Lines Matching refs:eth

57 static u32 mtk_eth_timestamp(struct mtk_eth *eth)  in mtk_eth_timestamp()  argument
59 return mtk_r32(eth, 0x0010) & mtk_get_ib1_ts_mask(eth); in mtk_eth_timestamp()
91 static u32 mtk_ppe_hash_entry(struct mtk_eth *eth, struct mtk_foe_entry *e) in mtk_ppe_hash_entry() argument
96 switch (mtk_get_ib1_pkt_type(eth, e->ib1)) { in mtk_ppe_hash_entry()
125 hash <<= (ffs(eth->soc->hash_offset) - 1); in mtk_ppe_hash_entry()
132 mtk_foe_entry_l2(struct mtk_eth *eth, struct mtk_foe_entry *entry) in mtk_foe_entry_l2() argument
134 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_l2()
146 mtk_foe_entry_ib2(struct mtk_eth *eth, struct mtk_foe_entry *entry) in mtk_foe_entry_ib2() argument
148 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_ib2()
159 int mtk_foe_entry_prepare(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_prepare() argument
168 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { in mtk_foe_entry_prepare()
178 int port_mg = eth->soc->offload_version > 1 ? 0 : 0x3f; in mtk_foe_entry_prepare()
192 val |= mtk_get_ib2_multicast_mask(eth); in mtk_foe_entry_prepare()
226 int mtk_foe_entry_set_pse_port(struct mtk_eth *eth, in mtk_foe_entry_set_pse_port() argument
229 u32 *ib2 = mtk_foe_entry_ib2(eth, entry); in mtk_foe_entry_set_pse_port()
232 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { in mtk_foe_entry_set_pse_port()
244 int mtk_foe_entry_set_ipv4_tuple(struct mtk_eth *eth, in mtk_foe_entry_set_ipv4_tuple() argument
249 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_set_ipv4_tuple()
284 int mtk_foe_entry_set_ipv6_tuple(struct mtk_eth *eth, in mtk_foe_entry_set_ipv6_tuple() argument
289 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_set_ipv6_tuple()
320 int mtk_foe_entry_set_dsa(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_dsa() argument
323 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_dsa()
327 if (!(entry->ib1 & mtk_get_ib1_vlan_layer_mask(eth))) in mtk_foe_entry_set_dsa()
328 entry->ib1 |= mtk_prep_ib1_vlan_layer(eth, 1); in mtk_foe_entry_set_dsa()
332 entry->ib1 &= ~mtk_get_ib1_vlan_tag_mask(eth); in mtk_foe_entry_set_dsa()
337 int mtk_foe_entry_set_vlan(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_vlan() argument
340 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_vlan()
342 switch (mtk_get_ib1_vlan_layer(eth, entry->ib1)) { in mtk_foe_entry_set_vlan()
344 entry->ib1 |= mtk_get_ib1_vlan_tag_mask(eth) | in mtk_foe_entry_set_vlan()
345 mtk_prep_ib1_vlan_layer(eth, 1); in mtk_foe_entry_set_vlan()
349 if (!(entry->ib1 & mtk_get_ib1_vlan_tag_mask(eth))) { in mtk_foe_entry_set_vlan()
354 entry->ib1 += mtk_prep_ib1_vlan_layer(eth, 1); in mtk_foe_entry_set_vlan()
362 int mtk_foe_entry_set_pppoe(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_pppoe() argument
365 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_pppoe()
367 if (!(entry->ib1 & mtk_get_ib1_vlan_layer_mask(eth)) || in mtk_foe_entry_set_pppoe()
368 (entry->ib1 & mtk_get_ib1_vlan_tag_mask(eth))) in mtk_foe_entry_set_pppoe()
371 entry->ib1 |= mtk_get_ib1_ppoe_mask(eth); in mtk_foe_entry_set_pppoe()
377 int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_wdma() argument
380 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_wdma()
381 u32 *ib2 = mtk_foe_entry_ib2(eth, entry); in mtk_foe_entry_set_wdma()
383 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { in mtk_foe_entry_set_wdma()
402 int mtk_foe_entry_set_queue(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_queue() argument
405 u32 *ib2 = mtk_foe_entry_ib2(eth, entry); in mtk_foe_entry_set_queue()
407 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { in mtk_foe_entry_set_queue()
421 mtk_flow_entry_match(struct mtk_eth *eth, struct mtk_flow_entry *entry, in mtk_flow_entry_match() argument
429 type = mtk_get_ib1_pkt_type(eth, entry->data.ib1); in mtk_flow_entry_match()
473 u32 ib1_ts_mask = mtk_get_ib1_ts_mask(ppe->eth); in __mtk_foe_entry_idle_time()
474 u16 now = mtk_eth_timestamp(ppe->eth); in __mtk_foe_entry_idle_time()
486 u32 ib1_ts_mask = mtk_get_ib1_ts_mask(ppe->eth); in mtk_flow_entry_update_l2()
533 memcpy(&foe, hwe, ppe->eth->soc->foe_entry_size); in mtk_flow_entry_update()
534 if (!mtk_flow_entry_match(ppe->eth, entry, &foe)) { in mtk_flow_entry_update()
549 struct mtk_eth *eth = ppe->eth; in __mtk_foe_entry_commit() local
550 u16 timestamp = mtk_eth_timestamp(eth); in __mtk_foe_entry_commit()
553 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { in __mtk_foe_entry_commit()
564 memcpy(&hwe->data, &entry->data, eth->soc->foe_entry_size - sizeof(hwe->ib1)); in __mtk_foe_entry_commit()
591 const struct mtk_soc_data *soc = ppe->eth->soc; in mtk_foe_entry_commit()
592 int type = mtk_get_ib1_pkt_type(ppe->eth, entry->data.ib1); in mtk_foe_entry_commit()
598 hash = mtk_ppe_hash_entry(ppe->eth, &entry->data); in mtk_foe_entry_commit()
611 const struct mtk_soc_data *soc = ppe->eth->soc; in mtk_foe_entry_commit_subflow()
615 u32 ib1_mask = mtk_get_ib1_pkt_type_mask(ppe->eth) | MTK_FOE_IB1_UDP; in mtk_foe_entry_commit_subflow()
634 l2 = mtk_foe_entry_l2(ppe->eth, &foe); in mtk_foe_entry_commit_subflow()
637 type = mtk_get_ib1_pkt_type(ppe->eth, foe.ib1); in mtk_foe_entry_commit_subflow()
643 *mtk_foe_entry_ib2(ppe->eth, &foe) = entry->data.bridge.ib2; in mtk_foe_entry_commit_subflow()
650 const struct mtk_soc_data *soc = ppe->eth->soc; in __mtk_ppe_check_skb()
676 if (found || !mtk_flow_entry_match(ppe->eth, entry, hwe)) { in __mtk_ppe_check_skb()
759 struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, in mtk_ppe_init() argument
762 const struct mtk_soc_data *soc = eth->soc; in mtk_ppe_init()
763 struct device *dev = eth->dev; in mtk_ppe_init()
778 ppe->eth = eth; in mtk_ppe_init()
805 void mtk_ppe_deinit(struct mtk_eth *eth) in mtk_ppe_deinit() argument
809 for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) { in mtk_ppe_deinit()
810 if (!eth->ppe[i]) in mtk_ppe_deinit()
812 rhashtable_destroy(&eth->ppe[i]->l2_flows); in mtk_ppe_deinit()
822 MTK_PPE_ENTRIES * ppe->eth->soc->foe_entry_size); in mtk_ppe_init_foe_table()
863 if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2)) in mtk_ppe_start()
879 if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2)) in mtk_ppe_start()
921 if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2)) { in mtk_ppe_start()