Lines Matching defs:eth

58 static u32 mtk_eth_timestamp(struct mtk_eth *eth)
60 return mtk_r32(eth, 0x0010) & mtk_get_ib1_ts_mask(eth);
109 if (mtk_is_netsys_v3_or_greater(ppe->eth)) {
141 static u32 mtk_ppe_hash_entry(struct mtk_eth *eth, struct mtk_foe_entry *e)
146 switch (mtk_get_ib1_pkt_type(eth, e->ib1)) {
175 hash <<= (ffs(eth->soc->hash_offset) - 1);
182 mtk_foe_entry_l2(struct mtk_eth *eth, struct mtk_foe_entry *entry)
184 int type = mtk_get_ib1_pkt_type(eth, entry->ib1);
196 mtk_foe_entry_ib2(struct mtk_eth *eth, struct mtk_foe_entry *entry)
198 int type = mtk_get_ib1_pkt_type(eth, entry->ib1);
209 int mtk_foe_entry_prepare(struct mtk_eth *eth, struct mtk_foe_entry *entry,
218 if (mtk_is_netsys_v2_or_greater(eth)) {
228 int port_mg = eth->soc->offload_version > 1 ? 0 : 0x3f;
242 val |= mtk_get_ib2_multicast_mask(eth);
276 int mtk_foe_entry_set_pse_port(struct mtk_eth *eth,
279 u32 *ib2 = mtk_foe_entry_ib2(eth, entry);
282 if (mtk_is_netsys_v2_or_greater(eth)) {
294 int mtk_foe_entry_set_ipv4_tuple(struct mtk_eth *eth,
299 int type = mtk_get_ib1_pkt_type(eth, entry->ib1);
334 int mtk_foe_entry_set_ipv6_tuple(struct mtk_eth *eth,
339 int type = mtk_get_ib1_pkt_type(eth, entry->ib1);
370 int mtk_foe_entry_set_dsa(struct mtk_eth *eth, struct mtk_foe_entry *entry,
373 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry);
377 if (!(entry->ib1 & mtk_get_ib1_vlan_layer_mask(eth)))
378 entry->ib1 |= mtk_prep_ib1_vlan_layer(eth, 1);
382 entry->ib1 &= ~mtk_get_ib1_vlan_tag_mask(eth);
387 int mtk_foe_entry_set_vlan(struct mtk_eth *eth, struct mtk_foe_entry *entry,
390 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry);
392 switch (mtk_get_ib1_vlan_layer(eth, entry->ib1)) {
394 entry->ib1 |= mtk_get_ib1_vlan_tag_mask(eth) |
395 mtk_prep_ib1_vlan_layer(eth, 1);
399 if (!(entry->ib1 & mtk_get_ib1_vlan_tag_mask(eth))) {
404 entry->ib1 += mtk_prep_ib1_vlan_layer(eth, 1);
412 int mtk_foe_entry_set_pppoe(struct mtk_eth *eth, struct mtk_foe_entry *entry,
415 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry);
417 if (!(entry->ib1 & mtk_get_ib1_vlan_layer_mask(eth)) ||
418 (entry->ib1 & mtk_get_ib1_vlan_tag_mask(eth)))
421 entry->ib1 |= mtk_get_ib1_ppoe_mask(eth);
427 int mtk_foe_entry_set_wdma(struct mtk_eth *eth, struct mtk_foe_entry *entry,
431 struct mtk_foe_mac_info *l2 = mtk_foe_entry_l2(eth, entry);
432 u32 *ib2 = mtk_foe_entry_ib2(eth, entry);
434 switch (eth->soc->version) {
464 int mtk_foe_entry_set_queue(struct mtk_eth *eth, struct mtk_foe_entry *entry,
467 u32 *ib2 = mtk_foe_entry_ib2(eth, entry);
469 if (mtk_is_netsys_v2_or_greater(eth)) {
483 mtk_flow_entry_match(struct mtk_eth *eth, struct mtk_flow_entry *entry,
491 type = mtk_get_ib1_pkt_type(eth, entry->data.ib1);
544 u32 ib1_ts_mask = mtk_get_ib1_ts_mask(ppe->eth);
545 u16 now = mtk_eth_timestamp(ppe->eth);
557 u32 ib1_ts_mask = mtk_get_ib1_ts_mask(ppe->eth);
604 memcpy(&foe, hwe, ppe->eth->soc->foe_entry_size);
605 if (!mtk_flow_entry_match(ppe->eth, entry, &foe)) {
620 struct mtk_eth *eth = ppe->eth;
621 u16 timestamp = mtk_eth_timestamp(eth);
625 if (mtk_is_netsys_v2_or_greater(eth)) {
636 memcpy(&hwe->data, &entry->data, eth->soc->foe_entry_size - sizeof(hwe->ib1));
641 if (mtk_is_netsys_v2_or_greater(eth))
645 *mtk_foe_entry_ib2(eth, hwe) |= val;
681 const struct mtk_soc_data *soc = ppe->eth->soc;
682 int type = mtk_get_ib1_pkt_type(ppe->eth, entry->data.ib1);
688 hash = mtk_ppe_hash_entry(ppe->eth, &entry->data);
701 const struct mtk_soc_data *soc = ppe->eth->soc;
705 u32 ib1_mask = mtk_get_ib1_pkt_type_mask(ppe->eth) | MTK_FOE_IB1_UDP;
724 l2 = mtk_foe_entry_l2(ppe->eth, &foe);
727 type = mtk_get_ib1_pkt_type(ppe->eth, foe.ib1);
733 *mtk_foe_entry_ib2(ppe->eth, &foe) = entry->data.bridge.ib2;
740 const struct mtk_soc_data *soc = ppe->eth->soc;
766 if (found || !mtk_flow_entry_match(ppe->eth, entry, hwe)) {
877 struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, int index)
879 bool accounting = eth->soc->has_accounting;
880 const struct mtk_soc_data *soc = eth->soc;
882 struct device *dev = eth->dev;
898 ppe->eth = eth;
900 ppe->version = eth->soc->offload_version;
943 void mtk_ppe_deinit(struct mtk_eth *eth)
947 for (i = 0; i < ARRAY_SIZE(eth->ppe); i++) {
948 if (!eth->ppe[i])
950 rhashtable_destroy(&eth->ppe[i]->l2_flows);
960 MTK_PPE_ENTRIES * ppe->eth->soc->foe_entry_size);
1000 if (mtk_is_netsys_v2_or_greater(ppe->eth))
1002 if (!mtk_is_netsys_v3_or_greater(ppe->eth))
1018 if (mtk_is_netsys_v2_or_greater(ppe->eth))
1060 if (mtk_is_netsys_v2_or_greater(ppe->eth)) {