target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl931x.c
static int rtl931x_pie_rule_del(struct rtl838x_switch_priv *priv, int index_from, int index_to)
{
	u32 v = (index_from << 1)| (index_to << 13 ) | BIT(0);

	pr_info("%s: from %d to %d\n", __func__, index_from, index_to);
	mutex_lock(&priv->reg_mutex);

	// Write from-to and execute bit into control register
	sw_w32(v, RTL931X_PIE_CLR_CTRL);

	// Wait until command has completed
	do {
	} while (sw_r32(RTL931X_PIE_CLR_CTRL) & BIT(0));

	mutex_unlock(&priv->reg_mutex);
	return 0;
}
/*
 * Delete a range of Packet Inspection Engine rules
 */
Delete a range of Packet Inspection Engine rules
Delete a range of Packet Inspection Engine rules
static int rtl931x_pie_rule_del(struct rtl838x_switch_priv *priv, int index_from, int index_to)
{
	u32 v = (index_from << 1)| (index_to << 13 ) | BIT(0);
	pr_info("%s: from %d to %d\n", __func__, index_from, index_to);
	mutex_lock(&priv->reg_mutex);
	sw_w32(v, RTL931X_PIE_CLR_CTRL);
	do {
	} while (sw_r32(RTL931X_PIE_CLR_CTRL) & BIT(0));
	mutex_unlock(&priv->reg_mutex);
	return 0;
}
static int rtl931x_pie_rule_del ( struct rtl838x_switch_priv * priv , int index_from , int index_to ) { u32 v = ( index_from << 1 ) | ( index_to << 13 ) | BIT ( 0 ) ; pr_info ( " \n " , __func__ , index_from , index_to ) ; mutex_lock ( & priv -> reg_mutex ) ; sw_w32 ( v , RTL931X_PIE_CLR_CTRL ) ; do { } while ( sw_r32 ( RTL931X_PIE_CLR_CTRL ) & BIT ( 0 ) ) ; mutex_unlock ( & priv -> reg_mutex ) ; return 0 ; }
Delete a range of Packet Inspection Engine rules
Delete a range of Packet Inspection Engine rules
// Write from-to and execute bit into control register // Wait until command has completed