Lines Matching full:tab
849 static void gfar_set_mask(u32 mask, struct filer_table *tab) in gfar_set_mask() argument
851 tab->fe[tab->index].ctrl = RQFCR_AND | RQFCR_PID_MASK | RQFCR_CMP_EXACT; in gfar_set_mask()
852 tab->fe[tab->index].prop = mask; in gfar_set_mask()
853 tab->index++; in gfar_set_mask()
857 static void gfar_set_parse_bits(u32 value, u32 mask, struct filer_table *tab) in gfar_set_parse_bits() argument
859 gfar_set_mask(mask, tab); in gfar_set_parse_bits()
860 tab->fe[tab->index].ctrl = RQFCR_CMP_EXACT | RQFCR_PID_PARSE | in gfar_set_parse_bits()
862 tab->fe[tab->index].prop = value; in gfar_set_parse_bits()
863 tab->index++; in gfar_set_parse_bits()
867 struct filer_table *tab) in gfar_set_general_attribute() argument
869 gfar_set_mask(mask, tab); in gfar_set_general_attribute()
870 tab->fe[tab->index].ctrl = RQFCR_CMP_EXACT | RQFCR_AND | flag; in gfar_set_general_attribute()
871 tab->fe[tab->index].prop = value; in gfar_set_general_attribute()
872 tab->index++; in gfar_set_general_attribute()
890 struct filer_table *tab) in gfar_set_attribute() argument
943 gfar_set_general_attribute(value, mask, flag, tab); in gfar_set_attribute()
949 struct filer_table *tab) in gfar_set_basic_ip() argument
953 RQFCR_PID_SIA, tab); in gfar_set_basic_ip()
956 RQFCR_PID_DIA, tab); in gfar_set_basic_ip()
959 RQFCR_PID_DPT, tab); in gfar_set_basic_ip()
962 RQFCR_PID_SPT, tab); in gfar_set_basic_ip()
963 gfar_set_attribute(value->tos, mask->tos, RQFCR_PID_TOS, tab); in gfar_set_basic_ip()
969 struct filer_table *tab) in gfar_set_user_ip() argument
973 RQFCR_PID_SIA, tab); in gfar_set_user_ip()
976 RQFCR_PID_DIA, tab); in gfar_set_user_ip()
977 gfar_set_attribute(value->tos, mask->tos, RQFCR_PID_TOS, tab); in gfar_set_user_ip()
978 gfar_set_attribute(value->proto, mask->proto, RQFCR_PID_L4P, tab); in gfar_set_user_ip()
981 RQFCR_PID_ARB, tab); in gfar_set_user_ip()
987 struct filer_table *tab) in gfar_set_ether() argument
1009 upper_temp_mask, RQFCR_PID_SAH, tab); in gfar_set_ether()
1014 lower_temp_mask, RQFCR_PID_SAL, tab); in gfar_set_ether()
1021 gfar_set_parse_bits(RQFPR_EBC, RQFPR_EBC, tab); in gfar_set_ether()
1039 upper_temp_mask, RQFCR_PID_DAH, tab); in gfar_set_ether()
1044 lower_temp_mask, RQFCR_PID_DAL, tab); in gfar_set_ether()
1050 RQFCR_PID_ETY, tab); in gfar_set_ether()
1087 struct filer_table *tab) in gfar_convert_to_filer() argument
1093 u32 old_index = tab->index; in gfar_convert_to_filer()
1122 RQFPR_IPV4 | RQFPR_TCP | vlan_mask, tab); in gfar_convert_to_filer()
1124 &rule->m_u.tcp_ip4_spec, tab); in gfar_convert_to_filer()
1128 RQFPR_IPV4 | RQFPR_UDP | vlan_mask, tab); in gfar_convert_to_filer()
1130 &rule->m_u.udp_ip4_spec, tab); in gfar_convert_to_filer()
1134 tab); in gfar_convert_to_filer()
1135 gfar_set_attribute(132, 0, RQFCR_PID_L4P, tab); in gfar_convert_to_filer()
1138 tab); in gfar_convert_to_filer()
1142 tab); in gfar_convert_to_filer()
1145 tab); in gfar_convert_to_filer()
1149 gfar_set_parse_bits(vlan, vlan_mask, tab); in gfar_convert_to_filer()
1151 (struct ethhdr *) &rule->m_u, tab); in gfar_convert_to_filer()
1159 gfar_set_attribute(id, id_mask, RQFCR_PID_VID, tab); in gfar_convert_to_filer()
1160 gfar_set_attribute(prio, prio_mask, RQFCR_PID_PRI, tab); in gfar_convert_to_filer()
1164 if (tab->index == old_index) { in gfar_convert_to_filer()
1165 gfar_set_mask(0xFFFFFFFF, tab); in gfar_convert_to_filer()
1166 tab->fe[tab->index].ctrl = 0x20; in gfar_convert_to_filer()
1167 tab->fe[tab->index].prop = 0x0; in gfar_convert_to_filer()
1168 tab->index++; in gfar_convert_to_filer()
1172 tab->fe[tab->index - 1].ctrl &= (~RQFCR_AND); in gfar_convert_to_filer()
1176 tab->fe[tab->index - 1].ctrl |= RQFCR_RJE; in gfar_convert_to_filer()
1178 tab->fe[tab->index - 1].ctrl |= (rule->ring_cookie << 10); in gfar_convert_to_filer()
1181 if (tab->index > (old_index + 2)) { in gfar_convert_to_filer()
1182 tab->fe[old_index + 1].ctrl |= RQFCR_CLE; in gfar_convert_to_filer()
1183 tab->fe[tab->index - 1].ctrl |= RQFCR_CLE; in gfar_convert_to_filer()
1189 if (tab->index > MAX_FILER_CACHE_IDX - 1) in gfar_convert_to_filer()
1197 struct filer_table *tab) in gfar_write_filer_table() argument
1200 if (tab->index > MAX_FILER_IDX - 1) in gfar_write_filer_table()
1204 for (; i < MAX_FILER_IDX && (tab->fe[i].ctrl | tab->fe[i].prop); i++) in gfar_write_filer_table()
1205 gfar_write_filer(priv, i, tab->fe[i].ctrl, tab->fe[i].prop); in gfar_write_filer_table()
1240 struct filer_table *tab; in gfar_process_filer_changes() local
1244 tab = kzalloc(sizeof(*tab), GFP_KERNEL); in gfar_process_filer_changes()
1245 if (tab == NULL) in gfar_process_filer_changes()
1252 ret = gfar_convert_to_filer(&j->fs, tab); in gfar_process_filer_changes()
1266 ret = gfar_write_filer_table(priv, tab); in gfar_process_filer_changes()
1273 kfree(tab); in gfar_process_filer_changes()