Lines Matching full:eth

61 static u32 mtk_eth_timestamp(struct mtk_eth *eth)  in mtk_eth_timestamp()  argument
63 return mtk_r32(eth, 0x0010) & mtk_get_ib1_ts_mask(eth); in mtk_eth_timestamp()
112 if (mtk_is_netsys_v3_or_greater(ppe->eth)) { in mtk_mib_entry_read()
144 static u32 mtk_ppe_hash_entry(struct mtk_eth *eth, struct mtk_foe_entry *e) in mtk_ppe_hash_entry() argument
149 switch (mtk_get_ib1_pkt_type(eth, e->ib1)) { in mtk_ppe_hash_entry()
178 hash <<= (ffs(eth->soc->hash_offset) - 1); in mtk_ppe_hash_entry()
185 mtk_foe_entry_l2(struct mtk_eth *eth, struct mtk_foe_entry *entry) in mtk_foe_entry_l2() argument
187 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_l2()
199 mtk_foe_entry_ib2(struct mtk_eth *eth, struct mtk_foe_entry *entry) in mtk_foe_entry_ib2() argument
201 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_ib2()
212 int mtk_foe_entry_prepare(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_prepare() argument
221 if (mtk_is_netsys_v2_or_greater(eth)) { in mtk_foe_entry_prepare()
231 int port_mg = eth->soc->offload_version > 1 ? 0 : 0x3f; in mtk_foe_entry_prepare()
245 val |= mtk_get_ib2_multicast_mask(eth); in mtk_foe_entry_prepare()
279 int mtk_foe_entry_set_pse_port(struct mtk_eth *eth, in mtk_foe_entry_set_pse_port() argument
282 u32 *ib2 = mtk_foe_entry_ib2(eth, entry); in mtk_foe_entry_set_pse_port()
285 if (mtk_is_netsys_v2_or_greater(eth)) { in mtk_foe_entry_set_pse_port()
297 int mtk_foe_entry_set_ipv4_tuple(struct mtk_eth *eth, in mtk_foe_entry_set_ipv4_tuple() argument
302 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_set_ipv4_tuple()
337 int mtk_foe_entry_set_ipv6_tuple(struct mtk_eth *eth, in mtk_foe_entry_set_ipv6_tuple() argument
342 int type = mtk_get_ib1_pkt_type(eth, entry->ib1); in mtk_foe_entry_set_ipv6_tuple()
370 int mtk_foe_entry_set_dsa(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_dsa() argument
373 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_dsa()
377 if (!(entry->ib1 & mtk_get_ib1_vlan_layer_mask(eth))) in mtk_foe_entry_set_dsa()
378 entry->ib1 |= mtk_prep_ib1_vlan_layer(eth, 1); in mtk_foe_entry_set_dsa()
382 entry->ib1 &= ~mtk_get_ib1_vlan_tag_mask(eth); in mtk_foe_entry_set_dsa()
387 int mtk_foe_entry_set_vlan(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_vlan() argument
390 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_vlan()
392 switch (mtk_get_ib1_vlan_layer(eth, entry->ib1)) { in mtk_foe_entry_set_vlan()
394 entry->ib1 |= mtk_get_ib1_vlan_tag_mask(eth) | in mtk_foe_entry_set_vlan()
395 mtk_prep_ib1_vlan_layer(eth, 1); in mtk_foe_entry_set_vlan()
399 if (!(entry->ib1 & mtk_get_ib1_vlan_tag_mask(eth))) { in mtk_foe_entry_set_vlan()
404 entry->ib1 += mtk_prep_ib1_vlan_layer(eth, 1); in mtk_foe_entry_set_vlan()
412 int mtk_foe_entry_set_pppoe(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_pppoe() argument
415 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_pppoe()
417 if (!(entry->ib1 & mtk_get_ib1_vlan_layer_mask(eth)) || in mtk_foe_entry_set_pppoe()
418 (entry->ib1 & mtk_get_ib1_vlan_tag_mask(eth))) in mtk_foe_entry_set_pppoe()
421 entry->ib1 |= mtk_get_ib1_ppoe_mask(eth); in mtk_foe_entry_set_pppoe()
427 int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_wdma() argument
431 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry); in mtk_foe_entry_set_wdma()
432 u32 *ib2 = mtk_foe_entry_ib2(eth, entry); in mtk_foe_entry_set_wdma()
434 switch (eth->soc->version) { in mtk_foe_entry_set_wdma()
464 int mtk_foe_entry_set_queue(struct mtk_eth *eth, struct mtk_foe_entry *entry, in mtk_foe_entry_set_queue() argument
467 u32 *ib2 = mtk_foe_entry_ib2(eth, entry); in mtk_foe_entry_set_queue()
469 if (mtk_is_netsys_v2_or_greater(eth)) { in mtk_foe_entry_set_queue()
483 mtk_flow_entry_match(struct mtk_eth *eth, struct mtk_flow_entry *entry, in mtk_flow_entry_match() argument
491 type = mtk_get_ib1_pkt_type(eth, entry->data.ib1); in mtk_flow_entry_match()
544 u32 ib1_ts_mask = mtk_get_ib1_ts_mask(ppe->eth); in __mtk_foe_entry_idle_time()
545 u16 now = mtk_eth_timestamp(ppe->eth); in __mtk_foe_entry_idle_time()
557 u32 ib1_ts_mask = mtk_get_ib1_ts_mask(ppe->eth); in mtk_flow_entry_update_l2()
604 memcpy(&foe, hwe, ppe->eth->soc->foe_entry_size); in mtk_flow_entry_update()
605 if (!mtk_flow_entry_match(ppe->eth, entry, &foe)) { in mtk_flow_entry_update()
620 struct mtk_eth *eth = ppe->eth; in __mtk_foe_entry_commit() local
621 u16 timestamp = mtk_eth_timestamp(eth); in __mtk_foe_entry_commit()
625 if (mtk_is_netsys_v2_or_greater(eth)) { in __mtk_foe_entry_commit()
636 memcpy(&hwe->data, &entry->data, eth->soc->foe_entry_size - sizeof(hwe->ib1)); in __mtk_foe_entry_commit()
641 if (mtk_is_netsys_v2_or_greater(eth)) in __mtk_foe_entry_commit()
645 *mtk_foe_entry_ib2(eth, hwe) |= val; in __mtk_foe_entry_commit()
681 const struct mtk_soc_data *soc = ppe->eth->soc; in mtk_foe_entry_commit()
682 int type = mtk_get_ib1_pkt_type(ppe->eth, entry->data.ib1); in mtk_foe_entry_commit()
688 hash = mtk_ppe_hash_entry(ppe->eth, &entry->data); in mtk_foe_entry_commit()
701 const struct mtk_soc_data *soc = ppe->eth->soc; in mtk_foe_entry_commit_subflow()
705 u32 ib1_mask = mtk_get_ib1_pkt_type_mask(ppe->eth) | MTK_FOE_IB1_UDP; in mtk_foe_entry_commit_subflow()
724 l2 = mtk_foe_entry_l2(ppe->eth, &foe); in mtk_foe_entry_commit_subflow()
727 type = mtk_get_ib1_pkt_type(ppe->eth, foe.ib1); in mtk_foe_entry_commit_subflow()
733 *mtk_foe_entry_ib2(ppe->eth, &foe) = entry->data.bridge.ib2; in mtk_foe_entry_commit_subflow()
740 const struct mtk_soc_data *soc = ppe->eth->soc; in __mtk_ppe_check_skb()
766 if (found || !mtk_flow_entry_match(ppe->eth, entry, hwe)) { in __mtk_ppe_check_skb()
877 struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int index) in mtk_ppe_init() argument
879 bool accounting = eth->soc->has_accounting; in mtk_ppe_init()
880 const struct mtk_soc_data *soc = eth->soc; in mtk_ppe_init()
882 struct device *dev = eth->dev; in mtk_ppe_init()
898 ppe->eth = eth; in mtk_ppe_init()
900 ppe->version = eth->soc->offload_version; in mtk_ppe_init()
943 void mtk_ppe_deinit(struct mtk_eth *eth) in mtk_ppe_deinit() argument
947 for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) { in mtk_ppe_deinit()
948 if (!eth->ppe[i]) in mtk_ppe_deinit()
950 rhashtable_destroy(&eth->ppe[i]->l2_flows); in mtk_ppe_deinit()
960 MTK_PPE_ENTRIES * ppe->eth->soc->foe_entry_size); in mtk_ppe_init_foe_table()
1000 if (mtk_is_netsys_v2_or_greater(ppe->eth)) in mtk_ppe_start()
1002 if (!mtk_is_netsys_v3_or_greater(ppe->eth)) in mtk_ppe_start()
1018 if (mtk_is_netsys_v2_or_greater(ppe->eth)) in mtk_ppe_start()
1060 if (mtk_is_netsys_v2_or_greater(ppe->eth)) { in mtk_ppe_start()