/Linux-v6.1/drivers/net/ethernet/mediatek/ |
D | mtk_eth_soc.c | 176 void mtk_w32(struct mtk_eth *eth, u32 val, unsigned reg) in mtk_w32() argument 178 __raw_writel(val, eth->base + reg); in mtk_w32() 181 u32 mtk_r32(struct mtk_eth *eth, unsigned reg) in mtk_r32() argument 183 return __raw_readl(eth->base + reg); in mtk_r32() 186 static u32 mtk_m32(struct mtk_eth *eth, u32 mask, u32 set, unsigned reg) in mtk_m32() argument 190 val = mtk_r32(eth, reg); in mtk_m32() 193 mtk_w32(eth, val, reg); in mtk_m32() 197 static int mtk_mdio_busy_wait(struct mtk_eth *eth) in mtk_mdio_busy_wait() argument 202 if (!(mtk_r32(eth, MTK_PHY_IAC) & PHY_IAC_ACCESS)) in mtk_mdio_busy_wait() 209 dev_err(eth->dev, "mdio: MDIO timeout\n"); in mtk_mdio_busy_wait() [all …]
|
D | mtk_eth_path.c | 18 int (*set_path)(struct mtk_eth *eth, int path); 43 static int set_mux_gdm1_to_gmac1_esw(struct mtk_eth *eth, int path) in set_mux_gdm1_to_gmac1_esw() argument 63 val = mtk_r32(eth, MTK_MAC_MISC); in set_mux_gdm1_to_gmac1_esw() 65 mtk_w32(eth, val, MTK_MAC_MISC); in set_mux_gdm1_to_gmac1_esw() 68 dev_dbg(eth->dev, "path %s in %s updated = %d\n", in set_mux_gdm1_to_gmac1_esw() 74 static int set_mux_gmac2_gmac0_to_gephy(struct mtk_eth *eth, int path) in set_mux_gmac2_gmac0_to_gephy() argument 89 regmap_update_bits(eth->infra, INFRA_MISC2, GEPHY_MAC_SEL, val); in set_mux_gmac2_gmac0_to_gephy() 91 dev_dbg(eth->dev, "path %s in %s updated = %d\n", in set_mux_gmac2_gmac0_to_gephy() 97 static int set_mux_u3_gmac2_to_qphy(struct mtk_eth *eth, int path) in set_mux_u3_gmac2_to_qphy() argument 112 regmap_update_bits(eth->infra, INFRA_MISC2, CO_QPHY_SEL, val); in set_mux_u3_gmac2_to_qphy() [all …]
|
D | mtk_ppe_offload.c | 17 struct ethhdr eth; member 55 mtk_flow_set_ipv4_addr(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_ipv4_addr() argument 58 return mtk_foe_entry_set_ipv4_tuple(eth, foe, egress, in mtk_flow_set_ipv4_addr() 64 mtk_flow_set_ipv6_addr(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_ipv6_addr() argument 67 return mtk_foe_entry_set_ipv6_tuple(eth, foe, in mtk_flow_set_ipv6_addr() 73 mtk_flow_offload_mangle_eth(const struct flow_action_entry *act, void *eth) in mtk_flow_offload_mangle_eth() argument 75 void *dest = eth + act->mangle.offset; in mtk_flow_offload_mangle_eth() 186 mtk_flow_set_output_device(struct mtk_eth *eth, struct mtk_foe_entry *foe, in mtk_flow_set_output_device() argument 194 mtk_foe_entry_set_wdma(eth, foe, info.wdma_idx, info.queue, in mtk_flow_set_output_device() 196 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { in mtk_flow_set_output_device() [all …]
|
D | mtk_ppe.c | 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 [all …]
|
D | mtk_eth_soc.h | 281 #define TX_DMA_PLEN0(x) (((x) & eth->soc->txrx.dma_max_len) << eth->soc->txrx.dma_len_offset) 282 #define TX_DMA_PLEN1(x) ((x) & eth->soc->txrx.dma_max_len) 293 #define RX_DMA_PREP_PLEN0(x) (((x) & eth->soc->txrx.dma_max_len) << eth->soc->txrx.dma_len_offset) 294 #define RX_DMA_GET_PLEN0(x) (((x) >> eth->soc->txrx.dma_len_offset) & eth->soc->txrx.dma_max_len) 1151 const struct mtk_soc_data *soc = ppe->eth->soc; in mtk_foe_get_entry() 1156 static inline u32 mtk_get_ib1_ts_mask(struct mtk_eth *eth) in mtk_get_ib1_ts_mask() argument 1158 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) in mtk_get_ib1_ts_mask() 1164 static inline u32 mtk_get_ib1_ppoe_mask(struct mtk_eth *eth) in mtk_get_ib1_ppoe_mask() argument 1166 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) in mtk_get_ib1_ppoe_mask() 1172 static inline u32 mtk_get_ib1_vlan_tag_mask(struct mtk_eth *eth) in mtk_get_ib1_vlan_tag_mask() argument [all …]
|
D | mtk_ppe.h | 288 struct mtk_eth *eth; member 305 struct mtk_ppe *mtk_ppe_init(struct mtk_eth *eth, void __iomem *base, 307 void mtk_ppe_deinit(struct mtk_eth *eth); 333 int mtk_foe_entry_prepare(struct mtk_eth *eth, struct mtk_foe_entry *entry, 336 int mtk_foe_entry_set_pse_port(struct mtk_eth *eth, 338 int mtk_foe_entry_set_ipv4_tuple(struct mtk_eth *eth, 342 int mtk_foe_entry_set_ipv6_tuple(struct mtk_eth *eth, 346 int mtk_foe_entry_set_dsa(struct mtk_eth *eth, struct mtk_foe_entry *entry, 348 int mtk_foe_entry_set_vlan(struct mtk_eth *eth, struct mtk_foe_entry *entry, 350 int mtk_foe_entry_set_pppoe(struct mtk_eth *eth, struct mtk_foe_entry *entry, [all …]
|
/Linux-v6.1/samples/bpf/ |
D | tc_l2_redirect_kern.c | 63 struct eth_hdr *eth = data; in _l2_to_iptun_ingress_forward() local 69 if (data + sizeof(*eth) > data_end) in _l2_to_iptun_ingress_forward() 76 if (eth->h_proto == htons(ETH_P_IP)) { in _l2_to_iptun_ingress_forward() 78 struct iphdr *iph = data + sizeof(*eth); in _l2_to_iptun_ingress_forward() 80 if (data + sizeof(*eth) + sizeof(*iph) > data_end) in _l2_to_iptun_ingress_forward() 89 } else if (eth->h_proto == htons(ETH_P_IPV6)) { in _l2_to_iptun_ingress_forward() 91 struct ipv6hdr *ip6h = data + sizeof(*eth); in _l2_to_iptun_ingress_forward() 93 if (data + sizeof(*eth) + sizeof(*ip6h) > data_end) in _l2_to_iptun_ingress_forward() 114 struct eth_hdr *eth = data; in _l2_to_iptun_ingress_redirect() local 120 if (data + sizeof(*eth) > data_end) in _l2_to_iptun_ingress_redirect() [all …]
|
D | xdp_redirect_cpu.bpf.c | 52 bool parse_eth(struct ethhdr *eth, void *data_end, in parse_eth() argument 58 offset = sizeof(*eth); in parse_eth() 59 if ((void *)eth + offset > data_end) in parse_eth() 62 eth_type = eth->h_proto; in parse_eth() 73 vlan_hdr = (void *)eth + offset; in parse_eth() 75 if ((void *)eth + offset > data_end) in parse_eth() 84 vlan_hdr = (void *)eth + offset; in parse_eth() 86 if ((void *)eth + offset > data_end) in parse_eth() 173 struct ethhdr *eth = data; in xdp_prognum1_touch_data() local 187 if (eth + 1 > data_end) in xdp_prognum1_touch_data() [all …]
|
D | parse_simple.c | 30 struct eth_hdr *eth = data; in handle_ingress() local 31 struct iphdr *iph = data + sizeof(*eth); in handle_ingress() 32 struct udphdr *udp = data + sizeof(*eth) + sizeof(*iph); in handle_ingress() 36 if (data + sizeof(*eth) + sizeof(*iph) + sizeof(*udp) > data_end) in handle_ingress() 39 if (eth->h_proto != htons(ETH_P_IP)) in handle_ingress()
|
D | xdp_adjust_tail_kern.c | 50 struct ethhdr *eth; in swap_mac() local 52 eth = data; in swap_mac() 53 memcpy(eth->h_source, orig_eth->h_dest, ETH_ALEN); in swap_mac() 54 memcpy(eth->h_dest, orig_eth->h_source, ETH_ALEN); in swap_mac() 55 eth->h_proto = orig_eth->h_proto; in swap_mac() 141 struct ethhdr *eth = data; in _xdp_icmp() local 144 if (eth + 1 > data_end) in _xdp_icmp() 147 h_proto = eth->h_proto; in _xdp_icmp()
|
D | test_cgrp2_tc_kern.c | 45 struct eth_hdr *eth = data; in handle_egress() local 46 struct ipv6hdr *ip6h = data + sizeof(*eth); in handle_egress() 53 if (data + sizeof(*eth) + sizeof(*ip6h) > data_end) in handle_egress() 56 if (eth->h_proto != htons(ETH_P_IPV6) || in handle_egress() 59 eth->h_proto, ip6h->nexthdr); in handle_egress()
|
D | xdp_redirect_map.bpf.c | 43 struct ethhdr *eth = data; in xdp_redirect_map() local 47 nh_off = sizeof(*eth); in xdp_redirect_map() 77 struct ethhdr *eth = data; in xdp_redirect_map_egress() local 80 nh_off = sizeof(*eth); in xdp_redirect_map_egress() 85 __builtin_memcpy(eth->h_source, mac_addr, ETH_ALEN); in xdp_redirect_map_egress()
|
/Linux-v6.1/net/ethernet/ |
D | eth.c | 83 struct ethhdr *eth = skb_push(skb, ETH_HLEN); in eth_header() local 86 eth->h_proto = htons(type); in eth_header() 88 eth->h_proto = htons(len); in eth_header() 96 memcpy(eth->h_source, saddr, ETH_ALEN); in eth_header() 99 memcpy(eth->h_dest, daddr, ETH_ALEN); in eth_header() 108 eth_zero_addr(eth->h_dest); in eth_header() 128 const struct ethhdr *eth = (const struct ethhdr *)data; in eth_get_headlen() local 132 if (unlikely(len < sizeof(*eth))) in eth_get_headlen() 137 eth->h_proto, sizeof(*eth), in eth_get_headlen() 139 return max_t(u32, keys.control.thoff, sizeof(*eth)); in eth_get_headlen() [all …]
|
/Linux-v6.1/drivers/net/ethernet/freescale/dpaa2/ |
D | Makefile | 6 obj-$(CONFIG_FSL_DPAA2_ETH) += fsl-dpaa2-eth.o 10 fsl-dpaa2-eth-objs := dpaa2-eth.o dpaa2-ethtool.o dpni.o dpaa2-mac.o dpmac.o dpaa2-eth-devlink.o 11 fsl-dpaa2-eth-${CONFIG_FSL_DPAA2_ETH_DCB} += dpaa2-eth-dcb.o 12 fsl-dpaa2-eth-${CONFIG_DEBUG_FS} += dpaa2-eth-debugfs.o 17 CFLAGS_dpaa2-eth.o := -I$(src)
|
/Linux-v6.1/drivers/infiniband/hw/mlx4/ |
D | ah.c | 93 memcpy(ah->av.eth.mac, ah_attr->roce.dmac, ETH_ALEN); in create_iboe_ah() 94 eth_zero_addr(ah->av.eth.s_mac); in create_iboe_ah() 103 &ah->av.eth.s_mac[0]); in create_iboe_ah() 110 ah->av.eth.gid_index = ret; in create_iboe_ah() 113 ah->av.eth.gid_index = ah_attr->grh.sgid_index; in create_iboe_ah() 118 ah->av.eth.port_pd = cpu_to_be32(to_mpd(ib_ah->pd)->pdn | in create_iboe_ah() 120 ah->av.eth.vlan = cpu_to_be16(vlan_tag); in create_iboe_ah() 121 ah->av.eth.hop_limit = grh->hop_limit; in create_iboe_ah() 123 ah->av.eth.stat_rate = rdma_ah_get_static_rate(ah_attr) + in create_iboe_ah() 125 while (ah->av.eth.stat_rate > IB_RATE_2_5_GBPS + MLX4_STAT_RATE_OFFSET && in create_iboe_ah() [all …]
|
/Linux-v6.1/tools/testing/selftests/bpf/progs/ |
D | xdping_kern.c | 63 struct ethhdr *eth = data; in icmp_check() local 67 if (data + sizeof(*eth) + sizeof(*iph) + ICMP_ECHO_LEN > data_end) in icmp_check() 70 if (eth->h_proto != bpf_htons(ETH_P_IP)) in icmp_check() 73 iph = data + sizeof(*eth); in icmp_check() 81 icmph = data + sizeof(*eth) + sizeof(*iph); in icmp_check() 95 struct ethhdr *eth = data; in xdping_client() local 109 iph = data + sizeof(*eth); in xdping_client() 110 icmph = data + sizeof(*eth) + sizeof(*iph); in xdping_client() 158 struct ethhdr *eth = data; in xdping_server() local 169 iph = data + sizeof(*eth); in xdping_server() [all …]
|
D | xdp_redirect_multi_kern.c | 43 struct ethhdr *eth = data; in xdp_redirect_map_multi_prog() local 47 nh_off = sizeof(*eth); in xdp_redirect_map_multi_prog() 51 h_proto = eth->h_proto; in xdp_redirect_map_multi_prog() 79 struct ethhdr *eth = data; in xdp_devmap_prog() local 83 nh_off = sizeof(*eth); in xdp_devmap_prog() 89 __builtin_memcpy(eth->h_source, mac, ETH_ALEN); in xdp_devmap_prog()
|
D | test_pkt_access.c | 102 struct ethhdr *eth = (struct ethhdr *)(data); in test_pkt_access() local 107 if (eth + 1 > data_end) in test_pkt_access() 110 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in test_pkt_access() 111 struct iphdr *iph = (struct iphdr *)(eth + 1); in test_pkt_access() 118 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in test_pkt_access() 119 struct ipv6hdr *ip6h = (struct ipv6hdr *)(eth + 1); in test_pkt_access()
|
D | test_sk_assign.c | 48 struct ethhdr *eth; in get_tuple() local 53 eth = (struct ethhdr *)(data); in get_tuple() 54 if (eth + 1 > data_end) in get_tuple() 57 if (eth->h_proto == bpf_htons(ETH_P_IP)) { in get_tuple() 58 struct iphdr *iph = (struct iphdr *)(data + sizeof(*eth)); in get_tuple() 69 } else if (eth->h_proto == bpf_htons(ETH_P_IPV6)) { in get_tuple() 70 struct ipv6hdr *ip6h = (struct ipv6hdr *)(data + sizeof(*eth)); in get_tuple()
|
/Linux-v6.1/drivers/net/ethernet/sgi/ |
D | meth.c | 109 mace->eth.mac_addr = macaddr; in load_eaddr() 116 while ((___rval = mace->eth.phy_data) & MDIO_BUSY) { \ 124 mace->eth.phy_regs = (priv->phy_addr << 5) | (phyreg & 0x1f); in mdio_read() 126 mace->eth.phy_trans_go = 1; in mdio_read() 195 mace->eth.mac_ctrl = priv->mac_ctrl; in meth_check_link() 204 mace->eth.mac_ctrl = priv->mac_ctrl; in meth_check_link() 218 mace->eth.tx_ring_base = priv->tx_ring_dma; in meth_init_tx_ring() 239 mace->eth.rx_fifo = priv->rx_ring_dmas[i]; in meth_init_rx_ring() 276 mace->eth.mac_ctrl = SGI_MAC_RESET; in meth_reset() 278 mace->eth.mac_ctrl = 0; in meth_reset() [all …]
|
/Linux-v6.1/drivers/net/wireless/marvell/mwifiex/ |
D | sta_rx.c | 27 struct ethhdr *eth; in mwifiex_discard_gratuitous_arp() local 31 eth = (struct ethhdr *)skb->data; in mwifiex_discard_gratuitous_arp() 32 switch (ntohs(eth->h_proto)) { in mwifiex_discard_gratuitous_arp() 78 struct ethhdr *eth; in mwifiex_process_rx_packet() local 104 eth = (struct ethhdr *) in mwifiex_process_rx_packet() 112 memcpy(eth->h_source, rx_pkt_hdr->eth803_hdr.h_source, in mwifiex_process_rx_packet() 113 sizeof(eth->h_source)); in mwifiex_process_rx_packet() 114 memcpy(eth->h_dest, rx_pkt_hdr->eth803_hdr.h_dest, in mwifiex_process_rx_packet() 115 sizeof(eth->h_dest)); in mwifiex_process_rx_packet() 119 hdr_chop = (u8 *) eth - (u8 *) local_rx_pd; in mwifiex_process_rx_packet()
|
/Linux-v6.1/arch/mips/cavium-octeon/ |
D | octeon-platform.c | 481 static void __init octeon_fdt_set_phy(int eth, int phy_addr) in octeon_fdt_set_phy() argument 493 phy_handle = fdt_getprop(initial_boot_params, eth, "phy-handle", NULL); in octeon_fdt_set_phy() 500 alt_phy_handle = fdt_getprop(initial_boot_params, eth, "cavium,alt-phy-handle", NULL); in octeon_fdt_set_phy() 511 fdt_nop_property(initial_boot_params, eth, "phy-handle"); in octeon_fdt_set_phy() 513 fdt_nop_property(initial_boot_params, eth, "cavium,alt-phy-handle"); in octeon_fdt_set_phy() 527 phy_prop = fdt_get_property(initial_boot_params, eth, "phy-handle", NULL); in octeon_fdt_set_phy() 530 fdt_nop_property(initial_boot_params, eth, "phy-handle"); in octeon_fdt_set_phy() 531 alt_prop = fdt_get_property_w(initial_boot_params, eth, "cavium,alt-phy-handle", NULL); in octeon_fdt_set_phy() 609 static void __init _octeon_rx_tx_delay(int eth, int rx_delay, int tx_delay) in _octeon_rx_tx_delay() argument 611 fdt_setprop_inplace_cell(initial_boot_params, eth, "rx-delay", in _octeon_rx_tx_delay() [all …]
|
/Linux-v6.1/arch/arm/mach-at91/ |
D | pm.c | 110 struct at91_pm_quirk_eth eth[AT91_PM_MAX_ETH]; member 320 static bool at91_pm_eth_quirk_is_valid(struct at91_pm_quirk_eth *eth) in at91_pm_eth_quirk_is_valid() argument 325 if (!eth->np) in at91_pm_eth_quirk_is_valid() 329 if (!(eth->modes & BIT(soc_pm.data.mode))) in at91_pm_eth_quirk_is_valid() 332 if (!eth->dev) { in at91_pm_eth_quirk_is_valid() 334 pdev = of_find_device_by_node(eth->np); in at91_pm_eth_quirk_is_valid() 337 eth->dev = &pdev->dev; in at91_pm_eth_quirk_is_valid() 341 if (!device_may_wakeup(eth->dev)) { in at91_pm_eth_quirk_is_valid() 342 put_device(eth->dev); in at91_pm_eth_quirk_is_valid() 352 struct at91_pm_quirk_eth *eth; in at91_pm_config_quirks() local [all …]
|
/Linux-v6.1/drivers/infiniband/hw/ocrdma/ |
D | ocrdma_ah.c | 78 struct ocrdma_eth_vlan eth; in set_av_attr() local 90 memset(ð, 0, sizeof(eth)); in set_av_attr() 108 eth.eth_type = cpu_to_be16(0x8100); in set_av_attr() 109 eth.roce_eth_type = cpu_to_be16(proto_num); in set_av_attr() 111 eth.vlan_tag = cpu_to_be16(vlan_tag); in set_av_attr() 115 eth.eth_type = cpu_to_be16(proto_num); in set_av_attr() 119 memcpy(ð.smac[0], &dev->nic_info.mac_addr[0], ETH_ALEN); in set_av_attr() 120 status = ocrdma_resolve_dmac(dev, attr, ð.dmac[0]); in set_av_attr() 126 memcpy(&ah->av->eth_hdr, ð, eth_sz); in set_av_attr()
|
/Linux-v6.1/tools/testing/selftests/bpf/prog_tests/ |
D | flow_dissector.c | 45 struct ethhdr eth; member 51 struct ethhdr eth; member 58 struct ethhdr eth; member 66 struct ethhdr eth; member 72 struct ethhdr eth; member 84 struct ethhdr eth; member 115 .eth.h_proto = __bpf_constant_htons(ETH_P_IP), 137 .eth.h_proto = __bpf_constant_htons(ETH_P_IPV6), 158 .eth.h_proto = __bpf_constant_htons(ETH_P_8021Q), 181 .eth.h_proto = __bpf_constant_htons(ETH_P_8021AD), [all …]
|