target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/rtl931x.c
static void rtl931x_write_pie_templated(u32 r[], struct pie_rule *pr, enum template_field_id t[])
{
	int i;
	u16 data, data_m;

	for (i = 0; i < N_FIXED_FIELDS; i++) {
		rtl931x_pie_data_fill(t[i], pr, &data, &data_m);

		// On the RTL9300, the mask fields are not word aligned!
		if (!(i % 2)) {
			r[5 - i / 2] = data;
			r[12 - i / 2] |= ((u32)data_m << 8);
		} else {
			r[5 - i / 2] |= ((u32)data) << 16;
			r[12 - i / 2] |= ((u32)data_m) << 24;
			r[11 - i / 2] |= ((u32)data_m) >> 8;
		}
	}
}
/*
 * Reads the intermediate representation of the templated match-fields of the
 * PIE rule in the pie_rule structure and fills in the raw data fields in the
 * raw register space r[].
 * The register space configuration size is identical for the RTL8380/90 and RTL9300,
 * however the RTL931X has 2 more registers / fields and the physical field-ids are different
 * on all SoCs
 * On the RTL9300 the mask fields are not word-aligend!
 */
Reads the intermediate representation of the templated match-fields of the
PIE rule in the pie_rule structure and fills in the raw data fields in the
raw register space r[].
The register space configuration size is identical for the RTL8380/90 and RTL9300,
however the RTL931X has 2 more registers / fields and the physical field-ids are different
on all SoCs
On the RTL9300 the mask fields are not word-aligend!
Reads the intermediate representation of the templated match - fields of the PIE rule in the pie_rule structure and fills in the raw data fields in the raw register space r [] . The register space configuration size is identical for the RTL8380 / 90 and RTL9300 however the RTL931X has 2 more registers / fields and the physical field - ids are different on all SoCs On the RTL9300 the mask fields are not word - aligend!
static void rtl931x_write_pie_templated(u32 r[], struct pie_rule *pr, enum template_field_id t[])
{
	int i;
	u16 data, data_m;
	for (i = 0; i < N_FIXED_FIELDS; i++) {
		rtl931x_pie_data_fill(t[i], pr, &data, &data_m);
		if (!(i % 2)) {
			r[5 - i / 2] = data;
			r[12 - i / 2] |= ((u32)data_m << 8);
		} else {
			r[5 - i / 2] |= ((u32)data) << 16;
			r[12 - i / 2] |= ((u32)data_m) << 24;
			r[11 - i / 2] |= ((u32)data_m) >> 8;
		}
	}
}
static void rtl931x_write_pie_templated ( u32 r [ ] , struct pie_rule * pr , enum template_field_id t [ ] ) { int i ; u16 data , data_m ; for ( i = 0 ; i < N_FIXED_FIELDS ; i ++ ) { rtl931x_pie_data_fill ( t [ i ] , pr , & data , & data_m ) ; if ( ! ( i % 2 ) ) { r [ 5 - i / 2 ] = data ; r [ 12 - i / 2 ] |= ( ( u32 ) data_m << 8 ) ; } else { r [ 5 - i / 2 ] |= ( ( u32 ) data ) << 16 ; r [ 12 - i / 2 ] |= ( ( u32 ) data_m ) << 24 ; r [ 11 - i / 2 ] |= ( ( u32 ) data_m ) >> 8 ; } } }
Reads the intermediate representation of the templated match-fields of the
 PIE rule in the pie_rule structure and fills in the raw data fields in the
 raw register space r[].
Reads the intermediate representation of the templated match - fields of the PIE rule in the pie_rule structure and fills in the raw data fields in the raw register space r [] .
// On the RTL9300, the mask fields are not word aligned!