aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/feature-removal-schedule.txt7
-rw-r--r--Documentation/networking/ip-sysctl.txt6
-rw-r--r--MAINTAINERS5
-rw-r--r--arch/arm/mach-ixp4xx/fsg-setup.c9
-rw-r--r--arch/arm/mach-ixp4xx/nas100d-setup.c5
-rw-r--r--arch/arm/mach-ixp4xx/nslu2-setup.c5
-rw-r--r--arch/sparc64/kernel/idprom.c5
-rw-r--r--arch/um/drivers/net_kern.c7
-rw-r--r--arch/xtensa/platforms/iss/network.c5
-rw-r--r--drivers/firmware/iscsi_ibft.c4
-rw-r--r--drivers/infiniband/core/sysfs.c10
-rw-r--r--drivers/infiniband/hw/mthca/mthca_mcg.c23
-rw-r--r--drivers/infiniband/hw/nes/nes.c17
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c10
-rw-r--r--drivers/infiniband/hw/nes/nes_nic.c10
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib.h23
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_cm.c8
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c25
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_multicast.c70
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c31
-rw-r--r--drivers/isdn/i4l/isdn_net.c34
-rw-r--r--drivers/media/dvb/b2c2/flexcop.c2
-rw-r--r--drivers/media/dvb/bt8xx/dst.c4
-rw-r--r--drivers/media/dvb/dm1105/dm1105.c3
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-dvb.c5
-rw-r--r--drivers/media/dvb/pluto2/pluto2.c3
-rw-r--r--drivers/message/fusion/mptlan.c18
-rw-r--r--drivers/net/3c503.c3
-rw-r--r--drivers/net/3c505.c5
-rw-r--r--drivers/net/3c507.c3
-rw-r--r--drivers/net/3c509.c5
-rw-r--r--drivers/net/3c515.c3
-rw-r--r--drivers/net/3c523.c10
-rw-r--r--drivers/net/3c527.c3
-rw-r--r--drivers/net/3c59x.c3
-rw-r--r--drivers/net/8139cp.c5
-rw-r--r--drivers/net/8139too.c5
-rw-r--r--drivers/net/82596.c13
-rw-r--r--drivers/net/Kconfig13
-rw-r--r--drivers/net/Makefile1
-rw-r--r--drivers/net/a2065.c4
-rw-r--r--drivers/net/ac3200.c5
-rw-r--r--drivers/net/acenic.c3
-rw-r--r--drivers/net/amd8111e.c5
-rw-r--r--drivers/net/apne.c3
-rw-r--r--drivers/net/ariadne.c20
-rw-r--r--drivers/net/arm/am79c961a.c6
-rw-r--r--drivers/net/arm/at91_ether.c10
-rw-r--r--drivers/net/arm/ether1.c5
-rw-r--r--drivers/net/arm/ether3.c5
-rw-r--r--drivers/net/arm/etherh.c5
-rw-r--r--drivers/net/at1700.c3
-rw-r--r--drivers/net/atarilance.c17
-rw-r--r--drivers/net/atp.c5
-rw-r--r--drivers/net/ax88796.c9
-rw-r--r--drivers/net/b44.c5
-rw-r--r--drivers/net/bmac.c5
-rw-r--r--drivers/net/bnx2.c5
-rw-r--r--drivers/net/bnx2x_main.c13
-rw-r--r--drivers/net/bonding/bond_main.c19
-rw-r--r--drivers/net/bonding/bond_sysfs.c4
-rw-r--r--drivers/net/cassini.c5
-rw-r--r--drivers/net/cpmac.c5
-rw-r--r--drivers/net/cris/eth_v10.c4
-rw-r--r--drivers/net/cs89x0.c12
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c69
-rw-r--r--drivers/net/de600.c3
-rw-r--r--drivers/net/de620.c8
-rw-r--r--drivers/net/declance.c4
-rw-r--r--drivers/net/depca.c6
-rw-r--r--drivers/net/dl2k.c5
-rw-r--r--drivers/net/dm9000.c8
-rw-r--r--drivers/net/e100.c21
-rw-r--r--drivers/net/e1000/e1000_main.c10
-rw-r--r--drivers/net/e1000e/netdev.c11
-rw-r--r--drivers/net/eepro.c3
-rw-r--r--drivers/net/eepro100.c2401
-rw-r--r--drivers/net/enc28j60.c16
-rw-r--r--drivers/net/enic/enic_res.c7
-rw-r--r--drivers/net/enic/vnic_dev.c10
-rw-r--r--drivers/net/epic100.c7
-rw-r--r--drivers/net/es3210.c9
-rw-r--r--drivers/net/ewrk3.c7
-rw-r--r--drivers/net/fealnx.c5
-rw-r--r--drivers/net/fec.c4
-rw-r--r--drivers/net/forcedeth.c9
-rw-r--r--drivers/net/fs_enet/fs_enet-main.c5
-rw-r--r--drivers/net/gianfar.c4
-rw-r--r--drivers/net/hamachi.c5
-rw-r--r--drivers/net/hamradio/bpqether.c7
-rw-r--r--drivers/net/hp-plus.c3
-rw-r--r--drivers/net/hp.c3
-rw-r--r--drivers/net/hp100.c5
-rw-r--r--drivers/net/hydra.c5
-rw-r--r--drivers/net/ibm_newemac/core.c11
-rw-r--r--drivers/net/ibmlana.c5
-rw-r--r--drivers/net/ibmveth.c5
-rw-r--r--drivers/net/igb/igb_main.c6
-rw-r--r--drivers/net/ioc3-eth.c12
-rw-r--r--drivers/net/isa-skeleton.c3
-rw-r--r--drivers/net/ixgb/ixgb_main.c3
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c6
-rw-r--r--drivers/net/jazzsonic.c4
-rw-r--r--drivers/net/jme.c12
-rw-r--r--drivers/net/lance.c3
-rw-r--r--drivers/net/lib82596.c13
-rw-r--r--drivers/net/lne390.c5
-rw-r--r--drivers/net/mac89x0.c4
-rw-r--r--drivers/net/macb.c7
-rw-r--r--drivers/net/mace.c5
-rw-r--r--drivers/net/macmace.c5
-rw-r--r--drivers/net/macsonic.c9
-rw-r--r--drivers/net/macvlan.c24
-rw-r--r--drivers/net/meth.c3
-rw-r--r--drivers/net/mlx4/mcg.c23
-rw-r--r--drivers/net/mv643xx_eth.c5
-rw-r--r--drivers/net/mvme147.c5
-rw-r--r--drivers/net/myri10ge/myri10ge.c4
-rw-r--r--drivers/net/myri_sbus.c14
-rw-r--r--drivers/net/natsemi.c5
-rw-r--r--drivers/net/ne-h8300.c3
-rw-r--r--drivers/net/ne.c3
-rw-r--r--drivers/net/ne2.c6
-rw-r--r--drivers/net/ne2k-pci.c5
-rw-r--r--drivers/net/ne3210.c5
-rw-r--r--drivers/net/netconsole.c9
-rw-r--r--drivers/net/netxen/netxen_nic_main.c8
-rw-r--r--drivers/net/netxen/netxen_nic_niu.c7
-rw-r--r--drivers/net/ni5010.c3
-rw-r--r--drivers/net/niu.c4
-rw-r--r--drivers/net/ns83820.c6
-rw-r--r--drivers/net/pasemi_mac.c5
-rw-r--r--drivers/net/pci-skeleton.c5
-rw-r--r--drivers/net/pcmcia/3c574_cs.c5
-rw-r--r--drivers/net/pcmcia/3c589_cs.c5
-rw-r--r--drivers/net/pcmcia/axnet_cs.c5
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c5
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c5
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c3
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c5
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c5
-rw-r--r--drivers/net/pcnet32.c3
-rw-r--r--drivers/net/pppoe.c5
-rw-r--r--drivers/net/ps3_gelic_net.c6
-rw-r--r--drivers/net/ps3_gelic_wireless.c20
-rw-r--r--drivers/net/qla3xxx.c9
-rw-r--r--drivers/net/qlge/qlge_main.c11
-rw-r--r--drivers/net/rionet.c5
-rw-r--r--drivers/net/rrunner.c3
-rw-r--r--drivers/net/s2io.c10
-rw-r--r--drivers/net/sb1250-mac.c5
-rw-r--r--drivers/net/seeq8005.c3
-rw-r--r--drivers/net/sfc/efx.c15
-rw-r--r--drivers/net/sgiseeq.c4
-rw-r--r--drivers/net/sis190.c6
-rw-r--r--drivers/net/sis900.c5
-rw-r--r--drivers/net/skge.c43
-rw-r--r--drivers/net/sky2.c5
-rw-r--r--drivers/net/smc-mca.c5
-rw-r--r--drivers/net/smc-ultra.c5
-rw-r--r--drivers/net/smc-ultra32.c5
-rw-r--r--drivers/net/smc9194.c4
-rw-r--r--drivers/net/smc91x.c5
-rw-r--r--drivers/net/starfire.c13
-rw-r--r--drivers/net/sun3lance.c9
-rw-r--r--drivers/net/sunbmac.c5
-rw-r--r--drivers/net/sundance.c5
-rw-r--r--drivers/net/sungem.c6
-rw-r--r--drivers/net/sunhme.c6
-rw-r--r--drivers/net/sunlance.c5
-rw-r--r--drivers/net/sunvnet.c5
-rw-r--r--drivers/net/tc35815.c22
-rw-r--r--drivers/net/tg3.c5
-rw-r--r--drivers/net/tokenring/abyss.c4
-rw-r--r--drivers/net/tokenring/ibmtr.c10
-rw-r--r--drivers/net/tokenring/lanstreamer.c35
-rw-r--r--drivers/net/tokenring/madgemc.c10
-rw-r--r--drivers/net/tokenring/olympic.c50
-rw-r--r--drivers/net/tokenring/proteon.c5
-rw-r--r--drivers/net/tokenring/skisa.c5
-rw-r--r--drivers/net/tokenring/tmspci.c5
-rw-r--r--drivers/net/tsi108_eth.c5
-rw-r--r--drivers/net/tulip/de2104x.c5
-rw-r--r--drivers/net/tulip/de4x5.c12
-rw-r--r--drivers/net/tulip/dmfe.c6
-rw-r--r--drivers/net/tulip/tulip_core.c11
-rw-r--r--drivers/net/tulip/uli526x.c5
-rw-r--r--drivers/net/tulip/winbond-840.c15
-rw-r--r--drivers/net/tulip/xircom_cb.c3
-rw-r--r--drivers/net/tun.c5
-rw-r--r--drivers/net/typhoon.c5
-rw-r--r--drivers/net/usb/pegasus.c5
-rw-r--r--drivers/net/usb/smsc95xx.c4
-rw-r--r--drivers/net/usb/usbnet.c5
-rw-r--r--drivers/net/veth.c16
-rw-r--r--drivers/net/via-rhine.c5
-rw-r--r--drivers/net/virtio_net.c4
-rw-r--r--drivers/net/wan/dscc4.c3
-rw-r--r--drivers/net/wan/pc300too.c2
-rw-r--r--drivers/net/wan/pci200syn.c2
-rw-r--r--drivers/net/wd.c5
-rw-r--r--drivers/net/wireless/adm8211.c5
-rw-r--r--drivers/net/wireless/airo.c17
-rw-r--r--drivers/net/wireless/arlan-main.c26
-rw-r--r--drivers/net/wireless/ath9k/core.c3
-rw-r--r--drivers/net/wireless/ath9k/hw.c5
-rw-r--r--drivers/net/wireless/ath9k/main.c19
-rw-r--r--drivers/net/wireless/ath9k/rc.c9
-rw-r--r--drivers/net/wireless/ath9k/xmit.c1
-rw-r--r--drivers/net/wireless/atmel.c5
-rw-r--r--drivers/net/wireless/b43/main.c5
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_rx.c59
-rw-r--r--drivers/net/wireless/hostap/hostap_80211_tx.c15
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c241
-rw-r--r--drivers/net/wireless/hostap/hostap_hw.c10
-rw-r--r--drivers/net/wireless/hostap/hostap_info.c16
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c16
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c26
-rw-r--r--drivers/net/wireless/hostap/hostap_pci.c2
-rw-r--r--drivers/net/wireless/hostap/hostap_proc.c15
-rw-r--r--drivers/net/wireless/ipw2100.c31
-rw-r--r--drivers/net/wireless/ipw2200.c219
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945-rs.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rs.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c47
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-sta.c38
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-tx.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c54
-rw-r--r--drivers/net/wireless/libertas/assoc.c32
-rw-r--r--drivers/net/wireless/libertas/cmd.c5
-rw-r--r--drivers/net/wireless/libertas/debugfs.c6
-rw-r--r--drivers/net/wireless/libertas/main.c9
-rw-r--r--drivers/net/wireless/libertas/scan.c11
-rw-r--r--drivers/net/wireless/libertas/wext.c3
-rw-r--r--drivers/net/wireless/libertas_tf/cmd.c5
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c15
-rw-r--r--drivers/net/wireless/netwave_cs.c5
-rw-r--r--drivers/net/wireless/orinoco.c10
-rw-r--r--drivers/net/wireless/p54/p54common.c5
-rw-r--r--drivers/net/wireless/p54/p54pci.c1
-rw-r--r--drivers/net/wireless/p54/p54usb.c1
-rw-r--r--drivers/net/wireless/prism54/isl_ioctl.c24
-rw-r--r--drivers/net/wireless/ray_cs.c9
-rw-r--r--drivers/net/wireless/rndis_wlan.c9
-rw-r--r--drivers/net/wireless/rt2x00/rt2400pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c3
-rw-r--r--drivers/net/wireless/rt2x00/rt61pci.c4
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c4
-rw-r--r--drivers/net/wireless/rtl8180_dev.c5
-rw-r--r--drivers/net/wireless/rtl8187_dev.c5
-rw-r--r--drivers/net/wireless/wavelan.c33
-rw-r--r--drivers/net/wireless/wavelan_cs.c38
-rw-r--r--drivers/net/wireless/wl3501_cs.c10
-rw-r--r--drivers/net/wireless/zd1211rw/zd_chip.c4
-rw-r--r--drivers/net/wireless/zd1211rw/zd_mac.c6
-rw-r--r--drivers/net/xtsonic.c6
-rw-r--r--drivers/net/yellowfin.c13
-rw-r--r--drivers/net/znet.c5
-rw-r--r--drivers/net/zorro8390.c7
-rw-r--r--drivers/s390/net/qeth_l2_main.c18
-rw-r--r--drivers/scsi/iscsi_tcp.c2
-rw-r--r--drivers/usb/atm/cxacru.c4
-rw-r--r--drivers/usb/atm/usbatm.c5
-rw-r--r--drivers/usb/gadget/u_ether.c6
-rw-r--r--drivers/uwb/wlp/eda.c38
-rw-r--r--fs/cifs/cifs_spnego.c3
-rw-r--r--fs/lockd/host.c2
-rw-r--r--fs/nfs/super.c3
-rw-r--r--include/linux/kernel.h12
-rw-r--r--include/linux/rculist.h17
-rw-r--r--include/linux/skbuff.h15
-rw-r--r--include/linux/sunrpc/svc_xprt.h4
-rw-r--r--include/linux/xfrm.h14
-rw-r--r--include/net/dst.h3
-rw-r--r--include/net/ip_vs.h4
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h6
-rw-r--r--include/net/netlink.h22
-rw-r--r--include/net/netns/ipv4.h2
-rw-r--r--include/net/sctp/sctp.h4
-rw-r--r--include/net/sock.h41
-rw-r--r--include/net/udp.h25
-rw-r--r--include/net/udplite.h2
-rw-r--r--include/net/xfrm.h4
-rw-r--r--lib/vsprintf.c70
-rw-r--r--net/802/tr.c22
-rw-r--r--net/8021q/vlan.c8
-rw-r--r--net/8021q/vlan.h6
-rw-r--r--net/8021q/vlan_dev.c22
-rw-r--r--net/Kconfig2
-rw-r--r--net/appletalk/aarp.c3
-rw-r--r--net/atm/br2684.c5
-rw-r--r--net/atm/lec.c26
-rw-r--r--net/bridge/netfilter/ebt_log.c6
-rw-r--r--net/core/dev.c25
-rw-r--r--net/core/neighbour.c2
-rw-r--r--net/core/net-sysfs.c7
-rw-r--r--net/core/net_namespace.c2
-rw-r--r--net/core/netpoll.c5
-rw-r--r--net/core/pktgen.c9
-rw-r--r--net/core/skbuff.c2
-rw-r--r--net/core/sock.c3
-rw-r--r--net/ieee80211/ieee80211_crypt_ccmp.c13
-rw-r--r--net/ieee80211/ieee80211_crypt_tkip.c29
-rw-r--r--net/ieee80211/ieee80211_rx.c71
-rw-r--r--net/ieee80211/ieee80211_wx.c5
-rw-r--r--net/ipv4/cipso_ipv4.c1
-rw-r--r--net/ipv4/devinet.c9
-rw-r--r--net/ipv4/icmp.c3
-rw-r--r--net/ipv4/ip_forward.c2
-rw-r--r--net/ipv4/route.c135
-rw-r--r--net/ipv4/sysctl_net_ipv4.c12
-rw-r--r--net/ipv4/tcp_input.c4
-rw-r--r--net/ipv4/tcp_timer.c4
-rw-r--r--net/ipv4/udp.c241
-rw-r--r--net/ipv4/udp_impl.h4
-rw-r--r--net/ipv4/udplite.c14
-rw-r--r--net/ipv6/addrconf.c5
-rw-r--r--net/ipv6/addrlabel.c34
-rw-r--r--net/ipv6/ah6.c4
-rw-r--r--net/ipv6/anycast.c6
-rw-r--r--net/ipv6/esp6.c4
-rw-r--r--net/ipv6/exthdrs.c2
-rw-r--r--net/ipv6/icmp.c7
-rw-r--r--net/ipv6/ip6_flowlabel.c4
-rw-r--r--net/ipv6/ip6_output.c2
-rw-r--r--net/ipv6/ip6mr.c5
-rw-r--r--net/ipv6/ipcomp6.c4
-rw-r--r--net/ipv6/mcast.c10
-rw-r--r--net/ipv6/ndisc.c7
-rw-r--r--net/ipv6/netfilter/ip6t_LOG.c2
-rw-r--r--net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c5
-rw-r--r--net/ipv6/route.c9
-rw-r--r--net/ipv6/tcp_ipv6.c8
-rw-r--r--net/ipv6/udp.c137
-rw-r--r--net/ipv6/udp_impl.h4
-rw-r--r--net/ipv6/udplite.c9
-rw-r--r--net/irda/irlan/irlan_client.c4
-rw-r--r--net/llc/llc_proc.c3
-rw-r--r--net/mac80211/debugfs_key.c4
-rw-r--r--net/mac80211/debugfs_netdev.c3
-rw-r--r--net/mac80211/debugfs_sta.c5
-rw-r--r--net/mac80211/event.c5
-rw-r--r--net/mac80211/ht.c42
-rw-r--r--net/mac80211/key.c10
-rw-r--r--net/mac80211/mesh_plink.c49
-rw-r--r--net/mac80211/mlme.c121
-rw-r--r--net/mac80211/rx.c38
-rw-r--r--net/mac80211/sta_info.c33
-rw-r--r--net/mac80211/tkip.c10
-rw-r--r--net/mac80211/tx.c24
-rw-r--r--net/mac80211/wme.c8
-rw-r--r--net/mac80211/wpa.c3
-rw-r--r--net/netfilter/ipvs/ip_vs_conn.c20
-rw-r--r--net/netfilter/ipvs/ip_vs_core.c8
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c8
-rw-r--r--net/netfilter/ipvs/ip_vs_proto.c19
-rw-r--r--net/netfilter/ipvs/ip_vs_proto_ah_esp.c5
-rw-r--r--net/netfilter/ipvs/ip_vs_xmit.c17
-rw-r--r--net/netfilter/nf_conntrack_ftp.c8
-rw-r--r--net/netfilter/nf_conntrack_h323_main.c12
-rw-r--r--net/netfilter/xt_hashlimit.c7
-rw-r--r--net/netfilter/xt_recent.c5
-rw-r--r--net/netlabel/netlabel_addrlist.c2
-rw-r--r--net/netlink/attr.c2
-rw-r--r--net/sctp/ipv6.c35
-rw-r--r--net/sctp/sm_statefuns.c5
-rw-r--r--net/sunrpc/clnt.c4
-rw-r--r--net/sunrpc/rpcb_clnt.c6
-rw-r--r--net/sunrpc/svcauth_unix.c7
-rw-r--r--net/sunrpc/xprtsock.c26
-rw-r--r--net/tipc/eth_media.c3
-rw-r--r--net/xfrm/xfrm_policy.c6
-rw-r--r--net/xfrm/xfrm_state.c12
-rw-r--r--net/xfrm/xfrm_user.c52
-rw-r--r--security/selinux/avc.c2
-rw-r--r--security/selinux/hooks.c4
380 files changed, 2131 insertions, 5125 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt
index 05d71b4b9430..6ecd4f0a24f0 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -144,13 +144,6 @@ Who: Christoph Hellwig <hch@lst.de>
144 144
145--------------------------- 145---------------------------
146 146
147What: eepro100 network driver
148When: January 2007
149Why: replaced by the e100 driver
150Who: Adrian Bunk <bunk@stusta.de>
151
152---------------------------
153
154What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports 147What: Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports
155 (temporary transition config option provided until then) 148 (temporary transition config option provided until then)
156 The transition config option will also be removed at the same time. 149 The transition config option will also be removed at the same time.
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index d84932650fd3..c7712787933c 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -27,6 +27,12 @@ min_adv_mss - INTEGER
27 The advertised MSS depends on the first hop route MTU, but will 27 The advertised MSS depends on the first hop route MTU, but will
28 never be lower than this setting. 28 never be lower than this setting.
29 29
30rt_cache_rebuild_count - INTEGER
31 The per net-namespace route cache emergency rebuild threshold.
32 Any net-namespace having its route cache rebuilt due to
33 a hash bucket chain being too long more than this many times
34 will have its route caching disabled
35
30IP Fragmentation: 36IP Fragmentation:
31 37
32ipfrag_high_thresh - INTEGER 38ipfrag_high_thresh - INTEGER
diff --git a/MAINTAINERS b/MAINTAINERS
index d643e862b8e4..cda50d690735 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1606,11 +1606,6 @@ L: acpi4asus-user@lists.sourceforge.net
1606W: http://sourceforge.net/projects/acpi4asus 1606W: http://sourceforge.net/projects/acpi4asus
1607S: Maintained 1607S: Maintained
1608 1608
1609EEPRO100 NETWORK DRIVER
1610P: Andrey V. Savochkin
1611M: saw@saw.sw.com.sg
1612S: Maintained
1613
1614EFS FILESYSTEM 1609EFS FILESYSTEM
1615W: http://aeschi.ch.eu.org/efs/ 1610W: http://aeschi.ch.eu.org/efs/
1616S: Orphan 1611S: Orphan
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c
index e7c6386782ed..5add22fc9899 100644
--- a/arch/arm/mach-ixp4xx/fsg-setup.c
+++ b/arch/arm/mach-ixp4xx/fsg-setup.c
@@ -177,7 +177,6 @@ static irqreturn_t fsg_reset_handler(int irq, void *dev_id)
177 177
178static void __init fsg_init(void) 178static void __init fsg_init(void)
179{ 179{
180 DECLARE_MAC_BUF(mac_buf);
181 uint8_t __iomem *f; 180 uint8_t __iomem *f;
182 181
183 ixp4xx_sys_init(); 182 ixp4xx_sys_init();
@@ -256,10 +255,10 @@ static void __init fsg_init(void)
256#endif 255#endif
257 iounmap(f); 256 iounmap(f);
258 } 257 }
259 printk(KERN_INFO "FSG: Using MAC address %s for port 0\n", 258 printk(KERN_INFO "FSG: Using MAC address %pM for port 0\n",
260 print_mac(mac_buf, fsg_plat_eth[0].hwaddr)); 259 fsg_plat_eth[0].hwaddr);
261 printk(KERN_INFO "FSG: Using MAC address %s for port 1\n", 260 printk(KERN_INFO "FSG: Using MAC address %pM for port 1\n",
262 print_mac(mac_buf, fsg_plat_eth[1].hwaddr)); 261 fsg_plat_eth[1].hwaddr);
263 262
264} 263}
265 264
diff --git a/arch/arm/mach-ixp4xx/nas100d-setup.c b/arch/arm/mach-ixp4xx/nas100d-setup.c
index 0acd95ecf27e..921c947b5b6b 100644
--- a/arch/arm/mach-ixp4xx/nas100d-setup.c
+++ b/arch/arm/mach-ixp4xx/nas100d-setup.c
@@ -231,7 +231,6 @@ static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
231 231
232static void __init nas100d_init(void) 232static void __init nas100d_init(void)
233{ 233{
234 DECLARE_MAC_BUF(mac_buf);
235 uint8_t __iomem *f; 234 uint8_t __iomem *f;
236 int i; 235 int i;
237 236
@@ -294,8 +293,8 @@ static void __init nas100d_init(void)
294#endif 293#endif
295 iounmap(f); 294 iounmap(f);
296 } 295 }
297 printk(KERN_INFO "NAS100D: Using MAC address %s for port 0\n", 296 printk(KERN_INFO "NAS100D: Using MAC address %pM for port 0\n",
298 print_mac(mac_buf, nas100d_plat_eth[0].hwaddr)); 297 nas100d_plat_eth[0].hwaddr);
299 298
300} 299}
301 300
diff --git a/arch/arm/mach-ixp4xx/nslu2-setup.c b/arch/arm/mach-ixp4xx/nslu2-setup.c
index bc9d920ae54f..ff6a08d02cc4 100644
--- a/arch/arm/mach-ixp4xx/nslu2-setup.c
+++ b/arch/arm/mach-ixp4xx/nslu2-setup.c
@@ -220,7 +220,6 @@ static struct sys_timer nslu2_timer = {
220 220
221static void __init nslu2_init(void) 221static void __init nslu2_init(void)
222{ 222{
223 DECLARE_MAC_BUF(mac_buf);
224 uint8_t __iomem *f; 223 uint8_t __iomem *f;
225 int i; 224 int i;
226 225
@@ -275,8 +274,8 @@ static void __init nslu2_init(void)
275#endif 274#endif
276 iounmap(f); 275 iounmap(f);
277 } 276 }
278 printk(KERN_INFO "NSLU2: Using MAC address %s for port 0\n", 277 printk(KERN_INFO "NSLU2: Using MAC address %pM for port 0\n",
279 print_mac(mac_buf, nslu2_plat_eth[0].hwaddr)); 278 nslu2_plat_eth[0].hwaddr);
280 279
281} 280}
282 281
diff --git a/arch/sparc64/kernel/idprom.c b/arch/sparc64/kernel/idprom.c
index 5b45a808c621..a62ff83337cd 100644
--- a/arch/sparc64/kernel/idprom.c
+++ b/arch/sparc64/kernel/idprom.c
@@ -42,8 +42,5 @@ void __init idprom_init(void)
42 idprom->id_cksum, calc_idprom_cksum(idprom)); 42 idprom->id_cksum, calc_idprom_cksum(idprom));
43 } 43 }
44 44
45 printk("Ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n", 45 printk("Ethernet address: %pM\n", idprom->id_ethaddr);
46 idprom->id_ethaddr[0], idprom->id_ethaddr[1],
47 idprom->id_ethaddr[2], idprom->id_ethaddr[3],
48 idprom->id_ethaddr[4], idprom->id_ethaddr[5]);
49} 46}
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 5b4ca8d93682..74f1a1787026 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -418,12 +418,7 @@ static void eth_configure(int n, void *init, char *mac,
418 418
419 setup_etheraddr(mac, device->mac, dev->name); 419 setup_etheraddr(mac, device->mac, dev->name);
420 420
421 printk(KERN_INFO "Netdevice %d ", n); 421 printk(KERN_INFO "Netdevice %d (%pM) : ", n, device->mac);
422 printk("(%02x:%02x:%02x:%02x:%02x:%02x) ",
423 device->mac[0], device->mac[1],
424 device->mac[2], device->mac[3],
425 device->mac[4], device->mac[5]);
426 printk(": ");
427 422
428 lp = dev->priv; 423 lp = dev->priv;
429 /* This points to the transport private data. It's still clear, but we 424 /* This points to the transport private data. It's still clear, but we
diff --git a/arch/xtensa/platforms/iss/network.c b/arch/xtensa/platforms/iss/network.c
index 11a20adc1409..87f47cade013 100644
--- a/arch/xtensa/platforms/iss/network.c
+++ b/arch/xtensa/platforms/iss/network.c
@@ -660,10 +660,7 @@ static int iss_net_configure(int index, char *init)
660 660
661 printk(KERN_INFO "Netdevice %d ", index); 661 printk(KERN_INFO "Netdevice %d ", index);
662 if (lp->have_mac) 662 if (lp->have_mac)
663 printk("(%02x:%02x:%02x:%02x:%02x:%02x) ", 663 printk("(%pM) ", lp->mac);
664 lp->mac[0], lp->mac[1],
665 lp->mac[2], lp->mac[3],
666 lp->mac[4], lp->mac[5]);
667 printk(": "); 664 printk(": ");
668 665
669 /* sysfs register */ 666 /* sysfs register */
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 4353414a0b77..acb82aff8808 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -290,9 +290,7 @@ static ssize_t sprintf_ipaddr(char *buf, u8 *ip)
290 /* 290 /*
291 * IPv6 291 * IPv6
292 */ 292 */
293 str += sprintf(str, NIP6_FMT, ntohs(ip[0]), ntohs(ip[1]), 293 str += sprintf(str, "%pI6", ip);
294 ntohs(ip[2]), ntohs(ip[3]), ntohs(ip[4]),
295 ntohs(ip[5]), ntohs(ip[6]), ntohs(ip[7]));
296 } 294 }
297 str += sprintf(str, "\n"); 295 str += sprintf(str, "\n");
298 return str - buf; 296 return str - buf;
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 4d1042115598..4f4d1bb9f069 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -262,15 +262,7 @@ static ssize_t show_port_gid(struct ib_port *p, struct port_attribute *attr,
262 if (ret) 262 if (ret)
263 return ret; 263 return ret;
264 264
265 return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", 265 return sprintf(buf, "%pI6\n", gid.raw);
266 be16_to_cpu(((__be16 *) gid.raw)[0]),
267 be16_to_cpu(((__be16 *) gid.raw)[1]),
268 be16_to_cpu(((__be16 *) gid.raw)[2]),
269 be16_to_cpu(((__be16 *) gid.raw)[3]),
270 be16_to_cpu(((__be16 *) gid.raw)[4]),
271 be16_to_cpu(((__be16 *) gid.raw)[5]),
272 be16_to_cpu(((__be16 *) gid.raw)[6]),
273 be16_to_cpu(((__be16 *) gid.raw)[7]));
274} 266}
275 267
276static ssize_t show_port_pkey(struct ib_port *p, struct port_attribute *attr, 268static ssize_t show_port_pkey(struct ib_port *p, struct port_attribute *attr,
diff --git a/drivers/infiniband/hw/mthca/mthca_mcg.c b/drivers/infiniband/hw/mthca/mthca_mcg.c
index 3f5f94879208..d4c81053e439 100644
--- a/drivers/infiniband/hw/mthca/mthca_mcg.c
+++ b/drivers/infiniband/hw/mthca/mthca_mcg.c
@@ -87,17 +87,7 @@ static int find_mgm(struct mthca_dev *dev,
87 } 87 }
88 88
89 if (0) 89 if (0)
90 mthca_dbg(dev, "Hash for %04x:%04x:%04x:%04x:" 90 mthca_dbg(dev, "Hash for %pI6 is %04x\n", gid, *hash);
91 "%04x:%04x:%04x:%04x is %04x\n",
92 be16_to_cpu(((__be16 *) gid)[0]),
93 be16_to_cpu(((__be16 *) gid)[1]),
94 be16_to_cpu(((__be16 *) gid)[2]),
95 be16_to_cpu(((__be16 *) gid)[3]),
96 be16_to_cpu(((__be16 *) gid)[4]),
97 be16_to_cpu(((__be16 *) gid)[5]),
98 be16_to_cpu(((__be16 *) gid)[6]),
99 be16_to_cpu(((__be16 *) gid)[7]),
100 *hash);
101 91
102 *index = *hash; 92 *index = *hash;
103 *prev = -1; 93 *prev = -1;
@@ -264,16 +254,7 @@ int mthca_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
264 goto out; 254 goto out;
265 255
266 if (index == -1) { 256 if (index == -1) {
267 mthca_err(dev, "MGID %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x " 257 mthca_err(dev, "MGID %pI6 not found\n", gid->raw);
268 "not found\n",
269 be16_to_cpu(((__be16 *) gid->raw)[0]),
270 be16_to_cpu(((__be16 *) gid->raw)[1]),
271 be16_to_cpu(((__be16 *) gid->raw)[2]),
272 be16_to_cpu(((__be16 *) gid->raw)[3]),
273 be16_to_cpu(((__be16 *) gid->raw)[4]),
274 be16_to_cpu(((__be16 *) gid->raw)[5]),
275 be16_to_cpu(((__be16 *) gid->raw)[6]),
276 be16_to_cpu(((__be16 *) gid->raw)[7]));
277 err = -EINVAL; 258 err = -EINVAL;
278 goto out; 259 goto out;
279 } 260 }
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index a2b04d62b1a4..fb7d243b1a23 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -138,14 +138,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
138 struct nes_device *nesdev; 138 struct nes_device *nesdev;
139 struct net_device *netdev; 139 struct net_device *netdev;
140 struct nes_vnic *nesvnic; 140 struct nes_vnic *nesvnic;
141 unsigned int addr; 141
142 unsigned int mask; 142 nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address %pI4, netmask %pI4.\n",
143 143 &ifa->ifa_address, &ifa->ifa_mask);
144 addr = ntohl(ifa->ifa_address);
145 mask = ntohl(ifa->ifa_mask);
146 nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address " NIPQUAD_FMT
147 ", netmask " NIPQUAD_FMT ".\n",
148 HIPQUAD(addr), HIPQUAD(mask));
149 list_for_each_entry(nesdev, &nes_dev_list, list) { 144 list_for_each_entry(nesdev, &nes_dev_list, list) {
150 nes_debug(NES_DBG_NETDEV, "Nesdev list entry = 0x%p. (%s)\n", 145 nes_debug(NES_DBG_NETDEV, "Nesdev list entry = 0x%p. (%s)\n",
151 nesdev, nesdev->netdev[0]->name); 146 nesdev, nesdev->netdev[0]->name);
@@ -356,10 +351,8 @@ struct ib_qp *nes_get_qp(struct ib_device *device, int qpn)
356 */ 351 */
357static void nes_print_macaddr(struct net_device *netdev) 352static void nes_print_macaddr(struct net_device *netdev)
358{ 353{
359 DECLARE_MAC_BUF(mac); 354 nes_debug(NES_DBG_INIT, "%s: %pM, IRQ %u\n",
360 355 netdev->name, netdev->dev_addr, netdev->irq);
361 nes_debug(NES_DBG_INIT, "%s: %s, IRQ %u\n",
362 netdev->name, print_mac(mac, netdev->dev_addr), netdev->irq);
363} 356}
364 357
365/** 358/**
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 2caf9da81ad5..6058d05e975d 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1027,7 +1027,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip)
1027 struct flowi fl; 1027 struct flowi fl;
1028 struct neighbour *neigh; 1028 struct neighbour *neigh;
1029 int rc = -1; 1029 int rc = -1;
1030 DECLARE_MAC_BUF(mac);
1031 1030
1032 memset(&fl, 0, sizeof fl); 1031 memset(&fl, 0, sizeof fl);
1033 fl.nl_u.ip4_u.daddr = htonl(dst_ip); 1032 fl.nl_u.ip4_u.daddr = htonl(dst_ip);
@@ -1041,8 +1040,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip)
1041 if (neigh) { 1040 if (neigh) {
1042 if (neigh->nud_state & NUD_VALID) { 1041 if (neigh->nud_state & NUD_VALID) {
1043 nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X" 1042 nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"
1044 " is %s, Gateway is 0x%08X \n", dst_ip, 1043 " is %pM, Gateway is 0x%08X \n", dst_ip,
1045 print_mac(mac, neigh->ha), ntohl(rt->rt_gateway)); 1044 neigh->ha, ntohl(rt->rt_gateway));
1046 nes_manage_arp_cache(nesvnic->netdev, neigh->ha, 1045 nes_manage_arp_cache(nesvnic->netdev, neigh->ha,
1047 dst_ip, NES_ARP_ADD); 1046 dst_ip, NES_ARP_ADD);
1048 rc = nes_arp_table(nesvnic->nesdev, dst_ip, NULL, 1047 rc = nes_arp_table(nesvnic->nesdev, dst_ip, NULL,
@@ -1071,7 +1070,6 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
1071 int arpindex = 0; 1070 int arpindex = 0;
1072 struct nes_device *nesdev; 1071 struct nes_device *nesdev;
1073 struct nes_adapter *nesadapter; 1072 struct nes_adapter *nesadapter;
1074 DECLARE_MAC_BUF(mac);
1075 1073
1076 /* create an hte and cm_node for this instance */ 1074 /* create an hte and cm_node for this instance */
1077 cm_node = kzalloc(sizeof(*cm_node), GFP_ATOMIC); 1075 cm_node = kzalloc(sizeof(*cm_node), GFP_ATOMIC);
@@ -1137,8 +1135,8 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
1137 1135
1138 /* copy the mac addr to node context */ 1136 /* copy the mac addr to node context */
1139 memcpy(cm_node->rem_mac, nesadapter->arp_table[arpindex].mac_addr, ETH_ALEN); 1137 memcpy(cm_node->rem_mac, nesadapter->arp_table[arpindex].mac_addr, ETH_ALEN);
1140 nes_debug(NES_DBG_CM, "Remote mac addr from arp table: %s\n", 1138 nes_debug(NES_DBG_CM, "Remote mac addr from arp table: %pM\n",
1141 print_mac(mac, cm_node->rem_mac)); 1139 cm_node->rem_mac);
1142 1140
1143 add_hte_node(cm_core, cm_node); 1141 add_hte_node(cm_core, cm_node);
1144 atomic_inc(&cm_nodes_created); 1142 atomic_inc(&cm_nodes_created);
diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 730358637bb6..3c96203e0d91 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -797,14 +797,13 @@ static int nes_netdev_set_mac_address(struct net_device *netdev, void *p)
797 int i; 797 int i;
798 u32 macaddr_low; 798 u32 macaddr_low;
799 u16 macaddr_high; 799 u16 macaddr_high;
800 DECLARE_MAC_BUF(mac);
801 800
802 if (!is_valid_ether_addr(mac_addr->sa_data)) 801 if (!is_valid_ether_addr(mac_addr->sa_data))
803 return -EADDRNOTAVAIL; 802 return -EADDRNOTAVAIL;
804 803
805 memcpy(netdev->dev_addr, mac_addr->sa_data, netdev->addr_len); 804 memcpy(netdev->dev_addr, mac_addr->sa_data, netdev->addr_len);
806 printk(PFX "%s: Address length = %d, Address = %s\n", 805 printk(PFX "%s: Address length = %d, Address = %pM\n",
807 __func__, netdev->addr_len, print_mac(mac, mac_addr->sa_data)); 806 __func__, netdev->addr_len, mac_addr->sa_data);
808 macaddr_high = ((u16)netdev->dev_addr[0]) << 8; 807 macaddr_high = ((u16)netdev->dev_addr[0]) << 8;
809 macaddr_high += (u16)netdev->dev_addr[1]; 808 macaddr_high += (u16)netdev->dev_addr[1];
810 macaddr_low = ((u32)netdev->dev_addr[2]) << 24; 809 macaddr_low = ((u32)netdev->dev_addr[2]) << 24;
@@ -909,9 +908,8 @@ static void nes_netdev_set_multicast_list(struct net_device *netdev)
909 if (mc_index >= max_pft_entries_avaiable) 908 if (mc_index >= max_pft_entries_avaiable)
910 break; 909 break;
911 if (multicast_addr) { 910 if (multicast_addr) {
912 DECLARE_MAC_BUF(mac); 911 nes_debug(NES_DBG_NIC_RX, "Assigning MC Address %pM to register 0x%04X nic_idx=%d\n",
913 nes_debug(NES_DBG_NIC_RX, "Assigning MC Address %s to register 0x%04X nic_idx=%d\n", 912 multicast_addr->dmi_addr,
914 print_mac(mac, multicast_addr->dmi_addr),
915 perfect_filter_register_address+(mc_index * 8), 913 perfect_filter_register_address+(mc_index * 8),
916 mc_nic_index); 914 mc_nic_index);
917 macaddr_high = ((u16)multicast_addr->dmi_addr[0]) << 8; 915 macaddr_high = ((u16)multicast_addr->dmi_addr[0]) << 8;
diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
index e0c7dfabf2b4..753a983a5fdc 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib.h
+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -732,29 +732,6 @@ extern int ipoib_debug_level;
732 do { (void) (priv); } while (0) 732 do { (void) (priv); } while (0)
733#endif /* CONFIG_INFINIBAND_IPOIB_DEBUG_DATA */ 733#endif /* CONFIG_INFINIBAND_IPOIB_DEBUG_DATA */
734 734
735
736#define IPOIB_GID_FMT "%2.2x%2.2x:%2.2x%2.2x:%2.2x%2.2x:%2.2x%2.2x:" \
737 "%2.2x%2.2x:%2.2x%2.2x:%2.2x%2.2x:%2.2x%2.2x"
738
739#define IPOIB_GID_RAW_ARG(gid) ((u8 *)(gid))[0], \
740 ((u8 *)(gid))[1], \
741 ((u8 *)(gid))[2], \
742 ((u8 *)(gid))[3], \
743 ((u8 *)(gid))[4], \
744 ((u8 *)(gid))[5], \
745 ((u8 *)(gid))[6], \
746 ((u8 *)(gid))[7], \
747 ((u8 *)(gid))[8], \
748 ((u8 *)(gid))[9], \
749 ((u8 *)(gid))[10],\
750 ((u8 *)(gid))[11],\
751 ((u8 *)(gid))[12],\
752 ((u8 *)(gid))[13],\
753 ((u8 *)(gid))[14],\
754 ((u8 *)(gid))[15]
755
756#define IPOIB_GID_ARG(gid) IPOIB_GID_RAW_ARG((gid).raw)
757
758#define IPOIB_QPN(ha) (be32_to_cpup((__be32 *) ha) & 0xffffff) 735#define IPOIB_QPN(ha) (be32_to_cpup((__be32 *) ha) & 0xffffff)
759 736
760#endif /* _IPOIB_H */ 737#endif /* _IPOIB_H */
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
index 7b14c2c39500..47d588ba2a7f 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
@@ -1128,8 +1128,8 @@ static int ipoib_cm_tx_init(struct ipoib_cm_tx *p, u32 qpn,
1128 goto err_send_cm; 1128 goto err_send_cm;
1129 } 1129 }
1130 1130
1131 ipoib_dbg(priv, "Request connection 0x%x for gid " IPOIB_GID_FMT " qpn 0x%x\n", 1131 ipoib_dbg(priv, "Request connection 0x%x for gid %pI6 qpn 0x%x\n",
1132 p->qp->qp_num, IPOIB_GID_ARG(pathrec->dgid), qpn); 1132 p->qp->qp_num, pathrec->dgid.raw, qpn);
1133 1133
1134 return 0; 1134 return 0;
1135 1135
@@ -1276,8 +1276,8 @@ void ipoib_cm_destroy_tx(struct ipoib_cm_tx *tx)
1276 if (test_and_clear_bit(IPOIB_FLAG_INITIALIZED, &tx->flags)) { 1276 if (test_and_clear_bit(IPOIB_FLAG_INITIALIZED, &tx->flags)) {
1277 list_move(&tx->list, &priv->cm.reap_list); 1277 list_move(&tx->list, &priv->cm.reap_list);
1278 queue_work(ipoib_workqueue, &priv->cm.reap_task); 1278 queue_work(ipoib_workqueue, &priv->cm.reap_task);
1279 ipoib_dbg(priv, "Reap connection for gid " IPOIB_GID_FMT "\n", 1279 ipoib_dbg(priv, "Reap connection for gid %pI6\n",
1280 IPOIB_GID_ARG(tx->neigh->dgid)); 1280 tx->neigh->dgid.raw);
1281 tx->neigh = NULL; 1281 tx->neigh = NULL;
1282 } 1282 }
1283} 1283}
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index fddded7900d1..b3a671895bdc 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -359,9 +359,9 @@ void ipoib_mark_paths_invalid(struct net_device *dev)
359 spin_lock_irq(&priv->lock); 359 spin_lock_irq(&priv->lock);
360 360
361 list_for_each_entry_safe(path, tp, &priv->path_list, list) { 361 list_for_each_entry_safe(path, tp, &priv->path_list, list) {
362 ipoib_dbg(priv, "mark path LID 0x%04x GID " IPOIB_GID_FMT " invalid\n", 362 ipoib_dbg(priv, "mark path LID 0x%04x GID %pI6 invalid\n",
363 be16_to_cpu(path->pathrec.dlid), 363 be16_to_cpu(path->pathrec.dlid),
364 IPOIB_GID_ARG(path->pathrec.dgid)); 364 path->pathrec.dgid.raw);
365 path->valid = 0; 365 path->valid = 0;
366 } 366 }
367 367
@@ -413,11 +413,11 @@ static void path_rec_completion(int status,
413 unsigned long flags; 413 unsigned long flags;
414 414
415 if (!status) 415 if (!status)
416 ipoib_dbg(priv, "PathRec LID 0x%04x for GID " IPOIB_GID_FMT "\n", 416 ipoib_dbg(priv, "PathRec LID 0x%04x for GID %pI6\n",
417 be16_to_cpu(pathrec->dlid), IPOIB_GID_ARG(pathrec->dgid)); 417 be16_to_cpu(pathrec->dlid), pathrec->dgid.raw);
418 else 418 else
419 ipoib_dbg(priv, "PathRec status %d for GID " IPOIB_GID_FMT "\n", 419 ipoib_dbg(priv, "PathRec status %d for GID %pI6\n",
420 status, IPOIB_GID_ARG(path->pathrec.dgid)); 420 status, path->pathrec.dgid.raw);
421 421
422 skb_queue_head_init(&skqueue); 422 skb_queue_head_init(&skqueue);
423 423
@@ -527,8 +527,8 @@ static int path_rec_start(struct net_device *dev,
527{ 527{
528 struct ipoib_dev_priv *priv = netdev_priv(dev); 528 struct ipoib_dev_priv *priv = netdev_priv(dev);
529 529
530 ipoib_dbg(priv, "Start path record lookup for " IPOIB_GID_FMT "\n", 530 ipoib_dbg(priv, "Start path record lookup for %pI6\n",
531 IPOIB_GID_ARG(path->pathrec.dgid)); 531 path->pathrec.dgid.raw);
532 532
533 init_completion(&path->done); 533 init_completion(&path->done);
534 534
@@ -764,12 +764,11 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
764 764
765 if ((be16_to_cpup((__be16 *) skb->data) != ETH_P_ARP) && 765 if ((be16_to_cpup((__be16 *) skb->data) != ETH_P_ARP) &&
766 (be16_to_cpup((__be16 *) skb->data) != ETH_P_RARP)) { 766 (be16_to_cpup((__be16 *) skb->data) != ETH_P_RARP)) {
767 ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x " 767 ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n",
768 IPOIB_GID_FMT "\n",
769 skb->dst ? "neigh" : "dst", 768 skb->dst ? "neigh" : "dst",
770 be16_to_cpup((__be16 *) skb->data), 769 be16_to_cpup((__be16 *) skb->data),
771 IPOIB_QPN(phdr->hwaddr), 770 IPOIB_QPN(phdr->hwaddr),
772 IPOIB_GID_RAW_ARG(phdr->hwaddr + 4)); 771 phdr->hwaddr + 4);
773 dev_kfree_skb_any(skb); 772 dev_kfree_skb_any(skb);
774 ++dev->stats.tx_dropped; 773 ++dev->stats.tx_dropped;
775 return NETDEV_TX_OK; 774 return NETDEV_TX_OK;
@@ -845,9 +844,9 @@ static void ipoib_neigh_cleanup(struct neighbour *n)
845 else 844 else
846 return; 845 return;
847 ipoib_dbg(priv, 846 ipoib_dbg(priv,
848 "neigh_cleanup for %06x " IPOIB_GID_FMT "\n", 847 "neigh_cleanup for %06x %pI6\n",
849 IPOIB_QPN(n->ha), 848 IPOIB_QPN(n->ha),
850 IPOIB_GID_RAW_ARG(n->ha + 4)); 849 n->ha + 4);
851 850
852 spin_lock_irqsave(&priv->lock, flags); 851 spin_lock_irqsave(&priv->lock, flags);
853 852
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
index d9d1223c3fd5..a2eb3b9789eb 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
@@ -71,9 +71,8 @@ static void ipoib_mcast_free(struct ipoib_mcast *mcast)
71 struct ipoib_neigh *neigh, *tmp; 71 struct ipoib_neigh *neigh, *tmp;
72 int tx_dropped = 0; 72 int tx_dropped = 0;
73 73
74 ipoib_dbg_mcast(netdev_priv(dev), 74 ipoib_dbg_mcast(netdev_priv(dev), "deleting multicast group %pI6\n",
75 "deleting multicast group " IPOIB_GID_FMT "\n", 75 mcast->mcmember.mgid.raw);
76 IPOIB_GID_ARG(mcast->mcmember.mgid));
77 76
78 spin_lock_irq(&priv->lock); 77 spin_lock_irq(&priv->lock);
79 78
@@ -205,9 +204,8 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
205 204
206 if (!test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) { 205 if (!test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) {
207 if (test_and_set_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) { 206 if (test_and_set_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) {
208 ipoib_warn(priv, "multicast group " IPOIB_GID_FMT 207 ipoib_warn(priv, "multicast group %pI6 already attached\n",
209 " already attached\n", 208 mcast->mcmember.mgid.raw);
210 IPOIB_GID_ARG(mcast->mcmember.mgid));
211 209
212 return 0; 210 return 0;
213 } 211 }
@@ -215,9 +213,8 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
215 ret = ipoib_mcast_attach(dev, be16_to_cpu(mcast->mcmember.mlid), 213 ret = ipoib_mcast_attach(dev, be16_to_cpu(mcast->mcmember.mlid),
216 &mcast->mcmember.mgid, set_qkey); 214 &mcast->mcmember.mgid, set_qkey);
217 if (ret < 0) { 215 if (ret < 0) {
218 ipoib_warn(priv, "couldn't attach QP to multicast group " 216 ipoib_warn(priv, "couldn't attach QP to multicast group %pI6\n",
219 IPOIB_GID_FMT "\n", 217 mcast->mcmember.mgid.raw);
220 IPOIB_GID_ARG(mcast->mcmember.mgid));
221 218
222 clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags); 219 clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags);
223 return ret; 220 return ret;
@@ -248,9 +245,8 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
248 mcast->ah = ah; 245 mcast->ah = ah;
249 spin_unlock_irq(&priv->lock); 246 spin_unlock_irq(&priv->lock);
250 247
251 ipoib_dbg_mcast(priv, "MGID " IPOIB_GID_FMT 248 ipoib_dbg_mcast(priv, "MGID %pI6 AV %p, LID 0x%04x, SL %d\n",
252 " AV %p, LID 0x%04x, SL %d\n", 249 mcast->mcmember.mgid.raw,
253 IPOIB_GID_ARG(mcast->mcmember.mgid),
254 mcast->ah->ah, 250 mcast->ah->ah,
255 be16_to_cpu(mcast->mcmember.mlid), 251 be16_to_cpu(mcast->mcmember.mlid),
256 mcast->mcmember.sl); 252 mcast->mcmember.sl);
@@ -295,9 +291,8 @@ ipoib_mcast_sendonly_join_complete(int status,
295 291
296 if (status) { 292 if (status) {
297 if (mcast->logcount++ < 20) 293 if (mcast->logcount++ < 20)
298 ipoib_dbg_mcast(netdev_priv(dev), "multicast join failed for " 294 ipoib_dbg_mcast(netdev_priv(dev), "multicast join failed for %pI6, status %d\n",
299 IPOIB_GID_FMT ", status %d\n", 295 mcast->mcmember.mgid.raw, status);
300 IPOIB_GID_ARG(mcast->mcmember.mgid), status);
301 296
302 /* Flush out any queued packets */ 297 /* Flush out any queued packets */
303 netif_tx_lock_bh(dev); 298 netif_tx_lock_bh(dev);
@@ -356,9 +351,8 @@ static int ipoib_mcast_sendonly_join(struct ipoib_mcast *mcast)
356 ipoib_warn(priv, "ib_sa_join_multicast failed (ret = %d)\n", 351 ipoib_warn(priv, "ib_sa_join_multicast failed (ret = %d)\n",
357 ret); 352 ret);
358 } else { 353 } else {
359 ipoib_dbg_mcast(priv, "no multicast record for " IPOIB_GID_FMT 354 ipoib_dbg_mcast(priv, "no multicast record for %pI6, starting join\n",
360 ", starting join\n", 355 mcast->mcmember.mgid.raw);
361 IPOIB_GID_ARG(mcast->mcmember.mgid));
362 } 356 }
363 357
364 return ret; 358 return ret;
@@ -386,9 +380,8 @@ static int ipoib_mcast_join_complete(int status,
386 struct net_device *dev = mcast->dev; 380 struct net_device *dev = mcast->dev;
387 struct ipoib_dev_priv *priv = netdev_priv(dev); 381 struct ipoib_dev_priv *priv = netdev_priv(dev);
388 382
389 ipoib_dbg_mcast(priv, "join completion for " IPOIB_GID_FMT 383 ipoib_dbg_mcast(priv, "join completion for %pI6 (status %d)\n",
390 " (status %d)\n", 384 mcast->mcmember.mgid.raw, status);
391 IPOIB_GID_ARG(mcast->mcmember.mgid), status);
392 385
393 /* We trap for port events ourselves. */ 386 /* We trap for port events ourselves. */
394 if (status == -ENETRESET) 387 if (status == -ENETRESET)
@@ -417,15 +410,11 @@ static int ipoib_mcast_join_complete(int status,
417 410
418 if (mcast->logcount++ < 20) { 411 if (mcast->logcount++ < 20) {
419 if (status == -ETIMEDOUT) { 412 if (status == -ETIMEDOUT) {
420 ipoib_dbg_mcast(priv, "multicast join failed for " IPOIB_GID_FMT 413 ipoib_dbg_mcast(priv, "multicast join failed for %pI6, status %d\n",
421 ", status %d\n", 414 mcast->mcmember.mgid.raw, status);
422 IPOIB_GID_ARG(mcast->mcmember.mgid),
423 status);
424 } else { 415 } else {
425 ipoib_warn(priv, "multicast join failed for " 416 ipoib_warn(priv, "multicast join failed for %pI6, status %d\n",
426 IPOIB_GID_FMT ", status %d\n", 417 mcast->mcmember.mgid.raw, status);
427 IPOIB_GID_ARG(mcast->mcmember.mgid),
428 status);
429 } 418 }
430 } 419 }
431 420
@@ -457,8 +446,7 @@ static void ipoib_mcast_join(struct net_device *dev, struct ipoib_mcast *mcast,
457 ib_sa_comp_mask comp_mask; 446 ib_sa_comp_mask comp_mask;
458 int ret = 0; 447 int ret = 0;
459 448
460 ipoib_dbg_mcast(priv, "joining MGID " IPOIB_GID_FMT "\n", 449 ipoib_dbg_mcast(priv, "joining MGID %pI6\n", mcast->mcmember.mgid.raw);
461 IPOIB_GID_ARG(mcast->mcmember.mgid));
462 450
463 rec.mgid = mcast->mcmember.mgid; 451 rec.mgid = mcast->mcmember.mgid;
464 rec.port_gid = priv->local_gid; 452 rec.port_gid = priv->local_gid;
@@ -643,8 +631,8 @@ static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast)
643 ib_sa_free_multicast(mcast->mc); 631 ib_sa_free_multicast(mcast->mc);
644 632
645 if (test_and_clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) { 633 if (test_and_clear_bit(IPOIB_MCAST_FLAG_ATTACHED, &mcast->flags)) {
646 ipoib_dbg_mcast(priv, "leaving MGID " IPOIB_GID_FMT "\n", 634 ipoib_dbg_mcast(priv, "leaving MGID %pI6\n",
647 IPOIB_GID_ARG(mcast->mcmember.mgid)); 635 mcast->mcmember.mgid.raw);
648 636
649 /* Remove ourselves from the multicast group */ 637 /* Remove ourselves from the multicast group */
650 ret = ib_detach_mcast(priv->qp, &mcast->mcmember.mgid, 638 ret = ib_detach_mcast(priv->qp, &mcast->mcmember.mgid,
@@ -675,8 +663,8 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb)
675 mcast = __ipoib_mcast_find(dev, mgid); 663 mcast = __ipoib_mcast_find(dev, mgid);
676 if (!mcast) { 664 if (!mcast) {
677 /* Let's create a new send only group now */ 665 /* Let's create a new send only group now */
678 ipoib_dbg_mcast(priv, "setting up send only multicast group for " 666 ipoib_dbg_mcast(priv, "setting up send only multicast group for %pI6\n",
679 IPOIB_GID_FMT "\n", IPOIB_GID_RAW_ARG(mgid)); 667 mgid);
680 668
681 mcast = ipoib_mcast_alloc(dev, 0); 669 mcast = ipoib_mcast_alloc(dev, 0);
682 if (!mcast) { 670 if (!mcast) {
@@ -809,14 +797,14 @@ void ipoib_mcast_restart_task(struct work_struct *work)
809 /* ignore group which is directly joined by userspace */ 797 /* ignore group which is directly joined by userspace */
810 if (test_bit(IPOIB_FLAG_UMCAST, &priv->flags) && 798 if (test_bit(IPOIB_FLAG_UMCAST, &priv->flags) &&
811 !ib_sa_get_mcmember_rec(priv->ca, priv->port, &mgid, &rec)) { 799 !ib_sa_get_mcmember_rec(priv->ca, priv->port, &mgid, &rec)) {
812 ipoib_dbg_mcast(priv, "ignoring multicast entry for mgid " 800 ipoib_dbg_mcast(priv, "ignoring multicast entry for mgid %pI6\n",
813 IPOIB_GID_FMT "\n", IPOIB_GID_ARG(mgid)); 801 mgid.raw);
814 continue; 802 continue;
815 } 803 }
816 804
817 /* Not found or send-only group, let's add a new entry */ 805 /* Not found or send-only group, let's add a new entry */
818 ipoib_dbg_mcast(priv, "adding multicast entry for mgid " 806 ipoib_dbg_mcast(priv, "adding multicast entry for mgid %pI6\n",
819 IPOIB_GID_FMT "\n", IPOIB_GID_ARG(mgid)); 807 mgid.raw);
820 808
821 nmcast = ipoib_mcast_alloc(dev, 0); 809 nmcast = ipoib_mcast_alloc(dev, 0);
822 if (!nmcast) { 810 if (!nmcast) {
@@ -849,8 +837,8 @@ void ipoib_mcast_restart_task(struct work_struct *work)
849 list_for_each_entry_safe(mcast, tmcast, &priv->multicast_list, list) { 837 list_for_each_entry_safe(mcast, tmcast, &priv->multicast_list, list) {
850 if (!test_bit(IPOIB_MCAST_FLAG_FOUND, &mcast->flags) && 838 if (!test_bit(IPOIB_MCAST_FLAG_FOUND, &mcast->flags) &&
851 !test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) { 839 !test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) {
852 ipoib_dbg_mcast(priv, "deleting multicast group " IPOIB_GID_FMT "\n", 840 ipoib_dbg_mcast(priv, "deleting multicast group %pI6\n",
853 IPOIB_GID_ARG(mcast->mcmember.mgid)); 841 mcast->mcmember.mgid.raw);
854 842
855 rb_erase(&mcast->rb_node, &priv->multicast_tree); 843 rb_erase(&mcast->rb_node, &priv->multicast_tree);
856 844
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 5b8b533f2908..7c13db885bf6 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1514,15 +1514,7 @@ static ssize_t show_dgid(struct device *dev, struct device_attribute *attr,
1514 target->state == SRP_TARGET_REMOVED) 1514 target->state == SRP_TARGET_REMOVED)
1515 return -ENODEV; 1515 return -ENODEV;
1516 1516
1517 return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", 1517 return sprintf(buf, "%pI6\n", target->path.dgid.raw);
1518 be16_to_cpu(((__be16 *) target->path.dgid.raw)[0]),
1519 be16_to_cpu(((__be16 *) target->path.dgid.raw)[1]),
1520 be16_to_cpu(((__be16 *) target->path.dgid.raw)[2]),
1521 be16_to_cpu(((__be16 *) target->path.dgid.raw)[3]),
1522 be16_to_cpu(((__be16 *) target->path.dgid.raw)[4]),
1523 be16_to_cpu(((__be16 *) target->path.dgid.raw)[5]),
1524 be16_to_cpu(((__be16 *) target->path.dgid.raw)[6]),
1525 be16_to_cpu(((__be16 *) target->path.dgid.raw)[7]));
1526} 1518}
1527 1519
1528static ssize_t show_orig_dgid(struct device *dev, 1520static ssize_t show_orig_dgid(struct device *dev,
@@ -1534,15 +1526,7 @@ static ssize_t show_orig_dgid(struct device *dev,
1534 target->state == SRP_TARGET_REMOVED) 1526 target->state == SRP_TARGET_REMOVED)
1535 return -ENODEV; 1527 return -ENODEV;
1536 1528
1537 return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", 1529 return sprintf(buf, "%pI6\n", target->orig_dgid);
1538 be16_to_cpu(target->orig_dgid[0]),
1539 be16_to_cpu(target->orig_dgid[1]),
1540 be16_to_cpu(target->orig_dgid[2]),
1541 be16_to_cpu(target->orig_dgid[3]),
1542 be16_to_cpu(target->orig_dgid[4]),
1543 be16_to_cpu(target->orig_dgid[5]),
1544 be16_to_cpu(target->orig_dgid[6]),
1545 be16_to_cpu(target->orig_dgid[7]));
1546} 1530}
1547 1531
1548static ssize_t show_zero_req_lim(struct device *dev, 1532static ssize_t show_zero_req_lim(struct device *dev,
@@ -1883,19 +1867,12 @@ static ssize_t srp_create_target(struct device *dev,
1883 1867
1884 shost_printk(KERN_DEBUG, target->scsi_host, PFX 1868 shost_printk(KERN_DEBUG, target->scsi_host, PFX
1885 "new target: id_ext %016llx ioc_guid %016llx pkey %04x " 1869 "new target: id_ext %016llx ioc_guid %016llx pkey %04x "
1886 "service_id %016llx dgid %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n", 1870 "service_id %016llx dgid %pI6\n",
1887 (unsigned long long) be64_to_cpu(target->id_ext), 1871 (unsigned long long) be64_to_cpu(target->id_ext),
1888 (unsigned long long) be64_to_cpu(target->ioc_guid), 1872 (unsigned long long) be64_to_cpu(target->ioc_guid),
1889 be16_to_cpu(target->path.pkey), 1873 be16_to_cpu(target->path.pkey),
1890 (unsigned long long) be64_to_cpu(target->service_id), 1874 (unsigned long long) be64_to_cpu(target->service_id),
1891 (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[0]), 1875 target->path.dgid.raw);
1892 (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[2]),
1893 (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[4]),
1894 (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[6]),
1895 (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[8]),
1896 (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[10]),
1897 (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[12]),
1898 (int) be16_to_cpu(*(__be16 *) &target->path.dgid.raw[14]));
1899 1876
1900 ret = srp_create_target_ib(target); 1877 ret = srp_create_target_ib(target);
1901 if (ret) 1878 if (ret)
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index bb904a0a98bd..60c82d7b12a8 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -1654,9 +1654,10 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb)
1654 unsigned char *p; 1654 unsigned char *p;
1655 int period; 1655 int period;
1656 u32 code; 1656 u32 code;
1657 u32 my_seq, addr; 1657 u32 my_seq;
1658 u32 your_seq, mask; 1658 u32 your_seq;
1659 u32 local; 1659 __be32 local;
1660 __be32 *addr, *mask;
1660 u16 unused; 1661 u16 unused;
1661 1662
1662 if (skb->len < 14) 1663 if (skb->len < 14)
@@ -1671,27 +1672,20 @@ isdn_net_ciscohdlck_slarp_in(isdn_net_local *lp, struct sk_buff *skb)
1671 isdn_net_ciscohdlck_slarp_send_reply(lp); 1672 isdn_net_ciscohdlck_slarp_send_reply(lp);
1672 break; 1673 break;
1673 case CISCO_SLARP_REPLY: 1674 case CISCO_SLARP_REPLY:
1674 addr = ntohl(*(u32 *)p); 1675 addr = (__be32 *)p;
1675 mask = ntohl(*(u32 *)(p+4)); 1676 mask = (__be32 *)(p + 4);
1676 if (mask != 0xfffffffc) 1677 if (*mask != cpu_to_be32(0xfffffffc))
1677 goto slarp_reply_out; 1678 goto slarp_reply_out;
1678 if ((addr & 3) == 0 || (addr & 3) == 3) 1679 if ((*addr & cpu_to_be32(3)) == cpu_to_be32(0) ||
1680 (*addr & cpu_to_be32(3)) == cpu_to_be32(3))
1679 goto slarp_reply_out; 1681 goto slarp_reply_out;
1680 local = addr ^ 3; 1682 local = *addr ^ cpu_to_be32(3);
1681 printk(KERN_INFO "%s: got slarp reply: " 1683 printk(KERN_INFO "%s: got slarp reply: remote ip: %pI4, local ip: %pI4 mask: %pI4\n",
1682 "remote ip: %d.%d.%d.%d, " 1684 lp->netdev->dev->name, addr, &local, mask);
1683 "local ip: %d.%d.%d.%d "
1684 "mask: %d.%d.%d.%d\n",
1685 lp->netdev->dev->name,
1686 HIPQUAD(addr),
1687 HIPQUAD(local),
1688 HIPQUAD(mask));
1689 break; 1685 break;
1690 slarp_reply_out: 1686 slarp_reply_out:
1691 printk(KERN_INFO "%s: got invalid slarp " 1687 printk(KERN_INFO "%s: got invalid slarp reply (%pI4/%pI4) - ignored\n",
1692 "reply (%d.%d.%d.%d/%d.%d.%d.%d) " 1688 lp->netdev->dev->name, addr, mask);
1693 "- ignored\n", lp->netdev->dev->name,
1694 HIPQUAD(addr), HIPQUAD(mask));
1695 break; 1689 break;
1696 case CISCO_SLARP_KEEPALIVE: 1690 case CISCO_SLARP_KEEPALIVE:
1697 period = (int)((jiffies - lp->cisco_last_slarp_in 1691 period = (int)((jiffies - lp->cisco_last_slarp_in
diff --git a/drivers/media/dvb/b2c2/flexcop.c b/drivers/media/dvb/b2c2/flexcop.c
index 5f79c8dc3836..676413a915b4 100644
--- a/drivers/media/dvb/b2c2/flexcop.c
+++ b/drivers/media/dvb/b2c2/flexcop.c
@@ -270,7 +270,7 @@ int flexcop_device_initialize(struct flexcop_device *fc)
270 /* do the MAC address reading after initializing the dvb_adapter */ 270 /* do the MAC address reading after initializing the dvb_adapter */
271 if (fc->get_mac_addr(fc, 0) == 0) { 271 if (fc->get_mac_addr(fc, 0) == 0) {
272 u8 *b = fc->dvb_adapter.proposed_mac; 272 u8 *b = fc->dvb_adapter.proposed_mac;
273 info("MAC address = %02x:%02x:%02x:%02x:%02x:%02x", b[0],b[1],b[2],b[3],b[4],b[5]); 273 info("MAC address = %pM", b);
274 flexcop_set_mac_filter(fc,b); 274 flexcop_set_mac_filter(fc,b);
275 flexcop_mac_filter_ctrl(fc,1); 275 flexcop_mac_filter_ctrl(fc,1);
276 } else 276 } else
diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c
index aa3db57d32d9..29e8f1546ab6 100644
--- a/drivers/media/dvb/bt8xx/dst.c
+++ b/drivers/media/dvb/bt8xx/dst.c
@@ -917,9 +917,7 @@ static int dst_get_mac(struct dst_state *state)
917 } 917 }
918 memset(&state->mac_address, '\0', 8); 918 memset(&state->mac_address, '\0', 8);
919 memcpy(&state->mac_address, &state->rxbuffer, 6); 919 memcpy(&state->mac_address, &state->rxbuffer, 6);
920 dprintk(verbose, DST_ERROR, 1, "MAC Address=[%02x:%02x:%02x:%02x:%02x:%02x]", 920 dprintk(verbose, DST_ERROR, 1, "MAC Address=[%pM]", state->mac_address);
921 state->mac_address[0], state->mac_address[1], state->mac_address[2],
922 state->mac_address[4], state->mac_address[5], state->mac_address[6]);
923 921
924 return 0; 922 return 0;
925} 923}
diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c
index 14e627ef6465..d15984e599bc 100644
--- a/drivers/media/dvb/dm1105/dm1105.c
+++ b/drivers/media/dvb/dm1105/dm1105.c
@@ -697,8 +697,7 @@ static void __devinit dm1105dvb_read_mac(struct dm1105dvb *dm1105dvb, u8 *mac)
697 }; 697 };
698 698
699 dm1105_i2c_xfer(&dm1105dvb->i2c_adap, msg , 2); 699 dm1105_i2c_xfer(&dm1105dvb->i2c_adap, msg , 2);
700 dev_info(&dm1105dvb->pdev->dev, "MAC %02x:%02x:%02x:%02x:%02x:%02x\n", 700 dev_info(&dm1105dvb->pdev->dev, "MAC %pM\n", mac);
701 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
702} 701}
703 702
704static int __devinit dm1105_probe(struct pci_dev *pdev, 703static int __devinit dm1105_probe(struct pci_dev *pdev,
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
index ce8cd0c5d831..8a7d87bcd1d9 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-dvb.c
@@ -91,10 +91,7 @@ int dvb_usb_adapter_dvb_init(struct dvb_usb_adapter *adap, short *adapter_nums)
91 91
92 if (adap->dev->props.read_mac_address) { 92 if (adap->dev->props.read_mac_address) {
93 if (adap->dev->props.read_mac_address(adap->dev,adap->dvb_adap.proposed_mac) == 0) 93 if (adap->dev->props.read_mac_address(adap->dev,adap->dvb_adap.proposed_mac) == 0)
94 info("MAC address: %02x:%02x:%02x:%02x:%02x:%02x",adap->dvb_adap.proposed_mac[0], 94 info("MAC address: %pM",adap->dvb_adap.proposed_mac);
95 adap->dvb_adap.proposed_mac[1], adap->dvb_adap.proposed_mac[2],
96 adap->dvb_adap.proposed_mac[3], adap->dvb_adap.proposed_mac[4],
97 adap->dvb_adap.proposed_mac[5]);
98 else 95 else
99 err("MAC address reading failed."); 96 err("MAC address reading failed.");
100 } 97 }
diff --git a/drivers/media/dvb/pluto2/pluto2.c b/drivers/media/dvb/pluto2/pluto2.c
index a9653c63f4db..d101b304e9b0 100644
--- a/drivers/media/dvb/pluto2/pluto2.c
+++ b/drivers/media/dvb/pluto2/pluto2.c
@@ -560,8 +560,7 @@ static void __devinit pluto_read_mac(struct pluto *pluto, u8 *mac)
560 mac[4] = (val >> 8) & 0xff; 560 mac[4] = (val >> 8) & 0xff;
561 mac[5] = (val >> 0) & 0xff; 561 mac[5] = (val >> 0) & 0xff;
562 562
563 dev_info(&pluto->pdev->dev, "MAC %02x:%02x:%02x:%02x:%02x:%02x\n", 563 dev_info(&pluto->pdev->dev, "MAC %pM\n", mac);
564 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
565} 564}
566 565
567static int __devinit pluto_read_serial(struct pluto *pluto) 566static int __devinit pluto_read_serial(struct pluto *pluto)
diff --git a/drivers/message/fusion/mptlan.c b/drivers/message/fusion/mptlan.c
index a1abf95cf751..582a921c7aab 100644
--- a/drivers/message/fusion/mptlan.c
+++ b/drivers/message/fusion/mptlan.c
@@ -1462,11 +1462,9 @@ mptlan_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1462 printk(KERN_INFO MYNAM ": %s: Fusion MPT LAN device " 1462 printk(KERN_INFO MYNAM ": %s: Fusion MPT LAN device "
1463 "registered as '%s'\n", ioc->name, dev->name); 1463 "registered as '%s'\n", ioc->name, dev->name);
1464 printk(KERN_INFO MYNAM ": %s/%s: " 1464 printk(KERN_INFO MYNAM ": %s/%s: "
1465 "LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n", 1465 "LanAddr = %pM\n",
1466 IOC_AND_NETDEV_NAMES_s_s(dev), 1466 IOC_AND_NETDEV_NAMES_s_s(dev),
1467 dev->dev_addr[0], dev->dev_addr[1], 1467 dev->dev_addr);
1468 dev->dev_addr[2], dev->dev_addr[3],
1469 dev->dev_addr[4], dev->dev_addr[5]);
1470 1468
1471 ioc->netdev = dev; 1469 ioc->netdev = dev;
1472 1470
@@ -1551,9 +1549,8 @@ mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev)
1551 1549
1552 printk (KERN_WARNING MYNAM ": %s: WARNING - Broadcast swap F/W bug detected!\n", 1550 printk (KERN_WARNING MYNAM ": %s: WARNING - Broadcast swap F/W bug detected!\n",
1553 NETDEV_PTR_TO_IOC_NAME_s(dev)); 1551 NETDEV_PTR_TO_IOC_NAME_s(dev));
1554 printk (KERN_WARNING MYNAM ": Please update sender @ MAC_addr = %02x:%02x:%02x:%02x:%02x:%02x\n", 1552 printk (KERN_WARNING MYNAM ": Please update sender @ MAC_addr = %pM\n",
1555 fch->saddr[0], fch->saddr[1], fch->saddr[2], 1553 fch->saddr);
1556 fch->saddr[3], fch->saddr[4], fch->saddr[5]);
1557 } 1554 }
1558 1555
1559 if (*fch->daddr & 1) { 1556 if (*fch->daddr & 1) {
@@ -1628,10 +1625,9 @@ mpt_lan_type_trans(struct sk_buff *skb, struct net_device *dev)
1628 nh->NAA = source_naa; /* Set the S_NAA value. */ 1625 nh->NAA = source_naa; /* Set the S_NAA value. */
1629 for (i = 0; i < FC_ALEN; i++) 1626 for (i = 0; i < FC_ALEN; i++)
1630 nh->ieee[i] = fch->saddr[i]; 1627 nh->ieee[i] = fch->saddr[i];
1631 dlprintk ((KERN_INFO "Got ARP from %02x:%02x:%02x:%02x:" 1628 dlprintk ((KERN_INFO "Got ARP from %pM with"
1632 "%02x:%02x with non-compliant S_NAA value.\n", 1629 " non-compliant S_NAA value.\n",
1633 fch->saddr[0], fch->saddr[1], fch->saddr[2], 1630 fch->saddr));
1634 fch->saddr[3], fch->saddr[4],fch->saddr[5]));
1635 } else { 1631 } else {
1636 printk (KERN_ERR "mptlan/type_trans: Unable to" 1632 printk (KERN_ERR "mptlan/type_trans: Unable to"
1637 " kmalloc a NAA_Hosed struct.\n"); 1633 " kmalloc a NAA_Hosed struct.\n");
diff --git a/drivers/net/3c503.c b/drivers/net/3c503.c
index 900b0ffdcc68..95bd95f1f99e 100644
--- a/drivers/net/3c503.c
+++ b/drivers/net/3c503.c
@@ -177,7 +177,6 @@ el2_probe1(struct net_device *dev, int ioaddr)
177 int i, iobase_reg, membase_reg, saved_406, wordlength, retval; 177 int i, iobase_reg, membase_reg, saved_406, wordlength, retval;
178 static unsigned version_printed; 178 static unsigned version_printed;
179 unsigned long vendor_id; 179 unsigned long vendor_id;
180 DECLARE_MAC_BUF(mac);
181 180
182 if (!request_region(ioaddr, EL2_IO_EXTENT, DRV_NAME)) 181 if (!request_region(ioaddr, EL2_IO_EXTENT, DRV_NAME))
183 return -EBUSY; 182 return -EBUSY;
@@ -228,7 +227,7 @@ el2_probe1(struct net_device *dev, int ioaddr)
228 /* Retrieve and print the ethernet address. */ 227 /* Retrieve and print the ethernet address. */
229 for (i = 0; i < 6; i++) 228 for (i = 0; i < 6; i++)
230 dev->dev_addr[i] = inb(ioaddr + i); 229 dev->dev_addr[i] = inb(ioaddr + i);
231 printk("%s", print_mac(mac, dev->dev_addr)); 230 printk("%pM", dev->dev_addr);
232 231
233 /* Map the 8390 back into the window. */ 232 /* Map the 8390 back into the window. */
234 outb(ECNTRL_THIN, ioaddr + 0x406); 233 outb(ECNTRL_THIN, ioaddr + 0x406);
diff --git a/drivers/net/3c505.c b/drivers/net/3c505.c
index a424869707a5..6ecb4188b451 100644
--- a/drivers/net/3c505.c
+++ b/drivers/net/3c505.c
@@ -1385,7 +1385,6 @@ static int __init elplus_setup(struct net_device *dev)
1385 unsigned long timeout; 1385 unsigned long timeout;
1386 unsigned long cookie = 0; 1386 unsigned long cookie = 0;
1387 int err = -ENODEV; 1387 int err = -ENODEV;
1388 DECLARE_MAC_BUF(mac);
1389 1388
1390 /* 1389 /*
1391 * setup adapter structure 1390 * setup adapter structure
@@ -1522,9 +1521,9 @@ static int __init elplus_setup(struct net_device *dev)
1522 * print remainder of startup message 1521 * print remainder of startup message
1523 */ 1522 */
1524 printk(KERN_INFO "%s: 3c505 at %#lx, irq %d, dma %d, " 1523 printk(KERN_INFO "%s: 3c505 at %#lx, irq %d, dma %d, "
1525 "addr %s, ", 1524 "addr %pM, ",
1526 dev->name, dev->base_addr, dev->irq, dev->dma, 1525 dev->name, dev->base_addr, dev->irq, dev->dma,
1527 print_mac(mac, dev->dev_addr)); 1526 dev->dev_addr);
1528 1527
1529 /* 1528 /*
1530 * read more information from the adapter 1529 * read more information from the adapter
diff --git a/drivers/net/3c507.c b/drivers/net/3c507.c
index 030c147211ba..66fd505788f4 100644
--- a/drivers/net/3c507.c
+++ b/drivers/net/3c507.c
@@ -357,7 +357,6 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
357 static unsigned char init_ID_done, version_printed; 357 static unsigned char init_ID_done, version_printed;
358 int i, irq, irqval, retval; 358 int i, irq, irqval, retval;
359 struct net_local *lp; 359 struct net_local *lp;
360 DECLARE_MAC_BUF(mac);
361 360
362 if (init_ID_done == 0) { 361 if (init_ID_done == 0) {
363 ushort lrs_state = 0xff; 362 ushort lrs_state = 0xff;
@@ -405,7 +404,7 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
405 outb(0x01, ioaddr + MISC_CTRL); 404 outb(0x01, ioaddr + MISC_CTRL);
406 for (i = 0; i < 6; i++) 405 for (i = 0; i < 6; i++)
407 dev->dev_addr[i] = inb(ioaddr + i); 406 dev->dev_addr[i] = inb(ioaddr + i);
408 printk(" %s", print_mac(mac, dev->dev_addr)); 407 printk(" %pM", dev->dev_addr);
409 408
410 if (mem_start) 409 if (mem_start)
411 net_debug = mem_start & 7; 410 net_debug = mem_start & 7;
diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index 3a7bc524af33..cc970c49fb34 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -541,7 +541,6 @@ static int __init el3_common_init(struct net_device *dev)
541{ 541{
542 struct el3_private *lp = netdev_priv(dev); 542 struct el3_private *lp = netdev_priv(dev);
543 int err; 543 int err;
544 DECLARE_MAC_BUF(mac);
545 const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"}; 544 const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"};
546 545
547 spin_lock_init(&lp->lock); 546 spin_lock_init(&lp->lock);
@@ -575,9 +574,9 @@ static int __init el3_common_init(struct net_device *dev)
575 } 574 }
576 575
577 printk(KERN_INFO "%s: 3c5x9 found at %#3.3lx, %s port, " 576 printk(KERN_INFO "%s: 3c5x9 found at %#3.3lx, %s port, "
578 "address %s, IRQ %d.\n", 577 "address %pM, IRQ %d.\n",
579 dev->name, dev->base_addr, if_names[(dev->if_port & 0x03)], 578 dev->name, dev->base_addr, if_names[(dev->if_port & 0x03)],
580 print_mac(mac, dev->dev_addr), dev->irq); 579 dev->dev_addr, dev->irq);
581 580
582 if (el3_debug > 0) 581 if (el3_debug > 0)
583 printk(KERN_INFO "%s", version); 582 printk(KERN_INFO "%s", version);
diff --git a/drivers/net/3c515.c b/drivers/net/3c515.c
index a0f8b6e2d0af..a2c24684a44a 100644
--- a/drivers/net/3c515.c
+++ b/drivers/net/3c515.c
@@ -570,7 +570,6 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
570 unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */ 570 unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */
571 int i; 571 int i;
572 int irq; 572 int irq;
573 DECLARE_MAC_BUF(mac);
574 573
575#ifdef __ISAPNP__ 574#ifdef __ISAPNP__
576 if (idev) { 575 if (idev) {
@@ -636,7 +635,7 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
636 checksum = (checksum ^ (checksum >> 8)) & 0xff; 635 checksum = (checksum ^ (checksum >> 8)) & 0xff;
637 if (checksum != 0x00) 636 if (checksum != 0x00)
638 printk(" ***INVALID CHECKSUM %4.4x*** ", checksum); 637 printk(" ***INVALID CHECKSUM %4.4x*** ", checksum);
639 printk(" %s", print_mac(mac, dev->dev_addr)); 638 printk(" %pM", dev->dev_addr);
640 if (eeprom[16] == 0x11c7) { /* Corkscrew */ 639 if (eeprom[16] == 0x11c7) { /* Corkscrew */
641 if (request_dma(dev->dma, "3c515")) { 640 if (request_dma(dev->dma, "3c515")) {
642 printk(", DMA %d allocation failed", dev->dma); 641 printk(", DMA %d allocation failed", dev->dma);
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c
index e2ce41d3828e..23a31232326c 100644
--- a/drivers/net/3c523.c
+++ b/drivers/net/3c523.c
@@ -383,7 +383,6 @@ static int elmc_getinfo(char *buf, int slot, void *d)
383{ 383{
384 int len = 0; 384 int len = 0;
385 struct net_device *dev = d; 385 struct net_device *dev = d;
386 DECLARE_MAC_BUF(mac);
387 386
388 if (dev == NULL) 387 if (dev == NULL)
389 return len; 388 return len;
@@ -398,8 +397,8 @@ static int elmc_getinfo(char *buf, int slot, void *d)
398 len += sprintf(buf + len, "Transceiver: %s\n", dev->if_port ? 397 len += sprintf(buf + len, "Transceiver: %s\n", dev->if_port ?
399 "External" : "Internal"); 398 "External" : "Internal");
400 len += sprintf(buf + len, "Device: %s\n", dev->name); 399 len += sprintf(buf + len, "Device: %s\n", dev->name);
401 len += sprintf(buf + len, "Hardware Address: %s\n", 400 len += sprintf(buf + len, "Hardware Address: %pM\n",
402 print_mac(mac, dev->dev_addr)); 401 dev->dev_addr);
403 402
404 return len; 403 return len;
405} /* elmc_getinfo() */ 404} /* elmc_getinfo() */
@@ -417,7 +416,6 @@ static int __init do_elmc_probe(struct net_device *dev)
417 unsigned int size = 0; 416 unsigned int size = 0;
418 int retval; 417 int retval;
419 struct priv *pr = dev->priv; 418 struct priv *pr = dev->priv;
420 DECLARE_MAC_BUF(mac);
421 419
422 if (MCA_bus == 0) { 420 if (MCA_bus == 0) {
423 return -ENODEV; 421 return -ENODEV;
@@ -543,8 +541,8 @@ static int __init do_elmc_probe(struct net_device *dev)
543 for (i = 0; i < 6; i++) 541 for (i = 0; i < 6; i++)
544 dev->dev_addr[i] = inb(dev->base_addr + i); 542 dev->dev_addr[i] = inb(dev->base_addr + i);
545 543
546 printk(KERN_INFO "%s: hardware address %s\n", 544 printk(KERN_INFO "%s: hardware address %pM\n",
547 dev->name, print_mac(mac, dev->dev_addr)); 545 dev->name, dev->dev_addr);
548 546
549 dev->open = &elmc_open; 547 dev->open = &elmc_open;
550 dev->stop = &elmc_close; 548 dev->stop = &elmc_close;
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c
index abc84f765973..0f4cabb4cc29 100644
--- a/drivers/net/3c527.c
+++ b/drivers/net/3c527.c
@@ -335,7 +335,6 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
335 "82586 initialisation failure", 335 "82586 initialisation failure",
336 "Adapter list configuration error" 336 "Adapter list configuration error"
337 }; 337 };
338 DECLARE_MAC_BUF(mac);
339 338
340 /* Time to play MCA games */ 339 /* Time to play MCA games */
341 340
@@ -405,7 +404,7 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
405 dev->dev_addr[i] = mca_read_pos(slot,3); 404 dev->dev_addr[i] = mca_read_pos(slot,3);
406 } 405 }
407 406
408 printk("%s: Address %s", dev->name, print_mac(mac, dev->dev_addr)); 407 printk("%s: Address %pM", dev->name, dev->dev_addr);
409 408
410 mca_write_pos(slot, 6, 0); 409 mca_write_pos(slot, 6, 0);
411 mca_write_pos(slot, 7, 0); 410 mca_write_pos(slot, 7, 0);
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 9ba295d9dd97..38d58fd9c18d 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -1013,7 +1013,6 @@ static int __devinit vortex_probe1(struct device *gendev,
1013 const char *print_name = "3c59x"; 1013 const char *print_name = "3c59x";
1014 struct pci_dev *pdev = NULL; 1014 struct pci_dev *pdev = NULL;
1015 struct eisa_device *edev = NULL; 1015 struct eisa_device *edev = NULL;
1016 DECLARE_MAC_BUF(mac);
1017 1016
1018 if (!printed_version) { 1017 if (!printed_version) {
1019 printk (version); 1018 printk (version);
@@ -1206,7 +1205,7 @@ static int __devinit vortex_probe1(struct device *gendev,
1206 ((__be16 *)dev->dev_addr)[i] = htons(eeprom[i + 10]); 1205 ((__be16 *)dev->dev_addr)[i] = htons(eeprom[i + 10]);
1207 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); 1206 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
1208 if (print_info) 1207 if (print_info)
1209 printk(" %s", print_mac(mac, dev->dev_addr)); 1208 printk(" %pM", dev->dev_addr);
1210 /* Unfortunately an all zero eeprom passes the checksum and this 1209 /* Unfortunately an all zero eeprom passes the checksum and this
1211 gets found in the wild in failure cases. Crypto is hard 8) */ 1210 gets found in the wild in failure cases. Crypto is hard 8) */
1212 if (!is_valid_ether_addr(dev->dev_addr)) { 1211 if (!is_valid_ether_addr(dev->dev_addr)) {
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 9ba1f0b46429..9e90d411e0ad 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1826,7 +1826,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1826 void __iomem *regs; 1826 void __iomem *regs;
1827 resource_size_t pciaddr; 1827 resource_size_t pciaddr;
1828 unsigned int addr_len, i, pci_using_dac; 1828 unsigned int addr_len, i, pci_using_dac;
1829 DECLARE_MAC_BUF(mac);
1830 1829
1831#ifndef MODULE 1830#ifndef MODULE
1832 static int version_printed; 1831 static int version_printed;
@@ -1967,10 +1966,10 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1967 goto err_out_iomap; 1966 goto err_out_iomap;
1968 1967
1969 printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, " 1968 printk (KERN_INFO "%s: RTL-8139C+ at 0x%lx, "
1970 "%s, IRQ %d\n", 1969 "%pM, IRQ %d\n",
1971 dev->name, 1970 dev->name,
1972 dev->base_addr, 1971 dev->base_addr,
1973 print_mac(mac, dev->dev_addr), 1972 dev->dev_addr,
1974 dev->irq); 1973 dev->irq);
1975 1974
1976 pci_set_drvdata(pdev, dev); 1975 pci_set_drvdata(pdev, dev);
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 63f906b04899..96841e40bd46 100644
--- a/drivers/net/8139too.c
+++ b/drivers/net/8139too.c
@@ -925,7 +925,6 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
925 int i, addr_len, option; 925 int i, addr_len, option;
926 void __iomem *ioaddr; 926 void __iomem *ioaddr;
927 static int board_idx = -1; 927 static int board_idx = -1;
928 DECLARE_MAC_BUF(mac);
929 928
930 assert (pdev != NULL); 929 assert (pdev != NULL);
931 assert (ent != NULL); 930 assert (ent != NULL);
@@ -1024,11 +1023,11 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev,
1024 pci_set_drvdata (pdev, dev); 1023 pci_set_drvdata (pdev, dev);
1025 1024
1026 printk (KERN_INFO "%s: %s at 0x%lx, " 1025 printk (KERN_INFO "%s: %s at 0x%lx, "
1027 "%s, IRQ %d\n", 1026 "%pM, IRQ %d\n",
1028 dev->name, 1027 dev->name,
1029 board_info[ent->driver_data].name, 1028 board_info[ent->driver_data].name,
1030 dev->base_addr, 1029 dev->base_addr,
1031 print_mac(mac, dev->dev_addr), 1030 dev->dev_addr,
1032 dev->irq); 1031 dev->irq);
1033 1032
1034 printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n", 1033 printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n",
diff --git a/drivers/net/82596.c b/drivers/net/82596.c
index da292e647eb1..1d97bb5377a8 100644
--- a/drivers/net/82596.c
+++ b/drivers/net/82596.c
@@ -1116,12 +1116,8 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
1116 1116
1117static void print_eth(unsigned char *add, char *str) 1117static void print_eth(unsigned char *add, char *str)
1118{ 1118{
1119 DECLARE_MAC_BUF(mac); 1119 printk(KERN_DEBUG "i596 0x%p, %pM --> %pM %02X%02X, %s\n",
1120 DECLARE_MAC_BUF(mac2); 1120 add, add + 6, add, add[12], add[13], str);
1121
1122 printk(KERN_DEBUG "i596 0x%p, %s --> %s %02X%02X, %s\n",
1123 add, print_mac(mac, add + 6), print_mac(mac2, add),
1124 add[12], add[13], str);
1125} 1121}
1126 1122
1127static int io = 0x300; 1123static int io = 0x300;
@@ -1544,7 +1540,6 @@ static void set_multicast_list(struct net_device *dev)
1544 struct dev_mc_list *dmi; 1540 struct dev_mc_list *dmi;
1545 unsigned char *cp; 1541 unsigned char *cp;
1546 struct mc_cmd *cmd; 1542 struct mc_cmd *cmd;
1547 DECLARE_MAC_BUF(mac);
1548 1543
1549 if (wait_cfg(dev, &lp->mc_cmd.cmd, 1000, "multicast list change request timed out")) 1544 if (wait_cfg(dev, &lp->mc_cmd.cmd, 1000, "multicast list change request timed out"))
1550 return; 1545 return;
@@ -1555,8 +1550,8 @@ static void set_multicast_list(struct net_device *dev)
1555 for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) { 1550 for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) {
1556 memcpy(cp, dmi->dmi_addr, 6); 1551 memcpy(cp, dmi->dmi_addr, 6);
1557 if (i596_debug > 1) 1552 if (i596_debug > 1)
1558 DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %s\n", 1553 DEB(DEB_MULTI,printk(KERN_INFO "%s: Adding address %pM\n",
1559 dev->name, print_mac(mac, cp))); 1554 dev->name, cp));
1560 } 1555 }
1561 i596_add_cmd(dev, &cmd->cmd); 1556 i596_add_cmd(dev, &cmd->cmd);
1562 } 1557 }
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index f749b40f954e..0f3e6b2d2808 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1414,19 +1414,6 @@ config TC35815
1414 depends on NET_PCI && PCI && MIPS 1414 depends on NET_PCI && PCI && MIPS
1415 select PHYLIB 1415 select PHYLIB
1416 1416
1417config EEPRO100
1418 tristate "EtherExpressPro/100 support (eepro100, original Becker driver)"
1419 depends on NET_PCI && PCI
1420 select MII
1421 help
1422 If you have an Intel EtherExpress PRO/100 PCI network (Ethernet)
1423 card, say Y and read the Ethernet-HOWTO, available from
1424 <http://www.tldp.org/docs.html#howto>.
1425
1426 To compile this driver as a module, choose M here. The module
1427 will be called eepro100.
1428
1429
1430config E100 1417config E100
1431 tristate "Intel(R) PRO/100+ support" 1418 tristate "Intel(R) PRO/100+ support"
1432 depends on NET_PCI && PCI 1419 depends on NET_PCI && PCI
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index f19acf8b9220..657c47b1a6b6 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -53,7 +53,6 @@ obj-$(CONFIG_VORTEX) += 3c59x.o
53obj-$(CONFIG_TYPHOON) += typhoon.o 53obj-$(CONFIG_TYPHOON) += typhoon.o
54obj-$(CONFIG_NE2K_PCI) += ne2k-pci.o 8390.o 54obj-$(CONFIG_NE2K_PCI) += ne2k-pci.o 8390.o
55obj-$(CONFIG_PCNET32) += pcnet32.o 55obj-$(CONFIG_PCNET32) += pcnet32.o
56obj-$(CONFIG_EEPRO100) += eepro100.o
57obj-$(CONFIG_E100) += e100.o 56obj-$(CONFIG_E100) += e100.o
58obj-$(CONFIG_TLAN) += tlan.o 57obj-$(CONFIG_TLAN) += tlan.o
59obj-$(CONFIG_EPIC100) += epic100.o 58obj-$(CONFIG_EPIC100) += epic100.o
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c
index 9c0837435b68..48965de794bb 100644
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -710,7 +710,6 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
710 unsigned long board, base_addr, mem_start; 710 unsigned long board, base_addr, mem_start;
711 struct resource *r1, *r2; 711 struct resource *r1, *r2;
712 int err; 712 int err;
713 DECLARE_MAC_BUF(mac);
714 713
715 board = z->resource.start; 714 board = z->resource.start;
716 base_addr = board+A2065_LANCE; 715 base_addr = board+A2065_LANCE;
@@ -787,8 +786,7 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
787 zorro_set_drvdata(z, dev); 786 zorro_set_drvdata(z, dev);
788 787
789 printk(KERN_INFO "%s: A2065 at 0x%08lx, Ethernet Address " 788 printk(KERN_INFO "%s: A2065 at 0x%08lx, Ethernet Address "
790 "%s\n", dev->name, board, 789 "%pM\n", dev->name, board, dev->dev_addr);
791 print_mac(mac, dev->dev_addr));
792 790
793 return 0; 791 return 0;
794} 792}
diff --git a/drivers/net/ac3200.c b/drivers/net/ac3200.c
index b1448637107f..071a851a2ea1 100644
--- a/drivers/net/ac3200.c
+++ b/drivers/net/ac3200.c
@@ -146,7 +146,6 @@ out:
146static int __init ac_probe1(int ioaddr, struct net_device *dev) 146static int __init ac_probe1(int ioaddr, struct net_device *dev)
147{ 147{
148 int i, retval; 148 int i, retval;
149 DECLARE_MAC_BUF(mac);
150 149
151 if (!request_region(ioaddr, AC_IO_EXTENT, DRV_NAME)) 150 if (!request_region(ioaddr, AC_IO_EXTENT, DRV_NAME))
152 return -EBUSY; 151 return -EBUSY;
@@ -171,8 +170,8 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
171 for (i = 0; i < 6; i++) 170 for (i = 0; i < 6; i++)
172 dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i); 171 dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i);
173 172
174 printk(KERN_DEBUG "AC3200 in EISA slot %d, node %s", 173 printk(KERN_DEBUG "AC3200 in EISA slot %d, node %pM",
175 ioaddr/0x1000, print_mac(mac, dev->dev_addr)); 174 ioaddr/0x1000, dev->dev_addr);
176#if 0 175#if 0
177 /* Check the vendor ID/prefix. Redundant after checking the EISA ID */ 176 /* Check the vendor ID/prefix. Redundant after checking the EISA ID */
178 if (inb(ioaddr + AC_SA_PROM + 0) != AC_ADDR0 177 if (inb(ioaddr + AC_SA_PROM + 0) != AC_ADDR0
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index 66de80b64b92..6eefd93a08f3 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -892,7 +892,6 @@ static int __devinit ace_init(struct net_device *dev)
892 int board_idx, ecode = 0; 892 int board_idx, ecode = 0;
893 short i; 893 short i;
894 unsigned char cache_size; 894 unsigned char cache_size;
895 DECLARE_MAC_BUF(mac);
896 895
897 ap = netdev_priv(dev); 896 ap = netdev_priv(dev);
898 regs = ap->regs; 897 regs = ap->regs;
@@ -1019,7 +1018,7 @@ static int __devinit ace_init(struct net_device *dev)
1019 dev->dev_addr[4] = (mac2 >> 8) & 0xff; 1018 dev->dev_addr[4] = (mac2 >> 8) & 0xff;
1020 dev->dev_addr[5] = mac2 & 0xff; 1019 dev->dev_addr[5] = mac2 & 0xff;
1021 1020
1022 printk("MAC: %s\n", print_mac(mac, dev->dev_addr)); 1021 printk("MAC: %pM\n", dev->dev_addr);
1023 1022
1024 /* 1023 /*
1025 * Looks like this is necessary to deal with on all architectures, 1024 * Looks like this is necessary to deal with on all architectures,
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index 07a6697e3635..4a2ef838fed6 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -1821,7 +1821,6 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
1821 unsigned long reg_addr,reg_len; 1821 unsigned long reg_addr,reg_len;
1822 struct amd8111e_priv* lp; 1822 struct amd8111e_priv* lp;
1823 struct net_device* dev; 1823 struct net_device* dev;
1824 DECLARE_MAC_BUF(mac);
1825 1824
1826 err = pci_enable_device(pdev); 1825 err = pci_enable_device(pdev);
1827 if(err){ 1826 if(err){
@@ -1963,8 +1962,8 @@ static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
1963 chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28; 1962 chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28;
1964 printk(KERN_INFO "%s: AMD-8111e Driver Version: %s\n", 1963 printk(KERN_INFO "%s: AMD-8111e Driver Version: %s\n",
1965 dev->name,MODULE_VERS); 1964 dev->name,MODULE_VERS);
1966 printk(KERN_INFO "%s: [ Rev %x ] PCI 10/100BaseT Ethernet %s\n", 1965 printk(KERN_INFO "%s: [ Rev %x ] PCI 10/100BaseT Ethernet %pM\n",
1967 dev->name, chip_version, print_mac(mac, dev->dev_addr)); 1966 dev->name, chip_version, dev->dev_addr);
1968 if (lp->ext_phy_id) 1967 if (lp->ext_phy_id)
1969 printk(KERN_INFO "%s: Found MII PHY ID 0x%08x at address 0x%02x\n", 1968 printk(KERN_INFO "%s: Found MII PHY ID 0x%08x at address 0x%02x\n",
1970 dev->name, lp->ext_phy_id, lp->ext_phy_addr); 1969 dev->name, lp->ext_phy_id, lp->ext_phy_addr);
diff --git a/drivers/net/apne.c b/drivers/net/apne.c
index 867f6fff543c..7426f6940630 100644
--- a/drivers/net/apne.c
+++ b/drivers/net/apne.c
@@ -207,7 +207,6 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
207 int neX000, ctron; 207 int neX000, ctron;
208#endif 208#endif
209 static unsigned version_printed; 209 static unsigned version_printed;
210 DECLARE_MAC_BUF(mac);
211 210
212 if (ei_debug && version_printed++ == 0) 211 if (ei_debug && version_printed++ == 0)
213 printk(version); 212 printk(version);
@@ -323,7 +322,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
323 for(i = 0; i < ETHER_ADDR_LEN; i++) 322 for(i = 0; i < ETHER_ADDR_LEN; i++)
324 dev->dev_addr[i] = SA_prom[i]; 323 dev->dev_addr[i] = SA_prom[i];
325 324
326 printk(" %s\n", print_mac(mac, dev->dev_addr)); 325 printk(" %pM\n", dev->dev_addr);
327 326
328 printk("%s: %s found.\n", dev->name, name); 327 printk("%s: %s found.\n", dev->name, name);
329 328
diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c
index 29e53eb71c74..2903191f4b7a 100644
--- a/drivers/net/ariadne.c
+++ b/drivers/net/ariadne.c
@@ -165,7 +165,6 @@ static int __devinit ariadne_init_one(struct zorro_dev *z,
165 struct net_device *dev; 165 struct net_device *dev;
166 struct ariadne_private *priv; 166 struct ariadne_private *priv;
167 int err; 167 int err;
168 DECLARE_MAC_BUF(mac);
169 168
170 r1 = request_mem_region(base_addr, sizeof(struct Am79C960), "Am79C960"); 169 r1 = request_mem_region(base_addr, sizeof(struct Am79C960), "Am79C960");
171 if (!r1) 170 if (!r1)
@@ -215,9 +214,8 @@ static int __devinit ariadne_init_one(struct zorro_dev *z,
215 } 214 }
216 zorro_set_drvdata(z, dev); 215 zorro_set_drvdata(z, dev);
217 216
218 printk(KERN_INFO "%s: Ariadne at 0x%08lx, Ethernet Address " 217 printk(KERN_INFO "%s: Ariadne at 0x%08lx, Ethernet Address %pM\n",
219 "%s\n", dev->name, board, 218 dev->name, board, dev->dev_addr);
220 print_mac(mac, dev->dev_addr));
221 219
222 return 0; 220 return 0;
223} 221}
@@ -613,14 +611,10 @@ static int ariadne_start_xmit(struct sk_buff *skb, struct net_device *dev)
613 611
614#if 0 612#if 0
615{ 613{
616 DECLARE_MAC_BUF(mac); 614 printk(KERN_DEBUG "TX pkt type 0x%04x from %pM to %pM "
617 DECLARE_MAC_BUF(mac2);
618
619 printk(KERN_DEBUG "TX pkt type 0x%04x from %s to %s "
620 " data 0x%08x len %d\n", 615 " data 0x%08x len %d\n",
621 ((u_short *)skb->data)[6], 616 ((u_short *)skb->data)[6],
622 print_mac(mac, ((const u8 *)skb->data)+6), 617 skb->data + 6, skb->data,
623 print_mac(mac, (const u8 *)skb->data),
624 (int)skb->data, (int)skb->len); 618 (int)skb->data, (int)skb->len);
625} 619}
626#endif 620#endif
@@ -743,18 +737,16 @@ static int ariadne_rx(struct net_device *dev)
743 skb->protocol=eth_type_trans(skb,dev); 737 skb->protocol=eth_type_trans(skb,dev);
744#if 0 738#if 0
745{ 739{
746 DECLARE_MAC_BUF(mac);
747
748 printk(KERN_DEBUG "RX pkt type 0x%04x from ", 740 printk(KERN_DEBUG "RX pkt type 0x%04x from ",
749 ((u_short *)skb->data)[6]); 741 ((u_short *)skb->data)[6]);
750 { 742 {
751 u_char *ptr = &((u_char *)skb->data)[6]; 743 u_char *ptr = &((u_char *)skb->data)[6];
752 printk("%s", print_mac(mac, ptr)); 744 printk("%pM", ptr);
753 } 745 }
754 printk(" to "); 746 printk(" to ");
755 { 747 {
756 u_char *ptr = (u_char *)skb->data; 748 u_char *ptr = (u_char *)skb->data;
757 printk("%s", print_mac(mac, ptr)); 749 printk("%pM", ptr);
758 } 750 }
759 printk(" data 0x%08x len %d\n", (int)skb->data, (int)skb->len); 751 printk(" data 0x%08x len %d\n", (int)skb->data, (int)skb->len);
760} 752}
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index aa4a5246be53..645915553182 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -745,10 +745,8 @@ static int __init am79c961_probe(struct platform_device *pdev)
745 745
746 ret = register_netdev(dev); 746 ret = register_netdev(dev);
747 if (ret == 0) { 747 if (ret == 0) {
748 DECLARE_MAC_BUF(mac); 748 printk(KERN_INFO "%s: ether address %pM\n",
749 749 dev->name, dev->dev_addr);
750 printk(KERN_INFO "%s: ether address %s\n",
751 dev->name, print_mac(mac, dev->dev_addr));
752 return 0; 750 return 0;
753 } 751 }
754 752
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 6f431a887e7e..e21dc2075ed8 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -485,7 +485,6 @@ static void update_mac_address(struct net_device *dev)
485static int set_mac_address(struct net_device *dev, void* addr) 485static int set_mac_address(struct net_device *dev, void* addr)
486{ 486{
487 struct sockaddr *address = addr; 487 struct sockaddr *address = addr;
488 DECLARE_MAC_BUF(mac);
489 488
490 if (!is_valid_ether_addr(address->sa_data)) 489 if (!is_valid_ether_addr(address->sa_data))
491 return -EADDRNOTAVAIL; 490 return -EADDRNOTAVAIL;
@@ -493,8 +492,8 @@ static int set_mac_address(struct net_device *dev, void* addr)
493 memcpy(dev->dev_addr, address->sa_data, dev->addr_len); 492 memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
494 update_mac_address(dev); 493 update_mac_address(dev);
495 494
496 printk("%s: Setting MAC address to %s\n", dev->name, 495 printk("%s: Setting MAC address to %pM\n", dev->name,
497 print_mac(mac, dev->dev_addr)); 496 dev->dev_addr);
498 497
499 return 0; 498 return 0;
500} 499}
@@ -978,7 +977,6 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
978 struct at91_private *lp; 977 struct at91_private *lp;
979 unsigned int val; 978 unsigned int val;
980 int res; 979 int res;
981 DECLARE_MAC_BUF(mac);
982 980
983 dev = alloc_etherdev(sizeof(struct at91_private)); 981 dev = alloc_etherdev(sizeof(struct at91_private));
984 if (!dev) 982 if (!dev)
@@ -1084,11 +1082,11 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add
1084 gpio_request(lp->board_data.phy_irq_pin, "ethernet_phy"); 1082 gpio_request(lp->board_data.phy_irq_pin, "ethernet_phy");
1085 1083
1086 /* Display ethernet banner */ 1084 /* Display ethernet banner */
1087 printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%s)\n", 1085 printk(KERN_INFO "%s: AT91 ethernet at 0x%08x int=%d %s%s (%pM)\n",
1088 dev->name, (uint) dev->base_addr, dev->irq, 1086 dev->name, (uint) dev->base_addr, dev->irq,
1089 at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_SPD ? "100-" : "10-", 1087 at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_SPD ? "100-" : "10-",
1090 at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_FD ? "FullDuplex" : "HalfDuplex", 1088 at91_emac_read(AT91_EMAC_CFG) & AT91_EMAC_FD ? "FullDuplex" : "HalfDuplex",
1091 print_mac(mac, dev->dev_addr)); 1089 dev->dev_addr);
1092 if ((phy_type == MII_DM9161_ID) || (lp->phy_type == MII_DM9161A_ID)) 1090 if ((phy_type == MII_DM9161_ID) || (lp->phy_type == MII_DM9161A_ID))
1093 printk(KERN_INFO "%s: Davicom 9161 PHY %s\n", dev->name, (lp->phy_media == PORT_FIBRE) ? "(Fiber)" : "(Copper)"); 1091 printk(KERN_INFO "%s: Davicom 9161 PHY %s\n", dev->name, (lp->phy_media == PORT_FIBRE) ? "(Fiber)" : "(Copper)");
1094 else if (phy_type == MII_LXT971A_ID) 1092 else if (phy_type == MII_LXT971A_ID)
diff --git a/drivers/net/arm/ether1.c b/drivers/net/arm/ether1.c
index 3bb9e293e2ef..e380de454463 100644
--- a/drivers/net/arm/ether1.c
+++ b/drivers/net/arm/ether1.c
@@ -996,7 +996,6 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
996{ 996{
997 struct net_device *dev; 997 struct net_device *dev;
998 int i, ret = 0; 998 int i, ret = 0;
999 DECLARE_MAC_BUF(mac);
1000 999
1001 ether1_banner(); 1000 ether1_banner();
1002 1001
@@ -1044,8 +1043,8 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
1044 if (ret) 1043 if (ret)
1045 goto free; 1044 goto free;
1046 1045
1047 printk(KERN_INFO "%s: ether1 in slot %d, %s\n", 1046 printk(KERN_INFO "%s: ether1 in slot %d, %pM\n",
1048 dev->name, ec->slot_no, print_mac(mac, dev->dev_addr)); 1047 dev->name, ec->slot_no, dev->dev_addr);
1049 1048
1050 ecard_set_drvdata(ec, dev); 1049 ecard_set_drvdata(ec, dev);
1051 return 0; 1050 return 0;
diff --git a/drivers/net/arm/ether3.c b/drivers/net/arm/ether3.c
index 67e96ae85035..21a7bef12d3b 100644
--- a/drivers/net/arm/ether3.c
+++ b/drivers/net/arm/ether3.c
@@ -776,7 +776,6 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
776 const struct ether3_data *data = id->data; 776 const struct ether3_data *data = id->data;
777 struct net_device *dev; 777 struct net_device *dev;
778 int bus_type, ret; 778 int bus_type, ret;
779 DECLARE_MAC_BUF(mac);
780 779
781 ether3_banner(); 780 ether3_banner();
782 781
@@ -859,8 +858,8 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id)
859 if (ret) 858 if (ret)
860 goto free; 859 goto free;
861 860
862 printk("%s: %s in slot %d, %s\n", 861 printk("%s: %s in slot %d, %pM\n",
863 dev->name, data->name, ec->slot_no, print_mac(mac, dev->dev_addr)); 862 dev->name, data->name, ec->slot_no, dev->dev_addr);
864 863
865 ecard_set_drvdata(ec, dev); 864 ecard_set_drvdata(ec, dev);
866 return 0; 865 return 0;
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c
index 5c5f1e470d3c..9eb9d1bedc85 100644
--- a/drivers/net/arm/etherh.c
+++ b/drivers/net/arm/etherh.c
@@ -648,7 +648,6 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
648 struct net_device *dev; 648 struct net_device *dev;
649 struct etherh_priv *eh; 649 struct etherh_priv *eh;
650 int ret; 650 int ret;
651 DECLARE_MAC_BUF(mac);
652 651
653 etherh_banner(); 652 etherh_banner();
654 653
@@ -746,8 +745,8 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
746 if (ret) 745 if (ret)
747 goto free; 746 goto free;
748 747
749 printk(KERN_INFO "%s: %s in slot %d, %s\n", 748 printk(KERN_INFO "%s: %s in slot %d, %pM\n",
750 dev->name, data->name, ec->slot_no, print_mac(mac, dev->dev_addr)); 749 dev->name, data->name, ec->slot_no, dev->dev_addr);
751 750
752 ecard_set_drvdata(ec, dev); 751 ecard_set_drvdata(ec, dev);
753 752
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c
index 7e874d485d24..18f724581841 100644
--- a/drivers/net/at1700.c
+++ b/drivers/net/at1700.c
@@ -265,7 +265,6 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
265 unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0; 265 unsigned int i, irq, is_fmv18x = 0, is_at1700 = 0;
266 int slot, ret = -ENODEV; 266 int slot, ret = -ENODEV;
267 struct net_local *lp = netdev_priv(dev); 267 struct net_local *lp = netdev_priv(dev);
268 DECLARE_MAC_BUF(mac);
269 268
270 if (!request_region(ioaddr, AT1700_IO_EXTENT, DRV_NAME)) 269 if (!request_region(ioaddr, AT1700_IO_EXTENT, DRV_NAME))
271 return -EBUSY; 270 return -EBUSY;
@@ -397,7 +396,7 @@ found:
397 dev->dev_addr[i] = val; 396 dev->dev_addr[i] = val;
398 } 397 }
399 } 398 }
400 printk("%s", print_mac(mac, dev->dev_addr)); 399 printk("%pM", dev->dev_addr);
401 400
402 /* The EEPROM word 12 bit 0x0400 means use regular 100 ohm 10baseT signals, 401 /* The EEPROM word 12 bit 0x0400 means use regular 100 ohm 10baseT signals,
403 rather than 150 ohm shielded twisted pair compensation. 402 rather than 150 ohm shielded twisted pair compensation.
diff --git a/drivers/net/atarilance.c b/drivers/net/atarilance.c
index 0860cc280b01..5a94c49b4c45 100644
--- a/drivers/net/atarilance.c
+++ b/drivers/net/atarilance.c
@@ -466,7 +466,6 @@ static unsigned long __init lance_probe1( struct net_device *dev,
466 int i; 466 int i;
467 static int did_version; 467 static int did_version;
468 unsigned short save1, save2; 468 unsigned short save1, save2;
469 DECLARE_MAC_BUF(mac);
470 469
471 PROBE_PRINT(( "Probing for Lance card at mem %#lx io %#lx\n", 470 PROBE_PRINT(( "Probing for Lance card at mem %#lx io %#lx\n",
472 (long)memaddr, (long)ioaddr )); 471 (long)memaddr, (long)ioaddr ));
@@ -595,7 +594,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,
595 i = IO->mem; 594 i = IO->mem;
596 break; 595 break;
597 } 596 }
598 printk("%s\n", print_mac(mac, dev->dev_addr)); 597 printk("%pM\n", dev->dev_addr);
599 if (lp->cardtype == OLD_RIEBL) { 598 if (lp->cardtype == OLD_RIEBL) {
600 printk( "%s: Warning: This is a default ethernet address!\n", 599 printk( "%s: Warning: This is a default ethernet address!\n",
601 dev->name ); 600 dev->name );
@@ -778,8 +777,6 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
778 int entry, len; 777 int entry, len;
779 struct lance_tx_head *head; 778 struct lance_tx_head *head;
780 unsigned long flags; 779 unsigned long flags;
781 DECLARE_MAC_BUF(mac);
782 DECLARE_MAC_BUF(mac2);
783 780
784 DPRINTK( 2, ( "%s: lance_start_xmit() called, csr0 %4.4x.\n", 781 DPRINTK( 2, ( "%s: lance_start_xmit() called, csr0 %4.4x.\n",
785 dev->name, DREG )); 782 dev->name, DREG ));
@@ -802,12 +799,10 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
802 799
803 /* Fill in a Tx ring entry */ 800 /* Fill in a Tx ring entry */
804 if (lance_debug >= 3) { 801 if (lance_debug >= 3) {
805 printk( "%s: TX pkt type 0x%04x from " 802 printk( "%s: TX pkt type 0x%04x from %pM to %pM"
806 "%s to %s"
807 " data at 0x%08x len %d\n", 803 " data at 0x%08x len %d\n",
808 dev->name, ((u_short *)skb->data)[6], 804 dev->name, ((u_short *)skb->data)[6],
809 print_mac(mac, &skb->data[6]), 805 &skb->data[6], skb->data,
810 print_mac(mac2, skb->data),
811 (int)skb->data, (int)skb->len ); 806 (int)skb->data, (int)skb->len );
812 } 807 }
813 808
@@ -1019,14 +1014,12 @@ static int lance_rx( struct net_device *dev )
1019 1014
1020 if (lance_debug >= 3) { 1015 if (lance_debug >= 3) {
1021 u_char *data = PKTBUF_ADDR(head); 1016 u_char *data = PKTBUF_ADDR(head);
1022 DECLARE_MAC_BUF(mac);
1023 DECLARE_MAC_BUF(mac2);
1024 1017
1025 printk(KERN_DEBUG "%s: RX pkt type 0x%04x from %s to %s " 1018 printk(KERN_DEBUG "%s: RX pkt type 0x%04x from %pM to %pM "
1026 "data %02x %02x %02x %02x %02x %02x %02x %02x " 1019 "data %02x %02x %02x %02x %02x %02x %02x %02x "
1027 "len %d\n", 1020 "len %d\n",
1028 dev->name, ((u_short *)data)[6], 1021 dev->name, ((u_short *)data)[6],
1029 print_mac(mac, &data[6]), print_mac(mac2, data), 1022 &data[6], data,
1030 data[15], data[16], data[17], data[18], 1023 data[15], data[16], data[17], data[18],
1031 data[19], data[20], data[21], data[22], 1024 data[19], data[20], data[21], data[22],
1032 pkt_len); 1025 pkt_len);
diff --git a/drivers/net/atp.c b/drivers/net/atp.c
index c10cd8058e23..405c2dc5f3e4 100644
--- a/drivers/net/atp.c
+++ b/drivers/net/atp.c
@@ -248,7 +248,6 @@ static int __init atp_probe1(long ioaddr)
248 struct net_local *lp; 248 struct net_local *lp;
249 int saved_ctrl_reg, status, i; 249 int saved_ctrl_reg, status, i;
250 int res; 250 int res;
251 DECLARE_MAC_BUF(mac);
252 251
253 outb(0xff, ioaddr + PAR_DATA); 252 outb(0xff, ioaddr + PAR_DATA);
254 /* Save the original value of the Control register, in case we guessed 253 /* Save the original value of the Control register, in case we guessed
@@ -324,8 +323,8 @@ static int __init atp_probe1(long ioaddr)
324#endif 323#endif
325 324
326 printk(KERN_NOTICE "%s: Pocket adapter found at %#3lx, IRQ %d, " 325 printk(KERN_NOTICE "%s: Pocket adapter found at %#3lx, IRQ %d, "
327 "SAPROM %s.\n", 326 "SAPROM %pM.\n",
328 dev->name, dev->base_addr, dev->irq, print_mac(mac, dev->dev_addr)); 327 dev->name, dev->base_addr, dev->irq, dev->dev_addr);
329 328
330 /* Reset the ethernet hardware and activate the printer pass-through. */ 329 /* Reset the ethernet hardware and activate the printer pass-through. */
331 write_reg_high(ioaddr, CMR1, CMR1h_RESET | CMR1h_MUX); 330 write_reg_high(ioaddr, CMR1, CMR1h_RESET | CMR1h_MUX);
diff --git a/drivers/net/ax88796.c b/drivers/net/ax88796.c
index 9a314d88e7b6..337488ec707c 100644
--- a/drivers/net/ax88796.c
+++ b/drivers/net/ax88796.c
@@ -758,13 +758,10 @@ static int ax_init_dev(struct net_device *dev, int first_init)
758#endif 758#endif
759 ax_NS8390_init(dev, 0); 759 ax_NS8390_init(dev, 0);
760 760
761 if (first_init) { 761 if (first_init)
762 DECLARE_MAC_BUF(mac); 762 dev_info(&ax->dev->dev, "%dbit, irq %d, %lx, MAC: %pM\n",
763
764 dev_info(&ax->dev->dev, "%dbit, irq %d, %lx, MAC: %s\n",
765 ei_status.word16 ? 16:8, dev->irq, dev->base_addr, 763 ei_status.word16 ? 16:8, dev->irq, dev->base_addr,
766 print_mac(mac, dev->dev_addr)); 764 dev->dev_addr);
767 }
768 765
769 ret = register_netdev(dev); 766 ret = register_netdev(dev);
770 if (ret) 767 if (ret)
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index c3bda5ce67c4..1978d25920d9 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -2117,7 +2117,6 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
2117 struct net_device *dev; 2117 struct net_device *dev;
2118 struct b44 *bp; 2118 struct b44 *bp;
2119 int err; 2119 int err;
2120 DECLARE_MAC_BUF(mac);
2121 2120
2122 instance++; 2121 instance++;
2123 2122
@@ -2213,8 +2212,8 @@ static int __devinit b44_init_one(struct ssb_device *sdev,
2213 */ 2212 */
2214 b44_chip_reset(bp, B44_CHIP_RESET_FULL); 2213 b44_chip_reset(bp, B44_CHIP_RESET_FULL);
2215 2214
2216 printk(KERN_INFO "%s: Broadcom 44xx/47xx 10/100BaseT Ethernet %s\n", 2215 printk(KERN_INFO "%s: Broadcom 44xx/47xx 10/100BaseT Ethernet %pM\n",
2217 dev->name, print_mac(mac, dev->dev_addr)); 2216 dev->name, dev->dev_addr);
2218 2217
2219 return 0; 2218 return 0;
2220 2219
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index a42bd19646d3..b141d0234e21 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -1258,7 +1258,6 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
1258 unsigned char addr[6]; 1258 unsigned char addr[6];
1259 struct net_device *dev; 1259 struct net_device *dev;
1260 int is_bmac_plus = ((int)match->data) != 0; 1260 int is_bmac_plus = ((int)match->data) != 0;
1261 DECLARE_MAC_BUF(mac);
1262 1261
1263 if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) { 1262 if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) {
1264 printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n"); 1263 printk(KERN_ERR "BMAC: can't use, need 3 addrs and 3 intrs\n");
@@ -1368,8 +1367,8 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
1368 goto err_out_irq2; 1367 goto err_out_irq2;
1369 } 1368 }
1370 1369
1371 printk(KERN_INFO "%s: BMAC%s at %s", 1370 printk(KERN_INFO "%s: BMAC%s at %pM",
1372 dev->name, (is_bmac_plus ? "+" : ""), print_mac(mac, dev->dev_addr)); 1371 dev->name, (is_bmac_plus ? "+" : ""), dev->dev_addr);
1373 XXDEBUG((", base_addr=%#0lx", dev->base_addr)); 1372 XXDEBUG((", base_addr=%#0lx", dev->base_addr));
1374 printk("\n"); 1373 printk("\n");
1375 1374
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 430d430bce29..f2e8c3b3ee04 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -7700,7 +7700,6 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
7700 struct bnx2 *bp; 7700 struct bnx2 *bp;
7701 int rc; 7701 int rc;
7702 char str[40]; 7702 char str[40];
7703 DECLARE_MAC_BUF(mac);
7704 7703
7705 if (version_printed++ == 0) 7704 if (version_printed++ == 0)
7706 printk(KERN_INFO "%s", version); 7705 printk(KERN_INFO "%s", version);
@@ -7767,14 +7766,14 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
7767 } 7766 }
7768 7767
7769 printk(KERN_INFO "%s: %s (%c%d) %s found at mem %lx, " 7768 printk(KERN_INFO "%s: %s (%c%d) %s found at mem %lx, "
7770 "IRQ %d, node addr %s\n", 7769 "IRQ %d, node addr %pM\n",
7771 dev->name, 7770 dev->name,
7772 board_info[ent->driver_data].name, 7771 board_info[ent->driver_data].name,
7773 ((CHIP_ID(bp) & 0xf000) >> 12) + 'A', 7772 ((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
7774 ((CHIP_ID(bp) & 0x0ff0) >> 4), 7773 ((CHIP_ID(bp) & 0x0ff0) >> 4),
7775 bnx2_bus_string(bp, str), 7774 bnx2_bus_string(bp, str),
7776 dev->base_addr, 7775 dev->base_addr,
7777 bp->pdev->irq, print_mac(mac, dev->dev_addr)); 7776 bp->pdev->irq, dev->dev_addr);
7778 7777
7779 return 0; 7778 return 0;
7780} 7779}
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index fce745148ff9..42965ad54f08 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -9851,11 +9851,8 @@ static void bnx2x_set_rx_mode(struct net_device *dev)
9851 mclist && (i < dev->mc_count); 9851 mclist && (i < dev->mc_count);
9852 i++, mclist = mclist->next) { 9852 i++, mclist = mclist->next) {
9853 9853
9854 DP(NETIF_MSG_IFUP, "Adding mcast MAC: " 9854 DP(NETIF_MSG_IFUP, "Adding mcast MAC: %pM\n",
9855 "%02x:%02x:%02x:%02x:%02x:%02x\n", 9855 mclist->dmi_addr);
9856 mclist->dmi_addr[0], mclist->dmi_addr[1],
9857 mclist->dmi_addr[2], mclist->dmi_addr[3],
9858 mclist->dmi_addr[4], mclist->dmi_addr[5]);
9859 9856
9860 crc = crc32c_le(0, mclist->dmi_addr, ETH_ALEN); 9857 crc = crc32c_le(0, mclist->dmi_addr, ETH_ALEN);
9861 bit = (crc >> 24) & 0xff; 9858 bit = (crc >> 24) & 0xff;
@@ -10090,8 +10087,7 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
10090 10087
10091 dev->irq = pdev->irq; 10088 dev->irq = pdev->irq;
10092 10089
10093 bp->regview = ioremap_nocache(dev->base_addr, 10090 bp->regview = pci_ioremap_bar(pdev, 0);
10094 pci_resource_len(pdev, 0));
10095 if (!bp->regview) { 10091 if (!bp->regview) {
10096 printk(KERN_ERR PFX "Cannot map register space, aborting\n"); 10092 printk(KERN_ERR PFX "Cannot map register space, aborting\n");
10097 rc = -ENOMEM; 10093 rc = -ENOMEM;
@@ -10192,7 +10188,6 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev,
10192 struct net_device *dev = NULL; 10188 struct net_device *dev = NULL;
10193 struct bnx2x *bp; 10189 struct bnx2x *bp;
10194 int rc; 10190 int rc;
10195 DECLARE_MAC_BUF(mac);
10196 10191
10197 if (version_printed++ == 0) 10192 if (version_printed++ == 0)
10198 printk(KERN_INFO "%s", version); 10193 printk(KERN_INFO "%s", version);
@@ -10236,7 +10231,7 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev,
10236 bnx2x_get_pcie_width(bp), 10231 bnx2x_get_pcie_width(bp),
10237 (bnx2x_get_pcie_speed(bp) == 2) ? "5GHz (Gen2)" : "2.5GHz", 10232 (bnx2x_get_pcie_speed(bp) == 2) ? "5GHz (Gen2)" : "2.5GHz",
10238 dev->base_addr, bp->pdev->irq); 10233 dev->base_addr, bp->pdev->irq);
10239 printk(KERN_CONT "node addr %s\n", print_mac(mac, dev->dev_addr)); 10234 printk(KERN_CONT "node addr %pM\n", dev->dev_addr);
10240 return 0; 10235 return 0;
10241 10236
10242init_one_exit: 10237init_one_exit:
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a3efba59eee9..fd9028d7c06e 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1791,7 +1791,6 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1791 struct slave *slave, *oldcurrent; 1791 struct slave *slave, *oldcurrent;
1792 struct sockaddr addr; 1792 struct sockaddr addr;
1793 int mac_addr_differ; 1793 int mac_addr_differ;
1794 DECLARE_MAC_BUF(mac);
1795 1794
1796 /* slave is not a slave or master is not master of this slave */ 1795 /* slave is not a slave or master is not master of this slave */
1797 if (!(slave_dev->flags & IFF_SLAVE) || 1796 if (!(slave_dev->flags & IFF_SLAVE) ||
@@ -1820,11 +1819,11 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1820 if (!mac_addr_differ && (bond->slave_cnt > 1)) 1819 if (!mac_addr_differ && (bond->slave_cnt > 1))
1821 printk(KERN_WARNING DRV_NAME 1820 printk(KERN_WARNING DRV_NAME
1822 ": %s: Warning: the permanent HWaddr of %s - " 1821 ": %s: Warning: the permanent HWaddr of %s - "
1823 "%s - is still in use by %s. " 1822 "%pM - is still in use by %s. "
1824 "Set the HWaddr of %s to a different address " 1823 "Set the HWaddr of %s to a different address "
1825 "to avoid conflicts.\n", 1824 "to avoid conflicts.\n",
1826 bond_dev->name, slave_dev->name, 1825 bond_dev->name, slave_dev->name,
1827 print_mac(mac, slave->perm_hwaddr), 1826 slave->perm_hwaddr,
1828 bond_dev->name, slave_dev->name); 1827 bond_dev->name, slave_dev->name);
1829 } 1828 }
1830 1829
@@ -3239,7 +3238,6 @@ static void bond_info_show_master(struct seq_file *seq)
3239 struct bonding *bond = seq->private; 3238 struct bonding *bond = seq->private;
3240 struct slave *curr; 3239 struct slave *curr;
3241 int i; 3240 int i;
3242 u32 target;
3243 3241
3244 read_lock(&bond->curr_slave_lock); 3242 read_lock(&bond->curr_slave_lock);
3245 curr = bond->curr_active_slave; 3243 curr = bond->curr_active_slave;
@@ -3293,8 +3291,7 @@ static void bond_info_show_master(struct seq_file *seq)
3293 continue; 3291 continue;
3294 if (printed) 3292 if (printed)
3295 seq_printf(seq, ","); 3293 seq_printf(seq, ",");
3296 target = ntohl(bond->params.arp_targets[i]); 3294 seq_printf(seq, " %pI4", &bond->params.arp_targets[i]);
3297 seq_printf(seq, " %d.%d.%d.%d", HIPQUAD(target));
3298 printed = 1; 3295 printed = 1;
3299 } 3296 }
3300 seq_printf(seq, "\n"); 3297 seq_printf(seq, "\n");
@@ -3302,7 +3299,6 @@ static void bond_info_show_master(struct seq_file *seq)
3302 3299
3303 if (bond->params.mode == BOND_MODE_8023AD) { 3300 if (bond->params.mode == BOND_MODE_8023AD) {
3304 struct ad_info ad_info; 3301 struct ad_info ad_info;
3305 DECLARE_MAC_BUF(mac);
3306 3302
3307 seq_puts(seq, "\n802.3ad info\n"); 3303 seq_puts(seq, "\n802.3ad info\n");
3308 seq_printf(seq, "LACP rate: %s\n", 3304 seq_printf(seq, "LACP rate: %s\n",
@@ -3322,8 +3318,8 @@ static void bond_info_show_master(struct seq_file *seq)
3322 ad_info.actor_key); 3318 ad_info.actor_key);
3323 seq_printf(seq, "\tPartner Key: %d\n", 3319 seq_printf(seq, "\tPartner Key: %d\n",
3324 ad_info.partner_key); 3320 ad_info.partner_key);
3325 seq_printf(seq, "\tPartner Mac Address: %s\n", 3321 seq_printf(seq, "\tPartner Mac Address: %pM\n",
3326 print_mac(mac, ad_info.partner_system)); 3322 ad_info.partner_system);
3327 } 3323 }
3328 } 3324 }
3329} 3325}
@@ -3331,7 +3327,6 @@ static void bond_info_show_master(struct seq_file *seq)
3331static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave) 3327static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave)
3332{ 3328{
3333 struct bonding *bond = seq->private; 3329 struct bonding *bond = seq->private;
3334 DECLARE_MAC_BUF(mac);
3335 3330
3336 seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name); 3331 seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
3337 seq_printf(seq, "MII Status: %s\n", 3332 seq_printf(seq, "MII Status: %s\n",
@@ -3339,9 +3334,7 @@ static void bond_info_show_slave(struct seq_file *seq, const struct slave *slave
3339 seq_printf(seq, "Link Failure Count: %u\n", 3334 seq_printf(seq, "Link Failure Count: %u\n",
3340 slave->link_failure_count); 3335 slave->link_failure_count);
3341 3336
3342 seq_printf(seq, 3337 seq_printf(seq, "Permanent HW addr: %pM\n", slave->perm_hwaddr);
3343 "Permanent HW addr: %s\n",
3344 print_mac(mac, slave->perm_hwaddr));
3345 3338
3346 if (bond->params.mode == BOND_MODE_8023AD) { 3339 if (bond->params.mode == BOND_MODE_8023AD) {
3347 const struct aggregator *agg 3340 const struct aggregator *agg
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 3bdb47382521..99c79a4e0806 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -1391,13 +1391,11 @@ static ssize_t bonding_show_ad_partner_mac(struct device *d,
1391{ 1391{
1392 int count = 0; 1392 int count = 0;
1393 struct bonding *bond = to_bond(d); 1393 struct bonding *bond = to_bond(d);
1394 DECLARE_MAC_BUF(mac);
1395 1394
1396 if (bond->params.mode == BOND_MODE_8023AD) { 1395 if (bond->params.mode == BOND_MODE_8023AD) {
1397 struct ad_info ad_info; 1396 struct ad_info ad_info;
1398 if (!bond_3ad_get_active_agg_info(bond, &ad_info)) { 1397 if (!bond_3ad_get_active_agg_info(bond, &ad_info)) {
1399 count = sprintf(buf,"%s\n", 1398 count = sprintf(buf, "%pM\n", ad_info.partner_system);
1400 print_mac(mac, ad_info.partner_system));
1401 } 1399 }
1402 } 1400 }
1403 1401
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 86909cfb14de..a06931d76f94 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -4988,7 +4988,6 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4988 int i, err, pci_using_dac; 4988 int i, err, pci_using_dac;
4989 u16 pci_cmd; 4989 u16 pci_cmd;
4990 u8 orig_cacheline_size = 0, cas_cacheline_size = 0; 4990 u8 orig_cacheline_size = 0, cas_cacheline_size = 0;
4991 DECLARE_MAC_BUF(mac);
4992 4991
4993 if (cas_version_printed++ == 0) 4992 if (cas_version_printed++ == 0)
4994 printk(KERN_INFO "%s", version); 4993 printk(KERN_INFO "%s", version);
@@ -5201,12 +5200,12 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
5201 5200
5202 i = readl(cp->regs + REG_BIM_CFG); 5201 i = readl(cp->regs + REG_BIM_CFG);
5203 printk(KERN_INFO "%s: Sun Cassini%s (%sbit/%sMHz PCI/%s) " 5202 printk(KERN_INFO "%s: Sun Cassini%s (%sbit/%sMHz PCI/%s) "
5204 "Ethernet[%d] %s\n", dev->name, 5203 "Ethernet[%d] %pM\n", dev->name,
5205 (cp->cas_flags & CAS_FLAG_REG_PLUS) ? "+" : "", 5204 (cp->cas_flags & CAS_FLAG_REG_PLUS) ? "+" : "",
5206 (i & BIM_CFG_32BIT) ? "32" : "64", 5205 (i & BIM_CFG_32BIT) ? "32" : "64",
5207 (i & BIM_CFG_66MHZ) ? "66" : "33", 5206 (i & BIM_CFG_66MHZ) ? "66" : "33",
5208 (cp->phy_type == CAS_PHY_SERDES) ? "Fi" : "Cu", pdev->irq, 5207 (cp->phy_type == CAS_PHY_SERDES) ? "Fi" : "Cu", pdev->irq,
5209 print_mac(mac, dev->dev_addr)); 5208 dev->dev_addr);
5210 5209
5211 pci_set_drvdata(pdev, dev); 5210 pci_set_drvdata(pdev, dev);
5212 cp->hw_running = 1; 5211 cp->hw_running = 1;
diff --git a/drivers/net/cpmac.c b/drivers/net/cpmac.c
index 017a5361b980..d39a77cba1af 100644
--- a/drivers/net/cpmac.c
+++ b/drivers/net/cpmac.c
@@ -1103,7 +1103,6 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1103 struct cpmac_priv *priv; 1103 struct cpmac_priv *priv;
1104 struct net_device *dev; 1104 struct net_device *dev;
1105 struct plat_cpmac_data *pdata; 1105 struct plat_cpmac_data *pdata;
1106 DECLARE_MAC_BUF(mac);
1107 1106
1108 pdata = pdev->dev.platform_data; 1107 pdata = pdev->dev.platform_data;
1109 1108
@@ -1180,8 +1179,8 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1180 if (netif_msg_probe(priv)) { 1179 if (netif_msg_probe(priv)) {
1181 printk(KERN_INFO 1180 printk(KERN_INFO
1182 "cpmac: device %s (regs: %p, irq: %d, phy: %s, " 1181 "cpmac: device %s (regs: %p, irq: %d, phy: %s, "
1183 "mac: %s)\n", dev->name, (void *)mem->start, dev->irq, 1182 "mac: %pM)\n", dev->name, (void *)mem->start, dev->irq,
1184 priv->phy_name, print_mac(mac, dev->dev_addr)); 1183 priv->phy_name, dev->dev_addr);
1185 } 1184 }
1186 return 0; 1185 return 0;
1187 1186
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 65d0a9103297..486fa215d3ad 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -419,7 +419,6 @@ e100_set_mac_address(struct net_device *dev, void *p)
419{ 419{
420 struct net_local *np = netdev_priv(dev); 420 struct net_local *np = netdev_priv(dev);
421 struct sockaddr *addr = p; 421 struct sockaddr *addr = p;
422 DECLARE_MAC_BUF(mac);
423 422
424 spin_lock(&np->lock); /* preemption protection */ 423 spin_lock(&np->lock); /* preemption protection */
425 424
@@ -440,8 +439,7 @@ e100_set_mac_address(struct net_device *dev, void *p)
440 439
441 /* show it in the log as well */ 440 /* show it in the log as well */
442 441
443 printk(KERN_INFO "%s: changed MAC to %s\n", 442 printk(KERN_INFO "%s: changed MAC to %pM\n", dev->name, dev->dev_addr);
444 dev->name, print_mac(mac, dev->dev_addr));
445 443
446 spin_unlock(&np->lock); 444 spin_unlock(&np->lock);
447 445
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c
index 7107620f615d..65174d3b9026 100644
--- a/drivers/net/cs89x0.c
+++ b/drivers/net/cs89x0.c
@@ -521,7 +521,6 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
521 unsigned rev_type = 0; 521 unsigned rev_type = 0;
522 int eeprom_buff[CHKSUM_LEN]; 522 int eeprom_buff[CHKSUM_LEN];
523 int retval; 523 int retval;
524 DECLARE_MAC_BUF(mac);
525 524
526 /* Initialize the device structure. */ 525 /* Initialize the device structure. */
527 if (!modular) { 526 if (!modular) {
@@ -846,7 +845,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
846 } 845 }
847 846
848 /* print the ethernet address. */ 847 /* print the ethernet address. */
849 printk(", MAC %s", print_mac(mac, dev->dev_addr)); 848 printk(", MAC %pM", dev->dev_addr);
850 849
851 dev->open = net_open; 850 dev->open = net_open;
852 dev->stop = net_close; 851 dev->stop = net_close;
@@ -1817,11 +1816,10 @@ static int set_mac_address(struct net_device *dev, void *p)
1817 1816
1818 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); 1817 memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
1819 1818
1820 if (net_debug) { 1819 if (net_debug)
1821 DECLARE_MAC_BUF(mac); 1820 printk("%s: Setting MAC address to %pM.\n",
1822 printk("%s: Setting MAC address to %s.\n", 1821 dev->name, dev->dev_addr);
1823 dev->name, print_mac(mac, dev->dev_addr)); 1822
1824 }
1825 /* set the Ethernet address */ 1823 /* set the Ethernet address */
1826 for (i=0; i < ETH_ALEN/2; i++) 1824 for (i=0; i < ETH_ALEN/2; i++)
1827 writereg(dev, PP_IA+i*2, dev->dev_addr[i*2] | (dev->dev_addr[i*2+1] << 8)); 1825 writereg(dev, PP_IA+i*2, dev->dev_addr[i*2] | (dev->dev_addr[i*2+1] << 8));
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 1ace41a13ac3..e1746eeb34a4 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -494,6 +494,36 @@ static void enable_all_napi(struct adapter *adap)
494} 494}
495 495
496/** 496/**
497 * set_qset_lro - Turn a queue set's LRO capability on and off
498 * @dev: the device the qset is attached to
499 * @qset_idx: the queue set index
500 * @val: the LRO switch
501 *
502 * Sets LRO on or off for a particular queue set.
503 * the device's features flag is updated to reflect the LRO
504 * capability when all queues belonging to the device are
505 * in the same state.
506 */
507static void set_qset_lro(struct net_device *dev, int qset_idx, int val)
508{
509 struct port_info *pi = netdev_priv(dev);
510 struct adapter *adapter = pi->adapter;
511 int i, lro_on = 1;
512
513 adapter->params.sge.qset[qset_idx].lro = !!val;
514 adapter->sge.qs[qset_idx].lro_enabled = !!val;
515
516 /* let ethtool report LRO on only if all queues are LRO enabled */
517 for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; ++i)
518 lro_on &= adapter->params.sge.qset[i].lro;
519
520 if (lro_on)
521 dev->features |= NETIF_F_LRO;
522 else
523 dev->features &= ~NETIF_F_LRO;
524}
525
526/**
497 * setup_sge_qsets - configure SGE Tx/Rx/response queues 527 * setup_sge_qsets - configure SGE Tx/Rx/response queues
498 * @adap: the adapter 528 * @adap: the adapter
499 * 529 *
@@ -516,8 +546,7 @@ static int setup_sge_qsets(struct adapter *adap)
516 pi->qs = &adap->sge.qs[pi->first_qset]; 546 pi->qs = &adap->sge.qs[pi->first_qset];
517 for (j = pi->first_qset; j < pi->first_qset + pi->nqsets; 547 for (j = pi->first_qset; j < pi->first_qset + pi->nqsets;
518 ++j, ++qset_idx) { 548 ++j, ++qset_idx) {
519 if (!pi->rx_csum_offload) 549 set_qset_lro(dev, qset_idx, pi->rx_csum_offload);
520 adap->params.sge.qset[qset_idx].lro = 0;
521 err = t3_sge_alloc_qset(adap, qset_idx, 1, 550 err = t3_sge_alloc_qset(adap, qset_idx, 1,
522 (adap->flags & USING_MSIX) ? qset_idx + 1 : 551 (adap->flags & USING_MSIX) ? qset_idx + 1 :
523 irq_idx, 552 irq_idx,
@@ -1632,13 +1661,10 @@ static int set_rx_csum(struct net_device *dev, u32 data)
1632 1661
1633 p->rx_csum_offload = data; 1662 p->rx_csum_offload = data;
1634 if (!data) { 1663 if (!data) {
1635 struct adapter *adap = p->adapter;
1636 int i; 1664 int i;
1637 1665
1638 for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) { 1666 for (i = p->first_qset; i < p->first_qset + p->nqsets; i++)
1639 adap->params.sge.qset[i].lro = 0; 1667 set_qset_lro(dev, i, 0);
1640 adap->sge.qs[i].lro_enabled = 0;
1641 }
1642 } 1668 }
1643 return 0; 1669 return 0;
1644} 1670}
@@ -1793,6 +1819,25 @@ static void get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
1793 memset(&wol->sopass, 0, sizeof(wol->sopass)); 1819 memset(&wol->sopass, 0, sizeof(wol->sopass));
1794} 1820}
1795 1821
1822static int cxgb3_set_flags(struct net_device *dev, u32 data)
1823{
1824 struct port_info *pi = netdev_priv(dev);
1825 int i;
1826
1827 if (data & ETH_FLAG_LRO) {
1828 if (!pi->rx_csum_offload)
1829 return -EINVAL;
1830
1831 for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++)
1832 set_qset_lro(dev, i, 1);
1833
1834 } else
1835 for (i = pi->first_qset; i < pi->first_qset + pi->nqsets; i++)
1836 set_qset_lro(dev, i, 0);
1837
1838 return 0;
1839}
1840
1796static const struct ethtool_ops cxgb_ethtool_ops = { 1841static const struct ethtool_ops cxgb_ethtool_ops = {
1797 .get_settings = get_settings, 1842 .get_settings = get_settings,
1798 .set_settings = set_settings, 1843 .set_settings = set_settings,
@@ -1822,6 +1867,8 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
1822 .get_regs = get_regs, 1867 .get_regs = get_regs,
1823 .get_wol = get_wol, 1868 .get_wol = get_wol,
1824 .set_tso = ethtool_op_set_tso, 1869 .set_tso = ethtool_op_set_tso,
1870 .get_flags = ethtool_op_get_flags,
1871 .set_flags = cxgb3_set_flags,
1825}; 1872};
1826 1873
1827static int in_range(int val, int lo, int hi) 1874static int in_range(int val, int lo, int hi)
@@ -1938,11 +1985,9 @@ static int cxgb_extension_ioctl(struct net_device *dev, void __user *useraddr)
1938 } 1985 }
1939 } 1986 }
1940 } 1987 }
1941 if (t.lro >= 0) { 1988 if (t.lro >= 0)
1942 struct sge_qset *qs = &adapter->sge.qs[t.qset_idx]; 1989 set_qset_lro(dev, t.qset_idx, t.lro);
1943 q->lro = t.lro; 1990
1944 qs->lro_enabled = t.lro;
1945 }
1946 break; 1991 break;
1947 } 1992 }
1948 case CHELSIO_GET_QSET_PARAMS:{ 1993 case CHELSIO_GET_QSET_PARAMS:{
diff --git a/drivers/net/de600.c b/drivers/net/de600.c
index cb849b091f98..2826c7473e5e 100644
--- a/drivers/net/de600.c
+++ b/drivers/net/de600.c
@@ -384,7 +384,6 @@ static struct net_device * __init de600_probe(void)
384 int i; 384 int i;
385 struct net_device *dev; 385 struct net_device *dev;
386 int err; 386 int err;
387 DECLARE_MAC_BUF(mac);
388 387
389 dev = alloc_etherdev(0); 388 dev = alloc_etherdev(0);
390 if (!dev) 389 if (!dev)
@@ -439,7 +438,7 @@ static struct net_device * __init de600_probe(void)
439 goto out1; 438 goto out1;
440 } 439 }
441 440
442 printk(", Ethernet Address: %s\n", print_mac(mac, dev->dev_addr)); 441 printk(", Ethernet Address: %pM\n", dev->dev_addr);
443 442
444 dev->open = de600_open; 443 dev->open = de600_open;
445 dev->stop = de600_close; 444 dev->stop = de600_close;
diff --git a/drivers/net/de620.c b/drivers/net/de620.c
index d454e143483e..643b1ea08414 100644
--- a/drivers/net/de620.c
+++ b/drivers/net/de620.c
@@ -800,7 +800,6 @@ struct net_device * __init de620_probe(int unit)
800 struct net_device *dev; 800 struct net_device *dev;
801 int err = -ENOMEM; 801 int err = -ENOMEM;
802 int i; 802 int i;
803 DECLARE_MAC_BUF(mac);
804 803
805 dev = alloc_etherdev(0); 804 dev = alloc_etherdev(0);
806 if (!dev) 805 if (!dev)
@@ -853,7 +852,7 @@ struct net_device * __init de620_probe(int unit)
853 dev->broadcast[i] = 0xff; 852 dev->broadcast[i] = 0xff;
854 } 853 }
855 854
856 printk(", Ethernet Address: %s", print_mac(mac, dev->dev_addr)); 855 printk(", Ethernet Address: %pM", dev->dev_addr);
857 856
858 printk(" (%dk RAM,", 857 printk(" (%dk RAM,",
859 (nic_data.RAM_Size) ? (nic_data.RAM_Size >> 2) : 64); 858 (nic_data.RAM_Size) ? (nic_data.RAM_Size >> 2) : 64);
@@ -876,10 +875,7 @@ struct net_device * __init de620_probe(int unit)
876 if (de620_debug) { 875 if (de620_debug) {
877 printk("\nEEPROM contents:\n"); 876 printk("\nEEPROM contents:\n");
878 printk("RAM_Size = 0x%02X\n", nic_data.RAM_Size); 877 printk("RAM_Size = 0x%02X\n", nic_data.RAM_Size);
879 printk("NodeID = %02X:%02X:%02X:%02X:%02X:%02X\n", 878 printk("NodeID = %pM\n", nic_data.NodeID);
880 nic_data.NodeID[0], nic_data.NodeID[1],
881 nic_data.NodeID[2], nic_data.NodeID[3],
882 nic_data.NodeID[4], nic_data.NodeID[5]);
883 printk("Model = %d\n", nic_data.Model); 879 printk("Model = %d\n", nic_data.Model);
884 printk("Media = %d\n", nic_data.Media); 880 printk("Media = %d\n", nic_data.Media);
885 printk("SCR = 0x%02x\n", nic_data.SCR); 881 printk("SCR = 0x%02x\n", nic_data.SCR);
diff --git a/drivers/net/declance.c b/drivers/net/declance.c
index 3e3506411ac0..df01ad3e7984 100644
--- a/drivers/net/declance.c
+++ b/drivers/net/declance.c
@@ -1023,7 +1023,6 @@ static int __init dec_lance_probe(struct device *bdev, const int type)
1023 int i, ret; 1023 int i, ret;
1024 unsigned long esar_base; 1024 unsigned long esar_base;
1025 unsigned char *esar; 1025 unsigned char *esar;
1026 DECLARE_MAC_BUF(mac);
1027 1026
1028 if (dec_lance_debug && version_printed++ == 0) 1027 if (dec_lance_debug && version_printed++ == 0)
1029 printk(version); 1028 printk(version);
@@ -1223,8 +1222,7 @@ static int __init dec_lance_probe(struct device *bdev, const int type)
1223 for (i = 0; i < 6; i++) 1222 for (i = 0; i < 6; i++)
1224 dev->dev_addr[i] = esar[i * 4]; 1223 dev->dev_addr[i] = esar[i * 4];
1225 1224
1226 printk(", addr = %s, irq = %d\n", 1225 printk(", addr = %pM, irq = %d\n", dev->dev_addr, dev->irq);
1227 print_mac(mac, dev->dev_addr), dev->irq);
1228 1226
1229 dev->open = &lance_open; 1227 dev->open = &lance_open;
1230 dev->stop = &lance_close; 1228 dev->stop = &lance_close;
diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index ace39ec0a367..bf6401f8d144 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -573,7 +573,6 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
573 s16 nicsr; 573 s16 nicsr;
574 u_long ioaddr; 574 u_long ioaddr;
575 u_long mem_start; 575 u_long mem_start;
576 DECLARE_MAC_BUF(mac);
577 576
578 /* 577 /*
579 * We are now supposed to enter this function with the 578 * We are now supposed to enter this function with the
@@ -633,7 +632,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
633 632
634 printk(", h/w address "); 633 printk(", h/w address ");
635 status = get_hw_addr(dev); 634 status = get_hw_addr(dev);
636 printk("%s", print_mac(mac, dev->dev_addr)); 635 printk("%pM", dev->dev_addr);
637 if (status != 0) { 636 if (status != 0) {
638 printk(" which has an Ethernet PROM CRC error.\n"); 637 printk(" which has an Ethernet PROM CRC error.\n");
639 return -ENXIO; 638 return -ENXIO;
@@ -1841,7 +1840,6 @@ static void depca_dbg_open(struct net_device *dev)
1841 u_long ioaddr = dev->base_addr; 1840 u_long ioaddr = dev->base_addr;
1842 struct depca_init *p = &lp->init_block; 1841 struct depca_init *p = &lp->init_block;
1843 int i; 1842 int i;
1844 DECLARE_MAC_BUF(mac);
1845 1843
1846 if (depca_debug > 1) { 1844 if (depca_debug > 1) {
1847 /* Do not copy the shadow init block into shared memory */ 1845 /* Do not copy the shadow init block into shared memory */
@@ -1880,7 +1878,7 @@ static void depca_dbg_open(struct net_device *dev)
1880 printk("...0x%8.8x\n", readl(&lp->tx_ring[i].base)); 1878 printk("...0x%8.8x\n", readl(&lp->tx_ring[i].base));
1881 printk("Initialisation block at 0x%8.8lx(Phys)\n", lp->mem_start); 1879 printk("Initialisation block at 0x%8.8lx(Phys)\n", lp->mem_start);
1882 printk(" mode: 0x%4.4x\n", p->mode); 1880 printk(" mode: 0x%4.4x\n", p->mode);
1883 printk(" physical address: %s\n", print_mac(mac, p->phys_addr)); 1881 printk(" physical address: %pM\n", p->phys_addr);
1884 printk(" multicast hash table: "); 1882 printk(" multicast hash table: ");
1885 for (i = 0; i < (HASH_TABLE_LEN >> 3) - 1; i++) { 1883 for (i = 0; i < (HASH_TABLE_LEN >> 3) - 1; i++) {
1886 printk("%2.2x:", p->mcast_table[i]); 1884 printk("%2.2x:", p->mcast_table[i]);
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index f8037110a522..f9e405a8a844 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -97,7 +97,6 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
97 static int version_printed; 97 static int version_printed;
98 void *ring_space; 98 void *ring_space;
99 dma_addr_t ring_dma; 99 dma_addr_t ring_dma;
100 DECLARE_MAC_BUF(mac);
101 100
102 if (!version_printed++) 101 if (!version_printed++)
103 printk ("%s", version); 102 printk ("%s", version);
@@ -257,8 +256,8 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
257 256
258 card_idx++; 257 card_idx++;
259 258
260 printk (KERN_INFO "%s: %s, %s, IRQ %d\n", 259 printk (KERN_INFO "%s: %s, %pM, IRQ %d\n",
261 dev->name, np->name, print_mac(mac, dev->dev_addr), irq); 260 dev->name, np->name, dev->dev_addr, irq);
262 if (tx_coalesce > 1) 261 if (tx_coalesce > 1)
263 printk(KERN_INFO "tx_coalesce:\t%d packets\n", 262 printk(KERN_INFO "tx_coalesce:\t%d packets\n",
264 tx_coalesce); 263 tx_coalesce);
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 5a9083e3f443..22dd3081339d 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -1385,13 +1385,11 @@ dm9000_probe(struct platform_device *pdev)
1385 platform_set_drvdata(pdev, ndev); 1385 platform_set_drvdata(pdev, ndev);
1386 ret = register_netdev(ndev); 1386 ret = register_netdev(ndev);
1387 1387
1388 if (ret == 0) { 1388 if (ret == 0)
1389 DECLARE_MAC_BUF(mac); 1389 printk(KERN_INFO "%s: dm9000%c at %p,%p IRQ %d MAC: %pM (%s)\n",
1390 printk(KERN_INFO "%s: dm9000%c at %p,%p IRQ %d MAC: %s (%s)\n",
1391 ndev->name, dm9000_type_to_char(db->type), 1390 ndev->name, dm9000_type_to_char(db->type),
1392 db->io_addr, db->io_data, ndev->irq, 1391 db->io_addr, db->io_data, ndev->irq,
1393 print_mac(mac, ndev->dev_addr), mac_src); 1392 ndev->dev_addr, mac_src);
1394 }
1395 return 0; 1393 return 0;
1396 1394
1397out: 1395out:
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 3d69fae781cf..084127fe0813 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2322,7 +2322,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
2322{ 2322{
2323 struct nic *nic = netdev_priv(netdev); 2323 struct nic *nic = netdev_priv(netdev);
2324 2324
2325 if(wol->wolopts != WAKE_MAGIC && wol->wolopts != 0) 2325 if ((wol->wolopts && wol->wolopts != WAKE_MAGIC) ||
2326 !device_can_wakeup(&nic->pdev->dev))
2326 return -EOPNOTSUPP; 2327 return -EOPNOTSUPP;
2327 2328
2328 if(wol->wolopts) 2329 if(wol->wolopts)
@@ -2330,6 +2331,8 @@ static int e100_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
2330 else 2331 else
2331 nic->flags &= ~wol_magic; 2332 nic->flags &= ~wol_magic;
2332 2333
2334 device_set_wakeup_enable(&nic->pdev->dev, wol->wolopts);
2335
2333 e100_exec_cb(nic, NULL, e100_configure); 2336 e100_exec_cb(nic, NULL, e100_configure);
2334 2337
2335 return 0; 2338 return 0;
@@ -2616,7 +2619,6 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2616 struct net_device *netdev; 2619 struct net_device *netdev;
2617 struct nic *nic; 2620 struct nic *nic;
2618 int err; 2621 int err;
2619 DECLARE_MAC_BUF(mac);
2620 2622
2621 if(!(netdev = alloc_etherdev(sizeof(struct nic)))) { 2623 if(!(netdev = alloc_etherdev(sizeof(struct nic)))) {
2622 if(((1 << debug) - 1) & NETIF_MSG_PROBE) 2624 if(((1 << debug) - 1) & NETIF_MSG_PROBE)
@@ -2734,8 +2736,10 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2734 2736
2735 /* Wol magic packet can be enabled from eeprom */ 2737 /* Wol magic packet can be enabled from eeprom */
2736 if((nic->mac >= mac_82558_D101_A4) && 2738 if((nic->mac >= mac_82558_D101_A4) &&
2737 (nic->eeprom[eeprom_id] & eeprom_id_wol)) 2739 (nic->eeprom[eeprom_id] & eeprom_id_wol)) {
2738 nic->flags |= wol_magic; 2740 nic->flags |= wol_magic;
2741 device_set_wakeup_enable(&pdev->dev, true);
2742 }
2739 2743
2740 /* ack any pending wake events, disable PME */ 2744 /* ack any pending wake events, disable PME */
2741 pci_pme_active(pdev, false); 2745 pci_pme_active(pdev, false);
@@ -2746,9 +2750,9 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2746 goto err_out_free; 2750 goto err_out_free;
2747 } 2751 }
2748 2752
2749 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %s\n", 2753 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, MAC addr %pM\n",
2750 (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0), 2754 (unsigned long long)pci_resource_start(pdev, use_io ? 1 : 0),
2751 pdev->irq, print_mac(mac, netdev->dev_addr)); 2755 pdev->irq, netdev->dev_addr);
2752 2756
2753 return 0; 2757 return 0;
2754 2758
@@ -2794,11 +2798,10 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2794 pci_save_state(pdev); 2798 pci_save_state(pdev);
2795 2799
2796 if ((nic->flags & wol_magic) | e100_asf(nic)) { 2800 if ((nic->flags & wol_magic) | e100_asf(nic)) {
2797 pci_enable_wake(pdev, PCI_D3hot, 1); 2801 if (pci_enable_wake(pdev, PCI_D3cold, true))
2798 pci_enable_wake(pdev, PCI_D3cold, 1); 2802 pci_enable_wake(pdev, PCI_D3hot, true);
2799 } else { 2803 } else {
2800 pci_enable_wake(pdev, PCI_D3hot, 0); 2804 pci_enable_wake(pdev, PCI_D3hot, false);
2801 pci_enable_wake(pdev, PCI_D3cold, 0);
2802 } 2805 }
2803 2806
2804 pci_disable_device(pdev); 2807 pci_disable_device(pdev);
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index fac82152e4c8..07b38fbe4e03 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -912,7 +912,6 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
912 u16 eeprom_data = 0; 912 u16 eeprom_data = 0;
913 u16 eeprom_apme_mask = E1000_EEPROM_APME; 913 u16 eeprom_apme_mask = E1000_EEPROM_APME;
914 int bars, need_ioport; 914 int bars, need_ioport;
915 DECLARE_MAC_BUF(mac);
916 915
917 /* do not allocate ioport bars when not needed */ 916 /* do not allocate ioport bars when not needed */
918 need_ioport = e1000_is_need_ioport(pdev); 917 need_ioport = e1000_is_need_ioport(pdev);
@@ -967,8 +966,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
967 hw->back = adapter; 966 hw->back = adapter;
968 967
969 err = -EIO; 968 err = -EIO;
970 hw->hw_addr = ioremap(pci_resource_start(pdev, BAR_0), 969 hw->hw_addr = pci_ioremap_bar(pdev, BAR_0);
971 pci_resource_len(pdev, BAR_0));
972 if (!hw->hw_addr) 970 if (!hw->hw_addr)
973 goto err_ioremap; 971 goto err_ioremap;
974 972
@@ -1016,9 +1014,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
1016 * because it depends on mac_type */ 1014 * because it depends on mac_type */
1017 if ((hw->mac_type == e1000_ich8lan) && 1015 if ((hw->mac_type == e1000_ich8lan) &&
1018 (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) { 1016 (pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
1019 hw->flash_address = 1017 hw->flash_address = pci_ioremap_bar(pdev, 1);
1020 ioremap(pci_resource_start(pdev, 1),
1021 pci_resource_len(pdev, 1));
1022 if (!hw->flash_address) 1018 if (!hw->flash_address)
1023 goto err_flashmap; 1019 goto err_flashmap;
1024 } 1020 }
@@ -1194,7 +1190,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
1194 (hw->bus_width == e1000_bus_width_pciex_1) ? "Width x1" : 1190 (hw->bus_width == e1000_bus_width_pciex_1) ? "Width x1" :
1195 "32-bit")); 1191 "32-bit"));
1196 1192
1197 printk("%s\n", print_mac(mac, netdev->dev_addr)); 1193 printk("%pM\n", netdev->dev_addr);
1198 1194
1199 if (hw->bus_type == e1000_bus_type_pci_express) { 1195 if (hw->bus_type == e1000_bus_type_pci_express) {
1200 DPRINTK(PROBE, WARNING, "This device (id %04x:%04x) will no " 1196 DPRINTK(PROBE, WARNING, "This device (id %04x:%04x) will no "
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index abd492b7336d..a5c9266cd7ce 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -4652,14 +4652,12 @@ static void e1000_print_device_info(struct e1000_adapter *adapter)
4652 u32 pba_num; 4652 u32 pba_num;
4653 4653
4654 /* print bus type/speed/width info */ 4654 /* print bus type/speed/width info */
4655 e_info("(PCI Express:2.5GB/s:%s) %02x:%02x:%02x:%02x:%02x:%02x\n", 4655 e_info("(PCI Express:2.5GB/s:%s) %pM\n",
4656 /* bus width */ 4656 /* bus width */
4657 ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" : 4657 ((hw->bus.width == e1000_bus_width_pcie_x4) ? "Width x4" :
4658 "Width x1"), 4658 "Width x1"),
4659 /* MAC address */ 4659 /* MAC address */
4660 netdev->dev_addr[0], netdev->dev_addr[1], 4660 netdev->dev_addr);
4661 netdev->dev_addr[2], netdev->dev_addr[3],
4662 netdev->dev_addr[4], netdev->dev_addr[5]);
4663 e_info("Intel(R) PRO/%s Network Connection\n", 4661 e_info("Intel(R) PRO/%s Network Connection\n",
4664 (hw->phy.type == e1000_phy_ife) ? "10/100" : "1000"); 4662 (hw->phy.type == e1000_phy_ife) ? "10/100" : "1000");
4665 e1000e_read_pba_num(hw, &pba_num); 4663 e1000e_read_pba_num(hw, &pba_num);
@@ -4906,10 +4904,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
4906 memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); 4904 memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
4907 4905
4908 if (!is_valid_ether_addr(netdev->perm_addr)) { 4906 if (!is_valid_ether_addr(netdev->perm_addr)) {
4909 e_err("Invalid MAC Address: %02x:%02x:%02x:%02x:%02x:%02x\n", 4907 e_err("Invalid MAC Address: %pM\n", netdev->perm_addr);
4910 netdev->perm_addr[0], netdev->perm_addr[1],
4911 netdev->perm_addr[2], netdev->perm_addr[3],
4912 netdev->perm_addr[4], netdev->perm_addr[5]);
4913 err = -EIO; 4908 err = -EIO;
4914 goto err_eeprom; 4909 goto err_eeprom;
4915 } 4910 }
diff --git a/drivers/net/eepro.c b/drivers/net/eepro.c
index 1f11350e16cf..5f72362b782d 100644
--- a/drivers/net/eepro.c
+++ b/drivers/net/eepro.c
@@ -690,7 +690,6 @@ static void __init eepro_print_info (struct net_device *dev)
690 struct eepro_local * lp = netdev_priv(dev); 690 struct eepro_local * lp = netdev_priv(dev);
691 int i; 691 int i;
692 const char * ifmap[] = {"AUI", "10Base2", "10BaseT"}; 692 const char * ifmap[] = {"AUI", "10Base2", "10BaseT"};
693 DECLARE_MAC_BUF(mac);
694 693
695 i = inb(dev->base_addr + ID_REG); 694 i = inb(dev->base_addr + ID_REG);
696 printk(KERN_DEBUG " id: %#x ",i); 695 printk(KERN_DEBUG " id: %#x ",i);
@@ -715,7 +714,7 @@ static void __init eepro_print_info (struct net_device *dev)
715 break; 714 break;
716 } 715 }
717 716
718 printk(" %s", print_mac(mac, dev->dev_addr)); 717 printk(" %pM", dev->dev_addr);
719 718
720 if (net_debug > 3) 719 if (net_debug > 3)
721 printk(KERN_DEBUG ", %dK RCV buffer", 720 printk(KERN_DEBUG ", %dK RCV buffer",
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
deleted file mode 100644
index e3e26c595fa3..000000000000
--- a/drivers/net/eepro100.c
+++ /dev/null
@@ -1,2401 +0,0 @@
1/* drivers/net/eepro100.c: An Intel i82557-559 Ethernet driver for Linux. */
2/*
3 Written 1996-1999 by Donald Becker.
4
5 The driver also contains updates by different kernel developers
6 (see incomplete list below).
7 Current maintainer is Andrey V. Savochkin <saw@saw.sw.com.sg>.
8 Please use this email address and linux-kernel mailing list for bug reports.
9
10 This software may be used and distributed according to the terms
11 of the GNU General Public License, incorporated herein by reference.
12
13 This driver is for the Intel EtherExpress Pro100 (Speedo3) design.
14 It should work with all i82557/558/559 boards.
15
16 Version history:
17 1998 Apr - 2000 Feb Andrey V. Savochkin <saw@saw.sw.com.sg>
18 Serious fixes for multicast filter list setting, TX timeout routine;
19 RX ring refilling logic; other stuff
20 2000 Feb Jeff Garzik <jgarzik@pobox.com>
21 Convert to new PCI driver interface
22 2000 Mar 24 Dragan Stancevic <visitor@valinux.com>
23 Disabled FC and ER, to avoid lockups when when we get FCP interrupts.
24 2000 Jul 17 Goutham Rao <goutham.rao@intel.com>
25 PCI DMA API fixes, adding pci_dma_sync_single calls where neccesary
26 2000 Aug 31 David Mosberger <davidm@hpl.hp.com>
27 rx_align support: enables rx DMA without causing unaligned accesses.
28*/
29
30static const char * const version =
31"eepro100.c:v1.09j-t 9/29/99 Donald Becker\n"
32"eepro100.c: $Revision: 1.36 $ 2000/11/17 Modified by Andrey V. Savochkin <saw@saw.sw.com.sg> and others\n";
33
34/* A few user-configurable values that apply to all boards.
35 First set is undocumented and spelled per Intel recommendations. */
36
37static int congenb /* = 0 */; /* Enable congestion control in the DP83840. */
38static int txfifo = 8; /* Tx FIFO threshold in 4 byte units, 0-15 */
39static int rxfifo = 8; /* Rx FIFO threshold, default 32 bytes. */
40/* Tx/Rx DMA burst length, 0-127, 0 == no preemption, tx==128 -> disabled. */
41static int txdmacount = 128;
42static int rxdmacount /* = 0 */;
43
44#if defined(__ia64__) || defined(__alpha__) || defined(__sparc__) || defined(__mips__) || \
45 defined(__arm__)
46 /* align rx buffers to 2 bytes so that IP header is aligned */
47# define rx_align(skb) skb_reserve((skb), 2)
48# define RxFD_ALIGNMENT __attribute__ ((aligned (2), packed))
49#else
50# define rx_align(skb)
51# define RxFD_ALIGNMENT
52#endif
53
54/* Set the copy breakpoint for the copy-only-tiny-buffer Rx method.
55 Lower values use more memory, but are faster. */
56static int rx_copybreak = 200;
57
58/* Maximum events (Rx packets, etc.) to handle at each interrupt. */
59static int max_interrupt_work = 20;
60
61/* Maximum number of multicast addresses to filter (vs. rx-all-multicast) */
62static int multicast_filter_limit = 64;
63
64/* 'options' is used to pass a transceiver override or full-duplex flag
65 e.g. "options=16" for FD, "options=32" for 100mbps-only. */
66static int full_duplex[] = {-1, -1, -1, -1, -1, -1, -1, -1};
67static int options[] = {-1, -1, -1, -1, -1, -1, -1, -1};
68
69/* A few values that may be tweaked. */
70/* The ring sizes should be a power of two for efficiency. */
71#define TX_RING_SIZE 64
72#define RX_RING_SIZE 64
73/* How much slots multicast filter setup may take.
74 Do not descrease without changing set_rx_mode() implementaion. */
75#define TX_MULTICAST_SIZE 2
76#define TX_MULTICAST_RESERV (TX_MULTICAST_SIZE*2)
77/* Actual number of TX packets queued, must be
78 <= TX_RING_SIZE-TX_MULTICAST_RESERV. */
79#define TX_QUEUE_LIMIT (TX_RING_SIZE-TX_MULTICAST_RESERV)
80/* Hysteresis marking queue as no longer full. */
81#define TX_QUEUE_UNFULL (TX_QUEUE_LIMIT-4)
82
83/* Operational parameters that usually are not changed. */
84
85/* Time in jiffies before concluding the transmitter is hung. */
86#define TX_TIMEOUT (2*HZ)
87/* Size of an pre-allocated Rx buffer: <Ethernet MTU> + slack.*/
88#define PKT_BUF_SZ 1536
89
90#include <linux/module.h>
91
92#include <linux/kernel.h>
93#include <linux/string.h>
94#include <linux/errno.h>
95#include <linux/ioport.h>
96#include <linux/slab.h>
97#include <linux/interrupt.h>
98#include <linux/timer.h>
99#include <linux/pci.h>
100#include <linux/spinlock.h>
101#include <linux/init.h>
102#include <linux/mii.h>
103#include <linux/delay.h>
104#include <linux/bitops.h>
105
106#include <asm/io.h>
107#include <asm/uaccess.h>
108#include <asm/irq.h>
109
110#include <linux/netdevice.h>
111#include <linux/etherdevice.h>
112#include <linux/rtnetlink.h>
113#include <linux/skbuff.h>
114#include <linux/ethtool.h>
115
116static int use_io;
117static int debug = -1;
118#define DEBUG_DEFAULT (NETIF_MSG_DRV | \
119 NETIF_MSG_HW | \
120 NETIF_MSG_RX_ERR | \
121 NETIF_MSG_TX_ERR)
122#define DEBUG ((debug >= 0) ? (1<<debug)-1 : DEBUG_DEFAULT)
123
124
125MODULE_AUTHOR("Maintainer: Andrey V. Savochkin <saw@saw.sw.com.sg>");
126MODULE_DESCRIPTION("Intel i82557/i82558/i82559 PCI EtherExpressPro driver");
127MODULE_LICENSE("GPL");
128module_param(use_io, int, 0);
129module_param(debug, int, 0);
130module_param_array(options, int, NULL, 0);
131module_param_array(full_duplex, int, NULL, 0);
132module_param(congenb, int, 0);
133module_param(txfifo, int, 0);
134module_param(rxfifo, int, 0);
135module_param(txdmacount, int, 0);
136module_param(rxdmacount, int, 0);
137module_param(rx_copybreak, int, 0);
138module_param(max_interrupt_work, int, 0);
139module_param(multicast_filter_limit, int, 0);
140MODULE_PARM_DESC(debug, "debug level (0-6)");
141MODULE_PARM_DESC(options, "Bits 0-3: transceiver type, bit 4: full duplex, bit 5: 100Mbps");
142MODULE_PARM_DESC(full_duplex, "full duplex setting(s) (1)");
143MODULE_PARM_DESC(congenb, "Enable congestion control (1)");
144MODULE_PARM_DESC(txfifo, "Tx FIFO threshold in 4 byte units, (0-15)");
145MODULE_PARM_DESC(rxfifo, "Rx FIFO threshold in 4 byte units, (0-15)");
146MODULE_PARM_DESC(txdmacount, "Tx DMA burst length; 128 - disable (0-128)");
147MODULE_PARM_DESC(rxdmacount, "Rx DMA burst length; 128 - disable (0-128)");
148MODULE_PARM_DESC(rx_copybreak, "copy breakpoint for copy-only-tiny-frames");
149MODULE_PARM_DESC(max_interrupt_work, "maximum events handled per interrupt");
150MODULE_PARM_DESC(multicast_filter_limit, "maximum number of filtered multicast addresses");
151
152#define RUN_AT(x) (jiffies + (x))
153
154#define netdevice_start(dev)
155#define netdevice_stop(dev)
156#define netif_set_tx_timeout(dev, tf, tm) \
157 do { \
158 (dev)->tx_timeout = (tf); \
159 (dev)->watchdog_timeo = (tm); \
160 } while(0)
161
162
163
164/*
165 Theory of Operation
166
167I. Board Compatibility
168
169This device driver is designed for the Intel i82557 "Speedo3" chip, Intel's
170single-chip fast Ethernet controller for PCI, as used on the Intel
171EtherExpress Pro 100 adapter.
172
173II. Board-specific settings
174
175PCI bus devices are configured by the system at boot time, so no jumpers
176need to be set on the board. The system BIOS should be set to assign the
177PCI INTA signal to an otherwise unused system IRQ line. While it's
178possible to share PCI interrupt lines, it negatively impacts performance and
179only recent kernels support it.
180
181III. Driver operation
182
183IIIA. General
184The Speedo3 is very similar to other Intel network chips, that is to say
185"apparently designed on a different planet". This chips retains the complex
186Rx and Tx descriptors and multiple buffers pointers as previous chips, but
187also has simplified Tx and Rx buffer modes. This driver uses the "flexible"
188Tx mode, but in a simplified lower-overhead manner: it associates only a
189single buffer descriptor with each frame descriptor.
190
191Despite the extra space overhead in each receive skbuff, the driver must use
192the simplified Rx buffer mode to assure that only a single data buffer is
193associated with each RxFD. The driver implements this by reserving space
194for the Rx descriptor at the head of each Rx skbuff.
195
196The Speedo-3 has receive and command unit base addresses that are added to
197almost all descriptor pointers. The driver sets these to zero, so that all
198pointer fields are absolute addresses.
199
200The System Control Block (SCB) of some previous Intel chips exists on the
201chip in both PCI I/O and memory space. This driver uses the I/O space
202registers, but might switch to memory mapped mode to better support non-x86
203processors.
204
205IIIB. Transmit structure
206
207The driver must use the complex Tx command+descriptor mode in order to
208have a indirect pointer to the skbuff data section. Each Tx command block
209(TxCB) is associated with two immediately appended Tx Buffer Descriptor
210(TxBD). A fixed ring of these TxCB+TxBD pairs are kept as part of the
211speedo_private data structure for each adapter instance.
212
213The newer i82558 explicitly supports this structure, and can read the two
214TxBDs in the same PCI burst as the TxCB.
215
216This ring structure is used for all normal transmit packets, but the
217transmit packet descriptors aren't long enough for most non-Tx commands such
218as CmdConfigure. This is complicated by the possibility that the chip has
219already loaded the link address in the previous descriptor. So for these
220commands we convert the next free descriptor on the ring to a NoOp, and point
221that descriptor's link to the complex command.
222
223An additional complexity of these non-transmit commands are that they may be
224added asynchronous to the normal transmit queue, so we disable interrupts
225whenever the Tx descriptor ring is manipulated.
226
227A notable aspect of these special configure commands is that they do
228work with the normal Tx ring entry scavenge method. The Tx ring scavenge
229is done at interrupt time using the 'dirty_tx' index, and checking for the
230command-complete bit. While the setup frames may have the NoOp command on the
231Tx ring marked as complete, but not have completed the setup command, this
232is not a problem. The tx_ring entry can be still safely reused, as the
233tx_skbuff[] entry is always empty for config_cmd and mc_setup frames.
234
235Commands may have bits set e.g. CmdSuspend in the command word to either
236suspend or stop the transmit/command unit. This driver always flags the last
237command with CmdSuspend, erases the CmdSuspend in the previous command, and
238then issues a CU_RESUME.
239Note: Watch out for the potential race condition here: imagine
240 erasing the previous suspend
241 the chip processes the previous command
242 the chip processes the final command, and suspends
243 doing the CU_RESUME
244 the chip processes the next-yet-valid post-final-command.
245So blindly sending a CU_RESUME is only safe if we do it immediately after
246after erasing the previous CmdSuspend, without the possibility of an
247intervening delay. Thus the resume command is always within the
248interrupts-disabled region. This is a timing dependence, but handling this
249condition in a timing-independent way would considerably complicate the code.
250
251Note: In previous generation Intel chips, restarting the command unit was a
252notoriously slow process. This is presumably no longer true.
253
254IIIC. Receive structure
255
256Because of the bus-master support on the Speedo3 this driver uses the new
257SKBUFF_RX_COPYBREAK scheme, rather than a fixed intermediate receive buffer.
258This scheme allocates full-sized skbuffs as receive buffers. The value
259SKBUFF_RX_COPYBREAK is used as the copying breakpoint: it is chosen to
260trade-off the memory wasted by passing the full-sized skbuff to the queue
261layer for all frames vs. the copying cost of copying a frame to a
262correctly-sized skbuff.
263
264For small frames the copying cost is negligible (esp. considering that we
265are pre-loading the cache with immediately useful header information), so we
266allocate a new, minimally-sized skbuff. For large frames the copying cost
267is non-trivial, and the larger copy might flush the cache of useful data, so
268we pass up the skbuff the packet was received into.
269
270IV. Notes
271
272Thanks to Steve Williams of Intel for arranging the non-disclosure agreement
273that stated that I could disclose the information. But I still resent
274having to sign an Intel NDA when I'm helping Intel sell their own product!
275
276*/
277
278static int speedo_found1(struct pci_dev *pdev, void __iomem *ioaddr, int fnd_cnt, int acpi_idle_state);
279
280/* Offsets to the various registers.
281 All accesses need not be longword aligned. */
282enum speedo_offsets {
283 SCBStatus = 0, SCBCmd = 2, /* Rx/Command Unit command and status. */
284 SCBIntmask = 3,
285 SCBPointer = 4, /* General purpose pointer. */
286 SCBPort = 8, /* Misc. commands and operands. */
287 SCBflash = 12, SCBeeprom = 14, /* EEPROM and flash memory control. */
288 SCBCtrlMDI = 16, /* MDI interface control. */
289 SCBEarlyRx = 20, /* Early receive byte count. */
290};
291/* Commands that can be put in a command list entry. */
292enum commands {
293 CmdNOp = 0, CmdIASetup = 0x10000, CmdConfigure = 0x20000,
294 CmdMulticastList = 0x30000, CmdTx = 0x40000, CmdTDR = 0x50000,
295 CmdDump = 0x60000, CmdDiagnose = 0x70000,
296 CmdSuspend = 0x40000000, /* Suspend after completion. */
297 CmdIntr = 0x20000000, /* Interrupt after completion. */
298 CmdTxFlex = 0x00080000, /* Use "Flexible mode" for CmdTx command. */
299};
300/* Clear CmdSuspend (1<<30) avoiding interference with the card access to the
301 status bits. Previous driver versions used separate 16 bit fields for
302 commands and statuses. --SAW
303 */
304#if defined(__alpha__)
305# define clear_suspend(cmd) clear_bit(30, &(cmd)->cmd_status);
306#else
307# define clear_suspend(cmd) ((__le16 *)&(cmd)->cmd_status)[1] &= ~cpu_to_le16(1<<14)
308#endif
309
310enum SCBCmdBits {
311 SCBMaskCmdDone=0x8000, SCBMaskRxDone=0x4000, SCBMaskCmdIdle=0x2000,
312 SCBMaskRxSuspend=0x1000, SCBMaskEarlyRx=0x0800, SCBMaskFlowCtl=0x0400,
313 SCBTriggerIntr=0x0200, SCBMaskAll=0x0100,
314 /* The rest are Rx and Tx commands. */
315 CUStart=0x0010, CUResume=0x0020, CUStatsAddr=0x0040, CUShowStats=0x0050,
316 CUCmdBase=0x0060, /* CU Base address (set to zero) . */
317 CUDumpStats=0x0070, /* Dump then reset stats counters. */
318 RxStart=0x0001, RxResume=0x0002, RxAbort=0x0004, RxAddrLoad=0x0006,
319 RxResumeNoResources=0x0007,
320};
321
322enum SCBPort_cmds {
323 PortReset=0, PortSelfTest=1, PortPartialReset=2, PortDump=3,
324};
325
326/* The Speedo3 Rx and Tx frame/buffer descriptors. */
327struct descriptor { /* A generic descriptor. */
328 volatile __le32 cmd_status; /* All command and status fields. */
329 __le32 link; /* struct descriptor * */
330 unsigned char params[0];
331};
332
333/* The Speedo3 Rx and Tx buffer descriptors. */
334struct RxFD { /* Receive frame descriptor. */
335 volatile __le32 status;
336 __le32 link; /* struct RxFD * */
337 __le32 rx_buf_addr; /* void * */
338 __le32 count;
339} RxFD_ALIGNMENT;
340
341/* Selected elements of the Tx/RxFD.status word. */
342enum RxFD_bits {
343 RxComplete=0x8000, RxOK=0x2000,
344 RxErrCRC=0x0800, RxErrAlign=0x0400, RxErrTooBig=0x0200, RxErrSymbol=0x0010,
345 RxEth2Type=0x0020, RxNoMatch=0x0004, RxNoIAMatch=0x0002,
346 TxUnderrun=0x1000, StatusComplete=0x8000,
347};
348
349#define CONFIG_DATA_SIZE 22
350struct TxFD { /* Transmit frame descriptor set. */
351 __le32 status;
352 __le32 link; /* void * */
353 __le32 tx_desc_addr; /* Always points to the tx_buf_addr element. */
354 __le32 count; /* # of TBD (=1), Tx start thresh., etc. */
355 /* This constitutes two "TBD" entries -- we only use one. */
356#define TX_DESCR_BUF_OFFSET 16
357 __le32 tx_buf_addr0; /* void *, frame to be transmitted. */
358 __le32 tx_buf_size0; /* Length of Tx frame. */
359 __le32 tx_buf_addr1; /* void *, frame to be transmitted. */
360 __le32 tx_buf_size1; /* Length of Tx frame. */
361 /* the structure must have space for at least CONFIG_DATA_SIZE starting
362 * from tx_desc_addr field */
363};
364
365/* Multicast filter setting block. --SAW */
366struct speedo_mc_block {
367 struct speedo_mc_block *next;
368 unsigned int tx;
369 dma_addr_t frame_dma;
370 unsigned int len;
371 struct descriptor frame __attribute__ ((__aligned__(16)));
372};
373
374/* Elements of the dump_statistics block. This block must be lword aligned. */
375struct speedo_stats {
376 __le32 tx_good_frames;
377 __le32 tx_coll16_errs;
378 __le32 tx_late_colls;
379 __le32 tx_underruns;
380 __le32 tx_lost_carrier;
381 __le32 tx_deferred;
382 __le32 tx_one_colls;
383 __le32 tx_multi_colls;
384 __le32 tx_total_colls;
385 __le32 rx_good_frames;
386 __le32 rx_crc_errs;
387 __le32 rx_align_errs;
388 __le32 rx_resource_errs;
389 __le32 rx_overrun_errs;
390 __le32 rx_colls_errs;
391 __le32 rx_runt_errs;
392 __le32 done_marker;
393};
394
395enum Rx_ring_state_bits {
396 RrNoMem=1, RrPostponed=2, RrNoResources=4, RrOOMReported=8,
397};
398
399/* Do not change the position (alignment) of the first few elements!
400 The later elements are grouped for cache locality.
401
402 Unfortunately, all the positions have been shifted since there.
403 A new re-alignment is required. 2000/03/06 SAW */
404struct speedo_private {
405 void __iomem *regs;
406 struct TxFD *tx_ring; /* Commands (usually CmdTxPacket). */
407 struct RxFD *rx_ringp[RX_RING_SIZE]; /* Rx descriptor, used as ring. */
408 /* The addresses of a Tx/Rx-in-place packets/buffers. */
409 struct sk_buff *tx_skbuff[TX_RING_SIZE];
410 struct sk_buff *rx_skbuff[RX_RING_SIZE];
411 /* Mapped addresses of the rings. */
412 dma_addr_t tx_ring_dma;
413#define TX_RING_ELEM_DMA(sp, n) ((sp)->tx_ring_dma + (n)*sizeof(struct TxFD))
414 dma_addr_t rx_ring_dma[RX_RING_SIZE];
415 struct descriptor *last_cmd; /* Last command sent. */
416 unsigned int cur_tx, dirty_tx; /* The ring entries to be free()ed. */
417 spinlock_t lock; /* Group with Tx control cache line. */
418 u32 tx_threshold; /* The value for txdesc.count. */
419 struct RxFD *last_rxf; /* Last filled RX buffer. */
420 dma_addr_t last_rxf_dma;
421 unsigned int cur_rx, dirty_rx; /* The next free ring entry */
422 long last_rx_time; /* Last Rx, in jiffies, to handle Rx hang. */
423 struct net_device_stats stats;
424 struct speedo_stats *lstats;
425 dma_addr_t lstats_dma;
426 int chip_id;
427 struct pci_dev *pdev;
428 struct timer_list timer; /* Media selection timer. */
429 struct speedo_mc_block *mc_setup_head; /* Multicast setup frame list head. */
430 struct speedo_mc_block *mc_setup_tail; /* Multicast setup frame list tail. */
431 long in_interrupt; /* Word-aligned dev->interrupt */
432 unsigned char acpi_pwr;
433 signed char rx_mode; /* Current PROMISC/ALLMULTI setting. */
434 unsigned int tx_full:1; /* The Tx queue is full. */
435 unsigned int flow_ctrl:1; /* Use 802.3x flow control. */
436 unsigned int rx_bug:1; /* Work around receiver hang errata. */
437 unsigned char default_port:8; /* Last dev->if_port value. */
438 unsigned char rx_ring_state; /* RX ring status flags. */
439 unsigned short phy[2]; /* PHY media interfaces available. */
440 unsigned short partner; /* Link partner caps. */
441 struct mii_if_info mii_if; /* MII API hooks, info */
442 u32 msg_enable; /* debug message level */
443};
444
445/* The parameters for a CmdConfigure operation.
446 There are so many options that it would be difficult to document each bit.
447 We mostly use the default or recommended settings. */
448static const char i82557_config_cmd[CONFIG_DATA_SIZE] = {
449 22, 0x08, 0, 0, 0, 0, 0x32, 0x03, 1, /* 1=Use MII 0=Use AUI */
450 0, 0x2E, 0, 0x60, 0,
451 0xf2, 0x48, 0, 0x40, 0xf2, 0x80, /* 0x40=Force full-duplex */
452 0x3f, 0x05, };
453static const char i82558_config_cmd[CONFIG_DATA_SIZE] = {
454 22, 0x08, 0, 1, 0, 0, 0x22, 0x03, 1, /* 1=Use MII 0=Use AUI */
455 0, 0x2E, 0, 0x60, 0x08, 0x88,
456 0x68, 0, 0x40, 0xf2, 0x84, /* Disable FC */
457 0x31, 0x05, };
458
459/* PHY media interface chips. */
460static const char * const phys[] = {
461 "None", "i82553-A/B", "i82553-C", "i82503",
462 "DP83840", "80c240", "80c24", "i82555",
463 "unknown-8", "unknown-9", "DP83840A", "unknown-11",
464 "unknown-12", "unknown-13", "unknown-14", "unknown-15", };
465enum phy_chips { NonSuchPhy=0, I82553AB, I82553C, I82503, DP83840, S80C240,
466 S80C24, I82555, DP83840A=10, };
467static const char is_mii[] = { 0, 1, 1, 0, 1, 1, 0, 1 };
468#define EE_READ_CMD (6)
469
470static int eepro100_init_one(struct pci_dev *pdev,
471 const struct pci_device_id *ent);
472
473static int do_eeprom_cmd(void __iomem *ioaddr, int cmd, int cmd_len);
474static int mdio_read(struct net_device *dev, int phy_id, int location);
475static void mdio_write(struct net_device *dev, int phy_id, int location, int value);
476static int speedo_open(struct net_device *dev);
477static void speedo_resume(struct net_device *dev);
478static void speedo_timer(unsigned long data);
479static void speedo_init_rx_ring(struct net_device *dev);
480static void speedo_tx_timeout(struct net_device *dev);
481static int speedo_start_xmit(struct sk_buff *skb, struct net_device *dev);
482static void speedo_refill_rx_buffers(struct net_device *dev, int force);
483static int speedo_rx(struct net_device *dev);
484static void speedo_tx_buffer_gc(struct net_device *dev);
485static irqreturn_t speedo_interrupt(int irq, void *dev_instance);
486static int speedo_close(struct net_device *dev);
487static struct net_device_stats *speedo_get_stats(struct net_device *dev);
488static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
489static void set_rx_mode(struct net_device *dev);
490static void speedo_show_state(struct net_device *dev);
491static const struct ethtool_ops ethtool_ops;
492
493
494
495#ifdef honor_default_port
496/* Optional driver feature to allow forcing the transceiver setting.
497 Not recommended. */
498static int mii_ctrl[8] = { 0x3300, 0x3100, 0x0000, 0x0100,
499 0x2000, 0x2100, 0x0400, 0x3100};
500#endif
501
502/* How to wait for the command unit to accept a command.
503 Typically this takes 0 ticks. */
504static inline unsigned char wait_for_cmd_done(struct net_device *dev,
505 struct speedo_private *sp)
506{
507 int wait = 1000;
508 void __iomem *cmd_ioaddr = sp->regs + SCBCmd;
509 unsigned char r;
510
511 do {
512 udelay(1);
513 r = ioread8(cmd_ioaddr);
514 } while(r && --wait >= 0);
515
516 if (wait < 0)
517 printk(KERN_ALERT "%s: wait_for_cmd_done timeout!\n", dev->name);
518 return r;
519}
520
521static int __devinit eepro100_init_one (struct pci_dev *pdev,
522 const struct pci_device_id *ent)
523{
524 void __iomem *ioaddr;
525 int irq, pci_bar;
526 int acpi_idle_state = 0, pm;
527 static int cards_found /* = 0 */;
528 unsigned long pci_base;
529
530#ifndef MODULE
531 /* when built-in, we only print version if device is found */
532 static int did_version;
533 if (did_version++ == 0)
534 printk(version);
535#endif
536
537 /* save power state before pci_enable_device overwrites it */
538 pm = pci_find_capability(pdev, PCI_CAP_ID_PM);
539 if (pm) {
540 u16 pwr_command;
541 pci_read_config_word(pdev, pm + PCI_PM_CTRL, &pwr_command);
542 acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
543 }
544
545 if (pci_enable_device(pdev))
546 goto err_out_free_mmio_region;
547
548 pci_set_master(pdev);
549
550 if (!request_region(pci_resource_start(pdev, 1),
551 pci_resource_len(pdev, 1), "eepro100")) {
552 dev_err(&pdev->dev, "eepro100: cannot reserve I/O ports\n");
553 goto err_out_none;
554 }
555 if (!request_mem_region(pci_resource_start(pdev, 0),
556 pci_resource_len(pdev, 0), "eepro100")) {
557 dev_err(&pdev->dev, "eepro100: cannot reserve MMIO region\n");
558 goto err_out_free_pio_region;
559 }
560
561 irq = pdev->irq;
562 pci_bar = use_io ? 1 : 0;
563 pci_base = pci_resource_start(pdev, pci_bar);
564 if (DEBUG & NETIF_MSG_PROBE)
565 printk("Found Intel i82557 PCI Speedo at %#lx, IRQ %d.\n",
566 pci_base, irq);
567
568 ioaddr = pci_iomap(pdev, pci_bar, 0);
569 if (!ioaddr) {
570 dev_err(&pdev->dev, "eepro100: cannot remap IO\n");
571 goto err_out_free_mmio_region;
572 }
573
574 if (speedo_found1(pdev, ioaddr, cards_found, acpi_idle_state) == 0)
575 cards_found++;
576 else
577 goto err_out_iounmap;
578
579 return 0;
580
581err_out_iounmap: ;
582 pci_iounmap(pdev, ioaddr);
583err_out_free_mmio_region:
584 release_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
585err_out_free_pio_region:
586 release_region(pci_resource_start(pdev, 1), pci_resource_len(pdev, 1));
587err_out_none:
588 return -ENODEV;
589}
590
591#ifdef CONFIG_NET_POLL_CONTROLLER
592/*
593 * Polling 'interrupt' - used by things like netconsole to send skbs
594 * without having to re-enable interrupts. It's not called while
595 * the interrupt routine is executing.
596 */
597
598static void poll_speedo (struct net_device *dev)
599{
600 /* disable_irq is not very nice, but with the funny lockless design
601 we have no other choice. */
602 disable_irq(dev->irq);
603 speedo_interrupt (dev->irq, dev);
604 enable_irq(dev->irq);
605}
606#endif
607
608static int __devinit speedo_found1(struct pci_dev *pdev,
609 void __iomem *ioaddr, int card_idx, int acpi_idle_state)
610{
611 struct net_device *dev;
612 struct speedo_private *sp;
613 const char *product;
614 int i, option;
615 u16 eeprom[0x100];
616 int size;
617 void *tx_ring_space;
618 dma_addr_t tx_ring_dma;
619 DECLARE_MAC_BUF(mac);
620
621 size = TX_RING_SIZE * sizeof(struct TxFD) + sizeof(struct speedo_stats);
622 tx_ring_space = pci_alloc_consistent(pdev, size, &tx_ring_dma);
623 if (tx_ring_space == NULL)
624 return -1;
625
626 dev = alloc_etherdev(sizeof(struct speedo_private));
627 if (dev == NULL) {
628 printk(KERN_ERR "eepro100: Could not allocate ethernet device.\n");
629 pci_free_consistent(pdev, size, tx_ring_space, tx_ring_dma);
630 return -1;
631 }
632
633 SET_NETDEV_DEV(dev, &pdev->dev);
634
635 if (dev->mem_start > 0)
636 option = dev->mem_start;
637 else if (card_idx >= 0 && options[card_idx] >= 0)
638 option = options[card_idx];
639 else
640 option = 0;
641
642 rtnl_lock();
643 if (dev_alloc_name(dev, dev->name) < 0)
644 goto err_free_unlock;
645
646 /* Read the station address EEPROM before doing the reset.
647 Nominally his should even be done before accepting the device, but
648 then we wouldn't have a device name with which to report the error.
649 The size test is for 6 bit vs. 8 bit address serial EEPROMs.
650 */
651 {
652 void __iomem *iobase;
653 int read_cmd, ee_size;
654 u16 sum;
655 int j;
656
657 /* Use IO only to avoid postponed writes and satisfy EEPROM timing
658 requirements. */
659 iobase = pci_iomap(pdev, 1, pci_resource_len(pdev, 1));
660 if (!iobase)
661 goto err_free_unlock;
662 if ((do_eeprom_cmd(iobase, EE_READ_CMD << 24, 27) & 0xffe0000)
663 == 0xffe0000) {
664 ee_size = 0x100;
665 read_cmd = EE_READ_CMD << 24;
666 } else {
667 ee_size = 0x40;
668 read_cmd = EE_READ_CMD << 22;
669 }
670
671 for (j = 0, i = 0, sum = 0; i < ee_size; i++) {
672 u16 value = do_eeprom_cmd(iobase, read_cmd | (i << 16), 27);
673 eeprom[i] = value;
674 sum += value;
675 if (i < 3) {
676 dev->dev_addr[j++] = value;
677 dev->dev_addr[j++] = value >> 8;
678 }
679 }
680 if (sum != 0xBABA)
681 printk(KERN_WARNING "%s: Invalid EEPROM checksum %#4.4x, "
682 "check settings before activating this device!\n",
683 dev->name, sum);
684 /* Don't unregister_netdev(dev); as the EEPro may actually be
685 usable, especially if the MAC address is set later.
686 On the other hand, it may be unusable if MDI data is corrupted. */
687
688 pci_iounmap(pdev, iobase);
689 }
690
691 /* Reset the chip: stop Tx and Rx processes and clear counters.
692 This takes less than 10usec and will easily finish before the next
693 action. */
694 iowrite32(PortReset, ioaddr + SCBPort);
695 ioread32(ioaddr + SCBPort);
696 udelay(10);
697
698 if (eeprom[3] & 0x0100)
699 product = "OEM i82557/i82558 10/100 Ethernet";
700 else
701 product = pci_name(pdev);
702
703 printk(KERN_INFO "%s: %s, %s, IRQ %d.\n", dev->name, product,
704 print_mac(mac, dev->dev_addr), pdev->irq);
705
706 sp = netdev_priv(dev);
707
708 /* we must initialize this early, for mdio_{read,write} */
709 sp->regs = ioaddr;
710
711#if 1 || defined(kernel_bloat)
712 /* OK, this is pure kernel bloat. I don't like it when other drivers
713 waste non-pageable kernel space to emit similar messages, but I need
714 them for bug reports. */
715 {
716 const char *connectors[] = {" RJ45", " BNC", " AUI", " MII"};
717 /* The self-test results must be paragraph aligned. */
718 volatile s32 *self_test_results;
719 int boguscnt = 16000; /* Timeout for set-test. */
720 if ((eeprom[3] & 0x03) != 0x03)
721 printk(KERN_INFO " Receiver lock-up bug exists -- enabling"
722 " work-around.\n");
723 printk(KERN_INFO " Board assembly %4.4x%2.2x-%3.3d, Physical"
724 " connectors present:",
725 eeprom[8], eeprom[9]>>8, eeprom[9] & 0xff);
726 for (i = 0; i < 4; i++)
727 if (eeprom[5] & (1<<i))
728 printk(connectors[i]);
729 printk("\n"KERN_INFO" Primary interface chip %s PHY #%d.\n",
730 phys[(eeprom[6]>>8)&15], eeprom[6] & 0x1f);
731 if (eeprom[7] & 0x0700)
732 printk(KERN_INFO " Secondary interface chip %s.\n",
733 phys[(eeprom[7]>>8)&7]);
734 if (((eeprom[6]>>8) & 0x3f) == DP83840
735 || ((eeprom[6]>>8) & 0x3f) == DP83840A) {
736 int mdi_reg23 = mdio_read(dev, eeprom[6] & 0x1f, 23) | 0x0422;
737 if (congenb)
738 mdi_reg23 |= 0x0100;
739 printk(KERN_INFO" DP83840 specific setup, setting register 23 to %4.4x.\n",
740 mdi_reg23);
741 mdio_write(dev, eeprom[6] & 0x1f, 23, mdi_reg23);
742 }
743 if ((option >= 0) && (option & 0x70)) {
744 printk(KERN_INFO " Forcing %dMbs %s-duplex operation.\n",
745 (option & 0x20 ? 100 : 10),
746 (option & 0x10 ? "full" : "half"));
747 mdio_write(dev, eeprom[6] & 0x1f, MII_BMCR,
748 ((option & 0x20) ? 0x2000 : 0) | /* 100mbps? */
749 ((option & 0x10) ? 0x0100 : 0)); /* Full duplex? */
750 }
751
752 /* Perform a system self-test. */
753 self_test_results = (s32*) ((((long) tx_ring_space) + 15) & ~0xf);
754 self_test_results[0] = 0;
755 self_test_results[1] = -1;
756 iowrite32(tx_ring_dma | PortSelfTest, ioaddr + SCBPort);
757 do {
758 udelay(10);
759 } while (self_test_results[1] == -1 && --boguscnt >= 0);
760
761 if (boguscnt < 0) { /* Test optimized out. */
762 printk(KERN_ERR "Self test failed, status %8.8x:\n"
763 KERN_ERR " Failure to initialize the i82557.\n"
764 KERN_ERR " Verify that the card is a bus-master"
765 " capable slot.\n",
766 self_test_results[1]);
767 } else
768 printk(KERN_INFO " General self-test: %s.\n"
769 KERN_INFO " Serial sub-system self-test: %s.\n"
770 KERN_INFO " Internal registers self-test: %s.\n"
771 KERN_INFO " ROM checksum self-test: %s (%#8.8x).\n",
772 self_test_results[1] & 0x1000 ? "failed" : "passed",
773 self_test_results[1] & 0x0020 ? "failed" : "passed",
774 self_test_results[1] & 0x0008 ? "failed" : "passed",
775 self_test_results[1] & 0x0004 ? "failed" : "passed",
776 self_test_results[0]);
777 }
778#endif /* kernel_bloat */
779
780 iowrite32(PortReset, ioaddr + SCBPort);
781 ioread32(ioaddr + SCBPort);
782 udelay(10);
783
784 /* Return the chip to its original power state. */
785 pci_set_power_state(pdev, acpi_idle_state);
786
787 pci_set_drvdata (pdev, dev);
788 SET_NETDEV_DEV(dev, &pdev->dev);
789
790 dev->irq = pdev->irq;
791
792 sp->pdev = pdev;
793 sp->msg_enable = DEBUG;
794 sp->acpi_pwr = acpi_idle_state;
795 sp->tx_ring = tx_ring_space;
796 sp->tx_ring_dma = tx_ring_dma;
797 sp->lstats = (struct speedo_stats *)(sp->tx_ring + TX_RING_SIZE);
798 sp->lstats_dma = TX_RING_ELEM_DMA(sp, TX_RING_SIZE);
799 init_timer(&sp->timer); /* used in ioctl() */
800 spin_lock_init(&sp->lock);
801
802 sp->mii_if.full_duplex = option >= 0 && (option & 0x10) ? 1 : 0;
803 if (card_idx >= 0) {
804 if (full_duplex[card_idx] >= 0)
805 sp->mii_if.full_duplex = full_duplex[card_idx];
806 }
807 sp->default_port = option >= 0 ? (option & 0x0f) : 0;
808
809 sp->phy[0] = eeprom[6];
810 sp->phy[1] = eeprom[7];
811
812 sp->mii_if.phy_id = eeprom[6] & 0x1f;
813 sp->mii_if.phy_id_mask = 0x1f;
814 sp->mii_if.reg_num_mask = 0x1f;
815 sp->mii_if.dev = dev;
816 sp->mii_if.mdio_read = mdio_read;
817 sp->mii_if.mdio_write = mdio_write;
818
819 sp->rx_bug = (eeprom[3] & 0x03) == 3 ? 0 : 1;
820 if (((pdev->device > 0x1030 && (pdev->device < 0x103F)))
821 || (pdev->device == 0x2449) || (pdev->device == 0x2459)
822 || (pdev->device == 0x245D)) {
823 sp->chip_id = 1;
824 }
825
826 if (sp->rx_bug)
827 printk(KERN_INFO " Receiver lock-up workaround activated.\n");
828
829 /* The Speedo-specific entries in the device structure. */
830 dev->open = &speedo_open;
831 dev->hard_start_xmit = &speedo_start_xmit;
832 netif_set_tx_timeout(dev, &speedo_tx_timeout, TX_TIMEOUT);
833 dev->stop = &speedo_close;
834 dev->get_stats = &speedo_get_stats;
835 dev->set_multicast_list = &set_rx_mode;
836 dev->do_ioctl = &speedo_ioctl;
837 SET_ETHTOOL_OPS(dev, &ethtool_ops);
838#ifdef CONFIG_NET_POLL_CONTROLLER
839 dev->poll_controller = &poll_speedo;
840#endif
841
842 if (register_netdevice(dev))
843 goto err_free_unlock;
844 rtnl_unlock();
845
846 return 0;
847
848 err_free_unlock:
849 rtnl_unlock();
850 free_netdev(dev);
851 return -1;
852}
853
854static void do_slow_command(struct net_device *dev, struct speedo_private *sp, int cmd)
855{
856 void __iomem *cmd_ioaddr = sp->regs + SCBCmd;
857 int wait = 0;
858 do
859 if (ioread8(cmd_ioaddr) == 0) break;
860 while(++wait <= 200);
861 if (wait > 100)
862 printk(KERN_ERR "Command %4.4x never accepted (%d polls)!\n",
863 ioread8(cmd_ioaddr), wait);
864
865 iowrite8(cmd, cmd_ioaddr);
866
867 for (wait = 0; wait <= 100; wait++)
868 if (ioread8(cmd_ioaddr) == 0) return;
869 for (; wait <= 20000; wait++)
870 if (ioread8(cmd_ioaddr) == 0) return;
871 else udelay(1);
872 printk(KERN_ERR "Command %4.4x was not accepted after %d polls!"
873 " Current status %8.8x.\n",
874 cmd, wait, ioread32(sp->regs + SCBStatus));
875}
876
877/* Serial EEPROM section.
878 A "bit" grungy, but we work our way through bit-by-bit :->. */
879/* EEPROM_Ctrl bits. */
880#define EE_SHIFT_CLK 0x01 /* EEPROM shift clock. */
881#define EE_CS 0x02 /* EEPROM chip select. */
882#define EE_DATA_WRITE 0x04 /* EEPROM chip data in. */
883#define EE_DATA_READ 0x08 /* EEPROM chip data out. */
884#define EE_ENB (0x4800 | EE_CS)
885#define EE_WRITE_0 0x4802
886#define EE_WRITE_1 0x4806
887#define EE_OFFSET SCBeeprom
888
889/* The fixes for the code were kindly provided by Dragan Stancevic
890 <visitor@valinux.com> to strictly follow Intel specifications of EEPROM
891 access timing.
892 The publicly available sheet 64486302 (sec. 3.1) specifies 1us access
893 interval for serial EEPROM. However, it looks like that there is an
894 additional requirement dictating larger udelay's in the code below.
895 2000/05/24 SAW */
896static int __devinit do_eeprom_cmd(void __iomem *ioaddr, int cmd, int cmd_len)
897{
898 unsigned retval = 0;
899 void __iomem *ee_addr = ioaddr + SCBeeprom;
900
901 iowrite16(EE_ENB, ee_addr); udelay(2);
902 iowrite16(EE_ENB | EE_SHIFT_CLK, ee_addr); udelay(2);
903
904 /* Shift the command bits out. */
905 do {
906 short dataval = (cmd & (1 << cmd_len)) ? EE_WRITE_1 : EE_WRITE_0;
907 iowrite16(dataval, ee_addr); udelay(2);
908 iowrite16(dataval | EE_SHIFT_CLK, ee_addr); udelay(2);
909 retval = (retval << 1) | ((ioread16(ee_addr) & EE_DATA_READ) ? 1 : 0);
910 } while (--cmd_len >= 0);
911 iowrite16(EE_ENB, ee_addr); udelay(2);
912
913 /* Terminate the EEPROM access. */
914 iowrite16(EE_ENB & ~EE_CS, ee_addr);
915 return retval;
916}
917
918static int mdio_read(struct net_device *dev, int phy_id, int location)
919{
920 struct speedo_private *sp = netdev_priv(dev);
921 void __iomem *ioaddr = sp->regs;
922 int val, boguscnt = 64*10; /* <64 usec. to complete, typ 27 ticks */
923 iowrite32(0x08000000 | (location<<16) | (phy_id<<21), ioaddr + SCBCtrlMDI);
924 do {
925 val = ioread32(ioaddr + SCBCtrlMDI);
926 if (--boguscnt < 0) {
927 printk(KERN_ERR " mdio_read() timed out with val = %8.8x.\n", val);
928 break;
929 }
930 } while (! (val & 0x10000000));
931 return val & 0xffff;
932}
933
934static void mdio_write(struct net_device *dev, int phy_id, int location, int value)
935{
936 struct speedo_private *sp = netdev_priv(dev);
937 void __iomem *ioaddr = sp->regs;
938 int val, boguscnt = 64*10; /* <64 usec. to complete, typ 27 ticks */
939 iowrite32(0x04000000 | (location<<16) | (phy_id<<21) | value,
940 ioaddr + SCBCtrlMDI);
941 do {
942 val = ioread32(ioaddr + SCBCtrlMDI);
943 if (--boguscnt < 0) {
944 printk(KERN_ERR" mdio_write() timed out with val = %8.8x.\n", val);
945 break;
946 }
947 } while (! (val & 0x10000000));
948}
949
950static int
951speedo_open(struct net_device *dev)
952{
953 struct speedo_private *sp = netdev_priv(dev);
954 void __iomem *ioaddr = sp->regs;
955 int retval;
956
957 if (netif_msg_ifup(sp))
958 printk(KERN_DEBUG "%s: speedo_open() irq %d.\n", dev->name, dev->irq);
959
960 pci_set_power_state(sp->pdev, PCI_D0);
961
962 /* Set up the Tx queue early.. */
963 sp->cur_tx = 0;
964 sp->dirty_tx = 0;
965 sp->last_cmd = NULL;
966 sp->tx_full = 0;
967 sp->in_interrupt = 0;
968
969 /* .. we can safely take handler calls during init. */
970 retval = request_irq(dev->irq, &speedo_interrupt, IRQF_SHARED, dev->name, dev);
971 if (retval) {
972 return retval;
973 }
974
975 dev->if_port = sp->default_port;
976
977#ifdef oh_no_you_dont_unless_you_honour_the_options_passed_in_to_us
978 /* Retrigger negotiation to reset previous errors. */
979 if ((sp->phy[0] & 0x8000) == 0) {
980 int phy_addr = sp->phy[0] & 0x1f ;
981 /* Use 0x3300 for restarting NWay, other values to force xcvr:
982 0x0000 10-HD
983 0x0100 10-FD
984 0x2000 100-HD
985 0x2100 100-FD
986 */
987#ifdef honor_default_port
988 mdio_write(dev, phy_addr, MII_BMCR, mii_ctrl[dev->default_port & 7]);
989#else
990 mdio_write(dev, phy_addr, MII_BMCR, 0x3300);
991#endif
992 }
993#endif
994
995 speedo_init_rx_ring(dev);
996
997 /* Fire up the hardware. */
998 iowrite16(SCBMaskAll, ioaddr + SCBCmd);
999 speedo_resume(dev);
1000
1001 netdevice_start(dev);
1002 netif_start_queue(dev);
1003
1004 /* Setup the chip and configure the multicast list. */
1005 sp->mc_setup_head = NULL;
1006 sp->mc_setup_tail = NULL;
1007 sp->flow_ctrl = sp->partner = 0;
1008 sp->rx_mode = -1; /* Invalid -> always reset the mode. */
1009 set_rx_mode(dev);
1010 if ((sp->phy[0] & 0x8000) == 0)
1011 sp->mii_if.advertising = mdio_read(dev, sp->phy[0] & 0x1f, MII_ADVERTISE);
1012
1013 mii_check_link(&sp->mii_if);
1014
1015 if (netif_msg_ifup(sp)) {
1016 printk(KERN_DEBUG "%s: Done speedo_open(), status %8.8x.\n",
1017 dev->name, ioread16(ioaddr + SCBStatus));
1018 }
1019
1020 /* Set the timer. The timer serves a dual purpose:
1021 1) to monitor the media interface (e.g. link beat) and perhaps switch
1022 to an alternate media type
1023 2) to monitor Rx activity, and restart the Rx process if the receiver
1024 hangs. */
1025 sp->timer.expires = RUN_AT((24*HZ)/10); /* 2.4 sec. */
1026 sp->timer.data = (unsigned long)dev;
1027 sp->timer.function = &speedo_timer; /* timer handler */
1028 add_timer(&sp->timer);
1029
1030 /* No need to wait for the command unit to accept here. */
1031 if ((sp->phy[0] & 0x8000) == 0)
1032 mdio_read(dev, sp->phy[0] & 0x1f, MII_BMCR);
1033
1034 return 0;
1035}
1036
1037/* Start the chip hardware after a full reset. */
1038static void speedo_resume(struct net_device *dev)
1039{
1040 struct speedo_private *sp = netdev_priv(dev);
1041 void __iomem *ioaddr = sp->regs;
1042
1043 /* Start with a Tx threshold of 256 (0x..20.... 8 byte units). */
1044 sp->tx_threshold = 0x01208000;
1045
1046 /* Set the segment registers to '0'. */
1047 if (wait_for_cmd_done(dev, sp) != 0) {
1048 iowrite32(PortPartialReset, ioaddr + SCBPort);
1049 udelay(10);
1050 }
1051
1052 iowrite32(0, ioaddr + SCBPointer);
1053 ioread32(ioaddr + SCBPointer); /* Flush to PCI. */
1054 udelay(10); /* Bogus, but it avoids the bug. */
1055
1056 /* Note: these next two operations can take a while. */
1057 do_slow_command(dev, sp, RxAddrLoad);
1058 do_slow_command(dev, sp, CUCmdBase);
1059
1060 /* Load the statistics block and rx ring addresses. */
1061 iowrite32(sp->lstats_dma, ioaddr + SCBPointer);
1062 ioread32(ioaddr + SCBPointer); /* Flush to PCI */
1063
1064 iowrite8(CUStatsAddr, ioaddr + SCBCmd);
1065 sp->lstats->done_marker = 0;
1066 wait_for_cmd_done(dev, sp);
1067
1068 if (sp->rx_ringp[sp->cur_rx % RX_RING_SIZE] == NULL) {
1069 if (netif_msg_rx_err(sp))
1070 printk(KERN_DEBUG "%s: NULL cur_rx in speedo_resume().\n",
1071 dev->name);
1072 } else {
1073 iowrite32(sp->rx_ring_dma[sp->cur_rx % RX_RING_SIZE],
1074 ioaddr + SCBPointer);
1075 ioread32(ioaddr + SCBPointer); /* Flush to PCI */
1076 }
1077
1078 /* Note: RxStart should complete instantly. */
1079 do_slow_command(dev, sp, RxStart);
1080 do_slow_command(dev, sp, CUDumpStats);
1081
1082 /* Fill the first command with our physical address. */
1083 {
1084 struct descriptor *ias_cmd;
1085
1086 ias_cmd =
1087 (struct descriptor *)&sp->tx_ring[sp->cur_tx++ % TX_RING_SIZE];
1088 /* Avoid a bug(?!) here by marking the command already completed. */
1089 ias_cmd->cmd_status = cpu_to_le32((CmdSuspend | CmdIASetup) | 0xa000);
1090 ias_cmd->link =
1091 cpu_to_le32(TX_RING_ELEM_DMA(sp, sp->cur_tx % TX_RING_SIZE));
1092 memcpy(ias_cmd->params, dev->dev_addr, 6);
1093 if (sp->last_cmd)
1094 clear_suspend(sp->last_cmd);
1095 sp->last_cmd = ias_cmd;
1096 }
1097
1098 /* Start the chip's Tx process and unmask interrupts. */
1099 iowrite32(TX_RING_ELEM_DMA(sp, sp->dirty_tx % TX_RING_SIZE),
1100 ioaddr + SCBPointer);
1101 /* We are not ACK-ing FCP and ER in the interrupt handler yet so they should
1102 remain masked --Dragan */
1103 iowrite16(CUStart | SCBMaskEarlyRx | SCBMaskFlowCtl, ioaddr + SCBCmd);
1104}
1105
1106/*
1107 * Sometimes the receiver stops making progress. This routine knows how to
1108 * get it going again, without losing packets or being otherwise nasty like
1109 * a chip reset would be. Previously the driver had a whole sequence
1110 * of if RxSuspended, if it's no buffers do one thing, if it's no resources,
1111 * do another, etc. But those things don't really matter. Separate logic
1112 * in the ISR provides for allocating buffers--the other half of operation
1113 * is just making sure the receiver is active. speedo_rx_soft_reset does that.
1114 * This problem with the old, more involved algorithm is shown up under
1115 * ping floods on the order of 60K packets/second on a 100Mbps fdx network.
1116 */
1117static void
1118speedo_rx_soft_reset(struct net_device *dev)
1119{
1120 struct speedo_private *sp = netdev_priv(dev);
1121 struct RxFD *rfd;
1122 void __iomem *ioaddr;
1123
1124 ioaddr = sp->regs;
1125 if (wait_for_cmd_done(dev, sp) != 0) {
1126 printk("%s: previous command stalled\n", dev->name);
1127 return;
1128 }
1129 /*
1130 * Put the hardware into a known state.
1131 */
1132 iowrite8(RxAbort, ioaddr + SCBCmd);
1133
1134 rfd = sp->rx_ringp[sp->cur_rx % RX_RING_SIZE];
1135
1136 rfd->rx_buf_addr = cpu_to_le32(0xffffffff);
1137
1138 if (wait_for_cmd_done(dev, sp) != 0) {
1139 printk("%s: RxAbort command stalled\n", dev->name);
1140 return;
1141 }
1142 iowrite32(sp->rx_ring_dma[sp->cur_rx % RX_RING_SIZE],
1143 ioaddr + SCBPointer);
1144 iowrite8(RxStart, ioaddr + SCBCmd);
1145}
1146
1147
1148/* Media monitoring and control. */
1149static void speedo_timer(unsigned long data)
1150{
1151 struct net_device *dev = (struct net_device *)data;
1152 struct speedo_private *sp = netdev_priv(dev);
1153 void __iomem *ioaddr = sp->regs;
1154 int phy_num = sp->phy[0] & 0x1f;
1155
1156 /* We have MII and lost link beat. */
1157 if ((sp->phy[0] & 0x8000) == 0) {
1158 int partner = mdio_read(dev, phy_num, MII_LPA);
1159 if (partner != sp->partner) {
1160 int flow_ctrl = sp->mii_if.advertising & partner & 0x0400 ? 1 : 0;
1161 if (netif_msg_link(sp)) {
1162 printk(KERN_DEBUG "%s: Link status change.\n", dev->name);
1163 printk(KERN_DEBUG "%s: Old partner %x, new %x, adv %x.\n",
1164 dev->name, sp->partner, partner, sp->mii_if.advertising);
1165 }
1166 sp->partner = partner;
1167 if (flow_ctrl != sp->flow_ctrl) {
1168 sp->flow_ctrl = flow_ctrl;
1169 sp->rx_mode = -1; /* Trigger a reload. */
1170 }
1171 }
1172 }
1173 mii_check_link(&sp->mii_if);
1174 if (netif_msg_timer(sp)) {
1175 printk(KERN_DEBUG "%s: Media control tick, status %4.4x.\n",
1176 dev->name, ioread16(ioaddr + SCBStatus));
1177 }
1178 if (sp->rx_mode < 0 ||
1179 (sp->rx_bug && jiffies - sp->last_rx_time > 2*HZ)) {
1180 /* We haven't received a packet in a Long Time. We might have been
1181 bitten by the receiver hang bug. This can be cleared by sending
1182 a set multicast list command. */
1183 if (netif_msg_timer(sp))
1184 printk(KERN_DEBUG "%s: Sending a multicast list set command"
1185 " from a timer routine,"
1186 " m=%d, j=%ld, l=%ld.\n",
1187 dev->name, sp->rx_mode, jiffies, sp->last_rx_time);
1188 set_rx_mode(dev);
1189 }
1190 /* We must continue to monitor the media. */
1191 sp->timer.expires = RUN_AT(2*HZ); /* 2.0 sec. */
1192 add_timer(&sp->timer);
1193}
1194
1195static void speedo_show_state(struct net_device *dev)
1196{
1197 struct speedo_private *sp = netdev_priv(dev);
1198 int i;
1199
1200 if (netif_msg_pktdata(sp)) {
1201 printk(KERN_DEBUG "%s: Tx ring dump, Tx queue %u / %u:\n",
1202 dev->name, sp->cur_tx, sp->dirty_tx);
1203 for (i = 0; i < TX_RING_SIZE; i++)
1204 printk(KERN_DEBUG "%s: %c%c%2d %8.8x.\n", dev->name,
1205 i == sp->dirty_tx % TX_RING_SIZE ? '*' : ' ',
1206 i == sp->cur_tx % TX_RING_SIZE ? '=' : ' ',
1207 i, sp->tx_ring[i].status);
1208
1209 printk(KERN_DEBUG "%s: Printing Rx ring"
1210 " (next to receive into %u, dirty index %u).\n",
1211 dev->name, sp->cur_rx, sp->dirty_rx);
1212 for (i = 0; i < RX_RING_SIZE; i++)
1213 printk(KERN_DEBUG "%s: %c%c%c%2d %8.8x.\n", dev->name,
1214 sp->rx_ringp[i] == sp->last_rxf ? 'l' : ' ',
1215 i == sp->dirty_rx % RX_RING_SIZE ? '*' : ' ',
1216 i == sp->cur_rx % RX_RING_SIZE ? '=' : ' ',
1217 i, (sp->rx_ringp[i] != NULL) ?
1218 (unsigned)sp->rx_ringp[i]->status : 0);
1219 }
1220
1221#if 0
1222 {
1223 void __iomem *ioaddr = sp->regs;
1224 int phy_num = sp->phy[0] & 0x1f;
1225 for (i = 0; i < 16; i++) {
1226 /* FIXME: what does it mean? --SAW */
1227 if (i == 6) i = 21;
1228 printk(KERN_DEBUG "%s: PHY index %d register %d is %4.4x.\n",
1229 dev->name, phy_num, i, mdio_read(dev, phy_num, i));
1230 }
1231 }
1232#endif
1233
1234}
1235
1236/* Initialize the Rx and Tx rings, along with various 'dev' bits. */
1237static void
1238speedo_init_rx_ring(struct net_device *dev)
1239{
1240 struct speedo_private *sp = netdev_priv(dev);
1241 struct RxFD *rxf, *last_rxf = NULL;
1242 dma_addr_t last_rxf_dma = 0 /* to shut up the compiler */;
1243 int i;
1244
1245 sp->cur_rx = 0;
1246
1247 for (i = 0; i < RX_RING_SIZE; i++) {
1248 struct sk_buff *skb;
1249 skb = dev_alloc_skb(PKT_BUF_SZ + sizeof(struct RxFD));
1250 if (skb)
1251 rx_align(skb); /* Align IP on 16 byte boundary */
1252 sp->rx_skbuff[i] = skb;
1253 if (skb == NULL)
1254 break; /* OK. Just initially short of Rx bufs. */
1255 skb->dev = dev; /* Mark as being used by this device. */
1256 rxf = (struct RxFD *)skb->data;
1257 sp->rx_ringp[i] = rxf;
1258 sp->rx_ring_dma[i] =
1259 pci_map_single(sp->pdev, rxf,
1260 PKT_BUF_SZ + sizeof(struct RxFD), PCI_DMA_BIDIRECTIONAL);
1261 skb_reserve(skb, sizeof(struct RxFD));
1262 if (last_rxf) {
1263 last_rxf->link = cpu_to_le32(sp->rx_ring_dma[i]);
1264 pci_dma_sync_single_for_device(sp->pdev, last_rxf_dma,
1265 sizeof(struct RxFD), PCI_DMA_TODEVICE);
1266 }
1267 last_rxf = rxf;
1268 last_rxf_dma = sp->rx_ring_dma[i];
1269 rxf->status = cpu_to_le32(0x00000001); /* '1' is flag value only. */
1270 rxf->link = 0; /* None yet. */
1271 /* This field unused by i82557. */
1272 rxf->rx_buf_addr = cpu_to_le32(0xffffffff);
1273 rxf->count = cpu_to_le32(PKT_BUF_SZ << 16);
1274 pci_dma_sync_single_for_device(sp->pdev, sp->rx_ring_dma[i],
1275 sizeof(struct RxFD), PCI_DMA_TODEVICE);
1276 }
1277 sp->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
1278 /* Mark the last entry as end-of-list. */
1279 last_rxf->status = cpu_to_le32(0xC0000002); /* '2' is flag value only. */
1280 pci_dma_sync_single_for_device(sp->pdev, sp->rx_ring_dma[RX_RING_SIZE-1],
1281 sizeof(struct RxFD), PCI_DMA_TODEVICE);
1282 sp->last_rxf = last_rxf;
1283 sp->last_rxf_dma = last_rxf_dma;
1284}
1285
1286static void speedo_purge_tx(struct net_device *dev)
1287{
1288 struct speedo_private *sp = netdev_priv(dev);
1289 int entry;
1290
1291 while ((int)(sp->cur_tx - sp->dirty_tx) > 0) {
1292 entry = sp->dirty_tx % TX_RING_SIZE;
1293 if (sp->tx_skbuff[entry]) {
1294 sp->stats.tx_errors++;
1295 pci_unmap_single(sp->pdev,
1296 le32_to_cpu(sp->tx_ring[entry].tx_buf_addr0),
1297 sp->tx_skbuff[entry]->len, PCI_DMA_TODEVICE);
1298 dev_kfree_skb_irq(sp->tx_skbuff[entry]);
1299 sp->tx_skbuff[entry] = NULL;
1300 }
1301 sp->dirty_tx++;
1302 }
1303 while (sp->mc_setup_head != NULL) {
1304 struct speedo_mc_block *t;
1305 if (netif_msg_tx_err(sp))
1306 printk(KERN_DEBUG "%s: freeing mc frame.\n", dev->name);
1307 pci_unmap_single(sp->pdev, sp->mc_setup_head->frame_dma,
1308 sp->mc_setup_head->len, PCI_DMA_TODEVICE);
1309 t = sp->mc_setup_head->next;
1310 kfree(sp->mc_setup_head);
1311 sp->mc_setup_head = t;
1312 }
1313 sp->mc_setup_tail = NULL;
1314 sp->tx_full = 0;
1315 netif_wake_queue(dev);
1316}
1317
1318static void reset_mii(struct net_device *dev)
1319{
1320 struct speedo_private *sp = netdev_priv(dev);
1321
1322 /* Reset the MII transceiver, suggested by Fred Young @ scalable.com. */
1323 if ((sp->phy[0] & 0x8000) == 0) {
1324 int phy_addr = sp->phy[0] & 0x1f;
1325 int advertising = mdio_read(dev, phy_addr, MII_ADVERTISE);
1326 int mii_bmcr = mdio_read(dev, phy_addr, MII_BMCR);
1327 mdio_write(dev, phy_addr, MII_BMCR, 0x0400);
1328 mdio_write(dev, phy_addr, MII_BMSR, 0x0000);
1329 mdio_write(dev, phy_addr, MII_ADVERTISE, 0x0000);
1330 mdio_write(dev, phy_addr, MII_BMCR, 0x8000);
1331#ifdef honor_default_port
1332 mdio_write(dev, phy_addr, MII_BMCR, mii_ctrl[dev->default_port & 7]);
1333#else
1334 mdio_read(dev, phy_addr, MII_BMCR);
1335 mdio_write(dev, phy_addr, MII_BMCR, mii_bmcr);
1336 mdio_write(dev, phy_addr, MII_ADVERTISE, advertising);
1337#endif
1338 }
1339}
1340
1341static void speedo_tx_timeout(struct net_device *dev)
1342{
1343 struct speedo_private *sp = netdev_priv(dev);
1344 void __iomem *ioaddr = sp->regs;
1345 int status = ioread16(ioaddr + SCBStatus);
1346 unsigned long flags;
1347
1348 if (netif_msg_tx_err(sp)) {
1349 printk(KERN_WARNING "%s: Transmit timed out: status %4.4x "
1350 " %4.4x at %d/%d command %8.8x.\n",
1351 dev->name, status, ioread16(ioaddr + SCBCmd),
1352 sp->dirty_tx, sp->cur_tx,
1353 sp->tx_ring[sp->dirty_tx % TX_RING_SIZE].status);
1354
1355 }
1356 speedo_show_state(dev);
1357#if 0
1358 if ((status & 0x00C0) != 0x0080
1359 && (status & 0x003C) == 0x0010) {
1360 /* Only the command unit has stopped. */
1361 printk(KERN_WARNING "%s: Trying to restart the transmitter...\n",
1362 dev->name);
1363 iowrite32(TX_RING_ELEM_DMA(sp, dirty_tx % TX_RING_SIZE]),
1364 ioaddr + SCBPointer);
1365 iowrite16(CUStart, ioaddr + SCBCmd);
1366 reset_mii(dev);
1367 } else {
1368#else
1369 {
1370#endif
1371 del_timer_sync(&sp->timer);
1372 /* Reset the Tx and Rx units. */
1373 iowrite32(PortReset, ioaddr + SCBPort);
1374 /* We may get spurious interrupts here. But I don't think that they
1375 may do much harm. 1999/12/09 SAW */
1376 udelay(10);
1377 /* Disable interrupts. */
1378 iowrite16(SCBMaskAll, ioaddr + SCBCmd);
1379 synchronize_irq(dev->irq);
1380 speedo_tx_buffer_gc(dev);
1381 /* Free as much as possible.
1382 It helps to recover from a hang because of out-of-memory.
1383 It also simplifies speedo_resume() in case TX ring is full or
1384 close-to-be full. */
1385 speedo_purge_tx(dev);
1386 speedo_refill_rx_buffers(dev, 1);
1387 spin_lock_irqsave(&sp->lock, flags);
1388 speedo_resume(dev);
1389 sp->rx_mode = -1;
1390 dev->trans_start = jiffies;
1391 spin_unlock_irqrestore(&sp->lock, flags);
1392 set_rx_mode(dev); /* it takes the spinlock itself --SAW */
1393 /* Reset MII transceiver. Do it before starting the timer to serialize
1394 mdio_xxx operations. Yes, it's a paranoya :-) 2000/05/09 SAW */
1395 reset_mii(dev);
1396 sp->timer.expires = RUN_AT(2*HZ);
1397 add_timer(&sp->timer);
1398 }
1399 return;
1400}
1401
1402static int
1403speedo_start_xmit(struct sk_buff *skb, struct net_device *dev)
1404{
1405 struct speedo_private *sp = netdev_priv(dev);
1406 void __iomem *ioaddr = sp->regs;
1407 int entry;
1408
1409 /* Prevent interrupts from changing the Tx ring from underneath us. */
1410 unsigned long flags;
1411
1412 spin_lock_irqsave(&sp->lock, flags);
1413
1414 /* Check if there are enough space. */
1415 if ((int)(sp->cur_tx - sp->dirty_tx) >= TX_QUEUE_LIMIT) {
1416 printk(KERN_ERR "%s: incorrect tbusy state, fixed.\n", dev->name);
1417 netif_stop_queue(dev);
1418 sp->tx_full = 1;
1419 spin_unlock_irqrestore(&sp->lock, flags);
1420 return 1;
1421 }
1422
1423 /* Calculate the Tx descriptor entry. */
1424 entry = sp->cur_tx++ % TX_RING_SIZE;
1425
1426 sp->tx_skbuff[entry] = skb;
1427 sp->tx_ring[entry].status =
1428 cpu_to_le32(CmdSuspend | CmdTx | CmdTxFlex);
1429 if (!(entry & ((TX_RING_SIZE>>2)-1)))
1430 sp->tx_ring[entry].status |= cpu_to_le32(CmdIntr);
1431 sp->tx_ring[entry].link =
1432 cpu_to_le32(TX_RING_ELEM_DMA(sp, sp->cur_tx % TX_RING_SIZE));
1433 sp->tx_ring[entry].tx_desc_addr =
1434 cpu_to_le32(TX_RING_ELEM_DMA(sp, entry) + TX_DESCR_BUF_OFFSET);
1435 /* The data region is always in one buffer descriptor. */
1436 sp->tx_ring[entry].count = cpu_to_le32(sp->tx_threshold);
1437 sp->tx_ring[entry].tx_buf_addr0 =
1438 cpu_to_le32(pci_map_single(sp->pdev, skb->data,
1439 skb->len, PCI_DMA_TODEVICE));
1440 sp->tx_ring[entry].tx_buf_size0 = cpu_to_le32(skb->len);
1441
1442 /* workaround for hardware bug on 10 mbit half duplex */
1443
1444 if ((sp->partner == 0) && (sp->chip_id == 1)) {
1445 wait_for_cmd_done(dev, sp);
1446 iowrite8(0 , ioaddr + SCBCmd);
1447 udelay(1);
1448 }
1449
1450 /* Trigger the command unit resume. */
1451 wait_for_cmd_done(dev, sp);
1452 clear_suspend(sp->last_cmd);
1453 /* We want the time window between clearing suspend flag on the previous
1454 command and resuming CU to be as small as possible.
1455 Interrupts in between are very undesired. --SAW */
1456 iowrite8(CUResume, ioaddr + SCBCmd);
1457 sp->last_cmd = (struct descriptor *)&sp->tx_ring[entry];
1458
1459 /* Leave room for set_rx_mode(). If there is no more space than reserved
1460 for multicast filter mark the ring as full. */
1461 if ((int)(sp->cur_tx - sp->dirty_tx) >= TX_QUEUE_LIMIT) {
1462 netif_stop_queue(dev);
1463 sp->tx_full = 1;
1464 }
1465
1466 spin_unlock_irqrestore(&sp->lock, flags);
1467
1468 dev->trans_start = jiffies;
1469
1470 return 0;
1471}
1472
1473static void speedo_tx_buffer_gc(struct net_device *dev)
1474{
1475 unsigned int dirty_tx;
1476 struct speedo_private *sp = netdev_priv(dev);
1477
1478 dirty_tx = sp->dirty_tx;
1479 while ((int)(sp->cur_tx - dirty_tx) > 0) {
1480 int entry = dirty_tx % TX_RING_SIZE;
1481 int status = le32_to_cpu(sp->tx_ring[entry].status);
1482
1483 if (netif_msg_tx_done(sp))
1484 printk(KERN_DEBUG " scavenge candidate %d status %4.4x.\n",
1485 entry, status);
1486 if ((status & StatusComplete) == 0)
1487 break; /* It still hasn't been processed. */
1488 if (status & TxUnderrun)
1489 if (sp->tx_threshold < 0x01e08000) {
1490 if (netif_msg_tx_err(sp))
1491 printk(KERN_DEBUG "%s: TX underrun, threshold adjusted.\n",
1492 dev->name);
1493 sp->tx_threshold += 0x00040000;
1494 }
1495 /* Free the original skb. */
1496 if (sp->tx_skbuff[entry]) {
1497 sp->stats.tx_packets++; /* Count only user packets. */
1498 sp->stats.tx_bytes += sp->tx_skbuff[entry]->len;
1499 pci_unmap_single(sp->pdev,
1500 le32_to_cpu(sp->tx_ring[entry].tx_buf_addr0),
1501 sp->tx_skbuff[entry]->len, PCI_DMA_TODEVICE);
1502 dev_kfree_skb_irq(sp->tx_skbuff[entry]);
1503 sp->tx_skbuff[entry] = NULL;
1504 }
1505 dirty_tx++;
1506 }
1507
1508 if (netif_msg_tx_err(sp) && (int)(sp->cur_tx - dirty_tx) > TX_RING_SIZE) {
1509 printk(KERN_ERR "out-of-sync dirty pointer, %d vs. %d,"
1510 " full=%d.\n",
1511 dirty_tx, sp->cur_tx, sp->tx_full);
1512 dirty_tx += TX_RING_SIZE;
1513 }
1514
1515 while (sp->mc_setup_head != NULL
1516 && (int)(dirty_tx - sp->mc_setup_head->tx - 1) > 0) {
1517 struct speedo_mc_block *t;
1518 if (netif_msg_tx_err(sp))
1519 printk(KERN_DEBUG "%s: freeing mc frame.\n", dev->name);
1520 pci_unmap_single(sp->pdev, sp->mc_setup_head->frame_dma,
1521 sp->mc_setup_head->len, PCI_DMA_TODEVICE);
1522 t = sp->mc_setup_head->next;
1523 kfree(sp->mc_setup_head);
1524 sp->mc_setup_head = t;
1525 }
1526 if (sp->mc_setup_head == NULL)
1527 sp->mc_setup_tail = NULL;
1528
1529 sp->dirty_tx = dirty_tx;
1530}
1531
1532/* The interrupt handler does all of the Rx thread work and cleans up
1533 after the Tx thread. */
1534static irqreturn_t speedo_interrupt(int irq, void *dev_instance)
1535{
1536 struct net_device *dev = (struct net_device *)dev_instance;
1537 struct speedo_private *sp;
1538 void __iomem *ioaddr;
1539 long boguscnt = max_interrupt_work;
1540 unsigned short status;
1541 unsigned int handled = 0;
1542
1543 sp = netdev_priv(dev);
1544 ioaddr = sp->regs;
1545
1546#ifndef final_version
1547 /* A lock to prevent simultaneous entry on SMP machines. */
1548 if (test_and_set_bit(0, (void*)&sp->in_interrupt)) {
1549 printk(KERN_ERR"%s: SMP simultaneous entry of an interrupt handler.\n",
1550 dev->name);
1551 sp->in_interrupt = 0; /* Avoid halting machine. */
1552 return IRQ_NONE;
1553 }
1554#endif
1555
1556 do {
1557 status = ioread16(ioaddr + SCBStatus);
1558 /* Acknowledge all of the current interrupt sources ASAP. */
1559 /* Will change from 0xfc00 to 0xff00 when we start handling
1560 FCP and ER interrupts --Dragan */
1561 iowrite16(status & 0xfc00, ioaddr + SCBStatus);
1562
1563 if (netif_msg_intr(sp))
1564 printk(KERN_DEBUG "%s: interrupt status=%#4.4x.\n",
1565 dev->name, status);
1566
1567 if ((status & 0xfc00) == 0)
1568 break;
1569 handled = 1;
1570
1571
1572 if ((status & 0x5000) || /* Packet received, or Rx error. */
1573 (sp->rx_ring_state&(RrNoMem|RrPostponed)) == RrPostponed)
1574 /* Need to gather the postponed packet. */
1575 speedo_rx(dev);
1576
1577 /* Always check if all rx buffers are allocated. --SAW */
1578 speedo_refill_rx_buffers(dev, 0);
1579
1580 spin_lock(&sp->lock);
1581 /*
1582 * The chip may have suspended reception for various reasons.
1583 * Check for that, and re-prime it should this be the case.
1584 */
1585 switch ((status >> 2) & 0xf) {
1586 case 0: /* Idle */
1587 break;
1588 case 1: /* Suspended */
1589 case 2: /* No resources (RxFDs) */
1590 case 9: /* Suspended with no more RBDs */
1591 case 10: /* No resources due to no RBDs */
1592 case 12: /* Ready with no RBDs */
1593 speedo_rx_soft_reset(dev);
1594 break;
1595 case 3: case 5: case 6: case 7: case 8:
1596 case 11: case 13: case 14: case 15:
1597 /* these are all reserved values */
1598 break;
1599 }
1600
1601
1602 /* User interrupt, Command/Tx unit interrupt or CU not active. */
1603 if (status & 0xA400) {
1604 speedo_tx_buffer_gc(dev);
1605 if (sp->tx_full
1606 && (int)(sp->cur_tx - sp->dirty_tx) < TX_QUEUE_UNFULL) {
1607 /* The ring is no longer full. */
1608 sp->tx_full = 0;
1609 netif_wake_queue(dev); /* Attention: under a spinlock. --SAW */
1610 }
1611 }
1612
1613 spin_unlock(&sp->lock);
1614
1615 if (--boguscnt < 0) {
1616 printk(KERN_ERR "%s: Too much work at interrupt, status=0x%4.4x.\n",
1617 dev->name, status);
1618 /* Clear all interrupt sources. */
1619 /* Will change from 0xfc00 to 0xff00 when we start handling
1620 FCP and ER interrupts --Dragan */
1621 iowrite16(0xfc00, ioaddr + SCBStatus);
1622 break;
1623 }
1624 } while (1);
1625
1626 if (netif_msg_intr(sp))
1627 printk(KERN_DEBUG "%s: exiting interrupt, status=%#4.4x.\n",
1628 dev->name, ioread16(ioaddr + SCBStatus));
1629
1630 clear_bit(0, (void*)&sp->in_interrupt);
1631 return IRQ_RETVAL(handled);
1632}
1633
1634static inline struct RxFD *speedo_rx_alloc(struct net_device *dev, int entry)
1635{
1636 struct speedo_private *sp = netdev_priv(dev);
1637 struct RxFD *rxf;
1638 struct sk_buff *skb;
1639 /* Get a fresh skbuff to replace the consumed one. */
1640 skb = dev_alloc_skb(PKT_BUF_SZ + sizeof(struct RxFD));
1641 if (skb)
1642 rx_align(skb); /* Align IP on 16 byte boundary */
1643 sp->rx_skbuff[entry] = skb;
1644 if (skb == NULL) {
1645 sp->rx_ringp[entry] = NULL;
1646 return NULL;
1647 }
1648 rxf = sp->rx_ringp[entry] = (struct RxFD *)skb->data;
1649 sp->rx_ring_dma[entry] =
1650 pci_map_single(sp->pdev, rxf,
1651 PKT_BUF_SZ + sizeof(struct RxFD), PCI_DMA_FROMDEVICE);
1652 skb->dev = dev;
1653 skb_reserve(skb, sizeof(struct RxFD));
1654 rxf->rx_buf_addr = cpu_to_le32(0xffffffff);
1655 pci_dma_sync_single_for_device(sp->pdev, sp->rx_ring_dma[entry],
1656 sizeof(struct RxFD), PCI_DMA_TODEVICE);
1657 return rxf;
1658}
1659
1660static inline void speedo_rx_link(struct net_device *dev, int entry,
1661 struct RxFD *rxf, dma_addr_t rxf_dma)
1662{
1663 struct speedo_private *sp = netdev_priv(dev);
1664 rxf->status = cpu_to_le32(0xC0000001); /* '1' for driver use only. */
1665 rxf->link = 0; /* None yet. */
1666 rxf->count = cpu_to_le32(PKT_BUF_SZ << 16);
1667 sp->last_rxf->link = cpu_to_le32(rxf_dma);
1668 sp->last_rxf->status &= cpu_to_le32(~0xC0000000);
1669 pci_dma_sync_single_for_device(sp->pdev, sp->last_rxf_dma,
1670 sizeof(struct RxFD), PCI_DMA_TODEVICE);
1671 sp->last_rxf = rxf;
1672 sp->last_rxf_dma = rxf_dma;
1673}
1674
1675static int speedo_refill_rx_buf(struct net_device *dev, int force)
1676{
1677 struct speedo_private *sp = netdev_priv(dev);
1678 int entry;
1679 struct RxFD *rxf;
1680
1681 entry = sp->dirty_rx % RX_RING_SIZE;
1682 if (sp->rx_skbuff[entry] == NULL) {
1683 rxf = speedo_rx_alloc(dev, entry);
1684 if (rxf == NULL) {
1685 unsigned int forw;
1686 int forw_entry;
1687 if (netif_msg_rx_err(sp) || !(sp->rx_ring_state & RrOOMReported)) {
1688 printk(KERN_WARNING "%s: can't fill rx buffer (force %d)!\n",
1689 dev->name, force);
1690 sp->rx_ring_state |= RrOOMReported;
1691 }
1692 speedo_show_state(dev);
1693 if (!force)
1694 return -1; /* Better luck next time! */
1695 /* Borrow an skb from one of next entries. */
1696 for (forw = sp->dirty_rx + 1; forw != sp->cur_rx; forw++)
1697 if (sp->rx_skbuff[forw % RX_RING_SIZE] != NULL)
1698 break;
1699 if (forw == sp->cur_rx)
1700 return -1;
1701 forw_entry = forw % RX_RING_SIZE;
1702 sp->rx_skbuff[entry] = sp->rx_skbuff[forw_entry];
1703 sp->rx_skbuff[forw_entry] = NULL;
1704 rxf = sp->rx_ringp[forw_entry];
1705 sp->rx_ringp[forw_entry] = NULL;
1706 sp->rx_ringp[entry] = rxf;
1707 }
1708 } else {
1709 rxf = sp->rx_ringp[entry];
1710 }
1711 speedo_rx_link(dev, entry, rxf, sp->rx_ring_dma[entry]);
1712 sp->dirty_rx++;
1713 sp->rx_ring_state &= ~(RrNoMem|RrOOMReported); /* Mark the progress. */
1714 return 0;
1715}
1716
1717static void speedo_refill_rx_buffers(struct net_device *dev, int force)
1718{
1719 struct speedo_private *sp = netdev_priv(dev);
1720
1721 /* Refill the RX ring. */
1722 while ((int)(sp->cur_rx - sp->dirty_rx) > 0 &&
1723 speedo_refill_rx_buf(dev, force) != -1);
1724}
1725
1726static int
1727speedo_rx(struct net_device *dev)
1728{
1729 struct speedo_private *sp = netdev_priv(dev);
1730 int entry = sp->cur_rx % RX_RING_SIZE;
1731 int rx_work_limit = sp->dirty_rx + RX_RING_SIZE - sp->cur_rx;
1732 int alloc_ok = 1;
1733 int npkts = 0;
1734
1735 if (netif_msg_intr(sp))
1736 printk(KERN_DEBUG " In speedo_rx().\n");
1737 /* If we own the next entry, it's a new packet. Send it up. */
1738 while (sp->rx_ringp[entry] != NULL) {
1739 int status;
1740 int pkt_len;
1741
1742 pci_dma_sync_single_for_cpu(sp->pdev, sp->rx_ring_dma[entry],
1743 sizeof(struct RxFD), PCI_DMA_FROMDEVICE);
1744 status = le32_to_cpu(sp->rx_ringp[entry]->status);
1745 pkt_len = le32_to_cpu(sp->rx_ringp[entry]->count) & 0x3fff;
1746
1747 if (!(status & RxComplete))
1748 break;
1749
1750 if (--rx_work_limit < 0)
1751 break;
1752
1753 /* Check for a rare out-of-memory case: the current buffer is
1754 the last buffer allocated in the RX ring. --SAW */
1755 if (sp->last_rxf == sp->rx_ringp[entry]) {
1756 /* Postpone the packet. It'll be reaped at an interrupt when this
1757 packet is no longer the last packet in the ring. */
1758 if (netif_msg_rx_err(sp))
1759 printk(KERN_DEBUG "%s: RX packet postponed!\n",
1760 dev->name);
1761 sp->rx_ring_state |= RrPostponed;
1762 break;
1763 }
1764
1765 if (netif_msg_rx_status(sp))
1766 printk(KERN_DEBUG " speedo_rx() status %8.8x len %d.\n", status,
1767 pkt_len);
1768 if ((status & (RxErrTooBig|RxOK|0x0f90)) != RxOK) {
1769 if (status & RxErrTooBig)
1770 printk(KERN_ERR "%s: Ethernet frame overran the Rx buffer, "
1771 "status %8.8x!\n", dev->name, status);
1772 else if (! (status & RxOK)) {
1773 /* There was a fatal error. This *should* be impossible. */
1774 sp->stats.rx_errors++;
1775 printk(KERN_ERR "%s: Anomalous event in speedo_rx(), "
1776 "status %8.8x.\n",
1777 dev->name, status);
1778 }
1779 } else {
1780 struct sk_buff *skb;
1781
1782 /* Check if the packet is long enough to just accept without
1783 copying to a properly sized skbuff. */
1784 if (pkt_len < rx_copybreak
1785 && (skb = dev_alloc_skb(pkt_len + 2)) != NULL) {
1786 skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
1787 /* 'skb_put()' points to the start of sk_buff data area. */
1788 pci_dma_sync_single_for_cpu(sp->pdev, sp->rx_ring_dma[entry],
1789 sizeof(struct RxFD) + pkt_len,
1790 PCI_DMA_FROMDEVICE);
1791
1792#if 1 || USE_IP_CSUM
1793 /* Packet is in one chunk -- we can copy + cksum. */
1794 skb_copy_to_linear_data(skb, sp->rx_skbuff[entry]->data, pkt_len);
1795 skb_put(skb, pkt_len);
1796#else
1797 skb_copy_from_linear_data(sp->rx_skbuff[entry],
1798 skb_put(skb, pkt_len),
1799 pkt_len);
1800#endif
1801 pci_dma_sync_single_for_device(sp->pdev, sp->rx_ring_dma[entry],
1802 sizeof(struct RxFD) + pkt_len,
1803 PCI_DMA_FROMDEVICE);
1804 npkts++;
1805 } else {
1806 /* Pass up the already-filled skbuff. */
1807 skb = sp->rx_skbuff[entry];
1808 if (skb == NULL) {
1809 printk(KERN_ERR "%s: Inconsistent Rx descriptor chain.\n",
1810 dev->name);
1811 break;
1812 }
1813 sp->rx_skbuff[entry] = NULL;
1814 skb_put(skb, pkt_len);
1815 npkts++;
1816 sp->rx_ringp[entry] = NULL;
1817 pci_unmap_single(sp->pdev, sp->rx_ring_dma[entry],
1818 PKT_BUF_SZ + sizeof(struct RxFD),
1819 PCI_DMA_FROMDEVICE);
1820 }
1821 skb->protocol = eth_type_trans(skb, dev);
1822 netif_rx(skb);
1823 dev->last_rx = jiffies;
1824 sp->stats.rx_packets++;
1825 sp->stats.rx_bytes += pkt_len;
1826 }
1827 entry = (++sp->cur_rx) % RX_RING_SIZE;
1828 sp->rx_ring_state &= ~RrPostponed;
1829 /* Refill the recently taken buffers.
1830 Do it one-by-one to handle traffic bursts better. */
1831 if (alloc_ok && speedo_refill_rx_buf(dev, 0) == -1)
1832 alloc_ok = 0;
1833 }
1834
1835 /* Try hard to refill the recently taken buffers. */
1836 speedo_refill_rx_buffers(dev, 1);
1837
1838 if (npkts)
1839 sp->last_rx_time = jiffies;
1840
1841 return 0;
1842}
1843
1844static int
1845speedo_close(struct net_device *dev)
1846{
1847 struct speedo_private *sp = netdev_priv(dev);
1848 void __iomem *ioaddr = sp->regs;
1849 int i;
1850
1851 netdevice_stop(dev);
1852 netif_stop_queue(dev);
1853
1854 if (netif_msg_ifdown(sp))
1855 printk(KERN_DEBUG "%s: Shutting down ethercard, status was %4.4x.\n",
1856 dev->name, ioread16(ioaddr + SCBStatus));
1857
1858 /* Shut off the media monitoring timer. */
1859 del_timer_sync(&sp->timer);
1860
1861 iowrite16(SCBMaskAll, ioaddr + SCBCmd);
1862
1863 /* Shutting down the chip nicely fails to disable flow control. So.. */
1864 iowrite32(PortPartialReset, ioaddr + SCBPort);
1865 ioread32(ioaddr + SCBPort); /* flush posted write */
1866 /*
1867 * The chip requires a 10 microsecond quiet period. Wait here!
1868 */
1869 udelay(10);
1870
1871 free_irq(dev->irq, dev);
1872 speedo_show_state(dev);
1873
1874 /* Free all the skbuffs in the Rx and Tx queues. */
1875 for (i = 0; i < RX_RING_SIZE; i++) {
1876 struct sk_buff *skb = sp->rx_skbuff[i];
1877 sp->rx_skbuff[i] = NULL;
1878 /* Clear the Rx descriptors. */
1879 if (skb) {
1880 pci_unmap_single(sp->pdev,
1881 sp->rx_ring_dma[i],
1882 PKT_BUF_SZ + sizeof(struct RxFD), PCI_DMA_FROMDEVICE);
1883 dev_kfree_skb(skb);
1884 }
1885 }
1886
1887 for (i = 0; i < TX_RING_SIZE; i++) {
1888 struct sk_buff *skb = sp->tx_skbuff[i];
1889 sp->tx_skbuff[i] = NULL;
1890 /* Clear the Tx descriptors. */
1891 if (skb) {
1892 pci_unmap_single(sp->pdev,
1893 le32_to_cpu(sp->tx_ring[i].tx_buf_addr0),
1894 skb->len, PCI_DMA_TODEVICE);
1895 dev_kfree_skb(skb);
1896 }
1897 }
1898
1899 /* Free multicast setting blocks. */
1900 for (i = 0; sp->mc_setup_head != NULL; i++) {
1901 struct speedo_mc_block *t;
1902 t = sp->mc_setup_head->next;
1903 kfree(sp->mc_setup_head);
1904 sp->mc_setup_head = t;
1905 }
1906 sp->mc_setup_tail = NULL;
1907 if (netif_msg_ifdown(sp))
1908 printk(KERN_DEBUG "%s: %d multicast blocks dropped.\n", dev->name, i);
1909
1910 pci_set_power_state(sp->pdev, PCI_D2);
1911
1912 return 0;
1913}
1914
1915/* The Speedo-3 has an especially awkward and unusable method of getting
1916 statistics out of the chip. It takes an unpredictable length of time
1917 for the dump-stats command to complete. To avoid a busy-wait loop we
1918 update the stats with the previous dump results, and then trigger a
1919 new dump.
1920
1921 Oh, and incoming frames are dropped while executing dump-stats!
1922 */
1923static struct net_device_stats *
1924speedo_get_stats(struct net_device *dev)
1925{
1926 struct speedo_private *sp = netdev_priv(dev);
1927 void __iomem *ioaddr = sp->regs;
1928
1929 /* Update only if the previous dump finished. */
1930 if (sp->lstats->done_marker == cpu_to_le32(0xA007)) {
1931 sp->stats.tx_aborted_errors += le32_to_cpu(sp->lstats->tx_coll16_errs);
1932 sp->stats.tx_window_errors += le32_to_cpu(sp->lstats->tx_late_colls);
1933 sp->stats.tx_fifo_errors += le32_to_cpu(sp->lstats->tx_underruns);
1934 sp->stats.tx_fifo_errors += le32_to_cpu(sp->lstats->tx_lost_carrier);
1935 /*sp->stats.tx_deferred += le32_to_cpu(sp->lstats->tx_deferred);*/
1936 sp->stats.collisions += le32_to_cpu(sp->lstats->tx_total_colls);
1937 sp->stats.rx_crc_errors += le32_to_cpu(sp->lstats->rx_crc_errs);
1938 sp->stats.rx_frame_errors += le32_to_cpu(sp->lstats->rx_align_errs);
1939 sp->stats.rx_over_errors += le32_to_cpu(sp->lstats->rx_resource_errs);
1940 sp->stats.rx_fifo_errors += le32_to_cpu(sp->lstats->rx_overrun_errs);
1941 sp->stats.rx_length_errors += le32_to_cpu(sp->lstats->rx_runt_errs);
1942 sp->lstats->done_marker = 0x0000;
1943 if (netif_running(dev)) {
1944 unsigned long flags;
1945 /* Take a spinlock to make wait_for_cmd_done and sending the
1946 command atomic. --SAW */
1947 spin_lock_irqsave(&sp->lock, flags);
1948 wait_for_cmd_done(dev, sp);
1949 iowrite8(CUDumpStats, ioaddr + SCBCmd);
1950 spin_unlock_irqrestore(&sp->lock, flags);
1951 }
1952 }
1953 return &sp->stats;
1954}
1955
1956static void speedo_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
1957{
1958 struct speedo_private *sp = netdev_priv(dev);
1959 strncpy(info->driver, "eepro100", sizeof(info->driver)-1);
1960 strncpy(info->version, version, sizeof(info->version)-1);
1961 if (sp->pdev)
1962 strcpy(info->bus_info, pci_name(sp->pdev));
1963}
1964
1965static int speedo_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
1966{
1967 struct speedo_private *sp = netdev_priv(dev);
1968 spin_lock_irq(&sp->lock);
1969 mii_ethtool_gset(&sp->mii_if, ecmd);
1970 spin_unlock_irq(&sp->lock);
1971 return 0;
1972}
1973
1974static int speedo_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
1975{
1976 struct speedo_private *sp = netdev_priv(dev);
1977 int res;
1978 spin_lock_irq(&sp->lock);
1979 res = mii_ethtool_sset(&sp->mii_if, ecmd);
1980 spin_unlock_irq(&sp->lock);
1981 return res;
1982}
1983
1984static int speedo_nway_reset(struct net_device *dev)
1985{
1986 struct speedo_private *sp = netdev_priv(dev);
1987 return mii_nway_restart(&sp->mii_if);
1988}
1989
1990static u32 speedo_get_link(struct net_device *dev)
1991{
1992 struct speedo_private *sp = netdev_priv(dev);
1993 return mii_link_ok(&sp->mii_if);
1994}
1995
1996static u32 speedo_get_msglevel(struct net_device *dev)
1997{
1998 struct speedo_private *sp = netdev_priv(dev);
1999 return sp->msg_enable;
2000}
2001
2002static void speedo_set_msglevel(struct net_device *dev, u32 v)
2003{
2004 struct speedo_private *sp = netdev_priv(dev);
2005 sp->msg_enable = v;
2006}
2007
2008static const struct ethtool_ops ethtool_ops = {
2009 .get_drvinfo = speedo_get_drvinfo,
2010 .get_settings = speedo_get_settings,
2011 .set_settings = speedo_set_settings,
2012 .nway_reset = speedo_nway_reset,
2013 .get_link = speedo_get_link,
2014 .get_msglevel = speedo_get_msglevel,
2015 .set_msglevel = speedo_set_msglevel,
2016};
2017
2018static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
2019{
2020 struct speedo_private *sp = netdev_priv(dev);
2021 struct mii_ioctl_data *data = if_mii(rq);
2022 int phy = sp->phy[0] & 0x1f;
2023 int saved_acpi;
2024 int t;
2025
2026 switch(cmd) {
2027 case SIOCGMIIPHY: /* Get address of MII PHY in use. */
2028 data->phy_id = phy;
2029
2030 case SIOCGMIIREG: /* Read MII PHY register. */
2031 /* FIXME: these operations need to be serialized with MDIO
2032 access from the timeout handler.
2033 They are currently serialized only with MDIO access from the
2034 timer routine. 2000/05/09 SAW */
2035 saved_acpi = pci_set_power_state(sp->pdev, PCI_D0);
2036 t = del_timer_sync(&sp->timer);
2037 data->val_out = mdio_read(dev, data->phy_id & 0x1f, data->reg_num & 0x1f);
2038 if (t)
2039 add_timer(&sp->timer); /* may be set to the past --SAW */
2040 pci_set_power_state(sp->pdev, saved_acpi);
2041 return 0;
2042
2043 case SIOCSMIIREG: /* Write MII PHY register. */
2044 if (!capable(CAP_NET_ADMIN))
2045 return -EPERM;
2046 saved_acpi = pci_set_power_state(sp->pdev, PCI_D0);
2047 t = del_timer_sync(&sp->timer);
2048 mdio_write(dev, data->phy_id, data->reg_num, data->val_in);
2049 if (t)
2050 add_timer(&sp->timer); /* may be set to the past --SAW */
2051 pci_set_power_state(sp->pdev, saved_acpi);
2052 return 0;
2053 default:
2054 return -EOPNOTSUPP;
2055 }
2056}
2057
2058/* Set or clear the multicast filter for this adaptor.
2059 This is very ugly with Intel chips -- we usually have to execute an
2060 entire configuration command, plus process a multicast command.
2061 This is complicated. We must put a large configuration command and
2062 an arbitrarily-sized multicast command in the transmit list.
2063 To minimize the disruption -- the previous command might have already
2064 loaded the link -- we convert the current command block, normally a Tx
2065 command, into a no-op and link it to the new command.
2066*/
2067static void set_rx_mode(struct net_device *dev)
2068{
2069 struct speedo_private *sp = netdev_priv(dev);
2070 void __iomem *ioaddr = sp->regs;
2071 struct descriptor *last_cmd;
2072 char new_rx_mode;
2073 unsigned long flags;
2074 int entry, i;
2075
2076 if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
2077 new_rx_mode = 3;
2078 } else if ((dev->flags & IFF_ALLMULTI) ||
2079 dev->mc_count > multicast_filter_limit) {
2080 new_rx_mode = 1;
2081 } else
2082 new_rx_mode = 0;
2083
2084 if (netif_msg_rx_status(sp))
2085 printk(KERN_DEBUG "%s: set_rx_mode %d -> %d\n", dev->name,
2086 sp->rx_mode, new_rx_mode);
2087
2088 if ((int)(sp->cur_tx - sp->dirty_tx) > TX_RING_SIZE - TX_MULTICAST_SIZE) {
2089 /* The Tx ring is full -- don't add anything! Hope the mode will be
2090 * set again later. */
2091 sp->rx_mode = -1;
2092 return;
2093 }
2094
2095 if (new_rx_mode != sp->rx_mode) {
2096 u8 *config_cmd_data;
2097
2098 spin_lock_irqsave(&sp->lock, flags);
2099 entry = sp->cur_tx++ % TX_RING_SIZE;
2100 last_cmd = sp->last_cmd;
2101 sp->last_cmd = (struct descriptor *)&sp->tx_ring[entry];
2102
2103 sp->tx_skbuff[entry] = NULL; /* Redundant. */
2104 sp->tx_ring[entry].status = cpu_to_le32(CmdSuspend | CmdConfigure);
2105 sp->tx_ring[entry].link =
2106 cpu_to_le32(TX_RING_ELEM_DMA(sp, (entry + 1) % TX_RING_SIZE));
2107 config_cmd_data = (void *)&sp->tx_ring[entry].tx_desc_addr;
2108 /* Construct a full CmdConfig frame. */
2109 memcpy(config_cmd_data, i82558_config_cmd, CONFIG_DATA_SIZE);
2110 config_cmd_data[1] = (txfifo << 4) | rxfifo;
2111 config_cmd_data[4] = rxdmacount;
2112 config_cmd_data[5] = txdmacount + 0x80;
2113 config_cmd_data[15] |= (new_rx_mode & 2) ? 1 : 0;
2114 /* 0x80 doesn't disable FC 0x84 does.
2115 Disable Flow control since we are not ACK-ing any FC interrupts
2116 for now. --Dragan */
2117 config_cmd_data[19] = 0x84;
2118 config_cmd_data[19] |= sp->mii_if.full_duplex ? 0x40 : 0;
2119 config_cmd_data[21] = (new_rx_mode & 1) ? 0x0D : 0x05;
2120 if (sp->phy[0] & 0x8000) { /* Use the AUI port instead. */
2121 config_cmd_data[15] |= 0x80;
2122 config_cmd_data[8] = 0;
2123 }
2124 /* Trigger the command unit resume. */
2125 wait_for_cmd_done(dev, sp);
2126 clear_suspend(last_cmd);
2127 iowrite8(CUResume, ioaddr + SCBCmd);
2128 if ((int)(sp->cur_tx - sp->dirty_tx) >= TX_QUEUE_LIMIT) {
2129 netif_stop_queue(dev);
2130 sp->tx_full = 1;
2131 }
2132 spin_unlock_irqrestore(&sp->lock, flags);
2133 }
2134
2135 if (new_rx_mode == 0 && dev->mc_count < 4) {
2136 /* The simple case of 0-3 multicast list entries occurs often, and
2137 fits within one tx_ring[] entry. */
2138 struct dev_mc_list *mclist;
2139 __le16 *setup_params, *eaddrs;
2140
2141 spin_lock_irqsave(&sp->lock, flags);
2142 entry = sp->cur_tx++ % TX_RING_SIZE;
2143 last_cmd = sp->last_cmd;
2144 sp->last_cmd = (struct descriptor *)&sp->tx_ring[entry];
2145
2146 sp->tx_skbuff[entry] = NULL;
2147 sp->tx_ring[entry].status = cpu_to_le32(CmdSuspend | CmdMulticastList);
2148 sp->tx_ring[entry].link =
2149 cpu_to_le32(TX_RING_ELEM_DMA(sp, (entry + 1) % TX_RING_SIZE));
2150 sp->tx_ring[entry].tx_desc_addr = 0; /* Really MC list count. */
2151 setup_params = (__le16 *)&sp->tx_ring[entry].tx_desc_addr;
2152 *setup_params++ = cpu_to_le16(dev->mc_count*6);
2153 /* Fill in the multicast addresses. */
2154 for (i = 0, mclist = dev->mc_list; i < dev->mc_count;
2155 i++, mclist = mclist->next) {
2156 eaddrs = (__le16 *)mclist->dmi_addr;
2157 *setup_params++ = *eaddrs++;
2158 *setup_params++ = *eaddrs++;
2159 *setup_params++ = *eaddrs++;
2160 }
2161
2162 wait_for_cmd_done(dev, sp);
2163 clear_suspend(last_cmd);
2164 /* Immediately trigger the command unit resume. */
2165 iowrite8(CUResume, ioaddr + SCBCmd);
2166
2167 if ((int)(sp->cur_tx - sp->dirty_tx) >= TX_QUEUE_LIMIT) {
2168 netif_stop_queue(dev);
2169 sp->tx_full = 1;
2170 }
2171 spin_unlock_irqrestore(&sp->lock, flags);
2172 } else if (new_rx_mode == 0) {
2173 struct dev_mc_list *mclist;
2174 __le16 *setup_params, *eaddrs;
2175 struct speedo_mc_block *mc_blk;
2176 struct descriptor *mc_setup_frm;
2177 int i;
2178
2179 mc_blk = kmalloc(sizeof(*mc_blk) + 2 + multicast_filter_limit*6,
2180 GFP_ATOMIC);
2181 if (mc_blk == NULL) {
2182 printk(KERN_ERR "%s: Failed to allocate a setup frame.\n",
2183 dev->name);
2184 sp->rx_mode = -1; /* We failed, try again. */
2185 return;
2186 }
2187 mc_blk->next = NULL;
2188 mc_blk->len = 2 + multicast_filter_limit*6;
2189 mc_blk->frame_dma =
2190 pci_map_single(sp->pdev, &mc_blk->frame, mc_blk->len,
2191 PCI_DMA_TODEVICE);
2192 mc_setup_frm = &mc_blk->frame;
2193
2194 /* Fill the setup frame. */
2195 if (netif_msg_ifup(sp))
2196 printk(KERN_DEBUG "%s: Constructing a setup frame at %p.\n",
2197 dev->name, mc_setup_frm);
2198 mc_setup_frm->cmd_status =
2199 cpu_to_le32(CmdSuspend | CmdIntr | CmdMulticastList);
2200 /* Link set below. */
2201 setup_params = (__le16 *)&mc_setup_frm->params;
2202 *setup_params++ = cpu_to_le16(dev->mc_count*6);
2203 /* Fill in the multicast addresses. */
2204 for (i = 0, mclist = dev->mc_list; i < dev->mc_count;
2205 i++, mclist = mclist->next) {
2206 eaddrs = (__le16 *)mclist->dmi_addr;
2207 *setup_params++ = *eaddrs++;
2208 *setup_params++ = *eaddrs++;
2209 *setup_params++ = *eaddrs++;
2210 }
2211
2212 /* Disable interrupts while playing with the Tx Cmd list. */
2213 spin_lock_irqsave(&sp->lock, flags);
2214
2215 if (sp->mc_setup_tail)
2216 sp->mc_setup_tail->next = mc_blk;
2217 else
2218 sp->mc_setup_head = mc_blk;
2219 sp->mc_setup_tail = mc_blk;
2220 mc_blk->tx = sp->cur_tx;
2221
2222 entry = sp->cur_tx++ % TX_RING_SIZE;
2223 last_cmd = sp->last_cmd;
2224 sp->last_cmd = mc_setup_frm;
2225
2226 /* Change the command to a NoOp, pointing to the CmdMulti command. */
2227 sp->tx_skbuff[entry] = NULL;
2228 sp->tx_ring[entry].status = cpu_to_le32(CmdNOp);
2229 sp->tx_ring[entry].link = cpu_to_le32(mc_blk->frame_dma);
2230
2231 /* Set the link in the setup frame. */
2232 mc_setup_frm->link =
2233 cpu_to_le32(TX_RING_ELEM_DMA(sp, (entry + 1) % TX_RING_SIZE));
2234
2235 pci_dma_sync_single_for_device(sp->pdev, mc_blk->frame_dma,
2236 mc_blk->len, PCI_DMA_TODEVICE);
2237
2238 wait_for_cmd_done(dev, sp);
2239 clear_suspend(last_cmd);
2240 /* Immediately trigger the command unit resume. */
2241 iowrite8(CUResume, ioaddr + SCBCmd);
2242
2243 if ((int)(sp->cur_tx - sp->dirty_tx) >= TX_QUEUE_LIMIT) {
2244 netif_stop_queue(dev);
2245 sp->tx_full = 1;
2246 }
2247 spin_unlock_irqrestore(&sp->lock, flags);
2248
2249 if (netif_msg_rx_status(sp))
2250 printk(" CmdMCSetup frame length %d in entry %d.\n",
2251 dev->mc_count, entry);
2252 }
2253
2254 sp->rx_mode = new_rx_mode;
2255}
2256
2257#ifdef CONFIG_PM
2258static int eepro100_suspend(struct pci_dev *pdev, pm_message_t state)
2259{
2260 struct net_device *dev = pci_get_drvdata (pdev);
2261 struct speedo_private *sp = netdev_priv(dev);
2262 void __iomem *ioaddr = sp->regs;
2263
2264 pci_save_state(pdev);
2265
2266 if (!netif_running(dev))
2267 return 0;
2268
2269 del_timer_sync(&sp->timer);
2270
2271 netif_device_detach(dev);
2272 iowrite32(PortPartialReset, ioaddr + SCBPort);
2273
2274 /* XXX call pci_set_power_state ()? */
2275 pci_disable_device(pdev);
2276 pci_set_power_state (pdev, PCI_D3hot);
2277 return 0;
2278}
2279
2280static int eepro100_resume(struct pci_dev *pdev)
2281{
2282 struct net_device *dev = pci_get_drvdata (pdev);
2283 struct speedo_private *sp = netdev_priv(dev);
2284 void __iomem *ioaddr = sp->regs;
2285 int rc;
2286
2287 pci_set_power_state(pdev, PCI_D0);
2288 pci_restore_state(pdev);
2289
2290 rc = pci_enable_device(pdev);
2291 if (rc)
2292 return rc;
2293
2294 pci_set_master(pdev);
2295
2296 if (!netif_running(dev))
2297 return 0;
2298
2299 /* I'm absolutely uncertain if this part of code may work.
2300 The problems are:
2301 - correct hardware reinitialization;
2302 - correct driver behavior between different steps of the
2303 reinitialization;
2304 - serialization with other driver calls.
2305 2000/03/08 SAW */
2306 iowrite16(SCBMaskAll, ioaddr + SCBCmd);
2307 speedo_resume(dev);
2308 netif_device_attach(dev);
2309 sp->rx_mode = -1;
2310 sp->flow_ctrl = sp->partner = 0;
2311 set_rx_mode(dev);
2312 sp->timer.expires = RUN_AT(2*HZ);
2313 add_timer(&sp->timer);
2314 return 0;
2315}
2316#endif /* CONFIG_PM */
2317
2318static void __devexit eepro100_remove_one (struct pci_dev *pdev)
2319{
2320 struct net_device *dev = pci_get_drvdata (pdev);
2321 struct speedo_private *sp = netdev_priv(dev);
2322
2323 unregister_netdev(dev);
2324
2325 release_region(pci_resource_start(pdev, 1), pci_resource_len(pdev, 1));
2326 release_mem_region(pci_resource_start(pdev, 0), pci_resource_len(pdev, 0));
2327
2328 pci_iounmap(pdev, sp->regs);
2329 pci_free_consistent(pdev, TX_RING_SIZE * sizeof(struct TxFD)
2330 + sizeof(struct speedo_stats),
2331 sp->tx_ring, sp->tx_ring_dma);
2332 pci_disable_device(pdev);
2333 free_netdev(dev);
2334}
2335
2336static struct pci_device_id eepro100_pci_tbl[] = {
2337 { PCI_VENDOR_ID_INTEL, 0x1229, PCI_ANY_ID, PCI_ANY_ID, },
2338 { PCI_VENDOR_ID_INTEL, 0x1209, PCI_ANY_ID, PCI_ANY_ID, },
2339 { PCI_VENDOR_ID_INTEL, 0x1029, PCI_ANY_ID, PCI_ANY_ID, },
2340 { PCI_VENDOR_ID_INTEL, 0x1030, PCI_ANY_ID, PCI_ANY_ID, },
2341 { PCI_VENDOR_ID_INTEL, 0x1031, PCI_ANY_ID, PCI_ANY_ID, },
2342 { PCI_VENDOR_ID_INTEL, 0x1032, PCI_ANY_ID, PCI_ANY_ID, },
2343 { PCI_VENDOR_ID_INTEL, 0x1033, PCI_ANY_ID, PCI_ANY_ID, },
2344 { PCI_VENDOR_ID_INTEL, 0x1034, PCI_ANY_ID, PCI_ANY_ID, },
2345 { PCI_VENDOR_ID_INTEL, 0x1035, PCI_ANY_ID, PCI_ANY_ID, },
2346 { PCI_VENDOR_ID_INTEL, 0x1036, PCI_ANY_ID, PCI_ANY_ID, },
2347 { PCI_VENDOR_ID_INTEL, 0x1037, PCI_ANY_ID, PCI_ANY_ID, },
2348 { PCI_VENDOR_ID_INTEL, 0x1038, PCI_ANY_ID, PCI_ANY_ID, },
2349 { PCI_VENDOR_ID_INTEL, 0x1039, PCI_ANY_ID, PCI_ANY_ID, },
2350 { PCI_VENDOR_ID_INTEL, 0x103A, PCI_ANY_ID, PCI_ANY_ID, },
2351 { PCI_VENDOR_ID_INTEL, 0x103B, PCI_ANY_ID, PCI_ANY_ID, },
2352 { PCI_VENDOR_ID_INTEL, 0x103C, PCI_ANY_ID, PCI_ANY_ID, },
2353 { PCI_VENDOR_ID_INTEL, 0x103D, PCI_ANY_ID, PCI_ANY_ID, },
2354 { PCI_VENDOR_ID_INTEL, 0x103E, PCI_ANY_ID, PCI_ANY_ID, },
2355 { PCI_VENDOR_ID_INTEL, 0x1050, PCI_ANY_ID, PCI_ANY_ID, },
2356 { PCI_VENDOR_ID_INTEL, 0x1059, PCI_ANY_ID, PCI_ANY_ID, },
2357 { PCI_VENDOR_ID_INTEL, 0x1227, PCI_ANY_ID, PCI_ANY_ID, },
2358 { PCI_VENDOR_ID_INTEL, 0x2449, PCI_ANY_ID, PCI_ANY_ID, },
2359 { PCI_VENDOR_ID_INTEL, 0x2459, PCI_ANY_ID, PCI_ANY_ID, },
2360 { PCI_VENDOR_ID_INTEL, 0x245D, PCI_ANY_ID, PCI_ANY_ID, },
2361 { PCI_VENDOR_ID_INTEL, 0x5200, PCI_ANY_ID, PCI_ANY_ID, },
2362 { PCI_VENDOR_ID_INTEL, 0x5201, PCI_ANY_ID, PCI_ANY_ID, },
2363 { 0,}
2364};
2365MODULE_DEVICE_TABLE(pci, eepro100_pci_tbl);
2366
2367static struct pci_driver eepro100_driver = {
2368 .name = "eepro100",
2369 .id_table = eepro100_pci_tbl,
2370 .probe = eepro100_init_one,
2371 .remove = __devexit_p(eepro100_remove_one),
2372#ifdef CONFIG_PM
2373 .suspend = eepro100_suspend,
2374 .resume = eepro100_resume,
2375#endif /* CONFIG_PM */
2376};
2377
2378static int __init eepro100_init_module(void)
2379{
2380#ifdef MODULE
2381 printk(version);
2382#endif
2383 return pci_register_driver(&eepro100_driver);
2384}
2385
2386static void __exit eepro100_cleanup_module(void)
2387{
2388 pci_unregister_driver(&eepro100_driver);
2389}
2390
2391module_init(eepro100_init_module);
2392module_exit(eepro100_cleanup_module);
2393
2394/*
2395 * Local variables:
2396 * compile-command: "gcc -DMODULE -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -c eepro100.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`"
2397 * c-indent-level: 4
2398 * c-basic-offset: 4
2399 * tab-width: 4
2400 * End:
2401 */
diff --git a/drivers/net/enc28j60.c b/drivers/net/enc28j60.c
index e1b441effbbe..a5c7bd4532d0 100644
--- a/drivers/net/enc28j60.c
+++ b/drivers/net/enc28j60.c
@@ -477,12 +477,10 @@ static int enc28j60_set_hw_macaddr(struct net_device *ndev)
477 477
478 mutex_lock(&priv->lock); 478 mutex_lock(&priv->lock);
479 if (!priv->hw_enable) { 479 if (!priv->hw_enable) {
480 if (netif_msg_drv(priv)) { 480 if (netif_msg_drv(priv))
481 DECLARE_MAC_BUF(mac);
482 printk(KERN_INFO DRV_NAME 481 printk(KERN_INFO DRV_NAME
483 ": %s: Setting MAC address to %s\n", 482 ": %s: Setting MAC address to %pM\n",
484 ndev->name, print_mac(mac, ndev->dev_addr)); 483 ndev->name, ndev->dev_addr);
485 }
486 /* NOTE: MAC address in ENC28J60 is byte-backward */ 484 /* NOTE: MAC address in ENC28J60 is byte-backward */
487 nolock_regb_write(priv, MAADR5, ndev->dev_addr[0]); 485 nolock_regb_write(priv, MAADR5, ndev->dev_addr[0]);
488 nolock_regb_write(priv, MAADR4, ndev->dev_addr[1]); 486 nolock_regb_write(priv, MAADR4, ndev->dev_addr[1]);
@@ -1328,11 +1326,9 @@ static int enc28j60_net_open(struct net_device *dev)
1328 printk(KERN_DEBUG DRV_NAME ": %s() enter\n", __func__); 1326 printk(KERN_DEBUG DRV_NAME ": %s() enter\n", __func__);
1329 1327
1330 if (!is_valid_ether_addr(dev->dev_addr)) { 1328 if (!is_valid_ether_addr(dev->dev_addr)) {
1331 if (netif_msg_ifup(priv)) { 1329 if (netif_msg_ifup(priv))
1332 DECLARE_MAC_BUF(mac); 1330 dev_err(&dev->dev, "invalid MAC address %pM\n",
1333 dev_err(&dev->dev, "invalid MAC address %s\n", 1331 dev->dev_addr);
1334 print_mac(mac, dev->dev_addr));
1335 }
1336 return -EADDRNOTAVAIL; 1332 return -EADDRNOTAVAIL;
1337 } 1333 }
1338 /* Reset the hardware here (and take it out of low power mode) */ 1334 /* Reset the hardware here (and take it out of low power mode) */
diff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c
index 95184b9108ef..e5fc9384f8f5 100644
--- a/drivers/net/enic/enic_res.c
+++ b/drivers/net/enic/enic_res.c
@@ -90,11 +90,8 @@ int enic_get_vnic_config(struct enic *enic)
90 90
91 c->intr_timer = min_t(u16, VNIC_INTR_TIMER_MAX, c->intr_timer); 91 c->intr_timer = min_t(u16, VNIC_INTR_TIMER_MAX, c->intr_timer);
92 92
93 printk(KERN_INFO PFX "vNIC MAC addr %02x:%02x:%02x:%02x:%02x:%02x " 93 printk(KERN_INFO PFX "vNIC MAC addr %pM wq/rq %d/%d\n",
94 "wq/rq %d/%d\n", 94 enic->mac_addr, c->wq_desc_count, c->rq_desc_count);
95 enic->mac_addr[0], enic->mac_addr[1], enic->mac_addr[2],
96 enic->mac_addr[3], enic->mac_addr[4], enic->mac_addr[5],
97 c->wq_desc_count, c->rq_desc_count);
98 printk(KERN_INFO PFX "vNIC mtu %d csum tx/rx %d/%d tso/lro %d/%d " 95 printk(KERN_INFO PFX "vNIC mtu %d csum tx/rx %d/%d tso/lro %d/%d "
99 "intr timer %d\n", 96 "intr timer %d\n",
100 c->mtu, ENIC_SETTING(enic, TXCSUM), 97 c->mtu, ENIC_SETTING(enic, TXCSUM),
diff --git a/drivers/net/enic/vnic_dev.c b/drivers/net/enic/vnic_dev.c
index 4d104f5c30f9..9afd33c7188d 100644
--- a/drivers/net/enic/vnic_dev.c
+++ b/drivers/net/enic/vnic_dev.c
@@ -489,10 +489,7 @@ void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
489 489
490 err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait); 490 err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait);
491 if (err) 491 if (err)
492 printk(KERN_ERR 492 printk(KERN_ERR "Can't add addr [%pM], %d\n", addr, err);
493 "Can't add addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n",
494 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5],
495 err);
496} 493}
497 494
498void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr) 495void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
@@ -507,10 +504,7 @@ void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
507 504
508 err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait); 505 err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait);
509 if (err) 506 if (err)
510 printk(KERN_ERR 507 printk(KERN_ERR "Can't del addr [%pM], %d\n", addr, err);
511 "Can't del addr [%02x:%02x:%02x:%02x:%02x:%02x], %d\n",
512 addr[0], addr[1], addr[2], addr[3], addr[4], addr[5],
513 err);
514} 508}
515 509
516int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr) 510int vnic_dev_notify_set(struct vnic_dev *vdev, u16 intr)
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index 76118ddd1042..65a404076abe 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -322,7 +322,6 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
322 int i, ret, option = 0, duplex = 0; 322 int i, ret, option = 0, duplex = 0;
323 void *ring_space; 323 void *ring_space;
324 dma_addr_t ring_dma; 324 dma_addr_t ring_dma;
325 DECLARE_MAC_BUF(mac);
326 325
327/* when built into the kernel, we only print version if device is found */ 326/* when built into the kernel, we only print version if device is found */
328#ifndef MODULE 327#ifndef MODULE
@@ -364,7 +363,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
364 ioaddr = pci_resource_start (pdev, 0); 363 ioaddr = pci_resource_start (pdev, 0);
365#else 364#else
366 ioaddr = pci_resource_start (pdev, 1); 365 ioaddr = pci_resource_start (pdev, 1);
367 ioaddr = (long) ioremap (ioaddr, pci_resource_len (pdev, 1)); 366 ioaddr = (long) pci_ioremap_bar(pdev, 1);
368 if (!ioaddr) { 367 if (!ioaddr) {
369 dev_err(&pdev->dev, "ioremap failed\n"); 368 dev_err(&pdev->dev, "ioremap failed\n");
370 goto err_out_free_netdev; 369 goto err_out_free_netdev;
@@ -499,9 +498,9 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
499 if (ret < 0) 498 if (ret < 0)
500 goto err_out_unmap_rx; 499 goto err_out_unmap_rx;
501 500
502 printk(KERN_INFO "%s: %s at %#lx, IRQ %d, %s\n", 501 printk(KERN_INFO "%s: %s at %#lx, IRQ %d, %pM\n",
503 dev->name, pci_id_tbl[chip_idx].name, ioaddr, dev->irq, 502 dev->name, pci_id_tbl[chip_idx].name, ioaddr, dev->irq,
504 print_mac(mac, dev->dev_addr)); 503 dev->dev_addr);
505 504
506out: 505out:
507 return ret; 506 return ret;
diff --git a/drivers/net/es3210.c b/drivers/net/es3210.c
index deefa51b8c31..e7df9f4a183d 100644
--- a/drivers/net/es3210.c
+++ b/drivers/net/es3210.c
@@ -179,7 +179,6 @@ static int __init es_probe1(struct net_device *dev, int ioaddr)
179{ 179{
180 int i, retval; 180 int i, retval;
181 unsigned long eisa_id; 181 unsigned long eisa_id;
182 DECLARE_MAC_BUF(mac);
183 182
184 if (!request_region(ioaddr + ES_SA_PROM, ES_IO_EXTENT, "es3210")) 183 if (!request_region(ioaddr + ES_SA_PROM, ES_IO_EXTENT, "es3210"))
185 return -ENODEV; 184 return -ENODEV;
@@ -205,14 +204,14 @@ static int __init es_probe1(struct net_device *dev, int ioaddr)
205 if (dev->dev_addr[0] != ES_ADDR0 || 204 if (dev->dev_addr[0] != ES_ADDR0 ||
206 dev->dev_addr[1] != ES_ADDR1 || 205 dev->dev_addr[1] != ES_ADDR1 ||
207 dev->dev_addr[2] != ES_ADDR2) { 206 dev->dev_addr[2] != ES_ADDR2) {
208 printk("es3210.c: card not found %s (invalid_prefix).\n", 207 printk("es3210.c: card not found %pM (invalid_prefix).\n",
209 print_mac(mac, dev->dev_addr)); 208 dev->dev_addr);
210 retval = -ENODEV; 209 retval = -ENODEV;
211 goto out; 210 goto out;
212 } 211 }
213 212
214 printk("es3210.c: ES3210 rev. %ld at %#x, node %s", 213 printk("es3210.c: ES3210 rev. %ld at %#x, node %pM",
215 eisa_id>>24, ioaddr, print_mac(mac, dev->dev_addr)); 214 eisa_id>>24, ioaddr, dev->dev_addr);
216 215
217 /* Snarf the interrupt now. */ 216 /* Snarf the interrupt now. */
218 if (dev->irq == 0) { 217 if (dev->irq == 0) {
diff --git a/drivers/net/ewrk3.c b/drivers/net/ewrk3.c
index 593a120e31b2..3ab2156905f0 100644
--- a/drivers/net/ewrk3.c
+++ b/drivers/net/ewrk3.c
@@ -396,7 +396,6 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
396 u_long mem_start, shmem_length; 396 u_long mem_start, shmem_length;
397 u_char cr, cmr, icr, nicsr, lemac, hard_strapped = 0; 397 u_char cr, cmr, icr, nicsr, lemac, hard_strapped = 0;
398 u_char eeprom_image[EEPROM_MAX], chksum, eisa_cr = 0; 398 u_char eeprom_image[EEPROM_MAX], chksum, eisa_cr = 0;
399 DECLARE_MAC_BUF(mac);
400 399
401 /* 400 /*
402 ** Stop the EWRK3. Enable the DBR ROM. Disable interrupts and remote boot. 401 ** Stop the EWRK3. Enable the DBR ROM. Disable interrupts and remote boot.
@@ -461,7 +460,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
461 if (lemac != LeMAC2) 460 if (lemac != LeMAC2)
462 DevicePresent(iobase); /* need after EWRK3_INIT */ 461 DevicePresent(iobase); /* need after EWRK3_INIT */
463 status = get_hw_addr(dev, eeprom_image, lemac); 462 status = get_hw_addr(dev, eeprom_image, lemac);
464 printk("%s\n", print_mac(mac, dev->dev_addr)); 463 printk("%pM\n", dev->dev_addr);
465 464
466 if (status) { 465 if (status) {
467 printk(" which has an EEPROM CRC error.\n"); 466 printk(" which has an EEPROM CRC error.\n");
@@ -646,10 +645,8 @@ static int ewrk3_open(struct net_device *dev)
646 ewrk3_init(dev); 645 ewrk3_init(dev);
647 646
648 if (ewrk3_debug > 1) { 647 if (ewrk3_debug > 1) {
649 DECLARE_MAC_BUF(mac);
650 printk("%s: ewrk3 open with irq %d\n", dev->name, dev->irq); 648 printk("%s: ewrk3 open with irq %d\n", dev->name, dev->irq);
651 printk(" physical address: %s\n", 649 printk(" physical address: %pM\n", dev->dev_addr);
652 print_mac(mac, dev->dev_addr));
653 if (lp->shmem_length == 0) { 650 if (lp->shmem_length == 0) {
654 printk(" no shared memory, I/O only mode\n"); 651 printk(" no shared memory, I/O only mode\n");
655 } else { 652 } else {
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index b455ae931f7a..61c7cbba88be 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -486,7 +486,6 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
486#else 486#else
487 int bar = 1; 487 int bar = 1;
488#endif 488#endif
489 DECLARE_MAC_BUF(mac);
490 489
491/* when built into the kernel, we only print version if device is found */ 490/* when built into the kernel, we only print version if device is found */
492#ifndef MODULE 491#ifndef MODULE
@@ -665,9 +664,9 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
665 if (err) 664 if (err)
666 goto err_out_free_tx; 665 goto err_out_free_tx;
667 666
668 printk(KERN_INFO "%s: %s at %p, %s, IRQ %d.\n", 667 printk(KERN_INFO "%s: %s at %p, %pM, IRQ %d.\n",
669 dev->name, skel_netdrv_tbl[chip_id].chip_name, ioaddr, 668 dev->name, skel_netdrv_tbl[chip_id].chip_name, ioaddr,
670 print_mac(mac, dev->dev_addr), irq); 669 dev->dev_addr, irq);
671 670
672 return 0; 671 return 0;
673 672
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index ecd5c71a7a8a..2487d83ce5e4 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -2562,7 +2562,6 @@ static int __init fec_enet_module_init(void)
2562{ 2562{
2563 struct net_device *dev; 2563 struct net_device *dev;
2564 int i, err; 2564 int i, err;
2565 DECLARE_MAC_BUF(mac);
2566 2565
2567 printk("FEC ENET Version 0.2\n"); 2566 printk("FEC ENET Version 0.2\n");
2568 2567
@@ -2581,8 +2580,7 @@ static int __init fec_enet_module_init(void)
2581 return -EIO; 2580 return -EIO;
2582 } 2581 }
2583 2582
2584 printk("%s: ethernet %s\n", 2583 printk("%s: ethernet %pM\n", dev->name, dev->dev_addr);
2585 dev->name, print_mac(mac, dev->dev_addr));
2586 } 2584 }
2587 return 0; 2585 return 0;
2588} 2586}
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index cc7328b15521..74c588efa92e 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -5420,7 +5420,6 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5420 u32 powerstate, txreg; 5420 u32 powerstate, txreg;
5421 u32 phystate_orig = 0, phystate; 5421 u32 phystate_orig = 0, phystate;
5422 int phyinitialized = 0; 5422 int phyinitialized = 0;
5423 DECLARE_MAC_BUF(mac);
5424 static int printed_version; 5423 static int printed_version;
5425 5424
5426 if (!printed_version++) 5425 if (!printed_version++)
@@ -5653,8 +5652,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5653 * to 01:23:45:67:89:ab 5652 * to 01:23:45:67:89:ab
5654 */ 5653 */
5655 dev_printk(KERN_ERR, &pci_dev->dev, 5654 dev_printk(KERN_ERR, &pci_dev->dev,
5656 "Invalid Mac address detected: %s\n", 5655 "Invalid Mac address detected: %pM\n",
5657 print_mac(mac, dev->dev_addr)); 5656 dev->dev_addr);
5658 dev_printk(KERN_ERR, &pci_dev->dev, 5657 dev_printk(KERN_ERR, &pci_dev->dev,
5659 "Please complain to your hardware vendor. Switching to a random MAC.\n"); 5658 "Please complain to your hardware vendor. Switching to a random MAC.\n");
5660 dev->dev_addr[0] = 0x00; 5659 dev->dev_addr[0] = 0x00;
@@ -5663,8 +5662,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
5663 get_random_bytes(&dev->dev_addr[3], 3); 5662 get_random_bytes(&dev->dev_addr[3], 3);
5664 } 5663 }
5665 5664
5666 dprintk(KERN_DEBUG "%s: MAC Address %s\n", 5665 dprintk(KERN_DEBUG "%s: MAC Address %pM\n",
5667 pci_name(pci_dev), print_mac(mac, dev->dev_addr)); 5666 pci_name(pci_dev), dev->dev_addr);
5668 5667
5669 /* set mac address */ 5668 /* set mac address */
5670 nv_copy_mac_to_hw(dev); 5669 nv_copy_mac_to_hw(dev);
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c
index cb51c1fb0338..e32f08d18c65 100644
--- a/drivers/net/fs_enet/fs_enet-main.c
+++ b/drivers/net/fs_enet/fs_enet-main.c
@@ -1115,10 +1115,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
1115 if (ret) 1115 if (ret)
1116 goto out_free_bd; 1116 goto out_free_bd;
1117 1117
1118 printk(KERN_INFO "%s: fs_enet: %02x:%02x:%02x:%02x:%02x:%02x\n", 1118 printk(KERN_INFO "%s: fs_enet: %pM\n", ndev->name, ndev->dev_addr);
1119 ndev->name,
1120 ndev->dev_addr[0], ndev->dev_addr[1], ndev->dev_addr[2],
1121 ndev->dev_addr[3], ndev->dev_addr[4], ndev->dev_addr[5]);
1122 1119
1123 return 0; 1120 return 0;
1124 1121
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 83a5cb6aa23b..013525f3c3bd 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -162,7 +162,6 @@ static int gfar_probe(struct platform_device *pdev)
162 struct gianfar_platform_data *einfo; 162 struct gianfar_platform_data *einfo;
163 struct resource *r; 163 struct resource *r;
164 int err = 0, irq; 164 int err = 0, irq;
165 DECLARE_MAC_BUF(mac);
166 165
167 einfo = (struct gianfar_platform_data *) pdev->dev.platform_data; 166 einfo = (struct gianfar_platform_data *) pdev->dev.platform_data;
168 167
@@ -364,8 +363,7 @@ static int gfar_probe(struct platform_device *pdev)
364 gfar_init_sysfs(dev); 363 gfar_init_sysfs(dev);
365 364
366 /* Print out the device info */ 365 /* Print out the device info */
367 printk(KERN_INFO DEVICE_NAME "%s\n", 366 printk(KERN_INFO DEVICE_NAME "%pM\n", dev->name, dev->dev_addr);
368 dev->name, print_mac(mac, dev->dev_addr));
369 367
370 /* Even more device info helps when determining which kernel */ 368 /* Even more device info helps when determining which kernel */
371 /* provided which set of benchmarks. */ 369 /* provided which set of benchmarks. */
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index 3199526bcecb..1dc0fd061bfc 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -582,7 +582,6 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
582 void *ring_space; 582 void *ring_space;
583 dma_addr_t ring_dma; 583 dma_addr_t ring_dma;
584 int ret = -ENOMEM; 584 int ret = -ENOMEM;
585 DECLARE_MAC_BUF(mac);
586 585
587/* when built into the kernel, we only print version if device is found */ 586/* when built into the kernel, we only print version if device is found */
588#ifndef MODULE 587#ifndef MODULE
@@ -744,9 +743,9 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
744 goto err_out_unmap_rx; 743 goto err_out_unmap_rx;
745 } 744 }
746 745
747 printk(KERN_INFO "%s: %s type %x at %p, %s, IRQ %d.\n", 746 printk(KERN_INFO "%s: %s type %x at %p, %pM, IRQ %d.\n",
748 dev->name, chip_tbl[chip_id].name, readl(ioaddr + ChipRev), 747 dev->name, chip_tbl[chip_id].name, readl(ioaddr + ChipRev),
749 ioaddr, print_mac(mac, dev->dev_addr), irq); 748 ioaddr, dev->dev_addr, irq);
750 i = readb(ioaddr + PCIClkMeas); 749 i = readb(ioaddr + PCIClkMeas);
751 printk(KERN_INFO "%s: %d-bit %d Mhz PCI bus (%d), Virtual Jumpers " 750 printk(KERN_INFO "%s: %d-bit %d Mhz PCI bus (%d), Virtual Jumpers "
752 "%2.2x, LPA %4.4x.\n", 751 "%2.2x, LPA %4.4x.\n",
diff --git a/drivers/net/hamradio/bpqether.c b/drivers/net/hamradio/bpqether.c
index 58f4b1d7bf1f..74529c832ad1 100644
--- a/drivers/net/hamradio/bpqether.c
+++ b/drivers/net/hamradio/bpqether.c
@@ -441,16 +441,15 @@ static int bpq_seq_show(struct seq_file *seq, void *v)
441 "dev ether destination accept from\n"); 441 "dev ether destination accept from\n");
442 else { 442 else {
443 const struct bpqdev *bpqdev = v; 443 const struct bpqdev *bpqdev = v;
444 DECLARE_MAC_BUF(mac);
445 444
446 seq_printf(seq, "%-5s %-10s %s ", 445 seq_printf(seq, "%-5s %-10s %pM ",
447 bpqdev->axdev->name, bpqdev->ethdev->name, 446 bpqdev->axdev->name, bpqdev->ethdev->name,
448 print_mac(mac, bpqdev->dest_addr)); 447 bpqdev->dest_addr);
449 448
450 if (is_multicast_ether_addr(bpqdev->acpt_addr)) 449 if (is_multicast_ether_addr(bpqdev->acpt_addr))
451 seq_printf(seq, "*\n"); 450 seq_printf(seq, "*\n");
452 else 451 else
453 seq_printf(seq, "%s\n", print_mac(mac, bpqdev->acpt_addr)); 452 seq_printf(seq, "%pM\n", bpqdev->acpt_addr);
454 453
455 } 454 }
456 return 0; 455 return 0;
diff --git a/drivers/net/hp-plus.c b/drivers/net/hp-plus.c
index fbbd3e660c27..9026fd6ea0ff 100644
--- a/drivers/net/hp-plus.c
+++ b/drivers/net/hp-plus.c
@@ -166,7 +166,6 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
166 const char name[] = "HP-PC-LAN+"; 166 const char name[] = "HP-PC-LAN+";
167 int mem_start; 167 int mem_start;
168 static unsigned version_printed; 168 static unsigned version_printed;
169 DECLARE_MAC_BUF(mac);
170 169
171 if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME)) 170 if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME))
172 return -EBUSY; 171 return -EBUSY;
@@ -193,7 +192,7 @@ static int __init hpp_probe1(struct net_device *dev, int ioaddr)
193 } 192 }
194 checksum += inb(ioaddr + 14); 193 checksum += inb(ioaddr + 14);
195 194
196 printk("%s", print_mac(mac, dev->dev_addr)); 195 printk("%pM", dev->dev_addr);
197 196
198 if (checksum != 0xff) { 197 if (checksum != 0xff) {
199 printk(" bad checksum %2.2x.\n", checksum); 198 printk(" bad checksum %2.2x.\n", checksum);
diff --git a/drivers/net/hp.c b/drivers/net/hp.c
index 0a8c64930ad3..3669194f1063 100644
--- a/drivers/net/hp.c
+++ b/drivers/net/hp.c
@@ -127,7 +127,6 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
127 int i, retval, board_id, wordmode; 127 int i, retval, board_id, wordmode;
128 const char *name; 128 const char *name;
129 static unsigned version_printed; 129 static unsigned version_printed;
130 DECLARE_MAC_BUF(mac);
131 130
132 if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME)) 131 if (!request_region(ioaddr, HP_IO_EXTENT, DRV_NAME))
133 return -EBUSY; 132 return -EBUSY;
@@ -161,7 +160,7 @@ static int __init hp_probe1(struct net_device *dev, int ioaddr)
161 for(i = 0; i < ETHER_ADDR_LEN; i++) 160 for(i = 0; i < ETHER_ADDR_LEN; i++)
162 dev->dev_addr[i] = inb(ioaddr + i); 161 dev->dev_addr[i] = inb(ioaddr + i);
163 162
164 printk(" %s", print_mac(mac, dev->dev_addr)); 163 printk(" %pM", dev->dev_addr);
165 164
166 /* Snarf the interrupt now. Someday this could be moved to open(). */ 165 /* Snarf the interrupt now. Someday this could be moved to open(). */
167 if (dev->irq < 2) { 166 if (dev->irq < 2) {
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index 571dd80fb850..fd34452c05b1 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -2093,9 +2093,8 @@ static void hp100_set_multicast_list(struct net_device *dev)
2093 addrs = dmi->dmi_addr; 2093 addrs = dmi->dmi_addr;
2094 if ((*addrs & 0x01) == 0x01) { /* multicast address? */ 2094 if ((*addrs & 0x01) == 0x01) { /* multicast address? */
2095#ifdef HP100_DEBUG 2095#ifdef HP100_DEBUG
2096 DECLARE_MAC_BUF(mac); 2096 printk("hp100: %s: multicast = %pM, ",
2097 printk("hp100: %s: multicast = %s, ", 2097 dev->name, addrs);
2098 dev->name, print_mac(mac, addrs));
2099#endif 2098#endif
2100 for (j = idx = 0; j < 6; j++) { 2099 for (j = idx = 0; j < 6; j++) {
2101 idx ^= *addrs++ & 0x3f; 2100 idx ^= *addrs++ & 0x3f;
diff --git a/drivers/net/hydra.c b/drivers/net/hydra.c
index b96cf2dcb109..b0ae0766ea4e 100644
--- a/drivers/net/hydra.c
+++ b/drivers/net/hydra.c
@@ -103,7 +103,6 @@ static int __devinit hydra_init(struct zorro_dev *z)
103 int start_page, stop_page; 103 int start_page, stop_page;
104 int j; 104 int j;
105 int err; 105 int err;
106 DECLARE_MAC_BUF(mac);
107 106
108 static u32 hydra_offsets[16] = { 107 static u32 hydra_offsets[16] = {
109 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 108 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e,
@@ -163,8 +162,8 @@ static int __devinit hydra_init(struct zorro_dev *z)
163 zorro_set_drvdata(z, dev); 162 zorro_set_drvdata(z, dev);
164 163
165 printk(KERN_INFO "%s: Hydra at 0x%08lx, address " 164 printk(KERN_INFO "%s: Hydra at 0x%08lx, address "
166 "%s (hydra.c " HYDRA_VERSION ")\n", 165 "%pM (hydra.c " HYDRA_VERSION ")\n",
167 dev->name, z->resource.start, print_mac(mac, dev->dev_addr)); 166 dev->name, z->resource.start, dev->dev_addr);
168 167
169 return 0; 168 return 0;
170} 169}
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c
index 901212aa37cb..87a706694fb3 100644
--- a/drivers/net/ibm_newemac/core.c
+++ b/drivers/net/ibm_newemac/core.c
@@ -396,9 +396,7 @@ static void emac_hash_mc(struct emac_instance *dev)
396 396
397 for (dmi = dev->ndev->mc_list; dmi; dmi = dmi->next) { 397 for (dmi = dev->ndev->mc_list; dmi; dmi = dmi->next) {
398 int slot, reg, mask; 398 int slot, reg, mask;
399 DBG2(dev, "mc %02x:%02x:%02x:%02x:%02x:%02x" NL, 399 DBG2(dev, "mc %pM" NL, dmi->dmi_addr);
400 dmi->dmi_addr[0], dmi->dmi_addr[1], dmi->dmi_addr[2],
401 dmi->dmi_addr[3], dmi->dmi_addr[4], dmi->dmi_addr[5]);
402 400
403 slot = EMAC_XAHT_CRC_TO_SLOT(dev, ether_crc(ETH_ALEN, dmi->dmi_addr)); 401 slot = EMAC_XAHT_CRC_TO_SLOT(dev, ether_crc(ETH_ALEN, dmi->dmi_addr));
404 reg = EMAC_XAHT_SLOT_TO_REG(dev, slot); 402 reg = EMAC_XAHT_SLOT_TO_REG(dev, slot);
@@ -2865,11 +2863,8 @@ static int __devinit emac_probe(struct of_device *ofdev,
2865 wake_up_all(&emac_probe_wait); 2863 wake_up_all(&emac_probe_wait);
2866 2864
2867 2865
2868 printk(KERN_INFO 2866 printk(KERN_INFO "%s: EMAC-%d %s, MAC %pM\n",
2869 "%s: EMAC-%d %s, MAC %02x:%02x:%02x:%02x:%02x:%02x\n", 2867 ndev->name, dev->cell_index, np->full_name, ndev->dev_addr);
2870 ndev->name, dev->cell_index, np->full_name,
2871 ndev->dev_addr[0], ndev->dev_addr[1], ndev->dev_addr[2],
2872 ndev->dev_addr[3], ndev->dev_addr[4], ndev->dev_addr[5]);
2873 2868
2874 if (dev->phy_mode == PHY_MODE_SGMII) 2869 if (dev->phy_mode == PHY_MODE_SGMII)
2875 printk(KERN_NOTICE "%s: in SGMII mode\n", ndev->name); 2870 printk(KERN_NOTICE "%s: in SGMII mode\n", ndev->name);
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c
index f02764725a22..0fad08c4ccd2 100644
--- a/drivers/net/ibmlana.c
+++ b/drivers/net/ibmlana.c
@@ -914,7 +914,6 @@ static int __devinit ibmlana_init_one(struct device *kdev)
914 int base = 0, irq = 0, iobase = 0, memlen = 0; 914 int base = 0, irq = 0, iobase = 0, memlen = 0;
915 ibmlana_priv *priv; 915 ibmlana_priv *priv;
916 ibmlana_medium medium; 916 ibmlana_medium medium;
917 DECLARE_MAC_BUF(mac);
918 917
919 dev = alloc_etherdev(sizeof(ibmlana_priv)); 918 dev = alloc_etherdev(sizeof(ibmlana_priv));
920 if (!dev) 919 if (!dev)
@@ -990,10 +989,10 @@ static int __devinit ibmlana_init_one(struct device *kdev)
990 /* print config */ 989 /* print config */
991 990
992 printk(KERN_INFO "%s: IRQ %d, I/O %#lx, memory %#lx-%#lx, " 991 printk(KERN_INFO "%s: IRQ %d, I/O %#lx, memory %#lx-%#lx, "
993 "MAC address %s.\n", 992 "MAC address %pM.\n",
994 dev->name, priv->realirq, dev->base_addr, 993 dev->name, priv->realirq, dev->base_addr,
995 dev->mem_start, dev->mem_end - 1, 994 dev->mem_start, dev->mem_end - 1,
996 print_mac(mac, dev->dev_addr)); 995 dev->dev_addr);
997 printk(KERN_INFO "%s: %s medium\n", dev->name, MediaNames[priv->medium]); 996 printk(KERN_INFO "%s: %s medium\n", dev->name, MediaNames[priv->medium]);
998 997
999 /* reset board */ 998 /* reset board */
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index c2d57f836088..9dc49588cba8 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -1371,13 +1371,12 @@ static int ibmveth_show(struct seq_file *seq, void *v)
1371 struct ibmveth_adapter *adapter = seq->private; 1371 struct ibmveth_adapter *adapter = seq->private;
1372 char *current_mac = ((char*) &adapter->netdev->dev_addr); 1372 char *current_mac = ((char*) &adapter->netdev->dev_addr);
1373 char *firmware_mac = ((char*) &adapter->mac_addr) ; 1373 char *firmware_mac = ((char*) &adapter->mac_addr) ;
1374 DECLARE_MAC_BUF(mac);
1375 1374
1376 seq_printf(seq, "%s %s\n\n", ibmveth_driver_string, ibmveth_driver_version); 1375 seq_printf(seq, "%s %s\n\n", ibmveth_driver_string, ibmveth_driver_version);
1377 1376
1378 seq_printf(seq, "Unit Address: 0x%x\n", adapter->vdev->unit_address); 1377 seq_printf(seq, "Unit Address: 0x%x\n", adapter->vdev->unit_address);
1379 seq_printf(seq, "Current MAC: %s\n", print_mac(mac, current_mac)); 1378 seq_printf(seq, "Current MAC: %pM\n", current_mac);
1380 seq_printf(seq, "Firmware MAC: %s\n", print_mac(mac, firmware_mac)); 1379 seq_printf(seq, "Firmware MAC: %pM\n", firmware_mac);
1381 1380
1382 seq_printf(seq, "\nAdapter Statistics:\n"); 1381 seq_printf(seq, "\nAdapter Statistics:\n");
1383 seq_printf(seq, " TX: vio_map_single failres: %ld\n", adapter->tx_map_failed); 1382 seq_printf(seq, " TX: vio_map_single failres: %ld\n", adapter->tx_map_failed);
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 1f397cd99414..3b42665ef1d4 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1275,16 +1275,14 @@ static int __devinit igb_probe(struct pci_dev *pdev,
1275 1275
1276 dev_info(&pdev->dev, "Intel(R) Gigabit Ethernet Network Connection\n"); 1276 dev_info(&pdev->dev, "Intel(R) Gigabit Ethernet Network Connection\n");
1277 /* print bus type/speed/width info */ 1277 /* print bus type/speed/width info */
1278 dev_info(&pdev->dev, 1278 dev_info(&pdev->dev, "%s: (PCIe:%s:%s) %pM\n",
1279 "%s: (PCIe:%s:%s) %02x:%02x:%02x:%02x:%02x:%02x\n",
1280 netdev->name, 1279 netdev->name,
1281 ((hw->bus.speed == e1000_bus_speed_2500) 1280 ((hw->bus.speed == e1000_bus_speed_2500)
1282 ? "2.5Gb/s" : "unknown"), 1281 ? "2.5Gb/s" : "unknown"),
1283 ((hw->bus.width == e1000_bus_width_pcie_x4) 1282 ((hw->bus.width == e1000_bus_width_pcie_x4)
1284 ? "Width x4" : (hw->bus.width == e1000_bus_width_pcie_x1) 1283 ? "Width x4" : (hw->bus.width == e1000_bus_width_pcie_x1)
1285 ? "Width x1" : "unknown"), 1284 ? "Width x1" : "unknown"),
1286 netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2], 1285 netdev->dev_addr);
1287 netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
1288 1286
1289 igb_read_part_num(hw, &part_num); 1287 igb_read_part_num(hw, &part_num);
1290 dev_info(&pdev->dev, "%s: PBA No: %06x-%03x\n", netdev->name, 1288 dev_info(&pdev->dev, "%s: PBA No: %06x-%03x\n", netdev->name,
diff --git a/drivers/net/ioc3-eth.c b/drivers/net/ioc3-eth.c
index 1f25263dc7eb..afac65e46773 100644
--- a/drivers/net/ioc3-eth.c
+++ b/drivers/net/ioc3-eth.c
@@ -390,11 +390,8 @@ static int nic_init(struct ioc3 *ioc3)
390 } 390 }
391 391
392 printk("Found %s NIC", type); 392 printk("Found %s NIC", type);
393 if (type != unknown) { 393 if (type != unknown)
394 printk (" registration number %02x:%02x:%02x:%02x:%02x:%02x," 394 printk (" registration number %pM, CRC %02x", serial, crc);
395 " CRC %02x", serial[0], serial[1], serial[2],
396 serial[3], serial[4], serial[5], crc);
397 }
398 printk(".\n"); 395 printk(".\n");
399 396
400 return 0; 397 return 0;
@@ -443,12 +440,9 @@ static void ioc3_get_eaddr_nic(struct ioc3_private *ip)
443 */ 440 */
444static void ioc3_get_eaddr(struct ioc3_private *ip) 441static void ioc3_get_eaddr(struct ioc3_private *ip)
445{ 442{
446 DECLARE_MAC_BUF(mac);
447
448 ioc3_get_eaddr_nic(ip); 443 ioc3_get_eaddr_nic(ip);
449 444
450 printk("Ethernet address is %s.\n", 445 printk("Ethernet address is %pM.\n", priv_netdev(ip)->dev_addr);
451 print_mac(mac, priv_netdev(ip)->dev_addr));
452} 446}
453 447
454static void __ioc3_set_mac_address(struct net_device *dev) 448static void __ioc3_set_mac_address(struct net_device *dev)
diff --git a/drivers/net/isa-skeleton.c b/drivers/net/isa-skeleton.c
index d6ff26af37b3..1c8d72b01247 100644
--- a/drivers/net/isa-skeleton.c
+++ b/drivers/net/isa-skeleton.c
@@ -192,7 +192,6 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr)
192 static unsigned version_printed; 192 static unsigned version_printed;
193 int i; 193 int i;
194 int err = -ENODEV; 194 int err = -ENODEV;
195 DECLARE_MAC_BUF(mac);
196 195
197 /* Grab the region so that no one else tries to probe our ioports. */ 196 /* Grab the region so that no one else tries to probe our ioports. */
198 if (!request_region(ioaddr, NETCARD_IO_EXTENT, cardname)) 197 if (!request_region(ioaddr, NETCARD_IO_EXTENT, cardname))
@@ -220,7 +219,7 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr)
220 for (i = 0; i < 6; i++) 219 for (i = 0; i < 6; i++)
221 dev->dev_addr[i] = inb(ioaddr + i); 220 dev->dev_addr[i] = inb(ioaddr + i);
222 221
223 printk("%s", print_mac(mac, dev->dev_addr)); 222 printk("%pM", dev->dev_addr);
224 223
225 err = -EAGAIN; 224 err = -EAGAIN;
226#ifdef jumpered_interrupts 225#ifdef jumpered_interrupts
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index be3c7dc96f63..21995dff1fa4 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -381,8 +381,7 @@ ixgb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
381 adapter->hw.back = adapter; 381 adapter->hw.back = adapter;
382 adapter->msg_enable = netif_msg_init(debug, DEFAULT_DEBUG_LEVEL_SHIFT); 382 adapter->msg_enable = netif_msg_init(debug, DEFAULT_DEBUG_LEVEL_SHIFT);
383 383
384 adapter->hw.hw_addr = ioremap(pci_resource_start(pdev, BAR_0), 384 adapter->hw.hw_addr = pci_ioremap_bar(pdev, BAR_0);
385 pci_resource_len(pdev, BAR_0));
386 if (!adapter->hw.hw_addr) { 385 if (!adapter->hw.hw_addr) {
387 err = -EIO; 386 err = -EIO;
388 goto err_ioremap; 387 goto err_ioremap;
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 7548fb7360d9..028bfb20412c 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3877,8 +3877,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
3877 pci_read_config_word(pdev, IXGBE_PCI_LINK_STATUS, &link_status); 3877 pci_read_config_word(pdev, IXGBE_PCI_LINK_STATUS, &link_status);
3878 link_speed = link_status & IXGBE_PCI_LINK_SPEED; 3878 link_speed = link_status & IXGBE_PCI_LINK_SPEED;
3879 link_width = link_status & IXGBE_PCI_LINK_WIDTH; 3879 link_width = link_status & IXGBE_PCI_LINK_WIDTH;
3880 dev_info(&pdev->dev, "(PCI Express:%s:%s) " 3880 dev_info(&pdev->dev, "(PCI Express:%s:%s) %pM\n",
3881 "%02x:%02x:%02x:%02x:%02x:%02x\n",
3882 ((link_speed == IXGBE_PCI_LINK_SPEED_5000) ? "5.0Gb/s" : 3881 ((link_speed == IXGBE_PCI_LINK_SPEED_5000) ? "5.0Gb/s" :
3883 (link_speed == IXGBE_PCI_LINK_SPEED_2500) ? "2.5Gb/s" : 3882 (link_speed == IXGBE_PCI_LINK_SPEED_2500) ? "2.5Gb/s" :
3884 "Unknown"), 3883 "Unknown"),
@@ -3887,8 +3886,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
3887 (link_width == IXGBE_PCI_LINK_WIDTH_2) ? "Width x2" : 3886 (link_width == IXGBE_PCI_LINK_WIDTH_2) ? "Width x2" :
3888 (link_width == IXGBE_PCI_LINK_WIDTH_1) ? "Width x1" : 3887 (link_width == IXGBE_PCI_LINK_WIDTH_1) ? "Width x1" :
3889 "Unknown"), 3888 "Unknown"),
3890 netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2], 3889 netdev->dev_addr);
3891 netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
3892 ixgbe_read_pba_num_generic(hw, &part_num); 3890 ixgbe_read_pba_num_generic(hw, &part_num);
3893 dev_info(&pdev->dev, "MAC: %d, PHY: %d, PBA No: %06x-%03x\n", 3891 dev_info(&pdev->dev, "MAC: %d, PHY: %d, PBA No: %06x-%03x\n",
3894 hw->mac.type, hw->phy.type, 3892 hw->mac.type, hw->phy.type,
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c
index 07944820f745..334ff9e12cdd 100644
--- a/drivers/net/jazzsonic.c
+++ b/drivers/net/jazzsonic.c
@@ -208,7 +208,6 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
208 struct sonic_local *lp; 208 struct sonic_local *lp;
209 struct resource *res; 209 struct resource *res;
210 int err = 0; 210 int err = 0;
211 DECLARE_MAC_BUF(mac);
212 211
213 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 212 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
214 if (!res) 213 if (!res)
@@ -233,8 +232,7 @@ static int __init jazz_sonic_probe(struct platform_device *pdev)
233 if (err) 232 if (err)
234 goto out1; 233 goto out1;
235 234
236 printk("%s: MAC %s IRQ %d\n", 235 printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);
237 dev->name, print_mac(mac, dev->dev_addr), dev->irq);
238 236
239 return 0; 237 return 0;
240 238
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 81c6cdc3851f..a10c68700e0e 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -2862,18 +2862,10 @@ jme_init_one(struct pci_dev *pdev,
2862 goto err_out_free_shadow; 2862 goto err_out_free_shadow;
2863 } 2863 }
2864 2864
2865 msg_probe(jme, 2865 msg_probe(jme, "JMC250 gigabit%s ver:%x rev:%x macaddr:%pM\n",
2866 "JMC250 gigabit%s ver:%x rev:%x "
2867 "macaddr:%02x:%02x:%02x:%02x:%02x:%02x\n",
2868 (jme->fpgaver != 0) ? " (FPGA)" : "", 2866 (jme->fpgaver != 0) ? " (FPGA)" : "",
2869 (jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev, 2867 (jme->fpgaver != 0) ? jme->fpgaver : jme->chiprev,
2870 jme->rev, 2868 jme->rev, netdev->dev_addr);
2871 netdev->dev_addr[0],
2872 netdev->dev_addr[1],
2873 netdev->dev_addr[2],
2874 netdev->dev_addr[3],
2875 netdev->dev_addr[4],
2876 netdev->dev_addr[5]);
2877 2869
2878 return 0; 2870 return 0;
2879 2871
diff --git a/drivers/net/lance.c b/drivers/net/lance.c
index 977ed3401bb3..4ab536de24a8 100644
--- a/drivers/net/lance.c
+++ b/drivers/net/lance.c
@@ -466,7 +466,6 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
466 unsigned long flags; 466 unsigned long flags;
467 int err = -ENOMEM; 467 int err = -ENOMEM;
468 void __iomem *bios; 468 void __iomem *bios;
469 DECLARE_MAC_BUF(mac);
470 469
471 /* First we look for special cases. 470 /* First we look for special cases.
472 Check for HP's on-board ethernet by looking for 'HP' in the BIOS. 471 Check for HP's on-board ethernet by looking for 'HP' in the BIOS.
@@ -529,7 +528,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
529 The first six bytes are the station address. */ 528 The first six bytes are the station address. */
530 for (i = 0; i < 6; i++) 529 for (i = 0; i < 6; i++)
531 dev->dev_addr[i] = inb(ioaddr + i); 530 dev->dev_addr[i] = inb(ioaddr + i);
532 printk("%s", print_mac(mac, dev->dev_addr)); 531 printk("%pM", dev->dev_addr);
533 532
534 dev->base_addr = ioaddr; 533 dev->base_addr = ioaddr;
535 /* Make certain the data structures used by the LANCE are aligned and DMAble. */ 534 /* Make certain the data structures used by the LANCE are aligned and DMAble. */
diff --git a/drivers/net/lib82596.c b/drivers/net/lib82596.c
index b59f442bbf36..cc8f64197a90 100644
--- a/drivers/net/lib82596.c
+++ b/drivers/net/lib82596.c
@@ -1034,12 +1034,8 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
1034 1034
1035static void print_eth(unsigned char *add, char *str) 1035static void print_eth(unsigned char *add, char *str)
1036{ 1036{
1037 DECLARE_MAC_BUF(mac); 1037 printk(KERN_DEBUG "i596 0x%p, %pM --> %pM %02X%02X, %s\n",
1038 DECLARE_MAC_BUF(mac2); 1038 add, add + 6, add, add[12], add[13], str);
1039
1040 printk(KERN_DEBUG "i596 0x%p, %s --> %s %02X%02X, %s\n",
1041 add, print_mac(mac, add + 6), print_mac(mac2, add),
1042 add[12], add[13], str);
1043} 1039}
1044 1040
1045static int __devinit i82596_probe(struct net_device *dev) 1041static int __devinit i82596_probe(struct net_device *dev)
@@ -1343,7 +1339,6 @@ static void set_multicast_list(struct net_device *dev)
1343 struct i596_private *lp = netdev_priv(dev); 1339 struct i596_private *lp = netdev_priv(dev);
1344 struct i596_dma *dma = lp->dma; 1340 struct i596_dma *dma = lp->dma;
1345 int config = 0, cnt; 1341 int config = 0, cnt;
1346 DECLARE_MAC_BUF(mac);
1347 1342
1348 DEB(DEB_MULTI, 1343 DEB(DEB_MULTI,
1349 printk(KERN_DEBUG 1344 printk(KERN_DEBUG
@@ -1407,8 +1402,8 @@ static void set_multicast_list(struct net_device *dev)
1407 if (i596_debug > 1) 1402 if (i596_debug > 1)
1408 DEB(DEB_MULTI, 1403 DEB(DEB_MULTI,
1409 printk(KERN_DEBUG 1404 printk(KERN_DEBUG
1410 "%s: Adding address %s\n", 1405 "%s: Adding address %pM\n",
1411 dev->name, print_mac(mac, cp))); 1406 dev->name, cp));
1412 } 1407 }
1413 DMA_WBACK_INV(dev, &dma->mc_cmd, sizeof(struct mc_cmd)); 1408 DMA_WBACK_INV(dev, &dma->mc_cmd, sizeof(struct mc_cmd));
1414 i596_add_cmd(dev, &cmd->cmd); 1409 i596_add_cmd(dev, &cmd->cmd);
diff --git a/drivers/net/lne390.c b/drivers/net/lne390.c
index b36989097883..bc70d5e79ab1 100644
--- a/drivers/net/lne390.c
+++ b/drivers/net/lne390.c
@@ -169,7 +169,6 @@ static int __init lne390_probe1(struct net_device *dev, int ioaddr)
169{ 169{
170 int i, revision, ret; 170 int i, revision, ret;
171 unsigned long eisa_id; 171 unsigned long eisa_id;
172 DECLARE_MAC_BUF(mac);
173 172
174 if (inb_p(ioaddr + LNE390_ID_PORT) == 0xff) return -ENODEV; 173 if (inb_p(ioaddr + LNE390_ID_PORT) == 0xff) return -ENODEV;
175 174
@@ -203,8 +202,8 @@ static int __init lne390_probe1(struct net_device *dev, int ioaddr)
203 202
204 for(i = 0; i < ETHER_ADDR_LEN; i++) 203 for(i = 0; i < ETHER_ADDR_LEN; i++)
205 dev->dev_addr[i] = inb(ioaddr + LNE390_SA_PROM + i); 204 dev->dev_addr[i] = inb(ioaddr + LNE390_SA_PROM + i);
206 printk("lne390.c: LNE390%X in EISA slot %d, address %s.\n", 205 printk("lne390.c: LNE390%X in EISA slot %d, address %pM.\n",
207 0xa+revision, ioaddr/0x1000, print_mac(mac, dev->dev_addr)); 206 0xa+revision, ioaddr/0x1000, dev->dev_addr);
208 207
209 printk("lne390.c: "); 208 printk("lne390.c: ");
210 209
diff --git a/drivers/net/mac89x0.c b/drivers/net/mac89x0.c
index 4ce8afd481c3..ca9c5a858679 100644
--- a/drivers/net/mac89x0.c
+++ b/drivers/net/mac89x0.c
@@ -181,7 +181,6 @@ struct net_device * __init mac89x0_probe(int unit)
181 unsigned long ioaddr; 181 unsigned long ioaddr;
182 unsigned short sig; 182 unsigned short sig;
183 int err = -ENODEV; 183 int err = -ENODEV;
184 DECLARE_MAC_BUF(mac);
185 184
186 if (!MACH_IS_MAC) 185 if (!MACH_IS_MAC)
187 return ERR_PTR(-ENODEV); 186 return ERR_PTR(-ENODEV);
@@ -279,8 +278,7 @@ struct net_device * __init mac89x0_probe(int unit)
279 278
280 /* print the IRQ and ethernet address. */ 279 /* print the IRQ and ethernet address. */
281 280
282 printk(" IRQ %d ADDR %s\n", 281 printk(" IRQ %d ADDR %pM\n", dev->irq, dev->dev_addr);
283 dev->irq, print_mac(mac, dev->dev_addr));
284 282
285 dev->open = net_open; 283 dev->open = net_open;
286 dev->stop = net_close; 284 dev->stop = net_close;
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 01f7a31bac76..e00c896d0c9b 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1104,7 +1104,6 @@ static int __init macb_probe(struct platform_device *pdev)
1104 unsigned long pclk_hz; 1104 unsigned long pclk_hz;
1105 u32 config; 1105 u32 config;
1106 int err = -ENXIO; 1106 int err = -ENXIO;
1107 DECLARE_MAC_BUF(mac);
1108 1107
1109 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1108 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1110 if (!regs) { 1109 if (!regs) {
@@ -1223,10 +1222,8 @@ static int __init macb_probe(struct platform_device *pdev)
1223 1222
1224 platform_set_drvdata(pdev, dev); 1223 platform_set_drvdata(pdev, dev);
1225 1224
1226 printk(KERN_INFO "%s: Atmel MACB at 0x%08lx irq %d " 1225 printk(KERN_INFO "%s: Atmel MACB at 0x%08lx irq %d (%pM)\n",
1227 "(%s)\n", 1226 dev->name, dev->base_addr, dev->irq, dev->dev_addr);
1228 dev->name, dev->base_addr, dev->irq,
1229 print_mac(mac, dev->dev_addr));
1230 1227
1231 phydev = bp->phy_dev; 1228 phydev = bp->phy_dev;
1232 printk(KERN_INFO "%s: attached PHY driver [%s] " 1229 printk(KERN_INFO "%s: attached PHY driver [%s] "
diff --git a/drivers/net/mace.c b/drivers/net/mace.c
index 451acdca2a21..a2021c0103b3 100644
--- a/drivers/net/mace.c
+++ b/drivers/net/mace.c
@@ -101,7 +101,6 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
101 struct mace_data *mp; 101 struct mace_data *mp;
102 const unsigned char *addr; 102 const unsigned char *addr;
103 int j, rev, rc = -EBUSY; 103 int j, rev, rc = -EBUSY;
104 DECLARE_MAC_BUF(mac);
105 104
106 if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) { 105 if (macio_resource_count(mdev) != 3 || macio_irq_count(mdev) != 3) {
107 printk(KERN_ERR "can't use MACE %s: need 3 addrs and 3 irqs\n", 106 printk(KERN_ERR "can't use MACE %s: need 3 addrs and 3 irqs\n",
@@ -241,8 +240,8 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
241 goto err_free_rx_irq; 240 goto err_free_rx_irq;
242 } 241 }
243 242
244 printk(KERN_INFO "%s: MACE at %s, chip revision %d.%d\n", 243 printk(KERN_INFO "%s: MACE at %pM, chip revision %d.%d\n",
245 dev->name, print_mac(mac, dev->dev_addr), 244 dev->name, dev->dev_addr,
246 mp->chipid >> 8, mp->chipid & 0xff); 245 mp->chipid >> 8, mp->chipid & 0xff);
247 246
248 return 0; 247 return 0;
diff --git a/drivers/net/macmace.c b/drivers/net/macmace.c
index 85587a6667b9..0b28318789a3 100644
--- a/drivers/net/macmace.c
+++ b/drivers/net/macmace.c
@@ -194,7 +194,6 @@ static int __devinit mace_probe(struct platform_device *pdev)
194 unsigned char checksum = 0; 194 unsigned char checksum = 0;
195 static int found = 0; 195 static int found = 0;
196 int err; 196 int err;
197 DECLARE_MAC_BUF(mac);
198 197
199 if (found || macintosh_config->ether_type != MAC_ETHER_MACE) 198 if (found || macintosh_config->ether_type != MAC_ETHER_MACE)
200 return -ENODEV; 199 return -ENODEV;
@@ -249,8 +248,8 @@ static int __devinit mace_probe(struct platform_device *pdev)
249 dev->set_multicast_list = mace_set_multicast; 248 dev->set_multicast_list = mace_set_multicast;
250 dev->set_mac_address = mace_set_address; 249 dev->set_mac_address = mace_set_address;
251 250
252 printk(KERN_INFO "%s: 68K MACE, hardware address %s\n", 251 printk(KERN_INFO "%s: 68K MACE, hardware address %pM\n",
253 dev->name, print_mac(mac, dev->dev_addr)); 252 dev->name, dev->dev_addr);
254 253
255 err = register_netdev(dev); 254 err = register_netdev(dev);
256 if (!err) 255 if (!err)
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index e64c2086d33c..205bb05c25d6 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -220,7 +220,6 @@ static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
220 struct sonic_local *lp = netdev_priv(dev); 220 struct sonic_local *lp = netdev_priv(dev);
221 const int prom_addr = ONBOARD_SONIC_PROM_BASE; 221 const int prom_addr = ONBOARD_SONIC_PROM_BASE;
222 int i; 222 int i;
223 DECLARE_MAC_BUF(mac);
224 223
225 /* On NuBus boards we can sometimes look in the ROM resources. 224 /* On NuBus boards we can sometimes look in the ROM resources.
226 No such luck for comm-slot/onboard. */ 225 No such luck for comm-slot/onboard. */
@@ -264,8 +263,8 @@ static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
264 dev->dev_addr[1] = val >> 8; 263 dev->dev_addr[1] = val >> 8;
265 dev->dev_addr[0] = val & 0xff; 264 dev->dev_addr[0] = val & 0xff;
266 265
267 printk(KERN_INFO "HW Address from CAM 15: %s\n", 266 printk(KERN_INFO "HW Address from CAM 15: %pM\n",
268 print_mac(mac, dev->dev_addr)); 267 dev->dev_addr);
269 } else return 0; 268 } else return 0;
270 269
271 if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) && 270 if (memcmp(dev->dev_addr, "\x08\x00\x07", 3) &&
@@ -560,7 +559,6 @@ static int __init mac_sonic_probe(struct platform_device *pdev)
560 struct net_device *dev; 559 struct net_device *dev;
561 struct sonic_local *lp; 560 struct sonic_local *lp;
562 int err; 561 int err;
563 DECLARE_MAC_BUF(mac);
564 562
565 dev = alloc_etherdev(sizeof(struct sonic_local)); 563 dev = alloc_etherdev(sizeof(struct sonic_local));
566 if (!dev) 564 if (!dev)
@@ -584,8 +582,7 @@ found:
584 if (err) 582 if (err)
585 goto out; 583 goto out;
586 584
587 printk("%s: MAC %s IRQ %d\n", 585 printk("%s: MAC %pM IRQ %d\n", dev->name, dev->dev_addr, dev->irq);
588 dev->name, print_mac(mac, dev->dev_addr), dev->irq);
589 586
590 return 0; 587 return 0;
591 588
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 42394505bb50..1d2de0b77a2c 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -333,10 +333,34 @@ static u32 macvlan_ethtool_get_rx_csum(struct net_device *dev)
333 return lowerdev->ethtool_ops->get_rx_csum(lowerdev); 333 return lowerdev->ethtool_ops->get_rx_csum(lowerdev);
334} 334}
335 335
336static int macvlan_ethtool_get_settings(struct net_device *dev,
337 struct ethtool_cmd *cmd)
338{
339 const struct macvlan_dev *vlan = netdev_priv(dev);
340 struct net_device *lowerdev = vlan->lowerdev;
341
342 if (!lowerdev->ethtool_ops->get_settings)
343 return -EOPNOTSUPP;
344
345 return lowerdev->ethtool_ops->get_settings(lowerdev, cmd);
346}
347
348static u32 macvlan_ethtool_get_flags(struct net_device *dev)
349{
350 const struct macvlan_dev *vlan = netdev_priv(dev);
351 struct net_device *lowerdev = vlan->lowerdev;
352
353 if (!lowerdev->ethtool_ops->get_flags)
354 return 0;
355 return lowerdev->ethtool_ops->get_flags(lowerdev);
356}
357
336static const struct ethtool_ops macvlan_ethtool_ops = { 358static const struct ethtool_ops macvlan_ethtool_ops = {
337 .get_link = ethtool_op_get_link, 359 .get_link = ethtool_op_get_link,
360 .get_settings = macvlan_ethtool_get_settings,
338 .get_rx_csum = macvlan_ethtool_get_rx_csum, 361 .get_rx_csum = macvlan_ethtool_get_rx_csum,
339 .get_drvinfo = macvlan_ethtool_get_drvinfo, 362 .get_drvinfo = macvlan_ethtool_get_drvinfo,
363 .get_flags = macvlan_ethtool_get_flags,
340}; 364};
341 365
342static void macvlan_setup(struct net_device *dev) 366static void macvlan_setup(struct net_device *dev)
diff --git a/drivers/net/meth.c b/drivers/net/meth.c
index a1e22ed1f6ee..621133b45f8f 100644
--- a/drivers/net/meth.c
+++ b/drivers/net/meth.c
@@ -94,10 +94,9 @@ char o2meth_eaddr[8]={0,0,0,0,0,0,0,0};
94static inline void load_eaddr(struct net_device *dev) 94static inline void load_eaddr(struct net_device *dev)
95{ 95{
96 int i; 96 int i;
97 DECLARE_MAC_BUF(mac);
98 u64 macaddr; 97 u64 macaddr;
99 98
100 DPRINTK("Loading MAC Address: %s\n", print_mac(mac, dev->dev_addr)); 99 DPRINTK("Loading MAC Address: %pM\n", dev->dev_addr);
101 macaddr = 0; 100 macaddr = 0;
102 for (i = 0; i < 6; i++) 101 for (i = 0; i < 6; i++)
103 macaddr |= (u64)dev->dev_addr[i] << ((5 - i) * 8); 102 macaddr |= (u64)dev->dev_addr[i] << ((5 - i) * 8);
diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c
index 592c01ae2c5d..b1622062b12d 100644
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -118,17 +118,7 @@ static int find_mgm(struct mlx4_dev *dev,
118 return err; 118 return err;
119 119
120 if (0) 120 if (0)
121 mlx4_dbg(dev, "Hash for %04x:%04x:%04x:%04x:" 121 mlx4_dbg(dev, "Hash for %pI6 is %04x\n", gid, *hash);
122 "%04x:%04x:%04x:%04x is %04x\n",
123 be16_to_cpu(((__be16 *) gid)[0]),
124 be16_to_cpu(((__be16 *) gid)[1]),
125 be16_to_cpu(((__be16 *) gid)[2]),
126 be16_to_cpu(((__be16 *) gid)[3]),
127 be16_to_cpu(((__be16 *) gid)[4]),
128 be16_to_cpu(((__be16 *) gid)[5]),
129 be16_to_cpu(((__be16 *) gid)[6]),
130 be16_to_cpu(((__be16 *) gid)[7]),
131 *hash);
132 122
133 *index = *hash; 123 *index = *hash;
134 *prev = -1; 124 *prev = -1;
@@ -277,16 +267,7 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16])
277 goto out; 267 goto out;
278 268
279 if (index == -1) { 269 if (index == -1) {
280 mlx4_err(dev, "MGID %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x " 270 mlx4_err(dev, "MGID %pI6 not found\n", gid);
281 "not found\n",
282 be16_to_cpu(((__be16 *) gid)[0]),
283 be16_to_cpu(((__be16 *) gid)[1]),
284 be16_to_cpu(((__be16 *) gid)[2]),
285 be16_to_cpu(((__be16 *) gid)[3]),
286 be16_to_cpu(((__be16 *) gid)[4]),
287 be16_to_cpu(((__be16 *) gid)[5]),
288 be16_to_cpu(((__be16 *) gid)[6]),
289 be16_to_cpu(((__be16 *) gid)[7]));
290 err = -EINVAL; 271 err = -EINVAL;
291 goto out; 272 goto out;
292 } 273 }
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index a9c8c08044b1..3a759d0a7d1a 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -2589,7 +2589,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
2589 struct mv643xx_eth_private *mp; 2589 struct mv643xx_eth_private *mp;
2590 struct net_device *dev; 2590 struct net_device *dev;
2591 struct resource *res; 2591 struct resource *res;
2592 DECLARE_MAC_BUF(mac);
2593 int err; 2592 int err;
2594 2593
2595 pd = pdev->dev.platform_data; 2594 pd = pdev->dev.platform_data;
@@ -2683,8 +2682,8 @@ static int mv643xx_eth_probe(struct platform_device *pdev)
2683 if (err) 2682 if (err)
2684 goto out; 2683 goto out;
2685 2684
2686 dev_printk(KERN_NOTICE, &dev->dev, "port %d with MAC address %s\n", 2685 dev_printk(KERN_NOTICE, &dev->dev, "port %d with MAC address %pM\n",
2687 mp->port_num, print_mac(mac, dev->dev_addr)); 2686 mp->port_num, dev->dev_addr);
2688 2687
2689 if (mp->tx_desc_sram_size > 0) 2688 if (mp->tx_desc_sram_size > 0)
2690 dev_printk(KERN_NOTICE, &dev->dev, "configured with sram\n"); 2689 dev_printk(KERN_NOTICE, &dev->dev, "configured with sram\n");
diff --git a/drivers/net/mvme147.c b/drivers/net/mvme147.c
index 06ca4252155f..d30b0d0026ec 100644
--- a/drivers/net/mvme147.c
+++ b/drivers/net/mvme147.c
@@ -67,7 +67,6 @@ struct net_device * __init mvme147lance_probe(int unit)
67 u_long *addr; 67 u_long *addr;
68 u_long address; 68 u_long address;
69 int err; 69 int err;
70 DECLARE_MAC_BUF(mac);
71 70
72 if (!MACH_IS_MVME147 || called) 71 if (!MACH_IS_MVME147 || called)
73 return ERR_PTR(-ENODEV); 72 return ERR_PTR(-ENODEV);
@@ -102,9 +101,9 @@ struct net_device * __init mvme147lance_probe(int unit)
102 dev->dev_addr[3]=address&0xff; 101 dev->dev_addr[3]=address&0xff;
103 102
104 printk("%s: MVME147 at 0x%08lx, irq %d, " 103 printk("%s: MVME147 at 0x%08lx, irq %d, "
105 "Hardware Address %s\n", 104 "Hardware Address %pM\n",
106 dev->name, dev->base_addr, MVME147_LANCE_IRQ, 105 dev->name, dev->base_addr, MVME147_LANCE_IRQ,
107 print_mac(mac, dev->dev_addr)); 106 dev->dev_addr);
108 107
109 lp = (struct m147lance_private *)dev->priv; 108 lp = (struct m147lance_private *)dev->priv;
110 lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 16K */ 109 lp->ram = __get_dma_pages(GFP_ATOMIC, 3); /* 16K */
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index a5f428bcc0eb..d2cbc7d55b10 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -2983,7 +2983,6 @@ static void myri10ge_set_multicast_list(struct net_device *dev)
2983 struct dev_mc_list *mc_list; 2983 struct dev_mc_list *mc_list;
2984 __be32 data[2] = { 0, 0 }; 2984 __be32 data[2] = { 0, 0 };
2985 int err; 2985 int err;
2986 DECLARE_MAC_BUF(mac);
2987 2986
2988 /* can be called from atomic contexts, 2987 /* can be called from atomic contexts,
2989 * pass 1 to force atomicity in myri10ge_send_cmd() */ 2988 * pass 1 to force atomicity in myri10ge_send_cmd() */
@@ -3030,8 +3029,7 @@ static void myri10ge_set_multicast_list(struct net_device *dev)
3030 printk(KERN_ERR "myri10ge: %s: Failed " 3029 printk(KERN_ERR "myri10ge: %s: Failed "
3031 "MXGEFW_JOIN_MULTICAST_GROUP, error status:" 3030 "MXGEFW_JOIN_MULTICAST_GROUP, error status:"
3032 "%d\t", dev->name, err); 3031 "%d\t", dev->name, err);
3033 printk(KERN_ERR "MAC %s\n", 3032 printk(KERN_ERR "MAC %pM\n", mc_list->dmi_addr);
3034 print_mac(mac, mc_list->dmi_addr));
3035 goto abort; 3033 goto abort;
3036 } 3034 }
3037 } 3035 }
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
index 3ad7589d6a1c..1bbdde199220 100644
--- a/drivers/net/myri_sbus.c
+++ b/drivers/net/myri_sbus.c
@@ -318,13 +318,10 @@ static void myri_is_not_so_happy(struct myri_eth *mp)
318#ifdef DEBUG_HEADER 318#ifdef DEBUG_HEADER
319static void dump_ehdr(struct ethhdr *ehdr) 319static void dump_ehdr(struct ethhdr *ehdr)
320{ 320{
321 DECLARE_MAC_BUF(mac); 321 printk("ehdr[h_dst(%pM)"
322 DECLARE_MAC_BUF(mac2); 322 "h_source(%pM)"
323 printk("ehdr[h_dst(%s)"
324 "h_source(%s)"
325 "h_proto(%04x)]\n", 323 "h_proto(%04x)]\n",
326 print_mac(mac, ehdr->h_dest), print_mac(mac2, ehdr->h_source), 324 ehdr->h_dest, ehdr->h_source, ehdr->h_proto);
327 ehdr->h_proto);
328} 325}
329 326
330static void dump_ehdr_and_myripad(unsigned char *stuff) 327static void dump_ehdr_and_myripad(unsigned char *stuff)
@@ -905,7 +902,6 @@ static int __devinit myri_sbus_probe(struct of_device *op, const struct of_devic
905 struct device_node *dp = op->node; 902 struct device_node *dp = op->node;
906 static unsigned version_printed; 903 static unsigned version_printed;
907 struct net_device *dev; 904 struct net_device *dev;
908 DECLARE_MAC_BUF(mac);
909 struct myri_eth *mp; 905 struct myri_eth *mp;
910 const void *prop; 906 const void *prop;
911 static int num; 907 static int num;
@@ -1088,8 +1084,8 @@ static int __devinit myri_sbus_probe(struct of_device *op, const struct of_devic
1088 1084
1089 num++; 1085 num++;
1090 1086
1091 printk("%s: MyriCOM MyriNET Ethernet %s\n", 1087 printk("%s: MyriCOM MyriNET Ethernet %pM\n",
1092 dev->name, print_mac(mac, dev->dev_addr)); 1088 dev->name, dev->dev_addr);
1093 1089
1094 return 0; 1090 return 0;
1095 1091
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index f7fa3944659b..5f1de803feeb 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -792,7 +792,6 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
792 const int pcibar = 1; /* PCI base address register */ 792 const int pcibar = 1; /* PCI base address register */
793 int prev_eedata; 793 int prev_eedata;
794 u32 tmp; 794 u32 tmp;
795 DECLARE_MAC_BUF(mac);
796 795
797/* when built into the kernel, we only print version if device is found */ 796/* when built into the kernel, we only print version if device is found */
798#ifndef MODULE 797#ifndef MODULE
@@ -948,10 +947,10 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
948 947
949 if (netif_msg_drv(np)) { 948 if (netif_msg_drv(np)) {
950 printk(KERN_INFO "natsemi %s: %s at %#08llx " 949 printk(KERN_INFO "natsemi %s: %s at %#08llx "
951 "(%s), %s, IRQ %d", 950 "(%s), %pM, IRQ %d",
952 dev->name, natsemi_pci_info[chip_idx].name, 951 dev->name, natsemi_pci_info[chip_idx].name,
953 (unsigned long long)iostart, pci_name(np->pci_dev), 952 (unsigned long long)iostart, pci_name(np->pci_dev),
954 print_mac(mac, dev->dev_addr), irq); 953 dev->dev_addr, irq);
955 if (dev->if_port == PORT_TP) 954 if (dev->if_port == PORT_TP)
956 printk(", port TP.\n"); 955 printk(", port TP.\n");
957 else if (np->ignore_phy) 956 else if (np->ignore_phy)
diff --git a/drivers/net/ne-h8300.c b/drivers/net/ne-h8300.c
index fbc7531d3c7d..aa99f5e09d37 100644
--- a/drivers/net/ne-h8300.c
+++ b/drivers/net/ne-h8300.c
@@ -204,7 +204,6 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
204 static unsigned version_printed; 204 static unsigned version_printed;
205 struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev); 205 struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
206 unsigned char bus_width; 206 unsigned char bus_width;
207 DECLARE_MAC_BUF(mac);
208 207
209 if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME)) 208 if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
210 return -EBUSY; 209 return -EBUSY;
@@ -299,7 +298,7 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr)
299 298
300 for(i = 0; i < ETHER_ADDR_LEN; i++) 299 for(i = 0; i < ETHER_ADDR_LEN; i++)
301 dev->dev_addr[i] = SA_prom[i]; 300 dev->dev_addr[i] = SA_prom[i];
302 printk(" %s\n", print_mac(mac, dev->dev_addr)); 301 printk(" %pM\n", dev->dev_addr);
303 302
304 printk("%s: %s found at %#x, using IRQ %d.\n", 303 printk("%s: %s found at %#x, using IRQ %d.\n",
305 dev->name, name, ioaddr, dev->irq); 304 dev->name, name, ioaddr, dev->irq);
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index eb681c0d51ba..f708712a374a 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -297,7 +297,6 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
297 int neX000, ctron, copam, bad_card; 297 int neX000, ctron, copam, bad_card;
298 int reg0, ret; 298 int reg0, ret;
299 static unsigned version_printed; 299 static unsigned version_printed;
300 DECLARE_MAC_BUF(mac);
301 300
302 if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME)) 301 if (!request_region(ioaddr, NE_IO_EXTENT, DRV_NAME))
303 return -EBUSY; 302 return -EBUSY;
@@ -517,7 +516,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
517 } 516 }
518#endif 517#endif
519 518
520 printk("%s\n", print_mac(mac, dev->dev_addr)); 519 printk("%pM\n", dev->dev_addr);
521 520
522 ei_status.name = name; 521 ei_status.name = name;
523 ei_status.tx_start_page = start_page; 522 ei_status.tx_start_page = start_page;
diff --git a/drivers/net/ne2.c b/drivers/net/ne2.c
index 332df75a9ab6..6f8f32603466 100644
--- a/drivers/net/ne2.c
+++ b/drivers/net/ne2.c
@@ -302,7 +302,6 @@ out:
302static int ne2_procinfo(char *buf, int slot, struct net_device *dev) 302static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
303{ 303{
304 int len=0; 304 int len=0;
305 DECLARE_MAC_BUF(mac);
306 305
307 len += sprintf(buf+len, "The NE/2 Ethernet Adapter\n" ); 306 len += sprintf(buf+len, "The NE/2 Ethernet Adapter\n" );
308 len += sprintf(buf+len, "Driver written by Wim Dumon "); 307 len += sprintf(buf+len, "Driver written by Wim Dumon ");
@@ -313,7 +312,7 @@ static int ne2_procinfo(char *buf, int slot, struct net_device *dev)
313 len += sprintf(buf+len, "Based on the original NE2000 drivers\n" ); 312 len += sprintf(buf+len, "Based on the original NE2000 drivers\n" );
314 len += sprintf(buf+len, "Base IO: %#x\n", (unsigned int)dev->base_addr); 313 len += sprintf(buf+len, "Base IO: %#x\n", (unsigned int)dev->base_addr);
315 len += sprintf(buf+len, "IRQ : %d\n", dev->irq); 314 len += sprintf(buf+len, "IRQ : %d\n", dev->irq);
316 len += sprintf(buf+len, "HW addr : %s\n", print_mac(mac, dev->dev_addr)); 315 len += sprintf(buf+len, "HW addr : %pM\n", dev->dev_addr);
317 316
318 return len; 317 return len;
319} 318}
@@ -326,7 +325,6 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
326 const char *name = "NE/2"; 325 const char *name = "NE/2";
327 int start_page, stop_page; 326 int start_page, stop_page;
328 static unsigned version_printed; 327 static unsigned version_printed;
329 DECLARE_MAC_BUF(mac);
330 328
331 if (ei_debug && version_printed++ == 0) 329 if (ei_debug && version_printed++ == 0)
332 printk(version); 330 printk(version);
@@ -469,7 +467,7 @@ static int __init ne2_probe1(struct net_device *dev, int slot)
469 for(i = 0; i < ETHER_ADDR_LEN; i++) 467 for(i = 0; i < ETHER_ADDR_LEN; i++)
470 dev->dev_addr[i] = SA_prom[i]; 468 dev->dev_addr[i] = SA_prom[i];
471 469
472 printk(" %s\n", print_mac(mac, dev->dev_addr)); 470 printk(" %pM\n", dev->dev_addr);
473 471
474 printk("%s: %s found at %#x, using IRQ %d.\n", 472 printk("%s: %s found at %#x, using IRQ %d.\n",
475 dev->name, name, base_addr, dev->irq); 473 dev->name, name, base_addr, dev->irq);
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
index de0de744a8fa..12a7d6de1411 100644
--- a/drivers/net/ne2k-pci.c
+++ b/drivers/net/ne2k-pci.c
@@ -212,7 +212,6 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
212 static unsigned int fnd_cnt; 212 static unsigned int fnd_cnt;
213 long ioaddr; 213 long ioaddr;
214 int flags = pci_clone_list[chip_idx].flags; 214 int flags = pci_clone_list[chip_idx].flags;
215 DECLARE_MAC_BUF(mac);
216 215
217/* when built into the kernel, we only print version if device is found */ 216/* when built into the kernel, we only print version if device is found */
218#ifndef MODULE 217#ifndef MODULE
@@ -368,9 +367,9 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
368 367
369 for(i = 0; i < 6; i++) 368 for(i = 0; i < 6; i++)
370 dev->dev_addr[i] = SA_prom[i]; 369 dev->dev_addr[i] = SA_prom[i];
371 printk("%s: %s found at %#lx, IRQ %d, %s.\n", 370 printk("%s: %s found at %#lx, IRQ %d, %pM.\n",
372 dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq, 371 dev->name, pci_clone_list[chip_idx].name, ioaddr, dev->irq,
373 print_mac(mac, dev->dev_addr)); 372 dev->dev_addr);
374 373
375 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); 374 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
376 375
diff --git a/drivers/net/ne3210.c b/drivers/net/ne3210.c
index 425043a88db9..6681ca748c74 100644
--- a/drivers/net/ne3210.c
+++ b/drivers/net/ne3210.c
@@ -99,7 +99,6 @@ static int __init ne3210_eisa_probe (struct device *device)
99 int i, retval, port_index; 99 int i, retval, port_index;
100 struct eisa_device *edev = to_eisa_device (device); 100 struct eisa_device *edev = to_eisa_device (device);
101 struct net_device *dev; 101 struct net_device *dev;
102 DECLARE_MAC_BUF(mac);
103 102
104 /* Allocate dev->priv and fill in 8390 specific dev fields. */ 103 /* Allocate dev->priv and fill in 8390 specific dev fields. */
105 if (!(dev = alloc_ei_netdev ())) { 104 if (!(dev = alloc_ei_netdev ())) {
@@ -131,8 +130,8 @@ static int __init ne3210_eisa_probe (struct device *device)
131 port_index = inb(ioaddr + NE3210_CFG2) >> 6; 130 port_index = inb(ioaddr + NE3210_CFG2) >> 6;
132 for(i = 0; i < ETHER_ADDR_LEN; i++) 131 for(i = 0; i < ETHER_ADDR_LEN; i++)
133 dev->dev_addr[i] = inb(ioaddr + NE3210_SA_PROM + i); 132 dev->dev_addr[i] = inb(ioaddr + NE3210_SA_PROM + i);
134 printk("ne3210.c: NE3210 in EISA slot %d, media: %s, addr: %s.\n", 133 printk("ne3210.c: NE3210 in EISA slot %d, media: %s, addr: %pM.\n",
135 edev->slot, ifmap[port_index], print_mac(mac, dev->dev_addr)); 134 edev->slot, ifmap[port_index], dev->dev_addr);
136 135
137 /* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */ 136 /* Snarf the interrupt now. CFG file has them all listed as `edge' with share=NO */
138 dev->irq = irq_map[(inb(ioaddr + NE3210_CFG2) >> 3) & 0x07]; 137 dev->irq = irq_map[(inb(ioaddr + NE3210_CFG2) >> 3) & 0x07];
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index 9681618c3232..d304d38cd5d1 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -307,17 +307,14 @@ static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf)
307static ssize_t show_local_mac(struct netconsole_target *nt, char *buf) 307static ssize_t show_local_mac(struct netconsole_target *nt, char *buf)
308{ 308{
309 struct net_device *dev = nt->np.dev; 309 struct net_device *dev = nt->np.dev;
310 static const u8 bcast[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
310 311
311 DECLARE_MAC_BUF(mac); 312 return snprintf(buf, PAGE_SIZE, "%pM\n", dev ? dev->dev_addr : bcast);
312 return snprintf(buf, PAGE_SIZE, "%s\n", dev ?
313 print_mac(mac, dev->dev_addr) : "ff:ff:ff:ff:ff:ff");
314} 313}
315 314
316static ssize_t show_remote_mac(struct netconsole_target *nt, char *buf) 315static ssize_t show_remote_mac(struct netconsole_target *nt, char *buf)
317{ 316{
318 DECLARE_MAC_BUF(mac); 317 return snprintf(buf, PAGE_SIZE, "%pM\n", nt->np.remote_mac);
319 return snprintf(buf, PAGE_SIZE, "%s\n",
320 print_mac(mac, nt->np.remote_mac));
321} 318}
322 319
323/* 320/*
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 6ef3f0d84bcf..33caca90e80c 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -439,7 +439,6 @@ netxen_read_mac_addr(struct netxen_adapter *adapter)
439 int i; 439 int i;
440 unsigned char *p; 440 unsigned char *p;
441 __le64 mac_addr; 441 __le64 mac_addr;
442 DECLARE_MAC_BUF(mac);
443 struct net_device *netdev = adapter->netdev; 442 struct net_device *netdev = adapter->netdev;
444 struct pci_dev *pdev = adapter->pdev; 443 struct pci_dev *pdev = adapter->pdev;
445 444
@@ -462,10 +461,9 @@ netxen_read_mac_addr(struct netxen_adapter *adapter)
462 461
463 /* set station address */ 462 /* set station address */
464 463
465 if (!is_valid_ether_addr(netdev->perm_addr)) { 464 if (!is_valid_ether_addr(netdev->perm_addr))
466 dev_warn(&pdev->dev, "Bad MAC address %s.\n", 465 dev_warn(&pdev->dev, "Bad MAC address %pM.\n", netdev->dev_addr);
467 print_mac(mac, netdev->dev_addr)); 466 else
468 } else
469 adapter->macaddr_set(adapter, netdev->dev_addr); 467 adapter->macaddr_set(adapter, netdev->dev_addr);
470 468
471 return 0; 469 return 0;
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c
index 27f07f6a45b1..c3b9c83b32fe 100644
--- a/drivers/net/netxen/netxen_nic_niu.c
+++ b/drivers/net/netxen/netxen_nic_niu.c
@@ -608,7 +608,6 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
608 int phy = adapter->physical_port; 608 int phy = adapter->physical_port;
609 unsigned char mac_addr[6]; 609 unsigned char mac_addr[6];
610 int i; 610 int i;
611 DECLARE_MAC_BUF(mac);
612 611
613 if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) 612 if (NX_IS_REVISION_P3(adapter->ahw.revision_id))
614 return 0; 613 return 0;
@@ -636,10 +635,8 @@ int netxen_niu_macaddr_set(struct netxen_adapter *adapter,
636 if (i == 10) { 635 if (i == 10) {
637 printk(KERN_ERR "%s: cannot set Mac addr for %s\n", 636 printk(KERN_ERR "%s: cannot set Mac addr for %s\n",
638 netxen_nic_driver_name, adapter->netdev->name); 637 netxen_nic_driver_name, adapter->netdev->name);
639 printk(KERN_ERR "MAC address set: %s.\n", 638 printk(KERN_ERR "MAC address set: %pM.\n", addr);
640 print_mac(mac, addr)); 639 printk(KERN_ERR "MAC address get: %pM.\n", mac_addr);
641 printk(KERN_ERR "MAC address get: %s.\n",
642 print_mac(mac, mac_addr));
643 } 640 }
644 return 0; 641 return 0;
645} 642}
diff --git a/drivers/net/ni5010.c b/drivers/net/ni5010.c
index 8e0ca9f4e404..e88ec8a2f837 100644
--- a/drivers/net/ni5010.c
+++ b/drivers/net/ni5010.c
@@ -203,7 +203,6 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
203 unsigned int data = 0; 203 unsigned int data = 0;
204 int boguscount = 40; 204 int boguscount = 40;
205 int err = -ENODEV; 205 int err = -ENODEV;
206 DECLARE_MAC_BUF(mac);
207 206
208 dev->base_addr = ioaddr; 207 dev->base_addr = ioaddr;
209 dev->irq = irq; 208 dev->irq = irq;
@@ -271,7 +270,7 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
271 outw(i, IE_GP); 270 outw(i, IE_GP);
272 dev->dev_addr[i] = inb(IE_SAPROM); 271 dev->dev_addr[i] = inb(IE_SAPROM);
273 } 272 }
274 printk("%s ", print_mac(mac, dev->dev_addr)); 273 printk("%pM ", dev->dev_addr);
275 274
276 PRINTK2((KERN_DEBUG "%s: I/O #4 passed!\n", dev->name)); 275 PRINTK2((KERN_DEBUG "%s: I/O #4 passed!\n", dev->name));
277 276
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index ebc812702903..f927bc06980a 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -8638,10 +8638,8 @@ static void __devinit niu_assign_netdev_ops(struct net_device *dev)
8638static void __devinit niu_device_announce(struct niu *np) 8638static void __devinit niu_device_announce(struct niu *np)
8639{ 8639{
8640 struct net_device *dev = np->dev; 8640 struct net_device *dev = np->dev;
8641 DECLARE_MAC_BUF(mac);
8642 8641
8643 pr_info("%s: NIU Ethernet %s\n", 8642 pr_info("%s: NIU Ethernet %pM\n", dev->name, dev->dev_addr);
8644 dev->name, print_mac(mac, dev->dev_addr));
8645 8643
8646 if (np->parent->plat_type == PLAT_TYPE_ATCA_CP3220) { 8644 if (np->parent->plat_type == PLAT_TYPE_ATCA_CP3220) {
8647 pr_info("%s: Port type[%s] mode[%s:%s] XCVR[%s] phy[%s]\n", 8645 pr_info("%s: Port type[%s] mode[%s:%s] XCVR[%s] phy[%s]\n",
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index ff449619f047..4bb64415437f 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1955,7 +1955,6 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1955 long addr; 1955 long addr;
1956 int err; 1956 int err;
1957 int using_dac = 0; 1957 int using_dac = 0;
1958 DECLARE_MAC_BUF(mac);
1959 1958
1960 /* See if we can set the dma mask early on; failure is fatal. */ 1959 /* See if we can set the dma mask early on; failure is fatal. */
1961 if (sizeof(dma_addr_t) == 8 && 1960 if (sizeof(dma_addr_t) == 8 &&
@@ -2220,12 +2219,11 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
2220 ndev->features |= NETIF_F_HIGHDMA; 2219 ndev->features |= NETIF_F_HIGHDMA;
2221 } 2220 }
2222 2221
2223 printk(KERN_INFO "%s: ns83820 v" VERSION ": DP83820 v%u.%u: %s io=0x%08lx irq=%d f=%s\n", 2222 printk(KERN_INFO "%s: ns83820 v" VERSION ": DP83820 v%u.%u: %pM io=0x%08lx irq=%d f=%s\n",
2224 ndev->name, 2223 ndev->name,
2225 (unsigned)readl(dev->base + SRR) >> 8, 2224 (unsigned)readl(dev->base + SRR) >> 8,
2226 (unsigned)readl(dev->base + SRR) & 0xff, 2225 (unsigned)readl(dev->base + SRR) & 0xff,
2227 print_mac(mac, ndev->dev_addr), 2226 ndev->dev_addr, addr, pci_dev->irq,
2228 addr, pci_dev->irq,
2229 (ndev->features & NETIF_F_HIGHDMA) ? "h,sg" : "sg" 2227 (ndev->features & NETIF_F_HIGHDMA) ? "h,sg" : "sg"
2230 ); 2228 );
2231 2229
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c
index edc0fd588985..b0270052c3a9 100644
--- a/drivers/net/pasemi_mac.c
+++ b/drivers/net/pasemi_mac.c
@@ -1742,7 +1742,6 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1742 struct net_device *dev; 1742 struct net_device *dev;
1743 struct pasemi_mac *mac; 1743 struct pasemi_mac *mac;
1744 int err; 1744 int err;
1745 DECLARE_MAC_BUF(mac_buf);
1746 1745
1747 err = pci_enable_device(pdev); 1746 err = pci_enable_device(pdev);
1748 if (err) 1747 if (err)
@@ -1849,9 +1848,9 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1849 err); 1848 err);
1850 goto out; 1849 goto out;
1851 } else if netif_msg_probe(mac) 1850 } else if netif_msg_probe(mac)
1852 printk(KERN_INFO "%s: PA Semi %s: intf %d, hw addr %s\n", 1851 printk(KERN_INFO "%s: PA Semi %s: intf %d, hw addr %pM\n",
1853 dev->name, mac->type == MAC_TYPE_GMAC ? "GMAC" : "XAUI", 1852 dev->name, mac->type == MAC_TYPE_GMAC ? "GMAC" : "XAUI",
1854 mac->dma_if, print_mac(mac_buf, dev->dev_addr)); 1853 mac->dma_if, dev->dev_addr);
1855 1854
1856 return err; 1855 return err;
1857 1856
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index 0a575fef29e6..bf952acee1f7 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -737,7 +737,6 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
737 int i, addr_len, option; 737 int i, addr_len, option;
738 void *ioaddr = NULL; 738 void *ioaddr = NULL;
739 static int board_idx = -1; 739 static int board_idx = -1;
740 DECLARE_MAC_BUF(mac);
741 740
742/* when built into the kernel, we only print version if device is found */ 741/* when built into the kernel, we only print version if device is found */
743#ifndef MODULE 742#ifndef MODULE
@@ -797,11 +796,11 @@ static int __devinit netdrv_init_one (struct pci_dev *pdev,
797 796
798 tp->phys[0] = 32; 797 tp->phys[0] = 32;
799 798
800 printk (KERN_INFO "%s: %s at 0x%lx, %sIRQ %d\n", 799 printk (KERN_INFO "%s: %s at 0x%lx, %pM IRQ %d\n",
801 dev->name, 800 dev->name,
802 board_info[ent->driver_data].name, 801 board_info[ent->driver_data].name,
803 dev->base_addr, 802 dev->base_addr,
804 print_mac(mac, dev->dev_addr), 803 dev->dev_addr,
805 dev->irq); 804 dev->irq);
806 805
807 printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n", 806 printk (KERN_DEBUG "%s: Identified 8139 chip type '%s'\n",
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 08c4dd896077..dcbb11ab98db 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -345,7 +345,6 @@ static int tc574_config(struct pcmcia_device *link)
345 __be16 *phys_addr; 345 __be16 *phys_addr;
346 char *cardname; 346 char *cardname;
347 __u32 config; 347 __u32 config;
348 DECLARE_MAC_BUF(mac);
349 348
350 phys_addr = (__be16 *)dev->dev_addr; 349 phys_addr = (__be16 *)dev->dev_addr;
351 350
@@ -463,9 +462,9 @@ static int tc574_config(struct pcmcia_device *link)
463 strcpy(lp->node.dev_name, dev->name); 462 strcpy(lp->node.dev_name, dev->name);
464 463
465 printk(KERN_INFO "%s: %s at io %#3lx, irq %d, " 464 printk(KERN_INFO "%s: %s at io %#3lx, irq %d, "
466 "hw_addr %s.\n", 465 "hw_addr %pM.\n",
467 dev->name, cardname, dev->base_addr, dev->irq, 466 dev->name, cardname, dev->base_addr, dev->irq,
468 print_mac(mac, dev->dev_addr)); 467 dev->dev_addr);
469 printk(" %dK FIFO split %s Rx:Tx, %sMII interface.\n", 468 printk(" %dK FIFO split %s Rx:Tx, %sMII interface.\n",
470 8 << config & Ram_size, 469 8 << config & Ram_size,
471 ram_split[(config & Ram_split) >> Ram_split_shift], 470 ram_split[(config & Ram_split) >> Ram_split_shift],
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index c235cdba69c6..5882109be777 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -255,7 +255,6 @@ static int tc589_config(struct pcmcia_device *link)
255 int last_fn, last_ret, i, j, multi = 0, fifo; 255 int last_fn, last_ret, i, j, multi = 0, fifo;
256 unsigned int ioaddr; 256 unsigned int ioaddr;
257 char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"}; 257 char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
258 DECLARE_MAC_BUF(mac);
259 258
260 DEBUG(0, "3c589_config(0x%p)\n", link); 259 DEBUG(0, "3c589_config(0x%p)\n", link);
261 260
@@ -333,9 +332,9 @@ static int tc589_config(struct pcmcia_device *link)
333 strcpy(lp->node.dev_name, dev->name); 332 strcpy(lp->node.dev_name, dev->name);
334 333
335 printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, " 334 printk(KERN_INFO "%s: 3Com 3c%s, io %#3lx, irq %d, "
336 "hw_addr %s\n", 335 "hw_addr %pM\n",
337 dev->name, (multi ? "562" : "589"), dev->base_addr, dev->irq, 336 dev->name, (multi ? "562" : "589"), dev->base_addr, dev->irq,
338 print_mac(mac, dev->dev_addr)); 337 dev->dev_addr);
339 printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n", 338 printk(KERN_INFO " %dK FIFO split %s Rx:Tx, %s xcvr\n",
340 (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3], 339 (fifo & 7) ? 32 : 8, ram_split[(fifo >> 16) & 3],
341 if_names[dev->if_port]); 340 if_names[dev->if_port]);
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index b37a498939ae..889f1bdb0853 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -321,7 +321,6 @@ static int axnet_config(struct pcmcia_device *link)
321 struct net_device *dev = link->priv; 321 struct net_device *dev = link->priv;
322 axnet_dev_t *info = PRIV(dev); 322 axnet_dev_t *info = PRIV(dev);
323 int i, j, last_ret, last_fn; 323 int i, j, last_ret, last_fn;
324 DECLARE_MAC_BUF(mac);
325 324
326 DEBUG(0, "axnet_config(0x%p)\n", link); 325 DEBUG(0, "axnet_config(0x%p)\n", link);
327 326
@@ -397,10 +396,10 @@ static int axnet_config(struct pcmcia_device *link)
397 strcpy(info->node.dev_name, dev->name); 396 strcpy(info->node.dev_name, dev->name);
398 397
399 printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, " 398 printk(KERN_INFO "%s: Asix AX88%d90: io %#3lx, irq %d, "
400 "hw_addr %s\n", 399 "hw_addr %pM\n",
401 dev->name, ((info->flags & IS_AX88790) ? 7 : 1), 400 dev->name, ((info->flags & IS_AX88790) ? 7 : 1),
402 dev->base_addr, dev->irq, 401 dev->base_addr, dev->irq,
403 print_mac(mac, dev->dev_addr)); 402 dev->dev_addr);
404 if (info->phy_id != -1) { 403 if (info->phy_id != -1) {
405 DEBUG(0, " MII transceiver at index %d, status %x.\n", info->phy_id, j); 404 DEBUG(0, " MII transceiver at index %d, status %x.\n", info->phy_id, j);
406 } else { 405 } else {
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 69d916daa7bb..465e4ad363ce 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -348,7 +348,6 @@ static int fmvj18x_config(struct pcmcia_device *link)
348 cardtype_t cardtype; 348 cardtype_t cardtype;
349 char *card_name = "unknown"; 349 char *card_name = "unknown";
350 u_char *node_id; 350 u_char *node_id;
351 DECLARE_MAC_BUF(mac);
352 351
353 DEBUG(0, "fmvj18x_config(0x%p)\n", link); 352 DEBUG(0, "fmvj18x_config(0x%p)\n", link);
354 353
@@ -539,9 +538,9 @@ static int fmvj18x_config(struct pcmcia_device *link)
539 538
540 /* print current configuration */ 539 /* print current configuration */
541 printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, " 540 printk(KERN_INFO "%s: %s, sram %s, port %#3lx, irq %d, "
542 "hw_addr %s\n", 541 "hw_addr %pM\n",
543 dev->name, card_name, sram_config == 0 ? "4K TX*2" : "8K TX*2", 542 dev->name, card_name, sram_config == 0 ? "4K TX*2" : "8K TX*2",
544 dev->base_addr, dev->irq, print_mac(mac, dev->dev_addr)); 543 dev->base_addr, dev->irq, dev->dev_addr);
545 544
546 return 0; 545 return 0;
547 546
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 448cd40aeba5..35a1d1024c50 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -659,7 +659,6 @@ static int nmclan_config(struct pcmcia_device *link)
659 u_char buf[64]; 659 u_char buf[64];
660 int i, last_ret, last_fn; 660 int i, last_ret, last_fn;
661 unsigned int ioaddr; 661 unsigned int ioaddr;
662 DECLARE_MAC_BUF(mac);
663 662
664 DEBUG(0, "nmclan_config(0x%p)\n", link); 663 DEBUG(0, "nmclan_config(0x%p)\n", link);
665 664
@@ -719,9 +718,9 @@ static int nmclan_config(struct pcmcia_device *link)
719 strcpy(lp->node.dev_name, dev->name); 718 strcpy(lp->node.dev_name, dev->name);
720 719
721 printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port," 720 printk(KERN_INFO "%s: nmclan: port %#3lx, irq %d, %s port,"
722 " hw_addr %s\n", 721 " hw_addr %pM\n",
723 dev->name, dev->base_addr, dev->irq, if_names[dev->if_port], 722 dev->name, dev->base_addr, dev->irq, if_names[dev->if_port],
724 print_mac(mac, dev->dev_addr)); 723 dev->dev_addr);
725 return 0; 724 return 0;
726 725
727cs_failed: 726cs_failed:
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index e40d6301aa7a..69625373a8ed 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -554,7 +554,6 @@ static int pcnet_config(struct pcmcia_device *link)
554 int last_ret, last_fn, start_pg, stop_pg, cm_offset; 554 int last_ret, last_fn, start_pg, stop_pg, cm_offset;
555 int has_shmem = 0; 555 int has_shmem = 0;
556 hw_info_t *local_hw_info; 556 hw_info_t *local_hw_info;
557 DECLARE_MAC_BUF(mac);
558 557
559 DEBUG(0, "pcnet_config(0x%p)\n", link); 558 DEBUG(0, "pcnet_config(0x%p)\n", link);
560 559
@@ -675,7 +674,7 @@ static int pcnet_config(struct pcmcia_device *link)
675 printk (" mem %#5lx,", dev->mem_start); 674 printk (" mem %#5lx,", dev->mem_start);
676 if (info->flags & HAS_MISC_REG) 675 if (info->flags & HAS_MISC_REG)
677 printk(" %s xcvr,", if_names[dev->if_port]); 676 printk(" %s xcvr,", if_names[dev->if_port]);
678 printk(" hw_addr %s\n", print_mac(mac, dev->dev_addr)); 677 printk(" hw_addr %pM\n", dev->dev_addr);
679 return 0; 678 return 0;
680 679
681cs_failed: 680cs_failed:
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index c74d6656d266..fccd53ef3c64 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -949,7 +949,6 @@ static int smc91c92_config(struct pcmcia_device *link)
949 int i, j, rev; 949 int i, j, rev;
950 unsigned int ioaddr; 950 unsigned int ioaddr;
951 u_long mir; 951 u_long mir;
952 DECLARE_MAC_BUF(mac);
953 952
954 DEBUG(0, "smc91c92_config(0x%p)\n", link); 953 DEBUG(0, "smc91c92_config(0x%p)\n", link);
955 954
@@ -1062,9 +1061,9 @@ static int smc91c92_config(struct pcmcia_device *link)
1062 strcpy(smc->node.dev_name, dev->name); 1061 strcpy(smc->node.dev_name, dev->name);
1063 1062
1064 printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, " 1063 printk(KERN_INFO "%s: smc91c%s rev %d: io %#3lx, irq %d, "
1065 "hw_addr %s\n", 1064 "hw_addr %pM\n",
1066 dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq, 1065 dev->name, name, (rev & 0x0f), dev->base_addr, dev->irq,
1067 print_mac(mac, dev->dev_addr)); 1066 dev->dev_addr);
1068 1067
1069 if (rev > 0) { 1068 if (rev > 0) {
1070 if (mir & 0x3ff) 1069 if (mir & 0x3ff)
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index e1fd585e7131..c45c3064fee6 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -772,7 +772,6 @@ xirc2ps_config(struct pcmcia_device * link)
772 int err, i; 772 int err, i;
773 u_char buf[64]; 773 u_char buf[64];
774 cistpl_lan_node_id_t *node_id = (cistpl_lan_node_id_t*)parse.funce.data; 774 cistpl_lan_node_id_t *node_id = (cistpl_lan_node_id_t*)parse.funce.data;
775 DECLARE_MAC_BUF(mac);
776 775
777 local->dingo_ccr = NULL; 776 local->dingo_ccr = NULL;
778 777
@@ -1051,9 +1050,9 @@ xirc2ps_config(struct pcmcia_device * link)
1051 strcpy(local->node.dev_name, dev->name); 1050 strcpy(local->node.dev_name, dev->name);
1052 1051
1053 /* give some infos about the hardware */ 1052 /* give some infos about the hardware */
1054 printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %s\n", 1053 printk(KERN_INFO "%s: %s: port %#3lx, irq %d, hwaddr %pM\n",
1055 dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq, 1054 dev->name, local->manf_str,(u_long)dev->base_addr, (int)dev->irq,
1056 print_mac(mac, dev->dev_addr)); 1055 dev->dev_addr);
1057 1056
1058 return 0; 1057 return 0;
1059 1058
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index ca8c0e037400..15bf6fe8416d 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1747,8 +1747,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1747 memset(dev->dev_addr, 0, sizeof(dev->dev_addr)); 1747 memset(dev->dev_addr, 0, sizeof(dev->dev_addr));
1748 1748
1749 if (pcnet32_debug & NETIF_MSG_PROBE) { 1749 if (pcnet32_debug & NETIF_MSG_PROBE) {
1750 DECLARE_MAC_BUF(mac); 1750 printk(" %pM", dev->dev_addr);
1751 printk(" %s", print_mac(mac, dev->dev_addr));
1752 1751
1753 /* Version 0x2623 and 0x2624 */ 1752 /* Version 0x2623 and 0x2624 */
1754 if (((chip_version + 1) & 0xfffe) == 0x2624) { 1753 if (((chip_version + 1) & 0xfffe) == 0x2624) {
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index b646e92134dc..c22b30533a14 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -958,7 +958,6 @@ static int pppoe_seq_show(struct seq_file *seq, void *v)
958{ 958{
959 struct pppox_sock *po; 959 struct pppox_sock *po;
960 char *dev_name; 960 char *dev_name;
961 DECLARE_MAC_BUF(mac);
962 961
963 if (v == SEQ_START_TOKEN) { 962 if (v == SEQ_START_TOKEN) {
964 seq_puts(seq, "Id Address Device\n"); 963 seq_puts(seq, "Id Address Device\n");
@@ -968,8 +967,8 @@ static int pppoe_seq_show(struct seq_file *seq, void *v)
968 po = v; 967 po = v;
969 dev_name = po->pppoe_pa.dev; 968 dev_name = po->pppoe_pa.dev;
970 969
971 seq_printf(seq, "%08X %s %8s\n", 970 seq_printf(seq, "%08X %pM %8s\n",
972 po->pppoe_pa.sid, print_mac(mac, po->pppoe_pa.remote), dev_name); 971 po->pppoe_pa.sid, po->pppoe_pa.remote, dev_name);
973out: 972out:
974 return 0; 973 return 0;
975} 974}
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 2eb54fd7bed5..4b564eda5bd9 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -1443,7 +1443,6 @@ int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card)
1443{ 1443{
1444 int status; 1444 int status;
1445 u64 v1, v2; 1445 u64 v1, v2;
1446 DECLARE_MAC_BUF(mac);
1447 1446
1448 netdev->features = NETIF_F_IP_CSUM; 1447 netdev->features = NETIF_F_IP_CSUM;
1449 1448
@@ -1474,9 +1473,8 @@ int gelic_net_setup_netdev(struct net_device *netdev, struct gelic_card *card)
1474 __func__, netdev->name, status); 1473 __func__, netdev->name, status);
1475 return status; 1474 return status;
1476 } 1475 }
1477 dev_info(ctodev(card), "%s: MAC addr %s\n", 1476 dev_info(ctodev(card), "%s: MAC addr %pM\n",
1478 netdev->name, 1477 netdev->name, netdev->dev_addr);
1479 print_mac(mac, netdev->dev_addr));
1480 1478
1481 return 0; 1479 return 0;
1482} 1480}
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index a834b52a6a2c..d10dc3ea9c79 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -763,7 +763,6 @@ static void scan_list_dump(struct gelic_wl_info *wl)
763{ 763{
764 struct gelic_wl_scan_info *scan_info; 764 struct gelic_wl_scan_info *scan_info;
765 int i; 765 int i;
766 DECLARE_MAC_BUF(mac);
767 766
768 i = 0; 767 i = 0;
769 list_for_each_entry(scan_info, &wl->network_list, list) { 768 list_for_each_entry(scan_info, &wl->network_list, list) {
@@ -775,8 +774,7 @@ static void scan_list_dump(struct gelic_wl_info *wl)
775 scan_info->rate_len, scan_info->rate_ext_len, 774 scan_info->rate_len, scan_info->rate_ext_len,
776 scan_info->essid_len); 775 scan_info->essid_len);
777 /* -- */ 776 /* -- */
778 pr_debug("bssid=%s\n", 777 pr_debug("bssid=%pM\n", &scan_info->hwinfo->bssid[2]);
779 print_mac(mac, &scan_info->hwinfo->bssid[2]));
780 pr_debug("essid=%s\n", scan_info->hwinfo->essid); 778 pr_debug("essid=%s\n", scan_info->hwinfo->essid);
781 } 779 }
782} 780}
@@ -1167,11 +1165,7 @@ static int gelic_wl_set_ap(struct net_device *netdev,
1167 ETH_ALEN); 1165 ETH_ALEN);
1168 set_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat); 1166 set_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat);
1169 set_bit(GELIC_WL_STAT_CONFIGURED, &wl->stat); 1167 set_bit(GELIC_WL_STAT_CONFIGURED, &wl->stat);
1170 pr_debug("%s: bss=%02x:%02x:%02x:%02x:%02x:%02x\n", 1168 pr_debug("%s: bss=%pM\n", __func__, wl->bssid);
1171 __func__,
1172 wl->bssid[0], wl->bssid[1],
1173 wl->bssid[2], wl->bssid[3],
1174 wl->bssid[4], wl->bssid[5]);
1175 } else { 1169 } else {
1176 pr_debug("%s: clear bssid\n", __func__); 1170 pr_debug("%s: clear bssid\n", __func__);
1177 clear_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat); 1171 clear_bit(GELIC_WL_STAT_BSSID_SET, &wl->stat);
@@ -1632,7 +1626,6 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
1632 unsigned long this_time = jiffies; 1626 unsigned long this_time = jiffies;
1633 unsigned int data_len, i, found, r; 1627 unsigned int data_len, i, found, r;
1634 void *buf; 1628 void *buf;
1635 DECLARE_MAC_BUF(mac);
1636 1629
1637 pr_debug("%s:start\n", __func__); 1630 pr_debug("%s:start\n", __func__);
1638 mutex_lock(&wl->scan_lock); 1631 mutex_lock(&wl->scan_lock);
@@ -1684,9 +1677,9 @@ static void gelic_wl_scan_complete_event(struct gelic_wl_info *wl)
1684 scan_info_size < data_len; 1677 scan_info_size < data_len;
1685 i++, scan_info_size += be16_to_cpu(scan_info->size), 1678 i++, scan_info_size += be16_to_cpu(scan_info->size),
1686 scan_info = (void *)scan_info + be16_to_cpu(scan_info->size)) { 1679 scan_info = (void *)scan_info + be16_to_cpu(scan_info->size)) {
1687 pr_debug("%s:size=%d bssid=%s scan_info=%p\n", __func__, 1680 pr_debug("%s:size=%d bssid=%pM scan_info=%p\n", __func__,
1688 be16_to_cpu(scan_info->size), 1681 be16_to_cpu(scan_info->size),
1689 print_mac(mac, &scan_info->bssid[2]), scan_info); 1682 &scan_info->bssid[2], scan_info);
1690 1683
1691 /* 1684 /*
1692 * The wireless firmware may return invalid channel 0 and/or 1685 * The wireless firmware may return invalid channel 0 and/or
@@ -1787,7 +1780,6 @@ struct gelic_wl_scan_info *gelic_wl_find_best_bss(struct gelic_wl_info *wl)
1787 struct gelic_wl_scan_info *best_bss; 1780 struct gelic_wl_scan_info *best_bss;
1788 int weight, best_weight; 1781 int weight, best_weight;
1789 u16 security; 1782 u16 security;
1790 DECLARE_MAC_BUF(mac);
1791 1783
1792 pr_debug("%s: <-\n", __func__); 1784 pr_debug("%s: <-\n", __func__);
1793 1785
@@ -1857,8 +1849,8 @@ struct gelic_wl_scan_info *gelic_wl_find_best_bss(struct gelic_wl_info *wl)
1857#ifdef DEBUG 1849#ifdef DEBUG
1858 pr_debug("%s: -> bss=%p\n", __func__, best_bss); 1850 pr_debug("%s: -> bss=%p\n", __func__, best_bss);
1859 if (best_bss) { 1851 if (best_bss) {
1860 pr_debug("%s:addr=%s\n", __func__, 1852 pr_debug("%s:addr=%pM\n", __func__,
1861 print_mac(mac, &best_bss->hwinfo->bssid[2])); 1853 &best_bss->hwinfo->bssid[2]);
1862 } 1854 }
1863#endif 1855#endif
1864 return best_bss; 1856 return best_bss;
diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index 3cdd07c45b6d..acf8dc55e2a0 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -3529,7 +3529,6 @@ static void ql_display_dev_info(struct net_device *ndev)
3529{ 3529{
3530 struct ql3_adapter *qdev = (struct ql3_adapter *)netdev_priv(ndev); 3530 struct ql3_adapter *qdev = (struct ql3_adapter *)netdev_priv(ndev);
3531 struct pci_dev *pdev = qdev->pdev; 3531 struct pci_dev *pdev = qdev->pdev;
3532 DECLARE_MAC_BUF(mac);
3533 3532
3534 printk(KERN_INFO PFX 3533 printk(KERN_INFO PFX
3535 "\n%s Adapter %d RevisionID %d found %s on PCI slot %d.\n", 3534 "\n%s Adapter %d RevisionID %d found %s on PCI slot %d.\n",
@@ -3555,8 +3554,8 @@ static void ql_display_dev_info(struct net_device *ndev)
3555 3554
3556 if (netif_msg_probe(qdev)) 3555 if (netif_msg_probe(qdev))
3557 printk(KERN_INFO PFX 3556 printk(KERN_INFO PFX
3558 "%s: MAC address %s\n", 3557 "%s: MAC address %pM\n",
3559 ndev->name, print_mac(mac, ndev->dev_addr)); 3558 ndev->name, ndev->dev_addr);
3560} 3559}
3561 3560
3562static int ql_adapter_down(struct ql3_adapter *qdev, int do_reset) 3561static int ql_adapter_down(struct ql3_adapter *qdev, int do_reset)
@@ -3978,9 +3977,7 @@ static int __devinit ql3xxx_probe(struct pci_dev *pdev,
3978 if (qdev->device_id == QL3032_DEVICE_ID) 3977 if (qdev->device_id == QL3032_DEVICE_ID)
3979 ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; 3978 ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG;
3980 3979
3981 qdev->mem_map_registers = 3980 qdev->mem_map_registers = pci_ioremap_bar(pdev, 1);
3982 ioremap_nocache(pci_resource_start(pdev, 1),
3983 pci_resource_len(qdev->pdev, 1));
3984 if (!qdev->mem_map_registers) { 3981 if (!qdev->mem_map_registers) {
3985 printk(KERN_ERR PFX "%s: cannot map device registers\n", 3982 printk(KERN_ERR PFX "%s: cannot map device registers\n",
3986 pci_name(pdev)); 3983 pci_name(pdev));
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index b83a9c9b6a97..6445d2cb1322 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -336,12 +336,11 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
336 (addr[5]); 336 (addr[5]);
337 337
338 QPRINTK(qdev, IFUP, INFO, 338 QPRINTK(qdev, IFUP, INFO,
339 "Adding %s address %02x:%02x:%02x:%02x:%02x:%02x" 339 "Adding %s address %pM"
340 " at index %d in the CAM.\n", 340 " at index %d in the CAM.\n",
341 ((type == 341 ((type ==
342 MAC_ADDR_TYPE_MULTI_MAC) ? "MULTICAST" : 342 MAC_ADDR_TYPE_MULTI_MAC) ? "MULTICAST" :
343 "UNICAST"), addr[0], addr[1], addr[2], addr[3], 343 "UNICAST"), addr, index);
344 addr[4], addr[5], index);
345 344
346 status = 345 status =
347 ql_wait_reg_rdy(qdev, 346 ql_wait_reg_rdy(qdev,
@@ -3127,11 +3126,7 @@ static void ql_display_dev_info(struct net_device *ndev)
3127 qdev->chip_rev_id >> 4 & 0x0000000f, 3126 qdev->chip_rev_id >> 4 & 0x0000000f,
3128 qdev->chip_rev_id >> 8 & 0x0000000f, 3127 qdev->chip_rev_id >> 8 & 0x0000000f,
3129 qdev->chip_rev_id >> 12 & 0x0000000f); 3128 qdev->chip_rev_id >> 12 & 0x0000000f);
3130 QPRINTK(qdev, PROBE, INFO, 3129 QPRINTK(qdev, PROBE, INFO, "MAC address %pM\n", ndev->dev_addr);
3131 "MAC address %02x:%02x:%02x:%02x:%02x:%02x\n",
3132 ndev->dev_addr[0], ndev->dev_addr[1],
3133 ndev->dev_addr[2], ndev->dev_addr[3], ndev->dev_addr[4],
3134 ndev->dev_addr[5]);
3135} 3130}
3136 3131
3137static int ql_adapter_down(struct ql_adapter *qdev) 3132static int ql_adapter_down(struct ql_adapter *qdev)
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index 2b8fd68bc516..bd4f4ad5d360 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -435,7 +435,6 @@ static int rionet_setup_netdev(struct rio_mport *mport)
435 struct net_device *ndev = NULL; 435 struct net_device *ndev = NULL;
436 struct rionet_private *rnet; 436 struct rionet_private *rnet;
437 u16 device_id; 437 u16 device_id;
438 DECLARE_MAC_BUF(mac);
439 438
440 /* Allocate our net_device structure */ 439 /* Allocate our net_device structure */
441 ndev = alloc_etherdev(sizeof(struct rionet_private)); 440 ndev = alloc_etherdev(sizeof(struct rionet_private));
@@ -485,12 +484,12 @@ static int rionet_setup_netdev(struct rio_mport *mport)
485 if (rc != 0) 484 if (rc != 0)
486 goto out; 485 goto out;
487 486
488 printk("%s: %s %s Version %s, MAC %s\n", 487 printk("%s: %s %s Version %s, MAC %pM\n",
489 ndev->name, 488 ndev->name,
490 DRV_NAME, 489 DRV_NAME,
491 DRV_DESC, 490 DRV_DESC,
492 DRV_VERSION, 491 DRV_VERSION,
493 print_mac(mac, ndev->dev_addr)); 492 ndev->dev_addr);
494 493
495 out: 494 out:
496 return rc; 495 return rc;
diff --git a/drivers/net/rrunner.c b/drivers/net/rrunner.c
index 3dd8f1342f70..7343291030c5 100644
--- a/drivers/net/rrunner.c
+++ b/drivers/net/rrunner.c
@@ -511,7 +511,6 @@ static int __devinit rr_init(struct net_device *dev)
511 struct rr_private *rrpriv; 511 struct rr_private *rrpriv;
512 struct rr_regs __iomem *regs; 512 struct rr_regs __iomem *regs;
513 u32 sram_size, rev; 513 u32 sram_size, rev;
514 DECLARE_MAC_BUF(mac);
515 514
516 rrpriv = netdev_priv(dev); 515 rrpriv = netdev_priv(dev);
517 regs = rrpriv->regs; 516 regs = rrpriv->regs;
@@ -549,7 +548,7 @@ static int __devinit rr_init(struct net_device *dev)
549 *(__be32 *)(dev->dev_addr+2) = 548 *(__be32 *)(dev->dev_addr+2) =
550 htonl(rr_read_eeprom_word(rrpriv, offsetof(struct eeprom, manf.BoardULA[4]))); 549 htonl(rr_read_eeprom_word(rrpriv, offsetof(struct eeprom, manf.BoardULA[4])));
551 550
552 printk(" MAC: %s\n", print_mac(mac, dev->dev_addr)); 551 printk(" MAC: %pM\n", dev->dev_addr);
553 552
554 sram_size = rr_read_eeprom_word(rrpriv, 8); 553 sram_size = rr_read_eeprom_word(rrpriv, 8);
555 printk(" SRAM size 0x%06x\n", sram_size); 554 printk(" SRAM size 0x%06x\n", sram_size);
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 6a1375f9cbb8..5663fa7aa3da 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -7748,7 +7748,6 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7748 int mode; 7748 int mode;
7749 u8 dev_intr_type = intr_type; 7749 u8 dev_intr_type = intr_type;
7750 u8 dev_multiq = 0; 7750 u8 dev_multiq = 0;
7751 DECLARE_MAC_BUF(mac);
7752 7751
7753 ret = s2io_verify_parm(pdev, &dev_intr_type, &dev_multiq); 7752 ret = s2io_verify_parm(pdev, &dev_intr_type, &dev_multiq);
7754 if (ret) 7753 if (ret)
@@ -7918,8 +7917,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7918 goto mem_alloc_failed; 7917 goto mem_alloc_failed;
7919 } 7918 }
7920 7919
7921 sp->bar0 = ioremap(pci_resource_start(pdev, 0), 7920 sp->bar0 = pci_ioremap_bar(pdev, 0);
7922 pci_resource_len(pdev, 0));
7923 if (!sp->bar0) { 7921 if (!sp->bar0) {
7924 DBG_PRINT(ERR_DBG, "%s: Neterion: cannot remap io mem1\n", 7922 DBG_PRINT(ERR_DBG, "%s: Neterion: cannot remap io mem1\n",
7925 dev->name); 7923 dev->name);
@@ -7927,8 +7925,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
7927 goto bar0_remap_failed; 7925 goto bar0_remap_failed;
7928 } 7926 }
7929 7927
7930 sp->bar1 = ioremap(pci_resource_start(pdev, 2), 7928 sp->bar1 = pci_ioremap_bar(pdev, 2);
7931 pci_resource_len(pdev, 2));
7932 if (!sp->bar1) { 7929 if (!sp->bar1) {
7933 DBG_PRINT(ERR_DBG, "%s: Neterion: cannot remap io mem2\n", 7930 DBG_PRINT(ERR_DBG, "%s: Neterion: cannot remap io mem2\n",
7934 dev->name); 7931 dev->name);
@@ -8125,8 +8122,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre)
8125 sp->product_name, pdev->revision); 8122 sp->product_name, pdev->revision);
8126 DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name, 8123 DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name,
8127 s2io_driver_version); 8124 s2io_driver_version);
8128 DBG_PRINT(ERR_DBG, "%s: MAC ADDR: %s\n", 8125 DBG_PRINT(ERR_DBG, "%s: MAC ADDR: %pM\n", dev->name, dev->dev_addr);
8129 dev->name, print_mac(mac, dev->dev_addr));
8130 DBG_PRINT(ERR_DBG, "SERIAL NUMBER: %s\n", sp->serial_num); 8126 DBG_PRINT(ERR_DBG, "SERIAL NUMBER: %s\n", sp->serial_num);
8131 if (sp->device_type & XFRAME_II_DEVICE) { 8127 if (sp->device_type & XFRAME_II_DEVICE) {
8132 mode = s2io_print_pci_mode(sp); 8128 mode = s2io_print_pci_mode(sp);
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
index 2615d46e6e50..480caec1e024 100644
--- a/drivers/net/sb1250-mac.c
+++ b/drivers/net/sb1250-mac.c
@@ -2292,7 +2292,6 @@ static int sbmac_init(struct platform_device *pldev, long long base)
2292 uint64_t ea_reg; 2292 uint64_t ea_reg;
2293 int i; 2293 int i;
2294 int err; 2294 int err;
2295 DECLARE_MAC_BUF(mac);
2296 2295
2297 sc->sbm_dev = dev; 2296 sc->sbm_dev = dev;
2298 sc->sbe_idx = idx; 2297 sc->sbe_idx = idx;
@@ -2373,8 +2372,8 @@ static int sbmac_init(struct platform_device *pldev, long long base)
2373 * process so we need to finish off the config message that 2372 * process so we need to finish off the config message that
2374 * was being displayed) 2373 * was being displayed)
2375 */ 2374 */
2376 pr_info("%s: SiByte Ethernet at 0x%08Lx, address: %s\n", 2375 pr_info("%s: SiByte Ethernet at 0x%08Lx, address: %pM\n",
2377 dev->name, base, print_mac(mac, eaddr)); 2376 dev->name, base, eaddr);
2378 2377
2379 sc->mii_bus->name = sbmac_mdio_string; 2378 sc->mii_bus->name = sbmac_mdio_string;
2380 snprintf(sc->mii_bus->id, MII_BUS_ID_SIZE, "%x", idx); 2379 snprintf(sc->mii_bus->id, MII_BUS_ID_SIZE, "%x", idx);
diff --git a/drivers/net/seeq8005.c b/drivers/net/seeq8005.c
index 48c64fb20eec..ad12e7fa06c6 100644
--- a/drivers/net/seeq8005.c
+++ b/drivers/net/seeq8005.c
@@ -158,7 +158,6 @@ static int __init seeq8005_probe1(struct net_device *dev, int ioaddr)
158 int old_dmaar; 158 int old_dmaar;
159 int old_rear; 159 int old_rear;
160 int retval; 160 int retval;
161 DECLARE_MAC_BUF(mac);
162 161
163 if (!request_region(ioaddr, SEEQ8005_IO_EXTENT, "seeq8005")) 162 if (!request_region(ioaddr, SEEQ8005_IO_EXTENT, "seeq8005"))
164 return -ENODEV; 163 return -ENODEV;
@@ -303,7 +302,7 @@ static int __init seeq8005_probe1(struct net_device *dev, int ioaddr)
303 /* Retrieve and print the ethernet address. */ 302 /* Retrieve and print the ethernet address. */
304 for (i = 0; i < 6; i++) 303 for (i = 0; i < 6; i++)
305 dev->dev_addr[i] = SA_prom[i+6]; 304 dev->dev_addr[i] = SA_prom[i+6];
306 printk("%s", print_mac(mac, dev->dev_addr)); 305 printk("%pM", dev->dev_addr);
307 306
308 if (dev->irq == 0xff) 307 if (dev->irq == 0xff)
309 ; /* Do nothing: a user-level program will set it. */ 308 ; /* Do nothing: a user-level program will set it. */
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index 06ea71c7e34e..5b05789f0b79 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -612,17 +612,15 @@ static int efx_probe_port(struct efx_nic *efx)
612 if (is_valid_ether_addr(efx->mac_address)) { 612 if (is_valid_ether_addr(efx->mac_address)) {
613 memcpy(efx->net_dev->dev_addr, efx->mac_address, ETH_ALEN); 613 memcpy(efx->net_dev->dev_addr, efx->mac_address, ETH_ALEN);
614 } else { 614 } else {
615 DECLARE_MAC_BUF(mac); 615 EFX_ERR(efx, "invalid MAC address %pM\n",
616 616 efx->mac_address);
617 EFX_ERR(efx, "invalid MAC address %s\n",
618 print_mac(mac, efx->mac_address));
619 if (!allow_bad_hwaddr) { 617 if (!allow_bad_hwaddr) {
620 rc = -EINVAL; 618 rc = -EINVAL;
621 goto err; 619 goto err;
622 } 620 }
623 random_ether_addr(efx->net_dev->dev_addr); 621 random_ether_addr(efx->net_dev->dev_addr);
624 EFX_INFO(efx, "using locally-generated MAC %s\n", 622 EFX_INFO(efx, "using locally-generated MAC %pM\n",
625 print_mac(mac, efx->net_dev->dev_addr)); 623 efx->net_dev->dev_addr);
626 } 624 }
627 625
628 return 0; 626 return 0;
@@ -1401,9 +1399,8 @@ static int efx_set_mac_address(struct net_device *net_dev, void *data)
1401 EFX_ASSERT_RESET_SERIALISED(efx); 1399 EFX_ASSERT_RESET_SERIALISED(efx);
1402 1400
1403 if (!is_valid_ether_addr(new_addr)) { 1401 if (!is_valid_ether_addr(new_addr)) {
1404 DECLARE_MAC_BUF(mac); 1402 EFX_ERR(efx, "invalid ethernet MAC address requested: %pM\n",
1405 EFX_ERR(efx, "invalid ethernet MAC address requested: %s\n", 1403 new_addr);
1406 print_mac(mac, new_addr));
1407 return -EINVAL; 1404 return -EINVAL;
1408 } 1405 }
1409 1406
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index 6261201403cd..ffc700e4f165 100644
--- a/drivers/net/sgiseeq.c
+++ b/drivers/net/sgiseeq.c
@@ -719,7 +719,6 @@ static int __init sgiseeq_probe(struct platform_device *pdev)
719 struct sgiseeq_private *sp; 719 struct sgiseeq_private *sp;
720 struct net_device *dev; 720 struct net_device *dev;
721 int err; 721 int err;
722 DECLARE_MAC_BUF(mac);
723 722
724 dev = alloc_etherdev(sizeof (struct sgiseeq_private)); 723 dev = alloc_etherdev(sizeof (struct sgiseeq_private));
725 if (!dev) { 724 if (!dev) {
@@ -793,8 +792,7 @@ static int __init sgiseeq_probe(struct platform_device *pdev)
793 goto err_out_free_page; 792 goto err_out_free_page;
794 } 793 }
795 794
796 printk(KERN_INFO "%s: %s %s\n", 795 printk(KERN_INFO "%s: %s %pM\n", dev->name, sgiseeqstr, dev->dev_addr);
797 dev->name, sgiseeqstr, print_mac(mac, dev->dev_addr));
798 796
799 return 0; 797 return 0;
800 798
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index e6e3bf58a569..f6c8f70b405c 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -1791,7 +1791,6 @@ static int __devinit sis190_init_one(struct pci_dev *pdev,
1791 struct net_device *dev; 1791 struct net_device *dev;
1792 void __iomem *ioaddr; 1792 void __iomem *ioaddr;
1793 int rc; 1793 int rc;
1794 DECLARE_MAC_BUF(mac);
1795 1794
1796 if (!printed_version) { 1795 if (!printed_version) {
1797 net_drv(&debug, KERN_INFO SIS190_DRIVER_NAME " loaded.\n"); 1796 net_drv(&debug, KERN_INFO SIS190_DRIVER_NAME " loaded.\n");
@@ -1841,10 +1840,9 @@ static int __devinit sis190_init_one(struct pci_dev *pdev,
1841 if (rc < 0) 1840 if (rc < 0)
1842 goto err_remove_mii; 1841 goto err_remove_mii;
1843 1842
1844 net_probe(tp, KERN_INFO "%s: %s at %p (IRQ: %d), " 1843 net_probe(tp, KERN_INFO "%s: %s at %p (IRQ: %d), %pM\n",
1845 "%s\n",
1846 pci_name(pdev), sis_chip_info[ent->driver_data].name, 1844 pci_name(pdev), sis_chip_info[ent->driver_data].name,
1847 ioaddr, dev->irq, print_mac(mac, dev->dev_addr)); 1845 ioaddr, dev->irq, dev->dev_addr);
1848 1846
1849 net_probe(tp, KERN_INFO "%s: %s mode.\n", dev->name, 1847 net_probe(tp, KERN_INFO "%s: %s mode.\n", dev->name,
1850 (tp->features & F_HAS_RGMII) ? "RGMII" : "GMII"); 1848 (tp->features & F_HAS_RGMII) ? "RGMII" : "GMII");
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index fa3a460f8e2f..bb7056a897bf 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -404,7 +404,6 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
404 int i, ret; 404 int i, ret;
405 const char *card_name = card_names[pci_id->driver_data]; 405 const char *card_name = card_names[pci_id->driver_data];
406 const char *dev_name = pci_name(pci_dev); 406 const char *dev_name = pci_name(pci_dev);
407 DECLARE_MAC_BUF(mac);
408 407
409/* when built into the kernel, we only print version if device is found */ 408/* when built into the kernel, we only print version if device is found */
410#ifndef MODULE 409#ifndef MODULE
@@ -534,9 +533,9 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev,
534 goto err_unmap_rx; 533 goto err_unmap_rx;
535 534
536 /* print some information about our NIC */ 535 /* print some information about our NIC */
537 printk(KERN_INFO "%s: %s at %#lx, IRQ %d, %s\n", 536 printk(KERN_INFO "%s: %s at %#lx, IRQ %d, %pM\n",
538 net_dev->name, card_name, ioaddr, net_dev->irq, 537 net_dev->name, card_name, ioaddr, net_dev->irq,
539 print_mac(mac, net_dev->dev_addr)); 538 net_dev->dev_addr);
540 539
541 /* Detect Wake on Lan support */ 540 /* Detect Wake on Lan support */
542 ret = (inl(net_dev->base_addr + CFGPMC) & PMESP) >> 27; 541 ret = (inl(net_dev->base_addr + CFGPMC) & PMESP) >> 27;
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 43f4c730be42..7911839f7375 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -149,24 +149,6 @@ static u32 wol_supported(const struct skge_hw *hw)
149 return WAKE_MAGIC | WAKE_PHY; 149 return WAKE_MAGIC | WAKE_PHY;
150} 150}
151 151
152static u32 pci_wake_enabled(struct pci_dev *dev)
153{
154 int pm = pci_find_capability(dev, PCI_CAP_ID_PM);
155 u16 value;
156
157 /* If device doesn't support PM Capabilities, but request is to disable
158 * wake events, it's a nop; otherwise fail */
159 if (!pm)
160 return 0;
161
162 pci_read_config_word(dev, pm + PCI_PM_PMC, &value);
163
164 value &= PCI_PM_CAP_PME_MASK;
165 value >>= ffs(PCI_PM_CAP_PME_MASK) - 1; /* First bit of mask */
166
167 return value != 0;
168}
169
170static void skge_wol_init(struct skge_port *skge) 152static void skge_wol_init(struct skge_port *skge)
171{ 153{
172 struct skge_hw *hw = skge->hw; 154 struct skge_hw *hw = skge->hw;
@@ -254,10 +236,14 @@ static int skge_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
254 struct skge_port *skge = netdev_priv(dev); 236 struct skge_port *skge = netdev_priv(dev);
255 struct skge_hw *hw = skge->hw; 237 struct skge_hw *hw = skge->hw;
256 238
257 if (wol->wolopts & ~wol_supported(hw)) 239 if ((wol->wolopts & ~wol_supported(hw))
240 || !device_can_wakeup(&hw->pdev->dev))
258 return -EOPNOTSUPP; 241 return -EOPNOTSUPP;
259 242
260 skge->wol = wol->wolopts; 243 skge->wol = wol->wolopts;
244
245 device_set_wakeup_enable(&hw->pdev->dev, skge->wol);
246
261 return 0; 247 return 0;
262} 248}
263 249
@@ -3856,7 +3842,7 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
3856 skge->speed = -1; 3842 skge->speed = -1;
3857 skge->advertising = skge_supported_modes(hw); 3843 skge->advertising = skge_supported_modes(hw);
3858 3844
3859 if (pci_wake_enabled(hw->pdev)) 3845 if (device_may_wakeup(&hw->pdev->dev))
3860 skge->wol = wol_supported(hw) & WAKE_MAGIC; 3846 skge->wol = wol_supported(hw) & WAKE_MAGIC;
3861 3847
3862 hw->dev[port] = dev; 3848 hw->dev[port] = dev;
@@ -3885,11 +3871,10 @@ static struct net_device *skge_devinit(struct skge_hw *hw, int port,
3885static void __devinit skge_show_addr(struct net_device *dev) 3871static void __devinit skge_show_addr(struct net_device *dev)
3886{ 3872{
3887 const struct skge_port *skge = netdev_priv(dev); 3873 const struct skge_port *skge = netdev_priv(dev);
3888 DECLARE_MAC_BUF(mac);
3889 3874
3890 if (netif_msg_probe(skge)) 3875 if (netif_msg_probe(skge))
3891 printk(KERN_INFO PFX "%s: addr %s\n", 3876 printk(KERN_INFO PFX "%s: addr %pM\n",
3892 dev->name, print_mac(mac, dev->dev_addr)); 3877 dev->name, dev->dev_addr);
3893} 3878}
3894 3879
3895static int __devinit skge_probe(struct pci_dev *pdev, 3880static int __devinit skge_probe(struct pci_dev *pdev,
@@ -4082,8 +4067,8 @@ static int skge_suspend(struct pci_dev *pdev, pm_message_t state)
4082 } 4067 }
4083 4068
4084 skge_write32(hw, B0_IMSK, 0); 4069 skge_write32(hw, B0_IMSK, 0);
4085 pci_enable_wake(pdev, pci_choose_state(pdev, state), wol); 4070
4086 pci_set_power_state(pdev, pci_choose_state(pdev, state)); 4071 pci_prepare_to_sleep(pdev);
4087 4072
4088 return 0; 4073 return 0;
4089} 4074}
@@ -4096,7 +4081,7 @@ static int skge_resume(struct pci_dev *pdev)
4096 if (!hw) 4081 if (!hw)
4097 return 0; 4082 return 0;
4098 4083
4099 err = pci_set_power_state(pdev, PCI_D0); 4084 err = pci_back_from_sleep(pdev);
4100 if (err) 4085 if (err)
4101 goto out; 4086 goto out;
4102 4087
@@ -4104,8 +4089,6 @@ static int skge_resume(struct pci_dev *pdev)
4104 if (err) 4089 if (err)
4105 goto out; 4090 goto out;
4106 4091
4107 pci_enable_wake(pdev, PCI_D0, 0);
4108
4109 err = skge_reset(hw); 4092 err = skge_reset(hw);
4110 if (err) 4093 if (err)
4111 goto out; 4094 goto out;
@@ -4146,8 +4129,8 @@ static void skge_shutdown(struct pci_dev *pdev)
4146 wol |= skge->wol; 4129 wol |= skge->wol;
4147 } 4130 }
4148 4131
4149 pci_enable_wake(pdev, PCI_D3hot, wol); 4132 if (pci_enable_wake(pdev, PCI_D3cold, wol))
4150 pci_enable_wake(pdev, PCI_D3cold, wol); 4133 pci_enable_wake(pdev, PCI_D3hot, wol);
4151 4134
4152 pci_disable_device(pdev); 4135 pci_disable_device(pdev);
4153 pci_set_power_state(pdev, PCI_D3hot); 4136 pci_set_power_state(pdev, PCI_D3hot);
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 3813d15e2df7..4dcd1a62fb49 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -4118,11 +4118,10 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
4118static void __devinit sky2_show_addr(struct net_device *dev) 4118static void __devinit sky2_show_addr(struct net_device *dev)
4119{ 4119{
4120 const struct sky2_port *sky2 = netdev_priv(dev); 4120 const struct sky2_port *sky2 = netdev_priv(dev);
4121 DECLARE_MAC_BUF(mac);
4122 4121
4123 if (netif_msg_probe(sky2)) 4122 if (netif_msg_probe(sky2))
4124 printk(KERN_INFO PFX "%s: addr %s\n", 4123 printk(KERN_INFO PFX "%s: addr %pM\n",
4125 dev->name, print_mac(mac, dev->dev_addr)); 4124 dev->name, dev->dev_addr);
4126} 4125}
4127 4126
4128/* Handle software interrupt used during MSI test */ 4127/* Handle software interrupt used during MSI test */
diff --git a/drivers/net/smc-mca.c b/drivers/net/smc-mca.c
index d6abb68e6e2f..58a0e0a4a325 100644
--- a/drivers/net/smc-mca.c
+++ b/drivers/net/smc-mca.c
@@ -196,7 +196,6 @@ static int __init ultramca_probe(struct device *gen_dev)
196 int tirq = 0; 196 int tirq = 0;
197 int base_addr = ultra_io[ultra_found]; 197 int base_addr = ultra_io[ultra_found];
198 int irq = ultra_irq[ultra_found]; 198 int irq = ultra_irq[ultra_found];
199 DECLARE_MAC_BUF(mac);
200 199
201 if (base_addr || irq) { 200 if (base_addr || irq) {
202 printk(KERN_INFO "Probing for SMC MCA adapter"); 201 printk(KERN_INFO "Probing for SMC MCA adapter");
@@ -334,8 +333,8 @@ static int __init ultramca_probe(struct device *gen_dev)
334 for (i = 0; i < 6; i++) 333 for (i = 0; i < 6; i++)
335 dev->dev_addr[i] = inb(ioaddr + 8 + i); 334 dev->dev_addr[i] = inb(ioaddr + 8 + i);
336 335
337 printk(KERN_INFO "smc_mca[%d]: Parameters: %#3x, %s", 336 printk(KERN_INFO "smc_mca[%d]: Parameters: %#3x, %pM",
338 slot + 1, ioaddr, print_mac(mac, dev->dev_addr)); 337 slot + 1, ioaddr, dev->dev_addr);
339 338
340 /* Switch from the station address to the alternate register set 339 /* Switch from the station address to the alternate register set
341 * and read the useful registers there. 340 * and read the useful registers there.
diff --git a/drivers/net/smc-ultra.c b/drivers/net/smc-ultra.c
index 00d6cf1af484..0fe0251767bb 100644
--- a/drivers/net/smc-ultra.c
+++ b/drivers/net/smc-ultra.c
@@ -198,7 +198,6 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
198 unsigned char num_pages, irqreg, addr, piomode; 198 unsigned char num_pages, irqreg, addr, piomode;
199 unsigned char idreg = inb(ioaddr + 7); 199 unsigned char idreg = inb(ioaddr + 7);
200 unsigned char reg4 = inb(ioaddr + 4) & 0x7f; 200 unsigned char reg4 = inb(ioaddr + 4) & 0x7f;
201 DECLARE_MAC_BUF(mac);
202 201
203 if (!request_region(ioaddr, ULTRA_IO_EXTENT, DRV_NAME)) 202 if (!request_region(ioaddr, ULTRA_IO_EXTENT, DRV_NAME))
204 return -EBUSY; 203 return -EBUSY;
@@ -228,8 +227,8 @@ static int __init ultra_probe1(struct net_device *dev, int ioaddr)
228 for (i = 0; i < 6; i++) 227 for (i = 0; i < 6; i++)
229 dev->dev_addr[i] = inb(ioaddr + 8 + i); 228 dev->dev_addr[i] = inb(ioaddr + 8 + i);
230 229
231 printk("%s: %s at %#3x, %s", dev->name, model_name, 230 printk("%s: %s at %#3x, %pM", dev->name, model_name,
232 ioaddr, print_mac(mac, dev->dev_addr)); 231 ioaddr, dev->dev_addr);
233 232
234 /* Switch from the station address to the alternate register set and 233 /* Switch from the station address to the alternate register set and
235 read the useful registers there. */ 234 read the useful registers there. */
diff --git a/drivers/net/smc-ultra32.c b/drivers/net/smc-ultra32.c
index a5a91ace28cc..cb6c097a2e0a 100644
--- a/drivers/net/smc-ultra32.c
+++ b/drivers/net/smc-ultra32.c
@@ -163,7 +163,6 @@ static int __init ultra32_probe1(struct net_device *dev, int ioaddr)
163 unsigned char idreg; 163 unsigned char idreg;
164 unsigned char reg4; 164 unsigned char reg4;
165 const char *ifmap[] = {"UTP No Link", "", "UTP/AUI", "UTP/BNC"}; 165 const char *ifmap[] = {"UTP No Link", "", "UTP/AUI", "UTP/BNC"};
166 DECLARE_MAC_BUF(mac);
167 166
168 if (!request_region(ioaddr, ULTRA32_IO_EXTENT, DRV_NAME)) 167 if (!request_region(ioaddr, ULTRA32_IO_EXTENT, DRV_NAME))
169 return -EBUSY; 168 return -EBUSY;
@@ -207,8 +206,8 @@ static int __init ultra32_probe1(struct net_device *dev, int ioaddr)
207 for (i = 0; i < 6; i++) 206 for (i = 0; i < 6; i++)
208 dev->dev_addr[i] = inb(ioaddr + 8 + i); 207 dev->dev_addr[i] = inb(ioaddr + 8 + i);
209 208
210 printk("%s: %s at 0x%X, %s", 209 printk("%s: %s at 0x%X, %pM",
211 dev->name, model_name, ioaddr, print_mac(mac, dev->dev_addr)); 210 dev->name, model_name, ioaddr, dev->dev_addr);
212 211
213 /* Switch from the station address to the alternate register set and 212 /* Switch from the station address to the alternate register set and
214 read the useful registers there. */ 213 read the useful registers there. */
diff --git a/drivers/net/smc9194.c b/drivers/net/smc9194.c
index de67744c4a2a..3bc733634a53 100644
--- a/drivers/net/smc9194.c
+++ b/drivers/net/smc9194.c
@@ -876,8 +876,6 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
876 word memory_info_register; 876 word memory_info_register;
877 word memory_cfg_register; 877 word memory_cfg_register;
878 878
879 DECLARE_MAC_BUF(mac);
880
881 /* Grab the region so that no one else tries to probe our ioports. */ 879 /* Grab the region so that no one else tries to probe our ioports. */
882 if (!request_region(ioaddr, SMC_IO_EXTENT, DRV_NAME)) 880 if (!request_region(ioaddr, SMC_IO_EXTENT, DRV_NAME))
883 return -EBUSY; 881 return -EBUSY;
@@ -1033,7 +1031,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
1033 /* 1031 /*
1034 . Print the Ethernet address 1032 . Print the Ethernet address
1035 */ 1033 */
1036 printk("ADDR: %s\n", print_mac(mac, dev->dev_addr)); 1034 printk("ADDR: %pM\n", dev->dev_addr);
1037 1035
1038 /* set the private data to zero by default */ 1036 /* set the private data to zero by default */
1039 memset(dev->priv, 0, sizeof(struct smc_local)); 1037 memset(dev->priv, 0, sizeof(struct smc_local));
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 6f9895d4e5bd..2d8bfa7bd9e9 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -1778,7 +1778,6 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
1778 int retval; 1778 int retval;
1779 unsigned int val, revision_register; 1779 unsigned int val, revision_register;
1780 const char *version_string; 1780 const char *version_string;
1781 DECLARE_MAC_BUF(mac);
1782 1781
1783 DBG(2, "%s: %s\n", CARDNAME, __func__); 1782 DBG(2, "%s: %s\n", CARDNAME, __func__);
1784 1783
@@ -1972,8 +1971,8 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
1972 "set using ifconfig\n", dev->name); 1971 "set using ifconfig\n", dev->name);
1973 } else { 1972 } else {
1974 /* Print the Ethernet address */ 1973 /* Print the Ethernet address */
1975 printk("%s: Ethernet addr: %s\n", 1974 printk("%s: Ethernet addr: %pM\n",
1976 dev->name, print_mac(mac, dev->dev_addr)); 1975 dev->name, dev->dev_addr);
1977 } 1976 }
1978 1977
1979 if (lp->phy_type == 0) { 1978 if (lp->phy_type == 0) {
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 1d2ef8f47780..32814183d5a3 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -653,7 +653,6 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
653 void __iomem *base; 653 void __iomem *base;
654 int drv_flags, io_size; 654 int drv_flags, io_size;
655 int boguscnt; 655 int boguscnt;
656 DECLARE_MAC_BUF(mac);
657 656
658/* when built into the kernel, we only print version if device is found */ 657/* when built into the kernel, we only print version if device is found */
659#ifndef MODULE 658#ifndef MODULE
@@ -823,9 +822,9 @@ static int __devinit starfire_init_one(struct pci_dev *pdev,
823 if (register_netdev(dev)) 822 if (register_netdev(dev))
824 goto err_out_cleardev; 823 goto err_out_cleardev;
825 824
826 printk(KERN_INFO "%s: %s at %p, %s, IRQ %d.\n", 825 printk(KERN_INFO "%s: %s at %p, %pM, IRQ %d.\n",
827 dev->name, netdrv_tbl[chip_idx].name, base, 826 dev->name, netdrv_tbl[chip_idx].name, base,
828 print_mac(mac, dev->dev_addr), irq); 827 dev->dev_addr, irq);
829 828
830 if (drv_flags & CanHaveMII) { 829 if (drv_flags & CanHaveMII) {
831 int phy, phy_idx = 0; 830 int phy, phy_idx = 0;
@@ -1452,12 +1451,8 @@ static int __netdev_rx(struct net_device *dev, int *quota)
1452#ifndef final_version /* Remove after testing. */ 1451#ifndef final_version /* Remove after testing. */
1453 /* You will want this info for the initial debug. */ 1452 /* You will want this info for the initial debug. */
1454 if (debug > 5) { 1453 if (debug > 5) {
1455 printk(KERN_DEBUG " Rx data " MAC_FMT " " MAC_FMT 1454 printk(KERN_DEBUG " Rx data %pM %pM %2.2x%2.2x.\n",
1456 " %2.2x%2.2x.\n", 1455 skb->data, skb->data + 6,
1457 skb->data[0], skb->data[1], skb->data[2],
1458 skb->data[3], skb->data[4], skb->data[5],
1459 skb->data[6], skb->data[7], skb->data[8],
1460 skb->data[9], skb->data[10], skb->data[11],
1461 skb->data[12], skb->data[13]); 1456 skb->data[12], skb->data[13]);
1462 } 1457 }
1463#endif 1458#endif
diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c
index 359452a06c67..608aa2f789d1 100644
--- a/drivers/net/sun3lance.c
+++ b/drivers/net/sun3lance.c
@@ -303,7 +303,6 @@ static int __init lance_probe( struct net_device *dev)
303 static int did_version; 303 static int did_version;
304 volatile unsigned short *ioaddr_probe; 304 volatile unsigned short *ioaddr_probe;
305 unsigned short tmp1, tmp2; 305 unsigned short tmp1, tmp2;
306 DECLARE_MAC_BUF(mac);
307 306
308#ifdef CONFIG_SUN3 307#ifdef CONFIG_SUN3
309 ioaddr = (unsigned long)ioremap(LANCE_OBIO, PAGE_SIZE); 308 ioaddr = (unsigned long)ioremap(LANCE_OBIO, PAGE_SIZE);
@@ -379,7 +378,7 @@ static int __init lance_probe( struct net_device *dev)
379 MEM->init.hwaddr[4] = dev->dev_addr[5]; 378 MEM->init.hwaddr[4] = dev->dev_addr[5];
380 MEM->init.hwaddr[5] = dev->dev_addr[4]; 379 MEM->init.hwaddr[5] = dev->dev_addr[4];
381 380
382 printk("%s\n", print_mac(mac, dev->dev_addr)); 381 printk("%pM\n", dev->dev_addr);
383 382
384 MEM->init.mode = 0x0000; 383 MEM->init.mode = 0x0000;
385 MEM->init.filter[0] = 0x00000000; 384 MEM->init.filter[0] = 0x00000000;
@@ -824,12 +823,10 @@ static int lance_rx( struct net_device *dev )
824#if 0 823#if 0
825 if (lance_debug >= 3) { 824 if (lance_debug >= 3) {
826 u_char *data = PKTBUF_ADDR(head); 825 u_char *data = PKTBUF_ADDR(head);
827 DECLARE_MAC_BUF(mac);
828 DECLARE_MAC_BUF(mac2)
829 printk("%s: RX pkt %d type 0x%04x" 826 printk("%s: RX pkt %d type 0x%04x"
830 " from %s to %s", 827 " from %pM to %pM",
831 dev->name, lp->new_tx, ((u_short *)data)[6], 828 dev->name, lp->new_tx, ((u_short *)data)[6],
832 print_mac(mac, &data[6]), print_mac(mac2, data)); 829 &data[6], data);
833 830
834 printk(" data %02x %02x %02x %02x %02x %02x %02x %02x " 831 printk(" data %02x %02x %02x %02x %02x %02x %02x %02x "
835 "len %d at %08x\n", 832 "len %d at %08x\n",
diff --git a/drivers/net/sunbmac.c b/drivers/net/sunbmac.c
index 018d0fca9422..e964395fceee 100644
--- a/drivers/net/sunbmac.c
+++ b/drivers/net/sunbmac.c
@@ -1081,7 +1081,6 @@ static int __devinit bigmac_ether_init(struct of_device *op,
1081 static int version_printed; 1081 static int version_printed;
1082 struct net_device *dev; 1082 struct net_device *dev;
1083 u8 bsizes, bsizes_more; 1083 u8 bsizes, bsizes_more;
1084 DECLARE_MAC_BUF(mac);
1085 struct bigmac *bp; 1084 struct bigmac *bp;
1086 int i; 1085 int i;
1087 1086
@@ -1212,8 +1211,8 @@ static int __devinit bigmac_ether_init(struct of_device *op,
1212 1211
1213 dev_set_drvdata(&bp->bigmac_op->dev, bp); 1212 dev_set_drvdata(&bp->bigmac_op->dev, bp);
1214 1213
1215 printk(KERN_INFO "%s: BigMAC 100baseT Ethernet %s\n", 1214 printk(KERN_INFO "%s: BigMAC 100baseT Ethernet %pM\n",
1216 dev->name, print_mac(mac, dev->dev_addr)); 1215 dev->name, dev->dev_addr);
1217 1216
1218 return 0; 1217 return 0;
1219 1218
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index f860ea150395..8c6a8941a054 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -468,7 +468,6 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
468 int bar = 1; 468 int bar = 1;
469#endif 469#endif
470 int phy, phy_end, phy_idx = 0; 470 int phy, phy_end, phy_idx = 0;
471 DECLARE_MAC_BUF(mac);
472 471
473/* when built into the kernel, we only print version if device is found */ 472/* when built into the kernel, we only print version if device is found */
474#ifndef MODULE 473#ifndef MODULE
@@ -547,9 +546,9 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
547 if (i) 546 if (i)
548 goto err_out_unmap_rx; 547 goto err_out_unmap_rx;
549 548
550 printk(KERN_INFO "%s: %s at %p, %s, IRQ %d.\n", 549 printk(KERN_INFO "%s: %s at %p, %pM, IRQ %d.\n",
551 dev->name, pci_id_tbl[chip_idx].name, ioaddr, 550 dev->name, pci_id_tbl[chip_idx].name, ioaddr,
552 print_mac(mac, dev->dev_addr), irq); 551 dev->dev_addr, irq);
553 552
554 np->phys[0] = 1; /* Default setting */ 553 np->phys[0] = 1; /* Default setting */
555 np->mii_preamble_required++; 554 np->mii_preamble_required++;
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 4291458955ef..250f08687b71 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2966,7 +2966,6 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
2966 struct net_device *dev; 2966 struct net_device *dev;
2967 struct gem *gp; 2967 struct gem *gp;
2968 int err, pci_using_dac; 2968 int err, pci_using_dac;
2969 DECLARE_MAC_BUF(mac);
2970 2969
2971 if (gem_version_printed++ == 0) 2970 if (gem_version_printed++ == 0)
2972 printk(KERN_INFO "%s", version); 2971 printk(KERN_INFO "%s", version);
@@ -3150,9 +3149,8 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
3150 goto err_out_free_consistent; 3149 goto err_out_free_consistent;
3151 } 3150 }
3152 3151
3153 printk(KERN_INFO "%s: Sun GEM (PCI) 10/100/1000BaseT Ethernet " 3152 printk(KERN_INFO "%s: Sun GEM (PCI) 10/100/1000BaseT Ethernet %pM\n",
3154 "%s\n", 3153 dev->name, dev->dev_addr);
3155 dev->name, print_mac(mac, dev->dev_addr));
3156 3154
3157 if (gp->phy_type == phy_mii_mdio0 || 3155 if (gp->phy_type == phy_mii_mdio0 ||
3158 gp->phy_type == phy_mii_mdio1) 3156 gp->phy_type == phy_mii_mdio1)
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c
index f1ebeb5f65b2..b55f7a4b52e7 100644
--- a/drivers/net/sunhme.c
+++ b/drivers/net/sunhme.c
@@ -2617,7 +2617,6 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe)
2617 struct net_device *dev; 2617 struct net_device *dev;
2618 int i, qfe_slot = -1; 2618 int i, qfe_slot = -1;
2619 int err = -ENODEV; 2619 int err = -ENODEV;
2620 DECLARE_MAC_BUF(mac);
2621 2620
2622 if (is_qfe) { 2621 if (is_qfe) {
2623 qp = quattro_sbus_find(op); 2622 qp = quattro_sbus_find(op);
@@ -2797,7 +2796,7 @@ static int __devinit happy_meal_sbus_probe_one(struct of_device *op, int is_qfe)
2797 printk(KERN_INFO "%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ", 2796 printk(KERN_INFO "%s: HAPPY MEAL (SBUS) 10/100baseT Ethernet ",
2798 dev->name); 2797 dev->name);
2799 2798
2800 printk("%s\n", print_mac(mac, dev->dev_addr)); 2799 printk("%pM\n", dev->dev_addr);
2801 2800
2802 return 0; 2801 return 0;
2803 2802
@@ -2932,7 +2931,6 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
2932 int i, qfe_slot = -1; 2931 int i, qfe_slot = -1;
2933 char prom_name[64]; 2932 char prom_name[64];
2934 int err; 2933 int err;
2935 DECLARE_MAC_BUF(mac);
2936 2934
2937 /* Now make sure pci_dev cookie is there. */ 2935 /* Now make sure pci_dev cookie is there. */
2938#ifdef CONFIG_SPARC 2936#ifdef CONFIG_SPARC
@@ -3141,7 +3139,7 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev,
3141 printk(KERN_INFO "%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ", 3139 printk(KERN_INFO "%s: HAPPY MEAL (PCI/CheerIO) 10/100BaseT Ethernet ",
3142 dev->name); 3140 dev->name);
3143 3141
3144 printk("%s\n", print_mac(mac, dev->dev_addr)); 3142 printk("%pM\n", dev->dev_addr);
3145 3143
3146 return 0; 3144 return 0;
3147 3145
diff --git a/drivers/net/sunlance.c b/drivers/net/sunlance.c
index 704301a5a7ff..c67cf94b5bff 100644
--- a/drivers/net/sunlance.c
+++ b/drivers/net/sunlance.c
@@ -1321,7 +1321,6 @@ static int __devinit sparc_lance_probe_one(struct of_device *op,
1321 static unsigned version_printed; 1321 static unsigned version_printed;
1322 struct lance_private *lp; 1322 struct lance_private *lp;
1323 struct net_device *dev; 1323 struct net_device *dev;
1324 DECLARE_MAC_BUF(mac);
1325 int i; 1324 int i;
1326 1325
1327 dev = alloc_etherdev(sizeof(struct lance_private) + 8); 1326 dev = alloc_etherdev(sizeof(struct lance_private) + 8);
@@ -1491,8 +1490,8 @@ no_link_test:
1491 1490
1492 dev_set_drvdata(&op->dev, lp); 1491 dev_set_drvdata(&op->dev, lp);
1493 1492
1494 printk(KERN_INFO "%s: LANCE %s\n", 1493 printk(KERN_INFO "%s: LANCE %pM\n",
1495 dev->name, print_mac(mac, dev->dev_addr)); 1494 dev->name, dev->dev_addr);
1496 1495
1497 return 0; 1496 return 0;
1498 1497
diff --git a/drivers/net/sunvnet.c b/drivers/net/sunvnet.c
index a720065553df..233f1cda36e5 100644
--- a/drivers/net/sunvnet.c
+++ b/drivers/net/sunvnet.c
@@ -1149,7 +1149,6 @@ static int __devinit vnet_port_probe(struct vio_dev *vdev,
1149 struct vnet *vp; 1149 struct vnet *vp;
1150 const u64 *rmac; 1150 const u64 *rmac;
1151 int len, i, err, switch_port; 1151 int len, i, err, switch_port;
1152 DECLARE_MAC_BUF(mac);
1153 1152
1154 print_version(); 1153 print_version();
1155 1154
@@ -1214,8 +1213,8 @@ static int __devinit vnet_port_probe(struct vio_dev *vdev,
1214 1213
1215 dev_set_drvdata(&vdev->dev, port); 1214 dev_set_drvdata(&vdev->dev, port);
1216 1215
1217 printk(KERN_INFO "%s: PORT ( remote-mac %s%s )\n", 1216 printk(KERN_INFO "%s: PORT ( remote-mac %pM%s )\n",
1218 vp->dev->name, print_mac(mac, port->raddr), 1217 vp->dev->name, port->raddr,
1219 switch_port ? " switch-port" : ""); 1218 switch_port ? " switch-port" : "");
1220 1219
1221 vio_port_up(&port->vio); 1220 vio_port_up(&port->vio);
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index df20cafff7dd..51de139491a0 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -236,7 +236,7 @@ struct tc35815_regs {
236#define Rx_Halted 0x00008000 /* Rx Halted */ 236#define Rx_Halted 0x00008000 /* Rx Halted */
237#define Rx_Good 0x00004000 /* Rx Good */ 237#define Rx_Good 0x00004000 /* Rx Good */
238#define Rx_RxPar 0x00002000 /* Rx Parity Error */ 238#define Rx_RxPar 0x00002000 /* Rx Parity Error */
239 /* 0x00001000 not use */ 239#define Rx_TypePkt 0x00001000 /* Rx Type Packet */
240#define Rx_LongErr 0x00000800 /* Rx Long Error */ 240#define Rx_LongErr 0x00000800 /* Rx Long Error */
241#define Rx_Over 0x00000400 /* Rx Overflow */ 241#define Rx_Over 0x00000400 /* Rx Overflow */
242#define Rx_CRCErr 0x00000200 /* Rx CRC Error */ 242#define Rx_CRCErr 0x00000200 /* Rx CRC Error */
@@ -244,8 +244,9 @@ struct tc35815_regs {
244#define Rx_10Stat 0x00000080 /* Rx 10Mbps Status */ 244#define Rx_10Stat 0x00000080 /* Rx 10Mbps Status */
245#define Rx_IntRx 0x00000040 /* Rx Interrupt */ 245#define Rx_IntRx 0x00000040 /* Rx Interrupt */
246#define Rx_CtlRecd 0x00000020 /* Rx Control Receive */ 246#define Rx_CtlRecd 0x00000020 /* Rx Control Receive */
247#define Rx_InLenErr 0x00000010 /* Rx In Range Frame Length Error */
247 248
248#define Rx_Stat_Mask 0x0000EFC0 /* Rx All Status Mask */ 249#define Rx_Stat_Mask 0x0000FFF0 /* Rx All Status Mask */
249 250
250/* Int_En bit asign -------------------------------------------------------- */ 251/* Int_En bit asign -------------------------------------------------------- */
251#define Int_NRAbtEn 0x00000800 /* 1:Non-recoverable Abort Enable */ 252#define Int_NRAbtEn 0x00000800 /* 1:Non-recoverable Abort Enable */
@@ -865,7 +866,6 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev,
865 struct net_device *dev; 866 struct net_device *dev;
866 struct tc35815_local *lp; 867 struct tc35815_local *lp;
867 int rc; 868 int rc;
868 DECLARE_MAC_BUF(mac);
869 869
870 static int printed_version; 870 static int printed_version;
871 if (!printed_version++) { 871 if (!printed_version++) {
@@ -942,11 +942,11 @@ static int __devinit tc35815_init_one(struct pci_dev *pdev,
942 goto err_out; 942 goto err_out;
943 943
944 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len); 944 memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
945 printk(KERN_INFO "%s: %s at 0x%lx, %s, IRQ %d\n", 945 printk(KERN_INFO "%s: %s at 0x%lx, %pM, IRQ %d\n",
946 dev->name, 946 dev->name,
947 chip_info[ent->driver_data].name, 947 chip_info[ent->driver_data].name,
948 dev->base_addr, 948 dev->base_addr,
949 print_mac(mac, dev->dev_addr), 949 dev->dev_addr,
950 dev->irq); 950 dev->irq);
951 951
952 rc = tc_mii_init(dev); 952 rc = tc_mii_init(dev);
@@ -1288,12 +1288,9 @@ panic_queues(struct net_device *dev)
1288 1288
1289static void print_eth(const u8 *add) 1289static void print_eth(const u8 *add)
1290{ 1290{
1291 DECLARE_MAC_BUF(mac);
1292
1293 printk(KERN_DEBUG "print_eth(%p)\n", add); 1291 printk(KERN_DEBUG "print_eth(%p)\n", add);
1294 printk(KERN_DEBUG " %s =>", print_mac(mac, add + 6)); 1292 printk(KERN_DEBUG " %pM => %pM : %02x%02x\n",
1295 printk(KERN_CONT " %s : %02x%02x\n", 1293 add + 6, add, add[12], add[13]);
1296 print_mac(mac, add), add[12], add[13]);
1297} 1294}
1298 1295
1299static int tc35815_tx_full(struct net_device *dev) 1296static int tc35815_tx_full(struct net_device *dev)
@@ -2153,13 +2150,12 @@ static void tc35815_set_cam_entry(struct net_device *dev, int index, unsigned ch
2153 int cam_index = index * 6; 2150 int cam_index = index * 6;
2154 u32 cam_data; 2151 u32 cam_data;
2155 u32 saved_addr; 2152 u32 saved_addr;
2156 DECLARE_MAC_BUF(mac);
2157 2153
2158 saved_addr = tc_readl(&tr->CAM_Adr); 2154 saved_addr = tc_readl(&tr->CAM_Adr);
2159 2155
2160 if (netif_msg_hw(lp)) 2156 if (netif_msg_hw(lp))
2161 printk(KERN_DEBUG "%s: CAM %d: %s\n", 2157 printk(KERN_DEBUG "%s: CAM %d: %pM\n",
2162 dev->name, index, print_mac(mac, addr)); 2158 dev->name, index, addr);
2163 if (index & 1) { 2159 if (index & 1) {
2164 /* read modify write */ 2160 /* read modify write */
2165 tc_writel(cam_index - 2, &tr->CAM_Adr); 2161 tc_writel(cam_index - 2, &tr->CAM_Adr);
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index eb9f8f3638e1..d0500db4f713 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -13252,7 +13252,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
13252 int err, pm_cap; 13252 int err, pm_cap;
13253 char str[40]; 13253 char str[40];
13254 u64 dma_mask, persist_dma_mask; 13254 u64 dma_mask, persist_dma_mask;
13255 DECLARE_MAC_BUF(mac);
13256 13255
13257 if (tg3_version_printed++ == 0) 13256 if (tg3_version_printed++ == 0)
13258 printk(KERN_INFO "%s", version); 13257 printk(KERN_INFO "%s", version);
@@ -13536,7 +13535,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
13536 } 13535 }
13537 13536
13538 printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] " 13537 printk(KERN_INFO "%s: Tigon3 [partno(%s) rev %04x PHY(%s)] "
13539 "(%s) %s Ethernet %s\n", 13538 "(%s) %s Ethernet %pM\n",
13540 dev->name, 13539 dev->name,
13541 tp->board_part_number, 13540 tp->board_part_number,
13542 tp->pci_chip_rev_id, 13541 tp->pci_chip_rev_id,
@@ -13545,7 +13544,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
13545 ((tp->tg3_flags & TG3_FLAG_10_100_ONLY) ? "10/100Base-TX" : 13544 ((tp->tg3_flags & TG3_FLAG_10_100_ONLY) ? "10/100Base-TX" :
13546 ((tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) ? "1000Base-SX" : 13545 ((tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) ? "1000Base-SX" :
13547 "10/100/1000Base-T")), 13546 "10/100/1000Base-T")),
13548 print_mac(mac, dev->dev_addr)); 13547 dev->dev_addr);
13549 13548
13550 printk(KERN_INFO "%s: RXcsums[%d] LinkChgREG[%d] " 13549 printk(KERN_INFO "%s: RXcsums[%d] LinkChgREG[%d] "
13551 "MIirq[%d] ASF[%d] WireSpeed[%d] TSOcap[%d]\n", 13550 "MIirq[%d] ASF[%d] WireSpeed[%d] TSOcap[%d]\n",
diff --git a/drivers/net/tokenring/abyss.c b/drivers/net/tokenring/abyss.c
index 7a7de0469eae..b566d6d79ecd 100644
--- a/drivers/net/tokenring/abyss.c
+++ b/drivers/net/tokenring/abyss.c
@@ -99,7 +99,6 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_
99 struct net_local *tp; 99 struct net_local *tp;
100 int ret, pci_irq_line; 100 int ret, pci_irq_line;
101 unsigned long pci_ioaddr; 101 unsigned long pci_ioaddr;
102 DECLARE_MAC_BUF(mac);
103 102
104 if (versionprinted++ == 0) 103 if (versionprinted++ == 0)
105 printk("%s", version); 104 printk("%s", version);
@@ -147,8 +146,7 @@ static int __devinit abyss_attach(struct pci_dev *pdev, const struct pci_device_
147 146
148 abyss_read_eeprom(dev); 147 abyss_read_eeprom(dev);
149 148
150 printk("%s: Ring Station Address: %s\n", 149 printk("%s: Ring Station Address: %pM\n", dev->name, dev->dev_addr);
151 dev->name, print_mac(mac, dev->dev_addr));
152 150
153 tp = netdev_priv(dev); 151 tp = netdev_priv(dev);
154 tp->setnselout = abyss_setnselout_pins; 152 tp->setnselout = abyss_setnselout_pins;
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c
index e494c63bfbd9..ad978982eee4 100644
--- a/drivers/net/tokenring/ibmtr.c
+++ b/drivers/net/tokenring/ibmtr.c
@@ -389,7 +389,6 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
389 unsigned long timeout; 389 unsigned long timeout;
390 static int version_printed; 390 static int version_printed;
391#endif 391#endif
392 DECLARE_MAC_BUF(mac);
393 392
394 /* Query the adapter PIO base port which will return 393 /* Query the adapter PIO base port which will return
395 * indication of where MMIO was placed. We also have a 394 * indication of where MMIO was placed. We also have a
@@ -703,8 +702,7 @@ static int __devinit ibmtr_probe1(struct net_device *dev, int PIOaddr)
703 channel_def[cardpresent - 1], adapter_def(ti->adapter_type)); 702 channel_def[cardpresent - 1], adapter_def(ti->adapter_type));
704 DPRINTK("using irq %d, PIOaddr %hx, %dK shared RAM.\n", 703 DPRINTK("using irq %d, PIOaddr %hx, %dK shared RAM.\n",
705 irq, PIOaddr, ti->mapped_ram_size / 2); 704 irq, PIOaddr, ti->mapped_ram_size / 2);
706 DPRINTK("Hardware address : %s\n", 705 DPRINTK("Hardware address : %pM\n", dev->dev_addr);
707 print_mac(mac, dev->dev_addr));
708 if (ti->page_mask) 706 if (ti->page_mask)
709 DPRINTK("Shared RAM paging enabled. " 707 DPRINTK("Shared RAM paging enabled. "
710 "Page size: %uK Shared Ram size %dK\n", 708 "Page size: %uK Shared Ram size %dK\n",
@@ -1741,8 +1739,6 @@ static void tr_rx(struct net_device *dev)
1741 void __iomem *trhhdr = rbuf + offsetof(struct rec_buf, data); 1739 void __iomem *trhhdr = rbuf + offsetof(struct rec_buf, data);
1742 u8 saddr[6]; 1740 u8 saddr[6];
1743 u8 daddr[6]; 1741 u8 daddr[6];
1744 DECLARE_MAC_BUF(mac);
1745 DECLARE_MAC_BUF(mac2);
1746 int i; 1742 int i;
1747 for (i = 0 ; i < 6 ; i++) 1743 for (i = 0 ; i < 6 ; i++)
1748 saddr[i] = readb(trhhdr + SADDR_OFST + i); 1744 saddr[i] = readb(trhhdr + SADDR_OFST + i);
@@ -1750,9 +1746,9 @@ static void tr_rx(struct net_device *dev)
1750 daddr[i] = readb(trhhdr + DADDR_OFST + i); 1746 daddr[i] = readb(trhhdr + DADDR_OFST + i);
1751 DPRINTK("Probably non-IP frame received.\n"); 1747 DPRINTK("Probably non-IP frame received.\n");
1752 DPRINTK("ssap: %02X dsap: %02X " 1748 DPRINTK("ssap: %02X dsap: %02X "
1753 "saddr: %s daddr: %$s\n", 1749 "saddr: %pM daddr: %pM\n",
1754 readb(llc + SSAP_OFST), readb(llc + DSAP_OFST), 1750 readb(llc + SSAP_OFST), readb(llc + DSAP_OFST),
1755 print_mac(mac, saddr), print_mac(mac2, daddr)); 1751 saddr, daddr);
1756 } 1752 }
1757#endif 1753#endif
1758 1754
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index 59d1673f9387..bd70e818212a 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -446,9 +446,6 @@ static int streamer_reset(struct net_device *dev)
446 unsigned int uaa_addr; 446 unsigned int uaa_addr;
447 struct sk_buff *skb = NULL; 447 struct sk_buff *skb = NULL;
448 __u16 misr; 448 __u16 misr;
449#if STREAMER_DEBUG
450 DECLARE_MAC_BUF(mac);
451#endif
452 449
453 streamer_priv = netdev_priv(dev); 450 streamer_priv = netdev_priv(dev);
454 streamer_mmio = streamer_priv->streamer_mmio; 451 streamer_mmio = streamer_priv->streamer_mmio;
@@ -577,8 +574,7 @@ static int streamer_reset(struct net_device *dev)
577 dev->dev_addr[i+1]= addr & 0xff; 574 dev->dev_addr[i+1]= addr & 0xff;
578 } 575 }
579#if STREAMER_DEBUG 576#if STREAMER_DEBUG
580 printk("Adapter address: %s\n", 577 printk("Adapter address: %pM\n", dev->dev_addr);
581 print_mac(mac, dev->dev_addr));
582#endif 578#endif
583 } 579 }
584 return 0; 580 return 0;
@@ -1538,7 +1534,6 @@ static void streamer_arb_cmd(struct net_device *dev)
1538 1534
1539#if STREAMER_NETWORK_MONITOR 1535#if STREAMER_NETWORK_MONITOR
1540 struct trh_hdr *mac_hdr; 1536 struct trh_hdr *mac_hdr;
1541 DECLARE_MAC_BUF(mac);
1542#endif 1537#endif
1543 1538
1544 writew(streamer_priv->arb, streamer_mmio + LAPA); 1539 writew(streamer_priv->arb, streamer_mmio + LAPA);
@@ -1611,11 +1606,11 @@ static void streamer_arb_cmd(struct net_device *dev)
1611 dev->name); 1606 dev->name);
1612 mac_hdr = tr_hdr(mac_frame); 1607 mac_hdr = tr_hdr(mac_frame);
1613 printk(KERN_WARNING 1608 printk(KERN_WARNING
1614 "%s: MAC Frame Dest. Addr: %s\n", 1609 "%s: MAC Frame Dest. Addr: %pM\n",
1615 dev->name, print_mac(mac, mac_hdr->daddr)); 1610 dev->name, mac_hdr->daddr);
1616 printk(KERN_WARNING 1611 printk(KERN_WARNING
1617 "%s: MAC Frame Srce. Addr: %s\n", 1612 "%s: MAC Frame Srce. Addr: %pM\n",
1618 dev->name, DEV->ADDR6(mac_hdr->saddr)); 1613 dev->name, mac_hdr->saddr);
1619#endif 1614#endif
1620 netif_rx(mac_frame); 1615 netif_rx(mac_frame);
1621 1616
@@ -1850,8 +1845,6 @@ static int sprintf_info(char *buffer, struct net_device *dev)
1850 struct streamer_parameters_table spt; 1845 struct streamer_parameters_table spt;
1851 int size = 0; 1846 int size = 0;
1852 int i; 1847 int i;
1853 DECLARE_MAC_BUF(mac);
1854 DECLARE_MAC_BUF(mac2);
1855 1848
1856 writew(streamer_priv->streamer_addr_table_addr, streamer_mmio + LAPA); 1849 writew(streamer_priv->streamer_addr_table_addr, streamer_mmio + LAPA);
1857 for (i = 0; i < 14; i += 2) { 1850 for (i = 0; i < 14; i += 2) {
@@ -1873,9 +1866,8 @@ static int sprintf_info(char *buffer, struct net_device *dev)
1873 size = sprintf(buffer, "\n%6s: Adapter Address : Node Address : Functional Addr\n", dev->name); 1866 size = sprintf(buffer, "\n%6s: Adapter Address : Node Address : Functional Addr\n", dev->name);
1874 1867
1875 size += sprintf(buffer + size, 1868 size += sprintf(buffer + size,
1876 "%6s: %s : %s : %02x:%02x:%02x:%02x\n", 1869 "%6s: %pM : %pM : %02x:%02x:%02x:%02x\n",
1877 dev->name, print_mac(mac, dev->dev_addr), 1870 dev->name, dev->dev_addr, sat.node_addr,
1878 print_mac(mac2, sat.node_addr),
1879 sat.func_addr[0], sat.func_addr[1], 1871 sat.func_addr[0], sat.func_addr[1],
1880 sat.func_addr[2], sat.func_addr[3]); 1872 sat.func_addr[2], sat.func_addr[3]);
1881 1873
@@ -1884,19 +1876,18 @@ static int sprintf_info(char *buffer, struct net_device *dev)
1884 size += sprintf(buffer + size, "%6s: Physical Addr : Up Node Address : Poll Address : AccPri : Auth Src : Att Code :\n", dev->name); 1876 size += sprintf(buffer + size, "%6s: Physical Addr : Up Node Address : Poll Address : AccPri : Auth Src : Att Code :\n", dev->name);
1885 1877
1886 size += sprintf(buffer + size, 1878 size += sprintf(buffer + size,
1887 "%6s: %02x:%02x:%02x:%02x : %s : %s : %04x : %04x : %04x :\n", 1879 "%6s: %02x:%02x:%02x:%02x : %pM : %pM : %04x : %04x : %04x :\n",
1888 dev->name, spt.phys_addr[0], spt.phys_addr[1], 1880 dev->name, spt.phys_addr[0], spt.phys_addr[1],
1889 spt.phys_addr[2], spt.phys_addr[3], 1881 spt.phys_addr[2], spt.phys_addr[3],
1890 print_mac(mac, spt.up_node_addr), 1882 spt.up_node_addr, spt.poll_addr,
1891 print_mac(mac2, spt.poll_addr),
1892 ntohs(spt.acc_priority), ntohs(spt.auth_source_class), 1883 ntohs(spt.acc_priority), ntohs(spt.auth_source_class),
1893 ntohs(spt.att_code)); 1884 ntohs(spt.att_code));
1894 1885
1895 size += sprintf(buffer + size, "%6s: Source Address : Bcn T : Maj. V : Lan St : Lcl Rg : Mon Err : Frame Correl : \n", dev->name); 1886 size += sprintf(buffer + size, "%6s: Source Address : Bcn T : Maj. V : Lan St : Lcl Rg : Mon Err : Frame Correl : \n", dev->name);
1896 1887
1897 size += sprintf(buffer + size, 1888 size += sprintf(buffer + size,
1898 "%6s: %s : %04x : %04x : %04x : %04x : %04x : %04x : \n", 1889 "%6s: %pM : %04x : %04x : %04x : %04x : %04x : %04x : \n",
1899 dev->name, print_mac(mac, spt.source_addr), 1890 dev->name, spt.source_addr,
1900 ntohs(spt.beacon_type), ntohs(spt.major_vector), 1891 ntohs(spt.beacon_type), ntohs(spt.major_vector),
1901 ntohs(spt.lan_status), ntohs(spt.local_ring), 1892 ntohs(spt.lan_status), ntohs(spt.local_ring),
1902 ntohs(spt.mon_error), ntohs(spt.frame_correl)); 1893 ntohs(spt.mon_error), ntohs(spt.frame_correl));
@@ -1905,10 +1896,10 @@ static int sprintf_info(char *buffer, struct net_device *dev)
1905 dev->name); 1896 dev->name);
1906 1897
1907 size += sprintf(buffer + size, 1898 size += sprintf(buffer + size,
1908 "%6s: : %02x : %02x : %s : %02x:%02x:%02x:%02x : \n", 1899 "%6s: : %02x : %02x : %pM : %02x:%02x:%02x:%02x : \n",
1909 dev->name, ntohs(spt.beacon_transmit), 1900 dev->name, ntohs(spt.beacon_transmit),
1910 ntohs(spt.beacon_receive), 1901 ntohs(spt.beacon_receive),
1911 print_mac(mac, spt.beacon_naun), 1902 spt.beacon_naun,
1912 spt.beacon_phys[0], spt.beacon_phys[1], 1903 spt.beacon_phys[0], spt.beacon_phys[1],
1913 spt.beacon_phys[2], spt.beacon_phys[3]); 1904 spt.beacon_phys[2], spt.beacon_phys[3]);
1914 return size; 1905 return size;
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c
index c9c5a2b1ed9e..0ba6f0bc7c00 100644
--- a/drivers/net/tokenring/madgemc.c
+++ b/drivers/net/tokenring/madgemc.c
@@ -152,7 +152,6 @@ static int __devinit madgemc_probe(struct device *device)
152 struct card_info *card; 152 struct card_info *card;
153 struct mca_device *mdev = to_mca_device(device); 153 struct mca_device *mdev = to_mca_device(device);
154 int ret = 0; 154 int ret = 0;
155 DECLARE_MAC_BUF(mac);
156 155
157 if (versionprinted++ == 0) 156 if (versionprinted++ == 0)
158 printk("%s", version); 157 printk("%s", version);
@@ -323,8 +322,8 @@ static int __devinit madgemc_probe(struct device *device)
323 mca_device_set_name(mdev, (card->cardtype == 0x08)?MADGEMC16_CARDNAME:MADGEMC32_CARDNAME); 322 mca_device_set_name(mdev, (card->cardtype == 0x08)?MADGEMC16_CARDNAME:MADGEMC32_CARDNAME);
324 mca_set_adapter_procfn(mdev->slot, madgemc_mcaproc, dev); 323 mca_set_adapter_procfn(mdev->slot, madgemc_mcaproc, dev);
325 324
326 printk("%s: Ring Station Address: %s\n", 325 printk("%s: Ring Station Address: %pM\n",
327 dev->name, print_mac(mac, dev->dev_addr)); 326 dev->name, dev->dev_addr);
328 327
329 if (tmsdev_init(dev, device)) { 328 if (tmsdev_init(dev, device)) {
330 printk("%s: unable to get memory for dev->priv.\n", 329 printk("%s: unable to get memory for dev->priv.\n",
@@ -690,7 +689,6 @@ static int madgemc_mcaproc(char *buf, int slot, void *d)
690 struct net_local *tp = netdev_priv(dev); 689 struct net_local *tp = netdev_priv(dev);
691 struct card_info *curcard = tp->tmspriv; 690 struct card_info *curcard = tp->tmspriv;
692 int len = 0; 691 int len = 0;
693 DECLARE_MAC_BUF(mac);
694 692
695 len += sprintf(buf+len, "-------\n"); 693 len += sprintf(buf+len, "-------\n");
696 if (curcard) { 694 if (curcard) {
@@ -714,8 +712,8 @@ static int madgemc_mcaproc(char *buf, int slot, void *d)
714 } 712 }
715 len += sprintf(buf+len, " (%s)\n", (curcard->fairness)?"Unfair":"Fair"); 713 len += sprintf(buf+len, " (%s)\n", (curcard->fairness)?"Unfair":"Fair");
716 714
717 len += sprintf(buf+len, "Ring Station Address: %s\n", 715 len += sprintf(buf+len, "Ring Station Address: %pM\n",
718 print_mac(mac, dev->dev_addr)); 716 dev->dev_addr);
719 } else 717 } else
720 len += sprintf(buf+len, "Card not configured\n"); 718 len += sprintf(buf+len, "Card not configured\n");
721 719
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index 0ab51a0f35fc..f78bc5d40708 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -421,10 +421,7 @@ static int olympic_init(struct net_device *dev)
421 memcpy_fromio(&dev->dev_addr[0], adapter_addr,6); 421 memcpy_fromio(&dev->dev_addr[0], adapter_addr,6);
422 422
423#if OLYMPIC_DEBUG 423#if OLYMPIC_DEBUG
424 { 424 printk("adapter address: %pM\n", dev->dev_addr);
425 DECLARE_MAC_BUF(mac);
426 printk("adapter address: %s\n", print_mac(mac, dev->dev_addr));
427 }
428#endif 425#endif
429 426
430 olympic_priv->olympic_addr_table_addr = swab16(readw(init_srb + 12)); 427 olympic_priv->olympic_addr_table_addr = swab16(readw(init_srb + 12));
@@ -441,7 +438,6 @@ static int olympic_open(struct net_device *dev)
441 unsigned long flags, t; 438 unsigned long flags, t;
442 int i, open_finished = 1 ; 439 int i, open_finished = 1 ;
443 u8 resp, err; 440 u8 resp, err;
444 DECLARE_MAC_BUF(mac);
445 441
446 DECLARE_WAITQUEUE(wait,current) ; 442 DECLARE_WAITQUEUE(wait,current) ;
447 443
@@ -569,8 +565,8 @@ static int olympic_open(struct net_device *dev)
569 goto out; 565 goto out;
570 566
571 case 0x32: 567 case 0x32:
572 printk(KERN_WARNING "%s: Invalid LAA: %s\n", 568 printk(KERN_WARNING "%s: Invalid LAA: %pM\n",
573 dev->name, print_mac(mac, olympic_priv->olympic_laa)); 569 dev->name, olympic_priv->olympic_laa);
574 goto out; 570 goto out;
575 571
576 default: 572 default:
@@ -704,13 +700,12 @@ static int olympic_open(struct net_device *dev)
704 u8 __iomem *opt; 700 u8 __iomem *opt;
705 int i; 701 int i;
706 u8 addr[6]; 702 u8 addr[6];
707 DECLARE_MAC_BUF(mac);
708 oat = (olympic_priv->olympic_lap + olympic_priv->olympic_addr_table_addr); 703 oat = (olympic_priv->olympic_lap + olympic_priv->olympic_addr_table_addr);
709 opt = (olympic_priv->olympic_lap + olympic_priv->olympic_parms_addr); 704 opt = (olympic_priv->olympic_lap + olympic_priv->olympic_parms_addr);
710 705
711 for (i = 0; i < 6; i++) 706 for (i = 0; i < 6; i++)
712 addr[i] = readb(oat+offsetof(struct olympic_adapter_addr_table,node_addr)+i); 707 addr[i] = readb(oat+offsetof(struct olympic_adapter_addr_table,node_addr)+i);
713 printk("%s: Node Address: %s\n",dev->name, print_mac(mac, addr)); 708 printk("%s: Node Address: %pM\n", dev->name, addr);
714 printk("%s: Functional Address: %02x:%02x:%02x:%02x\n",dev->name, 709 printk("%s: Functional Address: %02x:%02x:%02x:%02x\n",dev->name,
715 readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)), 710 readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)),
716 readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+1), 711 readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+1),
@@ -719,7 +714,7 @@ static int olympic_open(struct net_device *dev)
719 714
720 for (i = 0; i < 6; i++) 715 for (i = 0; i < 6; i++)
721 addr[i] = readb(opt+offsetof(struct olympic_parameters_table, up_node_addr)+i); 716 addr[i] = readb(opt+offsetof(struct olympic_parameters_table, up_node_addr)+i);
722 printk("%s: NAUN Address: %s\n",dev->name, print_mac(mac, addr)); 717 printk("%s: NAUN Address: %pM\n", dev->name, addr);
723 } 718 }
724 719
725 netif_start_queue(dev); 720 netif_start_queue(dev);
@@ -1440,16 +1435,10 @@ static void olympic_arb_cmd(struct net_device *dev)
1440 struct trh_hdr *mac_hdr; 1435 struct trh_hdr *mac_hdr;
1441 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name); 1436 printk(KERN_WARNING "%s: Received MAC Frame, details: \n",dev->name);
1442 mac_hdr = tr_hdr(mac_frame); 1437 mac_hdr = tr_hdr(mac_frame);
1443 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: " 1438 printk(KERN_WARNING "%s: MAC Frame Dest. Addr: %pM\n",
1444 MAC_FMT " \n", dev->name, 1439 dev->name, mac_hdr->daddr);
1445 mac_hdr->daddr[0], mac_hdr->daddr[1], 1440 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: %pM\n",
1446 mac_hdr->daddr[2], mac_hdr->daddr[3], 1441 dev->name, mac_hdr->saddr);
1447 mac_hdr->daddr[4], mac_hdr->daddr[5]);
1448 printk(KERN_WARNING "%s: MAC Frame Srce. Addr: "
1449 MAC_FMT " \n", dev->name,
1450 mac_hdr->saddr[0], mac_hdr->saddr[1],
1451 mac_hdr->saddr[2], mac_hdr->saddr[3],
1452 mac_hdr->saddr[4], mac_hdr->saddr[5]);
1453 } 1442 }
1454 netif_rx(mac_frame); 1443 netif_rx(mac_frame);
1455 dev->last_rx = jiffies; 1444 dev->last_rx = jiffies;
@@ -1647,8 +1636,6 @@ static int olympic_proc_info(char *buffer, char **start, off_t offset, int lengt
1647 u8 addr[6]; 1636 u8 addr[6];
1648 u8 addr2[6]; 1637 u8 addr2[6];
1649 int i; 1638 int i;
1650 DECLARE_MAC_BUF(mac);
1651 DECLARE_MAC_BUF(mac2);
1652 1639
1653 size = sprintf(buffer, 1640 size = sprintf(buffer,
1654 "IBM Pit/Pit-Phy/Olympic Chipset Token Ring Adapter %s\n",dev->name); 1641 "IBM Pit/Pit-Phy/Olympic Chipset Token Ring Adapter %s\n",dev->name);
@@ -1658,10 +1645,9 @@ static int olympic_proc_info(char *buffer, char **start, off_t offset, int lengt
1658 for (i = 0 ; i < 6 ; i++) 1645 for (i = 0 ; i < 6 ; i++)
1659 addr[i] = readb(oat+offsetof(struct olympic_adapter_addr_table,node_addr) + i); 1646 addr[i] = readb(oat+offsetof(struct olympic_adapter_addr_table,node_addr) + i);
1660 1647
1661 size += sprintf(buffer+size, "%6s: %s : %s : %02x:%02x:%02x:%02x\n", 1648 size += sprintf(buffer+size, "%6s: %pM : %pM : %02x:%02x:%02x:%02x\n",
1662 dev->name, 1649 dev->name,
1663 print_mac(mac, dev->dev_addr), 1650 dev->dev_addr, addr,
1664 print_mac(mac2, addr),
1665 readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)), 1651 readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)),
1666 readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+1), 1652 readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+1),
1667 readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+2), 1653 readb(oat+offsetof(struct olympic_adapter_addr_table,func_addr)+2),
@@ -1677,14 +1663,13 @@ static int olympic_proc_info(char *buffer, char **start, off_t offset, int lengt
1677 for (i = 0 ; i < 6 ; i++) 1663 for (i = 0 ; i < 6 ; i++)
1678 addr2[i] = readb(opt+offsetof(struct olympic_parameters_table, poll_addr) + i); 1664 addr2[i] = readb(opt+offsetof(struct olympic_parameters_table, poll_addr) + i);
1679 1665
1680 size += sprintf(buffer+size, "%6s: %02x:%02x:%02x:%02x : %s : %s : %04x : %04x : %04x :\n", 1666 size += sprintf(buffer+size, "%6s: %02x:%02x:%02x:%02x : %pM : %pM : %04x : %04x : %04x :\n",
1681 dev->name, 1667 dev->name,
1682 readb(opt+offsetof(struct olympic_parameters_table, phys_addr)), 1668 readb(opt+offsetof(struct olympic_parameters_table, phys_addr)),
1683 readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+1), 1669 readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+1),
1684 readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+2), 1670 readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+2),
1685 readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+3), 1671 readb(opt+offsetof(struct olympic_parameters_table, phys_addr)+3),
1686 print_mac(mac, addr), 1672 addr, addr2,
1687 print_mac(mac2, addr2),
1688 swab16(readw(opt+offsetof(struct olympic_parameters_table, acc_priority))), 1673 swab16(readw(opt+offsetof(struct olympic_parameters_table, acc_priority))),
1689 swab16(readw(opt+offsetof(struct olympic_parameters_table, auth_source_class))), 1674 swab16(readw(opt+offsetof(struct olympic_parameters_table, auth_source_class))),
1690 swab16(readw(opt+offsetof(struct olympic_parameters_table, att_code)))); 1675 swab16(readw(opt+offsetof(struct olympic_parameters_table, att_code))));
@@ -1694,9 +1679,8 @@ static int olympic_proc_info(char *buffer, char **start, off_t offset, int lengt
1694 1679
1695 for (i = 0 ; i < 6 ; i++) 1680 for (i = 0 ; i < 6 ; i++)
1696 addr[i] = readb(opt+offsetof(struct olympic_parameters_table, source_addr) + i); 1681 addr[i] = readb(opt+offsetof(struct olympic_parameters_table, source_addr) + i);
1697 size += sprintf(buffer+size, "%6s: %s : %04x : %04x : %04x : %04x : %04x : %04x : \n", 1682 size += sprintf(buffer+size, "%6s: %pM : %04x : %04x : %04x : %04x : %04x : %04x : \n",
1698 dev->name, 1683 dev->name, addr,
1699 print_mac(mac, addr),
1700 swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_type))), 1684 swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_type))),
1701 swab16(readw(opt+offsetof(struct olympic_parameters_table, major_vector))), 1685 swab16(readw(opt+offsetof(struct olympic_parameters_table, major_vector))),
1702 swab16(readw(opt+offsetof(struct olympic_parameters_table, lan_status))), 1686 swab16(readw(opt+offsetof(struct olympic_parameters_table, lan_status))),
@@ -1709,11 +1693,11 @@ static int olympic_proc_info(char *buffer, char **start, off_t offset, int lengt
1709 1693
1710 for (i = 0 ; i < 6 ; i++) 1694 for (i = 0 ; i < 6 ; i++)
1711 addr[i] = readb(opt+offsetof(struct olympic_parameters_table, beacon_naun) + i); 1695 addr[i] = readb(opt+offsetof(struct olympic_parameters_table, beacon_naun) + i);
1712 size += sprintf(buffer+size, "%6s: : %02x : %02x : %s : %02x:%02x:%02x:%02x : \n", 1696 size += sprintf(buffer+size, "%6s: : %02x : %02x : %pM : %02x:%02x:%02x:%02x : \n",
1713 dev->name, 1697 dev->name,
1714 swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_transmit))), 1698 swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_transmit))),
1715 swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_receive))), 1699 swab16(readw(opt+offsetof(struct olympic_parameters_table, beacon_receive))),
1716 print_mac(mac, addr), 1700 addr,
1717 readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)), 1701 readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)),
1718 readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)+1), 1702 readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)+1),
1719 readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)+2), 1703 readb(opt+offsetof(struct olympic_parameters_table, beacon_phys)+2),
diff --git a/drivers/net/tokenring/proteon.c b/drivers/net/tokenring/proteon.c
index 00ea94513460..cd2d62f76079 100644
--- a/drivers/net/tokenring/proteon.c
+++ b/drivers/net/tokenring/proteon.c
@@ -122,7 +122,6 @@ static int __init setup_card(struct net_device *dev, struct device *pdev)
122 static int versionprinted; 122 static int versionprinted;
123 const unsigned *port; 123 const unsigned *port;
124 int j,err = 0; 124 int j,err = 0;
125 DECLARE_MAC_BUF(mac);
126 125
127 if (!dev) 126 if (!dev)
128 return -ENOMEM; 127 return -ENOMEM;
@@ -153,8 +152,8 @@ static int __init setup_card(struct net_device *dev, struct device *pdev)
153 152
154 proteon_read_eeprom(dev); 153 proteon_read_eeprom(dev);
155 154
156 printk(KERN_DEBUG "proteon.c: Ring Station Address: %s\n", 155 printk(KERN_DEBUG "proteon.c: Ring Station Address: %pM\n",
157 print_mac(mac, dev->dev_addr)); 156 dev->dev_addr);
158 157
159 tp = netdev_priv(dev); 158 tp = netdev_priv(dev);
160 tp->setnselout = proteon_setnselout_pins; 159 tp->setnselout = proteon_setnselout_pins;
diff --git a/drivers/net/tokenring/skisa.c b/drivers/net/tokenring/skisa.c
index 41b6999a0f33..b578744311b0 100644
--- a/drivers/net/tokenring/skisa.c
+++ b/drivers/net/tokenring/skisa.c
@@ -139,7 +139,6 @@ static int __init setup_card(struct net_device *dev, struct device *pdev)
139 static int versionprinted; 139 static int versionprinted;
140 const unsigned *port; 140 const unsigned *port;
141 int j, err = 0; 141 int j, err = 0;
142 DECLARE_MAC_BUF(mac);
143 142
144 if (!dev) 143 if (!dev)
145 return -ENOMEM; 144 return -ENOMEM;
@@ -170,8 +169,8 @@ static int __init setup_card(struct net_device *dev, struct device *pdev)
170 169
171 sk_isa_read_eeprom(dev); 170 sk_isa_read_eeprom(dev);
172 171
173 printk(KERN_DEBUG "skisa.c: Ring Station Address: %s\n", 172 printk(KERN_DEBUG "skisa.c: Ring Station Address: %pM\n",
174 print_mac(mac, dev->dev_addr)); 173 dev->dev_addr);
175 174
176 tp = netdev_priv(dev); 175 tp = netdev_priv(dev);
177 tp->setnselout = sk_isa_setnselout_pins; 176 tp->setnselout = sk_isa_setnselout_pins;
diff --git a/drivers/net/tokenring/tmspci.c b/drivers/net/tokenring/tmspci.c
index 5f0ee880cfff..5f601773c260 100644
--- a/drivers/net/tokenring/tmspci.c
+++ b/drivers/net/tokenring/tmspci.c
@@ -100,7 +100,6 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic
100 unsigned int pci_irq_line; 100 unsigned int pci_irq_line;
101 unsigned long pci_ioaddr; 101 unsigned long pci_ioaddr;
102 struct card_info *cardinfo = &card_info_table[ent->driver_data]; 102 struct card_info *cardinfo = &card_info_table[ent->driver_data];
103 DECLARE_MAC_BUF(mac);
104 103
105 if (versionprinted++ == 0) 104 if (versionprinted++ == 0)
106 printk("%s", version); 105 printk("%s", version);
@@ -137,8 +136,8 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic
137 136
138 tms_pci_read_eeprom(dev); 137 tms_pci_read_eeprom(dev);
139 138
140 printk("%s: Ring Station Address: %s\n", 139 printk("%s: Ring Station Address: %pM\n",
141 dev->name, print_mac(mac, dev->dev_addr)); 140 dev->name, dev->dev_addr);
142 141
143 ret = tmsdev_init(dev, &pdev->dev); 142 ret = tmsdev_init(dev, &pdev->dev);
144 if (ret) { 143 if (ret) {
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index eb1da6f0b086..6924805e765e 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -1569,7 +1569,6 @@ tsi108_init_one(struct platform_device *pdev)
1569 struct tsi108_prv_data *data = NULL; 1569 struct tsi108_prv_data *data = NULL;
1570 hw_info *einfo; 1570 hw_info *einfo;
1571 int err = 0; 1571 int err = 0;
1572 DECLARE_MAC_BUF(mac);
1573 1572
1574 einfo = pdev->dev.platform_data; 1573 einfo = pdev->dev.platform_data;
1575 1574
@@ -1659,8 +1658,8 @@ tsi108_init_one(struct platform_device *pdev)
1659 } 1658 }
1660 1659
1661 platform_set_drvdata(pdev, dev); 1660 platform_set_drvdata(pdev, dev);
1662 printk(KERN_INFO "%s: Tsi108 Gigabit Ethernet, MAC: %s\n", 1661 printk(KERN_INFO "%s: Tsi108 Gigabit Ethernet, MAC: %pM\n",
1663 dev->name, print_mac(mac, dev->dev_addr)); 1662 dev->name, dev->dev_addr);
1664#ifdef DEBUG 1663#ifdef DEBUG
1665 data->msg_enable = DEBUG; 1664 data->msg_enable = DEBUG;
1666 dump_eth_one(dev); 1665 dump_eth_one(dev);
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 124d5d690dde..08076182df7c 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -1932,7 +1932,6 @@ static int __devinit de_init_one (struct pci_dev *pdev,
1932 void __iomem *regs; 1932 void __iomem *regs;
1933 unsigned long pciaddr; 1933 unsigned long pciaddr;
1934 static int board_idx = -1; 1934 static int board_idx = -1;
1935 DECLARE_MAC_BUF(mac);
1936 1935
1937 board_idx++; 1936 board_idx++;
1938 1937
@@ -2046,11 +2045,11 @@ static int __devinit de_init_one (struct pci_dev *pdev,
2046 goto err_out_iomap; 2045 goto err_out_iomap;
2047 2046
2048 /* print info about board and interface just registered */ 2047 /* print info about board and interface just registered */
2049 printk (KERN_INFO "%s: %s at 0x%lx, %s, IRQ %d\n", 2048 printk (KERN_INFO "%s: %s at 0x%lx, %pM, IRQ %d\n",
2050 dev->name, 2049 dev->name,
2051 de->de21040 ? "21040" : "21041", 2050 de->de21040 ? "21040" : "21041",
2052 dev->base_addr, 2051 dev->base_addr,
2053 print_mac(mac, dev->dev_addr), 2052 dev->dev_addr,
2054 dev->irq); 2053 dev->irq);
2055 2054
2056 pci_set_drvdata(pdev, dev); 2055 pci_set_drvdata(pdev, dev);
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 6444cbec0bdc..1e7d5e29a5ae 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1085,7 +1085,6 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)
1085 struct de4x5_private *lp = netdev_priv(dev); 1085 struct de4x5_private *lp = netdev_priv(dev);
1086 struct pci_dev *pdev = NULL; 1086 struct pci_dev *pdev = NULL;
1087 int i, status=0; 1087 int i, status=0;
1088 DECLARE_MAC_BUF(mac);
1089 1088
1090 gendev->driver_data = dev; 1089 gendev->driver_data = dev;
1091 1090
@@ -1122,7 +1121,7 @@ de4x5_hw_init(struct net_device *dev, u_long iobase, struct device *gendev)
1122 printk ("%s: %s at 0x%04lx", gendev->bus_id, name, iobase); 1121 printk ("%s: %s at 0x%04lx", gendev->bus_id, name, iobase);
1123 1122
1124 status = get_hw_addr(dev); 1123 status = get_hw_addr(dev);
1125 printk(", h/w address %s\n", print_mac(mac, dev->dev_addr)); 1124 printk(", h/w address %pM\n", dev->dev_addr);
1126 1125
1127 if (status != 0) { 1126 if (status != 0) {
1128 printk(" which has an Ethernet PROM CRC error.\n"); 1127 printk(" which has an Ethernet PROM CRC error.\n");
@@ -5401,7 +5400,6 @@ static void
5401de4x5_dbg_srom(struct de4x5_srom *p) 5400de4x5_dbg_srom(struct de4x5_srom *p)
5402{ 5401{
5403 int i; 5402 int i;
5404 DECLARE_MAC_BUF(mac);
5405 5403
5406 if (de4x5_debug & DEBUG_SROM) { 5404 if (de4x5_debug & DEBUG_SROM) {
5407 printk("Sub-system Vendor ID: %04x\n", *((u_short *)p->sub_vendor_id)); 5405 printk("Sub-system Vendor ID: %04x\n", *((u_short *)p->sub_vendor_id));
@@ -5410,7 +5408,7 @@ de4x5_dbg_srom(struct de4x5_srom *p)
5410 printk("SROM version: %02x\n", (u_char)(p->version)); 5408 printk("SROM version: %02x\n", (u_char)(p->version));
5411 printk("# controllers: %02x\n", (u_char)(p->num_controllers)); 5409 printk("# controllers: %02x\n", (u_char)(p->num_controllers));
5412 5410
5413 printk("Hardware Address: %s\n", print_mac(mac, p->ieee_addr)); 5411 printk("Hardware Address: %pM\n", p->ieee_addr);
5414 printk("CRC checksum: %04x\n", (u_short)(p->chksum)); 5412 printk("CRC checksum: %04x\n", (u_short)(p->chksum));
5415 for (i=0; i<64; i++) { 5413 for (i=0; i<64; i++) {
5416 printk("%3d %04x\n", i<<1, (u_short)*((u_short *)p+i)); 5414 printk("%3d %04x\n", i<<1, (u_short)*((u_short *)p+i));
@@ -5424,12 +5422,10 @@ static void
5424de4x5_dbg_rx(struct sk_buff *skb, int len) 5422de4x5_dbg_rx(struct sk_buff *skb, int len)
5425{ 5423{
5426 int i, j; 5424 int i, j;
5427 DECLARE_MAC_BUF(mac);
5428 DECLARE_MAC_BUF(mac2);
5429 5425
5430 if (de4x5_debug & DEBUG_RX) { 5426 if (de4x5_debug & DEBUG_RX) {
5431 printk("R: %s <- %s len/SAP:%02x%02x [%d]\n", 5427 printk("R: %pM <- %pM len/SAP:%02x%02x [%d]\n",
5432 print_mac(mac, skb->data), print_mac(mac2, &skb->data[6]), 5428 skb->data, &skb->data[6],
5433 (u_char)skb->data[12], 5429 (u_char)skb->data[12],
5434 (u_char)skb->data[13], 5430 (u_char)skb->data[13],
5435 len); 5431 len);
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index c91852f49a48..0ec3281529f9 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -362,7 +362,6 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
362 struct net_device *dev; 362 struct net_device *dev;
363 u32 pci_pmr; 363 u32 pci_pmr;
364 int i, err; 364 int i, err;
365 DECLARE_MAC_BUF(mac);
366 365
367 DMFE_DBUG(0, "dmfe_init_one()", 0); 366 DMFE_DBUG(0, "dmfe_init_one()", 0);
368 367
@@ -475,12 +474,11 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
475 if (err) 474 if (err)
476 goto err_out_free_buf; 475 goto err_out_free_buf;
477 476
478 printk(KERN_INFO "%s: Davicom DM%04lx at pci%s, " 477 printk(KERN_INFO "%s: Davicom DM%04lx at pci%s, %pM, irq %d.\n",
479 "%s, irq %d.\n",
480 dev->name, 478 dev->name,
481 ent->driver_data >> 16, 479 ent->driver_data >> 16,
482 pci_name(pdev), 480 pci_name(pdev),
483 print_mac(mac, dev->dev_addr), 481 dev->dev_addr,
484 dev->irq); 482 dev->irq);
485 483
486 pci_set_master(pdev); 484 pci_set_master(pdev);
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index cafa89e60167..1c5ef230b770 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -1050,13 +1050,11 @@ static void set_rx_mode(struct net_device *dev)
1050 filterbit = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26; 1050 filterbit = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
1051 filterbit &= 0x3f; 1051 filterbit &= 0x3f;
1052 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); 1052 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31);
1053 if (tulip_debug > 2) { 1053 if (tulip_debug > 2)
1054 DECLARE_MAC_BUF(mac); 1054 printk(KERN_INFO "%s: Added filter for %pM"
1055 printk(KERN_INFO "%s: Added filter for %s"
1056 " %8.8x bit %d.\n", 1055 " %8.8x bit %d.\n",
1057 dev->name, print_mac(mac, mclist->dmi_addr), 1056 dev->name, mclist->dmi_addr,
1058 ether_crc(ETH_ALEN, mclist->dmi_addr), filterbit); 1057 ether_crc(ETH_ALEN, mclist->dmi_addr), filterbit);
1059 }
1060 } 1058 }
1061 if (mc_filter[0] == tp->mc_filter[0] && 1059 if (mc_filter[0] == tp->mc_filter[0] &&
1062 mc_filter[1] == tp->mc_filter[1]) 1060 mc_filter[1] == tp->mc_filter[1])
@@ -1250,7 +1248,6 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1250 const char *chip_name = tulip_tbl[chip_idx].chip_name; 1248 const char *chip_name = tulip_tbl[chip_idx].chip_name;
1251 unsigned int eeprom_missing = 0; 1249 unsigned int eeprom_missing = 0;
1252 unsigned int force_csr0 = 0; 1250 unsigned int force_csr0 = 0;
1253 DECLARE_MAC_BUF(mac);
1254 1251
1255#ifndef MODULE 1252#ifndef MODULE
1256 static int did_version; /* Already printed version info. */ 1253 static int did_version; /* Already printed version info. */
@@ -1635,7 +1632,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev,
1635 1632
1636 if (eeprom_missing) 1633 if (eeprom_missing)
1637 printk(" EEPROM not present,"); 1634 printk(" EEPROM not present,");
1638 printk(" %s", print_mac(mac, dev->dev_addr)); 1635 printk(" %pM", dev->dev_addr);
1639 printk(", IRQ %d.\n", irq); 1636 printk(", IRQ %d.\n", irq);
1640 1637
1641 if (tp->chip_id == PNIC2) 1638 if (tp->chip_id == PNIC2)
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c
index e9e628621639..298649a236cb 100644
--- a/drivers/net/tulip/uli526x.c
+++ b/drivers/net/tulip/uli526x.c
@@ -261,7 +261,6 @@ static int __devinit uli526x_init_one (struct pci_dev *pdev,
261 struct uli526x_board_info *db; /* board information structure */ 261 struct uli526x_board_info *db; /* board information structure */
262 struct net_device *dev; 262 struct net_device *dev;
263 int i, err; 263 int i, err;
264 DECLARE_MAC_BUF(mac);
265 264
266 ULI526X_DBUG(0, "uli526x_init_one()", 0); 265 ULI526X_DBUG(0, "uli526x_init_one()", 0);
267 266
@@ -379,9 +378,9 @@ static int __devinit uli526x_init_one (struct pci_dev *pdev,
379 if (err) 378 if (err)
380 goto err_out_res; 379 goto err_out_res;
381 380
382 printk(KERN_INFO "%s: ULi M%04lx at pci%s, %s, irq %d.\n", 381 printk(KERN_INFO "%s: ULi M%04lx at pci%s, %pM, irq %d.\n",
383 dev->name,ent->driver_data >> 16,pci_name(pdev), 382 dev->name,ent->driver_data >> 16,pci_name(pdev),
384 print_mac(mac, dev->dev_addr), dev->irq); 383 dev->dev_addr, dev->irq);
385 384
386 pci_set_master(pdev); 385 pci_set_master(pdev);
387 386
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 50068194c163..e4cb408a70fe 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -355,7 +355,6 @@ static int __devinit w840_probe1 (struct pci_dev *pdev,
355 int irq; 355 int irq;
356 int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0; 356 int i, option = find_cnt < MAX_UNITS ? options[find_cnt] : 0;
357 void __iomem *ioaddr; 357 void __iomem *ioaddr;
358 DECLARE_MAC_BUF(mac);
359 358
360 i = pci_enable_device(pdev); 359 i = pci_enable_device(pdev);
361 if (i) return i; 360 if (i) return i;
@@ -435,9 +434,9 @@ static int __devinit w840_probe1 (struct pci_dev *pdev,
435 if (i) 434 if (i)
436 goto err_out_cleardev; 435 goto err_out_cleardev;
437 436
438 printk(KERN_INFO "%s: %s at %p, %s, IRQ %d.\n", 437 printk(KERN_INFO "%s: %s at %p, %pM, IRQ %d.\n",
439 dev->name, pci_id_tbl[chip_idx].name, ioaddr, 438 dev->name, pci_id_tbl[chip_idx].name, ioaddr,
440 print_mac(mac, dev->dev_addr), irq); 439 dev->dev_addr, irq);
441 440
442 if (np->drv_flags & CanHaveMII) { 441 if (np->drv_flags & CanHaveMII) {
443 int phy, phy_idx = 0; 442 int phy, phy_idx = 0;
@@ -1245,16 +1244,12 @@ static int netdev_rx(struct net_device *dev)
1245 } 1244 }
1246#ifndef final_version /* Remove after testing. */ 1245#ifndef final_version /* Remove after testing. */
1247 /* You will want this info for the initial debug. */ 1246 /* You will want this info for the initial debug. */
1248 if (debug > 5) { 1247 if (debug > 5)
1249 DECLARE_MAC_BUF(mac); 1248 printk(KERN_DEBUG " Rx data %pM %pM"
1250 DECLARE_MAC_BUF(mac2);
1251
1252 printk(KERN_DEBUG " Rx data %s %s"
1253 " %2.2x%2.2x %d.%d.%d.%d.\n", 1249 " %2.2x%2.2x %d.%d.%d.%d.\n",
1254 print_mac(mac, &skb->data[0]), print_mac(mac2, &skb->data[6]), 1250 &skb->data[0], &skb->data[6],
1255 skb->data[12], skb->data[13], 1251 skb->data[12], skb->data[13],
1256 skb->data[14], skb->data[15], skb->data[16], skb->data[17]); 1252 skb->data[14], skb->data[15], skb->data[16], skb->data[17]);
1257 }
1258#endif 1253#endif
1259 skb->protocol = eth_type_trans(skb, dev); 1254 skb->protocol = eth_type_trans(skb, dev);
1260 netif_rx(skb); 1255 netif_rx(skb);
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c
index 6b93d0169116..3c0b96b0e925 100644
--- a/drivers/net/tulip/xircom_cb.c
+++ b/drivers/net/tulip/xircom_cb.c
@@ -1072,7 +1072,6 @@ static void read_mac_address(struct xircom_private *card)
1072 unsigned char j, tuple, link, data_id, data_count; 1072 unsigned char j, tuple, link, data_id, data_count;
1073 unsigned long flags; 1073 unsigned long flags;
1074 int i; 1074 int i;
1075 DECLARE_MAC_BUF(mac);
1076 1075
1077 enter("read_mac_address"); 1076 enter("read_mac_address");
1078 1077
@@ -1102,7 +1101,7 @@ static void read_mac_address(struct xircom_private *card)
1102 } 1101 }
1103 } 1102 }
1104 spin_unlock_irqrestore(&card->lock, flags); 1103 spin_unlock_irqrestore(&card->lock, flags);
1105 pr_debug(" %s\n", print_mac(mac, card->dev->dev_addr)); 1104 pr_debug(" %pM\n", card->dev->dev_addr);
1106 leave("read_mac_address"); 1105 leave("read_mac_address");
1107} 1106}
1108 1107
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 6daea0c91862..64c7fc7ff08d 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -883,7 +883,6 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
883 void __user* argp = (void __user*)arg; 883 void __user* argp = (void __user*)arg;
884 struct ifreq ifr; 884 struct ifreq ifr;
885 int ret; 885 int ret;
886 DECLARE_MAC_BUF(mac);
887 886
888 if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89) 887 if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89)
889 if (copy_from_user(&ifr, argp, sizeof ifr)) 888 if (copy_from_user(&ifr, argp, sizeof ifr))
@@ -1011,8 +1010,8 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
1011 1010
1012 case SIOCSIFHWADDR: 1011 case SIOCSIFHWADDR:
1013 /* Set hw address */ 1012 /* Set hw address */
1014 DBG(KERN_DEBUG "%s: set hw address: %s\n", 1013 DBG(KERN_DEBUG "%s: set hw address: %pM\n",
1015 tun->dev->name, print_mac(mac, ifr.ifr_hwaddr.sa_data)); 1014 tun->dev->name, ifr.ifr_hwaddr.sa_data);
1016 1015
1017 rtnl_lock(); 1016 rtnl_lock();
1018 ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr); 1017 ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr);
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 734ce0977f02..6f191e9f610b 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -2311,7 +2311,6 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2311 struct cmd_desc xp_cmd; 2311 struct cmd_desc xp_cmd;
2312 struct resp_desc xp_resp[3]; 2312 struct resp_desc xp_resp[3];
2313 int err = 0; 2313 int err = 0;
2314 DECLARE_MAC_BUF(mac);
2315 2314
2316 if(!did_version++) 2315 if(!did_version++)
2317 printk(KERN_INFO "%s", version); 2316 printk(KERN_INFO "%s", version);
@@ -2526,11 +2525,11 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2526 2525
2527 pci_set_drvdata(pdev, dev); 2526 pci_set_drvdata(pdev, dev);
2528 2527
2529 printk(KERN_INFO "%s: %s at %s 0x%llx, %s\n", 2528 printk(KERN_INFO "%s: %s at %s 0x%llx, %pM\n",
2530 dev->name, typhoon_card_info[card_id].name, 2529 dev->name, typhoon_card_info[card_id].name,
2531 use_mmio ? "MMIO" : "IO", 2530 use_mmio ? "MMIO" : "IO",
2532 (unsigned long long)pci_resource_start(pdev, use_mmio), 2531 (unsigned long long)pci_resource_start(pdev, use_mmio),
2533 print_mac(mac, dev->dev_addr)); 2532 dev->dev_addr);
2534 2533
2535 /* xp_resp still contains the response to the READ_VERSIONS command. 2534 /* xp_resp still contains the response to the READ_VERSIONS command.
2536 * For debugging, let the user know what version he has. 2535 * For debugging, let the user know what version he has.
diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
index 7914867110ed..c073929c4d75 100644
--- a/drivers/net/usb/pegasus.c
+++ b/drivers/net/usb/pegasus.c
@@ -1309,7 +1309,6 @@ static int pegasus_probe(struct usb_interface *intf,
1309 pegasus_t *pegasus; 1309 pegasus_t *pegasus;
1310 int dev_index = id - pegasus_ids; 1310 int dev_index = id - pegasus_ids;
1311 int res = -ENOMEM; 1311 int res = -ENOMEM;
1312 DECLARE_MAC_BUF(mac);
1313 1312
1314 usb_get_dev(dev); 1313 usb_get_dev(dev);
1315 1314
@@ -1386,10 +1385,10 @@ static int pegasus_probe(struct usb_interface *intf,
1386 queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check, 1385 queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check,
1387 CARRIER_CHECK_DELAY); 1386 CARRIER_CHECK_DELAY);
1388 1387
1389 dev_info(&intf->dev, "%s, %s, %s\n", 1388 dev_info(&intf->dev, "%s, %s, %pM\n",
1390 net->name, 1389 net->name,
1391 usb_dev_id[dev_index].name, 1390 usb_dev_id[dev_index].name,
1392 print_mac(mac, net->dev_addr)); 1391 net->dev_addr);
1393 return 0; 1392 return 0;
1394 1393
1395out3: 1394out3:
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 51e2f5d7d14e..e0d349f74642 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -759,7 +759,6 @@ static int smsc95xx_reset(struct usbnet *dev)
759 struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); 759 struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
760 u32 read_buf, write_buf, burst_cap; 760 u32 read_buf, write_buf, burst_cap;
761 int ret = 0, timeout; 761 int ret = 0, timeout;
762 DECLARE_MAC_BUF(mac);
763 762
764 if (netif_msg_ifup(dev)) 763 if (netif_msg_ifup(dev))
765 devdbg(dev, "entering smsc95xx_reset"); 764 devdbg(dev, "entering smsc95xx_reset");
@@ -818,8 +817,7 @@ static int smsc95xx_reset(struct usbnet *dev)
818 return ret; 817 return ret;
819 818
820 if (netif_msg_ifup(dev)) 819 if (netif_msg_ifup(dev))
821 devdbg(dev, "MAC Address: %s", 820 devdbg(dev, "MAC Address: %pM", dev->net->dev_addr);
822 print_mac(mac, dev->net->dev_addr));
823 821
824 ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf); 822 ret = smsc95xx_read_reg(dev, HW_CFG, &read_buf);
825 if (ret < 0) { 823 if (ret < 0) {
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 02d25c743994..aa3149078888 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1125,7 +1125,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
1125 struct usb_device *xdev; 1125 struct usb_device *xdev;
1126 int status; 1126 int status;
1127 const char *name; 1127 const char *name;
1128 DECLARE_MAC_BUF(mac);
1129 1128
1130 name = udev->dev.driver->name; 1129 name = udev->dev.driver->name;
1131 info = (struct driver_info *) prod->driver_info; 1130 info = (struct driver_info *) prod->driver_info;
@@ -1236,11 +1235,11 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
1236 if (status) 1235 if (status)
1237 goto out3; 1236 goto out3;
1238 if (netif_msg_probe (dev)) 1237 if (netif_msg_probe (dev))
1239 devinfo (dev, "register '%s' at usb-%s-%s, %s, %s", 1238 devinfo (dev, "register '%s' at usb-%s-%s, %s, %pM",
1240 udev->dev.driver->name, 1239 udev->dev.driver->name,
1241 xdev->bus->bus_name, xdev->devpath, 1240 xdev->bus->bus_name, xdev->devpath,
1242 dev->driver_info->description, 1241 dev->driver_info->description,
1243 print_mac(mac, net->dev_addr)); 1242 net->dev_addr);
1244 1243
1245 // ok, it's ready to go. 1244 // ok, it's ready to go.
1246 usb_set_intfdata (udev, dev); 1245 usb_set_intfdata (udev, dev);
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 31cd817f33f9..75b40fefc4ee 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -8,7 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <linux/list.h>
12#include <linux/netdevice.h> 11#include <linux/netdevice.h>
13#include <linux/ethtool.h> 12#include <linux/ethtool.h>
14#include <linux/etherdevice.h> 13#include <linux/etherdevice.h>
@@ -30,14 +29,10 @@ struct veth_net_stats {
30 29
31struct veth_priv { 30struct veth_priv {
32 struct net_device *peer; 31 struct net_device *peer;
33 struct net_device *dev;
34 struct list_head list;
35 struct veth_net_stats *stats; 32 struct veth_net_stats *stats;
36 unsigned ip_summed; 33 unsigned ip_summed;
37}; 34};
38 35
39static LIST_HEAD(veth_list);
40
41/* 36/*
42 * ethtool interface 37 * ethtool interface
43 */ 38 */
@@ -420,14 +415,10 @@ static int veth_newlink(struct net_device *dev,
420 */ 415 */
421 416
422 priv = netdev_priv(dev); 417 priv = netdev_priv(dev);
423 priv->dev = dev;
424 priv->peer = peer; 418 priv->peer = peer;
425 list_add(&priv->list, &veth_list);
426 419
427 priv = netdev_priv(peer); 420 priv = netdev_priv(peer);
428 priv->dev = peer;
429 priv->peer = dev; 421 priv->peer = dev;
430 INIT_LIST_HEAD(&priv->list);
431 return 0; 422 return 0;
432 423
433err_register_dev: 424err_register_dev:
@@ -449,13 +440,6 @@ static void veth_dellink(struct net_device *dev)
449 priv = netdev_priv(dev); 440 priv = netdev_priv(dev);
450 peer = priv->peer; 441 peer = priv->peer;
451 442
452 if (!list_empty(&priv->list))
453 list_del(&priv->list);
454
455 priv = netdev_priv(peer);
456 if (!list_empty(&priv->list))
457 list_del(&priv->list);
458
459 unregister_netdevice(dev); 443 unregister_netdevice(dev);
460 unregister_netdevice(peer); 444 unregister_netdevice(peer);
461} 445}
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 5b7870080c56..bb54a936a807 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -631,7 +631,6 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
631#else 631#else
632 int bar = 0; 632 int bar = 0;
633#endif 633#endif
634 DECLARE_MAC_BUF(mac);
635 634
636/* when built into the kernel, we only print version if device is found */ 635/* when built into the kernel, we only print version if device is found */
637#ifndef MODULE 636#ifndef MODULE
@@ -787,14 +786,14 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
787 if (rc) 786 if (rc)
788 goto err_out_unmap; 787 goto err_out_unmap;
789 788
790 printk(KERN_INFO "%s: VIA %s at 0x%lx, %s, IRQ %d.\n", 789 printk(KERN_INFO "%s: VIA %s at 0x%lx, %pM, IRQ %d.\n",
791 dev->name, name, 790 dev->name, name,
792#ifdef USE_MMIO 791#ifdef USE_MMIO
793 memaddr, 792 memaddr,
794#else 793#else
795 (long)ioaddr, 794 (long)ioaddr,
796#endif 795#endif
797 print_mac(mac, dev->dev_addr), pdev->irq); 796 dev->dev_addr, pdev->irq);
798 797
799 pci_set_drvdata(pdev, dev); 798 pci_set_drvdata(pdev, dev);
800 799
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 0196a0df9021..68f908a57ac3 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -325,9 +325,7 @@ static int xmit_skb(struct virtnet_info *vi, struct sk_buff *skb)
325 325
326 sg_init_table(sg, 2+MAX_SKB_FRAGS); 326 sg_init_table(sg, 2+MAX_SKB_FRAGS);
327 327
328 pr_debug("%s: xmit %p " MAC_FMT "\n", vi->dev->name, skb, 328 pr_debug("%s: xmit %p %pM\n", vi->dev->name, skb, dest);
329 dest[0], dest[1], dest[2],
330 dest[3], dest[4], dest[5]);
331 329
332 /* Encode metadata header at front. */ 330 /* Encode metadata header at front. */
333 hdr = skb_vnet_hdr(skb); 331 hdr = skb_vnet_hdr(skb);
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 5f1ccb2b08b1..7d16ca3cb93c 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -730,8 +730,7 @@ static int __devinit dscc4_init_one(struct pci_dev *pdev,
730 goto err_free_mmio_region_1; 730 goto err_free_mmio_region_1;
731 } 731 }
732 732
733 ioaddr = ioremap(pci_resource_start(pdev, 0), 733 ioaddr = pci_ioremap_bar(pdev, 0);
734 pci_resource_len(pdev, 0));
735 if (!ioaddr) { 734 if (!ioaddr) {
736 printk(KERN_ERR "%s: cannot remap MMIO region %llx @ %llx\n", 735 printk(KERN_ERR "%s: cannot remap MMIO region %llx @ %llx\n",
737 DRV_NAME, (unsigned long long)pci_resource_len(pdev, 0), 736 DRV_NAME, (unsigned long long)pci_resource_len(pdev, 0),
diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c
index bf1b01590429..222671165223 100644
--- a/drivers/net/wan/pc300too.c
+++ b/drivers/net/wan/pc300too.c
@@ -379,7 +379,7 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev,
379 card->scabase = ioremap(scaphys, PC300_SCA_SIZE); 379 card->scabase = ioremap(scaphys, PC300_SCA_SIZE);
380 380
381 ramphys = pci_resource_start(pdev,3) & PCI_BASE_ADDRESS_MEM_MASK; 381 ramphys = pci_resource_start(pdev,3) & PCI_BASE_ADDRESS_MEM_MASK;
382 card->rambase = ioremap(ramphys, pci_resource_len(pdev,3)); 382 card->rambase = pci_ioremap_bar(pdev, 3);
383 383
384 if (card->plxbase == NULL || 384 if (card->plxbase == NULL ||
385 card->scabase == NULL || 385 card->scabase == NULL ||
diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c
index b595b64e7538..bba111cdeebe 100644
--- a/drivers/net/wan/pci200syn.c
+++ b/drivers/net/wan/pci200syn.c
@@ -343,7 +343,7 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev,
343 card->scabase = ioremap(scaphys, PCI200SYN_SCA_SIZE); 343 card->scabase = ioremap(scaphys, PCI200SYN_SCA_SIZE);
344 344
345 ramphys = pci_resource_start(pdev,3) & PCI_BASE_ADDRESS_MEM_MASK; 345 ramphys = pci_resource_start(pdev,3) & PCI_BASE_ADDRESS_MEM_MASK;
346 card->rambase = ioremap(ramphys, pci_resource_len(pdev,3)); 346 card->rambase = pci_ioremap_bar(pdev, 3);
347 347
348 if (card->plxbase == NULL || 348 if (card->plxbase == NULL ||
349 card->scabase == NULL || 349 card->scabase == NULL ||
diff --git a/drivers/net/wd.c b/drivers/net/wd.c
index fa14255282af..6d96ed472119 100644
--- a/drivers/net/wd.c
+++ b/drivers/net/wd.c
@@ -156,7 +156,6 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
156 int word16 = 0; /* 0 = 8 bit, 1 = 16 bit */ 156 int word16 = 0; /* 0 = 8 bit, 1 = 16 bit */
157 const char *model_name; 157 const char *model_name;
158 static unsigned version_printed; 158 static unsigned version_printed;
159 DECLARE_MAC_BUF(mac);
160 159
161 for (i = 0; i < 8; i++) 160 for (i = 0; i < 8; i++)
162 checksum += inb(ioaddr + 8 + i); 161 checksum += inb(ioaddr + 8 + i);
@@ -178,8 +177,8 @@ static int __init wd_probe1(struct net_device *dev, int ioaddr)
178 for (i = 0; i < 6; i++) 177 for (i = 0; i < 6; i++)
179 dev->dev_addr[i] = inb(ioaddr + 8 + i); 178 dev->dev_addr[i] = inb(ioaddr + 8 + i);
180 179
181 printk("%s: WD80x3 at %#3x, %s", 180 printk("%s: WD80x3 at %#3x, %pM",
182 dev->name, ioaddr, print_mac(mac, dev->dev_addr)); 181 dev->name, ioaddr, dev->dev_addr);
183 182
184 /* The following PureData probe code was contributed by 183 /* The following PureData probe code was contributed by
185 Mike Jagdis <jaggy@purplet.demon.co.uk>. Puredata does software 184 Mike Jagdis <jaggy@purplet.demon.co.uk>. Puredata does software
diff --git a/drivers/net/wireless/adm8211.c b/drivers/net/wireless/adm8211.c
index b2c050b68890..6e18c9d36787 100644
--- a/drivers/net/wireless/adm8211.c
+++ b/drivers/net/wireless/adm8211.c
@@ -1791,7 +1791,6 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
1791 int err; 1791 int err;
1792 u32 reg; 1792 u32 reg;
1793 u8 perm_addr[ETH_ALEN]; 1793 u8 perm_addr[ETH_ALEN];
1794 DECLARE_MAC_BUF(mac);
1795 1794
1796 err = pci_enable_device(pdev); 1795 err = pci_enable_device(pdev);
1797 if (err) { 1796 if (err) {
@@ -1925,8 +1924,8 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
1925 goto err_free_desc; 1924 goto err_free_desc;
1926 } 1925 }
1927 1926
1928 printk(KERN_INFO "%s: hwaddr %s, Rev 0x%02x\n", 1927 printk(KERN_INFO "%s: hwaddr %pM, Rev 0x%02x\n",
1929 wiphy_name(dev->wiphy), print_mac(mac, dev->wiphy->perm_addr), 1928 wiphy_name(dev->wiphy), dev->wiphy->perm_addr,
1930 pdev->revision); 1929 pdev->revision);
1931 1930
1932 return 0; 1931 return 0;
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 370133e492d2..7c99f5a5b332 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2757,7 +2757,6 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
2757 struct net_device *dev; 2757 struct net_device *dev;
2758 struct airo_info *ai; 2758 struct airo_info *ai;
2759 int i, rc; 2759 int i, rc;
2760 DECLARE_MAC_BUF(mac);
2761 2760
2762 /* Create the network device object. */ 2761 /* Create the network device object. */
2763 dev = alloc_netdev(sizeof(*ai), "", ether_setup); 2762 dev = alloc_netdev(sizeof(*ai), "", ether_setup);
@@ -2860,8 +2859,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
2860 goto err_out_reg; 2859 goto err_out_reg;
2861 2860
2862 set_bit(FLAG_REGISTERED,&ai->flags); 2861 set_bit(FLAG_REGISTERED,&ai->flags);
2863 airo_print_info(dev->name, "MAC enabled %s", 2862 airo_print_info(dev->name, "MAC enabled %pM", dev->dev_addr);
2864 print_mac(mac, dev->dev_addr));
2865 2863
2866 /* Allocate the transmit buffers */ 2864 /* Allocate the transmit buffers */
2867 if (probe && !test_bit(FLAG_MPI,&ai->flags)) 2865 if (probe && !test_bit(FLAG_MPI,&ai->flags))
@@ -2918,7 +2916,6 @@ int reset_airo_card( struct net_device *dev )
2918{ 2916{
2919 int i; 2917 int i;
2920 struct airo_info *ai = dev->priv; 2918 struct airo_info *ai = dev->priv;
2921 DECLARE_MAC_BUF(mac);
2922 2919
2923 if (reset_card (dev, 1)) 2920 if (reset_card (dev, 1))
2924 return -1; 2921 return -1;
@@ -2927,8 +2924,7 @@ int reset_airo_card( struct net_device *dev )
2927 airo_print_err(dev->name, "MAC could not be enabled"); 2924 airo_print_err(dev->name, "MAC could not be enabled");
2928 return -1; 2925 return -1;
2929 } 2926 }
2930 airo_print_info(dev->name, "MAC enabled %s", 2927 airo_print_info(dev->name, "MAC enabled %pM", dev->dev_addr);
2931 print_mac(mac, dev->dev_addr));
2932 /* Allocate the transmit buffers if needed */ 2928 /* Allocate the transmit buffers if needed */
2933 if (!test_bit(FLAG_MPI,&ai->flags)) 2929 if (!test_bit(FLAG_MPI,&ai->flags))
2934 for( i = 0; i < MAX_FIDS; i++ ) 2930 for( i = 0; i < MAX_FIDS; i++ )
@@ -5330,7 +5326,6 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
5330 int i; 5326 int i;
5331 char *ptr; 5327 char *ptr;
5332 APListRid APList_rid; 5328 APListRid APList_rid;
5333 DECLARE_MAC_BUF(mac);
5334 5329
5335 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5330 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5336 return -ENOMEM; 5331 return -ENOMEM;
@@ -5354,8 +5349,7 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
5354// We end when we find a zero MAC 5349// We end when we find a zero MAC
5355 if ( !*(int*)APList_rid.ap[i] && 5350 if ( !*(int*)APList_rid.ap[i] &&
5356 !*(int*)&APList_rid.ap[i][2]) break; 5351 !*(int*)&APList_rid.ap[i][2]) break;
5357 ptr += sprintf(ptr, "%s\n", 5352 ptr += sprintf(ptr, "%pM\n", APList_rid.ap[i]);
5358 print_mac(mac, APList_rid.ap[i]));
5359 } 5353 }
5360 if (i==0) ptr += sprintf(ptr, "Not using specific APs\n"); 5354 if (i==0) ptr += sprintf(ptr, "Not using specific APs\n");
5361 5355
@@ -5374,7 +5368,6 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
5374 int rc; 5368 int rc;
5375 /* If doLoseSync is not 1, we won't do a Lose Sync */ 5369 /* If doLoseSync is not 1, we won't do a Lose Sync */
5376 int doLoseSync = -1; 5370 int doLoseSync = -1;
5377 DECLARE_MAC_BUF(mac);
5378 5371
5379 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) 5372 if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
5380 return -ENOMEM; 5373 return -ENOMEM;
@@ -5411,8 +5404,8 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
5411 we have to add a spin lock... */ 5404 we have to add a spin lock... */
5412 rc = readBSSListRid(ai, doLoseSync, &BSSList_rid); 5405 rc = readBSSListRid(ai, doLoseSync, &BSSList_rid);
5413 while(rc == 0 && BSSList_rid.index != cpu_to_le16(0xffff)) { 5406 while(rc == 0 && BSSList_rid.index != cpu_to_le16(0xffff)) {
5414 ptr += sprintf(ptr, "%s %*s rssi = %d", 5407 ptr += sprintf(ptr, "%pM %*s rssi = %d",
5415 print_mac(mac, BSSList_rid.bssid), 5408 BSSList_rid.bssid,
5416 (int)BSSList_rid.ssidLen, 5409 (int)BSSList_rid.ssidLen,
5417 BSSList_rid.ssid, 5410 BSSList_rid.ssid,
5418 le16_to_cpu(BSSList_rid.dBm)); 5411 le16_to_cpu(BSSList_rid.dBm));
diff --git a/drivers/net/wireless/arlan-main.c b/drivers/net/wireless/arlan-main.c
index dec5e874a54d..b608643d5fcc 100644
--- a/drivers/net/wireless/arlan-main.c
+++ b/drivers/net/wireless/arlan-main.c
@@ -1467,19 +1467,17 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
1467 else if (hw_dst_addr[1] == 0x40) 1467 else if (hw_dst_addr[1] == 0x40)
1468 printk(KERN_ERR "%s m/bcast 0x0140 \n", dev->name); 1468 printk(KERN_ERR "%s m/bcast 0x0140 \n", dev->name);
1469 while (dmi) 1469 while (dmi)
1470 { if (dmi->dmi_addrlen == 6) 1470 {
1471 { 1471 if (dmi->dmi_addrlen == 6) {
1472 DECLARE_MAC_BUF(mac);
1473 if (arlan_debug & ARLAN_DEBUG_HEADER_DUMP) 1472 if (arlan_debug & ARLAN_DEBUG_HEADER_DUMP)
1474 printk(KERN_ERR "%s mcl %s\n", 1473 printk(KERN_ERR "%s mcl %pM\n",
1475 dev->name, print_mac(mac, dmi->dmi_addr)); 1474 dev->name, dmi->dmi_addr);
1476 for (i = 0; i < 6; i++) 1475 for (i = 0; i < 6; i++)
1477 if (dmi->dmi_addr[i] != hw_dst_addr[i]) 1476 if (dmi->dmi_addr[i] != hw_dst_addr[i])
1478 break; 1477 break;
1479 if (i == 6) 1478 if (i == 6)
1480 break; 1479 break;
1481 } 1480 } else
1482 else
1483 printk(KERN_ERR "%s: invalid multicast address length given.\n", dev->name); 1481 printk(KERN_ERR "%s: invalid multicast address length given.\n", dev->name);
1484 dmi = dmi->next; 1482 dmi = dmi->next;
1485 } 1483 }
@@ -1512,18 +1510,14 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
1512 { 1510 {
1513 char immedDestAddress[6]; 1511 char immedDestAddress[6];
1514 char immedSrcAddress[6]; 1512 char immedSrcAddress[6];
1515 DECLARE_MAC_BUF(mac);
1516 DECLARE_MAC_BUF(mac2);
1517 DECLARE_MAC_BUF(mac3);
1518 DECLARE_MAC_BUF(mac4);
1519 memcpy_fromio(immedDestAddress, arlan->immedDestAddress, 6); 1513 memcpy_fromio(immedDestAddress, arlan->immedDestAddress, 6);
1520 memcpy_fromio(immedSrcAddress, arlan->immedSrcAddress, 6); 1514 memcpy_fromio(immedSrcAddress, arlan->immedSrcAddress, 6);
1521 1515
1522 printk(KERN_WARNING "%s t %s f %s imd %s ims %s\n", 1516 printk(KERN_WARNING "%s t %pM f %pM imd %pM ims %pM\n",
1523 dev->name, print_mac(mac, skbtmp), 1517 dev->name, skbtmp,
1524 print_mac(mac2, &skbtmp[6]), 1518 &skbtmp[6],
1525 print_mac(mac3, immedDestAddress), 1519 immedDestAddress,
1526 print_mac(mac4, immedSrcAddress)); 1520 immedSrcAddress);
1527 } 1521 }
1528 skb->protocol = eth_type_trans(skb, dev); 1522 skb->protocol = eth_type_trans(skb, dev);
1529 IFDEBUG(ARLAN_DEBUG_HEADER_DUMP) 1523 IFDEBUG(ARLAN_DEBUG_HEADER_DUMP)
diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c
index c5033f6f42ac..0089e023c609 100644
--- a/drivers/net/wireless/ath9k/core.c
+++ b/drivers/net/wireless/ath9k/core.c
@@ -1325,7 +1325,6 @@ struct ath_node *ath_node_attach(struct ath_softc *sc, u8 *addr, int if_id)
1325{ 1325{
1326 struct ath_vap *avp; 1326 struct ath_vap *avp;
1327 struct ath_node *an; 1327 struct ath_node *an;
1328 DECLARE_MAC_BUF(mac);
1329 1328
1330 avp = sc->sc_vaps[if_id]; 1329 avp = sc->sc_vaps[if_id];
1331 ASSERT(avp != NULL); 1330 ASSERT(avp != NULL);
@@ -1355,8 +1354,6 @@ void ath_node_detach(struct ath_softc *sc, struct ath_node *an, bool bh_flag)
1355{ 1354{
1356 unsigned long flags; 1355 unsigned long flags;
1357 1356
1358 DECLARE_MAC_BUF(mac);
1359
1360 ath_chainmask_sel_timerstop(&an->an_chainmask_sel); 1357 ath_chainmask_sel_timerstop(&an->an_chainmask_sel);
1361 an->an_flags |= ATH_NODE_CLEAN; 1358 an->an_flags |= ATH_NODE_CLEAN;
1362 ath_tx_node_cleanup(sc, an, bh_flag); 1359 ath_tx_node_cleanup(sc, an, bh_flag);
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index 98bc25c9b3cf..d5b513e134ab 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -1291,7 +1291,6 @@ static int ath9k_hw_init_macaddr(struct ath_hal *ah)
1291 int i; 1291 int i;
1292 u16 eeval; 1292 u16 eeval;
1293 struct ath_hal_5416 *ahp = AH5416(ah); 1293 struct ath_hal_5416 *ahp = AH5416(ah);
1294 DECLARE_MAC_BUF(mac);
1295 1294
1296 sum = 0; 1295 sum = 0;
1297 for (i = 0; i < 3; i++) { 1296 for (i = 0; i < 3; i++) {
@@ -1302,8 +1301,8 @@ static int ath9k_hw_init_macaddr(struct ath_hal *ah)
1302 } 1301 }
1303 if (sum == 0 || sum == 0xffff * 3) { 1302 if (sum == 0 || sum == 0xffff * 3) {
1304 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM, 1303 DPRINTF(ah->ah_sc, ATH_DBG_EEPROM,
1305 "%s: mac address read failed: %s\n", __func__, 1304 "%s: mac address read failed: %pM\n", __func__,
1306 print_mac(mac, ahp->ah_macaddr)); 1305 ahp->ah_macaddr);
1307 return -EADDRNOTAVAIL; 1306 return -EADDRNOTAVAIL;
1308 } 1307 }
1309 1308
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index f05f584ab7bc..186d75acb326 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -362,7 +362,6 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
362 struct ieee80211_channel *curchan = hw->conf.channel; 362 struct ieee80211_channel *curchan = hw->conf.channel;
363 struct ath_vap *avp; 363 struct ath_vap *avp;
364 int pos; 364 int pos;
365 DECLARE_MAC_BUF(mac);
366 365
367 if (bss_conf->assoc) { 366 if (bss_conf->assoc) {
368 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Bss Info ASSOC %d\n", 367 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Bss Info ASSOC %d\n",
@@ -397,9 +396,9 @@ static void ath9k_bss_assoc_info(struct ath_softc *sc,
397 ath_update_chainmask(sc, bss_conf->assoc_ht); 396 ath_update_chainmask(sc, bss_conf->assoc_ht);
398 397
399 DPRINTF(sc, ATH_DBG_CONFIG, 398 DPRINTF(sc, ATH_DBG_CONFIG,
400 "%s: bssid %s aid 0x%x\n", 399 "%s: bssid %pM aid 0x%x\n",
401 __func__, 400 __func__,
402 print_mac(mac, sc->sc_curbssid), sc->sc_curaid); 401 sc->sc_curbssid, sc->sc_curaid);
403 402
404 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Set channel: %d MHz\n", 403 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Set channel: %d MHz\n",
405 __func__, 404 __func__,
@@ -1278,7 +1277,6 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
1278 struct ath_vap *avp; 1277 struct ath_vap *avp;
1279 u32 rfilt = 0; 1278 u32 rfilt = 0;
1280 int error, i; 1279 int error, i;
1281 DECLARE_MAC_BUF(mac);
1282 1280
1283 avp = sc->sc_vaps[0]; 1281 avp = sc->sc_vaps[0];
1284 if (avp == NULL) { 1282 if (avp == NULL) {
@@ -1333,9 +1331,9 @@ static int ath9k_config_interface(struct ieee80211_hw *hw,
1333 sc->sc_imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS); 1331 sc->sc_imask &= ~(ATH9K_INT_SWBA | ATH9K_INT_BMISS);
1334 1332
1335 DPRINTF(sc, ATH_DBG_CONFIG, 1333 DPRINTF(sc, ATH_DBG_CONFIG,
1336 "%s: RX filter 0x%x bssid %s aid 0x%x\n", 1334 "%s: RX filter 0x%x bssid %pM aid 0x%x\n",
1337 __func__, rfilt, 1335 __func__, rfilt,
1338 print_mac(mac, sc->sc_curbssid), sc->sc_curaid); 1336 sc->sc_curbssid, sc->sc_curaid);
1339 1337
1340 /* need to reconfigure the beacon */ 1338 /* need to reconfigure the beacon */
1341 sc->sc_flags &= ~SC_OP_BEACONS ; 1339 sc->sc_flags &= ~SC_OP_BEACONS ;
@@ -1424,7 +1422,6 @@ static void ath9k_sta_notify(struct ieee80211_hw *hw,
1424 struct ath_softc *sc = hw->priv; 1422 struct ath_softc *sc = hw->priv;
1425 struct ath_node *an; 1423 struct ath_node *an;
1426 unsigned long flags; 1424 unsigned long flags;
1427 DECLARE_MAC_BUF(mac);
1428 1425
1429 spin_lock_irqsave(&sc->node_lock, flags); 1426 spin_lock_irqsave(&sc->node_lock, flags);
1430 an = ath_node_find(sc, sta->addr); 1427 an = ath_node_find(sc, sta->addr);
@@ -1435,8 +1432,8 @@ static void ath9k_sta_notify(struct ieee80211_hw *hw,
1435 spin_lock_irqsave(&sc->node_lock, flags); 1432 spin_lock_irqsave(&sc->node_lock, flags);
1436 if (!an) { 1433 if (!an) {
1437 ath_node_attach(sc, sta->addr, 0); 1434 ath_node_attach(sc, sta->addr, 0);
1438 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Attach a node: %s\n", 1435 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Attach a node: %pM\n",
1439 __func__, print_mac(mac, sta->addr)); 1436 __func__, sta->addr);
1440 } else { 1437 } else {
1441 ath_node_get(sc, sta->addr); 1438 ath_node_get(sc, sta->addr);
1442 } 1439 }
@@ -1449,9 +1446,9 @@ static void ath9k_sta_notify(struct ieee80211_hw *hw,
1449 __func__); 1446 __func__);
1450 else { 1447 else {
1451 ath_node_put(sc, an, ATH9K_BH_STATUS_INTACT); 1448 ath_node_put(sc, an, ATH9K_BH_STATUS_INTACT);
1452 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Put a node: %s\n", 1449 DPRINTF(sc, ATH_DBG_CONFIG, "%s: Put a node: %pM\n",
1453 __func__, 1450 __func__,
1454 print_mac(mac, sta->addr)); 1451 sta->addr);
1455 } 1452 }
1456 break; 1453 break;
1457 default: 1454 default:
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c
index cca2fc5b0765..b1e535b8ec48 100644
--- a/drivers/net/wireless/ath9k/rc.c
+++ b/drivers/net/wireless/ath9k/rc.c
@@ -1942,7 +1942,6 @@ static void ath_get_rate(void *priv, struct ieee80211_supported_band *sband,
1942 s8 lowest_idx; 1942 s8 lowest_idx;
1943 __le16 fc = hdr->frame_control; 1943 __le16 fc = hdr->frame_control;
1944 u8 *qc, tid; 1944 u8 *qc, tid;
1945 DECLARE_MAC_BUF(mac);
1946 1945
1947 DPRINTF(sc, ATH_DBG_RATE, "%s\n", __func__); 1946 DPRINTF(sc, ATH_DBG_RATE, "%s\n", __func__);
1948 1947
@@ -2003,14 +2002,14 @@ static void ath_get_rate(void *priv, struct ieee80211_supported_band *sband,
2003 if (ret) 2002 if (ret)
2004 DPRINTF(sc, ATH_DBG_AGGR, 2003 DPRINTF(sc, ATH_DBG_AGGR,
2005 "%s: Unable to start tx " 2004 "%s: Unable to start tx "
2006 "aggr for: %s\n", 2005 "aggr for: %pM\n",
2007 __func__, 2006 __func__,
2008 print_mac(mac, hdr->addr1)); 2007 hdr->addr1);
2009 else 2008 else
2010 DPRINTF(sc, ATH_DBG_AGGR, 2009 DPRINTF(sc, ATH_DBG_AGGR,
2011 "%s: Started tx aggr for: %s\n", 2010 "%s: Started tx aggr for: %pM\n",
2012 __func__, 2011 __func__,
2013 print_mac(mac, hdr->addr1)); 2012 hdr->addr1);
2014 } else if (chk == AGGR_EXCHANGE_PROGRESS) 2013 } else if (chk == AGGR_EXCHANGE_PROGRESS)
2015 ath_tx_aggr_resp(sc, sband, sta, an, tid); 2014 ath_tx_aggr_resp(sc, sband, sta, an, tid);
2016 } 2015 }
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c
index 3a4757942b3f..13866043dec9 100644
--- a/drivers/net/wireless/ath9k/xmit.c
+++ b/drivers/net/wireless/ath9k/xmit.c
@@ -2416,7 +2416,6 @@ enum ATH_AGGR_CHECK ath_tx_aggr_check(struct ath_softc *sc,
2416 u8 tidno) 2416 u8 tidno)
2417{ 2417{
2418 struct ath_atx_tid *txtid; 2418 struct ath_atx_tid *txtid;
2419 DECLARE_MAC_BUF(mac);
2420 2419
2421 if (!(sc->sc_flags & SC_OP_TXAGGR)) 2420 if (!(sc->sc_flags & SC_OP_TXAGGR))
2422 return AGGR_NOT_REQUIRED; 2421 return AGGR_NOT_REQUIRED;
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index ecb02bdaab5b..6e20552c1881 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -1479,7 +1479,6 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
1479 struct net_device *dev; 1479 struct net_device *dev;
1480 struct atmel_private *priv; 1480 struct atmel_private *priv;
1481 int rc; 1481 int rc;
1482 DECLARE_MAC_BUF(mac);
1483 1482
1484 /* Create the network device object. */ 1483 /* Create the network device object. */
1485 dev = alloc_etherdev(sizeof(*priv)); 1484 dev = alloc_etherdev(sizeof(*priv));
@@ -1591,8 +1590,8 @@ struct net_device *init_atmel_card(unsigned short irq, unsigned long port,
1591 if (!ent) 1590 if (!ent)
1592 printk(KERN_WARNING "atmel: unable to create /proc entry.\n"); 1591 printk(KERN_WARNING "atmel: unable to create /proc entry.\n");
1593 1592
1594 printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %s\n", 1593 printk(KERN_INFO "%s: Atmel at76c50x. Version %d.%d. MAC %pM\n",
1595 dev->name, DRIVER_MAJOR, DRIVER_MINOR, print_mac(mac, dev->dev_addr)); 1594 dev->name, DRIVER_MAJOR, DRIVER_MINOR, dev->dev_addr);
1596 1595
1597 return dev; 1596 return dev;
1598 1597
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 14c44df584d0..6e773018cba0 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -3445,7 +3445,6 @@ static int b43_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3445 u8 algorithm; 3445 u8 algorithm;
3446 u8 index; 3446 u8 index;
3447 int err; 3447 int err;
3448 DECLARE_MAC_BUF(mac);
3449 3448
3450 if (modparam_nohwcrypt) 3449 if (modparam_nohwcrypt)
3451 return -ENOSPC; /* User disabled HW-crypto */ 3450 return -ENOSPC; /* User disabled HW-crypto */
@@ -3533,9 +3532,9 @@ out_unlock:
3533 mutex_unlock(&wl->mutex); 3532 mutex_unlock(&wl->mutex);
3534 if (!err) { 3533 if (!err) {
3535 b43dbg(wl, "%s hardware based encryption for keyidx: %d, " 3534 b43dbg(wl, "%s hardware based encryption for keyidx: %d, "
3536 "mac: %s\n", 3535 "mac: %pM\n",
3537 cmd == SET_KEY ? "Using" : "Disabling", key->keyidx, 3536 cmd == SET_KEY ? "Using" : "Disabling", key->keyidx,
3538 print_mac(mac, addr)); 3537 addr);
3539 } 3538 }
3540 return err; 3539 return err;
3541} 3540}
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c b/drivers/net/wireless/hostap/hostap_80211_rx.c
index f106bc1585a4..bbb8ec6683d7 100644
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -19,7 +19,6 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
19{ 19{
20 struct ieee80211_hdr_4addr *hdr; 20 struct ieee80211_hdr_4addr *hdr;
21 u16 fc; 21 u16 fc;
22 DECLARE_MAC_BUF(mac);
23 22
24 hdr = (struct ieee80211_hdr_4addr *) skb->data; 23 hdr = (struct ieee80211_hdr_4addr *) skb->data;
25 24
@@ -45,11 +44,11 @@ void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
45 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id), 44 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id),
46 le16_to_cpu(hdr->seq_ctl)); 45 le16_to_cpu(hdr->seq_ctl));
47 46
48 printk(KERN_DEBUG " A1=%s", print_mac(mac, hdr->addr1)); 47 printk(KERN_DEBUG " A1=%pM", hdr->addr1);
49 printk(" A2=%s", print_mac(mac, hdr->addr2)); 48 printk(" A2=%pM", hdr->addr2);
50 printk(" A3=%s", print_mac(mac, hdr->addr3)); 49 printk(" A3=%pM", hdr->addr3);
51 if (skb->len >= 30) 50 if (skb->len >= 30)
52 printk(" A4=%s", print_mac(mac, hdr->addr4)); 51 printk(" A4=%pM", hdr->addr4);
53 printk("\n"); 52 printk("\n");
54} 53}
55 54
@@ -557,7 +556,6 @@ static int
557hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr, 556hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr,
558 u16 fc, struct net_device **wds) 557 u16 fc, struct net_device **wds)
559{ 558{
560 DECLARE_MAC_BUF(mac);
561 /* FIX: is this really supposed to accept WDS frames only in Master 559 /* FIX: is this really supposed to accept WDS frames only in Master
562 * mode? What about Repeater or Managed with WDS frames? */ 560 * mode? What about Repeater or Managed with WDS frames? */
563 if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) != 561 if ((fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) !=
@@ -573,10 +571,10 @@ hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr,
573 hdr->addr1[4] != 0xff || hdr->addr1[5] != 0xff)) { 571 hdr->addr1[4] != 0xff || hdr->addr1[5] != 0xff)) {
574 /* RA (or BSSID) is not ours - drop */ 572 /* RA (or BSSID) is not ours - drop */
575 PDEBUG(DEBUG_EXTRA2, "%s: received WDS frame with " 573 PDEBUG(DEBUG_EXTRA2, "%s: received WDS frame with "
576 "not own or broadcast %s=%s\n", 574 "not own or broadcast %s=%pM\n",
577 local->dev->name, 575 local->dev->name,
578 fc & IEEE80211_FCTL_FROMDS ? "RA" : "BSSID", 576 fc & IEEE80211_FCTL_FROMDS ? "RA" : "BSSID",
579 print_mac(mac, hdr->addr1)); 577 hdr->addr1);
580 return -1; 578 return -1;
581 } 579 }
582 580
@@ -589,8 +587,8 @@ hostap_rx_frame_wds(local_info_t *local, struct ieee80211_hdr_4addr *hdr,
589 /* require that WDS link has been registered with TA or the 587 /* require that WDS link has been registered with TA or the
590 * frame is from current AP when using 'AP client mode' */ 588 * frame is from current AP when using 'AP client mode' */
591 PDEBUG(DEBUG_EXTRA, "%s: received WDS[4 addr] frame " 589 PDEBUG(DEBUG_EXTRA, "%s: received WDS[4 addr] frame "
592 "from unknown TA=%s\n", 590 "from unknown TA=%pM\n",
593 local->dev->name, print_mac(mac, hdr->addr2)); 591 local->dev->name, hdr->addr2);
594 if (local->ap && local->ap->autom_ap_wds) 592 if (local->ap && local->ap->autom_ap_wds)
595 hostap_wds_link_oper(local, hdr->addr2, WDS_ADD); 593 hostap_wds_link_oper(local, hdr->addr2, WDS_ADD);
596 return -1; 594 return -1;
@@ -667,10 +665,8 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
667 strcmp(crypt->ops->name, "TKIP") == 0) { 665 strcmp(crypt->ops->name, "TKIP") == 0) {
668 if (net_ratelimit()) { 666 if (net_ratelimit()) {
669 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 667 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
670 "received packet from " MAC_FMT "\n", 668 "received packet from %pM\n",
671 local->dev->name, 669 local->dev->name, hdr->addr2);
672 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
673 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
674 } 670 }
675 return -1; 671 return -1;
676 } 672 }
@@ -679,12 +675,8 @@ hostap_rx_frame_decrypt(local_info_t *local, struct sk_buff *skb,
679 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 675 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
680 atomic_dec(&crypt->refcnt); 676 atomic_dec(&crypt->refcnt);
681 if (res < 0) { 677 if (res < 0) {
682 printk(KERN_DEBUG "%s: decryption failed (SA=" MAC_FMT 678 printk(KERN_DEBUG "%s: decryption failed (SA=%pM) res=%d\n",
683 ") res=%d\n", 679 local->dev->name, hdr->addr2, res);
684 local->dev->name,
685 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
686 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
687 res);
688 local->comm_tallies.rx_discards_wep_undecryptable++; 680 local->comm_tallies.rx_discards_wep_undecryptable++;
689 return -1; 681 return -1;
690 } 682 }
@@ -700,7 +692,6 @@ hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb,
700{ 692{
701 struct ieee80211_hdr_4addr *hdr; 693 struct ieee80211_hdr_4addr *hdr;
702 int res, hdrlen; 694 int res, hdrlen;
703 DECLARE_MAC_BUF(mac);
704 695
705 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL) 696 if (crypt == NULL || crypt->ops->decrypt_msdu == NULL)
706 return 0; 697 return 0;
@@ -713,8 +704,8 @@ hostap_rx_frame_decrypt_msdu(local_info_t *local, struct sk_buff *skb,
713 atomic_dec(&crypt->refcnt); 704 atomic_dec(&crypt->refcnt);
714 if (res < 0) { 705 if (res < 0) {
715 printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed" 706 printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed"
716 " (SA=%s keyidx=%d)\n", 707 " (SA=%pM keyidx=%d)\n",
717 local->dev->name, print_mac(mac, hdr->addr2), keyidx); 708 local->dev->name, hdr->addr2, keyidx);
718 return -1; 709 return -1;
719 } 710 }
720 711
@@ -822,10 +813,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
822 * frames silently instead of filling system log with 813 * frames silently instead of filling system log with
823 * these reports. */ 814 * these reports. */
824 printk(KERN_DEBUG "%s: WEP decryption failed (not set)" 815 printk(KERN_DEBUG "%s: WEP decryption failed (not set)"
825 " (SA=" MAC_FMT ")\n", 816 " (SA=%pM)\n",
826 local->dev->name, 817 local->dev->name, hdr->addr2);
827 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
828 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
829#endif 818#endif
830 local->comm_tallies.rx_discards_wep_undecryptable++; 819 local->comm_tallies.rx_discards_wep_undecryptable++;
831 goto rx_dropped; 820 goto rx_dropped;
@@ -839,9 +828,7 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
839 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0) 828 (keyidx = hostap_rx_frame_decrypt(local, skb, crypt)) < 0)
840 { 829 {
841 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 830 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
842 "from " MAC_FMT "\n", dev->name, 831 "from %pM\n", dev->name, hdr->addr2);
843 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
844 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
845 /* TODO: could inform hostapd about this so that it 832 /* TODO: could inform hostapd about this so that it
846 * could send auth failure report */ 833 * could send auth failure report */
847 goto rx_dropped; 834 goto rx_dropped;
@@ -1009,10 +996,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
1009 "unencrypted EAPOL frame\n", local->dev->name); 996 "unencrypted EAPOL frame\n", local->dev->name);
1010 } else { 997 } else {
1011 printk(KERN_DEBUG "%s: encryption configured, but RX " 998 printk(KERN_DEBUG "%s: encryption configured, but RX "
1012 "frame not encrypted (SA=" MAC_FMT ")\n", 999 "frame not encrypted (SA=%pM)\n",
1013 local->dev->name, 1000 local->dev->name, hdr->addr2);
1014 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1015 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
1016 goto rx_dropped; 1001 goto rx_dropped;
1017 } 1002 }
1018 } 1003 }
@@ -1021,10 +1006,8 @@ void hostap_80211_rx(struct net_device *dev, struct sk_buff *skb,
1021 !hostap_is_eapol_frame(local, skb)) { 1006 !hostap_is_eapol_frame(local, skb)) {
1022 if (net_ratelimit()) { 1007 if (net_ratelimit()) {
1023 printk(KERN_DEBUG "%s: dropped unencrypted RX data " 1008 printk(KERN_DEBUG "%s: dropped unencrypted RX data "
1024 "frame from " MAC_FMT " (drop_unencrypted=1)\n", 1009 "frame from %pM (drop_unencrypted=1)\n",
1025 dev->name, 1010 dev->name, hdr->addr2);
1026 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1027 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
1028 } 1011 }
1029 goto rx_dropped; 1012 goto rx_dropped;
1030 } 1013 }
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c b/drivers/net/wireless/hostap/hostap_80211_tx.c
index 921c984416f8..075247188e64 100644
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -17,7 +17,6 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
17{ 17{
18 struct ieee80211_hdr_4addr *hdr; 18 struct ieee80211_hdr_4addr *hdr;
19 u16 fc; 19 u16 fc;
20 DECLARE_MAC_BUF(mac);
21 20
22 hdr = (struct ieee80211_hdr_4addr *) skb->data; 21 hdr = (struct ieee80211_hdr_4addr *) skb->data;
23 22
@@ -41,11 +40,11 @@ void hostap_dump_tx_80211(const char *name, struct sk_buff *skb)
41 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id), 40 printk(" dur=0x%04x seq=0x%04x\n", le16_to_cpu(hdr->duration_id),
42 le16_to_cpu(hdr->seq_ctl)); 41 le16_to_cpu(hdr->seq_ctl));
43 42
44 printk(KERN_DEBUG " A1=%s", print_mac(mac, hdr->addr1)); 43 printk(KERN_DEBUG " A1=%pM", hdr->addr1);
45 printk(" A2=%s", print_mac(mac, hdr->addr2)); 44 printk(" A2=%pM", hdr->addr2);
46 printk(" A3=%s", print_mac(mac, hdr->addr3)); 45 printk(" A3=%pM", hdr->addr3);
47 if (skb->len >= 30) 46 if (skb->len >= 30)
48 printk(" A4=%s", print_mac(mac, hdr->addr4)); 47 printk(" A4=%pM", hdr->addr4);
49 printk("\n"); 48 printk("\n");
50} 49}
51 50
@@ -328,10 +327,8 @@ static struct sk_buff * hostap_tx_encrypt(struct sk_buff *skb,
328 hdr = (struct ieee80211_hdr_4addr *) skb->data; 327 hdr = (struct ieee80211_hdr_4addr *) skb->data;
329 if (net_ratelimit()) { 328 if (net_ratelimit()) {
330 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped " 329 printk(KERN_DEBUG "%s: TKIP countermeasures: dropped "
331 "TX packet to " MAC_FMT "\n", 330 "TX packet to %pM\n",
332 local->dev->name, 331 local->dev->name, hdr->addr1);
333 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
334 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
335 } 332 }
336 kfree_skb(skb); 333 kfree_skb(skb);
337 return NULL; 334 return NULL;
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index af3d4ef2a80b..dec3dbe1bf8f 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -94,7 +94,6 @@ static void ap_sta_hash_add(struct ap_data *ap, struct sta_info *sta)
94static void ap_sta_hash_del(struct ap_data *ap, struct sta_info *sta) 94static void ap_sta_hash_del(struct ap_data *ap, struct sta_info *sta)
95{ 95{
96 struct sta_info *s; 96 struct sta_info *s;
97 DECLARE_MAC_BUF(mac);
98 97
99 s = ap->sta_hash[STA_HASH(sta->addr)]; 98 s = ap->sta_hash[STA_HASH(sta->addr)];
100 if (s == NULL) return; 99 if (s == NULL) return;
@@ -109,20 +108,18 @@ static void ap_sta_hash_del(struct ap_data *ap, struct sta_info *sta)
109 if (s->hnext != NULL) 108 if (s->hnext != NULL)
110 s->hnext = s->hnext->hnext; 109 s->hnext = s->hnext->hnext;
111 else 110 else
112 printk("AP: could not remove STA %s" 111 printk("AP: could not remove STA %pM from hash table\n",
113 " from hash table\n", 112 sta->addr);
114 print_mac(mac, sta->addr));
115} 113}
116 114
117static void ap_free_sta(struct ap_data *ap, struct sta_info *sta) 115static void ap_free_sta(struct ap_data *ap, struct sta_info *sta)
118{ 116{
119 DECLARE_MAC_BUF(mac);
120 if (sta->ap && sta->local) 117 if (sta->ap && sta->local)
121 hostap_event_expired_sta(sta->local->dev, sta); 118 hostap_event_expired_sta(sta->local->dev, sta);
122 119
123 if (ap->proc != NULL) { 120 if (ap->proc != NULL) {
124 char name[20]; 121 char name[20];
125 sprintf(name, "%s", print_mac(mac, sta->addr)); 122 sprintf(name, "%pM", sta->addr);
126 remove_proc_entry(name, ap->proc); 123 remove_proc_entry(name, ap->proc);
127 } 124 }
128 125
@@ -185,7 +182,6 @@ static void ap_handle_timer(unsigned long data)
185 struct ap_data *ap; 182 struct ap_data *ap;
186 unsigned long next_time = 0; 183 unsigned long next_time = 0;
187 int was_assoc; 184 int was_assoc;
188 DECLARE_MAC_BUF(mac);
189 185
190 if (sta == NULL || sta->local == NULL || sta->local->ap == NULL) { 186 if (sta == NULL || sta->local == NULL || sta->local->ap == NULL) {
191 PDEBUG(DEBUG_AP, "ap_handle_timer() called with NULL data\n"); 187 PDEBUG(DEBUG_AP, "ap_handle_timer() called with NULL data\n");
@@ -242,8 +238,8 @@ static void ap_handle_timer(unsigned long data)
242 if (sta->ap) { 238 if (sta->ap) {
243 if (ap->autom_ap_wds) { 239 if (ap->autom_ap_wds) {
244 PDEBUG(DEBUG_AP, "%s: removing automatic WDS " 240 PDEBUG(DEBUG_AP, "%s: removing automatic WDS "
245 "connection to AP %s\n", 241 "connection to AP %pM\n",
246 local->dev->name, print_mac(mac, sta->addr)); 242 local->dev->name, sta->addr);
247 hostap_wds_link_oper(local, sta->addr, WDS_DEL); 243 hostap_wds_link_oper(local, sta->addr, WDS_DEL);
248 } 244 }
249 } else if (sta->timeout_next == STA_NULLFUNC) { 245 } else if (sta->timeout_next == STA_NULLFUNC) {
@@ -259,11 +255,11 @@ static void ap_handle_timer(unsigned long data)
259 } else { 255 } else {
260 int deauth = sta->timeout_next == STA_DEAUTH; 256 int deauth = sta->timeout_next == STA_DEAUTH;
261 __le16 resp; 257 __le16 resp;
262 PDEBUG(DEBUG_AP, "%s: sending %s info to STA %s" 258 PDEBUG(DEBUG_AP, "%s: sending %s info to STA %pM"
263 "(last=%lu, jiffies=%lu)\n", 259 "(last=%lu, jiffies=%lu)\n",
264 local->dev->name, 260 local->dev->name,
265 deauth ? "deauthentication" : "disassociation", 261 deauth ? "deauthentication" : "disassociation",
266 print_mac(mac, sta->addr), sta->last_rx, jiffies); 262 sta->addr, sta->last_rx, jiffies);
267 263
268 resp = cpu_to_le16(deauth ? WLAN_REASON_PREV_AUTH_NOT_VALID : 264 resp = cpu_to_le16(deauth ? WLAN_REASON_PREV_AUTH_NOT_VALID :
269 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY); 265 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY);
@@ -275,10 +271,10 @@ static void ap_handle_timer(unsigned long data)
275 271
276 if (sta->timeout_next == STA_DEAUTH) { 272 if (sta->timeout_next == STA_DEAUTH) {
277 if (sta->flags & WLAN_STA_PERM) { 273 if (sta->flags & WLAN_STA_PERM) {
278 PDEBUG(DEBUG_AP, "%s: STA %s" 274 PDEBUG(DEBUG_AP, "%s: STA %pM"
279 " would have been removed, " 275 " would have been removed, "
280 "but it has 'perm' flag\n", 276 "but it has 'perm' flag\n",
281 local->dev->name, print_mac(mac, sta->addr)); 277 local->dev->name, sta->addr);
282 } else 278 } else
283 ap_free_sta(ap, sta); 279 ap_free_sta(ap, sta);
284 return; 280 return;
@@ -332,7 +328,6 @@ static int ap_control_proc_read(char *page, char **start, off_t off,
332 struct ap_data *ap = (struct ap_data *) data; 328 struct ap_data *ap = (struct ap_data *) data;
333 char *policy_txt; 329 char *policy_txt;
334 struct mac_entry *entry; 330 struct mac_entry *entry;
335 DECLARE_MAC_BUF(mac);
336 331
337 if (off != 0) { 332 if (off != 0) {
338 *eof = 1; 333 *eof = 1;
@@ -363,7 +358,7 @@ static int ap_control_proc_read(char *page, char **start, off_t off,
363 break; 358 break;
364 } 359 }
365 360
366 p += sprintf(p, "%s\n", print_mac(mac, entry->addr)); 361 p += sprintf(p, "%pM\n", entry->addr);
367 } 362 }
368 spin_unlock_bh(&ap->mac_restrictions.lock); 363 spin_unlock_bh(&ap->mac_restrictions.lock);
369 364
@@ -520,7 +515,6 @@ static int prism2_ap_proc_read(char *page, char **start, off_t off,
520 struct ap_data *ap = (struct ap_data *) data; 515 struct ap_data *ap = (struct ap_data *) data;
521 struct sta_info *sta; 516 struct sta_info *sta;
522 int i; 517 int i;
523 DECLARE_MAC_BUF(mac);
524 518
525 if (off > PROC_LIMIT) { 519 if (off > PROC_LIMIT) {
526 *eof = 1; 520 *eof = 1;
@@ -533,8 +527,8 @@ static int prism2_ap_proc_read(char *page, char **start, off_t off,
533 if (!sta->ap) 527 if (!sta->ap)
534 continue; 528 continue;
535 529
536 p += sprintf(p, "%s %d %d %d %d '", 530 p += sprintf(p, "%pM %d %d %d %d '",
537 print_mac(mac, sta->addr), 531 sta->addr,
538 sta->u.ap.channel, sta->last_rx_signal, 532 sta->u.ap.channel, sta->last_rx_signal,
539 sta->last_rx_silence, sta->last_rx_rate); 533 sta->last_rx_silence, sta->last_rx_rate);
540 for (i = 0; i < sta->u.ap.ssid_len; i++) 534 for (i = 0; i < sta->u.ap.ssid_len; i++)
@@ -683,11 +677,9 @@ static void hostap_ap_tx_cb_auth(struct sk_buff *skb, int ok, void *data)
683 if (sta) 677 if (sta)
684 atomic_dec(&sta->users); 678 atomic_dec(&sta->users);
685 if (txt) { 679 if (txt) {
686 PDEBUG(DEBUG_AP, "%s: " MAC_FMT " auth_cb - alg=%d " 680 PDEBUG(DEBUG_AP, "%s: %pM auth_cb - alg=%d "
687 "trans#=%d status=%d - %s\n", 681 "trans#=%d status=%d - %s\n",
688 dev->name, 682 dev->name, hdr->addr1,
689 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
690 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
691 auth_alg, auth_transaction, status, txt); 683 auth_alg, auth_transaction, status, txt);
692 } 684 }
693 dev_kfree_skb(skb); 685 dev_kfree_skb(skb);
@@ -754,11 +746,8 @@ static void hostap_ap_tx_cb_assoc(struct sk_buff *skb, int ok, void *data)
754 if (sta) 746 if (sta)
755 atomic_dec(&sta->users); 747 atomic_dec(&sta->users);
756 if (txt) { 748 if (txt) {
757 PDEBUG(DEBUG_AP, "%s: " MAC_FMT " assoc_cb - %s\n", 749 PDEBUG(DEBUG_AP, "%s: %pM assoc_cb - %s\n",
758 dev->name, 750 dev->name, hdr->addr1, txt);
759 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
760 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
761 txt);
762 } 751 }
763 dev_kfree_skb(skb); 752 dev_kfree_skb(skb);
764} 753}
@@ -781,11 +770,9 @@ static void hostap_ap_tx_cb_poll(struct sk_buff *skb, int ok, void *data)
781 sta->flags &= ~WLAN_STA_PENDING_POLL; 770 sta->flags &= ~WLAN_STA_PENDING_POLL;
782 spin_unlock(&ap->sta_table_lock); 771 spin_unlock(&ap->sta_table_lock);
783 } else { 772 } else {
784 PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT 773 PDEBUG(DEBUG_AP,
785 " did not ACK activity poll frame\n", 774 "%s: STA %pM did not ACK activity poll frame\n",
786 ap->local->dev->name, 775 ap->local->dev->name, hdr->addr1);
787 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
788 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
789 } 776 }
790 777
791 fail: 778 fail:
@@ -1002,7 +989,6 @@ static int prism2_sta_proc_read(char *page, char **start, off_t off,
1002 char *p = page; 989 char *p = page;
1003 struct sta_info *sta = (struct sta_info *) data; 990 struct sta_info *sta = (struct sta_info *) data;
1004 int i; 991 int i;
1005 DECLARE_MAC_BUF(mac);
1006 992
1007 /* FIX: possible race condition.. the STA data could have just expired, 993 /* FIX: possible race condition.. the STA data could have just expired,
1008 * but proc entry was still here so that the read could have started; 994 * but proc entry was still here so that the read could have started;
@@ -1013,11 +999,11 @@ static int prism2_sta_proc_read(char *page, char **start, off_t off,
1013 return 0; 999 return 0;
1014 } 1000 }
1015 1001
1016 p += sprintf(p, "%s=%s\nusers=%d\naid=%d\n" 1002 p += sprintf(p, "%s=%pM\nusers=%d\naid=%d\n"
1017 "flags=0x%04x%s%s%s%s%s%s%s\n" 1003 "flags=0x%04x%s%s%s%s%s%s%s\n"
1018 "capability=0x%02x\nlisten_interval=%d\nsupported_rates=", 1004 "capability=0x%02x\nlisten_interval=%d\nsupported_rates=",
1019 sta->ap ? "AP" : "STA", 1005 sta->ap ? "AP" : "STA",
1020 print_mac(mac, sta->addr), atomic_read(&sta->users), sta->aid, 1006 sta->addr, atomic_read(&sta->users), sta->aid,
1021 sta->flags, 1007 sta->flags,
1022 sta->flags & WLAN_STA_AUTH ? " AUTH" : "", 1008 sta->flags & WLAN_STA_AUTH ? " AUTH" : "",
1023 sta->flags & WLAN_STA_ASSOC ? " ASSOC" : "", 1009 sta->flags & WLAN_STA_ASSOC ? " ASSOC" : "",
@@ -1078,7 +1064,6 @@ static void handle_add_proc_queue(struct work_struct *work)
1078 struct sta_info *sta; 1064 struct sta_info *sta;
1079 char name[20]; 1065 char name[20];
1080 struct add_sta_proc_data *entry, *prev; 1066 struct add_sta_proc_data *entry, *prev;
1081 DECLARE_MAC_BUF(mac);
1082 1067
1083 entry = ap->add_sta_proc_entries; 1068 entry = ap->add_sta_proc_entries;
1084 ap->add_sta_proc_entries = NULL; 1069 ap->add_sta_proc_entries = NULL;
@@ -1091,7 +1076,7 @@ static void handle_add_proc_queue(struct work_struct *work)
1091 spin_unlock_bh(&ap->sta_table_lock); 1076 spin_unlock_bh(&ap->sta_table_lock);
1092 1077
1093 if (sta) { 1078 if (sta) {
1094 sprintf(name, "%s", print_mac(mac, sta->addr)); 1079 sprintf(name, "%pM", sta->addr);
1095 sta->proc = create_proc_read_entry( 1080 sta->proc = create_proc_read_entry(
1096 name, 0, ap->proc, 1081 name, 0, ap->proc,
1097 prism2_sta_proc_read, sta); 1082 prism2_sta_proc_read, sta);
@@ -1318,9 +1303,7 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1318 1303
1319 if (len < 6) { 1304 if (len < 6) {
1320 PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload " 1305 PDEBUG(DEBUG_AP, "%s: handle_authen - too short payload "
1321 "(len=%d) from " MAC_FMT "\n", dev->name, len, 1306 "(len=%d) from %pM\n", dev->name, len, hdr->addr2);
1322 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1323 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
1324 return; 1307 return;
1325 } 1308 }
1326 1309
@@ -1385,10 +1368,8 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1385 if (time_after(jiffies, sta->u.ap.last_beacon + 1368 if (time_after(jiffies, sta->u.ap.last_beacon +
1386 (10 * sta->listen_interval * HZ) / 1024)) { 1369 (10 * sta->listen_interval * HZ) / 1024)) {
1387 PDEBUG(DEBUG_AP, "%s: no beacons received for a while," 1370 PDEBUG(DEBUG_AP, "%s: no beacons received for a while,"
1388 " assuming AP " MAC_FMT " is now STA\n", 1371 " assuming AP %pM is now STA\n",
1389 dev->name, 1372 dev->name, sta->addr);
1390 sta->addr[0], sta->addr[1], sta->addr[2],
1391 sta->addr[3], sta->addr[4], sta->addr[5]);
1392 sta->ap = 0; 1373 sta->ap = 0;
1393 sta->flags = 0; 1374 sta->flags = 0;
1394 sta->u.sta.challenge = NULL; 1375 sta->u.sta.challenge = NULL;
@@ -1503,11 +1484,9 @@ static void handle_authen(local_info_t *local, struct sk_buff *skb,
1503 } 1484 }
1504 1485
1505 if (resp) { 1486 if (resp) {
1506 PDEBUG(DEBUG_AP, "%s: " MAC_FMT " auth (alg=%d " 1487 PDEBUG(DEBUG_AP, "%s: %pM auth (alg=%d "
1507 "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n", 1488 "trans#=%d stat=%d len=%d fc=%04x) ==> %d (%s)\n",
1508 dev->name, 1489 dev->name, hdr->addr2,
1509 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1510 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1511 auth_alg, auth_transaction, status_code, len, 1490 auth_alg, auth_transaction, status_code, len,
1512 fc, resp, txt); 1491 fc, resp, txt);
1513 } 1492 }
@@ -1533,10 +1512,8 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1533 1512
1534 if (len < (reassoc ? 10 : 4)) { 1513 if (len < (reassoc ? 10 : 4)) {
1535 PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload " 1514 PDEBUG(DEBUG_AP, "%s: handle_assoc - too short payload "
1536 "(len=%d, reassoc=%d) from " MAC_FMT "\n", 1515 "(len=%d, reassoc=%d) from %pM\n",
1537 dev->name, len, reassoc, 1516 dev->name, len, reassoc, hdr->addr2);
1538 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1539 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5]);
1540 return; 1517 return;
1541 } 1518 }
1542 1519
@@ -1613,12 +1590,9 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1613 } 1590 }
1614 1591
1615 if (left > 0) { 1592 if (left > 0) {
1616 PDEBUG(DEBUG_AP, "%s: assoc from " MAC_FMT 1593 PDEBUG(DEBUG_AP, "%s: assoc from %pM"
1617 " with extra data (%d bytes) [", 1594 " with extra data (%d bytes) [",
1618 dev->name, 1595 dev->name, hdr->addr2, left);
1619 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1620 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1621 left);
1622 while (left > 0) { 1596 while (left > 0) {
1623 PDEBUG2(DEBUG_AP, "<%02x>", *u); 1597 PDEBUG2(DEBUG_AP, "<%02x>", *u);
1624 u++; left--; 1598 u++; left--;
@@ -1717,14 +1691,12 @@ static void handle_assoc(local_info_t *local, struct sk_buff *skb,
1717 } 1691 }
1718 1692
1719#if 0 1693#if 0
1720 PDEBUG(DEBUG_AP, "%s: " MAC_FMT" %sassoc (len=%d " 1694 PDEBUG(DEBUG_AP, "%s: %pM %sassoc (len=%d "
1721 "prev_ap=" MAC_FMT") => %d(%d) (%s)\n", 1695 "prev_ap=%pM) => %d(%d) (%s)\n",
1722 dev->name, 1696 dev->name,
1723 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1697 hdr->addr2,
1724 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1725 reassoc ? "re" : "", len, 1698 reassoc ? "re" : "", len,
1726 prev_ap[0], prev_ap[1], prev_ap[2], 1699 prev_ap,
1727 prev_ap[3], prev_ap[4], prev_ap[5],
1728 resp, send_deauth, txt); 1700 resp, send_deauth, txt);
1729#endif 1701#endif
1730} 1702}
@@ -1741,7 +1713,6 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1741 u16 reason_code; 1713 u16 reason_code;
1742 __le16 *pos; 1714 __le16 *pos;
1743 struct sta_info *sta = NULL; 1715 struct sta_info *sta = NULL;
1744 DECLARE_MAC_BUF(mac);
1745 1716
1746 len = skb->len - IEEE80211_MGMT_HDR_LEN; 1717 len = skb->len - IEEE80211_MGMT_HDR_LEN;
1747 1718
@@ -1753,10 +1724,8 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1753 pos = (__le16 *) body; 1724 pos = (__le16 *) body;
1754 reason_code = le16_to_cpu(*pos); 1725 reason_code = le16_to_cpu(*pos);
1755 1726
1756 PDEBUG(DEBUG_AP, "%s: deauthentication: " MAC_FMT " len=%d, " 1727 PDEBUG(DEBUG_AP, "%s: deauthentication: %pM len=%d, "
1757 "reason_code=%d\n", dev->name, 1728 "reason_code=%d\n", dev->name, hdr->addr2,
1758 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1759 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1760 len, reason_code); 1729 len, reason_code);
1761 1730
1762 spin_lock_bh(&local->ap->sta_table_lock); 1731 spin_lock_bh(&local->ap->sta_table_lock);
@@ -1768,11 +1737,9 @@ static void handle_deauth(local_info_t *local, struct sk_buff *skb,
1768 } 1737 }
1769 spin_unlock_bh(&local->ap->sta_table_lock); 1738 spin_unlock_bh(&local->ap->sta_table_lock);
1770 if (sta == NULL) { 1739 if (sta == NULL) {
1771 printk("%s: deauthentication from " MAC_FMT ", " 1740 printk("%s: deauthentication from %pM, "
1772 "reason_code=%d, but STA not authenticated\n", dev->name, 1741 "reason_code=%d, but STA not authenticated\n", dev->name,
1773 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2], 1742 hdr->addr2, reason_code);
1774 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1775 reason_code);
1776 } 1743 }
1777} 1744}
1778 1745
@@ -1799,10 +1766,8 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1799 pos = (__le16 *) body; 1766 pos = (__le16 *) body;
1800 reason_code = le16_to_cpu(*pos); 1767 reason_code = le16_to_cpu(*pos);
1801 1768
1802 PDEBUG(DEBUG_AP, "%s: disassociation: " MAC_FMT " len=%d, " 1769 PDEBUG(DEBUG_AP, "%s: disassociation: %pM len=%d, "
1803 "reason_code=%d\n", dev->name, 1770 "reason_code=%d\n", dev->name, hdr->addr2,
1804 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1805 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1806 len, reason_code); 1771 len, reason_code);
1807 1772
1808 spin_lock_bh(&local->ap->sta_table_lock); 1773 spin_lock_bh(&local->ap->sta_table_lock);
@@ -1814,12 +1779,9 @@ static void handle_disassoc(local_info_t *local, struct sk_buff *skb,
1814 } 1779 }
1815 spin_unlock_bh(&local->ap->sta_table_lock); 1780 spin_unlock_bh(&local->ap->sta_table_lock);
1816 if (sta == NULL) { 1781 if (sta == NULL) {
1817 printk("%s: disassociation from " MAC_FMT ", " 1782 printk("%s: disassociation from %pM, "
1818 "reason_code=%d, but STA not authenticated\n", 1783 "reason_code=%d, but STA not authenticated\n",
1819 dev->name, 1784 dev->name, hdr->addr2, reason_code);
1820 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1821 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1822 reason_code);
1823 } 1785 }
1824} 1786}
1825 1787
@@ -1909,19 +1871,14 @@ static void handle_pspoll(local_info_t *local,
1909 u16 aid; 1871 u16 aid;
1910 struct sk_buff *skb; 1872 struct sk_buff *skb;
1911 1873
1912 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=" MAC_FMT 1874 PDEBUG(DEBUG_PS2, "handle_pspoll: BSSID=%pM, TA=%pM PWRMGT=%d\n",
1913 ", TA=" MAC_FMT " PWRMGT=%d\n", 1875 hdr->addr1, hdr->addr2,
1914 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
1915 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
1916 hdr->addr2[0], hdr->addr2[1], hdr->addr2[2],
1917 hdr->addr2[3], hdr->addr2[4], hdr->addr2[5],
1918 !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM)); 1876 !!(le16_to_cpu(hdr->frame_ctl) & IEEE80211_FCTL_PM));
1919 1877
1920 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 1878 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
1921 PDEBUG(DEBUG_AP, "handle_pspoll - addr1(BSSID)=" MAC_FMT 1879 PDEBUG(DEBUG_AP,
1922 " not own MAC\n", 1880 "handle_pspoll - addr1(BSSID)=%pM not own MAC\n",
1923 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2], 1881 hdr->addr1);
1924 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
1925 return; 1882 return;
1926 } 1883 }
1927 1884
@@ -2007,11 +1964,10 @@ static void handle_wds_oper_queue(struct work_struct *work)
2007 1964
2008 while (entry) { 1965 while (entry) {
2009 PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection " 1966 PDEBUG(DEBUG_AP, "%s: %s automatic WDS connection "
2010 "to AP " MAC_FMT "\n", 1967 "to AP %pM\n",
2011 local->dev->name, 1968 local->dev->name,
2012 entry->type == WDS_ADD ? "adding" : "removing", 1969 entry->type == WDS_ADD ? "adding" : "removing",
2013 entry->addr[0], entry->addr[1], entry->addr[2], 1970 entry->addr);
2014 entry->addr[3], entry->addr[4], entry->addr[5]);
2015 if (entry->type == WDS_ADD) 1971 if (entry->type == WDS_ADD)
2016 prism2_wds_add(local, entry->addr, 0); 1972 prism2_wds_add(local, entry->addr, 0);
2017 else if (entry->type == WDS_DEL) 1973 else if (entry->type == WDS_DEL)
@@ -2215,10 +2171,8 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2215 } 2171 }
2216 2172
2217 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 2173 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
2218 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)=" 2174 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(BSSID)=%pM"
2219 MAC_FMT " not own MAC\n", 2175 " not own MAC\n", hdr->addr1);
2220 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2221 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
2222 goto done; 2176 goto done;
2223 } 2177 }
2224 2178
@@ -2254,18 +2208,14 @@ static void handle_ap_item(local_info_t *local, struct sk_buff *skb,
2254 } 2208 }
2255 2209
2256 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) { 2210 if (memcmp(hdr->addr1, dev->dev_addr, ETH_ALEN)) {
2257 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=" MAC_FMT 2211 PDEBUG(DEBUG_AP, "handle_ap_item - addr1(DA)=%pM"
2258 " not own MAC\n", 2212 " not own MAC\n", hdr->addr1);
2259 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2260 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
2261 goto done; 2213 goto done;
2262 } 2214 }
2263 2215
2264 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) { 2216 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN)) {
2265 PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=" MAC_FMT 2217 PDEBUG(DEBUG_AP, "handle_ap_item - addr3(BSSID)=%pM"
2266 " not own MAC\n", 2218 " not own MAC\n", hdr->addr3);
2267 hdr->addr3[0], hdr->addr3[1], hdr->addr3[2],
2268 hdr->addr3[3], hdr->addr3[4], hdr->addr3[5]);
2269 goto done; 2219 goto done;
2270 } 2220 }
2271 2221
@@ -2366,10 +2316,9 @@ static void schedule_packet_send(local_info_t *local, struct sta_info *sta)
2366 memcpy(hdr->addr2, sta->addr, ETH_ALEN); 2316 memcpy(hdr->addr2, sta->addr, ETH_ALEN);
2367 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14)); 2317 hdr->duration_id = cpu_to_le16(sta->aid | BIT(15) | BIT(14));
2368 2318
2369 PDEBUG(DEBUG_PS2, "%s: Scheduling buffered packet delivery for STA " 2319 PDEBUG(DEBUG_PS2,
2370 MAC_FMT "\n", local->dev->name, 2320 "%s: Scheduling buffered packet delivery for STA %pM\n",
2371 sta->addr[0], sta->addr[1], sta->addr[2], 2321 local->dev->name, sta->addr);
2372 sta->addr[3], sta->addr[4], sta->addr[5]);
2373 2322
2374 skb->dev = local->dev; 2323 skb->dev = local->dev;
2375 2324
@@ -2723,12 +2672,8 @@ static int ap_update_sta_tx_rate(struct sta_info *sta, struct net_device *dev)
2723 case 3: sta->tx_rate = 110; break; 2672 case 3: sta->tx_rate = 110; break;
2724 default: sta->tx_rate = 0; break; 2673 default: sta->tx_rate = 0; break;
2725 } 2674 }
2726 PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT 2675 PDEBUG(DEBUG_AP, "%s: STA %pM TX rate raised to %d\n",
2727 " TX rate raised to %d\n", 2676 dev->name, sta->addr, sta->tx_rate);
2728 dev->name,
2729 sta->addr[0], sta->addr[1], sta->addr[2],
2730 sta->addr[3], sta->addr[4], sta->addr[5],
2731 sta->tx_rate);
2732 } 2677 }
2733 sta->tx_since_last_failure = 0; 2678 sta->tx_since_last_failure = 0;
2734 } 2679 }
@@ -2781,9 +2726,7 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2781 * print out any errors here. */ 2726 * print out any errors here. */
2782 if (net_ratelimit()) { 2727 if (net_ratelimit()) {
2783 printk(KERN_DEBUG "AP: drop packet to non-associated " 2728 printk(KERN_DEBUG "AP: drop packet to non-associated "
2784 "STA " MAC_FMT "\n", 2729 "STA %pM\n", hdr->addr1);
2785 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2786 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5]);
2787 } 2730 }
2788#endif 2731#endif
2789 local->ap->tx_drop_nonassoc++; 2732 local->ap->tx_drop_nonassoc++;
@@ -2821,11 +2764,9 @@ ap_tx_ret hostap_handle_sta_tx(local_info_t *local, struct hostap_tx_data *tx)
2821 } 2764 }
2822 2765
2823 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) { 2766 if (skb_queue_len(&sta->tx_buf) >= STA_MAX_TX_BUFFER) {
2824 PDEBUG(DEBUG_PS, "%s: No more space in STA (" MAC_FMT 2767 PDEBUG(DEBUG_PS, "%s: No more space in STA (%pM)'s"
2825 ")'s PS mode buffer\n", 2768 "PS mode buffer\n",
2826 local->dev->name, 2769 local->dev->name, sta->addr);
2827 sta->addr[0], sta->addr[1], sta->addr[2],
2828 sta->addr[3], sta->addr[4], sta->addr[5]);
2829 /* Make sure that TIM is set for the station (it might not be 2770 /* Make sure that TIM is set for the station (it might not be
2830 * after AP wlan hw reset). */ 2771 * after AP wlan hw reset). */
2831 /* FIX: should fix hw reset to restore bits based on STA 2772 /* FIX: should fix hw reset to restore bits based on STA
@@ -2897,12 +2838,9 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2897 sta = ap_get_sta(local->ap, hdr->addr1); 2838 sta = ap_get_sta(local->ap, hdr->addr1);
2898 if (!sta) { 2839 if (!sta) {
2899 spin_unlock(&local->ap->sta_table_lock); 2840 spin_unlock(&local->ap->sta_table_lock);
2900 PDEBUG(DEBUG_AP, "%s: Could not find STA " MAC_FMT 2841 PDEBUG(DEBUG_AP, "%s: Could not find STA %pM"
2901 " for this TX error (@%lu)\n", 2842 " for this TX error (@%lu)\n",
2902 local->dev->name, 2843 local->dev->name, hdr->addr1, jiffies);
2903 hdr->addr1[0], hdr->addr1[1], hdr->addr1[2],
2904 hdr->addr1[3], hdr->addr1[4], hdr->addr1[5],
2905 jiffies);
2906 return; 2844 return;
2907 } 2845 }
2908 2846
@@ -2929,12 +2867,9 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2929 case 3: sta->tx_rate = 110; break; 2867 case 3: sta->tx_rate = 110; break;
2930 default: sta->tx_rate = 0; break; 2868 default: sta->tx_rate = 0; break;
2931 } 2869 }
2932 PDEBUG(DEBUG_AP, "%s: STA " MAC_FMT 2870 PDEBUG(DEBUG_AP,
2933 " TX rate lowered to %d\n", 2871 "%s: STA %pM TX rate lowered to %d\n",
2934 local->dev->name, 2872 local->dev->name, sta->addr, sta->tx_rate);
2935 sta->addr[0], sta->addr[1], sta->addr[2],
2936 sta->addr[3], sta->addr[4], sta->addr[5],
2937 sta->tx_rate);
2938 } 2873 }
2939 sta->tx_consecutive_exc = 0; 2874 sta->tx_consecutive_exc = 0;
2940 } 2875 }
@@ -2945,17 +2880,16 @@ void hostap_handle_sta_tx_exc(local_info_t *local, struct sk_buff *skb)
2945static void hostap_update_sta_ps2(local_info_t *local, struct sta_info *sta, 2880static void hostap_update_sta_ps2(local_info_t *local, struct sta_info *sta,
2946 int pwrmgt, int type, int stype) 2881 int pwrmgt, int type, int stype)
2947{ 2882{
2948 DECLARE_MAC_BUF(mac);
2949 if (pwrmgt && !(sta->flags & WLAN_STA_PS)) { 2883 if (pwrmgt && !(sta->flags & WLAN_STA_PS)) {
2950 sta->flags |= WLAN_STA_PS; 2884 sta->flags |= WLAN_STA_PS;
2951 PDEBUG(DEBUG_PS2, "STA %s changed to use PS " 2885 PDEBUG(DEBUG_PS2, "STA %pM changed to use PS "
2952 "mode (type=0x%02X, stype=0x%02X)\n", 2886 "mode (type=0x%02X, stype=0x%02X)\n",
2953 print_mac(mac, sta->addr), type >> 2, stype >> 4); 2887 sta->addr, type >> 2, stype >> 4);
2954 } else if (!pwrmgt && (sta->flags & WLAN_STA_PS)) { 2888 } else if (!pwrmgt && (sta->flags & WLAN_STA_PS)) {
2955 sta->flags &= ~WLAN_STA_PS; 2889 sta->flags &= ~WLAN_STA_PS;
2956 PDEBUG(DEBUG_PS2, "STA %s changed to not use " 2890 PDEBUG(DEBUG_PS2, "STA %pM changed to not use "
2957 "PS mode (type=0x%02X, stype=0x%02X)\n", 2891 "PS mode (type=0x%02X, stype=0x%02X)\n",
2958 print_mac(mac, sta->addr), type >> 2, stype >> 4); 2892 sta->addr, type >> 2, stype >> 4);
2959 if (type != IEEE80211_FTYPE_CTL || 2893 if (type != IEEE80211_FTYPE_CTL ||
2960 stype != IEEE80211_STYPE_PSPOLL) 2894 stype != IEEE80211_STYPE_PSPOLL)
2961 schedule_packet_send(local, sta); 2895 schedule_packet_send(local, sta);
@@ -3029,13 +2963,9 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
3029#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT 2963#ifndef PRISM2_NO_KERNEL_IEEE80211_MGMT
3030 } else { 2964 } else {
3031 printk(KERN_DEBUG "%s: dropped received packet" 2965 printk(KERN_DEBUG "%s: dropped received packet"
3032 " from non-associated STA " 2966 " from non-associated STA %pM"
3033 MAC_FMT
3034 " (type=0x%02x, subtype=0x%02x)\n", 2967 " (type=0x%02x, subtype=0x%02x)\n",
3035 dev->name, 2968 dev->name, hdr->addr2,
3036 hdr->addr2[0], hdr->addr2[1],
3037 hdr->addr2[2], hdr->addr2[3],
3038 hdr->addr2[4], hdr->addr2[5],
3039 type >> 2, stype >> 4); 2969 type >> 2, stype >> 4);
3040 hostap_rx(dev, skb, rx_stats); 2970 hostap_rx(dev, skb, rx_stats);
3041#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 2971#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
@@ -3068,13 +2998,9 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
3068 * after being unavailable for some time. Speed up 2998 * after being unavailable for some time. Speed up
3069 * re-association by informing the station about it not 2999 * re-association by informing the station about it not
3070 * being associated. */ 3000 * being associated. */
3071 printk(KERN_DEBUG "%s: rejected received nullfunc " 3001 printk(KERN_DEBUG "%s: rejected received nullfunc frame"
3072 "frame without ToDS from not associated STA " 3002 " without ToDS from not associated STA %pM\n",
3073 MAC_FMT "\n", 3003 dev->name, hdr->addr2);
3074 dev->name,
3075 hdr->addr2[0], hdr->addr2[1],
3076 hdr->addr2[2], hdr->addr2[3],
3077 hdr->addr2[4], hdr->addr2[5]);
3078 hostap_rx(dev, skb, rx_stats); 3004 hostap_rx(dev, skb, rx_stats);
3079#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */ 3005#endif /* PRISM2_NO_KERNEL_IEEE80211_MGMT */
3080 } 3006 }
@@ -3090,13 +3016,10 @@ ap_rx_ret hostap_handle_sta_rx(local_info_t *local, struct net_device *dev,
3090 * broadcast frame from an IBSS network. Drop it silently. 3016 * broadcast frame from an IBSS network. Drop it silently.
3091 * If BSSID is own, report the dropping of this frame. */ 3017 * If BSSID is own, report the dropping of this frame. */
3092 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) { 3018 if (memcmp(hdr->addr3, dev->dev_addr, ETH_ALEN) == 0) {
3093 printk(KERN_DEBUG "%s: dropped received packet from " 3019 printk(KERN_DEBUG "%s: dropped received packet from %pM"
3094 MAC_FMT " with no ToDS flag " 3020 " with no ToDS flag "
3095 "(type=0x%02x, subtype=0x%02x)\n", dev->name, 3021 "(type=0x%02x, subtype=0x%02x)\n", dev->name,
3096 hdr->addr2[0], hdr->addr2[1], 3022 hdr->addr2, type >> 2, stype >> 4);
3097 hdr->addr2[2], hdr->addr2[3],
3098 hdr->addr2[4], hdr->addr2[5],
3099 type >> 2, stype >> 4);
3100 hostap_dump_rx_80211(dev->name, skb, rx_stats); 3023 hostap_dump_rx_80211(dev->name, skb, rx_stats);
3101 } 3024 }
3102 ret = AP_RX_DROP; 3025 ret = AP_RX_DROP;
diff --git a/drivers/net/wireless/hostap/hostap_hw.c b/drivers/net/wireless/hostap/hostap_hw.c
index 3153fe9d7ce0..fd7f7ceeac46 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -2335,10 +2335,6 @@ static void prism2_txexc(local_info_t *local)
2335 int show_dump, res; 2335 int show_dump, res;
2336 char *payload = NULL; 2336 char *payload = NULL;
2337 struct hfa384x_tx_frame txdesc; 2337 struct hfa384x_tx_frame txdesc;
2338 DECLARE_MAC_BUF(mac);
2339 DECLARE_MAC_BUF(mac2);
2340 DECLARE_MAC_BUF(mac3);
2341 DECLARE_MAC_BUF(mac4);
2342 2338
2343 show_dump = local->frame_dump & PRISM2_DUMP_TXEXC_HDR; 2339 show_dump = local->frame_dump & PRISM2_DUMP_TXEXC_HDR;
2344 local->stats.tx_errors++; 2340 local->stats.tx_errors++;
@@ -2404,9 +2400,9 @@ static void prism2_txexc(local_info_t *local)
2404 WLAN_FC_GET_STYPE(fc) >> 4, 2400 WLAN_FC_GET_STYPE(fc) >> 4,
2405 fc & IEEE80211_FCTL_TODS ? " ToDS" : "", 2401 fc & IEEE80211_FCTL_TODS ? " ToDS" : "",
2406 fc & IEEE80211_FCTL_FROMDS ? " FromDS" : ""); 2402 fc & IEEE80211_FCTL_FROMDS ? " FromDS" : "");
2407 PDEBUG(DEBUG_EXTRA, " A1=%s A2=%s A3=%s A4=%s\n", 2403 PDEBUG(DEBUG_EXTRA, " A1=%pM A2=%pM A3=%pM A4=%pM\n",
2408 print_mac(mac, txdesc.addr1), print_mac(mac2, txdesc.addr2), 2404 txdesc.addr1, txdesc.addr2,
2409 print_mac(mac3, txdesc.addr3), print_mac(mac4, txdesc.addr4)); 2405 txdesc.addr3, txdesc.addr4);
2410} 2406}
2411 2407
2412 2408
diff --git a/drivers/net/wireless/hostap/hostap_info.c b/drivers/net/wireless/hostap/hostap_info.c
index 7cd3fb79230e..99b4cf41edf2 100644
--- a/drivers/net/wireless/hostap/hostap_info.c
+++ b/drivers/net/wireless/hostap/hostap_info.c
@@ -166,7 +166,6 @@ static void prism2_host_roaming(local_info_t *local)
166 struct hfa384x_hostscan_result *selected, *entry; 166 struct hfa384x_hostscan_result *selected, *entry;
167 int i; 167 int i;
168 unsigned long flags; 168 unsigned long flags;
169 DECLARE_MAC_BUF(mac);
170 169
171 if (local->last_join_time && 170 if (local->last_join_time &&
172 time_before(jiffies, local->last_join_time + 10 * HZ)) { 171 time_before(jiffies, local->last_join_time + 10 * HZ)) {
@@ -199,9 +198,8 @@ static void prism2_host_roaming(local_info_t *local)
199 local->preferred_ap[2] || local->preferred_ap[3] || 198 local->preferred_ap[2] || local->preferred_ap[3] ||
200 local->preferred_ap[4] || local->preferred_ap[5]) { 199 local->preferred_ap[4] || local->preferred_ap[5]) {
201 /* Try to find preferred AP */ 200 /* Try to find preferred AP */
202 PDEBUG(DEBUG_EXTRA, "%s: Preferred AP BSSID " 201 PDEBUG(DEBUG_EXTRA, "%s: Preferred AP BSSID %pM\n",
203 "%s\n", 202 dev->name, local->preferred_ap);
204 dev->name, print_mac(mac, local->preferred_ap));
205 for (i = 0; i < local->last_scan_results_count; i++) { 203 for (i = 0; i < local->last_scan_results_count; i++) {
206 entry = &local->last_scan_results[i]; 204 entry = &local->last_scan_results[i];
207 if (memcmp(local->preferred_ap, entry->bssid, 6) == 0) 205 if (memcmp(local->preferred_ap, entry->bssid, 6) == 0)
@@ -218,9 +216,9 @@ static void prism2_host_roaming(local_info_t *local)
218 req.channel = selected->chid; 216 req.channel = selected->chid;
219 spin_unlock_irqrestore(&local->lock, flags); 217 spin_unlock_irqrestore(&local->lock, flags);
220 218
221 PDEBUG(DEBUG_EXTRA, "%s: JoinRequest: BSSID=%s" 219 PDEBUG(DEBUG_EXTRA, "%s: JoinRequest: BSSID=%pM"
222 " channel=%d\n", 220 " channel=%d\n",
223 dev->name, print_mac(mac, req.bssid), le16_to_cpu(req.channel)); 221 dev->name, req.bssid, le16_to_cpu(req.channel));
224 if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req, 222 if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req,
225 sizeof(req))) { 223 sizeof(req))) {
226 printk(KERN_DEBUG "%s: JoinRequest failed\n", dev->name); 224 printk(KERN_DEBUG "%s: JoinRequest failed\n", dev->name);
@@ -413,7 +411,6 @@ static void handle_info_queue_linkstatus(local_info_t *local)
413 int val = local->prev_link_status; 411 int val = local->prev_link_status;
414 int connected; 412 int connected;
415 union iwreq_data wrqu; 413 union iwreq_data wrqu;
416 DECLARE_MAC_BUF(mac);
417 414
418 connected = 415 connected =
419 val == HFA384X_LINKSTATUS_CONNECTED || 416 val == HFA384X_LINKSTATUS_CONNECTED ||
@@ -425,10 +422,9 @@ static void handle_info_queue_linkstatus(local_info_t *local)
425 printk(KERN_DEBUG "%s: could not read CURRENTBSSID after " 422 printk(KERN_DEBUG "%s: could not read CURRENTBSSID after "
426 "LinkStatus event\n", local->dev->name); 423 "LinkStatus event\n", local->dev->name);
427 } else { 424 } else {
428 PDEBUG(DEBUG_EXTRA, "%s: LinkStatus: BSSID=" 425 PDEBUG(DEBUG_EXTRA, "%s: LinkStatus: BSSID=%pM\n",
429 "%s\n",
430 local->dev->name, 426 local->dev->name,
431 print_mac(mac, (unsigned char *) local->bssid)); 427 (unsigned char *) local->bssid);
432 if (local->wds_type & HOSTAP_WDS_AP_CLIENT) 428 if (local->wds_type & HOSTAP_WDS_AP_CLIENT)
433 hostap_add_sta(local->ap, local->bssid); 429 hostap_add_sta(local->ap, local->bssid);
434 } 430 }
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 3f8b1d7036e5..2318c5df7a08 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -664,7 +664,6 @@ static int hostap_join_ap(struct net_device *dev)
664 unsigned long flags; 664 unsigned long flags;
665 int i; 665 int i;
666 struct hfa384x_hostscan_result *entry; 666 struct hfa384x_hostscan_result *entry;
667 DECLARE_MAC_BUF(mac);
668 667
669 iface = netdev_priv(dev); 668 iface = netdev_priv(dev);
670 local = iface->local; 669 local = iface->local;
@@ -686,14 +685,13 @@ static int hostap_join_ap(struct net_device *dev)
686 685
687 if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req, 686 if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req,
688 sizeof(req))) { 687 sizeof(req))) {
689 printk(KERN_DEBUG "%s: JoinRequest %s" 688 printk(KERN_DEBUG "%s: JoinRequest %pM failed\n",
690 " failed\n", 689 dev->name, local->preferred_ap);
691 dev->name, print_mac(mac, local->preferred_ap));
692 return -1; 690 return -1;
693 } 691 }
694 692
695 printk(KERN_DEBUG "%s: Trying to join BSSID %s\n", 693 printk(KERN_DEBUG "%s: Trying to join BSSID %pM\n",
696 dev->name, print_mac(mac, local->preferred_ap)); 694 dev->name, local->preferred_ap);
697 695
698 return 0; 696 return 0;
699} 697}
@@ -3701,10 +3699,8 @@ static int prism2_ioctl_set_assoc_ap_addr(local_info_t *local,
3701 struct prism2_hostapd_param *param, 3699 struct prism2_hostapd_param *param,
3702 int param_len) 3700 int param_len)
3703{ 3701{
3704 DECLARE_MAC_BUF(mac); 3702 printk(KERN_DEBUG "%ssta: associated as client with AP %pM\n",
3705 printk(KERN_DEBUG "%ssta: associated as client with AP " 3703 local->dev->name, param->sta_addr);
3706 "%s\n",
3707 local->dev->name, print_mac(mac, param->sta_addr));
3708 memcpy(local->assoc_ap_addr, param->sta_addr, ETH_ALEN); 3704 memcpy(local->assoc_ap_addr, param->sta_addr, ETH_ALEN);
3709 return 0; 3705 return 0;
3710} 3706}
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index 756ab56c1f40..4c36eb2fafd1 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -530,10 +530,6 @@ int hostap_set_auth_algs(local_info_t *local)
530void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx) 530void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx)
531{ 531{
532 u16 status, fc; 532 u16 status, fc;
533 DECLARE_MAC_BUF(mac);
534 DECLARE_MAC_BUF(mac2);
535 DECLARE_MAC_BUF(mac3);
536 DECLARE_MAC_BUF(mac4);
537 533
538 status = __le16_to_cpu(rx->status); 534 status = __le16_to_cpu(rx->status);
539 535
@@ -552,12 +548,11 @@ void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx)
552 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "", 548 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
553 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : ""); 549 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
554 550
555 printk(KERN_DEBUG " A1=%s A2=%s A3=%s A4=%s\n", 551 printk(KERN_DEBUG " A1=%pM A2=%pM A3=%pM A4=%pM\n",
556 print_mac(mac, rx->addr1), print_mac(mac2, rx->addr2), 552 rx->addr1, rx->addr2, rx->addr3, rx->addr4);
557 print_mac(mac3, rx->addr3), print_mac(mac4, rx->addr4));
558 553
559 printk(KERN_DEBUG " dst=%s src=%s len=%d\n", 554 printk(KERN_DEBUG " dst=%pM src=%pM len=%d\n",
560 print_mac(mac, rx->dst_addr), print_mac(mac2, rx->src_addr), 555 rx->dst_addr, rx->src_addr,
561 __be16_to_cpu(rx->len)); 556 __be16_to_cpu(rx->len));
562} 557}
563 558
@@ -565,10 +560,6 @@ void hostap_dump_rx_header(const char *name, const struct hfa384x_rx_frame *rx)
565void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx) 560void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)
566{ 561{
567 u16 fc; 562 u16 fc;
568 DECLARE_MAC_BUF(mac);
569 DECLARE_MAC_BUF(mac2);
570 DECLARE_MAC_BUF(mac3);
571 DECLARE_MAC_BUF(mac4);
572 563
573 printk(KERN_DEBUG "%s: TX status=0x%04x retry_count=%d tx_rate=%d " 564 printk(KERN_DEBUG "%s: TX status=0x%04x retry_count=%d tx_rate=%d "
574 "tx_control=0x%04x; jiffies=%ld\n", 565 "tx_control=0x%04x; jiffies=%ld\n",
@@ -584,12 +575,11 @@ void hostap_dump_tx_header(const char *name, const struct hfa384x_tx_frame *tx)
584 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "", 575 fc & IEEE80211_FCTL_TODS ? " [ToDS]" : "",
585 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : ""); 576 fc & IEEE80211_FCTL_FROMDS ? " [FromDS]" : "");
586 577
587 printk(KERN_DEBUG " A1=%s A2=%s A3=%s A4=%s\n", 578 printk(KERN_DEBUG " A1=%pM A2=%pM A3=%pM A4=%pM\n",
588 print_mac(mac, tx->addr1), print_mac(mac2, tx->addr2), 579 tx->addr1, tx->addr2, tx->addr3, tx->addr4);
589 print_mac(mac3, tx->addr3), print_mac(mac4, tx->addr4));
590 580
591 printk(KERN_DEBUG " dst=%s src=%s len=%d\n", 581 printk(KERN_DEBUG " dst=%pM src=%pM len=%d\n",
592 print_mac(mac, tx->dst_addr), print_mac(mac2, tx->src_addr), 582 tx->dst_addr, tx->src_addr,
593 __be16_to_cpu(tx->len)); 583 __be16_to_cpu(tx->len));
594} 584}
595 585
diff --git a/drivers/net/wireless/hostap/hostap_pci.c b/drivers/net/wireless/hostap/hostap_pci.c
index 3a874fc621d3..8fdd41f4b4f2 100644
--- a/drivers/net/wireless/hostap/hostap_pci.c
+++ b/drivers/net/wireless/hostap/hostap_pci.c
@@ -312,7 +312,7 @@ static int prism2_pci_probe(struct pci_dev *pdev,
312 goto err_out_disable; 312 goto err_out_disable;
313 } 313 }
314 314
315 mem = ioremap(phymem, pci_resource_len(pdev, 0)); 315 mem = pci_ioremap_bar(pdev, 0);
316 if (mem == NULL) { 316 if (mem == NULL) {
317 printk(KERN_ERR "prism2: Cannot remap PCI memory region\n") ; 317 printk(KERN_ERR "prism2: Cannot remap PCI memory region\n") ;
318 goto fail; 318 goto fail;
diff --git a/drivers/net/wireless/hostap/hostap_proc.c b/drivers/net/wireless/hostap/hostap_proc.c
index b03536008ad9..ae7d3caf3dae 100644
--- a/drivers/net/wireless/hostap/hostap_proc.c
+++ b/drivers/net/wireless/hostap/hostap_proc.c
@@ -106,7 +106,6 @@ static int prism2_wds_proc_read(char *page, char **start, off_t off,
106 local_info_t *local = (local_info_t *) data; 106 local_info_t *local = (local_info_t *) data;
107 struct list_head *ptr; 107 struct list_head *ptr;
108 struct hostap_interface *iface; 108 struct hostap_interface *iface;
109 DECLARE_MAC_BUF(mac);
110 109
111 if (off > PROC_LIMIT) { 110 if (off > PROC_LIMIT) {
112 *eof = 1; 111 *eof = 1;
@@ -118,9 +117,9 @@ static int prism2_wds_proc_read(char *page, char **start, off_t off,
118 iface = list_entry(ptr, struct hostap_interface, list); 117 iface = list_entry(ptr, struct hostap_interface, list);
119 if (iface->type != HOSTAP_INTERFACE_WDS) 118 if (iface->type != HOSTAP_INTERFACE_WDS)
120 continue; 119 continue;
121 p += sprintf(p, "%s\t%s\n", 120 p += sprintf(p, "%s\t%pM\n",
122 iface->dev->name, 121 iface->dev->name,
123 print_mac(mac, iface->u.wds.remote_addr)); 122 iface->u.wds.remote_addr);
124 if ((p - page) > PROC_LIMIT) { 123 if ((p - page) > PROC_LIMIT) {
125 printk(KERN_DEBUG "%s: wds proc did not fit\n", 124 printk(KERN_DEBUG "%s: wds proc did not fit\n",
126 local->dev->name); 125 local->dev->name);
@@ -148,7 +147,6 @@ static int prism2_bss_list_proc_read(char *page, char **start, off_t off,
148 struct list_head *ptr; 147 struct list_head *ptr;
149 struct hostap_bss_info *bss; 148 struct hostap_bss_info *bss;
150 int i; 149 int i;
151 DECLARE_MAC_BUF(mac);
152 150
153 if (off > PROC_LIMIT) { 151 if (off > PROC_LIMIT) {
154 *eof = 1; 152 *eof = 1;
@@ -160,8 +158,8 @@ static int prism2_bss_list_proc_read(char *page, char **start, off_t off,
160 spin_lock_bh(&local->lock); 158 spin_lock_bh(&local->lock);
161 list_for_each(ptr, &local->bss_list) { 159 list_for_each(ptr, &local->bss_list) {
162 bss = list_entry(ptr, struct hostap_bss_info, list); 160 bss = list_entry(ptr, struct hostap_bss_info, list);
163 p += sprintf(p, "%s\t%lu\t%u\t0x%x\t", 161 p += sprintf(p, "%pM\t%lu\t%u\t0x%x\t",
164 print_mac(mac, bss->bssid), bss->last_update, 162 bss->bssid, bss->last_update,
165 bss->count, bss->capab_info); 163 bss->count, bss->capab_info);
166 for (i = 0; i < bss->ssid_len; i++) { 164 for (i = 0; i < bss->ssid_len; i++) {
167 p += sprintf(p, "%c", 165 p += sprintf(p, "%c",
@@ -314,7 +312,6 @@ static int prism2_scan_results_proc_read(char *page, char **start, off_t off,
314 int entry, i, len, total = 0; 312 int entry, i, len, total = 0;
315 struct hfa384x_hostscan_result *scanres; 313 struct hfa384x_hostscan_result *scanres;
316 u8 *pos; 314 u8 *pos;
317 DECLARE_MAC_BUF(mac);
318 315
319 p += sprintf(p, "CHID ANL SL BcnInt Capab Rate BSSID ATIM SupRates " 316 p += sprintf(p, "CHID ANL SL BcnInt Capab Rate BSSID ATIM SupRates "
320 "SSID\n"); 317 "SSID\n");
@@ -332,14 +329,14 @@ static int prism2_scan_results_proc_read(char *page, char **start, off_t off,
332 if ((p - page) > (PAGE_SIZE - 200)) 329 if ((p - page) > (PAGE_SIZE - 200))
333 break; 330 break;
334 331
335 p += sprintf(p, "%d %d %d %d 0x%02x %d %s %d ", 332 p += sprintf(p, "%d %d %d %d 0x%02x %d %pM %d ",
336 le16_to_cpu(scanres->chid), 333 le16_to_cpu(scanres->chid),
337 (s16) le16_to_cpu(scanres->anl), 334 (s16) le16_to_cpu(scanres->anl),
338 (s16) le16_to_cpu(scanres->sl), 335 (s16) le16_to_cpu(scanres->sl),
339 le16_to_cpu(scanres->beacon_interval), 336 le16_to_cpu(scanres->beacon_interval),
340 le16_to_cpu(scanres->capability), 337 le16_to_cpu(scanres->capability),
341 le16_to_cpu(scanres->rate), 338 le16_to_cpu(scanres->rate),
342 print_mac(mac, scanres->bssid), 339 scanres->bssid,
343 le16_to_cpu(scanres->atim)); 340 le16_to_cpu(scanres->atim));
344 341
345 pos = scanres->sup_rates; 342 pos = scanres->sup_rates;
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index bca74811bc7f..6e988d2486a7 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -1914,7 +1914,6 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
1914 u32 chan; 1914 u32 chan;
1915 char *txratename; 1915 char *txratename;
1916 u8 bssid[ETH_ALEN]; 1916 u8 bssid[ETH_ALEN];
1917 DECLARE_MAC_BUF(mac);
1918 1917
1919 /* 1918 /*
1920 * TBD: BSSID is usually 00:00:00:00:00:00 here and not 1919 * TBD: BSSID is usually 00:00:00:00:00:00 here and not
@@ -1975,10 +1974,9 @@ static void isr_indicate_associated(struct ipw2100_priv *priv, u32 status)
1975 break; 1974 break;
1976 } 1975 }
1977 1976
1978 IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID=" 1977 IPW_DEBUG_INFO("%s: Associated with '%s' at %s, channel %d (BSSID=%pM)\n",
1979 "%s)\n",
1980 priv->net_dev->name, escape_essid(essid, essid_len), 1978 priv->net_dev->name, escape_essid(essid, essid_len),
1981 txratename, chan, print_mac(mac, bssid)); 1979 txratename, chan, bssid);
1982 1980
1983 /* now we copy read ssid into dev */ 1981 /* now we copy read ssid into dev */
1984 if (!(priv->config & CFG_STATIC_ESSID)) { 1982 if (!(priv->config & CFG_STATIC_ESSID)) {
@@ -2046,12 +2044,10 @@ static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
2046 2044
2047static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status) 2045static void isr_indicate_association_lost(struct ipw2100_priv *priv, u32 status)
2048{ 2046{
2049 DECLARE_MAC_BUF(mac);
2050
2051 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC, 2047 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | IPW_DL_ASSOC,
2052 "disassociated: '%s' %s \n", 2048 "disassociated: '%s' %pM \n",
2053 escape_essid(priv->essid, priv->essid_len), 2049 escape_essid(priv->essid, priv->essid_len),
2054 print_mac(mac, priv->bssid)); 2050 priv->bssid);
2055 2051
2056 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING); 2052 priv->status &= ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING);
2057 2053
@@ -4058,7 +4054,6 @@ static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr,
4058 char *out = buf; 4054 char *out = buf;
4059 int length; 4055 int length;
4060 int ret; 4056 int ret;
4061 DECLARE_MAC_BUF(mac);
4062 4057
4063 if (priv->status & STATUS_RF_KILL_MASK) 4058 if (priv->status & STATUS_RF_KILL_MASK)
4064 return 0; 4059 return 0;
@@ -4086,7 +4081,7 @@ static ssize_t show_bssinfo(struct device *d, struct device_attribute *attr,
4086 __LINE__); 4081 __LINE__);
4087 4082
4088 out += sprintf(out, "ESSID: %s\n", essid); 4083 out += sprintf(out, "ESSID: %s\n", essid);
4089 out += sprintf(out, "BSSID: %s\n", print_mac(mac, bssid)); 4084 out += sprintf(out, "BSSID: %pM\n", bssid);
4090 out += sprintf(out, "Channel: %d\n", chan); 4085 out += sprintf(out, "Channel: %d\n", chan);
4091 4086
4092 return out - buf; 4087 return out - buf;
@@ -4662,7 +4657,6 @@ static int ipw2100_read_mac_address(struct ipw2100_priv *priv)
4662{ 4657{
4663 u32 length = ETH_ALEN; 4658 u32 length = ETH_ALEN;
4664 u8 addr[ETH_ALEN]; 4659 u8 addr[ETH_ALEN];
4665 DECLARE_MAC_BUF(mac);
4666 4660
4667 int err; 4661 int err;
4668 4662
@@ -4673,8 +4667,7 @@ static int ipw2100_read_mac_address(struct ipw2100_priv *priv)
4673 } 4667 }
4674 4668
4675 memcpy(priv->net_dev->dev_addr, addr, ETH_ALEN); 4669 memcpy(priv->net_dev->dev_addr, addr, ETH_ALEN);
4676 IPW_DEBUG_INFO("card MAC is %s\n", 4670 IPW_DEBUG_INFO("card MAC is %pM\n", priv->net_dev->dev_addr);
4677 print_mac(mac, priv->net_dev->dev_addr));
4678 4671
4679 return 0; 4672 return 0;
4680} 4673}
@@ -5053,10 +5046,8 @@ static int ipw2100_set_mandatory_bssid(struct ipw2100_priv *priv, u8 * bssid,
5053 int err; 5046 int err;
5054 5047
5055#ifdef CONFIG_IPW2100_DEBUG 5048#ifdef CONFIG_IPW2100_DEBUG
5056 DECLARE_MAC_BUF(mac);
5057 if (bssid != NULL) 5049 if (bssid != NULL)
5058 IPW_DEBUG_HC("MANDATORY_BSSID: %s\n", 5050 IPW_DEBUG_HC("MANDATORY_BSSID: %pM\n", bssid);
5059 print_mac(mac, bssid));
5060 else 5051 else
5061 IPW_DEBUG_HC("MANDATORY_BSSID: <clear>\n"); 5052 IPW_DEBUG_HC("MANDATORY_BSSID: <clear>\n");
5062#endif 5053#endif
@@ -6905,7 +6896,6 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6905 static const unsigned char off[] = { 6896 static const unsigned char off[] = {
6906 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 6897 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
6907 }; 6898 };
6908 DECLARE_MAC_BUF(mac);
6909 6899
6910 // sanity checks 6900 // sanity checks
6911 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER) 6901 if (wrqu->ap_addr.sa_family != ARPHRD_ETHER)
@@ -6931,8 +6921,7 @@ static int ipw2100_wx_set_wap(struct net_device *dev,
6931 6921
6932 err = ipw2100_set_mandatory_bssid(priv, wrqu->ap_addr.sa_data, 0); 6922 err = ipw2100_set_mandatory_bssid(priv, wrqu->ap_addr.sa_data, 0);
6933 6923
6934 IPW_DEBUG_WX("SET BSSID -> %s\n", 6924 IPW_DEBUG_WX("SET BSSID -> %pM\n", wrqu->ap_addr.sa_data);
6935 print_mac(mac, wrqu->ap_addr.sa_data));
6936 6925
6937 done: 6926 done:
6938 mutex_unlock(&priv->action_mutex); 6927 mutex_unlock(&priv->action_mutex);
@@ -6948,7 +6937,6 @@ static int ipw2100_wx_get_wap(struct net_device *dev,
6948 */ 6937 */
6949 6938
6950 struct ipw2100_priv *priv = ieee80211_priv(dev); 6939 struct ipw2100_priv *priv = ieee80211_priv(dev);
6951 DECLARE_MAC_BUF(mac);
6952 6940
6953 /* If we are associated, trying to associate, or have a statically 6941 /* If we are associated, trying to associate, or have a statically
6954 * configured BSSID then return that; otherwise return ANY */ 6942 * configured BSSID then return that; otherwise return ANY */
@@ -6958,8 +6946,7 @@ static int ipw2100_wx_get_wap(struct net_device *dev,
6958 } else 6946 } else
6959 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); 6947 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
6960 6948
6961 IPW_DEBUG_WX("Getting WAP BSSID: %s\n", 6949 IPW_DEBUG_WX("Getting WAP BSSID: %pM\n", wrqu->ap_addr.sa_data);
6962 print_mac(mac, wrqu->ap_addr.sa_data));
6963 return 0; 6950 return 0;
6964} 6951}
6965 6952
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index dcce3542d5a7..13633d8274a3 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -2265,8 +2265,8 @@ static int ipw_send_adapter_address(struct ipw_priv *priv, u8 * mac)
2265 return -1; 2265 return -1;
2266 } 2266 }
2267 2267
2268 IPW_DEBUG_INFO("%s: Setting MAC to %s\n", 2268 IPW_DEBUG_INFO("%s: Setting MAC to %pM\n",
2269 priv->net_dev->name, print_mac(mac, mac)); 2269 priv->net_dev->name, mac);
2270 2270
2271 return ipw_send_cmd_pdu(priv, IPW_CMD_ADAPTER_ADDRESS, ETH_ALEN, mac); 2271 return ipw_send_cmd_pdu(priv, IPW_CMD_ADAPTER_ADDRESS, ETH_ALEN, mac);
2272} 2272}
@@ -3812,7 +3812,6 @@ static u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid)
3812{ 3812{
3813 struct ipw_station_entry entry; 3813 struct ipw_station_entry entry;
3814 int i; 3814 int i;
3815 DECLARE_MAC_BUF(mac);
3816 3815
3817 for (i = 0; i < priv->num_stations; i++) { 3816 for (i = 0; i < priv->num_stations; i++) {
3818 if (!memcmp(priv->stations[i], bssid, ETH_ALEN)) { 3817 if (!memcmp(priv->stations[i], bssid, ETH_ALEN)) {
@@ -3829,7 +3828,7 @@ static u8 ipw_add_station(struct ipw_priv *priv, u8 * bssid)
3829 if (i == MAX_STATIONS) 3828 if (i == MAX_STATIONS)
3830 return IPW_INVALID_STATION; 3829 return IPW_INVALID_STATION;
3831 3830
3832 IPW_DEBUG_SCAN("Adding AdHoc station: %s\n", print_mac(mac, bssid)); 3831 IPW_DEBUG_SCAN("Adding AdHoc station: %pM\n", bssid);
3833 3832
3834 entry.reserved = 0; 3833 entry.reserved = 0;
3835 entry.support_mode = 0; 3834 entry.support_mode = 0;
@@ -3856,7 +3855,6 @@ static u8 ipw_find_station(struct ipw_priv *priv, u8 * bssid)
3856static void ipw_send_disassociate(struct ipw_priv *priv, int quiet) 3855static void ipw_send_disassociate(struct ipw_priv *priv, int quiet)
3857{ 3856{
3858 int err; 3857 int err;
3859 DECLARE_MAC_BUF(mac);
3860 3858
3861 if (priv->status & STATUS_ASSOCIATING) { 3859 if (priv->status & STATUS_ASSOCIATING) {
3862 IPW_DEBUG_ASSOC("Disassociating while associating.\n"); 3860 IPW_DEBUG_ASSOC("Disassociating while associating.\n");
@@ -3869,9 +3867,9 @@ static void ipw_send_disassociate(struct ipw_priv *priv, int quiet)
3869 return; 3867 return;
3870 } 3868 }
3871 3869
3872 IPW_DEBUG_ASSOC("Disassocation attempt from %s " 3870 IPW_DEBUG_ASSOC("Disassocation attempt from %pM "
3873 "on channel %d.\n", 3871 "on channel %d.\n",
3874 print_mac(mac, priv->assoc_request.bssid), 3872 priv->assoc_request.bssid,
3875 priv->assoc_request.channel); 3873 priv->assoc_request.channel);
3876 3874
3877 priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED); 3875 priv->status &= ~(STATUS_ASSOCIATING | STATUS_ASSOCIATED);
@@ -4397,7 +4395,6 @@ static void handle_scan_event(struct ipw_priv *priv)
4397static void ipw_rx_notification(struct ipw_priv *priv, 4395static void ipw_rx_notification(struct ipw_priv *priv,
4398 struct ipw_rx_notification *notif) 4396 struct ipw_rx_notification *notif)
4399{ 4397{
4400 DECLARE_MAC_BUF(mac);
4401 u16 size = le16_to_cpu(notif->size); 4398 u16 size = le16_to_cpu(notif->size);
4402 notif->size = le16_to_cpu(notif->size); 4399 notif->size = le16_to_cpu(notif->size);
4403 4400
@@ -4411,11 +4408,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4411 case CMAS_ASSOCIATED:{ 4408 case CMAS_ASSOCIATED:{
4412 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4409 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4413 IPW_DL_ASSOC, 4410 IPW_DL_ASSOC,
4414 "associated: '%s' %s" 4411 "associated: '%s' %pM \n",
4415 " \n",
4416 escape_essid(priv->essid, 4412 escape_essid(priv->essid,
4417 priv->essid_len), 4413 priv->essid_len),
4418 print_mac(mac, priv->bssid)); 4414 priv->bssid);
4419 4415
4420 switch (priv->ieee->iw_mode) { 4416 switch (priv->ieee->iw_mode) {
4421 case IW_MODE_INFRA: 4417 case IW_MODE_INFRA:
@@ -4492,13 +4488,13 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4492 IPW_DL_STATE | 4488 IPW_DL_STATE |
4493 IPW_DL_ASSOC, 4489 IPW_DL_ASSOC,
4494 "deauthenticated: '%s' " 4490 "deauthenticated: '%s' "
4495 "%s" 4491 "%pM"
4496 ": (0x%04X) - %s \n", 4492 ": (0x%04X) - %s \n",
4497 escape_essid(priv-> 4493 escape_essid(priv->
4498 essid, 4494 essid,
4499 priv-> 4495 priv->
4500 essid_len), 4496 essid_len),
4501 print_mac(mac, priv->bssid), 4497 priv->bssid,
4502 le16_to_cpu(auth->status), 4498 le16_to_cpu(auth->status),
4503 ipw_get_status_code 4499 ipw_get_status_code
4504 (le16_to_cpu 4500 (le16_to_cpu
@@ -4515,11 +4511,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4515 4511
4516 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4512 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4517 IPW_DL_ASSOC, 4513 IPW_DL_ASSOC,
4518 "authenticated: '%s' %s" 4514 "authenticated: '%s' %pM\n",
4519 "\n",
4520 escape_essid(priv->essid, 4515 escape_essid(priv->essid,
4521 priv->essid_len), 4516 priv->essid_len),
4522 print_mac(mac, priv->bssid)); 4517 priv->bssid);
4523 break; 4518 break;
4524 } 4519 }
4525 4520
@@ -4544,11 +4539,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4544 4539
4545 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4540 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4546 IPW_DL_ASSOC, 4541 IPW_DL_ASSOC,
4547 "disassociated: '%s' %s" 4542 "disassociated: '%s' %pM \n",
4548 " \n",
4549 escape_essid(priv->essid, 4543 escape_essid(priv->essid,
4550 priv->essid_len), 4544 priv->essid_len),
4551 print_mac(mac, priv->bssid)); 4545 priv->bssid);
4552 4546
4553 priv->status &= 4547 priv->status &=
4554 ~(STATUS_DISASSOCIATING | 4548 ~(STATUS_DISASSOCIATING |
@@ -4583,10 +4577,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4583 switch (auth->state) { 4577 switch (auth->state) {
4584 case CMAS_AUTHENTICATED: 4578 case CMAS_AUTHENTICATED:
4585 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE, 4579 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE,
4586 "authenticated: '%s' %s \n", 4580 "authenticated: '%s' %pM \n",
4587 escape_essid(priv->essid, 4581 escape_essid(priv->essid,
4588 priv->essid_len), 4582 priv->essid_len),
4589 print_mac(mac, priv->bssid)); 4583 priv->bssid);
4590 priv->status |= STATUS_AUTH; 4584 priv->status |= STATUS_AUTH;
4591 break; 4585 break;
4592 4586
@@ -4602,10 +4596,10 @@ static void ipw_rx_notification(struct ipw_priv *priv,
4602 } 4596 }
4603 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE | 4597 IPW_DEBUG(IPW_DL_NOTIF | IPW_DL_STATE |
4604 IPW_DL_ASSOC, 4598 IPW_DL_ASSOC,
4605 "deauthenticated: '%s' %s\n", 4599 "deauthenticated: '%s' %pM\n",
4606 escape_essid(priv->essid, 4600 escape_essid(priv->essid,
4607 priv->essid_len), 4601 priv->essid_len),
4608 print_mac(mac, priv->bssid)); 4602 priv->bssid);
4609 4603
4610 priv->status &= ~(STATUS_ASSOCIATING | 4604 priv->status &= ~(STATUS_ASSOCIATING |
4611 STATUS_AUTH | 4605 STATUS_AUTH |
@@ -5429,27 +5423,25 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5429 int roaming) 5423 int roaming)
5430{ 5424{
5431 struct ipw_supported_rates rates; 5425 struct ipw_supported_rates rates;
5432 DECLARE_MAC_BUF(mac);
5433 DECLARE_MAC_BUF(mac2);
5434 5426
5435 /* Verify that this network's capability is compatible with the 5427 /* Verify that this network's capability is compatible with the
5436 * current mode (AdHoc or Infrastructure) */ 5428 * current mode (AdHoc or Infrastructure) */
5437 if ((priv->ieee->iw_mode == IW_MODE_ADHOC && 5429 if ((priv->ieee->iw_mode == IW_MODE_ADHOC &&
5438 !(network->capability & WLAN_CAPABILITY_IBSS))) { 5430 !(network->capability & WLAN_CAPABILITY_IBSS))) {
5439 IPW_DEBUG_MERGE("Network '%s (%s)' excluded due to " 5431 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded due to "
5440 "capability mismatch.\n", 5432 "capability mismatch.\n",
5441 escape_essid(network->ssid, network->ssid_len), 5433 escape_essid(network->ssid, network->ssid_len),
5442 print_mac(mac, network->bssid)); 5434 network->bssid);
5443 return 0; 5435 return 0;
5444 } 5436 }
5445 5437
5446 /* If we do not have an ESSID for this AP, we can not associate with 5438 /* If we do not have an ESSID for this AP, we can not associate with
5447 * it */ 5439 * it */
5448 if (network->flags & NETWORK_EMPTY_ESSID) { 5440 if (network->flags & NETWORK_EMPTY_ESSID) {
5449 IPW_DEBUG_MERGE("Network '%s (%s)' excluded " 5441 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5450 "because of hidden ESSID.\n", 5442 "because of hidden ESSID.\n",
5451 escape_essid(network->ssid, network->ssid_len), 5443 escape_essid(network->ssid, network->ssid_len),
5452 print_mac(mac, network->bssid)); 5444 network->bssid);
5453 return 0; 5445 return 0;
5454 } 5446 }
5455 5447
@@ -5459,11 +5451,11 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5459 if ((network->ssid_len != match->network->ssid_len) || 5451 if ((network->ssid_len != match->network->ssid_len) ||
5460 memcmp(network->ssid, match->network->ssid, 5452 memcmp(network->ssid, match->network->ssid,
5461 network->ssid_len)) { 5453 network->ssid_len)) {
5462 IPW_DEBUG_MERGE("Network '%s (%s)' excluded " 5454 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5463 "because of non-network ESSID.\n", 5455 "because of non-network ESSID.\n",
5464 escape_essid(network->ssid, 5456 escape_essid(network->ssid,
5465 network->ssid_len), 5457 network->ssid_len),
5466 print_mac(mac, network->bssid)); 5458 network->bssid);
5467 return 0; 5459 return 0;
5468 } 5460 }
5469 } else { 5461 } else {
@@ -5478,9 +5470,9 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5478 strncpy(escaped, 5470 strncpy(escaped,
5479 escape_essid(network->ssid, network->ssid_len), 5471 escape_essid(network->ssid, network->ssid_len),
5480 sizeof(escaped)); 5472 sizeof(escaped));
5481 IPW_DEBUG_MERGE("Network '%s (%s)' excluded " 5473 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5482 "because of ESSID mismatch: '%s'.\n", 5474 "because of ESSID mismatch: '%s'.\n",
5483 escaped, print_mac(mac, network->bssid), 5475 escaped, network->bssid,
5484 escape_essid(priv->essid, 5476 escape_essid(priv->essid,
5485 priv->essid_len)); 5477 priv->essid_len));
5486 return 0; 5478 return 0;
@@ -5507,10 +5499,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5507 /* Now go through and see if the requested network is valid... */ 5499 /* Now go through and see if the requested network is valid... */
5508 if (priv->ieee->scan_age != 0 && 5500 if (priv->ieee->scan_age != 0 &&
5509 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5501 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5510 IPW_DEBUG_MERGE("Network '%s (%s)' excluded " 5502 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5511 "because of age: %ums.\n", 5503 "because of age: %ums.\n",
5512 escape_essid(network->ssid, network->ssid_len), 5504 escape_essid(network->ssid, network->ssid_len),
5513 print_mac(mac, network->bssid), 5505 network->bssid,
5514 jiffies_to_msecs(jiffies - 5506 jiffies_to_msecs(jiffies -
5515 network->last_scanned)); 5507 network->last_scanned));
5516 return 0; 5508 return 0;
@@ -5518,10 +5510,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5518 5510
5519 if ((priv->config & CFG_STATIC_CHANNEL) && 5511 if ((priv->config & CFG_STATIC_CHANNEL) &&
5520 (network->channel != priv->channel)) { 5512 (network->channel != priv->channel)) {
5521 IPW_DEBUG_MERGE("Network '%s (%s)' excluded " 5513 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5522 "because of channel mismatch: %d != %d.\n", 5514 "because of channel mismatch: %d != %d.\n",
5523 escape_essid(network->ssid, network->ssid_len), 5515 escape_essid(network->ssid, network->ssid_len),
5524 print_mac(mac, network->bssid), 5516 network->bssid,
5525 network->channel, priv->channel); 5517 network->channel, priv->channel);
5526 return 0; 5518 return 0;
5527 } 5519 }
@@ -5529,10 +5521,10 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5529 /* Verify privacy compatability */ 5521 /* Verify privacy compatability */
5530 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != 5522 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) !=
5531 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5523 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5532 IPW_DEBUG_MERGE("Network '%s (%s)' excluded " 5524 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5533 "because of privacy mismatch: %s != %s.\n", 5525 "because of privacy mismatch: %s != %s.\n",
5534 escape_essid(network->ssid, network->ssid_len), 5526 escape_essid(network->ssid, network->ssid_len),
5535 print_mac(mac, network->bssid), 5527 network->bssid,
5536 priv-> 5528 priv->
5537 capability & CAP_PRIVACY_ON ? "on" : "off", 5529 capability & CAP_PRIVACY_ON ? "on" : "off",
5538 network-> 5530 network->
@@ -5542,41 +5534,41 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5542 } 5534 }
5543 5535
5544 if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) { 5536 if (!memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
5545 IPW_DEBUG_MERGE("Network '%s (%s)' excluded " 5537 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5546 "because of the same BSSID match: %s" 5538 "because of the same BSSID match: %pM"
5547 ".\n", escape_essid(network->ssid, 5539 ".\n", escape_essid(network->ssid,
5548 network->ssid_len), 5540 network->ssid_len),
5549 print_mac(mac, network->bssid), 5541 network->bssid,
5550 print_mac(mac2, priv->bssid)); 5542 priv->bssid);
5551 return 0; 5543 return 0;
5552 } 5544 }
5553 5545
5554 /* Filter out any incompatible freq / mode combinations */ 5546 /* Filter out any incompatible freq / mode combinations */
5555 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) { 5547 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) {
5556 IPW_DEBUG_MERGE("Network '%s (%s)' excluded " 5548 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5557 "because of invalid frequency/mode " 5549 "because of invalid frequency/mode "
5558 "combination.\n", 5550 "combination.\n",
5559 escape_essid(network->ssid, network->ssid_len), 5551 escape_essid(network->ssid, network->ssid_len),
5560 print_mac(mac, network->bssid)); 5552 network->bssid);
5561 return 0; 5553 return 0;
5562 } 5554 }
5563 5555
5564 /* Ensure that the rates supported by the driver are compatible with 5556 /* Ensure that the rates supported by the driver are compatible with
5565 * this AP, including verification of basic rates (mandatory) */ 5557 * this AP, including verification of basic rates (mandatory) */
5566 if (!ipw_compatible_rates(priv, network, &rates)) { 5558 if (!ipw_compatible_rates(priv, network, &rates)) {
5567 IPW_DEBUG_MERGE("Network '%s (%s)' excluded " 5559 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5568 "because configured rate mask excludes " 5560 "because configured rate mask excludes "
5569 "AP mandatory rate.\n", 5561 "AP mandatory rate.\n",
5570 escape_essid(network->ssid, network->ssid_len), 5562 escape_essid(network->ssid, network->ssid_len),
5571 print_mac(mac, network->bssid)); 5563 network->bssid);
5572 return 0; 5564 return 0;
5573 } 5565 }
5574 5566
5575 if (rates.num_rates == 0) { 5567 if (rates.num_rates == 0) {
5576 IPW_DEBUG_MERGE("Network '%s (%s)' excluded " 5568 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
5577 "because of no compatible rates.\n", 5569 "because of no compatible rates.\n",
5578 escape_essid(network->ssid, network->ssid_len), 5570 escape_essid(network->ssid, network->ssid_len),
5579 print_mac(mac, network->bssid)); 5571 network->bssid);
5580 return 0; 5572 return 0;
5581 } 5573 }
5582 5574
@@ -5587,9 +5579,9 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5587 /* Set up 'new' AP to this network */ 5579 /* Set up 'new' AP to this network */
5588 ipw_copy_rates(&match->rates, &rates); 5580 ipw_copy_rates(&match->rates, &rates);
5589 match->network = network; 5581 match->network = network;
5590 IPW_DEBUG_MERGE("Network '%s (%s)' is a viable match.\n", 5582 IPW_DEBUG_MERGE("Network '%s (%pM)' is a viable match.\n",
5591 escape_essid(network->ssid, network->ssid_len), 5583 escape_essid(network->ssid, network->ssid_len),
5592 print_mac(mac, network->bssid)); 5584 network->bssid);
5593 5585
5594 return 1; 5586 return 1;
5595} 5587}
@@ -5643,7 +5635,6 @@ static int ipw_best_network(struct ipw_priv *priv,
5643 struct ieee80211_network *network, int roaming) 5635 struct ieee80211_network *network, int roaming)
5644{ 5636{
5645 struct ipw_supported_rates rates; 5637 struct ipw_supported_rates rates;
5646 DECLARE_MAC_BUF(mac);
5647 5638
5648 /* Verify that this network's capability is compatible with the 5639 /* Verify that this network's capability is compatible with the
5649 * current mode (AdHoc or Infrastructure) */ 5640 * current mode (AdHoc or Infrastructure) */
@@ -5651,20 +5642,20 @@ static int ipw_best_network(struct ipw_priv *priv,
5651 !(network->capability & WLAN_CAPABILITY_ESS)) || 5642 !(network->capability & WLAN_CAPABILITY_ESS)) ||
5652 (priv->ieee->iw_mode == IW_MODE_ADHOC && 5643 (priv->ieee->iw_mode == IW_MODE_ADHOC &&
5653 !(network->capability & WLAN_CAPABILITY_IBSS))) { 5644 !(network->capability & WLAN_CAPABILITY_IBSS))) {
5654 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded due to " 5645 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded due to "
5655 "capability mismatch.\n", 5646 "capability mismatch.\n",
5656 escape_essid(network->ssid, network->ssid_len), 5647 escape_essid(network->ssid, network->ssid_len),
5657 print_mac(mac, network->bssid)); 5648 network->bssid);
5658 return 0; 5649 return 0;
5659 } 5650 }
5660 5651
5661 /* If we do not have an ESSID for this AP, we can not associate with 5652 /* If we do not have an ESSID for this AP, we can not associate with
5662 * it */ 5653 * it */
5663 if (network->flags & NETWORK_EMPTY_ESSID) { 5654 if (network->flags & NETWORK_EMPTY_ESSID) {
5664 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5655 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5665 "because of hidden ESSID.\n", 5656 "because of hidden ESSID.\n",
5666 escape_essid(network->ssid, network->ssid_len), 5657 escape_essid(network->ssid, network->ssid_len),
5667 print_mac(mac, network->bssid)); 5658 network->bssid);
5668 return 0; 5659 return 0;
5669 } 5660 }
5670 5661
@@ -5674,11 +5665,11 @@ static int ipw_best_network(struct ipw_priv *priv,
5674 if ((network->ssid_len != match->network->ssid_len) || 5665 if ((network->ssid_len != match->network->ssid_len) ||
5675 memcmp(network->ssid, match->network->ssid, 5666 memcmp(network->ssid, match->network->ssid,
5676 network->ssid_len)) { 5667 network->ssid_len)) {
5677 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5668 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5678 "because of non-network ESSID.\n", 5669 "because of non-network ESSID.\n",
5679 escape_essid(network->ssid, 5670 escape_essid(network->ssid,
5680 network->ssid_len), 5671 network->ssid_len),
5681 print_mac(mac, network->bssid)); 5672 network->bssid);
5682 return 0; 5673 return 0;
5683 } 5674 }
5684 } else { 5675 } else {
@@ -5692,9 +5683,9 @@ static int ipw_best_network(struct ipw_priv *priv,
5692 strncpy(escaped, 5683 strncpy(escaped,
5693 escape_essid(network->ssid, network->ssid_len), 5684 escape_essid(network->ssid, network->ssid_len),
5694 sizeof(escaped)); 5685 sizeof(escaped));
5695 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5686 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5696 "because of ESSID mismatch: '%s'.\n", 5687 "because of ESSID mismatch: '%s'.\n",
5697 escaped, print_mac(mac, network->bssid), 5688 escaped, network->bssid,
5698 escape_essid(priv->essid, 5689 escape_essid(priv->essid,
5699 priv->essid_len)); 5690 priv->essid_len));
5700 return 0; 5691 return 0;
@@ -5708,12 +5699,12 @@ static int ipw_best_network(struct ipw_priv *priv,
5708 strncpy(escaped, 5699 strncpy(escaped,
5709 escape_essid(network->ssid, network->ssid_len), 5700 escape_essid(network->ssid, network->ssid_len),
5710 sizeof(escaped)); 5701 sizeof(escaped));
5711 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded because " 5702 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded because "
5712 "'%s (%s)' has a stronger signal.\n", 5703 "'%s (%pM)' has a stronger signal.\n",
5713 escaped, print_mac(mac, network->bssid), 5704 escaped, network->bssid,
5714 escape_essid(match->network->ssid, 5705 escape_essid(match->network->ssid,
5715 match->network->ssid_len), 5706 match->network->ssid_len),
5716 print_mac(mac, match->network->bssid)); 5707 match->network->bssid);
5717 return 0; 5708 return 0;
5718 } 5709 }
5719 5710
@@ -5721,11 +5712,11 @@ static int ipw_best_network(struct ipw_priv *priv,
5721 * last 3 seconds, do not try and associate again... */ 5712 * last 3 seconds, do not try and associate again... */
5722 if (network->last_associate && 5713 if (network->last_associate &&
5723 time_after(network->last_associate + (HZ * 3UL), jiffies)) { 5714 time_after(network->last_associate + (HZ * 3UL), jiffies)) {
5724 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5715 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5725 "because of storming (%ums since last " 5716 "because of storming (%ums since last "
5726 "assoc attempt).\n", 5717 "assoc attempt).\n",
5727 escape_essid(network->ssid, network->ssid_len), 5718 escape_essid(network->ssid, network->ssid_len),
5728 print_mac(mac, network->bssid), 5719 network->bssid,
5729 jiffies_to_msecs(jiffies - 5720 jiffies_to_msecs(jiffies -
5730 network->last_associate)); 5721 network->last_associate));
5731 return 0; 5722 return 0;
@@ -5734,10 +5725,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5734 /* Now go through and see if the requested network is valid... */ 5725 /* Now go through and see if the requested network is valid... */
5735 if (priv->ieee->scan_age != 0 && 5726 if (priv->ieee->scan_age != 0 &&
5736 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) { 5727 time_after(jiffies, network->last_scanned + priv->ieee->scan_age)) {
5737 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5728 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5738 "because of age: %ums.\n", 5729 "because of age: %ums.\n",
5739 escape_essid(network->ssid, network->ssid_len), 5730 escape_essid(network->ssid, network->ssid_len),
5740 print_mac(mac, network->bssid), 5731 network->bssid,
5741 jiffies_to_msecs(jiffies - 5732 jiffies_to_msecs(jiffies -
5742 network->last_scanned)); 5733 network->last_scanned));
5743 return 0; 5734 return 0;
@@ -5745,10 +5736,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5745 5736
5746 if ((priv->config & CFG_STATIC_CHANNEL) && 5737 if ((priv->config & CFG_STATIC_CHANNEL) &&
5747 (network->channel != priv->channel)) { 5738 (network->channel != priv->channel)) {
5748 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5739 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5749 "because of channel mismatch: %d != %d.\n", 5740 "because of channel mismatch: %d != %d.\n",
5750 escape_essid(network->ssid, network->ssid_len), 5741 escape_essid(network->ssid, network->ssid_len),
5751 print_mac(mac, network->bssid), 5742 network->bssid,
5752 network->channel, priv->channel); 5743 network->channel, priv->channel);
5753 return 0; 5744 return 0;
5754 } 5745 }
@@ -5756,10 +5747,10 @@ static int ipw_best_network(struct ipw_priv *priv,
5756 /* Verify privacy compatability */ 5747 /* Verify privacy compatability */
5757 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != 5748 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) !=
5758 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5749 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5759 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5750 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5760 "because of privacy mismatch: %s != %s.\n", 5751 "because of privacy mismatch: %s != %s.\n",
5761 escape_essid(network->ssid, network->ssid_len), 5752 escape_essid(network->ssid, network->ssid_len),
5762 print_mac(mac, network->bssid), 5753 network->bssid,
5763 priv->capability & CAP_PRIVACY_ON ? "on" : 5754 priv->capability & CAP_PRIVACY_ON ? "on" :
5764 "off", 5755 "off",
5765 network->capability & 5756 network->capability &
@@ -5769,48 +5760,48 @@ static int ipw_best_network(struct ipw_priv *priv,
5769 5760
5770 if ((priv->config & CFG_STATIC_BSSID) && 5761 if ((priv->config & CFG_STATIC_BSSID) &&
5771 memcmp(network->bssid, priv->bssid, ETH_ALEN)) { 5762 memcmp(network->bssid, priv->bssid, ETH_ALEN)) {
5772 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5763 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5773 "because of BSSID mismatch: %s.\n", 5764 "because of BSSID mismatch: %pM.\n",
5774 escape_essid(network->ssid, network->ssid_len), 5765 escape_essid(network->ssid, network->ssid_len),
5775 print_mac(mac, network->bssid), print_mac(mac, priv->bssid)); 5766 network->bssid, priv->bssid);
5776 return 0; 5767 return 0;
5777 } 5768 }
5778 5769
5779 /* Filter out any incompatible freq / mode combinations */ 5770 /* Filter out any incompatible freq / mode combinations */
5780 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) { 5771 if (!ieee80211_is_valid_mode(priv->ieee, network->mode)) {
5781 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5772 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5782 "because of invalid frequency/mode " 5773 "because of invalid frequency/mode "
5783 "combination.\n", 5774 "combination.\n",
5784 escape_essid(network->ssid, network->ssid_len), 5775 escape_essid(network->ssid, network->ssid_len),
5785 print_mac(mac, network->bssid)); 5776 network->bssid);
5786 return 0; 5777 return 0;
5787 } 5778 }
5788 5779
5789 /* Filter out invalid channel in current GEO */ 5780 /* Filter out invalid channel in current GEO */
5790 if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) { 5781 if (!ieee80211_is_valid_channel(priv->ieee, network->channel)) {
5791 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5782 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5792 "because of invalid channel in current GEO\n", 5783 "because of invalid channel in current GEO\n",
5793 escape_essid(network->ssid, network->ssid_len), 5784 escape_essid(network->ssid, network->ssid_len),
5794 print_mac(mac, network->bssid)); 5785 network->bssid);
5795 return 0; 5786 return 0;
5796 } 5787 }
5797 5788
5798 /* Ensure that the rates supported by the driver are compatible with 5789 /* Ensure that the rates supported by the driver are compatible with
5799 * this AP, including verification of basic rates (mandatory) */ 5790 * this AP, including verification of basic rates (mandatory) */
5800 if (!ipw_compatible_rates(priv, network, &rates)) { 5791 if (!ipw_compatible_rates(priv, network, &rates)) {
5801 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5792 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5802 "because configured rate mask excludes " 5793 "because configured rate mask excludes "
5803 "AP mandatory rate.\n", 5794 "AP mandatory rate.\n",
5804 escape_essid(network->ssid, network->ssid_len), 5795 escape_essid(network->ssid, network->ssid_len),
5805 print_mac(mac, network->bssid)); 5796 network->bssid);
5806 return 0; 5797 return 0;
5807 } 5798 }
5808 5799
5809 if (rates.num_rates == 0) { 5800 if (rates.num_rates == 0) {
5810 IPW_DEBUG_ASSOC("Network '%s (%s)' excluded " 5801 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
5811 "because of no compatible rates.\n", 5802 "because of no compatible rates.\n",
5812 escape_essid(network->ssid, network->ssid_len), 5803 escape_essid(network->ssid, network->ssid_len),
5813 print_mac(mac, network->bssid)); 5804 network->bssid);
5814 return 0; 5805 return 0;
5815 } 5806 }
5816 5807
@@ -5822,9 +5813,9 @@ static int ipw_best_network(struct ipw_priv *priv,
5822 ipw_copy_rates(&match->rates, &rates); 5813 ipw_copy_rates(&match->rates, &rates);
5823 match->network = network; 5814 match->network = network;
5824 5815
5825 IPW_DEBUG_ASSOC("Network '%s (%s)' is a viable match.\n", 5816 IPW_DEBUG_ASSOC("Network '%s (%pM)' is a viable match.\n",
5826 escape_essid(network->ssid, network->ssid_len), 5817 escape_essid(network->ssid, network->ssid_len),
5827 print_mac(mac, network->bssid)); 5818 network->bssid);
5828 5819
5829 return 1; 5820 return 1;
5830} 5821}
@@ -6066,7 +6057,6 @@ static void ipw_bg_adhoc_check(struct work_struct *work)
6066 6057
6067static void ipw_debug_config(struct ipw_priv *priv) 6058static void ipw_debug_config(struct ipw_priv *priv)
6068{ 6059{
6069 DECLARE_MAC_BUF(mac);
6070 IPW_DEBUG_INFO("Scan completed, no valid APs matched " 6060 IPW_DEBUG_INFO("Scan completed, no valid APs matched "
6071 "[CFG 0x%08X]\n", priv->config); 6061 "[CFG 0x%08X]\n", priv->config);
6072 if (priv->config & CFG_STATIC_CHANNEL) 6062 if (priv->config & CFG_STATIC_CHANNEL)
@@ -6079,8 +6069,7 @@ static void ipw_debug_config(struct ipw_priv *priv)
6079 else 6069 else
6080 IPW_DEBUG_INFO("ESSID unlocked.\n"); 6070 IPW_DEBUG_INFO("ESSID unlocked.\n");
6081 if (priv->config & CFG_STATIC_BSSID) 6071 if (priv->config & CFG_STATIC_BSSID)
6082 IPW_DEBUG_INFO("BSSID locked to %s\n", 6072 IPW_DEBUG_INFO("BSSID locked to %pM\n", priv->bssid);
6083 print_mac(mac, priv->bssid));
6084 else 6073 else
6085 IPW_DEBUG_INFO("BSSID unlocked.\n"); 6074 IPW_DEBUG_INFO("BSSID unlocked.\n");
6086 if (priv->capability & CAP_PRIVACY_ON) 6075 if (priv->capability & CAP_PRIVACY_ON)
@@ -7295,7 +7284,6 @@ static int ipw_associate_network(struct ipw_priv *priv,
7295 struct ipw_supported_rates *rates, int roaming) 7284 struct ipw_supported_rates *rates, int roaming)
7296{ 7285{
7297 int err; 7286 int err;
7298 DECLARE_MAC_BUF(mac);
7299 7287
7300 if (priv->config & CFG_FIXED_RATE) 7288 if (priv->config & CFG_FIXED_RATE)
7301 ipw_set_fixed_rate(priv, network->mode); 7289 ipw_set_fixed_rate(priv, network->mode);
@@ -7463,9 +7451,9 @@ static int ipw_associate_network(struct ipw_priv *priv,
7463 return err; 7451 return err;
7464 } 7452 }
7465 7453
7466 IPW_DEBUG(IPW_DL_STATE, "associating: '%s' %s \n", 7454 IPW_DEBUG(IPW_DL_STATE, "associating: '%s' %pM \n",
7467 escape_essid(priv->essid, priv->essid_len), 7455 escape_essid(priv->essid, priv->essid_len),
7468 print_mac(mac, priv->bssid)); 7456 priv->bssid);
7469 7457
7470 return 0; 7458 return 0;
7471} 7459}
@@ -7604,7 +7592,6 @@ static int ipw_associate(void *data)
7604 if (list_empty(&priv->ieee->network_free_list)) { 7592 if (list_empty(&priv->ieee->network_free_list)) {
7605 struct ieee80211_network *oldest = NULL; 7593 struct ieee80211_network *oldest = NULL;
7606 struct ieee80211_network *target; 7594 struct ieee80211_network *target;
7607 DECLARE_MAC_BUF(mac);
7608 7595
7609 list_for_each_entry(target, &priv->ieee->network_list, list) { 7596 list_for_each_entry(target, &priv->ieee->network_list, list) {
7610 if ((oldest == NULL) || 7597 if ((oldest == NULL) ||
@@ -7615,11 +7602,11 @@ static int ipw_associate(void *data)
7615 /* If there are no more slots, expire the oldest */ 7602 /* If there are no more slots, expire the oldest */
7616 list_del(&oldest->list); 7603 list_del(&oldest->list);
7617 target = oldest; 7604 target = oldest;
7618 IPW_DEBUG_ASSOC("Expired '%s' (%s) from " 7605 IPW_DEBUG_ASSOC("Expired '%s' (%pM) from "
7619 "network list.\n", 7606 "network list.\n",
7620 escape_essid(target->ssid, 7607 escape_essid(target->ssid,
7621 target->ssid_len), 7608 target->ssid_len),
7622 print_mac(mac, target->bssid)); 7609 target->bssid);
7623 list_add_tail(&target->list, 7610 list_add_tail(&target->list,
7624 &priv->ieee->network_free_list); 7611 &priv->ieee->network_free_list);
7625 } 7612 }
@@ -8301,9 +8288,6 @@ static void ipw_rx(struct ipw_priv *priv)
8301 u32 r, w, i; 8288 u32 r, w, i;
8302 u8 network_packet; 8289 u8 network_packet;
8303 u8 fill_rx = 0; 8290 u8 fill_rx = 0;
8304 DECLARE_MAC_BUF(mac);
8305 DECLARE_MAC_BUF(mac2);
8306 DECLARE_MAC_BUF(mac3);
8307 8291
8308 r = ipw_read32(priv, IPW_RX_READ_INDEX); 8292 r = ipw_read32(priv, IPW_RX_READ_INDEX);
8309 w = ipw_read32(priv, IPW_RX_WRITE_INDEX); 8293 w = ipw_read32(priv, IPW_RX_WRITE_INDEX);
@@ -8433,18 +8417,12 @@ static void ipw_rx(struct ipw_priv *priv)
8433 header))) 8417 header)))
8434 { 8418 {
8435 IPW_DEBUG_DROP("Dropping: " 8419 IPW_DEBUG_DROP("Dropping: "
8436 "%s, " 8420 "%pM, "
8437 "%s, " 8421 "%pM, "
8438 "%s\n", 8422 "%pM\n",
8439 print_mac(mac, 8423 header->addr1,
8440 header-> 8424 header->addr2,
8441 addr1), 8425 header->addr3);
8442 print_mac(mac2,
8443 header->
8444 addr2),
8445 print_mac(mac3,
8446 header->
8447 addr3));
8448 break; 8426 break;
8449 } 8427 }
8450 8428
@@ -8983,7 +8961,6 @@ static int ipw_wx_set_wap(struct net_device *dev,
8983 union iwreq_data *wrqu, char *extra) 8961 union iwreq_data *wrqu, char *extra)
8984{ 8962{
8985 struct ipw_priv *priv = ieee80211_priv(dev); 8963 struct ipw_priv *priv = ieee80211_priv(dev);
8986 DECLARE_MAC_BUF(mac);
8987 8964
8988 static const unsigned char any[] = { 8965 static const unsigned char any[] = {
8989 0xff, 0xff, 0xff, 0xff, 0xff, 0xff 8966 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
@@ -9014,8 +8991,8 @@ static int ipw_wx_set_wap(struct net_device *dev,
9014 return 0; 8991 return 0;
9015 } 8992 }
9016 8993
9017 IPW_DEBUG_WX("Setting mandatory BSSID to %s\n", 8994 IPW_DEBUG_WX("Setting mandatory BSSID to %pM\n",
9018 print_mac(mac, wrqu->ap_addr.sa_data)); 8995 wrqu->ap_addr.sa_data);
9019 8996
9020 memcpy(priv->bssid, wrqu->ap_addr.sa_data, ETH_ALEN); 8997 memcpy(priv->bssid, wrqu->ap_addr.sa_data, ETH_ALEN);
9021 8998
@@ -9033,7 +9010,6 @@ static int ipw_wx_get_wap(struct net_device *dev,
9033 union iwreq_data *wrqu, char *extra) 9010 union iwreq_data *wrqu, char *extra)
9034{ 9011{
9035 struct ipw_priv *priv = ieee80211_priv(dev); 9012 struct ipw_priv *priv = ieee80211_priv(dev);
9036 DECLARE_MAC_BUF(mac);
9037 9013
9038 /* If we are associated, trying to associate, or have a statically 9014 /* If we are associated, trying to associate, or have a statically
9039 * configured BSSID then return that; otherwise return ANY */ 9015 * configured BSSID then return that; otherwise return ANY */
@@ -9045,8 +9021,8 @@ static int ipw_wx_get_wap(struct net_device *dev,
9045 } else 9021 } else
9046 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); 9022 memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN);
9047 9023
9048 IPW_DEBUG_WX("Getting WAP BSSID: %s\n", 9024 IPW_DEBUG_WX("Getting WAP BSSID: %pM\n",
9049 print_mac(mac, wrqu->ap_addr.sa_data)); 9025 wrqu->ap_addr.sa_data);
9050 mutex_unlock(&priv->mutex); 9026 mutex_unlock(&priv->mutex);
9051 return 0; 9027 return 0;
9052} 9028}
@@ -10199,10 +10175,8 @@ static int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
10199 id = ipw_add_station(priv, hdr->addr1); 10175 id = ipw_add_station(priv, hdr->addr1);
10200 if (id == IPW_INVALID_STATION) { 10176 if (id == IPW_INVALID_STATION) {
10201 IPW_WARNING("Attempt to send data to " 10177 IPW_WARNING("Attempt to send data to "
10202 "invalid cell: " MAC_FMT "\n", 10178 "invalid cell: %pM\n",
10203 hdr->addr1[0], hdr->addr1[1], 10179 hdr->addr1);
10204 hdr->addr1[2], hdr->addr1[3],
10205 hdr->addr1[4], hdr->addr1[5]);
10206 goto drop; 10180 goto drop;
10207 } 10181 }
10208 } 10182 }
@@ -10505,15 +10479,14 @@ static int ipw_net_set_mac_address(struct net_device *dev, void *p)
10505{ 10479{
10506 struct ipw_priv *priv = ieee80211_priv(dev); 10480 struct ipw_priv *priv = ieee80211_priv(dev);
10507 struct sockaddr *addr = p; 10481 struct sockaddr *addr = p;
10508 DECLARE_MAC_BUF(mac);
10509 10482
10510 if (!is_valid_ether_addr(addr->sa_data)) 10483 if (!is_valid_ether_addr(addr->sa_data))
10511 return -EADDRNOTAVAIL; 10484 return -EADDRNOTAVAIL;
10512 mutex_lock(&priv->mutex); 10485 mutex_lock(&priv->mutex);
10513 priv->config |= CFG_CUSTOM_MAC; 10486 priv->config |= CFG_CUSTOM_MAC;
10514 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN); 10487 memcpy(priv->mac_addr, addr->sa_data, ETH_ALEN);
10515 printk(KERN_INFO "%s: Setting MAC to %s\n", 10488 printk(KERN_INFO "%s: Setting MAC to %pM\n",
10516 priv->net_dev->name, print_mac(mac, priv->mac_addr)); 10489 priv->net_dev->name, priv->mac_addr);
10517 queue_work(priv->workqueue, &priv->adapter_restart); 10490 queue_work(priv->workqueue, &priv->adapter_restart);
10518 mutex_unlock(&priv->mutex); 10491 mutex_unlock(&priv->mutex);
10519 return 0; 10492 return 0;
@@ -11648,7 +11621,7 @@ static int __devinit ipw_pci_probe(struct pci_dev *pdev,
11648 length = pci_resource_len(pdev, 0); 11621 length = pci_resource_len(pdev, 0);
11649 priv->hw_len = length; 11622 priv->hw_len = length;
11650 11623
11651 base = ioremap_nocache(pci_resource_start(pdev, 0), length); 11624 base = pci_ioremap_bar(pdev, 0);
11652 if (!base) { 11625 if (!base) {
11653 err = -ENODEV; 11626 err = -ENODEV;
11654 goto out_pci_release_regions; 11627 goto out_pci_release_regions;
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
index 6fc5e7361f26..bb91353c443e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945-rs.c
@@ -649,7 +649,6 @@ static void rs_get_rate(void *priv_r, struct ieee80211_supported_band *sband,
649 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 649 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
650 u16 fc, rate_mask; 650 u16 fc, rate_mask;
651 struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r; 651 struct iwl3945_priv *priv = (struct iwl3945_priv *)priv_r;
652 DECLARE_MAC_BUF(mac);
653 652
654 IWL_DEBUG_RATE("enter\n"); 653 IWL_DEBUG_RATE("enter\n");
655 654
@@ -675,8 +674,8 @@ static void rs_get_rate(void *priv_r, struct ieee80211_supported_band *sband,
675 u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1); 674 u8 sta_id = iwl3945_hw_find_station(priv, hdr->addr1);
676 675
677 if (sta_id == IWL_INVALID_STATION) { 676 if (sta_id == IWL_INVALID_STATION) {
678 IWL_DEBUG_RATE("LQ: ADD station %s\n", 677 IWL_DEBUG_RATE("LQ: ADD station %pm\n",
679 print_mac(mac, hdr->addr1)); 678 hdr->addr1);
680 sta_id = iwl3945_add_station(priv, 679 sta_id = iwl3945_add_station(priv,
681 hdr->addr1, 0, CMD_ASYNC); 680 hdr->addr1, 0, CMD_ASYNC);
682 } 681 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index 7ca5627cc078..8a00245be51e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -759,7 +759,6 @@ u8 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *addr)
759 int i; 759 int i;
760 int ret = IWL_INVALID_STATION; 760 int ret = IWL_INVALID_STATION;
761 unsigned long flags; 761 unsigned long flags;
762 DECLARE_MAC_BUF(mac);
763 762
764 spin_lock_irqsave(&priv->sta_lock, flags); 763 spin_lock_irqsave(&priv->sta_lock, flags);
765 for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++) 764 for (i = IWL_STA_ID; i < priv->hw_setting.max_stations; i++)
@@ -770,8 +769,8 @@ u8 iwl3945_hw_find_station(struct iwl3945_priv *priv, const u8 *addr)
770 goto out; 769 goto out;
771 } 770 }
772 771
773 IWL_DEBUG_INFO("can not find STA %s (total %d)\n", 772 IWL_DEBUG_INFO("can not find STA %pM (total %d)\n",
774 print_mac(mac, addr), priv->num_stations); 773 addr, priv->num_stations);
775 out: 774 out:
776 spin_unlock_irqrestore(&priv->sta_lock, flags); 775 spin_unlock_irqrestore(&priv->sta_lock, flags);
777 return ret; 776 return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
index e2a58e477036..b497d40dc396 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
@@ -357,11 +357,9 @@ static void rs_tl_turn_on_agg_for_tid(struct iwl_priv *priv,
357 struct iwl_lq_sta *lq_data, u8 tid, 357 struct iwl_lq_sta *lq_data, u8 tid,
358 struct ieee80211_sta *sta) 358 struct ieee80211_sta *sta)
359{ 359{
360 DECLARE_MAC_BUF(mac);
361
362 if (rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) { 360 if (rs_tl_get_load(lq_data, tid) > IWL_AGG_LOAD_THRESHOLD) {
363 IWL_DEBUG_HT("Starting Tx agg: STA: %s tid: %d\n", 361 IWL_DEBUG_HT("Starting Tx agg: STA: %pM tid: %d\n",
364 print_mac(mac, sta->addr), tid); 362 sta->addr, tid);
365 ieee80211_start_tx_ba_session(priv->hw, sta->addr, tid); 363 ieee80211_start_tx_ba_session(priv->hw, sta->addr, tid);
366 } 364 }
367} 365}
@@ -2132,11 +2130,10 @@ static void rs_get_rate(void *priv_r, struct ieee80211_supported_band *sband,
2132 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) && 2130 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) &&
2133 !lq_sta->ibss_sta_added) { 2131 !lq_sta->ibss_sta_added) {
2134 u8 sta_id = iwl_find_station(priv, hdr->addr1); 2132 u8 sta_id = iwl_find_station(priv, hdr->addr1);
2135 DECLARE_MAC_BUF(mac);
2136 2133
2137 if (sta_id == IWL_INVALID_STATION) { 2134 if (sta_id == IWL_INVALID_STATION) {
2138 IWL_DEBUG_RATE("LQ: ADD station %s\n", 2135 IWL_DEBUG_RATE("LQ: ADD station %pM\n",
2139 print_mac(mac, hdr->addr1)); 2136 hdr->addr1);
2140 sta_id = iwl_add_station_flags(priv, hdr->addr1, 2137 sta_id = iwl_add_station_flags(priv, hdr->addr1,
2141 0, CMD_ASYNC, NULL); 2138 0, CMD_ASYNC, NULL);
2142 } 2139 }
@@ -2205,15 +2202,12 @@ static void rs_rate_init(void *priv_r, struct ieee80211_supported_band *sband,
2205 lq_sta->ibss_sta_added = 0; 2202 lq_sta->ibss_sta_added = 0;
2206 if (priv->iw_mode == NL80211_IFTYPE_AP) { 2203 if (priv->iw_mode == NL80211_IFTYPE_AP) {
2207 u8 sta_id = iwl_find_station(priv, sta->addr); 2204 u8 sta_id = iwl_find_station(priv, sta->addr);
2208 DECLARE_MAC_BUF(mac);
2209 2205
2210 /* for IBSS the call are from tasklet */ 2206 /* for IBSS the call are from tasklet */
2211 IWL_DEBUG_RATE("LQ: ADD station %s\n", 2207 IWL_DEBUG_RATE("LQ: ADD station %pM\n", sta->addr);
2212 print_mac(mac, sta->addr));
2213 2208
2214 if (sta_id == IWL_INVALID_STATION) { 2209 if (sta_id == IWL_INVALID_STATION) {
2215 IWL_DEBUG_RATE("LQ: ADD station %s\n", 2210 IWL_DEBUG_RATE("LQ: ADD station %pM\n", sta->addr);
2216 print_mac(mac, sta->addr));
2217 sta_id = iwl_add_station_flags(priv, sta->addr, 2211 sta_id = iwl_add_station_flags(priv, sta->addr,
2218 0, CMD_ASYNC, NULL); 2212 0, CMD_ASYNC, NULL);
2219 } 2213 }
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 321dbc8c034a..fe9307424a91 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -239,7 +239,6 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
239{ 239{
240 /* cast away the const for active_rxon in this function */ 240 /* cast away the const for active_rxon in this function */
241 struct iwl_rxon_cmd *active_rxon = (void *)&priv->active_rxon; 241 struct iwl_rxon_cmd *active_rxon = (void *)&priv->active_rxon;
242 DECLARE_MAC_BUF(mac);
243 int ret; 242 int ret;
244 bool new_assoc = 243 bool new_assoc =
245 !!(priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK); 244 !!(priv->staging_rxon.filter_flags & RXON_FILTER_ASSOC_MSK);
@@ -300,10 +299,10 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
300 IWL_DEBUG_INFO("Sending RXON\n" 299 IWL_DEBUG_INFO("Sending RXON\n"
301 "* with%s RXON_FILTER_ASSOC_MSK\n" 300 "* with%s RXON_FILTER_ASSOC_MSK\n"
302 "* channel = %d\n" 301 "* channel = %d\n"
303 "* bssid = %s\n", 302 "* bssid = %pM\n",
304 (new_assoc ? "" : "out"), 303 (new_assoc ? "" : "out"),
305 le16_to_cpu(priv->staging_rxon.channel), 304 le16_to_cpu(priv->staging_rxon.channel),
306 print_mac(mac, priv->staging_rxon.bssid_addr)); 305 priv->staging_rxon.bssid_addr);
307 306
308 iwl4965_set_rxon_hwcrypto(priv, !priv->hw_params.sw_crypto); 307 iwl4965_set_rxon_hwcrypto(priv, !priv->hw_params.sw_crypto);
309 308
@@ -1464,7 +1463,6 @@ void iwl_rx_handle(struct iwl_priv *priv)
1464static void iwl4965_print_rx_config_cmd(struct iwl_priv *priv) 1463static void iwl4965_print_rx_config_cmd(struct iwl_priv *priv)
1465{ 1464{
1466 struct iwl_rxon_cmd *rxon = &priv->staging_rxon; 1465 struct iwl_rxon_cmd *rxon = &priv->staging_rxon;
1467 DECLARE_MAC_BUF(mac);
1468 1466
1469 IWL_DEBUG_RADIO("RX CONFIG:\n"); 1467 IWL_DEBUG_RADIO("RX CONFIG:\n");
1470 iwl_print_hex_dump(priv, IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon)); 1468 iwl_print_hex_dump(priv, IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon));
@@ -1476,10 +1474,8 @@ static void iwl4965_print_rx_config_cmd(struct iwl_priv *priv)
1476 IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n", 1474 IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n",
1477 rxon->ofdm_basic_rates); 1475 rxon->ofdm_basic_rates);
1478 IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates); 1476 IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates);
1479 IWL_DEBUG_RADIO("u8[6] node_addr: %s\n", 1477 IWL_DEBUG_RADIO("u8[6] node_addr: %pM\n", rxon->node_addr);
1480 print_mac(mac, rxon->node_addr)); 1478 IWL_DEBUG_RADIO("u8[6] bssid_addr: %pM\n", rxon->bssid_addr);
1481 IWL_DEBUG_RADIO("u8[6] bssid_addr: %s\n",
1482 print_mac(mac, rxon->bssid_addr));
1483 IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id)); 1479 IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
1484} 1480}
1485#endif 1481#endif
@@ -2466,7 +2462,6 @@ static void iwl4965_post_associate(struct iwl_priv *priv)
2466{ 2462{
2467 struct ieee80211_conf *conf = NULL; 2463 struct ieee80211_conf *conf = NULL;
2468 int ret = 0; 2464 int ret = 0;
2469 DECLARE_MAC_BUF(mac);
2470 unsigned long flags; 2465 unsigned long flags;
2471 2466
2472 if (priv->iw_mode == NL80211_IFTYPE_AP) { 2467 if (priv->iw_mode == NL80211_IFTYPE_AP) {
@@ -2474,9 +2469,8 @@ static void iwl4965_post_associate(struct iwl_priv *priv)
2474 return; 2469 return;
2475 } 2470 }
2476 2471
2477 IWL_DEBUG_ASSOC("Associated as %d to: %s\n", 2472 IWL_DEBUG_ASSOC("Associated as %d to: %pM\n",
2478 priv->assoc_id, 2473 priv->assoc_id, priv->active_rxon.bssid_addr);
2479 print_mac(mac, priv->active_rxon.bssid_addr));
2480 2474
2481 2475
2482 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 2476 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
@@ -2722,7 +2716,6 @@ static int iwl4965_mac_add_interface(struct ieee80211_hw *hw,
2722{ 2716{
2723 struct iwl_priv *priv = hw->priv; 2717 struct iwl_priv *priv = hw->priv;
2724 unsigned long flags; 2718 unsigned long flags;
2725 DECLARE_MAC_BUF(mac);
2726 2719
2727 IWL_DEBUG_MAC80211("enter: type %d\n", conf->type); 2720 IWL_DEBUG_MAC80211("enter: type %d\n", conf->type);
2728 2721
@@ -2739,7 +2732,7 @@ static int iwl4965_mac_add_interface(struct ieee80211_hw *hw,
2739 mutex_lock(&priv->mutex); 2732 mutex_lock(&priv->mutex);
2740 2733
2741 if (conf->mac_addr) { 2734 if (conf->mac_addr) {
2742 IWL_DEBUG_MAC80211("Set %s\n", print_mac(mac, conf->mac_addr)); 2735 IWL_DEBUG_MAC80211("Set %pM\n", conf->mac_addr);
2743 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN); 2736 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
2744 } 2737 }
2745 2738
@@ -2948,7 +2941,6 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw,
2948 struct ieee80211_if_conf *conf) 2941 struct ieee80211_if_conf *conf)
2949{ 2942{
2950 struct iwl_priv *priv = hw->priv; 2943 struct iwl_priv *priv = hw->priv;
2951 DECLARE_MAC_BUF(mac);
2952 unsigned long flags; 2944 unsigned long flags;
2953 int rc; 2945 int rc;
2954 2946
@@ -2983,8 +2975,7 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw,
2983 mutex_lock(&priv->mutex); 2975 mutex_lock(&priv->mutex);
2984 2976
2985 if (conf->bssid) 2977 if (conf->bssid)
2986 IWL_DEBUG_MAC80211("bssid: %s\n", 2978 IWL_DEBUG_MAC80211("bssid: %pM\n", conf->bssid);
2987 print_mac(mac, conf->bssid));
2988 2979
2989/* 2980/*
2990 * very dubious code was here; the probe filtering flag is never set: 2981 * very dubious code was here; the probe filtering flag is never set:
@@ -2997,8 +2988,8 @@ static int iwl4965_mac_config_interface(struct ieee80211_hw *hw,
2997 if (!conf->bssid) { 2988 if (!conf->bssid) {
2998 conf->bssid = priv->mac_addr; 2989 conf->bssid = priv->mac_addr;
2999 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN); 2990 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
3000 IWL_DEBUG_MAC80211("bssid was set to: %s\n", 2991 IWL_DEBUG_MAC80211("bssid was set to: %pM\n",
3001 print_mac(mac, conf->bssid)); 2992 conf->bssid);
3002 } 2993 }
3003 if (priv->ibss_beacon) 2994 if (priv->ibss_beacon)
3004 dev_kfree_skb(priv->ibss_beacon); 2995 dev_kfree_skb(priv->ibss_beacon);
@@ -3241,14 +3232,13 @@ static void iwl4965_mac_update_tkip_key(struct ieee80211_hw *hw,
3241 unsigned long flags; 3232 unsigned long flags;
3242 __le16 key_flags = 0; 3233 __le16 key_flags = 0;
3243 int i; 3234 int i;
3244 DECLARE_MAC_BUF(mac);
3245 3235
3246 IWL_DEBUG_MAC80211("enter\n"); 3236 IWL_DEBUG_MAC80211("enter\n");
3247 3237
3248 sta_id = iwl_find_station(priv, addr); 3238 sta_id = iwl_find_station(priv, addr);
3249 if (sta_id == IWL_INVALID_STATION) { 3239 if (sta_id == IWL_INVALID_STATION) {
3250 IWL_DEBUG_MAC80211("leave - %s not in station map.\n", 3240 IWL_DEBUG_MAC80211("leave - %pM not in station map.\n",
3251 print_mac(mac, addr)); 3241 addr);
3252 return; 3242 return;
3253 } 3243 }
3254 3244
@@ -3285,7 +3275,6 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3285 struct ieee80211_key_conf *key) 3275 struct ieee80211_key_conf *key)
3286{ 3276{
3287 struct iwl_priv *priv = hw->priv; 3277 struct iwl_priv *priv = hw->priv;
3288 DECLARE_MAC_BUF(mac);
3289 int ret = 0; 3278 int ret = 0;
3290 u8 sta_id = IWL_INVALID_STATION; 3279 u8 sta_id = IWL_INVALID_STATION;
3291 u8 is_default_wep_key = 0; 3280 u8 is_default_wep_key = 0;
@@ -3303,8 +3292,8 @@ static int iwl4965_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
3303 3292
3304 sta_id = iwl_find_station(priv, addr); 3293 sta_id = iwl_find_station(priv, addr);
3305 if (sta_id == IWL_INVALID_STATION) { 3294 if (sta_id == IWL_INVALID_STATION) {
3306 IWL_DEBUG_MAC80211("leave - %s not in station map.\n", 3295 IWL_DEBUG_MAC80211("leave - %pM not in station map.\n",
3307 print_mac(mac, addr)); 3296 addr);
3308 return -EINVAL; 3297 return -EINVAL;
3309 3298
3310 } 3299 }
@@ -3405,10 +3394,9 @@ static int iwl4965_mac_ampdu_action(struct ieee80211_hw *hw,
3405 struct ieee80211_sta *sta, u16 tid, u16 *ssn) 3394 struct ieee80211_sta *sta, u16 tid, u16 *ssn)
3406{ 3395{
3407 struct iwl_priv *priv = hw->priv; 3396 struct iwl_priv *priv = hw->priv;
3408 DECLARE_MAC_BUF(mac);
3409 3397
3410 IWL_DEBUG_HT("A-MPDU action on addr %s tid %d\n", 3398 IWL_DEBUG_HT("A-MPDU action on addr %pM tid %d\n",
3411 print_mac(mac, sta->addr), tid); 3399 sta->addr, tid);
3412 3400
3413 if (!(priv->cfg->sku & IWL_SKU_N)) 3401 if (!(priv->cfg->sku & IWL_SKU_N))
3414 return -EACCES; 3402 return -EACCES;
@@ -4171,7 +4159,6 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
4171 struct ieee80211_hw *hw; 4159 struct ieee80211_hw *hw;
4172 struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data); 4160 struct iwl_cfg *cfg = (struct iwl_cfg *)(ent->driver_data);
4173 unsigned long flags; 4161 unsigned long flags;
4174 DECLARE_MAC_BUF(mac);
4175 4162
4176 /************************ 4163 /************************
4177 * 1. Allocating HW data 4164 * 1. Allocating HW data
@@ -4280,7 +4267,7 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
4280 4267
4281 /* extract MAC Address */ 4268 /* extract MAC Address */
4282 iwl_eeprom_get_mac(priv, priv->mac_addr); 4269 iwl_eeprom_get_mac(priv, priv->mac_addr);
4283 IWL_DEBUG_INFO("MAC address: %s\n", print_mac(mac, priv->mac_addr)); 4270 IWL_DEBUG_INFO("MAC address: %pM\n", priv->mac_addr);
4284 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr); 4271 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
4285 4272
4286 /************************ 4273 /************************
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 20db0eb636a8..753f9387aa68 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -228,7 +228,6 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf,
228 ssize_t ret; 228 ssize_t ret;
229 /* Add 30 for initial string */ 229 /* Add 30 for initial string */
230 const size_t bufsz = 30 + sizeof(char) * 500 * (priv->num_stations); 230 const size_t bufsz = 30 + sizeof(char) * 500 * (priv->num_stations);
231 DECLARE_MAC_BUF(mac);
232 231
233 buf = kmalloc(bufsz, GFP_KERNEL); 232 buf = kmalloc(bufsz, GFP_KERNEL);
234 if (!buf) 233 if (!buf)
@@ -242,7 +241,6 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf,
242 if (station->used) { 241 if (station->used) {
243 pos += scnprintf(buf + pos, bufsz - pos, 242 pos += scnprintf(buf + pos, bufsz - pos,
244 "station %d:\ngeneral data:\n", i+1); 243 "station %d:\ngeneral data:\n", i+1);
245 print_mac(mac, station->sta.sta.addr);
246 pos += scnprintf(buf + pos, bufsz - pos, "id: %u\n", 244 pos += scnprintf(buf + pos, bufsz - pos, "id: %u\n",
247 station->sta.sta.sta_id); 245 station->sta.sta.sta_id);
248 pos += scnprintf(buf + pos, bufsz - pos, "mode: %u\n", 246 pos += scnprintf(buf + pos, bufsz - pos, "mode: %u\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c
index 61797f3f8d5c..e02c4717c93c 100644
--- a/drivers/net/wireless/iwlwifi/iwl-sta.c
+++ b/drivers/net/wireless/iwlwifi/iwl-sta.c
@@ -45,7 +45,6 @@ u8 iwl_find_station(struct iwl_priv *priv, const u8 *addr)
45 int start = 0; 45 int start = 0;
46 int ret = IWL_INVALID_STATION; 46 int ret = IWL_INVALID_STATION;
47 unsigned long flags; 47 unsigned long flags;
48 DECLARE_MAC_BUF(mac);
49 48
50 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) || 49 if ((priv->iw_mode == NL80211_IFTYPE_ADHOC) ||
51 (priv->iw_mode == NL80211_IFTYPE_AP)) 50 (priv->iw_mode == NL80211_IFTYPE_AP))
@@ -63,8 +62,8 @@ u8 iwl_find_station(struct iwl_priv *priv, const u8 *addr)
63 goto out; 62 goto out;
64 } 63 }
65 64
66 IWL_DEBUG_ASSOC_LIMIT("can not find STA %s total %d\n", 65 IWL_DEBUG_ASSOC_LIMIT("can not find STA %pM total %d\n",
67 print_mac(mac, addr), priv->num_stations); 66 addr, priv->num_stations);
68 67
69 out: 68 out:
70 spin_unlock_irqrestore(&priv->sta_lock, flags); 69 spin_unlock_irqrestore(&priv->sta_lock, flags);
@@ -86,7 +85,6 @@ EXPORT_SYMBOL(iwl_get_ra_sta_id);
86static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id) 85static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)
87{ 86{
88 unsigned long flags; 87 unsigned long flags;
89 DECLARE_MAC_BUF(mac);
90 88
91 spin_lock_irqsave(&priv->sta_lock, flags); 89 spin_lock_irqsave(&priv->sta_lock, flags);
92 90
@@ -94,8 +92,8 @@ static void iwl_sta_ucode_activate(struct iwl_priv *priv, u8 sta_id)
94 IWL_ERROR("ACTIVATE a non DRIVER active station %d\n", sta_id); 92 IWL_ERROR("ACTIVATE a non DRIVER active station %d\n", sta_id);
95 93
96 priv->stations[sta_id].used |= IWL_STA_UCODE_ACTIVE; 94 priv->stations[sta_id].used |= IWL_STA_UCODE_ACTIVE;
97 IWL_DEBUG_ASSOC("Added STA to Ucode: %s\n", 95 IWL_DEBUG_ASSOC("Added STA to Ucode: %pM\n",
98 print_mac(mac, priv->stations[sta_id].sta.sta.addr)); 96 priv->stations[sta_id].sta.sta.addr);
99 97
100 spin_unlock_irqrestore(&priv->sta_lock, flags); 98 spin_unlock_irqrestore(&priv->sta_lock, flags);
101} 99}
@@ -237,7 +235,6 @@ u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap,
237 int sta_id = IWL_INVALID_STATION; 235 int sta_id = IWL_INVALID_STATION;
238 struct iwl_station_entry *station; 236 struct iwl_station_entry *station;
239 unsigned long flags_spin; 237 unsigned long flags_spin;
240 DECLARE_MAC_BUF(mac);
241 238
242 spin_lock_irqsave(&priv->sta_lock, flags_spin); 239 spin_lock_irqsave(&priv->sta_lock, flags_spin);
243 if (is_ap) 240 if (is_ap)
@@ -273,8 +270,8 @@ u8 iwl_add_station_flags(struct iwl_priv *priv, const u8 *addr, int is_ap,
273 270
274 station = &priv->stations[sta_id]; 271 station = &priv->stations[sta_id];
275 station->used = IWL_STA_DRIVER_ACTIVE; 272 station->used = IWL_STA_DRIVER_ACTIVE;
276 IWL_DEBUG_ASSOC("Add STA to driver ID %d: %s\n", 273 IWL_DEBUG_ASSOC("Add STA to driver ID %d: %pM\n",
277 sta_id, print_mac(mac, addr)); 274 sta_id, addr);
278 priv->num_stations++; 275 priv->num_stations++;
279 276
280 /* Set up the REPLY_ADD_STA command to send to device */ 277 /* Set up the REPLY_ADD_STA command to send to device */
@@ -301,14 +298,11 @@ EXPORT_SYMBOL(iwl_add_station_flags);
301static void iwl_sta_ucode_deactivate(struct iwl_priv *priv, const char *addr) 298static void iwl_sta_ucode_deactivate(struct iwl_priv *priv, const char *addr)
302{ 299{
303 unsigned long flags; 300 unsigned long flags;
304 DECLARE_MAC_BUF(mac);
305
306 u8 sta_id = iwl_find_station(priv, addr); 301 u8 sta_id = iwl_find_station(priv, addr);
307 302
308 BUG_ON(sta_id == IWL_INVALID_STATION); 303 BUG_ON(sta_id == IWL_INVALID_STATION);
309 304
310 IWL_DEBUG_ASSOC("Removed STA from Ucode: %s\n", 305 IWL_DEBUG_ASSOC("Removed STA from Ucode: %pM\n", addr);
311 print_mac(mac, addr));
312 306
313 spin_lock_irqsave(&priv->sta_lock, flags); 307 spin_lock_irqsave(&priv->sta_lock, flags);
314 308
@@ -415,7 +409,6 @@ int iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
415 int sta_id = IWL_INVALID_STATION; 409 int sta_id = IWL_INVALID_STATION;
416 int i, ret = -EINVAL; 410 int i, ret = -EINVAL;
417 unsigned long flags; 411 unsigned long flags;
418 DECLARE_MAC_BUF(mac);
419 412
420 spin_lock_irqsave(&priv->sta_lock, flags); 413 spin_lock_irqsave(&priv->sta_lock, flags);
421 414
@@ -435,18 +428,18 @@ int iwl_remove_station(struct iwl_priv *priv, const u8 *addr, int is_ap)
435 if (unlikely(sta_id == IWL_INVALID_STATION)) 428 if (unlikely(sta_id == IWL_INVALID_STATION))
436 goto out; 429 goto out;
437 430
438 IWL_DEBUG_ASSOC("Removing STA from driver:%d %s\n", 431 IWL_DEBUG_ASSOC("Removing STA from driver:%d %pM\n",
439 sta_id, print_mac(mac, addr)); 432 sta_id, addr);
440 433
441 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) { 434 if (!(priv->stations[sta_id].used & IWL_STA_DRIVER_ACTIVE)) {
442 IWL_ERROR("Removing %s but non DRIVER active\n", 435 IWL_ERROR("Removing %pM but non DRIVER active\n",
443 print_mac(mac, addr)); 436 addr);
444 goto out; 437 goto out;
445 } 438 }
446 439
447 if (!(priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE)) { 440 if (!(priv->stations[sta_id].used & IWL_STA_UCODE_ACTIVE)) {
448 IWL_ERROR("Removing %s but non UCODE active\n", 441 IWL_ERROR("Removing %pM but non UCODE active\n",
449 print_mac(mac, addr)); 442 addr);
450 goto out; 443 goto out;
451 } 444 }
452 445
@@ -927,7 +920,6 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
927{ 920{
928 int sta_id; 921 int sta_id;
929 u16 fc = le16_to_cpu(hdr->frame_control); 922 u16 fc = le16_to_cpu(hdr->frame_control);
930 DECLARE_MAC_BUF(mac);
931 923
932 /* If this frame is broadcast or management, use broadcast station id */ 924 /* If this frame is broadcast or management, use broadcast station id */
933 if (((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) || 925 if (((fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA) ||
@@ -962,9 +954,9 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr)
962 if (sta_id != IWL_INVALID_STATION) 954 if (sta_id != IWL_INVALID_STATION)
963 return sta_id; 955 return sta_id;
964 956
965 IWL_DEBUG_DROP("Station %s not in station map. " 957 IWL_DEBUG_DROP("Station %pM not in station map. "
966 "Defaulting to broadcast...\n", 958 "Defaulting to broadcast...\n",
967 print_mac(mac, hdr->addr1)); 959 hdr->addr1);
968 iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); 960 iwl_print_hex_dump(priv, IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
969 return priv->hw_params.bcast_sta_id; 961 return priv->hw_params.bcast_sta_id;
970 962
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c
index 907a53ebc6e4..37ebcff409e2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-tx.c
@@ -830,10 +830,8 @@ int iwl_tx_skb(struct iwl_priv *priv, struct sk_buff *skb)
830 /* Find (or create) index into station table for destination station */ 830 /* Find (or create) index into station table for destination station */
831 sta_id = iwl_get_sta_id(priv, hdr); 831 sta_id = iwl_get_sta_id(priv, hdr);
832 if (sta_id == IWL_INVALID_STATION) { 832 if (sta_id == IWL_INVALID_STATION) {
833 DECLARE_MAC_BUF(mac); 833 IWL_DEBUG_DROP("Dropping - INVALID STATION: %pM\n",
834 834 hdr->addr1);
835 IWL_DEBUG_DROP("Dropping - INVALID STATION: %s\n",
836 print_mac(mac, hdr->addr1));
837 goto drop; 835 goto drop;
838 } 836 }
839 837
@@ -1248,15 +1246,14 @@ int iwl_tx_agg_start(struct iwl_priv *priv, const u8 *ra, u16 tid, u16 *ssn)
1248 int ret; 1246 int ret;
1249 unsigned long flags; 1247 unsigned long flags;
1250 struct iwl_tid_data *tid_data; 1248 struct iwl_tid_data *tid_data;
1251 DECLARE_MAC_BUF(mac);
1252 1249
1253 if (likely(tid < ARRAY_SIZE(default_tid_to_tx_fifo))) 1250 if (likely(tid < ARRAY_SIZE(default_tid_to_tx_fifo)))
1254 tx_fifo = default_tid_to_tx_fifo[tid]; 1251 tx_fifo = default_tid_to_tx_fifo[tid];
1255 else 1252 else
1256 return -EINVAL; 1253 return -EINVAL;
1257 1254
1258 IWL_WARNING("%s on ra = %s tid = %d\n", 1255 IWL_WARNING("%s on ra = %pM tid = %d\n",
1259 __func__, print_mac(mac, ra), tid); 1256 __func__, ra, tid);
1260 1257
1261 sta_id = iwl_find_station(priv, ra); 1258 sta_id = iwl_find_station(priv, ra);
1262 if (sta_id == IWL_INVALID_STATION) 1259 if (sta_id == IWL_INVALID_STATION)
@@ -1301,7 +1298,6 @@ int iwl_tx_agg_stop(struct iwl_priv *priv , const u8 *ra, u16 tid)
1301 struct iwl_tid_data *tid_data; 1298 struct iwl_tid_data *tid_data;
1302 int ret, write_ptr, read_ptr; 1299 int ret, write_ptr, read_ptr;
1303 unsigned long flags; 1300 unsigned long flags;
1304 DECLARE_MAC_BUF(mac);
1305 1301
1306 if (!ra) { 1302 if (!ra) {
1307 IWL_ERROR("ra = NULL\n"); 1303 IWL_ERROR("ra = NULL\n");
@@ -1467,7 +1463,6 @@ void iwl_rx_reply_compressed_ba(struct iwl_priv *priv,
1467 int index; 1463 int index;
1468 struct iwl_tx_queue *txq = NULL; 1464 struct iwl_tx_queue *txq = NULL;
1469 struct iwl_ht_agg *agg; 1465 struct iwl_ht_agg *agg;
1470 DECLARE_MAC_BUF(mac);
1471 1466
1472 /* "flow" corresponds to Tx queue */ 1467 /* "flow" corresponds to Tx queue */
1473 u16 scd_flow = le16_to_cpu(ba_resp->scd_flow); 1468 u16 scd_flow = le16_to_cpu(ba_resp->scd_flow);
@@ -1489,10 +1484,10 @@ void iwl_rx_reply_compressed_ba(struct iwl_priv *priv,
1489 1484
1490 /* TODO: Need to get this copy more safely - now good for debug */ 1485 /* TODO: Need to get this copy more safely - now good for debug */
1491 1486
1492 IWL_DEBUG_TX_REPLY("REPLY_COMPRESSED_BA [%d]Received from %s, " 1487 IWL_DEBUG_TX_REPLY("REPLY_COMPRESSED_BA [%d]Received from %pM, "
1493 "sta_id = %d\n", 1488 "sta_id = %d\n",
1494 agg->wait_for_ba, 1489 agg->wait_for_ba,
1495 print_mac(mac, (u8 *) &ba_resp->sta_addr_lo32), 1490 (u8 *) &ba_resp->sta_addr_lo32,
1496 ba_resp->sta_id); 1491 ba_resp->sta_id);
1497 IWL_DEBUG_TX_REPLY("TID = %d, SeqCtl = %d, bitmap = 0x%llx, scd_flow = " 1492 IWL_DEBUG_TX_REPLY("TID = %d, SeqCtl = %d, bitmap = 0x%llx, scd_flow = "
1498 "%d, scd_ssn = %d\n", 1493 "%d, scd_ssn = %d\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index d15a2c997954..d3a2966d9181 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -446,7 +446,6 @@ u8 iwl3945_add_station(struct iwl3945_priv *priv, const u8 *addr, int is_ap, u8
446 int index = IWL_INVALID_STATION; 446 int index = IWL_INVALID_STATION;
447 struct iwl3945_station_entry *station; 447 struct iwl3945_station_entry *station;
448 unsigned long flags_spin; 448 unsigned long flags_spin;
449 DECLARE_MAC_BUF(mac);
450 u8 rate; 449 u8 rate;
451 450
452 spin_lock_irqsave(&priv->sta_lock, flags_spin); 451 spin_lock_irqsave(&priv->sta_lock, flags_spin);
@@ -480,7 +479,7 @@ u8 iwl3945_add_station(struct iwl3945_priv *priv, const u8 *addr, int is_ap, u8
480 return index; 479 return index;
481 } 480 }
482 481
483 IWL_DEBUG_ASSOC("Add STA ID %d: %s\n", index, print_mac(mac, addr)); 482 IWL_DEBUG_ASSOC("Add STA ID %d: %pM\n", index, addr);
484 station = &priv->stations[index]; 483 station = &priv->stations[index];
485 station->used = 1; 484 station->used = 1;
486 priv->num_stations++; 485 priv->num_stations++;
@@ -1063,7 +1062,6 @@ static int iwl3945_commit_rxon(struct iwl3945_priv *priv)
1063 /* cast away the const for active_rxon in this function */ 1062 /* cast away the const for active_rxon in this function */
1064 struct iwl3945_rxon_cmd *active_rxon = (void *)&priv->active_rxon; 1063 struct iwl3945_rxon_cmd *active_rxon = (void *)&priv->active_rxon;
1065 int rc = 0; 1064 int rc = 0;
1066 DECLARE_MAC_BUF(mac);
1067 1065
1068 if (!iwl3945_is_alive(priv)) 1066 if (!iwl3945_is_alive(priv))
1069 return -1; 1067 return -1;
@@ -1124,11 +1122,11 @@ static int iwl3945_commit_rxon(struct iwl3945_priv *priv)
1124 IWL_DEBUG_INFO("Sending RXON\n" 1122 IWL_DEBUG_INFO("Sending RXON\n"
1125 "* with%s RXON_FILTER_ASSOC_MSK\n" 1123 "* with%s RXON_FILTER_ASSOC_MSK\n"
1126 "* channel = %d\n" 1124 "* channel = %d\n"
1127 "* bssid = %s\n", 1125 "* bssid = %pM\n",
1128 ((priv->staging_rxon.filter_flags & 1126 ((priv->staging_rxon.filter_flags &
1129 RXON_FILTER_ASSOC_MSK) ? "" : "out"), 1127 RXON_FILTER_ASSOC_MSK) ? "" : "out"),
1130 le16_to_cpu(priv->staging_rxon.channel), 1128 le16_to_cpu(priv->staging_rxon.channel),
1131 print_mac(mac, priv->staging_rxon.bssid_addr)); 1129 priv->staging_rxon.bssid_addr);
1132 1130
1133 /* Apply the new configuration */ 1131 /* Apply the new configuration */
1134 rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON, 1132 rc = iwl3945_send_cmd_pdu(priv, REPLY_RXON,
@@ -2482,8 +2480,6 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
2482 /* If this frame is going out to an IBSS network, find the station, 2480 /* If this frame is going out to an IBSS network, find the station,
2483 * or create a new station table entry */ 2481 * or create a new station table entry */
2484 case NL80211_IFTYPE_ADHOC: { 2482 case NL80211_IFTYPE_ADHOC: {
2485 DECLARE_MAC_BUF(mac);
2486
2487 /* Create new station table entry */ 2483 /* Create new station table entry */
2488 sta_id = iwl3945_hw_find_station(priv, hdr->addr1); 2484 sta_id = iwl3945_hw_find_station(priv, hdr->addr1);
2489 if (sta_id != IWL_INVALID_STATION) 2485 if (sta_id != IWL_INVALID_STATION)
@@ -2494,9 +2490,9 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h
2494 if (sta_id != IWL_INVALID_STATION) 2490 if (sta_id != IWL_INVALID_STATION)
2495 return sta_id; 2491 return sta_id;
2496 2492
2497 IWL_DEBUG_DROP("Station %s not in station map. " 2493 IWL_DEBUG_DROP("Station %pM not in station map. "
2498 "Defaulting to broadcast...\n", 2494 "Defaulting to broadcast...\n",
2499 print_mac(mac, hdr->addr1)); 2495 hdr->addr1);
2500 iwl3945_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr)); 2496 iwl3945_print_hex_dump(IWL_DL_DROP, (u8 *) hdr, sizeof(*hdr));
2501 return priv->hw_setting.bcast_sta_id; 2497 return priv->hw_setting.bcast_sta_id;
2502 } 2498 }
@@ -2579,10 +2575,8 @@ static int iwl3945_tx_skb(struct iwl3945_priv *priv, struct sk_buff *skb)
2579 /* Find (or create) index into station table for destination station */ 2575 /* Find (or create) index into station table for destination station */
2580 sta_id = iwl3945_get_sta_id(priv, hdr); 2576 sta_id = iwl3945_get_sta_id(priv, hdr);
2581 if (sta_id == IWL_INVALID_STATION) { 2577 if (sta_id == IWL_INVALID_STATION) {
2582 DECLARE_MAC_BUF(mac); 2578 IWL_DEBUG_DROP("Dropping - INVALID STATION: %pM\n",
2583 2579 hdr->addr1);
2584 IWL_DEBUG_DROP("Dropping - INVALID STATION: %s\n",
2585 print_mac(mac, hdr->addr1));
2586 goto drop; 2580 goto drop;
2587 } 2581 }
2588 2582
@@ -4019,8 +4013,6 @@ static int iwl3945_tx_queue_update_write_ptr(struct iwl3945_priv *priv,
4019#ifdef CONFIG_IWL3945_DEBUG 4013#ifdef CONFIG_IWL3945_DEBUG
4020static void iwl3945_print_rx_config_cmd(struct iwl3945_rxon_cmd *rxon) 4014static void iwl3945_print_rx_config_cmd(struct iwl3945_rxon_cmd *rxon)
4021{ 4015{
4022 DECLARE_MAC_BUF(mac);
4023
4024 IWL_DEBUG_RADIO("RX CONFIG:\n"); 4016 IWL_DEBUG_RADIO("RX CONFIG:\n");
4025 iwl3945_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon)); 4017 iwl3945_print_hex_dump(IWL_DL_RADIO, (u8 *) rxon, sizeof(*rxon));
4026 IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel)); 4018 IWL_DEBUG_RADIO("u16 channel: 0x%x\n", le16_to_cpu(rxon->channel));
@@ -4031,10 +4023,8 @@ static void iwl3945_print_rx_config_cmd(struct iwl3945_rxon_cmd *rxon)
4031 IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n", 4023 IWL_DEBUG_RADIO("u8 ofdm_basic_rates: 0x%02x\n",
4032 rxon->ofdm_basic_rates); 4024 rxon->ofdm_basic_rates);
4033 IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates); 4025 IWL_DEBUG_RADIO("u8 cck_basic_rates: 0x%02x\n", rxon->cck_basic_rates);
4034 IWL_DEBUG_RADIO("u8[6] node_addr: %s\n", 4026 IWL_DEBUG_RADIO("u8[6] node_addr: %pM\n", rxon->node_addr);
4035 print_mac(mac, rxon->node_addr)); 4027 IWL_DEBUG_RADIO("u8[6] bssid_addr: %pM\n", rxon->bssid_addr);
4036 IWL_DEBUG_RADIO("u8[6] bssid_addr: %s\n",
4037 print_mac(mac, rxon->bssid_addr));
4038 IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id)); 4028 IWL_DEBUG_RADIO("u16 assoc_id: 0x%x\n", le16_to_cpu(rxon->assoc_id));
4039} 4029}
4040#endif 4030#endif
@@ -6321,7 +6311,6 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
6321{ 6311{
6322 int rc = 0; 6312 int rc = 0;
6323 struct ieee80211_conf *conf = NULL; 6313 struct ieee80211_conf *conf = NULL;
6324 DECLARE_MAC_BUF(mac);
6325 6314
6326 if (priv->iw_mode == NL80211_IFTYPE_AP) { 6315 if (priv->iw_mode == NL80211_IFTYPE_AP) {
6327 IWL_ERROR("%s Should not be called in AP mode\n", __func__); 6316 IWL_ERROR("%s Should not be called in AP mode\n", __func__);
@@ -6329,9 +6318,8 @@ static void iwl3945_post_associate(struct iwl3945_priv *priv)
6329 } 6318 }
6330 6319
6331 6320
6332 IWL_DEBUG_ASSOC("Associated as %d to: %s\n", 6321 IWL_DEBUG_ASSOC("Associated as %d to: %pM\n",
6333 priv->assoc_id, 6322 priv->assoc_id, priv->active_rxon.bssid_addr);
6334 print_mac(mac, priv->active_rxon.bssid_addr));
6335 6323
6336 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 6324 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
6337 return; 6325 return;
@@ -6592,7 +6580,6 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
6592{ 6580{
6593 struct iwl3945_priv *priv = hw->priv; 6581 struct iwl3945_priv *priv = hw->priv;
6594 unsigned long flags; 6582 unsigned long flags;
6595 DECLARE_MAC_BUF(mac);
6596 6583
6597 IWL_DEBUG_MAC80211("enter: type %d\n", conf->type); 6584 IWL_DEBUG_MAC80211("enter: type %d\n", conf->type);
6598 6585
@@ -6609,7 +6596,7 @@ static int iwl3945_mac_add_interface(struct ieee80211_hw *hw,
6609 mutex_lock(&priv->mutex); 6596 mutex_lock(&priv->mutex);
6610 6597
6611 if (conf->mac_addr) { 6598 if (conf->mac_addr) {
6612 IWL_DEBUG_MAC80211("Set: %s\n", print_mac(mac, conf->mac_addr)); 6599 IWL_DEBUG_MAC80211("Set: %pM\n", conf->mac_addr);
6613 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN); 6600 memcpy(priv->mac_addr, conf->mac_addr, ETH_ALEN);
6614 } 6601 }
6615 6602
@@ -6778,7 +6765,6 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6778 struct ieee80211_if_conf *conf) 6765 struct ieee80211_if_conf *conf)
6779{ 6766{
6780 struct iwl3945_priv *priv = hw->priv; 6767 struct iwl3945_priv *priv = hw->priv;
6781 DECLARE_MAC_BUF(mac);
6782 unsigned long flags; 6768 unsigned long flags;
6783 int rc; 6769 int rc;
6784 6770
@@ -6816,8 +6802,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6816 mutex_lock(&priv->mutex); 6802 mutex_lock(&priv->mutex);
6817 6803
6818 if (conf->bssid) 6804 if (conf->bssid)
6819 IWL_DEBUG_MAC80211("bssid: %s\n", 6805 IWL_DEBUG_MAC80211("bssid: %pM\n", conf->bssid);
6820 print_mac(mac, conf->bssid));
6821 6806
6822/* 6807/*
6823 * very dubious code was here; the probe filtering flag is never set: 6808 * very dubious code was here; the probe filtering flag is never set:
@@ -6830,8 +6815,8 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
6830 if (!conf->bssid) { 6815 if (!conf->bssid) {
6831 conf->bssid = priv->mac_addr; 6816 conf->bssid = priv->mac_addr;
6832 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN); 6817 memcpy(priv->bssid, priv->mac_addr, ETH_ALEN);
6833 IWL_DEBUG_MAC80211("bssid was set to: %s\n", 6818 IWL_DEBUG_MAC80211("bssid was set to: %pM\n",
6834 print_mac(mac, conf->bssid)); 6819 conf->bssid);
6835 } 6820 }
6836 if (priv->ibss_beacon) 6821 if (priv->ibss_beacon)
6837 dev_kfree_skb(priv->ibss_beacon); 6822 dev_kfree_skb(priv->ibss_beacon);
@@ -7072,10 +7057,8 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
7072 7057
7073 sta_id = iwl3945_hw_find_station(priv, addr); 7058 sta_id = iwl3945_hw_find_station(priv, addr);
7074 if (sta_id == IWL_INVALID_STATION) { 7059 if (sta_id == IWL_INVALID_STATION) {
7075 DECLARE_MAC_BUF(mac); 7060 IWL_DEBUG_MAC80211("leave - %pM not in station map.\n",
7076 7061 addr);
7077 IWL_DEBUG_MAC80211("leave - %s not in station map.\n",
7078 print_mac(mac, addr));
7079 return -EINVAL; 7062 return -EINVAL;
7080 } 7063 }
7081 7064
@@ -7870,7 +7853,6 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
7870 struct ieee80211_hw *hw; 7853 struct ieee80211_hw *hw;
7871 struct iwl_3945_cfg *cfg = (struct iwl_3945_cfg *)(ent->driver_data); 7854 struct iwl_3945_cfg *cfg = (struct iwl_3945_cfg *)(ent->driver_data);
7872 unsigned long flags; 7855 unsigned long flags;
7873 DECLARE_MAC_BUF(mac);
7874 7856
7875 /* Disabling hardware scan means that mac80211 will perform scans 7857 /* Disabling hardware scan means that mac80211 will perform scans
7876 * "the hard way", rather than using device's scan. */ 7858 * "the hard way", rather than using device's scan. */
@@ -8045,7 +8027,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
8045 } 8027 }
8046 /* MAC Address location in EEPROM same for 3945/4965 */ 8028 /* MAC Address location in EEPROM same for 3945/4965 */
8047 get_eeprom_mac(priv, priv->mac_addr); 8029 get_eeprom_mac(priv, priv->mac_addr);
8048 IWL_DEBUG_INFO("MAC address: %s\n", print_mac(mac, priv->mac_addr)); 8030 IWL_DEBUG_INFO("MAC address: %pM\n", priv->mac_addr);
8049 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr); 8031 SET_IEEE80211_PERM_ADDR(priv->hw, priv->mac_addr);
8050 8032
8051 err = iwl3945_init_channel_map(priv); 8033 err = iwl3945_init_channel_map(priv);
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 92be60415d04..8b88e9544418 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -151,7 +151,6 @@ static int lbs_adhoc_join(struct lbs_private *priv,
151 struct cmd_ds_802_11_ad_hoc_join cmd; 151 struct cmd_ds_802_11_ad_hoc_join cmd;
152 struct bss_descriptor *bss = &assoc_req->bss; 152 struct bss_descriptor *bss = &assoc_req->bss;
153 u8 preamble = RADIO_PREAMBLE_LONG; 153 u8 preamble = RADIO_PREAMBLE_LONG;
154 DECLARE_MAC_BUF(mac);
155 u16 ratesize = 0; 154 u16 ratesize = 0;
156 int ret = 0; 155 int ret = 0;
157 156
@@ -226,8 +225,8 @@ static int lbs_adhoc_join(struct lbs_private *priv,
226 bss->capability, CAPINFO_MASK); 225 bss->capability, CAPINFO_MASK);
227 226
228 /* information on BSSID descriptor passed to FW */ 227 /* information on BSSID descriptor passed to FW */
229 lbs_deb_join("ADHOC_J_CMD: BSSID = %s, SSID = '%s'\n", 228 lbs_deb_join("ADHOC_J_CMD: BSSID = %pM, SSID = '%s'\n",
230 print_mac(mac, cmd.bss.bssid), cmd.bss.ssid); 229 cmd.bss.bssid, cmd.bss.ssid);
231 230
232 /* Only v8 and below support setting these */ 231 /* Only v8 and below support setting these */
233 if (priv->fwrelease < 0x09000000) { 232 if (priv->fwrelease < 0x09000000) {
@@ -752,17 +751,15 @@ static int assoc_helper_bssid(struct lbs_private *priv,
752{ 751{
753 int ret = 0; 752 int ret = 0;
754 struct bss_descriptor * bss; 753 struct bss_descriptor * bss;
755 DECLARE_MAC_BUF(mac);
756 754
757 lbs_deb_enter_args(LBS_DEB_ASSOC, "BSSID %s", 755 lbs_deb_enter_args(LBS_DEB_ASSOC, "BSSID %pM", assoc_req->bssid);
758 print_mac(mac, assoc_req->bssid));
759 756
760 /* Search for index position in list for requested MAC */ 757 /* Search for index position in list for requested MAC */
761 bss = lbs_find_bssid_in_list(priv, assoc_req->bssid, 758 bss = lbs_find_bssid_in_list(priv, assoc_req->bssid,
762 assoc_req->mode); 759 assoc_req->mode);
763 if (bss == NULL) { 760 if (bss == NULL) {
764 lbs_deb_assoc("ASSOC: WAP: BSSID %s not found, " 761 lbs_deb_assoc("ASSOC: WAP: BSSID %pM not found, "
765 "cannot associate.\n", print_mac(mac, assoc_req->bssid)); 762 "cannot associate.\n", assoc_req->bssid);
766 goto out; 763 goto out;
767 } 764 }
768 765
@@ -1208,7 +1205,6 @@ void lbs_association_worker(struct work_struct *work)
1208 struct assoc_request * assoc_req = NULL; 1205 struct assoc_request * assoc_req = NULL;
1209 int ret = 0; 1206 int ret = 0;
1210 int find_any_ssid = 0; 1207 int find_any_ssid = 0;
1211 DECLARE_MAC_BUF(mac);
1212 1208
1213 lbs_deb_enter(LBS_DEB_ASSOC); 1209 lbs_deb_enter(LBS_DEB_ASSOC);
1214 1210
@@ -1228,13 +1224,13 @@ void lbs_association_worker(struct work_struct *work)
1228 " chann: %d\n" 1224 " chann: %d\n"
1229 " band: %d\n" 1225 " band: %d\n"
1230 " mode: %d\n" 1226 " mode: %d\n"
1231 " BSSID: %s\n" 1227 " BSSID: %pM\n"
1232 " secinfo: %s%s%s\n" 1228 " secinfo: %s%s%s\n"
1233 " auth_mode: %d\n", 1229 " auth_mode: %d\n",
1234 assoc_req->flags, 1230 assoc_req->flags,
1235 escape_essid(assoc_req->ssid, assoc_req->ssid_len), 1231 escape_essid(assoc_req->ssid, assoc_req->ssid_len),
1236 assoc_req->channel, assoc_req->band, assoc_req->mode, 1232 assoc_req->channel, assoc_req->band, assoc_req->mode,
1237 print_mac(mac, assoc_req->bssid), 1233 assoc_req->bssid,
1238 assoc_req->secinfo.WPAenabled ? " WPA" : "", 1234 assoc_req->secinfo.WPAenabled ? " WPA" : "",
1239 assoc_req->secinfo.WPA2enabled ? " WPA2" : "", 1235 assoc_req->secinfo.WPA2enabled ? " WPA2" : "",
1240 assoc_req->secinfo.wep_enabled ? " WEP" : "", 1236 assoc_req->secinfo.wep_enabled ? " WEP" : "",
@@ -1357,8 +1353,8 @@ void lbs_association_worker(struct work_struct *work)
1357 } 1353 }
1358 1354
1359 if (success) { 1355 if (success) {
1360 lbs_deb_assoc("associated to %s\n", 1356 lbs_deb_assoc("associated to %pM\n",
1361 print_mac(mac, priv->curbssparams.bssid)); 1357 priv->curbssparams.bssid);
1362 lbs_prepare_and_send_command(priv, 1358 lbs_prepare_and_send_command(priv,
1363 CMD_802_11_RSSI, 1359 CMD_802_11_RSSI,
1364 0, CMD_OPTION_WAITFORRSP, 0, NULL); 1360 0, CMD_OPTION_WAITFORRSP, 0, NULL);
@@ -1478,7 +1474,6 @@ int lbs_cmd_80211_authenticate(struct lbs_private *priv,
1478 struct cmd_ds_802_11_authenticate *pauthenticate = &cmd->params.auth; 1474 struct cmd_ds_802_11_authenticate *pauthenticate = &cmd->params.auth;
1479 int ret = -1; 1475 int ret = -1;
1480 u8 *bssid = pdata_buf; 1476 u8 *bssid = pdata_buf;
1481 DECLARE_MAC_BUF(mac);
1482 1477
1483 lbs_deb_enter(LBS_DEB_JOIN); 1478 lbs_deb_enter(LBS_DEB_JOIN);
1484 1479
@@ -1505,8 +1500,8 @@ int lbs_cmd_80211_authenticate(struct lbs_private *priv,
1505 1500
1506 memcpy(pauthenticate->macaddr, bssid, ETH_ALEN); 1501 memcpy(pauthenticate->macaddr, bssid, ETH_ALEN);
1507 1502
1508 lbs_deb_join("AUTH_CMD: BSSID %s, auth 0x%x\n", 1503 lbs_deb_join("AUTH_CMD: BSSID %pM, auth 0x%x\n",
1509 print_mac(mac, bssid), pauthenticate->authtype); 1504 bssid, pauthenticate->authtype);
1510 ret = 0; 1505 ret = 0;
1511 1506
1512out: 1507out:
@@ -1770,7 +1765,6 @@ static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp)
1770 struct cmd_ds_802_11_ad_hoc_result *adhoc_resp; 1765 struct cmd_ds_802_11_ad_hoc_result *adhoc_resp;
1771 union iwreq_data wrqu; 1766 union iwreq_data wrqu;
1772 struct bss_descriptor *bss; 1767 struct bss_descriptor *bss;
1773 DECLARE_MAC_BUF(mac);
1774 1768
1775 lbs_deb_enter(LBS_DEB_JOIN); 1769 lbs_deb_enter(LBS_DEB_JOIN);
1776 1770
@@ -1819,9 +1813,9 @@ static int lbs_adhoc_post(struct lbs_private *priv, struct cmd_header *resp)
1819 wrqu.ap_addr.sa_family = ARPHRD_ETHER; 1813 wrqu.ap_addr.sa_family = ARPHRD_ETHER;
1820 wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL); 1814 wireless_send_event(priv->dev, SIOCGIWAP, &wrqu, NULL);
1821 1815
1822 lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %s, channel %d\n", 1816 lbs_deb_join("ADHOC_RESP: Joined/started '%s', BSSID %pM, channel %d\n",
1823 escape_essid(bss->ssid, bss->ssid_len), 1817 escape_essid(bss->ssid, bss->ssid_len),
1824 print_mac(mac, priv->curbssparams.bssid), 1818 priv->curbssparams.bssid,
1825 priv->curbssparams.channel); 1819 priv->curbssparams.channel);
1826 1820
1827done: 1821done:
diff --git a/drivers/net/wireless/libertas/cmd.c b/drivers/net/wireless/libertas/cmd.c
index 8265c7d25edc..d45b07cf6a62 100644
--- a/drivers/net/wireless/libertas/cmd.c
+++ b/drivers/net/wireless/libertas/cmd.c
@@ -87,7 +87,6 @@ int lbs_update_hw_spec(struct lbs_private *priv)
87 struct cmd_ds_get_hw_spec cmd; 87 struct cmd_ds_get_hw_spec cmd;
88 int ret = -1; 88 int ret = -1;
89 u32 i; 89 u32 i;
90 DECLARE_MAC_BUF(mac);
91 90
92 lbs_deb_enter(LBS_DEB_CMD); 91 lbs_deb_enter(LBS_DEB_CMD);
93 92
@@ -110,8 +109,8 @@ int lbs_update_hw_spec(struct lbs_private *priv)
110 * CF card firmware 5.0.16p0: cap 0x00000303 109 * CF card firmware 5.0.16p0: cap 0x00000303
111 * USB dongle firmware 5.110.17p2: cap 0x00000303 110 * USB dongle firmware 5.110.17p2: cap 0x00000303
112 */ 111 */
113 lbs_pr_info("%s, fw %u.%u.%up%u, cap 0x%08x\n", 112 lbs_pr_info("%pM, fw %u.%u.%up%u, cap 0x%08x\n",
114 print_mac(mac, cmd.permanentaddr), 113 cmd.permanentaddr,
115 priv->fwrelease >> 24 & 0xff, 114 priv->fwrelease >> 24 & 0xff,
116 priv->fwrelease >> 16 & 0xff, 115 priv->fwrelease >> 16 & 0xff,
117 priv->fwrelease >> 8 & 0xff, 116 priv->fwrelease >> 8 & 0xff,
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 0aa0ce3b2c42..5f6bee493f23 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -65,7 +65,6 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
65 int numscansdone = 0, res; 65 int numscansdone = 0, res;
66 unsigned long addr = get_zeroed_page(GFP_KERNEL); 66 unsigned long addr = get_zeroed_page(GFP_KERNEL);
67 char *buf = (char *)addr; 67 char *buf = (char *)addr;
68 DECLARE_MAC_BUF(mac);
69 struct bss_descriptor * iter_bss; 68 struct bss_descriptor * iter_bss;
70 69
71 pos += snprintf(buf+pos, len-pos, 70 pos += snprintf(buf+pos, len-pos,
@@ -77,10 +76,9 @@ static ssize_t lbs_getscantable(struct file *file, char __user *userbuf,
77 u16 privacy = (iter_bss->capability & WLAN_CAPABILITY_PRIVACY); 76 u16 privacy = (iter_bss->capability & WLAN_CAPABILITY_PRIVACY);
78 u16 spectrum_mgmt = (iter_bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT); 77 u16 spectrum_mgmt = (iter_bss->capability & WLAN_CAPABILITY_SPECTRUM_MGMT);
79 78
80 pos += snprintf(buf+pos, len-pos, 79 pos += snprintf(buf+pos, len-pos, "%02u| %03d | %04d | %pM |",
81 "%02u| %03d | %04d | %s |",
82 numscansdone, iter_bss->channel, iter_bss->rssi, 80 numscansdone, iter_bss->channel, iter_bss->rssi,
83 print_mac(mac, iter_bss->bssid)); 81 iter_bss->bssid);
84 pos += snprintf(buf+pos, len-pos, " %04x-", iter_bss->capability); 82 pos += snprintf(buf+pos, len-pos, " %04x-", iter_bss->capability);
85 pos += snprintf(buf+pos, len-pos, "%c%c%c |", 83 pos += snprintf(buf+pos, len-pos, "%c%c%c |",
86 ibss ? 'A' : 'I', privacy ? 'P' : ' ', 84 ibss ? 'A' : 'I', privacy ? 'P' : ' ',
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c
index 73dc8c72402a..34a47f692bd6 100644
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -588,7 +588,6 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd,
588{ 588{
589 int i = nr_addrs; 589 int i = nr_addrs;
590 struct dev_mc_list *mc_list; 590 struct dev_mc_list *mc_list;
591 DECLARE_MAC_BUF(mac);
592 591
593 if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST)) 592 if ((dev->flags & (IFF_UP|IFF_MULTICAST)) != (IFF_UP|IFF_MULTICAST))
594 return nr_addrs; 593 return nr_addrs;
@@ -596,16 +595,16 @@ static int lbs_add_mcast_addrs(struct cmd_ds_mac_multicast_adr *cmd,
596 netif_addr_lock_bh(dev); 595 netif_addr_lock_bh(dev);
597 for (mc_list = dev->mc_list; mc_list; mc_list = mc_list->next) { 596 for (mc_list = dev->mc_list; mc_list; mc_list = mc_list->next) {
598 if (mac_in_list(cmd->maclist, nr_addrs, mc_list->dmi_addr)) { 597 if (mac_in_list(cmd->maclist, nr_addrs, mc_list->dmi_addr)) {
599 lbs_deb_net("mcast address %s:%s skipped\n", dev->name, 598 lbs_deb_net("mcast address %s:%pM skipped\n", dev->name,
600 print_mac(mac, mc_list->dmi_addr)); 599 mc_list->dmi_addr);
601 continue; 600 continue;
602 } 601 }
603 602
604 if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE) 603 if (i == MRVDRV_MAX_MULTICAST_LIST_SIZE)
605 break; 604 break;
606 memcpy(&cmd->maclist[6*i], mc_list->dmi_addr, ETH_ALEN); 605 memcpy(&cmd->maclist[6*i], mc_list->dmi_addr, ETH_ALEN);
607 lbs_deb_net("mcast address %s:%s added to filter\n", dev->name, 606 lbs_deb_net("mcast address %s:%pM added to filter\n", dev->name,
608 print_mac(mac, mc_list->dmi_addr)); 607 mc_list->dmi_addr);
609 i++; 608 i++;
610 } 609 }
611 netif_addr_unlock_bh(dev); 610 netif_addr_unlock_bh(dev);
diff --git a/drivers/net/wireless/libertas/scan.c b/drivers/net/wireless/libertas/scan.c
index 22c4c6110521..351b3f6e5664 100644
--- a/drivers/net/wireless/libertas/scan.c
+++ b/drivers/net/wireless/libertas/scan.c
@@ -359,7 +359,6 @@ int lbs_scan_networks(struct lbs_private *priv, int full_scan)
359#ifdef CONFIG_LIBERTAS_DEBUG 359#ifdef CONFIG_LIBERTAS_DEBUG
360 struct bss_descriptor *iter; 360 struct bss_descriptor *iter;
361 int i = 0; 361 int i = 0;
362 DECLARE_MAC_BUF(mac);
363#endif 362#endif
364 363
365 lbs_deb_enter_args(LBS_DEB_SCAN, "full_scan %d", full_scan); 364 lbs_deb_enter_args(LBS_DEB_SCAN, "full_scan %d", full_scan);
@@ -451,8 +450,8 @@ int lbs_scan_networks(struct lbs_private *priv, int full_scan)
451 mutex_lock(&priv->lock); 450 mutex_lock(&priv->lock);
452 lbs_deb_scan("scan table:\n"); 451 lbs_deb_scan("scan table:\n");
453 list_for_each_entry(iter, &priv->network_list, list) 452 list_for_each_entry(iter, &priv->network_list, list)
454 lbs_deb_scan("%02d: BSSID %s, RSSI %d, SSID '%s'\n", 453 lbs_deb_scan("%02d: BSSID %pM, RSSI %d, SSID '%s'\n",
455 i++, print_mac(mac, iter->bssid), iter->rssi, 454 i++, iter->bssid, iter->rssi,
456 escape_essid(iter->ssid, iter->ssid_len)); 455 escape_essid(iter->ssid, iter->ssid_len));
457 mutex_unlock(&priv->lock); 456 mutex_unlock(&priv->lock);
458#endif 457#endif
@@ -512,7 +511,6 @@ static int lbs_process_bss(struct bss_descriptor *bss,
512 struct ieeetypes_dsparamset *pDS; 511 struct ieeetypes_dsparamset *pDS;
513 struct ieeetypes_cfparamset *pCF; 512 struct ieeetypes_cfparamset *pCF;
514 struct ieeetypes_ibssparamset *pibss; 513 struct ieeetypes_ibssparamset *pibss;
515 DECLARE_MAC_BUF(mac);
516 struct ieeetypes_countryinfoset *pcountryinfo; 514 struct ieeetypes_countryinfoset *pcountryinfo;
517 uint8_t *pos, *end, *p; 515 uint8_t *pos, *end, *p;
518 uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0; 516 uint8_t n_ex_rates = 0, got_basic_rates = 0, n_basic_rates = 0;
@@ -544,7 +542,7 @@ static int lbs_process_bss(struct bss_descriptor *bss,
544 *bytesleft -= beaconsize; 542 *bytesleft -= beaconsize;
545 543
546 memcpy(bss->bssid, pos, ETH_ALEN); 544 memcpy(bss->bssid, pos, ETH_ALEN);
547 lbs_deb_scan("process_bss: BSSID %s\n", print_mac(mac, bss->bssid)); 545 lbs_deb_scan("process_bss: BSSID %pM\n", bss->bssid);
548 pos += ETH_ALEN; 546 pos += ETH_ALEN;
549 547
550 if ((end - pos) < 12) { 548 if ((end - pos) < 12) {
@@ -1151,7 +1149,6 @@ static int lbs_ret_80211_scan(struct lbs_private *priv, unsigned long dummy,
1151 struct bss_descriptor new; 1149 struct bss_descriptor new;
1152 struct bss_descriptor *found = NULL; 1150 struct bss_descriptor *found = NULL;
1153 struct bss_descriptor *oldest = NULL; 1151 struct bss_descriptor *oldest = NULL;
1154 DECLARE_MAC_BUF(mac);
1155 1152
1156 /* Process the data fields and IEs returned for this BSS */ 1153 /* Process the data fields and IEs returned for this BSS */
1157 memset(&new, 0, sizeof (struct bss_descriptor)); 1154 memset(&new, 0, sizeof (struct bss_descriptor));
@@ -1190,7 +1187,7 @@ static int lbs_ret_80211_scan(struct lbs_private *priv, unsigned long dummy,
1190 continue; 1187 continue;
1191 } 1188 }
1192 1189
1193 lbs_deb_scan("SCAN_RESP: BSSID %s\n", print_mac(mac, new.bssid)); 1190 lbs_deb_scan("SCAN_RESP: BSSID %pM\n", new.bssid);
1194 1191
1195 /* Copy the locally created newbssentry to the scan table */ 1192 /* Copy the locally created newbssentry to the scan table */
1196 memcpy(found, &new, offsetof(struct bss_descriptor, list)); 1193 memcpy(found, &new, offsetof(struct bss_descriptor, list));
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c
index 82c3e5a50ea6..04f0bf2ef0a8 100644
--- a/drivers/net/wireless/libertas/wext.c
+++ b/drivers/net/wireless/libertas/wext.c
@@ -2104,7 +2104,6 @@ static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info,
2104 struct lbs_private *priv = dev->priv; 2104 struct lbs_private *priv = dev->priv;
2105 struct assoc_request * assoc_req; 2105 struct assoc_request * assoc_req;
2106 int ret = 0; 2106 int ret = 0;
2107 DECLARE_MAC_BUF(mac);
2108 2107
2109 lbs_deb_enter(LBS_DEB_WEXT); 2108 lbs_deb_enter(LBS_DEB_WEXT);
2110 2109
@@ -2114,7 +2113,7 @@ static int lbs_set_wap(struct net_device *dev, struct iw_request_info *info,
2114 if (awrq->sa_family != ARPHRD_ETHER) 2113 if (awrq->sa_family != ARPHRD_ETHER)
2115 return -EINVAL; 2114 return -EINVAL;
2116 2115
2117 lbs_deb_wext("ASSOC: WAP: sa_data %s\n", print_mac(mac, awrq->sa_data)); 2116 lbs_deb_wext("ASSOC: WAP: sa_data %pM\n", awrq->sa_data);
2118 2117
2119 mutex_lock(&priv->lock); 2118 mutex_lock(&priv->lock);
2120 2119
diff --git a/drivers/net/wireless/libertas_tf/cmd.c b/drivers/net/wireless/libertas_tf/cmd.c
index fdbcf8ba3e8a..3d3914c83b14 100644
--- a/drivers/net/wireless/libertas_tf/cmd.c
+++ b/drivers/net/wireless/libertas_tf/cmd.c
@@ -79,7 +79,6 @@ int lbtf_update_hw_spec(struct lbtf_private *priv)
79 struct cmd_ds_get_hw_spec cmd; 79 struct cmd_ds_get_hw_spec cmd;
80 int ret = -1; 80 int ret = -1;
81 u32 i; 81 u32 i;
82 DECLARE_MAC_BUF(mac);
83 82
84 memset(&cmd, 0, sizeof(cmd)); 83 memset(&cmd, 0, sizeof(cmd));
85 cmd.hdr.size = cpu_to_le16(sizeof(cmd)); 84 cmd.hdr.size = cpu_to_le16(sizeof(cmd));
@@ -96,8 +95,8 @@ int lbtf_update_hw_spec(struct lbtf_private *priv)
96 priv->fwrelease = (priv->fwrelease << 8) | 95 priv->fwrelease = (priv->fwrelease << 8) |
97 (priv->fwrelease >> 24 & 0xff); 96 (priv->fwrelease >> 24 & 0xff);
98 97
99 printk(KERN_INFO "libertastf: %s, fw %u.%u.%up%u, cap 0x%08x\n", 98 printk(KERN_INFO "libertastf: %pM, fw %u.%u.%up%u, cap 0x%08x\n",
100 print_mac(mac, cmd.permanentaddr), 99 cmd.permanentaddr,
101 priv->fwrelease >> 24 & 0xff, 100 priv->fwrelease >> 24 & 0xff,
102 priv->fwrelease >> 16 & 0xff, 101 priv->fwrelease >> 16 & 0xff,
103 priv->fwrelease >> 8 & 0xff, 102 priv->fwrelease >> 8 & 0xff,
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 1a019e98dac3..88c5eec0607c 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -301,10 +301,9 @@ static void mac80211_hwsim_stop(struct ieee80211_hw *hw)
301static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw, 301static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw,
302 struct ieee80211_if_init_conf *conf) 302 struct ieee80211_if_init_conf *conf)
303{ 303{
304 DECLARE_MAC_BUF(mac); 304 printk(KERN_DEBUG "%s:%s (type=%d mac_addr=%pM)\n",
305 printk(KERN_DEBUG "%s:%s (type=%d mac_addr=%s)\n",
306 wiphy_name(hw->wiphy), __func__, conf->type, 305 wiphy_name(hw->wiphy), __func__, conf->type,
307 print_mac(mac, conf->mac_addr)); 306 conf->mac_addr);
308 hwsim_set_magic(conf->vif); 307 hwsim_set_magic(conf->vif);
309 return 0; 308 return 0;
310} 309}
@@ -313,10 +312,9 @@ static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw,
313static void mac80211_hwsim_remove_interface( 312static void mac80211_hwsim_remove_interface(
314 struct ieee80211_hw *hw, struct ieee80211_if_init_conf *conf) 313 struct ieee80211_hw *hw, struct ieee80211_if_init_conf *conf)
315{ 314{
316 DECLARE_MAC_BUF(mac); 315 printk(KERN_DEBUG "%s:%s (type=%d mac_addr=%pM)\n",
317 printk(KERN_DEBUG "%s:%s (type=%d mac_addr=%s)\n",
318 wiphy_name(hw->wiphy), __func__, conf->type, 316 wiphy_name(hw->wiphy), __func__, conf->type,
319 print_mac(mac, conf->mac_addr)); 317 conf->mac_addr);
320 hwsim_check_magic(conf->vif); 318 hwsim_check_magic(conf->vif);
321 hwsim_clear_magic(conf->vif); 319 hwsim_clear_magic(conf->vif);
322} 320}
@@ -505,7 +503,6 @@ static int __init init_mac80211_hwsim(void)
505 u8 addr[ETH_ALEN]; 503 u8 addr[ETH_ALEN];
506 struct mac80211_hwsim_data *data; 504 struct mac80211_hwsim_data *data;
507 struct ieee80211_hw *hw; 505 struct ieee80211_hw *hw;
508 DECLARE_MAC_BUF(mac);
509 506
510 if (radios < 1 || radios > 100) 507 if (radios < 1 || radios > 100)
511 return -EINVAL; 508 return -EINVAL;
@@ -588,9 +585,9 @@ static int __init init_mac80211_hwsim(void)
588 goto failed_hw; 585 goto failed_hw;
589 } 586 }
590 587
591 printk(KERN_DEBUG "%s: hwaddr %s registered\n", 588 printk(KERN_DEBUG "%s: hwaddr %pM registered\n",
592 wiphy_name(hw->wiphy), 589 wiphy_name(hw->wiphy),
593 print_mac(mac, hw->wiphy->perm_addr)); 590 hw->wiphy->perm_addr);
594 591
595 setup_timer(&data->beacon_timer, mac80211_hwsim_beacon, 592 setup_timer(&data->beacon_timer, mac80211_hwsim_beacon,
596 (unsigned long) hw); 593 (unsigned long) hw);
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c
index a670f36b5f3f..be80c0093b79 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/net/wireless/netwave_cs.c
@@ -737,7 +737,6 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
737 win_req_t req; 737 win_req_t req;
738 memreq_t mem; 738 memreq_t mem;
739 u_char __iomem *ramBase = NULL; 739 u_char __iomem *ramBase = NULL;
740 DECLARE_MAC_BUF(mac);
741 740
742 DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link); 741 DEBUG(0, "netwave_pcmcia_config(0x%p)\n", link);
743 742
@@ -808,12 +807,12 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
808 dev->dev_addr[i] = readb(ramBase + NETWAVE_EREG_PA + i); 807 dev->dev_addr[i] = readb(ramBase + NETWAVE_EREG_PA + i);
809 808
810 printk(KERN_INFO "%s: Netwave: port %#3lx, irq %d, mem %lx, " 809 printk(KERN_INFO "%s: Netwave: port %#3lx, irq %d, mem %lx, "
811 "id %c%c, hw_addr %s\n", 810 "id %c%c, hw_addr %pM\n",
812 dev->name, dev->base_addr, dev->irq, 811 dev->name, dev->base_addr, dev->irq,
813 (u_long) ramBase, 812 (u_long) ramBase,
814 (int) readb(ramBase+NETWAVE_EREG_NI), 813 (int) readb(ramBase+NETWAVE_EREG_NI),
815 (int) readb(ramBase+NETWAVE_EREG_NI+1), 814 (int) readb(ramBase+NETWAVE_EREG_NI+1),
816 print_mac(mac, dev->dev_addr)); 815 dev->dev_addr);
817 816
818 /* get revision words */ 817 /* get revision words */
819 printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n", 818 printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n",
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c
index e0512e49d6d3..366556fafaee 100644
--- a/drivers/net/wireless/orinoco.c
+++ b/drivers/net/wireless/orinoco.c
@@ -1477,12 +1477,11 @@ static void orinoco_rx(struct net_device *dev,
1477 MICHAEL_MIC_LEN)) { 1477 MICHAEL_MIC_LEN)) {
1478 union iwreq_data wrqu; 1478 union iwreq_data wrqu;
1479 struct iw_michaelmicfailure wxmic; 1479 struct iw_michaelmicfailure wxmic;
1480 DECLARE_MAC_BUF(mac);
1481 1480
1482 printk(KERN_WARNING "%s: " 1481 printk(KERN_WARNING "%s: "
1483 "Invalid Michael MIC in data frame from %s, " 1482 "Invalid Michael MIC in data frame from %pM, "
1484 "using key %i\n", 1483 "using key %i\n",
1485 dev->name, print_mac(mac, src), key_id); 1484 dev->name, src, key_id);
1486 1485
1487 /* TODO: update stats */ 1486 /* TODO: update stats */
1488 1487
@@ -3277,7 +3276,6 @@ static int orinoco_init(struct net_device *dev)
3277 struct hermes_idstring nickbuf; 3276 struct hermes_idstring nickbuf;
3278 u16 reclen; 3277 u16 reclen;
3279 int len; 3278 int len;
3280 DECLARE_MAC_BUF(mac);
3281 3279
3282 /* No need to lock, the hw_unavailable flag is already set in 3280 /* No need to lock, the hw_unavailable flag is already set in
3283 * alloc_orinocodev() */ 3281 * alloc_orinocodev() */
@@ -3348,8 +3346,8 @@ static int orinoco_init(struct net_device *dev)
3348 goto out; 3346 goto out;
3349 } 3347 }
3350 3348
3351 printk(KERN_DEBUG "%s: MAC address %s\n", 3349 printk(KERN_DEBUG "%s: MAC address %pM\n",
3352 dev->name, print_mac(mac, dev->dev_addr)); 3350 dev->name, dev->dev_addr);
3353 3351
3354 /* Get the station name */ 3352 /* Get the station name */
3355 err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME, 3353 err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME,
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c
index 827ca0384a4c..6370c44c64d5 100644
--- a/drivers/net/wireless/p54/p54common.c
+++ b/drivers/net/wireless/p54/p54common.c
@@ -320,7 +320,6 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
320 int err; 320 int err;
321 u8 *end = (u8 *)eeprom + len; 321 u8 *end = (u8 *)eeprom + len;
322 u16 synth = 0; 322 u16 synth = 0;
323 DECLARE_MAC_BUF(mac);
324 323
325 wrap = (struct eeprom_pda_wrap *) eeprom; 324 wrap = (struct eeprom_pda_wrap *) eeprom;
326 entry = (void *)wrap->data + le16_to_cpu(wrap->len); 325 entry = (void *)wrap->data + le16_to_cpu(wrap->len);
@@ -446,9 +445,9 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len)
446 SET_IEEE80211_PERM_ADDR(dev, perm_addr); 445 SET_IEEE80211_PERM_ADDR(dev, perm_addr);
447 } 446 }
448 447
449 printk(KERN_INFO "%s: hwaddr %s, MAC:isl38%02x RF:%s\n", 448 printk(KERN_INFO "%s: hwaddr %pM, MAC:isl38%02x RF:%s\n",
450 wiphy_name(dev->wiphy), 449 wiphy_name(dev->wiphy),
451 print_mac(mac, dev->wiphy->perm_addr), 450 dev->wiphy->perm_addr,
452 priv->version, p54_rf_chips[priv->rxhw]); 451 priv->version, p54_rf_chips[priv->rxhw]);
453 452
454 return 0; 453 return 0;
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c
index 88b3cad8b65e..bba2c90e533f 100644
--- a/drivers/net/wireless/p54/p54pci.c
+++ b/drivers/net/wireless/p54/p54pci.c
@@ -481,7 +481,6 @@ static int __devinit p54p_probe(struct pci_dev *pdev,
481 struct ieee80211_hw *dev; 481 struct ieee80211_hw *dev;
482 unsigned long mem_addr, mem_len; 482 unsigned long mem_addr, mem_len;
483 int err; 483 int err;
484 DECLARE_MAC_BUF(mac);
485 484
486 err = pci_enable_device(pdev); 485 err = pci_enable_device(pdev);
487 if (err) { 486 if (err) {
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 75d749bccb0d..68f1b80f04d9 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -786,7 +786,6 @@ static int __devinit p54u_probe(struct usb_interface *intf,
786 struct p54u_priv *priv; 786 struct p54u_priv *priv;
787 int err; 787 int err;
788 unsigned int i, recognized_pipes; 788 unsigned int i, recognized_pipes;
789 DECLARE_MAC_BUF(mac);
790 789
791 dev = p54_init_common(sizeof(*priv)); 790 dev = p54_init_common(sizeof(*priv));
792 if (!dev) { 791 if (!dev) {
diff --git a/drivers/net/wireless/prism54/isl_ioctl.c b/drivers/net/wireless/prism54/isl_ioctl.c
index 16e68f4b654a..57a150a22de5 100644
--- a/drivers/net/wireless/prism54/isl_ioctl.c
+++ b/drivers/net/wireless/prism54/isl_ioctl.c
@@ -2028,12 +2028,11 @@ static void
2028format_event(islpci_private *priv, char *dest, const char *str, 2028format_event(islpci_private *priv, char *dest, const char *str,
2029 const struct obj_mlme *mlme, u16 *length, int error) 2029 const struct obj_mlme *mlme, u16 *length, int error)
2030{ 2030{
2031 DECLARE_MAC_BUF(mac);
2032 int n = snprintf(dest, IW_CUSTOM_MAX, 2031 int n = snprintf(dest, IW_CUSTOM_MAX,
2033 "%s %s %s %s (%2.2X)", 2032 "%s %s %pM %s (%2.2X)",
2034 str, 2033 str,
2035 ((priv->iw_mode == IW_MODE_MASTER) ? "from" : "to"), 2034 ((priv->iw_mode == IW_MODE_MASTER) ? "from" : "to"),
2036 print_mac(mac, mlme->address), 2035 mlme->address,
2037 (error ? (mlme->code ? " : REJECTED " : " : ACCEPTED ") 2036 (error ? (mlme->code ? " : REJECTED " : " : ACCEPTED ")
2038 : ""), mlme->code); 2037 : ""), mlme->code);
2039 BUG_ON(n > IW_CUSTOM_MAX); 2038 BUG_ON(n > IW_CUSTOM_MAX);
@@ -2113,7 +2112,6 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid,
2113{ 2112{
2114 struct list_head *ptr; 2113 struct list_head *ptr;
2115 struct islpci_bss_wpa_ie *bss = NULL; 2114 struct islpci_bss_wpa_ie *bss = NULL;
2116 DECLARE_MAC_BUF(mac);
2117 2115
2118 if (wpa_ie_len > MAX_WPA_IE_LEN) 2116 if (wpa_ie_len > MAX_WPA_IE_LEN)
2119 wpa_ie_len = MAX_WPA_IE_LEN; 2117 wpa_ie_len = MAX_WPA_IE_LEN;
@@ -2154,7 +2152,7 @@ prism54_wpa_bss_ie_add(islpci_private *priv, u8 *bssid,
2154 bss->last_update = jiffies; 2152 bss->last_update = jiffies;
2155 } else { 2153 } else {
2156 printk(KERN_DEBUG "Failed to add BSS WPA entry for " 2154 printk(KERN_DEBUG "Failed to add BSS WPA entry for "
2157 "%s\n", print_mac(mac, bssid)); 2155 "%pM\n", bssid);
2158 } 2156 }
2159 2157
2160 /* expire old entries from WPA list */ 2158 /* expire old entries from WPA list */
@@ -2219,7 +2217,6 @@ prism54_process_bss_data(islpci_private *priv, u32 oid, u8 *addr,
2219{ 2217{
2220 struct ieee80211_beacon_phdr *hdr; 2218 struct ieee80211_beacon_phdr *hdr;
2221 u8 *pos, *end; 2219 u8 *pos, *end;
2222 DECLARE_MAC_BUF(mac);
2223 2220
2224 if (!priv->wpa) 2221 if (!priv->wpa)
2225 return; 2222 return;
@@ -2230,7 +2227,7 @@ prism54_process_bss_data(islpci_private *priv, u32 oid, u8 *addr,
2230 while (pos < end) { 2227 while (pos < end) {
2231 if (pos + 2 + pos[1] > end) { 2228 if (pos + 2 + pos[1] > end) {
2232 printk(KERN_DEBUG "Parsing Beacon/ProbeResp failed " 2229 printk(KERN_DEBUG "Parsing Beacon/ProbeResp failed "
2233 "for %s\n", print_mac(mac, addr)); 2230 "for %pM\n", addr);
2234 return; 2231 return;
2235 } 2232 }
2236 if (pos[0] == WLAN_EID_GENERIC && pos[1] >= 4 && 2233 if (pos[0] == WLAN_EID_GENERIC && pos[1] >= 4 &&
@@ -2269,7 +2266,6 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2269 size_t len = 0; /* u16, better? */ 2266 size_t len = 0; /* u16, better? */
2270 u8 *payload = NULL, *pos = NULL; 2267 u8 *payload = NULL, *pos = NULL;
2271 int ret; 2268 int ret;
2272 DECLARE_MAC_BUF(mac);
2273 2269
2274 /* I think all trapable objects are listed here. 2270 /* I think all trapable objects are listed here.
2275 * Some oids have a EX version. The difference is that they are emitted 2271 * Some oids have a EX version. The difference is that they are emitted
@@ -2358,8 +2354,8 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2358 break; 2354 break;
2359 2355
2360 memcpy(&confirm->address, mlmeex->address, ETH_ALEN); 2356 memcpy(&confirm->address, mlmeex->address, ETH_ALEN);
2361 printk(KERN_DEBUG "Authenticate from: address:\t%s\n", 2357 printk(KERN_DEBUG "Authenticate from: address:\t%pM\n",
2362 print_mac(mac, mlmeex->address)); 2358 mlmeex->address);
2363 confirm->id = -1; /* or mlmeex->id ? */ 2359 confirm->id = -1; /* or mlmeex->id ? */
2364 confirm->state = 0; /* not used */ 2360 confirm->state = 0; /* not used */
2365 confirm->code = 0; 2361 confirm->code = 0;
@@ -2404,8 +2400,8 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2404 wpa_ie_len = prism54_wpa_bss_ie_get(priv, mlmeex->address, wpa_ie); 2400 wpa_ie_len = prism54_wpa_bss_ie_get(priv, mlmeex->address, wpa_ie);
2405 2401
2406 if (!wpa_ie_len) { 2402 if (!wpa_ie_len) {
2407 printk(KERN_DEBUG "No WPA IE found from address:\t%s\n", 2403 printk(KERN_DEBUG "No WPA IE found from address:\t%pM\n",
2408 print_mac(mac, mlmeex->address)); 2404 mlmeex->address);
2409 kfree(confirm); 2405 kfree(confirm);
2410 break; 2406 break;
2411 } 2407 }
@@ -2441,8 +2437,8 @@ prism54_process_trap_helper(islpci_private *priv, enum oid_num_t oid,
2441 wpa_ie_len = prism54_wpa_bss_ie_get(priv, mlmeex->address, wpa_ie); 2437 wpa_ie_len = prism54_wpa_bss_ie_get(priv, mlmeex->address, wpa_ie);
2442 2438
2443 if (!wpa_ie_len) { 2439 if (!wpa_ie_len) {
2444 printk(KERN_DEBUG "No WPA IE found from address:\t%s\n", 2440 printk(KERN_DEBUG "No WPA IE found from address:\t%pM\n",
2445 print_mac(mac, mlmeex->address)); 2441 mlmeex->address);
2446 kfree(confirm); 2442 kfree(confirm);
2447 break; 2443 break;
2448 } 2444 }
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 1404a5717520..bf0b9299b5df 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -414,7 +414,6 @@ static int ray_config(struct pcmcia_device *link)
414 memreq_t mem; 414 memreq_t mem;
415 struct net_device *dev = (struct net_device *)link->priv; 415 struct net_device *dev = (struct net_device *)link->priv;
416 ray_dev_t *local = netdev_priv(dev); 416 ray_dev_t *local = netdev_priv(dev);
417 DECLARE_MAC_BUF(mac);
418 417
419 DEBUG(1, "ray_config(0x%p)\n", link); 418 DEBUG(1, "ray_config(0x%p)\n", link);
420 419
@@ -485,8 +484,8 @@ static int ray_config(struct pcmcia_device *link)
485 strcpy(local->node.dev_name, dev->name); 484 strcpy(local->node.dev_name, dev->name);
486 link->dev_node = &local->node; 485 link->dev_node = &local->node;
487 486
488 printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %s\n", 487 printk(KERN_INFO "%s: RayLink, irq %d, hw_addr %pM\n",
489 dev->name, dev->irq, print_mac(mac, dev->dev_addr)); 488 dev->name, dev->irq, dev->dev_addr);
490 489
491 return 0; 490 return 0;
492 491
@@ -2595,7 +2594,6 @@ static int ray_cs_proc_show(struct seq_file *m, void *v)
2595 UCHAR *p; 2594 UCHAR *p;
2596 struct freq_hop_element *pfh; 2595 struct freq_hop_element *pfh;
2597 UCHAR c[33]; 2596 UCHAR c[33];
2598 DECLARE_MAC_BUF(mac);
2599 2597
2600 link = this_device; 2598 link = this_device;
2601 if (!link) 2599 if (!link)
@@ -2623,8 +2621,7 @@ static int ray_cs_proc_show(struct seq_file *m, void *v)
2623 nettype[local->sparm.b5.a_network_type], c); 2621 nettype[local->sparm.b5.a_network_type], c);
2624 2622
2625 p = local->bss_id; 2623 p = local->bss_id;
2626 seq_printf(m, "BSSID = %s\n", 2624 seq_printf(m, "BSSID = %pM\n", p);
2627 print_mac(mac, p));
2628 2625
2629 seq_printf(m, "Country code = %d\n", 2626 seq_printf(m, "Country code = %d\n",
2630 local->sparm.b5.a_curr_country_code); 2627 local->sparm.b5.a_curr_country_code);
diff --git a/drivers/net/wireless/rndis_wlan.c b/drivers/net/wireless/rndis_wlan.c
index 2b414899dfa0..bd059e3c7e2b 100644
--- a/drivers/net/wireless/rndis_wlan.c
+++ b/drivers/net/wireless/rndis_wlan.c
@@ -1276,12 +1276,11 @@ static int rndis_iw_get_bssid(struct net_device *dev,
1276 struct usbnet *usbdev = dev->priv; 1276 struct usbnet *usbdev = dev->priv;
1277 unsigned char bssid[ETH_ALEN]; 1277 unsigned char bssid[ETH_ALEN];
1278 int ret; 1278 int ret;
1279 DECLARE_MAC_BUF(mac);
1280 1279
1281 ret = get_bssid(usbdev, bssid); 1280 ret = get_bssid(usbdev, bssid);
1282 1281
1283 if (ret == 0) 1282 if (ret == 0)
1284 devdbg(usbdev, "SIOCGIWAP: %s", print_mac(mac, bssid)); 1283 devdbg(usbdev, "SIOCGIWAP: %pM", bssid);
1285 else 1284 else
1286 devdbg(usbdev, "SIOCGIWAP: <not associated>"); 1285 devdbg(usbdev, "SIOCGIWAP: <not associated>");
1287 1286
@@ -1297,10 +1296,9 @@ static int rndis_iw_set_bssid(struct net_device *dev,
1297{ 1296{
1298 struct usbnet *usbdev = dev->priv; 1297 struct usbnet *usbdev = dev->priv;
1299 u8 *bssid = (u8 *)wrqu->ap_addr.sa_data; 1298 u8 *bssid = (u8 *)wrqu->ap_addr.sa_data;
1300 DECLARE_MAC_BUF(mac);
1301 int ret; 1299 int ret;
1302 1300
1303 devdbg(usbdev, "SIOCSIWAP: %s", print_mac(mac, bssid)); 1301 devdbg(usbdev, "SIOCSIWAP: %pM", bssid);
1304 1302
1305 ret = rndis_set_oid(usbdev, OID_802_11_BSSID, bssid, ETH_ALEN); 1303 ret = rndis_set_oid(usbdev, OID_802_11_BSSID, bssid, ETH_ALEN);
1306 1304
@@ -1660,11 +1658,10 @@ static char *rndis_translate_scan(struct net_device *dev,
1660 u32 beacon, atim; 1658 u32 beacon, atim;
1661 struct iw_event iwe; 1659 struct iw_event iwe;
1662 unsigned char sbuf[32]; 1660 unsigned char sbuf[32];
1663 DECLARE_MAC_BUF(mac);
1664 1661
1665 bssid_len = le32_to_cpu(bssid->length); 1662 bssid_len = le32_to_cpu(bssid->length);
1666 1663
1667 devdbg(usbdev, "BSSID %s", print_mac(mac, bssid->mac)); 1664 devdbg(usbdev, "BSSID %pM", bssid->mac);
1668 iwe.cmd = SIOCGIWAP; 1665 iwe.cmd = SIOCGIWAP;
1669 iwe.u.ap_addr.sa_family = ARPHRD_ETHER; 1666 iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
1670 memcpy(iwe.u.ap_addr.sa_data, bssid->mac, ETH_ALEN); 1667 memcpy(iwe.u.ap_addr.sa_data, bssid->mac, ETH_ALEN);
diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c
index 08cb9eec16a6..96eaf5f4dc68 100644
--- a/drivers/net/wireless/rt2x00/rt2400pci.c
+++ b/drivers/net/wireless/rt2x00/rt2400pci.c
@@ -1313,10 +1313,8 @@ static int rt2400pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
1313 */ 1313 */
1314 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); 1314 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
1315 if (!is_valid_ether_addr(mac)) { 1315 if (!is_valid_ether_addr(mac)) {
1316 DECLARE_MAC_BUF(macbuf);
1317
1318 random_ether_addr(mac); 1316 random_ether_addr(mac);
1319 EEPROM(rt2x00dev, "MAC: %s\n", print_mac(macbuf, mac)); 1317 EEPROM(rt2x00dev, "MAC: %pM\n", mac);
1320 } 1318 }
1321 1319
1322 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); 1320 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index ef42cc04a2d7..8b772ab613e4 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -1451,11 +1451,8 @@ static int rt2500pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
1451 */ 1451 */
1452 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); 1452 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
1453 if (!is_valid_ether_addr(mac)) { 1453 if (!is_valid_ether_addr(mac)) {
1454 DECLARE_MAC_BUF(macbuf);
1455
1456 random_ether_addr(mac); 1454 random_ether_addr(mac);
1457 EEPROM(rt2x00dev, "MAC: %s\n", 1455 EEPROM(rt2x00dev, "MAC: %pM\n", mac);
1458 print_mac(macbuf, mac));
1459 } 1456 }
1460 1457
1461 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); 1458 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index d3bf7bba611a..d19bee43861d 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -1319,10 +1319,8 @@ static int rt2500usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
1319 */ 1319 */
1320 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); 1320 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
1321 if (!is_valid_ether_addr(mac)) { 1321 if (!is_valid_ether_addr(mac)) {
1322 DECLARE_MAC_BUF(macbuf);
1323
1324 random_ether_addr(mac); 1322 random_ether_addr(mac);
1325 EEPROM(rt2x00dev, "MAC: %s\n", print_mac(macbuf, mac)); 1323 EEPROM(rt2x00dev, "MAC: %pM\n", mac);
1326 } 1324 }
1327 1325
1328 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); 1326 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index adf2876ed8ab..62449da577e5 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -222,8 +222,7 @@ static int rt2x00pci_alloc_reg(struct rt2x00_dev *rt2x00dev)
222{ 222{
223 struct pci_dev *pci_dev = to_pci_dev(rt2x00dev->dev); 223 struct pci_dev *pci_dev = to_pci_dev(rt2x00dev->dev);
224 224
225 rt2x00dev->csr.base = ioremap(pci_resource_start(pci_dev, 0), 225 rt2x00dev->csr.base = pci_ioremap_bar(pci_dev, 0);
226 pci_resource_len(pci_dev, 0));
227 if (!rt2x00dev->csr.base) 226 if (!rt2x00dev->csr.base)
228 goto exit; 227 goto exit;
229 228
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index a461620b489f..45f69f83552c 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2175,10 +2175,8 @@ static int rt61pci_validate_eeprom(struct rt2x00_dev *rt2x00dev)
2175 */ 2175 */
2176 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); 2176 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
2177 if (!is_valid_ether_addr(mac)) { 2177 if (!is_valid_ether_addr(mac)) {
2178 DECLARE_MAC_BUF(macbuf);
2179
2180 random_ether_addr(mac); 2178 random_ether_addr(mac);
2181 EEPROM(rt2x00dev, "MAC: %s\n", print_mac(macbuf, mac)); 2179 EEPROM(rt2x00dev, "MAC: %pM\n", mac);
2182 } 2180 }
2183 2181
2184 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); 2182 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 934f8e03c5aa..336fecb04c46 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -1781,10 +1781,8 @@ static int rt73usb_validate_eeprom(struct rt2x00_dev *rt2x00dev)
1781 */ 1781 */
1782 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0); 1782 mac = rt2x00_eeprom_addr(rt2x00dev, EEPROM_MAC_ADDR_0);
1783 if (!is_valid_ether_addr(mac)) { 1783 if (!is_valid_ether_addr(mac)) {
1784 DECLARE_MAC_BUF(macbuf);
1785
1786 random_ether_addr(mac); 1784 random_ether_addr(mac);
1787 EEPROM(rt2x00dev, "MAC: %s\n", print_mac(macbuf, mac)); 1785 EEPROM(rt2x00dev, "MAC: %pM\n", mac);
1788 } 1786 }
1789 1787
1790 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word); 1788 rt2x00_eeprom_read(rt2x00dev, EEPROM_ANTENNA, &word);
diff --git a/drivers/net/wireless/rtl8180_dev.c b/drivers/net/wireless/rtl8180_dev.c
index df7e78ee8a88..9de8f57486df 100644
--- a/drivers/net/wireless/rtl8180_dev.c
+++ b/drivers/net/wireless/rtl8180_dev.c
@@ -806,7 +806,6 @@ static int __devinit rtl8180_probe(struct pci_dev *pdev,
806 const char *chip_name, *rf_name = NULL; 806 const char *chip_name, *rf_name = NULL;
807 u32 reg; 807 u32 reg;
808 u16 eeprom_val; 808 u16 eeprom_val;
809 DECLARE_MAC_BUF(mac);
810 809
811 err = pci_enable_device(pdev); 810 err = pci_enable_device(pdev);
812 if (err) { 811 if (err) {
@@ -1002,8 +1001,8 @@ static int __devinit rtl8180_probe(struct pci_dev *pdev,
1002 goto err_iounmap; 1001 goto err_iounmap;
1003 } 1002 }
1004 1003
1005 printk(KERN_INFO "%s: hwaddr %s, %s + %s\n", 1004 printk(KERN_INFO "%s: hwaddr %pM, %s + %s\n",
1006 wiphy_name(dev->wiphy), print_mac(mac, dev->wiphy->perm_addr), 1005 wiphy_name(dev->wiphy), dev->wiphy->perm_addr,
1007 chip_name, priv->rf->name); 1006 chip_name, priv->rf->name);
1008 1007
1009 return 0; 1008 return 0;
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c
index 431e3c78bf27..9ceae9017f86 100644
--- a/drivers/net/wireless/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl8187_dev.c
@@ -1026,7 +1026,6 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
1026 const char *chip_name; 1026 const char *chip_name;
1027 u16 txpwr, reg; 1027 u16 txpwr, reg;
1028 int err, i; 1028 int err, i;
1029 DECLARE_MAC_BUF(mac);
1030 1029
1031 dev = ieee80211_alloc_hw(sizeof(*priv), &rtl8187_ops); 1030 dev = ieee80211_alloc_hw(sizeof(*priv), &rtl8187_ops);
1032 if (!dev) { 1031 if (!dev) {
@@ -1209,8 +1208,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
1209 } 1208 }
1210 mutex_init(&priv->conf_mutex); 1209 mutex_init(&priv->conf_mutex);
1211 1210
1212 printk(KERN_INFO "%s: hwaddr %s, %s V%d + %s\n", 1211 printk(KERN_INFO "%s: hwaddr %pM, %s V%d + %s\n",
1213 wiphy_name(dev->wiphy), print_mac(mac, dev->wiphy->perm_addr), 1212 wiphy_name(dev->wiphy), dev->wiphy->perm_addr,
1214 chip_name, priv->asic_rev, priv->rf->name); 1213 chip_name, priv->asic_rev, priv->rf->name);
1215 1214
1216 return 0; 1215 return 0;
diff --git a/drivers/net/wireless/wavelan.c b/drivers/net/wireless/wavelan.c
index e939a73ff794..6fa3d792ae27 100644
--- a/drivers/net/wireless/wavelan.c
+++ b/drivers/net/wireless/wavelan.c
@@ -859,8 +859,6 @@ static void wv_82586_reconfig(struct net_device * dev)
859 */ 859 */
860static void wv_psa_show(psa_t * p) 860static void wv_psa_show(psa_t * p)
861{ 861{
862 DECLARE_MAC_BUF(mac);
863
864 printk(KERN_DEBUG "##### WaveLAN PSA contents: #####\n"); 862 printk(KERN_DEBUG "##### WaveLAN PSA contents: #####\n");
865 printk(KERN_DEBUG "psa_io_base_addr_1: 0x%02X %02X %02X %02X\n", 863 printk(KERN_DEBUG "psa_io_base_addr_1: 0x%02X %02X %02X %02X\n",
866 p->psa_io_base_addr_1, 864 p->psa_io_base_addr_1,
@@ -872,13 +870,10 @@ static void wv_psa_show(psa_t * p)
872 printk(KERN_DEBUG "psa_holi_params: 0x%02x, ", p->psa_holi_params); 870 printk(KERN_DEBUG "psa_holi_params: 0x%02x, ", p->psa_holi_params);
873 printk("psa_int_req_no: %d\n", p->psa_int_req_no); 871 printk("psa_int_req_no: %d\n", p->psa_int_req_no);
874#ifdef DEBUG_SHOW_UNUSED 872#ifdef DEBUG_SHOW_UNUSED
875 printk(KERN_DEBUG "psa_unused0[]: %s\n", 873 printk(KERN_DEBUG "psa_unused0[]: %pM\n", p->psa_unused0);
876 print_mac(mac, p->psa_unused0));
877#endif /* DEBUG_SHOW_UNUSED */ 874#endif /* DEBUG_SHOW_UNUSED */
878 printk(KERN_DEBUG "psa_univ_mac_addr[]: %s\n", 875 printk(KERN_DEBUG "psa_univ_mac_addr[]: %pM\n", p->psa_univ_mac_addr);
879 print_mac(mac, p->psa_univ_mac_addr)); 876 printk(KERN_DEBUG "psa_local_mac_addr[]: %pM\n", p->psa_local_mac_addr);
880 printk(KERN_DEBUG "psa_local_mac_addr[]: %s\n",
881 print_mac(mac, p->psa_local_mac_addr));
882 printk(KERN_DEBUG "psa_univ_local_sel: %d, ", 877 printk(KERN_DEBUG "psa_univ_local_sel: %d, ",
883 p->psa_univ_local_sel); 878 p->psa_univ_local_sel);
884 printk("psa_comp_number: %d, ", p->psa_comp_number); 879 printk("psa_comp_number: %d, ", p->psa_comp_number);
@@ -1220,14 +1215,13 @@ static inline void wv_packet_info(u8 * p, /* Packet to dump */
1220{ /* Name of the function */ 1215{ /* Name of the function */
1221 int i; 1216 int i;
1222 int maxi; 1217 int maxi;
1223 DECLARE_MAC_BUF(mac);
1224 1218
1225 printk(KERN_DEBUG 1219 printk(KERN_DEBUG
1226 "%s: %s(): dest %s, length %d\n", 1220 "%s: %s(): dest %pM, length %d\n",
1227 msg1, msg2, print_mac(mac, p), length); 1221 msg1, msg2, p, length);
1228 printk(KERN_DEBUG 1222 printk(KERN_DEBUG
1229 "%s: %s(): src %s, type 0x%02X%02X\n", 1223 "%s: %s(): src %pM, type 0x%02X%02X\n",
1230 msg1, msg2, print_mac(mac, &p[6]), p[12], p[13]); 1224 msg1, msg2, &p[6], p[12], p[13]);
1231 1225
1232#ifdef DEBUG_PACKET_DUMP 1226#ifdef DEBUG_PACKET_DUMP
1233 1227
@@ -1258,9 +1252,6 @@ static void wv_init_info(struct net_device * dev)
1258 short ioaddr = dev->base_addr; 1252 short ioaddr = dev->base_addr;
1259 net_local *lp = (net_local *) dev->priv; 1253 net_local *lp = (net_local *) dev->priv;
1260 psa_t psa; 1254 psa_t psa;
1261#ifdef DEBUG_BASIC_SHOW
1262 DECLARE_MAC_BUF(mac);
1263#endif
1264 1255
1265 /* Read the parameter storage area */ 1256 /* Read the parameter storage area */
1266 psa_read(ioaddr, lp->hacr, 0, (unsigned char *) &psa, sizeof(psa)); 1257 psa_read(ioaddr, lp->hacr, 0, (unsigned char *) &psa, sizeof(psa));
@@ -1277,8 +1268,8 @@ static void wv_init_info(struct net_device * dev)
1277 1268
1278#ifdef DEBUG_BASIC_SHOW 1269#ifdef DEBUG_BASIC_SHOW
1279 /* Now, let's go for the basic stuff. */ 1270 /* Now, let's go for the basic stuff. */
1280 printk(KERN_NOTICE "%s: WaveLAN at %#x, %s, IRQ %d", 1271 printk(KERN_NOTICE "%s: WaveLAN at %#x, %pM, IRQ %d",
1281 dev->name, ioaddr, print_mac(mac, dev->dev_addr), dev->irq); 1272 dev->name, ioaddr, dev->dev_addr, dev->irq);
1282 1273
1283 /* Print current network ID. */ 1274 /* Print current network ID. */
1284 if (psa.psa_nwid_select) 1275 if (psa.psa_nwid_select)
@@ -3565,15 +3556,11 @@ static void wv_82586_config(struct net_device * dev)
3565 WAVELAN_ADDR_SIZE >> 1); 3556 WAVELAN_ADDR_SIZE >> 1);
3566 3557
3567#ifdef DEBUG_CONFIG_INFO 3558#ifdef DEBUG_CONFIG_INFO
3568 {
3569 DECLARE_MAC_BUF(mac);
3570 printk(KERN_DEBUG 3559 printk(KERN_DEBUG
3571 "%s: wv_82586_config(): set %d multicast addresses:\n", 3560 "%s: wv_82586_config(): set %d multicast addresses:\n",
3572 dev->name, lp->mc_count); 3561 dev->name, lp->mc_count);
3573 for (dmi = dev->mc_list; dmi; dmi = dmi->next) 3562 for (dmi = dev->mc_list; dmi; dmi = dmi->next)
3574 printk(KERN_DEBUG " %s\n", 3563 printk(KERN_DEBUG " %pM\n", dmi->dmi_addr);
3575 print_mac(mac, dmi->dmi_addr));
3576 }
3577#endif 3564#endif
3578 } 3565 }
3579 3566
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index e124b1d6267a..0a3bacc20d96 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -1020,7 +1020,6 @@ wv_82593_reconfig(struct net_device * dev)
1020static void 1020static void
1021wv_psa_show(psa_t * p) 1021wv_psa_show(psa_t * p)
1022{ 1022{
1023 DECLARE_MAC_BUF(mac);
1024 printk(KERN_DEBUG "##### wavelan psa contents: #####\n"); 1023 printk(KERN_DEBUG "##### wavelan psa contents: #####\n");
1025 printk(KERN_DEBUG "psa_io_base_addr_1: 0x%02X %02X %02X %02X\n", 1024 printk(KERN_DEBUG "psa_io_base_addr_1: 0x%02X %02X %02X %02X\n",
1026 p->psa_io_base_addr_1, 1025 p->psa_io_base_addr_1,
@@ -1034,13 +1033,10 @@ wv_psa_show(psa_t * p)
1034 printk(KERN_DEBUG "psa_holi_params: 0x%02x, ", p->psa_holi_params); 1033 printk(KERN_DEBUG "psa_holi_params: 0x%02x, ", p->psa_holi_params);
1035 printk("psa_int_req_no: %d\n", p->psa_int_req_no); 1034 printk("psa_int_req_no: %d\n", p->psa_int_req_no);
1036#ifdef DEBUG_SHOW_UNUSED 1035#ifdef DEBUG_SHOW_UNUSED
1037 printk(KERN_DEBUG "psa_unused0[]: %s\n", 1036 printk(KERN_DEBUG "psa_unused0[]: %pM\n", p->psa_unused0);
1038 print_mac(mac, p->psa_unused0));
1039#endif /* DEBUG_SHOW_UNUSED */ 1037#endif /* DEBUG_SHOW_UNUSED */
1040 printk(KERN_DEBUG "psa_univ_mac_addr[]: %s\n", 1038 printk(KERN_DEBUG "psa_univ_mac_addr[]: %pM\n", p->psa_univ_mac_addr);
1041 print_mac(mac, p->psa_univ_mac_addr)); 1039 printk(KERN_DEBUG "psa_local_mac_addr[]: %pM\n", p->psa_local_mac_addr);
1042 printk(KERN_DEBUG "psa_local_mac_addr[]: %s\n",
1043 print_mac(mac, p->psa_local_mac_addr));
1044 printk(KERN_DEBUG "psa_univ_local_sel: %d, ", p->psa_univ_local_sel); 1040 printk(KERN_DEBUG "psa_univ_local_sel: %d, ", p->psa_univ_local_sel);
1045 printk("psa_comp_number: %d, ", p->psa_comp_number); 1041 printk("psa_comp_number: %d, ", p->psa_comp_number);
1046 printk("psa_thr_pre_set: 0x%02x\n", p->psa_thr_pre_set); 1042 printk("psa_thr_pre_set: 0x%02x\n", p->psa_thr_pre_set);
@@ -1238,12 +1234,11 @@ wv_packet_info(u_char * p, /* Packet to dump */
1238{ 1234{
1239 int i; 1235 int i;
1240 int maxi; 1236 int maxi;
1241 DECLARE_MAC_BUF(mac);
1242 1237
1243 printk(KERN_DEBUG "%s: %s(): dest %s, length %d\n", 1238 printk(KERN_DEBUG "%s: %s(): dest %pM, length %d\n",
1244 msg1, msg2, print_mac(mac, p), length); 1239 msg1, msg2, p, length);
1245 printk(KERN_DEBUG "%s: %s(): src %s, type 0x%02X%02X\n", 1240 printk(KERN_DEBUG "%s: %s(): src %pM, type 0x%02X%02X\n",
1246 msg1, msg2, print_mac(mac, &p[6]), p[12], p[13]); 1241 msg1, msg2, &p[6], p[12], p[13]);
1247 1242
1248#ifdef DEBUG_PACKET_DUMP 1243#ifdef DEBUG_PACKET_DUMP
1249 1244
@@ -1274,7 +1269,6 @@ wv_init_info(struct net_device * dev)
1274{ 1269{
1275 unsigned int base = dev->base_addr; 1270 unsigned int base = dev->base_addr;
1276 psa_t psa; 1271 psa_t psa;
1277 DECLARE_MAC_BUF(mac);
1278 1272
1279 /* Read the parameter storage area */ 1273 /* Read the parameter storage area */
1280 psa_read(dev, 0, (unsigned char *) &psa, sizeof(psa)); 1274 psa_read(dev, 0, (unsigned char *) &psa, sizeof(psa));
@@ -1291,10 +1285,8 @@ wv_init_info(struct net_device * dev)
1291 1285
1292#ifdef DEBUG_BASIC_SHOW 1286#ifdef DEBUG_BASIC_SHOW
1293 /* Now, let's go for the basic stuff */ 1287 /* Now, let's go for the basic stuff */
1294 printk(KERN_NOTICE "%s: WaveLAN: port %#x, irq %d, " 1288 printk(KERN_NOTICE "%s: WaveLAN: port %#x, irq %d, hw_addr %pM",
1295 "hw_addr %s", 1289 dev->name, base, dev->irq, dev->dev_addr);
1296 dev->name, base, dev->irq,
1297 print_mac(mac, dev->dev_addr));
1298 1290
1299 /* Print current network id */ 1291 /* Print current network id */
1300 if(psa.psa_nwid_select) 1292 if(psa.psa_nwid_select)
@@ -2243,13 +2235,7 @@ static int wavelan_set_wap(struct net_device *dev,
2243 char *extra) 2235 char *extra)
2244{ 2236{
2245#ifdef DEBUG_IOCTL_INFO 2237#ifdef DEBUG_IOCTL_INFO
2246 printk(KERN_DEBUG "Set AP to : %02X:%02X:%02X:%02X:%02X:%02X\n", 2238 printk(KERN_DEBUG "Set AP to : %pM\n", wrqu->ap_addr.sa_data);
2247 wrqu->ap_addr.sa_data[0],
2248 wrqu->ap_addr.sa_data[1],
2249 wrqu->ap_addr.sa_data[2],
2250 wrqu->ap_addr.sa_data[3],
2251 wrqu->ap_addr.sa_data[4],
2252 wrqu->ap_addr.sa_data[5]);
2253#endif /* DEBUG_IOCTL_INFO */ 2239#endif /* DEBUG_IOCTL_INFO */
2254 2240
2255 return -EOPNOTSUPP; 2241 return -EOPNOTSUPP;
@@ -3647,12 +3633,10 @@ wv_82593_config(struct net_device * dev)
3647 int addrs_len = WAVELAN_ADDR_SIZE * lp->mc_count; 3633 int addrs_len = WAVELAN_ADDR_SIZE * lp->mc_count;
3648 3634
3649#ifdef DEBUG_CONFIG_INFO 3635#ifdef DEBUG_CONFIG_INFO
3650 DECLARE_MAC_BUF(mac);
3651 printk(KERN_DEBUG "%s: wv_hw_config(): set %d multicast addresses:\n", 3636 printk(KERN_DEBUG "%s: wv_hw_config(): set %d multicast addresses:\n",
3652 dev->name, lp->mc_count); 3637 dev->name, lp->mc_count);
3653 for(dmi=dev->mc_list; dmi; dmi=dmi->next) 3638 for(dmi=dev->mc_list; dmi; dmi=dmi->next)
3654 printk(KERN_DEBUG " %s\n", 3639 printk(KERN_DEBUG " %pM\n", dmi->dmi_addr);
3655 print_mac(mac, dmi->dmi_addr));
3656#endif 3640#endif
3657 3641
3658 /* Initialize adapter's ethernet multicast addresses */ 3642 /* Initialize adapter's ethernet multicast addresses */
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 68789c6e1ce9..8b96f50d9c6f 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -860,10 +860,9 @@ static int wl3501_esbq_confirm(struct wl3501_card *this)
860static void wl3501_online(struct net_device *dev) 860static void wl3501_online(struct net_device *dev)
861{ 861{
862 struct wl3501_card *this = netdev_priv(dev); 862 struct wl3501_card *this = netdev_priv(dev);
863 DECLARE_MAC_BUF(mac);
864 863
865 printk(KERN_INFO "%s: Wireless LAN online. BSSID: %s\n", 864 printk(KERN_INFO "%s: Wireless LAN online. BSSID: %pM\n",
866 dev->name, print_mac(mac, this->bssid)); 865 dev->name, this->bssid);
867 netif_wake_queue(dev); 866 netif_wake_queue(dev);
868} 867}
869 868
@@ -1965,7 +1964,6 @@ static int wl3501_config(struct pcmcia_device *link)
1965 struct net_device *dev = link->priv; 1964 struct net_device *dev = link->priv;
1966 int i = 0, j, last_fn, last_ret; 1965 int i = 0, j, last_fn, last_ret;
1967 struct wl3501_card *this; 1966 struct wl3501_card *this;
1968 DECLARE_MAC_BUF(mac);
1969 1967
1970 /* Try allocating IO ports. This tries a few fixed addresses. If you 1968 /* Try allocating IO ports. This tries a few fixed addresses. If you
1971 * want, you can also read the card's config table to pick addresses -- 1969 * want, you can also read the card's config table to pick addresses --
@@ -2024,9 +2022,9 @@ static int wl3501_config(struct pcmcia_device *link)
2024 2022
2025 /* print probe information */ 2023 /* print probe information */
2026 printk(KERN_INFO "%s: wl3501 @ 0x%3.3x, IRQ %d, " 2024 printk(KERN_INFO "%s: wl3501 @ 0x%3.3x, IRQ %d, "
2027 "MAC addr in flash ROM:%s\n", 2025 "MAC addr in flash ROM:%pM\n",
2028 dev->name, this->base_addr, (int)dev->irq, 2026 dev->name, this->base_addr, (int)dev->irq,
2029 print_mac(mac, dev->dev_addr)); 2027 dev->dev_addr);
2030 /* 2028 /*
2031 * Initialize card parameters - added by jss 2029 * Initialize card parameters - added by jss
2032 */ 2030 */
diff --git a/drivers/net/wireless/zd1211rw/zd_chip.c b/drivers/net/wireless/zd1211rw/zd_chip.c
index e0ac58b8ff1f..f1519143f8a6 100644
--- a/drivers/net/wireless/zd1211rw/zd_chip.c
+++ b/drivers/net/wireless/zd1211rw/zd_chip.c
@@ -378,7 +378,6 @@ int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)
378 [0] = { .addr = CR_MAC_ADDR_P1 }, 378 [0] = { .addr = CR_MAC_ADDR_P1 },
379 [1] = { .addr = CR_MAC_ADDR_P2 }, 379 [1] = { .addr = CR_MAC_ADDR_P2 },
380 }; 380 };
381 DECLARE_MAC_BUF(mac);
382 381
383 if (mac_addr) { 382 if (mac_addr) {
384 reqs[0].value = (mac_addr[3] << 24) 383 reqs[0].value = (mac_addr[3] << 24)
@@ -387,8 +386,7 @@ int zd_write_mac_addr(struct zd_chip *chip, const u8 *mac_addr)
387 | mac_addr[0]; 386 | mac_addr[0];
388 reqs[1].value = (mac_addr[5] << 8) 387 reqs[1].value = (mac_addr[5] << 8)
389 | mac_addr[4]; 388 | mac_addr[4];
390 dev_dbg_f(zd_chip_dev(chip), 389 dev_dbg_f(zd_chip_dev(chip), "mac addr %pM\n", mac_addr);
391 "mac addr %s\n", print_mac(mac, mac_addr));
392 } else { 390 } else {
393 dev_dbg_f(zd_chip_dev(chip), "set NULL mac\n"); 391 dev_dbg_f(zd_chip_dev(chip), "set NULL mac\n");
394 } 392 }
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index fe1867b25ff7..de45509d757e 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -852,14 +852,12 @@ static void zd_op_configure_filter(struct ieee80211_hw *hw,
852 if (*new_flags & (FIF_PROMISC_IN_BSS | FIF_ALLMULTI)) { 852 if (*new_flags & (FIF_PROMISC_IN_BSS | FIF_ALLMULTI)) {
853 zd_mc_add_all(&hash); 853 zd_mc_add_all(&hash);
854 } else { 854 } else {
855 DECLARE_MAC_BUF(macbuf);
856
857 zd_mc_clear(&hash); 855 zd_mc_clear(&hash);
858 for (i = 0; i < mc_count; i++) { 856 for (i = 0; i < mc_count; i++) {
859 if (!mclist) 857 if (!mclist)
860 break; 858 break;
861 dev_dbg_f(zd_mac_dev(mac), "mc addr %s\n", 859 dev_dbg_f(zd_mac_dev(mac), "mc addr %pM\n",
862 print_mac(macbuf, mclist->dmi_addr)); 860 mclist->dmi_addr);
863 zd_mc_add_addr(&hash, mclist->dmi_addr); 861 zd_mc_add_addr(&hash, mclist->dmi_addr);
864 mclist = mclist->next; 862 mclist = mclist->next;
865 } 863 }
diff --git a/drivers/net/xtsonic.c b/drivers/net/xtsonic.c
index da42aa06a3ba..03a3f34e9039 100644
--- a/drivers/net/xtsonic.c
+++ b/drivers/net/xtsonic.c
@@ -239,8 +239,6 @@ int __init xtsonic_probe(struct platform_device *pdev)
239 struct resource *resmem, *resirq; 239 struct resource *resmem, *resirq;
240 int err = 0; 240 int err = 0;
241 241
242 DECLARE_MAC_BUF(mac);
243
244 if ((resmem = platform_get_resource(pdev, IORESOURCE_MEM, 0)) == NULL) 242 if ((resmem = platform_get_resource(pdev, IORESOURCE_MEM, 0)) == NULL)
245 return -ENODEV; 243 return -ENODEV;
246 244
@@ -263,8 +261,8 @@ int __init xtsonic_probe(struct platform_device *pdev)
263 if ((err = register_netdev(dev))) 261 if ((err = register_netdev(dev)))
264 goto out1; 262 goto out1;
265 263
266 printk("%s: SONIC ethernet @%08lx, MAC %s, IRQ %d\n", dev->name, 264 printk("%s: SONIC ethernet @%08lx, MAC %pM, IRQ %d\n", dev->name,
267 dev->base_addr, print_mac(mac, dev->dev_addr), dev->irq); 265 dev->base_addr, dev->dev_addr, dev->irq);
268 266
269 return 0; 267 return 0;
270 268
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index 57e1f495b9fc..511066688810 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -374,7 +374,6 @@ static int __devinit yellowfin_init_one(struct pci_dev *pdev,
374#else 374#else
375 int bar = 1; 375 int bar = 1;
376#endif 376#endif
377 DECLARE_MAC_BUF(mac);
378 377
379/* when built into the kernel, we only print version if device is found */ 378/* when built into the kernel, we only print version if device is found */
380#ifndef MODULE 379#ifndef MODULE
@@ -481,10 +480,10 @@ static int __devinit yellowfin_init_one(struct pci_dev *pdev,
481 if (i) 480 if (i)
482 goto err_out_unmap_status; 481 goto err_out_unmap_status;
483 482
484 printk(KERN_INFO "%s: %s type %8x at %p, %s, IRQ %d.\n", 483 printk(KERN_INFO "%s: %s type %8x at %p, %pM, IRQ %d.\n",
485 dev->name, pci_id_tbl[chip_idx].name, 484 dev->name, pci_id_tbl[chip_idx].name,
486 ioread32(ioaddr + ChipRev), ioaddr, 485 ioread32(ioaddr + ChipRev), ioaddr,
487 print_mac(mac, dev->dev_addr), irq); 486 dev->dev_addr, irq);
488 487
489 if (np->drv_flags & HasMII) { 488 if (np->drv_flags & HasMII) {
490 int phy, phy_idx = 0; 489 int phy, phy_idx = 0;
@@ -1100,11 +1099,9 @@ static int yellowfin_rx(struct net_device *dev)
1100 memcmp(le32_to_cpu(yp->rx_ring_dma + 1099 memcmp(le32_to_cpu(yp->rx_ring_dma +
1101 entry*sizeof(struct yellowfin_desc)), 1100 entry*sizeof(struct yellowfin_desc)),
1102 "\377\377\377\377\377\377", 6) != 0) { 1101 "\377\377\377\377\377\377", 6) != 0) {
1103 if (bogus_rx++ == 0) { 1102 if (bogus_rx++ == 0)
1104 DECLARE_MAC_BUF(mac); 1103 printk(KERN_WARNING "%s: Bad frame to %pM\n",
1105 printk(KERN_WARNING "%s: Bad frame to %s\n", 1104 dev->name, buf_addr);
1106 dev->name, print_mac(mac, buf_addr));
1107 }
1108#endif 1105#endif
1109 } else { 1106 } else {
1110 struct sk_buff *skb; 1107 struct sk_buff *skb;
diff --git a/drivers/net/znet.c b/drivers/net/znet.c
index a86c022d6a94..fc7a8849306f 100644
--- a/drivers/net/znet.c
+++ b/drivers/net/znet.c
@@ -370,7 +370,6 @@ static int __init znet_probe (void)
370 struct net_device *dev; 370 struct net_device *dev;
371 char *p; 371 char *p;
372 int err = -ENOMEM; 372 int err = -ENOMEM;
373 DECLARE_MAC_BUF(mac);
374 373
375 /* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */ 374 /* This code scans the region 0xf0000 to 0xfffff for a "NETIDBLK". */
376 for(p = (char *)phys_to_virt(0xf0000); p < (char *)phys_to_virt(0x100000); p++) 375 for(p = (char *)phys_to_virt(0xf0000); p < (char *)phys_to_virt(0x100000); p++)
@@ -397,9 +396,9 @@ static int __init znet_probe (void)
397 for (i = 0; i < 6; i++) 396 for (i = 0; i < 6; i++)
398 dev->dev_addr[i] = netinfo->netid[i]; 397 dev->dev_addr[i] = netinfo->netid[i];
399 398
400 printk(KERN_INFO "%s: ZNET at %#3lx, %s" 399 printk(KERN_INFO "%s: ZNET at %#3lx, %pM"
401 ", using IRQ %d DMA %d and %d.\n", 400 ", using IRQ %d DMA %d and %d.\n",
402 dev->name, dev->base_addr, print_mac(mac, dev->dev_addr), 401 dev->name, dev->base_addr, dev->dev_addr,
403 dev->irq, netinfo->dma1, netinfo->dma2); 402 dev->irq, netinfo->dma1, netinfo->dma2);
404 403
405 if (znet_debug > 1) { 404 if (znet_debug > 1) {
diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c
index 3926b2aa9cca..9c73df4a0d30 100644
--- a/drivers/net/zorro8390.c
+++ b/drivers/net/zorro8390.c
@@ -151,7 +151,6 @@ static int __devinit zorro8390_init(struct net_device *dev,
151 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 151 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e,
152 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, 152 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e,
153 }; 153 };
154 DECLARE_MAC_BUF(mac);
155 154
156 /* Reset card. Who knows what dain-bramaged state it was left in. */ 155 /* Reset card. Who knows what dain-bramaged state it was left in. */
157 { 156 {
@@ -216,7 +215,7 @@ static int __devinit zorro8390_init(struct net_device *dev,
216 dev->dev_addr[i] = SA_prom[i]; 215 dev->dev_addr[i] = SA_prom[i];
217 216
218#ifdef DEBUG 217#ifdef DEBUG
219 printk("%s", print_mac(mac, dev->dev_addr)); 218 printk("%pM", dev->dev_addr);
220#endif 219#endif
221 220
222 ei_status.name = name; 221 ei_status.name = name;
@@ -244,8 +243,8 @@ static int __devinit zorro8390_init(struct net_device *dev,
244 return err; 243 return err;
245 } 244 }
246 245
247 printk(KERN_INFO "%s: %s at 0x%08lx, Ethernet Address %s\n", 246 printk(KERN_INFO "%s: %s at 0x%08lx, Ethernet Address %pM\n",
248 dev->name, name, board, print_mac(mac, dev->dev_addr)); 247 dev->name, name, board, dev->dev_addr);
249 248
250 return 0; 249 return 0;
251} 250}
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 1b1e80336d2c..8a8fad7a8bea 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -131,17 +131,13 @@ static int qeth_l2_send_setgroupmac_cb(struct qeth_card *card,
131 mac = &cmd->data.setdelmac.mac[0]; 131 mac = &cmd->data.setdelmac.mac[0];
132 /* MAC already registered, needed in couple/uncouple case */ 132 /* MAC already registered, needed in couple/uncouple case */
133 if (cmd->hdr.return_code == 0x2005) { 133 if (cmd->hdr.return_code == 0x2005) {
134 QETH_DBF_MESSAGE(2, "Group MAC %02x:%02x:%02x:%02x:%02x:%02x " 134 QETH_DBF_MESSAGE(2, "Group MAC %pM already existing on %s \n",
135 "already existing on %s \n", 135 mac, QETH_CARD_IFNAME(card));
136 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
137 QETH_CARD_IFNAME(card));
138 cmd->hdr.return_code = 0; 136 cmd->hdr.return_code = 0;
139 } 137 }
140 if (cmd->hdr.return_code) 138 if (cmd->hdr.return_code)
141 QETH_DBF_MESSAGE(2, "Could not set group MAC " 139 QETH_DBF_MESSAGE(2, "Could not set group MAC %pM on %s: %x\n",
142 "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n", 140 mac, QETH_CARD_IFNAME(card), cmd->hdr.return_code);
143 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
144 QETH_CARD_IFNAME(card), cmd->hdr.return_code);
145 return 0; 141 return 0;
146} 142}
147 143
@@ -163,10 +159,8 @@ static int qeth_l2_send_delgroupmac_cb(struct qeth_card *card,
163 cmd = (struct qeth_ipa_cmd *) data; 159 cmd = (struct qeth_ipa_cmd *) data;
164 mac = &cmd->data.setdelmac.mac[0]; 160 mac = &cmd->data.setdelmac.mac[0];
165 if (cmd->hdr.return_code) 161 if (cmd->hdr.return_code)
166 QETH_DBF_MESSAGE(2, "Could not delete group MAC " 162 QETH_DBF_MESSAGE(2, "Could not delete group MAC %pM on %s: %x\n",
167 "%02x:%02x:%02x:%02x:%02x:%02x on %s: %x\n", 163 mac, QETH_CARD_IFNAME(card), cmd->hdr.return_code);
168 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5],
169 QETH_CARD_IFNAME(card), cmd->hdr.return_code);
170 return 0; 164 return 0;
171} 165}
172 166
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index ed6c54cae7b1..24d09028a27f 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -1608,7 +1608,7 @@ static int iscsi_tcp_get_addr(struct iscsi_conn *conn, struct socket *sock,
1608 case AF_INET6: 1608 case AF_INET6:
1609 sin6 = (struct sockaddr_in6 *)addr; 1609 sin6 = (struct sockaddr_in6 *)addr;
1610 spin_lock_bh(&conn->session->lock); 1610 spin_lock_bh(&conn->session->lock);
1611 sprintf(buf, NIP6_FMT, NIP6(sin6->sin6_addr)); 1611 sprintf(buf, "%pI6", &sin6->sin6_addr);
1612 *port = be16_to_cpu(sin6->sin6_port); 1612 *port = be16_to_cpu(sin6->sin6_port);
1613 spin_unlock_bh(&conn->session->lock); 1613 spin_unlock_bh(&conn->session->lock);
1614 break; 1614 break;
diff --git a/drivers/usb/atm/cxacru.c b/drivers/usb/atm/cxacru.c
index 9aea43a8c4ad..5ed4ae07bac1 100644
--- a/drivers/usb/atm/cxacru.c
+++ b/drivers/usb/atm/cxacru.c
@@ -286,9 +286,7 @@ static ssize_t cxacru_sysfs_show_mac_address(struct device *dev,
286 struct usbatm_data *usbatm_instance = usb_get_intfdata(intf); 286 struct usbatm_data *usbatm_instance = usb_get_intfdata(intf);
287 struct atm_dev *atm_dev = usbatm_instance->atm_dev; 287 struct atm_dev *atm_dev = usbatm_instance->atm_dev;
288 288
289 return snprintf(buf, PAGE_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x\n", 289 return snprintf(buf, PAGE_SIZE, "%pM\n", atm_dev->esi);
290 atm_dev->esi[0], atm_dev->esi[1], atm_dev->esi[2],
291 atm_dev->esi[3], atm_dev->esi[4], atm_dev->esi[5]);
292} 290}
293 291
294static ssize_t cxacru_sysfs_show_adsl_state(struct device *dev, 292static ssize_t cxacru_sysfs_show_adsl_state(struct device *dev,
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c
index 06dd114910d4..fbea8563df1e 100644
--- a/drivers/usb/atm/usbatm.c
+++ b/drivers/usb/atm/usbatm.c
@@ -770,10 +770,7 @@ static int usbatm_atm_proc_read(struct atm_dev *atm_dev, loff_t * pos, char *pag
770 return sprintf(page, "%s\n", instance->description); 770 return sprintf(page, "%s\n", instance->description);
771 771
772 if (!left--) 772 if (!left--)
773 return sprintf(page, "MAC: %02x:%02x:%02x:%02x:%02x:%02x\n", 773 return sprintf(page, "MAC: %pM\n", atm_dev->esi);
774 atm_dev->esi[0], atm_dev->esi[1],
775 atm_dev->esi[2], atm_dev->esi[3],
776 atm_dev->esi[4], atm_dev->esi[5]);
777 774
778 if (!left--) 775 if (!left--)
779 return sprintf(page, 776 return sprintf(page,
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index 66948b72bb9b..00fa5239879d 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -787,10 +787,8 @@ int __init gether_setup(struct usb_gadget *g, u8 ethaddr[ETH_ALEN])
787 dev_dbg(&g->dev, "register_netdev failed, %d\n", status); 787 dev_dbg(&g->dev, "register_netdev failed, %d\n", status);
788 free_netdev(net); 788 free_netdev(net);
789 } else { 789 } else {
790 DECLARE_MAC_BUF(tmp); 790 INFO(dev, "MAC %pM\n", net->dev_addr);
791 791 INFO(dev, "HOST MAC %pM\n", dev->host_mac);
792 INFO(dev, "MAC %s\n", print_mac(tmp, net->dev_addr));
793 INFO(dev, "HOST MAC %s\n", print_mac(tmp, dev->host_mac));
794 792
795 the_dev = dev; 793 the_dev = dev;
796 } 794 }
diff --git a/drivers/uwb/wlp/eda.c b/drivers/uwb/wlp/eda.c
index cdfe8dfc4340..10985fa233cc 100644
--- a/drivers/uwb/wlp/eda.c
+++ b/drivers/uwb/wlp/eda.c
@@ -313,12 +313,9 @@ int wlp_eda_for_virtual(struct wlp_eda *eda,
313 list_for_each_entry(itr, &eda->cache, list_node) { 313 list_for_each_entry(itr, &eda->cache, list_node) {
314 if (!memcmp(itr->virt_addr, virt_addr, 314 if (!memcmp(itr->virt_addr, virt_addr,
315 sizeof(itr->virt_addr))) { 315 sizeof(itr->virt_addr))) {
316 d_printf(6, dev, "EDA: looking for " 316 d_printf(6, dev, "EDA: looking for %pM hit %02x:%02x "
317 "%02x:%02x:%02x:%02x:%02x:%02x hit %02x:%02x "
318 "wss %p tag 0x%02x state %u\n", 317 "wss %p tag 0x%02x state %u\n",
319 virt_addr[0], virt_addr[1], 318 virt_addr,
320 virt_addr[2], virt_addr[3],
321 virt_addr[4], virt_addr[5],
322 itr->dev_addr.data[1], 319 itr->dev_addr.data[1],
323 itr->dev_addr.data[0], itr->wss, 320 itr->dev_addr.data[0], itr->wss,
324 itr->tag, itr->state); 321 itr->tag, itr->state);
@@ -327,24 +324,13 @@ int wlp_eda_for_virtual(struct wlp_eda *eda,
327 found = 1; 324 found = 1;
328 break; 325 break;
329 } else 326 } else
330 d_printf(6, dev, "EDA: looking for " 327 d_printf(6, dev, "EDA: looking for %pM against %pM miss\n",
331 "%02x:%02x:%02x:%02x:%02x:%02x " 328 virt_addr, itr->virt_addr);
332 "against "
333 "%02x:%02x:%02x:%02x:%02x:%02x miss\n",
334 virt_addr[0], virt_addr[1],
335 virt_addr[2], virt_addr[3],
336 virt_addr[4], virt_addr[5],
337 itr->virt_addr[0], itr->virt_addr[1],
338 itr->virt_addr[2], itr->virt_addr[3],
339 itr->virt_addr[4], itr->virt_addr[5]);
340 } 329 }
341 if (!found) { 330 if (!found) {
342 if (printk_ratelimit()) 331 if (printk_ratelimit())
343 dev_err(dev, "EDA: Eth addr %02x:%02x:%02x" 332 dev_err(dev, "EDA: Eth addr %pM not found.\n",
344 ":%02x:%02x:%02x not found.\n", 333 virt_addr);
345 virt_addr[0], virt_addr[1],
346 virt_addr[2], virt_addr[3],
347 virt_addr[4], virt_addr[5]);
348 result = -ENODEV; 334 result = -ENODEV;
349 } 335 }
350 spin_unlock_irqrestore(&eda->lock, flags); 336 spin_unlock_irqrestore(&eda->lock, flags);
@@ -380,19 +366,13 @@ ssize_t wlp_eda_show(struct wlp *wlp, char *buf)
380 "tag state virt_addr\n"); 366 "tag state virt_addr\n");
381 list_for_each_entry(entry, &eda->cache, list_node) { 367 list_for_each_entry(entry, &eda->cache, list_node) {
382 result += scnprintf(buf + result, PAGE_SIZE - result, 368 result += scnprintf(buf + result, PAGE_SIZE - result,
383 "%02x:%02x:%02x:%02x:%02x:%02x %02x:%02x " 369 "%pM %02x:%02x %p 0x%02x %s %pM\n",
384 "%p 0x%02x %s " 370 entry->eth_addr,
385 "%02x:%02x:%02x:%02x:%02x:%02x\n",
386 entry->eth_addr[0], entry->eth_addr[1],
387 entry->eth_addr[2], entry->eth_addr[3],
388 entry->eth_addr[4], entry->eth_addr[5],
389 entry->dev_addr.data[1], 371 entry->dev_addr.data[1],
390 entry->dev_addr.data[0], entry->wss, 372 entry->dev_addr.data[0], entry->wss,
391 entry->tag, 373 entry->tag,
392 wlp_wss_connect_state_str(entry->state), 374 wlp_wss_connect_state_str(entry->state),
393 entry->virt_addr[0], entry->virt_addr[1], 375 entry->virt_addr);
394 entry->virt_addr[2], entry->virt_addr[3],
395 entry->virt_addr[4], entry->virt_addr[5]);
396 if (result >= PAGE_SIZE) 376 if (result >= PAGE_SIZE)
397 break; 377 break;
398 } 378 }
diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c
index fcee9298b620..0e186cd20ad9 100644
--- a/fs/cifs/cifs_spnego.c
+++ b/fs/cifs/cifs_spnego.c
@@ -124,8 +124,7 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
124 sprintf(dp, "ip4=" NIPQUAD_FMT, 124 sprintf(dp, "ip4=" NIPQUAD_FMT,
125 NIPQUAD(server->addr.sockAddr.sin_addr)); 125 NIPQUAD(server->addr.sockAddr.sin_addr));
126 else if (server->addr.sockAddr.sin_family == AF_INET6) 126 else if (server->addr.sockAddr.sin_family == AF_INET6)
127 sprintf(dp, "ip6=" NIP6_SEQFMT, 127 sprintf(dp, "ip6=%pi6", &server->addr.sockAddr6.sin6_addr);
128 NIP6(server->addr.sockAddr6.sin6_addr));
129 else 128 else
130 goto out; 129 goto out;
131 130
diff --git a/fs/lockd/host.c b/fs/lockd/host.c
index 9fd8889097b7..c8ab7d70390d 100644
--- a/fs/lockd/host.c
+++ b/fs/lockd/host.c
@@ -122,7 +122,7 @@ static void nlm_display_address(const struct sockaddr *sap,
122 snprintf(buf, len, NIPQUAD_FMT, 122 snprintf(buf, len, NIPQUAD_FMT,
123 NIPQUAD(sin6->sin6_addr.s6_addr32[3])); 123 NIPQUAD(sin6->sin6_addr.s6_addr32[3]));
124 else 124 else
125 snprintf(buf, len, NIP6_FMT, NIP6(sin6->sin6_addr)); 125 snprintf(buf, len, "%pI6", &sin6->sin6_addr);
126 break; 126 break;
127 default: 127 default:
128 snprintf(buf, len, "unsupported address family"); 128 snprintf(buf, len, "unsupported address family");
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index f48db679a1c6..eb391d8d70ba 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -468,8 +468,7 @@ static void nfs_show_mountd_options(struct seq_file *m, struct nfs_server *nfss,
468 } 468 }
469 case AF_INET6: { 469 case AF_INET6: {
470 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap; 470 struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sap;
471 seq_printf(m, ",mountaddr=" NIP6_FMT, 471 seq_printf(m, ",mountaddr=%pI6", &sin6->sin6_addr);
472 NIP6(sin6->sin6_addr));
473 break; 472 break;
474 } 473 }
475 default: 474 default:
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fba141d3ca07..ed60f8718d80 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -357,18 +357,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
357 ((unsigned char *)&addr)[3] 357 ((unsigned char *)&addr)[3]
358#define NIPQUAD_FMT "%u.%u.%u.%u" 358#define NIPQUAD_FMT "%u.%u.%u.%u"
359 359
360#define NIP6(addr) \
361 ntohs((addr).s6_addr16[0]), \
362 ntohs((addr).s6_addr16[1]), \
363 ntohs((addr).s6_addr16[2]), \
364 ntohs((addr).s6_addr16[3]), \
365 ntohs((addr).s6_addr16[4]), \
366 ntohs((addr).s6_addr16[5]), \
367 ntohs((addr).s6_addr16[6]), \
368 ntohs((addr).s6_addr16[7])
369#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
370#define NIP6_SEQFMT "%04x%04x%04x%04x%04x%04x%04x%04x"
371
372#if defined(__LITTLE_ENDIAN) 360#if defined(__LITTLE_ENDIAN)
373#define HIPQUAD(addr) \ 361#define HIPQUAD(addr) \
374 ((unsigned char *)&addr)[3], \ 362 ((unsigned char *)&addr)[3], \
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index e649bd3f2c97..3ba2998b22ba 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -383,5 +383,22 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev,
383 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ 383 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
384 pos = rcu_dereference(pos->next)) 384 pos = rcu_dereference(pos->next))
385 385
386/**
387 * hlist_for_each_entry_rcu_safenext - iterate over rcu list of given type
388 * @tpos: the type * to use as a loop cursor.
389 * @pos: the &struct hlist_node to use as a loop cursor.
390 * @head: the head for your list.
391 * @member: the name of the hlist_node within the struct.
392 * @next: the &struct hlist_node to use as a next cursor
393 *
394 * Special version of hlist_for_each_entry_rcu that make sure
395 * each next pointer is fetched before each iteration.
396 */
397#define hlist_for_each_entry_rcu_safenext(tpos, pos, head, member, next) \
398 for (pos = rcu_dereference((head)->first); \
399 pos && ({ next = pos->next; smp_rmb(); prefetch(next); 1; }) && \
400 ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
401 pos = rcu_dereference(next))
402
386#endif /* __KERNEL__ */ 403#endif /* __KERNEL__ */
387#endif 404#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 2725f4e5a9bf..487e34507b41 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -269,8 +269,9 @@ struct sk_buff {
269 struct dst_entry *dst; 269 struct dst_entry *dst;
270 struct rtable *rtable; 270 struct rtable *rtable;
271 }; 271 };
272#ifdef CONFIG_XFRM
272 struct sec_path *sp; 273 struct sec_path *sp;
273 274#endif
274 /* 275 /*
275 * This is the control buffer. It is free to use for every 276 * This is the control buffer. It is free to use for every
276 * layer. Please put your private variables there. If you 277 * layer. Please put your private variables there. If you
@@ -1864,6 +1865,18 @@ static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_bu
1864 to->queue_mapping = from->queue_mapping; 1865 to->queue_mapping = from->queue_mapping;
1865} 1866}
1866 1867
1868#ifdef CONFIG_XFRM
1869static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
1870{
1871 return skb->sp;
1872}
1873#else
1874static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
1875{
1876 return NULL;
1877}
1878#endif
1879
1867static inline int skb_is_gso(const struct sk_buff *skb) 1880static inline int skb_is_gso(const struct sk_buff *skb)
1868{ 1881{
1869 return skb_shinfo(skb)->gso_size; 1882 return skb_shinfo(skb)->gso_size;
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index 6fd7b016517f..51cb75ea42d5 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -145,8 +145,8 @@ static inline char *__svc_print_addr(struct sockaddr *addr,
145 break; 145 break;
146 146
147 case AF_INET6: 147 case AF_INET6:
148 snprintf(buf, len, "%x:%x:%x:%x:%x:%x:%x:%x, port=%u", 148 snprintf(buf, len, "%pI6, port=%u",
149 NIP6(((struct sockaddr_in6 *) addr)->sin6_addr), 149 &((struct sockaddr_in6 *)addr)->sin6_addr,
150 ntohs(((struct sockaddr_in6 *) addr)->sin6_port)); 150 ntohs(((struct sockaddr_in6 *) addr)->sin6_port));
151 break; 151 break;
152 152
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 4bc1e6b86cb2..52f3abd453a1 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -199,6 +199,9 @@ enum {
199#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO 199#define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO
200 XFRM_MSG_GETSPDINFO, 200 XFRM_MSG_GETSPDINFO,
201#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO 201#define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO
202
203 XFRM_MSG_MAPPING,
204#define XFRM_MSG_MAPPING XFRM_MSG_MAPPING
202 __XFRM_MSG_MAX 205 __XFRM_MSG_MAX
203}; 206};
204#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) 207#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -438,6 +441,15 @@ struct xfrm_user_migrate {
438 __u16 new_family; 441 __u16 new_family;
439}; 442};
440 443
444struct xfrm_user_mapping {
445 struct xfrm_usersa_id id;
446 __u32 reqid;
447 xfrm_address_t old_saddr;
448 xfrm_address_t new_saddr;
449 __be16 old_sport;
450 __be16 new_sport;
451};
452
441#ifndef __KERNEL__ 453#ifndef __KERNEL__
442/* backwards compatibility for userspace */ 454/* backwards compatibility for userspace */
443#define XFRMGRP_ACQUIRE 1 455#define XFRMGRP_ACQUIRE 1
@@ -464,6 +476,8 @@ enum xfrm_nlgroups {
464#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT 476#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
465 XFRMNLGRP_MIGRATE, 477 XFRMNLGRP_MIGRATE,
466#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE 478#define XFRMNLGRP_MIGRATE XFRMNLGRP_MIGRATE
479 XFRMNLGRP_MAPPING,
480#define XFRMNLGRP_MAPPING XFRMNLGRP_MAPPING
467 __XFRMNLGRP_MAX 481 __XFRMNLGRP_MAX
468}; 482};
469#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) 483#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)
diff --git a/include/net/dst.h b/include/net/dst.h
index 8a8b71e5f3f1..f96c4ba4dd32 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -59,8 +59,9 @@ struct dst_entry
59 59
60 struct neighbour *neighbour; 60 struct neighbour *neighbour;
61 struct hh_cache *hh; 61 struct hh_cache *hh;
62#ifdef CONFIG_XFRM
62 struct xfrm_state *xfrm; 63 struct xfrm_state *xfrm;
63 64#endif
64 int (*input)(struct sk_buff*); 65 int (*input)(struct sk_buff*);
65 int (*output)(struct sk_buff*); 66 int (*output)(struct sk_buff*);
66 67
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index fe9fcf73c85e..af48cada561e 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -87,8 +87,8 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
87 int len; 87 int len;
88#ifdef CONFIG_IP_VS_IPV6 88#ifdef CONFIG_IP_VS_IPV6
89 if (af == AF_INET6) 89 if (af == AF_INET6)
90 len = snprintf(&buf[*idx], buf_len - *idx, "[" NIP6_FMT "]", 90 len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6]",
91 NIP6(addr->in6)) + 1; 91 &addr->in6) + 1;
92 else 92 else
93#endif 93#endif
94 len = snprintf(&buf[*idx], buf_len - *idx, NIPQUAD_FMT, 94 len = snprintf(&buf[*idx], buf_len - *idx, NIPQUAD_FMT,
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index a6874ba22d54..42f1fc96f3ec 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -122,10 +122,10 @@ static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t)
122static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t) 122static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t)
123{ 123{
124#ifdef DEBUG 124#ifdef DEBUG
125 printk("tuple %p: %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", 125 printk("tuple %p: %u %pI6 %hu -> %pI6 %hu\n",
126 t, t->dst.protonum, 126 t, t->dst.protonum,
127 NIP6(*(struct in6_addr *)t->src.u3.all), ntohs(t->src.u.all), 127 t->src.u3.all, ntohs(t->src.u.all),
128 NIP6(*(struct in6_addr *)t->dst.u3.all), ntohs(t->dst.u.all)); 128 t->dst.u3.all, ntohs(t->dst.u.all));
129#endif 129#endif
130} 130}
131 131
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 3643bbb8e585..46b7764f1774 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -233,7 +233,7 @@ extern int nla_parse(struct nlattr *tb[], int maxtype,
233extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); 233extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype);
234extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, 234extern size_t nla_strlcpy(char *dst, const struct nlattr *nla,
235 size_t dstsize); 235 size_t dstsize);
236extern int nla_memcpy(void *dest, struct nlattr *src, int count); 236extern int nla_memcpy(void *dest, const struct nlattr *src, int count);
237extern int nla_memcmp(const struct nlattr *nla, const void *data, 237extern int nla_memcmp(const struct nlattr *nla, const void *data,
238 size_t size); 238 size_t size);
239extern int nla_strcmp(const struct nlattr *nla, const char *str); 239extern int nla_strcmp(const struct nlattr *nla, const char *str);
@@ -741,7 +741,7 @@ static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype)
741 * See nla_parse() 741 * See nla_parse()
742 */ 742 */
743static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, 743static inline int nla_parse_nested(struct nlattr *tb[], int maxtype,
744 struct nlattr *nla, 744 const struct nlattr *nla,
745 const struct nla_policy *policy) 745 const struct nla_policy *policy)
746{ 746{
747 return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy); 747 return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy);
@@ -875,7 +875,7 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
875 * nla_get_u32 - return payload of u32 attribute 875 * nla_get_u32 - return payload of u32 attribute
876 * @nla: u32 netlink attribute 876 * @nla: u32 netlink attribute
877 */ 877 */
878static inline u32 nla_get_u32(struct nlattr *nla) 878static inline u32 nla_get_u32(const struct nlattr *nla)
879{ 879{
880 return *(u32 *) nla_data(nla); 880 return *(u32 *) nla_data(nla);
881} 881}
@@ -884,7 +884,7 @@ static inline u32 nla_get_u32(struct nlattr *nla)
884 * nla_get_be32 - return payload of __be32 attribute 884 * nla_get_be32 - return payload of __be32 attribute
885 * @nla: __be32 netlink attribute 885 * @nla: __be32 netlink attribute
886 */ 886 */
887static inline __be32 nla_get_be32(struct nlattr *nla) 887static inline __be32 nla_get_be32(const struct nlattr *nla)
888{ 888{
889 return *(__be32 *) nla_data(nla); 889 return *(__be32 *) nla_data(nla);
890} 890}
@@ -893,7 +893,7 @@ static inline __be32 nla_get_be32(struct nlattr *nla)
893 * nla_get_u16 - return payload of u16 attribute 893 * nla_get_u16 - return payload of u16 attribute
894 * @nla: u16 netlink attribute 894 * @nla: u16 netlink attribute
895 */ 895 */
896static inline u16 nla_get_u16(struct nlattr *nla) 896static inline u16 nla_get_u16(const struct nlattr *nla)
897{ 897{
898 return *(u16 *) nla_data(nla); 898 return *(u16 *) nla_data(nla);
899} 899}
@@ -902,7 +902,7 @@ static inline u16 nla_get_u16(struct nlattr *nla)
902 * nla_get_be16 - return payload of __be16 attribute 902 * nla_get_be16 - return payload of __be16 attribute
903 * @nla: __be16 netlink attribute 903 * @nla: __be16 netlink attribute
904 */ 904 */
905static inline __be16 nla_get_be16(struct nlattr *nla) 905static inline __be16 nla_get_be16(const struct nlattr *nla)
906{ 906{
907 return *(__be16 *) nla_data(nla); 907 return *(__be16 *) nla_data(nla);
908} 908}
@@ -911,7 +911,7 @@ static inline __be16 nla_get_be16(struct nlattr *nla)
911 * nla_get_le16 - return payload of __le16 attribute 911 * nla_get_le16 - return payload of __le16 attribute
912 * @nla: __le16 netlink attribute 912 * @nla: __le16 netlink attribute
913 */ 913 */
914static inline __le16 nla_get_le16(struct nlattr *nla) 914static inline __le16 nla_get_le16(const struct nlattr *nla)
915{ 915{
916 return *(__le16 *) nla_data(nla); 916 return *(__le16 *) nla_data(nla);
917} 917}
@@ -920,7 +920,7 @@ static inline __le16 nla_get_le16(struct nlattr *nla)
920 * nla_get_u8 - return payload of u8 attribute 920 * nla_get_u8 - return payload of u8 attribute
921 * @nla: u8 netlink attribute 921 * @nla: u8 netlink attribute
922 */ 922 */
923static inline u8 nla_get_u8(struct nlattr *nla) 923static inline u8 nla_get_u8(const struct nlattr *nla)
924{ 924{
925 return *(u8 *) nla_data(nla); 925 return *(u8 *) nla_data(nla);
926} 926}
@@ -929,7 +929,7 @@ static inline u8 nla_get_u8(struct nlattr *nla)
929 * nla_get_u64 - return payload of u64 attribute 929 * nla_get_u64 - return payload of u64 attribute
930 * @nla: u64 netlink attribute 930 * @nla: u64 netlink attribute
931 */ 931 */
932static inline u64 nla_get_u64(struct nlattr *nla) 932static inline u64 nla_get_u64(const struct nlattr *nla)
933{ 933{
934 u64 tmp; 934 u64 tmp;
935 935
@@ -942,7 +942,7 @@ static inline u64 nla_get_u64(struct nlattr *nla)
942 * nla_get_flag - return payload of flag attribute 942 * nla_get_flag - return payload of flag attribute
943 * @nla: flag netlink attribute 943 * @nla: flag netlink attribute
944 */ 944 */
945static inline int nla_get_flag(struct nlattr *nla) 945static inline int nla_get_flag(const struct nlattr *nla)
946{ 946{
947 return !!nla; 947 return !!nla;
948} 948}
@@ -953,7 +953,7 @@ static inline int nla_get_flag(struct nlattr *nla)
953 * 953 *
954 * Returns the number of milliseconds in jiffies. 954 * Returns the number of milliseconds in jiffies.
955 */ 955 */
956static inline unsigned long nla_get_msecs(struct nlattr *nla) 956static inline unsigned long nla_get_msecs(const struct nlattr *nla)
957{ 957{
958 u64 msecs = nla_get_u64(nla); 958 u64 msecs = nla_get_u64(nla);
959 959
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index ece1c926b5d1..977f482d97a9 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -49,6 +49,8 @@ struct netns_ipv4 {
49 int sysctl_icmp_ratelimit; 49 int sysctl_icmp_ratelimit;
50 int sysctl_icmp_ratemask; 50 int sysctl_icmp_ratemask;
51 int sysctl_icmp_errors_use_inbound_ifaddr; 51 int sysctl_icmp_errors_use_inbound_ifaddr;
52 int sysctl_rt_cache_rebuild_count;
53 int current_rt_cache_rebuild_count;
52 54
53 struct timer_list rt_secret_timer; 55 struct timer_list rt_secret_timer;
54 atomic_t rt_genid; 56 atomic_t rt_genid;
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index ed71b110edf7..e71b0f7ce88e 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -285,9 +285,9 @@ extern int sctp_debug_flag;
285 if (sctp_debug_flag) { \ 285 if (sctp_debug_flag) { \
286 if (saddr->sa.sa_family == AF_INET6) { \ 286 if (saddr->sa.sa_family == AF_INET6) { \
287 printk(KERN_DEBUG \ 287 printk(KERN_DEBUG \
288 lead NIP6_FMT trail, \ 288 lead "%pI6" trail, \
289 leadparm, \ 289 leadparm, \
290 NIP6(saddr->v6.sin6_addr), \ 290 &saddr->v6.sin6_addr, \
291 otherparms); \ 291 otherparms); \
292 } else { \ 292 } else { \
293 printk(KERN_DEBUG \ 293 printk(KERN_DEBUG \
diff --git a/include/net/sock.h b/include/net/sock.h
index c04f9e18ea22..941ad7c830a3 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -229,7 +229,9 @@ struct sock {
229 } sk_backlog; 229 } sk_backlog;
230 wait_queue_head_t *sk_sleep; 230 wait_queue_head_t *sk_sleep;
231 struct dst_entry *sk_dst_cache; 231 struct dst_entry *sk_dst_cache;
232#ifdef CONFIG_XFRM
232 struct xfrm_policy *sk_policy[2]; 233 struct xfrm_policy *sk_policy[2];
234#endif
233 rwlock_t sk_dst_lock; 235 rwlock_t sk_dst_lock;
234 atomic_t sk_rmem_alloc; 236 atomic_t sk_rmem_alloc;
235 atomic_t sk_wmem_alloc; 237 atomic_t sk_wmem_alloc;
@@ -361,6 +363,27 @@ static __inline__ int sk_del_node_init(struct sock *sk)
361 return rc; 363 return rc;
362} 364}
363 365
366static __inline__ int __sk_del_node_init_rcu(struct sock *sk)
367{
368 if (sk_hashed(sk)) {
369 hlist_del_init_rcu(&sk->sk_node);
370 return 1;
371 }
372 return 0;
373}
374
375static __inline__ int sk_del_node_init_rcu(struct sock *sk)
376{
377 int rc = __sk_del_node_init_rcu(sk);
378
379 if (rc) {
380 /* paranoid for a while -acme */
381 WARN_ON(atomic_read(&sk->sk_refcnt) == 1);
382 __sock_put(sk);
383 }
384 return rc;
385}
386
364static __inline__ void __sk_add_node(struct sock *sk, struct hlist_head *list) 387static __inline__ void __sk_add_node(struct sock *sk, struct hlist_head *list)
365{ 388{
366 hlist_add_head(&sk->sk_node, list); 389 hlist_add_head(&sk->sk_node, list);
@@ -372,6 +395,17 @@ static __inline__ void sk_add_node(struct sock *sk, struct hlist_head *list)
372 __sk_add_node(sk, list); 395 __sk_add_node(sk, list);
373} 396}
374 397
398static __inline__ void __sk_add_node_rcu(struct sock *sk, struct hlist_head *list)
399{
400 hlist_add_head_rcu(&sk->sk_node, list);
401}
402
403static __inline__ void sk_add_node_rcu(struct sock *sk, struct hlist_head *list)
404{
405 sock_hold(sk);
406 __sk_add_node_rcu(sk, list);
407}
408
375static __inline__ void __sk_del_bind_node(struct sock *sk) 409static __inline__ void __sk_del_bind_node(struct sock *sk)
376{ 410{
377 __hlist_del(&sk->sk_bind_node); 411 __hlist_del(&sk->sk_bind_node);
@@ -385,6 +419,8 @@ static __inline__ void sk_add_bind_node(struct sock *sk,
385 419
386#define sk_for_each(__sk, node, list) \ 420#define sk_for_each(__sk, node, list) \
387 hlist_for_each_entry(__sk, node, list, sk_node) 421 hlist_for_each_entry(__sk, node, list, sk_node)
422#define sk_for_each_rcu_safenext(__sk, node, list, next) \
423 hlist_for_each_entry_rcu_safenext(__sk, node, list, sk_node, next)
388#define sk_for_each_from(__sk, node) \ 424#define sk_for_each_from(__sk, node) \
389 if (__sk && ({ node = &(__sk)->sk_node; 1; })) \ 425 if (__sk && ({ node = &(__sk)->sk_node; 1; })) \
390 hlist_for_each_entry_from(__sk, node, sk_node) 426 hlist_for_each_entry_from(__sk, node, sk_node)
@@ -587,8 +623,9 @@ struct proto {
587 int *sysctl_rmem; 623 int *sysctl_rmem;
588 int max_header; 624 int max_header;
589 625
590 struct kmem_cache *slab; 626 struct kmem_cache *slab;
591 unsigned int obj_size; 627 unsigned int obj_size;
628 int slab_flags;
592 629
593 atomic_t *orphan_count; 630 atomic_t *orphan_count;
594 631
@@ -597,7 +634,7 @@ struct proto {
597 634
598 union { 635 union {
599 struct inet_hashinfo *hashinfo; 636 struct inet_hashinfo *hashinfo;
600 struct hlist_head *udp_hash; 637 struct udp_table *udp_table;
601 struct raw_hashinfo *raw_hash; 638 struct raw_hashinfo *raw_hash;
602 } h; 639 } h;
603 640
diff --git a/include/net/udp.h b/include/net/udp.h
index 1e205095ea68..df2bfe545374 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -50,8 +50,15 @@ struct udp_skb_cb {
50}; 50};
51#define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) 51#define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb))
52 52
53extern struct hlist_head udp_hash[UDP_HTABLE_SIZE]; 53struct udp_hslot {
54extern rwlock_t udp_hash_lock; 54 struct hlist_head head;
55 spinlock_t lock;
56} __attribute__((aligned(2 * sizeof(long))));
57struct udp_table {
58 struct udp_hslot hash[UDP_HTABLE_SIZE];
59};
60extern struct udp_table udp_table;
61extern void udp_table_init(struct udp_table *);
55 62
56 63
57/* Note: this must match 'valbool' in sock_setsockopt */ 64/* Note: this must match 'valbool' in sock_setsockopt */
@@ -110,15 +117,7 @@ static inline void udp_lib_hash(struct sock *sk)
110 BUG(); 117 BUG();
111} 118}
112 119
113static inline void udp_lib_unhash(struct sock *sk) 120extern void udp_lib_unhash(struct sock *sk);
114{
115 write_lock_bh(&udp_hash_lock);
116 if (sk_del_node_init(sk)) {
117 inet_sk(sk)->num = 0;
118 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
119 }
120 write_unlock_bh(&udp_hash_lock);
121}
122 121
123static inline void udp_lib_close(struct sock *sk, long timeout) 122static inline void udp_lib_close(struct sock *sk, long timeout)
124{ 123{
@@ -187,7 +186,7 @@ extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
187struct udp_seq_afinfo { 186struct udp_seq_afinfo {
188 char *name; 187 char *name;
189 sa_family_t family; 188 sa_family_t family;
190 struct hlist_head *hashtable; 189 struct udp_table *udp_table;
191 struct file_operations seq_fops; 190 struct file_operations seq_fops;
192 struct seq_operations seq_ops; 191 struct seq_operations seq_ops;
193}; 192};
@@ -196,7 +195,7 @@ struct udp_iter_state {
196 struct seq_net_private p; 195 struct seq_net_private p;
197 sa_family_t family; 196 sa_family_t family;
198 int bucket; 197 int bucket;
199 struct hlist_head *hashtable; 198 struct udp_table *udp_table;
200}; 199};
201 200
202#ifdef CONFIG_PROC_FS 201#ifdef CONFIG_PROC_FS
diff --git a/include/net/udplite.h b/include/net/udplite.h
index b76b2e377af4..afdffe607b24 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -11,7 +11,7 @@
11#define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */ 11#define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */
12 12
13extern struct proto udplite_prot; 13extern struct proto udplite_prot;
14extern struct hlist_head udplite_hash[UDP_HTABLE_SIZE]; 14extern struct udp_table udplite_table;
15 15
16/* 16/*
17 * Checksum computation is all in software, hence simpler getfrag. 17 * Checksum computation is all in software, hence simpler getfrag.
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 11c890ad8ebb..f2c5ba28a428 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -882,6 +882,7 @@ struct xfrm_dst
882 u32 path_cookie; 882 u32 path_cookie;
883}; 883};
884 884
885#ifdef CONFIG_XFRM
885static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) 886static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
886{ 887{
887 dst_release(xdst->route); 888 dst_release(xdst->route);
@@ -894,6 +895,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
894 xdst->partner = NULL; 895 xdst->partner = NULL;
895#endif 896#endif
896} 897}
898#endif
897 899
898extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); 900extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
899 901
@@ -1536,9 +1538,11 @@ static inline void xfrm_states_delete(struct xfrm_state **states, int n)
1536} 1538}
1537#endif 1539#endif
1538 1540
1541#ifdef CONFIG_XFRM
1539static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb) 1542static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb)
1540{ 1543{
1541 return skb->sp->xvec[skb->sp->len - 1]; 1544 return skb->sp->xvec[skb->sp->len - 1];
1542} 1545}
1546#endif
1543 1547
1544#endif /* _NET_XFRM_H */ 1548#endif /* _NET_XFRM_H */
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index a013bbc23717..dd7cc7fa3e77 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -581,6 +581,58 @@ static char *resource_string(char *buf, char *end, struct resource *res, int fie
581 return string(buf, end, sym, field_width, precision, flags); 581 return string(buf, end, sym, field_width, precision, flags);
582} 582}
583 583
584static char *mac_address_string(char *buf, char *end, u8 *addr, int field_width,
585 int precision, int flags)
586{
587 char mac_addr[6 * 3]; /* (6 * 2 hex digits), 5 colons and trailing zero */
588 char *p = mac_addr;
589 int i;
590
591 for (i = 0; i < 6; i++) {
592 p = pack_hex_byte(p, addr[i]);
593 if (!(flags & SPECIAL) && i != 5)
594 *p++ = ':';
595 }
596 *p = '\0';
597
598 return string(buf, end, mac_addr, field_width, precision, flags & ~SPECIAL);
599}
600
601static char *ip6_addr_string(char *buf, char *end, u8 *addr, int field_width,
602 int precision, int flags)
603{
604 char ip6_addr[8 * 5]; /* (8 * 4 hex digits), 7 colons and trailing zero */
605 char *p = ip6_addr;
606 int i;
607
608 for (i = 0; i < 8; i++) {
609 p = pack_hex_byte(p, addr[2 * i]);
610 p = pack_hex_byte(p, addr[2 * i + 1]);
611 if (!(flags & SPECIAL) && i != 7)
612 *p++ = ':';
613 }
614 *p = '\0';
615
616 return string(buf, end, ip6_addr, field_width, precision, flags & ~SPECIAL);
617}
618
619static char *ip4_addr_string(char *buf, char *end, u8 *addr, int field_width,
620 int precision, int flags)
621{
622 char ip4_addr[4 * 4]; /* (4 * 3 decimal digits), 3 dots and trailing zero */
623 char *p = ip4_addr;
624 int i;
625
626 for (i = 0; i < 4; i++) {
627 p = put_dec_trunc(p, addr[i]);
628 if (i != 3)
629 *p++ = '.';
630 }
631 *p = '\0';
632
633 return string(buf, end, ip4_addr, field_width, precision, flags & ~SPECIAL);
634}
635
584/* 636/*
585 * Show a '%p' thing. A kernel extension is that the '%p' is followed 637 * Show a '%p' thing. A kernel extension is that the '%p' is followed
586 * by an extra set of alphanumeric characters that are extended format 638 * by an extra set of alphanumeric characters that are extended format
@@ -592,6 +644,12 @@ static char *resource_string(char *buf, char *end, struct resource *res, int fie
592 * - 'S' For symbolic direct pointers 644 * - 'S' For symbolic direct pointers
593 * - 'R' For a struct resource pointer, it prints the range of 645 * - 'R' For a struct resource pointer, it prints the range of
594 * addresses (not the name nor the flags) 646 * addresses (not the name nor the flags)
647 * - 'M' For a 6-byte MAC address, it prints the address in the
648 * usual colon-separated hex notation
649 * - 'I' [46] for IPv4/IPv6 addresses printed in the usual way (dot-separated
650 * decimal for v4 and colon separated network-order 16 bit hex for v6)
651 * - 'i' [46] for 'raw' IPv4/IPv6 addresses, IPv6 omits the colons, IPv4 is
652 * currently the same
595 * 653 *
596 * Note: The difference between 'S' and 'F' is that on ia64 and ppc64 654 * Note: The difference between 'S' and 'F' is that on ia64 and ppc64
597 * function pointers are really function descriptors, which contain a 655 * function pointers are really function descriptors, which contain a
@@ -607,6 +665,18 @@ static char *pointer(const char *fmt, char *buf, char *end, void *ptr, int field
607 return symbol_string(buf, end, ptr, field_width, precision, flags); 665 return symbol_string(buf, end, ptr, field_width, precision, flags);
608 case 'R': 666 case 'R':
609 return resource_string(buf, end, ptr, field_width, precision, flags); 667 return resource_string(buf, end, ptr, field_width, precision, flags);
668 case 'M':
669 return mac_address_string(buf, end, ptr, field_width, precision, flags);
670 case 'i':
671 flags |= SPECIAL;
672 /* Fallthrough */
673 case 'I':
674 if (fmt[1] == '6')
675 return ip6_addr_string(buf, end, ptr, field_width, precision, flags);
676 if (fmt[1] == '4')
677 return ip4_addr_string(buf, end, ptr, field_width, precision, flags);
678 flags &= ~SPECIAL;
679 break;
610 } 680 }
611 flags |= SMALL; 681 flags |= SMALL;
612 if (field_width == -1) { 682 if (field_width == -1) {
diff --git a/net/802/tr.c b/net/802/tr.c
index 18c66475d8c3..38f1f290c635 100644
--- a/net/802/tr.c
+++ b/net/802/tr.c
@@ -285,10 +285,7 @@ void tr_source_route(struct sk_buff *skb,struct trh_hdr *trh,
285 if(entry) 285 if(entry)
286 { 286 {
287#if TR_SR_DEBUG 287#if TR_SR_DEBUG
288{ 288printk("source routing for %pM\n", trh->daddr);
289DECLARE_MAC_BUF(mac);
290printk("source routing for %s\n",print_mac(mac, trh->daddr));
291}
292#endif 289#endif
293 if(!entry->local_ring && (ntohs(entry->rcf) & TR_RCF_LEN_MASK) >> 8) 290 if(!entry->local_ring && (ntohs(entry->rcf) & TR_RCF_LEN_MASK) >> 8)
294 { 291 {
@@ -370,9 +367,8 @@ static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
370 if(entry==NULL) 367 if(entry==NULL)
371 { 368 {
372#if TR_SR_DEBUG 369#if TR_SR_DEBUG
373 DECLARE_MAC_BUF(mac); 370 printk("adding rif_entry: addr:%pM rcf:%04X\n",
374 printk("adding rif_entry: addr:%s rcf:%04X\n", 371 trh->saddr, ntohs(trh->rcf));
375 print_mac(mac, trh->saddr), ntohs(trh->rcf));
376#endif 372#endif
377 /* 373 /*
378 * Allocate our new entry. A failure to allocate loses 374 * Allocate our new entry. A failure to allocate loses
@@ -417,11 +413,8 @@ static void tr_add_rif_info(struct trh_hdr *trh, struct net_device *dev)
417 !(trh->rcf & htons(TR_RCF_BROADCAST_MASK))) 413 !(trh->rcf & htons(TR_RCF_BROADCAST_MASK)))
418 { 414 {
419#if TR_SR_DEBUG 415#if TR_SR_DEBUG
420{ 416printk("updating rif_entry: addr:%pM rcf:%04X\n",
421DECLARE_MAC_BUF(mac); 417 trh->saddr, ntohs(trh->rcf));
422printk("updating rif_entry: addr:%s rcf:%04X\n",
423 print_mac(mac, trh->saddr), ntohs(trh->rcf));
424}
425#endif 418#endif
426 entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK); 419 entry->rcf = trh->rcf & htons((unsigned short)~TR_RCF_BROADCAST_MASK);
427 memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short)); 420 memcpy(&(entry->rseg[0]),&(trh->rseg[0]),8*sizeof(unsigned short));
@@ -532,7 +525,6 @@ static int rif_seq_show(struct seq_file *seq, void *v)
532{ 525{
533 int j, rcf_len, segment, brdgnmb; 526 int j, rcf_len, segment, brdgnmb;
534 struct rif_cache *entry = v; 527 struct rif_cache *entry = v;
535 DECLARE_MAC_BUF(mac);
536 528
537 if (v == SEQ_START_TOKEN) 529 if (v == SEQ_START_TOKEN)
538 seq_puts(seq, 530 seq_puts(seq,
@@ -542,9 +534,9 @@ static int rif_seq_show(struct seq_file *seq, void *v)
542 long ttl = (long) (entry->last_used + sysctl_tr_rif_timeout) 534 long ttl = (long) (entry->last_used + sysctl_tr_rif_timeout)
543 - (long) jiffies; 535 - (long) jiffies;
544 536
545 seq_printf(seq, "%s %s %7li ", 537 seq_printf(seq, "%s %pM %7li ",
546 dev?dev->name:"?", 538 dev?dev->name:"?",
547 print_mac(mac, entry->addr), 539 entry->addr,
548 ttl/HZ); 540 ttl/HZ);
549 541
550 if (entry->local_ring) 542 if (entry->local_ring)
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index f0e335aa20df..72326b9c759c 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -46,10 +46,10 @@ int vlan_net_id;
46/* Our listing of VLAN group(s) */ 46/* Our listing of VLAN group(s) */
47static struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE]; 47static struct hlist_head vlan_group_hash[VLAN_GRP_HASH_SIZE];
48 48
49static char vlan_fullname[] = "802.1Q VLAN Support"; 49const char vlan_fullname[] = "802.1Q VLAN Support";
50static char vlan_version[] = DRV_VERSION; 50const char vlan_version[] = DRV_VERSION;
51static char vlan_copyright[] = "Ben Greear <greearb@candelatech.com>"; 51static const char vlan_copyright[] = "Ben Greear <greearb@candelatech.com>";
52static char vlan_buggyright[] = "David S. Miller <davem@redhat.com>"; 52static const char vlan_buggyright[] = "David S. Miller <davem@redhat.com>";
53 53
54static struct packet_type vlan_packet_type = { 54static struct packet_type vlan_packet_type = {
55 .type = __constant_htons(ETH_P_8021Q), 55 .type = __constant_htons(ETH_P_8021Q),
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h
index a6603a4d917f..82570bc2a180 100644
--- a/net/8021q/vlan.h
+++ b/net/8021q/vlan.h
@@ -108,8 +108,10 @@ static inline int vlan_gvrp_init(void) { return 0; }
108static inline void vlan_gvrp_uninit(void) {} 108static inline void vlan_gvrp_uninit(void) {}
109#endif 109#endif
110 110
111int vlan_netlink_init(void); 111extern const char vlan_fullname[];
112void vlan_netlink_fini(void); 112extern const char vlan_version[];
113extern int vlan_netlink_init(void);
114extern void vlan_netlink_fini(void);
113 115
114extern struct rtnl_link_ops vlan_link_ops; 116extern struct rtnl_link_ops vlan_link_ops;
115 117
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 8883e9c8a223..c269fcbd13d5 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -648,6 +648,26 @@ static void vlan_dev_uninit(struct net_device *dev)
648 } 648 }
649} 649}
650 650
651static int vlan_ethtool_get_settings(struct net_device *dev,
652 struct ethtool_cmd *cmd)
653{
654 const struct vlan_dev_info *vlan = vlan_dev_info(dev);
655 struct net_device *real_dev = vlan->real_dev;
656
657 if (!real_dev->ethtool_ops->get_settings)
658 return -EOPNOTSUPP;
659
660 return real_dev->ethtool_ops->get_settings(real_dev, cmd);
661}
662
663static void vlan_ethtool_get_drvinfo(struct net_device *dev,
664 struct ethtool_drvinfo *info)
665{
666 strcpy(info->driver, vlan_fullname);
667 strcpy(info->version, vlan_version);
668 strcpy(info->fw_version, "N/A");
669}
670
651static u32 vlan_ethtool_get_rx_csum(struct net_device *dev) 671static u32 vlan_ethtool_get_rx_csum(struct net_device *dev)
652{ 672{
653 const struct vlan_dev_info *vlan = vlan_dev_info(dev); 673 const struct vlan_dev_info *vlan = vlan_dev_info(dev);
@@ -672,6 +692,8 @@ static u32 vlan_ethtool_get_flags(struct net_device *dev)
672} 692}
673 693
674static const struct ethtool_ops vlan_ethtool_ops = { 694static const struct ethtool_ops vlan_ethtool_ops = {
695 .get_settings = vlan_ethtool_get_settings,
696 .get_drvinfo = vlan_ethtool_get_drvinfo,
675 .get_link = ethtool_op_get_link, 697 .get_link = ethtool_op_get_link,
676 .get_rx_csum = vlan_ethtool_get_rx_csum, 698 .get_rx_csum = vlan_ethtool_get_rx_csum,
677 .get_flags = vlan_ethtool_get_flags, 699 .get_flags = vlan_ethtool_get_flags,
diff --git a/net/Kconfig b/net/Kconfig
index d789d79551ae..8c3d97ca0d96 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -27,7 +27,7 @@ menu "Networking options"
27config NET_NS 27config NET_NS
28 bool "Network namespace support" 28 bool "Network namespace support"
29 default n 29 default n
30 depends on EXPERIMENTAL && !SYSFS && NAMESPACES 30 depends on EXPERIMENTAL && NAMESPACES
31 help 31 help
32 Allow user space to create what appear to be multiple instances 32 Allow user space to create what appear to be multiple instances
33 of the network stack. 33 of the network stack.
diff --git a/net/appletalk/aarp.c b/net/appletalk/aarp.c
index b25c1e909d14..b03ff58e9308 100644
--- a/net/appletalk/aarp.c
+++ b/net/appletalk/aarp.c
@@ -995,7 +995,6 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
995 struct aarp_iter_state *iter = seq->private; 995 struct aarp_iter_state *iter = seq->private;
996 struct aarp_entry *entry = v; 996 struct aarp_entry *entry = v;
997 unsigned long now = jiffies; 997 unsigned long now = jiffies;
998 DECLARE_MAC_BUF(mac);
999 998
1000 if (v == SEQ_START_TOKEN) 999 if (v == SEQ_START_TOKEN)
1001 seq_puts(seq, 1000 seq_puts(seq,
@@ -1006,7 +1005,7 @@ static int aarp_seq_show(struct seq_file *seq, void *v)
1006 ntohs(entry->target_addr.s_net), 1005 ntohs(entry->target_addr.s_net),
1007 (unsigned int) entry->target_addr.s_node, 1006 (unsigned int) entry->target_addr.s_node,
1008 entry->dev ? entry->dev->name : "????"); 1007 entry->dev ? entry->dev->name : "????");
1009 seq_printf(seq, "%s", print_mac(mac, entry->hwaddr)); 1008 seq_printf(seq, "%pM", entry->hwaddr);
1010 seq_printf(seq, " %8s", 1009 seq_printf(seq, " %8s",
1011 dt2str((long)entry->expires_at - (long)now)); 1010 dt2str((long)entry->expires_at - (long)now));
1012 if (iter->table == unresolved) 1011 if (iter->table == unresolved)
diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index 280de481edc7..29ef8dc6921b 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -698,12 +698,11 @@ static int br2684_seq_show(struct seq_file *seq, void *v)
698 br2684_devs); 698 br2684_devs);
699 const struct net_device *net_dev = brdev->net_dev; 699 const struct net_device *net_dev = brdev->net_dev;
700 const struct br2684_vcc *brvcc; 700 const struct br2684_vcc *brvcc;
701 DECLARE_MAC_BUF(mac);
702 701
703 seq_printf(seq, "dev %.16s: num=%d, mac=%s (%s)\n", 702 seq_printf(seq, "dev %.16s: num=%d, mac=%pM (%s)\n",
704 net_dev->name, 703 net_dev->name,
705 brdev->number, 704 brdev->number,
706 print_mac(mac, net_dev->dev_addr), 705 net_dev->dev_addr,
707 brdev->mac_was_set ? "set" : "auto"); 706 brdev->mac_was_set ? "set" : "auto");
708 707
709 list_for_each_entry(brvcc, &brdev->brvccs, brvccs) { 708 list_for_each_entry(brvcc, &brdev->brvccs, brvccs) {
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 8f701cde5945..1def62d17739 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -373,19 +373,13 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
373 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) { 373 if (entry && (entry->tx_wait.qlen < LEC_UNRES_QUE_LEN)) {
374 pr_debug("%s:lec_start_xmit: queuing packet, ", 374 pr_debug("%s:lec_start_xmit: queuing packet, ",
375 dev->name); 375 dev->name);
376 pr_debug("MAC address " MAC_FMT "\n", 376 pr_debug("MAC address %pM\n", lec_h->h_dest);
377 lec_h->h_dest[0], lec_h->h_dest[1],
378 lec_h->h_dest[2], lec_h->h_dest[3],
379 lec_h->h_dest[4], lec_h->h_dest[5]);
380 skb_queue_tail(&entry->tx_wait, skb); 377 skb_queue_tail(&entry->tx_wait, skb);
381 } else { 378 } else {
382 pr_debug 379 pr_debug
383 ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ", 380 ("%s:lec_start_xmit: tx queue full or no arp entry, dropping, ",
384 dev->name); 381 dev->name);
385 pr_debug("MAC address " MAC_FMT "\n", 382 pr_debug("MAC address %pM\n", lec_h->h_dest);
386 lec_h->h_dest[0], lec_h->h_dest[1],
387 lec_h->h_dest[2], lec_h->h_dest[3],
388 lec_h->h_dest[4], lec_h->h_dest[5]);
389 priv->stats.tx_dropped++; 383 priv->stats.tx_dropped++;
390 dev_kfree_skb(skb); 384 dev_kfree_skb(skb);
391 } 385 }
@@ -397,10 +391,7 @@ static int lec_start_xmit(struct sk_buff *skb, struct net_device *dev)
397 391
398 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) { 392 while (entry && (skb2 = skb_dequeue(&entry->tx_wait))) {
399 pr_debug("lec.c: emptying tx queue, "); 393 pr_debug("lec.c: emptying tx queue, ");
400 pr_debug("MAC address " MAC_FMT "\n", 394 pr_debug("MAC address %pM\n", lec_h->h_dest);
401 lec_h->h_dest[0], lec_h->h_dest[1],
402 lec_h->h_dest[2], lec_h->h_dest[3],
403 lec_h->h_dest[4], lec_h->h_dest[5]);
404 lec_send(vcc, skb2, priv); 395 lec_send(vcc, skb2, priv);
405 } 396 }
406 397
@@ -539,15 +530,8 @@ static int lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
539 { 530 {
540 struct net_bridge_fdb_entry *f; 531 struct net_bridge_fdb_entry *f;
541 532
542 pr_debug 533 pr_debug("%s: bridge zeppelin asks about %pM\n",
543 ("%s: bridge zeppelin asks about " MAC_FMT "\n", 534 dev->name, mesg->content.proxy.mac_addr);
544 dev->name,
545 mesg->content.proxy.mac_addr[0],
546 mesg->content.proxy.mac_addr[1],
547 mesg->content.proxy.mac_addr[2],
548 mesg->content.proxy.mac_addr[3],
549 mesg->content.proxy.mac_addr[4],
550 mesg->content.proxy.mac_addr[5]);
551 535
552 if (br_fdb_get_hook == NULL || dev->br_port == NULL) 536 if (br_fdb_get_hook == NULL || dev->br_port == NULL)
553 break; 537 break;
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c
index 3d33c608906a..5e7cff3542f2 100644
--- a/net/bridge/netfilter/ebt_log.c
+++ b/net/bridge/netfilter/ebt_log.c
@@ -133,10 +133,8 @@ ebt_log_packet(u_int8_t pf, unsigned int hooknum,
133 printk(" INCOMPLETE IPv6 header"); 133 printk(" INCOMPLETE IPv6 header");
134 goto out; 134 goto out;
135 } 135 }
136 printk(" IPv6 SRC=%x:%x:%x:%x:%x:%x:%x:%x " 136 printk(" IPv6 SRC=%pI6 IPv6 DST=%pI6, IPv6 priority=0x%01X, Next Header=%d",
137 "IPv6 DST=%x:%x:%x:%x:%x:%x:%x:%x, IPv6 " 137 &ih->saddr, &ih->daddr, ih->priority, ih->nexthdr);
138 "priority=0x%01X, Next Header=%d", NIP6(ih->saddr),
139 NIP6(ih->daddr), ih->priority, ih->nexthdr);
140 nexthdr = ih->nexthdr; 138 nexthdr = ih->nexthdr;
141 offset_ph = ipv6_skip_exthdr(skb, sizeof(_iph), &nexthdr); 139 offset_ph = ipv6_skip_exthdr(skb, sizeof(_iph), &nexthdr);
142 if (offset_ph == -1) 140 if (offset_ph == -1)
diff --git a/net/core/dev.c b/net/core/dev.c
index d9038e328cc1..3a2b8be9e67b 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -924,10 +924,15 @@ int dev_change_name(struct net_device *dev, const char *newname)
924 strlcpy(dev->name, newname, IFNAMSIZ); 924 strlcpy(dev->name, newname, IFNAMSIZ);
925 925
926rollback: 926rollback:
927 ret = device_rename(&dev->dev, dev->name); 927 /* For now only devices in the initial network namespace
928 if (ret) { 928 * are in sysfs.
929 memcpy(dev->name, oldname, IFNAMSIZ); 929 */
930 return ret; 930 if (net == &init_net) {
931 ret = device_rename(&dev->dev, dev->name);
932 if (ret) {
933 memcpy(dev->name, oldname, IFNAMSIZ);
934 return ret;
935 }
931 } 936 }
932 937
933 write_lock_bh(&dev_base_lock); 938 write_lock_bh(&dev_base_lock);
@@ -4460,6 +4465,15 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
4460 if (dev->features & NETIF_F_NETNS_LOCAL) 4465 if (dev->features & NETIF_F_NETNS_LOCAL)
4461 goto out; 4466 goto out;
4462 4467
4468#ifdef CONFIG_SYSFS
4469 /* Don't allow real devices to be moved when sysfs
4470 * is enabled.
4471 */
4472 err = -EINVAL;
4473 if (dev->dev.parent)
4474 goto out;
4475#endif
4476
4463 /* Ensure the device has been registrered */ 4477 /* Ensure the device has been registrered */
4464 err = -EINVAL; 4478 err = -EINVAL;
4465 if (dev->reg_state != NETREG_REGISTERED) 4479 if (dev->reg_state != NETREG_REGISTERED)
@@ -4517,6 +4531,8 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
4517 */ 4531 */
4518 dev_addr_discard(dev); 4532 dev_addr_discard(dev);
4519 4533
4534 netdev_unregister_kobject(dev);
4535
4520 /* Actually switch the network namespace */ 4536 /* Actually switch the network namespace */
4521 dev_net_set(dev, net); 4537 dev_net_set(dev, net);
4522 4538
@@ -4533,7 +4549,6 @@ int dev_change_net_namespace(struct net_device *dev, struct net *net, const char
4533 } 4549 }
4534 4550
4535 /* Fixup kobjects */ 4551 /* Fixup kobjects */
4536 netdev_unregister_kobject(dev);
4537 err = netdev_register_kobject(dev); 4552 err = netdev_register_kobject(dev);
4538 WARN_ON(err); 4553 WARN_ON(err);
4539 4554
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 1dc728b38589..b337a937ea52 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -1340,7 +1340,6 @@ struct neigh_parms *neigh_parms_alloc(struct net_device *dev,
1340 if (p) { 1340 if (p) {
1341 p->tbl = tbl; 1341 p->tbl = tbl;
1342 atomic_set(&p->refcnt, 1); 1342 atomic_set(&p->refcnt, 1);
1343 INIT_RCU_HEAD(&p->rcu_head);
1344 p->reachable_time = 1343 p->reachable_time =
1345 neigh_rand_reach_time(p->base_reachable_time); 1344 neigh_rand_reach_time(p->base_reachable_time);
1346 1345
@@ -1412,7 +1411,6 @@ void neigh_table_init_no_netlink(struct neigh_table *tbl)
1412 tbl->parms.net = &init_net; 1411 tbl->parms.net = &init_net;
1413#endif 1412#endif
1414 atomic_set(&tbl->parms.refcnt, 1); 1413 atomic_set(&tbl->parms.refcnt, 1);
1415 INIT_RCU_HEAD(&tbl->parms.rcu_head);
1416 tbl->parms.reachable_time = 1414 tbl->parms.reachable_time =
1417 neigh_rand_reach_time(tbl->parms.base_reachable_time); 1415 neigh_rand_reach_time(tbl->parms.base_reachable_time);
1418 1416
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index 92d6b9467314..85cb8bdcfb8f 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -476,6 +476,10 @@ void netdev_unregister_kobject(struct net_device * net)
476 struct device *dev = &(net->dev); 476 struct device *dev = &(net->dev);
477 477
478 kobject_get(&dev->kobj); 478 kobject_get(&dev->kobj);
479
480 if (dev_net(net) != &init_net)
481 return;
482
479 device_del(dev); 483 device_del(dev);
480} 484}
481 485
@@ -501,6 +505,9 @@ int netdev_register_kobject(struct net_device *net)
501#endif 505#endif
502#endif /* CONFIG_SYSFS */ 506#endif /* CONFIG_SYSFS */
503 507
508 if (dev_net(net) != &init_net)
509 return 0;
510
504 return device_add(dev); 511 return device_add(dev);
505} 512}
506 513
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 1895a4ca9c4f..55cffad2f328 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -47,7 +47,6 @@ static __net_init int setup_net(struct net *net)
47 goto out; 47 goto out;
48 48
49 ng->len = INITIAL_NET_GEN_PTRS; 49 ng->len = INITIAL_NET_GEN_PTRS;
50 INIT_RCU_HEAD(&ng->rcu);
51 rcu_assign_pointer(net->gen, ng); 50 rcu_assign_pointer(net->gen, ng);
52 51
53 error = 0; 52 error = 0;
@@ -478,7 +477,6 @@ int net_assign_generic(struct net *net, int id, void *data)
478 */ 477 */
479 478
480 ng->len = id; 479 ng->len = id;
481 INIT_RCU_HEAD(&ng->rcu);
482 memcpy(&ng->ptr, &old_ng->ptr, old_ng->len); 480 memcpy(&ng->ptr, &old_ng->ptr, old_ng->len);
483 481
484 rcu_assign_pointer(net->gen, ng); 482 rcu_assign_pointer(net->gen, ng);
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 6c7af390be0a..34f5d072f168 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -553,7 +553,6 @@ out:
553 553
554void netpoll_print_options(struct netpoll *np) 554void netpoll_print_options(struct netpoll *np)
555{ 555{
556 DECLARE_MAC_BUF(mac);
557 printk(KERN_INFO "%s: local port %d\n", 556 printk(KERN_INFO "%s: local port %d\n",
558 np->name, np->local_port); 557 np->name, np->local_port);
559 printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n", 558 printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n",
@@ -564,8 +563,8 @@ void netpoll_print_options(struct netpoll *np)
564 np->name, np->remote_port); 563 np->name, np->remote_port);
565 printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n", 564 printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n",
566 np->name, HIPQUAD(np->remote_ip)); 565 np->name, HIPQUAD(np->remote_ip));
567 printk(KERN_INFO "%s: remote ethernet address %s\n", 566 printk(KERN_INFO "%s: remote ethernet address %pM\n",
568 np->name, print_mac(mac, np->remote_mac)); 567 np->name, np->remote_mac);
569} 568}
570 569
571int netpoll_parse_options(struct netpoll *np, char *opt) 570int netpoll_parse_options(struct netpoll *np, char *opt)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index a47f5bad110d..fa4973bf73e9 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -509,7 +509,6 @@ static int pktgen_if_show(struct seq_file *seq, void *v)
509 __u64 sa; 509 __u64 sa;
510 __u64 stopped; 510 __u64 stopped;
511 __u64 now = getCurUs(); 511 __u64 now = getCurUs();
512 DECLARE_MAC_BUF(mac);
513 512
514 seq_printf(seq, 513 seq_printf(seq,
515 "Params: count %llu min_pkt_size: %u max_pkt_size: %u\n", 514 "Params: count %llu min_pkt_size: %u max_pkt_size: %u\n",
@@ -554,12 +553,12 @@ static int pktgen_if_show(struct seq_file *seq, void *v)
554 553
555 seq_puts(seq, " src_mac: "); 554 seq_puts(seq, " src_mac: ");
556 555
557 seq_printf(seq, "%s ", 556 seq_printf(seq, "%pM ",
558 print_mac(mac, is_zero_ether_addr(pkt_dev->src_mac) ? 557 is_zero_ether_addr(pkt_dev->src_mac) ?
559 pkt_dev->odev->dev_addr : pkt_dev->src_mac)); 558 pkt_dev->odev->dev_addr : pkt_dev->src_mac);
560 559
561 seq_printf(seq, "dst_mac: "); 560 seq_printf(seq, "dst_mac: ");
562 seq_printf(seq, "%s\n", print_mac(mac, pkt_dev->dst_mac)); 561 seq_printf(seq, "%pM\n", pkt_dev->dst_mac);
563 562
564 seq_printf(seq, 563 seq_printf(seq,
565 " udp_src_min: %d udp_src_max: %d udp_dst_min: %d udp_dst_max: %d\n", 564 " udp_src_min: %d udp_src_max: %d udp_dst_min: %d udp_dst_max: %d\n",
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 4e22e3a35359..cdfe473181af 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -489,7 +489,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
489 new->network_header = old->network_header; 489 new->network_header = old->network_header;
490 new->mac_header = old->mac_header; 490 new->mac_header = old->mac_header;
491 new->dst = dst_clone(old->dst); 491 new->dst = dst_clone(old->dst);
492#ifdef CONFIG_INET 492#ifdef CONFIG_XFRM
493 new->sp = secpath_get(old->sp); 493 new->sp = secpath_get(old->sp);
494#endif 494#endif
495 memcpy(new->cb, old->cb, sizeof(old->cb)); 495 memcpy(new->cb, old->cb, sizeof(old->cb));
diff --git a/net/core/sock.c b/net/core/sock.c
index 5e2a3132a8c9..ded1eb5d2fd4 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2042,7 +2042,8 @@ int proto_register(struct proto *prot, int alloc_slab)
2042 2042
2043 if (alloc_slab) { 2043 if (alloc_slab) {
2044 prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0, 2044 prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0,
2045 SLAB_HWCACHE_ALIGN, NULL); 2045 SLAB_HWCACHE_ALIGN | prot->slab_flags,
2046 NULL);
2046 2047
2047 if (prot->slab == NULL) { 2048 if (prot->slab == NULL) {
2048 printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n", 2049 printk(KERN_CRIT "%s: Can't create sock SLAB cache!\n",
diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c b/net/ieee80211/ieee80211_crypt_ccmp.c
index 208bf35b5546..bea04af0b482 100644
--- a/net/ieee80211/ieee80211_crypt_ccmp.c
+++ b/net/ieee80211/ieee80211_crypt_ccmp.c
@@ -296,7 +296,6 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
296 int i, blocks, last, len; 296 int i, blocks, last, len;
297 size_t data_len = skb->len - hdr_len - CCMP_HDR_LEN - CCMP_MIC_LEN; 297 size_t data_len = skb->len - hdr_len - CCMP_HDR_LEN - CCMP_MIC_LEN;
298 u8 *mic = skb->data + skb->len - CCMP_MIC_LEN; 298 u8 *mic = skb->data + skb->len - CCMP_MIC_LEN;
299 DECLARE_MAC_BUF(mac);
300 299
301 if (skb->len < hdr_len + CCMP_HDR_LEN + CCMP_MIC_LEN) { 300 if (skb->len < hdr_len + CCMP_HDR_LEN + CCMP_MIC_LEN) {
302 key->dot11RSNAStatsCCMPFormatErrors++; 301 key->dot11RSNAStatsCCMPFormatErrors++;
@@ -309,7 +308,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
309 if (!(keyidx & (1 << 5))) { 308 if (!(keyidx & (1 << 5))) {
310 if (net_ratelimit()) { 309 if (net_ratelimit()) {
311 printk(KERN_DEBUG "CCMP: received packet without ExtIV" 310 printk(KERN_DEBUG "CCMP: received packet without ExtIV"
312 " flag from %s\n", print_mac(mac, hdr->addr2)); 311 " flag from %pM\n", hdr->addr2);
313 } 312 }
314 key->dot11RSNAStatsCCMPFormatErrors++; 313 key->dot11RSNAStatsCCMPFormatErrors++;
315 return -2; 314 return -2;
@@ -322,9 +321,9 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
322 } 321 }
323 if (!key->key_set) { 322 if (!key->key_set) {
324 if (net_ratelimit()) { 323 if (net_ratelimit()) {
325 printk(KERN_DEBUG "CCMP: received packet from %s" 324 printk(KERN_DEBUG "CCMP: received packet from %pM"
326 " with keyid=%d that does not have a configured" 325 " with keyid=%d that does not have a configured"
327 " key\n", print_mac(mac, hdr->addr2), keyidx); 326 " key\n", hdr->addr2, keyidx);
328 } 327 }
329 return -3; 328 return -3;
330 } 329 }
@@ -339,10 +338,10 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
339 338
340 if (ccmp_replay_check(pn, key->rx_pn)) { 339 if (ccmp_replay_check(pn, key->rx_pn)) {
341 if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) { 340 if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
342 IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=%s " 341 IEEE80211_DEBUG_DROP("CCMP: replay detected: STA=%pM "
343 "previous PN %02x%02x%02x%02x%02x%02x " 342 "previous PN %02x%02x%02x%02x%02x%02x "
344 "received PN %02x%02x%02x%02x%02x%02x\n", 343 "received PN %02x%02x%02x%02x%02x%02x\n",
345 print_mac(mac, hdr->addr2), 344 hdr->addr2,
346 key->rx_pn[0], key->rx_pn[1], key->rx_pn[2], 345 key->rx_pn[0], key->rx_pn[1], key->rx_pn[2],
347 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5], 346 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5],
348 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]); 347 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]);
@@ -373,7 +372,7 @@ static int ieee80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
373 if (memcmp(mic, a, CCMP_MIC_LEN) != 0) { 372 if (memcmp(mic, a, CCMP_MIC_LEN) != 0) {
374 if (net_ratelimit()) { 373 if (net_ratelimit()) {
375 printk(KERN_DEBUG "CCMP: decrypt failed: STA=" 374 printk(KERN_DEBUG "CCMP: decrypt failed: STA="
376 "%s\n", print_mac(mac, hdr->addr2)); 375 "%pM\n", hdr->addr2);
377 } 376 }
378 key->dot11RSNAStatsCCMPDecryptErrors++; 377 key->dot11RSNAStatsCCMPDecryptErrors++;
379 return -5; 378 return -5;
diff --git a/net/ieee80211/ieee80211_crypt_tkip.c b/net/ieee80211/ieee80211_crypt_tkip.c
index bba0152e2d71..d12da1da6328 100644
--- a/net/ieee80211/ieee80211_crypt_tkip.c
+++ b/net/ieee80211/ieee80211_crypt_tkip.c
@@ -359,15 +359,13 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
359 u8 rc4key[16], *pos, *icv; 359 u8 rc4key[16], *pos, *icv;
360 u32 crc; 360 u32 crc;
361 struct scatterlist sg; 361 struct scatterlist sg;
362 DECLARE_MAC_BUF(mac);
363 362
364 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) { 363 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) {
365 if (net_ratelimit()) { 364 if (net_ratelimit()) {
366 struct ieee80211_hdr_4addr *hdr = 365 struct ieee80211_hdr_4addr *hdr =
367 (struct ieee80211_hdr_4addr *)skb->data; 366 (struct ieee80211_hdr_4addr *)skb->data;
368 printk(KERN_DEBUG ": TKIP countermeasures: dropped " 367 printk(KERN_DEBUG ": TKIP countermeasures: dropped "
369 "TX packet to %s\n", 368 "TX packet to %pM\n", hdr->addr1);
370 print_mac(mac, hdr->addr1));
371 } 369 }
372 return -1; 370 return -1;
373 } 371 }
@@ -420,15 +418,13 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
420 u32 crc; 418 u32 crc;
421 struct scatterlist sg; 419 struct scatterlist sg;
422 int plen; 420 int plen;
423 DECLARE_MAC_BUF(mac);
424 421
425 hdr = (struct ieee80211_hdr_4addr *)skb->data; 422 hdr = (struct ieee80211_hdr_4addr *)skb->data;
426 423
427 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) { 424 if (tkey->flags & IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) {
428 if (net_ratelimit()) { 425 if (net_ratelimit()) {
429 printk(KERN_DEBUG ": TKIP countermeasures: dropped " 426 printk(KERN_DEBUG ": TKIP countermeasures: dropped "
430 "received packet from %s\n", 427 "received packet from %pM\n", hdr->addr2);
431 print_mac(mac, hdr->addr2));
432 } 428 }
433 return -1; 429 return -1;
434 } 430 }
@@ -441,7 +437,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
441 if (!(keyidx & (1 << 5))) { 437 if (!(keyidx & (1 << 5))) {
442 if (net_ratelimit()) { 438 if (net_ratelimit()) {
443 printk(KERN_DEBUG "TKIP: received packet without ExtIV" 439 printk(KERN_DEBUG "TKIP: received packet without ExtIV"
444 " flag from %s\n", print_mac(mac, hdr->addr2)); 440 " flag from %pM\n", hdr->addr2);
445 } 441 }
446 return -2; 442 return -2;
447 } 443 }
@@ -453,9 +449,9 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
453 } 449 }
454 if (!tkey->key_set) { 450 if (!tkey->key_set) {
455 if (net_ratelimit()) { 451 if (net_ratelimit()) {
456 printk(KERN_DEBUG "TKIP: received packet from %s" 452 printk(KERN_DEBUG "TKIP: received packet from %pM"
457 " with keyid=%d that does not have a configured" 453 " with keyid=%d that does not have a configured"
458 " key\n", print_mac(mac, hdr->addr2), keyidx); 454 " key\n", hdr->addr2, keyidx);
459 } 455 }
460 return -3; 456 return -3;
461 } 457 }
@@ -465,9 +461,9 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
465 461
466 if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) { 462 if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
467 if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) { 463 if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
468 IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%s" 464 IEEE80211_DEBUG_DROP("TKIP: replay detected: STA=%pM"
469 " previous TSC %08x%04x received TSC " 465 " previous TSC %08x%04x received TSC "
470 "%08x%04x\n", print_mac(mac, hdr->addr2), 466 "%08x%04x\n", hdr->addr2,
471 tkey->rx_iv32, tkey->rx_iv16, iv32, iv16); 467 tkey->rx_iv32, tkey->rx_iv16, iv32, iv16);
472 } 468 }
473 tkey->dot11RSNAStatsTKIPReplays++; 469 tkey->dot11RSNAStatsTKIPReplays++;
@@ -487,8 +483,8 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
487 if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) { 483 if (crypto_blkcipher_decrypt(&desc, &sg, &sg, plen + 4)) {
488 if (net_ratelimit()) { 484 if (net_ratelimit()) {
489 printk(KERN_DEBUG ": TKIP: failed to decrypt " 485 printk(KERN_DEBUG ": TKIP: failed to decrypt "
490 "received packet from %s\n", 486 "received packet from %pM\n",
491 print_mac(mac, hdr->addr2)); 487 hdr->addr2);
492 } 488 }
493 return -7; 489 return -7;
494 } 490 }
@@ -506,7 +502,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
506 } 502 }
507 if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) { 503 if (ieee80211_ratelimit_debug(IEEE80211_DL_DROP)) {
508 IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA=" 504 IEEE80211_DEBUG_DROP("TKIP: ICV error detected: STA="
509 "%s\n", print_mac(mac, hdr->addr2)); 505 "%pM\n", hdr->addr2);
510 } 506 }
511 tkey->dot11RSNAStatsTKIPICVErrors++; 507 tkey->dot11RSNAStatsTKIPICVErrors++;
512 return -5; 508 return -5;
@@ -633,7 +629,6 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
633{ 629{
634 struct ieee80211_tkip_data *tkey = priv; 630 struct ieee80211_tkip_data *tkey = priv;
635 u8 mic[8]; 631 u8 mic[8];
636 DECLARE_MAC_BUF(mac);
637 632
638 if (!tkey->key_set) 633 if (!tkey->key_set)
639 return -1; 634 return -1;
@@ -646,8 +641,8 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
646 struct ieee80211_hdr_4addr *hdr; 641 struct ieee80211_hdr_4addr *hdr;
647 hdr = (struct ieee80211_hdr_4addr *)skb->data; 642 hdr = (struct ieee80211_hdr_4addr *)skb->data;
648 printk(KERN_DEBUG "%s: Michael MIC verification failed for " 643 printk(KERN_DEBUG "%s: Michael MIC verification failed for "
649 "MSDU from %s keyidx=%d\n", 644 "MSDU from %pM keyidx=%d\n",
650 skb->dev ? skb->dev->name : "N/A", print_mac(mac, hdr->addr2), 645 skb->dev ? skb->dev->name : "N/A", hdr->addr2,
651 keyidx); 646 keyidx);
652 if (skb->dev) 647 if (skb->dev)
653 ieee80211_michael_mic_failure(skb->dev, hdr, keyidx); 648 ieee80211_michael_mic_failure(skb->dev, hdr, keyidx);
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
index 69dbc342a464..281223e41c58 100644
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -282,12 +282,8 @@ ieee80211_rx_frame_decrypt(struct ieee80211_device *ieee, struct sk_buff *skb,
282 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv); 282 res = crypt->ops->decrypt_mpdu(skb, hdrlen, crypt->priv);
283 atomic_dec(&crypt->refcnt); 283 atomic_dec(&crypt->refcnt);
284 if (res < 0) { 284 if (res < 0) {
285 IEEE80211_DEBUG_DROP("decryption failed (SA=" MAC_FMT 285 IEEE80211_DEBUG_DROP("decryption failed (SA=%pM) res=%d\n",
286 ") res=%d\n", 286 hdr->addr2, res);
287 hdr->addr2[0], hdr->addr2[1],
288 hdr->addr2[2], hdr->addr2[3],
289 hdr->addr2[4], hdr->addr2[5],
290 res);
291 if (res == -2) 287 if (res == -2)
292 IEEE80211_DEBUG_DROP("Decryption failed ICV " 288 IEEE80211_DEBUG_DROP("Decryption failed ICV "
293 "mismatch (key %d)\n", 289 "mismatch (key %d)\n",
@@ -319,11 +315,7 @@ ieee80211_rx_frame_decrypt_msdu(struct ieee80211_device *ieee,
319 atomic_dec(&crypt->refcnt); 315 atomic_dec(&crypt->refcnt);
320 if (res < 0) { 316 if (res < 0) {
321 printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed" 317 printk(KERN_DEBUG "%s: MSDU decryption/MIC verification failed"
322 " (SA=" MAC_FMT " keyidx=%d)\n", 318 " (SA=%pM keyidx=%d)\n", ieee->dev->name, hdr->addr2,
323 ieee->dev->name,
324 hdr->addr2[0], hdr->addr2[1],
325 hdr->addr2[2], hdr->addr2[3],
326 hdr->addr2[4], hdr->addr2[5],
327 keyidx); 319 keyidx);
328 return -1; 320 return -1;
329 } 321 }
@@ -358,7 +350,6 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
358 struct ieee80211_crypt_data *crypt = NULL; 350 struct ieee80211_crypt_data *crypt = NULL;
359 int keyidx = 0; 351 int keyidx = 0;
360 int can_be_decrypted = 0; 352 int can_be_decrypted = 0;
361 DECLARE_MAC_BUF(mac);
362 353
363 hdr = (struct ieee80211_hdr_4addr *)skb->data; 354 hdr = (struct ieee80211_hdr_4addr *)skb->data;
364 stats = &ieee->stats; 355 stats = &ieee->stats;
@@ -468,10 +459,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
468 * frames silently instead of filling system log with 459 * frames silently instead of filling system log with
469 * these reports. */ 460 * these reports. */
470 IEEE80211_DEBUG_DROP("Decryption failed (not set)" 461 IEEE80211_DEBUG_DROP("Decryption failed (not set)"
471 " (SA=" MAC_FMT ")\n", 462 " (SA=%pM)\n", hdr->addr2);
472 hdr->addr2[0], hdr->addr2[1],
473 hdr->addr2[2], hdr->addr2[3],
474 hdr->addr2[4], hdr->addr2[5]);
475 ieee->ieee_stats.rx_discards_undecryptable++; 463 ieee->ieee_stats.rx_discards_undecryptable++;
476 goto rx_dropped; 464 goto rx_dropped;
477 } 465 }
@@ -482,10 +470,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
482 fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt && 470 fc & IEEE80211_FCTL_PROTECTED && ieee->host_decrypt &&
483 (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) { 471 (keyidx = hostap_rx_frame_decrypt(ieee, skb, crypt)) < 0) {
484 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth " 472 printk(KERN_DEBUG "%s: failed to decrypt mgmt::auth "
485 "from " MAC_FMT "\n", dev->name, 473 "from %pM\n", dev->name, hdr->addr2);
486 hdr->addr2[0], hdr->addr2[1],
487 hdr->addr2[2], hdr->addr2[3],
488 hdr->addr2[4], hdr->addr2[5]);
489 /* TODO: could inform hostapd about this so that it 474 /* TODO: could inform hostapd about this so that it
490 * could send auth failure report */ 475 * could send auth failure report */
491 goto rx_dropped; 476 goto rx_dropped;
@@ -663,11 +648,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
663 * configured */ 648 * configured */
664 } else { 649 } else {
665 IEEE80211_DEBUG_DROP("encryption configured, but RX " 650 IEEE80211_DEBUG_DROP("encryption configured, but RX "
666 "frame not encrypted (SA=" 651 "frame not encrypted (SA=%pM)\n",
667 MAC_FMT ")\n", 652 hdr->addr2);
668 hdr->addr2[0], hdr->addr2[1],
669 hdr->addr2[2], hdr->addr2[3],
670 hdr->addr2[4], hdr->addr2[5]);
671 goto rx_dropped; 653 goto rx_dropped;
672 } 654 }
673 } 655 }
@@ -675,11 +657,8 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
675 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep && 657 if (crypt && !(fc & IEEE80211_FCTL_PROTECTED) && !ieee->open_wep &&
676 !ieee80211_is_eapol_frame(ieee, skb)) { 658 !ieee80211_is_eapol_frame(ieee, skb)) {
677 IEEE80211_DEBUG_DROP("dropped unencrypted RX data " 659 IEEE80211_DEBUG_DROP("dropped unencrypted RX data "
678 "frame from " MAC_FMT 660 "frame from %pM (drop_unencrypted=1)\n",
679 " (drop_unencrypted=1)\n", 661 hdr->addr2);
680 hdr->addr2[0], hdr->addr2[1],
681 hdr->addr2[2], hdr->addr2[3],
682 hdr->addr2[4], hdr->addr2[5]);
683 goto rx_dropped; 662 goto rx_dropped;
684 } 663 }
685 664
@@ -1429,8 +1408,6 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1429 struct ieee80211_network *network, 1408 struct ieee80211_network *network,
1430 struct ieee80211_rx_stats *stats) 1409 struct ieee80211_rx_stats *stats)
1431{ 1410{
1432 DECLARE_MAC_BUF(mac);
1433
1434 network->qos_data.active = 0; 1411 network->qos_data.active = 0;
1435 network->qos_data.supported = 0; 1412 network->qos_data.supported = 0;
1436 network->qos_data.param_count = 0; 1413 network->qos_data.param_count = 0;
@@ -1477,11 +1454,11 @@ static int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee8021
1477 } 1454 }
1478 1455
1479 if (network->mode == 0) { 1456 if (network->mode == 0) {
1480 IEEE80211_DEBUG_SCAN("Filtered out '%s (%s)' " 1457 IEEE80211_DEBUG_SCAN("Filtered out '%s (%pM)' "
1481 "network.\n", 1458 "network.\n",
1482 escape_essid(network->ssid, 1459 escape_essid(network->ssid,
1483 network->ssid_len), 1460 network->ssid_len),
1484 print_mac(mac, network->bssid)); 1461 network->bssid);
1485 return 1; 1462 return 1;
1486 } 1463 }
1487 1464
@@ -1510,7 +1487,6 @@ static void update_network(struct ieee80211_network *dst,
1510{ 1487{
1511 int qos_active; 1488 int qos_active;
1512 u8 old_param; 1489 u8 old_param;
1513 DECLARE_MAC_BUF(mac);
1514 1490
1515 ieee80211_network_reset(dst); 1491 ieee80211_network_reset(dst);
1516 dst->ibss_dfs = src->ibss_dfs; 1492 dst->ibss_dfs = src->ibss_dfs;
@@ -1524,8 +1500,8 @@ static void update_network(struct ieee80211_network *dst,
1524 memcpy(&dst->stats, &src->stats, 1500 memcpy(&dst->stats, &src->stats,
1525 sizeof(struct ieee80211_rx_stats)); 1501 sizeof(struct ieee80211_rx_stats));
1526 else 1502 else
1527 IEEE80211_DEBUG_SCAN("Network %s info received " 1503 IEEE80211_DEBUG_SCAN("Network %pM info received "
1528 "off channel (%d vs. %d)\n", print_mac(mac, src->bssid), 1504 "off channel (%d vs. %d)\n", src->bssid,
1529 dst->channel, src->stats.received_channel); 1505 dst->channel, src->stats.received_channel);
1530 1506
1531 dst->capability = src->capability; 1507 dst->capability = src->capability;
@@ -1597,12 +1573,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1597 struct ieee80211_info_element *info_element = beacon->info_element; 1573 struct ieee80211_info_element *info_element = beacon->info_element;
1598#endif 1574#endif
1599 unsigned long flags; 1575 unsigned long flags;
1600 DECLARE_MAC_BUF(mac);
1601 1576
1602 IEEE80211_DEBUG_SCAN("'%s' (%s" 1577 IEEE80211_DEBUG_SCAN("'%s' (%pM"
1603 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n", 1578 "): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
1604 escape_essid(info_element->data, info_element->len), 1579 escape_essid(info_element->data, info_element->len),
1605 print_mac(mac, beacon->header.addr3), 1580 beacon->header.addr3,
1606 (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0', 1581 (beacon->capability & cpu_to_le16(1 << 0xf)) ? '1' : '0',
1607 (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0', 1582 (beacon->capability & cpu_to_le16(1 << 0xe)) ? '1' : '0',
1608 (beacon->capability & cpu_to_le16(1 << 0xd)) ? '1' : '0', 1583 (beacon->capability & cpu_to_le16(1 << 0xd)) ? '1' : '0',
@@ -1621,10 +1596,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1621 (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0'); 1596 (beacon->capability & cpu_to_le16(1 << 0x0)) ? '1' : '0');
1622 1597
1623 if (ieee80211_network_init(ieee, beacon, &network, stats)) { 1598 if (ieee80211_network_init(ieee, beacon, &network, stats)) {
1624 IEEE80211_DEBUG_SCAN("Dropped '%s' (%s) via %s.\n", 1599 IEEE80211_DEBUG_SCAN("Dropped '%s' (%pM) via %s.\n",
1625 escape_essid(info_element->data, 1600 escape_essid(info_element->data,
1626 info_element->len), 1601 info_element->len),
1627 print_mac(mac, beacon->header.addr3), 1602 beacon->header.addr3,
1628 is_beacon(beacon->header.frame_ctl) ? 1603 is_beacon(beacon->header.frame_ctl) ?
1629 "BEACON" : "PROBE RESPONSE"); 1604 "BEACON" : "PROBE RESPONSE");
1630 return; 1605 return;
@@ -1658,11 +1633,11 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1658 /* If there are no more slots, expire the oldest */ 1633 /* If there are no more slots, expire the oldest */
1659 list_del(&oldest->list); 1634 list_del(&oldest->list);
1660 target = oldest; 1635 target = oldest;
1661 IEEE80211_DEBUG_SCAN("Expired '%s' (%s) from " 1636 IEEE80211_DEBUG_SCAN("Expired '%s' (%pM) from "
1662 "network list.\n", 1637 "network list.\n",
1663 escape_essid(target->ssid, 1638 escape_essid(target->ssid,
1664 target->ssid_len), 1639 target->ssid_len),
1665 print_mac(mac, target->bssid)); 1640 target->bssid);
1666 ieee80211_network_reset(target); 1641 ieee80211_network_reset(target);
1667 } else { 1642 } else {
1668 /* Otherwise just pull from the free list */ 1643 /* Otherwise just pull from the free list */
@@ -1672,10 +1647,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1672 } 1647 }
1673 1648
1674#ifdef CONFIG_IEEE80211_DEBUG 1649#ifdef CONFIG_IEEE80211_DEBUG
1675 IEEE80211_DEBUG_SCAN("Adding '%s' (%s) via %s.\n", 1650 IEEE80211_DEBUG_SCAN("Adding '%s' (%pM) via %s.\n",
1676 escape_essid(network.ssid, 1651 escape_essid(network.ssid,
1677 network.ssid_len), 1652 network.ssid_len),
1678 print_mac(mac, network.bssid), 1653 network.bssid,
1679 is_beacon(beacon->header.frame_ctl) ? 1654 is_beacon(beacon->header.frame_ctl) ?
1680 "BEACON" : "PROBE RESPONSE"); 1655 "BEACON" : "PROBE RESPONSE");
1681#endif 1656#endif
@@ -1683,10 +1658,10 @@ static void ieee80211_process_probe_response(struct ieee80211_device
1683 network.ibss_dfs = NULL; 1658 network.ibss_dfs = NULL;
1684 list_add_tail(&target->list, &ieee->network_list); 1659 list_add_tail(&target->list, &ieee->network_list);
1685 } else { 1660 } else {
1686 IEEE80211_DEBUG_SCAN("Updating '%s' (%s) via %s.\n", 1661 IEEE80211_DEBUG_SCAN("Updating '%s' (%pM) via %s.\n",
1687 escape_essid(target->ssid, 1662 escape_essid(target->ssid,
1688 target->ssid_len), 1663 target->ssid_len),
1689 print_mac(mac, target->bssid), 1664 target->bssid,
1690 is_beacon(beacon->header.frame_ctl) ? 1665 is_beacon(beacon->header.frame_ctl) ?
1691 "BEACON" : "PROBE RESPONSE"); 1666 "BEACON" : "PROBE RESPONSE");
1692 update_network(target, &network); 1667 update_network(target, &network);
diff --git a/net/ieee80211/ieee80211_wx.c b/net/ieee80211/ieee80211_wx.c
index 973832dd7faf..89a81062ab4b 100644
--- a/net/ieee80211/ieee80211_wx.c
+++ b/net/ieee80211/ieee80211_wx.c
@@ -264,7 +264,6 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
264 char *ev = extra; 264 char *ev = extra;
265 char *stop = ev + wrqu->data.length; 265 char *stop = ev + wrqu->data.length;
266 int i = 0; 266 int i = 0;
267 DECLARE_MAC_BUF(mac);
268 267
269 IEEE80211_DEBUG_WX("Getting scan\n"); 268 IEEE80211_DEBUG_WX("Getting scan\n");
270 269
@@ -283,10 +282,10 @@ int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
283 info); 282 info);
284 else 283 else
285 IEEE80211_DEBUG_SCAN("Not showing network '%s (" 284 IEEE80211_DEBUG_SCAN("Not showing network '%s ("
286 "%s)' due to age (%dms).\n", 285 "%pM)' due to age (%dms).\n",
287 escape_essid(network->ssid, 286 escape_essid(network->ssid,
288 network->ssid_len), 287 network->ssid_len),
289 print_mac(mac, network->bssid), 288 network->bssid,
290 jiffies_to_msecs(jiffies - 289 jiffies_to_msecs(jiffies -
291 network-> 290 network->
292 last_scanned)); 291 last_scanned));
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 2e78f6bd9775..e52799047a5f 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -490,7 +490,6 @@ int cipso_v4_doi_add(struct cipso_v4_doi *doi_def)
490 } 490 }
491 491
492 atomic_set(&doi_def->refcount, 1); 492 atomic_set(&doi_def->refcount, 1);
493 INIT_RCU_HEAD(&doi_def->rcu);
494 493
495 spin_lock(&cipso_v4_doi_list_lock); 494 spin_lock(&cipso_v4_doi_list_lock);
496 if (cipso_v4_doi_search(doi_def->doi) != NULL) 495 if (cipso_v4_doi_search(doi_def->doi) != NULL)
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index 56fce3ab6c55..0bff576d2918 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -112,13 +112,7 @@ static inline void devinet_sysctl_unregister(struct in_device *idev)
112 112
113static struct in_ifaddr *inet_alloc_ifa(void) 113static struct in_ifaddr *inet_alloc_ifa(void)
114{ 114{
115 struct in_ifaddr *ifa = kzalloc(sizeof(*ifa), GFP_KERNEL); 115 return kzalloc(sizeof(struct in_ifaddr), GFP_KERNEL);
116
117 if (ifa) {
118 INIT_RCU_HEAD(&ifa->rcu_head);
119 }
120
121 return ifa;
122} 116}
123 117
124static void inet_rcu_free_ifa(struct rcu_head *head) 118static void inet_rcu_free_ifa(struct rcu_head *head)
@@ -161,7 +155,6 @@ static struct in_device *inetdev_init(struct net_device *dev)
161 in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL); 155 in_dev = kzalloc(sizeof(*in_dev), GFP_KERNEL);
162 if (!in_dev) 156 if (!in_dev)
163 goto out; 157 goto out;
164 INIT_RCU_HEAD(&in_dev->rcu_head);
165 memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt, 158 memcpy(&in_dev->cnf, dev_net(dev)->ipv4.devconf_dflt,
166 sizeof(in_dev->cnf)); 159 sizeof(in_dev->cnf));
167 in_dev->cnf.sysctl = NULL; 160 in_dev->cnf.sysctl = NULL;
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 72b2de76f1cd..e9d6ea0b49ca 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -976,9 +976,10 @@ int icmp_rcv(struct sk_buff *skb)
976 struct net *net = dev_net(rt->u.dst.dev); 976 struct net *net = dev_net(rt->u.dst.dev);
977 977
978 if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) { 978 if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) {
979 struct sec_path *sp = skb_sec_path(skb);
979 int nh; 980 int nh;
980 981
981 if (!(skb->sp && skb->sp->xvec[skb->sp->len - 1]->props.flags & 982 if (!(sp && sp->xvec[sp->len - 1]->props.flags &
982 XFRM_STATE_ICMP)) 983 XFRM_STATE_ICMP))
983 goto drop; 984 goto drop;
984 985
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
index 450016b89a18..df3fe50bbf0d 100644
--- a/net/ipv4/ip_forward.c
+++ b/net/ipv4/ip_forward.c
@@ -106,7 +106,7 @@ int ip_forward(struct sk_buff *skb)
106 * We now generate an ICMP HOST REDIRECT giving the route 106 * We now generate an ICMP HOST REDIRECT giving the route
107 * we calculated. 107 * we calculated.
108 */ 108 */
109 if (rt->rt_flags&RTCF_DOREDIRECT && !opt->srr && !skb->sp) 109 if (rt->rt_flags&RTCF_DOREDIRECT && !opt->srr && !skb_sec_path(skb))
110 ip_rt_send_redirect(skb); 110 ip_rt_send_redirect(skb);
111 111
112 skb->priority = rt_tos2priority(iph->tos); 112 skb->priority = rt_tos2priority(iph->tos);
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 2ea6dcc3e2cc..e59b4dcf6778 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -129,6 +129,7 @@ static int ip_rt_mtu_expires __read_mostly = 10 * 60 * HZ;
129static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20; 129static int ip_rt_min_pmtu __read_mostly = 512 + 20 + 20;
130static int ip_rt_min_advmss __read_mostly = 256; 130static int ip_rt_min_advmss __read_mostly = 256;
131static int ip_rt_secret_interval __read_mostly = 10 * 60 * HZ; 131static int ip_rt_secret_interval __read_mostly = 10 * 60 * HZ;
132static int rt_chain_length_max __read_mostly = 20;
132 133
133static void rt_worker_func(struct work_struct *work); 134static void rt_worker_func(struct work_struct *work);
134static DECLARE_DELAYED_WORK(expires_work, rt_worker_func); 135static DECLARE_DELAYED_WORK(expires_work, rt_worker_func);
@@ -145,6 +146,7 @@ static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst);
145static void ipv4_link_failure(struct sk_buff *skb); 146static void ipv4_link_failure(struct sk_buff *skb);
146static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu); 147static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu);
147static int rt_garbage_collect(struct dst_ops *ops); 148static int rt_garbage_collect(struct dst_ops *ops);
149static void rt_emergency_hash_rebuild(struct net *net);
148 150
149 151
150static struct dst_ops ipv4_dst_ops = { 152static struct dst_ops ipv4_dst_ops = {
@@ -201,6 +203,7 @@ const __u8 ip_tos2prio[16] = {
201struct rt_hash_bucket { 203struct rt_hash_bucket {
202 struct rtable *chain; 204 struct rtable *chain;
203}; 205};
206
204#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || \ 207#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) || \
205 defined(CONFIG_PROVE_LOCKING) 208 defined(CONFIG_PROVE_LOCKING)
206/* 209/*
@@ -674,6 +677,20 @@ static inline u32 rt_score(struct rtable *rt)
674 return score; 677 return score;
675} 678}
676 679
680static inline bool rt_caching(const struct net *net)
681{
682 return net->ipv4.current_rt_cache_rebuild_count <=
683 net->ipv4.sysctl_rt_cache_rebuild_count;
684}
685
686static inline bool compare_hash_inputs(const struct flowi *fl1,
687 const struct flowi *fl2)
688{
689 return (__force u32)(((fl1->nl_u.ip4_u.daddr ^ fl2->nl_u.ip4_u.daddr) |
690 (fl1->nl_u.ip4_u.saddr ^ fl2->nl_u.ip4_u.saddr) |
691 (fl1->iif ^ fl2->iif)) == 0);
692}
693
677static inline int compare_keys(struct flowi *fl1, struct flowi *fl2) 694static inline int compare_keys(struct flowi *fl1, struct flowi *fl2)
678{ 695{
679 return ((__force u32)((fl1->nl_u.ip4_u.daddr ^ fl2->nl_u.ip4_u.daddr) | 696 return ((__force u32)((fl1->nl_u.ip4_u.daddr ^ fl2->nl_u.ip4_u.daddr) |
@@ -753,11 +770,24 @@ static void rt_do_flush(int process_context)
753 } 770 }
754} 771}
755 772
773/*
774 * While freeing expired entries, we compute average chain length
775 * and standard deviation, using fixed-point arithmetic.
776 * This to have an estimation of rt_chain_length_max
777 * rt_chain_length_max = max(elasticity, AVG + 4*SD)
778 * We use 3 bits for frational part, and 29 (or 61) for magnitude.
779 */
780
781#define FRACT_BITS 3
782#define ONE (1UL << FRACT_BITS)
783
756static void rt_check_expire(void) 784static void rt_check_expire(void)
757{ 785{
758 static unsigned int rover; 786 static unsigned int rover;
759 unsigned int i = rover, goal; 787 unsigned int i = rover, goal;
760 struct rtable *rth, **rthp; 788 struct rtable *rth, **rthp;
789 unsigned long length = 0, samples = 0;
790 unsigned long sum = 0, sum2 = 0;
761 u64 mult; 791 u64 mult;
762 792
763 mult = ((u64)ip_rt_gc_interval) << rt_hash_log; 793 mult = ((u64)ip_rt_gc_interval) << rt_hash_log;
@@ -766,6 +796,7 @@ static void rt_check_expire(void)
766 goal = (unsigned int)mult; 796 goal = (unsigned int)mult;
767 if (goal > rt_hash_mask) 797 if (goal > rt_hash_mask)
768 goal = rt_hash_mask + 1; 798 goal = rt_hash_mask + 1;
799 length = 0;
769 for (; goal > 0; goal--) { 800 for (; goal > 0; goal--) {
770 unsigned long tmo = ip_rt_gc_timeout; 801 unsigned long tmo = ip_rt_gc_timeout;
771 802
@@ -775,6 +806,8 @@ static void rt_check_expire(void)
775 if (need_resched()) 806 if (need_resched())
776 cond_resched(); 807 cond_resched();
777 808
809 samples++;
810
778 if (*rthp == NULL) 811 if (*rthp == NULL)
779 continue; 812 continue;
780 spin_lock_bh(rt_hash_lock_addr(i)); 813 spin_lock_bh(rt_hash_lock_addr(i));
@@ -789,11 +822,29 @@ static void rt_check_expire(void)
789 if (time_before_eq(jiffies, rth->u.dst.expires)) { 822 if (time_before_eq(jiffies, rth->u.dst.expires)) {
790 tmo >>= 1; 823 tmo >>= 1;
791 rthp = &rth->u.dst.rt_next; 824 rthp = &rth->u.dst.rt_next;
825 /*
826 * Only bump our length if the hash
827 * inputs on entries n and n+1 are not
828 * the same, we only count entries on
829 * a chain with equal hash inputs once
830 * so that entries for different QOS
831 * levels, and other non-hash input
832 * attributes don't unfairly skew
833 * the length computation
834 */
835 if ((*rthp == NULL) ||
836 !compare_hash_inputs(&(*rthp)->fl,
837 &rth->fl))
838 length += ONE;
792 continue; 839 continue;
793 } 840 }
794 } else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout)) { 841 } else if (!rt_may_expire(rth, tmo, ip_rt_gc_timeout)) {
795 tmo >>= 1; 842 tmo >>= 1;
796 rthp = &rth->u.dst.rt_next; 843 rthp = &rth->u.dst.rt_next;
844 if ((*rthp == NULL) ||
845 !compare_hash_inputs(&(*rthp)->fl,
846 &rth->fl))
847 length += ONE;
797 continue; 848 continue;
798 } 849 }
799 850
@@ -802,6 +853,15 @@ static void rt_check_expire(void)
802 rt_free(rth); 853 rt_free(rth);
803 } 854 }
804 spin_unlock_bh(rt_hash_lock_addr(i)); 855 spin_unlock_bh(rt_hash_lock_addr(i));
856 sum += length;
857 sum2 += length*length;
858 }
859 if (samples) {
860 unsigned long avg = sum / samples;
861 unsigned long sd = int_sqrt(sum2 / samples - avg*avg);
862 rt_chain_length_max = max_t(unsigned long,
863 ip_rt_gc_elasticity,
864 (avg + 4*sd) >> FRACT_BITS);
805 } 865 }
806 rover = i; 866 rover = i;
807} 867}
@@ -851,6 +911,26 @@ static void rt_secret_rebuild(unsigned long __net)
851 mod_timer(&net->ipv4.rt_secret_timer, jiffies + ip_rt_secret_interval); 911 mod_timer(&net->ipv4.rt_secret_timer, jiffies + ip_rt_secret_interval);
852} 912}
853 913
914static void rt_secret_rebuild_oneshot(struct net *net)
915{
916 del_timer_sync(&net->ipv4.rt_secret_timer);
917 rt_cache_invalidate(net);
918 if (ip_rt_secret_interval) {
919 net->ipv4.rt_secret_timer.expires += ip_rt_secret_interval;
920 add_timer(&net->ipv4.rt_secret_timer);
921 }
922}
923
924static void rt_emergency_hash_rebuild(struct net *net)
925{
926 if (net_ratelimit()) {
927 printk(KERN_WARNING "Route hash chain too long!\n");
928 printk(KERN_WARNING "Adjust your secret_interval!\n");
929 }
930
931 rt_secret_rebuild_oneshot(net);
932}
933
854/* 934/*
855 Short description of GC goals. 935 Short description of GC goals.
856 936
@@ -989,6 +1069,7 @@ out: return 0;
989static int rt_intern_hash(unsigned hash, struct rtable *rt, struct rtable **rp) 1069static int rt_intern_hash(unsigned hash, struct rtable *rt, struct rtable **rp)
990{ 1070{
991 struct rtable *rth, **rthp; 1071 struct rtable *rth, **rthp;
1072 struct rtable *rthi;
992 unsigned long now; 1073 unsigned long now;
993 struct rtable *cand, **candp; 1074 struct rtable *cand, **candp;
994 u32 min_score; 1075 u32 min_score;
@@ -1002,7 +1083,13 @@ restart:
1002 candp = NULL; 1083 candp = NULL;
1003 now = jiffies; 1084 now = jiffies;
1004 1085
1086 if (!rt_caching(dev_net(rt->u.dst.dev))) {
1087 rt_drop(rt);
1088 return 0;
1089 }
1090
1005 rthp = &rt_hash_table[hash].chain; 1091 rthp = &rt_hash_table[hash].chain;
1092 rthi = NULL;
1006 1093
1007 spin_lock_bh(rt_hash_lock_addr(hash)); 1094 spin_lock_bh(rt_hash_lock_addr(hash));
1008 while ((rth = *rthp) != NULL) { 1095 while ((rth = *rthp) != NULL) {
@@ -1048,6 +1135,17 @@ restart:
1048 chain_length++; 1135 chain_length++;
1049 1136
1050 rthp = &rth->u.dst.rt_next; 1137 rthp = &rth->u.dst.rt_next;
1138
1139 /*
1140 * check to see if the next entry in the chain
1141 * contains the same hash input values as rt. If it does
1142 * This is where we will insert into the list, instead of
1143 * at the head. This groups entries that differ by aspects not
1144 * relvant to the hash function together, which we use to adjust
1145 * our chain length
1146 */
1147 if (*rthp && compare_hash_inputs(&(*rthp)->fl, &rt->fl))
1148 rthi = rth;
1051 } 1149 }
1052 1150
1053 if (cand) { 1151 if (cand) {
@@ -1061,6 +1159,16 @@ restart:
1061 *candp = cand->u.dst.rt_next; 1159 *candp = cand->u.dst.rt_next;
1062 rt_free(cand); 1160 rt_free(cand);
1063 } 1161 }
1162 } else {
1163 if (chain_length > rt_chain_length_max) {
1164 struct net *net = dev_net(rt->u.dst.dev);
1165 int num = ++net->ipv4.current_rt_cache_rebuild_count;
1166 if (!rt_caching(dev_net(rt->u.dst.dev))) {
1167 printk(KERN_WARNING "%s: %d rebuilds is over limit, route caching disabled\n",
1168 rt->u.dst.dev->name, num);
1169 }
1170 rt_emergency_hash_rebuild(dev_net(rt->u.dst.dev));
1171 }
1064 } 1172 }
1065 1173
1066 /* Try to bind route to arp only if it is output 1174 /* Try to bind route to arp only if it is output
@@ -1098,7 +1206,11 @@ restart:
1098 } 1206 }
1099 } 1207 }
1100 1208
1101 rt->u.dst.rt_next = rt_hash_table[hash].chain; 1209 if (rthi)
1210 rt->u.dst.rt_next = rthi->u.dst.rt_next;
1211 else
1212 rt->u.dst.rt_next = rt_hash_table[hash].chain;
1213
1102#if RT_CACHE_DEBUG >= 2 1214#if RT_CACHE_DEBUG >= 2
1103 if (rt->u.dst.rt_next) { 1215 if (rt->u.dst.rt_next) {
1104 struct rtable *trt; 1216 struct rtable *trt;
@@ -1114,7 +1226,11 @@ restart:
1114 * previous writes to rt are comitted to memory 1226 * previous writes to rt are comitted to memory
1115 * before making rt visible to other CPUS. 1227 * before making rt visible to other CPUS.
1116 */ 1228 */
1117 rcu_assign_pointer(rt_hash_table[hash].chain, rt); 1229 if (rthi)
1230 rcu_assign_pointer(rthi->u.dst.rt_next, rt);
1231 else
1232 rcu_assign_pointer(rt_hash_table[hash].chain, rt);
1233
1118 spin_unlock_bh(rt_hash_lock_addr(hash)); 1234 spin_unlock_bh(rt_hash_lock_addr(hash));
1119 *rp = rt; 1235 *rp = rt;
1120 return 0; 1236 return 0;
@@ -1217,6 +1333,9 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
1217 || ipv4_is_zeronet(new_gw)) 1333 || ipv4_is_zeronet(new_gw))
1218 goto reject_redirect; 1334 goto reject_redirect;
1219 1335
1336 if (!rt_caching(net))
1337 goto reject_redirect;
1338
1220 if (!IN_DEV_SHARED_MEDIA(in_dev)) { 1339 if (!IN_DEV_SHARED_MEDIA(in_dev)) {
1221 if (!inet_addr_onlink(in_dev, new_gw, old_gw)) 1340 if (!inet_addr_onlink(in_dev, new_gw, old_gw))
1222 goto reject_redirect; 1341 goto reject_redirect;
@@ -1267,7 +1386,6 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
1267 1386
1268 /* Copy all the information. */ 1387 /* Copy all the information. */
1269 *rt = *rth; 1388 *rt = *rth;
1270 INIT_RCU_HEAD(&rt->u.dst.rcu_head);
1271 rt->u.dst.__use = 1; 1389 rt->u.dst.__use = 1;
1272 atomic_set(&rt->u.dst.__refcnt, 1); 1390 atomic_set(&rt->u.dst.__refcnt, 1);
1273 rt->u.dst.child = NULL; 1391 rt->u.dst.child = NULL;
@@ -1280,7 +1398,9 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw,
1280 rt->u.dst.path = &rt->u.dst; 1398 rt->u.dst.path = &rt->u.dst;
1281 rt->u.dst.neighbour = NULL; 1399 rt->u.dst.neighbour = NULL;
1282 rt->u.dst.hh = NULL; 1400 rt->u.dst.hh = NULL;
1401#ifdef CONFIG_XFRM
1283 rt->u.dst.xfrm = NULL; 1402 rt->u.dst.xfrm = NULL;
1403#endif
1284 rt->rt_genid = rt_genid(net); 1404 rt->rt_genid = rt_genid(net);
1285 rt->rt_flags |= RTCF_REDIRECTED; 1405 rt->rt_flags |= RTCF_REDIRECTED;
1286 1406
@@ -2130,6 +2250,10 @@ int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr,
2130 struct net *net; 2250 struct net *net;
2131 2251
2132 net = dev_net(dev); 2252 net = dev_net(dev);
2253
2254 if (!rt_caching(net))
2255 goto skip_cache;
2256
2133 tos &= IPTOS_RT_MASK; 2257 tos &= IPTOS_RT_MASK;
2134 hash = rt_hash(daddr, saddr, iif, rt_genid(net)); 2258 hash = rt_hash(daddr, saddr, iif, rt_genid(net));
2135 2259
@@ -2154,6 +2278,7 @@ int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr,
2154 } 2278 }
2155 rcu_read_unlock(); 2279 rcu_read_unlock();
2156 2280
2281skip_cache:
2157 /* Multicast recognition logic is moved from route cache to here. 2282 /* Multicast recognition logic is moved from route cache to here.
2158 The problem was that too many Ethernet cards have broken/missing 2283 The problem was that too many Ethernet cards have broken/missing
2159 hardware multicast filters :-( As result the host on multicasting 2284 hardware multicast filters :-( As result the host on multicasting
@@ -2539,6 +2664,9 @@ int __ip_route_output_key(struct net *net, struct rtable **rp,
2539 unsigned hash; 2664 unsigned hash;
2540 struct rtable *rth; 2665 struct rtable *rth;
2541 2666
2667 if (!rt_caching(net))
2668 goto slow_output;
2669
2542 hash = rt_hash(flp->fl4_dst, flp->fl4_src, flp->oif, rt_genid(net)); 2670 hash = rt_hash(flp->fl4_dst, flp->fl4_src, flp->oif, rt_genid(net));
2543 2671
2544 rcu_read_lock_bh(); 2672 rcu_read_lock_bh();
@@ -2563,6 +2691,7 @@ int __ip_route_output_key(struct net *net, struct rtable **rp,
2563 } 2691 }
2564 rcu_read_unlock_bh(); 2692 rcu_read_unlock_bh();
2565 2693
2694slow_output:
2566 return ip_route_output_slow(net, rp, flp); 2695 return ip_route_output_slow(net, rp, flp);
2567} 2696}
2568 2697
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c
index 1bb10df8ce7d..0cc8d31f9ac0 100644
--- a/net/ipv4/sysctl_net_ipv4.c
+++ b/net/ipv4/sysctl_net_ipv4.c
@@ -795,6 +795,14 @@ static struct ctl_table ipv4_net_table[] = {
795 .mode = 0644, 795 .mode = 0644,
796 .proc_handler = &proc_dointvec 796 .proc_handler = &proc_dointvec
797 }, 797 },
798 {
799 .ctl_name = CTL_UNNUMBERED,
800 .procname = "rt_cache_rebuild_count",
801 .data = &init_net.ipv4.sysctl_rt_cache_rebuild_count,
802 .maxlen = sizeof(int),
803 .mode = 0644,
804 .proc_handler = &proc_dointvec
805 },
798 { } 806 { }
799}; 807};
800 808
@@ -827,8 +835,12 @@ static __net_init int ipv4_sysctl_init_net(struct net *net)
827 &net->ipv4.sysctl_icmp_ratelimit; 835 &net->ipv4.sysctl_icmp_ratelimit;
828 table[5].data = 836 table[5].data =
829 &net->ipv4.sysctl_icmp_ratemask; 837 &net->ipv4.sysctl_icmp_ratemask;
838 table[6].data =
839 &net->ipv4.sysctl_rt_cache_rebuild_count;
830 } 840 }
831 841
842 net->ipv4.sysctl_rt_cache_rebuild_count = 4;
843
832 net->ipv4.ipv4_hdr = register_net_sysctl_table(net, 844 net->ipv4.ipv4_hdr = register_net_sysctl_table(net,
833 net_ipv4_ctl_path, table); 845 net_ipv4_ctl_path, table);
834 if (net->ipv4.ipv4_hdr == NULL) 846 if (net->ipv4.ipv4_hdr == NULL)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index d77c0d29e239..04909e4b3c4c 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -2346,9 +2346,9 @@ static void DBGUNDO(struct sock *sk, const char *msg)
2346#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 2346#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
2347 else if (sk->sk_family == AF_INET6) { 2347 else if (sk->sk_family == AF_INET6) {
2348 struct ipv6_pinfo *np = inet6_sk(sk); 2348 struct ipv6_pinfo *np = inet6_sk(sk);
2349 printk(KERN_DEBUG "Undo %s " NIP6_FMT "/%u c%u l%u ss%u/%u p%u\n", 2349 printk(KERN_DEBUG "Undo %s %pI6/%u c%u l%u ss%u/%u p%u\n",
2350 msg, 2350 msg,
2351 NIP6(np->daddr), ntohs(inet->dport), 2351 &np->daddr, ntohs(inet->dport),
2352 tp->snd_cwnd, tcp_left_out(tp), 2352 tp->snd_cwnd, tcp_left_out(tp),
2353 tp->snd_ssthresh, tp->prior_ssthresh, 2353 tp->snd_ssthresh, tp->prior_ssthresh,
2354 tp->packets_out); 2354 tp->packets_out);
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index 6b6dff1164b9..979c9d604eb0 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -306,8 +306,8 @@ static void tcp_retransmit_timer(struct sock *sk)
306#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 306#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
307 else if (sk->sk_family == AF_INET6) { 307 else if (sk->sk_family == AF_INET6) {
308 struct ipv6_pinfo *np = inet6_sk(sk); 308 struct ipv6_pinfo *np = inet6_sk(sk);
309 LIMIT_NETDEBUG(KERN_DEBUG "TCP: Treason uncloaked! Peer " NIP6_FMT ":%u/%u shrinks window %u:%u. Repaired.\n", 309 LIMIT_NETDEBUG(KERN_DEBUG "TCP: Treason uncloaked! Peer %pI6:%u/%u shrinks window %u:%u. Repaired.\n",
310 NIP6(np->daddr), ntohs(inet->dport), 310 &np->daddr, ntohs(inet->dport),
311 inet->num, tp->snd_una, tp->snd_nxt); 311 inet->num, tp->snd_una, tp->snd_nxt);
312 } 312 }
313#endif 313#endif
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 2095abc3caba..f760b86e7530 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -81,6 +81,8 @@
81#include <asm/uaccess.h> 81#include <asm/uaccess.h>
82#include <asm/ioctls.h> 82#include <asm/ioctls.h>
83#include <linux/bootmem.h> 83#include <linux/bootmem.h>
84#include <linux/highmem.h>
85#include <linux/swap.h>
84#include <linux/types.h> 86#include <linux/types.h>
85#include <linux/fcntl.h> 87#include <linux/fcntl.h>
86#include <linux/module.h> 88#include <linux/module.h>
@@ -104,12 +106,8 @@
104#include <net/xfrm.h> 106#include <net/xfrm.h>
105#include "udp_impl.h" 107#include "udp_impl.h"
106 108
107/* 109struct udp_table udp_table;
108 * Snmp MIB for the UDP layer 110EXPORT_SYMBOL(udp_table);
109 */
110
111struct hlist_head udp_hash[UDP_HTABLE_SIZE];
112DEFINE_RWLOCK(udp_hash_lock);
113 111
114int sysctl_udp_mem[3] __read_mostly; 112int sysctl_udp_mem[3] __read_mostly;
115int sysctl_udp_rmem_min __read_mostly; 113int sysctl_udp_rmem_min __read_mostly;
@@ -123,7 +121,7 @@ atomic_t udp_memory_allocated;
123EXPORT_SYMBOL(udp_memory_allocated); 121EXPORT_SYMBOL(udp_memory_allocated);
124 122
125static int udp_lib_lport_inuse(struct net *net, __u16 num, 123static int udp_lib_lport_inuse(struct net *net, __u16 num,
126 const struct hlist_head udptable[], 124 const struct udp_hslot *hslot,
127 struct sock *sk, 125 struct sock *sk,
128 int (*saddr_comp)(const struct sock *sk1, 126 int (*saddr_comp)(const struct sock *sk1,
129 const struct sock *sk2)) 127 const struct sock *sk2))
@@ -131,7 +129,7 @@ static int udp_lib_lport_inuse(struct net *net, __u16 num,
131 struct sock *sk2; 129 struct sock *sk2;
132 struct hlist_node *node; 130 struct hlist_node *node;
133 131
134 sk_for_each(sk2, node, &udptable[udp_hashfn(net, num)]) 132 sk_for_each(sk2, node, &hslot->head)
135 if (net_eq(sock_net(sk2), net) && 133 if (net_eq(sock_net(sk2), net) &&
136 sk2 != sk && 134 sk2 != sk &&
137 sk2->sk_hash == num && 135 sk2->sk_hash == num &&
@@ -154,12 +152,11 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum,
154 int (*saddr_comp)(const struct sock *sk1, 152 int (*saddr_comp)(const struct sock *sk1,
155 const struct sock *sk2 ) ) 153 const struct sock *sk2 ) )
156{ 154{
157 struct hlist_head *udptable = sk->sk_prot->h.udp_hash; 155 struct udp_hslot *hslot;
156 struct udp_table *udptable = sk->sk_prot->h.udp_table;
158 int error = 1; 157 int error = 1;
159 struct net *net = sock_net(sk); 158 struct net *net = sock_net(sk);
160 159
161 write_lock_bh(&udp_hash_lock);
162
163 if (!snum) { 160 if (!snum) {
164 int low, high, remaining; 161 int low, high, remaining;
165 unsigned rand; 162 unsigned rand;
@@ -171,26 +168,34 @@ int udp_lib_get_port(struct sock *sk, unsigned short snum,
171 rand = net_random(); 168 rand = net_random();
172 snum = first = rand % remaining + low; 169 snum = first = rand % remaining + low;
173 rand |= 1; 170 rand |= 1;
174 while (udp_lib_lport_inuse(net, snum, udptable, sk, 171 for (;;) {
175 saddr_comp)) { 172 hslot = &udptable->hash[udp_hashfn(net, snum)];
173 spin_lock_bh(&hslot->lock);
174 if (!udp_lib_lport_inuse(net, snum, hslot, sk, saddr_comp))
175 break;
176 spin_unlock_bh(&hslot->lock);
176 do { 177 do {
177 snum = snum + rand; 178 snum = snum + rand;
178 } while (snum < low || snum > high); 179 } while (snum < low || snum > high);
179 if (snum == first) 180 if (snum == first)
180 goto fail; 181 goto fail;
181 } 182 }
182 } else if (udp_lib_lport_inuse(net, snum, udptable, sk, saddr_comp)) 183 } else {
183 goto fail; 184 hslot = &udptable->hash[udp_hashfn(net, snum)];
184 185 spin_lock_bh(&hslot->lock);
186 if (udp_lib_lport_inuse(net, snum, hslot, sk, saddr_comp))
187 goto fail_unlock;
188 }
185 inet_sk(sk)->num = snum; 189 inet_sk(sk)->num = snum;
186 sk->sk_hash = snum; 190 sk->sk_hash = snum;
187 if (sk_unhashed(sk)) { 191 if (sk_unhashed(sk)) {
188 sk_add_node(sk, &udptable[udp_hashfn(net, snum)]); 192 sk_add_node_rcu(sk, &hslot->head);
189 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1); 193 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, 1);
190 } 194 }
191 error = 0; 195 error = 0;
196fail_unlock:
197 spin_unlock_bh(&hslot->lock);
192fail: 198fail:
193 write_unlock_bh(&udp_hash_lock);
194 return error; 199 return error;
195} 200}
196 201
@@ -208,63 +213,89 @@ int udp_v4_get_port(struct sock *sk, unsigned short snum)
208 return udp_lib_get_port(sk, snum, ipv4_rcv_saddr_equal); 213 return udp_lib_get_port(sk, snum, ipv4_rcv_saddr_equal);
209} 214}
210 215
216static inline int compute_score(struct sock *sk, struct net *net, __be32 saddr,
217 unsigned short hnum,
218 __be16 sport, __be32 daddr, __be16 dport, int dif)
219{
220 int score = -1;
221
222 if (net_eq(sock_net(sk), net) && sk->sk_hash == hnum &&
223 !ipv6_only_sock(sk)) {
224 struct inet_sock *inet = inet_sk(sk);
225
226 score = (sk->sk_family == PF_INET ? 1 : 0);
227 if (inet->rcv_saddr) {
228 if (inet->rcv_saddr != daddr)
229 return -1;
230 score += 2;
231 }
232 if (inet->daddr) {
233 if (inet->daddr != saddr)
234 return -1;
235 score += 2;
236 }
237 if (inet->dport) {
238 if (inet->dport != sport)
239 return -1;
240 score += 2;
241 }
242 if (sk->sk_bound_dev_if) {
243 if (sk->sk_bound_dev_if != dif)
244 return -1;
245 score += 2;
246 }
247 }
248 return score;
249}
250
211/* UDP is nearly always wildcards out the wazoo, it makes no sense to try 251/* UDP is nearly always wildcards out the wazoo, it makes no sense to try
212 * harder than this. -DaveM 252 * harder than this. -DaveM
213 */ 253 */
214static struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr, 254static struct sock *__udp4_lib_lookup(struct net *net, __be32 saddr,
215 __be16 sport, __be32 daddr, __be16 dport, 255 __be16 sport, __be32 daddr, __be16 dport,
216 int dif, struct hlist_head udptable[]) 256 int dif, struct udp_table *udptable)
217{ 257{
218 struct sock *sk, *result = NULL; 258 struct sock *sk, *result;
219 struct hlist_node *node; 259 struct hlist_node *node, *next;
220 unsigned short hnum = ntohs(dport); 260 unsigned short hnum = ntohs(dport);
221 int badness = -1; 261 unsigned int hash = udp_hashfn(net, hnum);
222 262 struct udp_hslot *hslot = &udptable->hash[hash];
223 read_lock(&udp_hash_lock); 263 int score, badness;
224 sk_for_each(sk, node, &udptable[udp_hashfn(net, hnum)]) { 264
225 struct inet_sock *inet = inet_sk(sk); 265 rcu_read_lock();
226 266begin:
227 if (net_eq(sock_net(sk), net) && sk->sk_hash == hnum && 267 result = NULL;
228 !ipv6_only_sock(sk)) { 268 badness = -1;
229 int score = (sk->sk_family == PF_INET ? 1 : 0); 269 sk_for_each_rcu_safenext(sk, node, &hslot->head, next) {
230 if (inet->rcv_saddr) { 270 /*
231 if (inet->rcv_saddr != daddr) 271 * lockless reader, and SLAB_DESTROY_BY_RCU items:
232 continue; 272 * We must check this item was not moved to another chain
233 score+=2; 273 */
234 } 274 if (udp_hashfn(net, sk->sk_hash) != hash)
235 if (inet->daddr) { 275 goto begin;
236 if (inet->daddr != saddr) 276 score = compute_score(sk, net, saddr, hnum, sport,
237 continue; 277 daddr, dport, dif);
238 score+=2; 278 if (score > badness) {
239 } 279 result = sk;
240 if (inet->dport) { 280 badness = score;
241 if (inet->dport != sport)
242 continue;
243 score+=2;
244 }
245 if (sk->sk_bound_dev_if) {
246 if (sk->sk_bound_dev_if != dif)
247 continue;
248 score+=2;
249 }
250 if (score == 9) {
251 result = sk;
252 break;
253 } else if (score > badness) {
254 result = sk;
255 badness = score;
256 }
257 } 281 }
258 } 282 }
259 if (result) 283 if (result) {
260 sock_hold(result); 284 if (unlikely(!atomic_inc_not_zero(&result->sk_refcnt)))
261 read_unlock(&udp_hash_lock); 285 result = NULL;
286 else if (unlikely(compute_score(result, net, saddr, hnum, sport,
287 daddr, dport, dif) < badness)) {
288 sock_put(result);
289 goto begin;
290 }
291 }
292 rcu_read_unlock();
262 return result; 293 return result;
263} 294}
264 295
265static inline struct sock *__udp4_lib_lookup_skb(struct sk_buff *skb, 296static inline struct sock *__udp4_lib_lookup_skb(struct sk_buff *skb,
266 __be16 sport, __be16 dport, 297 __be16 sport, __be16 dport,
267 struct hlist_head udptable[]) 298 struct udp_table *udptable)
268{ 299{
269 struct sock *sk; 300 struct sock *sk;
270 const struct iphdr *iph = ip_hdr(skb); 301 const struct iphdr *iph = ip_hdr(skb);
@@ -280,7 +311,7 @@ static inline struct sock *__udp4_lib_lookup_skb(struct sk_buff *skb,
280struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, 311struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
281 __be32 daddr, __be16 dport, int dif) 312 __be32 daddr, __be16 dport, int dif)
282{ 313{
283 return __udp4_lib_lookup(net, saddr, sport, daddr, dport, dif, udp_hash); 314 return __udp4_lib_lookup(net, saddr, sport, daddr, dport, dif, &udp_table);
284} 315}
285EXPORT_SYMBOL_GPL(udp4_lib_lookup); 316EXPORT_SYMBOL_GPL(udp4_lib_lookup);
286 317
@@ -323,7 +354,7 @@ found:
323 * to find the appropriate port. 354 * to find the appropriate port.
324 */ 355 */
325 356
326void __udp4_lib_err(struct sk_buff *skb, u32 info, struct hlist_head udptable[]) 357void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable)
327{ 358{
328 struct inet_sock *inet; 359 struct inet_sock *inet;
329 struct iphdr *iph = (struct iphdr*)skb->data; 360 struct iphdr *iph = (struct iphdr*)skb->data;
@@ -392,7 +423,7 @@ out:
392 423
393void udp_err(struct sk_buff *skb, u32 info) 424void udp_err(struct sk_buff *skb, u32 info)
394{ 425{
395 __udp4_lib_err(skb, info, udp_hash); 426 __udp4_lib_err(skb, info, &udp_table);
396} 427}
397 428
398/* 429/*
@@ -933,6 +964,21 @@ int udp_disconnect(struct sock *sk, int flags)
933 return 0; 964 return 0;
934} 965}
935 966
967void udp_lib_unhash(struct sock *sk)
968{
969 struct udp_table *udptable = sk->sk_prot->h.udp_table;
970 unsigned int hash = udp_hashfn(sock_net(sk), sk->sk_hash);
971 struct udp_hslot *hslot = &udptable->hash[hash];
972
973 spin_lock_bh(&hslot->lock);
974 if (sk_del_node_init_rcu(sk)) {
975 inet_sk(sk)->num = 0;
976 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
977 }
978 spin_unlock_bh(&hslot->lock);
979}
980EXPORT_SYMBOL(udp_lib_unhash);
981
936static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb) 982static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
937{ 983{
938 int is_udplite = IS_UDPLITE(sk); 984 int is_udplite = IS_UDPLITE(sk);
@@ -1071,13 +1117,14 @@ drop:
1071static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb, 1117static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
1072 struct udphdr *uh, 1118 struct udphdr *uh,
1073 __be32 saddr, __be32 daddr, 1119 __be32 saddr, __be32 daddr,
1074 struct hlist_head udptable[]) 1120 struct udp_table *udptable)
1075{ 1121{
1076 struct sock *sk; 1122 struct sock *sk;
1123 struct udp_hslot *hslot = &udptable->hash[udp_hashfn(net, ntohs(uh->dest))];
1077 int dif; 1124 int dif;
1078 1125
1079 read_lock(&udp_hash_lock); 1126 spin_lock(&hslot->lock);
1080 sk = sk_head(&udptable[udp_hashfn(net, ntohs(uh->dest))]); 1127 sk = sk_head(&hslot->head);
1081 dif = skb->dev->ifindex; 1128 dif = skb->dev->ifindex;
1082 sk = udp_v4_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif); 1129 sk = udp_v4_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
1083 if (sk) { 1130 if (sk) {
@@ -1102,7 +1149,7 @@ static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
1102 } while (sknext); 1149 } while (sknext);
1103 } else 1150 } else
1104 kfree_skb(skb); 1151 kfree_skb(skb);
1105 read_unlock(&udp_hash_lock); 1152 spin_unlock(&hslot->lock);
1106 return 0; 1153 return 0;
1107} 1154}
1108 1155
@@ -1148,7 +1195,7 @@ static inline int udp4_csum_init(struct sk_buff *skb, struct udphdr *uh,
1148 * All we need to do is get the socket, and then do a checksum. 1195 * All we need to do is get the socket, and then do a checksum.
1149 */ 1196 */
1150 1197
1151int __udp4_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[], 1198int __udp4_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
1152 int proto) 1199 int proto)
1153{ 1200{
1154 struct sock *sk; 1201 struct sock *sk;
@@ -1246,7 +1293,7 @@ drop:
1246 1293
1247int udp_rcv(struct sk_buff *skb) 1294int udp_rcv(struct sk_buff *skb)
1248{ 1295{
1249 return __udp4_lib_rcv(skb, udp_hash, IPPROTO_UDP); 1296 return __udp4_lib_rcv(skb, &udp_table, IPPROTO_UDP);
1250} 1297}
1251 1298
1252void udp_destroy_sock(struct sock *sk) 1299void udp_destroy_sock(struct sock *sk)
@@ -1488,7 +1535,8 @@ struct proto udp_prot = {
1488 .sysctl_wmem = &sysctl_udp_wmem_min, 1535 .sysctl_wmem = &sysctl_udp_wmem_min,
1489 .sysctl_rmem = &sysctl_udp_rmem_min, 1536 .sysctl_rmem = &sysctl_udp_rmem_min,
1490 .obj_size = sizeof(struct udp_sock), 1537 .obj_size = sizeof(struct udp_sock),
1491 .h.udp_hash = udp_hash, 1538 .slab_flags = SLAB_DESTROY_BY_RCU,
1539 .h.udp_table = &udp_table,
1492#ifdef CONFIG_COMPAT 1540#ifdef CONFIG_COMPAT
1493 .compat_setsockopt = compat_udp_setsockopt, 1541 .compat_setsockopt = compat_udp_setsockopt,
1494 .compat_getsockopt = compat_udp_getsockopt, 1542 .compat_getsockopt = compat_udp_getsockopt,
@@ -1498,20 +1546,23 @@ struct proto udp_prot = {
1498/* ------------------------------------------------------------------------ */ 1546/* ------------------------------------------------------------------------ */
1499#ifdef CONFIG_PROC_FS 1547#ifdef CONFIG_PROC_FS
1500 1548
1501static struct sock *udp_get_first(struct seq_file *seq) 1549static struct sock *udp_get_first(struct seq_file *seq, int start)
1502{ 1550{
1503 struct sock *sk; 1551 struct sock *sk;
1504 struct udp_iter_state *state = seq->private; 1552 struct udp_iter_state *state = seq->private;
1505 struct net *net = seq_file_net(seq); 1553 struct net *net = seq_file_net(seq);
1506 1554
1507 for (state->bucket = 0; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) { 1555 for (state->bucket = start; state->bucket < UDP_HTABLE_SIZE; ++state->bucket) {
1508 struct hlist_node *node; 1556 struct hlist_node *node;
1509 sk_for_each(sk, node, state->hashtable + state->bucket) { 1557 struct udp_hslot *hslot = &state->udp_table->hash[state->bucket];
1558 spin_lock_bh(&hslot->lock);
1559 sk_for_each(sk, node, &hslot->head) {
1510 if (!net_eq(sock_net(sk), net)) 1560 if (!net_eq(sock_net(sk), net))
1511 continue; 1561 continue;
1512 if (sk->sk_family == state->family) 1562 if (sk->sk_family == state->family)
1513 goto found; 1563 goto found;
1514 } 1564 }
1565 spin_unlock_bh(&hslot->lock);
1515 } 1566 }
1516 sk = NULL; 1567 sk = NULL;
1517found: 1568found:
@@ -1525,20 +1576,18 @@ static struct sock *udp_get_next(struct seq_file *seq, struct sock *sk)
1525 1576
1526 do { 1577 do {
1527 sk = sk_next(sk); 1578 sk = sk_next(sk);
1528try_again:
1529 ;
1530 } while (sk && (!net_eq(sock_net(sk), net) || sk->sk_family != state->family)); 1579 } while (sk && (!net_eq(sock_net(sk), net) || sk->sk_family != state->family));
1531 1580
1532 if (!sk && ++state->bucket < UDP_HTABLE_SIZE) { 1581 if (!sk) {
1533 sk = sk_head(state->hashtable + state->bucket); 1582 spin_unlock_bh(&state->udp_table->hash[state->bucket].lock);
1534 goto try_again; 1583 return udp_get_first(seq, state->bucket + 1);
1535 } 1584 }
1536 return sk; 1585 return sk;
1537} 1586}
1538 1587
1539static struct sock *udp_get_idx(struct seq_file *seq, loff_t pos) 1588static struct sock *udp_get_idx(struct seq_file *seq, loff_t pos)
1540{ 1589{
1541 struct sock *sk = udp_get_first(seq); 1590 struct sock *sk = udp_get_first(seq, 0);
1542 1591
1543 if (sk) 1592 if (sk)
1544 while (pos && (sk = udp_get_next(seq, sk)) != NULL) 1593 while (pos && (sk = udp_get_next(seq, sk)) != NULL)
@@ -1547,9 +1596,7 @@ static struct sock *udp_get_idx(struct seq_file *seq, loff_t pos)
1547} 1596}
1548 1597
1549static void *udp_seq_start(struct seq_file *seq, loff_t *pos) 1598static void *udp_seq_start(struct seq_file *seq, loff_t *pos)
1550 __acquires(udp_hash_lock)
1551{ 1599{
1552 read_lock(&udp_hash_lock);
1553 return *pos ? udp_get_idx(seq, *pos-1) : SEQ_START_TOKEN; 1600 return *pos ? udp_get_idx(seq, *pos-1) : SEQ_START_TOKEN;
1554} 1601}
1555 1602
@@ -1567,9 +1614,11 @@ static void *udp_seq_next(struct seq_file *seq, void *v, loff_t *pos)
1567} 1614}
1568 1615
1569static void udp_seq_stop(struct seq_file *seq, void *v) 1616static void udp_seq_stop(struct seq_file *seq, void *v)
1570 __releases(udp_hash_lock)
1571{ 1617{
1572 read_unlock(&udp_hash_lock); 1618 struct udp_iter_state *state = seq->private;
1619
1620 if (state->bucket < UDP_HTABLE_SIZE)
1621 spin_unlock_bh(&state->udp_table->hash[state->bucket].lock);
1573} 1622}
1574 1623
1575static int udp_seq_open(struct inode *inode, struct file *file) 1624static int udp_seq_open(struct inode *inode, struct file *file)
@@ -1585,7 +1634,7 @@ static int udp_seq_open(struct inode *inode, struct file *file)
1585 1634
1586 s = ((struct seq_file *)file->private_data)->private; 1635 s = ((struct seq_file *)file->private_data)->private;
1587 s->family = afinfo->family; 1636 s->family = afinfo->family;
1588 s->hashtable = afinfo->hashtable; 1637 s->udp_table = afinfo->udp_table;
1589 return err; 1638 return err;
1590} 1639}
1591 1640
@@ -1657,7 +1706,7 @@ int udp4_seq_show(struct seq_file *seq, void *v)
1657static struct udp_seq_afinfo udp4_seq_afinfo = { 1706static struct udp_seq_afinfo udp4_seq_afinfo = {
1658 .name = "udp", 1707 .name = "udp",
1659 .family = AF_INET, 1708 .family = AF_INET,
1660 .hashtable = udp_hash, 1709 .udp_table = &udp_table,
1661 .seq_fops = { 1710 .seq_fops = {
1662 .owner = THIS_MODULE, 1711 .owner = THIS_MODULE,
1663 }, 1712 },
@@ -1692,16 +1741,28 @@ void udp4_proc_exit(void)
1692} 1741}
1693#endif /* CONFIG_PROC_FS */ 1742#endif /* CONFIG_PROC_FS */
1694 1743
1744void __init udp_table_init(struct udp_table *table)
1745{
1746 int i;
1747
1748 for (i = 0; i < UDP_HTABLE_SIZE; i++) {
1749 INIT_HLIST_HEAD(&table->hash[i].head);
1750 spin_lock_init(&table->hash[i].lock);
1751 }
1752}
1753
1695void __init udp_init(void) 1754void __init udp_init(void)
1696{ 1755{
1697 unsigned long limit; 1756 unsigned long nr_pages, limit;
1698 1757
1758 udp_table_init(&udp_table);
1699 /* Set the pressure threshold up by the same strategy of TCP. It is a 1759 /* Set the pressure threshold up by the same strategy of TCP. It is a
1700 * fraction of global memory that is up to 1/2 at 256 MB, decreasing 1760 * fraction of global memory that is up to 1/2 at 256 MB, decreasing
1701 * toward zero with the amount of memory, with a floor of 128 pages. 1761 * toward zero with the amount of memory, with a floor of 128 pages.
1702 */ 1762 */
1703 limit = min(nr_all_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT); 1763 nr_pages = totalram_pages - totalhigh_pages;
1704 limit = (limit * (nr_all_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11); 1764 limit = min(nr_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT);
1765 limit = (limit * (nr_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11);
1705 limit = max(limit, 128UL); 1766 limit = max(limit, 128UL);
1706 sysctl_udp_mem[0] = limit / 4 * 3; 1767 sysctl_udp_mem[0] = limit / 4 * 3;
1707 sysctl_udp_mem[1] = limit; 1768 sysctl_udp_mem[1] = limit;
@@ -1712,8 +1773,6 @@ void __init udp_init(void)
1712} 1773}
1713 1774
1714EXPORT_SYMBOL(udp_disconnect); 1775EXPORT_SYMBOL(udp_disconnect);
1715EXPORT_SYMBOL(udp_hash);
1716EXPORT_SYMBOL(udp_hash_lock);
1717EXPORT_SYMBOL(udp_ioctl); 1776EXPORT_SYMBOL(udp_ioctl);
1718EXPORT_SYMBOL(udp_prot); 1777EXPORT_SYMBOL(udp_prot);
1719EXPORT_SYMBOL(udp_sendmsg); 1778EXPORT_SYMBOL(udp_sendmsg);
diff --git a/net/ipv4/udp_impl.h b/net/ipv4/udp_impl.h
index 2e9bad2fa1bc..9f4a6165f722 100644
--- a/net/ipv4/udp_impl.h
+++ b/net/ipv4/udp_impl.h
@@ -5,8 +5,8 @@
5#include <net/protocol.h> 5#include <net/protocol.h>
6#include <net/inet_common.h> 6#include <net/inet_common.h>
7 7
8extern int __udp4_lib_rcv(struct sk_buff *, struct hlist_head [], int ); 8extern int __udp4_lib_rcv(struct sk_buff *, struct udp_table *, int );
9extern void __udp4_lib_err(struct sk_buff *, u32, struct hlist_head []); 9extern void __udp4_lib_err(struct sk_buff *, u32, struct udp_table *);
10 10
11extern int udp_v4_get_port(struct sock *sk, unsigned short snum); 11extern int udp_v4_get_port(struct sock *sk, unsigned short snum);
12 12
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c
index 3c807964da96..c784891cb7e5 100644
--- a/net/ipv4/udplite.c
+++ b/net/ipv4/udplite.c
@@ -12,16 +12,17 @@
12 */ 12 */
13#include "udp_impl.h" 13#include "udp_impl.h"
14 14
15struct hlist_head udplite_hash[UDP_HTABLE_SIZE]; 15struct udp_table udplite_table;
16EXPORT_SYMBOL(udplite_table);
16 17
17static int udplite_rcv(struct sk_buff *skb) 18static int udplite_rcv(struct sk_buff *skb)
18{ 19{
19 return __udp4_lib_rcv(skb, udplite_hash, IPPROTO_UDPLITE); 20 return __udp4_lib_rcv(skb, &udplite_table, IPPROTO_UDPLITE);
20} 21}
21 22
22static void udplite_err(struct sk_buff *skb, u32 info) 23static void udplite_err(struct sk_buff *skb, u32 info)
23{ 24{
24 __udp4_lib_err(skb, info, udplite_hash); 25 __udp4_lib_err(skb, info, &udplite_table);
25} 26}
26 27
27static struct net_protocol udplite_protocol = { 28static struct net_protocol udplite_protocol = {
@@ -50,7 +51,8 @@ struct proto udplite_prot = {
50 .unhash = udp_lib_unhash, 51 .unhash = udp_lib_unhash,
51 .get_port = udp_v4_get_port, 52 .get_port = udp_v4_get_port,
52 .obj_size = sizeof(struct udp_sock), 53 .obj_size = sizeof(struct udp_sock),
53 .h.udp_hash = udplite_hash, 54 .slab_flags = SLAB_DESTROY_BY_RCU,
55 .h.udp_table = &udplite_table,
54#ifdef CONFIG_COMPAT 56#ifdef CONFIG_COMPAT
55 .compat_setsockopt = compat_udp_setsockopt, 57 .compat_setsockopt = compat_udp_setsockopt,
56 .compat_getsockopt = compat_udp_getsockopt, 58 .compat_getsockopt = compat_udp_getsockopt,
@@ -71,7 +73,7 @@ static struct inet_protosw udplite4_protosw = {
71static struct udp_seq_afinfo udplite4_seq_afinfo = { 73static struct udp_seq_afinfo udplite4_seq_afinfo = {
72 .name = "udplite", 74 .name = "udplite",
73 .family = AF_INET, 75 .family = AF_INET,
74 .hashtable = udplite_hash, 76 .udp_table = &udplite_table,
75 .seq_fops = { 77 .seq_fops = {
76 .owner = THIS_MODULE, 78 .owner = THIS_MODULE,
77 }, 79 },
@@ -108,6 +110,7 @@ static inline int udplite4_proc_init(void)
108 110
109void __init udplite4_register(void) 111void __init udplite4_register(void)
110{ 112{
113 udp_table_init(&udplite_table);
111 if (proto_register(&udplite_prot, 1)) 114 if (proto_register(&udplite_prot, 1))
112 goto out_register_err; 115 goto out_register_err;
113 116
@@ -126,5 +129,4 @@ out_register_err:
126 printk(KERN_CRIT "%s: Cannot add UDP-Lite protocol.\n", __func__); 129 printk(KERN_CRIT "%s: Cannot add UDP-Lite protocol.\n", __func__);
127} 130}
128 131
129EXPORT_SYMBOL(udplite_hash);
130EXPORT_SYMBOL(udplite_prot); 132EXPORT_SYMBOL(udplite_prot);
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index eea9542728ca..ff7ae05f72e1 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2986,9 +2986,8 @@ static void if6_seq_stop(struct seq_file *seq, void *v)
2986static int if6_seq_show(struct seq_file *seq, void *v) 2986static int if6_seq_show(struct seq_file *seq, void *v)
2987{ 2987{
2988 struct inet6_ifaddr *ifp = (struct inet6_ifaddr *)v; 2988 struct inet6_ifaddr *ifp = (struct inet6_ifaddr *)v;
2989 seq_printf(seq, 2989 seq_printf(seq, "%pi6 %02x %02x %02x %02x %8s\n",
2990 NIP6_SEQFMT " %02x %02x %02x %02x %8s\n", 2990 &ifp->addr,
2991 NIP6(ifp->addr),
2992 ifp->idev->dev->ifindex, 2991 ifp->idev->dev->ifindex,
2993 ifp->prefix_len, 2992 ifp->prefix_len,
2994 ifp->scope, 2993 ifp->scope,
diff --git a/net/ipv6/addrlabel.c b/net/ipv6/addrlabel.c
index 08909039d87b..6ff73c4c126a 100644
--- a/net/ipv6/addrlabel.c
+++ b/net/ipv6/addrlabel.c
@@ -186,10 +186,8 @@ u32 ipv6_addr_label(struct net *net,
186 label = p ? p->label : IPV6_ADDR_LABEL_DEFAULT; 186 label = p ? p->label : IPV6_ADDR_LABEL_DEFAULT;
187 rcu_read_unlock(); 187 rcu_read_unlock();
188 188
189 ADDRLABEL(KERN_DEBUG "%s(addr=" NIP6_FMT ", type=%d, ifindex=%d) => %08x\n", 189 ADDRLABEL(KERN_DEBUG "%s(addr=%pI6, type=%d, ifindex=%d) => %08x\n",
190 __func__, 190 __func__, addr, type, ifindex, label);
191 NIP6(*addr), type, ifindex,
192 label);
193 191
194 return label; 192 return label;
195} 193}
@@ -203,11 +201,8 @@ static struct ip6addrlbl_entry *ip6addrlbl_alloc(struct net *net,
203 struct ip6addrlbl_entry *newp; 201 struct ip6addrlbl_entry *newp;
204 int addrtype; 202 int addrtype;
205 203
206 ADDRLABEL(KERN_DEBUG "%s(prefix=" NIP6_FMT ", prefixlen=%d, ifindex=%d, label=%u)\n", 204 ADDRLABEL(KERN_DEBUG "%s(prefix=%pI6, prefixlen=%d, ifindex=%d, label=%u)\n",
207 __func__, 205 __func__, prefix, prefixlen, ifindex, (unsigned int)label);
208 NIP6(*prefix), prefixlen,
209 ifindex,
210 (unsigned int)label);
211 206
212 addrtype = ipv6_addr_type(prefix) & (IPV6_ADDR_MAPPED | IPV6_ADDR_COMPATv4 | IPV6_ADDR_LOOPBACK); 207 addrtype = ipv6_addr_type(prefix) & (IPV6_ADDR_MAPPED | IPV6_ADDR_COMPATv4 | IPV6_ADDR_LOOPBACK);
213 208
@@ -294,12 +289,9 @@ static int ip6addrlbl_add(struct net *net,
294 struct ip6addrlbl_entry *newp; 289 struct ip6addrlbl_entry *newp;
295 int ret = 0; 290 int ret = 0;
296 291
297 ADDRLABEL(KERN_DEBUG "%s(prefix=" NIP6_FMT ", prefixlen=%d, ifindex=%d, label=%u, replace=%d)\n", 292 ADDRLABEL(KERN_DEBUG "%s(prefix=%pI6, prefixlen=%d, ifindex=%d, label=%u, replace=%d)\n",
298 __func__, 293 __func__, prefix, prefixlen, ifindex, (unsigned int)label,
299 NIP6(*prefix), prefixlen, 294 replace);
300 ifindex,
301 (unsigned int)label,
302 replace);
303 295
304 newp = ip6addrlbl_alloc(net, prefix, prefixlen, ifindex, label); 296 newp = ip6addrlbl_alloc(net, prefix, prefixlen, ifindex, label);
305 if (IS_ERR(newp)) 297 if (IS_ERR(newp))
@@ -321,10 +313,8 @@ static int __ip6addrlbl_del(struct net *net,
321 struct hlist_node *pos, *n; 313 struct hlist_node *pos, *n;
322 int ret = -ESRCH; 314 int ret = -ESRCH;
323 315
324 ADDRLABEL(KERN_DEBUG "%s(prefix=" NIP6_FMT ", prefixlen=%d, ifindex=%d)\n", 316 ADDRLABEL(KERN_DEBUG "%s(prefix=%pI6, prefixlen=%d, ifindex=%d)\n",
325 __func__, 317 __func__, prefix, prefixlen, ifindex);
326 NIP6(*prefix), prefixlen,
327 ifindex);
328 318
329 hlist_for_each_entry_safe(p, pos, n, &ip6addrlbl_table.head, list) { 319 hlist_for_each_entry_safe(p, pos, n, &ip6addrlbl_table.head, list) {
330 if (p->prefixlen == prefixlen && 320 if (p->prefixlen == prefixlen &&
@@ -347,10 +337,8 @@ static int ip6addrlbl_del(struct net *net,
347 struct in6_addr prefix_buf; 337 struct in6_addr prefix_buf;
348 int ret; 338 int ret;
349 339
350 ADDRLABEL(KERN_DEBUG "%s(prefix=" NIP6_FMT ", prefixlen=%d, ifindex=%d)\n", 340 ADDRLABEL(KERN_DEBUG "%s(prefix=%pI6, prefixlen=%d, ifindex=%d)\n",
351 __func__, 341 __func__, prefix, prefixlen, ifindex);
352 NIP6(*prefix), prefixlen,
353 ifindex);
354 342
355 ipv6_addr_prefix(&prefix_buf, prefix, prefixlen); 343 ipv6_addr_prefix(&prefix_buf, prefix, prefixlen);
356 spin_lock(&ip6addrlbl_table.lock); 344 spin_lock(&ip6addrlbl_table.lock);
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c
index 2ff0c8233e47..7a8a01369e5c 100644
--- a/net/ipv6/ah6.c
+++ b/net/ipv6/ah6.c
@@ -419,8 +419,8 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
419 if (!x) 419 if (!x)
420 return; 420 return;
421 421
422 NETDEBUG(KERN_DEBUG "pmtu discovery on SA AH/%08x/" NIP6_FMT "\n", 422 NETDEBUG(KERN_DEBUG "pmtu discovery on SA AH/%08x/%pI6\n",
423 ntohl(ah->spi), NIP6(iph->daddr)); 423 ntohl(ah->spi), &iph->daddr);
424 424
425 xfrm_state_put(x); 425 xfrm_state_put(x);
426} 426}
diff --git a/net/ipv6/anycast.c b/net/ipv6/anycast.c
index 8336cd81cb4f..1ae58bec1de0 100644
--- a/net/ipv6/anycast.c
+++ b/net/ipv6/anycast.c
@@ -512,11 +512,9 @@ static int ac6_seq_show(struct seq_file *seq, void *v)
512 struct ifacaddr6 *im = (struct ifacaddr6 *)v; 512 struct ifacaddr6 *im = (struct ifacaddr6 *)v;
513 struct ac6_iter_state *state = ac6_seq_private(seq); 513 struct ac6_iter_state *state = ac6_seq_private(seq);
514 514
515 seq_printf(seq, 515 seq_printf(seq, "%-4d %-15s %pi6 %5d\n",
516 "%-4d %-15s " NIP6_SEQFMT " %5d\n",
517 state->dev->ifindex, state->dev->name, 516 state->dev->ifindex, state->dev->name,
518 NIP6(im->aca_addr), 517 &im->aca_addr, im->aca_users);
519 im->aca_users);
520 return 0; 518 return 0;
521} 519}
522 520
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c
index b181b08fb761..c02a6308defe 100644
--- a/net/ipv6/esp6.c
+++ b/net/ipv6/esp6.c
@@ -367,8 +367,8 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
367 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, esph->spi, IPPROTO_ESP, AF_INET6); 367 x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, esph->spi, IPPROTO_ESP, AF_INET6);
368 if (!x) 368 if (!x)
369 return; 369 return;
370 printk(KERN_DEBUG "pmtu discovery on SA ESP/%08x/" NIP6_FMT "\n", 370 printk(KERN_DEBUG "pmtu discovery on SA ESP/%08x/%pI6\n",
371 ntohl(esph->spi), NIP6(iph->daddr)); 371 ntohl(esph->spi), &iph->daddr);
372 xfrm_state_put(x); 372 xfrm_state_put(x);
373} 373}
374 374
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 6bfffec2371c..1c7f400a3cfe 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -219,7 +219,7 @@ static int ipv6_dest_hao(struct sk_buff *skb, int optoff)
219 219
220 if (!(ipv6_addr_type(&hao->addr) & IPV6_ADDR_UNICAST)) { 220 if (!(ipv6_addr_type(&hao->addr) & IPV6_ADDR_UNICAST)) {
221 LIMIT_NETDEBUG( 221 LIMIT_NETDEBUG(
222 KERN_DEBUG "hao is not an unicast addr: " NIP6_FMT "\n", NIP6(hao->addr)); 222 KERN_DEBUG "hao is not an unicast addr: %pI6\n", &hao->addr);
223 goto discard; 223 goto discard;
224 } 224 }
225 225
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 9b7d19ae5ced..3c2821f9b529 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -646,9 +646,10 @@ static int icmpv6_rcv(struct sk_buff *skb)
646 int type; 646 int type;
647 647
648 if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) { 648 if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
649 struct sec_path *sp = skb_sec_path(skb);
649 int nh; 650 int nh;
650 651
651 if (!(skb->sp && skb->sp->xvec[skb->sp->len - 1]->props.flags & 652 if (!(sp && sp->xvec[sp->len - 1]->props.flags &
652 XFRM_STATE_ICMP)) 653 XFRM_STATE_ICMP))
653 goto drop_no_count; 654 goto drop_no_count;
654 655
@@ -680,8 +681,8 @@ static int icmpv6_rcv(struct sk_buff *skb)
680 skb->csum = ~csum_unfold(csum_ipv6_magic(saddr, daddr, skb->len, 681 skb->csum = ~csum_unfold(csum_ipv6_magic(saddr, daddr, skb->len,
681 IPPROTO_ICMPV6, 0)); 682 IPPROTO_ICMPV6, 0));
682 if (__skb_checksum_complete(skb)) { 683 if (__skb_checksum_complete(skb)) {
683 LIMIT_NETDEBUG(KERN_DEBUG "ICMPv6 checksum failed [" NIP6_FMT " > " NIP6_FMT "]\n", 684 LIMIT_NETDEBUG(KERN_DEBUG "ICMPv6 checksum failed [%pI6 > %pI6]\n",
684 NIP6(*saddr), NIP6(*daddr)); 685 saddr, daddr);
685 goto discard_it; 686 goto discard_it;
686 } 687 }
687 } 688 }
diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c
index 37a4e777e347..7927a8498d17 100644
--- a/net/ipv6/ip6_flowlabel.c
+++ b/net/ipv6/ip6_flowlabel.c
@@ -696,14 +696,14 @@ static int ip6fl_seq_show(struct seq_file *seq, void *v)
696 else { 696 else {
697 struct ip6_flowlabel *fl = v; 697 struct ip6_flowlabel *fl = v;
698 seq_printf(seq, 698 seq_printf(seq,
699 "%05X %-1d %-6d %-6d %-6ld %-8ld " NIP6_SEQFMT " %-4d\n", 699 "%05X %-1d %-6d %-6d %-6ld %-8ld %pi6 %-4d\n",
700 (unsigned)ntohl(fl->label), 700 (unsigned)ntohl(fl->label),
701 fl->share, 701 fl->share,
702 (unsigned)fl->owner, 702 (unsigned)fl->owner,
703 atomic_read(&fl->users), 703 atomic_read(&fl->users),
704 fl->linger/HZ, 704 fl->linger/HZ,
705 (long)(fl->expires - jiffies)/HZ, 705 (long)(fl->expires - jiffies)/HZ,
706 NIP6(fl->dst), 706 &fl->dst,
707 fl->opt ? fl->opt->opt_nflen : 0); 707 fl->opt ? fl->opt->opt_nflen : 0);
708 } 708 }
709 return 0; 709 return 0;
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index c77db0b95e26..7d92fd97cfb9 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -490,7 +490,7 @@ int ip6_forward(struct sk_buff *skb)
490 We don't send redirects to frames decapsulated from IPsec. 490 We don't send redirects to frames decapsulated from IPsec.
491 */ 491 */
492 if (skb->dev == dst->dev && dst->neighbour && opt->srcrt == 0 && 492 if (skb->dev == dst->dev && dst->neighbour && opt->srcrt == 0 &&
493 !skb->sp) { 493 !skb_sec_path(skb)) {
494 struct in6_addr *target = NULL; 494 struct in6_addr *target = NULL;
495 struct rt6_info *rt; 495 struct rt6_info *rt;
496 struct neighbour *n = dst->neighbour; 496 struct neighbour *n = dst->neighbour;
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 182f8a177e7f..c491fb98a5e3 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -297,9 +297,8 @@ static int ipmr_mfc_seq_show(struct seq_file *seq, void *v)
297 const struct mfc6_cache *mfc = v; 297 const struct mfc6_cache *mfc = v;
298 const struct ipmr_mfc_iter *it = seq->private; 298 const struct ipmr_mfc_iter *it = seq->private;
299 299
300 seq_printf(seq, 300 seq_printf(seq, "%pI6 %pI6 %-3d %8ld %8ld %8ld",
301 NIP6_FMT " " NIP6_FMT " %-3d %8ld %8ld %8ld", 301 &mfc->mf6c_mcastgrp, &mfc->mf6c_origin,
302 NIP6(mfc->mf6c_mcastgrp), NIP6(mfc->mf6c_origin),
303 mfc->mf6c_parent, 302 mfc->mf6c_parent,
304 mfc->mfc_un.res.pkt, 303 mfc->mfc_un.res.pkt,
305 mfc->mfc_un.res.bytes, 304 mfc->mfc_un.res.bytes,
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c
index 4545e4306862..d4576a9c154f 100644
--- a/net/ipv6/ipcomp6.c
+++ b/net/ipv6/ipcomp6.c
@@ -67,8 +67,8 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
67 if (!x) 67 if (!x)
68 return; 68 return;
69 69
70 printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/" NIP6_FMT "\n", 70 printk(KERN_DEBUG "pmtu discovery on SA IPCOMP/%08x/%pI6\n",
71 spi, NIP6(iph->daddr)); 71 spi, &iph->daddr);
72 xfrm_state_put(x); 72 xfrm_state_put(x);
73} 73}
74 74
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index d7b3c6d398ae..a76199ecad23 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -2430,9 +2430,9 @@ static int igmp6_mc_seq_show(struct seq_file *seq, void *v)
2430 struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq); 2430 struct igmp6_mc_iter_state *state = igmp6_mc_seq_private(seq);
2431 2431
2432 seq_printf(seq, 2432 seq_printf(seq,
2433 "%-4d %-15s " NIP6_SEQFMT " %5d %08X %ld\n", 2433 "%-4d %-15s %pi6 %5d %08X %ld\n",
2434 state->dev->ifindex, state->dev->name, 2434 state->dev->ifindex, state->dev->name,
2435 NIP6(im->mca_addr), 2435 &im->mca_addr,
2436 im->mca_users, im->mca_flags, 2436 im->mca_users, im->mca_flags,
2437 (im->mca_flags&MAF_TIMER_RUNNING) ? 2437 (im->mca_flags&MAF_TIMER_RUNNING) ?
2438 jiffies_to_clock_t(im->mca_timer.expires-jiffies) : 0); 2438 jiffies_to_clock_t(im->mca_timer.expires-jiffies) : 0);
@@ -2591,10 +2591,10 @@ static int igmp6_mcf_seq_show(struct seq_file *seq, void *v)
2591 "Source Address", "INC", "EXC"); 2591 "Source Address", "INC", "EXC");
2592 } else { 2592 } else {
2593 seq_printf(seq, 2593 seq_printf(seq,
2594 "%3d %6.6s " NIP6_SEQFMT " " NIP6_SEQFMT " %6lu %6lu\n", 2594 "%3d %6.6s %pi6 %pi6 %6lu %6lu\n",
2595 state->dev->ifindex, state->dev->name, 2595 state->dev->ifindex, state->dev->name,
2596 NIP6(state->im->mca_addr), 2596 &state->im->mca_addr,
2597 NIP6(psf->sf_addr), 2597 &psf->sf_addr,
2598 psf->sf_count[MCAST_INCLUDE], 2598 psf->sf_count[MCAST_INCLUDE],
2599 psf->sf_count[MCAST_EXCLUDE]); 2599 psf->sf_count[MCAST_EXCLUDE]);
2600 } 2600 }
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 172438320eec..2a6752dae09d 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -647,11 +647,8 @@ static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
647 647
648 if ((probes -= neigh->parms->ucast_probes) < 0) { 648 if ((probes -= neigh->parms->ucast_probes) < 0) {
649 if (!(neigh->nud_state & NUD_VALID)) { 649 if (!(neigh->nud_state & NUD_VALID)) {
650 ND_PRINTK1(KERN_DEBUG 650 ND_PRINTK1(KERN_DEBUG "%s(): trying to ucast probe in NUD_INVALID: %pI6\n",
651 "%s(): trying to ucast probe in NUD_INVALID: " 651 __func__, target);
652 NIP6_FMT "\n",
653 __func__,
654 NIP6(*target));
655 } 652 }
656 ndisc_send_ns(dev, neigh, target, target, saddr); 653 ndisc_send_ns(dev, neigh, target, target, saddr);
657 } else if ((probes -= neigh->parms->app_probes) < 0) { 654 } else if ((probes -= neigh->parms->app_probes) < 0) {
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c
index caa441d09567..02885e8bb69b 100644
--- a/net/ipv6/netfilter/ip6t_LOG.c
+++ b/net/ipv6/netfilter/ip6t_LOG.c
@@ -61,7 +61,7 @@ static void dump_packet(const struct nf_loginfo *info,
61 } 61 }
62 62
63 /* Max length: 88 "SRC=0000.0000.0000.0000.0000.0000.0000.0000 DST=0000.0000.0000.0000.0000.0000.0000.0000 " */ 63 /* Max length: 88 "SRC=0000.0000.0000.0000.0000.0000.0000.0000 DST=0000.0000.0000.0000.0000.0000.0000.0000 " */
64 printk("SRC=" NIP6_FMT " DST=" NIP6_FMT " ", NIP6(ih->saddr), NIP6(ih->daddr)); 64 printk("SRC=%pI6 DST=%pI6 ", &ih->saddr, &ih->daddr);
65 65
66 /* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */ 66 /* Max length: 44 "LEN=65535 TC=255 HOPLIMIT=255 FLOWLBL=FFFFF " */
67 printk("LEN=%Zu TC=%u HOPLIMIT=%u FLOWLBL=%u ", 67 printk("LEN=%Zu TC=%u HOPLIMIT=%u FLOWLBL=%u ",
diff --git a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
index e91db16611d9..727b9530448a 100644
--- a/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
+++ b/net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c
@@ -56,9 +56,8 @@ static bool ipv6_invert_tuple(struct nf_conntrack_tuple *tuple,
56static int ipv6_print_tuple(struct seq_file *s, 56static int ipv6_print_tuple(struct seq_file *s,
57 const struct nf_conntrack_tuple *tuple) 57 const struct nf_conntrack_tuple *tuple)
58{ 58{
59 return seq_printf(s, "src=" NIP6_FMT " dst=" NIP6_FMT " ", 59 return seq_printf(s, "src=%pI6 dst=%pI6 ",
60 NIP6(*((struct in6_addr *)tuple->src.u3.ip6)), 60 tuple->src.u3.ip6, tuple->dst.u3.ip6);
61 NIP6(*((struct in6_addr *)tuple->dst.u3.ip6)));
62} 61}
63 62
64/* 63/*
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 89dc69924340..d69fa462d3f0 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2408,19 +2408,16 @@ static int rt6_info_route(struct rt6_info *rt, void *p_arg)
2408{ 2408{
2409 struct seq_file *m = p_arg; 2409 struct seq_file *m = p_arg;
2410 2410
2411 seq_printf(m, NIP6_SEQFMT " %02x ", NIP6(rt->rt6i_dst.addr), 2411 seq_printf(m, "%pi6 %02x ", &rt->rt6i_dst.addr, rt->rt6i_dst.plen);
2412 rt->rt6i_dst.plen);
2413 2412
2414#ifdef CONFIG_IPV6_SUBTREES 2413#ifdef CONFIG_IPV6_SUBTREES
2415 seq_printf(m, NIP6_SEQFMT " %02x ", NIP6(rt->rt6i_src.addr), 2414 seq_printf(m, "%pi6 %02x ", &rt->rt6i_src.addr, rt->rt6i_src.plen);
2416 rt->rt6i_src.plen);
2417#else 2415#else
2418 seq_puts(m, "00000000000000000000000000000000 00 "); 2416 seq_puts(m, "00000000000000000000000000000000 00 ");
2419#endif 2417#endif
2420 2418
2421 if (rt->rt6i_nexthop) { 2419 if (rt->rt6i_nexthop) {
2422 seq_printf(m, NIP6_SEQFMT, 2420 seq_printf(m, "%pi6", rt->rt6i_nexthop->primary_key);
2423 NIP6(*((struct in6_addr *)rt->rt6i_nexthop->primary_key)));
2424 } else { 2421 } else {
2425 seq_puts(m, "00000000000000000000000000000000"); 2422 seq_puts(m, "00000000000000000000000000000000");
2426 } 2423 }
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index b6b356b7912a..984276463a8d 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -872,12 +872,10 @@ static int tcp_v6_inbound_md5_hash (struct sock *sk, struct sk_buff *skb)
872 872
873 if (genhash || memcmp(hash_location, newhash, 16) != 0) { 873 if (genhash || memcmp(hash_location, newhash, 16) != 0) {
874 if (net_ratelimit()) { 874 if (net_ratelimit()) {
875 printk(KERN_INFO "MD5 Hash %s for " 875 printk(KERN_INFO "MD5 Hash %s for (%pI6, %u)->(%pI6, %u)\n",
876 "(" NIP6_FMT ", %u)->"
877 "(" NIP6_FMT ", %u)\n",
878 genhash ? "failed" : "mismatch", 876 genhash ? "failed" : "mismatch",
879 NIP6(ip6h->saddr), ntohs(th->source), 877 &ip6h->saddr, ntohs(th->source),
880 NIP6(ip6h->daddr), ntohs(th->dest)); 878 &ip6h->daddr, ntohs(th->dest));
881 } 879 }
882 return 1; 880 return 1;
883 } 881 }
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index e51da8c092fa..32d914db6c4f 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -54,62 +54,89 @@ int udp_v6_get_port(struct sock *sk, unsigned short snum)
54 return udp_lib_get_port(sk, snum, ipv6_rcv_saddr_equal); 54 return udp_lib_get_port(sk, snum, ipv6_rcv_saddr_equal);
55} 55}
56 56
57static inline int compute_score(struct sock *sk, struct net *net,
58 unsigned short hnum,
59 struct in6_addr *saddr, __be16 sport,
60 struct in6_addr *daddr, __be16 dport,
61 int dif)
62{
63 int score = -1;
64
65 if (net_eq(sock_net(sk), net) && sk->sk_hash == hnum &&
66 sk->sk_family == PF_INET6) {
67 struct ipv6_pinfo *np = inet6_sk(sk);
68 struct inet_sock *inet = inet_sk(sk);
69
70 score = 0;
71 if (inet->dport) {
72 if (inet->dport != sport)
73 return -1;
74 score++;
75 }
76 if (!ipv6_addr_any(&np->rcv_saddr)) {
77 if (!ipv6_addr_equal(&np->rcv_saddr, daddr))
78 return -1;
79 score++;
80 }
81 if (!ipv6_addr_any(&np->daddr)) {
82 if (!ipv6_addr_equal(&np->daddr, saddr))
83 return -1;
84 score++;
85 }
86 if (sk->sk_bound_dev_if) {
87 if (sk->sk_bound_dev_if != dif)
88 return -1;
89 score++;
90 }
91 }
92 return score;
93}
94
57static struct sock *__udp6_lib_lookup(struct net *net, 95static struct sock *__udp6_lib_lookup(struct net *net,
58 struct in6_addr *saddr, __be16 sport, 96 struct in6_addr *saddr, __be16 sport,
59 struct in6_addr *daddr, __be16 dport, 97 struct in6_addr *daddr, __be16 dport,
60 int dif, struct hlist_head udptable[]) 98 int dif, struct udp_table *udptable)
61{ 99{
62 struct sock *sk, *result = NULL; 100 struct sock *sk, *result;
63 struct hlist_node *node; 101 struct hlist_node *node, *next;
64 unsigned short hnum = ntohs(dport); 102 unsigned short hnum = ntohs(dport);
65 int badness = -1; 103 unsigned int hash = udp_hashfn(net, hnum);
66 104 struct udp_hslot *hslot = &udptable->hash[hash];
67 read_lock(&udp_hash_lock); 105 int score, badness;
68 sk_for_each(sk, node, &udptable[udp_hashfn(net, hnum)]) { 106
69 struct inet_sock *inet = inet_sk(sk); 107 rcu_read_lock();
70 108begin:
71 if (net_eq(sock_net(sk), net) && sk->sk_hash == hnum && 109 result = NULL;
72 sk->sk_family == PF_INET6) { 110 badness = -1;
73 struct ipv6_pinfo *np = inet6_sk(sk); 111 sk_for_each_rcu_safenext(sk, node, &hslot->head, next) {
74 int score = 0; 112 /*
75 if (inet->dport) { 113 * lockless reader, and SLAB_DESTROY_BY_RCU items:
76 if (inet->dport != sport) 114 * We must check this item was not moved to another chain
77 continue; 115 */
78 score++; 116 if (udp_hashfn(net, sk->sk_hash) != hash)
79 } 117 goto begin;
80 if (!ipv6_addr_any(&np->rcv_saddr)) { 118 score = compute_score(sk, net, hnum, saddr, sport, daddr, dport, dif);
81 if (!ipv6_addr_equal(&np->rcv_saddr, daddr)) 119 if (score > badness) {
82 continue; 120 result = sk;
83 score++; 121 badness = score;
84 } 122 }
85 if (!ipv6_addr_any(&np->daddr)) { 123 }
86 if (!ipv6_addr_equal(&np->daddr, saddr)) 124 if (result) {
87 continue; 125 if (unlikely(!atomic_inc_not_zero(&result->sk_refcnt)))
88 score++; 126 result = NULL;
89 } 127 else if (unlikely(compute_score(result, net, hnum, saddr, sport,
90 if (sk->sk_bound_dev_if) { 128 daddr, dport, dif) < badness)) {
91 if (sk->sk_bound_dev_if != dif) 129 sock_put(result);
92 continue; 130 goto begin;
93 score++;
94 }
95 if (score == 4) {
96 result = sk;
97 break;
98 } else if (score > badness) {
99 result = sk;
100 badness = score;
101 }
102 } 131 }
103 } 132 }
104 if (result) 133 rcu_read_unlock();
105 sock_hold(result);
106 read_unlock(&udp_hash_lock);
107 return result; 134 return result;
108} 135}
109 136
110static struct sock *__udp6_lib_lookup_skb(struct sk_buff *skb, 137static struct sock *__udp6_lib_lookup_skb(struct sk_buff *skb,
111 __be16 sport, __be16 dport, 138 __be16 sport, __be16 dport,
112 struct hlist_head udptable[]) 139 struct udp_table *udptable)
113{ 140{
114 struct sock *sk; 141 struct sock *sk;
115 struct ipv6hdr *iph = ipv6_hdr(skb); 142 struct ipv6hdr *iph = ipv6_hdr(skb);
@@ -239,7 +266,7 @@ csum_copy_err:
239 266
240void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt, 267void __udp6_lib_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
241 int type, int code, int offset, __be32 info, 268 int type, int code, int offset, __be32 info,
242 struct hlist_head udptable[] ) 269 struct udp_table *udptable)
243{ 270{
244 struct ipv6_pinfo *np; 271 struct ipv6_pinfo *np;
245 struct ipv6hdr *hdr = (struct ipv6hdr*)skb->data; 272 struct ipv6hdr *hdr = (struct ipv6hdr*)skb->data;
@@ -275,7 +302,7 @@ static __inline__ void udpv6_err(struct sk_buff *skb,
275 struct inet6_skb_parm *opt, int type, 302 struct inet6_skb_parm *opt, int type,
276 int code, int offset, __be32 info ) 303 int code, int offset, __be32 info )
277{ 304{
278 __udp6_lib_err(skb, opt, type, code, offset, info, udp_hash); 305 __udp6_lib_err(skb, opt, type, code, offset, info, &udp_table);
279} 306}
280 307
281int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb) 308int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
@@ -374,14 +401,15 @@ static struct sock *udp_v6_mcast_next(struct sock *sk,
374 */ 401 */
375static int __udp6_lib_mcast_deliver(struct net *net, struct sk_buff *skb, 402static int __udp6_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
376 struct in6_addr *saddr, struct in6_addr *daddr, 403 struct in6_addr *saddr, struct in6_addr *daddr,
377 struct hlist_head udptable[]) 404 struct udp_table *udptable)
378{ 405{
379 struct sock *sk, *sk2; 406 struct sock *sk, *sk2;
380 const struct udphdr *uh = udp_hdr(skb); 407 const struct udphdr *uh = udp_hdr(skb);
408 struct udp_hslot *hslot = &udptable->hash[udp_hashfn(net, ntohs(uh->dest))];
381 int dif; 409 int dif;
382 410
383 read_lock(&udp_hash_lock); 411 spin_lock(&hslot->lock);
384 sk = sk_head(&udptable[udp_hashfn(net, ntohs(uh->dest))]); 412 sk = sk_head(&hslot->head);
385 dif = inet6_iif(skb); 413 dif = inet6_iif(skb);
386 sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif); 414 sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
387 if (!sk) { 415 if (!sk) {
@@ -409,7 +437,7 @@ static int __udp6_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
409 sk_add_backlog(sk, skb); 437 sk_add_backlog(sk, skb);
410 bh_unlock_sock(sk); 438 bh_unlock_sock(sk);
411out: 439out:
412 read_unlock(&udp_hash_lock); 440 spin_unlock(&hslot->lock);
413 return 0; 441 return 0;
414} 442}
415 443
@@ -447,7 +475,7 @@ static inline int udp6_csum_init(struct sk_buff *skb, struct udphdr *uh,
447 return 0; 475 return 0;
448} 476}
449 477
450int __udp6_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[], 478int __udp6_lib_rcv(struct sk_buff *skb, struct udp_table *udptable,
451 int proto) 479 int proto)
452{ 480{
453 struct sock *sk; 481 struct sock *sk;
@@ -544,7 +572,7 @@ discard:
544 572
545static __inline__ int udpv6_rcv(struct sk_buff *skb) 573static __inline__ int udpv6_rcv(struct sk_buff *skb)
546{ 574{
547 return __udp6_lib_rcv(skb, udp_hash, IPPROTO_UDP); 575 return __udp6_lib_rcv(skb, &udp_table, IPPROTO_UDP);
548} 576}
549 577
550/* 578/*
@@ -1008,7 +1036,7 @@ int udp6_seq_show(struct seq_file *seq, void *v)
1008static struct udp_seq_afinfo udp6_seq_afinfo = { 1036static struct udp_seq_afinfo udp6_seq_afinfo = {
1009 .name = "udp6", 1037 .name = "udp6",
1010 .family = AF_INET6, 1038 .family = AF_INET6,
1011 .hashtable = udp_hash, 1039 .udp_table = &udp_table,
1012 .seq_fops = { 1040 .seq_fops = {
1013 .owner = THIS_MODULE, 1041 .owner = THIS_MODULE,
1014 }, 1042 },
@@ -1050,7 +1078,8 @@ struct proto udpv6_prot = {
1050 .sysctl_wmem = &sysctl_udp_wmem_min, 1078 .sysctl_wmem = &sysctl_udp_wmem_min,
1051 .sysctl_rmem = &sysctl_udp_rmem_min, 1079 .sysctl_rmem = &sysctl_udp_rmem_min,
1052 .obj_size = sizeof(struct udp6_sock), 1080 .obj_size = sizeof(struct udp6_sock),
1053 .h.udp_hash = udp_hash, 1081 .slab_flags = SLAB_DESTROY_BY_RCU,
1082 .h.udp_table = &udp_table,
1054#ifdef CONFIG_COMPAT 1083#ifdef CONFIG_COMPAT
1055 .compat_setsockopt = compat_udpv6_setsockopt, 1084 .compat_setsockopt = compat_udpv6_setsockopt,
1056 .compat_getsockopt = compat_udpv6_getsockopt, 1085 .compat_getsockopt = compat_udpv6_getsockopt,
diff --git a/net/ipv6/udp_impl.h b/net/ipv6/udp_impl.h
index 92dd7da766d8..23779208c334 100644
--- a/net/ipv6/udp_impl.h
+++ b/net/ipv6/udp_impl.h
@@ -7,9 +7,9 @@
7#include <net/inet_common.h> 7#include <net/inet_common.h>
8#include <net/transp_v6.h> 8#include <net/transp_v6.h>
9 9
10extern int __udp6_lib_rcv(struct sk_buff *, struct hlist_head [], int ); 10extern int __udp6_lib_rcv(struct sk_buff *, struct udp_table *, int );
11extern void __udp6_lib_err(struct sk_buff *, struct inet6_skb_parm *, 11extern void __udp6_lib_err(struct sk_buff *, struct inet6_skb_parm *,
12 int , int , int , __be32 , struct hlist_head []); 12 int , int , int , __be32 , struct udp_table *);
13 13
14extern int udp_v6_get_port(struct sock *sk, unsigned short snum); 14extern int udp_v6_get_port(struct sock *sk, unsigned short snum);
15 15
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index 3cd1a1ac3d6c..ba162a824585 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -15,14 +15,14 @@
15 15
16static int udplitev6_rcv(struct sk_buff *skb) 16static int udplitev6_rcv(struct sk_buff *skb)
17{ 17{
18 return __udp6_lib_rcv(skb, udplite_hash, IPPROTO_UDPLITE); 18 return __udp6_lib_rcv(skb, &udplite_table, IPPROTO_UDPLITE);
19} 19}
20 20
21static void udplitev6_err(struct sk_buff *skb, 21static void udplitev6_err(struct sk_buff *skb,
22 struct inet6_skb_parm *opt, 22 struct inet6_skb_parm *opt,
23 int type, int code, int offset, __be32 info) 23 int type, int code, int offset, __be32 info)
24{ 24{
25 __udp6_lib_err(skb, opt, type, code, offset, info, udplite_hash); 25 __udp6_lib_err(skb, opt, type, code, offset, info, &udplite_table);
26} 26}
27 27
28static struct inet6_protocol udplitev6_protocol = { 28static struct inet6_protocol udplitev6_protocol = {
@@ -49,7 +49,8 @@ struct proto udplitev6_prot = {
49 .unhash = udp_lib_unhash, 49 .unhash = udp_lib_unhash,
50 .get_port = udp_v6_get_port, 50 .get_port = udp_v6_get_port,
51 .obj_size = sizeof(struct udp6_sock), 51 .obj_size = sizeof(struct udp6_sock),
52 .h.udp_hash = udplite_hash, 52 .slab_flags = SLAB_DESTROY_BY_RCU,
53 .h.udp_table = &udplite_table,
53#ifdef CONFIG_COMPAT 54#ifdef CONFIG_COMPAT
54 .compat_setsockopt = compat_udpv6_setsockopt, 55 .compat_setsockopt = compat_udpv6_setsockopt,
55 .compat_getsockopt = compat_udpv6_getsockopt, 56 .compat_getsockopt = compat_udpv6_getsockopt,
@@ -95,7 +96,7 @@ void udplitev6_exit(void)
95static struct udp_seq_afinfo udplite6_seq_afinfo = { 96static struct udp_seq_afinfo udplite6_seq_afinfo = {
96 .name = "udplite6", 97 .name = "udplite6",
97 .family = AF_INET6, 98 .family = AF_INET6,
98 .hashtable = udplite_hash, 99 .udp_table = &udplite_table,
99 .seq_fops = { 100 .seq_fops = {
100 .owner = THIS_MODULE, 101 .owner = THIS_MODULE,
101 }, 102 },
diff --git a/net/irda/irlan/irlan_client.c b/net/irda/irlan/irlan_client.c
index 6be1ec26b30c..42f7d960d055 100644
--- a/net/irda/irlan/irlan_client.c
+++ b/net/irda/irlan/irlan_client.c
@@ -436,7 +436,6 @@ static void irlan_check_response_param(struct irlan_cb *self, char *param,
436 __u16 tmp_cpu; /* Temporary value in host order */ 436 __u16 tmp_cpu; /* Temporary value in host order */
437 __u8 *bytes; 437 __u8 *bytes;
438 int i; 438 int i;
439 DECLARE_MAC_BUF(mac);
440 439
441 IRDA_DEBUG(4, "%s(), parm=%s\n", __func__ , param); 440 IRDA_DEBUG(4, "%s(), parm=%s\n", __func__ , param);
442 441
@@ -521,8 +520,7 @@ static void irlan_check_response_param(struct irlan_cb *self, char *param,
521 /* FILTER_ENTRY, have we got an ethernet address? */ 520 /* FILTER_ENTRY, have we got an ethernet address? */
522 if (strcmp(param, "FILTER_ENTRY") == 0) { 521 if (strcmp(param, "FILTER_ENTRY") == 0) {
523 bytes = value; 522 bytes = value;
524 IRDA_DEBUG(4, "Ethernet address = %s\n", 523 IRDA_DEBUG(4, "Ethernet address = %pM\n", bytes);
525 print_mac(mac, bytes));
526 for (i = 0; i < 6; i++) 524 for (i = 0; i < 6; i++)
527 self->dev->dev_addr[i] = bytes[i]; 525 self->dev->dev_addr[i] = bytes[i];
528 } 526 }
diff --git a/net/llc/llc_proc.c b/net/llc/llc_proc.c
index 48212c0a961c..b58bd7c6cdf8 100644
--- a/net/llc/llc_proc.c
+++ b/net/llc/llc_proc.c
@@ -27,8 +27,7 @@
27 27
28static void llc_ui_format_mac(struct seq_file *seq, u8 *addr) 28static void llc_ui_format_mac(struct seq_file *seq, u8 *addr)
29{ 29{
30 DECLARE_MAC_BUF(mac); 30 seq_printf(seq, "%pM", addr);
31 seq_printf(seq, "%s", print_mac(mac, addr));
32} 31}
33 32
34static struct sock *llc_get_sk_idx(loff_t pos) 33static struct sock *llc_get_sk_idx(loff_t pos)
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index a3294d109322..6424ac565ae0 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -188,7 +188,6 @@ void ieee80211_debugfs_key_add(struct ieee80211_key *key)
188 { 188 {
189 static int keycount; 189 static int keycount;
190 char buf[50]; 190 char buf[50];
191 DECLARE_MAC_BUF(mac);
192 struct sta_info *sta; 191 struct sta_info *sta;
193 192
194 if (!key->local->debugfs.keys) 193 if (!key->local->debugfs.keys)
@@ -206,8 +205,7 @@ void ieee80211_debugfs_key_add(struct ieee80211_key *key)
206 rcu_read_lock(); 205 rcu_read_lock();
207 sta = rcu_dereference(key->sta); 206 sta = rcu_dereference(key->sta);
208 if (sta) 207 if (sta)
209 sprintf(buf, "../../stations/%s", 208 sprintf(buf, "../../stations/%pM", sta->sta.addr);
210 print_mac(mac, sta->sta.addr));
211 rcu_read_unlock(); 209 rcu_read_unlock();
212 210
213 /* using sta as a boolean is fine outside RCU lock */ 211 /* using sta as a boolean is fine outside RCU lock */
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 2ad504fc3414..69b2fbf35145 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -104,8 +104,7 @@ static ssize_t ieee80211_if_fmt_##name( \
104 const struct ieee80211_sub_if_data *sdata, char *buf, \ 104 const struct ieee80211_sub_if_data *sdata, char *buf, \
105 int buflen) \ 105 int buflen) \
106{ \ 106{ \
107 DECLARE_MAC_BUF(mac); \ 107 return scnprintf(buf, buflen, "%pM\n", sdata->field); \
108 return scnprintf(buf, buflen, "%s\n", print_mac(mac, sdata->field));\
109} 108}
110 109
111#define __IEEE80211_IF_FILE(name) \ 110#define __IEEE80211_IF_FILE(name) \
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index 189d0bafa91a..21e8b1c4f64e 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -246,15 +246,14 @@ STA_OPS_WR(agg_status);
246void ieee80211_sta_debugfs_add(struct sta_info *sta) 246void ieee80211_sta_debugfs_add(struct sta_info *sta)
247{ 247{
248 struct dentry *stations_dir = sta->local->debugfs.stations; 248 struct dentry *stations_dir = sta->local->debugfs.stations;
249 DECLARE_MAC_BUF(mbuf); 249 u8 mac[3*ETH_ALEN];
250 u8 *mac;
251 250
252 sta->debugfs.add_has_run = true; 251 sta->debugfs.add_has_run = true;
253 252
254 if (!stations_dir) 253 if (!stations_dir)
255 return; 254 return;
256 255
257 mac = print_mac(mbuf, sta->sta.addr); 256 snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
258 257
259 /* 258 /*
260 * This might fail due to a race condition: 259 * This might fail due to a race condition:
diff --git a/net/mac80211/event.c b/net/mac80211/event.c
index 8de60de70bc9..0d95561c0ee0 100644
--- a/net/mac80211/event.c
+++ b/net/mac80211/event.c
@@ -21,14 +21,13 @@ void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int ke
21{ 21{
22 union iwreq_data wrqu; 22 union iwreq_data wrqu;
23 char *buf = kmalloc(128, GFP_ATOMIC); 23 char *buf = kmalloc(128, GFP_ATOMIC);
24 DECLARE_MAC_BUF(mac);
25 24
26 if (buf) { 25 if (buf) {
27 /* TODO: needed parameters: count, key type, TSC */ 26 /* TODO: needed parameters: count, key type, TSC */
28 sprintf(buf, "MLME-MICHAELMICFAILURE.indication(" 27 sprintf(buf, "MLME-MICHAELMICFAILURE.indication("
29 "keyid=%d %scast addr=%s)", 28 "keyid=%d %scast addr=%pM)",
30 keyidx, hdr->addr1[0] & 0x01 ? "broad" : "uni", 29 keyidx, hdr->addr1[0] & 0x01 ? "broad" : "uni",
31 print_mac(mac, hdr->addr2)); 30 hdr->addr2);
32 memset(&wrqu, 0, sizeof(wrqu)); 31 memset(&wrqu, 0, sizeof(wrqu));
33 wrqu.data.length = strlen(buf); 32 wrqu.data.length = strlen(buf);
34 wireless_send_event(sdata->dev, IWEVCUSTOM, &wrqu, buf); 33 wireless_send_event(sdata->dev, IWEVCUSTOM, &wrqu, buf);
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c
index dc7d9a3d70d5..b854483cf23f 100644
--- a/net/mac80211/ht.c
+++ b/net/mac80211/ht.c
@@ -241,7 +241,6 @@ void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *r
241 struct ieee80211_hw *hw = &local->hw; 241 struct ieee80211_hw *hw = &local->hw;
242 struct sta_info *sta; 242 struct sta_info *sta;
243 int ret, i; 243 int ret, i;
244 DECLARE_MAC_BUF(mac);
245 244
246 rcu_read_lock(); 245 rcu_read_lock();
247 246
@@ -269,8 +268,8 @@ void ieee80211_sta_stop_rx_ba_session(struct ieee80211_sub_if_data *sdata, u8 *r
269 BUG_ON(!local->ops->ampdu_action); 268 BUG_ON(!local->ops->ampdu_action);
270 269
271#ifdef CONFIG_MAC80211_HT_DEBUG 270#ifdef CONFIG_MAC80211_HT_DEBUG
272 printk(KERN_DEBUG "Rx BA session stop requested for %s tid %u\n", 271 printk(KERN_DEBUG "Rx BA session stop requested for %pM tid %u\n",
273 print_mac(mac, ra), tid); 272 ra, tid);
274#endif /* CONFIG_MAC80211_HT_DEBUG */ 273#endif /* CONFIG_MAC80211_HT_DEBUG */
275 274
276 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_STOP, 275 ret = local->ops->ampdu_action(hw, IEEE80211_AMPDU_RX_STOP,
@@ -383,14 +382,13 @@ int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid)
383 u16 start_seq_num; 382 u16 start_seq_num;
384 u8 *state; 383 u8 *state;
385 int ret; 384 int ret;
386 DECLARE_MAC_BUF(mac);
387 385
388 if (tid >= STA_TID_NUM) 386 if (tid >= STA_TID_NUM)
389 return -EINVAL; 387 return -EINVAL;
390 388
391#ifdef CONFIG_MAC80211_HT_DEBUG 389#ifdef CONFIG_MAC80211_HT_DEBUG
392 printk(KERN_DEBUG "Open BA session requested for %s tid %u\n", 390 printk(KERN_DEBUG "Open BA session requested for %pM tid %u\n",
393 print_mac(mac, ra), tid); 391 ra, tid);
394#endif /* CONFIG_MAC80211_HT_DEBUG */ 392#endif /* CONFIG_MAC80211_HT_DEBUG */
395 393
396 rcu_read_lock(); 394 rcu_read_lock();
@@ -524,7 +522,6 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
524 struct sta_info *sta; 522 struct sta_info *sta;
525 u8 *state; 523 u8 *state;
526 int ret = 0; 524 int ret = 0;
527 DECLARE_MAC_BUF(mac);
528 525
529 if (tid >= STA_TID_NUM) 526 if (tid >= STA_TID_NUM)
530 return -EINVAL; 527 return -EINVAL;
@@ -546,8 +543,8 @@ int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
546 } 543 }
547 544
548#ifdef CONFIG_MAC80211_HT_DEBUG 545#ifdef CONFIG_MAC80211_HT_DEBUG
549 printk(KERN_DEBUG "Tx BA session stop requested for %s tid %u\n", 546 printk(KERN_DEBUG "Tx BA session stop requested for %pM tid %u\n",
550 print_mac(mac, ra), tid); 547 ra, tid);
551#endif /* CONFIG_MAC80211_HT_DEBUG */ 548#endif /* CONFIG_MAC80211_HT_DEBUG */
552 549
553 ieee80211_stop_queue(hw, sta->tid_to_tx_q[tid]); 550 ieee80211_stop_queue(hw, sta->tid_to_tx_q[tid]);
@@ -579,7 +576,6 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid)
579 struct ieee80211_local *local = hw_to_local(hw); 576 struct ieee80211_local *local = hw_to_local(hw);
580 struct sta_info *sta; 577 struct sta_info *sta;
581 u8 *state; 578 u8 *state;
582 DECLARE_MAC_BUF(mac);
583 579
584 if (tid >= STA_TID_NUM) { 580 if (tid >= STA_TID_NUM) {
585#ifdef CONFIG_MAC80211_HT_DEBUG 581#ifdef CONFIG_MAC80211_HT_DEBUG
@@ -594,8 +590,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid)
594 if (!sta) { 590 if (!sta) {
595 rcu_read_unlock(); 591 rcu_read_unlock();
596#ifdef CONFIG_MAC80211_HT_DEBUG 592#ifdef CONFIG_MAC80211_HT_DEBUG
597 printk(KERN_DEBUG "Could not find station: %s\n", 593 printk(KERN_DEBUG "Could not find station: %pM\n", ra);
598 print_mac(mac, ra));
599#endif 594#endif
600 return; 595 return;
601 } 596 }
@@ -634,7 +629,6 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid)
634 struct sta_info *sta; 629 struct sta_info *sta;
635 u8 *state; 630 u8 *state;
636 int agg_queue; 631 int agg_queue;
637 DECLARE_MAC_BUF(mac);
638 632
639 if (tid >= STA_TID_NUM) { 633 if (tid >= STA_TID_NUM) {
640#ifdef CONFIG_MAC80211_HT_DEBUG 634#ifdef CONFIG_MAC80211_HT_DEBUG
@@ -645,16 +639,15 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid)
645 } 639 }
646 640
647#ifdef CONFIG_MAC80211_HT_DEBUG 641#ifdef CONFIG_MAC80211_HT_DEBUG
648 printk(KERN_DEBUG "Stopping Tx BA session for %s tid %d\n", 642 printk(KERN_DEBUG "Stopping Tx BA session for %pM tid %d\n",
649 print_mac(mac, ra), tid); 643 ra, tid);
650#endif /* CONFIG_MAC80211_HT_DEBUG */ 644#endif /* CONFIG_MAC80211_HT_DEBUG */
651 645
652 rcu_read_lock(); 646 rcu_read_lock();
653 sta = sta_info_get(local, ra); 647 sta = sta_info_get(local, ra);
654 if (!sta) { 648 if (!sta) {
655#ifdef CONFIG_MAC80211_HT_DEBUG 649#ifdef CONFIG_MAC80211_HT_DEBUG
656 printk(KERN_DEBUG "Could not find station: %s\n", 650 printk(KERN_DEBUG "Could not find station: %pM\n", ra);
657 print_mac(mac, ra));
658#endif 651#endif
659 rcu_read_unlock(); 652 rcu_read_unlock();
660 return; 653 return;
@@ -783,7 +776,6 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
783 u16 capab, tid, timeout, ba_policy, buf_size, start_seq_num, status; 776 u16 capab, tid, timeout, ba_policy, buf_size, start_seq_num, status;
784 u8 dialog_token; 777 u8 dialog_token;
785 int ret = -EOPNOTSUPP; 778 int ret = -EOPNOTSUPP;
786 DECLARE_MAC_BUF(mac);
787 779
788 /* extract session parameters from addba request frame */ 780 /* extract session parameters from addba request frame */
789 dialog_token = mgmt->u.action.u.addba_req.dialog_token; 781 dialog_token = mgmt->u.action.u.addba_req.dialog_token;
@@ -808,8 +800,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
808#ifdef CONFIG_MAC80211_HT_DEBUG 800#ifdef CONFIG_MAC80211_HT_DEBUG
809 if (net_ratelimit()) 801 if (net_ratelimit())
810 printk(KERN_DEBUG "AddBA Req with bad params from " 802 printk(KERN_DEBUG "AddBA Req with bad params from "
811 "%s on tid %u. policy %d, buffer size %d\n", 803 "%pM on tid %u. policy %d, buffer size %d\n",
812 print_mac(mac, mgmt->sa), tid, ba_policy, 804 mgmt->sa, tid, ba_policy,
813 buf_size); 805 buf_size);
814#endif /* CONFIG_MAC80211_HT_DEBUG */ 806#endif /* CONFIG_MAC80211_HT_DEBUG */
815 goto end_no_lock; 807 goto end_no_lock;
@@ -831,8 +823,8 @@ void ieee80211_process_addba_request(struct ieee80211_local *local,
831#ifdef CONFIG_MAC80211_HT_DEBUG 823#ifdef CONFIG_MAC80211_HT_DEBUG
832 if (net_ratelimit()) 824 if (net_ratelimit())
833 printk(KERN_DEBUG "unexpected AddBA Req from " 825 printk(KERN_DEBUG "unexpected AddBA Req from "
834 "%s on tid %u\n", 826 "%pM on tid %u\n",
835 print_mac(mac, mgmt->sa), tid); 827 mgmt->sa, tid);
836#endif /* CONFIG_MAC80211_HT_DEBUG */ 828#endif /* CONFIG_MAC80211_HT_DEBUG */
837 goto end; 829 goto end;
838 } 830 }
@@ -964,7 +956,6 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
964 struct ieee80211_local *local = sdata->local; 956 struct ieee80211_local *local = sdata->local;
965 u16 tid, params; 957 u16 tid, params;
966 u16 initiator; 958 u16 initiator;
967 DECLARE_MAC_BUF(mac);
968 959
969 params = le16_to_cpu(mgmt->u.action.u.delba.params); 960 params = le16_to_cpu(mgmt->u.action.u.delba.params);
970 tid = (params & IEEE80211_DELBA_PARAM_TID_MASK) >> 12; 961 tid = (params & IEEE80211_DELBA_PARAM_TID_MASK) >> 12;
@@ -972,9 +963,8 @@ void ieee80211_process_delba(struct ieee80211_sub_if_data *sdata,
972 963
973#ifdef CONFIG_MAC80211_HT_DEBUG 964#ifdef CONFIG_MAC80211_HT_DEBUG
974 if (net_ratelimit()) 965 if (net_ratelimit())
975 printk(KERN_DEBUG "delba from %s (%s) tid %d reason code %d\n", 966 printk(KERN_DEBUG "delba from %pM (%s) tid %d reason code %d\n",
976 print_mac(mac, mgmt->sa), 967 mgmt->sa, initiator ? "initiator" : "recipient", tid,
977 initiator ? "initiator" : "recipient", tid,
978 mgmt->u.action.u.delba.reason_code); 968 mgmt->u.action.u.delba.reason_code);
979#endif /* CONFIG_MAC80211_HT_DEBUG */ 969#endif /* CONFIG_MAC80211_HT_DEBUG */
980 970
diff --git a/net/mac80211/key.c b/net/mac80211/key.c
index a5b06fe71980..999f7aa42326 100644
--- a/net/mac80211/key.c
+++ b/net/mac80211/key.c
@@ -132,7 +132,6 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
132{ 132{
133 const u8 *addr; 133 const u8 *addr;
134 int ret; 134 int ret;
135 DECLARE_MAC_BUF(mac);
136 135
137 assert_key_lock(); 136 assert_key_lock();
138 might_sleep(); 137 might_sleep();
@@ -154,16 +153,15 @@ static void ieee80211_key_enable_hw_accel(struct ieee80211_key *key)
154 153
155 if (ret && ret != -ENOSPC && ret != -EOPNOTSUPP) 154 if (ret && ret != -ENOSPC && ret != -EOPNOTSUPP)
156 printk(KERN_ERR "mac80211-%s: failed to set key " 155 printk(KERN_ERR "mac80211-%s: failed to set key "
157 "(%d, %s) to hardware (%d)\n", 156 "(%d, %pM) to hardware (%d)\n",
158 wiphy_name(key->local->hw.wiphy), 157 wiphy_name(key->local->hw.wiphy),
159 key->conf.keyidx, print_mac(mac, addr), ret); 158 key->conf.keyidx, addr, ret);
160} 159}
161 160
162static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key) 161static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
163{ 162{
164 const u8 *addr; 163 const u8 *addr;
165 int ret; 164 int ret;
166 DECLARE_MAC_BUF(mac);
167 165
168 assert_key_lock(); 166 assert_key_lock();
169 might_sleep(); 167 might_sleep();
@@ -186,9 +184,9 @@ static void ieee80211_key_disable_hw_accel(struct ieee80211_key *key)
186 184
187 if (ret) 185 if (ret)
188 printk(KERN_ERR "mac80211-%s: failed to remove key " 186 printk(KERN_ERR "mac80211-%s: failed to remove key "
189 "(%d, %s) from hardware (%d)\n", 187 "(%d, %pM) from hardware (%d)\n",
190 wiphy_name(key->local->hw.wiphy), 188 wiphy_name(key->local->hw.wiphy),
191 key->conf.keyidx, print_mac(mac, addr), ret); 189 key->conf.keyidx, addr, ret);
192 190
193 spin_lock(&todo_lock); 191 spin_lock(&todo_lock);
194 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE; 192 key->flags &= ~KEY_FLAG_UPLOADED_TO_HARDWARE;
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index faac101c0f85..929ba542fd72 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -257,9 +257,6 @@ static void mesh_plink_timer(unsigned long data)
257 struct sta_info *sta; 257 struct sta_info *sta;
258 __le16 llid, plid, reason; 258 __le16 llid, plid, reason;
259 struct ieee80211_sub_if_data *sdata; 259 struct ieee80211_sub_if_data *sdata;
260#ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG
261 DECLARE_MAC_BUF(mac);
262#endif
263 260
264 /* 261 /*
265 * This STA is valid because sta_info_destroy() will 262 * This STA is valid because sta_info_destroy() will
@@ -274,8 +271,8 @@ static void mesh_plink_timer(unsigned long data)
274 spin_unlock_bh(&sta->lock); 271 spin_unlock_bh(&sta->lock);
275 return; 272 return;
276 } 273 }
277 mpl_dbg("Mesh plink timer for %s fired on state %d\n", 274 mpl_dbg("Mesh plink timer for %pM fired on state %d\n",
278 print_mac(mac, sta->sta.addr), sta->plink_state); 275 sta->sta.addr, sta->plink_state);
279 reason = 0; 276 reason = 0;
280 llid = sta->llid; 277 llid = sta->llid;
281 plid = sta->plid; 278 plid = sta->plid;
@@ -287,9 +284,9 @@ static void mesh_plink_timer(unsigned long data)
287 /* retry timer */ 284 /* retry timer */
288 if (sta->plink_retries < dot11MeshMaxRetries(sdata)) { 285 if (sta->plink_retries < dot11MeshMaxRetries(sdata)) {
289 u32 rand; 286 u32 rand;
290 mpl_dbg("Mesh plink for %s (retry, timeout): %d %d\n", 287 mpl_dbg("Mesh plink for %pM (retry, timeout): %d %d\n",
291 print_mac(mac, sta->sta.addr), 288 sta->sta.addr, sta->plink_retries,
292 sta->plink_retries, sta->plink_timeout); 289 sta->plink_timeout);
293 get_random_bytes(&rand, sizeof(u32)); 290 get_random_bytes(&rand, sizeof(u32));
294 sta->plink_timeout = sta->plink_timeout + 291 sta->plink_timeout = sta->plink_timeout +
295 rand % sta->plink_timeout; 292 rand % sta->plink_timeout;
@@ -337,9 +334,6 @@ int mesh_plink_open(struct sta_info *sta)
337{ 334{
338 __le16 llid; 335 __le16 llid;
339 struct ieee80211_sub_if_data *sdata = sta->sdata; 336 struct ieee80211_sub_if_data *sdata = sta->sdata;
340#ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG
341 DECLARE_MAC_BUF(mac);
342#endif
343 337
344 spin_lock_bh(&sta->lock); 338 spin_lock_bh(&sta->lock);
345 get_random_bytes(&llid, 2); 339 get_random_bytes(&llid, 2);
@@ -351,8 +345,8 @@ int mesh_plink_open(struct sta_info *sta)
351 sta->plink_state = PLINK_OPN_SNT; 345 sta->plink_state = PLINK_OPN_SNT;
352 mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata)); 346 mesh_plink_timer_set(sta, dot11MeshRetryTimeout(sdata));
353 spin_unlock_bh(&sta->lock); 347 spin_unlock_bh(&sta->lock);
354 mpl_dbg("Mesh plink: starting establishment with %s\n", 348 mpl_dbg("Mesh plink: starting establishment with %pM\n",
355 print_mac(mac, sta->sta.addr)); 349 sta->sta.addr);
356 350
357 return mesh_plink_frame_tx(sdata, PLINK_OPEN, 351 return mesh_plink_frame_tx(sdata, PLINK_OPEN,
358 sta->sta.addr, llid, 0, 0); 352 sta->sta.addr, llid, 0, 0);
@@ -360,10 +354,6 @@ int mesh_plink_open(struct sta_info *sta)
360 354
361void mesh_plink_block(struct sta_info *sta) 355void mesh_plink_block(struct sta_info *sta)
362{ 356{
363#ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG
364 DECLARE_MAC_BUF(mac);
365#endif
366
367 spin_lock_bh(&sta->lock); 357 spin_lock_bh(&sta->lock);
368 __mesh_plink_deactivate(sta); 358 __mesh_plink_deactivate(sta);
369 sta->plink_state = PLINK_BLOCKED; 359 sta->plink_state = PLINK_BLOCKED;
@@ -374,12 +364,8 @@ int mesh_plink_close(struct sta_info *sta)
374{ 364{
375 struct ieee80211_sub_if_data *sdata = sta->sdata; 365 struct ieee80211_sub_if_data *sdata = sta->sdata;
376 __le16 llid, plid, reason; 366 __le16 llid, plid, reason;
377#ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG
378 DECLARE_MAC_BUF(mac);
379#endif
380 367
381 mpl_dbg("Mesh plink: closing link with %s\n", 368 mpl_dbg("Mesh plink: closing link with %pM\n", sta->sta.addr);
382 print_mac(mac, sta->sta.addr));
383 spin_lock_bh(&sta->lock); 369 spin_lock_bh(&sta->lock);
384 sta->reason = cpu_to_le16(MESH_LINK_CANCELLED); 370 sta->reason = cpu_to_le16(MESH_LINK_CANCELLED);
385 reason = sta->reason; 371 reason = sta->reason;
@@ -417,9 +403,6 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
417 u8 ie_len; 403 u8 ie_len;
418 u8 *baseaddr; 404 u8 *baseaddr;
419 __le16 plid, llid, reason; 405 __le16 plid, llid, reason;
420#ifdef CONFIG_MAC80211_VERBOSE_MPL_DEBUG
421 DECLARE_MAC_BUF(mac);
422#endif
423 406
424 /* need action_code, aux */ 407 /* need action_code, aux */
425 if (len < IEEE80211_MIN_ACTION_SIZE + 3) 408 if (len < IEEE80211_MIN_ACTION_SIZE + 3)
@@ -557,10 +540,10 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
557 } 540 }
558 } 541 }
559 542
560 mpl_dbg("Mesh plink (peer, state, llid, plid, event): %s %d %d %d %d\n", 543 mpl_dbg("Mesh plink (peer, state, llid, plid, event): %pM %d %d %d %d\n",
561 print_mac(mac, mgmt->sa), sta->plink_state, 544 mgmt->sa, sta->plink_state,
562 le16_to_cpu(sta->llid), le16_to_cpu(sta->plid), 545 le16_to_cpu(sta->llid), le16_to_cpu(sta->plid),
563 event); 546 event);
564 reason = 0; 547 reason = 0;
565 switch (sta->plink_state) { 548 switch (sta->plink_state) {
566 /* spin_unlock as soon as state is updated at each case */ 549 /* spin_unlock as soon as state is updated at each case */
@@ -660,8 +643,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
660 sta->plink_state = PLINK_ESTAB; 643 sta->plink_state = PLINK_ESTAB;
661 mesh_plink_inc_estab_count(sdata); 644 mesh_plink_inc_estab_count(sdata);
662 spin_unlock_bh(&sta->lock); 645 spin_unlock_bh(&sta->lock);
663 mpl_dbg("Mesh plink with %s ESTABLISHED\n", 646 mpl_dbg("Mesh plink with %pM ESTABLISHED\n",
664 print_mac(mac, sta->sta.addr)); 647 sta->sta.addr);
665 break; 648 break;
666 default: 649 default:
667 spin_unlock_bh(&sta->lock); 650 spin_unlock_bh(&sta->lock);
@@ -693,8 +676,8 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
693 sta->plink_state = PLINK_ESTAB; 676 sta->plink_state = PLINK_ESTAB;
694 mesh_plink_inc_estab_count(sdata); 677 mesh_plink_inc_estab_count(sdata);
695 spin_unlock_bh(&sta->lock); 678 spin_unlock_bh(&sta->lock);
696 mpl_dbg("Mesh plink with %s ESTABLISHED\n", 679 mpl_dbg("Mesh plink with %pM ESTABLISHED\n",
697 print_mac(mac, sta->sta.addr)); 680 sta->sta.addr);
698 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid, 681 mesh_plink_frame_tx(sdata, PLINK_CONFIRM, sta->sta.addr, llid,
699 plid, 0); 682 plid, 0);
700 break; 683 break;
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 87665d7bb4f9..6ad2619db85f 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -575,18 +575,16 @@ static u32 ieee80211_handle_protect_preamb(struct ieee80211_sub_if_data *sdata,
575 struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf; 575 struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf;
576#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 576#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
577 struct ieee80211_if_sta *ifsta = &sdata->u.sta; 577 struct ieee80211_if_sta *ifsta = &sdata->u.sta;
578 DECLARE_MAC_BUF(mac);
579#endif 578#endif
580 u32 changed = 0; 579 u32 changed = 0;
581 580
582 if (use_protection != bss_conf->use_cts_prot) { 581 if (use_protection != bss_conf->use_cts_prot) {
583#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 582#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
584 if (net_ratelimit()) { 583 if (net_ratelimit()) {
585 printk(KERN_DEBUG "%s: CTS protection %s (BSSID=" 584 printk(KERN_DEBUG "%s: CTS protection %s (BSSID=%pM)\n",
586 "%s)\n",
587 sdata->dev->name, 585 sdata->dev->name,
588 use_protection ? "enabled" : "disabled", 586 use_protection ? "enabled" : "disabled",
589 print_mac(mac, ifsta->bssid)); 587 ifsta->bssid);
590 } 588 }
591#endif 589#endif
592 bss_conf->use_cts_prot = use_protection; 590 bss_conf->use_cts_prot = use_protection;
@@ -597,10 +595,10 @@ static u32 ieee80211_handle_protect_preamb(struct ieee80211_sub_if_data *sdata,
597#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 595#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
598 if (net_ratelimit()) { 596 if (net_ratelimit()) {
599 printk(KERN_DEBUG "%s: switched to %s barker preamble" 597 printk(KERN_DEBUG "%s: switched to %s barker preamble"
600 " (BSSID=%s)\n", 598 " (BSSID=%pM)\n",
601 sdata->dev->name, 599 sdata->dev->name,
602 use_short_preamble ? "short" : "long", 600 use_short_preamble ? "short" : "long",
603 print_mac(mac, ifsta->bssid)); 601 ifsta->bssid);
604 } 602 }
605#endif 603#endif
606 bss_conf->use_short_preamble = use_short_preamble; 604 bss_conf->use_short_preamble = use_short_preamble;
@@ -760,18 +758,16 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
760static void ieee80211_direct_probe(struct ieee80211_sub_if_data *sdata, 758static void ieee80211_direct_probe(struct ieee80211_sub_if_data *sdata,
761 struct ieee80211_if_sta *ifsta) 759 struct ieee80211_if_sta *ifsta)
762{ 760{
763 DECLARE_MAC_BUF(mac);
764
765 ifsta->direct_probe_tries++; 761 ifsta->direct_probe_tries++;
766 if (ifsta->direct_probe_tries > IEEE80211_AUTH_MAX_TRIES) { 762 if (ifsta->direct_probe_tries > IEEE80211_AUTH_MAX_TRIES) {
767 printk(KERN_DEBUG "%s: direct probe to AP %s timed out\n", 763 printk(KERN_DEBUG "%s: direct probe to AP %pM timed out\n",
768 sdata->dev->name, print_mac(mac, ifsta->bssid)); 764 sdata->dev->name, ifsta->bssid);
769 ifsta->state = IEEE80211_STA_MLME_DISABLED; 765 ifsta->state = IEEE80211_STA_MLME_DISABLED;
770 return; 766 return;
771 } 767 }
772 768
773 printk(KERN_DEBUG "%s: direct probe to AP %s try %d\n", 769 printk(KERN_DEBUG "%s: direct probe to AP %pM try %d\n",
774 sdata->dev->name, print_mac(mac, ifsta->bssid), 770 sdata->dev->name, ifsta->bssid,
775 ifsta->direct_probe_tries); 771 ifsta->direct_probe_tries);
776 772
777 ifsta->state = IEEE80211_STA_MLME_DIRECT_PROBE; 773 ifsta->state = IEEE80211_STA_MLME_DIRECT_PROBE;
@@ -791,20 +787,18 @@ static void ieee80211_direct_probe(struct ieee80211_sub_if_data *sdata,
791static void ieee80211_authenticate(struct ieee80211_sub_if_data *sdata, 787static void ieee80211_authenticate(struct ieee80211_sub_if_data *sdata,
792 struct ieee80211_if_sta *ifsta) 788 struct ieee80211_if_sta *ifsta)
793{ 789{
794 DECLARE_MAC_BUF(mac);
795
796 ifsta->auth_tries++; 790 ifsta->auth_tries++;
797 if (ifsta->auth_tries > IEEE80211_AUTH_MAX_TRIES) { 791 if (ifsta->auth_tries > IEEE80211_AUTH_MAX_TRIES) {
798 printk(KERN_DEBUG "%s: authentication with AP %s" 792 printk(KERN_DEBUG "%s: authentication with AP %pM"
799 " timed out\n", 793 " timed out\n",
800 sdata->dev->name, print_mac(mac, ifsta->bssid)); 794 sdata->dev->name, ifsta->bssid);
801 ifsta->state = IEEE80211_STA_MLME_DISABLED; 795 ifsta->state = IEEE80211_STA_MLME_DISABLED;
802 return; 796 return;
803 } 797 }
804 798
805 ifsta->state = IEEE80211_STA_MLME_AUTHENTICATE; 799 ifsta->state = IEEE80211_STA_MLME_AUTHENTICATE;
806 printk(KERN_DEBUG "%s: authenticate with AP %s\n", 800 printk(KERN_DEBUG "%s: authenticate with AP %pM\n",
807 sdata->dev->name, print_mac(mac, ifsta->bssid)); 801 sdata->dev->name, ifsta->bssid);
808 802
809 ieee80211_send_auth(sdata, ifsta, 1, NULL, 0, 0); 803 ieee80211_send_auth(sdata, ifsta, 1, NULL, 0, 0);
810 804
@@ -914,20 +908,18 @@ static int ieee80211_privacy_mismatch(struct ieee80211_sub_if_data *sdata,
914static void ieee80211_associate(struct ieee80211_sub_if_data *sdata, 908static void ieee80211_associate(struct ieee80211_sub_if_data *sdata,
915 struct ieee80211_if_sta *ifsta) 909 struct ieee80211_if_sta *ifsta)
916{ 910{
917 DECLARE_MAC_BUF(mac);
918
919 ifsta->assoc_tries++; 911 ifsta->assoc_tries++;
920 if (ifsta->assoc_tries > IEEE80211_ASSOC_MAX_TRIES) { 912 if (ifsta->assoc_tries > IEEE80211_ASSOC_MAX_TRIES) {
921 printk(KERN_DEBUG "%s: association with AP %s" 913 printk(KERN_DEBUG "%s: association with AP %pM"
922 " timed out\n", 914 " timed out\n",
923 sdata->dev->name, print_mac(mac, ifsta->bssid)); 915 sdata->dev->name, ifsta->bssid);
924 ifsta->state = IEEE80211_STA_MLME_DISABLED; 916 ifsta->state = IEEE80211_STA_MLME_DISABLED;
925 return; 917 return;
926 } 918 }
927 919
928 ifsta->state = IEEE80211_STA_MLME_ASSOCIATE; 920 ifsta->state = IEEE80211_STA_MLME_ASSOCIATE;
929 printk(KERN_DEBUG "%s: associate with AP %s\n", 921 printk(KERN_DEBUG "%s: associate with AP %pM\n",
930 sdata->dev->name, print_mac(mac, ifsta->bssid)); 922 sdata->dev->name, ifsta->bssid);
931 if (ieee80211_privacy_mismatch(sdata, ifsta)) { 923 if (ieee80211_privacy_mismatch(sdata, ifsta)) {
932 printk(KERN_DEBUG "%s: mismatch in privacy configuration and " 924 printk(KERN_DEBUG "%s: mismatch in privacy configuration and "
933 "mixed-cell disabled - abort association\n", sdata->dev->name); 925 "mixed-cell disabled - abort association\n", sdata->dev->name);
@@ -947,7 +939,6 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata,
947 struct ieee80211_local *local = sdata->local; 939 struct ieee80211_local *local = sdata->local;
948 struct sta_info *sta; 940 struct sta_info *sta;
949 int disassoc; 941 int disassoc;
950 DECLARE_MAC_BUF(mac);
951 942
952 /* TODO: start monitoring current AP signal quality and number of 943 /* TODO: start monitoring current AP signal quality and number of
953 * missed beacons. Scan other channels every now and then and search 944 * missed beacons. Scan other channels every now and then and search
@@ -960,8 +951,8 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata,
960 951
961 sta = sta_info_get(local, ifsta->bssid); 952 sta = sta_info_get(local, ifsta->bssid);
962 if (!sta) { 953 if (!sta) {
963 printk(KERN_DEBUG "%s: No STA entry for own AP %s\n", 954 printk(KERN_DEBUG "%s: No STA entry for own AP %pM\n",
964 sdata->dev->name, print_mac(mac, ifsta->bssid)); 955 sdata->dev->name, ifsta->bssid);
965 disassoc = 1; 956 disassoc = 1;
966 } else { 957 } else {
967 disassoc = 0; 958 disassoc = 0;
@@ -969,9 +960,9 @@ static void ieee80211_associated(struct ieee80211_sub_if_data *sdata,
969 sta->last_rx + IEEE80211_MONITORING_INTERVAL)) { 960 sta->last_rx + IEEE80211_MONITORING_INTERVAL)) {
970 if (ifsta->flags & IEEE80211_STA_PROBEREQ_POLL) { 961 if (ifsta->flags & IEEE80211_STA_PROBEREQ_POLL) {
971 printk(KERN_DEBUG "%s: No ProbeResp from " 962 printk(KERN_DEBUG "%s: No ProbeResp from "
972 "current AP %s - assume out of " 963 "current AP %pM - assume out of "
973 "range\n", 964 "range\n",
974 sdata->dev->name, print_mac(mac, ifsta->bssid)); 965 sdata->dev->name, ifsta->bssid);
975 disassoc = 1; 966 disassoc = 1;
976 } else 967 } else
977 ieee80211_send_probe_req(sdata, ifsta->bssid, 968 ieee80211_send_probe_req(sdata, ifsta->bssid,
@@ -1032,7 +1023,6 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
1032 size_t len) 1023 size_t len)
1033{ 1024{
1034 u16 auth_alg, auth_transaction, status_code; 1025 u16 auth_alg, auth_transaction, status_code;
1035 DECLARE_MAC_BUF(mac);
1036 1026
1037 if (ifsta->state != IEEE80211_STA_MLME_AUTHENTICATE && 1027 if (ifsta->state != IEEE80211_STA_MLME_AUTHENTICATE &&
1038 sdata->vif.type != NL80211_IFTYPE_ADHOC) 1028 sdata->vif.type != NL80211_IFTYPE_ADHOC)
@@ -1125,7 +1115,6 @@ static void ieee80211_rx_mgmt_deauth(struct ieee80211_sub_if_data *sdata,
1125 size_t len) 1115 size_t len)
1126{ 1116{
1127 u16 reason_code; 1117 u16 reason_code;
1128 DECLARE_MAC_BUF(mac);
1129 1118
1130 if (len < 24 + 2) 1119 if (len < 24 + 2)
1131 return; 1120 return;
@@ -1157,7 +1146,6 @@ static void ieee80211_rx_mgmt_disassoc(struct ieee80211_sub_if_data *sdata,
1157 size_t len) 1146 size_t len)
1158{ 1147{
1159 u16 reason_code; 1148 u16 reason_code;
1160 DECLARE_MAC_BUF(mac);
1161 1149
1162 if (len < 24 + 2) 1150 if (len < 24 + 2)
1163 return; 1151 return;
@@ -1195,7 +1183,6 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
1195 struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf; 1183 struct ieee80211_bss_conf *bss_conf = &sdata->bss_conf;
1196 u8 *pos; 1184 u8 *pos;
1197 int i, j; 1185 int i, j;
1198 DECLARE_MAC_BUF(mac);
1199 bool have_higher_than_11mbit = false; 1186 bool have_higher_than_11mbit = false;
1200 1187
1201 /* AssocResp and ReassocResp have identical structure, so process both 1188 /* AssocResp and ReassocResp have identical structure, so process both
@@ -1214,9 +1201,9 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
1214 status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code); 1201 status_code = le16_to_cpu(mgmt->u.assoc_resp.status_code);
1215 aid = le16_to_cpu(mgmt->u.assoc_resp.aid); 1202 aid = le16_to_cpu(mgmt->u.assoc_resp.aid);
1216 1203
1217 printk(KERN_DEBUG "%s: RX %sssocResp from %s (capab=0x%x " 1204 printk(KERN_DEBUG "%s: RX %sssocResp from %pM (capab=0x%x "
1218 "status=%d aid=%d)\n", 1205 "status=%d aid=%d)\n",
1219 sdata->dev->name, reassoc ? "Rea" : "A", print_mac(mac, mgmt->sa), 1206 sdata->dev->name, reassoc ? "Rea" : "A", mgmt->sa,
1220 capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14)))); 1207 capab_info, status_code, (u16)(aid & ~(BIT(15) | BIT(14))));
1221 1208
1222 if (status_code != WLAN_STATUS_SUCCESS) { 1209 if (status_code != WLAN_STATUS_SUCCESS) {
@@ -1507,8 +1494,6 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1507 u64 beacon_timestamp, rx_timestamp; 1494 u64 beacon_timestamp, rx_timestamp;
1508 u64 supp_rates = 0; 1495 u64 supp_rates = 0;
1509 enum ieee80211_band band = rx_status->band; 1496 enum ieee80211_band band = rx_status->band;
1510 DECLARE_MAC_BUF(mac);
1511 DECLARE_MAC_BUF(mac2);
1512 1497
1513 if (elems->ds_params && elems->ds_params_len == 1) 1498 if (elems->ds_params && elems->ds_params_len == 1)
1514 freq = ieee80211_channel_to_frequency(elems->ds_params[0]); 1499 freq = ieee80211_channel_to_frequency(elems->ds_params[0]);
@@ -1538,10 +1523,10 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1538#ifdef CONFIG_MAC80211_IBSS_DEBUG 1523#ifdef CONFIG_MAC80211_IBSS_DEBUG
1539 if (sta->sta.supp_rates[band] != prev_rates) 1524 if (sta->sta.supp_rates[band] != prev_rates)
1540 printk(KERN_DEBUG "%s: updated supp_rates set " 1525 printk(KERN_DEBUG "%s: updated supp_rates set "
1541 "for %s based on beacon info (0x%llx | " 1526 "for %pM based on beacon info (0x%llx | "
1542 "0x%llx -> 0x%llx)\n", 1527 "0x%llx -> 0x%llx)\n",
1543 sdata->dev->name, 1528 sdata->dev->name,
1544 print_mac(mac, sta->sta.addr), 1529 sta->sta.addr,
1545 (unsigned long long) prev_rates, 1530 (unsigned long long) prev_rates,
1546 (unsigned long long) supp_rates, 1531 (unsigned long long) supp_rates,
1547 (unsigned long long) sta->sta.supp_rates[band]); 1532 (unsigned long long) sta->sta.supp_rates[band]);
@@ -1605,10 +1590,9 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1605 /* can't merge without knowing the TSF */ 1590 /* can't merge without knowing the TSF */
1606 rx_timestamp = -1LLU; 1591 rx_timestamp = -1LLU;
1607#ifdef CONFIG_MAC80211_IBSS_DEBUG 1592#ifdef CONFIG_MAC80211_IBSS_DEBUG
1608 printk(KERN_DEBUG "RX beacon SA=%s BSSID=" 1593 printk(KERN_DEBUG "RX beacon SA=%pM BSSID="
1609 "%s TSF=0x%llx BCN=0x%llx diff=%lld @%lu\n", 1594 "%pM TSF=0x%llx BCN=0x%llx diff=%lld @%lu\n",
1610 print_mac(mac, mgmt->sa), 1595 mgmt->sa, mgmt->bssid,
1611 print_mac(mac2, mgmt->bssid),
1612 (unsigned long long)rx_timestamp, 1596 (unsigned long long)rx_timestamp,
1613 (unsigned long long)beacon_timestamp, 1597 (unsigned long long)beacon_timestamp,
1614 (unsigned long long)(rx_timestamp - beacon_timestamp), 1598 (unsigned long long)(rx_timestamp - beacon_timestamp),
@@ -1617,8 +1601,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1617 if (beacon_timestamp > rx_timestamp) { 1601 if (beacon_timestamp > rx_timestamp) {
1618#ifdef CONFIG_MAC80211_IBSS_DEBUG 1602#ifdef CONFIG_MAC80211_IBSS_DEBUG
1619 printk(KERN_DEBUG "%s: beacon TSF higher than " 1603 printk(KERN_DEBUG "%s: beacon TSF higher than "
1620 "local TSF - IBSS merge with BSSID %s\n", 1604 "local TSF - IBSS merge with BSSID %pM\n",
1621 sdata->dev->name, print_mac(mac, mgmt->bssid)); 1605 sdata->dev->name, mgmt->bssid);
1622#endif 1606#endif
1623 ieee80211_sta_join_ibss(sdata, &sdata->u.sta, bss); 1607 ieee80211_sta_join_ibss(sdata, &sdata->u.sta, bss);
1624 ieee80211_ibss_add_sta(sdata, NULL, 1608 ieee80211_ibss_add_sta(sdata, NULL,
@@ -1727,11 +1711,6 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
1727 struct sk_buff *skb; 1711 struct sk_buff *skb;
1728 struct ieee80211_mgmt *resp; 1712 struct ieee80211_mgmt *resp;
1729 u8 *pos, *end; 1713 u8 *pos, *end;
1730 DECLARE_MAC_BUF(mac);
1731#ifdef CONFIG_MAC80211_IBSS_DEBUG
1732 DECLARE_MAC_BUF(mac2);
1733 DECLARE_MAC_BUF(mac3);
1734#endif
1735 1714
1736 if (sdata->vif.type != NL80211_IFTYPE_ADHOC || 1715 if (sdata->vif.type != NL80211_IFTYPE_ADHOC ||
1737 ifsta->state != IEEE80211_STA_MLME_IBSS_JOINED || 1716 ifsta->state != IEEE80211_STA_MLME_IBSS_JOINED ||
@@ -1744,10 +1723,10 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
1744 tx_last_beacon = 1; 1723 tx_last_beacon = 1;
1745 1724
1746#ifdef CONFIG_MAC80211_IBSS_DEBUG 1725#ifdef CONFIG_MAC80211_IBSS_DEBUG
1747 printk(KERN_DEBUG "%s: RX ProbeReq SA=%s DA=%s BSSID=" 1726 printk(KERN_DEBUG "%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM"
1748 "%s (tx_last_beacon=%d)\n", 1727 " (tx_last_beacon=%d)\n",
1749 sdata->dev->name, print_mac(mac, mgmt->sa), print_mac(mac2, mgmt->da), 1728 sdata->dev->name, mgmt->sa, mgmt->da,
1750 print_mac(mac3, mgmt->bssid), tx_last_beacon); 1729 mgmt->bssid, tx_last_beacon);
1751#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 1730#endif /* CONFIG_MAC80211_IBSS_DEBUG */
1752 1731
1753 if (!tx_last_beacon) 1732 if (!tx_last_beacon)
@@ -1763,8 +1742,8 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
1763 pos + 2 + pos[1] > end) { 1742 pos + 2 + pos[1] > end) {
1764#ifdef CONFIG_MAC80211_IBSS_DEBUG 1743#ifdef CONFIG_MAC80211_IBSS_DEBUG
1765 printk(KERN_DEBUG "%s: Invalid SSID IE in ProbeReq " 1744 printk(KERN_DEBUG "%s: Invalid SSID IE in ProbeReq "
1766 "from %s\n", 1745 "from %pM\n",
1767 sdata->dev->name, print_mac(mac, mgmt->sa)); 1746 sdata->dev->name, mgmt->sa);
1768#endif 1747#endif
1769 return; 1748 return;
1770 } 1749 }
@@ -1783,8 +1762,8 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
1783 resp = (struct ieee80211_mgmt *) skb->data; 1762 resp = (struct ieee80211_mgmt *) skb->data;
1784 memcpy(resp->da, mgmt->sa, ETH_ALEN); 1763 memcpy(resp->da, mgmt->sa, ETH_ALEN);
1785#ifdef CONFIG_MAC80211_IBSS_DEBUG 1764#ifdef CONFIG_MAC80211_IBSS_DEBUG
1786 printk(KERN_DEBUG "%s: Sending ProbeResp to %s\n", 1765 printk(KERN_DEBUG "%s: Sending ProbeResp to %pM\n",
1787 sdata->dev->name, print_mac(mac, resp->da)); 1766 sdata->dev->name, resp->da);
1788#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 1767#endif /* CONFIG_MAC80211_IBSS_DEBUG */
1789 ieee80211_tx_skb(sdata, skb, 0); 1768 ieee80211_tx_skb(sdata, skb, 0);
1790} 1769}
@@ -1990,7 +1969,6 @@ static int ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata,
1990 u8 bssid[ETH_ALEN], *pos; 1969 u8 bssid[ETH_ALEN], *pos;
1991 int i; 1970 int i;
1992 int ret; 1971 int ret;
1993 DECLARE_MAC_BUF(mac);
1994 1972
1995#if 0 1973#if 0
1996 /* Easier testing, use fixed BSSID. */ 1974 /* Easier testing, use fixed BSSID. */
@@ -2006,8 +1984,8 @@ static int ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata,
2006 bssid[0] |= 0x02; 1984 bssid[0] |= 0x02;
2007#endif 1985#endif
2008 1986
2009 printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %s\n", 1987 printk(KERN_DEBUG "%s: Creating new IBSS network, BSSID %pM\n",
2010 sdata->dev->name, print_mac(mac, bssid)); 1988 sdata->dev->name, bssid);
2011 1989
2012 bss = ieee80211_rx_bss_add(local, bssid, 1990 bss = ieee80211_rx_bss_add(local, bssid,
2013 local->hw.conf.channel->center_freq, 1991 local->hw.conf.channel->center_freq,
@@ -2050,8 +2028,6 @@ static int ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata,
2050 int found = 0; 2028 int found = 0;
2051 u8 bssid[ETH_ALEN]; 2029 u8 bssid[ETH_ALEN];
2052 int active_ibss; 2030 int active_ibss;
2053 DECLARE_MAC_BUF(mac);
2054 DECLARE_MAC_BUF(mac2);
2055 2031
2056 if (ifsta->ssid_len == 0) 2032 if (ifsta->ssid_len == 0)
2057 return -EINVAL; 2033 return -EINVAL;
@@ -2068,8 +2044,7 @@ static int ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata,
2068 || !(bss->capability & WLAN_CAPABILITY_IBSS)) 2044 || !(bss->capability & WLAN_CAPABILITY_IBSS))
2069 continue; 2045 continue;
2070#ifdef CONFIG_MAC80211_IBSS_DEBUG 2046#ifdef CONFIG_MAC80211_IBSS_DEBUG
2071 printk(KERN_DEBUG " bssid=%s found\n", 2047 printk(KERN_DEBUG " bssid=%pM found\n", bss->bssid);
2072 print_mac(mac, bss->bssid));
2073#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 2048#endif /* CONFIG_MAC80211_IBSS_DEBUG */
2074 memcpy(bssid, bss->bssid, ETH_ALEN); 2049 memcpy(bssid, bss->bssid, ETH_ALEN);
2075 found = 1; 2050 found = 1;
@@ -2080,9 +2055,8 @@ static int ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata,
2080 2055
2081#ifdef CONFIG_MAC80211_IBSS_DEBUG 2056#ifdef CONFIG_MAC80211_IBSS_DEBUG
2082 if (found) 2057 if (found)
2083 printk(KERN_DEBUG " sta_find_ibss: selected %s current " 2058 printk(KERN_DEBUG " sta_find_ibss: selected %pM current "
2084 "%s\n", print_mac(mac, bssid), 2059 "%pM\n", bssid, ifsta->bssid);
2085 print_mac(mac2, ifsta->bssid));
2086#endif /* CONFIG_MAC80211_IBSS_DEBUG */ 2060#endif /* CONFIG_MAC80211_IBSS_DEBUG */
2087 2061
2088 if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) { 2062 if (found && memcmp(ifsta->bssid, bssid, ETH_ALEN) != 0) {
@@ -2099,9 +2073,9 @@ static int ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata,
2099 if (!bss) 2073 if (!bss)
2100 goto dont_join; 2074 goto dont_join;
2101 2075
2102 printk(KERN_DEBUG "%s: Selected IBSS BSSID %s" 2076 printk(KERN_DEBUG "%s: Selected IBSS BSSID %pM"
2103 " based on configured SSID\n", 2077 " based on configured SSID\n",
2104 sdata->dev->name, print_mac(mac, bssid)); 2078 sdata->dev->name, bssid);
2105 ret = ieee80211_sta_join_ibss(sdata, ifsta, bss); 2079 ret = ieee80211_sta_join_ibss(sdata, ifsta, bss);
2106 ieee80211_rx_bss_put(local, bss); 2080 ieee80211_rx_bss_put(local, bss);
2107 return ret; 2081 return ret;
@@ -2343,7 +2317,6 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
2343{ 2317{
2344 struct ieee80211_local *local = sdata->local; 2318 struct ieee80211_local *local = sdata->local;
2345 struct sta_info *sta; 2319 struct sta_info *sta;
2346 DECLARE_MAC_BUF(mac);
2347 int band = local->hw.conf.channel->band; 2320 int band = local->hw.conf.channel->band;
2348 2321
2349 /* TODO: Could consider removing the least recently used entry and 2322 /* TODO: Could consider removing the least recently used entry and
@@ -2351,7 +2324,7 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
2351 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) { 2324 if (local->num_sta >= IEEE80211_IBSS_MAX_STA_ENTRIES) {
2352 if (net_ratelimit()) { 2325 if (net_ratelimit()) {
2353 printk(KERN_DEBUG "%s: No room for a new IBSS STA " 2326 printk(KERN_DEBUG "%s: No room for a new IBSS STA "
2354 "entry %s\n", sdata->dev->name, print_mac(mac, addr)); 2327 "entry %pM\n", sdata->dev->name, addr);
2355 } 2328 }
2356 return NULL; 2329 return NULL;
2357 } 2330 }
@@ -2360,8 +2333,8 @@ struct sta_info *ieee80211_ibss_add_sta(struct ieee80211_sub_if_data *sdata,
2360 return NULL; 2333 return NULL;
2361 2334
2362#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 2335#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
2363 printk(KERN_DEBUG "%s: Adding new IBSS station %s (dev=%s)\n", 2336 printk(KERN_DEBUG "%s: Adding new IBSS station %pM (dev=%s)\n",
2364 wiphy_name(local->hw.wiphy), print_mac(mac, addr), sdata->dev->name); 2337 wiphy_name(local->hw.wiphy), addr, sdata->dev->name);
2365#endif 2338#endif
2366 2339
2367 sta = sta_info_alloc(sdata, addr, GFP_ATOMIC); 2340 sta = sta_info_alloc(sdata, addr, GFP_ATOMIC);
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index cf6b121e1bbf..39aaf210e9f5 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -653,13 +653,12 @@ ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx)
653static void ap_sta_ps_start(struct sta_info *sta) 653static void ap_sta_ps_start(struct sta_info *sta)
654{ 654{
655 struct ieee80211_sub_if_data *sdata = sta->sdata; 655 struct ieee80211_sub_if_data *sdata = sta->sdata;
656 DECLARE_MAC_BUF(mac);
657 656
658 atomic_inc(&sdata->bss->num_sta_ps); 657 atomic_inc(&sdata->bss->num_sta_ps);
659 set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL); 658 set_and_clear_sta_flags(sta, WLAN_STA_PS, WLAN_STA_PSPOLL);
660#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 659#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
661 printk(KERN_DEBUG "%s: STA %s aid %d enters power save mode\n", 660 printk(KERN_DEBUG "%s: STA %pM aid %d enters power save mode\n",
662 sdata->dev->name, print_mac(mac, sta->sta.addr), sta->sta.aid); 661 sdata->dev->name, sta->sta.addr, sta->sta.aid);
663#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 662#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
664} 663}
665 664
@@ -670,7 +669,6 @@ static int ap_sta_ps_end(struct sta_info *sta)
670 struct sk_buff *skb; 669 struct sk_buff *skb;
671 int sent = 0; 670 int sent = 0;
672 struct ieee80211_tx_info *info; 671 struct ieee80211_tx_info *info;
673 DECLARE_MAC_BUF(mac);
674 672
675 atomic_dec(&sdata->bss->num_sta_ps); 673 atomic_dec(&sdata->bss->num_sta_ps);
676 674
@@ -680,8 +678,8 @@ static int ap_sta_ps_end(struct sta_info *sta)
680 sta_info_clear_tim_bit(sta); 678 sta_info_clear_tim_bit(sta);
681 679
682#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 680#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
683 printk(KERN_DEBUG "%s: STA %s aid %d exits power save mode\n", 681 printk(KERN_DEBUG "%s: STA %pM aid %d exits power save mode\n",
684 sdata->dev->name, print_mac(mac, sta->sta.addr), sta->sta.aid); 682 sdata->dev->name, sta->sta.addr, sta->sta.aid);
685#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 683#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
686 684
687 /* Send all buffered frames to the station */ 685 /* Send all buffered frames to the station */
@@ -696,9 +694,9 @@ static int ap_sta_ps_end(struct sta_info *sta)
696 local->total_ps_buffered--; 694 local->total_ps_buffered--;
697 sent++; 695 sent++;
698#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 696#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
699 printk(KERN_DEBUG "%s: STA %s aid %d send PS frame " 697 printk(KERN_DEBUG "%s: STA %pM aid %d send PS frame "
700 "since STA not sleeping anymore\n", sdata->dev->name, 698 "since STA not sleeping anymore\n", sdata->dev->name,
701 print_mac(mac, sta->sta.addr), sta->sta.aid); 699 sta->sta.addr, sta->sta.aid);
702#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 700#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
703 info->flags |= IEEE80211_TX_CTL_REQUEUE; 701 info->flags |= IEEE80211_TX_CTL_REQUEUE;
704 dev_queue_xmit(skb); 702 dev_queue_xmit(skb);
@@ -789,15 +787,12 @@ ieee80211_reassemble_add(struct ieee80211_sub_if_data *sdata,
789#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 787#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
790 struct ieee80211_hdr *hdr = 788 struct ieee80211_hdr *hdr =
791 (struct ieee80211_hdr *) entry->skb_list.next->data; 789 (struct ieee80211_hdr *) entry->skb_list.next->data;
792 DECLARE_MAC_BUF(mac);
793 DECLARE_MAC_BUF(mac2);
794 printk(KERN_DEBUG "%s: RX reassembly removed oldest " 790 printk(KERN_DEBUG "%s: RX reassembly removed oldest "
795 "fragment entry (idx=%d age=%lu seq=%d last_frag=%d " 791 "fragment entry (idx=%d age=%lu seq=%d last_frag=%d "
796 "addr1=%s addr2=%s\n", 792 "addr1=%pM addr2=%pM\n",
797 sdata->dev->name, idx, 793 sdata->dev->name, idx,
798 jiffies - entry->first_frag_time, entry->seq, 794 jiffies - entry->first_frag_time, entry->seq,
799 entry->last_frag, print_mac(mac, hdr->addr1), 795 entry->last_frag, hdr->addr1, hdr->addr2);
800 print_mac(mac2, hdr->addr2));
801#endif 796#endif
802 __skb_queue_purge(&entry->skb_list); 797 __skb_queue_purge(&entry->skb_list);
803 } 798 }
@@ -866,7 +861,6 @@ ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx)
866 unsigned int frag, seq; 861 unsigned int frag, seq;
867 struct ieee80211_fragment_entry *entry; 862 struct ieee80211_fragment_entry *entry;
868 struct sk_buff *skb; 863 struct sk_buff *skb;
869 DECLARE_MAC_BUF(mac);
870 864
871 hdr = (struct ieee80211_hdr *)rx->skb->data; 865 hdr = (struct ieee80211_hdr *)rx->skb->data;
872 fc = hdr->frame_control; 866 fc = hdr->frame_control;
@@ -970,7 +964,6 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
970 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev); 964 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(rx->dev);
971 struct sk_buff *skb; 965 struct sk_buff *skb;
972 int no_pending_pkts; 966 int no_pending_pkts;
973 DECLARE_MAC_BUF(mac);
974 __le16 fc = ((struct ieee80211_hdr *)rx->skb->data)->frame_control; 967 __le16 fc = ((struct ieee80211_hdr *)rx->skb->data)->frame_control;
975 968
976 if (likely(!rx->sta || !ieee80211_is_pspoll(fc) || 969 if (likely(!rx->sta || !ieee80211_is_pspoll(fc) ||
@@ -1001,8 +994,8 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
1001 set_sta_flags(rx->sta, WLAN_STA_PSPOLL); 994 set_sta_flags(rx->sta, WLAN_STA_PSPOLL);
1002 995
1003#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 996#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
1004 printk(KERN_DEBUG "STA %s aid %d: PS Poll (entries after %d)\n", 997 printk(KERN_DEBUG "STA %pM aid %d: PS Poll (entries after %d)\n",
1005 print_mac(mac, rx->sta->sta.addr), rx->sta->sta.aid, 998 rx->sta->sta.addr, rx->sta->sta.aid,
1006 skb_queue_len(&rx->sta->ps_tx_buf)); 999 skb_queue_len(&rx->sta->ps_tx_buf));
1007#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 1000#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
1008 1001
@@ -1025,9 +1018,9 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx)
1025 * Should we send it a null-func frame indicating we 1018 * Should we send it a null-func frame indicating we
1026 * have nothing buffered for it? 1019 * have nothing buffered for it?
1027 */ 1020 */
1028 printk(KERN_DEBUG "%s: STA %s sent PS Poll even " 1021 printk(KERN_DEBUG "%s: STA %pM sent PS Poll even "
1029 "though there are no buffered frames for it\n", 1022 "though there are no buffered frames for it\n",
1030 rx->dev->name, print_mac(mac, rx->sta->sta.addr)); 1023 rx->dev->name, rx->sta->sta.addr);
1031#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 1024#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
1032 } 1025 }
1033 1026
@@ -1097,10 +1090,6 @@ ieee80211_data_to_8023(struct ieee80211_rx_data *rx)
1097 u8 src[ETH_ALEN] __aligned(2); 1090 u8 src[ETH_ALEN] __aligned(2);
1098 struct sk_buff *skb = rx->skb; 1091 struct sk_buff *skb = rx->skb;
1099 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1092 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1100 DECLARE_MAC_BUF(mac);
1101 DECLARE_MAC_BUF(mac2);
1102 DECLARE_MAC_BUF(mac3);
1103 DECLARE_MAC_BUF(mac4);
1104 1093
1105 if (unlikely(!ieee80211_is_data_present(hdr->frame_control))) 1094 if (unlikely(!ieee80211_is_data_present(hdr->frame_control)))
1106 return -1; 1095 return -1;
@@ -1279,7 +1268,6 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
1279 int remaining, err; 1268 int remaining, err;
1280 u8 dst[ETH_ALEN]; 1269 u8 dst[ETH_ALEN];
1281 u8 src[ETH_ALEN]; 1270 u8 src[ETH_ALEN];
1282 DECLARE_MAC_BUF(mac);
1283 1271
1284 if (unlikely(!ieee80211_is_data(fc))) 1272 if (unlikely(!ieee80211_is_data(fc)))
1285 return RX_CONTINUE; 1273 return RX_CONTINUE;
@@ -1632,8 +1620,6 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev,
1632{ 1620{
1633 int keyidx; 1621 int keyidx;
1634 unsigned int hdrlen; 1622 unsigned int hdrlen;
1635 DECLARE_MAC_BUF(mac);
1636 DECLARE_MAC_BUF(mac2);
1637 1623
1638 hdrlen = ieee80211_hdrlen(hdr->frame_control); 1624 hdrlen = ieee80211_hdrlen(hdr->frame_control);
1639 if (rx->skb->len >= hdrlen + 4) 1625 if (rx->skb->len >= hdrlen + 4)
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 7fef8ea1f5ec..ca89a848c41e 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -137,14 +137,12 @@ struct sta_info *sta_info_get_by_idx(struct ieee80211_local *local, int idx,
137static void __sta_info_free(struct ieee80211_local *local, 137static void __sta_info_free(struct ieee80211_local *local,
138 struct sta_info *sta) 138 struct sta_info *sta)
139{ 139{
140 DECLARE_MAC_BUF(mbuf);
141
142 rate_control_free_sta(sta); 140 rate_control_free_sta(sta);
143 rate_control_put(sta->rate_ctrl); 141 rate_control_put(sta->rate_ctrl);
144 142
145#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 143#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
146 printk(KERN_DEBUG "%s: Destroyed STA %s\n", 144 printk(KERN_DEBUG "%s: Destroyed STA %pM\n",
147 wiphy_name(local->hw.wiphy), print_mac(mbuf, sta->sta.addr)); 145 wiphy_name(local->hw.wiphy), sta->sta.addr);
148#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 146#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
149 147
150 kfree(sta); 148 kfree(sta);
@@ -222,7 +220,6 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
222 struct ieee80211_local *local = sdata->local; 220 struct ieee80211_local *local = sdata->local;
223 struct sta_info *sta; 221 struct sta_info *sta;
224 int i; 222 int i;
225 DECLARE_MAC_BUF(mbuf);
226 223
227 sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, gfp); 224 sta = kzalloc(sizeof(*sta) + local->hw.sta_data_size, gfp);
228 if (!sta) 225 if (!sta)
@@ -263,8 +260,8 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
263 skb_queue_head_init(&sta->tx_filtered); 260 skb_queue_head_init(&sta->tx_filtered);
264 261
265#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 262#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
266 printk(KERN_DEBUG "%s: Allocated STA %s\n", 263 printk(KERN_DEBUG "%s: Allocated STA %pM\n",
267 wiphy_name(local->hw.wiphy), print_mac(mbuf, sta->sta.addr)); 264 wiphy_name(local->hw.wiphy), sta->sta.addr);
268#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 265#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
269 266
270#ifdef CONFIG_MAC80211_MESH 267#ifdef CONFIG_MAC80211_MESH
@@ -281,7 +278,6 @@ int sta_info_insert(struct sta_info *sta)
281 struct ieee80211_sub_if_data *sdata = sta->sdata; 278 struct ieee80211_sub_if_data *sdata = sta->sdata;
282 unsigned long flags; 279 unsigned long flags;
283 int err = 0; 280 int err = 0;
284 DECLARE_MAC_BUF(mac);
285 281
286 /* 282 /*
287 * Can't be a WARN_ON because it can be triggered through a race: 283 * Can't be a WARN_ON because it can be triggered through a race:
@@ -322,8 +318,8 @@ int sta_info_insert(struct sta_info *sta)
322 } 318 }
323 319
324#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 320#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
325 printk(KERN_DEBUG "%s: Inserted STA %s\n", 321 printk(KERN_DEBUG "%s: Inserted STA %pM\n",
326 wiphy_name(local->hw.wiphy), print_mac(mac, sta->sta.addr)); 322 wiphy_name(local->hw.wiphy), sta->sta.addr);
327#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 323#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
328 324
329 spin_unlock_irqrestore(&local->sta_lock, flags); 325 spin_unlock_irqrestore(&local->sta_lock, flags);
@@ -423,9 +419,6 @@ static void __sta_info_unlink(struct sta_info **sta)
423{ 419{
424 struct ieee80211_local *local = (*sta)->local; 420 struct ieee80211_local *local = (*sta)->local;
425 struct ieee80211_sub_if_data *sdata = (*sta)->sdata; 421 struct ieee80211_sub_if_data *sdata = (*sta)->sdata;
426#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
427 DECLARE_MAC_BUF(mbuf);
428#endif
429 /* 422 /*
430 * pull caller's reference if we're already gone. 423 * pull caller's reference if we're already gone.
431 */ 424 */
@@ -468,8 +461,8 @@ static void __sta_info_unlink(struct sta_info **sta)
468 } 461 }
469 462
470#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 463#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
471 printk(KERN_DEBUG "%s: Removed STA %s\n", 464 printk(KERN_DEBUG "%s: Removed STA %pM\n",
472 wiphy_name(local->hw.wiphy), print_mac(mbuf, (*sta)->sta.addr)); 465 wiphy_name(local->hw.wiphy), (*sta)->sta.addr);
473#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 466#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
474 467
475 /* 468 /*
@@ -544,7 +537,6 @@ static void sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
544 unsigned long flags; 537 unsigned long flags;
545 struct sk_buff *skb; 538 struct sk_buff *skb;
546 struct ieee80211_sub_if_data *sdata; 539 struct ieee80211_sub_if_data *sdata;
547 DECLARE_MAC_BUF(mac);
548 540
549 if (skb_queue_empty(&sta->ps_tx_buf)) 541 if (skb_queue_empty(&sta->ps_tx_buf))
550 return; 542 return;
@@ -564,8 +556,8 @@ static void sta_info_cleanup_expire_buffered(struct ieee80211_local *local,
564 sdata = sta->sdata; 556 sdata = sta->sdata;
565 local->total_ps_buffered--; 557 local->total_ps_buffered--;
566#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 558#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
567 printk(KERN_DEBUG "Buffered frame expired (STA " 559 printk(KERN_DEBUG "Buffered frame expired (STA %pM)\n",
568 "%s)\n", print_mac(mac, sta->sta.addr)); 560 sta->sta.addr);
569#endif 561#endif
570 dev_kfree_skb(skb); 562 dev_kfree_skb(skb);
571 563
@@ -809,15 +801,14 @@ void ieee80211_sta_expire(struct ieee80211_sub_if_data *sdata,
809 struct ieee80211_local *local = sdata->local; 801 struct ieee80211_local *local = sdata->local;
810 struct sta_info *sta, *tmp; 802 struct sta_info *sta, *tmp;
811 LIST_HEAD(tmp_list); 803 LIST_HEAD(tmp_list);
812 DECLARE_MAC_BUF(mac);
813 unsigned long flags; 804 unsigned long flags;
814 805
815 spin_lock_irqsave(&local->sta_lock, flags); 806 spin_lock_irqsave(&local->sta_lock, flags);
816 list_for_each_entry_safe(sta, tmp, &local->sta_list, list) 807 list_for_each_entry_safe(sta, tmp, &local->sta_list, list)
817 if (time_after(jiffies, sta->last_rx + exp_time)) { 808 if (time_after(jiffies, sta->last_rx + exp_time)) {
818#ifdef CONFIG_MAC80211_IBSS_DEBUG 809#ifdef CONFIG_MAC80211_IBSS_DEBUG
819 printk(KERN_DEBUG "%s: expiring inactive STA %s\n", 810 printk(KERN_DEBUG "%s: expiring inactive STA %pM\n",
820 sdata->dev->name, print_mac(mac, sta->sta.addr)); 811 sdata->dev->name, sta->sta.addr);
821#endif 812#endif
822 __sta_info_unlink(&sta); 813 __sta_info_unlink(&sta);
823 if (sta) 814 if (sta)
diff --git a/net/mac80211/tkip.c b/net/mac80211/tkip.c
index 34b32bc8f609..38fa111d2dc6 100644
--- a/net/mac80211/tkip.c
+++ b/net/mac80211/tkip.c
@@ -263,10 +263,9 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
263 (iv32 == key->u.tkip.rx[queue].iv32 && 263 (iv32 == key->u.tkip.rx[queue].iv32 &&
264 iv16 <= key->u.tkip.rx[queue].iv16))) { 264 iv16 <= key->u.tkip.rx[queue].iv16))) {
265#ifdef CONFIG_MAC80211_TKIP_DEBUG 265#ifdef CONFIG_MAC80211_TKIP_DEBUG
266 DECLARE_MAC_BUF(mac);
267 printk(KERN_DEBUG "TKIP replay detected for RX frame from " 266 printk(KERN_DEBUG "TKIP replay detected for RX frame from "
268 "%s (RX IV (%04x,%02x) <= prev. IV (%04x,%02x)\n", 267 "%pM (RX IV (%04x,%02x) <= prev. IV (%04x,%02x)\n",
269 print_mac(mac, ta), 268 ta,
270 iv32, iv16, key->u.tkip.rx[queue].iv32, 269 iv32, iv16, key->u.tkip.rx[queue].iv32,
271 key->u.tkip.rx[queue].iv16); 270 key->u.tkip.rx[queue].iv16);
272#endif 271#endif
@@ -287,9 +286,8 @@ int ieee80211_tkip_decrypt_data(struct crypto_blkcipher *tfm,
287 { 286 {
288 int i; 287 int i;
289 u8 key_offset = NL80211_TKIP_DATA_OFFSET_ENCR_KEY; 288 u8 key_offset = NL80211_TKIP_DATA_OFFSET_ENCR_KEY;
290 DECLARE_MAC_BUF(mac); 289 printk(KERN_DEBUG "TKIP decrypt: Phase1 TA=%pM"
291 printk(KERN_DEBUG "TKIP decrypt: Phase1 TA=%s" 290 " TK=", ta);
292 " TK=", print_mac(mac, ta));
293 for (i = 0; i < 16; i++) 291 for (i = 0; i < 16; i++)
294 printk("%02x ", 292 printk("%02x ",
295 key->conf.key[key_offset + i]); 293 key->conf.key[key_offset + i]);
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 1460537faf33..9191b510bff8 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -201,10 +201,9 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx)
201 tx->sdata->vif.type != NL80211_IFTYPE_ADHOC && 201 tx->sdata->vif.type != NL80211_IFTYPE_ADHOC &&
202 ieee80211_is_data(hdr->frame_control))) { 202 ieee80211_is_data(hdr->frame_control))) {
203#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 203#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
204 DECLARE_MAC_BUF(mac);
205 printk(KERN_DEBUG "%s: dropped data frame to not " 204 printk(KERN_DEBUG "%s: dropped data frame to not "
206 "associated station %s\n", 205 "associated station %pM\n",
207 tx->dev->name, print_mac(mac, hdr->addr1)); 206 tx->dev->name, hdr->addr1);
208#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ 207#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */
209 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc); 208 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc);
210 return TX_DROP; 209 return TX_DROP;
@@ -331,7 +330,6 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
331 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); 330 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb);
332 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; 331 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data;
333 u32 staflags; 332 u32 staflags;
334 DECLARE_MAC_BUF(mac);
335 333
336 if (unlikely(!sta || ieee80211_is_probe_resp(hdr->frame_control))) 334 if (unlikely(!sta || ieee80211_is_probe_resp(hdr->frame_control)))
337 return TX_CONTINUE; 335 return TX_CONTINUE;
@@ -341,9 +339,9 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
341 if (unlikely((staflags & WLAN_STA_PS) && 339 if (unlikely((staflags & WLAN_STA_PS) &&
342 !(staflags & WLAN_STA_PSPOLL))) { 340 !(staflags & WLAN_STA_PSPOLL))) {
343#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 341#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
344 printk(KERN_DEBUG "STA %s aid %d: PS buffer (entries " 342 printk(KERN_DEBUG "STA %pM aid %d: PS buffer (entries "
345 "before %d)\n", 343 "before %d)\n",
346 print_mac(mac, sta->sta.addr), sta->sta.aid, 344 sta->sta.addr, sta->sta.aid,
347 skb_queue_len(&sta->ps_tx_buf)); 345 skb_queue_len(&sta->ps_tx_buf));
348#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 346#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
349 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) 347 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER)
@@ -352,9 +350,9 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
352 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf); 350 struct sk_buff *old = skb_dequeue(&sta->ps_tx_buf);
353#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 351#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
354 if (net_ratelimit()) { 352 if (net_ratelimit()) {
355 printk(KERN_DEBUG "%s: STA %s TX " 353 printk(KERN_DEBUG "%s: STA %pM TX "
356 "buffer full - dropping oldest frame\n", 354 "buffer full - dropping oldest frame\n",
357 tx->dev->name, print_mac(mac, sta->sta.addr)); 355 tx->dev->name, sta->sta.addr);
358 } 356 }
359#endif 357#endif
360 dev_kfree_skb(old); 358 dev_kfree_skb(old);
@@ -371,9 +369,9 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
371 } 369 }
372#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG 370#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG
373 else if (unlikely(test_sta_flags(sta, WLAN_STA_PS))) { 371 else if (unlikely(test_sta_flags(sta, WLAN_STA_PS))) {
374 printk(KERN_DEBUG "%s: STA %s in PS mode, but pspoll " 372 printk(KERN_DEBUG "%s: STA %pM in PS mode, but pspoll "
375 "set -> send frame\n", tx->dev->name, 373 "set -> send frame\n", tx->dev->name,
376 print_mac(mac, sta->sta.addr)); 374 sta->sta.addr);
377 } 375 }
378#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ 376#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
379 clear_sta_flags(sta, WLAN_STA_PSPOLL); 377 clear_sta_flags(sta, WLAN_STA_PSPOLL);
@@ -1593,12 +1591,10 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1593 compare_ether_addr(dev->dev_addr, 1591 compare_ether_addr(dev->dev_addr,
1594 skb->data + ETH_ALEN) == 0))) { 1592 skb->data + ETH_ALEN) == 0))) {
1595#ifdef CONFIG_MAC80211_VERBOSE_DEBUG 1593#ifdef CONFIG_MAC80211_VERBOSE_DEBUG
1596 DECLARE_MAC_BUF(mac);
1597
1598 if (net_ratelimit()) 1594 if (net_ratelimit())
1599 printk(KERN_DEBUG "%s: dropped frame to %s" 1595 printk(KERN_DEBUG "%s: dropped frame to %pM"
1600 " (unauthorized port)\n", dev->name, 1596 " (unauthorized port)\n", dev->name,
1601 print_mac(mac, hdr.addr1)); 1597 hdr.addr1);
1602#endif 1598#endif
1603 1599
1604 I802_DEBUG_INC(local->tx_handlers_drop_unauth_port); 1600 I802_DEBUG_INC(local->tx_handlers_drop_unauth_port);
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 139b5f267b34..d27ef7f2d4a7 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -206,13 +206,11 @@ int ieee80211_ht_agg_queue_add(struct ieee80211_local *local,
206 * on the previous queue 206 * on the previous queue
207 * since HT is strict in order */ 207 * since HT is strict in order */
208#ifdef CONFIG_MAC80211_HT_DEBUG 208#ifdef CONFIG_MAC80211_HT_DEBUG
209 if (net_ratelimit()) { 209 if (net_ratelimit())
210 DECLARE_MAC_BUF(mac);
211 printk(KERN_DEBUG "allocated aggregation queue" 210 printk(KERN_DEBUG "allocated aggregation queue"
212 " %d tid %d addr %s pool=0x%lX\n", 211 " %d tid %d addr %pM pool=0x%lX\n",
213 i, tid, print_mac(mac, sta->sta.addr), 212 i, tid, sta->sta.addr,
214 local->queue_pool[0]); 213 local->queue_pool[0]);
215 }
216#endif /* CONFIG_MAC80211_HT_DEBUG */ 214#endif /* CONFIG_MAC80211_HT_DEBUG */
217 return 0; 215 return 0;
218 } 216 }
diff --git a/net/mac80211/wpa.c b/net/mac80211/wpa.c
index 6db649480e8f..3a20b036ef4c 100644
--- a/net/mac80211/wpa.c
+++ b/net/mac80211/wpa.c
@@ -90,7 +90,6 @@ ieee80211_rx_h_michael_mic_verify(struct ieee80211_rx_data *rx)
90 u8 mic[MICHAEL_MIC_LEN]; 90 u8 mic[MICHAEL_MIC_LEN];
91 struct sk_buff *skb = rx->skb; 91 struct sk_buff *skb = rx->skb;
92 int authenticator = 1, wpa_test = 0; 92 int authenticator = 1, wpa_test = 0;
93 DECLARE_MAC_BUF(mac);
94 93
95 /* 94 /*
96 * No way to verify the MIC if the hardware stripped it 95 * No way to verify the MIC if the hardware stripped it
@@ -227,7 +226,6 @@ ieee80211_crypto_tkip_decrypt(struct ieee80211_rx_data *rx)
227 int hdrlen, res, hwaccel = 0, wpa_test = 0; 226 int hdrlen, res, hwaccel = 0, wpa_test = 0;
228 struct ieee80211_key *key = rx->key; 227 struct ieee80211_key *key = rx->key;
229 struct sk_buff *skb = rx->skb; 228 struct sk_buff *skb = rx->skb;
230 DECLARE_MAC_BUF(mac);
231 229
232 hdrlen = ieee80211_hdrlen(hdr->frame_control); 230 hdrlen = ieee80211_hdrlen(hdr->frame_control);
233 231
@@ -453,7 +451,6 @@ ieee80211_crypto_ccmp_decrypt(struct ieee80211_rx_data *rx)
453 struct sk_buff *skb = rx->skb; 451 struct sk_buff *skb = rx->skb;
454 u8 pn[CCMP_PN_LEN]; 452 u8 pn[CCMP_PN_LEN];
455 int data_len; 453 int data_len;
456 DECLARE_MAC_BUF(mac);
457 454
458 hdrlen = ieee80211_hdrlen(hdr->frame_control); 455 hdrlen = ieee80211_hdrlen(hdr->frame_control);
459 456
diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
index 9a24332fbed8..60aba45023ff 100644
--- a/net/netfilter/ipvs/ip_vs_conn.c
+++ b/net/netfilter/ipvs/ip_vs_conn.c
@@ -820,13 +820,11 @@ static int ip_vs_conn_seq_show(struct seq_file *seq, void *v)
820 820
821#ifdef CONFIG_IP_VS_IPV6 821#ifdef CONFIG_IP_VS_IPV6
822 if (cp->af == AF_INET6) 822 if (cp->af == AF_INET6)
823 seq_printf(seq, 823 seq_printf(seq, "%-3s %pI6 %04X %pI6 %04X %pI6 %04X %-11s %7lu\n",
824 "%-3s " NIP6_FMT " %04X " NIP6_FMT
825 " %04X " NIP6_FMT " %04X %-11s %7lu\n",
826 ip_vs_proto_name(cp->protocol), 824 ip_vs_proto_name(cp->protocol),
827 NIP6(cp->caddr.in6), ntohs(cp->cport), 825 &cp->caddr.in6, ntohs(cp->cport),
828 NIP6(cp->vaddr.in6), ntohs(cp->vport), 826 &cp->vaddr.in6, ntohs(cp->vport),
829 NIP6(cp->daddr.in6), ntohs(cp->dport), 827 &cp->daddr.in6, ntohs(cp->dport),
830 ip_vs_state_name(cp->protocol, cp->state), 828 ip_vs_state_name(cp->protocol, cp->state),
831 (cp->timer.expires-jiffies)/HZ); 829 (cp->timer.expires-jiffies)/HZ);
832 else 830 else
@@ -883,13 +881,11 @@ static int ip_vs_conn_sync_seq_show(struct seq_file *seq, void *v)
883 881
884#ifdef CONFIG_IP_VS_IPV6 882#ifdef CONFIG_IP_VS_IPV6
885 if (cp->af == AF_INET6) 883 if (cp->af == AF_INET6)
886 seq_printf(seq, 884 seq_printf(seq, "%-3s %pI6 %04X %pI6 %04X %pI6 %04X %-11s %-6s %7lu\n",
887 "%-3s " NIP6_FMT " %04X " NIP6_FMT
888 " %04X " NIP6_FMT " %04X %-11s %-6s %7lu\n",
889 ip_vs_proto_name(cp->protocol), 885 ip_vs_proto_name(cp->protocol),
890 NIP6(cp->caddr.in6), ntohs(cp->cport), 886 &cp->caddr.in6, ntohs(cp->cport),
891 NIP6(cp->vaddr.in6), ntohs(cp->vport), 887 &cp->vaddr.in6, ntohs(cp->vport),
892 NIP6(cp->daddr.in6), ntohs(cp->dport), 888 &cp->daddr.in6, ntohs(cp->dport),
893 ip_vs_state_name(cp->protocol, cp->state), 889 ip_vs_state_name(cp->protocol, cp->state),
894 ip_vs_origin_name(cp->flags), 890 ip_vs_origin_name(cp->flags),
895 (cp->timer.expires-jiffies)/HZ); 891 (cp->timer.expires-jiffies)/HZ);
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 958abf3e5f8c..c3c68443b5b1 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -805,9 +805,9 @@ static int ip_vs_out_icmp_v6(struct sk_buff *skb, int *related)
805 if (ic == NULL) 805 if (ic == NULL)
806 return NF_DROP; 806 return NF_DROP;
807 807
808 IP_VS_DBG(12, "Outgoing ICMPv6 (%d,%d) " NIP6_FMT "->" NIP6_FMT "\n", 808 IP_VS_DBG(12, "Outgoing ICMPv6 (%d,%d) %pI6->%pI6\n",
809 ic->icmp6_type, ntohs(icmpv6_id(ic)), 809 ic->icmp6_type, ntohs(icmpv6_id(ic)),
810 NIP6(iph->saddr), NIP6(iph->daddr)); 810 &iph->saddr, &iph->daddr);
811 811
812 /* 812 /*
813 * Work through seeing if this is for us. 813 * Work through seeing if this is for us.
@@ -1175,9 +1175,9 @@ ip_vs_in_icmp_v6(struct sk_buff *skb, int *related, unsigned int hooknum)
1175 if (ic == NULL) 1175 if (ic == NULL)
1176 return NF_DROP; 1176 return NF_DROP;
1177 1177
1178 IP_VS_DBG(12, "Incoming ICMPv6 (%d,%d) " NIP6_FMT "->" NIP6_FMT "\n", 1178 IP_VS_DBG(12, "Incoming ICMPv6 (%d,%d) %pI6->%pI6\n",
1179 ic->icmp6_type, ntohs(icmpv6_id(ic)), 1179 ic->icmp6_type, ntohs(icmpv6_id(ic)),
1180 NIP6(iph->saddr), NIP6(iph->daddr)); 1180 &iph->saddr, &iph->daddr);
1181 1181
1182 /* 1182 /*
1183 * Work through seeing if this is for us. 1183 * Work through seeing if this is for us.
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index 0302cf3e5039..76db27ec9633 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -1867,9 +1867,9 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
1867 if (iter->table == ip_vs_svc_table) { 1867 if (iter->table == ip_vs_svc_table) {
1868#ifdef CONFIG_IP_VS_IPV6 1868#ifdef CONFIG_IP_VS_IPV6
1869 if (svc->af == AF_INET6) 1869 if (svc->af == AF_INET6)
1870 seq_printf(seq, "%s [" NIP6_FMT "]:%04X %s ", 1870 seq_printf(seq, "%s [%pI6]:%04X %s ",
1871 ip_vs_proto_name(svc->protocol), 1871 ip_vs_proto_name(svc->protocol),
1872 NIP6(svc->addr.in6), 1872 &svc->addr.in6,
1873 ntohs(svc->port), 1873 ntohs(svc->port),
1874 svc->scheduler->name); 1874 svc->scheduler->name);
1875 else 1875 else
@@ -1895,9 +1895,9 @@ static int ip_vs_info_seq_show(struct seq_file *seq, void *v)
1895#ifdef CONFIG_IP_VS_IPV6 1895#ifdef CONFIG_IP_VS_IPV6
1896 if (dest->af == AF_INET6) 1896 if (dest->af == AF_INET6)
1897 seq_printf(seq, 1897 seq_printf(seq,
1898 " -> [" NIP6_FMT "]:%04X" 1898 " -> [%pI6]:%04X"
1899 " %-7s %-6d %-10d %-10d\n", 1899 " %-7s %-6d %-10d %-10d\n",
1900 NIP6(dest->addr.in6), 1900 &dest->addr.in6,
1901 ntohs(dest->port), 1901 ntohs(dest->port),
1902 ip_vs_fwd_name(atomic_read(&dest->conn_flags)), 1902 ip_vs_fwd_name(atomic_read(&dest->conn_flags)),
1903 atomic_read(&dest->weight), 1903 atomic_read(&dest->weight),
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index 0791f9e08feb..54cd67fbfe74 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -203,26 +203,21 @@ ip_vs_tcpudp_debug_packet_v6(struct ip_vs_protocol *pp,
203 if (ih == NULL) 203 if (ih == NULL)
204 sprintf(buf, "%s TRUNCATED", pp->name); 204 sprintf(buf, "%s TRUNCATED", pp->name);
205 else if (ih->nexthdr == IPPROTO_FRAGMENT) 205 else if (ih->nexthdr == IPPROTO_FRAGMENT)
206 sprintf(buf, "%s " NIP6_FMT "->" NIP6_FMT " frag", 206 sprintf(buf, "%s %pI6->%pI6 frag",
207 pp->name, NIP6(ih->saddr), 207 pp->name, &ih->saddr, &ih->daddr);
208 NIP6(ih->daddr));
209 else { 208 else {
210 __be16 _ports[2], *pptr; 209 __be16 _ports[2], *pptr;
211 210
212 pptr = skb_header_pointer(skb, offset + sizeof(struct ipv6hdr), 211 pptr = skb_header_pointer(skb, offset + sizeof(struct ipv6hdr),
213 sizeof(_ports), _ports); 212 sizeof(_ports), _ports);
214 if (pptr == NULL) 213 if (pptr == NULL)
215 sprintf(buf, "%s TRUNCATED " NIP6_FMT "->" NIP6_FMT, 214 sprintf(buf, "%s TRUNCATED %pI6->%pI6",
216 pp->name, 215 pp->name, &ih->saddr, &ih->daddr);
217 NIP6(ih->saddr),
218 NIP6(ih->daddr));
219 else 216 else
220 sprintf(buf, "%s " NIP6_FMT ":%u->" NIP6_FMT ":%u", 217 sprintf(buf, "%s %pI6:%u->%pI6:%u",
221 pp->name, 218 pp->name,
222 NIP6(ih->saddr), 219 &ih->saddr, ntohs(pptr[0]),
223 ntohs(pptr[0]), 220 &ih->daddr, ntohs(pptr[1]));
224 NIP6(ih->daddr),
225 ntohs(pptr[1]));
226 } 221 }
227 222
228 printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); 223 printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf);
diff --git a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
index 80ab0c8e5b4a..6ede88812044 100644
--- a/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_ah_esp.c
@@ -154,9 +154,8 @@ ah_esp_debug_packet_v6(struct ip_vs_protocol *pp, const struct sk_buff *skb,
154 if (ih == NULL) 154 if (ih == NULL)
155 sprintf(buf, "%s TRUNCATED", pp->name); 155 sprintf(buf, "%s TRUNCATED", pp->name);
156 else 156 else
157 sprintf(buf, "%s " NIP6_FMT "->" NIP6_FMT, 157 sprintf(buf, "%s %pI6->%pI6",
158 pp->name, NIP6(ih->saddr), 158 pp->name, &ih->saddr, &ih->daddr);
159 NIP6(ih->daddr));
160 159
161 printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf); 160 printk(KERN_DEBUG "IPVS: %s: %s\n", msg, buf);
162} 161}
diff --git a/net/netfilter/ipvs/ip_vs_xmit.c b/net/netfilter/ipvs/ip_vs_xmit.c
index 02ddc2b3ce2e..fc342dda950a 100644
--- a/net/netfilter/ipvs/ip_vs_xmit.c
+++ b/net/netfilter/ipvs/ip_vs_xmit.c
@@ -141,14 +141,13 @@ __ip_vs_get_out_rt_v6(struct ip_vs_conn *cp)
141 NULL, &fl); 141 NULL, &fl);
142 if (!rt) { 142 if (!rt) {
143 spin_unlock(&dest->dst_lock); 143 spin_unlock(&dest->dst_lock);
144 IP_VS_DBG_RL("ip6_route_output error, " 144 IP_VS_DBG_RL("ip6_route_output error, dest: %pI6\n",
145 "dest: " NIP6_FMT "\n", 145 &dest->addr.in6);
146 NIP6(dest->addr.in6));
147 return NULL; 146 return NULL;
148 } 147 }
149 __ip_vs_dst_set(dest, 0, dst_clone(&rt->u.dst)); 148 __ip_vs_dst_set(dest, 0, dst_clone(&rt->u.dst));
150 IP_VS_DBG(10, "new dst " NIP6_FMT ", refcnt=%d\n", 149 IP_VS_DBG(10, "new dst %pI6, refcnt=%d\n",
151 NIP6(dest->addr.in6), 150 &dest->addr.in6,
152 atomic_read(&rt->u.dst.__refcnt)); 151 atomic_read(&rt->u.dst.__refcnt));
153 } 152 }
154 spin_unlock(&dest->dst_lock); 153 spin_unlock(&dest->dst_lock);
@@ -167,8 +166,8 @@ __ip_vs_get_out_rt_v6(struct ip_vs_conn *cp)
167 166
168 rt = (struct rt6_info *)ip6_route_output(&init_net, NULL, &fl); 167 rt = (struct rt6_info *)ip6_route_output(&init_net, NULL, &fl);
169 if (!rt) { 168 if (!rt) {
170 IP_VS_DBG_RL("ip6_route_output error, dest: " 169 IP_VS_DBG_RL("ip6_route_output error, dest: %pI6\n",
171 NIP6_FMT "\n", NIP6(cp->daddr.in6)); 170 &cp->daddr.in6);
172 return NULL; 171 return NULL;
173 } 172 }
174 } 173 }
@@ -301,8 +300,8 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
301 300
302 rt = (struct rt6_info *)ip6_route_output(&init_net, NULL, &fl); 301 rt = (struct rt6_info *)ip6_route_output(&init_net, NULL, &fl);
303 if (!rt) { 302 if (!rt) {
304 IP_VS_DBG_RL("ip_vs_bypass_xmit_v6(): ip6_route_output error, " 303 IP_VS_DBG_RL("ip_vs_bypass_xmit_v6(): ip6_route_output error, dest: %pI6\n",
305 "dest: " NIP6_FMT "\n", NIP6(iph->daddr)); 304 &iph->daddr);
306 goto tx_error_icmp; 305 goto tx_error_icmp;
307 } 306 }
308 307
diff --git a/net/netfilter/nf_conntrack_ftp.c b/net/netfilter/nf_conntrack_ftp.c
index 4f7107107e99..8cab6d595909 100644
--- a/net/netfilter/nf_conntrack_ftp.c
+++ b/net/netfilter/nf_conntrack_ftp.c
@@ -467,11 +467,9 @@ static int help(struct sk_buff *skb,
467 NIPQUAD(cmd.u3.ip), 467 NIPQUAD(cmd.u3.ip),
468 NIPQUAD(ct->tuplehash[dir].tuple.src.u3.ip)); 468 NIPQUAD(ct->tuplehash[dir].tuple.src.u3.ip));
469 } else { 469 } else {
470 pr_debug("conntrack_ftp: NOT RECORDING: " NIP6_FMT 470 pr_debug("conntrack_ftp: NOT RECORDING: %pI6 != %pI6\n",
471 " != " NIP6_FMT "\n", 471 cmd.u3.ip6,
472 NIP6(*((struct in6_addr *)cmd.u3.ip6)), 472 ct->tuplehash[dir].tuple.src.u3.ip6);
473 NIP6(*((struct in6_addr *)
474 ct->tuplehash[dir].tuple.src.u3.ip6)));
475 } 473 }
476 474
477 /* Thanks to Cristiano Lincoln Mattos 475 /* Thanks to Cristiano Lincoln Mattos
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c
index c1504f71cdff..99bc803d1dd1 100644
--- a/net/netfilter/nf_conntrack_h323_main.c
+++ b/net/netfilter/nf_conntrack_h323_main.c
@@ -850,10 +850,8 @@ static int process_setup(struct sk_buff *skb, struct nf_conn *ct,
850 get_h225_addr(ct, *data, &setup->destCallSignalAddress, 850 get_h225_addr(ct, *data, &setup->destCallSignalAddress,
851 &addr, &port) && 851 &addr, &port) &&
852 memcmp(&addr, &ct->tuplehash[!dir].tuple.src.u3, sizeof(addr))) { 852 memcmp(&addr, &ct->tuplehash[!dir].tuple.src.u3, sizeof(addr))) {
853 pr_debug("nf_ct_q931: set destCallSignalAddress " 853 pr_debug("nf_ct_q931: set destCallSignalAddress %pI6:%hu->%pI6:%hu\n",
854 NIP6_FMT ":%hu->" NIP6_FMT ":%hu\n", 854 &addr, ntohs(port), &ct->tuplehash[!dir].tuple.src.u3,
855 NIP6(*(struct in6_addr *)&addr), ntohs(port),
856 NIP6(*(struct in6_addr *)&ct->tuplehash[!dir].tuple.src.u3),
857 ntohs(ct->tuplehash[!dir].tuple.src.u.tcp.port)); 855 ntohs(ct->tuplehash[!dir].tuple.src.u.tcp.port));
858 ret = set_h225_addr(skb, data, dataoff, 856 ret = set_h225_addr(skb, data, dataoff,
859 &setup->destCallSignalAddress, 857 &setup->destCallSignalAddress,
@@ -868,10 +866,8 @@ static int process_setup(struct sk_buff *skb, struct nf_conn *ct,
868 get_h225_addr(ct, *data, &setup->sourceCallSignalAddress, 866 get_h225_addr(ct, *data, &setup->sourceCallSignalAddress,
869 &addr, &port) && 867 &addr, &port) &&
870 memcmp(&addr, &ct->tuplehash[!dir].tuple.dst.u3, sizeof(addr))) { 868 memcmp(&addr, &ct->tuplehash[!dir].tuple.dst.u3, sizeof(addr))) {
871 pr_debug("nf_ct_q931: set sourceCallSignalAddress " 869 pr_debug("nf_ct_q931: set sourceCallSignalAddress %pI6:%hu->%pI6:%hu\n",
872 NIP6_FMT ":%hu->" NIP6_FMT ":%hu\n", 870 &addr, ntohs(port), &ct->tuplehash[!dir].tuple.dst.u3,
873 NIP6(*(struct in6_addr *)&addr), ntohs(port),
874 NIP6(*(struct in6_addr *)&ct->tuplehash[!dir].tuple.dst.u3),
875 ntohs(ct->tuplehash[!dir].tuple.dst.u.tcp.port)); 871 ntohs(ct->tuplehash[!dir].tuple.dst.u.tcp.port));
876 ret = set_h225_addr(skb, data, dataoff, 872 ret = set_h225_addr(skb, data, dataoff,
877 &setup->sourceCallSignalAddress, 873 &setup->sourceCallSignalAddress,
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c
index 6fc4292d46e6..6379717f9044 100644
--- a/net/netfilter/xt_hashlimit.c
+++ b/net/netfilter/xt_hashlimit.c
@@ -904,12 +904,11 @@ static int dl_seq_real_show(struct dsthash_ent *ent, u_int8_t family,
904 ent->rateinfo.cost); 904 ent->rateinfo.cost);
905#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE) 905#if defined(CONFIG_IP6_NF_IPTABLES) || defined(CONFIG_IP6_NF_IPTABLES_MODULE)
906 case NFPROTO_IPV6: 906 case NFPROTO_IPV6:
907 return seq_printf(s, "%ld " NIP6_FMT ":%u->" 907 return seq_printf(s, "%ld %pI6:%u->%pI6:%u %u %u %u\n",
908 NIP6_FMT ":%u %u %u %u\n",
909 (long)(ent->expires - jiffies)/HZ, 908 (long)(ent->expires - jiffies)/HZ,
910 NIP6(*(struct in6_addr *)&ent->dst.ip6.src), 909 &ent->dst.ip6.src,
911 ntohs(ent->dst.src_port), 910 ntohs(ent->dst.src_port),
912 NIP6(*(struct in6_addr *)&ent->dst.ip6.dst), 911 &ent->dst.ip6.dst,
913 ntohs(ent->dst.dst_port), 912 ntohs(ent->dst.dst_port),
914 ent->rateinfo.credit, ent->rateinfo.credit_cap, 913 ent->rateinfo.credit, ent->rateinfo.credit_cap,
915 ent->rateinfo.cost); 914 ent->rateinfo.cost);
diff --git a/net/netfilter/xt_recent.c b/net/netfilter/xt_recent.c
index 280c471bcdf4..b785727a5bf7 100644
--- a/net/netfilter/xt_recent.c
+++ b/net/netfilter/xt_recent.c
@@ -426,9 +426,8 @@ static int recent_seq_show(struct seq_file *seq, void *v)
426 "oldest_pkt: %u", NIPQUAD(e->addr.ip), e->ttl, 426 "oldest_pkt: %u", NIPQUAD(e->addr.ip), e->ttl,
427 e->stamps[i], e->index); 427 e->stamps[i], e->index);
428 else 428 else
429 seq_printf(seq, "src=" NIP6_FMT " ttl: %u last_seen: %lu " 429 seq_printf(seq, "src=%pI6 ttl: %u last_seen: %lu oldest_pkt: %u",
430 "oldest_pkt: %u", NIP6(e->addr.in6), e->ttl, 430 &e->addr.in6, e->ttl, e->stamps[i], e->index);
431 e->stamps[i], e->index);
432 for (i = 0; i < e->nstamps; i++) 431 for (i = 0; i < e->nstamps; i++)
433 seq_printf(seq, "%s %lu", i ? "," : "", e->stamps[i]); 432 seq_printf(seq, "%s %lu", i ? "," : "", e->stamps[i]);
434 seq_printf(seq, "\n"); 433 seq_printf(seq, "\n");
diff --git a/net/netlabel/netlabel_addrlist.c b/net/netlabel/netlabel_addrlist.c
index 249f6b92f153..2fc49e56c5a7 100644
--- a/net/netlabel/netlabel_addrlist.c
+++ b/net/netlabel/netlabel_addrlist.c
@@ -371,7 +371,7 @@ void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf,
371 371
372 if (dev != NULL) 372 if (dev != NULL)
373 audit_log_format(audit_buf, " netif=%s", dev); 373 audit_log_format(audit_buf, " netif=%s", dev);
374 audit_log_format(audit_buf, " %s=" NIP6_FMT, dir, NIP6(*addr)); 374 audit_log_format(audit_buf, " %s=%pI6", dir, addr);
375 if (ntohl(mask->s6_addr32[3]) != 0xffffffff) { 375 if (ntohl(mask->s6_addr32[3]) != 0xffffffff) {
376 u32 mask_len = 0; 376 u32 mask_len = 0;
377 u32 mask_val; 377 u32 mask_val;
diff --git a/net/netlink/attr.c b/net/netlink/attr.c
index 2d106cfe1d27..c83fea7da9a8 100644
--- a/net/netlink/attr.c
+++ b/net/netlink/attr.c
@@ -233,7 +233,7 @@ size_t nla_strlcpy(char *dst, const struct nlattr *nla, size_t dstsize)
233 * 233 *
234 * Returns the number of bytes copied. 234 * Returns the number of bytes copied.
235 */ 235 */
236int nla_memcpy(void *dest, struct nlattr *src, int count) 236int nla_memcpy(void *dest, const struct nlattr *src, int count)
237{ 237{
238 int minlen = min_t(int, count, nla_len(src)); 238 int minlen = min_t(int, count, nla_len(src));
239 239
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 4124bbb99947..ceaa4aa066ea 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -223,10 +223,9 @@ static int sctp_v6_xmit(struct sk_buff *skb, struct sctp_transport *transport)
223 ipv6_addr_copy(&fl.fl6_dst, rt0->addr); 223 ipv6_addr_copy(&fl.fl6_dst, rt0->addr);
224 } 224 }
225 225
226 SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, " 226 SCTP_DEBUG_PRINTK("%s: skb:%p, len:%d, src:%pI6 dst:%pI6\n",
227 "src:" NIP6_FMT " dst:" NIP6_FMT "\n",
228 __func__, skb, skb->len, 227 __func__, skb, skb->len,
229 NIP6(fl.fl6_src), NIP6(fl.fl6_dst)); 228 &fl.fl6_src, &fl.fl6_dst);
230 229
231 SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS); 230 SCTP_INC_STATS(SCTP_MIB_OUTSCTPPACKS);
232 231
@@ -252,23 +251,19 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
252 fl.oif = daddr->v6.sin6_scope_id; 251 fl.oif = daddr->v6.sin6_scope_id;
253 252
254 253
255 SCTP_DEBUG_PRINTK("%s: DST=" NIP6_FMT " ", 254 SCTP_DEBUG_PRINTK("%s: DST=%pI6 ", __func__, &fl.fl6_dst);
256 __func__, NIP6(fl.fl6_dst));
257 255
258 if (saddr) { 256 if (saddr) {
259 ipv6_addr_copy(&fl.fl6_src, &saddr->v6.sin6_addr); 257 ipv6_addr_copy(&fl.fl6_src, &saddr->v6.sin6_addr);
260 SCTP_DEBUG_PRINTK( 258 SCTP_DEBUG_PRINTK("SRC=%pI6 - ", &fl.fl6_src);
261 "SRC=" NIP6_FMT " - ",
262 NIP6(fl.fl6_src));
263 } 259 }
264 260
265 dst = ip6_route_output(&init_net, NULL, &fl); 261 dst = ip6_route_output(&init_net, NULL, &fl);
266 if (!dst->error) { 262 if (!dst->error) {
267 struct rt6_info *rt; 263 struct rt6_info *rt;
268 rt = (struct rt6_info *)dst; 264 rt = (struct rt6_info *)dst;
269 SCTP_DEBUG_PRINTK( 265 SCTP_DEBUG_PRINTK("rt6_dst:%pI6 rt6_src:%pI6\n",
270 "rt6_dst:" NIP6_FMT " rt6_src:" NIP6_FMT "\n", 266 &rt->rt6i_dst.addr, &rt->rt6i_src.addr);
271 NIP6(rt->rt6i_dst.addr), NIP6(rt->rt6i_src.addr));
272 return dst; 267 return dst;
273 } 268 }
274 SCTP_DEBUG_PRINTK("NO ROUTE\n"); 269 SCTP_DEBUG_PRINTK("NO ROUTE\n");
@@ -314,9 +309,8 @@ static void sctp_v6_get_saddr(struct sctp_sock *sk,
314 __u8 matchlen = 0; 309 __u8 matchlen = 0;
315 __u8 bmatchlen; 310 __u8 bmatchlen;
316 311
317 SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p " 312 SCTP_DEBUG_PRINTK("%s: asoc:%p dst:%p daddr:%pI6 ",
318 "daddr:" NIP6_FMT " ", 313 __func__, asoc, dst, &daddr->v6.sin6_addr);
319 __func__, asoc, dst, NIP6(daddr->v6.sin6_addr));
320 314
321 if (!asoc) { 315 if (!asoc) {
322 ipv6_dev_get_saddr(sock_net(sctp_opt2sk(sk)), 316 ipv6_dev_get_saddr(sock_net(sctp_opt2sk(sk)),
@@ -324,8 +318,8 @@ static void sctp_v6_get_saddr(struct sctp_sock *sk,
324 &daddr->v6.sin6_addr, 318 &daddr->v6.sin6_addr,
325 inet6_sk(&sk->inet.sk)->srcprefs, 319 inet6_sk(&sk->inet.sk)->srcprefs,
326 &saddr->v6.sin6_addr); 320 &saddr->v6.sin6_addr);
327 SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: " NIP6_FMT "\n", 321 SCTP_DEBUG_PRINTK("saddr from ipv6_get_saddr: %pI6\n",
328 NIP6(saddr->v6.sin6_addr)); 322 &saddr->v6.sin6_addr);
329 return; 323 return;
330 } 324 }
331 325
@@ -353,12 +347,11 @@ static void sctp_v6_get_saddr(struct sctp_sock *sk,
353 347
354 if (baddr) { 348 if (baddr) {
355 memcpy(saddr, baddr, sizeof(union sctp_addr)); 349 memcpy(saddr, baddr, sizeof(union sctp_addr));
356 SCTP_DEBUG_PRINTK("saddr: " NIP6_FMT "\n", 350 SCTP_DEBUG_PRINTK("saddr: %pI6\n", &saddr->v6.sin6_addr);
357 NIP6(saddr->v6.sin6_addr));
358 } else { 351 } else {
359 printk(KERN_ERR "%s: asoc:%p Could not find a valid source " 352 printk(KERN_ERR "%s: asoc:%p Could not find a valid source "
360 "address for the dest:" NIP6_FMT "\n", 353 "address for the dest:%pI6\n",
361 __func__, asoc, NIP6(daddr->v6.sin6_addr)); 354 __func__, asoc, &daddr->v6.sin6_addr);
362 } 355 }
363 356
364 rcu_read_unlock(); 357 rcu_read_unlock();
@@ -727,7 +720,7 @@ static int sctp_v6_is_ce(const struct sk_buff *skb)
727/* Dump the v6 addr to the seq file. */ 720/* Dump the v6 addr to the seq file. */
728static void sctp_v6_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr) 721static void sctp_v6_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr)
729{ 722{
730 seq_printf(seq, NIP6_FMT " ", NIP6(addr->v6.sin6_addr)); 723 seq_printf(seq, "%pI6 ", &addr->v6.sin6_addr);
731} 724}
732 725
733static void sctp_v6_ecn_capable(struct sock *sk) 726static void sctp_v6_ecn_capable(struct sock *sk)
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index a6a0ea71ae93..d07b484b873a 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1123,11 +1123,10 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
1123 if (from_addr.sa.sa_family == AF_INET6) { 1123 if (from_addr.sa.sa_family == AF_INET6) {
1124 if (net_ratelimit()) 1124 if (net_ratelimit())
1125 printk(KERN_WARNING 1125 printk(KERN_WARNING
1126 "%s association %p could not find address " 1126 "%s association %p could not find address %pI6\n",
1127 NIP6_FMT "\n",
1128 __func__, 1127 __func__,
1129 asoc, 1128 asoc,
1130 NIP6(from_addr.v6.sin6_addr)); 1129 &from_addr.v6.sin6_addr);
1131 } else { 1130 } else {
1132 if (net_ratelimit()) 1131 if (net_ratelimit())
1133 printk(KERN_WARNING 1132 printk(KERN_WARNING
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 4895c341e46d..8f067497c212 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -278,8 +278,8 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args)
278 case AF_INET6: { 278 case AF_INET6: {
279 struct sockaddr_in6 *sin = 279 struct sockaddr_in6 *sin =
280 (struct sockaddr_in6 *)args->address; 280 (struct sockaddr_in6 *)args->address;
281 snprintf(servername, sizeof(servername), NIP6_FMT, 281 snprintf(servername, sizeof(servername), "%pI6",
282 NIP6(sin->sin6_addr)); 282 &sin->sin6_addr);
283 break; 283 break;
284 } 284 }
285 default: 285 default:
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
index 41013dd66ac3..4c8adadc214d 100644
--- a/net/sunrpc/rpcb_clnt.c
+++ b/net/sunrpc/rpcb_clnt.c
@@ -305,9 +305,9 @@ static int rpcb_register_netid6(struct sockaddr_in6 *address_to_register,
305 snprintf(buf, sizeof(buf), "::.%u.%u", 305 snprintf(buf, sizeof(buf), "::.%u.%u",
306 port >> 8, port & 0xff); 306 port >> 8, port & 0xff);
307 else 307 else
308 snprintf(buf, sizeof(buf), NIP6_FMT".%u.%u", 308 snprintf(buf, sizeof(buf), "%pI6.%u.%u",
309 NIP6(address_to_register->sin6_addr), 309 &address_to_register->sin6_addr,
310 port >> 8, port & 0xff); 310 port >> 8, port & 0xff);
311 map->r_addr = buf; 311 map->r_addr = buf;
312 312
313 dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with " 313 dprintk("RPC: %sregistering [%u, %u, %s, '%s'] with "
diff --git a/net/sunrpc/svcauth_unix.c b/net/sunrpc/svcauth_unix.c
index f24800f2c098..16f714a247bc 100644
--- a/net/sunrpc/svcauth_unix.c
+++ b/net/sunrpc/svcauth_unix.c
@@ -168,7 +168,7 @@ static void ip_map_request(struct cache_detail *cd,
168 ntohl(im->m_addr.s6_addr32[3]) >> 8 & 0xff, 168 ntohl(im->m_addr.s6_addr32[3]) >> 8 & 0xff,
169 ntohl(im->m_addr.s6_addr32[3]) >> 0 & 0xff); 169 ntohl(im->m_addr.s6_addr32[3]) >> 0 & 0xff);
170 } else { 170 } else {
171 snprintf(text_addr, 40, NIP6_FMT, NIP6(im->m_addr)); 171 snprintf(text_addr, 40, "%pI6", &im->m_addr);
172 } 172 }
173 qword_add(bpp, blen, im->m_class); 173 qword_add(bpp, blen, im->m_class);
174 qword_add(bpp, blen, text_addr); 174 qword_add(bpp, blen, text_addr);
@@ -214,7 +214,7 @@ static int ip_map_parse(struct cache_detail *cd,
214 addr.s6_addr32[2] = htonl(0xffff); 214 addr.s6_addr32[2] = htonl(0xffff);
215 addr.s6_addr32[3] = 215 addr.s6_addr32[3] =
216 htonl((((((b1<<8)|b2)<<8)|b3)<<8)|b4); 216 htonl((((((b1<<8)|b2)<<8)|b3)<<8)|b4);
217 } else if (sscanf(buf, NIP6_FMT "%c", 217 } else if (sscanf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x%c",
218 &b1, &b2, &b3, &b4, &b5, &b6, &b7, &b8, &c) == 8) { 218 &b1, &b2, &b3, &b4, &b5, &b6, &b7, &b8, &c) == 8) {
219 addr.s6_addr16[0] = htons(b1); 219 addr.s6_addr16[0] = htons(b1);
220 addr.s6_addr16[1] = htons(b2); 220 addr.s6_addr16[1] = htons(b2);
@@ -286,8 +286,7 @@ static int ip_map_show(struct seq_file *m,
286 ntohl(addr.s6_addr32[3]) >> 0 & 0xff, 286 ntohl(addr.s6_addr32[3]) >> 0 & 0xff,
287 dom); 287 dom);
288 } else { 288 } else {
289 seq_printf(m, "%s " NIP6_FMT " %s\n", 289 seq_printf(m, "%s %pI6 %s\n", im->m_class, &addr, dom);
290 im->m_class, NIP6(addr), dom);
291 } 290 }
292 return 0; 291 return 0;
293} 292}
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 0a50361e3d83..82a9b6286dd3 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -342,8 +342,7 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt,
342 342
343 buf = kzalloc(40, GFP_KERNEL); 343 buf = kzalloc(40, GFP_KERNEL);
344 if (buf) { 344 if (buf) {
345 snprintf(buf, 40, NIP6_FMT, 345 snprintf(buf, 40, "%pI6",&addr->sin6_addr);
346 NIP6(addr->sin6_addr));
347 } 346 }
348 xprt->address_strings[RPC_DISPLAY_ADDR] = buf; 347 xprt->address_strings[RPC_DISPLAY_ADDR] = buf;
349 348
@@ -358,18 +357,17 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt,
358 357
359 buf = kzalloc(64, GFP_KERNEL); 358 buf = kzalloc(64, GFP_KERNEL);
360 if (buf) { 359 if (buf) {
361 snprintf(buf, 64, "addr="NIP6_FMT" port=%u proto=%s", 360 snprintf(buf, 64, "addr=%pI6 port=%u proto=%s",
362 NIP6(addr->sin6_addr), 361 &addr->sin6_addr,
363 ntohs(addr->sin6_port), 362 ntohs(addr->sin6_port),
364 protocol); 363 protocol);
365 } 364 }
366 xprt->address_strings[RPC_DISPLAY_ALL] = buf; 365 xprt->address_strings[RPC_DISPLAY_ALL] = buf;
367 366
368 buf = kzalloc(36, GFP_KERNEL); 367 buf = kzalloc(36, GFP_KERNEL);
369 if (buf) { 368 if (buf)
370 snprintf(buf, 36, NIP6_SEQFMT, 369 snprintf(buf, 36, "%pi6", &addr->sin6_addr);
371 NIP6(addr->sin6_addr)); 370
372 }
373 xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = buf; 371 xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = buf;
374 372
375 buf = kzalloc(8, GFP_KERNEL); 373 buf = kzalloc(8, GFP_KERNEL);
@@ -381,10 +379,10 @@ static void xs_format_ipv6_peer_addresses(struct rpc_xprt *xprt,
381 379
382 buf = kzalloc(50, GFP_KERNEL); 380 buf = kzalloc(50, GFP_KERNEL);
383 if (buf) { 381 if (buf) {
384 snprintf(buf, 50, NIP6_FMT".%u.%u", 382 snprintf(buf, 50, "%pI6.%u.%u",
385 NIP6(addr->sin6_addr), 383 &addr->sin6_addr,
386 ntohs(addr->sin6_port) >> 8, 384 ntohs(addr->sin6_port) >> 8,
387 ntohs(addr->sin6_port) & 0xff); 385 ntohs(addr->sin6_port) & 0xff);
388 } 386 }
389 xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf; 387 xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf;
390 388
@@ -1448,8 +1446,8 @@ static int xs_bind6(struct sock_xprt *transport, struct socket *sock)
1448 if (port > last) 1446 if (port > last)
1449 nloop++; 1447 nloop++;
1450 } while (err == -EADDRINUSE && nloop != 2); 1448 } while (err == -EADDRINUSE && nloop != 2);
1451 dprintk("RPC: xs_bind6 "NIP6_FMT":%u: %s (%d)\n", 1449 dprintk("RPC: xs_bind6 %pI6:%u: %s (%d)\n",
1452 NIP6(myaddr.sin6_addr), port, err ? "failed" : "ok", err); 1450 &myaddr.sin6_addr, port, err ? "failed" : "ok", err);
1453 return err; 1451 return err;
1454} 1452}
1455 1453
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index fe43ef7dd7e3..f72ba774c246 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -243,12 +243,11 @@ static int recv_notification(struct notifier_block *nb, unsigned long evt,
243static char *eth_addr2str(struct tipc_media_addr *a, char *str_buf, int str_size) 243static char *eth_addr2str(struct tipc_media_addr *a, char *str_buf, int str_size)
244{ 244{
245 unchar *addr = (unchar *)&a->dev_addr; 245 unchar *addr = (unchar *)&a->dev_addr;
246 DECLARE_MAC_BUF(mac);
247 246
248 if (str_size < 18) 247 if (str_size < 18)
249 *str_buf = '\0'; 248 *str_buf = '\0';
250 else 249 else
251 sprintf(str_buf, "%s", print_mac(mac, addr)); 250 sprintf(str_buf, "%pM", addr);
252 return str_buf; 251 return str_buf;
253} 252}
254 253
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 25872747762c..9d88c3df804a 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2469,13 +2469,11 @@ static void xfrm_audit_common_policyinfo(struct xfrm_policy *xp,
2469 sel->prefixlen_d); 2469 sel->prefixlen_d);
2470 break; 2470 break;
2471 case AF_INET6: 2471 case AF_INET6:
2472 audit_log_format(audit_buf, " src=" NIP6_FMT, 2472 audit_log_format(audit_buf, " src=%pI6", sel->saddr.a6);
2473 NIP6(*(struct in6_addr *)sel->saddr.a6));
2474 if (sel->prefixlen_s != 128) 2473 if (sel->prefixlen_s != 128)
2475 audit_log_format(audit_buf, " src_prefixlen=%d", 2474 audit_log_format(audit_buf, " src_prefixlen=%d",
2476 sel->prefixlen_s); 2475 sel->prefixlen_s);
2477 audit_log_format(audit_buf, " dst=" NIP6_FMT, 2476 audit_log_format(audit_buf, " dst=%pI6", sel->daddr.a6);
2478 NIP6(*(struct in6_addr *)sel->daddr.a6));
2479 if (sel->prefixlen_d != 128) 2477 if (sel->prefixlen_d != 128)
2480 audit_log_format(audit_buf, " dst_prefixlen=%d", 2478 audit_log_format(audit_buf, " dst_prefixlen=%d",
2481 sel->prefixlen_d); 2479 sel->prefixlen_d);
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 508337f97249..304eca4ac970 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -2115,10 +2115,8 @@ static void xfrm_audit_helper_sainfo(struct xfrm_state *x,
2115 NIPQUAD(x->id.daddr.a4)); 2115 NIPQUAD(x->id.daddr.a4));
2116 break; 2116 break;
2117 case AF_INET6: 2117 case AF_INET6:
2118 audit_log_format(audit_buf, 2118 audit_log_format(audit_buf, " src=%pI6 dst=%pI6",
2119 " src=" NIP6_FMT " dst=" NIP6_FMT, 2119 x->props.saddr.a6, x->id.daddr.a6);
2120 NIP6(*(struct in6_addr *)x->props.saddr.a6),
2121 NIP6(*(struct in6_addr *)x->id.daddr.a6));
2122 break; 2120 break;
2123 } 2121 }
2124 2122
@@ -2142,10 +2140,8 @@ static void xfrm_audit_helper_pktinfo(struct sk_buff *skb, u16 family,
2142 case AF_INET6: 2140 case AF_INET6:
2143 iph6 = ipv6_hdr(skb); 2141 iph6 = ipv6_hdr(skb);
2144 audit_log_format(audit_buf, 2142 audit_log_format(audit_buf,
2145 " src=" NIP6_FMT " dst=" NIP6_FMT 2143 " src=%pI6 dst=%pI6 flowlbl=0x%x%02x%02x",
2146 " flowlbl=0x%x%02x%02x", 2144 &iph6->saddr,&iph6->daddr,
2147 NIP6(iph6->saddr),
2148 NIP6(iph6->daddr),
2149 iph6->flow_lbl[0] & 0x0f, 2145 iph6->flow_lbl[0] & 0x0f,
2150 iph6->flow_lbl[1], 2146 iph6->flow_lbl[1],
2151 iph6->flow_lbl[2]); 2147 iph6->flow_lbl[2]);
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index 4a8a1abb59ee..76cf56d5d834 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -2503,6 +2503,57 @@ static int xfrm_send_report(u8 proto, struct xfrm_selector *sel,
2503 return nlmsg_multicast(xfrm_nl, skb, 0, XFRMNLGRP_REPORT, GFP_ATOMIC); 2503 return nlmsg_multicast(xfrm_nl, skb, 0, XFRMNLGRP_REPORT, GFP_ATOMIC);
2504} 2504}
2505 2505
2506static inline size_t xfrm_mapping_msgsize(void)
2507{
2508 return NLMSG_ALIGN(sizeof(struct xfrm_user_mapping));
2509}
2510
2511static int build_mapping(struct sk_buff *skb, struct xfrm_state *x,
2512 xfrm_address_t *new_saddr, __be16 new_sport)
2513{
2514 struct xfrm_user_mapping *um;
2515 struct nlmsghdr *nlh;
2516
2517 nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_MAPPING, sizeof(*um), 0);
2518 if (nlh == NULL)
2519 return -EMSGSIZE;
2520
2521 um = nlmsg_data(nlh);
2522
2523 memcpy(&um->id.daddr, &x->id.daddr, sizeof(um->id.daddr));
2524 um->id.spi = x->id.spi;
2525 um->id.family = x->props.family;
2526 um->id.proto = x->id.proto;
2527 memcpy(&um->new_saddr, new_saddr, sizeof(um->new_saddr));
2528 memcpy(&um->old_saddr, &x->props.saddr, sizeof(um->old_saddr));
2529 um->new_sport = new_sport;
2530 um->old_sport = x->encap->encap_sport;
2531 um->reqid = x->props.reqid;
2532
2533 return nlmsg_end(skb, nlh);
2534}
2535
2536static int xfrm_send_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
2537 __be16 sport)
2538{
2539 struct sk_buff *skb;
2540
2541 if (x->id.proto != IPPROTO_ESP)
2542 return -EINVAL;
2543
2544 if (!x->encap)
2545 return -EINVAL;
2546
2547 skb = nlmsg_new(xfrm_mapping_msgsize(), GFP_ATOMIC);
2548 if (skb == NULL)
2549 return -ENOMEM;
2550
2551 if (build_mapping(skb, x, ipaddr, sport) < 0)
2552 BUG();
2553
2554 return nlmsg_multicast(xfrm_nl, skb, 0, XFRMNLGRP_MAPPING, GFP_ATOMIC);
2555}
2556
2506static struct xfrm_mgr netlink_mgr = { 2557static struct xfrm_mgr netlink_mgr = {
2507 .id = "netlink", 2558 .id = "netlink",
2508 .notify = xfrm_send_state_notify, 2559 .notify = xfrm_send_state_notify,
@@ -2511,6 +2562,7 @@ static struct xfrm_mgr netlink_mgr = {
2511 .notify_policy = xfrm_send_policy_notify, 2562 .notify_policy = xfrm_send_policy_notify,
2512 .report = xfrm_send_report, 2563 .report = xfrm_send_report,
2513 .migrate = xfrm_send_migrate, 2564 .migrate = xfrm_send_migrate,
2565 .new_mapping = xfrm_send_mapping,
2514}; 2566};
2515 2567
2516static int __init xfrm_user_init(void) 2568static int __init xfrm_user_init(void)
diff --git a/security/selinux/avc.c b/security/selinux/avc.c
index cb30c7e350b3..ed6af12cdf43 100644
--- a/security/selinux/avc.c
+++ b/security/selinux/avc.c
@@ -495,7 +495,7 @@ static inline void avc_print_ipv6_addr(struct audit_buffer *ab,
495 char *name1, char *name2) 495 char *name1, char *name2)
496{ 496{
497 if (!ipv6_addr_any(addr)) 497 if (!ipv6_addr_any(addr))
498 audit_log_format(ab, " %s=" NIP6_FMT, name1, NIP6(*addr)); 498 audit_log_format(ab, " %s=%pI6", name1, addr);
499 if (port) 499 if (port)
500 audit_log_format(ab, " %s=%d", name2, ntohs(port)); 500 audit_log_format(ab, " %s=%d", name2, ntohs(port));
501} 501}
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index 3e3fde7c1d2b..aedf02b1345a 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -4626,7 +4626,7 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, int ifindex,
4626 * as fast and as clean as possible. */ 4626 * as fast and as clean as possible. */
4627 if (selinux_compat_net || !selinux_policycap_netpeer) 4627 if (selinux_compat_net || !selinux_policycap_netpeer)
4628 return selinux_ip_postroute_compat(skb, ifindex, family); 4628 return selinux_ip_postroute_compat(skb, ifindex, family);
4629 4629#ifdef CONFIG_XFRM
4630 /* If skb->dst->xfrm is non-NULL then the packet is undergoing an IPsec 4630 /* If skb->dst->xfrm is non-NULL then the packet is undergoing an IPsec
4631 * packet transformation so allow the packet to pass without any checks 4631 * packet transformation so allow the packet to pass without any checks
4632 * since we'll have another chance to perform access control checks 4632 * since we'll have another chance to perform access control checks
@@ -4635,7 +4635,7 @@ static unsigned int selinux_ip_postroute(struct sk_buff *skb, int ifindex,
4635 * is NULL, in this case go ahead and apply access control. */ 4635 * is NULL, in this case go ahead and apply access control. */
4636 if (skb->dst != NULL && skb->dst->xfrm != NULL) 4636 if (skb->dst != NULL && skb->dst->xfrm != NULL)
4637 return NF_ACCEPT; 4637 return NF_ACCEPT;
4638 4638#endif
4639 secmark_active = selinux_secmark_enabled(); 4639 secmark_active = selinux_secmark_enabled();
4640 peerlbl_active = netlbl_enabled() || selinux_xfrm_enabled(); 4640 peerlbl_active = netlbl_enabled() || selinux_xfrm_enabled();
4641 if (!secmark_active && !peerlbl_active) 4641 if (!secmark_active && !peerlbl_active)