Lines Matching refs:trap
1281 static void ocelot_populate_l2_ptp_trap_key(struct ocelot_vcap_filter *trap) in ocelot_populate_l2_ptp_trap_key() argument
1283 trap->key_type = OCELOT_VCAP_KEY_ETYPE; in ocelot_populate_l2_ptp_trap_key()
1284 *(__be16 *)trap->key.etype.etype.value = htons(ETH_P_1588); in ocelot_populate_l2_ptp_trap_key()
1285 *(__be16 *)trap->key.etype.etype.mask = htons(0xffff); in ocelot_populate_l2_ptp_trap_key()
1289 ocelot_populate_ipv4_ptp_event_trap_key(struct ocelot_vcap_filter *trap) in ocelot_populate_ipv4_ptp_event_trap_key() argument
1291 trap->key_type = OCELOT_VCAP_KEY_IPV4; in ocelot_populate_ipv4_ptp_event_trap_key()
1292 trap->key.ipv4.dport.value = PTP_EV_PORT; in ocelot_populate_ipv4_ptp_event_trap_key()
1293 trap->key.ipv4.dport.mask = 0xffff; in ocelot_populate_ipv4_ptp_event_trap_key()
1297 ocelot_populate_ipv6_ptp_event_trap_key(struct ocelot_vcap_filter *trap) in ocelot_populate_ipv6_ptp_event_trap_key() argument
1299 trap->key_type = OCELOT_VCAP_KEY_IPV6; in ocelot_populate_ipv6_ptp_event_trap_key()
1300 trap->key.ipv6.dport.value = PTP_EV_PORT; in ocelot_populate_ipv6_ptp_event_trap_key()
1301 trap->key.ipv6.dport.mask = 0xffff; in ocelot_populate_ipv6_ptp_event_trap_key()
1305 ocelot_populate_ipv4_ptp_general_trap_key(struct ocelot_vcap_filter *trap) in ocelot_populate_ipv4_ptp_general_trap_key() argument
1307 trap->key_type = OCELOT_VCAP_KEY_IPV4; in ocelot_populate_ipv4_ptp_general_trap_key()
1308 trap->key.ipv4.dport.value = PTP_GEN_PORT; in ocelot_populate_ipv4_ptp_general_trap_key()
1309 trap->key.ipv4.dport.mask = 0xffff; in ocelot_populate_ipv4_ptp_general_trap_key()
1313 ocelot_populate_ipv6_ptp_general_trap_key(struct ocelot_vcap_filter *trap) in ocelot_populate_ipv6_ptp_general_trap_key() argument
1315 trap->key_type = OCELOT_VCAP_KEY_IPV6; in ocelot_populate_ipv6_ptp_general_trap_key()
1316 trap->key.ipv6.dport.value = PTP_GEN_PORT; in ocelot_populate_ipv6_ptp_general_trap_key()
1317 trap->key.ipv6.dport.mask = 0xffff; in ocelot_populate_ipv6_ptp_general_trap_key()
1325 struct ocelot_vcap_filter *trap; in ocelot_trap_add() local
1331 trap = ocelot_vcap_block_find_filter_by_id(block_vcap_is2, cookie, in ocelot_trap_add()
1333 if (!trap) { in ocelot_trap_add()
1334 trap = kzalloc(sizeof(*trap), GFP_KERNEL); in ocelot_trap_add()
1335 if (!trap) in ocelot_trap_add()
1338 populate(trap); in ocelot_trap_add()
1339 trap->prio = 1; in ocelot_trap_add()
1340 trap->id.cookie = cookie; in ocelot_trap_add()
1341 trap->id.tc_offload = false; in ocelot_trap_add()
1342 trap->block_id = VCAP_IS2; in ocelot_trap_add()
1343 trap->type = OCELOT_VCAP_FILTER_OFFLOAD; in ocelot_trap_add()
1344 trap->lookup = 0; in ocelot_trap_add()
1345 trap->action.cpu_copy_ena = true; in ocelot_trap_add()
1346 trap->action.mask_mode = OCELOT_MASK_MODE_PERMIT_DENY; in ocelot_trap_add()
1347 trap->action.port_mask = 0; in ocelot_trap_add()
1351 trap->ingress_port_mask |= BIT(port); in ocelot_trap_add()
1354 err = ocelot_vcap_filter_add(ocelot, trap, NULL); in ocelot_trap_add()
1356 err = ocelot_vcap_filter_replace(ocelot, trap); in ocelot_trap_add()
1358 trap->ingress_port_mask &= ~BIT(port); in ocelot_trap_add()
1359 if (!trap->ingress_port_mask) in ocelot_trap_add()
1360 kfree(trap); in ocelot_trap_add()
1371 struct ocelot_vcap_filter *trap; in ocelot_trap_del() local
1375 trap = ocelot_vcap_block_find_filter_by_id(block_vcap_is2, cookie, in ocelot_trap_del()
1377 if (!trap) in ocelot_trap_del()
1380 trap->ingress_port_mask &= ~BIT(port); in ocelot_trap_del()
1381 if (!trap->ingress_port_mask) in ocelot_trap_del()
1382 return ocelot_vcap_filter_del(ocelot, trap); in ocelot_trap_del()
1384 return ocelot_vcap_filter_replace(ocelot, trap); in ocelot_trap_del()