diff --git a/sys/dev/e1000/e1000_82540.c b/sys/dev/e1000/e1000_82540.c index d90c8f9b73f1..adc944a8ebb4 100644 --- a/sys/dev/e1000/e1000_82540.c +++ b/sys/dev/e1000/e1000_82540.c @@ -696,7 +696,7 @@ s32 e1000_read_mac_addr_82540(struct e1000_hw *hw) DEBUGFUNC("e1000_read_mac_addr"); - for (i = 0; i < ETH_ADDR_LEN; i += 2) { + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { offset = i >> 1; ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); if (ret_val) { @@ -711,7 +711,7 @@ s32 e1000_read_mac_addr_82540(struct e1000_hw *hw) if (hw->bus.func == E1000_FUNC_1) hw->mac.perm_addr[5] ^= 1; - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; out: diff --git a/sys/dev/e1000/e1000_82541.c b/sys/dev/e1000/e1000_82541.c index 04f3b356b6f1..ead974cb1358 100644 --- a/sys/dev/e1000/e1000_82541.c +++ b/sys/dev/e1000/e1000_82541.c @@ -1285,7 +1285,7 @@ static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw) DEBUGFUNC("e1000_read_mac_addr"); - for (i = 0; i < ETH_ADDR_LEN; i += 2) { + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { offset = i >> 1; ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); if (ret_val) { @@ -1296,7 +1296,7 @@ static s32 e1000_read_mac_addr_82541(struct e1000_hw *hw) hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); } - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; out: diff --git a/sys/dev/e1000/e1000_82542.c b/sys/dev/e1000/e1000_82542.c index 57deeb87a089..09906699ab10 100644 --- a/sys/dev/e1000/e1000_82542.c +++ b/sys/dev/e1000/e1000_82542.c @@ -573,7 +573,7 @@ s32 e1000_read_mac_addr_82542(struct e1000_hw *hw) DEBUGFUNC("e1000_read_mac_addr"); - for (i = 0; i < ETH_ADDR_LEN; i += 2) { + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { offset = i >> 1; ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); if (ret_val) { @@ -584,7 +584,7 @@ s32 e1000_read_mac_addr_82542(struct e1000_hw *hw) hw->mac.perm_addr[i+1] = (u8)(nvm_data >> 8); } - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; out: diff --git a/sys/dev/e1000/e1000_82543.c b/sys/dev/e1000/e1000_82543.c index 48ad49294f31..e247b01f6cda 100644 --- a/sys/dev/e1000/e1000_82543.c +++ b/sys/dev/e1000/e1000_82543.c @@ -1574,7 +1574,7 @@ s32 e1000_read_mac_addr_82543(struct e1000_hw *hw) DEBUGFUNC("e1000_read_mac_addr"); - for (i = 0; i < ETH_ADDR_LEN; i += 2) { + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { offset = i >> 1; ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); if (ret_val) { @@ -1589,7 +1589,7 @@ s32 e1000_read_mac_addr_82543(struct e1000_hw *hw) if (hw->bus.func == E1000_FUNC_1) hw->mac.perm_addr[5] ^= 1; - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; out: diff --git a/sys/dev/e1000/e1000_defines.h b/sys/dev/e1000/e1000_defines.h index db7659e8d04f..722596b36e34 100644 --- a/sys/dev/e1000/e1000_defines.h +++ b/sys/dev/e1000/e1000_defines.h @@ -1206,10 +1206,6 @@ #define PCIE_LINK_SPEED_5000 0x02 #define PCIE_DEVICE_CONTROL2_16ms 0x0005 -#ifndef ETH_ADDR_LEN -#define ETH_ADDR_LEN 6 -#endif - #define PHY_REVISION_MASK 0xFFFFFFF0 #define MAX_PHY_REG_ADDRESS 0x1F /* 5 bit address bus (0-0x1F) */ #define MAX_PHY_MULTI_PAGE_REG 0xF diff --git a/sys/dev/e1000/e1000_hw.h b/sys/dev/e1000/e1000_hw.h index 7e4e7f1ad73a..cfaf15586b13 100644 --- a/sys/dev/e1000/e1000_hw.h +++ b/sys/dev/e1000/e1000_hw.h @@ -785,8 +785,8 @@ struct e1000_nvm_operations { struct e1000_mac_info { struct e1000_mac_operations ops; - u8 addr[ETH_ADDR_LEN]; - u8 perm_addr[ETH_ADDR_LEN]; + u8 addr[ETHER_ADDR_LEN]; + u8 perm_addr[ETHER_ADDR_LEN]; enum e1000_mac_type type; diff --git a/sys/dev/e1000/e1000_ich8lan.c b/sys/dev/e1000/e1000_ich8lan.c index e83b8146d5b4..b1c033c2e8d9 100644 --- a/sys/dev/e1000/e1000_ich8lan.c +++ b/sys/dev/e1000/e1000_ich8lan.c @@ -2780,7 +2780,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) * SHRAL/H) and initial CRC values to the MAC */ for (i = 0; i < hw->mac.rar_entry_count; i++) { - u8 mac_addr[ETH_ADDR_LEN] = {0}; + u8 mac_addr[ETHER_ADDR_LEN] = {0}; u32 addr_high, addr_low; addr_high = E1000_READ_REG(hw, E1000_RAH(i)); diff --git a/sys/dev/e1000/e1000_mac.c b/sys/dev/e1000/e1000_mac.c index 22d4e4faa30b..bd597674bfd8 100644 --- a/sys/dev/e1000/e1000_mac.c +++ b/sys/dev/e1000/e1000_mac.c @@ -371,7 +371,7 @@ void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value) void e1000_init_rx_addrs_generic(struct e1000_hw *hw, u16 rar_count) { u32 i; - u8 mac_addr[ETH_ADDR_LEN] = {0}; + u8 mac_addr[ETHER_ADDR_LEN] = {0}; DEBUGFUNC("e1000_init_rx_addrs_generic"); @@ -403,7 +403,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) u32 i; s32 ret_val; u16 offset, nvm_alt_mac_addr_offset, nvm_data; - u8 alt_mac_addr[ETH_ADDR_LEN]; + u8 alt_mac_addr[ETHER_ADDR_LEN]; DEBUGFUNC("e1000_check_alt_mac_addr_generic"); @@ -440,7 +440,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw) if (hw->bus.func == E1000_FUNC_3) nvm_alt_mac_addr_offset += E1000_ALT_MAC_ADDRESS_OFFSET_LAN3; - for (i = 0; i < ETH_ADDR_LEN; i += 2) { + for (i = 0; i < ETHER_ADDR_LEN; i += 2) { offset = nvm_alt_mac_addr_offset + (i >> 1); ret_val = hw->nvm.ops.read(hw, offset, 1, &nvm_data); if (ret_val) { @@ -604,7 +604,7 @@ void e1000_update_mc_addr_list_generic(struct e1000_hw *hw, hash_bit = hash_value & 0x1F; hw->mac.mta_shadow[hash_reg] |= (1 << hash_bit); - mc_addr_list += (ETH_ADDR_LEN); + mc_addr_list += (ETHER_ADDR_LEN); } /* replace the entire MTA table */ diff --git a/sys/dev/e1000/e1000_nvm.c b/sys/dev/e1000/e1000_nvm.c index 119cdc38199e..1bc74288df77 100644 --- a/sys/dev/e1000/e1000_nvm.c +++ b/sys/dev/e1000/e1000_nvm.c @@ -1143,7 +1143,7 @@ s32 e1000_read_mac_addr_generic(struct e1000_hw *hw) for (i = 0; i < E1000_RAH_MAC_ADDR_LEN; i++) hw->mac.perm_addr[i+4] = (u8)(rar_high >> (i*8)); - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; return E1000_SUCCESS; diff --git a/sys/dev/e1000/e1000_vf.c b/sys/dev/e1000/e1000_vf.c index e6571c79c88c..035b580bd23c 100644 --- a/sys/dev/e1000/e1000_vf.c +++ b/sys/dev/e1000/e1000_vf.c @@ -431,7 +431,7 @@ void e1000_update_mc_addr_list_vf(struct e1000_hw *hw, hash_value = e1000_hash_mc_addr_vf(hw, mc_addr_list); DEBUGOUT1("Hash value = 0x%03X\n", hash_value); hash_list[i] = hash_value & 0x0FFF; - mc_addr_list += ETH_ADDR_LEN; + mc_addr_list += ETHER_ADDR_LEN; } e1000_write_msg_read_ack(hw, msgbuf, E1000_VFMAILBOX_SIZE); @@ -517,7 +517,7 @@ static s32 e1000_read_mac_addr_vf(struct e1000_hw *hw) { int i; - for (i = 0; i < ETH_ADDR_LEN; i++) + for (i = 0; i < ETHER_ADDR_LEN; i++) hw->mac.addr[i] = hw->mac.perm_addr[i]; return E1000_SUCCESS; diff --git a/sys/dev/e1000/if_em.c b/sys/dev/e1000/if_em.c index b1177fcb82f6..c9052a2de4ea 100644 --- a/sys/dev/e1000/if_em.c +++ b/sys/dev/e1000/if_em.c @@ -1002,7 +1002,7 @@ em_if_attach_pre(if_ctx_t ctx) hw->mac.report_tx_early = 1; /* Allocate multicast array memory. */ - adapter->mta = malloc(sizeof(u8) * ETH_ADDR_LEN * + adapter->mta = malloc(sizeof(u8) * ETHER_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES, M_DEVBUF, M_NOWAIT); if (adapter->mta == NULL) { device_printf(dev, "Can not allocate multicast setup array\n"); @@ -1672,7 +1672,7 @@ em_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) if (cnt == MAX_NUM_MULTICAST_ADDRESSES) return (1); - bcopy(LLADDR(sdl), &mta[cnt * ETH_ADDR_LEN], ETH_ADDR_LEN); + bcopy(LLADDR(sdl), &mta[cnt * ETHER_ADDR_LEN], ETHER_ADDR_LEN); return (1); } @@ -1696,7 +1696,7 @@ em_if_multi_set(if_ctx_t ctx) IOCTL_DEBUGOUT("em_set_multi: begin"); mta = adapter->mta; - bzero(mta, sizeof(u8) * ETH_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES); + bzero(mta, sizeof(u8) * ETHER_ADDR_LEN * MAX_NUM_MULTICAST_ADDRESSES); if (adapter->hw.mac.type == e1000_82542 && adapter->hw.revision_id == E1000_REVISION_2) { diff --git a/sys/dev/e1000/if_em.h b/sys/dev/e1000/if_em.h index bfc1b3f2a118..0bb662c73aa1 100644 --- a/sys/dev/e1000/if_em.h +++ b/sys/dev/e1000/if_em.h @@ -340,7 +340,6 @@ #define EM_MSIX_MASK 0x01F00000 /* For 82574 use */ #define EM_MSIX_LINK 0x01000000 /* For 82574 use */ #define ETH_ZLEN 60 -#define ETH_ADDR_LEN 6 #define EM_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP) /* Offload bits in mbuf flag */ #define IGB_CSUM_OFFLOAD (CSUM_IP | CSUM_IP_UDP | CSUM_IP_TCP | \ CSUM_IP_SCTP | CSUM_IP6_UDP | CSUM_IP6_TCP | \ diff --git a/sys/dev/oce/oce_hw.c b/sys/dev/oce/oce_hw.c index 76735a12d547..cc86c2442499 100644 --- a/sys/dev/oce/oce_hw.c +++ b/sys/dev/oce/oce_hw.c @@ -553,7 +553,7 @@ oce_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt) return (0); bcopy(LLADDR(sdl), &req->params.req.mac[req->params.req.num_mac++], - ETH_ADDR_LEN); + ETHER_ADDR_LEN); return (1); } diff --git a/sys/dev/oce/oce_if.h b/sys/dev/oce/oce_if.h index 5cf004b2dea5..d1fd35bd35f9 100644 --- a/sys/dev/oce/oce_if.h +++ b/sys/dev/oce/oce_if.h @@ -200,7 +200,6 @@ extern int mp_ncpus; /* system's total active cpu cores */ #define OCE_IF_CAPABILITIES_NONE 0 -#define ETH_ADDR_LEN 6 #define MAX_VLANFILTER_SIZE 64 #define MAX_VLANS 4096