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()
190 val |= mtk_get_ib2_multicast_mask(eth); in mtk_foe_entry_prepare()
224 int mtk_foe_entry_set_pse_port(struct mtk_eth *eth, in mtk_foe_entry_set_pse_port() argument
227 u32 *ib2 = mtk_foe_entry_ib2(eth, entry); in mtk_foe_entry_set_pse_port()
230 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { in mtk_foe_entry_set_pse_port()
242 int mtk_foe_entry_set_ipv4_tuple(struct mtk_eth *eth, in mtk_foe_entry_set_ipv4_tuple() argument
247 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_set_ipv4_tuple()
282 int mtk_foe_entry_set_ipv6_tuple(struct mtk_eth *eth, in mtk_foe_entry_set_ipv6_tuple() argument
287 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_set_ipv6_tuple()
318 int mtk_foe_entry_set_dsa(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_dsa() argument
321 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_dsa()
325 if (!(entry->ib1 & mtk_get_ib1_vlan_layer_mask(eth))) in mtk_foe_entry_set_dsa()
326 entry->ib1 |= mtk_prep_ib1_vlan_layer(eth, 1); in mtk_foe_entry_set_dsa()
330 entry->ib1 &= ~mtk_get_ib1_vlan_tag_mask(eth); in mtk_foe_entry_set_dsa()
335 int mtk_foe_entry_set_vlan(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_vlan() argument
338 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_vlan()
340 switch (mtk_get_ib1_vlan_layer(eth, entry->ib1)) { in mtk_foe_entry_set_vlan()
342 entry->ib1 |= mtk_get_ib1_vlan_tag_mask(eth) | in mtk_foe_entry_set_vlan()
343 mtk_prep_ib1_vlan_layer(eth, 1); in mtk_foe_entry_set_vlan()
347 if (!(entry->ib1 & mtk_get_ib1_vlan_tag_mask(eth))) { in mtk_foe_entry_set_vlan()
352 entry->ib1 += mtk_prep_ib1_vlan_layer(eth, 1); in mtk_foe_entry_set_vlan()
360 int mtk_foe_entry_set_pppoe(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_pppoe() argument
363 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_pppoe()
365 if (!(entry->ib1 & mtk_get_ib1_vlan_layer_mask(eth)) || in mtk_foe_entry_set_pppoe()
366 (entry->ib1 & mtk_get_ib1_vlan_tag_mask(eth))) in mtk_foe_entry_set_pppoe()
369 entry->ib1 |= mtk_get_ib1_ppoe_mask(eth); in mtk_foe_entry_set_pppoe()
375 int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_wdma() argument
378 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_wdma()
379 u32 *ib2 = mtk_foe_entry_ib2(eth, entry); in mtk_foe_entry_set_wdma()
381 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { in mtk_foe_entry_set_wdma()
401 mtk_flow_entry_match(struct mtk_eth *eth, struct mtk_flow_entry *entry, in mtk_flow_entry_match() argument
409 type = mtk_get_ib1_pkt_type(eth, entry->data.ib1); in mtk_flow_entry_match()
453 u32 ib1_ts_mask = mtk_get_ib1_ts_mask(ppe->eth); in __mtk_foe_entry_idle_time()
454 u16 now = mtk_eth_timestamp(ppe->eth); in __mtk_foe_entry_idle_time()
466 u32 ib1_ts_mask = mtk_get_ib1_ts_mask(ppe->eth); in mtk_flow_entry_update_l2()
513 memcpy(&foe, hwe, ppe->eth->soc->foe_entry_size); in mtk_flow_entry_update()
514 if (!mtk_flow_entry_match(ppe->eth, entry, &foe)) { in mtk_flow_entry_update()
529 struct mtk_eth *eth = ppe->eth; in __mtk_foe_entry_commit() local
530 u16 timestamp = mtk_eth_timestamp(eth); in __mtk_foe_entry_commit()
533 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { in __mtk_foe_entry_commit()
544 memcpy(&hwe->data, &entry->data, eth->soc->foe_entry_size - sizeof(hwe->ib1)); in __mtk_foe_entry_commit()
571 const struct mtk_soc_data *soc = ppe->eth->soc; in mtk_foe_entry_commit()
572 int type = mtk_get_ib1_pkt_type(ppe->eth, entry->data.ib1); in mtk_foe_entry_commit()
578 hash = mtk_ppe_hash_entry(ppe->eth, &entry->data); in mtk_foe_entry_commit()
591 const struct mtk_soc_data *soc = ppe->eth->soc; in mtk_foe_entry_commit_subflow()
595 u32 ib1_mask = mtk_get_ib1_pkt_type_mask(ppe->eth) | MTK_FOE_IB1_UDP; in mtk_foe_entry_commit_subflow()
615 l2 = mtk_foe_entry_l2(ppe->eth, &foe); in mtk_foe_entry_commit_subflow()
618 type = mtk_get_ib1_pkt_type(ppe->eth, foe.ib1); in mtk_foe_entry_commit_subflow()
624 *mtk_foe_entry_ib2(ppe->eth, &foe) = entry->data.bridge.ib2; in mtk_foe_entry_commit_subflow()
631 const struct mtk_soc_data *soc = ppe->eth->soc; in __mtk_ppe_check_skb()
657 if (found || !mtk_flow_entry_match(ppe->eth, entry, hwe)) { in __mtk_ppe_check_skb()
713 struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, in mtk_ppe_init() argument
716 const struct mtk_soc_data *soc = eth->soc; in mtk_ppe_init()
717 struct device *dev = eth->dev; in mtk_ppe_init()
732 ppe->eth = eth; in mtk_ppe_init()
759 void mtk_ppe_deinit(struct mtk_eth *eth) in mtk_ppe_deinit() argument
763 for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) { in mtk_ppe_deinit()
764 if (!eth->ppe[i]) in mtk_ppe_deinit()
766 rhashtable_destroy(ð->ppe[i]->l2_flows); in mtk_ppe_deinit()
776 MTK_PPE_ENTRIES * ppe->eth->soc->foe_entry_size); in mtk_ppe_init_foe_table()
817 if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2)) in mtk_ppe_start()
833 if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2)) in mtk_ppe_start()
875 if (MTK_HAS_CAPS(ppe->eth->soc->caps, MTK_NETSYS_V2)) { in mtk_ppe_start()