treewide: Use consistent api style for address testing
Subsystems (98)
cover treewide: Use consistent api style for address testing
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(-)
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 1/21 etherdevice: Rename is_<foo>_ether_addr tests to eth_addr_<foo>
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.
--- include/linux/etherdevice.h | 36 ++++++++++++++++++++++-------------- 1 files changed, 22 insertions(+), 14 deletions(-)
include/linux/etherdevice.h +22 -14
@@ -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
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 2/21 net: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- 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(-)
net/802/stp.c +2 -2
@@ -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] -
net/8021q/vlan_dev.c +3 -3
@@ -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 )
net/8021q/vlan_netlink.c +1 -1
@@ -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 ; }
net/batman-adv/bat_iv_ogm.c +1 -1
@@ -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 ();
net/batman-adv/bridge_loop_avoidance.c +4 -4
@@ -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. */
net/batman-adv/routing.c +10 -10
@@ -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 */
net/batman-adv/soft-interface.c +2 -2
@@ -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)) {
net/batman-adv/unicast.c +1 -1
@@ -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;
net/batman-adv/vis.c +2 -2
@@ -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);
net/bridge/br_device.c +3 -3
@@ -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);
net/bridge/br_fdb.c +1 -1
@@ -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);
net/bridge/br_if.c +1 -1
@@ -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 */
net/bridge/br_input.c +4 -4
@@ -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) &ð_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 );
net/bridge/br_netlink.c +1 -1
@@ -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 ; }
net/core/pktgen.c +2 -2
@@ -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 */
net/core/rtnetlink.c +1 -1
@@ -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 ; }
net/dsa/slave.c +1 -1
@@ -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 ))
net/ethernet/eth.c +3 -3
@@ -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 ;
net/ipv4/ip_gre.c +1 -1
@@ -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 ; }
net/ipv6/ip6_gre.c +1 -1
@@ -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 ; }
net/mac80211/cfg.c +1 -1
@@ -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 );
net/mac80211/ibss.c +4 -4
@@ -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 &ð_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)
net/mac80211/ieee80211_i.h +1 -1
@@ -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); }
net/mac80211/iface.c +6 -6
@@ -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 &ð_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;
net/mac80211/mesh.c +1 -1
@@ -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 );
net/mac80211/mesh_hwmp.c +2 -2
@@ -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++;
net/mac80211/mesh_pathtbl.c +2 -2
@@ -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 ;
net/mac80211/mesh_plink.c +1 -1
@@ -594,7 +594,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_mif (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 ;
net/mac80211/mlme.c +2 -2
@@ -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);
net/mac80211/rx.c +25 -25
194 lines not on this page · raw message
net/mac80211/sta_info.c +1 -1
@@ -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 ;
net/mac80211/status.c +3 -3
@@ -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++;
net/mac80211/tx.c +11 -11
@@ -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
net/mac80211/wme.c +2 -2
@@ -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 ;
net/openvswitch/flow.c +2 -2
@@ -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 );
net/openvswitch/vport-internal_dev.c +1 -1
@@ -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);
net/wireless/core.c +1 -1
@@ -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 ;
net/wireless/ibss.c +1 -1
@@ -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 */
net/wireless/nl80211.c +2 -2
@@ -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 ]);
net/wireless/util.c +2 -2
@@ -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) &ðer_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,
net/wireless/wext-compat.c +1 -1
@@ -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));
net/wireless/wext-sme.c +1 -1
@@ -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);
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 3/21 arch: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- 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(-)
arch/arm/mach-davinci/board-mityomapl138.c +1 -1
@@ -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
arch/arm/mach-pxa/colibri-pxa3xx.c +1 -1
@@ -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",
arch/avr32/boards/atngw100/setup.c +1 -1
@@ -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 ;/*
arch/avr32/boards/atstk1000/atstk1002.c +1 -1
@@ -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 ;/*
arch/avr32/boards/favr-32/setup.c +1 -1
@@ -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 ;/*
arch/avr32/boards/hammerhead/setup.c +1 -1
@@ -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 ;/*
arch/avr32/boards/merisc/setup.c +1 -1
@@ -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;
arch/avr32/boards/mimc200/setup.c +1 -1
@@ -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 ;/*
arch/mips/alchemy/common/platform.c +2 -2
@@ -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 */
arch/um/drivers/net_kern.c +3 -3
@@ -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" );
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 3/21 arch: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- 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(-)
arch/arm/mach-davinci/board-mityomapl138.c +1 -1
@@ -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
arch/arm/mach-pxa/colibri-pxa3xx.c +1 -1
@@ -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",
arch/avr32/boards/atngw100/setup.c +1 -1
@@ -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 ;/*
arch/avr32/boards/atstk1000/atstk1002.c +1 -1
@@ -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 ;/*
arch/avr32/boards/favr-32/setup.c +1 -1
@@ -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 ;/*
arch/avr32/boards/hammerhead/setup.c +1 -1
@@ -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 ;/*
arch/avr32/boards/merisc/setup.c +1 -1
@@ -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;
arch/avr32/boards/mimc200/setup.c +1 -1
@@ -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 ;/*
arch/mips/alchemy/common/platform.c +2 -2
@@ -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 */
arch/um/drivers/net_kern.c +3 -3
@@ -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" );
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 4/21 wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- 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(-)
drivers/net/wireless/adm8211.c +1 -1
@@ -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);
drivers/net/wireless/airo.c +2 -2
@@ -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))
drivers/net/wireless/at76c50x-usb.c +4 -4
@@ -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);
drivers/net/wireless/ath/ath6kl/cfg80211.c +4 -4
@@ -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 &ð_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);
drivers/net/wireless/ath/ath6kl/main.c +4 -4
@@ -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 ); }
drivers/net/wireless/ath/ath6kl/txrx.c +5 -5
@@ -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);
drivers/net/wireless/ath/ath9k/recv.c +4 -4
@@ -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) &ðer_addr_equal (hdr->addr3, common->curbssid)) rs.is_mybeacon = true;else
drivers/net/wireless/b43/main.c +1 -1
@@ -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);
drivers/net/wireless/b43legacy/main.c +1 -1
@@ -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);
drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +2 -2
@@ -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 );
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +1 -1
@@ -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);
drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +1 -1
@@ -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);
drivers/net/wireless/brcm80211/brcmsmac/main.c +8 -8
@@ -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 )
drivers/net/wireless/hostap/hostap_info.c +1 -1
@@ -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
drivers/net/wireless/hostap/hostap_ioctl.c +4 -4
@@ -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;
drivers/net/wireless/hostap/hostap_main.c +1 -1
@@ -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 ;
drivers/net/wireless/ipw2x00/ipw2100.c +3 -3
@@ -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 ;
drivers/net/wireless/ipw2x00/ipw2200.c +9 -9
@@ -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 ;
drivers/net/wireless/ipw2x00/libipw_rx.c +6 -6
@@ -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 ;
drivers/net/wireless/ipw2x00/libipw_tx.c +2 -2
@@ -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;
drivers/net/wireless/iwlegacy/3945-mac.c +1 -1
@@ -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;
drivers/net/wireless/iwlegacy/4965-mac.c +1 -1
@@ -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);
drivers/net/wireless/iwlegacy/common.c +1 -1
@@ -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++) {
drivers/net/wireless/iwlwifi/dvm/sta.c +1 -1
@@ -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++) {
drivers/net/wireless/libertas_tf/main.c +1 -1
@@ -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); }
drivers/net/wireless/mwifiex/join.c +1 -1
@@ -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 );
drivers/net/wireless/mwifiex/scan.c +1 -1
@@ -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;
drivers/net/wireless/mwifiex/sta_cmd.c +1 -1
@@ -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 );
drivers/net/wireless/mwifiex/sta_cmdresp.c +1 -1
@@ -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 ; }
drivers/net/wireless/mwifiex/uap_txrx.c +1 -1
@@ -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 {
drivers/net/wireless/mwl8k.c +1 -1
@@ -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 ;
drivers/net/wireless/orinoco/wext.c +2 -2
@@ -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 );
drivers/net/wireless/p54/eeprom.c +1 -1
@@ -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,
drivers/net/wireless/rndis_wlan.c +9 -9
@@ -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. */
drivers/net/wireless/rt2x00/rt2400pci.c +1 -1
@@ -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); }
drivers/net/wireless/rt2x00/rt2500pci.c +1 -1
@@ -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); }
drivers/net/wireless/rt2x00/rt2500usb.c +1 -1
@@ -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); }
drivers/net/wireless/rt2x00/rt2800lib.c +4 -4
@@ -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); }
drivers/net/wireless/rt2x00/rt61pci.c +1 -1
@@ -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); }
drivers/net/wireless/rt2x00/rt73usb.c +1 -1
@@ -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); }
drivers/net/wireless/rtl818x/rtl8180/dev.c +2 -2
@@ -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);
drivers/net/wireless/rtl818x/rtl8187/dev.c +2 -2
@@ -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);
drivers/net/wireless/rtlwifi/base.c +3 -3
@@ -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);
drivers/net/wireless/rtlwifi/cam.c +1 -1
@@ -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 ;
drivers/net/wireless/rtlwifi/pci.c +4 -4
@@ -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;
drivers/net/wireless/rtlwifi/rc.c +2 -2
@@ -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) {
drivers/net/wireless/rtlwifi/rtl8192ce/trx.c +2 -2
@@ -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 ); }
drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +2 -2
@@ -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);
drivers/net/wireless/rtlwifi/usb.c +6 -6
@@ -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;
drivers/net/wireless/ti/wl1251/main.c +6 -6
@@ -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;
drivers/net/wireless/ti/wlcore/cmd.c +1 -1
@@ -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 ;
drivers/net/wireless/ti/wlcore/main.c +3 -3
@@ -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;
drivers/net/wireless/ti/wlcore/tx.c +1 -1
@@ -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;
drivers/net/wireless/wl3501_cs.c +1 -1
@@ -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 );
drivers/net/wireless/zd1211rw/zd_mac.c +1 -1
@@ -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;
Signature · 1 line
1.7.8.111.gad25c.dirty
RE: [PATCH net-next 04/21] wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
Hi Joe,
Quoted 6 lines
Subject: [PATCH net-next 04/21] wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
Convert the old
ether_addrtests to eth_addr_<foo>. Adds api consistency.Signed-off-by Joe Perches <[email protected]>
Thanks,
Bing
Re: [PATCH net-next 04/21] wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesQuoted 5 lines · Joe Perches
Convert the old
ether_addrtests to eth_addr_<foo>. Adds api consistency.Signed-off-by Joe Perches <[email protected]>---
For the TI drivers part:
[...]
Quoted 107 lines
drivers/net/wireless/ti/wl1251/main.c +6
-6@@ -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;drivers/net/wireless/ti/wlcore/cmd.c +1
-1@@ -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 ;drivers/net/wireless/ti/wlcore/main.c +3
-3@@ -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;drivers/net/wireless/ti/wlcore/tx.c +0
-0
drivers/net/wireless/ti/wlcore/tx.c static u8 wl12xx_tx_get_hlid_ap(struct wl1271 *wl, struct wl12xx_vif *wlvif, · line 151
Quoted 8 lines
drivers/net/wireless/ti/wlcore/tx.c +1
-1@@ -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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
Url : http://lists.ath9k.org/pipermail/ath9k-devel/attachments/20121020/9ea015a7/attachment.pgp
Re: [PATCH net-next 04/21] wireless: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesQuoted 2 lines · Joe Perches
Convert the old
ether_addrtests to eth_addr_<foo>. Adds api consistency.
Quoted 6 lines
Signed-off-by Joe Perches <[email protected]>--- .../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 ++++++++--------
PATCH 5/21 drivers: net: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- 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(-)
drivers/net/bonding/bond_3ad.c +1 -1
@@ -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); }/**
drivers/net/bonding/bond_alb.c +1 -1
@@ -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 ; }
drivers/net/bonding/bond_main.c +3 -3
@@ -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 ;
drivers/net/dummy.c +1 -1
@@ -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 ;
drivers/net/ethernet/3com/3c59x.c +1 -1
@@ -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 */
drivers/net/ethernet/3com/typhoon.c +1 -1
@@ -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; }
drivers/net/ethernet/8390/etherh.c +1 -1
@@ -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 ;
drivers/net/ethernet/adi/bfin_mac.c +3 -3
@@ -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);
drivers/net/ethernet/aeroflex/greth.c +2 -2
@@ -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 ;
drivers/net/ethernet/amd/au1000_eth.c +1 -1
@@ -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. */
drivers/net/ethernet/amd/depca.c +2 -2
@@ -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++;
drivers/net/ethernet/amd/pcnet32.c +4 -4
@@ -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; }
drivers/net/ethernet/atheros/atl1c/atl1c_hw.c +1 -1
@@ -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); }/*
drivers/net/ethernet/atheros/atl1c/atl1c_main.c +1 -1
@@ -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))
drivers/net/ethernet/atheros/atl1e/atl1e_hw.c +2 -2
@@ -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 ; }
drivers/net/ethernet/atheros/atl1e/atl1e_main.c +1 -1
@@ -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))
drivers/net/ethernet/atheros/atlx/atl1.c +5 -5
@@ -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; }
drivers/net/ethernet/atheros/atlx/atl2.c +7 -7
@@ -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 ; }
drivers/net/ethernet/atheros/atlx/atlx.c +1 -1
@@ -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);
drivers/net/ethernet/broadcom/b44.c +2 -2
@@ -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 ; }
drivers/net/ethernet/broadcom/bnx2.c +1 -1
@@ -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);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +3 -3
@@ -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 ; }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +2 -2
@@ -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
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +3 -3
@@ -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 ); }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +1 -1
@@ -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 */
drivers/net/ethernet/broadcom/cnic.c +1 -1
@@ -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)) {
drivers/net/ethernet/broadcom/tg3.c +3 -3
@@ -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 ;
drivers/net/ethernet/brocade/bna/bnad.c +3 -3
@@ -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 */
drivers/net/ethernet/cadence/at91_ether.c +3 -3
@@ -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 */
drivers/net/ethernet/cadence/macb.c +2 -2
@@ -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);
drivers/net/ethernet/calxeda/xgmac.c +3 -3
@@ -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);
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +1 -1
@@ -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);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1 -1
@@ -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,
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +1 -1
@@ -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,
drivers/net/ethernet/cirrus/ep93xx_eth.c +1 -1
@@ -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);
drivers/net/ethernet/cirrus/mac89x0.c +1 -1
@@ -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 );
drivers/net/ethernet/cisco/enic/enic_dev.c +2 -2
@@ -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);
drivers/net/ethernet/cisco/enic/enic_main.c +5 -5
@@ -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 */
drivers/net/ethernet/cisco/enic/enic_pp.c +5 -5
@@ -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);
drivers/net/ethernet/davicom/dm9000.c +3 -3
@@ -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);
drivers/net/ethernet/dec/ewrk3.c +2 -2
@@ -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++;
drivers/net/ethernet/dec/tulip/de4x5.c +2 -2
@@ -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++;
drivers/net/ethernet/dlink/sundance.c +1 -1
@@ -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);
drivers/net/ethernet/dnet.c +3 -3
@@ -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);
drivers/net/ethernet/emulex/benet/be_main.c +4 -4
@@ -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 ); }
drivers/net/ethernet/ethoc.c +3 -3
@@ -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; }
drivers/net/ethernet/faraday/ftgmac100.c +1 -1
@@ -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);
drivers/net/ethernet/faraday/ftmac100.c +1 -1
@@ -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);
drivers/net/ethernet/freescale/fec.c +4 -4
@@ -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);
drivers/net/ethernet/freescale/fec_mpc52xx.c +1 -1
@@ -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);
drivers/net/ethernet/freescale/gianfar_ethtool.c +6 -6
@@ -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 {
drivers/net/ethernet/freescale/ucc_geth.c +1 -1
@@ -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);
drivers/net/ethernet/i825xx/ether1.c +1 -1
@@ -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 ;
drivers/net/ethernet/ibm/ehea/ehea_main.c +2 -2
@@ -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; }
drivers/net/ethernet/intel/e100.c +2 -2
@@ -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 ;
drivers/net/ethernet/intel/e1000/e1000_main.c +2 -2
@@ -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 */
drivers/net/ethernet/intel/e1000e/mac.c +1 -1
@@ -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 ; }
drivers/net/ethernet/intel/e1000e/netdev.c +2 -2
@@ -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 ;
drivers/net/ethernet/intel/igb/e1000_mac.c +1 -1
@@ -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; }
drivers/net/ethernet/intel/igb/igb_main.c +4 -4
@@ -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);
drivers/net/ethernet/intel/igbvf/netdev.c +3 -3
@@ -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 ;
drivers/net/ethernet/intel/ixgb/ixgb_hw.c +3 -3
@@ -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; }
drivers/net/ethernet/intel/ixgb/ixgb_main.c +3 -3
@@ -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 ;
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +1 -1
@@ -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) |
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +7 -7
@@ -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 ;
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +3 -3
@@ -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);
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +4 -4
@@ -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;
drivers/net/ethernet/lantiq_etop.c +1 -1
@@ -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;
drivers/net/ethernet/marvell/mv643xx_eth.c +2 -2
@@ -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);
drivers/net/ethernet/marvell/pxa168_eth.c +1 -1
@@ -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 ;
drivers/net/ethernet/marvell/skge.c +3 -3
@@ -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);
drivers/net/ethernet/marvell/sky2.c +1 -1
@@ -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 );
drivers/net/ethernet/mellanox/mlx4/en_netdev.c +1 -1
@@ -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 );
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +2 -2
@@ -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 ))
drivers/net/ethernet/micrel/ks8695net.c +3 -3
@@ -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);
drivers/net/ethernet/micrel/ks8842.c +2 -2
@@ -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); }
drivers/net/ethernet/micrel/ks8851.c +2 -2
@@ -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 ;
drivers/net/ethernet/micrel/ks8851_mll.c +1 -1
@@ -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" );
drivers/net/ethernet/microchip/enc28j60.c +2 -2
@@ -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);
drivers/net/ethernet/myricom/myri10ge/myri10ge.c +1 -1
@@ -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);
drivers/net/ethernet/neterion/s2io.c +1 -1
@@ -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);
drivers/net/ethernet/neterion/vxge/vxge-config.c +1 -1
@@ -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; }
drivers/net/ethernet/neterion/vxge/vxge-main.c +6 -6
@@ -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 ));
drivers/net/ethernet/netx-eth.c +1 -1
@@ -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);
drivers/net/ethernet/nuvoton/w90p910_ether.c +2 -2
@@ -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" );
drivers/net/ethernet/nvidia/forcedeth.c +2 -2
@@ -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
drivers/net/ethernet/nxp/lpc_eth.c +4 -4
@@ -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 */
drivers/net/ethernet/octeon/octeon_mgmt.c +1 -1
@@ -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 &ð_addr_valid (mac)) {memcpy (netdev->dev_addr, mac,ETH_ALEN ); netdev->addr_assign_type &= ~NET_ADDR_RANDOM ; }else {
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +3 -3
@@ -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
drivers/net/ethernet/pasemi/pasemi_mac.c +2 -2
@@ -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; }
drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +2 -2
@@ -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)) {
drivers/net/ethernet/qlogic/qla3xxx.c +1 -1
@@ -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);
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +2 -2
@@ -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)) {
drivers/net/ethernet/qlogic/qlge/qlge_main.c +3 -3
@@ -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. */
drivers/net/ethernet/realtek/8139cp.c +1 -1
@@ -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);
drivers/net/ethernet/realtek/8139too.c +1 -1
@@ -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);
drivers/net/ethernet/realtek/r8169.c +1 -1
@@ -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);
drivers/net/ethernet/renesas/sh_eth.c +2 -2
@@ -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 &ð_addr_multicast (ha->addr))continue ;if (sh_eth_tsu_add_entry (ndev, ha->addr) <0 ) {
drivers/net/ethernet/seeq/ether3.c +1 -1
@@ -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 ;
drivers/net/ethernet/sfc/efx.c +1 -1
@@ -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);
drivers/net/ethernet/sfc/ethtool.c +3 -3
@@ -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,
drivers/net/ethernet/sfc/siena_sriov.c +3 -3
@@ -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;
drivers/net/ethernet/sis/sis900.c +1 -1
@@ -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);
drivers/net/ethernet/smsc/smc911x.c +2 -2
@@ -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 {
drivers/net/ethernet/smsc/smc91x.c +2 -2
@@ -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 {
drivers/net/ethernet/smsc/smsc911x.c +5 -5
@@ -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" );
drivers/net/ethernet/smsc/smsc9420.c +3 -3
@@ -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;
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +2 -2
@@ -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,
drivers/net/ethernet/sun/niu.c +4 -4
@@ -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);
drivers/net/ethernet/sun/sungem.c +1 -1
@@ -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);
drivers/net/ethernet/ti/cpsw.c +1 -1
@@ -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 {
drivers/net/ethernet/ti/davinci_emac.c +3 -3
@@ -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_dataelse 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);
drivers/net/ethernet/tile/tilegx.c +2 -2
@@ -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 ;
drivers/net/ethernet/tile/tilepro.c +2 -2
@@ -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. */
drivers/net/ethernet/toshiba/ps3_gelic_net.c +1 -1
@@ -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);
drivers/net/ethernet/toshiba/ps3_gelic_wireless.c +1 -1
@@ -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);
drivers/net/ethernet/toshiba/spider_net.c +2 -2
@@ -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 */
drivers/net/ethernet/toshiba/tc35815.c +2 -2
@@ -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 ; }
drivers/net/ethernet/tundra/tsi108_eth.c +4 -4
@@ -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++)
drivers/net/ethernet/via/via-rhine.c +1 -1
@@ -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);
drivers/net/ethernet/wiznet/w5100.c +3 -3
@@ -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 &ð_addr_valid (data->mac_addr)) {memcpy (ndev->dev_addr, data->mac_addr,ETH_ALEN ); }else {eth_hw_addr_random (ndev);
drivers/net/ethernet/wiznet/w5300.c +3 -3
@@ -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 &ð_addr_valid (data->mac_addr)) {memcpy (ndev->dev_addr, data->mac_addr,ETH_ALEN ); }else {eth_hw_addr_random (ndev);
drivers/net/ethernet/xilinx/ll_temac_main.c +1 -1
@@ -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 ;
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1 -1
@@ -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 */
drivers/net/hamradio/bpqether.c +1 -1
@@ -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);
drivers/net/ifb.c +1 -1
@@ -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 ;
drivers/net/macvlan.c +8 -8
@@ -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 ; }
drivers/net/phy/at803x.c +1 -1
@@ -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++) {
drivers/net/rionet.c +2 -2
@@ -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);
drivers/net/team/team.c +2 -2
@@ -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 ;
drivers/net/tun.c +2 -2
@@ -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 ;
drivers/net/usb/asix_common.c +1 -1
@@ -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 );
drivers/net/usb/dm9601.c +2 -2
@@ -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
drivers/net/usb/mcs7830.c +1 -1
@@ -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);
drivers/net/usb/smsc75xx.c +1 -1
@@ -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" );
drivers/net/usb/smsc95xx.c +1 -1
@@ -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 ;
drivers/net/veth.c +1 -1
@@ -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 ]) {
drivers/net/vxlan.c +2 -2
@@ -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 ; }
drivers/net/wimax/i2400m/driver.c +1 -1
@@ -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 {
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 6/21 staging: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- 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(-)
drivers/staging/ccg/u_ether.c +3 -3
@@ -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);
drivers/staging/csr/sme_wext.c +1 -1
@@ -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) {
drivers/staging/et131x/et131x.c +2 -2
@@ -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);
drivers/staging/gdm72xx/gdm_wimax.c +1 -1
@@ -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);
drivers/staging/octeon/ethernet.c +1 -1
@@ -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 &ð_addr_valid (mac)) {memcpy (dev->dev_addr, mac,ETH_ALEN ); dev->addr_assign_type &= ~NET_ADDR_RANDOM ; }else {
drivers/staging/ozwpan/ozcdev.c +1 -1
@@ -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 ;
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac.c +1 -1
@@ -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];
drivers/staging/rtl8187se/ieee80211/ieee80211_softmac_wx.c +1 -1
@@ -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);
drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c +1 -1
@@ -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 ; }
drivers/staging/rtl8187se/r8180_core.c +1 -1
@@ -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 ;
drivers/staging/rtl8192e/rtl8192e/rtl_core.c +3 -3
@@ -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; }
drivers/staging/rtl8192e/rtl819x_TSProc.c +1 -1
@@ -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;
drivers/staging/rtl8192e/rtllib_rx.c +4 -4
@@ -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);
drivers/staging/rtl8192e/rtllib_softmac.c +2 -2
@@ -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];
drivers/staging/rtl8192e/rtllib_softmac_wx.c +2 -2
@@ -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);
drivers/staging/rtl8192e/rtllib_tx.c +6 -6
@@ -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)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c +2 -2
@@ -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++; }
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c +1 -1
@@ -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];
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac_wx.c +1 -1
@@ -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);
drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c +6 -6
@@ -314,7 +314,7 @@ void ieee80211_tx_query_agg_cap(struct ieee80211_device* ieee, struct sk_buff* sif (!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_desvoid 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)
drivers/staging/rtl8192u/ieee80211/rtl819x_TSProc.c +1 -1
@@ -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;
drivers/staging/rtl8192u/r8192U_core.c +4 -4
@@ -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 */
drivers/staging/rtl8712/rtl871x_ioctl_linux.c +1 -1
@@ -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 ;
drivers/staging/rtl8712/rtl871x_ioctl_set.c +1 -1
@@ -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; }
drivers/staging/rtl8712/rtl871x_mlme.c +1 -1
@@ -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);
drivers/staging/rtl8712/rtl871x_recv.c +4 -4
@@ -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)
drivers/staging/slicoss/slicoss.c +1 -1
@@ -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);
drivers/staging/vt6655/bssdb.c +1 -1
@@ -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; }
drivers/staging/vt6655/card.c +1 -1
@@ -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 ;
drivers/staging/vt6655/device_main.c +1 -1
@@ -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) {
drivers/staging/vt6655/dpc.c +2 -2
@@ -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);
drivers/staging/vt6655/hostap.c +2 -2
@@ -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) {
drivers/staging/vt6655/iwctl.c +1 -1
@@ -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;
drivers/staging/vt6655/key.c +1 -1
@@ -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++) {
drivers/staging/vt6655/mib.c +4 -4
@@ -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]++;
drivers/staging/vt6655/rxtx.c +5 -5
@@ -1372,7 +1372,7 @@ s_cbFillTxBufHead(PSDevice pDevice, unsigned char byPktType, unsigned char *pbyTif ((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 *pbif ((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 ;
drivers/staging/vt6655/wpactl.c +2 -2
@@ -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),
drivers/staging/vt6656/bssdb.c +1 -1
@@ -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; }
drivers/staging/vt6656/dpc.c +2 -2
@@ -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);
drivers/staging/vt6656/hostap.c +2 -2
@@ -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) {
drivers/staging/vt6656/iwctl.c +1 -1
@@ -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;
drivers/staging/vt6656/key.c +1 -1
@@ -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++) {
drivers/staging/vt6656/rxtx.c +7 -7
@@ -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
drivers/staging/vt6656/wpactl.c +1 -1
@@ -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" );
drivers/staging/wlags49_h2/wl_wext.c +1 -1
@@ -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 );
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 7/21 infiniband: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- drivers/infiniband/hw/amso1100/c2.c | 2 +- drivers/infiniband/hw/nes/nes_nic.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/amso1100/c2.c +1 -1
@@ -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);
drivers/infiniband/hw/nes/nes_nic.c +1 -1
@@ -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);
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 8/21 scsi: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- 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(-)
drivers/scsi/bnx2fc/bnx2fc_els.c +2 -2
@@ -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);
drivers/scsi/bnx2fc/bnx2fc_fcoe.c +1 -1
@@ -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 ;
drivers/scsi/fcoe/fcoe.c +6 -6
@@ -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);
drivers/scsi/fcoe/fcoe_ctlr.c +4 -4
@@ -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);
drivers/scsi/fnic/fnic_fcs.c +3 -3
@@ -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); }
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 9/21 of: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- drivers/of/of_net.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/of/of_net.c +3 -3
@@ -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 ) &ð_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 ) &ð_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 ) &ð_addr_valid (pp->value))return pp->value;return NULL ;
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 10/21 s390: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- drivers/s390/net/qeth_l2_main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/s390/net/qeth_l2_main.c +2 -2
@@ -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 ; }
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 11/21 usb: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- drivers/usb/gadget/u_ether.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/usb/gadget/u_ether.c +3 -3
@@ -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);
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 12/21 uwb: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- drivers/uwb/address.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/uwb/address.c +1 -1
@@ -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 ;
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 13/21 Documentation: networking: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- Documentation/networking/driver.txt | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Documentation/networking/driver.txt +1 -1
@@ -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:
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 14/21 llc_if.h: Convert is_<foo>_ether_addr uses to eth_addr_<foo>
In reply to Joe PerchesConvert the old ether_addr tests to eth_addr_<foo>. Adds api consistency.
--- include/net/llc_if.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
include/net/llc_if.h +2 -2
@@ -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
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 15/21 in.h: Rename ipv4_is_<foo> functions to ipv4_addr_<foo>
In reply to Joe PerchesMake 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.
--- include/linux/in.h | 40 ++++++++++++++++++++++++++++------------ 1 files changed, 28 insertions(+), 12 deletions(-)
include/linux/in.h +28 -12
@@ -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 */
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 16/21 net: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
In reply to Joe PerchesUse the new ipv4_addr_<foo> functions to be consistent with the ipv6_addr_<foo> and eth_addr_<foo> style.
--- 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(-)
net/bridge/br_multicast.c +2 -2
@@ -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;
net/core/netpoll.c +1 -1
@@ -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);
net/core/pktgen.c +5 -5
@@ -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); }
net/ipv4/arp.c +2 -2
@@ -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;/*
net/ipv4/datagram.c +1 -1
@@ -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)
net/ipv4/devinet.c +2 -2
@@ -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);
net/ipv4/fib_frontend.c +6 -6
@@ -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 ;
net/ipv4/igmp.c +6 -6
@@ -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, structint 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 ();
net/ipv4/ip_gre.c +10 -10
@@ -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 *devif (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 ;
net/ipv4/ipmr.c +2 -2
@@ -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 ;
net/ipv4/netfilter/ipt_rpfilter.c +5 -5
@@ -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 ;
net/ipv4/ping.c +1 -1
@@ -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)
net/ipv4/raw.c +1 -1
@@ -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)
net/ipv4/route.c +29 -29
163 lines not on this page · raw message
net/ipv4/udp.c +1 -1
@@ -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)
net/ipv6/addrconf.c +6 -6
@@ -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 ;
net/l2tp/l2tp_ip.c +1 -1
@@ -303,7 +303,7 @@ static int l2tp_ip_connect(struct sock *sk, struct sockaddr *uaddr, int addr_lenif (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);
net/l2tp/l2tp_ip6.c +1 -1
@@ -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 ; }
net/netfilter/ipvs/ip_vs_xmit.c +3 -3
@@ -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",
net/netfilter/xt_cluster.c +1 -1
@@ -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 =
net/netfilter/xt_pkttype.c +1 -1
@@ -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 )
net/sctp/protocol.c +5 -5
@@ -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 ;
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 17/21 infiniband: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
In reply to Joe PerchesUse the new ipv4_addr_<foo> functions to be consistent with the ipv6_addr_<foo> and eth_addr_<foo> style.
--- drivers/infiniband/core/cma.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/core/cma.c +2 -2
@@ -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(
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 18/21 ath6kl: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
In reply to Joe PerchesUse the new ipv4_addr_<foo> functions to be consistent with the ipv6_addr_<foo> and eth_addr_<foo> style.
--- drivers/net/wireless/ath/ath6kl/wmi.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath6kl/wmi.c +2 -2
@@ -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 ));
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 19/21 parisc: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
In reply to Joe PerchesUse the new ipv4_addr_<foo> functions to be consistent with the ipv6_addr_<foo> and eth_addr_<foo> style.
--- drivers/parisc/led.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/parisc/led.c +1 -1
@@ -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;
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 20/21 lockd: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
In reply to Joe PerchesUse the new ipv4_addr_<foo> functions to be consistent with the ipv6_addr_<foo> and eth_addr_<foo> style.
--- include/linux/lockd/lockd.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
include/linux/lockd/lockd.h +2 -2
@@ -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 ; }
Signature · 1 line
1.7.8.111.gad25c.dirty
PATCH 21/21 sctp: Convert ipv4_is_<foo> uses to ipv4_addr_<foo>
In reply to Joe PerchesUse the new ipv4_addr_<foo> functions to be consistent with the ipv6_addr_<foo> and eth_addr_<foo> style.
--- include/net/sctp/constants.h | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-)
include/net/sctp/constants.h +6 -6
@@ -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
Signature · 1 line
1.7.8.111.gad25c.dirty
Quoted 31 lines · Joe Perches
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 structin6_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>
Quoted 8 lines
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.
(trimmed over long cc list from original 00/21 post)
Quoted 9 lines · Eric Dumazet
Quoted 8 lines · Joe Perches
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.
[]
Quoted 1 line
Yes they are some names discrepancies, thats a big deal.
missing a not maybe?
Quoted 2 lines
And we have
alloc_skb()/kfree_skb()/skb_clone()Why notskb_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.
Quoted 10 lines
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 wasrandom_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.
Quoted 11 lines
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
Quoted 10 lines · On Fri, 19 Oct 2012 09:04:14 +0200 Eric Dumazet <[email protected]> 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.
Signature · 2 lines
Regards, Pavel Roskin
(cc list trimmed)
Quoted 14 lines · Pavel Roskin
Quoted 10 lines · On Fri, 19 Oct 2012 09:04:14 +0200 Eric Dumazet <[email protected]> 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.
Quoted 8 lines
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.
David Miller
maintainerCC 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.