Lines Matching refs:bits
23 #define BITMASK(bits) (BIT(bits) - 1) argument
105 static inline int cpsw_ale_get_field(u32 *ale_entry, u32 start, u32 bits) in cpsw_ale_get_field() argument
111 idx2 = (start + bits - 1) / 32; in cpsw_ale_get_field()
119 return (hi_val + (ale_entry[idx] >> start)) & BITMASK(bits); in cpsw_ale_get_field()
122 static inline void cpsw_ale_set_field(u32 *ale_entry, u32 start, u32 bits, in cpsw_ale_set_field() argument
127 value &= BITMASK(bits); in cpsw_ale_set_field()
129 idx2 = (start + bits - 1) / 32; in cpsw_ale_set_field()
133 ale_entry[idx2] &= ~(BITMASK(bits + start - (idx2 * 32))); in cpsw_ale_set_field()
138 ale_entry[idx] &= ~(BITMASK(bits) << start); in cpsw_ale_set_field()
142 #define DEFINE_ALE_FIELD(name, start, bits) \ argument
145 return cpsw_ale_get_field(ale_entry, start, bits); \
149 cpsw_ale_set_field(ale_entry, start, bits, value); \
153 static inline int cpsw_ale_get_##name(u32 *ale_entry, u32 bits) \
155 return cpsw_ale_get_field(ale_entry, start, bits); \
158 u32 bits) \
160 cpsw_ale_set_field(ale_entry, start, bits, value); \
177 #define ALE_ENTRY_FLD(id, start, bits) \ argument
180 .num_bits = bits, \
235 u32 bits; in cpsw_ale_entry_get_fld() local
246 bits = entry_fld->num_bits; in cpsw_ale_entry_get_fld()
248 bits = ale->port_mask_bits; in cpsw_ale_entry_get_fld()
250 return cpsw_ale_get_field(ale_entry, entry_fld->start_bit, bits); in cpsw_ale_entry_get_fld()
260 u32 bits; in cpsw_ale_entry_set_fld() local
271 bits = entry_fld->num_bits; in cpsw_ale_entry_set_fld()
273 bits = ale->port_mask_bits; in cpsw_ale_entry_set_fld()
275 cpsw_ale_set_field(ale_entry, entry_fld->start_bit, bits, value); in cpsw_ale_entry_set_fld()
877 int bits; member
887 .bits = 1,
895 .bits = 1,
903 .bits = 1,
911 .bits = 1,
919 .bits = 1,
927 .bits = 1,
935 .bits = 1,
943 .bits = 1,
951 .bits = 1,
959 .bits = 1,
967 .bits = 1,
975 .bits = 1,
983 .bits = 2,
991 .bits = 1,
999 .bits = 1,
1007 .bits = 1,
1015 .bits = 1,
1023 .bits = 1,
1031 .bits = 1,
1039 .bits = 8,
1047 .bits = 8,
1055 .bits = 6,
1063 .bits = 6,
1071 .bits = 6,
1079 .bits = 6,
1087 .bits = 6,
1095 .bits = 1,
1116 mask = BITMASK(info->bits); in cpsw_ale_control_set()
1150 return tmp & BITMASK(info->bits); in cpsw_ale_control_get()
1368 ale_controls[ALE_PORT_UNKNOWN_VLAN_MEMBER].bits = in cpsw_ale_create()
1372 ale_controls[ALE_PORT_UNKNOWN_MCAST_FLOOD].bits = in cpsw_ale_create()
1377 ale_controls[ALE_PORT_UNKNOWN_REG_MCAST_FLOOD].bits = in cpsw_ale_create()
1382 ale_controls[ALE_PORT_UNTAGGED_EGRESS].bits = in cpsw_ale_create()