* [PATCH net-next 00/21] treewide: Use consistent api style for address testing
@ 2012-10-19 3:55 Joe Perches
2012-10-19 3:55 ` [PATCH net-next 01/21] etherdevice: Rename is_<foo>_ether_addr tests to eth_addr_<foo> Joe Perches
` (22 more replies)
0 siblings, 23 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 3:55 UTC (permalink / raw)
To: davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-rdma-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
uclinux-dist-devel-ZG0+EudsQA8dtHy/vicBwGD2FQJk+8+b,
linuxppc-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
e1000-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
cbe-oss-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-usb-u79uwXL29TY76Z2rM5mHXA, wimax-BPSAo7wm5JOHVYUYWc+uSQ,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
ath9k-devel-xDcbHBWguxHbcTqmT+pZeQ,
b43-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
users-poMEt7QlJxcwIE2E9O76wjtx2kNaKg5H,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
linux-parisc-u79uwXL29TY76Z2rM5mHXA,
linux-s390-u79uwXL29TY76Z2rM5mHXA,
linux-scsi-u79uwXL29TY76Z2rM5mHXA, devel-s9riP+hp16TNLxjTenLetw,
linux-nfs-u79uwXL29TY76Z2rM5mHXA,
linux-sctp-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
bridge-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
netfilter-devel-u79uwXL29TY76Z2rM5mHXA,
netfilter-u79uwXL29TY76Z2rM5mHXA, coreteam-Cap9r6Oaw4JrovVCs/uTlw,
lvs-devel-u79uwXL29TY76Z2rM5mHXA, dev-yBygre7rU0TnMu66kgdUjQ
Cc: devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
linux-mips-6z/3iImG2C8G8FEW9MqTrA,
user-mode-linux-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
user-mode-linux-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
ethernet, ipv4, and ipv6 address testing uses 3 different api naming styles.
ethernet uses: is_<foo>_ether_addr
ipv4 uses: ipv4_is_<foo>
ipv6 uses: ipv6_addr_<foo>
Standardize on the ipv6 style of <prefix>_addr_<type> to reduce
the number of styles to remember.
The new consistent styles are:
eth_addr_<foo>(const u8 *)
ipv4_addr_<foo>(__be32)
ipv6_addr_<foo>(const struct in6_addr *)
Add temporary backward compatibility #defines for the old names too.
Joe Perches (21):
etherdevice: Rename is_<foo>_ether_addr tests to eth_addr_<foo>
net: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
arch: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
drivers: net: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
staging: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
infiniband: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
scsi: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
of: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
s390: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
usb: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
uwb: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
Documentation: networking: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
llc_if.h: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
in.h: Rename ipv4_is_<foo> functions to ipv4_addr_<foo>
net: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
infiniband: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
ath6kl: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
parisc: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
lockd: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
sctp: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
Documentation/networking/driver.txt | 2 +-
arch/arm/mach-davinci/board-mityomapl138.c | 2 +-
arch/arm/mach-pxa/colibri-pxa3xx.c | 2 +-
arch/avr32/boards/atngw100/setup.c | 2 +-
arch/avr32/boards/atstk1000/atstk1002.c | 2 +-
arch/avr32/boards/favr-32/setup.c | 2 +-
arch/avr32/boards/hammerhead/setup.c | 2 +-
arch/avr32/boards/merisc/setup.c | 2 +-
arch/avr32/boards/mimc200/setup.c | 2 +-
arch/mips/alchemy/common/platform.c | 4 +-
arch/um/drivers/net_kern.c | 6 +-
drivers/infiniband/core/cma.c | 4 +-
drivers/infiniband/hw/amso1100/c2.c | 2 +-
drivers/infiniband/hw/nes/nes_nic.c | 2 +-
drivers/net/bonding/bond_3ad.c | 2 +-
drivers/net/bonding/bond_alb.c | 2 +-
drivers/net/bonding/bond_main.c | 6 +-
drivers/net/dummy.c | 2 +-
drivers/net/ethernet/3com/3c59x.c | 2 +-
drivers/net/ethernet/3com/typhoon.c | 2 +-
drivers/net/ethernet/8390/etherh.c | 2 +-
drivers/net/ethernet/adi/bfin_mac.c | 6 +-
drivers/net/ethernet/aeroflex/greth.c | 4 +-
drivers/net/ethernet/amd/au1000_eth.c | 2 +-
drivers/net/ethernet/amd/depca.c | 4 +-
drivers/net/ethernet/amd/pcnet32.c | 8 ++--
drivers/net/ethernet/atheros/atl1c/atl1c_hw.c | 2 +-
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 2 +-
drivers/net/ethernet/atheros/atl1e/atl1e_hw.c | 4 +-
drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 2 +-
drivers/net/ethernet/atheros/atlx/atl1.c | 10 ++--
drivers/net/ethernet/atheros/atlx/atl2.c | 14 +++---
drivers/net/ethernet/atheros/atlx/atlx.c | 2 +-
drivers/net/ethernet/broadcom/b44.c | 4 +-
drivers/net/ethernet/broadcom/bnx2.c | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 4 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 2 +-
drivers/net/ethernet/broadcom/cnic.c | 2 +-
drivers/net/ethernet/broadcom/tg3.c | 6 +-
drivers/net/ethernet/brocade/bna/bnad.c | 6 +-
drivers/net/ethernet/cadence/at91_ether.c | 6 +-
drivers/net/ethernet/cadence/macb.c | 4 +-
drivers/net/ethernet/calxeda/xgmac.c | 6 +-
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 2 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +-
.../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 2 +-
drivers/net/ethernet/cirrus/ep93xx_eth.c | 2 +-
drivers/net/ethernet/cirrus/mac89x0.c | 2 +-
drivers/net/ethernet/cisco/enic/enic_dev.c | 4 +-
drivers/net/ethernet/cisco/enic/enic_main.c | 10 ++--
drivers/net/ethernet/cisco/enic/enic_pp.c | 10 ++--
drivers/net/ethernet/davicom/dm9000.c | 6 +-
drivers/net/ethernet/dec/ewrk3.c | 4 +-
drivers/net/ethernet/dec/tulip/de4x5.c | 4 +-
drivers/net/ethernet/dlink/sundance.c | 2 +-
drivers/net/ethernet/dnet.c | 6 +-
drivers/net/ethernet/emulex/benet/be_main.c | 8 ++--
drivers/net/ethernet/ethoc.c | 6 +-
drivers/net/ethernet/faraday/ftgmac100.c | 2 +-
drivers/net/ethernet/faraday/ftmac100.c | 2 +-
drivers/net/ethernet/freescale/fec.c | 8 ++--
drivers/net/ethernet/freescale/fec_mpc52xx.c | 2 +-
drivers/net/ethernet/freescale/gianfar_ethtool.c | 12 ++--
drivers/net/ethernet/freescale/ucc_geth.c | 2 +-
drivers/net/ethernet/i825xx/ether1.c | 2 +-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 4 +-
drivers/net/ethernet/intel/e100.c | 4 +-
drivers/net/ethernet/intel/e1000/e1000_main.c | 4 +-
drivers/net/ethernet/intel/e1000e/mac.c | 2 +-
drivers/net/ethernet/intel/e1000e/netdev.c | 4 +-
drivers/net/ethernet/intel/igb/e1000_mac.c | 2 +-
drivers/net/ethernet/intel/igb/igb_main.c | 8 ++--
drivers/net/ethernet/intel/igbvf/netdev.c | 6 +-
drivers/net/ethernet/intel/ixgb/ixgb_hw.c | 6 +-
drivers/net/ethernet/intel/ixgb/ixgb_main.c | 6 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 14 +++---
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 6 +-
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 8 ++--
drivers/net/ethernet/lantiq_etop.c | 2 +-
drivers/net/ethernet/marvell/mv643xx_eth.c | 4 +-
drivers/net/ethernet/marvell/pxa168_eth.c | 2 +-
drivers/net/ethernet/marvell/skge.c | 6 +-
drivers/net/ethernet/marvell/sky2.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
.../net/ethernet/mellanox/mlx4/resource_tracker.c | 4 +-
drivers/net/ethernet/micrel/ks8695net.c | 6 +-
drivers/net/ethernet/micrel/ks8842.c | 4 +-
drivers/net/ethernet/micrel/ks8851.c | 4 +-
drivers/net/ethernet/micrel/ks8851_mll.c | 2 +-
drivers/net/ethernet/microchip/enc28j60.c | 4 +-
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +-
drivers/net/ethernet/neterion/s2io.c | 2 +-
drivers/net/ethernet/neterion/vxge/vxge-config.c | 2 +-
drivers/net/ethernet/neterion/vxge/vxge-main.c | 12 ++--
drivers/net/ethernet/netx-eth.c | 2 +-
drivers/net/ethernet/nuvoton/w90p910_ether.c | 4 +-
drivers/net/ethernet/nvidia/forcedeth.c | 4 +-
drivers/net/ethernet/nxp/lpc_eth.c | 8 ++--
drivers/net/ethernet/octeon/octeon_mgmt.c | 2 +-
.../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 6 +-
drivers/net/ethernet/pasemi/pasemi_mac.c | 4 +-
.../net/ethernet/qlogic/netxen/netxen_nic_main.c | 4 +-
drivers/net/ethernet/qlogic/qla3xxx.c | 2 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 4 +-
drivers/net/ethernet/qlogic/qlge/qlge_main.c | 6 +-
drivers/net/ethernet/realtek/8139cp.c | 2 +-
drivers/net/ethernet/realtek/8139too.c | 2 +-
drivers/net/ethernet/realtek/r8169.c | 2 +-
drivers/net/ethernet/renesas/sh_eth.c | 4 +-
drivers/net/ethernet/seeq/ether3.c | 2 +-
drivers/net/ethernet/sfc/efx.c | 2 +-
drivers/net/ethernet/sfc/ethtool.c | 6 +-
drivers/net/ethernet/sfc/siena_sriov.c | 6 +-
drivers/net/ethernet/sis/sis900.c | 2 +-
drivers/net/ethernet/smsc/smc911x.c | 4 +-
drivers/net/ethernet/smsc/smc91x.c | 4 +-
drivers/net/ethernet/smsc/smsc911x.c | 10 ++--
drivers/net/ethernet/smsc/smsc9420.c | 6 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 +-
drivers/net/ethernet/sun/niu.c | 8 ++--
drivers/net/ethernet/sun/sungem.c | 2 +-
drivers/net/ethernet/ti/cpsw.c | 2 +-
drivers/net/ethernet/ti/davinci_emac.c | 6 +-
drivers/net/ethernet/tile/tilegx.c | 4 +-
drivers/net/ethernet/tile/tilepro.c | 4 +-
drivers/net/ethernet/toshiba/ps3_gelic_net.c | 2 +-
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 2 +-
drivers/net/ethernet/toshiba/spider_net.c | 4 +-
drivers/net/ethernet/toshiba/tc35815.c | 4 +-
drivers/net/ethernet/tundra/tsi108_eth.c | 8 ++--
drivers/net/ethernet/via/via-rhine.c | 2 +-
drivers/net/ethernet/wiznet/w5100.c | 6 +-
drivers/net/ethernet/wiznet/w5300.c | 6 +-
drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +-
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
drivers/net/hamradio/bpqether.c | 2 +-
drivers/net/ifb.c | 2 +-
drivers/net/macvlan.c | 16 +++---
drivers/net/phy/at803x.c | 2 +-
drivers/net/rionet.c | 4 +-
drivers/net/team/team.c | 4 +-
drivers/net/tun.c | 4 +-
drivers/net/usb/asix_common.c | 2 +-
drivers/net/usb/dm9601.c | 4 +-
drivers/net/usb/mcs7830.c | 2 +-
drivers/net/usb/smsc75xx.c | 2 +-
drivers/net/usb/smsc95xx.c | 2 +-
drivers/net/veth.c | 2 +-
drivers/net/vxlan.c | 4 +-
drivers/net/wimax/i2400m/driver.c | 2 +-
drivers/net/wireless/adm8211.c | 2 +-
drivers/net/wireless/airo.c | 4 +-
drivers/net/wireless/at76c50x-usb.c | 8 ++--
drivers/net/wireless/ath/ath6kl/cfg80211.c | 8 ++--
drivers/net/wireless/ath/ath6kl/main.c | 8 ++--
drivers/net/wireless/ath/ath6kl/txrx.c | 10 ++--
drivers/net/wireless/ath/ath6kl/wmi.c | 4 +-
drivers/net/wireless/ath/ath9k/recv.c | 8 ++--
drivers/net/wireless/b43/main.c | 2 +-
drivers/net/wireless/b43legacy/main.c | 2 +-
.../net/wireless/brcm80211/brcmfmac/dhd_linux.c | 4 +-
.../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 2 +-
.../net/wireless/brcm80211/brcmsmac/mac80211_if.c | 2 +-
drivers/net/wireless/brcm80211/brcmsmac/main.c | 16 +++---
drivers/net/wireless/hostap/hostap_info.c | 2 +-
drivers/net/wireless/hostap/hostap_ioctl.c | 8 ++--
drivers/net/wireless/hostap/hostap_main.c | 2 +-
drivers/net/wireless/ipw2x00/ipw2100.c | 6 +-
drivers/net/wireless/ipw2x00/ipw2200.c | 18 +++---
drivers/net/wireless/ipw2x00/libipw_rx.c | 12 ++--
drivers/net/wireless/ipw2x00/libipw_tx.c | 4 +-
drivers/net/wireless/iwlegacy/3945-mac.c | 2 +-
drivers/net/wireless/iwlegacy/4965-mac.c | 2 +-
drivers/net/wireless/iwlegacy/common.c | 2 +-
drivers/net/wireless/iwlwifi/dvm/sta.c | 2 +-
drivers/net/wireless/libertas_tf/main.c | 2 +-
drivers/net/wireless/mwifiex/join.c | 2 +-
drivers/net/wireless/mwifiex/scan.c | 2 +-
drivers/net/wireless/mwifiex/sta_cmd.c | 2 +-
drivers/net/wireless/mwifiex/sta_cmdresp.c | 2 +-
drivers/net/wireless/mwifiex/uap_txrx.c | 2 +-
drivers/net/wireless/mwl8k.c | 2 +-
drivers/net/wireless/orinoco/wext.c | 4 +-
drivers/net/wireless/p54/eeprom.c | 2 +-
drivers/net/wireless/rndis_wlan.c | 18 +++---
drivers/net/wireless/rt2x00/rt2400pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500usb.c | 2 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 8 ++--
drivers/net/wireless/rt2x00/rt61pci.c | 2 +-
drivers/net/wireless/rt2x00/rt73usb.c | 2 +-
drivers/net/wireless/rtl818x/rtl8180/dev.c | 4 +-
drivers/net/wireless/rtl818x/rtl8187/dev.c | 4 +-
drivers/net/wireless/rtlwifi/base.c | 6 +-
drivers/net/wireless/rtlwifi/cam.c | 2 +-
drivers/net/wireless/rtlwifi/pci.c | 8 ++--
drivers/net/wireless/rtlwifi/rc.c | 4 +-
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 4 +-
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 4 +-
drivers/net/wireless/rtlwifi/usb.c | 12 ++--
drivers/net/wireless/ti/wl1251/main.c | 12 ++--
drivers/net/wireless/ti/wlcore/cmd.c | 2 +-
drivers/net/wireless/ti/wlcore/main.c | 6 +-
drivers/net/wireless/ti/wlcore/tx.c | 2 +-
drivers/net/wireless/wl3501_cs.c | 2 +-
drivers/net/wireless/zd1211rw/zd_mac.c | 2 +-
drivers/of/of_net.c | 6 +-
drivers/parisc/led.c | 2 +-
drivers/s390/net/qeth_l2_main.c | 4 +-
drivers/scsi/bnx2fc/bnx2fc_els.c | 4 +-
drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 2 +-
drivers/scsi/fcoe/fcoe.c | 12 ++--
drivers/scsi/fcoe/fcoe_ctlr.c | 8 ++--
drivers/scsi/fnic/fnic_fcs.c | 6 +-
drivers/staging/ccg/u_ether.c | 6 +-
drivers/staging/csr/sme_wext.c | 2 +-
drivers/staging/et131x/et131x.c | 4 +-
drivers/staging/gdm72xx/gdm_wimax.c | 2 +-
drivers/staging/octeon/ethernet.c | 2 +-
drivers/staging/ozwpan/ozcdev.c | 2 +-
.../rtl8187se/ieee80211/ieee80211_softmac.c | 2 +-
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 2 +-
drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c | 2 +-
drivers/staging/rtl8187se/r8180_core.c | 2 +-
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 +-
drivers/staging/rtl8192e/rtl819x_TSProc.c | 2 +-
drivers/staging/rtl8192e/rtllib_rx.c | 8 ++--
drivers/staging/rtl8192e/rtllib_softmac.c | 4 +-
drivers/staging/rtl8192e/rtllib_softmac_wx.c | 4 +-
drivers/staging/rtl8192e/rtllib_tx.c | 12 ++--
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 +-
.../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
.../rtl8192u/ieee80211/ieee80211_softmac_wx.c | 2 +-
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 12 ++--
.../staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 2 +-
drivers/staging/rtl8192u/r8192U_core.c | 8 ++--
drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +-
drivers/staging/rtl8712/rtl871x_ioctl_set.c | 2 +-
drivers/staging/rtl8712/rtl871x_mlme.c | 2 +-
drivers/staging/rtl8712/rtl871x_recv.c | 8 ++--
drivers/staging/slicoss/slicoss.c | 2 +-
drivers/staging/vt6655/bssdb.c | 2 +-
drivers/staging/vt6655/card.c | 2 +-
drivers/staging/vt6655/device_main.c | 2 +-
drivers/staging/vt6655/dpc.c | 4 +-
drivers/staging/vt6655/hostap.c | 4 +-
drivers/staging/vt6655/iwctl.c | 2 +-
drivers/staging/vt6655/key.c | 2 +-
drivers/staging/vt6655/mib.c | 8 ++--
drivers/staging/vt6655/rxtx.c | 10 ++--
drivers/staging/vt6655/wpactl.c | 4 +-
drivers/staging/vt6656/bssdb.c | 2 +-
drivers/staging/vt6656/dpc.c | 4 +-
drivers/staging/vt6656/hostap.c | 4 +-
drivers/staging/vt6656/iwctl.c | 2 +-
drivers/staging/vt6656/key.c | 2 +-
drivers/staging/vt6656/rxtx.c | 14 +++---
drivers/staging/vt6656/wpactl.c | 2 +-
drivers/staging/wlags49_h2/wl_wext.c | 2 +-
drivers/usb/gadget/u_ether.c | 6 +-
drivers/uwb/address.c | 2 +-
include/linux/etherdevice.h | 36 ++++++++-----
include/linux/in.h | 40 ++++++++++----
include/linux/lockd/lockd.h | 4 +-
include/net/llc_if.h | 4 +-
include/net/sctp/constants.h | 12 ++--
net/802/stp.c | 4 +-
net/8021q/vlan_dev.c | 6 +-
net/8021q/vlan_netlink.c | 2 +-
net/batman-adv/bat_iv_ogm.c | 2 +-
net/batman-adv/bridge_loop_avoidance.c | 8 ++--
net/batman-adv/routing.c | 20 ++++----
net/batman-adv/soft-interface.c | 4 +-
net/batman-adv/unicast.c | 2 +-
net/batman-adv/vis.c | 4 +-
net/bridge/br_device.c | 6 +-
net/bridge/br_fdb.c | 2 +-
net/bridge/br_if.c | 2 +-
net/bridge/br_input.c | 8 ++--
net/bridge/br_multicast.c | 4 +-
net/bridge/br_netlink.c | 2 +-
net/core/netpoll.c | 2 +-
net/core/pktgen.c | 14 +++---
net/core/rtnetlink.c | 2 +-
net/dsa/slave.c | 2 +-
net/ethernet/eth.c | 6 +-
net/ipv4/arp.c | 4 +-
net/ipv4/datagram.c | 2 +-
net/ipv4/devinet.c | 4 +-
net/ipv4/fib_frontend.c | 12 ++--
net/ipv4/igmp.c | 12 ++--
net/ipv4/ip_gre.c | 22 ++++----
net/ipv4/ipmr.c | 4 +-
net/ipv4/netfilter/ipt_rpfilter.c | 10 ++--
net/ipv4/ping.c | 2 +-
net/ipv4/raw.c | 2 +-
net/ipv4/route.c | 58 ++++++++++----------
net/ipv4/udp.c | 2 +-
net/ipv6/addrconf.c | 12 ++--
net/ipv6/ip6_gre.c | 2 +-
net/l2tp/l2tp_ip.c | 2 +-
net/l2tp/l2tp_ip6.c | 2 +-
net/mac80211/cfg.c | 2 +-
net/mac80211/ibss.c | 8 ++--
net/mac80211/ieee80211_i.h | 2 +-
net/mac80211/iface.c | 12 ++--
net/mac80211/mesh.c | 2 +-
net/mac80211/mesh_hwmp.c | 4 +-
net/mac80211/mesh_pathtbl.c | 4 +-
net/mac80211/mesh_plink.c | 2 +-
net/mac80211/mlme.c | 4 +-
net/mac80211/rx.c | 50 +++++++++---------
net/mac80211/sta_info.c | 2 +-
net/mac80211/status.c | 6 +-
net/mac80211/tx.c | 22 ++++----
net/mac80211/wme.c | 4 +-
net/netfilter/ipvs/ip_vs_xmit.c | 6 +-
net/netfilter/xt_cluster.c | 2 +-
net/netfilter/xt_pkttype.c | 2 +-
net/openvswitch/flow.c | 4 +-
net/openvswitch/vport-internal_dev.c | 2 +-
net/sctp/protocol.c | 10 ++--
net/wireless/core.c | 2 +-
net/wireless/ibss.c | 2 +-
net/wireless/nl80211.c | 4 +-
net/wireless/util.c | 4 +-
net/wireless/wext-compat.c | 2 +-
net/wireless/wext-sme.c | 2 +-
331 files changed, 833 insertions(+), 809 deletions(-)
--
1.7.8.111.gad25c.dirty
^ permalink raw reply [flat|nested] 30+ messages in thread
* [PATCH net-next 01/21] etherdevice: Rename is_<foo>_ether_addr tests to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
@ 2012-10-19 3:55 ` Joe Perches
[not found] ` <cover.1350618006.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
` (21 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 3:55 UTC (permalink / raw)
To: linux-kernel; +Cc: netdev
Make the ether_addr tests use a similar style to ipv6_<foo> tests.
Add backward compatibility #defines to keep current is_<foo>_ether_addr
code working until completely converted.
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/etherdevice.h | 36 ++++++++++++++++++++++--------------
1 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index b006ba0..969efa5 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -52,63 +52,63 @@ extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs,
#define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count)
/**
- * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
+ * eth_addr_zero - Determine if give Ethernet address is all zeros.
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if the address is all zeroes.
*/
-static inline bool is_zero_ether_addr(const u8 *addr)
+static inline bool eth_addr_zero(const u8 *addr)
{
return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]);
}
/**
- * is_multicast_ether_addr - Determine if the Ethernet address is a multicast.
+ * eth_addr_multicast - Determine if the Ethernet address is a multicast.
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if the address is a multicast address.
* By definition the broadcast address is also a multicast address.
*/
-static inline bool is_multicast_ether_addr(const u8 *addr)
+static inline bool eth_addr_multicast(const u8 *addr)
{
return 0x01 & addr[0];
}
/**
- * is_local_ether_addr - Determine if the Ethernet address is locally-assigned one (IEEE 802).
+ * eth_addr_local - Determine if the Ethernet address is locally-assigned one (IEEE 802).
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if the address is a local address.
*/
-static inline bool is_local_ether_addr(const u8 *addr)
+static inline bool eth_addr_local(const u8 *addr)
{
return 0x02 & addr[0];
}
/**
- * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast
+ * eth_addr_broadcast - Determine if the Ethernet address is broadcast
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if the address is the broadcast address.
*/
-static inline bool is_broadcast_ether_addr(const u8 *addr)
+static inline bool eth_addr_broadcast(const u8 *addr)
{
return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff;
}
/**
- * is_unicast_ether_addr - Determine if the Ethernet address is unicast
+ * eth_addr_unicast - Determine if the Ethernet address is unicast
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Return true if the address is a unicast address.
*/
-static inline bool is_unicast_ether_addr(const u8 *addr)
+static inline bool eth_addr_unicast(const u8 *addr)
{
- return !is_multicast_ether_addr(addr);
+ return !eth_addr_multicast(addr);
}
/**
- * is_valid_ether_addr - Determine if the given Ethernet address is valid
+ * eth_addr_valid - Determine if the given Ethernet address is valid
* @addr: Pointer to a six-byte array containing the Ethernet address
*
* Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
@@ -116,13 +116,21 @@ static inline bool is_unicast_ether_addr(const u8 *addr)
*
* Return true if the address is valid.
*/
-static inline bool is_valid_ether_addr(const u8 *addr)
+static inline bool eth_addr_valid(const u8 *addr)
{
/* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to
* explicitly check for it here. */
- return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);
+ return !eth_addr_multicast(addr) && !eth_addr_zero(addr);
}
+/* Some #defines to make old is_<foo>_ether_addr tests work for awhile */
+#define is_zero_ether_addr(addr) eth_addr_zero(addr)
+#define is_multicast_ether_addr(addr) eth_addr_multicast(addr)
+#define is_local_ether_addr(addr) eth_addr_local(addr)
+#define is_broadcast_ether_addr(addr) eth_addr_broadcast(addr)
+#define is_unicast_ether_addr(addr) eth_addr_unicast(addr)
+#define is_valid_ether_addr(addr) eth_addr_valid(addr)
+
/**
* eth_random_addr - Generate software assigned random Ethernet address
* @addr: Pointer to a six-byte array containing the Ethernet address
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 02/21] net: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
[not found] ` <cover.1350618006.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
@ 2012-10-19 3:55 ` Joe Perches
0 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 3:55 UTC (permalink / raw)
To: Patrick McHardy, Marek Lindner, Simon Wunderlich,
Antonio Quartulli, Stephen Hemminger, David S. Miller,
Alexey Kuznetsov, James Morris, Hideaki YOSHIFUJI,
John W. Linville, Johannes Berg, Jesse Gross
Cc: dev-yBygre7rU0TnMu66kgdUjQ,
bridge-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
linux-wireless-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
net/802/stp.c | 4 +-
net/8021q/vlan_dev.c | 6 ++--
net/8021q/vlan_netlink.c | 2 +-
net/batman-adv/bat_iv_ogm.c | 2 +-
net/batman-adv/bridge_loop_avoidance.c | 8 ++--
net/batman-adv/routing.c | 20 ++++++------
net/batman-adv/soft-interface.c | 4 +-
net/batman-adv/unicast.c | 2 +-
net/batman-adv/vis.c | 4 +-
net/bridge/br_device.c | 6 ++--
net/bridge/br_fdb.c | 2 +-
net/bridge/br_if.c | 2 +-
net/bridge/br_input.c | 8 ++--
net/bridge/br_netlink.c | 2 +-
net/core/pktgen.c | 4 +-
net/core/rtnetlink.c | 2 +-
net/dsa/slave.c | 2 +-
net/ethernet/eth.c | 6 ++--
net/ipv4/ip_gre.c | 2 +-
net/ipv6/ip6_gre.c | 2 +-
net/mac80211/cfg.c | 2 +-
net/mac80211/ibss.c | 8 ++--
net/mac80211/ieee80211_i.h | 2 +-
net/mac80211/iface.c | 12 ++++----
net/mac80211/mesh.c | 2 +-
net/mac80211/mesh_hwmp.c | 4 +-
net/mac80211/mesh_pathtbl.c | 4 +-
net/mac80211/mesh_plink.c | 2 +-
net/mac80211/mlme.c | 4 +-
net/mac80211/rx.c | 50 ++++++++++++++++----------------
net/mac80211/sta_info.c | 2 +-
net/mac80211/status.c | 6 ++--
net/mac80211/tx.c | 22 +++++++-------
net/mac80211/wme.c | 4 +-
net/openvswitch/flow.c | 4 +-
net/openvswitch/vport-internal_dev.c | 2 +-
net/wireless/core.c | 2 +-
net/wireless/ibss.c | 2 +-
net/wireless/nl80211.c | 4 +-
net/wireless/util.c | 4 +-
net/wireless/wext-compat.c | 2 +-
net/wireless/wext-sme.c | 2 +-
42 files changed, 118 insertions(+), 118 deletions(-)
diff --git a/net/802/stp.c b/net/802/stp.c
index 2c40ba0..80a253c 100644
--- a/net/802/stp.c
+++ b/net/802/stp.c
@@ -74,7 +74,7 @@ int stp_proto_register(const struct stp_proto *proto)
goto out;
}
}
- if (is_zero_ether_addr(proto->group_address))
+ if (eth_addr_zero(proto->group_address))
rcu_assign_pointer(stp_proto, proto);
else
rcu_assign_pointer(garp_protos[proto->group_address[5] -
@@ -88,7 +88,7 @@ EXPORT_SYMBOL_GPL(stp_proto_register);
void stp_proto_unregister(const struct stp_proto *proto)
{
mutex_lock(&stp_proto_mutex);
- if (is_zero_ether_addr(proto->group_address))
+ if (eth_addr_zero(proto->group_address))
RCU_INIT_POINTER(stp_proto, NULL);
else
RCU_INIT_POINTER(garp_protos[proto->group_address[5] -
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 4024424..5c330c9 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -352,7 +352,7 @@ static int vlan_dev_set_mac_address(struct net_device *dev, void *p)
struct sockaddr *addr = p;
int err;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
if (!(dev->flags & IFF_UP))
@@ -559,9 +559,9 @@ static int vlan_dev_init(struct net_device *dev)
/* ipv6 shared card related stuff */
dev->dev_id = real_dev->dev_id;
- if (is_zero_ether_addr(dev->dev_addr))
+ if (eth_addr_zero(dev->dev_addr))
memcpy(dev->dev_addr, real_dev->dev_addr, dev->addr_len);
- if (is_zero_ether_addr(dev->broadcast))
+ if (eth_addr_zero(dev->broadcast))
memcpy(dev->broadcast, real_dev->broadcast, dev->addr_len);
#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
index 708c80e..c79bba9 100644
--- a/net/8021q/vlan_netlink.c
+++ b/net/8021q/vlan_netlink.c
@@ -46,7 +46,7 @@ static int vlan_validate(struct nlattr *tb[], struct nlattr *data[])
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index b02b75d..5e07dbc 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -1056,7 +1056,7 @@ static void batadv_iv_ogm_process(const struct ethhdr *ethhdr,
hard_iface->net_dev->dev_addr))
is_my_oldorig = 1;
- if (is_broadcast_ether_addr(ethhdr->h_source))
+ if (eth_addr_broadcast(ethhdr->h_source))
is_broadcast = 1;
}
rcu_read_unlock();
diff --git a/net/batman-adv/bridge_loop_avoidance.c b/net/batman-adv/bridge_loop_avoidance.c
index fd8d5af..719faa6 100644
--- a/net/batman-adv/bridge_loop_avoidance.c
+++ b/net/batman-adv/bridge_loop_avoidance.c
@@ -1425,7 +1425,7 @@ int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid,
if (unlikely(atomic_read(&bat_priv->bla.num_requests)))
/* don't allow broadcasts while requests are in flight */
- if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast)
+ if (eth_addr_multicast(ethhdr->h_dest) && is_bcast)
goto handled;
memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN);
@@ -1451,7 +1451,7 @@ int batadv_bla_rx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid,
}
/* if it is a broadcast ... */
- if (is_multicast_ether_addr(ethhdr->h_dest) && is_bcast) {
+ if (eth_addr_multicast(ethhdr->h_dest) && is_bcast) {
/* ... drop it. the responsible gateway is in charge.
*
* We need to check is_bcast because with the gateway
@@ -1524,7 +1524,7 @@ int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid)
if (unlikely(atomic_read(&bat_priv->bla.num_requests)))
/* don't allow broadcasts while requests are in flight */
- if (is_multicast_ether_addr(ethhdr->h_dest))
+ if (eth_addr_multicast(ethhdr->h_dest))
goto handled;
memcpy(search_claim.addr, ethhdr->h_source, ETH_ALEN);
@@ -1549,7 +1549,7 @@ int batadv_bla_tx(struct batadv_priv *bat_priv, struct sk_buff *skb, short vid)
}
/* check if it is a multicast/broadcast frame */
- if (is_multicast_ether_addr(ethhdr->h_dest)) {
+ if (eth_addr_multicast(ethhdr->h_dest)) {
/* drop it. the responsible gateway has forwarded it into
* the backbone network.
*/
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 376b4cc..69357da 100644
--- a/net/batman-adv/routing.c
+++ b/net/batman-adv/routing.c
@@ -261,11 +261,11 @@ bool batadv_check_management_packet(struct sk_buff *skb,
ethhdr = (struct ethhdr *)skb_mac_header(skb);
/* packet with broadcast indication but unicast recipient */
- if (!is_broadcast_ether_addr(ethhdr->h_dest))
+ if (!eth_addr_broadcast(ethhdr->h_dest))
return false;
/* packet with broadcast sender address */
- if (is_broadcast_ether_addr(ethhdr->h_source))
+ if (eth_addr_broadcast(ethhdr->h_source))
return false;
/* create a copy of the skb, if needed, to modify it. */
@@ -412,11 +412,11 @@ int batadv_recv_icmp_packet(struct sk_buff *skb,
ethhdr = (struct ethhdr *)skb_mac_header(skb);
/* packet with unicast indication but broadcast recipient */
- if (is_broadcast_ether_addr(ethhdr->h_dest))
+ if (eth_addr_broadcast(ethhdr->h_dest))
goto out;
/* packet with broadcast sender address */
- if (is_broadcast_ether_addr(ethhdr->h_source))
+ if (eth_addr_broadcast(ethhdr->h_source))
goto out;
/* not for me */
@@ -590,11 +590,11 @@ static int batadv_check_unicast_packet(struct sk_buff *skb, int hdr_size)
ethhdr = (struct ethhdr *)skb_mac_header(skb);
/* packet with unicast indication but broadcast recipient */
- if (is_broadcast_ether_addr(ethhdr->h_dest))
+ if (eth_addr_broadcast(ethhdr->h_dest))
return -1;
/* packet with broadcast sender address */
- if (is_broadcast_ether_addr(ethhdr->h_source))
+ if (eth_addr_broadcast(ethhdr->h_source))
return -1;
/* not for me */
@@ -697,11 +697,11 @@ int batadv_recv_roam_adv(struct sk_buff *skb, struct batadv_hard_iface *recv_if)
ethhdr = (struct ethhdr *)skb_mac_header(skb);
/* packet with unicast indication but broadcast recipient */
- if (is_broadcast_ether_addr(ethhdr->h_dest))
+ if (eth_addr_broadcast(ethhdr->h_dest))
goto out;
/* packet with broadcast sender address */
- if (is_broadcast_ether_addr(ethhdr->h_source))
+ if (eth_addr_broadcast(ethhdr->h_source))
goto out;
batadv_inc_counter(bat_priv, BATADV_CNT_TT_ROAM_ADV_RX);
@@ -1077,11 +1077,11 @@ int batadv_recv_bcast_packet(struct sk_buff *skb,
ethhdr = (struct ethhdr *)skb_mac_header(skb);
/* packet with broadcast indication but unicast recipient */
- if (!is_broadcast_ether_addr(ethhdr->h_dest))
+ if (!eth_addr_broadcast(ethhdr->h_dest))
goto out;
/* packet with broadcast sender address */
- if (is_broadcast_ether_addr(ethhdr->h_source))
+ if (eth_addr_broadcast(ethhdr->h_source))
goto out;
/* ignore broadcasts sent by myself */
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index b9a28d2..a08fe2f 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -109,7 +109,7 @@ static int batadv_interface_set_mac_addr(struct net_device *dev, void *p)
struct sockaddr *addr = p;
uint8_t old_addr[ETH_ALEN];
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(old_addr, dev->dev_addr, ETH_ALEN);
@@ -184,7 +184,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
if (batadv_compare_eth(ethhdr->h_dest, stp_addr))
goto dropped;
- if (is_multicast_ether_addr(ethhdr->h_dest)) {
+ if (eth_addr_multicast(ethhdr->h_dest)) {
do_bcast = true;
switch (atomic_read(&bat_priv->gw_mode)) {
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c
index f397232..e0538e2 100644
--- a/net/batman-adv/unicast.c
+++ b/net/batman-adv/unicast.c
@@ -302,7 +302,7 @@ int batadv_unicast_send_skb(struct sk_buff *skb, struct batadv_priv *bat_priv)
unsigned int dev_mtu;
/* get routing information */
- if (is_multicast_ether_addr(ethhdr->h_dest)) {
+ if (eth_addr_multicast(ethhdr->h_dest)) {
orig_node = batadv_gw_get_selected_orig(bat_priv);
if (orig_node)
goto find_router;
diff --git a/net/batman-adv/vis.c b/net/batman-adv/vis.c
index 5abd145..55c1025 100644
--- a/net/batman-adv/vis.c
+++ b/net/batman-adv/vis.c
@@ -476,7 +476,7 @@ void batadv_receive_client_update_packet(struct batadv_priv *bat_priv,
int are_target = 0;
/* clients shall not broadcast. */
- if (is_broadcast_ether_addr(vis_packet->target_orig))
+ if (eth_addr_broadcast(vis_packet->target_orig))
return;
/* Are we the target for this VIS packet? */
@@ -800,7 +800,7 @@ static void batadv_send_vis_packet(struct batadv_priv *bat_priv,
memcpy(packet->sender_orig, primary_if->net_dev->dev_addr, ETH_ALEN);
packet->header.ttl--;
- if (is_broadcast_ether_addr(packet->target_orig))
+ if (eth_addr_broadcast(packet->target_orig))
batadv_broadcast_vis_packet(bat_priv, info);
else
batadv_unicast_vis_packet(bat_priv, info);
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 070e8a6..9963b31 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -50,9 +50,9 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)
skb_reset_mac_header(skb);
skb_pull(skb, ETH_HLEN);
- if (is_broadcast_ether_addr(dest))
+ if (eth_addr_broadcast(dest))
br_flood_deliver(br, skb);
- else if (is_multicast_ether_addr(dest)) {
+ else if (eth_addr_multicast(dest)) {
if (unlikely(netpoll_tx_running(dev))) {
br_flood_deliver(br, skb);
goto out;
@@ -167,7 +167,7 @@ static int br_set_mac_address(struct net_device *dev, void *p)
struct net_bridge *br = netdev_priv(dev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
spin_lock_bh(&br->lock);
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c
index d9576e6..5519242 100644
--- a/net/bridge/br_fdb.c
+++ b/net/bridge/br_fdb.c
@@ -374,7 +374,7 @@ static int fdb_insert(struct net_bridge *br, struct net_bridge_port *source,
struct hlist_head *head = &br->hash[br_mac_hash(addr)];
struct net_bridge_fdb_entry *fdb;
- if (!is_valid_ether_addr(addr))
+ if (!eth_addr_valid(addr))
return -EINVAL;
fdb = fdb_find(head, addr);
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 1c8fdc3..b21cfc3 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -327,7 +327,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
/* Don't allow bridging non-ethernet like devices */
if ((dev->flags & IFF_LOOPBACK) ||
dev->type != ARPHRD_ETHER || dev->addr_len != ETH_ALEN ||
- !is_valid_ether_addr(dev->dev_addr))
+ !eth_addr_valid(dev->dev_addr))
return -EINVAL;
/* No bridging of bridges */
diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index 76f15fd..c084fed 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -61,7 +61,7 @@ int br_handle_frame_finish(struct sk_buff *skb)
br = p->br;
br_fdb_update(br, p, eth_hdr(skb)->h_source);
- if (!is_broadcast_ether_addr(dest) && is_multicast_ether_addr(dest) &&
+ if (!eth_addr_broadcast(dest) && eth_addr_multicast(dest) &&
br_multicast_rcv(br, p, skb))
goto drop;
@@ -78,9 +78,9 @@ int br_handle_frame_finish(struct sk_buff *skb)
dst = NULL;
- if (is_broadcast_ether_addr(dest))
+ if (eth_addr_broadcast(dest))
skb2 = skb;
- else if (is_multicast_ether_addr(dest)) {
+ else if (eth_addr_multicast(dest)) {
mdst = br_mdb_get(br, skb);
if (mdst || BR_INPUT_SKB_CB_MROUTERS_ONLY(skb)) {
if ((mdst && mdst->mglist) ||
@@ -153,7 +153,7 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
if (unlikely(skb->pkt_type == PACKET_LOOPBACK))
return RX_HANDLER_PASS;
- if (!is_valid_ether_addr(eth_hdr(skb)->h_source))
+ if (!eth_addr_valid(eth_hdr(skb)->h_source))
goto drop;
skb = skb_share_check(skb, GFP_ATOMIC);
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 093f527..e6b7916 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -201,7 +201,7 @@ static int br_validate(struct nlattr *tb[], struct nlattr *data[])
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index d1dc14c..3422af7 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -573,7 +573,7 @@ static int pktgen_if_show(struct seq_file *seq, void *v)
seq_puts(seq, " src_mac: ");
seq_printf(seq, "%pM ",
- is_zero_ether_addr(pkt_dev->src_mac) ?
+ eth_addr_zero(pkt_dev->src_mac) ?
pkt_dev->odev->dev_addr : pkt_dev->src_mac);
seq_printf(seq, "dst_mac: ");
@@ -2028,7 +2028,7 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
/* Default to the interface's mac if not explicitly set. */
- if (is_zero_ether_addr(pkt_dev->src_mac))
+ if (eth_addr_zero(pkt_dev->src_mac))
memcpy(&(pkt_dev->hh[6]), pkt_dev->odev->dev_addr, ETH_ALEN);
/* Set up Dest MAC */
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index 76d4c2c..5f2632f 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -2079,7 +2079,7 @@ static int rtnl_fdb_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
}
addr = nla_data(tb[NDA_LLADDR]);
- if (!is_valid_ether_addr(addr)) {
+ if (!eth_addr_valid(addr)) {
pr_info("PF_BRIDGE: RTM_NEWNEIGH with invalid ether address\n");
return -EINVAL;
}
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index e32083d..c2eaa8e 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -140,7 +140,7 @@ static int dsa_slave_set_mac_address(struct net_device *dev, void *a)
struct sockaddr *addr = a;
int err;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
if (!(dev->flags & IFF_UP))
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 4efad53..5ebd114 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -163,7 +163,7 @@ __be16 eth_type_trans(struct sk_buff *skb, struct net_device *dev)
skb_pull_inline(skb, ETH_HLEN);
eth = eth_hdr(skb);
- if (unlikely(is_multicast_ether_addr(eth->h_dest))) {
+ if (unlikely(eth_addr_multicast(eth->h_dest))) {
if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast))
skb->pkt_type = PACKET_BROADCAST;
else
@@ -287,7 +287,7 @@ int eth_mac_addr(struct net_device *dev, void *p)
if (!(dev->priv_flags & IFF_LIVE_ADDR_CHANGE) && netif_running(dev))
return -EBUSY;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
/* if device marked as NET_ADDR_RANDOM, reset it */
@@ -315,7 +315,7 @@ EXPORT_SYMBOL(eth_change_mtu);
int eth_validate_addr(struct net_device *dev)
{
- if (!is_valid_ether_addr(dev->dev_addr))
+ if (!eth_addr_valid(dev->dev_addr))
return -EADDRNOTAVAIL;
return 0;
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index 7240f8e..dd94879 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -1502,7 +1502,7 @@ static int ipgre_tap_validate(struct nlattr *tb[], struct nlattr *data[])
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 0185679..7f1810d 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1453,7 +1453,7 @@ static int ip6gre_tap_validate(struct nlattr *tb[], struct nlattr *data[])
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 05f3a31..28cc1b0 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1193,7 +1193,7 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev,
if (ether_addr_equal(mac, sdata->vif.addr))
return -EINVAL;
- if (is_multicast_ether_addr(mac))
+ if (eth_addr_multicast(mac))
return -EINVAL;
sta = sta_info_alloc(sdata, mac, GFP_KERNEL);
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 5f3620f..cd6c03a 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -747,7 +747,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
bssid = ifibss->bssid;
if (ifibss->fixed_channel)
chan = ifibss->channel;
- if (!is_zero_ether_addr(ifibss->bssid))
+ if (!eth_addr_zero(ifibss->bssid))
bssid = ifibss->bssid;
cbss = cfg80211_get_bss(local->hw.wiphy, chan, bssid,
ifibss->ssid, ifibss->ssid_len,
@@ -829,11 +829,11 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
"RX ProbeReq SA=%pM DA=%pM BSSID=%pM (tx_last_beacon=%d)\n",
mgmt->sa, mgmt->da, mgmt->bssid, tx_last_beacon);
- if (!tx_last_beacon && is_multicast_ether_addr(mgmt->da))
+ if (!tx_last_beacon && eth_addr_multicast(mgmt->da))
return;
if (!ether_addr_equal(mgmt->bssid, ifibss->bssid) &&
- !is_broadcast_ether_addr(mgmt->bssid))
+ !eth_addr_broadcast(mgmt->bssid))
return;
end = ((u8 *) mgmt) + len;
@@ -1157,7 +1157,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
active_ibss = ieee80211_sta_active_ibss(sdata);
- if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) {
+ if (!active_ibss && !eth_addr_zero(ifibss->bssid)) {
capability = WLAN_CAPABILITY_IBSS;
if (ifibss->privacy)
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 8c80455..c218341 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1185,7 +1185,7 @@ static inline struct ieee80211_local *hw_to_local(
static inline int ieee80211_bssid_match(const u8 *raddr, const u8 *addr)
{
return ether_addr_equal(raddr, addr) ||
- is_broadcast_ether_addr(raddr);
+ eth_addr_broadcast(raddr);
}
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 6f8a73c..6292fa4 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -427,7 +427,7 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
switch (sdata->vif.type) {
case NL80211_IFTYPE_WDS:
- if (!is_valid_ether_addr(sdata->u.wds.remote_addr))
+ if (!eth_addr_valid(sdata->u.wds.remote_addr))
return -ENOLINK;
break;
case NL80211_IFTYPE_AP_VLAN: {
@@ -482,13 +482,13 @@ int ieee80211_do_open(struct wireless_dev *wdev, bool coming_up)
* Copy the hopefully now-present MAC address to
* this interface, if it has the special null one.
*/
- if (dev && is_zero_ether_addr(dev->dev_addr)) {
+ if (dev && eth_addr_zero(dev->dev_addr)) {
memcpy(dev->dev_addr,
local->hw.wiphy->perm_addr,
ETH_ALEN);
memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN);
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
res = -EADDRNOTAVAIL;
goto err_stop;
}
@@ -647,7 +647,7 @@ static int ieee80211_open(struct net_device *dev)
int err;
/* fail early if user set an invalid address */
- if (!is_valid_ether_addr(dev->dev_addr))
+ if (!eth_addr_valid(dev->dev_addr))
return -EADDRNOTAVAIL;
err = ieee80211_check_concurrent_iface(sdata, sdata->vif.type);
@@ -1320,7 +1320,7 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local,
/* default ... something at least */
memcpy(perm_addr, local->hw.wiphy->perm_addr, ETH_ALEN);
- if (is_zero_ether_addr(local->hw.wiphy->addr_mask) &&
+ if (eth_addr_zero(local->hw.wiphy->addr_mask) &&
local->hw.wiphy->n_addresses <= 1)
return;
@@ -1376,7 +1376,7 @@ static void ieee80211_assign_perm_addr(struct ieee80211_local *local,
}
/* try mask if available */
- if (is_zero_ether_addr(local->hw.wiphy->addr_mask))
+ if (eth_addr_zero(local->hw.wiphy->addr_mask))
break;
m = local->hw.wiphy->addr_mask;
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index ff0296c..60bdef7 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -473,7 +473,7 @@ void ieee80211_mesh_root_setup(struct ieee80211_if_mesh *ifmsh)
int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc,
const u8 *meshda, const u8 *meshsa)
{
- if (is_multicast_ether_addr(meshda)) {
+ if (eth_addr_multicast(meshda)) {
*fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS);
/* DA TA SA */
memcpy(hdr->addr1, meshda, ETH_ALEN);
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 47aeee2..46c162b 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -539,7 +539,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
target_sn = ++ifmsh->sn;
ifmsh->last_sn_update = jiffies;
}
- } else if (is_broadcast_ether_addr(target_addr) &&
+ } else if (eth_addr_broadcast(target_addr) &&
(target_flags & IEEE80211_PREQ_TO_FLAG)) {
rcu_read_lock();
mpath = mesh_path_lookup(orig_addr, sdata);
@@ -621,7 +621,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata,
hopcount, ttl, cpu_to_le32(lifetime),
cpu_to_le32(metric), cpu_to_le32(preq_id),
sdata);
- if (!is_multicast_ether_addr(da))
+ if (!eth_addr_multicast(da))
ifmsh->mshstats.fwded_unicast++;
else
ifmsh->mshstats.fwded_mcast++;
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index aa74981..e86a6e4 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -510,7 +510,7 @@ int mesh_path_add(u8 *dst, struct ieee80211_sub_if_data *sdata)
/* never add ourselves as neighbours */
return -ENOTSUPP;
- if (is_multicast_ether_addr(dst))
+ if (eth_addr_multicast(dst))
return -ENOTSUPP;
if (atomic_add_unless(&sdata->u.mesh.mpaths, 1, MESH_MAX_MPATHS) == 0)
@@ -645,7 +645,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, struct ieee80211_sub_if_data *sdata)
/* never add ourselves as neighbours */
return -ENOTSUPP;
- if (is_multicast_ether_addr(dst))
+ if (eth_addr_multicast(dst))
return -ENOTSUPP;
err = -ENOMEM;
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 3ab34d8..3b327d6 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -594,7 +594,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
if (len < IEEE80211_MIN_ACTION_SIZE + 3)
return;
- if (is_multicast_ether_addr(mgmt->da)) {
+ if (eth_addr_multicast(mgmt->da)) {
mpl_dbg(sdata,
"Mesh plink: ignore frame from multicast address\n");
return;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index e714ed8..b0f2d64 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -423,7 +423,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
memcpy(mgmt->bssid, assoc_data->bss->bssid, ETH_ALEN);
- if (!is_zero_ether_addr(assoc_data->prev_bssid)) {
+ if (!eth_addr_zero(assoc_data->prev_bssid)) {
skb_put(skb, 10);
mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
IEEE80211_STYPE_REASSOC_REQ);
@@ -1491,7 +1491,7 @@ void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
* data idle periods for sending the periodic probe request to the
* AP we're connected to.
*/
- if (is_multicast_ether_addr(hdr->addr1))
+ if (eth_addr_multicast(hdr->addr1))
return;
ieee80211_sta_reset_conn_monitor(sdata);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 61c621e..8b79842 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -457,7 +457,7 @@ static int ieee80211_is_unicast_robust_mgmt_frame(struct sk_buff *skb)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
- if (skb->len < 24 || is_multicast_ether_addr(hdr->addr1))
+ if (skb->len < 24 || eth_addr_multicast(hdr->addr1))
return 0;
return ieee80211_is_robust_mgmt_frame(hdr);
@@ -468,7 +468,7 @@ static int ieee80211_is_multicast_robust_mgmt_frame(struct sk_buff *skb)
{
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
- if (skb->len < 24 || !is_multicast_ether_addr(hdr->addr1))
+ if (skb->len < 24 || !eth_addr_multicast(hdr->addr1))
return 0;
return ieee80211_is_robust_mgmt_frame(hdr);
@@ -482,7 +482,7 @@ static int ieee80211_get_mmie_keyidx(struct sk_buff *skb)
struct ieee80211_mmie *mmie;
if (skb->len < 24 + sizeof(*mmie) ||
- !is_multicast_ether_addr(hdr->da))
+ !eth_addr_multicast(hdr->da))
return -1;
if (!ieee80211_is_robust_mgmt_frame((struct ieee80211_hdr *) hdr))
@@ -505,7 +505,7 @@ ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx)
char *dev_addr = rx->sdata->vif.addr;
if (ieee80211_is_data(hdr->frame_control)) {
- if (is_multicast_ether_addr(hdr->addr1)) {
+ if (eth_addr_multicast(hdr->addr1)) {
if (ieee80211_has_tods(hdr->frame_control) ||
!ieee80211_has_fromds(hdr->frame_control))
return RX_DROP_MONITOR;
@@ -841,7 +841,7 @@ ieee80211_rx_h_check(struct ieee80211_rx_data *rx)
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb);
/* Drop duplicate 802.11 retransmissions (IEEE 802.11 Chap. 9.2.9) */
- if (rx->sta && !is_multicast_ether_addr(hdr->addr1)) {
+ if (rx->sta && !eth_addr_multicast(hdr->addr1)) {
if (unlikely(ieee80211_has_retry(hdr->frame_control) &&
rx->sta->last_seq_ctrl[rx->seqno_idx] ==
hdr->seq_ctrl)) {
@@ -965,7 +965,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
if (!ieee80211_has_protected(fc))
mmie_keyidx = ieee80211_get_mmie_keyidx(rx->skb);
- if (!is_multicast_ether_addr(hdr->addr1) && sta_ptk) {
+ if (!eth_addr_multicast(hdr->addr1) && sta_ptk) {
rx->key = sta_ptk;
if ((status->flag & RX_FLAG_DECRYPTED) &&
(status->flag & RX_FLAG_IV_STRIPPED))
@@ -998,7 +998,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
int i;
if (ieee80211_is_mgmt(fc) &&
- is_multicast_ether_addr(hdr->addr1) &&
+ eth_addr_multicast(hdr->addr1) &&
(key = rcu_dereference(rx->sdata->default_mgmt_key)))
rx->key = key;
else {
@@ -1048,7 +1048,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
keyidx = keyid >> 6;
/* check per-station GTK first, if multicast packet */
- if (is_multicast_ether_addr(hdr->addr1) && rx->sta)
+ if (eth_addr_multicast(hdr->addr1) && rx->sta)
rx->key = rcu_dereference(rx->sta->gtk[keyidx]);
/* if not found, try default key */
@@ -1063,7 +1063,7 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
if (rx->key &&
rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP40 &&
rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP104 &&
- !is_multicast_ether_addr(hdr->addr1))
+ !eth_addr_multicast(hdr->addr1))
rx->key = NULL;
}
}
@@ -1290,7 +1290,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx)
sta->last_rx_rate_flag = status->flag;
}
}
- } else if (!is_multicast_ether_addr(hdr->addr1)) {
+ } else if (!eth_addr_multicast(hdr->addr1)) {
/*
* Mesh beacons will update last_rx when if they are found to
* match the current local configuration when processed.
@@ -1467,7 +1467,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
if (likely((!ieee80211_has_morefrags(fc) && frag == 0) ||
(rx->skb)->len < 24 ||
- is_multicast_ether_addr(hdr->addr1))) {
+ eth_addr_multicast(hdr->addr1))) {
/* not fragmented */
goto out;
}
@@ -1563,7 +1563,7 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
out:
if (rx->sta)
rx->sta->rx_packets++;
- if (is_multicast_ether_addr(hdr->addr1))
+ if (eth_addr_multicast(hdr->addr1))
rx->local->dot11MulticastReceivedFrameCount++;
else
ieee80211_led_rx(rx->local);
@@ -1680,7 +1680,7 @@ __ieee80211_data_to_8023(struct ieee80211_rx_data *rx, bool *port_control)
check_port_control = true;
}
- if (is_multicast_ether_addr(hdr->addr1) &&
+ if (eth_addr_multicast(hdr->addr1) &&
sdata->vif.type == NL80211_IFTYPE_AP_VLAN && sdata->u.vlan.sta)
return -1;
@@ -1743,7 +1743,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
!(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) &&
(status->rx_flags & IEEE80211_RX_RA_MATCH) &&
(sdata->vif.type != NL80211_IFTYPE_AP_VLAN || !sdata->u.vlan.sta)) {
- if (is_multicast_ether_addr(ehdr->h_dest)) {
+ if (eth_addr_multicast(ehdr->h_dest)) {
/*
* send multicast frames both to higher layers in
* local net stack and back to the wireless medium
@@ -1839,7 +1839,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
!rx->sdata->u.vlan.sta)
return RX_DROP_UNUSABLE;
- if (is_multicast_ether_addr(hdr->addr1) &&
+ if (eth_addr_multicast(hdr->addr1) &&
((rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN &&
rx->sdata->u.vlan.sta) ||
(rx->sdata->vif.type == NL80211_IFTYPE_STATION &&
@@ -1893,7 +1893,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
/* frame is in RMC, don't forward */
if (ieee80211_is_data(hdr->frame_control) &&
- is_multicast_ether_addr(hdr->addr1) &&
+ eth_addr_multicast(hdr->addr1) &&
mesh_rmc_check(hdr->addr3, mesh_hdr, rx->sdata))
return RX_DROP_MONITOR;
@@ -1908,7 +1908,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
char *proxied_addr;
char *mpp_addr;
- if (is_multicast_ether_addr(hdr->addr1)) {
+ if (eth_addr_multicast(hdr->addr1)) {
mpp_addr = hdr->addr3;
proxied_addr = mesh_hdr->eaddr1;
} else {
@@ -1930,7 +1930,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
}
/* Frame has reached destination. Don't forward */
- if (!is_multicast_ether_addr(hdr->addr1) &&
+ if (!eth_addr_multicast(hdr->addr1) &&
ether_addr_equal(sdata->vif.addr, hdr->addr3))
return RX_CONTINUE;
@@ -1965,7 +1965,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
info->control.vif = &rx->sdata->vif;
info->control.jiffies = jiffies;
- if (is_multicast_ether_addr(fwd_hdr->addr1)) {
+ if (eth_addr_multicast(fwd_hdr->addr1)) {
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_mcast);
memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
} else if (!mesh_nexthop_lookup(fwd_skb, sdata)) {
@@ -1982,7 +1982,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_frames);
ieee80211_add_pending_skb(local, fwd_skb);
out:
- if (is_multicast_ether_addr(hdr->addr1) ||
+ if (eth_addr_multicast(hdr->addr1) ||
sdata->dev->flags & IFF_PROMISC)
return RX_CONTINUE;
else
@@ -2041,7 +2041,7 @@ ieee80211_rx_h_data(struct ieee80211_rx_data *rx)
dev->stats.rx_bytes += rx->skb->len;
if (local->ps_sdata && local->hw.conf.dynamic_ps_timeout > 0 &&
- !is_multicast_ether_addr(
+ !eth_addr_multicast(
((struct ethhdr *)rx->skb->data)->h_dest) &&
(!local->scanning &&
!test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state))) {
@@ -2461,7 +2461,7 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx)
sdata->vif.type == NL80211_IFTYPE_AP_VLAN))
return RX_DROP_MONITOR;
- if (is_multicast_ether_addr(mgmt->da))
+ if (eth_addr_multicast(mgmt->da))
return RX_DROP_MONITOR;
/* do not return rejected action frames */
@@ -2509,8 +2509,8 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx)
case cpu_to_le16(IEEE80211_STYPE_REASSOC_RESP):
case cpu_to_le16(IEEE80211_STYPE_DEAUTH):
case cpu_to_le16(IEEE80211_STYPE_DISASSOC):
- if (is_multicast_ether_addr(mgmt->da) &&
- !is_broadcast_ether_addr(mgmt->da))
+ if (eth_addr_multicast(mgmt->da) &&
+ !eth_addr_broadcast(mgmt->da))
return RX_DROP_MONITOR;
/* process only for station */
@@ -2762,7 +2762,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx,
struct sk_buff *skb = rx->skb;
struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(skb);
u8 *bssid = ieee80211_get_bssid(hdr, skb->len, sdata->vif.type);
- int multicast = is_multicast_ether_addr(hdr->addr1);
+ int multicast = eth_addr_multicast(hdr->addr1);
switch (sdata->vif.type) {
case NL80211_IFTYPE_STATION:
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 797dd36..430db47 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -364,7 +364,7 @@ static int sta_info_insert_check(struct sta_info *sta)
return -ENETDOWN;
if (WARN_ON(ether_addr_equal(sta->sta.addr, sdata->vif.addr) ||
- is_multicast_ether_addr(sta->sta.addr)))
+ eth_addr_multicast(sta->sta.addr)))
return -EINVAL;
return 0;
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 3af0cc4..04ba926 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -288,7 +288,7 @@ static void ieee80211_add_tx_radiotap_header(struct ieee80211_supported_band
/* IEEE80211_RADIOTAP_TX_FLAGS */
txflags = 0;
if (!(info->flags & IEEE80211_TX_STAT_ACK) &&
- !is_multicast_ether_addr(hdr->addr1))
+ !eth_addr_multicast(hdr->addr1))
txflags |= IEEE80211_RADIOTAP_F_TX_FAIL;
if ((info->status.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) ||
@@ -482,7 +482,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
if (info->flags & IEEE80211_TX_STAT_ACK) {
if (ieee80211_is_first_frag(hdr->seq_ctrl)) {
local->dot11TransmittedFrameCount++;
- if (is_multicast_ether_addr(hdr->addr1))
+ if (eth_addr_multicast(hdr->addr1))
local->dot11MulticastTransmittedFrameCount++;
if (retry_count > 0)
local->dot11RetryCount++;
@@ -494,7 +494,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
* with an individual address in the address 1 field or an MPDU
* with a multicast address in the address 1 field of type Data
* or Management. */
- if (!is_multicast_ether_addr(hdr->addr1) ||
+ if (!eth_addr_multicast(hdr->addr1) ||
ieee80211_is_data(fc) ||
ieee80211_is_mgmt(fc))
local->dot11TransmittedFragmentCount++;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index c9bf83f..c5e251d 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -532,14 +532,14 @@ ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx)
else if (tx->sta && (key = rcu_dereference(tx->sta->ptk)))
tx->key = key;
else if (ieee80211_is_mgmt(hdr->frame_control) &&
- is_multicast_ether_addr(hdr->addr1) &&
+ eth_addr_multicast(hdr->addr1) &&
ieee80211_is_robust_mgmt_frame(hdr) &&
(key = rcu_dereference(tx->sdata->default_mgmt_key)))
tx->key = key;
- else if (is_multicast_ether_addr(hdr->addr1) &&
+ else if (eth_addr_multicast(hdr->addr1) &&
(key = rcu_dereference(tx->sdata->default_multicast_key)))
tx->key = key;
- else if (!is_multicast_ether_addr(hdr->addr1) &&
+ else if (!eth_addr_multicast(hdr->addr1) &&
(key = rcu_dereference(tx->sdata->default_unicast_key)))
tx->key = key;
else if (info->flags & IEEE80211_TX_CTL_INJECTED)
@@ -693,7 +693,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx)
(info->flags & IEEE80211_TX_CTL_NO_ACK)))
info->control.rates[0].count = 1;
- if (is_multicast_ether_addr(hdr->addr1)) {
+ if (eth_addr_multicast(hdr->addr1)) {
/*
* XXX: verify the rate is in the basic rateset
*/
@@ -1036,7 +1036,7 @@ ieee80211_tx_h_calculate_duration(struct ieee80211_tx_data *tx)
next_len = next->len;
} else
next_len = 0;
- group_addr = is_multicast_ether_addr(hdr->addr1);
+ group_addr = eth_addr_multicast(hdr->addr1);
hdr->duration_id =
ieee80211_duration(tx, skb, group_addr, next_len);
@@ -1174,7 +1174,7 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
}
}
- if (is_multicast_ether_addr(hdr->addr1)) {
+ if (eth_addr_multicast(hdr->addr1)) {
tx->flags &= ~IEEE80211_TX_UNICAST;
info->flags |= IEEE80211_TX_CTL_NO_ACK;
} else
@@ -1475,7 +1475,7 @@ void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
if (ieee80211_vif_is_mesh(&sdata->vif) &&
ieee80211_is_data(hdr->frame_control) &&
- !is_multicast_ether_addr(hdr->addr1) &&
+ !eth_addr_multicast(hdr->addr1) &&
mesh_nexthop_resolve(skb, sdata)) {
/* skb queued: don't free */
rcu_read_unlock();
@@ -1787,7 +1787,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
goto fail;
}
rcu_read_lock();
- if (!is_multicast_ether_addr(skb->data)) {
+ if (!eth_addr_multicast(skb->data)) {
mpath = mesh_path_lookup(skb->data, sdata);
if (!mpath)
mppath = mpp_path_lookup(skb->data, sdata);
@@ -1823,7 +1823,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc,
mesh_da, sdata->vif.addr);
- if (is_multicast_ether_addr(mesh_da))
+ if (eth_addr_multicast(mesh_da))
/* DA TA mSA AE:SA */
meshhdrlen =
ieee80211_new_mesh_header(&mesh_hdr,
@@ -1913,7 +1913,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
* if it is a multicast address (which can only happen
* in AP mode)
*/
- multicast = is_multicast_ether_addr(hdr.addr1);
+ multicast = eth_addr_multicast(hdr.addr1);
if (!multicast) {
rcu_read_lock();
sta = sta_info_get(sdata, hdr.addr1);
@@ -1939,7 +1939,7 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
* EAPOL frames from the local station.
*/
if (unlikely(!ieee80211_vif_is_mesh(&sdata->vif) &&
- !is_multicast_ether_addr(hdr.addr1) && !authorized &&
+ !eth_addr_multicast(hdr.addr1) && !authorized &&
(cpu_to_be16(ethertype) != sdata->control_port_protocol ||
!ether_addr_equal(sdata->vif.addr, skb->data + ETH_ALEN)))) {
#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index cea06e9..f64d446 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -141,7 +141,7 @@ u16 ieee80211_select_queue(struct ieee80211_sub_if_data *sdata,
break;
}
- if (!sta && ra && !is_multicast_ether_addr(ra)) {
+ if (!sta && ra && !eth_addr_multicast(ra)) {
sta = sta_info_get(sdata, ra);
if (sta)
qos = test_sta_flag(sta, WLAN_STA_WME);
@@ -176,7 +176,7 @@ void ieee80211_set_qos_hdr(struct ieee80211_sub_if_data *sdata,
/* preserve EOSP bit */
ack_policy = *p & IEEE80211_QOS_CTL_EOSP;
- if (is_multicast_ether_addr(hdr->addr1) ||
+ if (eth_addr_multicast(hdr->addr1) ||
sdata->noack_map & BIT(tid)) {
ack_policy |= IEEE80211_QOS_CTL_ACK_POLICY_NOACK;
info->flags |= IEEE80211_TX_CTL_NO_ACK;
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 98c7063..70addfe 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -540,13 +540,13 @@ static int parse_icmpv6(struct sk_buff *skb, struct sw_flow_key *key,
*/
if (nd_opt->nd_opt_type == ND_OPT_SOURCE_LL_ADDR
&& opt_len == 8) {
- if (unlikely(!is_zero_ether_addr(key->ipv6.nd.sll)))
+ if (unlikely(!eth_addr_zero(key->ipv6.nd.sll)))
goto invalid;
memcpy(key->ipv6.nd.sll,
&nd->opt[offset+sizeof(*nd_opt)], ETH_ALEN);
} else if (nd_opt->nd_opt_type == ND_OPT_TARGET_LL_ADDR
&& opt_len == 8) {
- if (unlikely(!is_zero_ether_addr(key->ipv6.nd.tll)))
+ if (unlikely(!eth_addr_zero(key->ipv6.nd.tll)))
goto invalid;
memcpy(key->ipv6.nd.tll,
&nd->opt[offset+sizeof(*nd_opt)], ETH_ALEN);
diff --git a/net/openvswitch/vport-internal_dev.c b/net/openvswitch/vport-internal_dev.c
index 5d460c3..96a02c9 100644
--- a/net/openvswitch/vport-internal_dev.c
+++ b/net/openvswitch/vport-internal_dev.c
@@ -67,7 +67,7 @@ static int internal_dev_mac_addr(struct net_device *dev, void *p)
{
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 443d4d7..8048685 100644
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
@@ -468,7 +468,7 @@ int wiphy_register(struct wiphy *wiphy)
return -EINVAL;
if (WARN_ON(wiphy->addresses &&
- !is_zero_ether_addr(wiphy->perm_addr) &&
+ !eth_addr_zero(wiphy->perm_addr) &&
memcmp(wiphy->perm_addr, wiphy->addresses[0].addr,
ETH_ALEN)))
return -EINVAL;
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index ca5672f..21a7dce 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -479,7 +479,7 @@ int cfg80211_ibss_wext_siwap(struct net_device *dev,
return -EINVAL;
/* automatic mode */
- if (is_zero_ether_addr(bssid) || is_broadcast_ether_addr(bssid))
+ if (eth_addr_zero(bssid) || eth_addr_broadcast(bssid))
bssid = NULL;
/* both automatic */
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 0418a6d..fe94df8 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -4630,7 +4630,7 @@ static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb,
bss = nla_nest_start(msg, NL80211_ATTR_BSS);
if (!bss)
goto nla_put_failure;
- if ((!is_zero_ether_addr(res->bssid) &&
+ if ((!eth_addr_zero(res->bssid) &&
nla_put(msg, NL80211_BSS_BSSID, ETH_ALEN, res->bssid)) ||
(res->information_elements && res->len_information_elements &&
nla_put(msg, NL80211_BSS_INFORMATION_ELEMENTS,
@@ -5275,7 +5275,7 @@ static int nl80211_join_ibss(struct sk_buff *skb, struct genl_info *info)
if (info->attrs[NL80211_ATTR_MAC]) {
ibss.bssid = nla_data(info->attrs[NL80211_ATTR_MAC]);
- if (!is_valid_ether_addr(ibss.bssid))
+ if (!eth_addr_valid(ibss.bssid))
return -EINVAL;
}
ibss.ssid = nla_data(info->attrs[NL80211_ATTR_SSID]);
diff --git a/net/wireless/util.c b/net/wireless/util.c
index ef35f4e..b25f934 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -388,7 +388,7 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
if ((iftype != NL80211_IFTYPE_STATION &&
iftype != NL80211_IFTYPE_P2P_CLIENT &&
iftype != NL80211_IFTYPE_MESH_POINT) ||
- (is_multicast_ether_addr(dst) &&
+ (eth_addr_multicast(dst) &&
ether_addr_equal(src, addr)))
return -1;
if (iftype == NL80211_IFTYPE_MESH_POINT) {
@@ -739,7 +739,7 @@ void cfg80211_process_wdev_events(struct wireless_dev *wdev)
wdev_lock(wdev);
switch (ev->type) {
case EVENT_CONNECT_RESULT:
- if (!is_zero_ether_addr(ev->cr.bssid))
+ if (!eth_addr_zero(ev->cr.bssid))
bssid = ev->cr.bssid;
__cfg80211_connect_result(
wdev->netdev, bssid,
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 494379e..dcc9501 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -724,7 +724,7 @@ static int cfg80211_wext_siwencodeext(struct net_device *dev,
}
addr = ext->addr.sa_data;
- if (is_broadcast_ether_addr(addr))
+ if (eth_addr_broadcast(addr))
addr = NULL;
memset(¶ms, 0, sizeof(params));
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
index 1f773f6..4f2f6d8 100644
--- a/net/wireless/wext-sme.c
+++ b/net/wireless/wext-sme.c
@@ -267,7 +267,7 @@ int cfg80211_mgd_wext_siwap(struct net_device *dev,
return -EINVAL;
/* automatic mode */
- if (is_zero_ether_addr(bssid) || is_broadcast_ether_addr(bssid))
+ if (eth_addr_zero(bssid) || eth_addr_broadcast(bssid))
bssid = NULL;
cfg80211_lock_rdev(rdev);
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 04/21] wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
2012-10-19 3:55 ` [PATCH net-next 01/21] etherdevice: Rename is_<foo>_ether_addr tests to eth_addr_<foo> Joe Perches
[not found] ` <cover.1350618006.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
@ 2012-10-19 3:55 ` Joe Perches
2012-10-20 2:30 ` Bing Zhao
` (2 more replies)
2012-10-19 4:13 ` [PATCH net-next 03/21] arch: " Joe Perches
` (19 subsequent siblings)
22 siblings, 3 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 3:55 UTC (permalink / raw)
To: John W. Linville, Kalle Valo, Luis R. Rodriguez, Jouni Malinen,
Vasanthakumar Thiagarajan, Senthil Balasubramanian,
Stefano Brivio, Larry Finger, Stanislav Yakovlev,
Stanislaw Gruszka, Bing Zhao, Lennert Buytenhek,
Christian Lamparter, Jussi Kivilinna, Ivo van Doorn,
Gertjan van Wingerde, Helmut Schaa, Herton Ronaldo Krzesinski,
Hin-Tak Leung, Chaoming Li, A
Cc: Brett Rudley, Roland Vossen, Arend van Spriel,
Franky (Zhenhui) Lin, Kan Yan, Johannes Berg, Wey-Yi Guy,
Intel Linux Wireless, Luciano Coelho, linux-wireless, netdev,
linux-kernel, ath9k-devel, b43-dev, brcm80211-dev-list, users
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/adm8211.c | 2 +-
drivers/net/wireless/airo.c | 4 ++--
drivers/net/wireless/at76c50x-usb.c | 8 ++++----
drivers/net/wireless/ath/ath6kl/cfg80211.c | 8 ++++----
drivers/net/wireless/ath/ath6kl/main.c | 8 ++++----
drivers/net/wireless/ath/ath6kl/txrx.c | 10 +++++-----
drivers/net/wireless/ath/ath9k/recv.c | 8 ++++----
drivers/net/wireless/b43/main.c | 2 +-
drivers/net/wireless/b43legacy/main.c | 2 +-
.../net/wireless/brcm80211/brcmfmac/dhd_linux.c | 4 ++--
.../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 2 +-
.../net/wireless/brcm80211/brcmsmac/mac80211_if.c | 2 +-
drivers/net/wireless/brcm80211/brcmsmac/main.c | 16 ++++++++--------
drivers/net/wireless/hostap/hostap_info.c | 2 +-
drivers/net/wireless/hostap/hostap_ioctl.c | 8 ++++----
drivers/net/wireless/hostap/hostap_main.c | 2 +-
drivers/net/wireless/ipw2x00/ipw2100.c | 6 +++---
drivers/net/wireless/ipw2x00/ipw2200.c | 18 +++++++++---------
drivers/net/wireless/ipw2x00/libipw_rx.c | 12 ++++++------
drivers/net/wireless/ipw2x00/libipw_tx.c | 4 ++--
drivers/net/wireless/iwlegacy/3945-mac.c | 2 +-
drivers/net/wireless/iwlegacy/4965-mac.c | 2 +-
drivers/net/wireless/iwlegacy/common.c | 2 +-
drivers/net/wireless/iwlwifi/dvm/sta.c | 2 +-
drivers/net/wireless/libertas_tf/main.c | 2 +-
drivers/net/wireless/mwifiex/join.c | 2 +-
drivers/net/wireless/mwifiex/scan.c | 2 +-
drivers/net/wireless/mwifiex/sta_cmd.c | 2 +-
drivers/net/wireless/mwifiex/sta_cmdresp.c | 2 +-
drivers/net/wireless/mwifiex/uap_txrx.c | 2 +-
drivers/net/wireless/mwl8k.c | 2 +-
drivers/net/wireless/orinoco/wext.c | 4 ++--
drivers/net/wireless/p54/eeprom.c | 2 +-
drivers/net/wireless/rndis_wlan.c | 18 +++++++++---------
drivers/net/wireless/rt2x00/rt2400pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2500usb.c | 2 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 8 ++++----
drivers/net/wireless/rt2x00/rt61pci.c | 2 +-
drivers/net/wireless/rt2x00/rt73usb.c | 2 +-
drivers/net/wireless/rtl818x/rtl8180/dev.c | 4 ++--
drivers/net/wireless/rtl818x/rtl8187/dev.c | 4 ++--
drivers/net/wireless/rtlwifi/base.c | 6 +++---
drivers/net/wireless/rtlwifi/cam.c | 2 +-
drivers/net/wireless/rtlwifi/pci.c | 8 ++++----
drivers/net/wireless/rtlwifi/rc.c | 4 ++--
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c | 4 ++--
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | 4 ++--
drivers/net/wireless/rtlwifi/usb.c | 12 ++++++------
drivers/net/wireless/ti/wl1251/main.c | 12 ++++++------
drivers/net/wireless/ti/wlcore/cmd.c | 2 +-
drivers/net/wireless/ti/wlcore/main.c | 6 +++---
drivers/net/wireless/ti/wlcore/tx.c | 2 +-
drivers/net/wireless/wl3501_cs.c | 2 +-
drivers/net/wireless/zd1211rw/zd_mac.c | 2 +-
55 files changed, 133 insertions(+), 133 deletions(-)
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index 154a496..2fd62a0 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1853,7 +1853,7 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
*(__le16 *)&perm_addr[4] =
cpu_to_le16(ADM8211_CSR_READ(PAR1) & 0xFFFF);
- if (!is_valid_ether_addr(perm_addr)) {
+ if (!eth_addr_valid(perm_addr)) {
printk(KERN_WARNING "%s (adm8211): Invalid hwaddr in EEPROM!\n",
pci_name(pdev));
eth_random_addr(perm_addr);
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 3cd05a71..b0afd59 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -5986,8 +5986,8 @@ static int airo_set_wap(struct net_device *dev,
if (awrq->sa_family != ARPHRD_ETHER)
return -EINVAL;
- else if (is_broadcast_ether_addr(awrq->sa_data) ||
- is_zero_ether_addr(awrq->sa_data)) {
+ else if (eth_addr_broadcast(awrq->sa_data) ||
+ eth_addr_zero(awrq->sa_data)) {
memset(&cmd, 0, sizeof(cmd));
cmd.cmd=CMD_LOSE_SYNC;
if (down_interruptible(&local->sem))
diff --git a/drivers/net/wireless/at76c50x-usb.c b/drivers/net/wireless/at76c50x-usb.c
index 99b9ddf..3ed5523 100644
--- a/drivers/net/wireless/at76c50x-usb.c
+++ b/drivers/net/wireless/at76c50x-usb.c
@@ -1658,7 +1658,7 @@ static void at76_work_join_bssid(struct work_struct *work)
mutex_lock(&priv->mtx);
- if (is_valid_ether_addr(priv->bssid))
+ if (eth_addr_valid(priv->bssid))
at76_join(priv);
mutex_unlock(&priv->mtx);
@@ -1874,7 +1874,7 @@ static void at76_dwork_hw_scan(struct work_struct *work)
return;
}
- if (is_valid_ether_addr(priv->bssid))
+ if (eth_addr_valid(priv->bssid))
at76_join(priv);
mutex_unlock(&priv->mtx);
@@ -1952,7 +1952,7 @@ static int at76_config(struct ieee80211_hw *hw, u32 changed)
priv->channel = hw->conf.channel->hw_value;
- if (is_valid_ether_addr(priv->bssid))
+ if (eth_addr_valid(priv->bssid))
at76_join(priv);
else
at76_start_monitor(priv);
@@ -1980,7 +1980,7 @@ static void at76_bss_info_changed(struct ieee80211_hw *hw,
memcpy(priv->bssid, conf->bssid, ETH_ALEN);
- if (is_valid_ether_addr(priv->bssid))
+ if (eth_addr_valid(priv->bssid))
/* mac80211 is joining a bss */
at76_join(priv);
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 7089f81..42c605a 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -455,7 +455,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
if (test_bit(SKIP_SCAN, &ar->flag) &&
((sme->channel && sme->channel->center_freq == 0) ||
- (sme->bssid && is_zero_ether_addr(sme->bssid)))) {
+ (sme->bssid && eth_addr_zero(sme->bssid)))) {
ath6kl_err("SkipScan: channel or bssid invalid\n");
return -EINVAL;
}
@@ -521,7 +521,7 @@ static int ath6kl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
vif->ch_hint = sme->channel->center_freq;
memset(vif->req_bssid, 0, sizeof(vif->req_bssid));
- if (sme->bssid && !is_broadcast_ether_addr(sme->bssid))
+ if (sme->bssid && !eth_addr_broadcast(sme->bssid))
memcpy(vif->req_bssid, sme->bssid, sizeof(vif->req_bssid));
ath6kl_set_wpa_version(vif, sme->crypto.wpa_versions);
@@ -1628,7 +1628,7 @@ static int ath6kl_cfg80211_join_ibss(struct wiphy *wiphy,
}
memset(vif->req_bssid, 0, sizeof(vif->req_bssid));
- if (ibss_param->bssid && !is_broadcast_ether_addr(ibss_param->bssid))
+ if (ibss_param->bssid && !eth_addr_broadcast(ibss_param->bssid))
memcpy(vif->req_bssid, ibss_param->bssid,
sizeof(vif->req_bssid));
@@ -3066,7 +3066,7 @@ static bool ath6kl_mgmt_powersave_ap(struct ath6kl_vif *vif,
struct ath6kl *ar = vif->ar;
mgmt = (struct ieee80211_mgmt *) buf;
- if (is_multicast_ether_addr(mgmt->da))
+ if (eth_addr_multicast(mgmt->da))
return false;
conn = ath6kl_find_sta(vif, mgmt->da);
diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c
index c189e28..c90b53b 100644
--- a/drivers/net/wireless/ath/ath6kl/main.c
+++ b/drivers/net/wireless/ath/ath6kl/main.c
@@ -115,14 +115,14 @@ static u8 ath6kl_remove_sta(struct ath6kl *ar, u8 *mac, u16 reason)
{
u8 i, removed = 0;
- if (is_zero_ether_addr(mac))
+ if (eth_addr_zero(mac))
return removed;
- if (is_broadcast_ether_addr(mac)) {
+ if (eth_addr_broadcast(mac)) {
ath6kl_dbg(ATH6KL_DBG_TRC, "deleting all station\n");
for (i = 0; i < AP_MAX_NUM_STA; i++) {
- if (!is_zero_ether_addr(ar->sta_list[i].mac)) {
+ if (!eth_addr_zero(ar->sta_list[i].mac)) {
ath6kl_sta_cleanup(ar, i);
removed = 1;
}
@@ -999,7 +999,7 @@ void ath6kl_disconnect_event(struct ath6kl_vif *vif, u8 reason, u8 *bssid,
MCAST_AID, 0);
}
- if (!is_broadcast_ether_addr(bssid)) {
+ if (!eth_addr_broadcast(bssid)) {
/* send event to application */
cfg80211_del_sta(vif->ndev, bssid, GFP_KERNEL);
}
diff --git a/drivers/net/wireless/ath/ath6kl/txrx.c b/drivers/net/wireless/ath/ath6kl/txrx.c
index 7dfa0fd..159ef34 100644
--- a/drivers/net/wireless/ath/ath6kl/txrx.c
+++ b/drivers/net/wireless/ath/ath6kl/txrx.c
@@ -50,7 +50,7 @@ static u8 ath6kl_ibss_map_epid(struct sk_buff *skb, struct net_device *dev,
datap = skb->data;
eth_hdr = (struct ethhdr *) (datap + sizeof(struct wmi_data_hdr));
- if (is_multicast_ether_addr(eth_hdr->h_dest))
+ if (eth_addr_multicast(eth_hdr->h_dest))
return ENDPOINT_2;
for (i = 0; i < ar->node_num; i++) {
@@ -212,7 +212,7 @@ static bool ath6kl_powersave_ap(struct ath6kl_vif *vif, struct sk_buff *skb,
bool ps_queued = false;
struct ath6kl *ar = vif->ar;
- if (is_multicast_ether_addr(datap->h_dest)) {
+ if (eth_addr_multicast(datap->h_dest)) {
u8 ctr = 0;
bool q_mcast = false;
@@ -1544,7 +1544,7 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
if (vif->nw_type == AP_NETWORK) {
datap = (struct ethhdr *) skb->data;
- if (is_multicast_ether_addr(datap->h_dest))
+ if (eth_addr_multicast(datap->h_dest))
/*
* Bcast/Mcast frames should be sent to the
* OS stack as well as on the air.
@@ -1578,7 +1578,7 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
datap = (struct ethhdr *) skb->data;
- if (is_unicast_ether_addr(datap->h_dest)) {
+ if (eth_addr_unicast(datap->h_dest)) {
if (vif->nw_type == AP_NETWORK) {
conn = ath6kl_find_sta(vif, datap->h_source);
if (!conn)
@@ -1592,7 +1592,7 @@ void ath6kl_rx(struct htc_target *target, struct htc_packet *packet)
/* aggregation code will handle the skb */
return;
}
- } else if (!is_broadcast_ether_addr(datap->h_dest))
+ } else if (!eth_addr_broadcast(datap->h_dest))
vif->net_stats.multicast++;
ath6kl_deliver_frames_to_nw_stack(vif->ndev, skb);
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index 83d16e7..777bec9 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -595,7 +595,7 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb, bool mybeacon)
} else if ((sc->ps_flags & PS_WAIT_FOR_CAB) &&
(ieee80211_is_data(hdr->frame_control) ||
ieee80211_is_action(hdr->frame_control)) &&
- is_multicast_ether_addr(hdr->addr1) &&
+ eth_addr_multicast(hdr->addr1) &&
!ieee80211_has_moredata(hdr->frame_control)) {
/*
* No more broadcast/multicast frames to be received at this
@@ -605,7 +605,7 @@ static void ath_rx_ps(struct ath_softc *sc, struct sk_buff *skb, bool mybeacon)
ath_dbg(common, PS,
"All PS CAB frames received, back to sleep\n");
} else if ((sc->ps_flags & PS_WAIT_FOR_PSPOLL_DATA) &&
- !is_multicast_ether_addr(hdr->addr1) &&
+ !eth_addr_multicast(hdr->addr1) &&
!ieee80211_has_morefrags(hdr->frame_control)) {
sc->ps_flags &= ~PS_WAIT_FOR_PSPOLL_DATA;
ath_dbg(common, PS,
@@ -774,7 +774,7 @@ static bool ath9k_rx_accept(struct ath_common *common,
fc = hdr->frame_control;
- is_mc = !!is_multicast_ether_addr(hdr->addr1);
+ is_mc = !!eth_addr_multicast(hdr->addr1);
is_valid_tkip = rx_stats->rs_keyix != ATH9K_RXKEYIX_INVALID &&
test_bit(rx_stats->rs_keyix, common->tkip_keymap);
strip_mic = is_valid_tkip && ieee80211_is_data(fc) &&
@@ -1096,7 +1096,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp)
rxs = IEEE80211_SKB_RXCB(hdr_skb);
if (ieee80211_is_beacon(hdr->frame_control)) {
RX_STAT_INC(rx_beacons);
- if (!is_zero_ether_addr(common->curbssid) &&
+ if (!eth_addr_zero(common->curbssid) &&
ether_addr_equal(hdr->addr3, common->curbssid))
rs.is_mybeacon = true;
else
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 73730e9..3b1aca8 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -5334,7 +5334,7 @@ static struct b43_wl *b43_wireless_init(struct b43_bus_dev *dev)
wl->hw_registred = false;
hw->max_rates = 2;
SET_IEEE80211_DEV(hw, dev->dev);
- if (is_valid_ether_addr(sprom->et1mac))
+ if (eth_addr_valid(sprom->et1mac))
SET_IEEE80211_PERM_ADDR(hw, sprom->et1mac);
else
SET_IEEE80211_PERM_ADDR(hw, sprom->il0mac);
diff --git a/drivers/net/wireless/b43legacy/main.c b/drivers/net/wireless/b43legacy/main.c
index 18e208e..9f95cd6 100644
--- a/drivers/net/wireless/b43legacy/main.c
+++ b/drivers/net/wireless/b43legacy/main.c
@@ -3820,7 +3820,7 @@ static int b43legacy_wireless_init(struct ssb_device *dev)
hw->queues = 1; /* FIXME: hardware has more queues */
hw->max_rates = 2;
SET_IEEE80211_DEV(hw, dev->dev);
- if (is_valid_ether_addr(sprom->et1mac))
+ if (eth_addr_valid(sprom->et1mac))
SET_IEEE80211_PERM_ADDR(hw, sprom->et1mac);
else
SET_IEEE80211_PERM_ADDR(hw, sprom->il0mac);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
index d7c76ce..5d6b922c 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c
@@ -319,7 +319,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *ndev)
u8 *pktdata = (u8 *)(skb->data);
struct ethhdr *eh = (struct ethhdr *)pktdata;
- if (is_multicast_ether_addr(eh->h_dest))
+ if (eth_addr_multicast(eh->h_dest))
drvr->tx_multicast++;
if (ntohs(eh->h_proto) == ETH_P_PAE)
atomic_inc(&drvr->pend_8021x_cnt);
@@ -865,7 +865,7 @@ static int brcmf_net_attach(struct brcmf_if *ifp)
/*
* determine mac address to use
*/
- if (is_valid_ether_addr(ifp->mac_addr))
+ if (eth_addr_valid(ifp->mac_addr))
memcpy(temp_addr, ifp->mac_addr, ETH_ALEN);
else
memcpy(temp_addr, drvr->mac, ETH_ALEN);
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index c1abaa6..d773906 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -1999,7 +1999,7 @@ brcmf_add_keyext(struct wiphy *wiphy, struct net_device *ndev,
key.index = (u32) key_idx;
/* Instead of bcast for ea address for default wep keys,
driver needs it to be Null */
- if (!is_multicast_ether_addr(mac_addr))
+ if (!eth_addr_multicast(mac_addr))
memcpy((char *)&key.ea, (void *)mac_addr, ETH_ALEN);
key.len = (u32) params->key_len;
bssidx = brcmf_find_bssidx(cfg, ndev);
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
index a744ea5..f502527 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c
@@ -1062,7 +1062,7 @@ static struct brcms_info *brcms_attach(struct bcma_device *pdev)
brcms_c_regd_init(wl->wlc);
memcpy(perm, &wl->pub->cur_etheraddr, ETH_ALEN);
- if (WARN_ON(!is_valid_ether_addr(perm)))
+ if (WARN_ON(!eth_addr_valid(perm)))
goto fail;
SET_IEEE80211_PERM_ADDR(hw, perm);
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 75086b3..bbe0937 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -1902,7 +1902,7 @@ static void brcms_c_get_macaddr(struct brcms_hardware *wlc_hw, u8 etheraddr[ETH_
struct ssb_sprom *sprom = &wlc_hw->d11core->bus->sprom;
/* If macaddr exists, use it (Sromrev4, CIS, ...). */
- if (!is_zero_ether_addr(sprom->il0mac)) {
+ if (!eth_addr_zero(sprom->il0mac)) {
memcpy(etheraddr, sprom->il0mac, 6);
return;
}
@@ -4707,8 +4707,8 @@ static int brcms_b_attach(struct brcms_c_info *wlc, struct bcma_device *core,
/* init etheraddr state variables */
brcms_c_get_macaddr(wlc_hw, wlc_hw->etheraddr);
- if (is_broadcast_ether_addr(wlc_hw->etheraddr) ||
- is_zero_ether_addr(wlc_hw->etheraddr)) {
+ if (eth_addr_broadcast(wlc_hw->etheraddr) ||
+ eth_addr_zero(wlc_hw->etheraddr)) {
wiphy_err(wiphy, "wl%d: brcms_b_attach: bad macaddr\n",
unit);
err = 22;
@@ -6764,7 +6764,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
if (!rspec_active(rspec[k])) {
rspec[k] = BRCM_RATE_1M;
} else {
- if (!is_multicast_ether_addr(h->addr1)) {
+ if (!eth_addr_multicast(h->addr1)) {
/* set tx antenna config */
brcms_c_antsel_antcfg_get(wlc->asi, false,
false, 0, 0, &antcfg, &fbantcfg);
@@ -6905,7 +6905,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
/* (2) PROTECTION, may change rspec */
if ((ieee80211_is_data(h->frame_control) ||
ieee80211_is_mgmt(h->frame_control)) &&
- (phylen > wlc->RTSThresh) && !is_multicast_ether_addr(h->addr1))
+ (phylen > wlc->RTSThresh) && !eth_addr_multicast(h->addr1))
use_rts = true;
/* (3) PLCP: determine PLCP header and MAC duration,
@@ -6928,7 +6928,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
/* DUR field for main rate */
if (!ieee80211_is_pspoll(h->frame_control) &&
- !is_multicast_ether_addr(h->addr1) && !use_rifs) {
+ !eth_addr_multicast(h->addr1) && !use_rifs) {
durid =
brcms_c_compute_frame_dur(wlc, rspec[0], preamble_type[0],
next_frag_len);
@@ -6946,7 +6946,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
/* DUR field for fallback rate */
if (ieee80211_is_pspoll(h->frame_control))
txh->FragDurFallback = h->duration_id;
- else if (is_multicast_ether_addr(h->addr1) || use_rifs)
+ else if (eth_addr_multicast(h->addr1) || use_rifs)
txh->FragDurFallback = 0;
else {
durid = brcms_c_compute_frame_dur(wlc, rspec[1],
@@ -6958,7 +6958,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
if (frag == 0)
mcl |= TXC_STARTMSDU;
- if (!is_multicast_ether_addr(h->addr1))
+ if (!eth_addr_multicast(h->addr1))
mcl |= TXC_IMMEDACK;
if (wlc->band->bandtype == BRCM_BAND_5G)
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c
index 970a48b..239e213 100644
--- a/drivers/net/wireless/hostap/hostap_info.c
+++ b/drivers/net/wireless/hostap/hostap_info.c
@@ -464,7 +464,7 @@ static void handle_info_queue_scanresults(local_info_t *local)
prism2_host_roaming(local);
if (local->host_roaming == 2 && local->iw_mode == IW_MODE_INFRA &&
- !is_zero_ether_addr(local->preferred_ap)) {
+ !eth_addr_zero(local->preferred_ap)) {
/*
* Firmware seems to be getting into odd state in host_roaming
* mode 2 when hostscan is used without join command, so try
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index ac07473..e37beee 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -3222,7 +3222,7 @@ static int prism2_ioctl_siwencodeext(struct net_device *dev,
return -EINVAL;
addr = ext->addr.sa_data;
- if (is_broadcast_ether_addr(addr)) {
+ if (eth_addr_broadcast(addr)) {
sta_ptr = NULL;
crypt = &local->crypt_info.crypt[i];
} else {
@@ -3394,7 +3394,7 @@ static int prism2_ioctl_giwencodeext(struct net_device *dev,
i--;
addr = ext->addr.sa_data;
- if (is_broadcast_ether_addr(addr)) {
+ if (eth_addr_broadcast(addr)) {
sta_ptr = NULL;
crypt = &local->crypt_info.crypt[i];
} else {
@@ -3457,7 +3457,7 @@ static int prism2_ioctl_set_encryption(local_info_t *local,
param->u.crypt.key_len)
return -EINVAL;
- if (is_broadcast_ether_addr(param->sta_addr)) {
+ if (eth_addr_broadcast(param->sta_addr)) {
if (param->u.crypt.idx >= WEP_KEYS)
return -EINVAL;
sta_ptr = NULL;
@@ -3590,7 +3590,7 @@ static int prism2_ioctl_get_encryption(local_info_t *local,
if (max_key_len < 0)
return -EINVAL;
- if (is_broadcast_ether_addr(param->sta_addr)) {
+ if (eth_addr_broadcast(param->sta_addr)) {
sta_ptr = NULL;
if (param->u.crypt.idx >= WEP_KEYS)
param->u.crypt.idx = local->crypt_info.tx_keyidx;
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 15f0fad..19197ed 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -1084,7 +1084,7 @@ int prism2_sta_deauth(local_info_t *local, u16 reason)
__le16 val = cpu_to_le16(reason);
if (local->iw_mode != IW_MODE_INFRA ||
- is_zero_ether_addr(local->bssid) ||
+ eth_addr_zero(local->bssid) ||
memcmp(local->bssid, "\x44\x44\x44\x44\x44\x44", ETH_ALEN) == 0)
return 0;
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 29b8fa1..a67ba42 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -5821,7 +5821,7 @@ static int ipw2100_set_address(struct net_device *dev, void *p)
struct sockaddr *addr = p;
int err = 0;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
mutex_lock(&priv->action_mutex);
@@ -6972,8 +6972,8 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
goto done;
}
- if (is_broadcast_ether_addr(wrqu->ap_addr.sa_data) ||
- is_zero_ether_addr(wrqu->ap_addr.sa_data)) {
+ if (eth_addr_broadcast(wrqu->ap_addr.sa_data) ||
+ eth_addr_zero(wrqu->ap_addr.sa_data)) {
/* we disable mandatory BSSID association */
IPW_DEBUG_WX("exit - disable mandatory BSSID\n");
priv->config &= ~CFG_STATIC_BSSID;
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 935120f..cf64853 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -7277,7 +7277,7 @@ static int ipw_is_qos_active(struct net_device *dev,
struct libipw_qos_data *qos_data = NULL;
int active, supported;
u8 *daddr = skb->data + ETH_ALEN;
- int unicast = !is_multicast_ether_addr(daddr);
+ int unicast = !eth_addr_multicast(daddr);
if (!(priv->status & STATUS_ASSOCIATED))
return 0;
@@ -7836,7 +7836,7 @@ static void ipw_handle_data_packet(struct ipw_priv *priv,
/* HW decrypt will not clear the WEP bit, MIC, PN, etc. */
hdr = (struct libipw_hdr_4addr *)rxb->skb->data;
if (priv->ieee->iw_mode != IW_MODE_MONITOR &&
- (is_multicast_ether_addr(hdr->addr1) ?
+ (eth_addr_multicast(hdr->addr1) ?
!priv->ieee->host_mc_decrypt : !priv->ieee->host_decrypt))
ipw_rebuild_decrypted_skb(priv, rxb->skb);
@@ -8222,7 +8222,7 @@ static int is_network_packet(struct ipw_priv *priv,
return 0;
/* {broad,multi}cast packets to our BSSID go through */
- if (is_multicast_ether_addr(header->addr1))
+ if (eth_addr_multicast(header->addr1))
return !memcmp(header->addr3, priv->bssid, ETH_ALEN);
/* packets to our adapter go through */
@@ -8235,7 +8235,7 @@ static int is_network_packet(struct ipw_priv *priv,
return 0;
/* {broad,multi}cast packets to our BSS go through */
- if (is_multicast_ether_addr(header->addr1))
+ if (eth_addr_multicast(header->addr1))
return !memcmp(header->addr2, priv->bssid, ETH_ALEN);
/* packets to our adapter go through */
@@ -9040,8 +9040,8 @@ static int ipw_wx_set_wap(struct net_device *dev,
if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
return -EINVAL;
mutex_lock(&priv->mutex);
- if (is_broadcast_ether_addr(wrqu->ap_addr.sa_data) ||
- is_zero_ether_addr(wrqu->ap_addr.sa_data)) {
+ if (eth_addr_broadcast(wrqu->ap_addr.sa_data) ||
+ eth_addr_zero(wrqu->ap_addr.sa_data)) {
/* we disable mandatory BSSID association */
IPW_DEBUG_WX("Setting AP BSSID to ANY\n");
priv->config &= ~CFG_STATIC_BSSID;
@@ -10240,7 +10240,7 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct libipw_txb *txb,
hdr_len = libipw_get_hdrlen(le16_to_cpu(hdr->frame_ctl));
switch (priv->ieee->iw_mode) {
case IW_MODE_ADHOC:
- unicast = !is_multicast_ether_addr(hdr->addr1);
+ unicast = !eth_addr_multicast(hdr->addr1);
id = ipw_find_station(priv, hdr->addr1);
if (id == IPW_INVALID_STATION) {
id = ipw_add_station(priv, hdr->addr1);
@@ -10255,7 +10255,7 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct libipw_txb *txb,
case IW_MODE_INFRA:
default:
- unicast = !is_multicast_ether_addr(hdr->addr3);
+ unicast = !eth_addr_multicast(hdr->addr3);
id = 0;
break;
}
@@ -10541,7 +10541,7 @@ static int ipw_net_set_mac_address(struct net_device *dev, void *p)
struct ipw_priv *priv = libipw_priv(dev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
mutex_lock(&priv->mutex);
priv->config |= CFG_CUSTOM_MAC;
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
index 02e0579..347b88a 100644
--- a/drivers/net/wireless/ipw2x00/libipw_rx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
@@ -416,8 +416,8 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
return 1;
}
- can_be_decrypted = (is_multicast_ether_addr(hdr->addr1) ||
- is_broadcast_ether_addr(hdr->addr2)) ?
+ can_be_decrypted = (eth_addr_multicast(hdr->addr1) ||
+ eth_addr_broadcast(hdr->addr2)) ?
ieee->host_mc_decrypt : ieee->host_decrypt;
if (can_be_decrypted) {
@@ -442,7 +442,7 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
* 802.11, but makes it easier to use different keys with
* stations that do not support WEP key mapping). */
- if (is_unicast_ether_addr(hdr->addr1) || local->bcrx_sta_key)
+ if (eth_addr_unicast(hdr->addr1) || local->bcrx_sta_key)
(void)hostap_handle_sta_crypto(local, hdr, &crypt,
&sta);
#endif
@@ -772,7 +772,7 @@ int libipw_rx(struct libipw_device *ieee, struct sk_buff *skb,
#ifdef NOT_YET
if (ieee->iw_mode == IW_MODE_MASTER && !wds && ieee->ap->bridge_packets) {
- if (is_multicast_ether_addr(dst)) {
+ if (eth_addr_multicast(dst)) {
/* copy multicast frame both to the higher layers and
* to the wireless media */
ieee->ap->bridged_multicast++;
@@ -883,7 +883,7 @@ void libipw_rx_any(struct libipw_device *ieee,
else if (memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN) == 0)
is_packet_for_us = 1;
/* mcast */
- else if (is_multicast_ether_addr(hdr->addr1))
+ else if (eth_addr_multicast(hdr->addr1))
is_packet_for_us = 1;
}
break;
@@ -898,7 +898,7 @@ void libipw_rx_any(struct libipw_device *ieee,
else if (memcmp(hdr->addr1, ieee->dev->dev_addr, ETH_ALEN) == 0)
is_packet_for_us = 1;
/* mcast */
- else if (is_multicast_ether_addr(hdr->addr1)) {
+ else if (eth_addr_multicast(hdr->addr1)) {
/* not our own packet bcasted from AP */
if (memcmp(hdr->addr3, ieee->dev->dev_addr, ETH_ALEN))
is_packet_for_us = 1;
diff --git a/drivers/net/wireless/ipw2x00/libipw_tx.c b/drivers/net/wireless/ipw2x00/libipw_tx.c
index e8c0398..d01deb7 100644
--- a/drivers/net/wireless/ipw2x00/libipw_tx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_tx.c
@@ -380,8 +380,8 @@ netdev_tx_t libipw_xmit(struct sk_buff *skb, struct net_device *dev)
if (host_encrypt || ieee->host_open_frag) {
/* Determine fragmentation size based on destination (multicast
* and broadcast are not fragmented) */
- if (is_multicast_ether_addr(dest) ||
- is_broadcast_ether_addr(dest))
+ if (eth_addr_multicast(dest) ||
+ eth_addr_broadcast(dest))
frag_size = MAX_FRAG_THRESHOLD;
else
frag_size = ieee->fts;
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index e252acb..ba4ff40 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -495,7 +495,7 @@ il3945_tx_skb(struct il_priv *il,
goto drop_unlock;
}
- unicast = !is_multicast_ether_addr(hdr->addr1);
+ unicast = !eth_addr_multicast(hdr->addr1);
id = 0;
fc = hdr->frame_control;
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index eac4dc8..101b337 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -2561,7 +2561,7 @@ il4965_find_station(struct il_priv *il, const u8 *addr)
if (il->iw_mode == NL80211_IFTYPE_ADHOC)
start = IL_STA_ID;
- if (is_broadcast_ether_addr(addr))
+ if (eth_addr_broadcast(addr))
return il->hw_params.bcast_id;
spin_lock_irqsave(&il->sta_lock, flags);
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 318ed3c..0fad82c 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -1892,7 +1892,7 @@ il_prep_station(struct il_priv *il, const u8 *addr, bool is_ap,
if (is_ap)
sta_id = IL_AP_ID;
- else if (is_broadcast_ether_addr(addr))
+ else if (eth_addr_broadcast(addr))
sta_id = il->hw_params.bcast_id;
else
for (i = IL_STA_ID; i < il->hw_params.max_stations; i++) {
diff --git a/drivers/net/wireless/iwlwifi/dvm/sta.c b/drivers/net/wireless/iwlwifi/dvm/sta.c
index cd9b6de..a220343 100644
--- a/drivers/net/wireless/iwlwifi/dvm/sta.c
+++ b/drivers/net/wireless/iwlwifi/dvm/sta.c
@@ -303,7 +303,7 @@ u8 iwl_prep_station(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
if (is_ap)
sta_id = ctx->ap_sta_id;
- else if (is_broadcast_ether_addr(addr))
+ else if (eth_addr_broadcast(addr))
sta_id = ctx->bcast_sta_id;
else
for (i = IWL_STA_ID; i < IWLAGN_STATION_COUNT; i++) {
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index 7001856..e48e573 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -513,7 +513,7 @@ static void lbtf_op_bss_info_changed(struct ieee80211_hw *hw,
}
if (changes & BSS_CHANGED_BSSID) {
- bool activate = !is_zero_ether_addr(bss_conf->bssid);
+ bool activate = !eth_addr_zero(bss_conf->bssid);
lbtf_set_bssid(priv, activate, bss_conf->bssid);
}
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c
index 7b0858a..7778521 100644
--- a/drivers/net/wireless/mwifiex/join.c
+++ b/drivers/net/wireless/mwifiex/join.c
@@ -1352,7 +1352,7 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac)
u8 mac_address[ETH_ALEN];
int ret;
- if (!mac || is_zero_ether_addr(mac))
+ if (!mac || eth_addr_zero(mac))
memcpy(mac_address,
priv->curr_bss_params.bss_descriptor.mac_address,
ETH_ALEN);
diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c
index 00b658d..e02a56b 100644
--- a/drivers/net/wireless/mwifiex/scan.c
+++ b/drivers/net/wireless/mwifiex/scan.c
@@ -838,7 +838,7 @@ mwifiex_config_scan(struct mwifiex_private *priv,
* or BSSID filter applied to the scan results in the firmware.
*/
if ((i && ssid_filter) ||
- !is_zero_ether_addr(scan_cfg_out->specific_bssid))
+ !eth_addr_zero(scan_cfg_out->specific_bssid))
*filtered_scan = true;
} else {
scan_cfg_out->bss_mode = (u8) adapter->scan_mode;
diff --git a/drivers/net/wireless/mwifiex/sta_cmd.c b/drivers/net/wireless/mwifiex/sta_cmd.c
index 5d87195..3f4073b 100644
--- a/drivers/net/wireless/mwifiex/sta_cmd.c
+++ b/drivers/net/wireless/mwifiex/sta_cmd.c
@@ -592,7 +592,7 @@ mwifiex_cmd_802_11_key_material(struct mwifiex_private *priv,
/* set 0 when re-key */
key_material->key_param_set.key[1] = 0;
- if (!is_broadcast_ether_addr(enc_key->mac_addr)) {
+ if (!eth_addr_broadcast(enc_key->mac_addr)) {
/* WAPI pairwise key: unicast */
key_material->key_param_set.key_info |=
cpu_to_le16(KEY_UNICAST);
diff --git a/drivers/net/wireless/mwifiex/sta_cmdresp.c b/drivers/net/wireless/mwifiex/sta_cmdresp.c
index 09e6a26..685d78e 100644
--- a/drivers/net/wireless/mwifiex/sta_cmdresp.c
+++ b/drivers/net/wireless/mwifiex/sta_cmdresp.c
@@ -778,7 +778,7 @@ static int mwifiex_ret_ibss_coalescing_status(struct mwifiex_private *priv,
"info: new BSSID %pM\n", ibss_coal_resp->bssid);
/* If rsp has NULL BSSID, Just return..... No Action */
- if (is_zero_ether_addr(ibss_coal_resp->bssid)) {
+ if (eth_addr_zero(ibss_coal_resp->bssid)) {
dev_warn(priv->adapter->dev, "new BSSID is NULL\n");
return 0;
}
diff --git a/drivers/net/wireless/mwifiex/uap_txrx.c b/drivers/net/wireless/mwifiex/uap_txrx.c
index 0966ac2..d71f2d6 100644
--- a/drivers/net/wireless/mwifiex/uap_txrx.c
+++ b/drivers/net/wireless/mwifiex/uap_txrx.c
@@ -134,7 +134,7 @@ int mwifiex_handle_uap_rx_forward(struct mwifiex_private *priv,
memcpy(ra, rx_pkt_hdr->eth803_hdr.h_dest, ETH_ALEN);
- if (is_multicast_ether_addr(ra)) {
+ if (eth_addr_multicast(ra)) {
skb_uap = skb_copy(skb, GFP_ATOMIC);
mwifiex_uap_queue_bridged_pkt(priv, skb_uap);
} else {
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 5099e53..499c702 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1886,7 +1886,7 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw,
qos |= MWL8K_QOS_QLEN_UNSPEC | MWL8K_QOS_EOSP;
} else if (ieee80211_is_data(wh->frame_control)) {
txdatarate = 1;
- if (is_multicast_ether_addr(wh->addr1))
+ if (eth_addr_multicast(wh->addr1))
txstatus |= MWL8K_TXD_STATUS_MULTICAST_TX;
qos &= ~MWL8K_QOS_ACK_POLICY_MASK;
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c
index 3b5508f..b5f3c6b 100644
--- a/drivers/net/wireless/orinoco/wext.c
+++ b/drivers/net/wireless/orinoco/wext.c
@@ -165,8 +165,8 @@ static int orinoco_ioctl_setwap(struct net_device *dev,
return -EBUSY;
/* Enable automatic roaming - no sanity checks are needed */
- if (is_zero_ether_addr(ap_addr->sa_data) ||
- is_broadcast_ether_addr(ap_addr->sa_data)) {
+ if (eth_addr_zero(ap_addr->sa_data) ||
+ eth_addr_broadcast(ap_addr->sa_data)) {
priv->bssid_fixed = 0;
memset(priv->desired_bssid, 0, ETH_ALEN);
diff --git a/drivers/net/wireless/p54/eeprom.c b/drivers/net/wireless/p54/eeprom.c
index 1ef1bfe..d3bb493 100644
--- a/drivers/net/wireless/p54/eeprom.c
+++ b/drivers/net/wireless/p54/eeprom.c
@@ -912,7 +912,7 @@ good_eeprom:
if ((synth & PDR_SYNTH_TX_DIV_MASK) == PDR_SYNTH_TX_DIV_SUPPORTED)
priv->tx_diversity_mask = 3;
- if (!is_valid_ether_addr(dev->wiphy->perm_addr)) {
+ if (!eth_addr_valid(dev->wiphy->perm_addr)) {
u8 perm_addr[ETH_ALEN];
wiphy_warn(dev->wiphy,
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index bd1f0cb..32f9488 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1060,7 +1060,7 @@ static bool is_associated(struct usbnet *usbdev)
ret = get_bssid(usbdev, bssid);
- return (ret == 0 && !is_zero_ether_addr(bssid));
+ return (ret == 0 && !eth_addr_zero(bssid));
}
static int disassociate(struct usbnet *usbdev, bool reset_ssid)
@@ -1425,8 +1425,8 @@ static int add_wpa_key(struct usbnet *usbdev, const u8 *key, int key_len,
}
}
- is_addr_ok = addr && !is_zero_ether_addr(addr) &&
- !is_broadcast_ether_addr(addr);
+ is_addr_ok = addr && !eth_addr_zero(addr) &&
+ !eth_addr_broadcast(addr);
if ((flags & NDIS_80211_ADDKEY_PAIRWISE_KEY) && !is_addr_ok) {
netdev_dbg(usbdev->net, "%s(): pairwise but bssid invalid (%pM)\n",
__func__, addr);
@@ -1551,7 +1551,7 @@ static int remove_key(struct usbnet *usbdev, u8 index, const u8 *bssid)
remove_key.index = cpu_to_le32(index);
if (bssid) {
/* pairwise key */
- if (!is_broadcast_ether_addr(bssid))
+ if (!eth_addr_broadcast(bssid))
remove_key.index |=
NDIS_80211_ADDKEY_PAIRWISE_KEY;
memcpy(remove_key.bssid, bssid,
@@ -2232,8 +2232,8 @@ static int rndis_connect(struct wiphy *wiphy, struct net_device *dev,
}
}
- if (sme->bssid && !is_zero_ether_addr(sme->bssid) &&
- !is_broadcast_ether_addr(sme->bssid)) {
+ if (sme->bssid && !eth_addr_zero(sme->bssid) &&
+ !eth_addr_broadcast(sme->bssid)) {
ret = set_bssid(usbdev, sme->bssid);
if (ret < 0) {
netdev_dbg(usbdev->net, "connect: set_bssid failed, %d\n",
@@ -2346,8 +2346,8 @@ static int rndis_join_ibss(struct wiphy *wiphy, struct net_device *dev,
}
}
- if (params->bssid && !is_zero_ether_addr(params->bssid) &&
- !is_broadcast_ether_addr(params->bssid)) {
+ if (params->bssid && !eth_addr_zero(params->bssid) &&
+ !eth_addr_broadcast(params->bssid)) {
ret = set_bssid(usbdev, params->bssid);
if (ret < 0) {
netdev_dbg(usbdev->net, "join_ibss: set_bssid failed, %d\n",
@@ -2816,7 +2816,7 @@ static void rndis_wlan_do_link_up_work(struct usbnet *usbdev)
match_bss = false;
rndis_check_bssid_list(usbdev, bssid, &match_bss);
- if (!is_zero_ether_addr(bssid) && !match_bss) {
+ if (!eth_addr_zero(bssid) && !match_bss) {
/* Couldn't get bss from device, we need to manually craft bss
* for cfg80211.
*/
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index e3a2d90..f8883b2 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1454,7 +1454,7 @@ static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
* Start validation of the data that has been read.
*/
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
- if (!is_valid_ether_addr(mac)) {
+ if (!eth_addr_valid(mac)) {
eth_random_addr(mac);
EEPROM(rt2x00dev, "MAC: %pM\n", mac);
}
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 479d756..0bd01cc 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1584,7 +1584,7 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
* Start validation of the data that has been read.
*/
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
- if (!is_valid_ether_addr(mac)) {
+ if (!eth_addr_valid(mac)) {
eth_random_addr(mac);
EEPROM(rt2x00dev, "MAC: %pM\n", mac);
}
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index a12e84f..e069656 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1351,7 +1351,7 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
* Start validation of the data that has been read.
*/
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
- if (!is_valid_ether_addr(mac)) {
+ if (!eth_addr_valid(mac)) {
eth_random_addr(mac);
EEPROM(rt2x00dev, "MAC: %pM\n", mac);
}
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 01dc889..7fb9a24 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1165,7 +1165,7 @@ static inline int rt2800_find_wcid(struct rt2x00_dev *rt2x00dev)
offset = MAC_WCID_ENTRY(idx);
rt2800_register_multiread(rt2x00dev, offset, &wcid_entry,
sizeof(wcid_entry));
- if (is_broadcast_ether_addr(wcid_entry.mac))
+ if (eth_addr_broadcast(wcid_entry.mac))
return idx;
}
@@ -1351,7 +1351,7 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
update_bssid = true;
}
- if (!is_zero_ether_addr((const u8 *)conf->mac)) {
+ if (!eth_addr_zero((const u8 *)conf->mac)) {
reg = le32_to_cpu(conf->mac[1]);
rt2x00_set_field32(®, MAC_ADDR_DW1_UNICAST_TO_ME_MASK, 0xff);
conf->mac[1] = cpu_to_le32(reg);
@@ -1362,7 +1362,7 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
}
if ((flags & CONFIG_UPDATE_BSSID) || update_bssid) {
- if (!is_zero_ether_addr((const u8 *)conf->bssid)) {
+ if (!eth_addr_zero((const u8 *)conf->bssid)) {
reg = le32_to_cpu(conf->bssid[1]);
rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_ID_MASK, 3);
rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_BCN_NUM, 7);
@@ -4591,7 +4591,7 @@ static int rt2800_validate_eeprom(struct rt2x00_dev *rt2x00dev)
* Start validation of the data that has been read.
*/
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
- if (!is_valid_ether_addr(mac)) {
+ if (!eth_addr_valid(mac)) {
eth_random_addr(mac);
EEPROM(rt2x00dev, "MAC: %pM\n", mac);
}
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index d6582a2..0a886b0 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2413,7 +2413,7 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
* Start validation of the data that has been read.
*/
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
- if (!is_valid_ether_addr(mac)) {
+ if (!eth_addr_valid(mac)) {
eth_random_addr(mac);
EEPROM(rt2x00dev, "MAC: %pM\n", mac);
}
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index e5eb43b..e0812ca 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1769,7 +1769,7 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
* Start validation of the data that has been read.
*/
mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
- if (!is_valid_ether_addr(mac)) {
+ if (!eth_addr_valid(mac)) {
eth_random_addr(mac);
EEPROM(rt2x00dev, "MAC: %pM\n", mac);
}
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index 021d83e..d3d267c 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -795,7 +795,7 @@ static void rtl8180_bss_info_changed(struct ieee80211_hw *dev,
rtl818x_iowrite8(priv, &priv->map->BSSID[i],
info->bssid[i]);
- if (is_valid_ether_addr(info->bssid)) {
+ if (eth_addr_valid(info->bssid)) {
if (vif->type == NL80211_IFTYPE_ADHOC)
reg = RTL818X_MSR_ADHOC;
else
@@ -1077,7 +1077,7 @@ static int __devinit rtl8180_probe(struct pci_dev *pdev,
}
eeprom_93cx6_multiread(&eeprom, 0x7, (__le16 *)mac_addr, 3);
- if (!is_valid_ether_addr(mac_addr)) {
+ if (!eth_addr_valid(mac_addr)) {
printk(KERN_WARNING "%s (rtl8180): Invalid hwaddr! Using"
" randomly generated MAC addr\n", pci_name(pdev));
eth_random_addr(mac_addr);
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 7811b63..c424c1c 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -1260,7 +1260,7 @@ static void rtl8187_bss_info_changed(struct ieee80211_hw *dev,
else
reg = 0;
- if (is_valid_ether_addr(info->bssid)) {
+ if (eth_addr_valid(info->bssid)) {
if (vif->type == NL80211_IFTYPE_ADHOC)
reg |= RTL818X_MSR_ADHOC;
else
@@ -1485,7 +1485,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
eeprom_93cx6_multiread(&eeprom, RTL8187_EEPROM_MAC_ADDR,
(__le16 __force *)mac_addr, 3);
- if (!is_valid_ether_addr(mac_addr)) {
+ if (!eth_addr_valid(mac_addr)) {
printk(KERN_WARNING "rtl8187: Invalid hwaddr! Using randomly "
"generated MAC address\n");
eth_random_addr(mac_addr);
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index 59381fe..1d82a3b 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -339,7 +339,7 @@ static void _rtl_init_mac80211(struct ieee80211_hw *hw)
hw->sta_data_size = sizeof(struct rtl_sta_info);
/* <6> mac address */
- if (is_valid_ether_addr(rtlefuse->dev_addr)) {
+ if (eth_addr_valid(rtlefuse->dev_addr)) {
SET_IEEE80211_PERM_ADDR(hw, rtlefuse->dev_addr);
} else {
u8 rtlmac1[] = { 0x00, 0xe0, 0x4c, 0x81, 0x92, 0x00 };
@@ -881,9 +881,9 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw,
}
}
- if (is_multicast_ether_addr(ieee80211_get_DA(hdr)))
+ if (eth_addr_multicast(ieee80211_get_DA(hdr)))
tcb_desc->multicast = 1;
- else if (is_broadcast_ether_addr(ieee80211_get_DA(hdr)))
+ else if (eth_addr_broadcast(ieee80211_get_DA(hdr)))
tcb_desc->broadcast = 1;
_rtl_txrate_selectmode(hw, sta, tcb_desc);
diff --git a/drivers/net/wireless/rtlwifi/cam.c b/drivers/net/wireless/rtlwifi/cam.c
index 5b4b4d4..c539ac9 100644
--- a/drivers/net/wireless/rtlwifi/cam.c
+++ b/drivers/net/wireless/rtlwifi/cam.c
@@ -328,7 +328,7 @@ void rtl_cam_del_entry(struct ieee80211_hw *hw, u8 *sta_addr)
RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG, "sta_addr is NULL\n");
}
- if (is_zero_ether_addr(sta_addr)) {
+ if (eth_addr_zero(sta_addr)) {
RT_TRACE(rtlpriv, COMP_SEC, DBG_EMERG,
"sta_addr is %pM\n", sta_addr);
return;
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index abc306b..4227c7f 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -619,9 +619,9 @@ static void _rtl_receive_one(struct ieee80211_hw *hw, struct sk_buff *skb,
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
- if (is_broadcast_ether_addr(hdr->addr1)) {
+ if (eth_addr_broadcast(hdr->addr1)) {
;/*TODO*/
- } else if (is_multicast_ether_addr(hdr->addr1)) {
+ } else if (eth_addr_multicast(hdr->addr1)) {
;/*TODO*/
} else {
unicast = true;
@@ -1370,9 +1370,9 @@ static int rtl_pci_tx(struct ieee80211_hw *hw,
rtl_action_proc(hw, skb, true);
- if (is_multicast_ether_addr(pda_addr))
+ if (eth_addr_multicast(pda_addr))
rtlpriv->stats.txbytesmulticast += skb->len;
- else if (is_broadcast_ether_addr(pda_addr))
+ else if (eth_addr_broadcast(pda_addr))
rtlpriv->stats.txbytesbroadcast += skb->len;
else
rtlpriv->stats.txbytesunicast += skb->len;
diff --git a/drivers/net/wireless/rtlwifi/rc.c b/drivers/net/wireless/rtlwifi/rc.c
index d5cbf01..b43dd4f 100644
--- a/drivers/net/wireless/rtlwifi/rc.c
+++ b/drivers/net/wireless/rtlwifi/rc.c
@@ -193,8 +193,8 @@ static void rtl_tx_status(void *ppriv,
if (rtl_is_special_data(mac->hw, skb, true))
return;
- if (is_multicast_ether_addr(ieee80211_get_DA(hdr))
- || is_broadcast_ether_addr(ieee80211_get_DA(hdr)))
+ if (eth_addr_multicast(ieee80211_get_DA(hdr))
+ || eth_addr_broadcast(ieee80211_get_DA(hdr)))
return;
if (sta) {
diff --git a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
index 390d6d4..a080ce7 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192ce/trx.c
@@ -759,8 +759,8 @@ void rtl92ce_tx_fill_desc(struct ieee80211_hw *hw,
SET_TX_DESC_MORE_FRAG(pdesc, (lastseg ? 0 : 1));
- if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) ||
- is_broadcast_ether_addr(ieee80211_get_DA(hdr))) {
+ if (eth_addr_multicast(ieee80211_get_DA(hdr)) ||
+ eth_addr_broadcast(ieee80211_get_DA(hdr))) {
SET_TX_DESC_BMC(pdesc, 1);
}
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
index 6e66f04..cb3a4e8 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
@@ -616,8 +616,8 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
}
if (ieee80211_has_morefrags(fc))
SET_TX_DESC_MORE_FRAG(txdesc, 1);
- if (is_multicast_ether_addr(ieee80211_get_DA(hdr)) ||
- is_broadcast_ether_addr(ieee80211_get_DA(hdr)))
+ if (eth_addr_multicast(ieee80211_get_DA(hdr)) ||
+ eth_addr_broadcast(ieee80211_get_DA(hdr)))
SET_TX_DESC_BMC(txdesc, 1);
_rtl_fill_usb_tx_desc(txdesc);
_rtl_tx_desc_checksum(txdesc);
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index 030beb4..b843b5b 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -452,9 +452,9 @@ static void _rtl_usb_rx_process_agg(struct ieee80211_hw *hw,
if (!stats.crc) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
- if (is_broadcast_ether_addr(hdr->addr1)) {
+ if (eth_addr_broadcast(hdr->addr1)) {
/*TODO*/;
- } else if (is_multicast_ether_addr(hdr->addr1)) {
+ } else if (eth_addr_multicast(hdr->addr1)) {
/*TODO*/
} else {
unicast = true;
@@ -495,9 +495,9 @@ static void _rtl_usb_rx_process_noagg(struct ieee80211_hw *hw,
if (!stats.crc) {
memcpy(IEEE80211_SKB_RXCB(skb), &rx_status, sizeof(rx_status));
- if (is_broadcast_ether_addr(hdr->addr1)) {
+ if (eth_addr_broadcast(hdr->addr1)) {
/*TODO*/;
- } else if (is_multicast_ether_addr(hdr->addr1)) {
+ } else if (eth_addr_multicast(hdr->addr1)) {
/*TODO*/
} else {
unicast = true;
@@ -879,9 +879,9 @@ static void _rtl_usb_tx_preprocess(struct ieee80211_hw *hw,
}
rtl_action_proc(hw, skb, true);
- if (is_multicast_ether_addr(pda_addr))
+ if (eth_addr_multicast(pda_addr))
rtlpriv->stats.txbytesmulticast += skb->len;
- else if (is_broadcast_ether_addr(pda_addr))
+ else if (eth_addr_broadcast(pda_addr))
rtlpriv->stats.txbytesbroadcast += skb->len;
else
rtlpriv->stats.txbytesunicast += skb->len;
diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
index 441cbcc..822d1f2 100644
--- a/drivers/net/wireless/ti/wl1251/main.c
+++ b/drivers/net/wireless/ti/wl1251/main.c
@@ -338,7 +338,7 @@ static int wl1251_join(struct wl1251 *wl, u8 bss_type, u8 channel,
* Join command applies filters, and if we are not associated,
* BSSID filter must be disabled for association to work.
*/
- if (is_zero_ether_addr(wl->bssid))
+ if (eth_addr_zero(wl->bssid))
wl->rx_config &= ~CFG_BSSID_FILTER_EN;
ret = wl1251_cmd_join(wl, bss_type, channel, beacon_interval,
@@ -703,7 +703,7 @@ static void wl1251_op_configure_filter(struct ieee80211_hw *hw,
}
if (*total & FIF_CONTROL)
wl->rx_filter |= CFG_RX_CTL_EN;
- if (*total & FIF_OTHER_BSS || is_zero_ether_addr(wl->bssid))
+ if (*total & FIF_OTHER_BSS || eth_addr_zero(wl->bssid))
wl->rx_config &= ~CFG_BSSID_FILTER_EN;
if (*total & FIF_PROBE_REQ)
wl->rx_filter |= CFG_RX_PREQ_EN;
@@ -734,7 +734,7 @@ static int wl1251_set_key_type(struct wl1251 *wl,
switch (mac80211_key->cipher) {
case WLAN_CIPHER_SUITE_WEP40:
case WLAN_CIPHER_SUITE_WEP104:
- if (is_broadcast_ether_addr(addr))
+ if (eth_addr_broadcast(addr))
key->key_type = KEY_WEP_DEFAULT;
else
key->key_type = KEY_WEP_ADDR;
@@ -742,7 +742,7 @@ static int wl1251_set_key_type(struct wl1251 *wl,
mac80211_key->hw_key_idx = mac80211_key->keyidx;
break;
case WLAN_CIPHER_SUITE_TKIP:
- if (is_broadcast_ether_addr(addr))
+ if (eth_addr_broadcast(addr))
key->key_type = KEY_TKIP_MIC_GROUP;
else
key->key_type = KEY_TKIP_MIC_PAIRWISE;
@@ -750,7 +750,7 @@ static int wl1251_set_key_type(struct wl1251 *wl,
mac80211_key->hw_key_idx = mac80211_key->keyidx;
break;
case WLAN_CIPHER_SUITE_CCMP:
- if (is_broadcast_ether_addr(addr))
+ if (eth_addr_broadcast(addr))
key->key_type = KEY_AES_GROUP;
else
key->key_type = KEY_AES_PAIRWISE;
@@ -793,7 +793,7 @@ static int wl1251_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
key->cipher, key->keyidx, key->keylen, key->flags);
wl1251_dump(DEBUG_CRYPT, "KEY: ", key->key, key->keylen);
- if (is_zero_ether_addr(addr)) {
+ if (eth_addr_zero(addr)) {
/* We dont support TX only encryption */
ret = -EOPNOTSUPP;
goto out;
diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
index eaef3f4..3e40415 100644
--- a/drivers/net/wireless/ti/wlcore/cmd.c
+++ b/drivers/net/wireless/ti/wlcore/cmd.c
@@ -1268,7 +1268,7 @@ int wl1271_cmd_set_sta_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
if (key_type == KEY_WEP)
cmd->lid_key_type = WEP_DEFAULT_LID_TYPE;
- else if (is_broadcast_ether_addr(addr))
+ else if (eth_addr_broadcast(addr))
cmd->lid_key_type = BROADCAST_LID_TYPE;
else
cmd->lid_key_type = UNICAST_LID_TYPE;
diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
index 25530c8..d421844 100644
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -3020,7 +3020,7 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
addr = sta ? sta->addr : bcast_addr;
- if (is_zero_ether_addr(addr)) {
+ if (eth_addr_zero(addr)) {
/* We dont support TX only encryption */
return -EOPNOTSUPP;
}
@@ -3029,7 +3029,7 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
will be cleared automatically on next CMD_JOIN. Ignore the
request silently, as we dont want the mac80211 to emit
an error message. */
- if (action == KEY_REMOVE && !is_broadcast_ether_addr(addr))
+ if (action == KEY_REMOVE && !eth_addr_broadcast(addr))
return 0;
/* don't remove key if hlid was already deleted */
@@ -3871,7 +3871,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
}
if (changed & BSS_CHANGED_BSSID)
- if (!is_zero_ether_addr(bss_conf->bssid)) {
+ if (!eth_addr_zero(bss_conf->bssid)) {
ret = wl12xx_cmd_build_null_data(wl, wlvif);
if (ret < 0)
goto out;
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
index a90d3cd..03e966e 100644
--- a/drivers/net/wireless/ti/wlcore/tx.c
+++ b/drivers/net/wireless/ti/wlcore/tx.c
@@ -145,7 +145,7 @@ static u8 wl12xx_tx_get_hlid_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif,
return wl->system_hlid;
hdr = (struct ieee80211_hdr *)skb->data;
- if (is_multicast_ether_addr(ieee80211_get_DA(hdr)))
+ if (eth_addr_multicast(ieee80211_get_DA(hdr)))
return wlvif->ap.bcast_hlid;
else
return wlvif->ap.global_hlid;
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 730186d..804a15a 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -1525,7 +1525,7 @@ static int wl3501_set_wap(struct net_device *dev, struct iw_request_info *info,
/* FIXME: we support other ARPHRDs...*/
if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
goto out;
- if (is_broadcast_ether_addr(wrqu->ap_addr.sa_data)) {
+ if (eth_addr_broadcast(wrqu->ap_addr.sa_data)) {
/* FIXME: rescan? */
} else
memcpy(this->bssid, wrqu->ap_addr.sa_data, ETH_ALEN);
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index 114364b..ce32bb5 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -1335,7 +1335,7 @@ static void zd_op_bss_info_changed(struct ieee80211_hw *hw,
mac->type);
}
} else
- associated = is_valid_ether_addr(bss_conf->bssid);
+ associated = eth_addr_valid(bss_conf->bssid);
spin_lock_irq(&mac->lock);
mac->associated = associated;
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 03/21] arch: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (2 preceding siblings ...)
2012-10-19 3:55 ` [PATCH net-next 04/21] wireless: " Joe Perches
@ 2012-10-19 4:13 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 05/21] drivers: net: " Joe Perches
` (18 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:13 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
arch/arm/mach-davinci/board-mityomapl138.c | 2 +-
arch/arm/mach-pxa/colibri-pxa3xx.c | 2 +-
arch/avr32/boards/atngw100/setup.c | 2 +-
arch/avr32/boards/atstk1000/atstk1002.c | 2 +-
arch/avr32/boards/favr-32/setup.c | 2 +-
arch/avr32/boards/hammerhead/setup.c | 2 +-
arch/avr32/boards/merisc/setup.c | 2 +-
arch/avr32/boards/mimc200/setup.c | 2 +-
arch/mips/alchemy/common/platform.c | 4 ++--
arch/um/drivers/net_kern.c | 6 +++---
10 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/arch/arm/mach-davinci/board-mityomapl138.c b/arch/arm/mach-davinci/board-mityomapl138.c
index 43e4a0d..df45c9c 100644
--- a/arch/arm/mach-davinci/board-mityomapl138.c
+++ b/arch/arm/mach-davinci/board-mityomapl138.c
@@ -138,7 +138,7 @@ static void read_factory_config(struct memory_accessor *a, void *context)
}
pr_info("MityOMAPL138: Found MAC = %pM\n", factory_config.mac);
- if (is_valid_ether_addr(factory_config.mac))
+ if (eth_addr_valid(factory_config.mac))
memcpy(soc_info->emac_pdata->mac_addr,
factory_config.mac, ETH_ALEN);
else
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c
index 8240291..839040c 100644
--- a/arch/arm/mach-pxa/colibri-pxa3xx.c
+++ b/arch/arm/mach-pxa/colibri-pxa3xx.c
@@ -52,7 +52,7 @@ void __init colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data)
serial >>= 8;
}
- if (is_valid_ether_addr(ether_mac_addr)) {
+ if (eth_addr_valid(ether_mac_addr)) {
plat_data->flags |= AXFLG_MAC_FROMPLATFORM;
plat_data->mac_addr = ether_mac_addr;
printk(KERN_INFO "%s(): taking MAC from serial boot tag\n",
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c
index afeae89..5f7d86d 100644
--- a/arch/avr32/boards/atngw100/setup.c
+++ b/arch/avr32/boards/atngw100/setup.c
@@ -175,7 +175,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
return;
addr = hw_addr[pdev->id].addr;
- if (!is_valid_ether_addr(addr))
+ if (!eth_addr_valid(addr))
return;
/*
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c
index 6c80aba..7334686 100644
--- a/arch/avr32/boards/atstk1000/atstk1002.c
+++ b/arch/avr32/boards/atstk1000/atstk1002.c
@@ -189,7 +189,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
return;
addr = hw_addr[pdev->id].addr;
- if (!is_valid_ether_addr(addr))
+ if (!eth_addr_valid(addr))
return;
/*
diff --git a/arch/avr32/boards/favr-32/setup.c b/arch/avr32/boards/favr-32/setup.c
index 27bd6fb..0b76aa7 100644
--- a/arch/avr32/boards/favr-32/setup.c
+++ b/arch/avr32/boards/favr-32/setup.c
@@ -196,7 +196,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
return;
addr = hw_addr[pdev->id].addr;
- if (!is_valid_ether_addr(addr))
+ if (!eth_addr_valid(addr))
return;
/*
diff --git a/arch/avr32/boards/hammerhead/setup.c b/arch/avr32/boards/hammerhead/setup.c
index 9d1efd1..d64fa9f 100644
--- a/arch/avr32/boards/hammerhead/setup.c
+++ b/arch/avr32/boards/hammerhead/setup.c
@@ -139,7 +139,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
addr = hw_addr[pdev->id].addr;
- if (!is_valid_ether_addr(addr))
+ if (!eth_addr_valid(addr))
return;
/*
diff --git a/arch/avr32/boards/merisc/setup.c b/arch/avr32/boards/merisc/setup.c
index ed137e3..817d2d8 100644
--- a/arch/avr32/boards/merisc/setup.c
+++ b/arch/avr32/boards/merisc/setup.c
@@ -129,7 +129,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
return;
addr = hw_addr[pdev->id].addr;
- if (!is_valid_ether_addr(addr))
+ if (!eth_addr_valid(addr))
return;
regs = (void __iomem __force *)res->start;
diff --git a/arch/avr32/boards/mimc200/setup.c b/arch/avr32/boards/mimc200/setup.c
index 05358aa..31cd87e 100644
--- a/arch/avr32/boards/mimc200/setup.c
+++ b/arch/avr32/boards/mimc200/setup.c
@@ -152,7 +152,7 @@ static void __init set_hw_addr(struct platform_device *pdev)
return;
addr = hw_addr[pdev->id].addr;
- if (!is_valid_ether_addr(addr))
+ if (!eth_addr_valid(addr))
return;
/*
diff --git a/arch/mips/alchemy/common/platform.c b/arch/mips/alchemy/common/platform.c
index c0f3ce6..5f07da3 100644
--- a/arch/mips/alchemy/common/platform.c
+++ b/arch/mips/alchemy/common/platform.c
@@ -343,7 +343,7 @@ static void __init alchemy_setup_macs(int ctype)
au1xxx_eth0_device.resource = macres;
i = prom_get_ethernet_addr(ethaddr);
- if (!i && !is_valid_ether_addr(au1xxx_eth0_platform_data.mac))
+ if (!i && !eth_addr_valid(au1xxx_eth0_platform_data.mac))
memcpy(au1xxx_eth0_platform_data.mac, ethaddr, 6);
ret = platform_device_register(&au1xxx_eth0_device);
@@ -364,7 +364,7 @@ static void __init alchemy_setup_macs(int ctype)
au1xxx_eth1_device.resource = macres;
ethaddr[5] += 1; /* next addr for 2nd MAC */
- if (!i && !is_valid_ether_addr(au1xxx_eth1_platform_data.mac))
+ if (!i && !eth_addr_valid(au1xxx_eth1_platform_data.mac))
memcpy(au1xxx_eth1_platform_data.mac, ethaddr, 6);
/* Register second MAC if enabled in pinfunc */
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index b1314eb..47e11e7 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -312,19 +312,19 @@ static int setup_etheraddr(char *str, unsigned char *addr, char *name)
}
str = end + 1;
}
- if (is_multicast_ether_addr(addr)) {
+ if (eth_addr_multicast(addr)) {
printk(KERN_ERR
"Attempt to assign a multicast ethernet address to a "
"device disallowed\n");
goto random;
}
- if (!is_valid_ether_addr(addr)) {
+ if (!eth_addr_valid(addr)) {
printk(KERN_ERR
"Attempt to assign an invalid ethernet address to a "
"device disallowed\n");
goto random;
}
- if (!is_local_ether_addr(addr)) {
+ if (!eth_addr_local(addr)) {
printk(KERN_WARNING
"Warning: Assigning a globally valid ethernet "
"address to a device\n");
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 05/21] drivers: net: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (3 preceding siblings ...)
2012-10-19 4:13 ` [PATCH net-next 03/21] arch: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 06/21] staging: " Joe Perches
` (17 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/bonding/bond_3ad.c | 2 +-
drivers/net/bonding/bond_alb.c | 2 +-
drivers/net/bonding/bond_main.c | 6 +++---
drivers/net/dummy.c | 2 +-
drivers/net/ethernet/3com/3c59x.c | 2 +-
drivers/net/ethernet/3com/typhoon.c | 2 +-
drivers/net/ethernet/8390/etherh.c | 2 +-
drivers/net/ethernet/adi/bfin_mac.c | 6 +++---
drivers/net/ethernet/aeroflex/greth.c | 4 ++--
drivers/net/ethernet/amd/au1000_eth.c | 2 +-
drivers/net/ethernet/amd/depca.c | 4 ++--
drivers/net/ethernet/amd/pcnet32.c | 8 ++++----
drivers/net/ethernet/atheros/atl1c/atl1c_hw.c | 2 +-
drivers/net/ethernet/atheros/atl1c/atl1c_main.c | 2 +-
drivers/net/ethernet/atheros/atl1e/atl1e_hw.c | 4 ++--
drivers/net/ethernet/atheros/atl1e/atl1e_main.c | 2 +-
drivers/net/ethernet/atheros/atlx/atl1.c | 10 +++++-----
drivers/net/ethernet/atheros/atlx/atl2.c | 14 +++++++-------
drivers/net/ethernet/atheros/atlx/atlx.c | 2 +-
drivers/net/ethernet/broadcom/b44.c | 4 ++--
drivers/net/ethernet/broadcom/bnx2.c | 2 +-
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | 6 +++---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 4 ++--
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 6 +++---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 2 +-
drivers/net/ethernet/broadcom/cnic.c | 2 +-
drivers/net/ethernet/broadcom/tg3.c | 6 +++---
drivers/net/ethernet/brocade/bna/bnad.c | 6 +++---
drivers/net/ethernet/cadence/at91_ether.c | 6 +++---
drivers/net/ethernet/cadence/macb.c | 4 ++--
drivers/net/ethernet/calxeda/xgmac.c | 6 +++---
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c | 2 +-
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +-
.../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 2 +-
drivers/net/ethernet/cirrus/ep93xx_eth.c | 2 +-
drivers/net/ethernet/cirrus/mac89x0.c | 2 +-
drivers/net/ethernet/cisco/enic/enic_dev.c | 4 ++--
drivers/net/ethernet/cisco/enic/enic_main.c | 10 +++++-----
drivers/net/ethernet/cisco/enic/enic_pp.c | 10 +++++-----
drivers/net/ethernet/davicom/dm9000.c | 6 +++---
drivers/net/ethernet/dec/ewrk3.c | 4 ++--
drivers/net/ethernet/dec/tulip/de4x5.c | 4 ++--
drivers/net/ethernet/dlink/sundance.c | 2 +-
drivers/net/ethernet/dnet.c | 6 +++---
drivers/net/ethernet/emulex/benet/be_main.c | 8 ++++----
drivers/net/ethernet/ethoc.c | 6 +++---
drivers/net/ethernet/faraday/ftgmac100.c | 2 +-
drivers/net/ethernet/faraday/ftmac100.c | 2 +-
drivers/net/ethernet/freescale/fec.c | 8 ++++----
drivers/net/ethernet/freescale/fec_mpc52xx.c | 2 +-
drivers/net/ethernet/freescale/gianfar_ethtool.c | 12 ++++++------
drivers/net/ethernet/freescale/ucc_geth.c | 2 +-
drivers/net/ethernet/i825xx/ether1.c | 2 +-
drivers/net/ethernet/ibm/ehea/ehea_main.c | 4 ++--
drivers/net/ethernet/intel/e100.c | 4 ++--
drivers/net/ethernet/intel/e1000/e1000_main.c | 4 ++--
drivers/net/ethernet/intel/e1000e/mac.c | 2 +-
drivers/net/ethernet/intel/e1000e/netdev.c | 4 ++--
drivers/net/ethernet/intel/igb/e1000_mac.c | 2 +-
drivers/net/ethernet/intel/igb/igb_main.c | 8 ++++----
drivers/net/ethernet/intel/igbvf/netdev.c | 6 +++---
drivers/net/ethernet/intel/ixgb/ixgb_hw.c | 6 +++---
drivers/net/ethernet/intel/ixgb/ixgb_main.c | 6 +++---
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c | 2 +-
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 14 +++++++-------
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 6 +++---
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 8 ++++----
drivers/net/ethernet/lantiq_etop.c | 2 +-
drivers/net/ethernet/marvell/mv643xx_eth.c | 4 ++--
drivers/net/ethernet/marvell/pxa168_eth.c | 2 +-
drivers/net/ethernet/marvell/skge.c | 6 +++---
drivers/net/ethernet/marvell/sky2.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 2 +-
.../net/ethernet/mellanox/mlx4/resource_tracker.c | 4 ++--
drivers/net/ethernet/micrel/ks8695net.c | 6 +++---
drivers/net/ethernet/micrel/ks8842.c | 4 ++--
drivers/net/ethernet/micrel/ks8851.c | 4 ++--
drivers/net/ethernet/micrel/ks8851_mll.c | 2 +-
drivers/net/ethernet/microchip/enc28j60.c | 4 ++--
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +-
drivers/net/ethernet/neterion/s2io.c | 2 +-
drivers/net/ethernet/neterion/vxge/vxge-config.c | 2 +-
drivers/net/ethernet/neterion/vxge/vxge-main.c | 12 ++++++------
drivers/net/ethernet/netx-eth.c | 2 +-
drivers/net/ethernet/nuvoton/w90p910_ether.c | 4 ++--
drivers/net/ethernet/nvidia/forcedeth.c | 4 ++--
drivers/net/ethernet/nxp/lpc_eth.c | 8 ++++----
drivers/net/ethernet/octeon/octeon_mgmt.c | 2 +-
.../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 6 +++---
drivers/net/ethernet/pasemi/pasemi_mac.c | 4 ++--
.../net/ethernet/qlogic/netxen/netxen_nic_main.c | 4 ++--
drivers/net/ethernet/qlogic/qla3xxx.c | 2 +-
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 4 ++--
drivers/net/ethernet/qlogic/qlge/qlge_main.c | 6 +++---
drivers/net/ethernet/realtek/8139cp.c | 2 +-
drivers/net/ethernet/realtek/8139too.c | 2 +-
drivers/net/ethernet/realtek/r8169.c | 2 +-
drivers/net/ethernet/renesas/sh_eth.c | 4 ++--
drivers/net/ethernet/seeq/ether3.c | 2 +-
drivers/net/ethernet/sfc/efx.c | 2 +-
drivers/net/ethernet/sfc/ethtool.c | 6 +++---
drivers/net/ethernet/sfc/siena_sriov.c | 6 +++---
drivers/net/ethernet/sis/sis900.c | 2 +-
drivers/net/ethernet/smsc/smc911x.c | 4 ++--
drivers/net/ethernet/smsc/smc91x.c | 4 ++--
drivers/net/ethernet/smsc/smsc911x.c | 10 +++++-----
drivers/net/ethernet/smsc/smsc9420.c | 6 +++---
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++--
drivers/net/ethernet/sun/niu.c | 8 ++++----
drivers/net/ethernet/sun/sungem.c | 2 +-
drivers/net/ethernet/ti/cpsw.c | 2 +-
drivers/net/ethernet/ti/davinci_emac.c | 6 +++---
drivers/net/ethernet/tile/tilegx.c | 4 ++--
drivers/net/ethernet/tile/tilepro.c | 4 ++--
drivers/net/ethernet/toshiba/ps3_gelic_net.c | 2 +-
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c | 2 +-
drivers/net/ethernet/toshiba/spider_net.c | 4 ++--
drivers/net/ethernet/toshiba/tc35815.c | 4 ++--
drivers/net/ethernet/tundra/tsi108_eth.c | 8 ++++----
drivers/net/ethernet/via/via-rhine.c | 2 +-
drivers/net/ethernet/wiznet/w5100.c | 6 +++---
drivers/net/ethernet/wiznet/w5300.c | 6 +++---
drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +-
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
drivers/net/hamradio/bpqether.c | 2 +-
drivers/net/ifb.c | 2 +-
drivers/net/macvlan.c | 16 ++++++++--------
drivers/net/phy/at803x.c | 2 +-
drivers/net/rionet.c | 4 ++--
drivers/net/team/team.c | 4 ++--
drivers/net/tun.c | 4 ++--
drivers/net/usb/asix_common.c | 2 +-
drivers/net/usb/dm9601.c | 4 ++--
drivers/net/usb/mcs7830.c | 2 +-
drivers/net/usb/smsc75xx.c | 2 +-
drivers/net/usb/smsc95xx.c | 2 +-
drivers/net/veth.c | 2 +-
drivers/net/vxlan.c | 4 ++--
drivers/net/wimax/i2400m/driver.c | 2 +-
139 files changed, 294 insertions(+), 294 deletions(-)
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index a030e63..8031bfe 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -213,7 +213,7 @@ static inline struct aggregator *__get_next_agg(struct aggregator *aggregator)
*/
static inline int __agg_has_partner(struct aggregator *agg)
{
- return !is_zero_ether_addr(agg->partner_system.mac_addr_value);
+ return !eth_addr_zero(agg->partner_system.mac_addr_value);
}
/**
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index e15cc11..adc7277 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -1651,7 +1651,7 @@ int bond_alb_set_mac_address(struct net_device *bond_dev, void *addr)
int res;
int i;
- if (!is_valid_ether_addr(sa->sa_data)) {
+ if (!eth_addr_valid(sa->sa_data)) {
return -EADDRNOTAVAIL;
}
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index b2530b0..e89330e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1607,7 +1607,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
/* If this is the first slave, then we need to set the master's hardware
* address to be the same as the slave's. */
- if (is_zero_ether_addr(bond->dev->dev_addr))
+ if (eth_addr_zero(bond->dev->dev_addr))
memcpy(bond->dev->dev_addr, slave_dev->dev_addr,
slave_dev->addr_len);
@@ -3928,7 +3928,7 @@ static int bond_set_mac_address(struct net_device *bond_dev, void *addr)
if (bond->params.fail_over_mac == BOND_FOM_ACTIVE)
return 0;
- if (!is_valid_ether_addr(sa->sa_data))
+ if (!eth_addr_valid(sa->sa_data))
return -EADDRNOTAVAIL;
/* Can't hold bond->lock with bh disabled here since
@@ -4885,7 +4885,7 @@ static int bond_validate(struct nlattr *tb[], struct nlattr *data[])
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
return 0;
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index c260af5..9d6134c 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -133,7 +133,7 @@ static int dummy_validate(struct nlattr *tb[], struct nlattr *data[])
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
return 0;
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index e463d10..884ee83 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -1299,7 +1299,7 @@ static int __devinit vortex_probe1(struct device *gendev,
pr_cont(" %pM", dev->dev_addr);
/* Unfortunately an all zero eeprom passes the checksum and this
gets found in the wild in failure cases. Crypto is hard 8) */
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
retval = -EINVAL;
pr_err("*** EEPROM MAC address is invalid.\n");
goto free_ring; /* With every pack */
diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c
index bb9670f..ffe8a93 100644
--- a/drivers/net/ethernet/3com/typhoon.c
+++ b/drivers/net/ethernet/3com/typhoon.c
@@ -2398,7 +2398,7 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
*(__be16 *)&dev->dev_addr[0] = htons(le16_to_cpu(xp_resp[0].parm1));
*(__be32 *)&dev->dev_addr[2] = htonl(le32_to_cpu(xp_resp[0].parm2));
- if(!is_valid_ether_addr(dev->dev_addr)) {
+ if(!eth_addr_valid(dev->dev_addr)) {
err_msg = "Could not obtain valid ethernet address, aborting";
goto error_out_reset;
}
diff --git a/drivers/net/ethernet/8390/etherh.c b/drivers/net/ethernet/8390/etherh.c
index 8322c54..9a40499 100644
--- a/drivers/net/ethernet/8390/etherh.c
+++ b/drivers/net/ethernet/8390/etherh.c
@@ -463,7 +463,7 @@ etherh_open(struct net_device *dev)
{
struct ei_device *ei_local = netdev_priv(dev);
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
printk(KERN_WARNING "%s: invalid ethernet MAC address\n",
dev->name);
return -EINVAL;
diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c
index f816426..f672ed6 100644
--- a/drivers/net/ethernet/adi/bfin_mac.c
+++ b/drivers/net/ethernet/adi/bfin_mac.c
@@ -1412,7 +1412,7 @@ static int bfin_mac_open(struct net_device *dev)
* to bring the device up. The user must specify an
* address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
*/
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
netdev_warn(dev, "no valid ethernet hw addr\n");
return -EINVAL;
}
@@ -1515,9 +1515,9 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev)
* Grab the MAC from the board somehow
* this is done in the arch/blackfin/mach-bfxxx/boards/eth_mac.c
*/
- if (!is_valid_ether_addr(ndev->dev_addr)) {
+ if (!eth_addr_valid(ndev->dev_addr)) {
if (bfin_get_ether_addr(ndev->dev_addr) ||
- !is_valid_ether_addr(ndev->dev_addr)) {
+ !eth_addr_valid(ndev->dev_addr)) {
/* Still not valid, get a random one */
netdev_warn(ndev, "Setting Ethernet MAC to a random one\n");
eth_hw_addr_random(ndev);
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index 9c77c73..216218b 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -1016,7 +1016,7 @@ static int greth_set_mac_add(struct net_device *dev, void *p)
greth = netdev_priv(dev);
regs = greth->regs;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
@@ -1520,7 +1520,7 @@ static int __devinit greth_of_probe(struct platform_device *ofdev)
macaddr[5]++;
- if (!is_valid_ether_addr(&dev->dev_addr[0])) {
+ if (!eth_addr_valid(&dev->dev_addr[0])) {
if (netif_msg_probe(greth))
dev_err(greth->dev, "no valid ethernet address, aborting.\n");
err = -EINVAL;
diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index f195acf..c1b302b 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -1138,7 +1138,7 @@ static int __devinit au1000_probe(struct platform_device *pdev)
" PHY search on MAC0\n");
aup->phy1_search_mac0 = 1;
} else {
- if (is_valid_ether_addr(pd->mac)) {
+ if (eth_addr_valid(pd->mac)) {
memcpy(dev->dev_addr, pd->mac, 6);
} else {
/* Set a random MAC since no valid provided by platform_data. */
diff --git a/drivers/net/ethernet/amd/depca.c b/drivers/net/ethernet/amd/depca.c
index c771de7..a953092 100644
--- a/drivers/net/ethernet/amd/depca.c
+++ b/drivers/net/ethernet/amd/depca.c
@@ -1008,8 +1008,8 @@ static int depca_rx(struct net_device *dev)
i = DEPCA_PKT_STAT_SZ;
}
}
- if (is_multicast_ether_addr(buf)) {
- if (is_broadcast_ether_addr(buf)) {
+ if (eth_addr_multicast(buf)) {
+ if (eth_addr_broadcast(buf)) {
lp->pktStats.broadcast++;
} else {
lp->pktStats.multicast++;
diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index 86b6d8e..28d19d7 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -1679,8 +1679,8 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
promaddr[i] = inb(ioaddr + i);
if (memcmp(promaddr, dev->dev_addr, 6) ||
- !is_valid_ether_addr(dev->dev_addr)) {
- if (is_valid_ether_addr(promaddr)) {
+ !eth_addr_valid(dev->dev_addr)) {
+ if (eth_addr_valid(promaddr)) {
if (pcnet32_debug & NETIF_MSG_PROBE) {
pr_cont(" warning: CSR address invalid,\n");
pr_info(" using instead PROM address of");
@@ -1691,7 +1691,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
/* if the ethernet address is not valid, force to 00:00:00:00:00:00 */
- if (!is_valid_ether_addr(dev->perm_addr))
+ if (!eth_addr_valid(dev->perm_addr))
memset(dev->dev_addr, 0, ETH_ALEN);
if (pcnet32_debug & NETIF_MSG_PROBE) {
@@ -2014,7 +2014,7 @@ static int pcnet32_open(struct net_device *dev)
spin_lock_irqsave(&lp->lock, flags);
/* Check for a valid station address */
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
rc = -EINVAL;
goto err_free_irq;
}
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
index 21e261f..eb956f4 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_hw.c
@@ -73,7 +73,7 @@ static bool atl1c_read_current_addr(struct atl1c_hw *hw, u8 *eth_addr)
*(u32 *) ð_addr[2] = htonl(addr[0]);
*(u16 *) ð_addr[0] = htons((u16)addr[1]);
- return is_valid_ether_addr(eth_addr);
+ return eth_addr_valid(eth_addr);
}
/*
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index d19f82f..362cf5c 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -464,7 +464,7 @@ static int atl1c_set_mac_addr(struct net_device *netdev, void *p)
struct atl1c_adapter *adapter = netdev_priv(netdev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
if (netif_running(netdev))
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_hw.c b/drivers/net/ethernet/atheros/atl1e/atl1e_hw.c
index 923063d..419a789 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_hw.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_hw.c
@@ -72,7 +72,7 @@ static int atl1e_get_permanent_address(struct atl1e_hw *hw)
u32 twsi_ctrl_data;
u8 eth_addr[ETH_ALEN];
- if (is_valid_ether_addr(hw->perm_mac_addr))
+ if (eth_addr_valid(hw->perm_mac_addr))
return 0;
/* init */
@@ -99,7 +99,7 @@ static int atl1e_get_permanent_address(struct atl1e_hw *hw)
*(u32 *) ð_addr[2] = swab32(addr[0]);
*(u16 *) ð_addr[0] = swab16(*(u16 *)&addr[1]);
- if (is_valid_ether_addr(eth_addr)) {
+ if (eth_addr_valid(eth_addr)) {
memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
return 0;
}
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index e213da2..8e4dcae 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -357,7 +357,7 @@ static int atl1e_set_mac_addr(struct net_device *netdev, void *p)
struct atl1e_adapter *adapter = netdev_priv(netdev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
if (netif_running(netdev))
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index 7bae2ad..408bb32 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -440,7 +440,7 @@ static int atl1_get_permanent_address(struct atl1_hw *hw)
u8 eth_addr[ETH_ALEN];
bool key_valid;
- if (is_valid_ether_addr(hw->perm_mac_addr))
+ if (eth_addr_valid(hw->perm_mac_addr))
return 0;
/* init */
@@ -472,7 +472,7 @@ static int atl1_get_permanent_address(struct atl1_hw *hw)
*(u32 *) ð_addr[2] = swab32(addr[0]);
*(u16 *) ð_addr[0] = swab16(*(u16 *) &addr[1]);
- if (is_valid_ether_addr(eth_addr)) {
+ if (eth_addr_valid(eth_addr)) {
memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
return 0;
}
@@ -505,7 +505,7 @@ static int atl1_get_permanent_address(struct atl1_hw *hw)
*(u32 *) ð_addr[2] = swab32(addr[0]);
*(u16 *) ð_addr[0] = swab16(*(u16 *) &addr[1]);
- if (is_valid_ether_addr(eth_addr)) {
+ if (eth_addr_valid(eth_addr)) {
memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
return 0;
}
@@ -520,7 +520,7 @@ static int atl1_get_permanent_address(struct atl1_hw *hw)
addr[1] = ioread16(hw->hw_addr + (REG_MAC_STA_ADDR + 4));
*(u32 *) ð_addr[2] = swab32(addr[0]);
*(u16 *) ð_addr[0] = swab16(*(u16 *) &addr[1]);
- if (is_valid_ether_addr(eth_addr)) {
+ if (eth_addr_valid(eth_addr)) {
memcpy(hw->perm_mac_addr, eth_addr, ETH_ALEN);
return 0;
}
@@ -3058,7 +3058,7 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
}
memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
- if (!is_valid_ether_addr(netdev->dev_addr)) {
+ if (!eth_addr_valid(netdev->dev_addr)) {
err = -EIO;
goto err_common;
}
diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c
index 623dd86..4da08e2 100644
--- a/drivers/net/ethernet/atheros/atlx/atl2.c
+++ b/drivers/net/ethernet/atheros/atlx/atl2.c
@@ -954,7 +954,7 @@ static int atl2_set_mac(struct net_device *netdev, void *p)
struct atl2_adapter *adapter = netdev_priv(netdev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
if (netif_running(netdev))
@@ -1438,9 +1438,9 @@ static int __devinit atl2_probe(struct pci_dev *pdev,
#ifdef ETHTOOL_GPERMADDR
memcpy(netdev->perm_addr, adapter->hw.mac_addr, netdev->addr_len);
- if (!is_valid_ether_addr(netdev->perm_addr)) {
+ if (!eth_addr_valid(netdev->perm_addr)) {
#else
- if (!is_valid_ether_addr(netdev->dev_addr)) {
+ if (!eth_addr_valid(netdev->dev_addr)) {
#endif
err = -EIO;
goto err_eeprom;
@@ -2247,7 +2247,7 @@ static int get_permanent_address(struct atl2_hw *hw)
u8 EthAddr[ETH_ALEN];
bool KeyValid;
- if (is_valid_ether_addr(hw->perm_mac_addr))
+ if (eth_addr_valid(hw->perm_mac_addr))
return 0;
Addr[0] = 0;
@@ -2284,7 +2284,7 @@ static int get_permanent_address(struct atl2_hw *hw)
*(u32 *) &EthAddr[2] = LONGSWAP(Addr[0]);
*(u16 *) &EthAddr[0] = SHORTSWAP(*(u16 *) &Addr[1]);
- if (is_valid_ether_addr(EthAddr)) {
+ if (eth_addr_valid(EthAddr)) {
memcpy(hw->perm_mac_addr, EthAddr, ETH_ALEN);
return 0;
}
@@ -2319,7 +2319,7 @@ static int get_permanent_address(struct atl2_hw *hw)
*(u32 *) &EthAddr[2] = LONGSWAP(Addr[0]);
*(u16 *) &EthAddr[0] = SHORTSWAP(*(u16 *)&Addr[1]);
- if (is_valid_ether_addr(EthAddr)) {
+ if (eth_addr_valid(EthAddr)) {
memcpy(hw->perm_mac_addr, EthAddr, ETH_ALEN);
return 0;
}
@@ -2329,7 +2329,7 @@ static int get_permanent_address(struct atl2_hw *hw)
*(u32 *) &EthAddr[2] = LONGSWAP(Addr[0]);
*(u16 *) &EthAddr[0] = SHORTSWAP(*(u16 *) &Addr[1]);
- if (is_valid_ether_addr(EthAddr)) {
+ if (eth_addr_valid(EthAddr)) {
memcpy(hw->perm_mac_addr, EthAddr, ETH_ALEN);
return 0;
}
diff --git a/drivers/net/ethernet/atheros/atlx/atlx.c b/drivers/net/ethernet/atheros/atlx/atlx.c
index 77ffbc4..9324632 100644
--- a/drivers/net/ethernet/atheros/atlx/atlx.c
+++ b/drivers/net/ethernet/atheros/atlx/atlx.c
@@ -79,7 +79,7 @@ static int atlx_set_mac(struct net_device *netdev, void *p)
if (netif_running(netdev))
return -EBUSY;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
diff --git a/drivers/net/ethernet/broadcom/b44.c b/drivers/net/ethernet/broadcom/b44.c
index 9786c0e..fcfabc3 100644
--- a/drivers/net/ethernet/broadcom/b44.c
+++ b/drivers/net/ethernet/broadcom/b44.c
@@ -1357,7 +1357,7 @@ static int b44_set_mac_addr(struct net_device *dev, void *p)
if (netif_running(dev))
return -EBUSY;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EINVAL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
@@ -2106,7 +2106,7 @@ static int __devinit b44_get_invariants(struct b44 *bp)
memcpy(bp->dev->dev_addr, addr, 6);
- if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
+ if (!eth_addr_valid(&bp->dev->dev_addr[0])){
pr_err("Invalid MAC address found in EEPROM\n");
return -EINVAL;
}
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index d431070..74ea138 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -7854,7 +7854,7 @@ bnx2_change_mac_addr(struct net_device *dev, void *p)
struct sockaddr *addr = p;
struct bnx2 *bp = netdev_priv(dev);
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
index 4833b6a..26735f9 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c
@@ -2975,8 +2975,8 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
eth = (struct ethhdr *)skb->data;
/* set flag according to packet type (UNICAST_ADDRESS is default)*/
- if (unlikely(is_multicast_ether_addr(eth->h_dest))) {
- if (is_broadcast_ether_addr(eth->h_dest))
+ if (unlikely(eth_addr_multicast(eth->h_dest))) {
+ if (eth_addr_broadcast(eth->h_dest))
mac_type = BROADCAST_ADDRESS;
else
mac_type = MULTICAST_ADDRESS;
@@ -3341,7 +3341,7 @@ int bnx2x_change_mac_addr(struct net_device *dev, void *p)
#ifdef BCM_CNIC
if ((IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp)) &&
- !is_zero_ether_addr(addr->sa_data)) {
+ !eth_addr_zero(addr->sa_data)) {
BNX2X_ERR("Can't configure non-zero address on iSCSI or FCoE functions in MF-SD mode\n");
return -EINVAL;
}
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
index 9c5ea6c..6825a56 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
@@ -1340,10 +1340,10 @@ static inline void bnx2x_update_drv_flags(struct bnx2x *bp, u32 flags, u32 set)
static inline bool bnx2x_is_valid_ether_addr(struct bnx2x *bp, u8 *addr)
{
- if (is_valid_ether_addr(addr))
+ if (eth_addr_valid(addr))
return true;
#ifdef BCM_CNIC
- if (is_zero_ether_addr(addr) &&
+ if (eth_addr_zero(addr) &&
(IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp)))
return true;
#endif
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index d5648fc..1a8c401 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -7596,7 +7596,7 @@ int bnx2x_set_eth_mac(struct bnx2x *bp, bool set)
unsigned long ramrod_flags = 0;
#ifdef BCM_CNIC
- if (is_zero_ether_addr(bp->dev->dev_addr) &&
+ if (eth_addr_zero(bp->dev->dev_addr) &&
(IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))) {
DP(NETIF_MSG_IFUP | NETIF_MSG_IFDOWN,
"Ignoring Zero MAC for STORAGE SD mode\n");
@@ -10447,7 +10447,7 @@ static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)
/* Disable iSCSI if MAC configuration is
* invalid.
*/
- if (!is_valid_ether_addr(iscsi_mac)) {
+ if (!eth_addr_valid(iscsi_mac)) {
bp->flags |= NO_ISCSI_FLAG;
memset(iscsi_mac, 0, ETH_ALEN);
}
@@ -10455,7 +10455,7 @@ static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)
/* Disable FCoE if MAC configuration is
* invalid.
*/
- if (!is_valid_ether_addr(fip_mac)) {
+ if (!eth_addr_valid(fip_mac)) {
bp->flags |= NO_FCOE_FLAG;
memset(bp->fip_mac, 0, ETH_ALEN);
}
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
index 614981c..da96556 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
@@ -482,7 +482,7 @@ static int bnx2x_check_mac_add(struct bnx2x *bp,
DP(BNX2X_MSG_SP, "Checking MAC %pM for ADD command\n", data->mac.mac);
- if (!is_valid_ether_addr(data->mac.mac))
+ if (!eth_addr_valid(data->mac.mac))
return -EINVAL;
/* Check if a requested MAC already exists */
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index cc8434f..2f9e257 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -399,7 +399,7 @@ static int cnic_iscsi_nl_msg_recv(struct cnic_dev *dev, u32 msg_type,
memcpy(&csk->src_ip[0], &path_resp->src.v4_addr,
sizeof(struct in_addr));
- if (is_valid_ether_addr(csk->ha)) {
+ if (eth_addr_valid(csk->ha)) {
cnic_cm_set_pg(csk);
} else if (!test_bit(SK_F_OFFLD_SCHED, &csk->flags) &&
!test_bit(SK_F_OFFLD_COMPLETE, &csk->flags)) {
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index a8800ac..13efde2 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -8259,7 +8259,7 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p)
struct sockaddr *addr = p;
int err = 0, skip_mac_1 = 0;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
@@ -15304,7 +15304,7 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
dev->dev_addr[5] = (lo >> 0) & 0xff;
/* Some old bootcode may report a 0 MAC address in SRAM */
- addr_ok = is_valid_ether_addr(&dev->dev_addr[0]);
+ addr_ok = eth_addr_valid(&dev->dev_addr[0]);
}
if (!addr_ok) {
/* Next, try NVRAM. */
@@ -15328,7 +15328,7 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
}
}
- if (!is_valid_ether_addr(&dev->dev_addr[0])) {
+ if (!eth_addr_valid(&dev->dev_addr[0])) {
#ifdef CONFIG_SPARC
if (!tg3_get_default_macaddr_sparc(tp))
return 0;
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c
index ce1eac5..1cce0d2 100644
--- a/drivers/net/ethernet/brocade/bna/bnad.c
+++ b/drivers/net/ethernet/brocade/bna/bnad.c
@@ -632,7 +632,7 @@ bnad_set_netdev_perm_addr(struct bnad *bnad)
struct net_device *netdev = bnad->netdev;
memcpy(netdev->perm_addr, &bnad->perm_addr, netdev->addr_len);
- if (is_zero_ether_addr(netdev->dev_addr))
+ if (eth_addr_zero(netdev->dev_addr))
memcpy(netdev->dev_addr, &bnad->perm_addr, netdev->addr_len);
}
@@ -863,7 +863,7 @@ bnad_cb_tx_resume(struct bnad *bnad, struct bna_tx *tx)
* get a 0 MAC address. We try to get the MAC address
* again here.
*/
- if (is_zero_ether_addr(&bnad->perm_addr.mac[0])) {
+ if (eth_addr_zero(&bnad->perm_addr.mac[0])) {
bna_enet_perm_mac_get(&bnad->bna.enet, &bnad->perm_addr);
bnad_set_netdev_perm_addr(bnad);
}
@@ -2040,7 +2040,7 @@ bnad_mac_addr_set_locked(struct bnad *bnad, u8 *mac_addr)
{
int ret;
- if (!is_valid_ether_addr(mac_addr))
+ if (!eth_addr_valid(mac_addr))
return -EADDRNOTAVAIL;
/* If datapath is down, pretend everything went through */
diff --git a/drivers/net/ethernet/cadence/at91_ether.c b/drivers/net/ethernet/cadence/at91_ether.c
index 4e980a7..6ee06d8 100644
--- a/drivers/net/ethernet/cadence/at91_ether.c
+++ b/drivers/net/ethernet/cadence/at91_ether.c
@@ -464,7 +464,7 @@ static short __init unpack_mac_address(struct net_device *dev, unsigned int hi,
addr[5] = (hi & 0xff00) >> 8;
}
- if (is_valid_ether_addr(addr)) {
+ if (eth_addr_valid(addr)) {
memcpy(dev->dev_addr, &addr, 6);
return 1;
}
@@ -515,7 +515,7 @@ static int set_mac_address(struct net_device *dev, void* addr)
{
struct sockaddr *address = addr;
- if (!is_valid_ether_addr(address->sa_data))
+ if (!eth_addr_valid(address->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
@@ -777,7 +777,7 @@ static int at91ether_open(struct net_device *dev)
struct at91_private *lp = netdev_priv(dev);
unsigned long ctl;
- if (!is_valid_ether_addr(dev->dev_addr))
+ if (!eth_addr_valid(dev->dev_addr))
return -EADDRNOTAVAIL;
clk_enable(lp->ether_clk); /* Re-enable Peripheral clock */
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 033064b..e0d95c04 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -83,7 +83,7 @@ static void __init macb_get_hwaddr(struct macb *bp)
addr[4] = top & 0xff;
addr[5] = (top >> 8) & 0xff;
- if (is_valid_ether_addr(addr)) {
+ if (eth_addr_valid(addr)) {
memcpy(bp->dev->dev_addr, addr, sizeof(addr));
} else {
netdev_info(bp->dev, "invalid hw address, using random\n");
@@ -1043,7 +1043,7 @@ static int macb_open(struct net_device *dev)
if (!bp->phy_dev)
return -EAGAIN;
- if (!is_valid_ether_addr(dev->dev_addr))
+ if (!eth_addr_valid(dev->dev_addr))
return -EADDRNOTAVAIL;
err = macb_alloc_consistent(bp);
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c
index 16814b3..daff393 100644
--- a/drivers/net/ethernet/calxeda/xgmac.c
+++ b/drivers/net/ethernet/calxeda/xgmac.c
@@ -997,7 +997,7 @@ static int xgmac_open(struct net_device *dev)
* to bring the device up. The user must specify an
* address using the following linux command:
* ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx */
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
eth_hw_addr_random(dev);
netdev_dbg(priv->dev, "generated random MAC address %pM\n",
dev->dev_addr);
@@ -1463,7 +1463,7 @@ static int xgmac_set_mac_address(struct net_device *dev, void *p)
void __iomem *ioaddr = priv->base;
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
@@ -1765,7 +1765,7 @@ static int xgmac_probe(struct platform_device *pdev)
/* Get the MAC address */
xgmac_get_mac_addr(priv->base, ndev->dev_addr, 0);
- if (!is_valid_ether_addr(ndev->dev_addr))
+ if (!eth_addr_valid(ndev->dev_addr))
netdev_warn(ndev, "MAC address %pM not valid",
ndev->dev_addr);
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
index 9c9f326..7e03da5 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
@@ -2543,7 +2543,7 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p)
struct adapter *adapter = pi->adapter;
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 604f4f8..4f95029 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -3106,7 +3106,7 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p)
struct sockaddr *addr = p;
struct port_info *pi = netdev_priv(dev);
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
ret = t4_change_mac(pi->adapter, pi->adapter->fn, pi->viid,
diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
index 9dad561..7e46100 100644
--- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c
@@ -1129,7 +1129,7 @@ static int cxgb4vf_set_mac_addr(struct net_device *dev, void *_addr)
struct sockaddr *addr = _addr;
struct port_info *pi = netdev_priv(dev);
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
ret = t4vf_change_mac(pi->adapter, pi->viid, pi->xact_addr_filt,
diff --git a/drivers/net/ethernet/cirrus/ep93xx_eth.c b/drivers/net/ethernet/cirrus/ep93xx_eth.c
index 78c5521..b4806c4 100644
--- a/drivers/net/ethernet/cirrus/ep93xx_eth.c
+++ b/drivers/net/ethernet/cirrus/ep93xx_eth.c
@@ -858,7 +858,7 @@ static int ep93xx_eth_probe(struct platform_device *pdev)
ep->mii.mdio_write = ep93xx_mdio_write;
ep->mdc_divisor = 40; /* Max HCLK 100 MHz, min MDIO clk 2.5 MHz. */
- if (is_zero_ether_addr(dev->dev_addr))
+ if (eth_addr_zero(dev->dev_addr))
eth_hw_addr_random(dev);
err = register_netdev(dev);
diff --git a/drivers/net/ethernet/cirrus/mac89x0.c b/drivers/net/ethernet/cirrus/mac89x0.c
index e285f38..f5b39af 100644
--- a/drivers/net/ethernet/cirrus/mac89x0.c
+++ b/drivers/net/ethernet/cirrus/mac89x0.c
@@ -593,7 +593,7 @@ static int set_mac_address(struct net_device *dev, void *addr)
struct sockaddr *saddr = addr;
int i;
- if (!is_valid_ether_addr(saddr->sa_data))
+ if (!eth_addr_valid(saddr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, saddr->sa_data, ETH_ALEN);
diff --git a/drivers/net/ethernet/cisco/enic/enic_dev.c b/drivers/net/ethernet/cisco/enic/enic_dev.c
index bf0fc56..bc15a36 100644
--- a/drivers/net/ethernet/cisco/enic/enic_dev.c
+++ b/drivers/net/ethernet/cisco/enic/enic_dev.c
@@ -51,7 +51,7 @@ int enic_dev_add_station_addr(struct enic *enic)
{
int err;
- if (!is_valid_ether_addr(enic->netdev->dev_addr))
+ if (!eth_addr_valid(enic->netdev->dev_addr))
return -EADDRNOTAVAIL;
spin_lock(&enic->devcmd_lock);
@@ -65,7 +65,7 @@ int enic_dev_del_station_addr(struct enic *enic)
{
int err;
- if (!is_valid_ether_addr(enic->netdev->dev_addr))
+ if (!eth_addr_valid(enic->netdev->dev_addr))
return -EADDRNOTAVAIL;
spin_lock(&enic->devcmd_lock);
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index ad1468b..f70c8ff 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -857,10 +857,10 @@ static int enic_set_mac_addr(struct net_device *netdev, char *addr)
struct enic *enic = netdev_priv(netdev);
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic)) {
- if (!is_valid_ether_addr(addr) && !is_zero_ether_addr(addr))
+ if (!eth_addr_valid(addr) && !eth_addr_zero(addr))
return -EADDRNOTAVAIL;
} else {
- if (!is_valid_ether_addr(addr))
+ if (!eth_addr_valid(addr))
return -EADDRNOTAVAIL;
}
@@ -1065,7 +1065,7 @@ static int enic_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
if (err)
return err;
- if (is_valid_ether_addr(mac) || is_zero_ether_addr(mac)) {
+ if (eth_addr_valid(mac) || eth_addr_zero(mac)) {
if (vf == PORT_SELF_VF) {
memcpy(pp->vf_mac, mac, ETH_ALEN);
return 0;
@@ -1122,10 +1122,10 @@ static int enic_set_vf_port(struct net_device *netdev, int vf,
if (vf == PORT_SELF_VF) {
/* Special case handling: mac came from IFLA_VF_MAC */
- if (!is_zero_ether_addr(prev_pp.vf_mac))
+ if (!eth_addr_zero(prev_pp.vf_mac))
memcpy(pp->mac_addr, prev_pp.vf_mac, ETH_ALEN);
- if (is_zero_ether_addr(netdev->dev_addr))
+ if (eth_addr_zero(netdev->dev_addr))
eth_hw_addr_random(netdev);
} else {
/* SR-IOV VF: get mac from adapter */
diff --git a/drivers/net/ethernet/cisco/enic/enic_pp.c b/drivers/net/ethernet/cisco/enic/enic_pp.c
index 43464f0..3ad72fe 100644
--- a/drivers/net/ethernet/cisco/enic/enic_pp.c
+++ b/drivers/net/ethernet/cisco/enic/enic_pp.c
@@ -94,7 +94,7 @@ static int enic_set_port_profile(struct enic *enic, int vf)
VIC_GENERIC_PROV_TLV_PORT_PROFILE_NAME_STR,
strlen(pp->name) + 1, pp->name);
- if (!is_zero_ether_addr(pp->mac_addr)) {
+ if (!eth_addr_zero(pp->mac_addr)) {
client_mac = pp->mac_addr;
} else if (vf == PORT_SELF_VF) {
client_mac = netdev->dev_addr;
@@ -204,10 +204,10 @@ static int enic_pp_disassociate(struct enic *enic, int vf,
return err;
/* Deregister mac addresses */
- if (!is_zero_ether_addr(pp->mac_addr))
+ if (!eth_addr_zero(pp->mac_addr))
ENIC_DEVCMD_PROXY_BY_INDEX(vf, err, enic, vnic_dev_del_addr,
pp->mac_addr);
- else if (vf == PORT_SELF_VF && !is_zero_ether_addr(netdev->dev_addr))
+ else if (vf == PORT_SELF_VF && !eth_addr_zero(netdev->dev_addr))
ENIC_DEVCMD_PROXY_BY_INDEX(vf, err, enic, vnic_dev_del_addr,
netdev->dev_addr);
@@ -291,10 +291,10 @@ static int enic_pp_associate(struct enic *enic, int vf,
return err;
/* Register mac address */
- if (!is_zero_ether_addr(pp->mac_addr))
+ if (!eth_addr_zero(pp->mac_addr))
ENIC_DEVCMD_PROXY_BY_INDEX(vf, err, enic, vnic_dev_add_addr,
pp->mac_addr);
- else if (vf == PORT_SELF_VF && !is_zero_ether_addr(netdev->dev_addr))
+ else if (vf == PORT_SELF_VF && !eth_addr_zero(netdev->dev_addr))
ENIC_DEVCMD_PROXY_BY_INDEX(vf, err, enic, vnic_dev_add_addr,
netdev->dev_addr);
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index 36499d5..663e2b3 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -1568,12 +1568,12 @@ dm9000_probe(struct platform_device *pdev)
for (i = 0; i < 6; i += 2)
dm9000_read_eeprom(db, i / 2, ndev->dev_addr+i);
- if (!is_valid_ether_addr(ndev->dev_addr) && pdata != NULL) {
+ if (!eth_addr_valid(ndev->dev_addr) && pdata != NULL) {
mac_src = "platform data";
memcpy(ndev->dev_addr, pdata->dev_addr, 6);
}
- if (!is_valid_ether_addr(ndev->dev_addr)) {
+ if (!eth_addr_valid(ndev->dev_addr)) {
/* try reading from mac */
mac_src = "chip";
@@ -1581,7 +1581,7 @@ dm9000_probe(struct platform_device *pdev)
ndev->dev_addr[i] = ior(db, i+DM9000_PAR);
}
- if (!is_valid_ether_addr(ndev->dev_addr)) {
+ if (!eth_addr_valid(ndev->dev_addr)) {
dev_warn(db->dev, "%s: Invalid ethernet MAC address. Please "
"set using ifconfig\n", ndev->name);
diff --git a/drivers/net/ethernet/dec/ewrk3.c b/drivers/net/ethernet/dec/ewrk3.c
index 17ae8c6..468fd127 100644
--- a/drivers/net/ethernet/dec/ewrk3.c
+++ b/drivers/net/ethernet/dec/ewrk3.c
@@ -1010,8 +1010,8 @@ static int ewrk3_rx(struct net_device *dev)
}
}
p = skb->data; /* Look at the dest addr */
- if (is_multicast_ether_addr(p)) {
- if (is_broadcast_ether_addr(p)) {
+ if (eth_addr_multicast(p)) {
+ if (eth_addr_broadcast(p)) {
lp->pktStats.broadcast++;
} else {
lp->pktStats.multicast++;
diff --git a/drivers/net/ethernet/dec/tulip/de4x5.c b/drivers/net/ethernet/dec/tulip/de4x5.c
index f879e92..aca612d 100644
--- a/drivers/net/ethernet/dec/tulip/de4x5.c
+++ b/drivers/net/ethernet/dec/tulip/de4x5.c
@@ -1868,8 +1868,8 @@ de4x5_local_stats(struct net_device *dev, char *buf, int pkt_len)
i = DE4X5_PKT_STAT_SZ;
}
}
- if (is_multicast_ether_addr(buf)) {
- if (is_broadcast_ether_addr(buf)) {
+ if (eth_addr_multicast(buf)) {
+ if (eth_addr_broadcast(buf)) {
lp->pktStats.broadcast++;
} else {
lp->pktStats.multicast++;
diff --git a/drivers/net/ethernet/dlink/sundance.c b/drivers/net/ethernet/dlink/sundance.c
index 3b83588..7c16cd9 100644
--- a/drivers/net/ethernet/dlink/sundance.c
+++ b/drivers/net/ethernet/dlink/sundance.c
@@ -1598,7 +1598,7 @@ static int sundance_set_mac_addr(struct net_device *dev, void *data)
{
const struct sockaddr *addr = data;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
__set_mac_addr(dev);
diff --git a/drivers/net/ethernet/dnet.c b/drivers/net/ethernet/dnet.c
index 290b26f..b314d90 100644
--- a/drivers/net/ethernet/dnet.c
+++ b/drivers/net/ethernet/dnet.c
@@ -96,7 +96,7 @@ static void __devinit dnet_get_hwaddr(struct dnet *bp)
tmp = dnet_readw_mac(bp, DNET_INTERNAL_MAC_ADDR_2_REG);
*((__be16 *)(addr + 4)) = cpu_to_be16(tmp);
- if (is_valid_ether_addr(addr))
+ if (eth_addr_valid(addr))
memcpy(bp->dev->dev_addr, addr, sizeof(addr));
}
@@ -664,7 +664,7 @@ static int dnet_open(struct net_device *dev)
if (!bp->phy_dev)
return -EAGAIN;
- if (!is_valid_ether_addr(dev->dev_addr))
+ if (!eth_addr_valid(dev->dev_addr))
return -EADDRNOTAVAIL;
napi_enable(&bp->napi);
@@ -894,7 +894,7 @@ static int __devinit dnet_probe(struct platform_device *pdev)
dnet_get_hwaddr(bp);
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
/* choose a random ethernet address */
eth_hw_addr_random(dev);
__dnet_set_hwaddr(bp);
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c
index d1b6cc5..db8eca7 100644
--- a/drivers/net/ethernet/emulex/benet/be_main.c
+++ b/drivers/net/ethernet/emulex/benet/be_main.c
@@ -238,7 +238,7 @@ static int be_mac_addr_set(struct net_device *netdev, void *p)
u8 current_mac[ETH_ALEN];
u32 pmac_id = adapter->pmac_id[0];
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
status = be_cmd_mac_addr_query(adapter, current_mac, false,
@@ -966,7 +966,7 @@ static int be_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
if (!sriov_enabled(adapter))
return -EPERM;
- if (!is_valid_ether_addr(mac) || vf >= adapter->num_vfs)
+ if (!eth_addr_valid(mac) || vf >= adapter->num_vfs)
return -EINVAL;
if (lancer_chip(adapter)) {
@@ -2682,7 +2682,7 @@ static int be_get_mac_addr(struct be_adapter *adapter, u8 *mac, u32 if_handle,
{
int status = 0;
- if (!is_zero_ether_addr(adapter->netdev->perm_addr)) {
+ if (!eth_addr_zero(adapter->netdev->perm_addr)) {
memcpy(mac, adapter->netdev->dev_addr, ETH_ALEN);
if (!lancer_chip(adapter) && !be_physfn(adapter))
*active_mac = true;
@@ -2798,7 +2798,7 @@ static int be_setup(struct be_adapter *adapter)
goto err;
}
- if (is_zero_ether_addr(adapter->netdev->dev_addr)) {
+ if (eth_addr_zero(adapter->netdev->dev_addr)) {
memcpy(adapter->netdev->dev_addr, mac, ETH_ALEN);
memcpy(adapter->netdev->perm_addr, mac, ETH_ALEN);
}
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index 94b7bfc..d5ebf25 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -776,7 +776,7 @@ static int ethoc_set_mac_address(struct net_device *dev, void *addr)
struct ethoc *priv = netdev_priv(dev);
u8 *mac = (u8 *)addr;
- if (!is_valid_ether_addr(mac))
+ if (!eth_addr_valid(mac))
return -EADDRNOTAVAIL;
ethoc_write(priv, MAC_ADDR0, (mac[2] << 24) | (mac[3] << 16) |
@@ -1051,12 +1051,12 @@ static int __devinit ethoc_probe(struct platform_device *pdev)
/* Check that the given MAC address is valid. If it isn't, read the
* current MAC from the controller. */
- if (!is_valid_ether_addr(netdev->dev_addr))
+ if (!eth_addr_valid(netdev->dev_addr))
ethoc_get_mac_address(netdev, netdev->dev_addr);
/* Check the MAC again for validity, if it still isn't choose and
* program a random one. */
- if (!is_valid_ether_addr(netdev->dev_addr)) {
+ if (!eth_addr_valid(netdev->dev_addr)) {
eth_random_addr(netdev->dev_addr);
random_mac = true;
}
diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
index 74d749e..2f04209 100644
--- a/drivers/net/ethernet/faraday/ftgmac100.c
+++ b/drivers/net/ethernet/faraday/ftgmac100.c
@@ -1293,7 +1293,7 @@ static int ftgmac100_probe(struct platform_device *pdev)
netdev_info(netdev, "irq %d, mapped at %p\n", priv->irq, priv->base);
- if (!is_valid_ether_addr(netdev->dev_addr)) {
+ if (!eth_addr_valid(netdev->dev_addr)) {
eth_hw_addr_random(netdev);
netdev_info(netdev, "generated random MAC address %pM\n",
netdev->dev_addr);
diff --git a/drivers/net/ethernet/faraday/ftmac100.c b/drivers/net/ethernet/faraday/ftmac100.c
index b901a01..607ec55 100644
--- a/drivers/net/ethernet/faraday/ftmac100.c
+++ b/drivers/net/ethernet/faraday/ftmac100.c
@@ -1135,7 +1135,7 @@ static int ftmac100_probe(struct platform_device *pdev)
netdev_info(netdev, "irq %d, mapped at %p\n", priv->irq, priv->base);
- if (!is_valid_ether_addr(netdev->dev_addr)) {
+ if (!eth_addr_valid(netdev->dev_addr)) {
eth_hw_addr_random(netdev);
netdev_info(netdev, "generated random MAC address %pM\n",
netdev->dev_addr);
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index fffd205..72c8380 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -811,7 +811,7 @@ static void __inline__ fec_get_mac(struct net_device *ndev)
/*
* 2) from device tree data
*/
- if (!is_valid_ether_addr(iap)) {
+ if (!eth_addr_valid(iap)) {
struct device_node *np = fep->pdev->dev.of_node;
if (np) {
const char *mac = of_get_mac_address(np);
@@ -824,7 +824,7 @@ static void __inline__ fec_get_mac(struct net_device *ndev)
/*
* 3) from flash or fuse (via platform data)
*/
- if (!is_valid_ether_addr(iap)) {
+ if (!eth_addr_valid(iap)) {
#ifdef CONFIG_M5272
if (FEC_FLASHMAC)
iap = (unsigned char *)FEC_FLASHMAC;
@@ -837,7 +837,7 @@ static void __inline__ fec_get_mac(struct net_device *ndev)
/*
* 4) FEC mac registers set by bootloader
*/
- if (!is_valid_ether_addr(iap)) {
+ if (!eth_addr_valid(iap)) {
*((unsigned long *) &tmpaddr[0]) =
be32_to_cpu(readl(fep->hwp + FEC_ADDR_LOW));
*((unsigned short *) &tmpaddr[4]) =
@@ -1375,7 +1375,7 @@ fec_set_mac_address(struct net_device *ndev, void *p)
struct fec_enet_private *fep = netdev_priv(ndev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx.c b/drivers/net/ethernet/freescale/fec_mpc52xx.c
index 2933d08..ca5ce3c 100644
--- a/drivers/net/ethernet/freescale/fec_mpc52xx.c
+++ b/drivers/net/ethernet/freescale/fec_mpc52xx.c
@@ -928,7 +928,7 @@ static int __devinit mpc52xx_fec_probe(struct platform_device *op)
priv->t_irq = bcom_get_task_irq(priv->tx_dmatsk);
/* MAC address init */
- if (!is_zero_ether_addr(mpc52xx_fec_mac_addr))
+ if (!eth_addr_zero(mpc52xx_fec_mac_addr))
memcpy(ndev->dev_addr, mpc52xx_fec_mac_addr, 6);
else
mpc52xx_fec_get_paddr(ndev, ndev->dev_addr);
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index ab6762c..ab65a61 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -1014,8 +1014,8 @@ static void gfar_set_ether(struct ethhdr *value, struct ethhdr *mask,
u32 lower_temp_mask = 0;
/* Source address */
- if (!is_broadcast_ether_addr(mask->h_source)) {
- if (is_zero_ether_addr(mask->h_source)) {
+ if (!eth_addr_broadcast(mask->h_source)) {
+ if (eth_addr_zero(mask->h_source)) {
upper_temp_mask = 0xFFFFFFFF;
lower_temp_mask = 0xFFFFFFFF;
} else {
@@ -1038,13 +1038,13 @@ static void gfar_set_ether(struct ethhdr *value, struct ethhdr *mask,
lower_temp_mask, RQFCR_PID_SAL, tab);
}
/* Destination address */
- if (!is_broadcast_ether_addr(mask->h_dest)) {
+ if (!eth_addr_broadcast(mask->h_dest)) {
/* Special for destination is limited broadcast */
- if ((is_broadcast_ether_addr(value->h_dest) &&
- is_zero_ether_addr(mask->h_dest))) {
+ if ((eth_addr_broadcast(value->h_dest) &&
+ eth_addr_zero(mask->h_dest))) {
gfar_set_parse_bits(RQFPR_EBC, RQFPR_EBC, tab);
} else {
- if (is_zero_ether_addr(mask->h_dest)) {
+ if (eth_addr_zero(mask->h_dest)) {
upper_temp_mask = 0xFFFFFFFF;
lower_temp_mask = 0xFFFFFFFF;
} else {
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index 0a70bb5..424ab77 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -3448,7 +3448,7 @@ static int ucc_geth_set_mac_addr(struct net_device *dev, void *p)
struct ucc_geth_private *ugeth = netdev_priv(dev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
diff --git a/drivers/net/ethernet/i825xx/ether1.c b/drivers/net/ethernet/i825xx/ether1.c
index 067db3f..9e67b31 100644
--- a/drivers/net/ethernet/i825xx/ether1.c
+++ b/drivers/net/ethernet/i825xx/ether1.c
@@ -638,7 +638,7 @@ ether1_txalloc (struct net_device *dev, int size)
static int
ether1_open (struct net_device *dev)
{
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
printk(KERN_WARNING "%s: invalid ethernet MAC address\n",
dev->name);
return -EINVAL;
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index f4d2da0..09f4c1d 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -1011,7 +1011,7 @@ int ehea_sense_port_attr(struct ehea_port *port)
/* MAC address */
port->mac_addr = cb0->port_mac_addr << 16;
- if (!is_valid_ether_addr((u8 *)&port->mac_addr)) {
+ if (!eth_addr_valid((u8 *)&port->mac_addr)) {
ret = -EADDRNOTAVAIL;
goto out_free;
}
@@ -1741,7 +1741,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
int ret;
u64 hret;
- if (!is_valid_ether_addr(mac_addr->sa_data)) {
+ if (!eth_addr_valid(mac_addr->sa_data)) {
ret = -EADDRNOTAVAIL;
goto out;
}
diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c
index 29ce9bd..6cc50e0 100644
--- a/drivers/net/ethernet/intel/e100.c
+++ b/drivers/net/ethernet/intel/e100.c
@@ -2263,7 +2263,7 @@ static int e100_set_mac_address(struct net_device *netdev, void *p)
struct nic *nic = netdev_priv(netdev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
@@ -2930,7 +2930,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
memcpy(netdev->dev_addr, nic->eeprom, ETH_ALEN);
memcpy(netdev->perm_addr, nic->eeprom, ETH_ALEN);
- if (!is_valid_ether_addr(netdev->perm_addr)) {
+ if (!eth_addr_valid(netdev->perm_addr)) {
if (!eeprom_bad_csum_allow) {
netif_err(nic, probe, nic->netdev, "Invalid MAC address from EEPROM, aborting\n");
err = -EAGAIN;
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 222bfaf..ad49b1e 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1126,7 +1126,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
memcpy(netdev->dev_addr, hw->mac_addr, netdev->addr_len);
memcpy(netdev->perm_addr, hw->mac_addr, netdev->addr_len);
- if (!is_valid_ether_addr(netdev->perm_addr))
+ if (!eth_addr_valid(netdev->perm_addr))
e_err(probe, "Invalid MAC Address\n");
@@ -2213,7 +2213,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p)
struct e1000_hw *hw = &adapter->hw;
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
/* 82542 2.0 needs to be in reset to write receive address registers */
diff --git a/drivers/net/ethernet/intel/e1000e/mac.c b/drivers/net/ethernet/intel/e1000e/mac.c
index a134399..37d9fd1 100644
--- a/drivers/net/ethernet/intel/e1000e/mac.c
+++ b/drivers/net/ethernet/intel/e1000e/mac.c
@@ -205,7 +205,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
}
/* if multicast bit is set, the alternate address will not be used */
- if (is_multicast_ether_addr(alt_mac_addr)) {
+ if (eth_addr_multicast(alt_mac_addr)) {
e_dbg("Ignoring Alternate Mac Address with MC bit set\n");
return 0;
}
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index f444eb0..58be1cb 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -4053,7 +4053,7 @@ static int e1000_set_mac(struct net_device *netdev, void *p)
struct e1000_hw *hw = &adapter->hw;
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
@@ -6292,7 +6292,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
- if (!is_valid_ether_addr(netdev->perm_addr)) {
+ if (!eth_addr_valid(netdev->perm_addr)) {
dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
netdev->perm_addr);
err = -EIO;
diff --git a/drivers/net/ethernet/intel/igb/e1000_mac.c b/drivers/net/ethernet/intel/igb/e1000_mac.c
index 819c145..0c58632 100644
--- a/drivers/net/ethernet/intel/igb/e1000_mac.c
+++ b/drivers/net/ethernet/intel/igb/e1000_mac.c
@@ -280,7 +280,7 @@ s32 igb_check_alt_mac_addr(struct e1000_hw *hw)
}
/* if multicast bit is set, the alternate address will not be used */
- if (is_multicast_ether_addr(alt_mac_addr)) {
+ if (eth_addr_multicast(alt_mac_addr)) {
hw_dbg("Ignoring Alternate Mac Address with MC bit set\n");
goto out;
}
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index e1ceb37..7e34d44 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2042,7 +2042,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
memcpy(netdev->dev_addr, hw->mac.addr, netdev->addr_len);
memcpy(netdev->perm_addr, hw->mac.addr, netdev->addr_len);
- if (!is_valid_ether_addr(netdev->perm_addr)) {
+ if (!eth_addr_valid(netdev->perm_addr)) {
dev_err(&pdev->dev, "Invalid MAC Address\n");
err = -EIO;
goto err_eeprom;
@@ -3372,7 +3372,7 @@ static int igb_set_mac(struct net_device *netdev, void *p)
struct e1000_hw *hw = &adapter->hw;
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
@@ -5362,7 +5362,7 @@ static int igb_set_vf_mac_addr(struct igb_adapter *adapter, u32 *msg, int vf)
unsigned char *addr = (char *)&msg[1];
int err = -1;
- if (is_valid_ether_addr(addr))
+ if (eth_addr_valid(addr))
err = igb_set_vf_mac(adapter, vf, addr);
return err;
@@ -6718,7 +6718,7 @@ static int igb_set_vf_mac(struct igb_adapter *adapter,
static int igb_ndo_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
{
struct igb_adapter *adapter = netdev_priv(netdev);
- if (!is_valid_ether_addr(mac) || (vf >= adapter->vfs_allocated_count))
+ if (!eth_addr_valid(mac) || (vf >= adapter->vfs_allocated_count))
return -EINVAL;
adapter->vf_data[vf].flags |= IGB_VF_FLAG_PF_SET_MAC;
dev_info(&adapter->pdev->dev, "setting MAC %pM on VF %d\n", mac, vf);
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index 0ac11f5..e502b73 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -1432,7 +1432,7 @@ static void igbvf_reset(struct igbvf_adapter *adapter)
mac->ops.init_hw(hw);
- if (is_valid_ether_addr(adapter->hw.mac.addr)) {
+ if (eth_addr_valid(adapter->hw.mac.addr)) {
memcpy(netdev->dev_addr, adapter->hw.mac.addr,
netdev->addr_len);
memcpy(netdev->perm_addr, adapter->hw.mac.addr,
@@ -1707,7 +1707,7 @@ static int igbvf_set_mac(struct net_device *netdev, void *p)
struct e1000_hw *hw = &adapter->hw;
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(hw->mac.addr, addr->sa_data, netdev->addr_len);
@@ -2732,7 +2732,7 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
netdev->addr_len);
}
- if (!is_valid_ether_addr(netdev->dev_addr)) {
+ if (!eth_addr_valid(netdev->dev_addr)) {
dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
netdev->dev_addr);
err = -EIO;
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_hw.c b/drivers/net/ethernet/intel/ixgb/ixgb_hw.c
index bf9a220..d51cb6d 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_hw.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_hw.c
@@ -1128,17 +1128,17 @@ mac_addr_valid(u8 *mac_addr)
ENTER();
/* Make sure it is not a multicast address */
- if (is_multicast_ether_addr(mac_addr)) {
+ if (eth_addr_multicast(mac_addr)) {
pr_debug("MAC address is multicast\n");
is_valid = false;
}
/* Not a broadcast address */
- else if (is_broadcast_ether_addr(mac_addr)) {
+ else if (eth_addr_broadcast(mac_addr)) {
pr_debug("MAC address is broadcast\n");
is_valid = false;
}
/* Reject the zero address */
- else if (is_zero_ether_addr(mac_addr)) {
+ else if (eth_addr_zero(mac_addr)) {
pr_debug("MAC address is all zeros\n");
is_valid = false;
}
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
index d99a2d5..d6f2a43 100644
--- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c
+++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c
@@ -502,7 +502,7 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr);
memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
- if (!is_valid_ether_addr(netdev->perm_addr)) {
+ if (!eth_addr_valid(netdev->perm_addr)) {
netif_err(adapter, probe, adapter->netdev, "Invalid MAC Address\n");
err = -EIO;
goto err_eeprom;
@@ -1080,7 +1080,7 @@ ixgb_set_mac(struct net_device *netdev, void *p)
struct ixgb_adapter *adapter = netdev_priv(netdev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
@@ -2342,7 +2342,7 @@ static pci_ers_result_t ixgb_io_slot_reset(struct pci_dev *pdev)
ixgb_get_ee_mac_addr(&adapter->hw, netdev->dev_addr);
memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
- if (!is_valid_ether_addr(netdev->perm_addr)) {
+ if (!eth_addr_valid(netdev->perm_addr)) {
netif_err(adapter, probe, adapter->netdev,
"After reset, invalid MAC address\n");
return PCI_ERS_RESULT_DISCONNECT;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index ae73ef1..35d46ae 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -893,7 +893,7 @@ int ixgbe_fcoe_get_wwn(struct net_device *netdev, u64 *wwn, int type)
}
if ((prefix != 0xffff) &&
- is_valid_ether_addr(mac->san_addr)) {
+ eth_addr_valid(mac->san_addr)) {
*wwn = ((u64) prefix << 48) |
((u64) mac->san_addr[0] << 40) |
((u64) mac->san_addr[1] << 32) |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index fa3d552..fb05d31 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -6504,7 +6504,7 @@ static int ixgbe_set_mac(struct net_device *netdev, void *p)
struct ixgbe_hw *hw = &adapter->hw;
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
@@ -6569,7 +6569,7 @@ static int ixgbe_add_sanmac_netdev(struct net_device *dev)
struct ixgbe_adapter *adapter = netdev_priv(dev);
struct ixgbe_hw *hw = &adapter->hw;
- if (is_valid_ether_addr(hw->mac.san_addr)) {
+ if (eth_addr_valid(hw->mac.san_addr)) {
rtnl_lock();
err = dev_addr_add(dev, hw->mac.san_addr, NETDEV_HW_ADDR_T_SAN);
rtnl_unlock();
@@ -6593,7 +6593,7 @@ static int ixgbe_del_sanmac_netdev(struct net_device *dev)
struct ixgbe_adapter *adapter = netdev_priv(dev);
struct ixgbe_mac_info *mac = &adapter->hw.mac;
- if (is_valid_ether_addr(mac->san_addr)) {
+ if (eth_addr_valid(mac->san_addr)) {
rtnl_lock();
err = dev_addr_del(dev, mac->san_addr, NETDEV_HW_ADDR_T_SAN);
rtnl_unlock();
@@ -6916,14 +6916,14 @@ static int ixgbe_ndo_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
return -EINVAL;
}
- if (is_unicast_ether_addr(addr)) {
+ if (eth_addr_unicast(addr)) {
u32 rar_uc_entries = IXGBE_MAX_PF_MACVLANS;
if (netdev_uc_count(dev) < rar_uc_entries)
err = dev_uc_add_excl(dev, addr);
else
err = -ENOMEM;
- } else if (is_multicast_ether_addr(addr)) {
+ } else if (eth_addr_multicast(addr)) {
err = dev_mc_add_excl(dev, addr);
} else {
err = -EINVAL;
@@ -6950,9 +6950,9 @@ static int ixgbe_ndo_fdb_del(struct ndmsg *ndm,
}
if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) {
- if (is_unicast_ether_addr(addr))
+ if (eth_addr_unicast(addr))
err = dev_uc_del(dev, addr);
- else if (is_multicast_ether_addr(addr))
+ else if (eth_addr_multicast(addr))
err = dev_mc_del(dev, addr);
else
err = -EINVAL;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
index dce48bf..af64c92 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
@@ -585,7 +585,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
ixgbe_vf_reset_msg(adapter, vf);
adapter->vfinfo[vf].clear_to_send = true;
- if (is_valid_ether_addr(new_mac) &&
+ if (eth_addr_valid(new_mac) &&
!adapter->vfinfo[vf].pf_set_mac)
ixgbe_set_vf_mac(adapter, vf, vf_mac);
else
@@ -614,7 +614,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf)
switch ((msgbuf[0] & 0xFFFF)) {
case IXGBE_VF_SET_MAC_ADDR:
new_mac = ((u8 *)(&msgbuf[1]));
- if (is_valid_ether_addr(new_mac) &&
+ if (eth_addr_valid(new_mac) &&
!adapter->vfinfo[vf].pf_set_mac) {
ixgbe_set_vf_mac(adapter, vf, new_mac);
} else if (memcmp(adapter->vfinfo[vf].vf_mac_addresses,
@@ -756,7 +756,7 @@ void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter)
int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
{
struct ixgbe_adapter *adapter = netdev_priv(netdev);
- if (!is_valid_ether_addr(mac) || (vf >= adapter->num_vfs))
+ if (!eth_addr_valid(mac) || (vf >= adapter->num_vfs))
return -EINVAL;
adapter->vfinfo[vf].pf_set_mac = true;
dev_info(&adapter->pdev->dev, "setting MAC %pM on VF %d\n", mac, vf);
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index de1ad50..ff61bcb 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1392,7 +1392,7 @@ static void ixgbevf_up_complete(struct ixgbevf_adapter *adapter)
spin_lock(&adapter->mbx_lock);
if (hw->mac.ops.set_rar) {
- if (is_valid_ether_addr(hw->mac.addr))
+ if (eth_addr_valid(hw->mac.addr))
hw->mac.ops.set_rar(hw, 0, hw->mac.addr, 0);
else
hw->mac.ops.set_rar(hw, 0, hw->mac.perm_addr, 0);
@@ -1620,7 +1620,7 @@ void ixgbevf_reset(struct ixgbevf_adapter *adapter)
spin_unlock(&adapter->mbx_lock);
- if (is_valid_ether_addr(adapter->hw.mac.addr)) {
+ if (eth_addr_valid(adapter->hw.mac.addr)) {
memcpy(netdev->dev_addr, adapter->hw.mac.addr,
netdev->addr_len);
memcpy(netdev->perm_addr, adapter->hw.mac.addr,
@@ -2896,7 +2896,7 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p)
struct ixgbe_hw *hw = &adapter->hw;
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
@@ -3183,7 +3183,7 @@ static int __devinit ixgbevf_probe(struct pci_dev *pdev,
/* The HW MAC address was set and/or determined in sw_init */
memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
- if (!is_valid_ether_addr(netdev->dev_addr)) {
+ if (!eth_addr_valid(netdev->dev_addr)) {
pr_err("invalid MAC address\n");
err = -EIO;
goto err_sw_init;
diff --git a/drivers/net/ethernet/lantiq_etop.c b/drivers/net/ethernet/lantiq_etop.c
index 003c5bc..6e00638 100644
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -643,7 +643,7 @@ ltq_etop_init(struct net_device *dev)
ltq_etop_change_mtu(dev, 1500);
memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr));
- if (!is_valid_ether_addr(mac.sa_data)) {
+ if (!eth_addr_valid(mac.sa_data)) {
pr_warn("etop: invalid MAC, using random\n");
eth_random_addr(mac.sa_data);
random_mac = true;
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 84c1326..9735faa 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -1830,7 +1830,7 @@ static int mv643xx_eth_set_mac_address(struct net_device *dev, void *addr)
{
struct sockaddr *sa = addr;
- if (!is_valid_ether_addr(sa->sa_data))
+ if (!eth_addr_valid(sa->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN);
@@ -2727,7 +2727,7 @@ static void set_params(struct mv643xx_eth_private *mp,
{
struct net_device *dev = mp->dev;
- if (is_valid_ether_addr(pd->mac_addr))
+ if (eth_addr_valid(pd->mac_addr))
memcpy(dev->dev_addr, pd->mac_addr, 6);
else
uc_addr_get(mp, dev->dev_addr);
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 5948972..8c46003 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -624,7 +624,7 @@ static int pxa168_eth_set_mac_address(struct net_device *dev, void *addr)
struct pxa168_eth_private *pep = netdev_priv(dev);
unsigned char oldMac[ETH_ALEN];
- if (!is_valid_ether_addr(sa->sa_data))
+ if (!eth_addr_valid(sa->sa_data))
return -EADDRNOTAVAIL;
memcpy(oldMac, dev->dev_addr, ETH_ALEN);
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index 9b9c2ac..c03c2a3 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -2524,7 +2524,7 @@ static int skge_up(struct net_device *dev)
size_t rx_size, tx_size;
int err;
- if (!is_valid_ether_addr(dev->dev_addr))
+ if (!eth_addr_valid(dev->dev_addr))
return -EINVAL;
netif_info(skge, ifup, skge->netdev, "enabling interface\n");
@@ -3419,7 +3419,7 @@ static int skge_set_mac_address(struct net_device *dev, void *p)
const struct sockaddr *addr = p;
u16 ctrl;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
@@ -3951,7 +3951,7 @@ static int __devinit skge_probe(struct pci_dev *pdev,
}
/* Some motherboards are broken and has zero in ROM. */
- if (!is_valid_ether_addr(dev->dev_addr))
+ if (!eth_addr_valid(dev->dev_addr))
dev_warn(&pdev->dev, "bad (zero?) ethernet address in rom\n");
err = register_netdev(dev);
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 78946fe..38a8d27 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -3823,7 +3823,7 @@ static int sky2_set_mac_address(struct net_device *dev, void *p)
unsigned port = sky2->port;
const struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
index edd9cb8..aeb6285 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c
@@ -432,7 +432,7 @@ static int mlx4_en_set_mac(struct net_device *dev, void *addr)
struct mlx4_en_dev *mdev = priv->mdev;
struct sockaddr *saddr = addr;
- if (!is_valid_ether_addr(saddr->sa_data))
+ if (!eth_addr_valid(saddr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, saddr->sa_data, ETH_ALEN);
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 926c911..4c79433 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -2992,8 +2992,8 @@ static int validate_eth_header_mac(int slave, struct _rule_hw *eth_header,
__be64 be_mac;
/* make sure it isn't multicast or broadcast mac*/
- if (!is_multicast_ether_addr(eth_header->eth.dst_mac) &&
- !is_broadcast_ether_addr(eth_header->eth.dst_mac)) {
+ if (!eth_addr_multicast(eth_header->eth.dst_mac) &&
+ !eth_addr_broadcast(eth_header->eth.dst_mac)) {
list_for_each_entry_safe(res, tmp, rlist, list) {
be_mac = cpu_to_be64(res->mac << 16);
if (!memcmp(&be_mac, eth_header->eth.dst_mac, ETH_ALEN))
diff --git a/drivers/net/ethernet/micrel/ks8695net.c b/drivers/net/ethernet/micrel/ks8695net.c
index dccae1d..562a49e 100644
--- a/drivers/net/ethernet/micrel/ks8695net.c
+++ b/drivers/net/ethernet/micrel/ks8695net.c
@@ -1065,7 +1065,7 @@ ks8695_set_mac(struct net_device *ndev, void *addr)
struct ks8695_priv *ksp = netdev_priv(ndev);
struct sockaddr *address = addr;
- if (!is_valid_ether_addr(address->sa_data))
+ if (!eth_addr_valid(address->sa_data))
return -EADDRNOTAVAIL;
memcpy(ndev->dev_addr, address->sa_data, ndev->addr_len);
@@ -1249,7 +1249,7 @@ ks8695_open(struct net_device *ndev)
struct ks8695_priv *ksp = netdev_priv(ndev);
int ret;
- if (!is_valid_ether_addr(ndev->dev_addr))
+ if (!eth_addr_valid(ndev->dev_addr))
return -EADDRNOTAVAIL;
ks8695_reset(ksp);
@@ -1459,7 +1459,7 @@ ks8695_probe(struct platform_device *pdev)
ndev->dev_addr[4] = (maclow >> 8) & 0xFF;
ndev->dev_addr[5] = maclow & 0xFF;
- if (!is_valid_ether_addr(ndev->dev_addr))
+ if (!eth_addr_valid(ndev->dev_addr))
dev_warn(ksp->dev, "%s: Invalid ethernet MAC address. Please "
"set using ifconfig\n", ndev->name);
diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c
index 24fb049..5e34050 100644
--- a/drivers/net/ethernet/micrel/ks8842.c
+++ b/drivers/net/ethernet/micrel/ks8842.c
@@ -1077,7 +1077,7 @@ static int ks8842_set_mac(struct net_device *netdev, void *p)
netdev_dbg(netdev, "%s: entry\n", __func__);
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
netdev->addr_assign_type &= ~NET_ADDR_RANDOM;
@@ -1211,7 +1211,7 @@ static int __devinit ks8842_probe(struct platform_device *pdev)
if (i == netdev->addr_len) {
ks8842_read_mac_addr(adapter, netdev->dev_addr);
- if (!is_valid_ether_addr(netdev->dev_addr))
+ if (!eth_addr_valid(netdev->dev_addr))
eth_hw_addr_random(netdev);
}
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index 1540ebe..b77fbf5 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -432,7 +432,7 @@ static void ks8851_init_mac(struct ks8851_net *ks)
/* first, try reading what we've got already */
if (ks->rc_ccr & CCR_EEPROM) {
ks8851_read_mac_addr(dev);
- if (is_valid_ether_addr(dev->dev_addr))
+ if (eth_addr_valid(dev->dev_addr))
return;
netdev_err(ks->netdev, "invalid mac address read %pM\n",
@@ -1049,7 +1049,7 @@ static int ks8851_set_mac_address(struct net_device *dev, void *addr)
if (netif_running(dev))
return -EBUSY;
- if (!is_valid_ether_addr(sa->sa_data))
+ if (!eth_addr_valid(sa->sa_data))
return -EADDRNOTAVAIL;
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
index 38529ed..1d78951 100644
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
@@ -1607,7 +1607,7 @@ static int __devinit ks8851_probe(struct platform_device *pdev)
goto err_pdata;
}
memcpy(ks->mac_addr, pdata->mac_addr, 6);
- if (!is_valid_ether_addr(ks->mac_addr)) {
+ if (!eth_addr_valid(ks->mac_addr)) {
/* Use random MAC address if none passed */
eth_random_addr(ks->mac_addr);
netdev_info(netdev, "Using random mac address\n");
diff --git a/drivers/net/ethernet/microchip/enc28j60.c b/drivers/net/ethernet/microchip/enc28j60.c
index 6118bda..bf59887 100644
--- a/drivers/net/ethernet/microchip/enc28j60.c
+++ b/drivers/net/ethernet/microchip/enc28j60.c
@@ -524,7 +524,7 @@ static int enc28j60_set_mac_address(struct net_device *dev, void *addr)
if (netif_running(dev))
return -EBUSY;
- if (!is_valid_ether_addr(address->sa_data))
+ if (!eth_addr_valid(address->sa_data))
return -EADDRNOTAVAIL;
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
@@ -1352,7 +1352,7 @@ static int enc28j60_net_open(struct net_device *dev)
if (netif_msg_drv(priv))
printk(KERN_DEBUG DRV_NAME ": %s() enter\n", __func__);
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
if (netif_msg_ifup(priv))
dev_err(&dev->dev, "invalid MAC address %pM\n",
dev->dev_addr);
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index 83516e3..4146b7c 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -3128,7 +3128,7 @@ static int myri10ge_set_mac_address(struct net_device *dev, void *addr)
struct myri10ge_priv *mgp = netdev_priv(dev);
int status;
- if (!is_valid_ether_addr(sa->sa_data))
+ if (!eth_addr_valid(sa->sa_data))
return -EADDRNOTAVAIL;
status = myri10ge_update_mac_address(mgp, sa->sa_data);
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
index de50547..0bb1431 100644
--- a/drivers/net/ethernet/neterion/s2io.c
+++ b/drivers/net/ethernet/neterion/s2io.c
@@ -5245,7 +5245,7 @@ static int s2io_set_mac_addr(struct net_device *dev, void *p)
{
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c
index c2e420a..bf2cb52 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-config.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c
@@ -982,7 +982,7 @@ __vxge_hw_vpath_addr_get(struct __vxge_hw_virtualpath *vpath,
action = VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_LIST_NEXT_ENTRY;
data0 = 0, data1 = 0, steer_ctrl = 0;
- } while (!is_valid_ether_addr(macaddr));
+ } while (!eth_addr_valid(macaddr));
exit:
return status;
}
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c
index 3e5b750..6262280 100644
--- a/drivers/net/ethernet/neterion/vxge/vxge-main.c
+++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c
@@ -683,7 +683,7 @@ static int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac)
new_mac_entry->state = mac->state;
vpath->mac_addr_cnt++;
- if (is_multicast_ether_addr(mac->macaddr))
+ if (eth_addr_multicast(mac->macaddr))
vpath->mcast_addr_cnt++;
return TRUE;
@@ -697,7 +697,7 @@ vxge_add_mac_addr(struct vxgedev *vdev, struct macInfo *mac)
struct vxge_vpath *vpath;
enum vxge_hw_vpath_mac_addr_add_mode duplicate_mode;
- if (is_multicast_ether_addr(mac->macaddr))
+ if (eth_addr_multicast(mac->macaddr))
duplicate_mode = VXGE_HW_VPATH_MAC_ADDR_ADD_DUPLICATE;
else
duplicate_mode = VXGE_HW_VPATH_MAC_ADDR_REPLACE_DUPLICATE;
@@ -1076,7 +1076,7 @@ static int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac)
kfree((struct vxge_mac_addrs *)entry);
vpath->mac_addr_cnt--;
- if (is_multicast_ether_addr(mac->macaddr))
+ if (eth_addr_multicast(mac->macaddr))
vpath->mcast_addr_cnt--;
return TRUE;
}
@@ -1198,7 +1198,7 @@ static void vxge_set_multicast(struct net_device *dev)
mac_address = (u8 *)&mac_entry->macaddr;
memcpy(mac_info.macaddr, mac_address, ETH_ALEN);
- if (is_multicast_ether_addr(mac_info.macaddr)) {
+ if (eth_addr_multicast(mac_info.macaddr)) {
for (vpath_idx = 0; vpath_idx <
vdev->no_of_vpath;
vpath_idx++) {
@@ -1240,7 +1240,7 @@ _set_all_mcast:
mac_address = (u8 *)&mac_entry->macaddr;
memcpy(mac_info.macaddr, mac_address, ETH_ALEN);
- if (is_multicast_ether_addr(mac_info.macaddr))
+ if (eth_addr_multicast(mac_info.macaddr))
break;
}
@@ -1291,7 +1291,7 @@ static int vxge_set_mac_addr(struct net_device *dev, void *p)
vdev = netdev_priv(dev);
hldev = vdev->devh;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EINVAL;
memset(&mac_info_new, 0, sizeof(struct macInfo));
diff --git a/drivers/net/ethernet/netx-eth.c b/drivers/net/ethernet/netx-eth.c
index 63e7af4..244a7fe 100644
--- a/drivers/net/ethernet/netx-eth.c
+++ b/drivers/net/ethernet/netx-eth.c
@@ -362,7 +362,7 @@ static int netx_eth_enable(struct net_device *ndev)
xc_reset(priv->xc);
xc_start(priv->xc);
- if (!is_valid_ether_addr(ndev->dev_addr))
+ if (!eth_addr_valid(ndev->dev_addr))
printk("%s: Invalid ethernet MAC address. Please "
"set using ifconfig\n", ndev->name);
diff --git a/drivers/net/ethernet/nuvoton/w90p910_ether.c b/drivers/net/ethernet/nuvoton/w90p910_ether.c
index 6893a65..335e417 100644
--- a/drivers/net/ethernet/nuvoton/w90p910_ether.c
+++ b/drivers/net/ethernet/nuvoton/w90p910_ether.c
@@ -558,7 +558,7 @@ static int w90p910_set_mac_address(struct net_device *dev, void *addr)
{
struct sockaddr *address = addr;
- if (!is_valid_ether_addr(address->sa_data))
+ if (!eth_addr_valid(address->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
@@ -941,7 +941,7 @@ static void __init get_mac_address(struct net_device *dev)
addr[4] = 0x88;
addr[5] = 0xa8;
- if (is_valid_ether_addr(addr))
+ if (eth_addr_valid(addr))
memcpy(dev->dev_addr, &addr, 0x06);
else
dev_err(&pdev->dev, "invalid mac address\n");
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c
index 876bece..fb5565c 100644
--- a/drivers/net/ethernet/nvidia/forcedeth.c
+++ b/drivers/net/ethernet/nvidia/forcedeth.c
@@ -3020,7 +3020,7 @@ static int nv_set_mac_address(struct net_device *dev, void *addr)
struct fe_priv *np = netdev_priv(dev);
struct sockaddr *macaddr = (struct sockaddr *)addr;
- if (!is_valid_ether_addr(macaddr->sa_data))
+ if (!eth_addr_valid(macaddr->sa_data))
return -EADDRNOTAVAIL;
/* synchronized against open : rtnl_lock() held by caller */
@@ -5733,7 +5733,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
}
memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
- if (!is_valid_ether_addr(dev->perm_addr)) {
+ if (!eth_addr_valid(dev->perm_addr)) {
/*
* Bad mac address. At least one bios sets the mac address
* to 01:23:45:67:89:ab
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index 53743f7..da92b95 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1137,7 +1137,7 @@ static int lpc_set_mac_address(struct net_device *ndev, void *p)
struct netdata_local *pldat = netdev_priv(ndev);
unsigned long flags;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(ndev->dev_addr, addr->sa_data, ETH_ALEN);
@@ -1219,7 +1219,7 @@ static int lpc_eth_open(struct net_device *ndev)
if (netif_msg_ifup(pldat))
dev_dbg(&pldat->pdev->dev, "enabling %s\n", ndev->name);
- if (!is_valid_ether_addr(ndev->dev_addr))
+ if (!eth_addr_valid(ndev->dev_addr))
return -EADDRNOTAVAIL;
__lpc_eth_clock_enable(pldat, true);
@@ -1436,13 +1436,13 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
__lpc_get_mac(pldat, ndev->dev_addr);
#ifdef CONFIG_OF_NET
- if (!is_valid_ether_addr(ndev->dev_addr)) {
+ if (!eth_addr_valid(ndev->dev_addr)) {
const char *macaddr = of_get_mac_address(pdev->dev.of_node);
if (macaddr)
memcpy(ndev->dev_addr, macaddr, ETH_ALEN);
}
#endif
- if (!is_valid_ether_addr(ndev->dev_addr))
+ if (!eth_addr_valid(ndev->dev_addr))
eth_hw_addr_random(ndev);
/* Reset the ethernet controller */
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
index f97719c..147ace9 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -1534,7 +1534,7 @@ static int __devinit octeon_mgmt_probe(struct platform_device *pdev)
mac = of_get_mac_address(pdev->dev.of_node);
- if (mac && is_valid_ether_addr(mac)) {
+ if (mac && eth_addr_valid(mac)) {
memcpy(netdev->dev_addr, mac, ETH_ALEN);
netdev->addr_assign_type &= ~NET_ADDR_RANDOM;
} else {
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index b2a94d0..15aec1b 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -1974,7 +1974,7 @@ int pch_gbe_up(struct pch_gbe_adapter *adapter)
int err;
/* Ensure we have a valid MAC */
- if (!is_valid_ether_addr(adapter->hw.mac.addr)) {
+ if (!eth_addr_valid(adapter->hw.mac.addr)) {
pr_err("Error: Invalid MAC address\n");
return -EINVAL;
}
@@ -2260,7 +2260,7 @@ static int pch_gbe_set_mac(struct net_device *netdev, void *addr)
struct sockaddr *skaddr = addr;
int ret_val;
- if (!is_valid_ether_addr(skaddr->sa_data)) {
+ if (!eth_addr_valid(skaddr->sa_data)) {
ret_val = -EADDRNOTAVAIL;
} else {
memcpy(netdev->dev_addr, skaddr->sa_data, netdev->addr_len);
@@ -2707,7 +2707,7 @@ static int pch_gbe_probe(struct pci_dev *pdev,
}
memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
- if (!is_valid_ether_addr(netdev->dev_addr)) {
+ if (!eth_addr_valid(netdev->dev_addr)) {
/*
* If the MAC is invalid (or just missing), display a warning
* but do not abort setting up the device. pch_gbe_up will
diff --git a/drivers/net/ethernet/pasemi/pasemi_mac.c b/drivers/net/ethernet/pasemi/pasemi_mac.c
index 6fa74d5..06c6a32 100644
--- a/drivers/net/ethernet/pasemi/pasemi_mac.c
+++ b/drivers/net/ethernet/pasemi/pasemi_mac.c
@@ -237,7 +237,7 @@ static int pasemi_mac_set_mac_addr(struct net_device *dev, void *p)
struct sockaddr *addr = p;
unsigned int adr0, adr1;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
@@ -1782,7 +1782,7 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
/* get mac addr from device tree */
- if (pasemi_get_mac_addr(mac) || !is_valid_ether_addr(mac->mac_addr)) {
+ if (pasemi_get_mac_addr(mac) || !eth_addr_valid(mac->mac_addr)) {
err = -ENODEV;
goto out;
}
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
index df45061..df2a26a 100644
--- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
+++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c
@@ -506,7 +506,7 @@ netxen_read_mac_addr(struct netxen_adapter *adapter)
/* set station address */
- if (!is_valid_ether_addr(netdev->perm_addr))
+ if (!eth_addr_valid(netdev->perm_addr))
dev_warn(&pdev->dev, "Bad MAC address %pM.\n", netdev->dev_addr);
return 0;
@@ -517,7 +517,7 @@ static int netxen_nic_set_mac(struct net_device *netdev, void *p)
struct netxen_adapter *adapter = netdev_priv(netdev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
if (netif_running(netdev)) {
diff --git a/drivers/net/ethernet/qlogic/qla3xxx.c b/drivers/net/ethernet/qlogic/qla3xxx.c
index df09b1c..7ffddf0 100644
--- a/drivers/net/ethernet/qlogic/qla3xxx.c
+++ b/drivers/net/ethernet/qlogic/qla3xxx.c
@@ -3581,7 +3581,7 @@ static int ql3xxx_set_mac_address(struct net_device *ndev, void *p)
if (netif_running(ndev))
return -EBUSY;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
index 24ad17e..df1d45d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
@@ -285,7 +285,7 @@ qlcnic_read_mac_addr(struct qlcnic_adapter *adapter)
/* set station address */
- if (!is_valid_ether_addr(netdev->perm_addr))
+ if (!eth_addr_valid(netdev->perm_addr))
dev_warn(&pdev->dev, "Bad MAC address %pM.\n",
netdev->dev_addr);
@@ -300,7 +300,7 @@ static int qlcnic_set_mac(struct net_device *netdev, void *p)
if ((adapter->flags & QLCNIC_MAC_OVERRIDE_DISABLED))
return -EOPNOTSUPP;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
if (test_bit(__QLCNIC_DEV_UP, &adapter->state)) {
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index b262d61..2c02691 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -791,7 +791,7 @@ static int ql_get_8000_flash_params(struct ql_adapter *qdev)
qdev->flash.flash_params_8000.mac_addr,
qdev->ndev->addr_len);
- if (!is_valid_ether_addr(mac_addr)) {
+ if (!eth_addr_valid(mac_addr)) {
netif_err(qdev, ifup, qdev->ndev, "Invalid MAC address.\n");
status = -EINVAL;
goto exit;
@@ -842,7 +842,7 @@ static int ql_get_8012_flash_params(struct ql_adapter *qdev)
goto exit;
}
- if (!is_valid_ether_addr(qdev->flash.flash_params_8012.mac_addr)) {
+ if (!eth_addr_valid(qdev->flash.flash_params_8012.mac_addr)) {
status = -EINVAL;
goto exit;
}
@@ -4341,7 +4341,7 @@ static int qlge_set_mac_address(struct net_device *ndev, void *p)
struct sockaddr *addr = p;
int status;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(ndev->dev_addr, addr->sa_data, ndev->addr_len);
/* Update local copy of current mac address. */
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 1c81825..a14c82f 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -1564,7 +1564,7 @@ static int cp_set_mac_address(struct net_device *dev, void *p)
struct cp_private *cp = netdev_priv(dev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
diff --git a/drivers/net/ethernet/realtek/8139too.c b/drivers/net/ethernet/realtek/8139too.c
index 3ed7add..5215d65 100644
--- a/drivers/net/ethernet/realtek/8139too.c
+++ b/drivers/net/ethernet/realtek/8139too.c
@@ -2228,7 +2228,7 @@ static int rtl8139_set_mac_address(struct net_device *dev, void *p)
void __iomem *ioaddr = tp->mmio_addr;
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index e7ff886..cdec3ce 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -3746,7 +3746,7 @@ static int rtl_set_mac_address(struct net_device *dev, void *p)
struct rtl8169_private *tp = netdev_priv(dev);
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index c8bfea0..8957df9 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -2075,7 +2075,7 @@ static void sh_eth_tsu_purge_mcast(struct net_device *ndev)
for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) {
sh_eth_tsu_read_entry(reg_offset, addr);
- if (is_multicast_ether_addr(addr))
+ if (eth_addr_multicast(addr))
sh_eth_tsu_del_entry(ndev, addr);
}
}
@@ -2111,7 +2111,7 @@ static void sh_eth_set_multicast_list(struct net_device *ndev)
} else if (mdp->cd->tsu) {
struct netdev_hw_addr *ha;
netdev_for_each_mc_addr(ha, ndev) {
- if (mcast_all && is_multicast_ether_addr(ha->addr))
+ if (mcast_all && eth_addr_multicast(ha->addr))
continue;
if (sh_eth_tsu_add_entry(ndev, ha->addr) < 0) {
diff --git a/drivers/net/ethernet/seeq/ether3.c b/drivers/net/ethernet/seeq/ether3.c
index 6a40dd0..7da5f85 100644
--- a/drivers/net/ethernet/seeq/ether3.c
+++ b/drivers/net/ethernet/seeq/ether3.c
@@ -399,7 +399,7 @@ ether3_probe_bus_16(struct net_device *dev, int val)
static int
ether3_open(struct net_device *dev)
{
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
printk(KERN_WARNING "%s: invalid ethernet MAC address\n",
dev->name);
return -EINVAL;
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 4f86d0c..5a753f4 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1982,7 +1982,7 @@ static int efx_set_mac_address(struct net_device *net_dev, void *data)
struct sockaddr *addr = data;
char *new_addr = addr->sa_data;
- if (!is_valid_ether_addr(new_addr)) {
+ if (!eth_addr_valid(new_addr)) {
netif_err(efx, drv, efx->net_dev,
"invalid ethernet MAC address requested: %pM\n",
new_addr);
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c
index 90f078e..4541dce 100644
--- a/drivers/net/ethernet/sfc/ethtool.c
+++ b/drivers/net/ethernet/sfc/ethtool.c
@@ -1019,14 +1019,14 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx,
ntohs(rule->m_ext.vlan_tci) : 0);
/* Must not match on source address or Ethertype */
- if (!is_zero_ether_addr(mac_mask->h_source) ||
+ if (!eth_addr_zero(mac_mask->h_source) ||
mac_mask->h_proto)
return -EINVAL;
/* Is it a default UC or MC filter? */
if (ether_addr_equal(mac_mask->h_dest, mac_addr_mc_mask) &&
vlan_tag_mask == 0) {
- if (is_multicast_ether_addr(mac_entry->h_dest))
+ if (eth_addr_multicast(mac_entry->h_dest))
rc = efx_filter_set_mc_def(&spec);
else
rc = efx_filter_set_uc_def(&spec);
@@ -1034,7 +1034,7 @@ static int efx_ethtool_set_class_rule(struct efx_nic *efx,
/* Otherwise, it must match all of destination and all
* or none of VID.
*/
- else if (is_broadcast_ether_addr(mac_mask->h_dest) &&
+ else if (eth_addr_broadcast(mac_mask->h_dest) &&
(vlan_tag_mask == 0xfff || vlan_tag_mask == 0)) {
rc = efx_filter_set_eth_local(
&spec,
diff --git a/drivers/net/ethernet/sfc/siena_sriov.c b/drivers/net/ethernet/sfc/siena_sriov.c
index d49b53d..4ab5330 100644
--- a/drivers/net/ethernet/sfc/siena_sriov.c
+++ b/drivers/net/ethernet/sfc/siena_sriov.c
@@ -321,7 +321,7 @@ static void efx_sriov_reset_tx_filter(struct efx_vf *vf)
vf->tx_filter_id = -1;
}
- if (is_zero_ether_addr(vf->addr.mac_addr))
+ if (eth_addr_zero(vf->addr.mac_addr))
return;
/* Turn on TX filtering automatically if not explicitly
@@ -365,7 +365,7 @@ static void efx_sriov_reset_rx_filter(struct efx_vf *vf)
vf->rx_filter_id = -1;
}
- if (!vf->rx_filtering || is_zero_ether_addr(vf->addr.mac_addr))
+ if (!vf->rx_filtering || eth_addr_zero(vf->addr.mac_addr))
return;
vlan = ntohs(vf->addr.tci) & VLAN_VID_MASK;
@@ -1092,7 +1092,7 @@ static void efx_sriov_peer_work(struct work_struct *data)
vf = efx->vf + pos;
mutex_lock(&vf->status_lock);
- if (vf->rx_filtering && !is_zero_ether_addr(vf->addr.mac_addr)) {
+ if (vf->rx_filtering && !eth_addr_zero(vf->addr.mac_addr)) {
*peer++ = vf->addr;
++peer_count;
--peer_space;
diff --git a/drivers/net/ethernet/sis/sis900.c b/drivers/net/ethernet/sis/sis900.c
index fb9f6b3..29d8c70 100644
--- a/drivers/net/ethernet/sis/sis900.c
+++ b/drivers/net/ethernet/sis/sis900.c
@@ -539,7 +539,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
else
ret = sis900_get_mac_addr(pci_dev, net_dev);
- if (!ret || !is_valid_ether_addr(net_dev->dev_addr)) {
+ if (!ret || !eth_addr_valid(net_dev->dev_addr)) {
eth_hw_addr_random(net_dev);
printk(KERN_WARNING "%s: Unreadable or invalid MAC address,"
"using random generated one\n", dev_name);
diff --git a/drivers/net/ethernet/smsc/smc911x.c b/drivers/net/ethernet/smsc/smc911x.c
index 8d15f7a..fa49ddc 100644
--- a/drivers/net/ethernet/smsc/smc911x.c
+++ b/drivers/net/ethernet/smsc/smc911x.c
@@ -1405,7 +1405,7 @@ smc911x_open(struct net_device *dev)
* to bring the device up. The user must specify an
* address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
*/
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
PRINTK("%s: no valid ethernet hw addr\n", __func__);
return -EINVAL;
}
@@ -2001,7 +2001,7 @@ static int __devinit smc911x_probe(struct net_device *dev)
printk("TXDMA %d", lp->txdma);
#endif
printk("\n");
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
printk("%s: Invalid ethernet MAC address. Please "
"set using ifconfig\n", dev->name);
} else {
diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c
index 318adc9..2a0e709 100644
--- a/drivers/net/ethernet/smsc/smc91x.c
+++ b/drivers/net/ethernet/smsc/smc91x.c
@@ -1479,7 +1479,7 @@ smc_open(struct net_device *dev)
* to bring the device up. The user must specify an
* address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx
*/
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
PRINTK("%s: no valid ethernet hw addr\n", __func__);
return -EINVAL;
}
@@ -2052,7 +2052,7 @@ static int __devinit smc_probe(struct net_device *dev, void __iomem *ioaddr,
lp->cfg.flags & SMC91X_NOWAIT ? " [nowait]" : "",
THROTTLE_TX_PKTS ? " [throttle_tx]" : "");
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
printk("%s: Invalid ethernet MAC address. Please "
"set using ifconfig\n", dev->name);
} else {
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 62d1baf..656abcc 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -1463,7 +1463,7 @@ static int smsc911x_open(struct net_device *dev)
return -EAGAIN;
}
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
SMSC_WARN(pdata, hw, "dev_addr is not a valid MAC address");
return -EADDRNOTAVAIL;
}
@@ -1833,7 +1833,7 @@ static int smsc911x_set_mac_address(struct net_device *dev, void *p)
if (pdata->generation <= 1 && netif_running(dev))
return -EBUSY;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
@@ -2466,11 +2466,11 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
spin_lock_irq(&pdata->mac_lock);
/* Check if mac address has been specified when bringing interface up */
- if (is_valid_ether_addr(dev->dev_addr)) {
+ if (eth_addr_valid(dev->dev_addr)) {
smsc911x_set_hw_mac_address(pdata, dev->dev_addr);
SMSC_TRACE(pdata, probe,
"MAC Address is specified by configuration");
- } else if (is_valid_ether_addr(pdata->config.mac)) {
+ } else if (eth_addr_valid(pdata->config.mac)) {
memcpy(dev->dev_addr, pdata->config.mac, 6);
SMSC_TRACE(pdata, probe,
"MAC Address specified by platform data");
@@ -2479,7 +2479,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
* it will already have been set */
smsc_get_mac(dev);
- if (is_valid_ether_addr(dev->dev_addr)) {
+ if (eth_addr_valid(dev->dev_addr)) {
/* eeprom values are valid so use them */
SMSC_TRACE(pdata, probe,
"Mac Address is read from LAN911x EEPROM");
diff --git a/drivers/net/ethernet/smsc/smsc9420.c b/drivers/net/ethernet/smsc/smsc9420.c
index 1fcd914e..9832b11 100644
--- a/drivers/net/ethernet/smsc/smsc9420.c
+++ b/drivers/net/ethernet/smsc/smsc9420.c
@@ -490,7 +490,7 @@ static void smsc9420_check_mac_address(struct net_device *dev)
struct smsc9420_pdata *pd = netdev_priv(dev);
/* Check if mac address has been specified when bringing interface up */
- if (is_valid_ether_addr(dev->dev_addr)) {
+ if (eth_addr_valid(dev->dev_addr)) {
smsc9420_set_mac_address(dev);
smsc_dbg(PROBE, "MAC Address is specified by configuration");
} else {
@@ -505,7 +505,7 @@ static void smsc9420_check_mac_address(struct net_device *dev)
dev->dev_addr[4] = (u8)(mac_high16);
dev->dev_addr[5] = (u8)(mac_high16 >> 8);
- if (is_valid_ether_addr(dev->dev_addr)) {
+ if (eth_addr_valid(dev->dev_addr)) {
/* eeprom values are valid so use them */
smsc_dbg(PROBE, "Mac Address is read from EEPROM");
} else {
@@ -1341,7 +1341,7 @@ static int smsc9420_open(struct net_device *dev)
unsigned long flags;
int result = 0, timeout;
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
smsc_warn(IFUP, "dev_addr is not a valid MAC address");
result = -EADDRNOTAVAIL;
goto out_0;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index c6cdbc4..16df337 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -993,11 +993,11 @@ static void stmmac_check_ether_addr(struct stmmac_priv *priv)
{
/* verify if the MAC address is valid, in case of failures it
* generates a random MAC address */
- if (!is_valid_ether_addr(priv->dev->dev_addr)) {
+ if (!eth_addr_valid(priv->dev->dev_addr)) {
priv->hw->mac->get_umac_addr((void __iomem *)
priv->dev->base_addr,
priv->dev->dev_addr, 0);
- if (!is_valid_ether_addr(priv->dev->dev_addr))
+ if (!eth_addr_valid(priv->dev->dev_addr))
eth_hw_addr_random(priv->dev);
}
pr_warning("%s: device MAC address %pM\n", priv->dev->name,
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index 275b430..f17b7f0 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -6407,7 +6407,7 @@ static int niu_set_mac_addr(struct net_device *dev, void *p)
struct sockaddr *addr = p;
unsigned long flags;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
@@ -8340,7 +8340,7 @@ static void __devinit niu_pci_vpd_validate(struct niu *np)
struct niu_vpd *vpd = &np->vpd;
u8 val8;
- if (!is_valid_ether_addr(&vpd->local_mac[0])) {
+ if (!eth_addr_valid(&vpd->local_mac[0])) {
dev_err(np->device, "VPD MAC invalid, falling back to SPROM\n");
np->flags &= ~NIU_FLAGS_VPD_VALID;
@@ -8485,7 +8485,7 @@ static int __devinit niu_pci_probe_sprom(struct niu *np)
dev->perm_addr[4] = (val >> 0) & 0xff;
dev->perm_addr[5] = (val >> 8) & 0xff;
- if (!is_valid_ether_addr(&dev->perm_addr[0])) {
+ if (!eth_addr_valid(&dev->perm_addr[0])) {
dev_err(np->device, "SPROM MAC address invalid [ %pM ]\n",
dev->perm_addr);
return -EINVAL;
@@ -9275,7 +9275,7 @@ static int __devinit niu_get_of_props(struct niu *np)
dp->full_name, prop_len);
}
memcpy(dev->perm_addr, mac_addr, dev->addr_len);
- if (!is_valid_ether_addr(&dev->perm_addr[0])) {
+ if (!eth_addr_valid(&dev->perm_addr[0])) {
netdev_err(dev, "%s: OF MAC address is invalid\n",
dp->full_name);
netdev_err(dev, "%s: [ %pM ]\n", dp->full_name, dev->perm_addr);
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index 6c8695e..4cdf017 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -2424,7 +2424,7 @@ static int gem_set_mac_address(struct net_device *dev, void *addr)
struct gem *gp = netdev_priv(dev);
unsigned char *e = &dev->dev_addr[0];
- if (!is_valid_ether_addr(macaddr->sa_data))
+ if (!eth_addr_valid(macaddr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, macaddr->sa_data, dev->addr_len);
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index df55e24..b33bccc 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -902,7 +902,7 @@ static int __devinit cpsw_probe(struct platform_device *pdev)
}
data = &priv->data;
- if (is_valid_ether_addr(data->slave_data[0].mac_addr)) {
+ if (eth_addr_valid(data->slave_data[0].mac_addr)) {
memcpy(priv->mac_addr, data->slave_data[0].mac_addr, ETH_ALEN);
pr_info("Detected MACID = %pM", priv->mac_addr);
} else {
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index fce89a0..aebe8c3 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1258,7 +1258,7 @@ static int emac_dev_setmac_addr(struct net_device *ndev, void *addr)
struct device *emac_dev = &priv->ndev->dev;
struct sockaddr *sa = addr;
- if (!is_valid_ether_addr(sa->sa_data))
+ if (!eth_addr_valid(sa->sa_data))
return -EADDRNOTAVAIL;
/* Store mac addr in priv and rx channel and set it in EMAC hw */
@@ -1795,7 +1795,7 @@ static struct emac_platform_data
else
pdata->version = EMAC_VERSION_2;
- if (!is_valid_ether_addr(pdata->mac_addr)) {
+ if (!eth_addr_valid(pdata->mac_addr)) {
mac_addr = of_get_mac_address(np);
if (mac_addr)
memcpy(pdata->mac_addr, mac_addr, ETH_ALEN);
@@ -1982,7 +1982,7 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
}
ndev->irq = res->start;
- if (!is_valid_ether_addr(priv->mac_addr)) {
+ if (!eth_addr_valid(priv->mac_addr)) {
/* Use random MAC if none passed */
eth_hw_addr_random(ndev);
memcpy(priv->mac_addr, ndev->dev_addr, ndev->addr_len);
diff --git a/drivers/net/ethernet/tile/tilegx.c b/drivers/net/ethernet/tile/tilegx.c
index 4e2a162..e7cd4c5 100644
--- a/drivers/net/ethernet/tile/tilegx.c
+++ b/drivers/net/ethernet/tile/tilegx.c
@@ -397,7 +397,7 @@ static inline bool filter_packet(struct net_device *dev, void *buf)
/* Filter out packets that aren't for us. */
if (!(dev->flags & IFF_PROMISC) &&
- !is_multicast_ether_addr(buf) &&
+ !eth_addr_multicast(buf) &&
compare_ether_addr(dev->dev_addr, buf) != 0)
return true;
@@ -1756,7 +1756,7 @@ static int tile_net_set_mac_address(struct net_device *dev, void *p)
{
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EINVAL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
return 0;
diff --git a/drivers/net/ethernet/tile/tilepro.c b/drivers/net/ethernet/tile/tilepro.c
index 96070e9..2d768d7 100644
--- a/drivers/net/ethernet/tile/tilepro.c
+++ b/drivers/net/ethernet/tile/tilepro.c
@@ -840,7 +840,7 @@ static bool tile_net_poll_aux(struct tile_net_cpu *info, int index)
filter = 1;
} else if (!(dev->flags & IFF_PROMISC)) {
/* FIXME: Implement HW multicast filter. */
- if (!is_multicast_ether_addr(buf)) {
+ if (!eth_addr_multicast(buf)) {
/* Filter packets not for our address. */
const u8 *mine = dev->dev_addr;
filter = !ether_addr_equal(mine, buf);
@@ -2190,7 +2190,7 @@ static int tile_net_set_mac_address(struct net_device *dev, void *p)
{
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
/* ISSUE: Note that "dev_addr" is now a pointer. */
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index 5ee82a7..c2f567c 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -1505,7 +1505,7 @@ int __devinit gelic_net_setup_netdev(struct net_device *netdev,
GELIC_LV1_GET_MAC_ADDRESS,
0, 0, 0, &v1, &v2);
v1 <<= 16;
- if (status || !is_valid_ether_addr((u8 *)&v1)) {
+ if (status || !eth_addr_valid((u8 *)&v1)) {
dev_info(ctodev(card),
"%s:lv1_net_control GET_MAC_ADDR failed %d\n",
__func__, status);
diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
index 961c832..a6bfc6d 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_wireless.c
@@ -1161,7 +1161,7 @@ static int gelic_wl_set_ap(struct net_device *netdev,
return -EINVAL;
spin_lock_irqsave(&wl->lock, irqflag);
- if (is_valid_ether_addr(data->ap_addr.sa_data)) {
+ if (eth_addr_valid(data->ap_addr.sa_data)) {
memcpy(wl->bssid, data->ap_addr.sa_data,
ETH_ALEN);
set_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat);
diff --git a/drivers/net/ethernet/toshiba/spider_net.c b/drivers/net/ethernet/toshiba/spider_net.c
index c1ebfe9..eb56f55 100644
--- a/drivers/net/ethernet/toshiba/spider_net.c
+++ b/drivers/net/ethernet/toshiba/spider_net.c
@@ -288,7 +288,7 @@ spider_net_get_mac_address(struct net_device *netdev)
netdev->dev_addr[4] = (macl >> 8) & 0xff;
netdev->dev_addr[5] = macl & 0xff;
- if (!is_valid_ether_addr(&netdev->dev_addr[0]))
+ if (!eth_addr_valid(&netdev->dev_addr[0]))
return -EINVAL;
return 0;
@@ -1343,7 +1343,7 @@ spider_net_set_mac(struct net_device *netdev, void *p)
u32 macl, macu, regvalue;
struct sockaddr *addr = p;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
/* switch off GMACTPE and GMACRPE */
diff --git a/drivers/net/ethernet/toshiba/tc35815.c b/drivers/net/ethernet/toshiba/tc35815.c
index 651a70c..aab2cf4 100644
--- a/drivers/net/ethernet/toshiba/tc35815.c
+++ b/drivers/net/ethernet/toshiba/tc35815.c
@@ -736,7 +736,7 @@ static int __devinit tc35815_read_plat_dev_addr(struct net_device *dev)
if (pd->platform_data)
memcpy(dev->dev_addr, pd->platform_data, ETH_ALEN);
put_device(pd);
- return is_valid_ether_addr(dev->dev_addr) ? 0 : -ENODEV;
+ return eth_addr_valid(dev->dev_addr) ? 0 : -ENODEV;
}
return -ENODEV;
}
@@ -764,7 +764,7 @@ static int __devinit tc35815_init_dev_addr(struct net_device *dev)
dev->dev_addr[i] = data & 0xff;
dev->dev_addr[i+1] = data >> 8;
}
- if (!is_valid_ether_addr(dev->dev_addr))
+ if (!eth_addr_valid(dev->dev_addr))
return tc35815_read_plat_dev_addr(dev);
return 0;
}
diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c
index 8fa947a..384b5e7 100644
--- a/drivers/net/ethernet/tundra/tsi108_eth.c
+++ b/drivers/net/ethernet/tundra/tsi108_eth.c
@@ -349,7 +349,7 @@ static void tsi108_check_phy(struct net_device *dev)
udelay(5);
spin_lock(&data->txlock);
- if (is_valid_ether_addr(dev->dev_addr) && data->txfree)
+ if (eth_addr_valid(dev->dev_addr) && data->txfree)
netif_wake_queue(dev);
data->link_up = 1;
@@ -646,7 +646,7 @@ static void tsi108_complete_tx(struct net_device *dev)
}
if (release) {
- if (is_valid_ether_addr(dev->dev_addr) && data->link_up)
+ if (eth_addr_valid(dev->dev_addr) && data->link_up)
netif_wake_queue(dev);
}
}
@@ -1130,7 +1130,7 @@ static int tsi108_get_mac(struct net_device *dev)
dev->dev_addr[5] = (word1 >> 24) & 0xff;
}
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
printk(KERN_ERR
"%s: Invalid MAC address. word1: %08x, word2: %08x\n",
dev->name, word1, word2);
@@ -1146,7 +1146,7 @@ static int tsi108_set_mac(struct net_device *dev, void *addr)
u32 word1, word2;
int i;
- if (!is_valid_ether_addr(addr))
+ if (!eth_addr_valid(addr))
return -EADDRNOTAVAIL;
for (i = 0; i < 6; i++)
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c
index 0459c09..8851a95 100644
--- a/drivers/net/ethernet/via/via-rhine.c
+++ b/drivers/net/ethernet/via/via-rhine.c
@@ -984,7 +984,7 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
for (i = 0; i < 6; i++)
dev->dev_addr[i] = ioread8(ioaddr + StationAddr + i);
- if (!is_valid_ether_addr(dev->dev_addr)) {
+ if (!eth_addr_valid(dev->dev_addr)) {
/* Report it and use a random ethernet address instead */
netdev_err(dev, "Invalid MAC address: %pM\n", dev->dev_addr);
eth_hw_addr_random(dev);
diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c
index 2c08bf6..e7d3f0f 100644
--- a/drivers/net/ethernet/wiznet/w5100.c
+++ b/drivers/net/ethernet/wiznet/w5100.c
@@ -567,7 +567,7 @@ static int w5100_set_macaddr(struct net_device *ndev, void *addr)
struct w5100_priv *priv = netdev_priv(ndev);
struct sockaddr *sock_addr = addr;
- if (!is_valid_ether_addr(sock_addr->sa_data))
+ if (!eth_addr_valid(sock_addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(ndev->dev_addr, sock_addr->sa_data, ETH_ALEN);
ndev->addr_assign_type &= ~NET_ADDR_RANDOM;
@@ -580,7 +580,7 @@ static int w5100_open(struct net_device *ndev)
struct w5100_priv *priv = netdev_priv(ndev);
netif_info(priv, ifup, ndev, "enabling\n");
- if (!is_valid_ether_addr(ndev->dev_addr))
+ if (!eth_addr_valid(ndev->dev_addr))
return -EINVAL;
w5100_hw_start(priv);
napi_enable(&priv->napi);
@@ -634,7 +634,7 @@ static int __devinit w5100_hw_probe(struct platform_device *pdev)
int irq;
int ret;
- if (data && is_valid_ether_addr(data->mac_addr)) {
+ if (data && eth_addr_valid(data->mac_addr)) {
memcpy(ndev->dev_addr, data->mac_addr, ETH_ALEN);
} else {
eth_hw_addr_random(ndev);
diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c
index 88943d9..480c22e 100644
--- a/drivers/net/ethernet/wiznet/w5300.c
+++ b/drivers/net/ethernet/wiznet/w5300.c
@@ -487,7 +487,7 @@ static int w5300_set_macaddr(struct net_device *ndev, void *addr)
struct w5300_priv *priv = netdev_priv(ndev);
struct sockaddr *sock_addr = addr;
- if (!is_valid_ether_addr(sock_addr->sa_data))
+ if (!eth_addr_valid(sock_addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(ndev->dev_addr, sock_addr->sa_data, ETH_ALEN);
ndev->addr_assign_type &= ~NET_ADDR_RANDOM;
@@ -500,7 +500,7 @@ static int w5300_open(struct net_device *ndev)
struct w5300_priv *priv = netdev_priv(ndev);
netif_info(priv, ifup, ndev, "enabling\n");
- if (!is_valid_ether_addr(ndev->dev_addr))
+ if (!eth_addr_valid(ndev->dev_addr))
return -EINVAL;
w5300_hw_start(priv);
napi_enable(&priv->napi);
@@ -554,7 +554,7 @@ static int __devinit w5300_hw_probe(struct platform_device *pdev)
int irq;
int ret;
- if (data && is_valid_ether_addr(data->mac_addr)) {
+ if (data && eth_addr_valid(data->mac_addr)) {
memcpy(ndev->dev_addr, data->mac_addr, ETH_ALEN);
} else {
eth_hw_addr_random(ndev);
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index f8e3518..31db40b 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -326,7 +326,7 @@ static int temac_set_mac_address(struct net_device *ndev, void *address)
if (address)
memcpy(ndev->dev_addr, address, ETH_ALEN);
- if (!is_valid_ether_addr(ndev->dev_addr))
+ if (!eth_addr_valid(ndev->dev_addr))
eth_hw_addr_random(ndev);
else
ndev->addr_assign_type &= ~NET_ADDR_RANDOM;
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 0793299..64ebc03 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -311,7 +311,7 @@ static void axienet_set_mac_address(struct net_device *ndev, void *address)
if (address)
memcpy(ndev->dev_addr, address, ETH_ALEN);
- if (!is_valid_ether_addr(ndev->dev_addr))
+ if (!eth_addr_valid(ndev->dev_addr))
eth_random_addr(ndev->dev_addr);
/* Set up unicast MAC address filter set its mac address */
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index c2e5497..8979a6d 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -431,7 +431,7 @@ static int bpq_seq_show(struct seq_file *seq, void *v)
bpqdev->axdev->name, bpqdev->ethdev->name,
bpqdev->dest_addr);
- if (is_multicast_ether_addr(bpqdev->acpt_addr))
+ if (eth_addr_multicast(bpqdev->acpt_addr))
seq_printf(seq, "*\n");
else
seq_printf(seq, "%pM\n", bpqdev->acpt_addr);
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 344dceb..aa52f82 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -244,7 +244,7 @@ static int ifb_validate(struct nlattr *tb[], struct nlattr *data[])
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
return 0;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 68a43fe..db091cc33 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -168,7 +168,7 @@ static rx_handler_result_t macvlan_handle_frame(struct sk_buff **pskb)
int ret = NET_RX_DROP;
port = macvlan_port_get_rcu(skb->dev);
- if (is_multicast_ether_addr(eth->h_dest)) {
+ if (eth_addr_multicast(eth->h_dest)) {
skb = ip_check_defrag(skb, IP_DEFRAG_MACVLAN);
if (!skb)
return RX_HANDLER_CONSUMED;
@@ -242,7 +242,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
skb->ip_summed = CHECKSUM_UNNECESSARY;
/* send to other bridge ports directly */
- if (is_multicast_ether_addr(eth->h_dest)) {
+ if (eth_addr_multicast(eth->h_dest)) {
macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE);
goto xmit_world;
}
@@ -370,7 +370,7 @@ static int macvlan_set_mac_address(struct net_device *dev, void *p)
struct sockaddr *addr = p;
int err;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
if (!(dev->flags & IFF_UP)) {
@@ -557,9 +557,9 @@ static int macvlan_fdb_add(struct ndmsg *ndm, struct nlattr *tb[],
if (!vlan->port->passthru)
return -EOPNOTSUPP;
- if (is_unicast_ether_addr(addr))
+ if (eth_addr_unicast(addr))
err = dev_uc_add_excl(dev, addr);
- else if (is_multicast_ether_addr(addr))
+ else if (eth_addr_multicast(addr))
err = dev_mc_add_excl(dev, addr);
return err;
@@ -575,9 +575,9 @@ static int macvlan_fdb_del(struct ndmsg *ndm,
if (!vlan->port->passthru)
return -EOPNOTSUPP;
- if (is_unicast_ether_addr(addr))
+ if (eth_addr_unicast(addr))
err = dev_uc_del(dev, addr);
- else if (is_multicast_ether_addr(addr))
+ else if (eth_addr_multicast(addr))
err = dev_mc_del(dev, addr);
return err;
@@ -682,7 +682,7 @@ static int macvlan_validate(struct nlattr *tb[], struct nlattr *data[])
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
index 45cbc10..f595507 100644
--- a/drivers/net/phy/at803x.c
+++ b/drivers/net/phy/at803x.c
@@ -47,7 +47,7 @@ static void at803x_set_wol_mac_addr(struct phy_device *phydev)
mac = (const u8 *) ndev->dev_addr;
- if (!is_valid_ether_addr(mac))
+ if (!eth_addr_valid(mac))
return;
for (i = 0; i < 3; i++) {
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index d8b9b1e..f94afc6 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -180,7 +180,7 @@ static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
return NETDEV_TX_LOCKED;
}
- if (is_multicast_ether_addr(eth->h_dest))
+ if (eth_addr_multicast(eth->h_dest))
add_num = nets[rnet->mport->id].nact;
if ((rnet->tx_cnt + add_num) > RIONET_TX_RING_SIZE) {
@@ -191,7 +191,7 @@ static int rionet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
return NETDEV_TX_BUSY;
}
- if (is_multicast_ether_addr(eth->h_dest)) {
+ if (eth_addr_multicast(eth->h_dest)) {
int count = 0;
for (i = 0; i < RIO_MAX_ROUTE_ENTRIES(rnet->mport->sys_size);
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index d44cca3..0f092c5 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1498,7 +1498,7 @@ static int team_set_mac_address(struct net_device *dev, void *p)
struct team *team = netdev_priv(dev);
struct team_port *port;
- if (dev->type == ARPHRD_ETHER && !is_valid_ether_addr(addr->sa_data))
+ if (dev->type == ARPHRD_ETHER && !eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
@@ -1821,7 +1821,7 @@ static int team_validate(struct nlattr *tb[], struct nlattr *data[])
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
return 0;
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 0873cdc..7444e97 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -281,7 +281,7 @@ static int update_filter(struct tap_filter *filter, void __user *arg)
* unicast will leave the filter disabled. */
memset(filter->mask, 0, sizeof(filter->mask));
for (; n < uf.count; n++) {
- if (!is_multicast_ether_addr(addr[n].u)) {
+ if (!eth_addr_multicast(addr[n].u)) {
err = 0; /* no filter */
goto done;
}
@@ -319,7 +319,7 @@ static int run_filter(struct tap_filter *filter, const struct sk_buff *skb)
return 1;
/* Inexact match (multicast only) */
- if (is_multicast_ether_addr(eh->h_dest))
+ if (eth_addr_multicast(eh->h_dest))
return addr_hash_test(filter->mask, eh->h_dest);
return 0;
diff --git a/drivers/net/usb/asix_common.c b/drivers/net/usb/asix_common.c
index 774d9ce..095daa7 100644
--- a/drivers/net/usb/asix_common.c
+++ b/drivers/net/usb/asix_common.c
@@ -614,7 +614,7 @@ int asix_set_mac_address(struct net_device *net, void *p)
if (netif_running(net))
return -EBUSY;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(net->dev_addr, addr->sa_data, ETH_ALEN);
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c
index e0433ce..1c42305 100644
--- a/drivers/net/usb/dm9601.c
+++ b/drivers/net/usb/dm9601.c
@@ -408,7 +408,7 @@ static int dm9601_set_mac_address(struct net_device *net, void *p)
struct sockaddr *addr = p;
struct usbnet *dev = netdev_priv(net);
- if (!is_valid_ether_addr(addr->sa_data)) {
+ if (!eth_addr_valid(addr->sa_data)) {
dev_err(&net->dev, "not setting invalid mac address %pM\n",
addr->sa_data);
return -EINVAL;
@@ -467,7 +467,7 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf)
/*
* Overwrite the auto-generated address only with good ones.
*/
- if (is_valid_ether_addr(mac))
+ if (eth_addr_valid(mac))
memcpy(dev->net->dev_addr, mac, ETH_ALEN);
else {
printk(KERN_WARNING
diff --git a/drivers/net/usb/mcs7830.c b/drivers/net/usb/mcs7830.c
index cc7e720..ffff9b9 100644
--- a/drivers/net/usb/mcs7830.c
+++ b/drivers/net/usb/mcs7830.c
@@ -239,7 +239,7 @@ static int mcs7830_set_mac_address(struct net_device *netdev, void *p)
if (netif_running(netdev))
return -EBUSY;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
ret = mcs7830_hif_set_mac_address(dev, addr->sa_data);
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index b77ae76..dae7812 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -654,7 +654,7 @@ static void smsc75xx_init_mac_address(struct usbnet *dev)
/* try reading mac address from EEPROM */
if (smsc75xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
dev->net->dev_addr) == 0) {
- if (is_valid_ether_addr(dev->net->dev_addr)) {
+ if (eth_addr_valid(dev->net->dev_addr)) {
/* eeprom values are valid so use them */
netif_dbg(dev, ifup, dev->net,
"MAC address read from EEPROM");
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 7479a57..6ad71fc 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -714,7 +714,7 @@ static void smsc95xx_init_mac_address(struct usbnet *dev)
/* try reading mac address from EEPROM */
if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
dev->net->dev_addr) == 0) {
- if (is_valid_ether_addr(dev->net->dev_addr)) {
+ if (eth_addr_valid(dev->net->dev_addr)) {
/* eeprom values are valid so use them */
netif_dbg(dev, ifup, dev->net, "MAC address read from EEPROM\n");
return;
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index e522ff7..5c472d1 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -282,7 +282,7 @@ static int veth_validate(struct nlattr *tb[], struct nlattr *data[])
if (tb[IFLA_ADDRESS]) {
if (nla_len(tb[IFLA_ADDRESS]) != ETH_ALEN)
return -EINVAL;
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS])))
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS])))
return -EADDRNOTAVAIL;
}
if (tb[IFLA_MTU]) {
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 607976c..e15ada0 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -627,7 +627,7 @@ static __be32 vxlan_find_dst(struct vxlan_dev *vxlan, struct sk_buff *skb)
const struct ethhdr *eth = (struct ethhdr *) skb->data;
const struct vxlan_fdb *f;
- if (is_multicast_ether_addr(eth->h_dest))
+ if (eth_addr_multicast(eth->h_dest))
return vxlan->gaddr;
f = vxlan_find_mac(vxlan, eth->h_dest);
@@ -1030,7 +1030,7 @@ static int vxlan_validate(struct nlattr *tb[], struct nlattr *data[])
return -EINVAL;
}
- if (!is_valid_ether_addr(nla_data(tb[IFLA_ADDRESS]))) {
+ if (!eth_addr_valid(nla_data(tb[IFLA_ADDRESS]))) {
pr_debug("invalid all zero ethernet address\n");
return -EADDRNOTAVAIL;
}
diff --git a/drivers/net/wimax/i2400m/driver.c b/drivers/net/wimax/i2400m/driver.c
index 9c34d2f..0209271 100644
--- a/drivers/net/wimax/i2400m/driver.c
+++ b/drivers/net/wimax/i2400m/driver.c
@@ -243,7 +243,7 @@ int i2400m_check_mac_addr(struct i2400m *i2400m)
"to that of boot mode's\n");
dev_warn(dev, "device reports %pM\n", ddi->mac_address);
dev_warn(dev, "boot mode reported %pM\n", net_dev->perm_addr);
- if (is_zero_ether_addr(ddi->mac_address))
+ if (eth_addr_zero(ddi->mac_address))
dev_err(dev, "device reports an invalid MAC address, "
"not updating\n");
else {
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 06/21] staging: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (4 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 05/21] drivers: net: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 07/21] infiniband: " Joe Perches
` (16 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/staging/ccg/u_ether.c | 6 +++---
drivers/staging/csr/sme_wext.c | 2 +-
drivers/staging/et131x/et131x.c | 4 ++--
drivers/staging/gdm72xx/gdm_wimax.c | 2 +-
drivers/staging/octeon/ethernet.c | 2 +-
drivers/staging/ozwpan/ozcdev.c | 2 +-
.../rtl8187se/ieee80211/ieee80211_softmac.c | 2 +-
.../rtl8187se/ieee80211/ieee80211_softmac_wx.c | 2 +-
drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c | 2 +-
drivers/staging/rtl8187se/r8180_core.c | 2 +-
drivers/staging/rtl8192e/rtl8192e/rtl_core.c | 6 +++---
drivers/staging/rtl8192e/rtl819x_TSProc.c | 2 +-
drivers/staging/rtl8192e/rtllib_rx.c | 8 ++++----
drivers/staging/rtl8192e/rtllib_softmac.c | 4 ++--
drivers/staging/rtl8192e/rtllib_softmac_wx.c | 4 ++--
drivers/staging/rtl8192e/rtllib_tx.c | 12 ++++++------
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 4 ++--
.../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
.../rtl8192u/ieee80211/ieee80211_softmac_wx.c | 2 +-
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 12 ++++++------
.../staging/rtl8192u/ieee80211/rtl819x_TSProc.c | 2 +-
drivers/staging/rtl8192u/r8192U_core.c | 8 ++++----
drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +-
drivers/staging/rtl8712/rtl871x_ioctl_set.c | 2 +-
drivers/staging/rtl8712/rtl871x_mlme.c | 2 +-
drivers/staging/rtl8712/rtl871x_recv.c | 8 ++++----
drivers/staging/slicoss/slicoss.c | 2 +-
drivers/staging/vt6655/bssdb.c | 2 +-
drivers/staging/vt6655/card.c | 2 +-
drivers/staging/vt6655/device_main.c | 2 +-
drivers/staging/vt6655/dpc.c | 4 ++--
drivers/staging/vt6655/hostap.c | 4 ++--
drivers/staging/vt6655/iwctl.c | 2 +-
drivers/staging/vt6655/key.c | 2 +-
drivers/staging/vt6655/mib.c | 8 ++++----
drivers/staging/vt6655/rxtx.c | 10 +++++-----
drivers/staging/vt6655/wpactl.c | 4 ++--
drivers/staging/vt6656/bssdb.c | 2 +-
drivers/staging/vt6656/dpc.c | 4 ++--
drivers/staging/vt6656/hostap.c | 4 ++--
drivers/staging/vt6656/iwctl.c | 2 +-
drivers/staging/vt6656/key.c | 2 +-
drivers/staging/vt6656/rxtx.c | 14 +++++++-------
drivers/staging/vt6656/wpactl.c | 2 +-
drivers/staging/wlags49_h2/wl_wext.c | 2 +-
45 files changed, 90 insertions(+), 90 deletions(-)
diff --git a/drivers/staging/ccg/u_ether.c b/drivers/staging/ccg/u_ether.c
index d0dabcf..0f1a1b7 100644
--- a/drivers/staging/ccg/u_ether.c
+++ b/drivers/staging/ccg/u_ether.c
@@ -509,13 +509,13 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
if (!is_promisc(cdc_filter)) {
u8 *dest = skb->data;
- if (is_multicast_ether_addr(dest)) {
+ if (eth_addr_multicast(dest)) {
u16 type;
/* ignores USB_CDC_PACKET_TYPE_MULTICAST and host
* SET_ETHERNET_MULTICAST_FILTERS requests
*/
- if (is_broadcast_ether_addr(dest))
+ if (eth_addr_broadcast(dest))
type = USB_CDC_PACKET_TYPE_BROADCAST;
else
type = USB_CDC_PACKET_TYPE_ALL_MULTICAST;
@@ -714,7 +714,7 @@ static int get_ether_addr(const char *str, u8 *dev_addr)
num |= hex_to_bin(*str++);
dev_addr [i] = num;
}
- if (is_valid_ether_addr(dev_addr))
+ if (eth_addr_valid(dev_addr))
return 0;
}
eth_random_addr(dev_addr);
diff --git a/drivers/staging/csr/sme_wext.c b/drivers/staging/csr/sme_wext.c
index b58c0c6..0aea381 100644
--- a/drivers/staging/csr/sme_wext.c
+++ b/drivers/staging/csr/sme_wext.c
@@ -1211,7 +1211,7 @@ unifi_siwap(struct net_device *dev, struct iw_request_info *info,
unifi_trace(priv, UDBG1, "unifi_siwap: asked for %pM\n",
wrqu->ap_addr.sa_data);
- if (is_zero_ether_addr(wrqu->ap_addr.sa_data)) {
+ if (eth_addr_zero(wrqu->ap_addr.sa_data)) {
priv->ignore_bssid_join = FALSE;
err = sme_mgt_disconnect(priv);
if (err) {
diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c
index 413da0d..90c8e86 100644
--- a/drivers/staging/et131x/et131x.c
+++ b/drivers/staging/et131x/et131x.c
@@ -3955,7 +3955,7 @@ static void et131x_hwaddr_init(struct et131x_adapter *adapter)
* EEPROM then we need to generate the last octet and set it on the
* device
*/
- if (is_zero_ether_addr(adapter->rom_addr)) {
+ if (eth_addr_zero(adapter->rom_addr)) {
/*
* We need to randomly generate the last octet so we
* decrease our chances of setting the mac address to
@@ -5156,7 +5156,7 @@ static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)
return -ENODEV;
/* Make sure the requested MAC is valid */
- if (!is_valid_ether_addr(address->sa_data))
+ if (!eth_addr_valid(address->sa_data))
return -EADDRNOTAVAIL;
et131x_disable_txrx(netdev);
diff --git a/drivers/staging/gdm72xx/gdm_wimax.c b/drivers/staging/gdm72xx/gdm_wimax.c
index 6cb8107..5a00ff6 100644
--- a/drivers/staging/gdm72xx/gdm_wimax.c
+++ b/drivers/staging/gdm72xx/gdm_wimax.c
@@ -489,7 +489,7 @@ static int gdm_wimax_set_mac_addr(struct net_device *dev, void *p)
if (netif_running(dev))
return -EBUSY;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EADDRNOTAVAIL;
__gdm_wimax_set_mac_addr(dev, addr->sa_data);
diff --git a/drivers/staging/octeon/ethernet.c b/drivers/staging/octeon/ethernet.c
index 683bedc..496351f 100644
--- a/drivers/staging/octeon/ethernet.c
+++ b/drivers/staging/octeon/ethernet.c
@@ -453,7 +453,7 @@ int cvm_oct_common_init(struct net_device *dev)
if (priv->of_node)
mac = of_get_mac_address(priv->of_node);
- if (mac && is_valid_ether_addr(mac)) {
+ if (mac && eth_addr_valid(mac)) {
memcpy(dev->dev_addr, mac, ETH_ALEN);
dev->addr_assign_type &= ~NET_ADDR_RANDOM;
} else {
diff --git a/drivers/staging/ozwpan/ozcdev.c b/drivers/staging/ozwpan/ozcdev.c
index 64913ae..b2cf3b4 100644
--- a/drivers/staging/ozwpan/ozcdev.c
+++ b/drivers/staging/ozwpan/ozcdev.c
@@ -214,7 +214,7 @@ static int oz_set_active_pd(u8 *addr)
if (old_pd)
oz_pd_put(old_pd);
} else {
- if (is_zero_ether_addr(addr)) {
+ if (eth_addr_zero(addr)) {
spin_lock_bh(&g_cdev.lock);
pd = g_cdev.active_pd;
g_cdev.active_pd = 0;
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
index 00f9af0..15fd4f4 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c
@@ -2803,7 +2803,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
param->u.crypt.key_len);
return -EINVAL;
}
- if (is_broadcast_ether_addr(param->sta_addr)) {
+ if (eth_addr_broadcast(param->sta_addr)) {
if (param->u.crypt.idx >= WEP_KEYS)
return -EINVAL;
crypt = &ieee->crypt[param->u.crypt.idx];
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
index 1ef8fd6..ad23eb5 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c
@@ -162,7 +162,7 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
spin_lock_irqsave(&ieee->lock, flags);
memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN);
- ieee->wap_set = !is_zero_ether_addr(temp->sa_data);
+ ieee->wap_set = !eth_addr_zero(temp->sa_data);
//printk(" %x:%x:%x:%x:%x:%x\n", ieee->current_network.bssid[0],ieee->current_network.bssid[1],ieee->current_network.bssid[2],ieee->current_network.bssid[3],ieee->current_network.bssid[4],ieee->current_network.bssid[5]);
spin_unlock_irqrestore(&ieee->lock, flags);
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
index 89ed86e..b281c8d 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
@@ -413,7 +413,7 @@ int ieee80211_rtl_xmit(struct sk_buff *skb,
/* Determine fragmentation size based on destination (multicast
* and broadcast are not fragmented) */
- if (is_multicast_ether_addr(header.addr1)) {
+ if (eth_addr_multicast(header.addr1)) {
frag_size = MAX_FRAG_THRESHOLD;
qos_ctl = QOS_CTL_NOTCONTAIN_ACK;
}
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c
index 20e5fb5..b439dd5 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -2003,7 +2003,7 @@ short rtl8180_tx(struct net_device *dev, u8* txbuf, int len, int priority,
}
memcpy(&dest, frag_hdr->addr1, ETH_ALEN);
- if (is_multicast_ether_addr(dest)) {
+ if (eth_addr_multicast(dest)) {
Duration = 0;
RtsDur = 0;
bRTSEnable = 0;
diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
index 81134d3..8da56f4 100644
--- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
+++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c
@@ -2023,9 +2023,9 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
stype = WLAN_FC_GET_STYPE(fc);
pda_addr = header->addr1;
- if (is_broadcast_ether_addr(pda_addr))
+ if (eth_addr_broadcast(pda_addr))
broad_addr = true;
- else if (is_multicast_ether_addr(pda_addr))
+ else if (eth_addr_multicast(pda_addr))
multi_addr = true;
else
uni_addr = true;
@@ -2357,7 +2357,7 @@ static void rtl8192_rx_normal(struct net_device *dev)
stats.RxBufShift);
skb_trim(skb, skb->len - 4/*sCrcLng*/);
rtllib_hdr = (struct rtllib_hdr_1addr *)skb->data;
- if (!is_multicast_ether_addr(rtllib_hdr->addr1)) {
+ if (!eth_addr_multicast(rtllib_hdr->addr1)) {
/* unicast packet */
unicast_packet = true;
}
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index 658e875..ebd3349 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -310,7 +310,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
u8 *Addr, u8 TID, enum tr_select TxRxSelect, bool bAddNewTs)
{
u8 UP = 0;
- if (is_multicast_ether_addr(Addr)) {
+ if (eth_addr_multicast(Addr)) {
RTLLIB_DEBUG(RTLLIB_DL_ERR, "ERR! get TS for Broadcast or "
"Multicast\n");
return false;
diff --git a/drivers/staging/rtl8192e/rtllib_rx.c b/drivers/staging/rtl8192e/rtllib_rx.c
index 8b8a5c6..8d13ace 100644
--- a/drivers/staging/rtl8192e/rtllib_rx.c
+++ b/drivers/staging/rtl8192e/rtllib_rx.c
@@ -1000,7 +1000,7 @@ static int rtllib_rx_data_filter(struct rtllib_device *ieee, u16 fc,
return -1;
/* {broad,multi}cast packets to our BSS go through */
- if (is_multicast_ether_addr(dst)) {
+ if (eth_addr_multicast(dst)) {
if (memcmp(bssid, ieee->current_network.bssid, ETH_ALEN))
return -1;
}
@@ -1230,7 +1230,7 @@ static void rtllib_rx_indicate_pkt_legacy(struct rtllib_device *ieee,
ieee->stats.rx_packets++;
ieee->stats.rx_bytes += sub_skb->len;
- if (is_multicast_ether_addr(dst))
+ if (eth_addr_multicast(dst))
ieee->stats.multicast++;
/* Indicate the packets to upper layer */
@@ -1269,7 +1269,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
sc = le16_to_cpu(hdr->seq_ctl);
/*Filter pkt not to me*/
- multicast = is_multicast_ether_addr(hdr->addr1);
+ multicast = eth_addr_multicast(hdr->addr1);
unicast = !multicast;
if (unicast && (compare_ether_addr(dev->dev_addr, hdr->addr1) != 0)) {
if (ieee->bNetPromiscuousMode)
@@ -1350,7 +1350,7 @@ static int rtllib_rx_InfraAdhoc(struct rtllib_device *ieee, struct sk_buff *skb,
/* Get TS for Rx Reorder */
hdr = (struct rtllib_hdr_4addr *) skb->data;
if (ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data)
- && !is_multicast_ether_addr(hdr->addr1)
+ && !eth_addr_multicast(hdr->addr1)
&& (!bToOtherSTA)) {
TID = Frame_QoSTID(skb->data);
SeqNum = WLAN_GET_SEQ_SEQ(sc);
diff --git a/drivers/staging/rtl8192e/rtllib_softmac.c b/drivers/staging/rtl8192e/rtllib_softmac.c
index 4feecec..a8d0931 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac.c
@@ -1844,7 +1844,7 @@ static short probe_rq_parse(struct rtllib_device *ieee, struct sk_buff *skb,
bssid_match =
(memcmp(header->addr3, ieee->current_network.bssid, ETH_ALEN) != 0) &&
- (!is_broadcast_ether_addr(header->addr3));
+ (!eth_addr_broadcast(header->addr3));
if (bssid_match)
return -1;
@@ -3356,7 +3356,7 @@ static int rtllib_wpa_set_encryption(struct rtllib_device *ieee,
param->u.crypt.key_len);
return -EINVAL;
}
- if (is_broadcast_ether_addr(param->sta_addr)) {
+ if (eth_addr_broadcast(param->sta_addr)) {
if (param->u.crypt.idx >= NUM_WEP_KEYS)
return -EINVAL;
crypt = &ieee->crypt_info.crypt[param->u.crypt.idx];
diff --git a/drivers/staging/rtl8192e/rtllib_softmac_wx.c b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
index 740cf85..b870df5 100644
--- a/drivers/staging/rtl8192e/rtllib_softmac_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_softmac_wx.c
@@ -158,7 +158,7 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee,
goto out;
}
- if (is_zero_ether_addr(temp->sa_data)) {
+ if (eth_addr_zero(temp->sa_data)) {
spin_lock_irqsave(&ieee->lock, flags);
memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN);
ieee->wap_set = 0;
@@ -178,7 +178,7 @@ int rtllib_wx_set_wap(struct rtllib_device *ieee,
ieee->cannot_notify = false;
memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN);
- ieee->wap_set = !is_zero_ether_addr(temp->sa_data);
+ ieee->wap_set = !eth_addr_zero(temp->sa_data);
spin_unlock_irqrestore(&ieee->lock, flags);
diff --git a/drivers/staging/rtl8192e/rtllib_tx.c b/drivers/staging/rtl8192e/rtllib_tx.c
index 42900ee..a843560 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -296,7 +296,7 @@ static void rtllib_tx_query_agg_cap(struct rtllib_device *ieee,
return;
if (!IsQoSDataFrame(skb->data))
return;
- if (is_multicast_ether_addr(hdr->addr1))
+ if (eth_addr_multicast(hdr->addr1))
return;
if (tcb_desc->bdhcp || ieee->CntAfterLink < 2)
@@ -423,7 +423,7 @@ static void rtllib_query_protectionmode(struct rtllib_device *ieee,
if (tcb_desc->bBroadcast || tcb_desc->bMulticast)
return;
- if (is_broadcast_ether_addr(skb->data+16))
+ if (eth_addr_broadcast(skb->data+16))
return;
if (ieee->mode < IEEE_N_24G) {
@@ -514,7 +514,7 @@ u16 rtllib_query_seqnum(struct rtllib_device *ieee, struct sk_buff *skb,
{
u16 seqnum = 0;
- if (is_multicast_ether_addr(dst))
+ if (eth_addr_multicast(dst))
return 0;
if (IsQoSDataFrame(skb->data)) {
struct tx_ts_record *pTS = NULL;
@@ -697,7 +697,7 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
ETH_ALEN);
}
- bIsMulticast = is_multicast_ether_addr(header.addr1);
+ bIsMulticast = eth_addr_multicast(header.addr1);
header.frame_ctl = cpu_to_le16(fc);
@@ -897,9 +897,9 @@ int rtllib_xmit_inter(struct sk_buff *skb, struct net_device *dev)
tcb_desc->RATRIndex = 7;
tcb_desc->bTxUseDriverAssingedRate = 1;
} else {
- if (is_multicast_ether_addr(header.addr1))
+ if (eth_addr_multicast(header.addr1))
tcb_desc->bMulticast = 1;
- if (is_broadcast_ether_addr(header.addr1))
+ if (eth_addr_broadcast(header.addr1))
tcb_desc->bBroadcast = 1;
rtllib_txrate_selectmode(ieee, tcb_desc);
if (tcb_desc->bMulticast || tcb_desc->bBroadcast)
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index e3cf7a4..5b89789 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -1285,7 +1285,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
*/
//added by amy for reorder
if(ieee->current_network.qos_data.active && IsQoSDataFrame(skb->data)
- && !is_multicast_ether_addr(hdr->addr1))
+ && !eth_addr_multicast(hdr->addr1))
{
TID = Frame_QoSTID(skb->data);
SeqNum = WLAN_GET_SEQ_SEQ(sc);
@@ -1346,7 +1346,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
stats->rx_packets++;
stats->rx_bytes += sub_skb->len;
- if(is_multicast_ether_addr(dst)) {
+ if(eth_addr_multicast(dst)) {
stats->multicast++;
}
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 7a07078..7c74ce39 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -2965,7 +2965,7 @@ static int ieee80211_wpa_set_encryption(struct ieee80211_device *ieee,
param->u.crypt.key_len);
return -EINVAL;
}
- if (is_broadcast_ether_addr(param->sta_addr)) {
+ if (eth_addr_broadcast(param->sta_addr)) {
if (param->u.crypt.idx >= WEP_KEYS)
return -EINVAL;
crypt = &ieee->crypt[param->u.crypt.idx];
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
index 421da8a..c1f92b8 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c
@@ -166,7 +166,7 @@ int ieee80211_wx_set_wap(struct ieee80211_device *ieee,
spin_lock_irqsave(&ieee->lock, flags);
memcpy(ieee->current_network.bssid, temp->sa_data, ETH_ALEN);
- ieee->wap_set = !is_zero_ether_addr(temp->sa_data);
+ ieee->wap_set = !eth_addr_zero(temp->sa_data);
spin_unlock_irqrestore(&ieee->lock, flags);
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
index 3f5ceeb..0c11c99 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
@@ -314,7 +314,7 @@ void ieee80211_tx_query_agg_cap(struct ieee80211_device* ieee, struct sk_buff* s
if (!IsQoSDataFrame(skb->data))
return;
- if (is_multicast_ether_addr(hdr->addr1))
+ if (eth_addr_multicast(hdr->addr1))
return;
//check packet and mode later
#ifdef TO_DO_LIST
@@ -444,7 +444,7 @@ void ieee80211_query_protectionmode(struct ieee80211_device* ieee, cb_desc* tcb_
if(tcb_desc->bBroadcast || tcb_desc->bMulticast)//only unicast frame will use rts/cts
return;
- if (is_broadcast_ether_addr(skb->data+16)) //check addr3 as infrastructure add3 is DA.
+ if (eth_addr_broadcast(skb->data+16)) //check addr3 as infrastructure add3 is DA.
return;
if (ieee->mode < IEEE_N_24G) //b, g mode
@@ -575,7 +575,7 @@ void ieee80211_txrate_selectmode(struct ieee80211_device* ieee, cb_desc* tcb_des
void ieee80211_query_seqnum(struct ieee80211_device*ieee, struct sk_buff* skb, u8* dst)
{
- if (is_multicast_ether_addr(dst))
+ if (eth_addr_multicast(dst))
return;
if (IsQoSDataFrame(skb->data)) //we deal qos data only
{
@@ -693,7 +693,7 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
/* Determine fragmentation size based on destination (multicast
* and broadcast are not fragmented) */
- if (is_multicast_ether_addr(header.addr1)) {
+ if (eth_addr_multicast(header.addr1)) {
frag_size = MAX_FRAG_THRESHOLD;
qos_ctl |= QOS_CTL_NOTCONTAIN_ACK;
}
@@ -863,9 +863,9 @@ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev)
{
cb_desc *tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->bTxEnableFwCalcDur = 1;
- if (is_multicast_ether_addr(header.addr1))
+ if (eth_addr_multicast(header.addr1))
tcb_desc->bMulticast = 1;
- if (is_broadcast_ether_addr(header.addr1))
+ if (eth_addr_broadcast(header.addr1))
tcb_desc->bBroadcast = 1;
ieee80211_txrate_selectmode(ieee, tcb_desc);
if ( tcb_desc->bMulticast || tcb_desc->bBroadcast)
diff --git a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
index 06a9824..cde11e9 100644
--- a/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c
@@ -350,7 +350,7 @@ bool GetTs(
// We do not build any TS for Broadcast or Multicast stream.
// So reject these kinds of search here.
//
- if (is_multicast_ether_addr(Addr))
+ if (eth_addr_multicast(Addr))
{
IEEE80211_DEBUG(IEEE80211_DL_ERR, "get TS for Broadcast or Multicast\n");
return false;
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 5a2fab9..74797dc 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -5475,9 +5475,9 @@ void rtl8192_rx_nomal(struct sk_buff* skb)
rx_pkt_len = skb->len;
ieee80211_hdr = (struct ieee80211_hdr_1addr *)skb->data;
unicast_packet = false;
- if(is_broadcast_ether_addr(ieee80211_hdr->addr1)) {
+ if(eth_addr_broadcast(ieee80211_hdr->addr1)) {
//TODO
- }else if(is_multicast_ether_addr(ieee80211_hdr->addr1)){
+ }else if(eth_addr_multicast(ieee80211_hdr->addr1)){
//TODO
}else {
/* unicast packet */
@@ -5535,9 +5535,9 @@ void rtl8192_rx_nomal(struct sk_buff* skb)
rx_pkt_len = skb->len;
ieee80211_hdr = (struct ieee80211_hdr_1addr *)skb->data;
unicast_packet = false;
- if(is_broadcast_ether_addr(ieee80211_hdr->addr1)) {
+ if(eth_addr_broadcast(ieee80211_hdr->addr1)) {
//TODO
- }else if(is_multicast_ether_addr(ieee80211_hdr->addr1)){
+ }else if(eth_addr_multicast(ieee80211_hdr->addr1)){
//TODO
}else {
/* unicast packet */
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index c9a6a7f..703e545 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -407,7 +407,7 @@ static int wpa_set_encryption(struct net_device *dev, struct ieee_param *param,
if (param_len != (u32)((u8 *) param->u.crypt.key - (u8 *)param) +
param->u.crypt.key_len)
return -EINVAL;
- if (is_broadcast_ether_addr(param->sta_addr)) {
+ if (eth_addr_broadcast(param->sta_addr)) {
if (param->u.crypt.idx >= WEP_KEYS) {
/* for large key indices, set the default (0) */
param->u.crypt.idx = 0;
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
index d3ab24e..6a9aab6 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
@@ -131,7 +131,7 @@ u8 r8712_set_802_11_bssid(struct _adapter *padapter, u8 *bssid)
u8 status = true;
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
- if (is_zero_ether_addr(bssid) || is_broadcast_ether_addr(bssid)) {
+ if (eth_addr_zero(bssid) || eth_addr_broadcast(bssid)) {
status = false;
return status;
}
diff --git a/drivers/staging/rtl8712/rtl871x_mlme.c b/drivers/staging/rtl8712/rtl871x_mlme.c
index c51ad9e..5c4d550 100644
--- a/drivers/staging/rtl8712/rtl871x_mlme.c
+++ b/drivers/staging/rtl8712/rtl871x_mlme.c
@@ -149,7 +149,7 @@ static struct wlan_network *_r8712_find_network(struct __queue *scanned_queue,
struct list_head *phead, *plist;
struct wlan_network *pnetwork = NULL;
- if (is_zero_ether_addr(addr))
+ if (eth_addr_zero(addr))
return NULL;
spin_lock_irqsave(&scanned_queue->lock, irqL);
phead = get_list_head(scanned_queue);
diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c
index 23ec684..37702e3 100644
--- a/drivers/staging/rtl8712/rtl871x_recv.c
+++ b/drivers/staging/rtl8712/rtl871x_recv.c
@@ -332,8 +332,8 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
return _FAIL;
if ((memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast))
return _FAIL;
- if (is_zero_ether_addr(pattrib->bssid) ||
- is_zero_ether_addr(mybssid) ||
+ if (eth_addr_zero(pattrib->bssid) ||
+ eth_addr_zero(mybssid) ||
(memcmp(pattrib->bssid, mybssid, ETH_ALEN)))
return _FAIL;
sta_addr = pattrib->src;
@@ -410,8 +410,8 @@ static sint ap2sta_data_frame(struct _adapter *adapter,
if ((memcmp(myhwaddr, pattrib->dst, ETH_ALEN)) && (!bmcast))
return _FAIL;
/* check BSSID */
- if (is_zero_ether_addr(pattrib->bssid) ||
- is_zero_ether_addr(mybssid) ||
+ if (eth_addr_zero(pattrib->bssid) ||
+ eth_addr_zero(mybssid) ||
(memcmp(pattrib->bssid, mybssid, ETH_ALEN)))
return _FAIL;
if (bmcast)
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index cd920da..4cc972d 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -918,7 +918,7 @@ static int slic_mac_set_address(struct net_device *dev, void *ptr)
if (!adapter)
return -EBUSY;
- if (!is_valid_ether_addr(addr->sa_data))
+ if (!eth_addr_valid(addr->sa_data))
return -EINVAL;
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c
index fe57fb8..4e44851 100644
--- a/drivers/staging/vt6655/bssdb.c
+++ b/drivers/staging/vt6655/bssdb.c
@@ -143,7 +143,7 @@ BSSpSearchBSSList(
if (pbyDesireBSSID != NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"BSSpSearchBSSList BSSID[%pM]\n", pbyDesireBSSID);
- if ((!is_broadcast_ether_addr(pbyDesireBSSID)) &&
+ if ((!eth_addr_broadcast(pbyDesireBSSID)) &&
(memcmp(pbyDesireBSSID, ZeroBSSID, 6)!= 0)){
pbyBSSID = pbyDesireBSSID;
}
diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 319ca48..12b31ce 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -835,7 +835,7 @@ bool CARDbSetBSSID(void *pDeviceHandler, unsigned char *pbyBSSID, CARD_OP_MODE e
pDevice->byRxMode &= ~RCR_BSSID;
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wcmd: rx_mode = %x\n", pDevice->byRxMode );
} else {
- if (is_zero_ether_addr(pDevice->abyBSSID) == false) {
+ if (eth_addr_zero(pDevice->abyBSSID) == false) {
MACvRegBitsOn(pDevice->PortOffset, MAC_REG_RCR, RCR_BSSID);
pDevice->bBSSIDFilter = true;
pDevice->byRxMode |= RCR_BSSID;
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 9e3b3f2b..b47d31a 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -2275,7 +2275,7 @@ static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
spin_unlock_irq(&pDevice->lock);
return 0;
}
- if (is_multicast_ether_addr((unsigned char *)(skb->data))) {
+ if (eth_addr_multicast((unsigned char *)(skb->data))) {
uNodeIndex = 0;
bNodeExist = true;
if (pMgmt->sNodeDBTable[0].bPSEnable) {
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index 373e9e4..de96dfa 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -442,7 +442,7 @@ device_receive_frame (
return false;
}
- if (!is_multicast_ether_addr(pbyFrame)) {
+ if (!eth_addr_multicast(pbyFrame)) {
if (WCTLbIsDuplicate(&(pDevice->sDupRxCache), (PS802_11Header) (skb->data + 4))) {
pDevice->s802_11Counter.FrameDuplicateCount++;
return false;
@@ -1421,7 +1421,7 @@ static bool s_bAPModeRxData (
if (FrameSize > CB_MAX_BUF_SIZE)
return false;
// check DA
- if(is_multicast_ether_addr((unsigned char *)(skb->data+cbHeaderOffset))) {
+ if(eth_addr_multicast((unsigned char *)(skb->data+cbHeaderOffset))) {
if (pMgmt->sNodeDBTable[0].bPSEnable) {
skbcpy = dev_alloc_skb((int)pDevice->rx_buf_sz);
diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
index 67b1b88..5076547 100644
--- a/drivers/staging/vt6655/hostap.c
+++ b/drivers/staging/vt6655/hostap.c
@@ -495,7 +495,7 @@ static int hostap_set_encryption(PSDevice pDevice,
return -EINVAL;
}
- if (is_broadcast_ether_addr(param->sta_addr)) {
+ if (eth_addr_broadcast(param->sta_addr)) {
if (param->u.crypt.idx >= MAX_GROUP_KEY)
return -EINVAL;
iNodeIndex = 0;
@@ -714,7 +714,7 @@ static int hostap_get_encryption(PSDevice pDevice,
param->u.crypt.err = 0;
- if (is_broadcast_ether_addr(param->sta_addr)) {
+ if (eth_addr_broadcast(param->sta_addr)) {
iNodeIndex = 0;
} else {
if (BSSDBbIsSTAInNodeDB(pMgmt, param->sta_addr, &iNodeIndex) == false) {
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index 5cdda8d..94d96bd 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -676,7 +676,7 @@ if (pMgmt->eScanState == WMAC_IS_SCANNING) {
return rc;
}
//mike :add
- if ((is_broadcast_ether_addr(pMgmt->abyDesireBSSID)) ||
+ if ((eth_addr_broadcast(pMgmt->abyDesireBSSID)) ||
(memcmp(pMgmt->abyDesireBSSID, ZeroBSSID, 6) == 0)){
PRINT_K("SIOCSIWAP:invalid desired BSSID return!\n");
return rc;
diff --git a/drivers/staging/vt6655/key.c b/drivers/staging/vt6655/key.c
index 194fedc..03affe48 100644
--- a/drivers/staging/vt6655/key.c
+++ b/drivers/staging/vt6655/key.c
@@ -371,7 +371,7 @@ bool KeybRemoveKey (
{
int i;
- if (is_broadcast_ether_addr(pbyBSSID)) {
+ if (eth_addr_broadcast(pbyBSSID)) {
// delete all keys
if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
for (i=0;i<MAX_KEY_TABLE;i++) {
diff --git a/drivers/staging/vt6655/mib.c b/drivers/staging/vt6655/mib.c
index 63ae4ad..28157f6 100644
--- a/drivers/staging/vt6655/mib.c
+++ b/drivers/staging/vt6655/mib.c
@@ -471,11 +471,11 @@ STAvUpdateTDStatCounter (
pStatistic->CustomStat.ullTsrAllOK =
(pStatistic->ullTsrOK[TYPE_AC0DMA] + pStatistic->ullTsrOK[TYPE_TXDMA0]);
// update counters in case that successful transmit
- if (is_broadcast_ether_addr(pbyDestAddr)) {
+ if (eth_addr_broadcast(pbyDestAddr)) {
pStatistic->ullTxBroadcastFrames[uIdx]++;
pStatistic->ullTxBroadcastBytes[uIdx] += (unsigned long long) cbFrameLength;
}
- else if (is_multicast_ether_addr(pbyDestAddr)) {
+ else if (eth_addr_multicast(pbyDestAddr)) {
pStatistic->ullTxMulticastFrames[uIdx]++;
pStatistic->ullTxMulticastBytes[uIdx] += (unsigned long long) cbFrameLength;
}
@@ -495,9 +495,9 @@ STAvUpdateTDStatCounter (
pStatistic->dwTsrACKData[uIdx]++;
}
- if (is_broadcast_ether_addr(pbyDestAddr))
+ if (eth_addr_broadcast(pbyDestAddr))
pStatistic->dwTsrBroadcast[uIdx]++;
- else if (is_multicast_ether_addr(pbyDestAddr))
+ else if (eth_addr_multicast(pbyDestAddr))
pStatistic->dwTsrMulticast[uIdx]++;
else
pStatistic->dwTsrDirected[uIdx]++;
diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 4972e57..5189415 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -1372,7 +1372,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyT
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
- if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])))
+ if (eth_addr_multicast(&(psEthHeader->abyDstAddr[0])))
bNeedACK = false;
else
bNeedACK = true;
@@ -2088,7 +2088,7 @@ vGenerateFIFOHeader(PSDevice pDevice, unsigned char byPktType, unsigned char *pb
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
- if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0]))) {
+ if (eth_addr_multicast(&(psEthHeader->abyDstAddr[0]))) {
bNeedACK = false;
pTxBufHead->wFIFOCtl = pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK);
}
@@ -2388,7 +2388,7 @@ CMD_STATUS csMgmt_xmit(PSDevice pDevice, PSTxMgmtPacket pPacket) {
pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us);
- if (is_multicast_ether_addr(&(pPacket->p80211Header->sA3.abyAddr1[0])))
+ if (eth_addr_multicast(&(pPacket->p80211Header->sA3.abyAddr1[0])))
bNeedACK = false;
else {
bNeedACK = true;
@@ -2722,7 +2722,7 @@ cbGetFragCount (
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
- if (is_multicast_ether_addr(&(psEthHeader->abyDstAddr[0])))
+ if (eth_addr_multicast(&(psEthHeader->abyDstAddr[0])))
bNeedACK = false;
else
bNeedACK = true;
@@ -2897,7 +2897,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb, unsigned char *pbMPDU, un
pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us);
- if (is_multicast_ether_addr(&(p80211Header->sA3.abyAddr1[0]))) {
+ if (eth_addr_multicast(&(p80211Header->sA3.abyAddr1[0]))) {
bNeedACK = false;
if (pDevice->bEnableHostWEP) {
uNodeIndex = 0;
diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index 2b6ae1e..e7a00f2 100644
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -353,8 +353,8 @@ spin_lock_irq(&pDevice->lock);
}
// spin_lock_irq(&pDevice->lock);
- if (is_broadcast_ether_addr(¶m->addr[0]) || (param->addr == NULL)) {
- // If is_broadcast_ether_addr, set the key as every key entry's group key.
+ if (eth_addr_broadcast(¶m->addr[0]) || (param->addr == NULL)) {
+ // If eth_addr_broadcast, set the key as every key entry's group key.
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Groupe Key Assign.\n");
if ((KeybSetAllGroupKey(&(pDevice->sKey),
diff --git a/drivers/staging/vt6656/bssdb.c b/drivers/staging/vt6656/bssdb.c
index 2ac066d..db8d7ed 100644
--- a/drivers/staging/vt6656/bssdb.c
+++ b/drivers/staging/vt6656/bssdb.c
@@ -131,7 +131,7 @@ PKnownBSS BSSpSearchBSSList(void *hDeviceContext,
if (pbyDesireBSSID != NULL) {
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO
"BSSpSearchBSSList BSSID[%pM]\n", pbyDesireBSSID);
- if ((!is_broadcast_ether_addr(pbyDesireBSSID)) &&
+ if ((!eth_addr_broadcast(pbyDesireBSSID)) &&
(memcmp(pbyDesireBSSID, ZeroBSSID, 6)!= 0)){
pbyBSSID = pbyDesireBSSID;
}
diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index 28edf9e..cea9fbf 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -452,7 +452,7 @@ RXbBulkInProcessData (
}
}
- if (!is_multicast_ether_addr(pMACHeader->abyAddr1)) {
+ if (!eth_addr_multicast(pMACHeader->abyAddr1)) {
if ( WCTLbIsDuplicate(&(pDevice->sDupRxCache), (PS802_11Header) pbyFrame) ) {
pDevice->s802_11Counter.FrameDuplicateCount++;
return FALSE;
@@ -1424,7 +1424,7 @@ static BOOL s_bAPModeRxData (
if (FrameSize > CB_MAX_BUF_SIZE)
return FALSE;
// check DA
- if (is_multicast_ether_addr((PBYTE)(skb->data+cbHeaderOffset))) {
+ if (eth_addr_multicast((PBYTE)(skb->data+cbHeaderOffset))) {
if (pMgmt->sNodeDBTable[0].bPSEnable) {
skbcpy = dev_alloc_skb((int)pDevice->rx_buf_sz);
diff --git a/drivers/staging/vt6656/hostap.c b/drivers/staging/vt6656/hostap.c
index 0a73d40..f5fa4ba 100644
--- a/drivers/staging/vt6656/hostap.c
+++ b/drivers/staging/vt6656/hostap.c
@@ -439,7 +439,7 @@ static int hostap_set_encryption(PSDevice pDevice,
return -EINVAL;
}
- if (is_broadcast_ether_addr(param->sta_addr)) {
+ if (eth_addr_broadcast(param->sta_addr)) {
if (param->u.crypt.idx >= MAX_GROUP_KEY)
return -EINVAL;
iNodeIndex = 0;
@@ -661,7 +661,7 @@ static int hostap_get_encryption(PSDevice pDevice,
param->u.crypt.err = 0;
- if (is_broadcast_ether_addr(param->sta_addr)) {
+ if (eth_addr_broadcast(param->sta_addr)) {
iNodeIndex = 0;
} else {
if (BSSbIsSTAInNodeDB(pDevice, param->sta_addr, &iNodeIndex) == FALSE) {
diff --git a/drivers/staging/vt6656/iwctl.c b/drivers/staging/vt6656/iwctl.c
index 8f19874..43c03e2 100644
--- a/drivers/staging/vt6656/iwctl.c
+++ b/drivers/staging/vt6656/iwctl.c
@@ -582,7 +582,7 @@ int iwctl_siwap(struct net_device *dev, struct iw_request_info *info,
} else {
memcpy(pMgmt->abyDesireBSSID, wrq->sa_data, 6);
// mike: add
- if ((is_broadcast_ether_addr(pMgmt->abyDesireBSSID)) ||
+ if ((eth_addr_broadcast(pMgmt->abyDesireBSSID)) ||
(memcmp(pMgmt->abyDesireBSSID, ZeroBSSID, 6) == 0)) {
PRINT_K("SIOCSIWAP:invalid desired BSSID return!\n");
return rc;
diff --git a/drivers/staging/vt6656/key.c b/drivers/staging/vt6656/key.c
index a61fcb9..4d2a170 100644
--- a/drivers/staging/vt6656/key.c
+++ b/drivers/staging/vt6656/key.c
@@ -402,7 +402,7 @@ BOOL KeybRemoveKey(
int i;
BOOL bReturnValue = FALSE;
- if (is_broadcast_ether_addr(pbyBSSID)) {
+ if (eth_addr_broadcast(pbyBSSID)) {
// delete all keys
if ((dwKeyIndex & PAIRWISE_KEY) != 0) {
for (i=0;i<MAX_KEY_TABLE;i++) {
diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
index 3390838..ed2edd2 100644
--- a/drivers/staging/vt6656/rxtx.c
+++ b/drivers/staging/vt6656/rxtx.c
@@ -298,9 +298,9 @@ s_vSaveTxPktInfo(PSDevice pDevice, BYTE byPktNum, PBYTE pbyDestAddr, WORD wPktLe
{
PSStatCounter pStatistic=&(pDevice->scStatistic);
- if (is_broadcast_ether_addr(pbyDestAddr))
+ if (eth_addr_broadcast(pbyDestAddr))
pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni = TX_PKT_BROAD;
- else if (is_multicast_ether_addr(pbyDestAddr))
+ else if (eth_addr_multicast(pbyDestAddr))
pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni = TX_PKT_MULTI;
else
pStatistic->abyTxPktInfo[byPktNum].byBroadMultiUni = TX_PKT_UNI;
@@ -1484,7 +1484,7 @@ s_bPacketToWirelessUsb(
} else { //if (pDevice->dwDiagRefCount != 0) {
if ((pDevice->eOPMode == OP_MODE_ADHOC) ||
(pDevice->eOPMode == OP_MODE_AP)) {
- if (is_multicast_ether_addr(psEthHeader->abyDstAddr)) {
+ if (eth_addr_multicast(psEthHeader->abyDstAddr)) {
bNeedACK = FALSE;
pTxBufHead->wFIFOCtl =
pTxBufHead->wFIFOCtl & (~FIFOCTL_NEEDACK);
@@ -2027,7 +2027,7 @@ CMD_STATUS csMgmt_xmit(
pTxBufHead->wFIFOCtl |= FIFOCTL_TMOEN;
pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us);
- if (is_multicast_ether_addr(pPacket->p80211Header->sA3.abyAddr1)) {
+ if (eth_addr_multicast(pPacket->p80211Header->sA3.abyAddr1)) {
bNeedACK = FALSE;
}
else {
@@ -2434,7 +2434,7 @@ vDMA0_tx_80211(PSDevice pDevice, struct sk_buff *skb) {
pTxBufHead->wFIFOCtl |= FIFOCTL_TMOEN;
pTxBufHead->wTimeStamp = cpu_to_le16(DEFAULT_MGN_LIFETIME_RES_64us);
- if (is_multicast_ether_addr(p80211Header->sA3.abyAddr1)) {
+ if (eth_addr_multicast(p80211Header->sA3.abyAddr1)) {
bNeedACK = FALSE;
if (pDevice->bEnableHostWEP) {
uNodeIndex = 0;
@@ -2759,7 +2759,7 @@ int nsDMA_tx_packet(PSDevice pDevice, unsigned int uDMAIdx, struct sk_buff *skb)
return 0;
}
- if (is_multicast_ether_addr((PBYTE)(skb->data))) {
+ if (eth_addr_multicast((PBYTE)(skb->data))) {
uNodeIndex = 0;
bNodeExist = TRUE;
if (pMgmt->sNodeDBTable[0].bPSEnable) {
@@ -2952,7 +2952,7 @@ int nsDMA_tx_packet(PSDevice pDevice, unsigned int uDMAIdx, struct sk_buff *skb)
else {
if (pDevice->eOPMode == OP_MODE_ADHOC) {
// Adhoc Tx rate decided from node DB
- if (is_multicast_ether_addr(pDevice->sTxEthHeader.abyDstAddr)) {
+ if (eth_addr_multicast(pDevice->sTxEthHeader.abyDstAddr)) {
// Multicast use highest data rate
pDevice->wCurrentRate = pMgmt->sNodeDBTable[0].wTxDataRate;
// preamble type
diff --git a/drivers/staging/vt6656/wpactl.c b/drivers/staging/vt6656/wpactl.c
index 3e65aa1..534a7c8 100644
--- a/drivers/staging/vt6656/wpactl.c
+++ b/drivers/staging/vt6656/wpactl.c
@@ -337,7 +337,7 @@ int wpa_set_wpadev(PSDevice pDevice, int val)
return -EINVAL;
}
- if (is_broadcast_ether_addr(¶m->addr[0]) || (param->addr == NULL)) {
+ if (eth_addr_broadcast(¶m->addr[0]) || (param->addr == NULL)) {
/* if broadcast, set the key as every key entry's group key */
DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "Groupe Key Assign.\n");
diff --git a/drivers/staging/wlags49_h2/wl_wext.c b/drivers/staging/wlags49_h2/wl_wext.c
index f553366..8263409 100644
--- a/drivers/staging/wlags49_h2/wl_wext.c
+++ b/drivers/staging/wlags49_h2/wl_wext.c
@@ -174,7 +174,7 @@ static int hermes_clear_tkip_keys(ltv_t *ltv, u16 key_idx, u8 *addr)
switch (key_idx) {
case 0:
- if (!is_broadcast_ether_addr(addr)) {
+ if (!eth_addr_broadcast(addr)) {
ltv->len = 7;
ltv->typ = CFG_REMOVE_TKIP_MAPPED_KEY;
memcpy(<v->u.u8[0], addr, ETH_ALEN);
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 07/21] infiniband: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (5 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 06/21] staging: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 08/21] scsi: " Joe Perches
` (15 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/infiniband/hw/amso1100/c2.c | 2 +-
drivers/infiniband/hw/nes/nes_nic.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/hw/amso1100/c2.c b/drivers/infiniband/hw/amso1100/c2.c
index 5ce7b9e..3bb307c 100644
--- a/drivers/infiniband/hw/amso1100/c2.c
+++ b/drivers/infiniband/hw/amso1100/c2.c
@@ -908,7 +908,7 @@ static struct net_device *c2_devinit(struct c2_dev *c2dev,
memcpy_fromio(netdev->dev_addr, mmio_addr + C2_REGS_ENADDR, 6);
/* Validate the MAC address */
- if (!is_valid_ether_addr(netdev->dev_addr)) {
+ if (!eth_addr_valid(netdev->dev_addr)) {
pr_debug("Invalid MAC Address\n");
c2_print_macaddr(netdev);
free_netdev(netdev);
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 0564be7..3cd7d38 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -809,7 +809,7 @@ static int nes_netdev_set_mac_address(struct net_device *netdev, void *p)
u32 macaddr_low;
u16 macaddr_high;
- if (!is_valid_ether_addr(mac_addr->sa_data))
+ if (!eth_addr_valid(mac_addr->sa_data))
return -EADDRNOTAVAIL;
memcpy(netdev->dev_addr, mac_addr->sa_data, netdev->addr_len);
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 08/21] scsi: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (6 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 07/21] infiniband: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 09/21] of: " Joe Perches
` (14 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/scsi/bnx2fc/bnx2fc_els.c | 4 ++--
drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 2 +-
drivers/scsi/fcoe/fcoe.c | 12 ++++++------
drivers/scsi/fcoe/fcoe_ctlr.c | 8 ++++----
drivers/scsi/fnic/fnic_fcs.c | 6 +++---
5 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/scsi/bnx2fc/bnx2fc_els.c b/drivers/scsi/bnx2fc/bnx2fc_els.c
index bdbbb13..e611fe5 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_els.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_els.c
@@ -860,7 +860,7 @@ static void bnx2fc_flogi_resp(struct fc_seq *seq, struct fc_frame *fp,
goto done;
mac = fr_cb(fp)->granted_mac;
- if (is_zero_ether_addr(mac)) {
+ if (eth_addr_zero(mac)) {
op = fc_frame_payload_op(fp);
if (lport->vport) {
if (op == ELS_LS_RJT) {
@@ -872,7 +872,7 @@ static void bnx2fc_flogi_resp(struct fc_seq *seq, struct fc_frame *fp,
}
fcoe_ctlr_recv_flogi(fip, lport, fp);
}
- if (!is_zero_ether_addr(mac))
+ if (!eth_addr_zero(mac))
fip->update_mac(lport, mac);
done:
fc_lport_flogi_resp(seq, fp, lport);
diff --git a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
index e055865..e888418 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c
@@ -1216,7 +1216,7 @@ static int bnx2fc_interface_setup(struct bnx2fc_interface *interface)
ha->addr[4], ha->addr[5]);
if ((ha->type == NETDEV_HW_ADDR_T_SAN) &&
- (is_valid_ether_addr(ha->addr))) {
+ (eth_addr_valid(ha->addr))) {
memcpy(ctlr->ctl_src_addr, ha->addr,
ETH_ALEN);
sel_san_mac = 1;
diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 666b7ac..876b99c 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -328,7 +328,7 @@ static int fcoe_interface_setup(struct fcoe_interface *fcoe,
rcu_read_lock();
for_each_dev_addr(real_dev, ha) {
if ((ha->type == NETDEV_HW_ADDR_T_SAN) &&
- (is_valid_ether_addr(ha->addr))) {
+ (eth_addr_valid(ha->addr))) {
memcpy(fip->ctl_src_addr, ha->addr, ETH_ALEN);
fip->spma = 1;
break;
@@ -563,9 +563,9 @@ static void fcoe_update_src_mac(struct fc_lport *lport, u8 *addr)
struct fcoe_port *port = lport_priv(lport);
struct fcoe_interface *fcoe = port->priv;
- if (!is_zero_ether_addr(port->data_src_addr))
+ if (!eth_addr_zero(port->data_src_addr))
dev_uc_del(fcoe->netdev, port->data_src_addr);
- if (!is_zero_ether_addr(addr))
+ if (!eth_addr_zero(addr))
dev_uc_add(fcoe->netdev, addr);
memcpy(port->data_src_addr, addr, ETH_ALEN);
}
@@ -980,7 +980,7 @@ static void fcoe_if_destroy(struct fc_lport *lport)
fcoe_clean_pending_queue(lport);
rtnl_lock();
- if (!is_zero_ether_addr(port->data_src_addr))
+ if (!eth_addr_zero(port->data_src_addr))
dev_uc_del(netdev, port->data_src_addr);
if (lport->vport)
synchronize_net();
@@ -2587,9 +2587,9 @@ static void fcoe_flogi_resp(struct fc_seq *seq, struct fc_frame *fp, void *arg)
mac = fr_cb(fp)->granted_mac;
/* pre-FIP */
- if (is_zero_ether_addr(mac))
+ if (eth_addr_zero(mac))
fcoe_ctlr_recv_flogi(fip, lport, fp);
- if (!is_zero_ether_addr(mac))
+ if (!eth_addr_zero(mac))
fcoe_update_src_mac(lport, mac);
done:
fc_lport_flogi_resp(seq, fp, lport);
diff --git a/drivers/scsi/fcoe/fcoe_ctlr.c b/drivers/scsi/fcoe/fcoe_ctlr.c
index 2ebe03a..5f230a0 100644
--- a/drivers/scsi/fcoe/fcoe_ctlr.c
+++ b/drivers/scsi/fcoe/fcoe_ctlr.c
@@ -302,7 +302,7 @@ static void fcoe_ctlr_announce(struct fcoe_ctlr *fip)
if (sel && !compare_ether_addr(sel->fcf_mac, fip->dest_addr))
goto unlock;
- if (!is_zero_ether_addr(fip->dest_addr)) {
+ if (!eth_addr_zero(fip->dest_addr)) {
printk(KERN_NOTICE "libfcoe: host%d: "
"FIP Fibre-Channel Forwarder MAC %pM deselected\n",
fip->lp->host->host_no, fip->dest_addr);
@@ -907,7 +907,7 @@ static int fcoe_ctlr_parse_adv(struct fcoe_ctlr *fip,
((struct fip_mac_desc *)desc)->fd_mac,
ETH_ALEN);
memcpy(fcf->fcoe_mac, fcf->fcf_mac, ETH_ALEN);
- if (!is_valid_ether_addr(fcf->fcf_mac)) {
+ if (!eth_addr_valid(fcf->fcf_mac)) {
LIBFCOE_FIP_DBG(fip,
"Invalid MAC addr %pM in FIP adv\n",
fcf->fcf_mac);
@@ -1212,7 +1212,7 @@ static void fcoe_ctlr_recv_els(struct fcoe_ctlr *fip, struct sk_buff *skb)
if ((els_dtype == FIP_DT_FLOGI || els_dtype == FIP_DT_FDISC) &&
sub == FIP_SC_REP && fip->mode != FIP_MODE_VN2VN) {
if (els_op == ELS_LS_ACC) {
- if (!is_valid_ether_addr(granted_mac)) {
+ if (!eth_addr_valid(granted_mac)) {
LIBFCOE_FIP_DBG(fip,
"Invalid MAC address %pM in FIP ELS\n",
granted_mac);
@@ -2252,7 +2252,7 @@ static int fcoe_ctlr_vn_parse(struct fcoe_ctlr *fip,
if (dlen != sizeof(struct fip_mac_desc))
goto len_err;
macd = (struct fip_mac_desc *)desc;
- if (!is_valid_ether_addr(macd->fd_mac)) {
+ if (!eth_addr_valid(macd->fd_mac)) {
LIBFCOE_FIP_DBG(fip,
"Invalid MAC addr %pM in FIP VN2VN\n",
macd->fd_mac);
diff --git a/drivers/scsi/fnic/fnic_fcs.c b/drivers/scsi/fnic/fnic_fcs.c
index 3c53c34..792df19 100644
--- a/drivers/scsi/fnic/fnic_fcs.c
+++ b/drivers/scsi/fnic/fnic_fcs.c
@@ -190,12 +190,12 @@ void fnic_update_mac_locked(struct fnic *fnic, u8 *new)
u8 *ctl = fnic->ctlr.ctl_src_addr;
u8 *data = fnic->data_src_addr;
- if (is_zero_ether_addr(new))
+ if (eth_addr_zero(new))
new = ctl;
if (!compare_ether_addr(data, new))
return;
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, "update_mac %pM\n", new);
- if (!is_zero_ether_addr(data) && compare_ether_addr(data, ctl))
+ if (!eth_addr_zero(data) && compare_ether_addr(data, ctl))
vnic_dev_del_addr(fnic->vdev, data);
memcpy(data, new, ETH_ALEN);
if (compare_ether_addr(new, ctl))
@@ -251,7 +251,7 @@ void fnic_set_port_id(struct fc_lport *lport, u32 port_id, struct fc_frame *fp)
if (fp) {
mac = fr_cb(fp)->granted_mac;
- if (is_zero_ether_addr(mac)) {
+ if (eth_addr_zero(mac)) {
/* non-FIP - FLOGI already accepted - ignore return */
fcoe_ctlr_recv_flogi(&fnic->ctlr, lport, fp);
}
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 09/21] of: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (7 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 08/21] scsi: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 10/21] s390: " Joe Perches
` (13 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/of/of_net.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c
index ffab033..452dcf6 100644
--- a/drivers/of/of_net.c
+++ b/drivers/of/of_net.c
@@ -78,15 +78,15 @@ const void *of_get_mac_address(struct device_node *np)
struct property *pp;
pp = of_find_property(np, "mac-address", NULL);
- if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
+ if (pp && (pp->length == 6) && eth_addr_valid(pp->value))
return pp->value;
pp = of_find_property(np, "local-mac-address", NULL);
- if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
+ if (pp && (pp->length == 6) && eth_addr_valid(pp->value))
return pp->value;
pp = of_find_property(np, "address", NULL);
- if (pp && (pp->length == 6) && is_valid_ether_addr(pp->value))
+ if (pp && (pp->length == 6) && eth_addr_valid(pp->value))
return pp->value;
return NULL;
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 10/21] s390: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (8 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 09/21] of: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 11/21] usb: " Joe Perches
` (12 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/s390/net/qeth_l2_main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index e67e025..58324dc 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -227,9 +227,9 @@ static inline int qeth_l2_get_cast_type(struct qeth_card *card,
{
if (card->info.type == QETH_CARD_TYPE_OSN)
return RTN_UNSPEC;
- if (is_broadcast_ether_addr(skb->data))
+ if (eth_addr_broadcast(skb->data))
return RTN_BROADCAST;
- if (is_multicast_ether_addr(skb->data))
+ if (eth_addr_multicast(skb->data))
return RTN_MULTICAST;
return RTN_UNSPEC;
}
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 11/21] usb: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (9 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 10/21] s390: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 12/21] uwb: " Joe Perches
` (11 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/usb/gadget/u_ether.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index 6458764..d6a5577 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -510,13 +510,13 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
if (!is_promisc(cdc_filter)) {
u8 *dest = skb->data;
- if (is_multicast_ether_addr(dest)) {
+ if (eth_addr_multicast(dest)) {
u16 type;
/* ignores USB_CDC_PACKET_TYPE_MULTICAST and host
* SET_ETHERNET_MULTICAST_FILTERS requests
*/
- if (is_broadcast_ether_addr(dest))
+ if (eth_addr_broadcast(dest))
type = USB_CDC_PACKET_TYPE_BROADCAST;
else
type = USB_CDC_PACKET_TYPE_ALL_MULTICAST;
@@ -721,7 +721,7 @@ static int get_ether_addr(const char *str, u8 *dev_addr)
num |= hex_to_bin(*str++);
dev_addr [i] = num;
}
- if (is_valid_ether_addr(dev_addr))
+ if (eth_addr_valid(dev_addr))
return 0;
}
eth_random_addr(dev_addr);
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 12/21] uwb: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (10 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 11/21] usb: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 13/21] Documentation: networking: " Joe Perches
` (10 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/uwb/address.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/uwb/address.c b/drivers/uwb/address.c
index 8739c4f..ba4e4cf 100644
--- a/drivers/uwb/address.c
+++ b/drivers/uwb/address.c
@@ -343,7 +343,7 @@ static ssize_t uwb_rc_mac_addr_store(struct device *dev,
result = -EINVAL;
goto out;
}
- if (is_multicast_ether_addr(addr.data)) {
+ if (eth_addr_multicast(addr.data)) {
dev_err(&rc->uwb_dev.dev, "refusing to set multicast "
"MAC address %s\n", buf);
result = -EINVAL;
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 13/21] Documentation: networking: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (11 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 12/21] uwb: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 14/21] llc_if.h: " Joe Perches
` (9 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
Documentation/networking/driver.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Documentation/networking/driver.txt b/Documentation/networking/driver.txt
index da59e28..4db39f4 100644
--- a/Documentation/networking/driver.txt
+++ b/Documentation/networking/driver.txt
@@ -80,7 +80,7 @@ Probing guidelines:
1) Any hardware layer address you obtain for your device should
be verified. For example, for ethernet check it with
- linux/etherdevice.h:is_valid_ether_addr()
+ linux/etherdevice.h:eth_addr_valid()
Close/stop guidelines:
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 14/21] llc_if.h: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (12 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 13/21] Documentation: networking: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:14 ` [PATCH net-next 15/21] in.h: Rename ipv4_is_<foo> functions to ipv4_addr_<foo> Joe Perches
` (8 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Convert the old ether_addr tests to eth_addr_<foo>.
Adds api consistency.
Signed-off-by: Joe Perches <joe@perches.com>
---
include/net/llc_if.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/llc_if.h b/include/net/llc_if.h
index b595a00..cce2942 100644
--- a/include/net/llc_if.h
+++ b/include/net/llc_if.h
@@ -71,12 +71,12 @@
*/
static inline int llc_mac_null(const u8 *mac)
{
- return is_zero_ether_addr(mac);
+ return eth_addr_zero(mac);
}
static inline int llc_mac_multicast(const u8 *mac)
{
- return is_multicast_ether_addr(mac);
+ return eth_addr_multicast(mac);
}
/**
* llc_mac_match - determines if two mac addresses are the same
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 15/21] in.h: Rename ipv4_is_<foo> functions to ipv4_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (13 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 14/21] llc_if.h: " Joe Perches
@ 2012-10-19 4:14 ` Joe Perches
2012-10-19 4:15 ` [PATCH net-next 16/21] net: Convert ipv4_is_<foo> uses " Joe Perches
` (7 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:14 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Make the ipv4_is_<foo> tests use a similar style to ipv6_<foo> tests.
Add backward compatibility #defines to keep current ipv4_is_<foo>
code working until completely converted.
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/in.h | 40 ++++++++++++++++++++++++++++------------
1 files changed, 28 insertions(+), 12 deletions(-)
diff --git a/include/linux/in.h b/include/linux/in.h
index 31b4937..2116ce8 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -39,66 +39,82 @@ static inline int proto_ports_offset(int proto)
}
}
-static inline bool ipv4_is_loopback(__be32 addr)
+static inline bool ipv4_addr_loopback(__be32 addr)
{
return (addr & htonl(0xff000000)) == htonl(0x7f000000);
}
-static inline bool ipv4_is_multicast(__be32 addr)
+static inline bool ipv4_addr_multicast(__be32 addr)
{
return (addr & htonl(0xf0000000)) == htonl(0xe0000000);
}
-static inline bool ipv4_is_local_multicast(__be32 addr)
+static inline bool ipv4_addr_local_multicast(__be32 addr)
{
return (addr & htonl(0xffffff00)) == htonl(0xe0000000);
}
-static inline bool ipv4_is_lbcast(__be32 addr)
+static inline bool ipv4_addr_lbcast(__be32 addr)
{
/* limited broadcast */
return addr == htonl(INADDR_BROADCAST);
}
-static inline bool ipv4_is_zeronet(__be32 addr)
+static inline bool ipv4_addr_zeronet(__be32 addr)
{
return (addr & htonl(0xff000000)) == htonl(0x00000000);
}
/* Special-Use IPv4 Addresses (RFC3330) */
-static inline bool ipv4_is_private_10(__be32 addr)
+static inline bool ipv4_addr_private_10(__be32 addr)
{
return (addr & htonl(0xff000000)) == htonl(0x0a000000);
}
-static inline bool ipv4_is_private_172(__be32 addr)
+static inline bool ipv4_addr_private_172(__be32 addr)
{
return (addr & htonl(0xfff00000)) == htonl(0xac100000);
}
-static inline bool ipv4_is_private_192(__be32 addr)
+static inline bool ipv4_addr_private_192(__be32 addr)
{
return (addr & htonl(0xffff0000)) == htonl(0xc0a80000);
}
-static inline bool ipv4_is_linklocal_169(__be32 addr)
+static inline bool ipv4_addr_linklocal_169(__be32 addr)
{
return (addr & htonl(0xffff0000)) == htonl(0xa9fe0000);
}
-static inline bool ipv4_is_anycast_6to4(__be32 addr)
+static inline bool ipv4_addr_anycast_6to4(__be32 addr)
{
return (addr & htonl(0xffffff00)) == htonl(0xc0586300);
}
-static inline bool ipv4_is_test_192(__be32 addr)
+static inline bool ipv4_addr_test_192(__be32 addr)
{
return (addr & htonl(0xffffff00)) == htonl(0xc0000200);
}
-static inline bool ipv4_is_test_198(__be32 addr)
+static inline bool ipv4_addr_test_198(__be32 addr)
{
return (addr & htonl(0xfffe0000)) == htonl(0xc6120000);
}
+
+/* Some #defines to make old ipv4_is_<foo> tests work for awhile */
+
+#define ipv4_is_loopback(addr) ipv4_addr_loopback(addr)
+#define ipv4_is_multicast(addr) ipv4_addr_multicast(addr)
+#define ipv4_is_local_multicast(addr) ipv4_addr_local_multicast(addr)
+#define ipv4_is_lbcast(addr) ipv4_addr_lbcast(addr)
+#define ipv4_is_zeronet(addr) ipv4_addr_zeronet(addr)
+#define ipv4_is_private_10(addr) ipv4_addr_private_10(addr)
+#define ipv4_is_private_172(addr) ipv4_addr_private_172(addr)
+#define ipv4_is_private_192(addr) ipv4_addr_private_192(addr)
+#define ipv4_is_linklocal_169(addr) ipv4_addr_linklocal_169(addr)
+#define ipv4_is_anycast_6to4(addr) ipv4_addr_anycast_6to4(addr)
+#define ipv4_is_test_192(addr) ipv4_addr_test_192(addr)
+#define ipv4_is_test_198(addr) ipv4_addr_test_198(addr)
+
#endif /* _LINUX_IN_H */
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 16/21] net: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (14 preceding siblings ...)
2012-10-19 4:14 ` [PATCH net-next 15/21] in.h: Rename ipv4_is_<foo> functions to ipv4_addr_<foo> Joe Perches
@ 2012-10-19 4:15 ` Joe Perches
2012-10-19 4:15 ` [PATCH net-next 17/21] infiniband: " Joe Perches
` (6 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:15 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Use the new ipv4_addr_<foo> functions to be consistent with
the ipv6_addr_<foo> and eth_addr_<foo> style.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/bridge/br_multicast.c | 4 +-
net/core/netpoll.c | 2 +-
net/core/pktgen.c | 10 +++---
net/ipv4/arp.c | 4 +-
net/ipv4/datagram.c | 2 +-
net/ipv4/devinet.c | 4 +-
net/ipv4/fib_frontend.c | 12 ++++----
net/ipv4/igmp.c | 12 ++++----
net/ipv4/ip_gre.c | 20 ++++++------
net/ipv4/ipmr.c | 4 +-
net/ipv4/netfilter/ipt_rpfilter.c | 10 +++---
net/ipv4/ping.c | 2 +-
net/ipv4/raw.c | 2 +-
net/ipv4/route.c | 58 ++++++++++++++++++------------------
net/ipv4/udp.c | 2 +-
net/ipv6/addrconf.c | 12 ++++----
net/l2tp/l2tp_ip.c | 2 +-
net/l2tp/l2tp_ip6.c | 2 +-
net/netfilter/ipvs/ip_vs_xmit.c | 6 ++--
net/netfilter/xt_cluster.c | 2 +-
net/netfilter/xt_pkttype.c | 2 +-
net/sctp/protocol.c | 10 +++---
22 files changed, 92 insertions(+), 92 deletions(-)
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 2417434..1a58375 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -696,7 +696,7 @@ static int br_ip4_multicast_add_group(struct net_bridge *br,
{
struct br_ip br_group;
- if (ipv4_is_local_multicast(group))
+ if (ipv4_addr_local_multicast(group))
return 0;
br_group.u.ip4 = group;
@@ -1266,7 +1266,7 @@ static void br_ip4_multicast_leave_group(struct net_bridge *br,
{
struct br_ip br_group;
- if (ipv4_is_local_multicast(group))
+ if (ipv4_addr_local_multicast(group))
return;
br_group.u.ip4 = group;
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 77a0388..7a84b2a 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -495,7 +495,7 @@ static void netpoll_arp_reply(struct sk_buff *skb, struct netpoll_info *npinfo)
memcpy(&tip, arp_ptr, 4);
/* Should we ignore arp? */
- if (ipv4_is_loopback(tip) || ipv4_is_multicast(tip))
+ if (ipv4_addr_loopback(tip) || ipv4_addr_multicast(tip))
return;
size = arp_hdr_len(skb->dev);
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 3422af7..8327f05 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2396,11 +2396,11 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
t = random32() % (imx - imn) + imn;
s = htonl(t);
- while (ipv4_is_loopback(s) ||
- ipv4_is_multicast(s) ||
- ipv4_is_lbcast(s) ||
- ipv4_is_zeronet(s) ||
- ipv4_is_local_multicast(s)) {
+ while (ipv4_addr_loopback(s) ||
+ ipv4_addr_multicast(s) ||
+ ipv4_addr_lbcast(s) ||
+ ipv4_addr_zeronet(s) ||
+ ipv4_addr_local_multicast(s)) {
t = random32() % (imx - imn) + imn;
s = htonl(t);
}
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 4780045..b03e5e4 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -789,8 +789,8 @@ static int arp_process(struct sk_buff *skb)
* Check for bad requests for 127.x.x.x and requests for multicast
* addresses. If this is one such, delete it.
*/
- if (ipv4_is_multicast(tip) ||
- (!IN_DEV_ROUTE_LOCALNET(in_dev) && ipv4_is_loopback(tip)))
+ if (ipv4_addr_multicast(tip) ||
+ (!IN_DEV_ROUTE_LOCALNET(in_dev) && ipv4_addr_loopback(tip)))
goto out;
/*
diff --git a/net/ipv4/datagram.c b/net/ipv4/datagram.c
index 424fafb..83b51ad 100644
--- a/net/ipv4/datagram.c
+++ b/net/ipv4/datagram.c
@@ -43,7 +43,7 @@ int ip4_datagram_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
oif = sk->sk_bound_dev_if;
saddr = inet->inet_saddr;
- if (ipv4_is_multicast(usin->sin_addr.s_addr)) {
+ if (ipv4_addr_multicast(usin->sin_addr.s_addr)) {
if (!oif)
oif = inet->mc_index;
if (!saddr)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 2a6abc1..f217d83 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -491,7 +491,7 @@ static int inet_set_ifa(struct net_device *dev, struct in_ifaddr *ifa)
in_dev_hold(in_dev);
ifa->ifa_dev = in_dev;
}
- if (ipv4_is_loopback(ifa->ifa_local))
+ if (ipv4_addr_loopback(ifa->ifa_local))
ifa->ifa_scope = RT_SCOPE_HOST;
return inet_insert_ifa(ifa);
}
@@ -660,7 +660,7 @@ static int inet_abc_len(__be32 addr)
{
int rc = -1; /* Something else, probably a multicast. */
- if (ipv4_is_zeronet(addr))
+ if (ipv4_addr_zeronet(addr))
rc = 0;
else {
__u32 haddr = ntohl(addr);
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
index 825c608..9883d33 100644
--- a/net/ipv4/fib_frontend.c
+++ b/net/ipv4/fib_frontend.c
@@ -164,9 +164,9 @@ static inline unsigned int __inet_dev_addr_type(struct net *net,
unsigned int ret = RTN_BROADCAST;
struct fib_table *local_table;
- if (ipv4_is_zeronet(addr) || ipv4_is_lbcast(addr))
+ if (ipv4_addr_zeronet(addr) || ipv4_addr_lbcast(addr))
return RTN_BROADCAST;
- if (ipv4_is_multicast(addr))
+ if (ipv4_addr_multicast(addr))
return RTN_MULTICAST;
local_table = fib_get_table(net, RT_TABLE_LOCAL);
@@ -216,7 +216,7 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb)
net = dev_net(dev);
scope = RT_SCOPE_UNIVERSE;
- if (!ipv4_is_zeronet(ip_hdr(skb)->saddr)) {
+ if (!ipv4_addr_zeronet(ip_hdr(skb)->saddr)) {
fl4.flowi4_oif = 0;
fl4.flowi4_iif = LOOPBACK_IFINDEX;
fl4.daddr = ip_hdr(skb)->saddr;
@@ -760,7 +760,7 @@ void fib_add_ifaddr(struct in_ifaddr *ifa)
if (ifa->ifa_broadcast && ifa->ifa_broadcast != htonl(0xFFFFFFFF))
fib_magic(RTM_NEWROUTE, RTN_BROADCAST, ifa->ifa_broadcast, 32, prim);
- if (!ipv4_is_zeronet(prefix) && !(ifa->ifa_flags & IFA_F_SECONDARY) &&
+ if (!ipv4_addr_zeronet(prefix) && !(ifa->ifa_flags & IFA_F_SECONDARY) &&
(prefix != addr || ifa->ifa_prefixlen < 32)) {
fib_magic(RTM_NEWROUTE,
dev->flags & IFF_LOOPBACK ? RTN_LOCAL : RTN_UNICAST,
@@ -807,7 +807,7 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim)
pr_warn("%s: bug: iprim != prim\n", __func__);
return;
}
- } else if (!ipv4_is_zeronet(any) &&
+ } else if (!ipv4_addr_zeronet(any) &&
(any != ifa->ifa_local || ifa->ifa_prefixlen < 32)) {
fib_magic(RTM_DELROUTE,
dev->flags & IFF_LOOPBACK ? RTN_LOCAL : RTN_UNICAST,
@@ -878,7 +878,7 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim)
__be32 brd1 = ifa1->ifa_address | ~ifa1->ifa_mask;
__be32 any1 = ifa1->ifa_address & ifa1->ifa_mask;
- if (!ipv4_is_zeronet(any1)) {
+ if (!ipv4_addr_zeronet(any1)) {
if (ifa->ifa_broadcast == brd1 ||
ifa->ifa_broadcast == any1)
ok |= BRD_OK;
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 736ab70..dc9a9b3 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -1796,7 +1796,7 @@ int ip_mc_join_group(struct sock *sk , struct ip_mreqn *imr)
int ifindex;
int count = 0;
- if (!ipv4_is_multicast(addr))
+ if (!ipv4_addr_multicast(addr))
return -EINVAL;
rtnl_lock();
@@ -1920,7 +1920,7 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
int leavegroup = 0;
int i, j, rv;
- if (!ipv4_is_multicast(addr))
+ if (!ipv4_addr_multicast(addr))
return -EINVAL;
rtnl_lock();
@@ -2055,7 +2055,7 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex)
struct net *net = sock_net(sk);
int leavegroup = 0;
- if (!ipv4_is_multicast(addr))
+ if (!ipv4_addr_multicast(addr))
return -EINVAL;
if (msf->imsf_fmode != MCAST_INCLUDE &&
msf->imsf_fmode != MCAST_EXCLUDE)
@@ -2141,7 +2141,7 @@ int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
struct ip_sf_socklist *psl;
struct net *net = sock_net(sk);
- if (!ipv4_is_multicast(addr))
+ if (!ipv4_addr_multicast(addr))
return -EINVAL;
rtnl_lock();
@@ -2203,7 +2203,7 @@ int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
if (psin->sin_family != AF_INET)
return -EINVAL;
addr = psin->sin_addr.s_addr;
- if (!ipv4_is_multicast(addr))
+ if (!ipv4_addr_multicast(addr))
return -EINVAL;
rtnl_lock();
@@ -2255,7 +2255,7 @@ int ip_mc_sf_allow(struct sock *sk, __be32 loc_addr, __be32 rmt_addr, int dif)
int ret;
ret = 1;
- if (!ipv4_is_multicast(loc_addr))
+ if (!ipv4_addr_multicast(loc_addr))
goto out;
rcu_read_lock();
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index dd94879..4c9ef98 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -306,7 +306,7 @@ static struct ip_tunnel *ipgre_tunnel_lookup(struct net_device *dev,
for_each_ip_tunnel_rcu(ign->tunnels_l[h1]) {
if ((local != t->parms.iph.saddr &&
(local != t->parms.iph.daddr ||
- !ipv4_is_multicast(local))) ||
+ !ipv4_addr_multicast(local))) ||
!(t->dev->flags & IFF_UP))
continue;
@@ -375,7 +375,7 @@ static struct ip_tunnel __rcu **__ipgre_bucket(struct ipgre_net *ign,
if (local)
prio |= 1;
- if (remote && !ipv4_is_multicast(remote)) {
+ if (remote && !ipv4_addr_multicast(remote)) {
prio |= 2;
h ^= HASH(remote);
}
@@ -580,7 +580,7 @@ static void ipgre_err(struct sk_buff *skb, u32 info)
return;
}
if (t->parms.iph.daddr == 0 ||
- ipv4_is_multicast(t->parms.iph.daddr))
+ ipv4_addr_multicast(t->parms.iph.daddr))
return;
if (t->parms.iph.ttl == 0 && type == ICMP_TIME_EXCEEDED)
@@ -681,7 +681,7 @@ static int ipgre_rcv(struct sk_buff *skb)
skb_postpull_rcsum(skb, skb_transport_header(skb), offset);
skb->pkt_type = PACKET_HOST;
#ifdef CONFIG_NET_IPGRE_BROADCAST
- if (ipv4_is_multicast(iph->daddr)) {
+ if (ipv4_addr_multicast(iph->daddr)) {
/* Looped back packet, drop it! */
if (rt_is_output_route(skb_rtable(skb)))
goto drop;
@@ -877,7 +877,7 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
if (rt6 && mtu < dst_mtu(skb_dst(skb)) && mtu >= IPV6_MIN_MTU) {
if ((tunnel->parms.iph.daddr &&
- !ipv4_is_multicast(tunnel->parms.iph.daddr)) ||
+ !ipv4_addr_multicast(tunnel->parms.iph.daddr)) ||
rt6->rt6i_dst.plen == 128) {
rt6->rt6i_flags |= RTF_MODIFIED;
dst_metric_set(skb_dst(skb), RTAX_MTU, mtu);
@@ -1115,7 +1115,7 @@ ipgre_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
t = netdev_priv(dev);
- if (ipv4_is_multicast(p.iph.daddr))
+ if (ipv4_addr_multicast(p.iph.daddr))
nflags = IFF_BROADCAST;
else if (p.iph.daddr)
nflags = IFF_POINTOPOINT;
@@ -1266,7 +1266,7 @@ static int ipgre_open(struct net_device *dev)
{
struct ip_tunnel *t = netdev_priv(dev);
- if (ipv4_is_multicast(t->parms.iph.daddr)) {
+ if (ipv4_addr_multicast(t->parms.iph.daddr)) {
struct flowi4 fl4;
struct rtable *rt;
@@ -1292,7 +1292,7 @@ static int ipgre_close(struct net_device *dev)
{
struct ip_tunnel *t = netdev_priv(dev);
- if (ipv4_is_multicast(t->parms.iph.daddr) && t->mlink) {
+ if (ipv4_addr_multicast(t->parms.iph.daddr) && t->mlink) {
struct in_device *in_dev;
in_dev = inetdev_by_index(dev_net(dev), t->mlink);
if (in_dev)
@@ -1365,7 +1365,7 @@ static int ipgre_tunnel_init(struct net_device *dev)
if (iph->daddr) {
#ifdef CONFIG_NET_IPGRE_BROADCAST
- if (ipv4_is_multicast(iph->daddr)) {
+ if (ipv4_addr_multicast(iph->daddr)) {
if (!iph->saddr)
return -EINVAL;
dev->flags = IFF_BROADCAST;
@@ -1663,7 +1663,7 @@ static int ipgre_changelink(struct net_device *dev, struct nlattr *tb[],
if (dev->type != ARPHRD_ETHER) {
unsigned int nflags = 0;
- if (ipv4_is_multicast(p.iph.daddr))
+ if (ipv4_addr_multicast(p.iph.daddr))
nflags = IFF_BROADCAST;
else if (p.iph.daddr)
nflags = IFF_POINTOPOINT;
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c
index 6168c4d..99d7ed2 100644
--- a/net/ipv4/ipmr.c
+++ b/net/ipv4/ipmr.c
@@ -1092,7 +1092,7 @@ static int ipmr_mfc_add(struct net *net, struct mr_table *mrt,
return 0;
}
- if (!ipv4_is_multicast(mfc->mfcc_mcastgrp.s_addr))
+ if (!ipv4_addr_multicast(mfc->mfcc_mcastgrp.s_addr))
return -EINVAL;
c = ipmr_cache_alloc();
@@ -1927,7 +1927,7 @@ static int __pim_rcv(struct mr_table *mrt, struct sk_buff *skb,
* b. packet is not a NULL-REGISTER
* c. packet is not truncated
*/
- if (!ipv4_is_multicast(encap->daddr) ||
+ if (!ipv4_addr_multicast(encap->daddr) ||
encap->tot_len == 0 ||
ntohs(encap->tot_len) + pimlen > skb->len)
return 1;
diff --git a/net/ipv4/netfilter/ipt_rpfilter.c b/net/ipv4/netfilter/ipt_rpfilter.c
index c301300..86ae272 100644
--- a/net/ipv4/netfilter/ipt_rpfilter.c
+++ b/net/ipv4/netfilter/ipt_rpfilter.c
@@ -26,8 +26,8 @@ MODULE_DESCRIPTION("iptables: ipv4 reverse path filter match");
/* don't try to find route from mcast/bcast/zeronet */
static __be32 rpfilter_get_saddr(__be32 addr)
{
- if (ipv4_is_multicast(addr) || ipv4_is_lbcast(addr) ||
- ipv4_is_zeronet(addr))
+ if (ipv4_addr_multicast(addr) || ipv4_addr_lbcast(addr) ||
+ ipv4_addr_zeronet(addr))
return 0;
return addr;
}
@@ -80,9 +80,9 @@ static bool rpfilter_mt(const struct sk_buff *skb, struct xt_action_param *par)
return true ^ invert;
iph = ip_hdr(skb);
- if (ipv4_is_multicast(iph->daddr)) {
- if (ipv4_is_zeronet(iph->saddr))
- return ipv4_is_local_multicast(iph->daddr) ^ invert;
+ if (ipv4_addr_multicast(iph->daddr)) {
+ if (ipv4_addr_zeronet(iph->saddr))
+ return ipv4_addr_local_multicast(iph->daddr) ^ invert;
flow.flowi4_iif = 0;
} else {
flow.flowi4_iif = LOOPBACK_IFINDEX;
diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c
index 8f3d054..68adc89 100644
--- a/net/ipv4/ping.c
+++ b/net/ipv4/ping.c
@@ -553,7 +553,7 @@ static int ping_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
tos |= RTO_ONLINK;
}
- if (ipv4_is_multicast(daddr)) {
+ if (ipv4_addr_multicast(daddr)) {
if (!ipc.oif)
ipc.oif = inet->mc_index;
if (!saddr)
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 73d1e4d..4116bf3 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -562,7 +562,7 @@ static int raw_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
if (msg->msg_flags & MSG_DONTROUTE)
tos |= RTO_ONLINK;
- if (ipv4_is_multicast(daddr)) {
+ if (ipv4_addr_multicast(daddr)) {
if (!ipc.oif)
ipc.oif = inet->mc_index;
if (!saddr)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index a8c6512..263dfd8 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -688,8 +688,8 @@ static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flow
net = dev_net(dev);
if (new_gw == old_gw || !IN_DEV_RX_REDIRECTS(in_dev) ||
- ipv4_is_multicast(new_gw) || ipv4_is_lbcast(new_gw) ||
- ipv4_is_zeronet(new_gw))
+ ipv4_addr_multicast(new_gw) || ipv4_addr_lbcast(new_gw) ||
+ ipv4_addr_zeronet(new_gw))
goto reject_redirect;
if (!IN_DEV_SHARED_MEDIA(in_dev)) {
@@ -1332,16 +1332,16 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (in_dev == NULL)
return -EINVAL;
- if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr) ||
+ if (ipv4_addr_multicast(saddr) || ipv4_addr_lbcast(saddr) ||
skb->protocol != htons(ETH_P_IP))
goto e_inval;
if (likely(!IN_DEV_ROUTE_LOCALNET(in_dev)))
- if (ipv4_is_loopback(saddr))
+ if (ipv4_addr_loopback(saddr))
goto e_inval;
- if (ipv4_is_zeronet(saddr)) {
- if (!ipv4_is_local_multicast(daddr))
+ if (ipv4_addr_zeronet(saddr)) {
+ if (!ipv4_addr_local_multicast(daddr))
goto e_inval;
} else {
err = fib_validate_source(skb, saddr, 0, tos, 0, dev,
@@ -1374,7 +1374,7 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
}
#ifdef CONFIG_IP_MROUTE
- if (!ipv4_is_local_multicast(daddr) && IN_DEV_MFORWARD(in_dev))
+ if (!ipv4_addr_local_multicast(daddr) && IN_DEV_MFORWARD(in_dev))
rth->dst.input = ip_mr_input;
#endif
RT_CACHE_STAT_INC(in_slow_mc);
@@ -1553,29 +1553,29 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
by fib_lookup.
*/
- if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr))
+ if (ipv4_addr_multicast(saddr) || ipv4_addr_lbcast(saddr))
goto martian_source;
res.fi = NULL;
- if (ipv4_is_lbcast(daddr) || (saddr == 0 && daddr == 0))
+ if (ipv4_addr_lbcast(daddr) || (saddr == 0 && daddr == 0))
goto brd_input;
/* Accept zero addresses only to limited broadcast;
* I even do not know to fix it or not. Waiting for complains :-)
*/
- if (ipv4_is_zeronet(saddr))
+ if (ipv4_addr_zeronet(saddr))
goto martian_source;
- if (ipv4_is_zeronet(daddr))
+ if (ipv4_addr_zeronet(daddr))
goto martian_destination;
/* Following code try to avoid calling IN_DEV_NET_ROUTE_LOCALNET(),
* and call it once if daddr or/and saddr are loopback addresses
*/
- if (ipv4_is_loopback(daddr)) {
+ if (ipv4_addr_loopback(daddr)) {
if (!IN_DEV_NET_ROUTE_LOCALNET(in_dev, net))
goto martian_destination;
- } else if (ipv4_is_loopback(saddr)) {
+ } else if (ipv4_addr_loopback(saddr)) {
if (!IN_DEV_NET_ROUTE_LOCALNET(in_dev, net))
goto martian_source;
}
@@ -1620,7 +1620,7 @@ brd_input:
if (skb->protocol != htons(ETH_P_IP))
goto e_inval;
- if (!ipv4_is_zeronet(saddr)) {
+ if (!ipv4_addr_zeronet(saddr)) {
err = fib_validate_source(skb, saddr, 0, tos, 0, dev,
in_dev, &itag);
if (err < 0)
@@ -1726,7 +1726,7 @@ int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr,
Note, that multicast routers are not affected, because
route cache entry is created eventually.
*/
- if (ipv4_is_multicast(daddr)) {
+ if (ipv4_addr_multicast(daddr)) {
struct in_device *in_dev = __in_dev_get_rcu(dev);
if (in_dev) {
@@ -1735,7 +1735,7 @@ int ip_route_input_noref(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (our
#ifdef CONFIG_IP_MROUTE
||
- (!ipv4_is_local_multicast(daddr) &&
+ (!ipv4_addr_local_multicast(daddr) &&
IN_DEV_MFORWARD(in_dev))
#endif
) {
@@ -1772,14 +1772,14 @@ static struct rtable *__mkroute_output(const struct fib_result *res,
return ERR_PTR(-EINVAL);
if (likely(!IN_DEV_ROUTE_LOCALNET(in_dev)))
- if (ipv4_is_loopback(fl4->saddr) && !(dev_out->flags & IFF_LOOPBACK))
+ if (ipv4_addr_loopback(fl4->saddr) && !(dev_out->flags & IFF_LOOPBACK))
return ERR_PTR(-EINVAL);
- if (ipv4_is_lbcast(fl4->daddr))
+ if (ipv4_addr_lbcast(fl4->daddr))
type = RTN_BROADCAST;
- else if (ipv4_is_multicast(fl4->daddr))
+ else if (ipv4_addr_multicast(fl4->daddr))
type = RTN_MULTICAST;
- else if (ipv4_is_zeronet(fl4->daddr))
+ else if (ipv4_addr_zeronet(fl4->daddr))
return ERR_PTR(-EINVAL);
if (dev_out->flags & IFF_LOOPBACK)
@@ -1860,7 +1860,7 @@ add:
#ifdef CONFIG_IP_MROUTE
if (type == RTN_MULTICAST) {
if (IN_DEV_MFORWARD(in_dev) &&
- !ipv4_is_local_multicast(fl4->daddr)) {
+ !ipv4_addr_local_multicast(fl4->daddr)) {
rth->dst.input = ip_mr_input;
rth->dst.output = ip_mc_output;
}
@@ -1900,9 +1900,9 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
rcu_read_lock();
if (fl4->saddr) {
rth = ERR_PTR(-EINVAL);
- if (ipv4_is_multicast(fl4->saddr) ||
- ipv4_is_lbcast(fl4->saddr) ||
- ipv4_is_zeronet(fl4->saddr))
+ if (ipv4_addr_multicast(fl4->saddr) ||
+ ipv4_addr_lbcast(fl4->saddr) ||
+ ipv4_addr_zeronet(fl4->saddr))
goto out;
/* I removed check for oif == dev_out->oif here.
@@ -1914,8 +1914,8 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
*/
if (fl4->flowi4_oif == 0 &&
- (ipv4_is_multicast(fl4->daddr) ||
- ipv4_is_lbcast(fl4->daddr))) {
+ (ipv4_addr_multicast(fl4->daddr) ||
+ ipv4_addr_lbcast(fl4->daddr))) {
/* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
dev_out = __ip_dev_find(net, fl4->saddr, false);
if (dev_out == NULL)
@@ -1959,15 +1959,15 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4)
rth = ERR_PTR(-ENETUNREACH);
goto out;
}
- if (ipv4_is_local_multicast(fl4->daddr) ||
- ipv4_is_lbcast(fl4->daddr)) {
+ if (ipv4_addr_local_multicast(fl4->daddr) ||
+ ipv4_addr_lbcast(fl4->daddr)) {
if (!fl4->saddr)
fl4->saddr = inet_select_addr(dev_out, 0,
RT_SCOPE_LINK);
goto make_route;
}
if (fl4->saddr) {
- if (ipv4_is_multicast(fl4->daddr))
+ if (ipv4_addr_multicast(fl4->daddr))
fl4->saddr = inet_select_addr(dev_out, 0,
fl4->flowi4_scope);
else if (!fl4->daddr)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 79c8dbe..3d0f229 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -918,7 +918,7 @@ int udp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
connected = 0;
}
- if (ipv4_is_multicast(daddr)) {
+ if (ipv4_addr_multicast(daddr)) {
if (!ipc.oif)
ipc.oif = inet->mc_index;
if (!saddr)
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 0424e4e..190e8c3 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1535,12 +1535,12 @@ static int __ipv6_isatap_ifid(u8 *eui, __be32 addr)
{
if (addr == 0)
return -1;
- eui[0] = (ipv4_is_zeronet(addr) || ipv4_is_private_10(addr) ||
- ipv4_is_loopback(addr) || ipv4_is_linklocal_169(addr) ||
- ipv4_is_private_172(addr) || ipv4_is_test_192(addr) ||
- ipv4_is_anycast_6to4(addr) || ipv4_is_private_192(addr) ||
- ipv4_is_test_198(addr) || ipv4_is_multicast(addr) ||
- ipv4_is_lbcast(addr)) ? 0x00 : 0x02;
+ eui[0] = (ipv4_addr_zeronet(addr) || ipv4_addr_private_10(addr) ||
+ ipv4_addr_loopback(addr) || ipv4_addr_linklocal_169(addr) ||
+ ipv4_addr_private_172(addr) || ipv4_addr_test_192(addr) ||
+ ipv4_addr_anycast_6to4(addr) || ipv4_addr_private_192(addr) ||
+ ipv4_addr_test_198(addr) || ipv4_addr_multicast(addr) ||
+ ipv4_addr_lbcast(addr)) ? 0x00 : 0x02;
eui[1] = 0;
eui[2] = 0x5E;
eui[3] = 0xFE;
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index 61d8b75..823875c 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -303,7 +303,7 @@ static int l2tp_ip_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len
if (addr_len < sizeof(*lsa))
return -EINVAL;
- if (ipv4_is_multicast(lsa->l2tp_addr.s_addr))
+ if (ipv4_addr_multicast(lsa->l2tp_addr.s_addr))
return -EINVAL;
rc = ip4_datagram_connect(sk, uaddr, addr_len);
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c
index 9275471..edc8da9 100644
--- a/net/l2tp/l2tp_ip6.c
+++ b/net/l2tp/l2tp_ip6.c
@@ -371,7 +371,7 @@ static int l2tp_ip6_connect(struct sock *sk, struct sockaddr *uaddr,
if (addr_type & IPV6_ADDR_MAPPED) {
daddr = &usin->sin6_addr;
- if (ipv4_is_multicast(daddr->s6_addr32[3]))
+ if (ipv4_addr_multicast(daddr->s6_addr32[3]))
return -EINVAL;
}
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index cc4c809..aeee744 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -201,7 +201,7 @@ __ip_vs_get_out_rt(struct sk_buff *skb, struct ip_vs_dest *dest,
ip_rt_put(rt);
return NULL;
}
- if (unlikely(!local && ipv4_is_loopback(ip_hdr(skb)->saddr))) {
+ if (unlikely(!local && ipv4_addr_loopback(ip_hdr(skb)->saddr))) {
IP_VS_DBG_RL("Stopping traffic from loopback address %pI4 "
"to non-local address, dest: %pI4\n",
&ip_hdr(skb)->saddr, &daddr);
@@ -604,7 +604,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#endif
/* From world but DNAT to loopback address? */
- if (local && ipv4_is_loopback(cp->daddr.ip) &&
+ if (local && ipv4_addr_loopback(cp->daddr.ip) &&
rt_is_input_route(skb_rtable(skb))) {
IP_VS_DBG_RL_PKT(1, AF_INET, pp, skb, 0, "ip_vs_nat_xmit(): "
"stopping DNAT to loopback address");
@@ -1239,7 +1239,7 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
#endif
/* From world but DNAT to loopback address? */
- if (local && ipv4_is_loopback(cp->daddr.ip) &&
+ if (local && ipv4_addr_loopback(cp->daddr.ip) &&
rt_is_input_route(skb_rtable(skb))) {
IP_VS_DBG(1, "%s(): "
"stopping DNAT to loopback %pI4\n",
diff --git a/net/netfilter/xt_cluster.c b/net/netfilter/xt_cluster.c
index f4af1bf..266faf0 100644
--- a/net/netfilter/xt_cluster.c
+++ b/net/netfilter/xt_cluster.c
@@ -72,7 +72,7 @@ xt_cluster_is_multicast_addr(const struct sk_buff *skb, u_int8_t family)
switch(family) {
case NFPROTO_IPV4:
- is_multicast = ipv4_is_multicast(ip_hdr(skb)->daddr);
+ is_multicast = ipv4_addr_multicast(ip_hdr(skb)->daddr);
break;
case NFPROTO_IPV6:
is_multicast =
diff --git a/net/netfilter/xt_pkttype.c b/net/netfilter/xt_pkttype.c
index 5b645cb..c65c5c9 100644
--- a/net/netfilter/xt_pkttype.c
+++ b/net/netfilter/xt_pkttype.c
@@ -31,7 +31,7 @@ pkttype_mt(const struct sk_buff *skb, struct xt_action_param *par)
if (skb->pkt_type != PACKET_LOOPBACK)
type = skb->pkt_type;
else if (par->family == NFPROTO_IPV4 &&
- ipv4_is_multicast(ip_hdr(skb)->daddr))
+ ipv4_addr_multicast(ip_hdr(skb)->daddr))
type = PACKET_MULTICAST;
else if (par->family == NFPROTO_IPV6 &&
ipv6_hdr(skb)->daddr.s6_addr[0] == 0xFF)
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 2d51842..405cefc 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -406,13 +406,13 @@ static sctp_scope_t sctp_v4_scope(union sctp_addr *addr)
/* Check for unusable SCTP addresses. */
if (IS_IPV4_UNUSABLE_ADDRESS(addr->v4.sin_addr.s_addr)) {
retval = SCTP_SCOPE_UNUSABLE;
- } else if (ipv4_is_loopback(addr->v4.sin_addr.s_addr)) {
+ } else if (ipv4_addr_loopback(addr->v4.sin_addr.s_addr)) {
retval = SCTP_SCOPE_LOOPBACK;
- } else if (ipv4_is_linklocal_169(addr->v4.sin_addr.s_addr)) {
+ } else if (ipv4_addr_linklocal_169(addr->v4.sin_addr.s_addr)) {
retval = SCTP_SCOPE_LINK;
- } else if (ipv4_is_private_10(addr->v4.sin_addr.s_addr) ||
- ipv4_is_private_172(addr->v4.sin_addr.s_addr) ||
- ipv4_is_private_192(addr->v4.sin_addr.s_addr)) {
+ } else if (ipv4_addr_private_10(addr->v4.sin_addr.s_addr) ||
+ ipv4_addr_private_172(addr->v4.sin_addr.s_addr) ||
+ ipv4_addr_private_192(addr->v4.sin_addr.s_addr)) {
retval = SCTP_SCOPE_PRIVATE;
} else {
retval = SCTP_SCOPE_GLOBAL;
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 17/21] infiniband: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (15 preceding siblings ...)
2012-10-19 4:15 ` [PATCH net-next 16/21] net: Convert ipv4_is_<foo> uses " Joe Perches
@ 2012-10-19 4:15 ` Joe Perches
2012-10-19 4:15 ` [PATCH net-next 18/21] ath6kl: " Joe Perches
` (5 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:15 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Use the new ipv4_addr_<foo> functions to be consistent with
the ipv6_addr_<foo> and eth_addr_<foo> style.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/infiniband/core/cma.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c
index a7568c3..108f96f 100644
--- a/drivers/infiniband/core/cma.c
+++ b/drivers/infiniband/core/cma.c
@@ -683,7 +683,7 @@ static inline int cma_zero_addr(struct sockaddr *addr)
struct in6_addr *ip6;
if (addr->sa_family == AF_INET)
- return ipv4_is_zeronet(
+ return ipv4_addr_zeronet(
((struct sockaddr_in *)addr)->sin_addr.s_addr);
else {
ip6 = &((struct sockaddr_in6 *) addr)->sin6_addr;
@@ -695,7 +695,7 @@ static inline int cma_zero_addr(struct sockaddr *addr)
static inline int cma_loopback_addr(struct sockaddr *addr)
{
if (addr->sa_family == AF_INET)
- return ipv4_is_loopback(
+ return ipv4_addr_loopback(
((struct sockaddr_in *) addr)->sin_addr.s_addr);
else
return ipv6_addr_loopback(
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 18/21] ath6kl: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (16 preceding siblings ...)
2012-10-19 4:15 ` [PATCH net-next 17/21] infiniband: " Joe Perches
@ 2012-10-19 4:15 ` Joe Perches
2012-10-19 4:15 ` [PATCH net-next 19/21] parisc: " Joe Perches
` (4 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:15 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Use the new ipv4_addr_<foo> functions to be consistent with
the ipv6_addr_<foo> and eth_addr_<foo> style.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/wireless/ath/ath6kl/wmi.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index c30ab4b..a5624f5 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -2547,8 +2547,8 @@ int ath6kl_wmi_set_ip_cmd(struct wmi *wmi, u8 if_idx,
int ret;
/* Multicast address are not valid */
- if (ipv4_is_multicast(ips0) ||
- ipv4_is_multicast(ips1))
+ if (ipv4_addr_multicast(ips0) ||
+ ipv4_addr_multicast(ips1))
return -EINVAL;
skb = ath6kl_wmi_get_new_buf(sizeof(struct wmi_set_ip_cmd));
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 19/21] parisc: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (17 preceding siblings ...)
2012-10-19 4:15 ` [PATCH net-next 18/21] ath6kl: " Joe Perches
@ 2012-10-19 4:15 ` Joe Perches
2012-10-19 4:15 ` [PATCH net-next 20/21] lockd: " Joe Perches
` (3 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:15 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Use the new ipv4_addr_<foo> functions to be consistent with
the ipv6_addr_<foo> and eth_addr_<foo> style.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/parisc/led.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c
index f2f501e..8951fd1 100644
--- a/drivers/parisc/led.c
+++ b/drivers/parisc/led.c
@@ -369,7 +369,7 @@ static __inline__ int led_get_net_activity(void)
struct in_device *in_dev = __in_dev_get_rcu(dev);
if (!in_dev || !in_dev->ifa_list)
continue;
- if (ipv4_is_loopback(in_dev->ifa_list->ifa_local))
+ if (ipv4_addr_loopback(in_dev->ifa_list->ifa_local))
continue;
stats = dev_get_stats(dev, &temp);
rx_total += stats->rx_packets;
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 20/21] lockd: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (18 preceding siblings ...)
2012-10-19 4:15 ` [PATCH net-next 19/21] parisc: " Joe Perches
@ 2012-10-19 4:15 ` Joe Perches
2012-10-19 4:15 ` [PATCH net-next 21/21] sctp: " Joe Perches
` (2 subsequent siblings)
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:15 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Use the new ipv4_addr_<foo> functions to be consistent with
the ipv6_addr_<foo> and eth_addr_<foo> style.
Signed-off-by: Joe Perches <joe@perches.com>
---
include/linux/lockd/lockd.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index f5a051a..8fa00e0 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -301,7 +301,7 @@ static inline int __nlm_privileged_request4(const struct sockaddr *sap)
if (ntohs(sin->sin_port) > 1023)
return 0;
- return ipv4_is_loopback(sin->sin_addr.s_addr);
+ return ipv4_addr_loopback(sin->sin_addr.s_addr);
}
#if IS_ENABLED(CONFIG_IPV6)
@@ -313,7 +313,7 @@ static inline int __nlm_privileged_request6(const struct sockaddr *sap)
return 0;
if (ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_MAPPED)
- return ipv4_is_loopback(sin6->sin6_addr.s6_addr32[3]);
+ return ipv4_addr_loopback(sin6->sin6_addr.s6_addr32[3]);
return ipv6_addr_type(&sin6->sin6_addr) & IPV6_ADDR_LOOPBACK;
}
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* [PATCH net-next 21/21] sctp: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (19 preceding siblings ...)
2012-10-19 4:15 ` [PATCH net-next 20/21] lockd: " Joe Perches
@ 2012-10-19 4:15 ` Joe Perches
2012-10-19 7:04 ` [PATCH net-next 00/21] treewide: Use consistent api style for address testing Eric Dumazet
2012-10-19 7:36 ` David Miller
22 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 4:15 UTC (permalink / raw)
To: netdev; +Cc: linux-kernel
Use the new ipv4_addr_<foo> functions to be consistent with
the ipv6_addr_<foo> and eth_addr_<foo> style.
Signed-off-by: Joe Perches <joe@perches.com>
---
include/net/sctp/constants.h | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index d053d2e..31bae2f 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -365,12 +365,12 @@ typedef enum {
* Also, RFC 8.4, non-unicast addresses are not considered valid SCTP
* addresses.
*/
-#define IS_IPV4_UNUSABLE_ADDRESS(a) \
- ((htonl(INADDR_BROADCAST) == a) || \
- ipv4_is_multicast(a) || \
- ipv4_is_zeronet(a) || \
- ipv4_is_test_198(a) || \
- ipv4_is_anycast_6to4(a))
+#define IS_IPV4_UNUSABLE_ADDRESS(a) \
+ ((htonl(INADDR_BROADCAST) == a) || \
+ ipv4_addr_multicast(a) || \
+ ipv4_addr_zeronet(a) || \
+ ipv4_addr_test_198(a) || \
+ ipv4_addr_anycast_6to4(a))
/* Flags used for the bind address copy functions. */
#define SCTP_ADDR6_ALLOWED 0x00000001 /* IPv6 address is allowed by
--
1.7.8.111.gad25c.dirty
^ permalink raw reply related [flat|nested] 30+ messages in thread
* Re: [PATCH net-next 00/21] treewide: Use consistent api style for address testing
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (20 preceding siblings ...)
2012-10-19 4:15 ` [PATCH net-next 21/21] sctp: " Joe Perches
@ 2012-10-19 7:04 ` Eric Dumazet
2012-10-19 10:29 ` Joe Perches
2012-10-19 15:55 ` [ath9k-devel] " Pavel Roskin
2012-10-19 7:36 ` David Miller
22 siblings, 2 replies; 30+ messages in thread
From: Eric Dumazet @ 2012-10-19 7:04 UTC (permalink / raw)
To: Joe Perches
Cc: linux-mips, linux-usb, linux-doc, brcm80211-dev-list,
linux-kernel, linux-sctp, devel, dev, linux-s390,
user-mode-linux-devel, linux-scsi, linux-rdma, bridge, lvs-devel,
coreteam, b43-dev, cbe-oss-dev, devel, wimax, devicetree-discuss,
linux-nfs, netfilter, user-mode-linux-user, linux-arm-kernel,
davinci-linux-open-source, linux-parisc, netdev, b.a.t.m.a.n,
linux-wireless, us
On Thu, 2012-10-18 at 20:55 -0700, Joe Perches wrote:
> ethernet, ipv4, and ipv6 address testing uses 3 different api naming styles.
>
> ethernet uses: is_<foo>_ether_addr
> ipv4 uses: ipv4_is_<foo>
> ipv6 uses: ipv6_addr_<foo>
>
> Standardize on the ipv6 style of <prefix>_addr_<type> to reduce
> the number of styles to remember.
>
> The new consistent styles are:
>
> eth_addr_<foo>(const u8 *)
> ipv4_addr_<foo>(__be32)
> ipv6_addr_<foo>(const struct in6_addr *)
>
> Add temporary backward compatibility #defines for the old names too.
>
> Joe Perches (21):
> etherdevice: Rename is_<foo>_ether_addr tests to eth_addr_<foo>
> net: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> arch: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> drivers: net: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> staging: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> infiniband: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> scsi: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> of: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> s390: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> usb: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> uwb: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> Documentation: networking: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> llc_if.h: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
> in.h: Rename ipv4_is_<foo> functions to ipv4_addr_<foo>
> net: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
> infiniband: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
> ath6kl: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
> parisc: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
> lockd: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
> sctp: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
Yes they are some names discrepancies, thats a big deal.
And we have alloc_skb() / kfree_skb() / skb_clone()
Why not skb_alloc() / skb_free() / skb_clone() ?
Some people actually know current code by name of functions, they dont
want to change their mind and having to grep include files and git log
to learn the new names of an old function, especially when traveling and
using a laptop.
Sure, when we want to use eth_random_addr(), a grep into include files
to check if its still the right name (old one was random_ether_addr())
is OK because we dont use this one often.
If you think about it, eth_random_addr() was not the perfect name.
Think about all the documentation you can find outside of kernel tree,
RFC and things like that, copy/pasting some linux kernel code.
This kind of changes make our life more difficult, when we have to
backport patches or rebase code, or even perform some searches to find
prior issues/discussions.
Life of a kernel developer is not only dealing with latest Linus (or
-next) tree, and using automatic 'tools'.
Thats a real pain for me at least.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH net-next 00/21] treewide: Use consistent api style for address testing
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
` (21 preceding siblings ...)
2012-10-19 7:04 ` [PATCH net-next 00/21] treewide: Use consistent api style for address testing Eric Dumazet
@ 2012-10-19 7:36 ` David Miller
22 siblings, 0 replies; 30+ messages in thread
From: David Miller @ 2012-10-19 7:36 UTC (permalink / raw)
To: joe; +Cc: netdev
CC list too large, so this didn't make it to any of the vger lists.
And therefore nobody on the vger lists saw Eric Dumazet's reply
either.
But anyways, like him I think this is useless churn and it's
largest side effect will be making backports harder.
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH net-next 00/21] treewide: Use consistent api style for address testing
2012-10-19 7:04 ` [PATCH net-next 00/21] treewide: Use consistent api style for address testing Eric Dumazet
@ 2012-10-19 10:29 ` Joe Perches
2012-10-19 15:55 ` [ath9k-devel] " Pavel Roskin
1 sibling, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 10:29 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, linux-kernel
(trimmed over long cc list from original 00/21 post)
On Fri, 2012-10-19 at 09:04 +0200, Eric Dumazet wrote:
> On Thu, 2012-10-18 at 20:55 -0700, Joe Perches wrote:
> > ethernet, ipv4, and ipv6 address testing uses 3 different api naming styles.
> >
> > ethernet uses: is_<foo>_ether_addr
> > ipv4 uses: ipv4_is_<foo>
> > ipv6 uses: ipv6_addr_<foo>
> >
> > Standardize on the ipv6 style of <prefix>_addr_<type> to reduce
> > the number of styles to remember.
[]
> Yes they are some names discrepancies, thats a big deal.
missing a not maybe?
> And we have alloc_skb() / kfree_skb() / skb_clone()
> Why not skb_alloc() / skb_free() / skb_clone() ?
Not really a similar use case to this renaming, as alloc/free
functions generally start with alloc/free.
These particular functions all refer to address tests.
> Some people actually know current code by name of functions, they dont
> want to change their mind and having to grep include files and git log
> to learn the new names of an old function, especially when traveling and
> using a laptop.
>
> Sure, when we want to use eth_random_addr(), a grep into include files
> to check if its still the right name (old one was random_ether_addr())
> is OK because we dont use this one often.
>
> If you think about it, eth_random_addr() was not the perfect name.
Luckily, that one's only got 46 references.
I don't care for the <type>_<action>_addr vs <type>_addr_<test>
use either. Maybe a set in the name would have been/still be better.
> Think about all the documentation you can find outside of kernel tree,
> RFC and things like that, copy/pasting some linux kernel code.
>
> This kind of changes make our life more difficult, when we have to
> backport patches or rebase code, or even perform some searches to find
> prior issues/discussions.
>
> Life of a kernel developer is not only dealing with latest Linus (or
> -next) tree, and using automatic 'tools'.
>
> Thats a real pain for me at least.
Pity, api consistency has some value.
cheers, Joe
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [ath9k-devel] [PATCH net-next 00/21] treewide: Use consistent api style for address testing
2012-10-19 7:04 ` [PATCH net-next 00/21] treewide: Use consistent api style for address testing Eric Dumazet
2012-10-19 10:29 ` Joe Perches
@ 2012-10-19 15:55 ` Pavel Roskin
2012-10-19 16:39 ` Joe Perches
1 sibling, 1 reply; 30+ messages in thread
From: Pavel Roskin @ 2012-10-19 15:55 UTC (permalink / raw)
To: Eric Dumazet
Cc: linux-mips-6z/3iImG2C8G8FEW9MqTrA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r,
linux-doc-u79uwXL29TY76Z2rM5mHXA,
brcm80211-dev-list-dY08KVG/lbpWk0Htik3J/w,
users-poMEt7QlJxcwIE2E9O76wjtx2kNaKg5H,
linux-sctp-u79uwXL29TY76Z2rM5mHXA, devel-s9riP+hp16TNLxjTenLetw,
dev-yBygre7rU0TnMu66kgdUjQ, linux-s390-u79uwXL29TY76Z2rM5mHXA,
wimax-BPSAo7wm5JOHVYUYWc+uSQ, linux-scsi-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
bridge-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
lvs-devel-u79uwXL29TY76Z2rM5mHXA, coreteam-Cap9r6Oaw4JrovVCs/uTlw,
b43-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
cbe-oss-dev-uLR06cmDAlY/bJ5BZ2RsiQ,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
user-mode-linux-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ,
davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/,
netfilter-u79uwXL29TY76Z2rM5mHXA,
user-mode-linux-user-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-nfs-u79uwXL29TY76Z2rM5mHXA,
linux-parisc-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA,
linux-wireless-u79uwXL29TY76Z2rM5mHXA, l
On Fri, 19 Oct 2012 09:04:14 +0200
Eric Dumazet <eric.dumazet-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Yes they are some names discrepancies, thats a big deal.
>
> And we have alloc_skb() / kfree_skb() / skb_clone()
>
> Why not skb_alloc() / skb_free() / skb_clone() ?
>
> Some people actually know current code by name of functions, they dont
> want to change their mind and having to grep include files and git log
> to learn the new names of an old function, especially when traveling
> and using a laptop.
I agree.
Also, it makes sense to introduce a more consistent name for a function
when it's improved in some way and the callers need to be adjusted or
re-checked.
That way, the old name can be phased out as the code is made compatible
with the new function.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [ath9k-devel] [PATCH net-next 00/21] treewide: Use consistent api style for address testing
2012-10-19 15:55 ` [ath9k-devel] " Pavel Roskin
@ 2012-10-19 16:39 ` Joe Perches
0 siblings, 0 replies; 30+ messages in thread
From: Joe Perches @ 2012-10-19 16:39 UTC (permalink / raw)
To: Pavel Roskin; +Cc: Eric Dumazet, linux-kernel, netdev, ath9k-devel
(cc list trimmed)
On Fri, 2012-10-19 at 11:55 -0400, Pavel Roskin wrote:
> On Fri, 19 Oct 2012 09:04:14 +0200
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> > Yes they are some names discrepancies, thats a big deal.
> >
> > And we have alloc_skb() / kfree_skb() / skb_clone()
> >
> > Why not skb_alloc() / skb_free() / skb_clone() ?
> >
> > Some people actually know current code by name of functions, they dont
> > want to change their mind and having to grep include files and git log
> > to learn the new names of an old function, especially when traveling
> > and using a laptop.
>
> I agree.
>
> Also, it makes sense to introduce a more consistent name for a function
> when it's improved in some way and the callers need to be adjusted or
> re-checked.
>
> That way, the old name can be phased out as the code is made compatible
> with the new function.
That can also be done, as was done with this series, with backward
compatible #defines.
^ permalink raw reply [flat|nested] 30+ messages in thread
* RE: [PATCH net-next 04/21] wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 ` [PATCH net-next 04/21] wireless: " Joe Perches
@ 2012-10-20 2:30 ` Bing Zhao
2012-10-20 10:51 ` Luciano Coelho
2012-10-20 16:19 ` Arend van Spriel
2 siblings, 0 replies; 30+ messages in thread
From: Bing Zhao @ 2012-10-20 2:30 UTC (permalink / raw)
To: Joe Perches, John W. Linville, Kalle Valo, Luis R. Rodriguez,
Jouni Malinen, Vasanthakumar Thiagarajan, Senthil Balasubramanian,
Stefano Brivio, Larry Finger, Stanislav Yakovlev,
Stanislaw Gruszka, Lennert Buytenhek, Christian Lamparter,
Jussi Kivilinna, Ivo van Doorn, Gertjan van Wingerde,
Helmut Schaa, Herton Ronaldo Krzesinski, Hin-Tak Leung,
Chaoming Li, A
Cc: Brett Rudley, Roland Vossen, Arend van Spriel,
Franky (Zhenhui) Lin, Kan Yan, Johannes Berg, Wey-Yi Guy,
Intel Linux Wireless, Luciano Coelho,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, ath9k-devel@lists.ath9k.org,
b43-dev@lists.infradead.org, brcm80211-dev-list@broadcom.com,
users@rt2x00.serialmonkey.com
Hi Joe,
> Subject: [PATCH net-next 04/21] wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
>
> Convert the old ether_addr tests to eth_addr_<foo>.
> Adds api consistency.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Bing Zhao <bzhao@marvell.com> [mwifiex]
Thanks,
Bing
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH net-next 04/21] wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 ` [PATCH net-next 04/21] wireless: " Joe Perches
2012-10-20 2:30 ` Bing Zhao
@ 2012-10-20 10:51 ` Luciano Coelho
2012-10-20 16:19 ` Arend van Spriel
2 siblings, 0 replies; 30+ messages in thread
From: Luciano Coelho @ 2012-10-20 10:51 UTC (permalink / raw)
To: Joe Perches
Cc: Stanislaw Gruszka, Franky (Zhenhui) Lin, brcm80211-dev-list,
linux-kernel, Kalle Valo, Wey-Yi Guy, Brett Rudley,
Christian Lamparter, Hin-Tak Leung, Wingerde, users,
Roland Vossen, Jouni Malinen, Intel Linux Wireless,
Luis R. Rodriguez, b43-dev, Arnaldo Carvalho de Melo, Spriel,
Daniel Drake, Herton Ronaldo Krzesinski, Lennert Buytenhek, Arend,
Johannes Berg
[-- Attachment #1.1: Type: text/plain, Size: 5262 bytes --]
On Thu, 2012-10-18 at 20:55 -0700, Joe Perches wrote:
> Convert the old ether_addr tests to eth_addr_<foo>.
> Adds api consistency.
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
For the TI drivers part:
Acked-by: Luciano Coelho <luca@coelho.fi>
[...]
> diff --git a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
> index 441cbcc..822d1f2 100644
> --- a/drivers/net/wireless/ti/wl1251/main.c
> +++ b/drivers/net/wireless/ti/wl1251/main.c
> @@ -338,7 +338,7 @@ static int wl1251_join(struct wl1251 *wl, u8 bss_type, u8 channel,
> * Join command applies filters, and if we are not associated,
> * BSSID filter must be disabled for association to work.
> */
> - if (is_zero_ether_addr(wl->bssid))
> + if (eth_addr_zero(wl->bssid))
> wl->rx_config &= ~CFG_BSSID_FILTER_EN;
>
> ret = wl1251_cmd_join(wl, bss_type, channel, beacon_interval,
> @@ -703,7 +703,7 @@ static void wl1251_op_configure_filter(struct ieee80211_hw *hw,
> }
> if (*total & FIF_CONTROL)
> wl->rx_filter |= CFG_RX_CTL_EN;
> - if (*total & FIF_OTHER_BSS || is_zero_ether_addr(wl->bssid))
> + if (*total & FIF_OTHER_BSS || eth_addr_zero(wl->bssid))
> wl->rx_config &= ~CFG_BSSID_FILTER_EN;
> if (*total & FIF_PROBE_REQ)
> wl->rx_filter |= CFG_RX_PREQ_EN;
> @@ -734,7 +734,7 @@ static int wl1251_set_key_type(struct wl1251 *wl,
> switch (mac80211_key->cipher) {
> case WLAN_CIPHER_SUITE_WEP40:
> case WLAN_CIPHER_SUITE_WEP104:
> - if (is_broadcast_ether_addr(addr))
> + if (eth_addr_broadcast(addr))
> key->key_type = KEY_WEP_DEFAULT;
> else
> key->key_type = KEY_WEP_ADDR;
> @@ -742,7 +742,7 @@ static int wl1251_set_key_type(struct wl1251 *wl,
> mac80211_key->hw_key_idx = mac80211_key->keyidx;
> break;
> case WLAN_CIPHER_SUITE_TKIP:
> - if (is_broadcast_ether_addr(addr))
> + if (eth_addr_broadcast(addr))
> key->key_type = KEY_TKIP_MIC_GROUP;
> else
> key->key_type = KEY_TKIP_MIC_PAIRWISE;
> @@ -750,7 +750,7 @@ static int wl1251_set_key_type(struct wl1251 *wl,
> mac80211_key->hw_key_idx = mac80211_key->keyidx;
> break;
> case WLAN_CIPHER_SUITE_CCMP:
> - if (is_broadcast_ether_addr(addr))
> + if (eth_addr_broadcast(addr))
> key->key_type = KEY_AES_GROUP;
> else
> key->key_type = KEY_AES_PAIRWISE;
> @@ -793,7 +793,7 @@ static int wl1251_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
> key->cipher, key->keyidx, key->keylen, key->flags);
> wl1251_dump(DEBUG_CRYPT, "KEY: ", key->key, key->keylen);
>
> - if (is_zero_ether_addr(addr)) {
> + if (eth_addr_zero(addr)) {
> /* We dont support TX only encryption */
> ret = -EOPNOTSUPP;
> goto out;
> diff --git a/drivers/net/wireless/ti/wlcore/cmd.c b/drivers/net/wireless/ti/wlcore/cmd.c
> index eaef3f4..3e40415 100644
> --- a/drivers/net/wireless/ti/wlcore/cmd.c
> +++ b/drivers/net/wireless/ti/wlcore/cmd.c
> @@ -1268,7 +1268,7 @@ int wl1271_cmd_set_sta_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
>
> if (key_type == KEY_WEP)
> cmd->lid_key_type = WEP_DEFAULT_LID_TYPE;
> - else if (is_broadcast_ether_addr(addr))
> + else if (eth_addr_broadcast(addr))
> cmd->lid_key_type = BROADCAST_LID_TYPE;
> else
> cmd->lid_key_type = UNICAST_LID_TYPE;
> diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
> index 25530c8..d421844 100644
> --- a/drivers/net/wireless/ti/wlcore/main.c
> +++ b/drivers/net/wireless/ti/wlcore/main.c
> @@ -3020,7 +3020,7 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
>
> addr = sta ? sta->addr : bcast_addr;
>
> - if (is_zero_ether_addr(addr)) {
> + if (eth_addr_zero(addr)) {
> /* We dont support TX only encryption */
> return -EOPNOTSUPP;
> }
> @@ -3029,7 +3029,7 @@ static int wl1271_set_key(struct wl1271 *wl, struct wl12xx_vif *wlvif,
> will be cleared automatically on next CMD_JOIN. Ignore the
> request silently, as we dont want the mac80211 to emit
> an error message. */
> - if (action == KEY_REMOVE && !is_broadcast_ether_addr(addr))
> + if (action == KEY_REMOVE && !eth_addr_broadcast(addr))
> return 0;
>
> /* don't remove key if hlid was already deleted */
> @@ -3871,7 +3871,7 @@ static void wl1271_bss_info_changed_sta(struct wl1271 *wl,
> }
>
> if (changed & BSS_CHANGED_BSSID)
> - if (!is_zero_ether_addr(bss_conf->bssid)) {
> + if (!eth_addr_zero(bss_conf->bssid)) {
> ret = wl12xx_cmd_build_null_data(wl, wlvif);
> if (ret < 0)
> goto out;
> diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
> index a90d3cd..03e966e 100644
> --- a/drivers/net/wireless/ti/wlcore/tx.c
> +++ b/drivers/net/wireless/ti/wlcore/tx.c
> @@ -145,7 +145,7 @@ static u8 wl12xx_tx_get_hlid_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif,
> return wl->system_hlid;
>
> hdr = (struct ieee80211_hdr *)skb->data;
> - if (is_multicast_ether_addr(ieee80211_get_DA(hdr)))
> + if (eth_addr_multicast(ieee80211_get_DA(hdr)))
> return wlvif->ap.bcast_hlid;
> else
> return wlvif->ap.global_hlid;
[...]
--
Cheers,
Luca.
[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 154 bytes --]
_______________________________________________
ath9k-devel mailing list
ath9k-devel@lists.ath9k.org
https://lists.ath9k.org/mailman/listinfo/ath9k-devel
^ permalink raw reply [flat|nested] 30+ messages in thread
* Re: [PATCH net-next 04/21] wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
2012-10-19 3:55 ` [PATCH net-next 04/21] wireless: " Joe Perches
2012-10-20 2:30 ` Bing Zhao
2012-10-20 10:51 ` Luciano Coelho
@ 2012-10-20 16:19 ` Arend van Spriel
2 siblings, 0 replies; 30+ messages in thread
From: Arend van Spriel @ 2012-10-20 16:19 UTC (permalink / raw)
To: Joe Perches
Cc: John W. Linville, linux-wireless@vger.kernel.org, netdev,
linux-kernel@vger.kernel.org, brcm80211 development
On 10/19/2012 05:55 AM, Joe Perches wrote:
> Convert the old ether_addr tests to eth_addr_<foo>.
> Adds api consistency.
Acked-by: Arend van Spriel <arend@broadcom.com>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> .../net/wireless/brcm80211/brcmfmac/dhd_linux.c | 4 ++--
> .../net/wireless/brcm80211/brcmfmac/wl_cfg80211.c | 2 +-
> .../net/wireless/brcm80211/brcmsmac/mac80211_if.c | 2 +-
> drivers/net/wireless/brcm80211/brcmsmac/main.c | 16 ++++++++--------
^ permalink raw reply [flat|nested] 30+ messages in thread
end of thread, other threads:[~2012-10-20 16:19 UTC | newest]
Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-19 3:55 [PATCH net-next 00/21] treewide: Use consistent api style for address testing Joe Perches
2012-10-19 3:55 ` [PATCH net-next 01/21] etherdevice: Rename is_<foo>_ether_addr tests to eth_addr_<foo> Joe Perches
[not found] ` <cover.1350618006.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2012-10-19 3:55 ` [PATCH net-next 02/21] net: Convert is_<foo>_ether_addr uses " Joe Perches
2012-10-19 3:55 ` [PATCH net-next 04/21] wireless: " Joe Perches
2012-10-20 2:30 ` Bing Zhao
2012-10-20 10:51 ` Luciano Coelho
2012-10-20 16:19 ` Arend van Spriel
2012-10-19 4:13 ` [PATCH net-next 03/21] arch: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 05/21] drivers: net: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 06/21] staging: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 07/21] infiniband: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 08/21] scsi: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 09/21] of: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 10/21] s390: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 11/21] usb: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 12/21] uwb: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 13/21] Documentation: networking: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 14/21] llc_if.h: " Joe Perches
2012-10-19 4:14 ` [PATCH net-next 15/21] in.h: Rename ipv4_is_<foo> functions to ipv4_addr_<foo> Joe Perches
2012-10-19 4:15 ` [PATCH net-next 16/21] net: Convert ipv4_is_<foo> uses " Joe Perches
2012-10-19 4:15 ` [PATCH net-next 17/21] infiniband: " Joe Perches
2012-10-19 4:15 ` [PATCH net-next 18/21] ath6kl: " Joe Perches
2012-10-19 4:15 ` [PATCH net-next 19/21] parisc: " Joe Perches
2012-10-19 4:15 ` [PATCH net-next 20/21] lockd: " Joe Perches
2012-10-19 4:15 ` [PATCH net-next 21/21] sctp: " Joe Perches
2012-10-19 7:04 ` [PATCH net-next 00/21] treewide: Use consistent api style for address testing Eric Dumazet
2012-10-19 10:29 ` Joe Perches
2012-10-19 15:55 ` [ath9k-devel] " Pavel Roskin
2012-10-19 16:39 ` Joe Perches
2012-10-19 7:36 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).