aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-04-26 04:22:15 -0400
committerJiri Kosina <jkosina@suse.cz>2011-04-26 04:22:59 -0400
commit07f9479a40cc778bc1462ada11f95b01360ae4ff (patch)
tree0676cf38df3844004bb3ebfd99dfa67a4a8998f5 /drivers/net
parent9d5e6bdb3013acfb311ab407eeca0b6a6a3dedbf (diff)
parentcd2e49e90f1cae7726c9a2c54488d881d7f1cd1c (diff)
Merge branch 'master' into for-next
Fast-forwarded to current state of Linus' tree as there are patches to be applied for files that didn't exist on the old branch.
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c501.c6
-rw-r--r--drivers/net/3c523.c2
-rw-r--r--drivers/net/3c527.c4
-rw-r--r--drivers/net/3c59x.c2
-rw-r--r--drivers/net/a2065.c10
-rw-r--r--drivers/net/acenic.c4
-rw-r--r--drivers/net/amd8111e.c2
-rw-r--r--drivers/net/ariadne.c10
-rw-r--r--drivers/net/at1700.c2
-rw-r--r--drivers/net/atl1e/atl1e_main.c2
-rw-r--r--drivers/net/atlx/atl2.c24
-rw-r--r--drivers/net/bcm63xx_enet.c2
-rw-r--r--drivers/net/benet/be.h4
-rw-r--r--drivers/net/benet/be_cmds.c2
-rw-r--r--drivers/net/benet/be_main.c21
-rw-r--r--drivers/net/bfin_mac.c13
-rw-r--r--drivers/net/bna/bfa_ioc.c41
-rw-r--r--drivers/net/bna/bfa_ioc.h1
-rw-r--r--drivers/net/bna/bfa_ioc_ct.c28
-rw-r--r--drivers/net/bna/bfi.h6
-rw-r--r--drivers/net/bna/bna_hw.h2
-rw-r--r--drivers/net/bna/bnad.c1
-rw-r--r--drivers/net/bnx2.c2
-rw-r--r--drivers/net/bnx2x/bnx2x.h2
-rw-r--r--drivers/net/bnx2x/bnx2x_ethtool.c9
-rw-r--r--drivers/net/bnx2x/bnx2x_hsi.h2
-rw-r--r--drivers/net/bnx2x/bnx2x_link.c14
-rw-r--r--drivers/net/bnx2x/bnx2x_main.c10
-rw-r--r--drivers/net/bnx2x/bnx2x_reg.h44
-rw-r--r--drivers/net/bonding/bond_alb.c6
-rw-r--r--drivers/net/bonding/bond_alb.h8
-rw-r--r--drivers/net/bonding/bond_main.c58
-rw-r--r--drivers/net/bonding/bonding.h1
-rw-r--r--drivers/net/caif/Makefile4
-rw-r--r--drivers/net/caif/caif_shmcore.c2
-rw-r--r--drivers/net/caif/caif_spi.c2
-rw-r--r--drivers/net/caif/caif_spi_slave.c4
-rw-r--r--drivers/net/can/at91_can.c4
-rw-r--r--drivers/net/can/c_can/c_can.c26
-rw-r--r--drivers/net/can/c_can/c_can_platform.c9
-rw-r--r--drivers/net/can/janz-ican3.c11
-rw-r--r--drivers/net/can/mcp251x.c3
-rw-r--r--drivers/net/can/mscan/mpc5xxx_can.c2
-rw-r--r--drivers/net/can/mscan/mscan.c2
-rw-r--r--drivers/net/can/sja1000/sja1000.c2
-rw-r--r--drivers/net/can/softing/softing.h2
-rw-r--r--drivers/net/can/softing/softing_main.c2
-rw-r--r--drivers/net/can/ti_hecc.c2
-rw-r--r--drivers/net/can/usb/ems_usb.c2
-rw-r--r--drivers/net/can/usb/esd_usb2.c2
-rw-r--r--drivers/net/cassini.c4
-rw-r--r--drivers/net/cassini.h2
-rw-r--r--drivers/net/chelsio/mv88e1xxx.c2
-rw-r--r--drivers/net/chelsio/pm3393.c2
-rw-r--r--drivers/net/chelsio/sge.c2
-rw-r--r--drivers/net/chelsio/vsc7326.c2
-rw-r--r--drivers/net/cris/eth_v10.c2
-rw-r--r--drivers/net/cxgb3/cxgb3_main.c14
-rw-r--r--drivers/net/cxgb3/sge.c2
-rw-r--r--drivers/net/cxgb3/t3_hw.c6
-rw-r--r--drivers/net/cxgb4/t4_hw.c2
-rw-r--r--drivers/net/cxgb4vf/cxgb4vf_main.c2
-rw-r--r--drivers/net/cxgb4vf/sge.c8
-rw-r--r--drivers/net/davinci_cpdma.c11
-rw-r--r--drivers/net/davinci_cpdma.h1
-rw-r--r--drivers/net/davinci_emac.c13
-rw-r--r--drivers/net/dm9000.c8
-rw-r--r--drivers/net/e1000/e1000_ethtool.c2
-rw-r--r--drivers/net/e1000/e1000_hw.h2
-rw-r--r--drivers/net/e1000/e1000_main.c2
-rw-r--r--drivers/net/e1000e/netdev.c2
-rw-r--r--drivers/net/enc28j60_hw.h2
-rw-r--r--drivers/net/eth16i.c2
-rw-r--r--drivers/net/ethoc.c2
-rw-r--r--drivers/net/fec.h4
-rw-r--r--drivers/net/forcedeth.c14
-rw-r--r--drivers/net/ftmac100.c2
-rw-r--r--drivers/net/gianfar.c16
-rw-r--r--drivers/net/gianfar.h3
-rw-r--r--drivers/net/hamradio/Makefile2
-rw-r--r--drivers/net/hamradio/yam.c2
-rw-r--r--drivers/net/hp100.c16
-rw-r--r--drivers/net/hp100.h2
-rw-r--r--drivers/net/ibm_newemac/tah.c2
-rw-r--r--drivers/net/ibmlana.c4
-rw-r--r--drivers/net/ibmlana.h2
-rw-r--r--drivers/net/igb/e1000_mac.c4
-rw-r--r--drivers/net/igb/e1000_phy.c2
-rw-r--r--drivers/net/igb/igb_main.c14
-rw-r--r--drivers/net/igbvf/netdev.c2
-rw-r--r--drivers/net/ipg.c28
-rw-r--r--drivers/net/irda/ali-ircc.c4
-rw-r--r--drivers/net/irda/donauboe.c2
-rw-r--r--drivers/net/irda/donauboe.h2
-rw-r--r--drivers/net/irda/girbil-sir.c2
-rw-r--r--drivers/net/irda/irda-usb.c4
-rw-r--r--drivers/net/irda/mcs7780.c6
-rw-r--r--drivers/net/irda/nsc-ircc.c2
-rw-r--r--drivers/net/irda/nsc-ircc.h2
-rw-r--r--drivers/net/irda/pxaficp_ir.c4
-rw-r--r--drivers/net/irda/smsc-ircc2.c2
-rw-r--r--drivers/net/irda/via-ircc.c98
-rw-r--r--drivers/net/irda/vlsi_ir.h4
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb.c2
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c4
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c8
-rw-r--r--drivers/net/ixgbe/ixgbe_phy.c2
-rw-r--r--drivers/net/ixgbe/ixgbe_x540.c2
-rw-r--r--drivers/net/ixgbevf/ixgbevf_main.c2
-rw-r--r--drivers/net/jme.c30
-rw-r--r--drivers/net/ks8842.c5
-rw-r--r--drivers/net/ks8851.c8
-rw-r--r--drivers/net/ks8851_mll.c4
-rw-r--r--drivers/net/ksz884x.c2
-rw-r--r--drivers/net/lib8390.c4
-rw-r--r--drivers/net/loopback.c3
-rw-r--r--drivers/net/lp486e.c2
-rw-r--r--drivers/net/macvlan.c18
-rw-r--r--drivers/net/meth.h4
-rw-r--r--drivers/net/mlx4/alloc.c13
-rw-r--r--drivers/net/mlx4/cq.c2
-rw-r--r--drivers/net/mlx4/en_cq.c38
-rw-r--r--drivers/net/mlx4/en_ethtool.c66
-rw-r--r--drivers/net/mlx4/en_main.c24
-rw-r--r--drivers/net/mlx4/en_netdev.c208
-rw-r--r--drivers/net/mlx4/en_port.c13
-rw-r--r--drivers/net/mlx4/en_port.h19
-rw-r--r--drivers/net/mlx4/en_rx.c17
-rw-r--r--drivers/net/mlx4/en_selftest.c2
-rw-r--r--drivers/net/mlx4/en_tx.c74
-rw-r--r--drivers/net/mlx4/eq.c111
-rw-r--r--drivers/net/mlx4/fw.c25
-rw-r--r--drivers/net/mlx4/fw.h3
-rw-r--r--drivers/net/mlx4/main.c127
-rw-r--r--drivers/net/mlx4/mcg.c647
-rw-r--r--drivers/net/mlx4/mlx4.h52
-rw-r--r--drivers/net/mlx4/mlx4_en.h27
-rw-r--r--drivers/net/mlx4/pd.c102
-rw-r--r--drivers/net/mlx4/port.c169
-rw-r--r--drivers/net/mlx4/profile.c4
-rw-r--r--drivers/net/mlx4/sense.c4
-rw-r--r--drivers/net/myri10ge/myri10ge.c40
-rw-r--r--drivers/net/myri_sbus.c2
-rw-r--r--drivers/net/natsemi.c9
-rw-r--r--drivers/net/netxen/netxen_nic.h4
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c2
-rw-r--r--drivers/net/netxen/netxen_nic_hdr.h2
-rw-r--r--drivers/net/netxen/netxen_nic_main.c17
-rw-r--r--drivers/net/niu.c2
-rw-r--r--drivers/net/ns83820.c4
-rw-r--r--drivers/net/pch_gbe/pch_gbe.h14
-rw-r--r--drivers/net/pch_gbe/pch_gbe_ethtool.c2
-rw-r--r--drivers/net/pch_gbe/pch_gbe_main.c10
-rw-r--r--drivers/net/pci-skeleton.c2
-rw-r--r--drivers/net/pcmcia/3c574_cs.c2
-rw-r--r--drivers/net/pcmcia/axnet_cs.c4
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c2
-rw-r--r--drivers/net/pcnet32.c2
-rw-r--r--drivers/net/phy/phy_device.c12
-rw-r--r--drivers/net/ppp_deflate.c2
-rw-r--r--drivers/net/ppp_generic.c2
-rw-r--r--drivers/net/ppp_synctty.c2
-rw-r--r--drivers/net/pppoe.c4
-rw-r--r--drivers/net/ps3_gelic_net.c4
-rw-r--r--drivers/net/ps3_gelic_net.h2
-rw-r--r--drivers/net/ps3_gelic_wireless.c2
-rw-r--r--drivers/net/pxa168_eth.c2
-rw-r--r--drivers/net/qla3xxx.h2
-rw-r--r--drivers/net/qlcnic/qlcnic.h1
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c2
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c14
-rw-r--r--drivers/net/qlge/qlge_main.c10
-rw-r--r--drivers/net/r6040.c2
-rw-r--r--drivers/net/r8169.c4
-rw-r--r--drivers/net/rionet.c6
-rw-r--r--drivers/net/s2io.c8
-rw-r--r--drivers/net/s2io.h2
-rw-r--r--drivers/net/sfc/efx.c24
-rw-r--r--drivers/net/sfc/falcon.c4
-rw-r--r--drivers/net/sfc/io.h2
-rw-r--r--drivers/net/sfc/mcdi.c2
-rw-r--r--drivers/net/sfc/mcdi_pcol.h6
-rw-r--r--drivers/net/sfc/mcdi_phy.c2
-rw-r--r--drivers/net/sfc/net_driver.h4
-rw-r--r--drivers/net/sfc/nic.c22
-rw-r--r--drivers/net/sfc/nic.h1
-rw-r--r--drivers/net/sfc/selftest.c25
-rw-r--r--drivers/net/sfc/tx.c3
-rw-r--r--drivers/net/sfc/workarounds.h2
-rw-r--r--drivers/net/sgiseeq.c4
-rw-r--r--drivers/net/sh_eth.c2
-rw-r--r--drivers/net/sis190.c4
-rw-r--r--drivers/net/sis900.c29
-rw-r--r--drivers/net/skfp/Makefile2
-rw-r--r--drivers/net/skfp/ess.c8
-rw-r--r--drivers/net/skfp/fplustm.c6
-rw-r--r--drivers/net/skfp/h/cmtdef.h4
-rw-r--r--drivers/net/skfp/h/fplustm.h4
-rw-r--r--drivers/net/skfp/h/smc.h2
-rw-r--r--drivers/net/skfp/h/smt.h2
-rw-r--r--drivers/net/skfp/h/supern_2.h4
-rw-r--r--drivers/net/skfp/hwmtm.c2
-rw-r--r--drivers/net/skfp/pcmplc.c6
-rw-r--r--drivers/net/skfp/smt.c2
-rw-r--r--drivers/net/skge.h8
-rw-r--r--drivers/net/sky2.c4
-rw-r--r--drivers/net/sky2.h6
-rw-r--r--drivers/net/smc91x.h2
-rw-r--r--drivers/net/smsc911x.c10
-rw-r--r--drivers/net/smsc9420.c2
-rw-r--r--drivers/net/starfire.c6
-rw-r--r--drivers/net/stmmac/dwmac_lib.c28
-rw-r--r--drivers/net/stmmac/norm_desc.c2
-rw-r--r--drivers/net/stmmac/stmmac_main.c49
-rw-r--r--drivers/net/sunbmac.h2
-rw-r--r--drivers/net/sungem.c2
-rw-r--r--drivers/net/sunhme.h2
-rw-r--r--drivers/net/tc35815.c38
-rw-r--r--drivers/net/tehuti.c12
-rw-r--r--drivers/net/tehuti.h2
-rw-r--r--drivers/net/tg3.c8
-rw-r--r--drivers/net/tg3.h4
-rw-r--r--drivers/net/tokenring/3c359.c6
-rw-r--r--drivers/net/tokenring/lanstreamer.c2
-rw-r--r--drivers/net/tokenring/madgemc.c6
-rw-r--r--drivers/net/tokenring/olympic.c2
-rw-r--r--drivers/net/tokenring/smctr.c12
-rw-r--r--drivers/net/tokenring/tms380tr.h2
-rw-r--r--drivers/net/tsi108_eth.h8
-rw-r--r--drivers/net/tulip/de4x5.c6
-rw-r--r--drivers/net/tulip/dmfe.c2
-rw-r--r--drivers/net/tulip/eeprom.c2
-rw-r--r--drivers/net/typhoon.c2
-rw-r--r--drivers/net/ucc_geth.h4
-rw-r--r--drivers/net/usb/Kconfig15
-rw-r--r--drivers/net/usb/Makefile1
-rw-r--r--drivers/net/usb/cdc_eem.c4
-rw-r--r--drivers/net/usb/cdc_ether.c23
-rw-r--r--drivers/net/usb/cdc_ncm.c2
-rw-r--r--drivers/net/usb/cdc_subset.c8
-rw-r--r--drivers/net/usb/gl620a.c2
-rw-r--r--drivers/net/usb/kaweth.c2
-rw-r--r--drivers/net/usb/lg-vl600.c346
-rw-r--r--drivers/net/usb/net1080.c2
-rw-r--r--drivers/net/usb/plusb.c2
-rw-r--r--drivers/net/usb/rndis_host.c2
-rw-r--r--drivers/net/usb/smsc95xx.c32
-rw-r--r--drivers/net/usb/usbnet.c13
-rw-r--r--drivers/net/usb/zaurus.c8
-rw-r--r--drivers/net/veth.c2
-rw-r--r--drivers/net/via-rhine.c4
-rw-r--r--drivers/net/via-velocity.c4
-rw-r--r--drivers/net/vmxnet3/vmxnet3_drv.c4
-rw-r--r--drivers/net/vmxnet3/vmxnet3_ethtool.c4
-rw-r--r--drivers/net/vxge/vxge-config.c2
-rw-r--r--drivers/net/vxge/vxge-ethtool.c4
-rw-r--r--drivers/net/vxge/vxge-main.c8
-rw-r--r--drivers/net/vxge/vxge-traffic.c4
-rw-r--r--drivers/net/vxge/vxge-traffic.h2
-rw-r--r--drivers/net/wan/cosa.c2
-rw-r--r--drivers/net/wan/dscc4.c8
-rw-r--r--drivers/net/wan/hostess_sv11.c2
-rw-r--r--drivers/net/wan/ixp4xx_hss.c4
-rw-r--r--drivers/net/wan/lmc/Makefile2
-rw-r--r--drivers/net/wan/lmc/lmc_main.c2
-rw-r--r--drivers/net/wan/lmc/lmc_var.h6
-rw-r--r--drivers/net/wan/z85230.c8
-rw-r--r--drivers/net/wimax/i2400m/control.c4
-rw-r--r--drivers/net/wimax/i2400m/driver.c4
-rw-r--r--drivers/net/wimax/i2400m/fw.c4
-rw-r--r--drivers/net/wimax/i2400m/i2400m-usb.h6
-rw-r--r--drivers/net/wimax/i2400m/i2400m.h4
-rw-r--r--drivers/net/wimax/i2400m/netdev.c2
-rw-r--r--drivers/net/wimax/i2400m/op-rfkill.c4
-rw-r--r--drivers/net/wimax/i2400m/rx.c4
-rw-r--r--drivers/net/wimax/i2400m/tx.c4
-rw-r--r--drivers/net/wimax/i2400m/usb-fw.c2
-rw-r--r--drivers/net/wimax/i2400m/usb-rx.c2
-rw-r--r--drivers/net/wimax/i2400m/usb-tx.c2
-rw-r--r--drivers/net/wireless/airo.c14
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c2
-rw-r--r--drivers/net/wireless/ath/ar9170/phy.c2
-rw-r--r--drivers/net/wireless/ath/ath5k/ani.h2
-rw-r--r--drivers/net/wireless/ath/ath5k/base.c6
-rw-r--r--drivers/net/wireless/ath/ath5k/desc.c14
-rw-r--r--drivers/net/wireless/ath/ath5k/eeprom.c4
-rw-r--r--drivers/net/wireless/ath/ath5k/pci.c2
-rw-r--r--drivers/net/wireless/ath/ath5k/pcu.c6
-rw-r--r--drivers/net/wireless/ath/ath5k/phy.c22
-rw-r--r--drivers/net/wireless/ath/ath5k/reg.h12
-rw-r--r--drivers/net/wireless/ath/ath9k/ar5008_phy.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_eeprom.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hif_usb.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_hst.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c10
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.c25
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.h2
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c18
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c4
-rw-r--r--drivers/net/wireless/ath/ath9k/recv.c6
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c8
-rw-r--r--drivers/net/wireless/ath/carl9170/carl9170.h3
-rw-r--r--drivers/net/wireless/ath/carl9170/main.c1
-rw-r--r--drivers/net/wireless/ath/carl9170/phy.c2
-rw-r--r--drivers/net/wireless/ath/carl9170/rx.c2
-rw-r--r--drivers/net/wireless/ath/carl9170/tx.c7
-rw-r--r--drivers/net/wireless/ath/carl9170/usb.c2
-rw-r--r--drivers/net/wireless/ath/hw.c2
-rw-r--r--drivers/net/wireless/ath/regd.c4
-rw-r--r--drivers/net/wireless/ath/regd_common.h1
-rw-r--r--drivers/net/wireless/atmel.c4
-rw-r--r--drivers/net/wireless/atmel_cs.c2
-rw-r--r--drivers/net/wireless/b43/b43.h2
-rw-r--r--drivers/net/wireless/b43/dma.c2
-rw-r--r--drivers/net/wireless/b43/dma.h2
-rw-r--r--drivers/net/wireless/b43/main.c2
-rw-r--r--drivers/net/wireless/b43/phy_g.h2
-rw-r--r--drivers/net/wireless/b43/phy_n.h2
-rw-r--r--drivers/net/wireless/b43legacy/b43legacy.h2
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.c2
-rw-r--r--drivers/net/wireless/hostap/hostap_ap.h2
-rw-r--r--drivers/net/wireless/hostap/hostap_config.h4
-rw-r--r--drivers/net/wireless/hostap/hostap_ioctl.c4
-rw-r--r--drivers/net/wireless/hostap/hostap_wlan.h2
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2100.c2
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c18
-rw-r--r--drivers/net/wireless/ipw2x00/libipw_rx.c2
-rw-r--r--drivers/net/wireless/iwlegacy/Kconfig9
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-3945-hw.h2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-4965-hw.h3
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-core.c29
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-eeprom.c7
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-fh.h2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-scan.c2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl-sta.c2
-rw-r--r--drivers/net/wireless/iwlegacy/iwl3945-base.c11
-rw-r--r--drivers/net/wireless/iwlegacy/iwl4965-base.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-ict.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c7
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-eeprom.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fh.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-scan.c2
-rw-r--r--drivers/net/wireless/iwmc3200wifi/hal.c4
-rw-r--r--drivers/net/wireless/iwmc3200wifi/tx.c2
-rw-r--r--drivers/net/wireless/libertas/README4
-rw-r--r--drivers/net/wireless/libertas/cfg.c2
-rw-r--r--drivers/net/wireless/libertas/if_cs.c2
-rw-r--r--drivers/net/wireless/libertas/if_spi.h2
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c2
-rw-r--r--drivers/net/wireless/mwl8k.c9
-rw-r--r--drivers/net/wireless/orinoco/cfg.c3
-rw-r--r--drivers/net/wireless/orinoco/hw.c2
-rw-r--r--drivers/net/wireless/orinoco/main.c2
-rw-r--r--drivers/net/wireless/p54/main.c2
-rw-r--r--drivers/net/wireless/p54/p54spi.c5
-rw-r--r--drivers/net/wireless/p54/p54usb.c2
-rw-r--r--drivers/net/wireless/p54/txrx.c2
-rw-r--r--drivers/net/wireless/prism54/islpci_eth.c4
-rw-r--r--drivers/net/wireless/rayctl.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2800.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2800lib.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c13
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00.h8
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00config.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00crypto.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dev.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00dump.h2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00link.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.c6
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00queue.h12
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c2
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.h2
-rw-r--r--drivers/net/wireless/rtlwifi/base.c2
-rw-r--r--drivers/net/wireless/rtlwifi/efuse.c33
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c2
-rw-r--r--drivers/net/wireless/rtlwifi/regd.c2
-rw-r--r--drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c2
-rw-r--r--drivers/net/wireless/rtlwifi/usb.c2
-rw-r--r--drivers/net/wireless/rtlwifi/wifi.h2
-rw-r--r--drivers/net/wireless/wl1251/cmd.c2
-rw-r--r--drivers/net/wireless/wl1251/rx.c2
-rw-r--r--drivers/net/wireless/wl1251/sdio.c2
-rw-r--r--drivers/net/wireless/wl1251/spi.c2
-rw-r--r--drivers/net/wireless/wl12xx/cmd.c2
-rw-r--r--drivers/net/wireless/wl12xx/conf.h8
-rw-r--r--drivers/net/wireless/wl12xx/io.h2
-rw-r--r--drivers/net/wireless/wl12xx/sdio.c2
-rw-r--r--drivers/net/wireless/wl12xx/spi.c2
-rw-r--r--drivers/net/wireless/wl12xx/testmode.c5
-rw-r--r--drivers/net/wireless/wl3501_cs.c4
-rw-r--r--drivers/net/wireless/zd1211rw/Makefile4
-rw-r--r--drivers/net/wireless/zd1211rw/zd_rf_rf2959.c2
-rw-r--r--drivers/net/wireless/zd1211rw/zd_rf_uw2453.c2
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.c21
-rw-r--r--drivers/net/wireless/zd1211rw/zd_usb.h1
-rw-r--r--drivers/net/xilinx_emaclite.c2
-rw-r--r--drivers/net/znet.c2
401 files changed, 3170 insertions, 1219 deletions
diff --git a/drivers/net/3c501.c b/drivers/net/3c501.c
index 9e1c03eb97ae..5420f6de27df 100644
--- a/drivers/net/3c501.c
+++ b/drivers/net/3c501.c
@@ -399,7 +399,7 @@ static void el_timeout(struct net_device *dev)
399 * as we may still be attempting to retrieve the last RX packet buffer. 399 * as we may still be attempting to retrieve the last RX packet buffer.
400 * 400 *
401 * When a transmit times out we dump the card into control mode and just 401 * When a transmit times out we dump the card into control mode and just
402 * start again. It happens enough that it isnt worth logging. 402 * start again. It happens enough that it isn't worth logging.
403 * 403 *
404 * We avoid holding the spin locks when doing the packet load to the board. 404 * We avoid holding the spin locks when doing the packet load to the board.
405 * The device is very slow, and its DMA mode is even slower. If we held the 405 * The device is very slow, and its DMA mode is even slower. If we held the
@@ -499,7 +499,7 @@ static netdev_tx_t el_start_xmit(struct sk_buff *skb, struct net_device *dev)
499 * 499 *
500 * Handle the ether interface interrupts. The 3c501 needs a lot more 500 * Handle the ether interface interrupts. The 3c501 needs a lot more
501 * hand holding than most cards. In particular we get a transmit interrupt 501 * hand holding than most cards. In particular we get a transmit interrupt
502 * with a collision error because the board firmware isnt capable of rewinding 502 * with a collision error because the board firmware isn't capable of rewinding
503 * its own transmit buffer pointers. It can however count to 16 for us. 503 * its own transmit buffer pointers. It can however count to 16 for us.
504 * 504 *
505 * On the receive side the card is also very dumb. It has no buffering to 505 * On the receive side the card is also very dumb. It has no buffering to
@@ -732,7 +732,7 @@ static void el_receive(struct net_device *dev)
732 * el_reset: Reset a 3c501 card 732 * el_reset: Reset a 3c501 card
733 * @dev: The 3c501 card about to get zapped 733 * @dev: The 3c501 card about to get zapped
734 * 734 *
735 * Even resetting a 3c501 isnt simple. When you activate reset it loses all 735 * Even resetting a 3c501 isn't simple. When you activate reset it loses all
736 * its configuration. You must hold the lock when doing this. The function 736 * its configuration. You must hold the lock when doing this. The function
737 * cannot take the lock itself as it is callable from the irq handler. 737 * cannot take the lock itself as it is callable from the irq handler.
738 */ 738 */
diff --git a/drivers/net/3c523.c b/drivers/net/3c523.c
index de579d043169..bc0d1a1c2e28 100644
--- a/drivers/net/3c523.c
+++ b/drivers/net/3c523.c
@@ -44,7 +44,7 @@
44 this for the 64K version would require a lot of heinous bank 44 this for the 64K version would require a lot of heinous bank
45 switching, which I'm sure not interested in doing. If you try to 45 switching, which I'm sure not interested in doing. If you try to
46 implement a bank switching version, you'll basically have to remember 46 implement a bank switching version, you'll basically have to remember
47 what bank is enabled and do a switch everytime you access a memory 47 what bank is enabled and do a switch every time you access a memory
48 location that's not current. You'll also have to remap pointers on 48 location that's not current. You'll also have to remap pointers on
49 the driver side, because it only knows about 16K of the memory. 49 the driver side, because it only knows about 16K of the memory.
50 Anyone desperate or masochistic enough to try? 50 Anyone desperate or masochistic enough to try?
diff --git a/drivers/net/3c527.c b/drivers/net/3c527.c
index 8c094bae8bf3..d9d056d207f3 100644
--- a/drivers/net/3c527.c
+++ b/drivers/net/3c527.c
@@ -51,7 +51,7 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Procter <rnp@paradise.net.
51 * circular buffer queues. 51 * circular buffer queues.
52 * 52 *
53 * The mailboxes can be used for controlling how the card traverses 53 * The mailboxes can be used for controlling how the card traverses
54 * its buffer rings, but are used only for inital setup in this 54 * its buffer rings, but are used only for initial setup in this
55 * implementation. The exec mailbox allows a variety of commands to 55 * implementation. The exec mailbox allows a variety of commands to
56 * be executed. Each command must complete before the next is 56 * be executed. Each command must complete before the next is
57 * executed. Primarily we use the exec mailbox for controlling the 57 * executed. Primarily we use the exec mailbox for controlling the
@@ -813,7 +813,7 @@ static void mc32_flush_rx_ring(struct net_device *dev)
813 * 813 *
814 * This sets up the host transmit data-structures. 814 * This sets up the host transmit data-structures.
815 * 815 *
816 * First, we obtain from the card it's current postion in the tx 816 * First, we obtain from the card it's current position in the tx
817 * ring, so that we will know where to begin transmitting 817 * ring, so that we will know where to begin transmitting
818 * packets. 818 * packets.
819 * 819 *
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 0a92436f0538..8cc22568ebd3 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -984,7 +984,7 @@ static int __init vortex_eisa_init(void)
984 * any device have been found when we exit from 984 * any device have been found when we exit from
985 * eisa_driver_register (the bus root driver may not be 985 * eisa_driver_register (the bus root driver may not be
986 * initialized yet). So we blindly assume something was 986 * initialized yet). So we blindly assume something was
987 * found, and let the sysfs magic happend... 987 * found, and let the sysfs magic happened...
988 */ 988 */
989 eisa_found = 1; 989 eisa_found = 1;
990 } 990 }
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c
index f142cc21e453..deaa8bc16cf8 100644
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -711,14 +711,14 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
711 return -EBUSY; 711 return -EBUSY;
712 r2 = request_mem_region(mem_start, A2065_RAM_SIZE, "RAM"); 712 r2 = request_mem_region(mem_start, A2065_RAM_SIZE, "RAM");
713 if (!r2) { 713 if (!r2) {
714 release_resource(r1); 714 release_mem_region(base_addr, sizeof(struct lance_regs));
715 return -EBUSY; 715 return -EBUSY;
716 } 716 }
717 717
718 dev = alloc_etherdev(sizeof(struct lance_private)); 718 dev = alloc_etherdev(sizeof(struct lance_private));
719 if (dev == NULL) { 719 if (dev == NULL) {
720 release_resource(r1); 720 release_mem_region(base_addr, sizeof(struct lance_regs));
721 release_resource(r2); 721 release_mem_region(mem_start, A2065_RAM_SIZE);
722 return -ENOMEM; 722 return -ENOMEM;
723 } 723 }
724 724
@@ -764,8 +764,8 @@ static int __devinit a2065_init_one(struct zorro_dev *z,
764 764
765 err = register_netdev(dev); 765 err = register_netdev(dev);
766 if (err) { 766 if (err) {
767 release_resource(r1); 767 release_mem_region(base_addr, sizeof(struct lance_regs));
768 release_resource(r2); 768 release_mem_region(mem_start, A2065_RAM_SIZE);
769 free_netdev(dev); 769 free_netdev(dev);
770 return err; 770 return err;
771 } 771 }
diff --git a/drivers/net/acenic.c b/drivers/net/acenic.c
index 41d9911202d0..ee648fe5d96f 100644
--- a/drivers/net/acenic.c
+++ b/drivers/net/acenic.c
@@ -1584,7 +1584,7 @@ static void ace_watchdog(struct net_device *data)
1584 /* 1584 /*
1585 * We haven't received a stats update event for more than 2.5 1585 * We haven't received a stats update event for more than 2.5
1586 * seconds and there is data in the transmit queue, thus we 1586 * seconds and there is data in the transmit queue, thus we
1587 * asume the card is stuck. 1587 * assume the card is stuck.
1588 */ 1588 */
1589 if (*ap->tx_csm != ap->tx_ret_csm) { 1589 if (*ap->tx_csm != ap->tx_ret_csm) {
1590 printk(KERN_WARNING "%s: Transmitter is stuck, %08x\n", 1590 printk(KERN_WARNING "%s: Transmitter is stuck, %08x\n",
@@ -2564,7 +2564,7 @@ restart:
2564 2564
2565 /* 2565 /*
2566 * A TX-descriptor producer (an IRQ) might have gotten 2566 * A TX-descriptor producer (an IRQ) might have gotten
2567 * inbetween, making the ring free again. Since xmit is 2567 * between, making the ring free again. Since xmit is
2568 * serialized, this is the only situation we have to 2568 * serialized, this is the only situation we have to
2569 * re-test. 2569 * re-test.
2570 */ 2570 */
diff --git a/drivers/net/amd8111e.c b/drivers/net/amd8111e.c
index 2ca880b4c0db..88495c48a81d 100644
--- a/drivers/net/amd8111e.c
+++ b/drivers/net/amd8111e.c
@@ -1398,7 +1398,7 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
1398 mc_filter[1] = mc_filter[0] = 0; 1398 mc_filter[1] = mc_filter[0] = 0;
1399 lp->options &= ~OPTION_MULTICAST_ENABLE; 1399 lp->options &= ~OPTION_MULTICAST_ENABLE;
1400 amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF); 1400 amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF);
1401 /* disable promiscous mode */ 1401 /* disable promiscuous mode */
1402 writel(PROM, lp->mmio + CMD2); 1402 writel(PROM, lp->mmio + CMD2);
1403 return; 1403 return;
1404 } 1404 }
diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c
index 7ca0eded2561..b7f45cd756a2 100644
--- a/drivers/net/ariadne.c
+++ b/drivers/net/ariadne.c
@@ -182,14 +182,14 @@ static int __devinit ariadne_init_one(struct zorro_dev *z,
182 return -EBUSY; 182 return -EBUSY;
183 r2 = request_mem_region(mem_start, ARIADNE_RAM_SIZE, "RAM"); 183 r2 = request_mem_region(mem_start, ARIADNE_RAM_SIZE, "RAM");
184 if (!r2) { 184 if (!r2) {
185 release_resource(r1); 185 release_mem_region(base_addr, sizeof(struct Am79C960));
186 return -EBUSY; 186 return -EBUSY;
187 } 187 }
188 188
189 dev = alloc_etherdev(sizeof(struct ariadne_private)); 189 dev = alloc_etherdev(sizeof(struct ariadne_private));
190 if (dev == NULL) { 190 if (dev == NULL) {
191 release_resource(r1); 191 release_mem_region(base_addr, sizeof(struct Am79C960));
192 release_resource(r2); 192 release_mem_region(mem_start, ARIADNE_RAM_SIZE);
193 return -ENOMEM; 193 return -ENOMEM;
194 } 194 }
195 195
@@ -213,8 +213,8 @@ static int __devinit ariadne_init_one(struct zorro_dev *z,
213 213
214 err = register_netdev(dev); 214 err = register_netdev(dev);
215 if (err) { 215 if (err) {
216 release_resource(r1); 216 release_mem_region(base_addr, sizeof(struct Am79C960));
217 release_resource(r2); 217 release_mem_region(mem_start, ARIADNE_RAM_SIZE);
218 free_netdev(dev); 218 free_netdev(dev);
219 return err; 219 return err;
220 } 220 }
diff --git a/drivers/net/at1700.c b/drivers/net/at1700.c
index f4744fc89768..65a78f965dd2 100644
--- a/drivers/net/at1700.c
+++ b/drivers/net/at1700.c
@@ -133,7 +133,7 @@ struct net_local {
133/* Run-time register bank 2 definitions. */ 133/* Run-time register bank 2 definitions. */
134#define DATAPORT 8 /* Word-wide DMA or programmed-I/O dataport. */ 134#define DATAPORT 8 /* Word-wide DMA or programmed-I/O dataport. */
135#define TX_START 10 135#define TX_START 10
136#define COL16CNTL 11 /* Controll Reg for 16 collisions */ 136#define COL16CNTL 11 /* Control Reg for 16 collisions */
137#define MODE13 13 137#define MODE13 13
138#define RX_CTRL 14 138#define RX_CTRL 14
139/* Configuration registers only on the '865A/B chips. */ 139/* Configuration registers only on the '865A/B chips. */
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c
index 1ff001a8270c..b0a71e2f28a9 100644
--- a/drivers/net/atl1e/atl1e_main.c
+++ b/drivers/net/atl1e/atl1e_main.c
@@ -2509,7 +2509,7 @@ static struct pci_driver atl1e_driver = {
2509 .id_table = atl1e_pci_tbl, 2509 .id_table = atl1e_pci_tbl,
2510 .probe = atl1e_probe, 2510 .probe = atl1e_probe,
2511 .remove = __devexit_p(atl1e_remove), 2511 .remove = __devexit_p(atl1e_remove),
2512 /* Power Managment Hooks */ 2512 /* Power Management Hooks */
2513#ifdef CONFIG_PM 2513#ifdef CONFIG_PM
2514 .suspend = atl1e_suspend, 2514 .suspend = atl1e_suspend,
2515 .resume = atl1e_resume, 2515 .resume = atl1e_resume,
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
index e637e9f28fd4..e3cbf45dc612 100644
--- a/drivers/net/atlx/atl2.c
+++ b/drivers/net/atlx/atl2.c
@@ -1701,7 +1701,7 @@ static struct pci_driver atl2_driver = {
1701 .id_table = atl2_pci_tbl, 1701 .id_table = atl2_pci_tbl,
1702 .probe = atl2_probe, 1702 .probe = atl2_probe,
1703 .remove = __devexit_p(atl2_remove), 1703 .remove = __devexit_p(atl2_remove),
1704 /* Power Managment Hooks */ 1704 /* Power Management Hooks */
1705 .suspend = atl2_suspend, 1705 .suspend = atl2_suspend,
1706#ifdef CONFIG_PM 1706#ifdef CONFIG_PM
1707 .resume = atl2_resume, 1707 .resume = atl2_resume,
@@ -1996,13 +1996,15 @@ static int atl2_set_eeprom(struct net_device *netdev,
1996 if (!eeprom_buff) 1996 if (!eeprom_buff)
1997 return -ENOMEM; 1997 return -ENOMEM;
1998 1998
1999 ptr = (u32 *)eeprom_buff; 1999 ptr = eeprom_buff;
2000 2000
2001 if (eeprom->offset & 3) { 2001 if (eeprom->offset & 3) {
2002 /* need read/modify/write of first changed EEPROM word */ 2002 /* need read/modify/write of first changed EEPROM word */
2003 /* only the second byte of the word is being modified */ 2003 /* only the second byte of the word is being modified */
2004 if (!atl2_read_eeprom(hw, first_dword*4, &(eeprom_buff[0]))) 2004 if (!atl2_read_eeprom(hw, first_dword*4, &(eeprom_buff[0]))) {
2005 return -EIO; 2005 ret_val = -EIO;
2006 goto out;
2007 }
2006 ptr++; 2008 ptr++;
2007 } 2009 }
2008 if (((eeprom->offset + eeprom->len) & 3)) { 2010 if (((eeprom->offset + eeprom->len) & 3)) {
@@ -2011,18 +2013,22 @@ static int atl2_set_eeprom(struct net_device *netdev,
2011 * only the first byte of the word is being modified 2013 * only the first byte of the word is being modified
2012 */ 2014 */
2013 if (!atl2_read_eeprom(hw, last_dword * 4, 2015 if (!atl2_read_eeprom(hw, last_dword * 4,
2014 &(eeprom_buff[last_dword - first_dword]))) 2016 &(eeprom_buff[last_dword - first_dword]))) {
2015 return -EIO; 2017 ret_val = -EIO;
2018 goto out;
2019 }
2016 } 2020 }
2017 2021
2018 /* Device's eeprom is always little-endian, word addressable */ 2022 /* Device's eeprom is always little-endian, word addressable */
2019 memcpy(ptr, bytes, eeprom->len); 2023 memcpy(ptr, bytes, eeprom->len);
2020 2024
2021 for (i = 0; i < last_dword - first_dword + 1; i++) { 2025 for (i = 0; i < last_dword - first_dword + 1; i++) {
2022 if (!atl2_write_eeprom(hw, ((first_dword+i)*4), eeprom_buff[i])) 2026 if (!atl2_write_eeprom(hw, ((first_dword+i)*4), eeprom_buff[i])) {
2023 return -EIO; 2027 ret_val = -EIO;
2028 goto out;
2029 }
2024 } 2030 }
2025 2031 out:
2026 kfree(eeprom_buff); 2032 kfree(eeprom_buff);
2027 return ret_val; 2033 return ret_val;
2028} 2034}
diff --git a/drivers/net/bcm63xx_enet.c b/drivers/net/bcm63xx_enet.c
index e94a966af418..c48104b08861 100644
--- a/drivers/net/bcm63xx_enet.c
+++ b/drivers/net/bcm63xx_enet.c
@@ -597,7 +597,7 @@ static int bcm_enet_set_mac_address(struct net_device *dev, void *p)
597} 597}
598 598
599/* 599/*
600 * Change rx mode (promiscous/allmulti) and update multicast list 600 * Change rx mode (promiscuous/allmulti) and update multicast list
601 */ 601 */
602static void bcm_enet_set_multicast_list(struct net_device *dev) 602static void bcm_enet_set_multicast_list(struct net_device *dev)
603{ 603{
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index f803c58b941d..66823eded7a3 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -154,7 +154,7 @@ struct be_eq_obj {
154 u16 min_eqd; /* in usecs */ 154 u16 min_eqd; /* in usecs */
155 u16 max_eqd; /* in usecs */ 155 u16 max_eqd; /* in usecs */
156 u16 cur_eqd; /* in usecs */ 156 u16 cur_eqd; /* in usecs */
157 u8 msix_vec_idx; 157 u8 eq_idx;
158 158
159 struct napi_struct napi; 159 struct napi_struct napi;
160}; 160};
@@ -291,7 +291,7 @@ struct be_adapter {
291 u32 num_rx_qs; 291 u32 num_rx_qs;
292 u32 big_page_size; /* Compounded page size shared by rx wrbs */ 292 u32 big_page_size; /* Compounded page size shared by rx wrbs */
293 293
294 u8 msix_vec_next_idx; 294 u8 eq_next_idx;
295 struct be_drv_stats drv_stats; 295 struct be_drv_stats drv_stats;
296 296
297 struct vlan_group *vlan_grp; 297 struct vlan_group *vlan_grp;
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index 5a4a87e7c5ea..1e2d825bb94a 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -1331,7 +1331,7 @@ err:
1331 1331
1332/* 1332/*
1333 * Uses MCC for this command as it may be called in BH context 1333 * Uses MCC for this command as it may be called in BH context
1334 * (mc == NULL) => multicast promiscous 1334 * (mc == NULL) => multicast promiscuous
1335 */ 1335 */
1336int be_cmd_multicast_set(struct be_adapter *adapter, u32 if_id, 1336int be_cmd_multicast_set(struct be_adapter *adapter, u32 if_id,
1337 struct net_device *netdev, struct be_dma_mem *mem) 1337 struct net_device *netdev, struct be_dma_mem *mem)
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index a71163f1e34b..7cb5a114c733 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -708,7 +708,7 @@ static void be_set_multicast_list(struct net_device *netdev)
708 goto done; 708 goto done;
709 } 709 }
710 710
711 /* BE was previously in promiscous mode; disable it */ 711 /* BE was previously in promiscuous mode; disable it */
712 if (adapter->promiscuous) { 712 if (adapter->promiscuous) {
713 adapter->promiscuous = false; 713 adapter->promiscuous = false;
714 be_cmd_promiscuous_config(adapter, adapter->port_num, 0); 714 be_cmd_promiscuous_config(adapter, adapter->port_num, 0);
@@ -1497,7 +1497,7 @@ static int be_tx_queues_create(struct be_adapter *adapter)
1497 if (be_cmd_eq_create(adapter, eq, adapter->tx_eq.cur_eqd)) 1497 if (be_cmd_eq_create(adapter, eq, adapter->tx_eq.cur_eqd))
1498 goto tx_eq_free; 1498 goto tx_eq_free;
1499 1499
1500 adapter->tx_eq.msix_vec_idx = adapter->msix_vec_next_idx++; 1500 adapter->tx_eq.eq_idx = adapter->eq_next_idx++;
1501 1501
1502 1502
1503 /* Alloc TX eth compl queue */ 1503 /* Alloc TX eth compl queue */
@@ -1590,7 +1590,7 @@ static int be_rx_queues_create(struct be_adapter *adapter)
1590 if (rc) 1590 if (rc)
1591 goto err; 1591 goto err;
1592 1592
1593 rxo->rx_eq.msix_vec_idx = adapter->msix_vec_next_idx++; 1593 rxo->rx_eq.eq_idx = adapter->eq_next_idx++;
1594 1594
1595 /* CQ */ 1595 /* CQ */
1596 cq = &rxo->cq; 1596 cq = &rxo->cq;
@@ -1666,11 +1666,11 @@ static irqreturn_t be_intx(int irq, void *dev)
1666 if (!isr) 1666 if (!isr)
1667 return IRQ_NONE; 1667 return IRQ_NONE;
1668 1668
1669 if ((1 << adapter->tx_eq.msix_vec_idx & isr)) 1669 if ((1 << adapter->tx_eq.eq_idx & isr))
1670 event_handle(adapter, &adapter->tx_eq); 1670 event_handle(adapter, &adapter->tx_eq);
1671 1671
1672 for_all_rx_queues(adapter, rxo, i) { 1672 for_all_rx_queues(adapter, rxo, i) {
1673 if ((1 << rxo->rx_eq.msix_vec_idx & isr)) 1673 if ((1 << rxo->rx_eq.eq_idx & isr))
1674 event_handle(adapter, &rxo->rx_eq); 1674 event_handle(adapter, &rxo->rx_eq);
1675 } 1675 }
1676 } 1676 }
@@ -1951,7 +1951,7 @@ static void be_sriov_disable(struct be_adapter *adapter)
1951static inline int be_msix_vec_get(struct be_adapter *adapter, 1951static inline int be_msix_vec_get(struct be_adapter *adapter,
1952 struct be_eq_obj *eq_obj) 1952 struct be_eq_obj *eq_obj)
1953{ 1953{
1954 return adapter->msix_entries[eq_obj->msix_vec_idx].vector; 1954 return adapter->msix_entries[eq_obj->eq_idx].vector;
1955} 1955}
1956 1956
1957static int be_request_irq(struct be_adapter *adapter, 1957static int be_request_irq(struct be_adapter *adapter,
@@ -2345,6 +2345,7 @@ static int be_clear(struct be_adapter *adapter)
2345 be_mcc_queues_destroy(adapter); 2345 be_mcc_queues_destroy(adapter);
2346 be_rx_queues_destroy(adapter); 2346 be_rx_queues_destroy(adapter);
2347 be_tx_queues_destroy(adapter); 2347 be_tx_queues_destroy(adapter);
2348 adapter->eq_next_idx = 0;
2348 2349
2349 if (be_physfn(adapter) && adapter->sriov_enabled) 2350 if (be_physfn(adapter) && adapter->sriov_enabled)
2350 for (vf = 0; vf < num_vfs; vf++) 2351 for (vf = 0; vf < num_vfs; vf++)
@@ -3141,12 +3142,14 @@ static int be_resume(struct pci_dev *pdev)
3141static void be_shutdown(struct pci_dev *pdev) 3142static void be_shutdown(struct pci_dev *pdev)
3142{ 3143{
3143 struct be_adapter *adapter = pci_get_drvdata(pdev); 3144 struct be_adapter *adapter = pci_get_drvdata(pdev);
3144 struct net_device *netdev = adapter->netdev;
3145 3145
3146 if (netif_running(netdev)) 3146 if (!adapter)
3147 return;
3148
3149 if (netif_running(adapter->netdev))
3147 cancel_delayed_work_sync(&adapter->work); 3150 cancel_delayed_work_sync(&adapter->work);
3148 3151
3149 netif_device_detach(netdev); 3152 netif_device_detach(adapter->netdev);
3150 3153
3151 be_cmd_reset_function(adapter); 3154 be_cmd_reset_function(adapter);
3152 3155
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index 22abfb39d813..68d45ba2d9b9 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -1237,8 +1237,17 @@ static int bfin_mac_enable(struct phy_device *phydev)
1237 1237
1238 if (phydev->interface == PHY_INTERFACE_MODE_RMII) { 1238 if (phydev->interface == PHY_INTERFACE_MODE_RMII) {
1239 opmode |= RMII; /* For Now only 100MBit are supported */ 1239 opmode |= RMII; /* For Now only 100MBit are supported */
1240#if (defined(CONFIG_BF537) || defined(CONFIG_BF536)) && CONFIG_BF_REV_0_2 1240#if defined(CONFIG_BF537) || defined(CONFIG_BF536)
1241 opmode |= TE; 1241 if (__SILICON_REVISION__ < 3) {
1242 /*
1243 * This isn't publicly documented (fun times!), but in
1244 * silicon <=0.2, the RX and TX pins are clocked together.
1245 * So in order to recv, we must enable the transmit side
1246 * as well. This will cause a spurious TX interrupt too,
1247 * but we can easily consume that.
1248 */
1249 opmode |= TE;
1250 }
1242#endif 1251#endif
1243 } 1252 }
1244 1253
diff --git a/drivers/net/bna/bfa_ioc.c b/drivers/net/bna/bfa_ioc.c
index 34933cb9569f..7581518ecfa2 100644
--- a/drivers/net/bna/bfa_ioc.c
+++ b/drivers/net/bna/bfa_ioc.c
@@ -38,6 +38,8 @@
38#define bfa_ioc_map_port(__ioc) ((__ioc)->ioc_hwif->ioc_map_port(__ioc)) 38#define bfa_ioc_map_port(__ioc) ((__ioc)->ioc_hwif->ioc_map_port(__ioc))
39#define bfa_ioc_notify_fail(__ioc) \ 39#define bfa_ioc_notify_fail(__ioc) \
40 ((__ioc)->ioc_hwif->ioc_notify_fail(__ioc)) 40 ((__ioc)->ioc_hwif->ioc_notify_fail(__ioc))
41#define bfa_ioc_sync_start(__ioc) \
42 ((__ioc)->ioc_hwif->ioc_sync_start(__ioc))
41#define bfa_ioc_sync_join(__ioc) \ 43#define bfa_ioc_sync_join(__ioc) \
42 ((__ioc)->ioc_hwif->ioc_sync_join(__ioc)) 44 ((__ioc)->ioc_hwif->ioc_sync_join(__ioc))
43#define bfa_ioc_sync_leave(__ioc) \ 45#define bfa_ioc_sync_leave(__ioc) \
@@ -602,7 +604,7 @@ bfa_iocpf_sm_fwcheck(struct bfa_iocpf *iocpf, enum iocpf_event event)
602 switch (event) { 604 switch (event) {
603 case IOCPF_E_SEMLOCKED: 605 case IOCPF_E_SEMLOCKED:
604 if (bfa_ioc_firmware_lock(ioc)) { 606 if (bfa_ioc_firmware_lock(ioc)) {
605 if (bfa_ioc_sync_complete(ioc)) { 607 if (bfa_ioc_sync_start(ioc)) {
606 iocpf->retry_count = 0; 608 iocpf->retry_count = 0;
607 bfa_ioc_sync_join(ioc); 609 bfa_ioc_sync_join(ioc);
608 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_hwinit); 610 bfa_fsm_set_state(iocpf, bfa_iocpf_sm_hwinit);
@@ -1314,7 +1316,7 @@ bfa_nw_ioc_fwver_cmp(struct bfa_ioc *ioc, struct bfi_ioc_image_hdr *fwhdr)
1314 * execution context (driver/bios) must match. 1316 * execution context (driver/bios) must match.
1315 */ 1317 */
1316static bool 1318static bool
1317bfa_ioc_fwver_valid(struct bfa_ioc *ioc) 1319bfa_ioc_fwver_valid(struct bfa_ioc *ioc, u32 boot_env)
1318{ 1320{
1319 struct bfi_ioc_image_hdr fwhdr, *drv_fwhdr; 1321 struct bfi_ioc_image_hdr fwhdr, *drv_fwhdr;
1320 1322
@@ -1325,7 +1327,7 @@ bfa_ioc_fwver_valid(struct bfa_ioc *ioc)
1325 if (fwhdr.signature != drv_fwhdr->signature) 1327 if (fwhdr.signature != drv_fwhdr->signature)
1326 return false; 1328 return false;
1327 1329
1328 if (fwhdr.exec != drv_fwhdr->exec) 1330 if (swab32(fwhdr.param) != boot_env)
1329 return false; 1331 return false;
1330 1332
1331 return bfa_nw_ioc_fwver_cmp(ioc, &fwhdr); 1333 return bfa_nw_ioc_fwver_cmp(ioc, &fwhdr);
@@ -1352,9 +1354,12 @@ bfa_ioc_hwinit(struct bfa_ioc *ioc, bool force)
1352{ 1354{
1353 enum bfi_ioc_state ioc_fwstate; 1355 enum bfi_ioc_state ioc_fwstate;
1354 bool fwvalid; 1356 bool fwvalid;
1357 u32 boot_env;
1355 1358
1356 ioc_fwstate = readl(ioc->ioc_regs.ioc_fwstate); 1359 ioc_fwstate = readl(ioc->ioc_regs.ioc_fwstate);
1357 1360
1361 boot_env = BFI_BOOT_LOADER_OS;
1362
1358 if (force) 1363 if (force)
1359 ioc_fwstate = BFI_IOC_UNINIT; 1364 ioc_fwstate = BFI_IOC_UNINIT;
1360 1365
@@ -1362,10 +1367,10 @@ bfa_ioc_hwinit(struct bfa_ioc *ioc, bool force)
1362 * check if firmware is valid 1367 * check if firmware is valid
1363 */ 1368 */
1364 fwvalid = (ioc_fwstate == BFI_IOC_UNINIT) ? 1369 fwvalid = (ioc_fwstate == BFI_IOC_UNINIT) ?
1365 false : bfa_ioc_fwver_valid(ioc); 1370 false : bfa_ioc_fwver_valid(ioc, boot_env);
1366 1371
1367 if (!fwvalid) { 1372 if (!fwvalid) {
1368 bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, ioc->pcidev.device_id); 1373 bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, boot_env);
1369 return; 1374 return;
1370 } 1375 }
1371 1376
@@ -1396,7 +1401,7 @@ bfa_ioc_hwinit(struct bfa_ioc *ioc, bool force)
1396 /** 1401 /**
1397 * Initialize the h/w for any other states. 1402 * Initialize the h/w for any other states.
1398 */ 1403 */
1399 bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, ioc->pcidev.device_id); 1404 bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, boot_env);
1400} 1405}
1401 1406
1402void 1407void
@@ -1506,7 +1511,7 @@ bfa_ioc_hb_stop(struct bfa_ioc *ioc)
1506 */ 1511 */
1507static void 1512static void
1508bfa_ioc_download_fw(struct bfa_ioc *ioc, u32 boot_type, 1513bfa_ioc_download_fw(struct bfa_ioc *ioc, u32 boot_type,
1509 u32 boot_param) 1514 u32 boot_env)
1510{ 1515{
1511 u32 *fwimg; 1516 u32 *fwimg;
1512 u32 pgnum, pgoff; 1517 u32 pgnum, pgoff;
@@ -1558,10 +1563,10 @@ bfa_ioc_download_fw(struct bfa_ioc *ioc, u32 boot_type,
1558 /* 1563 /*
1559 * Set boot type and boot param at the end. 1564 * Set boot type and boot param at the end.
1560 */ 1565 */
1561 writel((swab32(swab32(boot_type))), ((ioc->ioc_regs.smem_page_start) 1566 writel(boot_type, ((ioc->ioc_regs.smem_page_start)
1562 + (BFI_BOOT_TYPE_OFF))); 1567 + (BFI_BOOT_TYPE_OFF)));
1563 writel((swab32(swab32(boot_param))), ((ioc->ioc_regs.smem_page_start) 1568 writel(boot_env, ((ioc->ioc_regs.smem_page_start)
1564 + (BFI_BOOT_PARAM_OFF))); 1569 + (BFI_BOOT_LOADER_OFF)));
1565} 1570}
1566 1571
1567static void 1572static void
@@ -1721,7 +1726,7 @@ bfa_ioc_pll_init(struct bfa_ioc *ioc)
1721 * as the entry vector. 1726 * as the entry vector.
1722 */ 1727 */
1723static void 1728static void
1724bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_param) 1729bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_env)
1725{ 1730{
1726 void __iomem *rb; 1731 void __iomem *rb;
1727 1732
@@ -1734,7 +1739,7 @@ bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_param)
1734 * Initialize IOC state of all functions on a chip reset. 1739 * Initialize IOC state of all functions on a chip reset.
1735 */ 1740 */
1736 rb = ioc->pcidev.pci_bar_kva; 1741 rb = ioc->pcidev.pci_bar_kva;
1737 if (boot_param == BFI_BOOT_TYPE_MEMTEST) { 1742 if (boot_type == BFI_BOOT_TYPE_MEMTEST) {
1738 writel(BFI_IOC_MEMTEST, (rb + BFA_IOC0_STATE_REG)); 1743 writel(BFI_IOC_MEMTEST, (rb + BFA_IOC0_STATE_REG));
1739 writel(BFI_IOC_MEMTEST, (rb + BFA_IOC1_STATE_REG)); 1744 writel(BFI_IOC_MEMTEST, (rb + BFA_IOC1_STATE_REG));
1740 } else { 1745 } else {
@@ -1743,7 +1748,7 @@ bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_param)
1743 } 1748 }
1744 1749
1745 bfa_ioc_msgflush(ioc); 1750 bfa_ioc_msgflush(ioc);
1746 bfa_ioc_download_fw(ioc, boot_type, boot_param); 1751 bfa_ioc_download_fw(ioc, boot_type, boot_env);
1747 1752
1748 /** 1753 /**
1749 * Enable interrupts just before starting LPU 1754 * Enable interrupts just before starting LPU
@@ -2219,13 +2224,9 @@ bfa_nw_ioc_get_mac(struct bfa_ioc *ioc)
2219static void 2224static void
2220bfa_ioc_recover(struct bfa_ioc *ioc) 2225bfa_ioc_recover(struct bfa_ioc *ioc)
2221{ 2226{
2222 u16 bdf; 2227 pr_crit("Heart Beat of IOC has failed\n");
2223 2228 bfa_ioc_stats(ioc, ioc_hbfails);
2224 bdf = (ioc->pcidev.pci_slot << 8 | ioc->pcidev.pci_func << 3 | 2229 bfa_fsm_send_event(ioc, IOC_E_HBFAIL);
2225 ioc->pcidev.device_id);
2226
2227 pr_crit("Firmware heartbeat failure at %d", bdf);
2228 BUG_ON(1);
2229} 2230}
2230 2231
2231static void 2232static void
diff --git a/drivers/net/bna/bfa_ioc.h b/drivers/net/bna/bfa_ioc.h
index e4974bc24ef6..bd48abee781f 100644
--- a/drivers/net/bna/bfa_ioc.h
+++ b/drivers/net/bna/bfa_ioc.h
@@ -194,6 +194,7 @@ struct bfa_ioc_hwif {
194 bool msix); 194 bool msix);
195 void (*ioc_notify_fail) (struct bfa_ioc *ioc); 195 void (*ioc_notify_fail) (struct bfa_ioc *ioc);
196 void (*ioc_ownership_reset) (struct bfa_ioc *ioc); 196 void (*ioc_ownership_reset) (struct bfa_ioc *ioc);
197 bool (*ioc_sync_start) (struct bfa_ioc *ioc);
197 void (*ioc_sync_join) (struct bfa_ioc *ioc); 198 void (*ioc_sync_join) (struct bfa_ioc *ioc);
198 void (*ioc_sync_leave) (struct bfa_ioc *ioc); 199 void (*ioc_sync_leave) (struct bfa_ioc *ioc);
199 void (*ioc_sync_ack) (struct bfa_ioc *ioc); 200 void (*ioc_sync_ack) (struct bfa_ioc *ioc);
diff --git a/drivers/net/bna/bfa_ioc_ct.c b/drivers/net/bna/bfa_ioc_ct.c
index 469997c4ffd1..87aecdf22cf9 100644
--- a/drivers/net/bna/bfa_ioc_ct.c
+++ b/drivers/net/bna/bfa_ioc_ct.c
@@ -41,6 +41,7 @@ static void bfa_ioc_ct_map_port(struct bfa_ioc *ioc);
41static void bfa_ioc_ct_isr_mode_set(struct bfa_ioc *ioc, bool msix); 41static void bfa_ioc_ct_isr_mode_set(struct bfa_ioc *ioc, bool msix);
42static void bfa_ioc_ct_notify_fail(struct bfa_ioc *ioc); 42static void bfa_ioc_ct_notify_fail(struct bfa_ioc *ioc);
43static void bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc); 43static void bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc);
44static bool bfa_ioc_ct_sync_start(struct bfa_ioc *ioc);
44static void bfa_ioc_ct_sync_join(struct bfa_ioc *ioc); 45static void bfa_ioc_ct_sync_join(struct bfa_ioc *ioc);
45static void bfa_ioc_ct_sync_leave(struct bfa_ioc *ioc); 46static void bfa_ioc_ct_sync_leave(struct bfa_ioc *ioc);
46static void bfa_ioc_ct_sync_ack(struct bfa_ioc *ioc); 47static void bfa_ioc_ct_sync_ack(struct bfa_ioc *ioc);
@@ -63,6 +64,7 @@ bfa_nw_ioc_set_ct_hwif(struct bfa_ioc *ioc)
63 nw_hwif_ct.ioc_isr_mode_set = bfa_ioc_ct_isr_mode_set; 64 nw_hwif_ct.ioc_isr_mode_set = bfa_ioc_ct_isr_mode_set;
64 nw_hwif_ct.ioc_notify_fail = bfa_ioc_ct_notify_fail; 65 nw_hwif_ct.ioc_notify_fail = bfa_ioc_ct_notify_fail;
65 nw_hwif_ct.ioc_ownership_reset = bfa_ioc_ct_ownership_reset; 66 nw_hwif_ct.ioc_ownership_reset = bfa_ioc_ct_ownership_reset;
67 nw_hwif_ct.ioc_sync_start = bfa_ioc_ct_sync_start;
66 nw_hwif_ct.ioc_sync_join = bfa_ioc_ct_sync_join; 68 nw_hwif_ct.ioc_sync_join = bfa_ioc_ct_sync_join;
67 nw_hwif_ct.ioc_sync_leave = bfa_ioc_ct_sync_leave; 69 nw_hwif_ct.ioc_sync_leave = bfa_ioc_ct_sync_leave;
68 nw_hwif_ct.ioc_sync_ack = bfa_ioc_ct_sync_ack; 70 nw_hwif_ct.ioc_sync_ack = bfa_ioc_ct_sync_ack;
@@ -345,6 +347,32 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc)
345/** 347/**
346 * Synchronized IOC failure processing routines 348 * Synchronized IOC failure processing routines
347 */ 349 */
350static bool
351bfa_ioc_ct_sync_start(struct bfa_ioc *ioc)
352{
353 u32 r32 = readl(ioc->ioc_regs.ioc_fail_sync);
354 u32 sync_reqd = bfa_ioc_ct_get_sync_reqd(r32);
355
356 /*
357 * Driver load time. If the sync required bit for this PCI fn
358 * is set, it is due to an unclean exit by the driver for this
359 * PCI fn in the previous incarnation. Whoever comes here first
360 * should clean it up, no matter which PCI fn.
361 */
362
363 if (sync_reqd & bfa_ioc_ct_sync_pos(ioc)) {
364 writel(0, ioc->ioc_regs.ioc_fail_sync);
365 writel(1, ioc->ioc_regs.ioc_usage_reg);
366 writel(BFI_IOC_UNINIT, ioc->ioc_regs.ioc_fwstate);
367 writel(BFI_IOC_UNINIT, ioc->ioc_regs.alt_ioc_fwstate);
368 return true;
369 }
370
371 return bfa_ioc_ct_sync_complete(ioc);
372}
373/**
374 * Synchronized IOC failure processing routines
375 */
348static void 376static void
349bfa_ioc_ct_sync_join(struct bfa_ioc *ioc) 377bfa_ioc_ct_sync_join(struct bfa_ioc *ioc)
350{ 378{
diff --git a/drivers/net/bna/bfi.h b/drivers/net/bna/bfi.h
index a97396811050..6050379526f7 100644
--- a/drivers/net/bna/bfi.h
+++ b/drivers/net/bna/bfi.h
@@ -184,12 +184,14 @@ enum bfi_mclass {
184#define BFI_IOC_MSGLEN_MAX 32 /* 32 bytes */ 184#define BFI_IOC_MSGLEN_MAX 32 /* 32 bytes */
185 185
186#define BFI_BOOT_TYPE_OFF 8 186#define BFI_BOOT_TYPE_OFF 8
187#define BFI_BOOT_PARAM_OFF 12 187#define BFI_BOOT_LOADER_OFF 12
188 188
189#define BFI_BOOT_TYPE_NORMAL 0 /* param is device id */ 189#define BFI_BOOT_TYPE_NORMAL 0
190#define BFI_BOOT_TYPE_FLASH 1 190#define BFI_BOOT_TYPE_FLASH 1
191#define BFI_BOOT_TYPE_MEMTEST 2 191#define BFI_BOOT_TYPE_MEMTEST 2
192 192
193#define BFI_BOOT_LOADER_OS 0
194
193#define BFI_BOOT_MEMTEST_RES_ADDR 0x900 195#define BFI_BOOT_MEMTEST_RES_ADDR 0x900
194#define BFI_BOOT_MEMTEST_RES_SIG 0xA0A1A2A3 196#define BFI_BOOT_MEMTEST_RES_SIG 0xA0A1A2A3
195 197
diff --git a/drivers/net/bna/bna_hw.h b/drivers/net/bna/bna_hw.h
index 806b224a4c63..6cb89692f5c1 100644
--- a/drivers/net/bna/bna_hw.h
+++ b/drivers/net/bna/bna_hw.h
@@ -897,7 +897,7 @@ static struct bna_ritseg_pool_cfg name[BFI_RIT_SEG_TOTAL_POOLS] = \
897 * Catapult RSS Table Base Offset Address 897 * Catapult RSS Table Base Offset Address
898 * 898 *
899 * Exists in RAD memory space. 899 * Exists in RAD memory space.
900 * Each entry is 352 bits, but alligned on 900 * Each entry is 352 bits, but aligned on
901 * 64 byte (512 bit) boundary. Accessed 901 * 64 byte (512 bit) boundary. Accessed
902 * 4 byte words, the whole entry can be 902 * 4 byte words, the whole entry can be
903 * broken into 11 word accesses. 903 * broken into 11 word accesses.
diff --git a/drivers/net/bna/bnad.c b/drivers/net/bna/bnad.c
index 9f356d5d0f33..8e6ceab9f4d8 100644
--- a/drivers/net/bna/bnad.c
+++ b/drivers/net/bna/bnad.c
@@ -1837,7 +1837,6 @@ bnad_setup_rx(struct bnad *bnad, uint rx_id)
1837 /* Initialize the Rx event handlers */ 1837 /* Initialize the Rx event handlers */
1838 rx_cbfn.rcb_setup_cbfn = bnad_cb_rcb_setup; 1838 rx_cbfn.rcb_setup_cbfn = bnad_cb_rcb_setup;
1839 rx_cbfn.rcb_destroy_cbfn = bnad_cb_rcb_destroy; 1839 rx_cbfn.rcb_destroy_cbfn = bnad_cb_rcb_destroy;
1840 rx_cbfn.rcb_destroy_cbfn = NULL;
1841 rx_cbfn.ccb_setup_cbfn = bnad_cb_ccb_setup; 1840 rx_cbfn.ccb_setup_cbfn = bnad_cb_ccb_setup;
1842 rx_cbfn.ccb_destroy_cbfn = bnad_cb_ccb_destroy; 1841 rx_cbfn.ccb_destroy_cbfn = bnad_cb_ccb_destroy;
1843 rx_cbfn.rx_cleanup_cbfn = bnad_cb_rx_cleanup; 1842 rx_cbfn.rx_cleanup_cbfn = bnad_cb_rx_cleanup;
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index d1865cc97313..8e6d618b5305 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -8317,7 +8317,7 @@ static const struct net_device_ops bnx2_netdev_ops = {
8317#endif 8317#endif
8318}; 8318};
8319 8319
8320static void inline vlan_features_add(struct net_device *dev, u32 flags) 8320static inline void vlan_features_add(struct net_device *dev, u32 flags)
8321{ 8321{
8322 dev->vlan_features |= flags; 8322 dev->vlan_features |= flags;
8323} 8323}
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index b7ff87b35fbb..e0fca701d2f3 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -1220,7 +1220,7 @@ struct bnx2x {
1220 struct bnx2x_dcbx_port_params dcbx_port_params; 1220 struct bnx2x_dcbx_port_params dcbx_port_params;
1221 int dcb_version; 1221 int dcb_version;
1222 1222
1223 /* DCBX Negotation results */ 1223 /* DCBX Negotiation results */
1224 struct dcbx_features dcbx_local_feat; 1224 struct dcbx_features dcbx_local_feat;
1225 u32 dcbx_error; 1225 u32 dcbx_error;
1226 u32 pending_max; 1226 u32 pending_max;
diff --git a/drivers/net/bnx2x/bnx2x_ethtool.c b/drivers/net/bnx2x/bnx2x_ethtool.c
index f5050155c6b5..89cb977898cb 100644
--- a/drivers/net/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/bnx2x/bnx2x_ethtool.c
@@ -2114,19 +2114,18 @@ static int bnx2x_phys_id(struct net_device *dev, u32 data)
2114 for (i = 0; i < (data * 2); i++) { 2114 for (i = 0; i < (data * 2); i++) {
2115 if ((i % 2) == 0) 2115 if ((i % 2) == 0)
2116 bnx2x_set_led(&bp->link_params, &bp->link_vars, 2116 bnx2x_set_led(&bp->link_params, &bp->link_vars,
2117 LED_MODE_OPER, SPEED_1000); 2117 LED_MODE_ON, SPEED_1000);
2118 else 2118 else
2119 bnx2x_set_led(&bp->link_params, &bp->link_vars, 2119 bnx2x_set_led(&bp->link_params, &bp->link_vars,
2120 LED_MODE_OFF, 0); 2120 LED_MODE_FRONT_PANEL_OFF, 0);
2121 2121
2122 msleep_interruptible(500); 2122 msleep_interruptible(500);
2123 if (signal_pending(current)) 2123 if (signal_pending(current))
2124 break; 2124 break;
2125 } 2125 }
2126 2126
2127 if (bp->link_vars.link_up) 2127 bnx2x_set_led(&bp->link_params, &bp->link_vars,
2128 bnx2x_set_led(&bp->link_params, &bp->link_vars, LED_MODE_OPER, 2128 LED_MODE_OPER, bp->link_vars.line_speed);
2129 bp->link_vars.line_speed);
2130 2129
2131 return 0; 2130 return 0;
2132} 2131}
diff --git a/drivers/net/bnx2x/bnx2x_hsi.h b/drivers/net/bnx2x/bnx2x_hsi.h
index be503cc0a50b..dac1bf9cbbfa 100644
--- a/drivers/net/bnx2x/bnx2x_hsi.h
+++ b/drivers/net/bnx2x/bnx2x_hsi.h
@@ -3019,7 +3019,7 @@ struct tstorm_eth_mac_filter_config {
3019 3019
3020 3020
3021/* 3021/*
3022 * common flag to indicate existance of TPA. 3022 * common flag to indicate existence of TPA.
3023 */ 3023 */
3024struct tstorm_eth_tpa_exist { 3024struct tstorm_eth_tpa_exist {
3025#if defined(__BIG_ENDIAN) 3025#if defined(__BIG_ENDIAN)
diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c
index f2f367d4e74d..974ef2be36a5 100644
--- a/drivers/net/bnx2x/bnx2x_link.c
+++ b/drivers/net/bnx2x/bnx2x_link.c
@@ -2823,7 +2823,7 @@ static u16 bnx2x_wait_reset_complete(struct bnx2x *bp,
2823 struct link_params *params) 2823 struct link_params *params)
2824{ 2824{
2825 u16 cnt, ctrl; 2825 u16 cnt, ctrl;
2826 /* Wait for soft reset to get cleared upto 1 sec */ 2826 /* Wait for soft reset to get cleared up to 1 sec */
2827 for (cnt = 0; cnt < 1000; cnt++) { 2827 for (cnt = 0; cnt < 1000; cnt++) {
2828 bnx2x_cl45_read(bp, phy, 2828 bnx2x_cl45_read(bp, phy,
2829 MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, &ctrl); 2829 MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, &ctrl);
@@ -4141,7 +4141,7 @@ static u8 bnx2x_8073_config_init(struct bnx2x_phy *phy,
4141 val = (1<<5); 4141 val = (1<<5);
4142 /* 4142 /*
4143 * Note that 2.5G works only when used with 1G 4143 * Note that 2.5G works only when used with 1G
4144 * advertisment 4144 * advertisement
4145 */ 4145 */
4146 } else 4146 } else
4147 val = (1<<5); 4147 val = (1<<5);
@@ -4151,7 +4151,7 @@ static u8 bnx2x_8073_config_init(struct bnx2x_phy *phy,
4151 PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) 4151 PORT_HW_CFG_SPEED_CAPABILITY_D0_10G)
4152 val |= (1<<7); 4152 val |= (1<<7);
4153 4153
4154 /* Note that 2.5G works only when used with 1G advertisment */ 4154 /* Note that 2.5G works only when used with 1G advertisement */
4155 if (phy->speed_cap_mask & 4155 if (phy->speed_cap_mask &
4156 (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G | 4156 (PORT_HW_CFG_SPEED_CAPABILITY_D0_1G |
4157 PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G)) 4157 PORT_HW_CFG_SPEED_CAPABILITY_D0_2_5G))
@@ -5232,14 +5232,14 @@ static u8 bnx2x_8706_config_init(struct bnx2x_phy *phy,
5232 bnx2x_cl45_write(bp, phy, 5232 bnx2x_cl45_write(bp, phy,
5233 MDIO_PMA_DEVAD, MDIO_PMA_REG_LASI_CTRL, 1); 5233 MDIO_PMA_DEVAD, MDIO_PMA_REG_LASI_CTRL, 1);
5234 } else { 5234 } else {
5235 /* Force 1Gbps using autoneg with 1G advertisment */ 5235 /* Force 1Gbps using autoneg with 1G advertisement */
5236 5236
5237 /* Allow CL37 through CL73 */ 5237 /* Allow CL37 through CL73 */
5238 DP(NETIF_MSG_LINK, "XGXS 8706 AutoNeg\n"); 5238 DP(NETIF_MSG_LINK, "XGXS 8706 AutoNeg\n");
5239 bnx2x_cl45_write(bp, phy, 5239 bnx2x_cl45_write(bp, phy,
5240 MDIO_AN_DEVAD, MDIO_AN_REG_CL37_CL73, 0x040c); 5240 MDIO_AN_DEVAD, MDIO_AN_REG_CL37_CL73, 0x040c);
5241 5241
5242 /* Enable Full-Duplex advertisment on CL37 */ 5242 /* Enable Full-Duplex advertisement on CL37 */
5243 bnx2x_cl45_write(bp, phy, 5243 bnx2x_cl45_write(bp, phy,
5244 MDIO_AN_DEVAD, MDIO_AN_REG_CL37_FC_LP, 0x0020); 5244 MDIO_AN_DEVAD, MDIO_AN_REG_CL37_FC_LP, 0x0020);
5245 /* Enable CL37 AN */ 5245 /* Enable CL37 AN */
@@ -6269,7 +6269,7 @@ static u8 bnx2x_848x3_config_init(struct bnx2x_phy *phy,
6269 6269
6270 switch (actual_phy_selection) { 6270 switch (actual_phy_selection) {
6271 case PORT_HW_CFG_PHY_SELECTION_HARDWARE_DEFAULT: 6271 case PORT_HW_CFG_PHY_SELECTION_HARDWARE_DEFAULT:
6272 /* Do nothing. Essentialy this is like the priority copper */ 6272 /* Do nothing. Essentially this is like the priority copper */
6273 break; 6273 break;
6274 case PORT_HW_CFG_PHY_SELECTION_FIRST_PHY_PRIORITY: 6274 case PORT_HW_CFG_PHY_SELECTION_FIRST_PHY_PRIORITY:
6275 val |= MDIO_CTL_REG_84823_MEDIA_PRIORITY_COPPER; 6275 val |= MDIO_CTL_REG_84823_MEDIA_PRIORITY_COPPER;
@@ -7765,7 +7765,7 @@ u8 bnx2x_link_reset(struct link_params *params, struct link_vars *vars,
7765 REG_WR(bp, NIG_REG_NIG_EMAC0_EN + port*4, 0); 7765 REG_WR(bp, NIG_REG_NIG_EMAC0_EN + port*4, 0);
7766 7766
7767 msleep(10); 7767 msleep(10);
7768 /* The PHY reset is controled by GPIO 1 7768 /* The PHY reset is controlled by GPIO 1
7769 * Hold it as vars low 7769 * Hold it as vars low
7770 */ 7770 */
7771 /* clear link led */ 7771 /* clear link led */
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c
index 32e64cc85d2c..a97a4a1c344f 100644
--- a/drivers/net/bnx2x/bnx2x_main.c
+++ b/drivers/net/bnx2x/bnx2x_main.c
@@ -3702,7 +3702,7 @@ static void bnx2x_eq_int(struct bnx2x *bp)
3702 if ((hw_cons & EQ_DESC_MAX_PAGE) == EQ_DESC_MAX_PAGE) 3702 if ((hw_cons & EQ_DESC_MAX_PAGE) == EQ_DESC_MAX_PAGE)
3703 hw_cons++; 3703 hw_cons++;
3704 3704
3705 /* This function may never run in parralel with itself for a 3705 /* This function may never run in parallel with itself for a
3706 * specific bp, thus there is no need in "paired" read memory 3706 * specific bp, thus there is no need in "paired" read memory
3707 * barrier here. 3707 * barrier here.
3708 */ 3708 */
@@ -5089,7 +5089,7 @@ static int bnx2x_init_hw_common(struct bnx2x *bp, u32 load_code)
5089 /* Step 1: set zeroes to all ilt page entries with valid bit on 5089 /* Step 1: set zeroes to all ilt page entries with valid bit on
5090 * Step 2: set the timers first/last ilt entry to point 5090 * Step 2: set the timers first/last ilt entry to point
5091 * to the entire range to prevent ILT range error for 3rd/4th 5091 * to the entire range to prevent ILT range error for 3rd/4th
5092 * vnic (this code assumes existance of the vnic) 5092 * vnic (this code assumes existence of the vnic)
5093 * 5093 *
5094 * both steps performed by call to bnx2x_ilt_client_init_op() 5094 * both steps performed by call to bnx2x_ilt_client_init_op()
5095 * with dummy TM client 5095 * with dummy TM client
@@ -8685,7 +8685,7 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp)
8685 E1H_FUNC_MAX * sizeof(struct drv_func_mb); 8685 E1H_FUNC_MAX * sizeof(struct drv_func_mb);
8686 /* 8686 /*
8687 * get mf configuration: 8687 * get mf configuration:
8688 * 1. existance of MF configuration 8688 * 1. existence of MF configuration
8689 * 2. MAC address must be legal (check only upper bytes) 8689 * 2. MAC address must be legal (check only upper bytes)
8690 * for Switch-Independent mode; 8690 * for Switch-Independent mode;
8691 * OVLAN must be legal for Switch-Dependent mode 8691 * OVLAN must be legal for Switch-Dependent mode
@@ -8727,7 +8727,7 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp)
8727 default: 8727 default:
8728 /* Unknown configuration: reset mf_config */ 8728 /* Unknown configuration: reset mf_config */
8729 bp->mf_config[vn] = 0; 8729 bp->mf_config[vn] = 0;
8730 DP(NETIF_MSG_PROBE, "Unkown MF mode 0x%x\n", 8730 DP(NETIF_MSG_PROBE, "Unknown MF mode 0x%x\n",
8731 val); 8731 val);
8732 } 8732 }
8733 } 8733 }
@@ -9777,7 +9777,7 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev,
9777 9777
9778#endif 9778#endif
9779 9779
9780 /* Configure interupt mode: try to enable MSI-X/MSI if 9780 /* Configure interrupt mode: try to enable MSI-X/MSI if
9781 * needed, set bp->num_queues appropriately. 9781 * needed, set bp->num_queues appropriately.
9782 */ 9782 */
9783 bnx2x_set_int_mode(bp); 9783 bnx2x_set_int_mode(bp);
diff --git a/drivers/net/bnx2x/bnx2x_reg.h b/drivers/net/bnx2x/bnx2x_reg.h
index 1c89f19a4425..1509a2318af9 100644
--- a/drivers/net/bnx2x/bnx2x_reg.h
+++ b/drivers/net/bnx2x/bnx2x_reg.h
@@ -175,9 +175,9 @@
175 the initial credit value; read returns the current value of the credit 175 the initial credit value; read returns the current value of the credit
176 counter. Must be initialized to 1 at start-up. */ 176 counter. Must be initialized to 1 at start-up. */
177#define CCM_REG_CFC_INIT_CRD 0xd0204 177#define CCM_REG_CFC_INIT_CRD 0xd0204
178/* [RW 2] Auxillary counter flag Q number 1. */ 178/* [RW 2] Auxiliary counter flag Q number 1. */
179#define CCM_REG_CNT_AUX1_Q 0xd00c8 179#define CCM_REG_CNT_AUX1_Q 0xd00c8
180/* [RW 2] Auxillary counter flag Q number 2. */ 180/* [RW 2] Auxiliary counter flag Q number 2. */
181#define CCM_REG_CNT_AUX2_Q 0xd00cc 181#define CCM_REG_CNT_AUX2_Q 0xd00cc
182/* [RW 28] The CM header value for QM request (primary). */ 182/* [RW 28] The CM header value for QM request (primary). */
183#define CCM_REG_CQM_CCM_HDR_P 0xd008c 183#define CCM_REG_CQM_CCM_HDR_P 0xd008c
@@ -457,13 +457,13 @@
457#define CSDM_REG_AGG_INT_MODE_9 0xc21dc 457#define CSDM_REG_AGG_INT_MODE_9 0xc21dc
458/* [RW 13] The start address in the internal RAM for the cfc_rsp lcid */ 458/* [RW 13] The start address in the internal RAM for the cfc_rsp lcid */
459#define CSDM_REG_CFC_RSP_START_ADDR 0xc2008 459#define CSDM_REG_CFC_RSP_START_ADDR 0xc2008
460/* [RW 16] The maximum value of the competion counter #0 */ 460/* [RW 16] The maximum value of the completion counter #0 */
461#define CSDM_REG_CMP_COUNTER_MAX0 0xc201c 461#define CSDM_REG_CMP_COUNTER_MAX0 0xc201c
462/* [RW 16] The maximum value of the competion counter #1 */ 462/* [RW 16] The maximum value of the completion counter #1 */
463#define CSDM_REG_CMP_COUNTER_MAX1 0xc2020 463#define CSDM_REG_CMP_COUNTER_MAX1 0xc2020
464/* [RW 16] The maximum value of the competion counter #2 */ 464/* [RW 16] The maximum value of the completion counter #2 */
465#define CSDM_REG_CMP_COUNTER_MAX2 0xc2024 465#define CSDM_REG_CMP_COUNTER_MAX2 0xc2024
466/* [RW 16] The maximum value of the competion counter #3 */ 466/* [RW 16] The maximum value of the completion counter #3 */
467#define CSDM_REG_CMP_COUNTER_MAX3 0xc2028 467#define CSDM_REG_CMP_COUNTER_MAX3 0xc2028
468/* [RW 13] The start address in the internal RAM for the completion 468/* [RW 13] The start address in the internal RAM for the completion
469 counters. */ 469 counters. */
@@ -851,7 +851,7 @@
851#define IGU_REG_ATTN_MSG_ADDR_L 0x130120 851#define IGU_REG_ATTN_MSG_ADDR_L 0x130120
852/* [R 4] Debug: [3] - attention write done message is pending (0-no pending; 852/* [R 4] Debug: [3] - attention write done message is pending (0-no pending;
853 * 1-pending). [2:0] = PFID. Pending means attention message was sent; but 853 * 1-pending). [2:0] = PFID. Pending means attention message was sent; but
854 * write done didnt receive. */ 854 * write done didn't receive. */
855#define IGU_REG_ATTN_WRITE_DONE_PENDING 0x130030 855#define IGU_REG_ATTN_WRITE_DONE_PENDING 0x130030
856#define IGU_REG_BLOCK_CONFIGURATION 0x130000 856#define IGU_REG_BLOCK_CONFIGURATION 0x130000
857#define IGU_REG_COMMAND_REG_32LSB_DATA 0x130124 857#define IGU_REG_COMMAND_REG_32LSB_DATA 0x130124
@@ -862,7 +862,7 @@
862#define IGU_REG_CSTORM_TYPE_0_SB_CLEANUP 0x130200 862#define IGU_REG_CSTORM_TYPE_0_SB_CLEANUP 0x130200
863/* [R 5] Debug: ctrl_fsm */ 863/* [R 5] Debug: ctrl_fsm */
864#define IGU_REG_CTRL_FSM 0x130064 864#define IGU_REG_CTRL_FSM 0x130064
865/* [R 1] data availble for error memory. If this bit is clear do not red 865/* [R 1] data available for error memory. If this bit is clear do not red
866 * from error_handling_memory. */ 866 * from error_handling_memory. */
867#define IGU_REG_ERROR_HANDLING_DATA_VALID 0x130130 867#define IGU_REG_ERROR_HANDLING_DATA_VALID 0x130130
868/* [RW 11] Parity mask register #0 read/write */ 868/* [RW 11] Parity mask register #0 read/write */
@@ -3015,7 +3015,7 @@
3015 block. Should be used for close the gates. */ 3015 block. Should be used for close the gates. */
3016#define PXP_REG_HST_DISCARD_DOORBELLS 0x1030a4 3016#define PXP_REG_HST_DISCARD_DOORBELLS 0x1030a4
3017/* [R 1] debug only: '1' means this PSWHST is discarding doorbells. This bit 3017/* [R 1] debug only: '1' means this PSWHST is discarding doorbells. This bit
3018 should update accoring to 'hst_discard_doorbells' register when the state 3018 should update according to 'hst_discard_doorbells' register when the state
3019 machine is idle */ 3019 machine is idle */
3020#define PXP_REG_HST_DISCARD_DOORBELLS_STATUS 0x1030a0 3020#define PXP_REG_HST_DISCARD_DOORBELLS_STATUS 0x1030a0
3021/* [RW 1] When 1; new internal writes arriving to the block are discarded. 3021/* [RW 1] When 1; new internal writes arriving to the block are discarded.
@@ -3023,7 +3023,7 @@
3023#define PXP_REG_HST_DISCARD_INTERNAL_WRITES 0x1030a8 3023#define PXP_REG_HST_DISCARD_INTERNAL_WRITES 0x1030a8
3024/* [R 6] debug only: A bit mask for all PSWHST internal write clients. '1' 3024/* [R 6] debug only: A bit mask for all PSWHST internal write clients. '1'
3025 means this PSWHST is discarding inputs from this client. Each bit should 3025 means this PSWHST is discarding inputs from this client. Each bit should
3026 update accoring to 'hst_discard_internal_writes' register when the state 3026 update according to 'hst_discard_internal_writes' register when the state
3027 machine is idle. */ 3027 machine is idle. */
3028#define PXP_REG_HST_DISCARD_INTERNAL_WRITES_STATUS 0x10309c 3028#define PXP_REG_HST_DISCARD_INTERNAL_WRITES_STATUS 0x10309c
3029/* [WB 160] Used for initialization of the inbound interrupts memory */ 3029/* [WB 160] Used for initialization of the inbound interrupts memory */
@@ -3822,13 +3822,13 @@
3822#define TSDM_REG_AGG_INT_T_1 0x420bc 3822#define TSDM_REG_AGG_INT_T_1 0x420bc
3823/* [RW 13] The start address in the internal RAM for the cfc_rsp lcid */ 3823/* [RW 13] The start address in the internal RAM for the cfc_rsp lcid */
3824#define TSDM_REG_CFC_RSP_START_ADDR 0x42008 3824#define TSDM_REG_CFC_RSP_START_ADDR 0x42008
3825/* [RW 16] The maximum value of the competion counter #0 */ 3825/* [RW 16] The maximum value of the completion counter #0 */
3826#define TSDM_REG_CMP_COUNTER_MAX0 0x4201c 3826#define TSDM_REG_CMP_COUNTER_MAX0 0x4201c
3827/* [RW 16] The maximum value of the competion counter #1 */ 3827/* [RW 16] The maximum value of the completion counter #1 */
3828#define TSDM_REG_CMP_COUNTER_MAX1 0x42020 3828#define TSDM_REG_CMP_COUNTER_MAX1 0x42020
3829/* [RW 16] The maximum value of the competion counter #2 */ 3829/* [RW 16] The maximum value of the completion counter #2 */
3830#define TSDM_REG_CMP_COUNTER_MAX2 0x42024 3830#define TSDM_REG_CMP_COUNTER_MAX2 0x42024
3831/* [RW 16] The maximum value of the competion counter #3 */ 3831/* [RW 16] The maximum value of the completion counter #3 */
3832#define TSDM_REG_CMP_COUNTER_MAX3 0x42028 3832#define TSDM_REG_CMP_COUNTER_MAX3 0x42028
3833/* [RW 13] The start address in the internal RAM for the completion 3833/* [RW 13] The start address in the internal RAM for the completion
3834 counters. */ 3834 counters. */
@@ -4284,13 +4284,13 @@
4284#define USDM_REG_AGG_INT_T_6 0xc40d0 4284#define USDM_REG_AGG_INT_T_6 0xc40d0
4285/* [RW 13] The start address in the internal RAM for the cfc_rsp lcid */ 4285/* [RW 13] The start address in the internal RAM for the cfc_rsp lcid */
4286#define USDM_REG_CFC_RSP_START_ADDR 0xc4008 4286#define USDM_REG_CFC_RSP_START_ADDR 0xc4008
4287/* [RW 16] The maximum value of the competion counter #0 */ 4287/* [RW 16] The maximum value of the completion counter #0 */
4288#define USDM_REG_CMP_COUNTER_MAX0 0xc401c 4288#define USDM_REG_CMP_COUNTER_MAX0 0xc401c
4289/* [RW 16] The maximum value of the competion counter #1 */ 4289/* [RW 16] The maximum value of the completion counter #1 */
4290#define USDM_REG_CMP_COUNTER_MAX1 0xc4020 4290#define USDM_REG_CMP_COUNTER_MAX1 0xc4020
4291/* [RW 16] The maximum value of the competion counter #2 */ 4291/* [RW 16] The maximum value of the completion counter #2 */
4292#define USDM_REG_CMP_COUNTER_MAX2 0xc4024 4292#define USDM_REG_CMP_COUNTER_MAX2 0xc4024
4293/* [RW 16] The maximum value of the competion counter #3 */ 4293/* [RW 16] The maximum value of the completion counter #3 */
4294#define USDM_REG_CMP_COUNTER_MAX3 0xc4028 4294#define USDM_REG_CMP_COUNTER_MAX3 0xc4028
4295/* [RW 13] The start address in the internal RAM for the completion 4295/* [RW 13] The start address in the internal RAM for the completion
4296 counters. */ 4296 counters. */
@@ -4798,13 +4798,13 @@
4798#define XSDM_REG_AGG_INT_MODE_1 0x1661bc 4798#define XSDM_REG_AGG_INT_MODE_1 0x1661bc
4799/* [RW 13] The start address in the internal RAM for the cfc_rsp lcid */ 4799/* [RW 13] The start address in the internal RAM for the cfc_rsp lcid */
4800#define XSDM_REG_CFC_RSP_START_ADDR 0x166008 4800#define XSDM_REG_CFC_RSP_START_ADDR 0x166008
4801/* [RW 16] The maximum value of the competion counter #0 */ 4801/* [RW 16] The maximum value of the completion counter #0 */
4802#define XSDM_REG_CMP_COUNTER_MAX0 0x16601c 4802#define XSDM_REG_CMP_COUNTER_MAX0 0x16601c
4803/* [RW 16] The maximum value of the competion counter #1 */ 4803/* [RW 16] The maximum value of the completion counter #1 */
4804#define XSDM_REG_CMP_COUNTER_MAX1 0x166020 4804#define XSDM_REG_CMP_COUNTER_MAX1 0x166020
4805/* [RW 16] The maximum value of the competion counter #2 */ 4805/* [RW 16] The maximum value of the completion counter #2 */
4806#define XSDM_REG_CMP_COUNTER_MAX2 0x166024 4806#define XSDM_REG_CMP_COUNTER_MAX2 0x166024
4807/* [RW 16] The maximum value of the competion counter #3 */ 4807/* [RW 16] The maximum value of the completion counter #3 */
4808#define XSDM_REG_CMP_COUNTER_MAX3 0x166028 4808#define XSDM_REG_CMP_COUNTER_MAX3 0x166028
4809/* [RW 13] The start address in the internal RAM for the completion 4809/* [RW 13] The start address in the internal RAM for the completion
4810 counters. */ 4810 counters. */
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index 9bc5de3e04a8..ba715826e2a8 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -176,7 +176,7 @@ static int tlb_initialize(struct bonding *bond)
176 bond_info->tx_hashtbl = new_hashtbl; 176 bond_info->tx_hashtbl = new_hashtbl;
177 177
178 for (i = 0; i < TLB_HASH_TABLE_SIZE; i++) { 178 for (i = 0; i < TLB_HASH_TABLE_SIZE; i++) {
179 tlb_init_table_entry(&bond_info->tx_hashtbl[i], 1); 179 tlb_init_table_entry(&bond_info->tx_hashtbl[i], 0);
180 } 180 }
181 181
182 _unlock_tx_hashtbl(bond); 182 _unlock_tx_hashtbl(bond);
@@ -701,7 +701,7 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond)
701 */ 701 */
702 rlb_choose_channel(skb, bond); 702 rlb_choose_channel(skb, bond);
703 703
704 /* The ARP relpy packets must be delayed so that 704 /* The ARP reply packets must be delayed so that
705 * they can cancel out the influence of the ARP request. 705 * they can cancel out the influence of the ARP request.
706 */ 706 */
707 bond->alb_info.rlb_update_delay_counter = RLB_UPDATE_DELAY; 707 bond->alb_info.rlb_update_delay_counter = RLB_UPDATE_DELAY;
@@ -1042,7 +1042,7 @@ static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *sla
1042 * 1042 *
1043 * If the permanent hw address of @slave is @bond's hw address, we need to 1043 * If the permanent hw address of @slave is @bond's hw address, we need to
1044 * find a different hw address to give @slave, that isn't in use by any other 1044 * find a different hw address to give @slave, that isn't in use by any other
1045 * slave in the bond. This address must be, of course, one of the premanent 1045 * slave in the bond. This address must be, of course, one of the permanent
1046 * addresses of the other slaves. 1046 * addresses of the other slaves.
1047 * 1047 *
1048 * We go over the slave list, and for each slave there we compare its 1048 * We go over the slave list, and for each slave there we compare its
diff --git a/drivers/net/bonding/bond_alb.h b/drivers/net/bonding/bond_alb.h
index 118c28aa471e..8ca7158b2dda 100644
--- a/drivers/net/bonding/bond_alb.h
+++ b/drivers/net/bonding/bond_alb.h
@@ -74,9 +74,9 @@ struct tlb_client_info {
74 * packets to a Client that the Hash function 74 * packets to a Client that the Hash function
75 * gave this entry index. 75 * gave this entry index.
76 */ 76 */
77 u32 tx_bytes; /* Each Client acumulates the BytesTx that 77 u32 tx_bytes; /* Each Client accumulates the BytesTx that
78 * were tranmitted to it, and after each 78 * were transmitted to it, and after each
79 * CallBack the LoadHistory is devided 79 * CallBack the LoadHistory is divided
80 * by the balance interval 80 * by the balance interval
81 */ 81 */
82 u32 load_history; /* This field contains the amount of Bytes 82 u32 load_history; /* This field contains the amount of Bytes
@@ -122,7 +122,6 @@ struct tlb_slave_info {
122}; 122};
123 123
124struct alb_bond_info { 124struct alb_bond_info {
125 struct timer_list alb_timer;
126 struct tlb_client_info *tx_hashtbl; /* Dynamically allocated */ 125 struct tlb_client_info *tx_hashtbl; /* Dynamically allocated */
127 spinlock_t tx_hashtbl_lock; 126 spinlock_t tx_hashtbl_lock;
128 u32 unbalanced_load; 127 u32 unbalanced_load;
@@ -140,7 +139,6 @@ struct alb_bond_info {
140 struct slave *next_rx_slave;/* next slave to be assigned 139 struct slave *next_rx_slave;/* next slave to be assigned
141 * to a new rx client for 140 * to a new rx client for
142 */ 141 */
143 u32 rlb_interval_counter;
144 u8 primary_is_promisc; /* boolean */ 142 u8 primary_is_promisc; /* boolean */
145 u32 rlb_promisc_timeout_counter;/* counts primary 143 u32 rlb_promisc_timeout_counter;/* counts primary
146 * promiscuity time 144 * promiscuity time
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 1a6e9eb7af43..16d6fe954695 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1482,21 +1482,16 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1482{ 1482{
1483 struct sk_buff *skb = *pskb; 1483 struct sk_buff *skb = *pskb;
1484 struct slave *slave; 1484 struct slave *slave;
1485 struct net_device *bond_dev;
1486 struct bonding *bond; 1485 struct bonding *bond;
1487 1486
1488 slave = bond_slave_get_rcu(skb->dev);
1489 bond_dev = ACCESS_ONCE(slave->dev->master);
1490 if (unlikely(!bond_dev))
1491 return RX_HANDLER_PASS;
1492
1493 skb = skb_share_check(skb, GFP_ATOMIC); 1487 skb = skb_share_check(skb, GFP_ATOMIC);
1494 if (unlikely(!skb)) 1488 if (unlikely(!skb))
1495 return RX_HANDLER_CONSUMED; 1489 return RX_HANDLER_CONSUMED;
1496 1490
1497 *pskb = skb; 1491 *pskb = skb;
1498 1492
1499 bond = netdev_priv(bond_dev); 1493 slave = bond_slave_get_rcu(skb->dev);
1494 bond = slave->bond;
1500 1495
1501 if (bond->params.arp_interval) 1496 if (bond->params.arp_interval)
1502 slave->dev->last_rx = jiffies; 1497 slave->dev->last_rx = jiffies;
@@ -1505,10 +1500,10 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1505 return RX_HANDLER_EXACT; 1500 return RX_HANDLER_EXACT;
1506 } 1501 }
1507 1502
1508 skb->dev = bond_dev; 1503 skb->dev = bond->dev;
1509 1504
1510 if (bond->params.mode == BOND_MODE_ALB && 1505 if (bond->params.mode == BOND_MODE_ALB &&
1511 bond_dev->priv_flags & IFF_BRIDGE_PORT && 1506 bond->dev->priv_flags & IFF_BRIDGE_PORT &&
1512 skb->pkt_type == PACKET_HOST) { 1507 skb->pkt_type == PACKET_HOST) {
1513 1508
1514 if (unlikely(skb_cow_head(skb, 1509 if (unlikely(skb_cow_head(skb,
@@ -1516,7 +1511,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1516 kfree_skb(skb); 1511 kfree_skb(skb);
1517 return RX_HANDLER_CONSUMED; 1512 return RX_HANDLER_CONSUMED;
1518 } 1513 }
1519 memcpy(eth_hdr(skb)->h_dest, bond_dev->dev_addr, ETH_ALEN); 1514 memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN);
1520 } 1515 }
1521 1516
1522 return RX_HANDLER_ANOTHER; 1517 return RX_HANDLER_ANOTHER;
@@ -1698,20 +1693,15 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1698 pr_debug("Error %d calling netdev_set_bond_master\n", res); 1693 pr_debug("Error %d calling netdev_set_bond_master\n", res);
1699 goto err_restore_mac; 1694 goto err_restore_mac;
1700 } 1695 }
1701 res = netdev_rx_handler_register(slave_dev, bond_handle_frame,
1702 new_slave);
1703 if (res) {
1704 pr_debug("Error %d calling netdev_rx_handler_register\n", res);
1705 goto err_unset_master;
1706 }
1707 1696
1708 /* open the slave since the application closed it */ 1697 /* open the slave since the application closed it */
1709 res = dev_open(slave_dev); 1698 res = dev_open(slave_dev);
1710 if (res) { 1699 if (res) {
1711 pr_debug("Opening slave %s failed\n", slave_dev->name); 1700 pr_debug("Opening slave %s failed\n", slave_dev->name);
1712 goto err_unreg_rxhandler; 1701 goto err_unset_master;
1713 } 1702 }
1714 1703
1704 new_slave->bond = bond;
1715 new_slave->dev = slave_dev; 1705 new_slave->dev = slave_dev;
1716 slave_dev->priv_flags |= IFF_BONDING; 1706 slave_dev->priv_flags |= IFF_BONDING;
1717 1707
@@ -1907,6 +1897,13 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1907 if (res) 1897 if (res)
1908 goto err_close; 1898 goto err_close;
1909 1899
1900 res = netdev_rx_handler_register(slave_dev, bond_handle_frame,
1901 new_slave);
1902 if (res) {
1903 pr_debug("Error %d calling netdev_rx_handler_register\n", res);
1904 goto err_dest_symlinks;
1905 }
1906
1910 pr_info("%s: enslaving %s as a%s interface with a%s link.\n", 1907 pr_info("%s: enslaving %s as a%s interface with a%s link.\n",
1911 bond_dev->name, slave_dev->name, 1908 bond_dev->name, slave_dev->name,
1912 bond_is_active_slave(new_slave) ? "n active" : " backup", 1909 bond_is_active_slave(new_slave) ? "n active" : " backup",
@@ -1916,13 +1913,12 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1916 return 0; 1913 return 0;
1917 1914
1918/* Undo stages on error */ 1915/* Undo stages on error */
1916err_dest_symlinks:
1917 bond_destroy_slave_symlinks(bond_dev, slave_dev);
1918
1919err_close: 1919err_close:
1920 dev_close(slave_dev); 1920 dev_close(slave_dev);
1921 1921
1922err_unreg_rxhandler:
1923 netdev_rx_handler_unregister(slave_dev);
1924 synchronize_net();
1925
1926err_unset_master: 1922err_unset_master:
1927 netdev_set_bond_master(slave_dev, NULL); 1923 netdev_set_bond_master(slave_dev, NULL);
1928 1924
@@ -1988,6 +1984,14 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
1988 return -EINVAL; 1984 return -EINVAL;
1989 } 1985 }
1990 1986
1987 /* unregister rx_handler early so bond_handle_frame wouldn't be called
1988 * for this slave anymore.
1989 */
1990 netdev_rx_handler_unregister(slave_dev);
1991 write_unlock_bh(&bond->lock);
1992 synchronize_net();
1993 write_lock_bh(&bond->lock);
1994
1991 if (!bond->params.fail_over_mac) { 1995 if (!bond->params.fail_over_mac) {
1992 if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) && 1996 if (!compare_ether_addr(bond_dev->dev_addr, slave->perm_hwaddr) &&
1993 bond->slave_cnt > 1) 1997 bond->slave_cnt > 1)
@@ -2104,8 +2108,6 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
2104 netif_addr_unlock_bh(bond_dev); 2108 netif_addr_unlock_bh(bond_dev);
2105 } 2109 }
2106 2110
2107 netdev_rx_handler_unregister(slave_dev);
2108 synchronize_net();
2109 netdev_set_bond_master(slave_dev, NULL); 2111 netdev_set_bond_master(slave_dev, NULL);
2110 2112
2111 slave_disable_netpoll(slave); 2113 slave_disable_netpoll(slave);
@@ -2130,7 +2132,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
2130} 2132}
2131 2133
2132/* 2134/*
2133* First release a slave and than destroy the bond if no more slaves are left. 2135* First release a slave and then destroy the bond if no more slaves are left.
2134* Must be under rtnl_lock when this function is called. 2136* Must be under rtnl_lock when this function is called.
2135*/ 2137*/
2136static int bond_release_and_destroy(struct net_device *bond_dev, 2138static int bond_release_and_destroy(struct net_device *bond_dev,
@@ -2186,6 +2188,12 @@ static int bond_release_all(struct net_device *bond_dev)
2186 */ 2188 */
2187 write_unlock_bh(&bond->lock); 2189 write_unlock_bh(&bond->lock);
2188 2190
2191 /* unregister rx_handler early so bond_handle_frame wouldn't
2192 * be called for this slave anymore.
2193 */
2194 netdev_rx_handler_unregister(slave_dev);
2195 synchronize_net();
2196
2189 if (bond_is_lb(bond)) { 2197 if (bond_is_lb(bond)) {
2190 /* must be called only after the slave 2198 /* must be called only after the slave
2191 * has been detached from the list 2199 * has been detached from the list
@@ -2217,8 +2225,6 @@ static int bond_release_all(struct net_device *bond_dev)
2217 netif_addr_unlock_bh(bond_dev); 2225 netif_addr_unlock_bh(bond_dev);
2218 } 2226 }
2219 2227
2220 netdev_rx_handler_unregister(slave_dev);
2221 synchronize_net();
2222 netdev_set_bond_master(slave_dev, NULL); 2228 netdev_set_bond_master(slave_dev, NULL);
2223 2229
2224 slave_disable_netpoll(slave); 2230 slave_disable_netpoll(slave);
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 6b26962fd0ec..90736cb4d975 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -187,6 +187,7 @@ struct slave {
187 struct net_device *dev; /* first - useful for panic debug */ 187 struct net_device *dev; /* first - useful for panic debug */
188 struct slave *next; 188 struct slave *next;
189 struct slave *prev; 189 struct slave *prev;
190 struct bonding *bond; /* our master */
190 int delay; 191 int delay;
191 unsigned long jiffies; 192 unsigned long jiffies;
192 unsigned long last_arp_rx; 193 unsigned long last_arp_rx;
diff --git a/drivers/net/caif/Makefile b/drivers/net/caif/Makefile
index b38d987da67d..9560b9d624bd 100644
--- a/drivers/net/caif/Makefile
+++ b/drivers/net/caif/Makefile
@@ -1,6 +1,4 @@
1ifeq ($(CONFIG_CAIF_DEBUG),y) 1ccflags-$(CONFIG_CAIF_DEBUG) := -DDEBUG
2EXTRA_CFLAGS += -DDEBUG
3endif
4 2
5# Serial interface 3# Serial interface
6obj-$(CONFIG_CAIF_TTY) += caif_serial.o 4obj-$(CONFIG_CAIF_TTY) += caif_serial.o
diff --git a/drivers/net/caif/caif_shmcore.c b/drivers/net/caif/caif_shmcore.c
index 80511167f35b..731aa1193770 100644
--- a/drivers/net/caif/caif_shmcore.c
+++ b/drivers/net/caif/caif_shmcore.c
@@ -591,7 +591,7 @@ int caif_shmcore_probe(struct shmdev_layer *pshm_dev)
591 (NR_TX_BUF * TX_BUF_SZ + NR_RX_BUF * RX_BUF_SZ)) { 591 (NR_TX_BUF * TX_BUF_SZ + NR_RX_BUF * RX_BUF_SZ)) {
592 592
593 pr_warn("ERROR, Amount of available" 593 pr_warn("ERROR, Amount of available"
594 " Phys. SHM cannot accomodate current SHM " 594 " Phys. SHM cannot accommodate current SHM "
595 "driver configuration, Bailing out ...\n"); 595 "driver configuration, Bailing out ...\n");
596 free_netdev(pshm_dev->pshm_netdev); 596 free_netdev(pshm_dev->pshm_netdev);
597 return -ENOMEM; 597 return -ENOMEM;
diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index 20da1996d354..57e639373815 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -397,7 +397,7 @@ int cfspi_xmitlen(struct cfspi *cfspi)
397 int pkts = 0; 397 int pkts = 0;
398 398
399 /* 399 /*
400 * Decommit previously commited frames. 400 * Decommit previously committed frames.
401 * skb_queue_splice_tail(&cfspi->chead,&cfspi->qhead) 401 * skb_queue_splice_tail(&cfspi->chead,&cfspi->qhead)
402 */ 402 */
403 while (skb_peek(&cfspi->chead)) { 403 while (skb_peek(&cfspi->chead)) {
diff --git a/drivers/net/caif/caif_spi_slave.c b/drivers/net/caif/caif_spi_slave.c
index 1b9943a4edab..b009e03cda9e 100644
--- a/drivers/net/caif/caif_spi_slave.c
+++ b/drivers/net/caif/caif_spi_slave.c
@@ -98,7 +98,7 @@ void cfspi_xfer(struct work_struct *work)
98 98
99 cfspi_dbg_state(cfspi, CFSPI_STATE_FETCH_PKT); 99 cfspi_dbg_state(cfspi, CFSPI_STATE_FETCH_PKT);
100 100
101 /* Copy commited SPI frames after the SPI indication. */ 101 /* Copy committed SPI frames after the SPI indication. */
102 ptr = (u8 *) cfspi->xfer.va_tx; 102 ptr = (u8 *) cfspi->xfer.va_tx;
103 ptr += SPI_IND_SZ; 103 ptr += SPI_IND_SZ;
104 len = cfspi_xmitfrm(cfspi, ptr, cfspi->tx_cpck_len); 104 len = cfspi_xmitfrm(cfspi, ptr, cfspi->tx_cpck_len);
@@ -158,7 +158,7 @@ void cfspi_xfer(struct work_struct *work)
158 158
159 cfspi_dbg_state(cfspi, CFSPI_STATE_SIG_ACTIVE); 159 cfspi_dbg_state(cfspi, CFSPI_STATE_SIG_ACTIVE);
160 160
161 /* Signal that we are ready to recieve data. */ 161 /* Signal that we are ready to receive data. */
162 cfspi->dev->sig_xfer(true, cfspi->dev); 162 cfspi->dev->sig_xfer(true, cfspi->dev);
163 163
164 cfspi_dbg_state(cfspi, CFSPI_STATE_WAIT_XFER_DONE); 164 cfspi_dbg_state(cfspi, CFSPI_STATE_WAIT_XFER_DONE);
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
index 57d2ffbbb433..74efb5a2ad41 100644
--- a/drivers/net/can/at91_can.c
+++ b/drivers/net/can/at91_can.c
@@ -416,7 +416,7 @@ static netdev_tx_t at91_start_xmit(struct sk_buff *skb, struct net_device *dev)
416 416
417 stats->tx_bytes += cf->can_dlc; 417 stats->tx_bytes += cf->can_dlc;
418 418
419 /* _NOTE_: substract AT91_MB_TX_FIRST offset from mb! */ 419 /* _NOTE_: subtract AT91_MB_TX_FIRST offset from mb! */
420 can_put_echo_skb(skb, dev, mb - AT91_MB_TX_FIRST); 420 can_put_echo_skb(skb, dev, mb - AT91_MB_TX_FIRST);
421 421
422 /* 422 /*
@@ -782,7 +782,7 @@ static void at91_irq_tx(struct net_device *dev, u32 reg_sr)
782 reg_msr = at91_read(priv, AT91_MSR(mb)); 782 reg_msr = at91_read(priv, AT91_MSR(mb));
783 if (likely(reg_msr & AT91_MSR_MRDY && 783 if (likely(reg_msr & AT91_MSR_MRDY &&
784 ~reg_msr & AT91_MSR_MABT)) { 784 ~reg_msr & AT91_MSR_MABT)) {
785 /* _NOTE_: substract AT91_MB_TX_FIRST offset from mb! */ 785 /* _NOTE_: subtract AT91_MB_TX_FIRST offset from mb! */
786 can_get_echo_skb(dev, mb - AT91_MB_TX_FIRST); 786 can_get_echo_skb(dev, mb - AT91_MB_TX_FIRST);
787 dev->stats.tx_packets++; 787 dev->stats.tx_packets++;
788 } 788 }
diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c
index 14050786218a..7e5cc0bd913d 100644
--- a/drivers/net/can/c_can/c_can.c
+++ b/drivers/net/can/c_can/c_can.c
@@ -588,14 +588,9 @@ static void c_can_chip_config(struct net_device *dev)
588{ 588{
589 struct c_can_priv *priv = netdev_priv(dev); 589 struct c_can_priv *priv = netdev_priv(dev);
590 590
591 if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT) 591 /* enable automatic retransmission */
592 /* disable automatic retransmission */ 592 priv->write_reg(priv, &priv->regs->control,
593 priv->write_reg(priv, &priv->regs->control, 593 CONTROL_ENABLE_AR);
594 CONTROL_DISABLE_AR);
595 else
596 /* enable automatic retransmission */
597 priv->write_reg(priv, &priv->regs->control,
598 CONTROL_ENABLE_AR);
599 594
600 if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY & 595 if (priv->can.ctrlmode & (CAN_CTRLMODE_LISTENONLY &
601 CAN_CTRLMODE_LOOPBACK)) { 596 CAN_CTRLMODE_LOOPBACK)) {
@@ -633,9 +628,6 @@ static void c_can_start(struct net_device *dev)
633{ 628{
634 struct c_can_priv *priv = netdev_priv(dev); 629 struct c_can_priv *priv = netdev_priv(dev);
635 630
636 /* enable status change, error and module interrupts */
637 c_can_enable_all_interrupts(priv, ENABLE_ALL_INTERRUPTS);
638
639 /* basic c_can configuration */ 631 /* basic c_can configuration */
640 c_can_chip_config(dev); 632 c_can_chip_config(dev);
641 633
@@ -643,6 +635,9 @@ static void c_can_start(struct net_device *dev)
643 635
644 /* reset tx helper pointers */ 636 /* reset tx helper pointers */
645 priv->tx_next = priv->tx_echo = 0; 637 priv->tx_next = priv->tx_echo = 0;
638
639 /* enable status change, error and module interrupts */
640 c_can_enable_all_interrupts(priv, ENABLE_ALL_INTERRUPTS);
646} 641}
647 642
648static void c_can_stop(struct net_device *dev) 643static void c_can_stop(struct net_device *dev)
@@ -704,7 +699,6 @@ static void c_can_do_tx(struct net_device *dev)
704 699
705 for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) { 700 for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) {
706 msg_obj_no = get_tx_echo_msg_obj(priv); 701 msg_obj_no = get_tx_echo_msg_obj(priv);
707 c_can_inval_msg_object(dev, 0, msg_obj_no);
708 val = c_can_read_reg32(priv, &priv->regs->txrqst1); 702 val = c_can_read_reg32(priv, &priv->regs->txrqst1);
709 if (!(val & (1 << msg_obj_no))) { 703 if (!(val & (1 << msg_obj_no))) {
710 can_get_echo_skb(dev, 704 can_get_echo_skb(dev,
@@ -713,6 +707,7 @@ static void c_can_do_tx(struct net_device *dev)
713 &priv->regs->ifregs[0].msg_cntrl) 707 &priv->regs->ifregs[0].msg_cntrl)
714 & IF_MCONT_DLC_MASK; 708 & IF_MCONT_DLC_MASK;
715 stats->tx_packets++; 709 stats->tx_packets++;
710 c_can_inval_msg_object(dev, 0, msg_obj_no);
716 } 711 }
717 } 712 }
718 713
@@ -818,7 +813,7 @@ static int c_can_handle_state_change(struct net_device *dev,
818 struct sk_buff *skb; 813 struct sk_buff *skb;
819 struct can_berr_counter bec; 814 struct can_berr_counter bec;
820 815
821 /* propogate the error condition to the CAN stack */ 816 /* propagate the error condition to the CAN stack */
822 skb = alloc_can_err_skb(dev, &cf); 817 skb = alloc_can_err_skb(dev, &cf);
823 if (unlikely(!skb)) 818 if (unlikely(!skb))
824 return 0; 819 return 0;
@@ -892,7 +887,7 @@ static int c_can_handle_bus_err(struct net_device *dev,
892 if (lec_type == LEC_UNUSED || lec_type == LEC_NO_ERROR) 887 if (lec_type == LEC_UNUSED || lec_type == LEC_NO_ERROR)
893 return 0; 888 return 0;
894 889
895 /* propogate the error condition to the CAN stack */ 890 /* propagate the error condition to the CAN stack */
896 skb = alloc_can_err_skb(dev, &cf); 891 skb = alloc_can_err_skb(dev, &cf);
897 if (unlikely(!skb)) 892 if (unlikely(!skb))
898 return 0; 893 return 0;
@@ -1112,8 +1107,7 @@ struct net_device *alloc_c_can_dev(void)
1112 priv->can.bittiming_const = &c_can_bittiming_const; 1107 priv->can.bittiming_const = &c_can_bittiming_const;
1113 priv->can.do_set_mode = c_can_set_mode; 1108 priv->can.do_set_mode = c_can_set_mode;
1114 priv->can.do_get_berr_counter = c_can_get_berr_counter; 1109 priv->can.do_get_berr_counter = c_can_get_berr_counter;
1115 priv->can.ctrlmode_supported = CAN_CTRLMODE_ONE_SHOT | 1110 priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK |
1116 CAN_CTRLMODE_LOOPBACK |
1117 CAN_CTRLMODE_LISTENONLY | 1111 CAN_CTRLMODE_LISTENONLY |
1118 CAN_CTRLMODE_BERR_REPORTING; 1112 CAN_CTRLMODE_BERR_REPORTING;
1119 1113
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c
index e629b961ae2d..cc90824f2c9c 100644
--- a/drivers/net/can/c_can/c_can_platform.c
+++ b/drivers/net/can/c_can/c_can_platform.c
@@ -73,7 +73,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
73 void __iomem *addr; 73 void __iomem *addr;
74 struct net_device *dev; 74 struct net_device *dev;
75 struct c_can_priv *priv; 75 struct c_can_priv *priv;
76 struct resource *mem, *irq; 76 struct resource *mem;
77 int irq;
77#ifdef CONFIG_HAVE_CLK 78#ifdef CONFIG_HAVE_CLK
78 struct clk *clk; 79 struct clk *clk;
79 80
@@ -88,8 +89,8 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
88 89
89 /* get the platform data */ 90 /* get the platform data */
90 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 91 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
91 irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 92 irq = platform_get_irq(pdev, 0);
92 if (!mem || (irq <= 0)) { 93 if (!mem || irq <= 0) {
93 ret = -ENODEV; 94 ret = -ENODEV;
94 goto exit_free_clk; 95 goto exit_free_clk;
95 } 96 }
@@ -117,7 +118,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev)
117 118
118 priv = netdev_priv(dev); 119 priv = netdev_priv(dev);
119 120
120 dev->irq = irq->start; 121 dev->irq = irq;
121 priv->regs = addr; 122 priv->regs = addr;
122#ifdef CONFIG_HAVE_CLK 123#ifdef CONFIG_HAVE_CLK
123 priv->can.clock.freq = clk_get_rate(clk); 124 priv->can.clock.freq = clk_get_rate(clk);
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 366f5cc050ae..587fba48cdd9 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -15,6 +15,7 @@
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/delay.h> 16#include <linux/delay.h>
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18#include <linux/mfd/core.h>
18 19
19#include <linux/netdevice.h> 20#include <linux/netdevice.h>
20#include <linux/can.h> 21#include <linux/can.h>
@@ -273,7 +274,7 @@ static inline void ican3_set_page(struct ican3_dev *mod, unsigned int page)
273 */ 274 */
274 275
275/* 276/*
276 * Recieve a message from the ICAN3 "old-style" firmware interface 277 * Receive a message from the ICAN3 "old-style" firmware interface
277 * 278 *
278 * LOCKING: must hold mod->lock 279 * LOCKING: must hold mod->lock
279 * 280 *
@@ -1049,7 +1050,7 @@ static void ican3_handle_inquiry(struct ican3_dev *mod, struct ican3_msg *msg)
1049 complete(&mod->termination_comp); 1050 complete(&mod->termination_comp);
1050 break; 1051 break;
1051 default: 1052 default:
1052 dev_err(mod->dev, "recieved an unknown inquiry response\n"); 1053 dev_err(mod->dev, "received an unknown inquiry response\n");
1053 break; 1054 break;
1054 } 1055 }
1055} 1056}
@@ -1057,7 +1058,7 @@ static void ican3_handle_inquiry(struct ican3_dev *mod, struct ican3_msg *msg)
1057static void ican3_handle_unknown_message(struct ican3_dev *mod, 1058static void ican3_handle_unknown_message(struct ican3_dev *mod,
1058 struct ican3_msg *msg) 1059 struct ican3_msg *msg)
1059{ 1060{
1060 dev_warn(mod->dev, "recieved unknown message: spec 0x%.2x length %d\n", 1061 dev_warn(mod->dev, "received unknown message: spec 0x%.2x length %d\n",
1061 msg->spec, le16_to_cpu(msg->len)); 1062 msg->spec, le16_to_cpu(msg->len));
1062} 1063}
1063 1064
@@ -1112,7 +1113,7 @@ static bool ican3_txok(struct ican3_dev *mod)
1112} 1113}
1113 1114
1114/* 1115/*
1115 * Recieve one CAN frame from the hardware 1116 * Receive one CAN frame from the hardware
1116 * 1117 *
1117 * CONTEXT: must be called from user context 1118 * CONTEXT: must be called from user context
1118 */ 1119 */
@@ -1643,7 +1644,7 @@ static int __devinit ican3_probe(struct platform_device *pdev)
1643 struct device *dev; 1644 struct device *dev;
1644 int ret; 1645 int ret;
1645 1646
1646 pdata = pdev->dev.platform_data; 1647 pdata = mfd_get_data(pdev);
1647 if (!pdata) 1648 if (!pdata)
1648 return -ENXIO; 1649 return -ENXIO;
1649 1650
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 7513c4523ac4..330140ee266d 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -931,7 +931,8 @@ static int mcp251x_open(struct net_device *net)
931 priv->tx_len = 0; 931 priv->tx_len = 0;
932 932
933 ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist, 933 ret = request_threaded_irq(spi->irq, NULL, mcp251x_can_ist,
934 IRQF_TRIGGER_FALLING, DEVICE_NAME, priv); 934 pdata->irq_flags ? pdata->irq_flags : IRQF_TRIGGER_FALLING,
935 DEVICE_NAME, priv);
935 if (ret) { 936 if (ret) {
936 dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq); 937 dev_err(&spi->dev, "failed to acquire irq %d\n", spi->irq);
937 if (pdata->transceiver_enable) 938 if (pdata->transceiver_enable)
diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c
index c0a1bc5b1435..bd1d811c204f 100644
--- a/drivers/net/can/mscan/mpc5xxx_can.c
+++ b/drivers/net/can/mscan/mpc5xxx_can.c
@@ -260,7 +260,7 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
260 260
261 if (!ofdev->dev.of_match) 261 if (!ofdev->dev.of_match)
262 return -EINVAL; 262 return -EINVAL;
263 data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data; 263 data = (struct mpc5xxx_can_data *)ofdev->dev.of_match->data;
264 264
265 base = of_iomap(np, 0); 265 base = of_iomap(np, 0);
266 if (!base) { 266 if (!base) {
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c
index 74cd880c7e06..92feac68b66e 100644
--- a/drivers/net/can/mscan/mscan.c
+++ b/drivers/net/can/mscan/mscan.c
@@ -246,7 +246,7 @@ static netdev_tx_t mscan_start_xmit(struct sk_buff *skb, struct net_device *dev)
246 out_be16(&regs->tx.idr3_2, can_id); 246 out_be16(&regs->tx.idr3_2, can_id);
247 247
248 can_id >>= 16; 248 can_id >>= 16;
249 /* EFF_FLAGS are inbetween the IDs :( */ 249 /* EFF_FLAGS are between the IDs :( */
250 can_id = (can_id & 0x7) | ((can_id << 2) & 0xffe0) 250 can_id = (can_id & 0x7) | ((can_id << 2) & 0xffe0)
251 | MSCAN_EFF_FLAGS; 251 | MSCAN_EFF_FLAGS;
252 } else { 252 } else {
diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
index 0a8de01d52f7..a358ea9445a2 100644
--- a/drivers/net/can/sja1000/sja1000.c
+++ b/drivers/net/can/sja1000/sja1000.c
@@ -425,7 +425,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
425 cf->data[3] = ecc & ECC_SEG; 425 cf->data[3] = ecc & ECC_SEG;
426 break; 426 break;
427 } 427 }
428 /* Error occured during transmission? */ 428 /* Error occurred during transmission? */
429 if ((ecc & ECC_DIR) == 0) 429 if ((ecc & ECC_DIR) == 0)
430 cf->data[2] |= CAN_ERR_PROT_TX; 430 cf->data[2] |= CAN_ERR_PROT_TX;
431 } 431 }
diff --git a/drivers/net/can/softing/softing.h b/drivers/net/can/softing/softing.h
index 7ec9f4db3d52..afd7d85b6915 100644
--- a/drivers/net/can/softing/softing.h
+++ b/drivers/net/can/softing/softing.h
@@ -22,7 +22,7 @@ struct softing_priv {
22 struct softing *card; 22 struct softing *card;
23 struct { 23 struct {
24 int pending; 24 int pending;
25 /* variables wich hold the circular buffer */ 25 /* variables which hold the circular buffer */
26 int echo_put; 26 int echo_put;
27 int echo_get; 27 int echo_get;
28 } tx; 28 } tx;
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c
index 8d7595344a62..60a49e5a2a53 100644
--- a/drivers/net/can/softing/softing_main.c
+++ b/drivers/net/can/softing/softing_main.c
@@ -218,7 +218,7 @@ static int softing_handle_1(struct softing *card)
218 ptr = buf; 218 ptr = buf;
219 cmd = *ptr++; 219 cmd = *ptr++;
220 if (cmd == 0xff) 220 if (cmd == 0xff)
221 /* not quite usefull, probably the card has got out */ 221 /* not quite useful, probably the card has got out */
222 return 0; 222 return 0;
223 netdev = card->net[0]; 223 netdev = card->net[0];
224 if (cmd & CMD_BUS2) 224 if (cmd & CMD_BUS2)
diff --git a/drivers/net/can/ti_hecc.c b/drivers/net/can/ti_hecc.c
index 4d07f1ee7168..f7bbde9eb2cb 100644
--- a/drivers/net/can/ti_hecc.c
+++ b/drivers/net/can/ti_hecc.c
@@ -663,7 +663,7 @@ static int ti_hecc_error(struct net_device *ndev, int int_status,
663 struct can_frame *cf; 663 struct can_frame *cf;
664 struct sk_buff *skb; 664 struct sk_buff *skb;
665 665
666 /* propogate the error condition to the can stack */ 666 /* propagate the error condition to the can stack */
667 skb = alloc_can_err_skb(ndev, &cf); 667 skb = alloc_can_err_skb(ndev, &cf);
668 if (!skb) { 668 if (!skb) {
669 if (printk_ratelimit()) 669 if (printk_ratelimit())
diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c
index e75f1a876972..a72c7bfb4090 100644
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@ -386,7 +386,7 @@ static void ems_usb_rx_err(struct ems_usb *dev, struct ems_cpc_msg *msg)
386 break; 386 break;
387 } 387 }
388 388
389 /* Error occured during transmission? */ 389 /* Error occurred during transmission? */
390 if ((ecc & SJA1000_ECC_DIR) == 0) 390 if ((ecc & SJA1000_ECC_DIR) == 0)
391 cf->data[2] |= CAN_ERR_PROT_TX; 391 cf->data[2] |= CAN_ERR_PROT_TX;
392 392
diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c
index dc53c831ea95..eb8b0e600282 100644
--- a/drivers/net/can/usb/esd_usb2.c
+++ b/drivers/net/can/usb/esd_usb2.c
@@ -284,7 +284,7 @@ static void esd_usb2_rx_event(struct esd_usb2_net_priv *priv,
284 break; 284 break;
285 } 285 }
286 286
287 /* Error occured during transmission? */ 287 /* Error occurred during transmission? */
288 if (!(ecc & SJA1000_ECC_DIR)) 288 if (!(ecc & SJA1000_ECC_DIR))
289 cf->data[2] |= CAN_ERR_PROT_TX; 289 cf->data[2] |= CAN_ERR_PROT_TX;
290 290
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index 3437613f0454..143a28c666af 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -51,7 +51,7 @@
51 * TX has 4 queues. currently these queues are used in a round-robin 51 * TX has 4 queues. currently these queues are used in a round-robin
52 * fashion for load balancing. They can also be used for QoS. for that 52 * fashion for load balancing. They can also be used for QoS. for that
53 * to work, however, QoS information needs to be exposed down to the driver 53 * to work, however, QoS information needs to be exposed down to the driver
54 * level so that subqueues get targetted to particular transmit rings. 54 * level so that subqueues get targeted to particular transmit rings.
55 * alternatively, the queues can be configured via use of the all-purpose 55 * alternatively, the queues can be configured via use of the all-purpose
56 * ioctl. 56 * ioctl.
57 * 57 *
@@ -5165,7 +5165,7 @@ err_out_free_res:
5165 pci_release_regions(pdev); 5165 pci_release_regions(pdev);
5166 5166
5167err_write_cacheline: 5167err_write_cacheline:
5168 /* Try to restore it in case the error occured after we 5168 /* Try to restore it in case the error occurred after we
5169 * set it. 5169 * set it.
5170 */ 5170 */
5171 pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, orig_cacheline_size); 5171 pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, orig_cacheline_size);
diff --git a/drivers/net/cassini.h b/drivers/net/cassini.h
index faf4746a0f3e..b361424d5f57 100644
--- a/drivers/net/cassini.h
+++ b/drivers/net/cassini.h
@@ -772,7 +772,7 @@
772#define RX_DEBUG_INTR_WRITE_PTR_MASK 0xC0000000 /* interrupt write pointer 772#define RX_DEBUG_INTR_WRITE_PTR_MASK 0xC0000000 /* interrupt write pointer
773 of the interrupt queue */ 773 of the interrupt queue */
774 774
775/* flow control frames are emmitted using two PAUSE thresholds: 775/* flow control frames are emitted using two PAUSE thresholds:
776 * XOFF PAUSE uses pause time value pre-programmed in the Send PAUSE MAC reg 776 * XOFF PAUSE uses pause time value pre-programmed in the Send PAUSE MAC reg
777 * XON PAUSE uses a pause time of 0. granularity of threshold is 64bytes. 777 * XON PAUSE uses a pause time of 0. granularity of threshold is 64bytes.
778 * PAUSE thresholds defined in terms of FIFO occupancy and may be translated 778 * PAUSE thresholds defined in terms of FIFO occupancy and may be translated
diff --git a/drivers/net/chelsio/mv88e1xxx.c b/drivers/net/chelsio/mv88e1xxx.c
index 809047a99e96..71018a4fdf15 100644
--- a/drivers/net/chelsio/mv88e1xxx.c
+++ b/drivers/net/chelsio/mv88e1xxx.c
@@ -41,7 +41,7 @@ static void mdio_clear_bit(struct cphy *cphy, int reg, u32 bitval)
41 * 41 *
42 * PARAMS: cphy - Pointer to PHY instance data. 42 * PARAMS: cphy - Pointer to PHY instance data.
43 * 43 *
44 * RETURN: 0 - Successfull reset. 44 * RETURN: 0 - Successful reset.
45 * -1 - Timeout. 45 * -1 - Timeout.
46 */ 46 */
47static int mv88e1xxx_reset(struct cphy *cphy, int wait) 47static int mv88e1xxx_reset(struct cphy *cphy, int wait)
diff --git a/drivers/net/chelsio/pm3393.c b/drivers/net/chelsio/pm3393.c
index 7dbb16d36fff..40c7b93ababc 100644
--- a/drivers/net/chelsio/pm3393.c
+++ b/drivers/net/chelsio/pm3393.c
@@ -293,7 +293,7 @@ static int pm3393_enable_port(struct cmac *cmac, int which)
293 pm3393_enable(cmac, which); 293 pm3393_enable(cmac, which);
294 294
295 /* 295 /*
296 * XXX This should be done by the PHY and preferrably not at all. 296 * XXX This should be done by the PHY and preferably not at all.
297 * The PHY doesn't give us link status indication on its own so have 297 * The PHY doesn't give us link status indication on its own so have
298 * the link management code query it instead. 298 * the link management code query it instead.
299 */ 299 */
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index f778b15ad3fd..8754d4473042 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -1662,7 +1662,7 @@ irqreturn_t t1_interrupt(int irq, void *data)
1662 * The code figures out how many entries the sk_buff will require in the 1662 * The code figures out how many entries the sk_buff will require in the
1663 * cmdQ and updates the cmdQ data structure with the state once the enqueue 1663 * cmdQ and updates the cmdQ data structure with the state once the enqueue
1664 * has complete. Then, it doesn't access the global structure anymore, but 1664 * has complete. Then, it doesn't access the global structure anymore, but
1665 * uses the corresponding fields on the stack. In conjuction with a spinlock 1665 * uses the corresponding fields on the stack. In conjunction with a spinlock
1666 * around that code, we can make the function reentrant without holding the 1666 * around that code, we can make the function reentrant without holding the
1667 * lock when we actually enqueue (which might be expensive, especially on 1667 * lock when we actually enqueue (which might be expensive, especially on
1668 * architectures with IO MMUs). 1668 * architectures with IO MMUs).
diff --git a/drivers/net/chelsio/vsc7326.c b/drivers/net/chelsio/vsc7326.c
index 106a590f0d9a..b0cb388f5e12 100644
--- a/drivers/net/chelsio/vsc7326.c
+++ b/drivers/net/chelsio/vsc7326.c
@@ -566,7 +566,7 @@ static int mac_disable(struct cmac *mac, int which)
566 for (i = 0; i <= 0x3a; ++i) 566 for (i = 0; i <= 0x3a; ++i)
567 vsc_write(mac->adapter, CRA(4, port, i), 0); 567 vsc_write(mac->adapter, CRA(4, port, i), 0);
568 568
569 /* Clear sofware counters */ 569 /* Clear software counters */
570 memset(&mac->stats, 0, sizeof(struct cmac_statistics)); 570 memset(&mac->stats, 0, sizeof(struct cmac_statistics));
571 571
572 return 0; 572 return 0;
diff --git a/drivers/net/cris/eth_v10.c b/drivers/net/cris/eth_v10.c
index 80c2feeefec5..9d267d3a6892 100644
--- a/drivers/net/cris/eth_v10.c
+++ b/drivers/net/cris/eth_v10.c
@@ -1383,7 +1383,7 @@ e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1383 spin_lock(&np->lock); /* Preempt protection */ 1383 spin_lock(&np->lock); /* Preempt protection */
1384 switch (cmd) { 1384 switch (cmd) {
1385 /* The ioctls below should be considered obsolete but are */ 1385 /* The ioctls below should be considered obsolete but are */
1386 /* still present for compatability with old scripts/apps */ 1386 /* still present for compatibility with old scripts/apps */
1387 case SET_ETH_SPEED_10: /* 10 Mbps */ 1387 case SET_ETH_SPEED_10: /* 10 Mbps */
1388 e100_set_speed(dev, 10); 1388 e100_set_speed(dev, 10);
1389 break; 1389 break;
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 4d538a4e9d55..910893143295 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -1983,14 +1983,20 @@ static int set_coalesce(struct net_device *dev, struct ethtool_coalesce *c)
1983{ 1983{
1984 struct port_info *pi = netdev_priv(dev); 1984 struct port_info *pi = netdev_priv(dev);
1985 struct adapter *adapter = pi->adapter; 1985 struct adapter *adapter = pi->adapter;
1986 struct qset_params *qsp = &adapter->params.sge.qset[0]; 1986 struct qset_params *qsp;
1987 struct sge_qset *qs = &adapter->sge.qs[0]; 1987 struct sge_qset *qs;
1988 int i;
1988 1989
1989 if (c->rx_coalesce_usecs * 10 > M_NEWTIMER) 1990 if (c->rx_coalesce_usecs * 10 > M_NEWTIMER)
1990 return -EINVAL; 1991 return -EINVAL;
1991 1992
1992 qsp->coalesce_usecs = c->rx_coalesce_usecs; 1993 for (i = 0; i < pi->nqsets; i++) {
1993 t3_update_qset_coalesce(qs, qsp); 1994 qsp = &adapter->params.sge.qset[i];
1995 qs = &adapter->sge.qs[i];
1996 qsp->coalesce_usecs = c->rx_coalesce_usecs;
1997 t3_update_qset_coalesce(qs, qsp);
1998 }
1999
1994 return 0; 2000 return 0;
1995} 2001}
1996 2002
diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c
index f9f6645b2e61..bfa2d56af1ee 100644
--- a/drivers/net/cxgb3/sge.c
+++ b/drivers/net/cxgb3/sge.c
@@ -199,7 +199,7 @@ static inline void refill_rspq(struct adapter *adapter,
199 * need_skb_unmap - does the platform need unmapping of sk_buffs? 199 * need_skb_unmap - does the platform need unmapping of sk_buffs?
200 * 200 *
201 * Returns true if the platform needs sk_buff unmapping. The compiler 201 * Returns true if the platform needs sk_buff unmapping. The compiler
202 * optimizes away unecessary code if this returns true. 202 * optimizes away unnecessary code if this returns true.
203 */ 203 */
204static inline int need_skb_unmap(void) 204static inline int need_skb_unmap(void)
205{ 205{
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
index d55db6b38e7b..c688421da9c7 100644
--- a/drivers/net/cxgb3/t3_hw.c
+++ b/drivers/net/cxgb3/t3_hw.c
@@ -1386,11 +1386,11 @@ struct intr_info {
1386 * @reg: the interrupt status register to process 1386 * @reg: the interrupt status register to process
1387 * @mask: a mask to apply to the interrupt status 1387 * @mask: a mask to apply to the interrupt status
1388 * @acts: table of interrupt actions 1388 * @acts: table of interrupt actions
1389 * @stats: statistics counters tracking interrupt occurences 1389 * @stats: statistics counters tracking interrupt occurrences
1390 * 1390 *
1391 * A table driven interrupt handler that applies a set of masks to an 1391 * A table driven interrupt handler that applies a set of masks to an
1392 * interrupt status word and performs the corresponding actions if the 1392 * interrupt status word and performs the corresponding actions if the
1393 * interrupts described by the mask have occured. The actions include 1393 * interrupts described by the mask have occurred. The actions include
1394 * optionally printing a warning or alert message, and optionally 1394 * optionally printing a warning or alert message, and optionally
1395 * incrementing a stat counter. The table is terminated by an entry 1395 * incrementing a stat counter. The table is terminated by an entry
1396 * specifying mask 0. Returns the number of fatal interrupt conditions. 1396 * specifying mask 0. Returns the number of fatal interrupt conditions.
@@ -2783,7 +2783,7 @@ static void init_mtus(unsigned short mtus[])
2783{ 2783{
2784 /* 2784 /*
2785 * See draft-mathis-plpmtud-00.txt for the values. The min is 88 so 2785 * See draft-mathis-plpmtud-00.txt for the values. The min is 88 so
2786 * it can accomodate max size TCP/IP headers when SACK and timestamps 2786 * it can accommodate max size TCP/IP headers when SACK and timestamps
2787 * are enabled and still have at least 8 bytes of payload. 2787 * are enabled and still have at least 8 bytes of payload.
2788 */ 2788 */
2789 mtus[0] = 88; 2789 mtus[0] = 88;
diff --git a/drivers/net/cxgb4/t4_hw.c b/drivers/net/cxgb4/t4_hw.c
index b9fd8a6f2cc4..d1ec111aebd8 100644
--- a/drivers/net/cxgb4/t4_hw.c
+++ b/drivers/net/cxgb4/t4_hw.c
@@ -883,7 +883,7 @@ struct intr_info {
883 * 883 *
884 * A table driven interrupt handler that applies a set of masks to an 884 * A table driven interrupt handler that applies a set of masks to an
885 * interrupt status word and performs the corresponding actions if the 885 * interrupt status word and performs the corresponding actions if the
886 * interrupts described by the mask have occured. The actions include 886 * interrupts described by the mask have occurred. The actions include
887 * optionally emitting a warning or alert message. The table is terminated 887 * optionally emitting a warning or alert message. The table is terminated
888 * by an entry specifying mask 0. Returns the number of fatal interrupt 888 * by an entry specifying mask 0. Returns the number of fatal interrupt
889 * conditions. 889 * conditions.
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c
index 6aad64df4dcb..4661cbbd9bd9 100644
--- a/drivers/net/cxgb4vf/cxgb4vf_main.c
+++ b/drivers/net/cxgb4vf/cxgb4vf_main.c
@@ -2738,7 +2738,7 @@ static int __devinit cxgb4vf_pci_probe(struct pci_dev *pdev,
2738 cfg_queues(adapter); 2738 cfg_queues(adapter);
2739 2739
2740 /* 2740 /*
2741 * Print a short notice on the existance and configuration of the new 2741 * Print a short notice on the existence and configuration of the new
2742 * VF network device ... 2742 * VF network device ...
2743 */ 2743 */
2744 for_each_port(adapter, pidx) { 2744 for_each_port(adapter, pidx) {
diff --git a/drivers/net/cxgb4vf/sge.c b/drivers/net/cxgb4vf/sge.c
index e0b3d1bc2fdf..bb65121f581c 100644
--- a/drivers/net/cxgb4vf/sge.c
+++ b/drivers/net/cxgb4vf/sge.c
@@ -224,8 +224,8 @@ static inline bool is_buf_mapped(const struct rx_sw_desc *sdesc)
224/** 224/**
225 * need_skb_unmap - does the platform need unmapping of sk_buffs? 225 * need_skb_unmap - does the platform need unmapping of sk_buffs?
226 * 226 *
227 * Returns true if the platfrom needs sk_buff unmapping. The compiler 227 * Returns true if the platform needs sk_buff unmapping. The compiler
228 * optimizes away unecessary code if this returns true. 228 * optimizes away unnecessary code if this returns true.
229 */ 229 */
230static inline int need_skb_unmap(void) 230static inline int need_skb_unmap(void)
231{ 231{
@@ -267,7 +267,7 @@ static inline unsigned int fl_cap(const struct sge_fl *fl)
267 * 267 *
268 * Tests specified Free List to see whether the number of buffers 268 * Tests specified Free List to see whether the number of buffers
269 * available to the hardware has falled below our "starvation" 269 * available to the hardware has falled below our "starvation"
270 * threshhold. 270 * threshold.
271 */ 271 */
272static inline bool fl_starving(const struct sge_fl *fl) 272static inline bool fl_starving(const struct sge_fl *fl)
273{ 273{
@@ -1149,7 +1149,7 @@ int t4vf_eth_xmit(struct sk_buff *skb, struct net_device *dev)
1149 if (unlikely(credits < ETHTXQ_STOP_THRES)) { 1149 if (unlikely(credits < ETHTXQ_STOP_THRES)) {
1150 /* 1150 /*
1151 * After we're done injecting the Work Request for this 1151 * After we're done injecting the Work Request for this
1152 * packet, we'll be below our "stop threshhold" so stop the TX 1152 * packet, we'll be below our "stop threshold" so stop the TX
1153 * Queue now and schedule a request for an SGE Egress Queue 1153 * Queue now and schedule a request for an SGE Egress Queue
1154 * Update message. The queue will get started later on when 1154 * Update message. The queue will get started later on when
1155 * the firmware processes this Work Request and sends us an 1155 * the firmware processes this Work Request and sends us an
diff --git a/drivers/net/davinci_cpdma.c b/drivers/net/davinci_cpdma.c
index e92b2b6cd8c4..ae47f23ba930 100644
--- a/drivers/net/davinci_cpdma.c
+++ b/drivers/net/davinci_cpdma.c
@@ -76,6 +76,7 @@ struct cpdma_desc {
76 76
77struct cpdma_desc_pool { 77struct cpdma_desc_pool {
78 u32 phys; 78 u32 phys;
79 u32 hw_addr;
79 void __iomem *iomap; /* ioremap map */ 80 void __iomem *iomap; /* ioremap map */
80 void *cpumap; /* dma_alloc map */ 81 void *cpumap; /* dma_alloc map */
81 int desc_size, mem_size; 82 int desc_size, mem_size;
@@ -137,7 +138,8 @@ struct cpdma_chan {
137 * abstract out these details 138 * abstract out these details
138 */ 139 */
139static struct cpdma_desc_pool * 140static struct cpdma_desc_pool *
140cpdma_desc_pool_create(struct device *dev, u32 phys, int size, int align) 141cpdma_desc_pool_create(struct device *dev, u32 phys, u32 hw_addr,
142 int size, int align)
141{ 143{
142 int bitmap_size; 144 int bitmap_size;
143 struct cpdma_desc_pool *pool; 145 struct cpdma_desc_pool *pool;
@@ -161,10 +163,12 @@ cpdma_desc_pool_create(struct device *dev, u32 phys, int size, int align)
161 if (phys) { 163 if (phys) {
162 pool->phys = phys; 164 pool->phys = phys;
163 pool->iomap = ioremap(phys, size); 165 pool->iomap = ioremap(phys, size);
166 pool->hw_addr = hw_addr;
164 } else { 167 } else {
165 pool->cpumap = dma_alloc_coherent(dev, size, &pool->phys, 168 pool->cpumap = dma_alloc_coherent(dev, size, &pool->phys,
166 GFP_KERNEL); 169 GFP_KERNEL);
167 pool->iomap = (void __force __iomem *)pool->cpumap; 170 pool->iomap = (void __force __iomem *)pool->cpumap;
171 pool->hw_addr = pool->phys;
168 } 172 }
169 173
170 if (pool->iomap) 174 if (pool->iomap)
@@ -201,14 +205,14 @@ static inline dma_addr_t desc_phys(struct cpdma_desc_pool *pool,
201{ 205{
202 if (!desc) 206 if (!desc)
203 return 0; 207 return 0;
204 return pool->phys + (__force dma_addr_t)desc - 208 return pool->hw_addr + (__force dma_addr_t)desc -
205 (__force dma_addr_t)pool->iomap; 209 (__force dma_addr_t)pool->iomap;
206} 210}
207 211
208static inline struct cpdma_desc __iomem * 212static inline struct cpdma_desc __iomem *
209desc_from_phys(struct cpdma_desc_pool *pool, dma_addr_t dma) 213desc_from_phys(struct cpdma_desc_pool *pool, dma_addr_t dma)
210{ 214{
211 return dma ? pool->iomap + dma - pool->phys : NULL; 215 return dma ? pool->iomap + dma - pool->hw_addr : NULL;
212} 216}
213 217
214static struct cpdma_desc __iomem * 218static struct cpdma_desc __iomem *
@@ -260,6 +264,7 @@ struct cpdma_ctlr *cpdma_ctlr_create(struct cpdma_params *params)
260 264
261 ctlr->pool = cpdma_desc_pool_create(ctlr->dev, 265 ctlr->pool = cpdma_desc_pool_create(ctlr->dev,
262 ctlr->params.desc_mem_phys, 266 ctlr->params.desc_mem_phys,
267 ctlr->params.desc_hw_addr,
263 ctlr->params.desc_mem_size, 268 ctlr->params.desc_mem_size,
264 ctlr->params.desc_align); 269 ctlr->params.desc_align);
265 if (!ctlr->pool) { 270 if (!ctlr->pool) {
diff --git a/drivers/net/davinci_cpdma.h b/drivers/net/davinci_cpdma.h
index 868e50ebde45..afa19a0c0d81 100644
--- a/drivers/net/davinci_cpdma.h
+++ b/drivers/net/davinci_cpdma.h
@@ -33,6 +33,7 @@ struct cpdma_params {
33 bool has_soft_reset; 33 bool has_soft_reset;
34 int min_packet_size; 34 int min_packet_size;
35 u32 desc_mem_phys; 35 u32 desc_mem_phys;
36 u32 desc_hw_addr;
36 int desc_mem_size; 37 int desc_mem_size;
37 int desc_align; 38 int desc_align;
38 39
diff --git a/drivers/net/davinci_emac.c b/drivers/net/davinci_emac.c
index 082d6ea69920..807b6bb200eb 100644
--- a/drivers/net/davinci_emac.c
+++ b/drivers/net/davinci_emac.c
@@ -94,14 +94,14 @@ MODULE_VERSION(EMAC_MODULE_VERSION);
94static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1"; 94static const char emac_version_string[] = "TI DaVinci EMAC Linux v6.1";
95 95
96/* Configuration items */ 96/* Configuration items */
97#define EMAC_DEF_PASS_CRC (0) /* Do not pass CRC upto frames */ 97#define EMAC_DEF_PASS_CRC (0) /* Do not pass CRC up to frames */
98#define EMAC_DEF_QOS_EN (0) /* EMAC proprietary QoS disabled */ 98#define EMAC_DEF_QOS_EN (0) /* EMAC proprietary QoS disabled */
99#define EMAC_DEF_NO_BUFF_CHAIN (0) /* No buffer chain */ 99#define EMAC_DEF_NO_BUFF_CHAIN (0) /* No buffer chain */
100#define EMAC_DEF_MACCTRL_FRAME_EN (0) /* Discard Maccontrol frames */ 100#define EMAC_DEF_MACCTRL_FRAME_EN (0) /* Discard Maccontrol frames */
101#define EMAC_DEF_SHORT_FRAME_EN (0) /* Discard short frames */ 101#define EMAC_DEF_SHORT_FRAME_EN (0) /* Discard short frames */
102#define EMAC_DEF_ERROR_FRAME_EN (0) /* Discard error frames */ 102#define EMAC_DEF_ERROR_FRAME_EN (0) /* Discard error frames */
103#define EMAC_DEF_PROM_EN (0) /* Promiscous disabled */ 103#define EMAC_DEF_PROM_EN (0) /* Promiscuous disabled */
104#define EMAC_DEF_PROM_CH (0) /* Promiscous channel is 0 */ 104#define EMAC_DEF_PROM_CH (0) /* Promiscuous channel is 0 */
105#define EMAC_DEF_BCAST_EN (1) /* Broadcast enabled */ 105#define EMAC_DEF_BCAST_EN (1) /* Broadcast enabled */
106#define EMAC_DEF_BCAST_CH (0) /* Broadcast channel is 0 */ 106#define EMAC_DEF_BCAST_CH (0) /* Broadcast channel is 0 */
107#define EMAC_DEF_MCAST_EN (1) /* Multicast enabled */ 107#define EMAC_DEF_MCAST_EN (1) /* Multicast enabled */
@@ -1013,7 +1013,7 @@ static void emac_rx_handler(void *token, int len, int status)
1013 return; 1013 return;
1014 } 1014 }
1015 1015
1016 /* recycle on recieve error */ 1016 /* recycle on receive error */
1017 if (status < 0) { 1017 if (status < 0) {
1018 ndev->stats.rx_errors++; 1018 ndev->stats.rx_errors++;
1019 goto recycle; 1019 goto recycle;
@@ -1854,10 +1854,13 @@ static int __devinit davinci_emac_probe(struct platform_device *pdev)
1854 dma_params.rxcp = priv->emac_base + 0x660; 1854 dma_params.rxcp = priv->emac_base + 0x660;
1855 dma_params.num_chan = EMAC_MAX_TXRX_CHANNELS; 1855 dma_params.num_chan = EMAC_MAX_TXRX_CHANNELS;
1856 dma_params.min_packet_size = EMAC_DEF_MIN_ETHPKTSIZE; 1856 dma_params.min_packet_size = EMAC_DEF_MIN_ETHPKTSIZE;
1857 dma_params.desc_mem_phys = hw_ram_addr; 1857 dma_params.desc_hw_addr = hw_ram_addr;
1858 dma_params.desc_mem_size = pdata->ctrl_ram_size; 1858 dma_params.desc_mem_size = pdata->ctrl_ram_size;
1859 dma_params.desc_align = 16; 1859 dma_params.desc_align = 16;
1860 1860
1861 dma_params.desc_mem_phys = pdata->no_bd_ram ? 0 :
1862 (u32 __force)res->start + pdata->ctrl_ram_offset;
1863
1861 priv->dma = cpdma_ctlr_create(&dma_params); 1864 priv->dma = cpdma_ctlr_create(&dma_params);
1862 if (!priv->dma) { 1865 if (!priv->dma) {
1863 dev_err(emac_dev, "DaVinci EMAC: Error initializing DMA\n"); 1866 dev_err(emac_dev, "DaVinci EMAC: Error initializing DMA\n");
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 317708113601..b7af5bab9937 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -621,9 +621,9 @@ static int dm9000_set_wol(struct net_device *dev, struct ethtool_wolinfo *w)
621 /* change in wol state, update IRQ state */ 621 /* change in wol state, update IRQ state */
622 622
623 if (!dm->wake_state) 623 if (!dm->wake_state)
624 set_irq_wake(dm->irq_wake, 1); 624 irq_set_irq_wake(dm->irq_wake, 1);
625 else if (dm->wake_state & !opts) 625 else if (dm->wake_state & !opts)
626 set_irq_wake(dm->irq_wake, 0); 626 irq_set_irq_wake(dm->irq_wake, 0);
627 } 627 }
628 628
629 dm->wake_state = opts; 629 dm->wake_state = opts;
@@ -1424,13 +1424,13 @@ dm9000_probe(struct platform_device *pdev)
1424 } else { 1424 } else {
1425 1425
1426 /* test to see if irq is really wakeup capable */ 1426 /* test to see if irq is really wakeup capable */
1427 ret = set_irq_wake(db->irq_wake, 1); 1427 ret = irq_set_irq_wake(db->irq_wake, 1);
1428 if (ret) { 1428 if (ret) {
1429 dev_err(db->dev, "irq %d cannot set wakeup (%d)\n", 1429 dev_err(db->dev, "irq %d cannot set wakeup (%d)\n",
1430 db->irq_wake, ret); 1430 db->irq_wake, ret);
1431 ret = 0; 1431 ret = 0;
1432 } else { 1432 } else {
1433 set_irq_wake(db->irq_wake, 0); 1433 irq_set_irq_wake(db->irq_wake, 0);
1434 db->wake_supported = 1; 1434 db->wake_supported = 1;
1435 } 1435 }
1436 } 1436 }
diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c
index f4d0922ec65b..dd70738eb2f4 100644
--- a/drivers/net/e1000/e1000_ethtool.c
+++ b/drivers/net/e1000/e1000_ethtool.c
@@ -160,7 +160,7 @@ static int e1000_get_settings(struct net_device *netdev,
160 &adapter->link_duplex); 160 &adapter->link_duplex);
161 ecmd->speed = adapter->link_speed; 161 ecmd->speed = adapter->link_speed;
162 162
163 /* unfortunatly FULL_DUPLEX != DUPLEX_FULL 163 /* unfortunately FULL_DUPLEX != DUPLEX_FULL
164 * and HALF_DUPLEX != DUPLEX_HALF */ 164 * and HALF_DUPLEX != DUPLEX_HALF */
165 165
166 if (adapter->link_duplex == FULL_DUPLEX) 166 if (adapter->link_duplex == FULL_DUPLEX)
diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h
index c70b23d52284..5c9a8403668b 100644
--- a/drivers/net/e1000/e1000_hw.h
+++ b/drivers/net/e1000/e1000_hw.h
@@ -1026,7 +1026,7 @@ extern void __iomem *ce4100_gbe_mdio_base_virt;
1026 1026
1027#define E1000_KUMCTRLSTA 0x00034 /* MAC-PHY interface - RW */ 1027#define E1000_KUMCTRLSTA 0x00034 /* MAC-PHY interface - RW */
1028#define E1000_MDPHYA 0x0003C /* PHY address - RW */ 1028#define E1000_MDPHYA 0x0003C /* PHY address - RW */
1029#define E1000_MANC2H 0x05860 /* Managment Control To Host - RW */ 1029#define E1000_MANC2H 0x05860 /* Management Control To Host - RW */
1030#define E1000_SW_FW_SYNC 0x05B5C /* Software-Firmware Synchronization - RW */ 1030#define E1000_SW_FW_SYNC 0x05B5C /* Software-Firmware Synchronization - RW */
1031 1031
1032#define E1000_GCR 0x05B00 /* PCI-Ex Control */ 1032#define E1000_GCR 0x05B00 /* PCI-Ex Control */
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index bfab14092d2c..477e066a1cf0 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -205,7 +205,7 @@ static struct pci_driver e1000_driver = {
205 .probe = e1000_probe, 205 .probe = e1000_probe,
206 .remove = __devexit_p(e1000_remove), 206 .remove = __devexit_p(e1000_remove),
207#ifdef CONFIG_PM 207#ifdef CONFIG_PM
208 /* Power Managment Hooks */ 208 /* Power Management Hooks */
209 .suspend = e1000_suspend, 209 .suspend = e1000_suspend,
210 .resume = e1000_resume, 210 .resume = e1000_resume,
211#endif 211#endif
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index a39d4a4d871c..506a0a0043b3 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -4886,7 +4886,7 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
4886 if (skb->protocol == htons(ETH_P_IP)) 4886 if (skb->protocol == htons(ETH_P_IP))
4887 tx_flags |= E1000_TX_FLAGS_IPV4; 4887 tx_flags |= E1000_TX_FLAGS_IPV4;
4888 4888
4889 /* if count is 0 then mapping error has occured */ 4889 /* if count is 0 then mapping error has occurred */
4890 count = e1000_tx_map(adapter, skb, first, max_per_txd, nr_frags, mss); 4890 count = e1000_tx_map(adapter, skb, first, max_per_txd, nr_frags, mss);
4891 if (count) { 4891 if (count) {
4892 e1000_tx_queue(adapter, tx_flags, count); 4892 e1000_tx_queue(adapter, tx_flags, count);
diff --git a/drivers/net/enc28j60_hw.h b/drivers/net/enc28j60_hw.h
index 1a0b20969f80..25b41de49f0e 100644
--- a/drivers/net/enc28j60_hw.h
+++ b/drivers/net/enc28j60_hw.h
@@ -303,7 +303,7 @@
303/* maximum ethernet frame length */ 303/* maximum ethernet frame length */
304#define MAX_FRAMELEN 1518 304#define MAX_FRAMELEN 1518
305 305
306/* Prefered half duplex: LEDA: Link status LEDB: Rx/Tx activity */ 306/* Preferred half duplex: LEDA: Link status LEDB: Rx/Tx activity */
307#define ENC28J60_LAMPS_MODE 0x3476 307#define ENC28J60_LAMPS_MODE 0x3476
308 308
309#endif 309#endif
diff --git a/drivers/net/eth16i.c b/drivers/net/eth16i.c
index fb717be511f6..12d28e9d0cb7 100644
--- a/drivers/net/eth16i.c
+++ b/drivers/net/eth16i.c
@@ -13,7 +13,7 @@
13 This driver supports following cards : 13 This driver supports following cards :
14 - ICL EtherTeam 16i 14 - ICL EtherTeam 16i
15 - ICL EtherTeam 32 EISA 15 - ICL EtherTeam 32 EISA
16 (Uses true 32 bit transfers rather than 16i compability mode) 16 (Uses true 32 bit transfers rather than 16i compatibility mode)
17 17
18 Example Module usage: 18 Example Module usage:
19 insmod eth16i.o io=0x2a0 mediatype=bnc 19 insmod eth16i.o io=0x2a0 mediatype=bnc
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index db0290f05bdf..a83dd312c3ac 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -542,7 +542,7 @@ static irqreturn_t ethoc_interrupt(int irq, void *dev_id)
542 542
543 /* Figure out what triggered the interrupt... 543 /* Figure out what triggered the interrupt...
544 * The tricky bit here is that the interrupt source bits get 544 * The tricky bit here is that the interrupt source bits get
545 * set in INT_SOURCE for an event irregardless of whether that 545 * set in INT_SOURCE for an event regardless of whether that
546 * event is masked or not. Thus, in order to figure out what 546 * event is masked or not. Thus, in order to figure out what
547 * triggered the interrupt, we need to remove the sources 547 * triggered the interrupt, we need to remove the sources
548 * for all events that are currently masked. This behaviour 548 * for all events that are currently masked. This behaviour
diff --git a/drivers/net/fec.h b/drivers/net/fec.h
index ace318df4c8d..8b2c6d797e6d 100644
--- a/drivers/net/fec.h
+++ b/drivers/net/fec.h
@@ -97,11 +97,11 @@ struct bufdesc {
97 * The following definitions courtesy of commproc.h, which where 97 * The following definitions courtesy of commproc.h, which where
98 * Copyright (c) 1997 Dan Malek (dmalek@jlc.net). 98 * Copyright (c) 1997 Dan Malek (dmalek@jlc.net).
99 */ 99 */
100#define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */ 100#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */
101#define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */ 101#define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */
102#define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */ 102#define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */
103#define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */ 103#define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */
104#define BD_SC_CM ((ushort)0x0200) /* Continous mode */ 104#define BD_SC_CM ((ushort)0x0200) /* Continuous mode */
105#define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */ 105#define BD_SC_ID ((ushort)0x0100) /* Rec'd too many idles */
106#define BD_SC_P ((ushort)0x0100) /* xmt preamble */ 106#define BD_SC_P ((ushort)0x0100) /* xmt preamble */
107#define BD_SC_BR ((ushort)0x0020) /* Break received */ 107#define BD_SC_BR ((ushort)0x0020) /* Break received */
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 7b92897ca66b..d5ab4dad5051 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -440,7 +440,7 @@ union ring_type {
440#define NV_RX3_VLAN_TAG_PRESENT (1<<16) 440#define NV_RX3_VLAN_TAG_PRESENT (1<<16)
441#define NV_RX3_VLAN_TAG_MASK (0x0000FFFF) 441#define NV_RX3_VLAN_TAG_MASK (0x0000FFFF)
442 442
443/* Miscelaneous hardware related defines: */ 443/* Miscellaneous hardware related defines: */
444#define NV_PCI_REGSZ_VER1 0x270 444#define NV_PCI_REGSZ_VER1 0x270
445#define NV_PCI_REGSZ_VER2 0x2d4 445#define NV_PCI_REGSZ_VER2 0x2d4
446#define NV_PCI_REGSZ_VER3 0x604 446#define NV_PCI_REGSZ_VER3 0x604
@@ -1488,7 +1488,7 @@ static int phy_init(struct net_device *dev)
1488 } 1488 }
1489 } 1489 }
1490 1490
1491 /* some phys clear out pause advertisment on reset, set it back */ 1491 /* some phys clear out pause advertisement on reset, set it back */
1492 mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg); 1492 mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg);
1493 1493
1494 /* restart auto negotiation, power down phy */ 1494 /* restart auto negotiation, power down phy */
@@ -2535,7 +2535,7 @@ static void nv_tx_timeout(struct net_device *dev)
2535 else 2535 else
2536 nv_tx_done_optimized(dev, np->tx_ring_size); 2536 nv_tx_done_optimized(dev, np->tx_ring_size);
2537 2537
2538 /* save current HW postion */ 2538 /* save current HW position */
2539 if (np->tx_change_owner) 2539 if (np->tx_change_owner)
2540 put_tx.ex = np->tx_change_owner->first_tx_desc; 2540 put_tx.ex = np->tx_change_owner->first_tx_desc;
2541 else 2541 else
@@ -4053,7 +4053,7 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
4053 4053
4054 } else if (ecmd->autoneg == AUTONEG_DISABLE) { 4054 } else if (ecmd->autoneg == AUTONEG_DISABLE) {
4055 /* Note: autonegotiation disable, speed 1000 intentionally 4055 /* Note: autonegotiation disable, speed 1000 intentionally
4056 * forbidden - noone should need that. */ 4056 * forbidden - no one should need that. */
4057 4057
4058 if (ecmd->speed != SPEED_10 && ecmd->speed != SPEED_100) 4058 if (ecmd->speed != SPEED_10 && ecmd->speed != SPEED_100)
4059 return -EINVAL; 4059 return -EINVAL;
@@ -4103,7 +4103,7 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
4103 adv |= ADVERTISE_100HALF; 4103 adv |= ADVERTISE_100HALF;
4104 if (ecmd->advertising & ADVERTISED_100baseT_Full) 4104 if (ecmd->advertising & ADVERTISED_100baseT_Full)
4105 adv |= ADVERTISE_100FULL; 4105 adv |= ADVERTISE_100FULL;
4106 if (np->pause_flags & NV_PAUSEFRAME_RX_REQ) /* for rx we set both advertisments but disable tx pause */ 4106 if (np->pause_flags & NV_PAUSEFRAME_RX_REQ) /* for rx we set both advertisements but disable tx pause */
4107 adv |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; 4107 adv |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
4108 if (np->pause_flags & NV_PAUSEFRAME_TX_REQ) 4108 if (np->pause_flags & NV_PAUSEFRAME_TX_REQ)
4109 adv |= ADVERTISE_PAUSE_ASYM; 4109 adv |= ADVERTISE_PAUSE_ASYM;
@@ -4148,7 +4148,7 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
4148 if (ecmd->speed == SPEED_100 && ecmd->duplex == DUPLEX_FULL) 4148 if (ecmd->speed == SPEED_100 && ecmd->duplex == DUPLEX_FULL)
4149 adv |= ADVERTISE_100FULL; 4149 adv |= ADVERTISE_100FULL;
4150 np->pause_flags &= ~(NV_PAUSEFRAME_AUTONEG|NV_PAUSEFRAME_RX_ENABLE|NV_PAUSEFRAME_TX_ENABLE); 4150 np->pause_flags &= ~(NV_PAUSEFRAME_AUTONEG|NV_PAUSEFRAME_RX_ENABLE|NV_PAUSEFRAME_TX_ENABLE);
4151 if (np->pause_flags & NV_PAUSEFRAME_RX_REQ) {/* for rx we set both advertisments but disable tx pause */ 4151 if (np->pause_flags & NV_PAUSEFRAME_RX_REQ) {/* for rx we set both advertisements but disable tx pause */
4152 adv |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; 4152 adv |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
4153 np->pause_flags |= NV_PAUSEFRAME_RX_ENABLE; 4153 np->pause_flags |= NV_PAUSEFRAME_RX_ENABLE;
4154 } 4154 }
@@ -4449,7 +4449,7 @@ static int nv_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam*
4449 4449
4450 adv = mii_rw(dev, np->phyaddr, MII_ADVERTISE, MII_READ); 4450 adv = mii_rw(dev, np->phyaddr, MII_ADVERTISE, MII_READ);
4451 adv &= ~(ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM); 4451 adv &= ~(ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
4452 if (np->pause_flags & NV_PAUSEFRAME_RX_REQ) /* for rx we set both advertisments but disable tx pause */ 4452 if (np->pause_flags & NV_PAUSEFRAME_RX_REQ) /* for rx we set both advertisements but disable tx pause */
4453 adv |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; 4453 adv |= ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM;
4454 if (np->pause_flags & NV_PAUSEFRAME_TX_REQ) 4454 if (np->pause_flags & NV_PAUSEFRAME_TX_REQ)
4455 adv |= ADVERTISE_PAUSE_ASYM; 4455 adv |= ADVERTISE_PAUSE_ASYM;
diff --git a/drivers/net/ftmac100.c b/drivers/net/ftmac100.c
index 1d6f4b8d393a..a31661948c42 100644
--- a/drivers/net/ftmac100.c
+++ b/drivers/net/ftmac100.c
@@ -1102,7 +1102,7 @@ static int ftmac100_probe(struct platform_device *pdev)
1102 goto err_req_mem; 1102 goto err_req_mem;
1103 } 1103 }
1104 1104
1105 priv->base = ioremap(res->start, res->end - res->start); 1105 priv->base = ioremap(res->start, resource_size(res));
1106 if (!priv->base) { 1106 if (!priv->base) {
1107 dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n"); 1107 dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n");
1108 err = -EIO; 1108 err = -EIO;
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index ccb231c4d933..2a0ad9a501bb 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -949,6 +949,11 @@ static void gfar_detect_errata(struct gfar_private *priv)
949 (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0)) 949 (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0))
950 priv->errata |= GFAR_ERRATA_A002; 950 priv->errata |= GFAR_ERRATA_A002;
951 951
952 /* MPC8313 Rev < 2.0, MPC8548 rev 2.0 */
953 if ((pvr == 0x80850010 && mod == 0x80b0 && rev < 0x0020) ||
954 (pvr == 0x80210020 && mod == 0x8030 && rev == 0x0020))
955 priv->errata |= GFAR_ERRATA_12;
956
952 if (priv->errata) 957 if (priv->errata)
953 dev_info(dev, "enabled errata workarounds, flags: 0x%x\n", 958 dev_info(dev, "enabled errata workarounds, flags: 0x%x\n",
954 priv->errata); 959 priv->errata);
@@ -2154,8 +2159,15 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
2154 /* Set up checksumming */ 2159 /* Set up checksumming */
2155 if (CHECKSUM_PARTIAL == skb->ip_summed) { 2160 if (CHECKSUM_PARTIAL == skb->ip_summed) {
2156 fcb = gfar_add_fcb(skb); 2161 fcb = gfar_add_fcb(skb);
2157 lstatus |= BD_LFLAG(TXBD_TOE); 2162 /* as specified by errata */
2158 gfar_tx_checksum(skb, fcb); 2163 if (unlikely(gfar_has_errata(priv, GFAR_ERRATA_12)
2164 && ((unsigned long)fcb % 0x20) > 0x18)) {
2165 __skb_pull(skb, GMAC_FCB_LEN);
2166 skb_checksum_help(skb);
2167 } else {
2168 lstatus |= BD_LFLAG(TXBD_TOE);
2169 gfar_tx_checksum(skb, fcb);
2170 }
2159 } 2171 }
2160 2172
2161 if (vlan_tx_tag_present(skb)) { 2173 if (vlan_tx_tag_present(skb)) {
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h
index 54de4135e932..b2fe7edefad9 100644
--- a/drivers/net/gianfar.h
+++ b/drivers/net/gianfar.h
@@ -1039,10 +1039,11 @@ enum gfar_errata {
1039 GFAR_ERRATA_74 = 0x01, 1039 GFAR_ERRATA_74 = 0x01,
1040 GFAR_ERRATA_76 = 0x02, 1040 GFAR_ERRATA_76 = 0x02,
1041 GFAR_ERRATA_A002 = 0x04, 1041 GFAR_ERRATA_A002 = 0x04,
1042 GFAR_ERRATA_12 = 0x08, /* a.k.a errata eTSEC49 */
1042}; 1043};
1043 1044
1044/* Struct stolen almost completely (and shamelessly) from the FCC enet source 1045/* Struct stolen almost completely (and shamelessly) from the FCC enet source
1045 * (Ok, that's not so true anymore, but there is a family resemblence) 1046 * (Ok, that's not so true anymore, but there is a family resemblance)
1046 * The GFAR buffer descriptors track the ring buffers. The rx_bd_base 1047 * The GFAR buffer descriptors track the ring buffers. The rx_bd_base
1047 * and tx_bd_base always point to the currently available buffer. 1048 * and tx_bd_base always point to the currently available buffer.
1048 * The dirty_tx tracks the current buffer that is being sent by the 1049 * The dirty_tx tracks the current buffer that is being sent by the
diff --git a/drivers/net/hamradio/Makefile b/drivers/net/hamradio/Makefile
index 9def86704a91..104096070026 100644
--- a/drivers/net/hamradio/Makefile
+++ b/drivers/net/hamradio/Makefile
@@ -3,7 +3,7 @@
3# 3#
4# 4#
5# 19971130 Moved the amateur radio related network drivers from 5# 19971130 Moved the amateur radio related network drivers from
6# drivers/net/ to drivers/hamradio for easier maintainance. 6# drivers/net/ to drivers/hamradio for easier maintenance.
7# Joerg Reuter DL1BKE <jreuter@yaina.de> 7# Joerg Reuter DL1BKE <jreuter@yaina.de>
8# 8#
9# 20000806 Rewritten to use lists instead of if-statements. 9# 20000806 Rewritten to use lists instead of if-statements.
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c
index 7d9ced0738c5..96a98d2ff151 100644
--- a/drivers/net/hamradio/yam.c
+++ b/drivers/net/hamradio/yam.c
@@ -30,7 +30,7 @@
30 * 0.1 F1OAT 07.06.98 Add timer polling routine for channel arbitration 30 * 0.1 F1OAT 07.06.98 Add timer polling routine for channel arbitration
31 * 0.2 F6FBB 08.06.98 Added delay after FPGA programming 31 * 0.2 F6FBB 08.06.98 Added delay after FPGA programming
32 * 0.3 F6FBB 29.07.98 Delayed PTT implementation for dupmode=2 32 * 0.3 F6FBB 29.07.98 Delayed PTT implementation for dupmode=2
33 * 0.4 F6FBB 30.07.98 Added TxTail, Slottime and Persistance 33 * 0.4 F6FBB 30.07.98 Added TxTail, Slottime and Persistence
34 * 0.5 F6FBB 01.08.98 Shared IRQs, /proc/net and network statistics 34 * 0.5 F6FBB 01.08.98 Shared IRQs, /proc/net and network statistics
35 * 0.6 F6FBB 25.08.98 Added 1200Bds format 35 * 0.6 F6FBB 25.08.98 Added 1200Bds format
36 * 0.7 F6FBB 12.09.98 Added to the kernel configuration 36 * 0.7 F6FBB 12.09.98 Added to the kernel configuration
diff --git a/drivers/net/hp100.c b/drivers/net/hp100.c
index 8e2c4601b5f5..8e10d2f6a5ad 100644
--- a/drivers/net/hp100.c
+++ b/drivers/net/hp100.c
@@ -180,8 +180,8 @@ struct hp100_private {
180 180
181 u_int *page_vaddr_algn; /* Aligned virtual address of allocated page */ 181 u_int *page_vaddr_algn; /* Aligned virtual address of allocated page */
182 u_long whatever_offset; /* Offset to bus/phys/dma address */ 182 u_long whatever_offset; /* Offset to bus/phys/dma address */
183 int rxrcommit; /* # Rx PDLs commited to adapter */ 183 int rxrcommit; /* # Rx PDLs committed to adapter */
184 int txrcommit; /* # Tx PDLs commited to adapter */ 184 int txrcommit; /* # Tx PDLs committed to adapter */
185}; 185};
186 186
187/* 187/*
@@ -716,7 +716,7 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
716 * implemented/tested only with the lassen chip anyway... */ 716 * implemented/tested only with the lassen chip anyway... */
717 if (lp->mode == 1) { /* busmaster */ 717 if (lp->mode == 1) { /* busmaster */
718 dma_addr_t page_baddr; 718 dma_addr_t page_baddr;
719 /* Get physically continous memory for TX & RX PDLs */ 719 /* Get physically continuous memory for TX & RX PDLs */
720 /* Conversion to new PCI API : 720 /* Conversion to new PCI API :
721 * Pages are always aligned and zeroed, no need to it ourself. 721 * Pages are always aligned and zeroed, no need to it ourself.
722 * Doc says should be OK for EISA bus as well - Jean II */ 722 * Doc says should be OK for EISA bus as well - Jean II */
@@ -1596,7 +1596,7 @@ drop:
1596 1596
1597/* clean_txring checks if packets have been sent by the card by reading 1597/* clean_txring checks if packets have been sent by the card by reading
1598 * the TX_PDL register from the performance page and comparing it to the 1598 * the TX_PDL register from the performance page and comparing it to the
1599 * number of commited packets. It then frees the skb's of the packets that 1599 * number of committed packets. It then frees the skb's of the packets that
1600 * obviously have been sent to the network. 1600 * obviously have been sent to the network.
1601 * 1601 *
1602 * Needs the PERFORMANCE page selected. 1602 * Needs the PERFORMANCE page selected.
@@ -1617,7 +1617,7 @@ static void hp100_clean_txring(struct net_device *dev)
1617 1617
1618#ifdef HP100_DEBUG 1618#ifdef HP100_DEBUG
1619 if (donecount > MAX_TX_PDL) 1619 if (donecount > MAX_TX_PDL)
1620 printk("hp100: %s: Warning: More PDLs transmitted than commited to card???\n", dev->name); 1620 printk("hp100: %s: Warning: More PDLs transmitted than committed to card???\n", dev->name);
1621#endif 1621#endif
1622 1622
1623 for (; 0 != donecount; donecount--) { 1623 for (; 0 != donecount; donecount--) {
@@ -1765,7 +1765,7 @@ drop:
1765 * Receive Function (Non-Busmaster mode) 1765 * Receive Function (Non-Busmaster mode)
1766 * Called when an "Receive Packet" interrupt occurs, i.e. the receive 1766 * Called when an "Receive Packet" interrupt occurs, i.e. the receive
1767 * packet counter is non-zero. 1767 * packet counter is non-zero.
1768 * For non-busmaster, this function does the whole work of transfering 1768 * For non-busmaster, this function does the whole work of transferring
1769 * the packet to the host memory and then up to higher layers via skb 1769 * the packet to the host memory and then up to higher layers via skb
1770 * and netif_rx. 1770 * and netif_rx.
1771 */ 1771 */
@@ -1892,7 +1892,7 @@ static void hp100_rx_bm(struct net_device *dev)
1892 /* RX_PKT_CNT states how many PDLs are currently formatted and available to 1892 /* RX_PKT_CNT states how many PDLs are currently formatted and available to
1893 * the cards BM engine */ 1893 * the cards BM engine */
1894 if ((hp100_inw(RX_PKT_CNT) & 0x00ff) >= lp->rxrcommit) { 1894 if ((hp100_inw(RX_PKT_CNT) & 0x00ff) >= lp->rxrcommit) {
1895 printk("hp100: %s: More packets received than commited? RX_PKT_CNT=0x%x, commit=0x%x\n", 1895 printk("hp100: %s: More packets received than committed? RX_PKT_CNT=0x%x, commit=0x%x\n",
1896 dev->name, hp100_inw(RX_PKT_CNT) & 0x00ff, 1896 dev->name, hp100_inw(RX_PKT_CNT) & 0x00ff,
1897 lp->rxrcommit); 1897 lp->rxrcommit);
1898 return; 1898 return;
@@ -2256,7 +2256,7 @@ static irqreturn_t hp100_interrupt(int irq, void *dev_id)
2256 if (lp->mode != 1) /* non busmaster */ 2256 if (lp->mode != 1) /* non busmaster */
2257 hp100_rx(dev); 2257 hp100_rx(dev);
2258 else if (!(val & HP100_RX_PDL_FILL_COMPL)) { 2258 else if (!(val & HP100_RX_PDL_FILL_COMPL)) {
2259 /* Shouldnt happen - maybe we missed a RX_PDL_FILL Interrupt? */ 2259 /* Shouldn't happen - maybe we missed a RX_PDL_FILL Interrupt? */
2260 hp100_rx_bm(dev); 2260 hp100_rx_bm(dev);
2261 } 2261 }
2262 } 2262 }
diff --git a/drivers/net/hp100.h b/drivers/net/hp100.h
index e6ca128a5564..b60e96fe38b4 100644
--- a/drivers/net/hp100.h
+++ b/drivers/net/hp100.h
@@ -109,7 +109,7 @@
109#define HP100_REG_MAC_CFG_2 0x0d /* RW: (8) Misc MAC functions */ 109#define HP100_REG_MAC_CFG_2 0x0d /* RW: (8) Misc MAC functions */
110#define HP100_REG_MAC_CFG_3 0x0e /* RW: (8) Misc MAC functions */ 110#define HP100_REG_MAC_CFG_3 0x0e /* RW: (8) Misc MAC functions */
111#define HP100_REG_MAC_CFG_4 0x0f /* R: (8) Misc MAC states */ 111#define HP100_REG_MAC_CFG_4 0x0f /* R: (8) Misc MAC states */
112#define HP100_REG_DROPPED 0x10 /* R: (16),11:0 Pkts cant fit in mem */ 112#define HP100_REG_DROPPED 0x10 /* R: (16),11:0 Pkts can't fit in mem */
113#define HP100_REG_CRC 0x12 /* R: (8) Pkts with CRC */ 113#define HP100_REG_CRC 0x12 /* R: (8) Pkts with CRC */
114#define HP100_REG_ABORT 0x13 /* R: (8) Aborted Tx pkts */ 114#define HP100_REG_ABORT 0x13 /* R: (8) Aborted Tx pkts */
115#define HP100_REG_TRAIN_REQUEST 0x14 /* RW: (16) Endnode MAC register. */ 115#define HP100_REG_TRAIN_REQUEST 0x14 /* RW: (16) Endnode MAC register. */
diff --git a/drivers/net/ibm_newemac/tah.c b/drivers/net/ibm_newemac/tah.c
index 8ead6a96abaa..5f51bf7c9dc5 100644
--- a/drivers/net/ibm_newemac/tah.c
+++ b/drivers/net/ibm_newemac/tah.c
@@ -60,7 +60,7 @@ void tah_reset(struct platform_device *ofdev)
60 printk(KERN_ERR "%s: reset timeout\n", 60 printk(KERN_ERR "%s: reset timeout\n",
61 ofdev->dev.of_node->full_name); 61 ofdev->dev.of_node->full_name);
62 62
63 /* 10KB TAH TX FIFO accomodates the max MTU of 9000 */ 63 /* 10KB TAH TX FIFO accommodates the max MTU of 9000 */
64 out_be32(&p->mr, 64 out_be32(&p->mr,
65 TAH_MR_CVR | TAH_MR_ST_768 | TAH_MR_TFS_10KB | TAH_MR_DTFP | 65 TAH_MR_CVR | TAH_MR_ST_768 | TAH_MR_TFS_10KB | TAH_MR_DTFP |
66 TAH_MR_DIG); 66 TAH_MR_DIG);
diff --git a/drivers/net/ibmlana.c b/drivers/net/ibmlana.c
index 94d9969ec0bb..8ff68ae6b520 100644
--- a/drivers/net/ibmlana.c
+++ b/drivers/net/ibmlana.c
@@ -53,7 +53,7 @@ History:
53 still work with 2.0.x.... 53 still work with 2.0.x....
54 Jan 28th, 2000 54 Jan 28th, 2000
55 in Linux 2.2.13, the version.h file mysteriously didn't get 55 in Linux 2.2.13, the version.h file mysteriously didn't get
56 included. Added a workaround for this. Futhermore, it now 56 included. Added a workaround for this. Furthermore, it now
57 not only compiles as a modules ;-) 57 not only compiles as a modules ;-)
58 Jan 30th, 2000 58 Jan 30th, 2000
59 newer kernels automatically probe more than one board, so the 59 newer kernels automatically probe more than one board, so the
@@ -481,7 +481,7 @@ static void InitBoard(struct net_device *dev)
481 if ((dev->flags & IFF_ALLMULTI) || netdev_mc_count(dev) > camcnt) 481 if ((dev->flags & IFF_ALLMULTI) || netdev_mc_count(dev) > camcnt)
482 rcrval |= RCREG_AMC; 482 rcrval |= RCREG_AMC;
483 483
484 /* promiscous mode ? */ 484 /* promiscuous mode ? */
485 485
486 if (dev->flags & IFF_PROMISC) 486 if (dev->flags & IFF_PROMISC)
487 rcrval |= RCREG_PRO; 487 rcrval |= RCREG_PRO;
diff --git a/drivers/net/ibmlana.h b/drivers/net/ibmlana.h
index aa3ddbdee4bb..accd5efc9c8a 100644
--- a/drivers/net/ibmlana.h
+++ b/drivers/net/ibmlana.h
@@ -90,7 +90,7 @@ typedef struct {
90#define RCREG_ERR 0x8000 /* accept damaged and collided pkts */ 90#define RCREG_ERR 0x8000 /* accept damaged and collided pkts */
91#define RCREG_RNT 0x4000 /* accept packets that are < 64 */ 91#define RCREG_RNT 0x4000 /* accept packets that are < 64 */
92#define RCREG_BRD 0x2000 /* accept broadcasts */ 92#define RCREG_BRD 0x2000 /* accept broadcasts */
93#define RCREG_PRO 0x1000 /* promiscous mode */ 93#define RCREG_PRO 0x1000 /* promiscuous mode */
94#define RCREG_AMC 0x0800 /* accept all multicasts */ 94#define RCREG_AMC 0x0800 /* accept all multicasts */
95#define RCREG_LB_NONE 0x0000 /* no loopback */ 95#define RCREG_LB_NONE 0x0000 /* no loopback */
96#define RCREG_LB_MAC 0x0200 /* MAC loopback */ 96#define RCREG_LB_MAC 0x0200 /* MAC loopback */
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c
index 90c5e01e9235..ce8255fc3c52 100644
--- a/drivers/net/igb/e1000_mac.c
+++ b/drivers/net/igb/e1000_mac.c
@@ -181,7 +181,7 @@ s32 igb_vfta_set(struct e1000_hw *hw, u32 vid, bool add)
181 * address and must override the actual permanent MAC address. If an 181 * address and must override the actual permanent MAC address. If an
182 * alternate MAC address is fopund it is saved in the hw struct and 182 * alternate MAC address is fopund it is saved in the hw struct and
183 * prgrammed into RAR0 and the cuntion returns success, otherwise the 183 * prgrammed into RAR0 and the cuntion returns success, otherwise the
184 * fucntion returns an error. 184 * function returns an error.
185 **/ 185 **/
186s32 igb_check_alt_mac_addr(struct e1000_hw *hw) 186s32 igb_check_alt_mac_addr(struct e1000_hw *hw)
187{ 187{
@@ -982,7 +982,7 @@ out:
982} 982}
983 983
984/** 984/**
985 * igb_get_speed_and_duplex_copper - Retreive current speed/duplex 985 * igb_get_speed_and_duplex_copper - Retrieve current speed/duplex
986 * @hw: pointer to the HW structure 986 * @hw: pointer to the HW structure
987 * @speed: stores the current speed 987 * @speed: stores the current speed
988 * @duplex: stores the current duplex 988 * @duplex: stores the current duplex
diff --git a/drivers/net/igb/e1000_phy.c b/drivers/net/igb/e1000_phy.c
index 6694bf3e5ad9..d639706eb3f6 100644
--- a/drivers/net/igb/e1000_phy.c
+++ b/drivers/net/igb/e1000_phy.c
@@ -1421,7 +1421,7 @@ out:
1421} 1421}
1422 1422
1423/** 1423/**
1424 * igb_check_downshift - Checks whether a downshift in speed occured 1424 * igb_check_downshift - Checks whether a downshift in speed occurred
1425 * @hw: pointer to the HW structure 1425 * @hw: pointer to the HW structure
1426 * 1426 *
1427 * Success returns 0, Failure returns 1 1427 * Success returns 0, Failure returns 1
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index 3d850af0cdda..0dfd1b93829e 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -200,7 +200,7 @@ static struct pci_driver igb_driver = {
200 .probe = igb_probe, 200 .probe = igb_probe,
201 .remove = __devexit_p(igb_remove), 201 .remove = __devexit_p(igb_remove),
202#ifdef CONFIG_PM 202#ifdef CONFIG_PM
203 /* Power Managment Hooks */ 203 /* Power Management Hooks */
204 .suspend = igb_suspend, 204 .suspend = igb_suspend,
205 .resume = igb_resume, 205 .resume = igb_resume,
206#endif 206#endif
@@ -2292,7 +2292,7 @@ static void igb_init_hw_timer(struct igb_adapter *adapter)
2292 /** 2292 /**
2293 * Scale the NIC clock cycle by a large factor so that 2293 * Scale the NIC clock cycle by a large factor so that
2294 * relatively small clock corrections can be added or 2294 * relatively small clock corrections can be added or
2295 * substracted at each clock tick. The drawbacks of a large 2295 * subtracted at each clock tick. The drawbacks of a large
2296 * factor are a) that the clock register overflows more quickly 2296 * factor are a) that the clock register overflows more quickly
2297 * (not such a big deal) and b) that the increment per tick has 2297 * (not such a big deal) and b) that the increment per tick has
2298 * to fit into 24 bits. As a result we need to use a shift of 2298 * to fit into 24 bits. As a result we need to use a shift of
@@ -3409,7 +3409,7 @@ static void igb_set_rx_mode(struct net_device *netdev)
3409 } else { 3409 } else {
3410 /* 3410 /*
3411 * Write addresses to the MTA, if the attempt fails 3411 * Write addresses to the MTA, if the attempt fails
3412 * then we should just turn on promiscous mode so 3412 * then we should just turn on promiscuous mode so
3413 * that we can at least receive multicast traffic 3413 * that we can at least receive multicast traffic
3414 */ 3414 */
3415 count = igb_write_mc_addr_list(netdev); 3415 count = igb_write_mc_addr_list(netdev);
@@ -3423,7 +3423,7 @@ static void igb_set_rx_mode(struct net_device *netdev)
3423 /* 3423 /*
3424 * Write addresses to available RAR registers, if there is not 3424 * Write addresses to available RAR registers, if there is not
3425 * sufficient space to store all the addresses then enable 3425 * sufficient space to store all the addresses then enable
3426 * unicast promiscous mode 3426 * unicast promiscuous mode
3427 */ 3427 */
3428 count = igb_write_uc_addr_list(netdev); 3428 count = igb_write_uc_addr_list(netdev);
3429 if (count < 0) { 3429 if (count < 0) {
@@ -4317,7 +4317,7 @@ netdev_tx_t igb_xmit_frame_ring_adv(struct sk_buff *skb,
4317 4317
4318 /* 4318 /*
4319 * count reflects descriptors mapped, if 0 or less then mapping error 4319 * count reflects descriptors mapped, if 0 or less then mapping error
4320 * has occured and we need to rewind the descriptor queue 4320 * has occurred and we need to rewind the descriptor queue
4321 */ 4321 */
4322 count = igb_tx_map_adv(tx_ring, skb, first); 4322 count = igb_tx_map_adv(tx_ring, skb, first);
4323 if (!count) { 4323 if (!count) {
@@ -5352,8 +5352,8 @@ static void igb_msg_task(struct igb_adapter *adapter)
5352 * The unicast table address is a register array of 32-bit registers. 5352 * The unicast table address is a register array of 32-bit registers.
5353 * The table is meant to be used in a way similar to how the MTA is used 5353 * The table is meant to be used in a way similar to how the MTA is used
5354 * however due to certain limitations in the hardware it is necessary to 5354 * however due to certain limitations in the hardware it is necessary to
5355 * set all the hash bits to 1 and use the VMOLR ROPE bit as a promiscous 5355 * set all the hash bits to 1 and use the VMOLR ROPE bit as a promiscuous
5356 * enable bit to allow vlan tag stripping when promiscous mode is enabled 5356 * enable bit to allow vlan tag stripping when promiscuous mode is enabled
5357 **/ 5357 **/
5358static void igb_set_uta(struct igb_adapter *adapter) 5358static void igb_set_uta(struct igb_adapter *adapter)
5359{ 5359{
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 6ccc32fd7338..1d04ca6fdaea 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -2227,7 +2227,7 @@ static netdev_tx_t igbvf_xmit_frame_ring_adv(struct sk_buff *skb,
2227 2227
2228 /* 2228 /*
2229 * count reflects descriptors mapped, if 0 then mapping error 2229 * count reflects descriptors mapped, if 0 then mapping error
2230 * has occured and we need to rewind the descriptor queue 2230 * has occurred and we need to rewind the descriptor queue
2231 */ 2231 */
2232 count = igbvf_tx_map_adv(adapter, tx_ring, skb, first); 2232 count = igbvf_tx_map_adv(adapter, tx_ring, skb, first);
2233 2233
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index a5b0f0e194bb..58cd3202b48c 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -486,14 +486,14 @@ static int ipg_config_autoneg(struct net_device *dev)
486 phyctrl = ipg_r8(PHY_CTRL); 486 phyctrl = ipg_r8(PHY_CTRL);
487 mac_ctrl_val = ipg_r32(MAC_CTRL); 487 mac_ctrl_val = ipg_r32(MAC_CTRL);
488 488
489 /* Set flags for use in resolving auto-negotation, assuming 489 /* Set flags for use in resolving auto-negotiation, assuming
490 * non-1000Mbps, half duplex, no flow control. 490 * non-1000Mbps, half duplex, no flow control.
491 */ 491 */
492 fullduplex = 0; 492 fullduplex = 0;
493 txflowcontrol = 0; 493 txflowcontrol = 0;
494 rxflowcontrol = 0; 494 rxflowcontrol = 0;
495 495
496 /* To accomodate a problem in 10Mbps operation, 496 /* To accommodate a problem in 10Mbps operation,
497 * set a global flag if PHY running in 10Mbps mode. 497 * set a global flag if PHY running in 10Mbps mode.
498 */ 498 */
499 sp->tenmbpsmode = 0; 499 sp->tenmbpsmode = 0;
@@ -846,7 +846,7 @@ static void init_tfdlist(struct net_device *dev)
846} 846}
847 847
848/* 848/*
849 * Free all transmit buffers which have already been transfered 849 * Free all transmit buffers which have already been transferred
850 * via DMA to the IPG. 850 * via DMA to the IPG.
851 */ 851 */
852static void ipg_nic_txfree(struct net_device *dev) 852static void ipg_nic_txfree(struct net_device *dev)
@@ -920,7 +920,7 @@ static void ipg_tx_timeout(struct net_device *dev)
920 920
921/* 921/*
922 * For TxComplete interrupts, free all transmit 922 * For TxComplete interrupts, free all transmit
923 * buffers which have already been transfered via DMA 923 * buffers which have already been transferred via DMA
924 * to the IPG. 924 * to the IPG.
925 */ 925 */
926static void ipg_nic_txcleanup(struct net_device *dev) 926static void ipg_nic_txcleanup(struct net_device *dev)
@@ -1141,13 +1141,13 @@ static int ipg_nic_rx_check_error(struct net_device *dev)
1141 1141
1142 /* Increment detailed receive error statistics. */ 1142 /* Increment detailed receive error statistics. */
1143 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFIFOOVERRUN) { 1143 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFIFOOVERRUN) {
1144 IPG_DEBUG_MSG("RX FIFO overrun occured.\n"); 1144 IPG_DEBUG_MSG("RX FIFO overrun occurred.\n");
1145 1145
1146 sp->stats.rx_fifo_errors++; 1146 sp->stats.rx_fifo_errors++;
1147 } 1147 }
1148 1148
1149 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXRUNTFRAME) { 1149 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXRUNTFRAME) {
1150 IPG_DEBUG_MSG("RX runt occured.\n"); 1150 IPG_DEBUG_MSG("RX runt occurred.\n");
1151 sp->stats.rx_length_errors++; 1151 sp->stats.rx_length_errors++;
1152 } 1152 }
1153 1153
@@ -1156,7 +1156,7 @@ static int ipg_nic_rx_check_error(struct net_device *dev)
1156 */ 1156 */
1157 1157
1158 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXALIGNMENTERROR) { 1158 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXALIGNMENTERROR) {
1159 IPG_DEBUG_MSG("RX alignment error occured.\n"); 1159 IPG_DEBUG_MSG("RX alignment error occurred.\n");
1160 sp->stats.rx_frame_errors++; 1160 sp->stats.rx_frame_errors++;
1161 } 1161 }
1162 1162
@@ -1421,12 +1421,12 @@ static int ipg_nic_rx(struct net_device *dev)
1421 1421
1422 /* Increment detailed receive error statistics. */ 1422 /* Increment detailed receive error statistics. */
1423 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFIFOOVERRUN) { 1423 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXFIFOOVERRUN) {
1424 IPG_DEBUG_MSG("RX FIFO overrun occured.\n"); 1424 IPG_DEBUG_MSG("RX FIFO overrun occurred.\n");
1425 sp->stats.rx_fifo_errors++; 1425 sp->stats.rx_fifo_errors++;
1426 } 1426 }
1427 1427
1428 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXRUNTFRAME) { 1428 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXRUNTFRAME) {
1429 IPG_DEBUG_MSG("RX runt occured.\n"); 1429 IPG_DEBUG_MSG("RX runt occurred.\n");
1430 sp->stats.rx_length_errors++; 1430 sp->stats.rx_length_errors++;
1431 } 1431 }
1432 1432
@@ -1436,7 +1436,7 @@ static int ipg_nic_rx(struct net_device *dev)
1436 */ 1436 */
1437 1437
1438 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXALIGNMENTERROR) { 1438 if (le64_to_cpu(rxfd->rfs) & IPG_RFS_RXALIGNMENTERROR) {
1439 IPG_DEBUG_MSG("RX alignment error occured.\n"); 1439 IPG_DEBUG_MSG("RX alignment error occurred.\n");
1440 sp->stats.rx_frame_errors++; 1440 sp->stats.rx_frame_errors++;
1441 } 1441 }
1442 1442
@@ -1460,7 +1460,7 @@ static int ipg_nic_rx(struct net_device *dev)
1460 } 1460 }
1461 } else { 1461 } else {
1462 1462
1463 /* Adjust the new buffer length to accomodate the size 1463 /* Adjust the new buffer length to accommodate the size
1464 * of the received frame. 1464 * of the received frame.
1465 */ 1465 */
1466 skb_put(skb, framelen); 1466 skb_put(skb, framelen);
@@ -1488,7 +1488,7 @@ static int ipg_nic_rx(struct net_device *dev)
1488 } 1488 }
1489 1489
1490 /* 1490 /*
1491 * If there are more RFDs to proces and the allocated amount of RFD 1491 * If there are more RFDs to process and the allocated amount of RFD
1492 * processing time has expired, assert Interrupt Requested to make 1492 * processing time has expired, assert Interrupt Requested to make
1493 * sure we come back to process the remaining RFDs. 1493 * sure we come back to process the remaining RFDs.
1494 */ 1494 */
@@ -1886,7 +1886,7 @@ static netdev_tx_t ipg_nic_hard_start_xmit(struct sk_buff *skb,
1886 /* Request TxComplete interrupts at an interval defined 1886 /* Request TxComplete interrupts at an interval defined
1887 * by the constant IPG_FRAMESBETWEENTXCOMPLETES. 1887 * by the constant IPG_FRAMESBETWEENTXCOMPLETES.
1888 * Request TxComplete interrupt for every frame 1888 * Request TxComplete interrupt for every frame
1889 * if in 10Mbps mode to accomodate problem with 10Mbps 1889 * if in 10Mbps mode to accommodate problem with 10Mbps
1890 * processing. 1890 * processing.
1891 */ 1891 */
1892 if (sp->tenmbpsmode) 1892 if (sp->tenmbpsmode)
@@ -2098,7 +2098,7 @@ static int ipg_nic_change_mtu(struct net_device *dev, int new_mtu)
2098 struct ipg_nic_private *sp = netdev_priv(dev); 2098 struct ipg_nic_private *sp = netdev_priv(dev);
2099 int err; 2099 int err;
2100 2100
2101 /* Function to accomodate changes to Maximum Transfer Unit 2101 /* Function to accommodate changes to Maximum Transfer Unit
2102 * (or MTU) of IPG NIC. Cannot use default function since 2102 * (or MTU) of IPG NIC. Cannot use default function since
2103 * the default will not allow for MTU > 1500 bytes. 2103 * the default will not allow for MTU > 1500 bytes.
2104 */ 2104 */
diff --git a/drivers/net/irda/ali-ircc.c b/drivers/net/irda/ali-ircc.c
index 92631eb6f6a3..872183f29ec4 100644
--- a/drivers/net/irda/ali-ircc.c
+++ b/drivers/net/irda/ali-ircc.c
@@ -76,7 +76,7 @@ static int ali_ircc_probe_53(ali_chip_t *chip, chipio_t *info);
76static int ali_ircc_init_43(ali_chip_t *chip, chipio_t *info); 76static int ali_ircc_init_43(ali_chip_t *chip, chipio_t *info);
77static int ali_ircc_init_53(ali_chip_t *chip, chipio_t *info); 77static int ali_ircc_init_53(ali_chip_t *chip, chipio_t *info);
78 78
79/* These are the currently known ALi sourth-bridge chipsets, the only one difference 79/* These are the currently known ALi south-bridge chipsets, the only one difference
80 * is that M1543C doesn't support HP HDSL-3600 80 * is that M1543C doesn't support HP HDSL-3600
81 */ 81 */
82static ali_chip_t chips[] = 82static ali_chip_t chips[] =
@@ -1108,7 +1108,7 @@ static void ali_ircc_sir_change_speed(struct ali_ircc_cb *priv, __u32 speed)
1108 outb(lcr, iobase+UART_LCR); /* Set 8N1 */ 1108 outb(lcr, iobase+UART_LCR); /* Set 8N1 */
1109 outb(fcr, iobase+UART_FCR); /* Enable FIFO's */ 1109 outb(fcr, iobase+UART_FCR); /* Enable FIFO's */
1110 1110
1111 /* without this, the conection will be broken after come back from FIR speed, 1111 /* without this, the connection will be broken after come back from FIR speed,
1112 but with this, the SIR connection is harder to established */ 1112 but with this, the SIR connection is harder to established */
1113 outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase+UART_MCR); 1113 outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase+UART_MCR);
1114 1114
diff --git a/drivers/net/irda/donauboe.c b/drivers/net/irda/donauboe.c
index f81d944fc360..174cafad2c1a 100644
--- a/drivers/net/irda/donauboe.c
+++ b/drivers/net/irda/donauboe.c
@@ -56,7 +56,7 @@
56/* do_probe module parameter Enable this code */ 56/* do_probe module parameter Enable this code */
57/* Probe code is very useful for understanding how the hardware works */ 57/* Probe code is very useful for understanding how the hardware works */
58/* Use it with various combinations of TT_LEN, RX_LEN */ 58/* Use it with various combinations of TT_LEN, RX_LEN */
59/* Strongly recomended, disable if the probe fails on your machine */ 59/* Strongly recommended, disable if the probe fails on your machine */
60/* and send me <james@fishsoup.dhs.org> the output of dmesg */ 60/* and send me <james@fishsoup.dhs.org> the output of dmesg */
61#define USE_PROBE 1 61#define USE_PROBE 1
62#undef USE_PROBE 62#undef USE_PROBE
diff --git a/drivers/net/irda/donauboe.h b/drivers/net/irda/donauboe.h
index 77fcf4459161..d92d54e839b9 100644
--- a/drivers/net/irda/donauboe.h
+++ b/drivers/net/irda/donauboe.h
@@ -51,7 +51,7 @@
51 51
52/* The documentation for this chip is allegedly released */ 52/* The documentation for this chip is allegedly released */
53/* However I have not seen it, not have I managed to contact */ 53/* However I have not seen it, not have I managed to contact */
54/* anyone who has. HOWEVER the chip bears a striking resemblence */ 54/* anyone who has. HOWEVER the chip bears a striking resemblance */
55/* to the IrDA controller in the Toshiba RISC TMPR3922 chip */ 55/* to the IrDA controller in the Toshiba RISC TMPR3922 chip */
56/* the documentation for this is freely available at */ 56/* the documentation for this is freely available at */
57/* http://www.madingley.org/james/resources/toshoboe/TMPR3922.pdf */ 57/* http://www.madingley.org/james/resources/toshoboe/TMPR3922.pdf */
diff --git a/drivers/net/irda/girbil-sir.c b/drivers/net/irda/girbil-sir.c
index a31b8fa8aaa9..96cdecff349d 100644
--- a/drivers/net/irda/girbil-sir.c
+++ b/drivers/net/irda/girbil-sir.c
@@ -38,7 +38,7 @@ static int girbil_change_speed(struct sir_dev *dev, unsigned speed);
38/* Control register 1 */ 38/* Control register 1 */
39#define GIRBIL_TXEN 0x01 /* Enable transmitter */ 39#define GIRBIL_TXEN 0x01 /* Enable transmitter */
40#define GIRBIL_RXEN 0x02 /* Enable receiver */ 40#define GIRBIL_RXEN 0x02 /* Enable receiver */
41#define GIRBIL_ECAN 0x04 /* Cancel self emmited data */ 41#define GIRBIL_ECAN 0x04 /* Cancel self emitted data */
42#define GIRBIL_ECHO 0x08 /* Echo control characters */ 42#define GIRBIL_ECHO 0x08 /* Echo control characters */
43 43
44/* LED Current Register (0x2) */ 44/* LED Current Register (0x2) */
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index e4ea61944c22..d9267cb98a23 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -370,7 +370,7 @@ static void speed_bulk_callback(struct urb *urb)
370 /* urb is now available */ 370 /* urb is now available */
371 //urb->status = 0; -> tested above 371 //urb->status = 0; -> tested above
372 372
373 /* New speed and xbof is now commited in hardware */ 373 /* New speed and xbof is now committed in hardware */
374 self->new_speed = -1; 374 self->new_speed = -1;
375 self->new_xbofs = -1; 375 self->new_xbofs = -1;
376 376
@@ -602,7 +602,7 @@ static void write_bulk_callback(struct urb *urb)
602 IRDA_DEBUG(1, "%s(), Changing speed now...\n", __func__); 602 IRDA_DEBUG(1, "%s(), Changing speed now...\n", __func__);
603 irda_usb_change_speed_xbofs(self); 603 irda_usb_change_speed_xbofs(self);
604 } else { 604 } else {
605 /* New speed and xbof is now commited in hardware */ 605 /* New speed and xbof is now committed in hardware */
606 self->new_speed = -1; 606 self->new_speed = -1;
607 self->new_xbofs = -1; 607 self->new_xbofs = -1;
608 /* Done, waiting for next packet */ 608 /* Done, waiting for next packet */
diff --git a/drivers/net/irda/mcs7780.c b/drivers/net/irda/mcs7780.c
index cc821de2c966..be52bfed66a9 100644
--- a/drivers/net/irda/mcs7780.c
+++ b/drivers/net/irda/mcs7780.c
@@ -588,7 +588,7 @@ static int mcs_speed_change(struct mcs_cb *mcs)
588 588
589 mcs_get_reg(mcs, MCS_MODE_REG, &rval); 589 mcs_get_reg(mcs, MCS_MODE_REG, &rval);
590 590
591 /* MINRXPW values recomended by MosChip */ 591 /* MINRXPW values recommended by MosChip */
592 if (mcs->new_speed <= 115200) { 592 if (mcs->new_speed <= 115200) {
593 rval &= ~MCS_FIR; 593 rval &= ~MCS_FIR;
594 594
@@ -799,7 +799,7 @@ static void mcs_receive_irq(struct urb *urb)
799 ret = usb_submit_urb(urb, GFP_ATOMIC); 799 ret = usb_submit_urb(urb, GFP_ATOMIC);
800} 800}
801 801
802/* Transmit callback funtion. */ 802/* Transmit callback function. */
803static void mcs_send_irq(struct urb *urb) 803static void mcs_send_irq(struct urb *urb)
804{ 804{
805 struct mcs_cb *mcs = urb->context; 805 struct mcs_cb *mcs = urb->context;
@@ -811,7 +811,7 @@ static void mcs_send_irq(struct urb *urb)
811 netif_wake_queue(ndev); 811 netif_wake_queue(ndev);
812} 812}
813 813
814/* Transmit callback funtion. */ 814/* Transmit callback function. */
815static netdev_tx_t mcs_hard_xmit(struct sk_buff *skb, 815static netdev_tx_t mcs_hard_xmit(struct sk_buff *skb,
816 struct net_device *ndev) 816 struct net_device *ndev)
817{ 817{
diff --git a/drivers/net/irda/nsc-ircc.c b/drivers/net/irda/nsc-ircc.c
index 559fe854d76d..7a963d4e6d06 100644
--- a/drivers/net/irda/nsc-ircc.c
+++ b/drivers/net/irda/nsc-ircc.c
@@ -716,7 +716,7 @@ static int nsc_ircc_probe_338(nsc_chip_t *chip, chipio_t *info)
716 int reg, com = 0; 716 int reg, com = 0;
717 int pnp; 717 int pnp;
718 718
719 /* Read funtion enable register (FER) */ 719 /* Read function enable register (FER) */
720 outb(CFG_338_FER, cfg_base); 720 outb(CFG_338_FER, cfg_base);
721 reg = inb(cfg_base+1); 721 reg = inb(cfg_base+1);
722 722
diff --git a/drivers/net/irda/nsc-ircc.h b/drivers/net/irda/nsc-ircc.h
index 7ba7738759b9..32fa58211fad 100644
--- a/drivers/net/irda/nsc-ircc.h
+++ b/drivers/net/irda/nsc-ircc.h
@@ -135,7 +135,7 @@
135#define LSR_TXRDY 0x20 /* Transmitter ready */ 135#define LSR_TXRDY 0x20 /* Transmitter ready */
136#define LSR_TXEMP 0x40 /* Transmitter empty */ 136#define LSR_TXEMP 0x40 /* Transmitter empty */
137 137
138#define ASCR 0x07 /* Auxillary Status and Control Register */ 138#define ASCR 0x07 /* Auxiliary Status and Control Register */
139#define ASCR_RXF_TOUT 0x01 /* Rx FIFO timeout */ 139#define ASCR_RXF_TOUT 0x01 /* Rx FIFO timeout */
140#define ASCR_FEND_INF 0x02 /* Frame end bytes in rx FIFO */ 140#define ASCR_FEND_INF 0x02 /* Frame end bytes in rx FIFO */
141#define ASCR_S_EOT 0x04 /* Set end of transmission */ 141#define ASCR_S_EOT 0x04 /* Set end of transmission */
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index c192c31e4c5c..001ed0a255f6 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -40,7 +40,7 @@
40 40
41#define ICCR0_AME (1 << 7) /* Address match enable */ 41#define ICCR0_AME (1 << 7) /* Address match enable */
42#define ICCR0_TIE (1 << 6) /* Transmit FIFO interrupt enable */ 42#define ICCR0_TIE (1 << 6) /* Transmit FIFO interrupt enable */
43#define ICCR0_RIE (1 << 5) /* Recieve FIFO interrupt enable */ 43#define ICCR0_RIE (1 << 5) /* Receive FIFO interrupt enable */
44#define ICCR0_RXE (1 << 4) /* Receive enable */ 44#define ICCR0_RXE (1 << 4) /* Receive enable */
45#define ICCR0_TXE (1 << 3) /* Transmit enable */ 45#define ICCR0_TXE (1 << 3) /* Transmit enable */
46#define ICCR0_TUS (1 << 2) /* Transmit FIFO underrun select */ 46#define ICCR0_TUS (1 << 2) /* Transmit FIFO underrun select */
@@ -483,7 +483,7 @@ static irqreturn_t pxa_irda_fir_irq(int irq, void *dev_id)
483 } 483 }
484 484
485 if (icsr0 & ICSR0_EIF) { 485 if (icsr0 & ICSR0_EIF) {
486 /* An error in FIFO occured, or there is a end of frame */ 486 /* An error in FIFO occurred, or there is a end of frame */
487 pxa_irda_fir_irq_eif(si, dev, icsr0); 487 pxa_irda_fir_irq_eif(si, dev, icsr0);
488 } 488 }
489 489
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c
index 1c1677cfea29..8800e1fe4129 100644
--- a/drivers/net/irda/smsc-ircc2.c
+++ b/drivers/net/irda/smsc-ircc2.c
@@ -1582,7 +1582,7 @@ static irqreturn_t smsc_ircc_interrupt_sir(struct net_device *dev)
1582 int iobase; 1582 int iobase;
1583 int iir, lsr; 1583 int iir, lsr;
1584 1584
1585 /* Already locked comming here in smsc_ircc_interrupt() */ 1585 /* Already locked coming here in smsc_ircc_interrupt() */
1586 /*spin_lock(&self->lock);*/ 1586 /*spin_lock(&self->lock);*/
1587 1587
1588 iobase = self->io.sir_base; 1588 iobase = self->io.sir_base;
diff --git a/drivers/net/irda/via-ircc.c b/drivers/net/irda/via-ircc.c
index 67c0ad42d818..f504b262ba36 100644
--- a/drivers/net/irda/via-ircc.c
+++ b/drivers/net/irda/via-ircc.c
@@ -29,7 +29,7 @@ F02 Oct/28/02: Add SB device ID for 3147 and 3177.
29 29
302004-02-16: <sda@bdit.de> 302004-02-16: <sda@bdit.de>
31- Removed unneeded 'legacy' pci stuff. 31- Removed unneeded 'legacy' pci stuff.
32- Make sure SIR mode is set (hw_init()) before calling mode-dependant stuff. 32- Make sure SIR mode is set (hw_init()) before calling mode-dependent stuff.
33- On speed change from core, don't send SIR frame with new speed. 33- On speed change from core, don't send SIR frame with new speed.
34 Use current speed and change speeds later. 34 Use current speed and change speeds later.
35- Make module-param dongle_id actually work. 35- Make module-param dongle_id actually work.
@@ -75,15 +75,9 @@ static int dongle_id = 0; /* default: probe */
75/* We can't guess the type of connected dongle, user *must* supply it. */ 75/* We can't guess the type of connected dongle, user *must* supply it. */
76module_param(dongle_id, int, 0); 76module_param(dongle_id, int, 0);
77 77
78/* FIXME : we should not need this, because instances should be automatically
79 * managed by the PCI layer. Especially that we seem to only be using the
80 * first entry. Jean II */
81/* Max 4 instances for now */
82static struct via_ircc_cb *dev_self[] = { NULL, NULL, NULL, NULL };
83
84/* Some prototypes */ 78/* Some prototypes */
85static int via_ircc_open(int i, chipio_t * info, unsigned int id); 79static int via_ircc_open(struct pci_dev *pdev, chipio_t * info,
86static int via_ircc_close(struct via_ircc_cb *self); 80 unsigned int id);
87static int via_ircc_dma_receive(struct via_ircc_cb *self); 81static int via_ircc_dma_receive(struct via_ircc_cb *self);
88static int via_ircc_dma_receive_complete(struct via_ircc_cb *self, 82static int via_ircc_dma_receive_complete(struct via_ircc_cb *self,
89 int iobase); 83 int iobase);
@@ -215,7 +209,7 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi
215 pci_write_config_byte(pcidev,0x42,(bTmp | 0xf0)); 209 pci_write_config_byte(pcidev,0x42,(bTmp | 0xf0));
216 pci_write_config_byte(pcidev,0x5a,0xc0); 210 pci_write_config_byte(pcidev,0x5a,0xc0);
217 WriteLPCReg(0x28, 0x70 ); 211 WriteLPCReg(0x28, 0x70 );
218 if (via_ircc_open(0, &info,0x3076) == 0) 212 if (via_ircc_open(pcidev, &info, 0x3076) == 0)
219 rc=0; 213 rc=0;
220 } else 214 } else
221 rc = -ENODEV; //IR not turn on 215 rc = -ENODEV; //IR not turn on
@@ -254,7 +248,7 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi
254 info.irq=FirIRQ; 248 info.irq=FirIRQ;
255 info.dma=FirDRQ1; 249 info.dma=FirDRQ1;
256 info.dma2=FirDRQ0; 250 info.dma2=FirDRQ0;
257 if (via_ircc_open(0, &info,0x3096) == 0) 251 if (via_ircc_open(pcidev, &info, 0x3096) == 0)
258 rc=0; 252 rc=0;
259 } else 253 } else
260 rc = -ENODEV; //IR not turn on !!!!! 254 rc = -ENODEV; //IR not turn on !!!!!
@@ -264,48 +258,10 @@ static int __devinit via_init_one (struct pci_dev *pcidev, const struct pci_devi
264 return rc; 258 return rc;
265} 259}
266 260
267/*
268 * Function via_ircc_clean ()
269 *
270 * Close all configured chips
271 *
272 */
273static void via_ircc_clean(void)
274{
275 int i;
276
277 IRDA_DEBUG(3, "%s()\n", __func__);
278
279 for (i=0; i < ARRAY_SIZE(dev_self); i++) {
280 if (dev_self[i])
281 via_ircc_close(dev_self[i]);
282 }
283}
284
285static void __devexit via_remove_one (struct pci_dev *pdev)
286{
287 IRDA_DEBUG(3, "%s()\n", __func__);
288
289 /* FIXME : This is ugly. We should use pci_get_drvdata(pdev);
290 * to get our driver instance and call directly via_ircc_close().
291 * See vlsi_ir for details...
292 * Jean II */
293 via_ircc_clean();
294
295 /* FIXME : This should be in via_ircc_close(), because here we may
296 * theoritically disable still configured devices :-( - Jean II */
297 pci_disable_device(pdev);
298}
299
300static void __exit via_ircc_cleanup(void) 261static void __exit via_ircc_cleanup(void)
301{ 262{
302 IRDA_DEBUG(3, "%s()\n", __func__); 263 IRDA_DEBUG(3, "%s()\n", __func__);
303 264
304 /* FIXME : This should be redundant, as pci_unregister_driver()
305 * should call via_remove_one() on each device.
306 * Jean II */
307 via_ircc_clean();
308
309 /* Cleanup all instances of the driver */ 265 /* Cleanup all instances of the driver */
310 pci_unregister_driver (&via_driver); 266 pci_unregister_driver (&via_driver);
311} 267}
@@ -324,12 +280,13 @@ static const struct net_device_ops via_ircc_fir_ops = {
324}; 280};
325 281
326/* 282/*
327 * Function via_ircc_open (iobase, irq) 283 * Function via_ircc_open(pdev, iobase, irq)
328 * 284 *
329 * Open driver instance 285 * Open driver instance
330 * 286 *
331 */ 287 */
332static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id) 288static __devinit int via_ircc_open(struct pci_dev *pdev, chipio_t * info,
289 unsigned int id)
333{ 290{
334 struct net_device *dev; 291 struct net_device *dev;
335 struct via_ircc_cb *self; 292 struct via_ircc_cb *self;
@@ -337,9 +294,6 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
337 294
338 IRDA_DEBUG(3, "%s()\n", __func__); 295 IRDA_DEBUG(3, "%s()\n", __func__);
339 296
340 if (i >= ARRAY_SIZE(dev_self))
341 return -ENOMEM;
342
343 /* Allocate new instance of the driver */ 297 /* Allocate new instance of the driver */
344 dev = alloc_irdadev(sizeof(struct via_ircc_cb)); 298 dev = alloc_irdadev(sizeof(struct via_ircc_cb));
345 if (dev == NULL) 299 if (dev == NULL)
@@ -349,13 +303,8 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
349 self->netdev = dev; 303 self->netdev = dev;
350 spin_lock_init(&self->lock); 304 spin_lock_init(&self->lock);
351 305
352 /* FIXME : We should store our driver instance in the PCI layer, 306 pci_set_drvdata(pdev, self);
353 * using pci_set_drvdata(), not in this array. 307
354 * See vlsi_ir for details... - Jean II */
355 /* FIXME : 'i' is always 0 (see via_init_one()) :-( - Jean II */
356 /* Need to store self somewhere */
357 dev_self[i] = self;
358 self->index = i;
359 /* Initialize Resource */ 308 /* Initialize Resource */
360 self->io.cfg_base = info->cfg_base; 309 self->io.cfg_base = info->cfg_base;
361 self->io.fir_base = info->fir_base; 310 self->io.fir_base = info->fir_base;
@@ -385,7 +334,7 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
385 self->io.dongle_id = dongle_id; 334 self->io.dongle_id = dongle_id;
386 335
387 /* The only value we must override it the baudrate */ 336 /* The only value we must override it the baudrate */
388 /* Maximum speeds and capabilities are dongle-dependant. */ 337 /* Maximum speeds and capabilities are dongle-dependent. */
389 switch( self->io.dongle_id ){ 338 switch( self->io.dongle_id ){
390 case 0x0d: 339 case 0x0d:
391 self->qos.baud_rate.bits = 340 self->qos.baud_rate.bits =
@@ -414,7 +363,7 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
414 363
415 /* Allocate memory if needed */ 364 /* Allocate memory if needed */
416 self->rx_buff.head = 365 self->rx_buff.head =
417 dma_alloc_coherent(NULL, self->rx_buff.truesize, 366 dma_alloc_coherent(&pdev->dev, self->rx_buff.truesize,
418 &self->rx_buff_dma, GFP_KERNEL); 367 &self->rx_buff_dma, GFP_KERNEL);
419 if (self->rx_buff.head == NULL) { 368 if (self->rx_buff.head == NULL) {
420 err = -ENOMEM; 369 err = -ENOMEM;
@@ -423,7 +372,7 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
423 memset(self->rx_buff.head, 0, self->rx_buff.truesize); 372 memset(self->rx_buff.head, 0, self->rx_buff.truesize);
424 373
425 self->tx_buff.head = 374 self->tx_buff.head =
426 dma_alloc_coherent(NULL, self->tx_buff.truesize, 375 dma_alloc_coherent(&pdev->dev, self->tx_buff.truesize,
427 &self->tx_buff_dma, GFP_KERNEL); 376 &self->tx_buff_dma, GFP_KERNEL);
428 if (self->tx_buff.head == NULL) { 377 if (self->tx_buff.head == NULL) {
429 err = -ENOMEM; 378 err = -ENOMEM;
@@ -455,33 +404,32 @@ static __devinit int via_ircc_open(int i, chipio_t * info, unsigned int id)
455 via_hw_init(self); 404 via_hw_init(self);
456 return 0; 405 return 0;
457 err_out4: 406 err_out4:
458 dma_free_coherent(NULL, self->tx_buff.truesize, 407 dma_free_coherent(&pdev->dev, self->tx_buff.truesize,
459 self->tx_buff.head, self->tx_buff_dma); 408 self->tx_buff.head, self->tx_buff_dma);
460 err_out3: 409 err_out3:
461 dma_free_coherent(NULL, self->rx_buff.truesize, 410 dma_free_coherent(&pdev->dev, self->rx_buff.truesize,
462 self->rx_buff.head, self->rx_buff_dma); 411 self->rx_buff.head, self->rx_buff_dma);
463 err_out2: 412 err_out2:
464 release_region(self->io.fir_base, self->io.fir_ext); 413 release_region(self->io.fir_base, self->io.fir_ext);
465 err_out1: 414 err_out1:
415 pci_set_drvdata(pdev, NULL);
466 free_netdev(dev); 416 free_netdev(dev);
467 dev_self[i] = NULL;
468 return err; 417 return err;
469} 418}
470 419
471/* 420/*
472 * Function via_ircc_close (self) 421 * Function via_remove_one(pdev)
473 * 422 *
474 * Close driver instance 423 * Close driver instance
475 * 424 *
476 */ 425 */
477static int via_ircc_close(struct via_ircc_cb *self) 426static void __devexit via_remove_one(struct pci_dev *pdev)
478{ 427{
428 struct via_ircc_cb *self = pci_get_drvdata(pdev);
479 int iobase; 429 int iobase;
480 430
481 IRDA_DEBUG(3, "%s()\n", __func__); 431 IRDA_DEBUG(3, "%s()\n", __func__);
482 432
483 IRDA_ASSERT(self != NULL, return -1;);
484
485 iobase = self->io.fir_base; 433 iobase = self->io.fir_base;
486 434
487 ResetChip(iobase, 5); //hardware reset. 435 ResetChip(iobase, 5); //hardware reset.
@@ -493,16 +441,16 @@ static int via_ircc_close(struct via_ircc_cb *self)
493 __func__, self->io.fir_base); 441 __func__, self->io.fir_base);
494 release_region(self->io.fir_base, self->io.fir_ext); 442 release_region(self->io.fir_base, self->io.fir_ext);
495 if (self->tx_buff.head) 443 if (self->tx_buff.head)
496 dma_free_coherent(NULL, self->tx_buff.truesize, 444 dma_free_coherent(&pdev->dev, self->tx_buff.truesize,
497 self->tx_buff.head, self->tx_buff_dma); 445 self->tx_buff.head, self->tx_buff_dma);
498 if (self->rx_buff.head) 446 if (self->rx_buff.head)
499 dma_free_coherent(NULL, self->rx_buff.truesize, 447 dma_free_coherent(&pdev->dev, self->rx_buff.truesize,
500 self->rx_buff.head, self->rx_buff_dma); 448 self->rx_buff.head, self->rx_buff_dma);
501 dev_self[self->index] = NULL; 449 pci_set_drvdata(pdev, NULL);
502 450
503 free_netdev(self->netdev); 451 free_netdev(self->netdev);
504 452
505 return 0; 453 pci_disable_device(pdev);
506} 454}
507 455
508/* 456/*
diff --git a/drivers/net/irda/vlsi_ir.h b/drivers/net/irda/vlsi_ir.h
index d66fab854bf1..a076eb125349 100644
--- a/drivers/net/irda/vlsi_ir.h
+++ b/drivers/net/irda/vlsi_ir.h
@@ -209,7 +209,7 @@ enum vlsi_pio_irintr {
209 IRINTR_ACTEN = 0x80, /* activity interrupt enable */ 209 IRINTR_ACTEN = 0x80, /* activity interrupt enable */
210 IRINTR_ACTIVITY = 0x40, /* activity monitor (traffic detected) */ 210 IRINTR_ACTIVITY = 0x40, /* activity monitor (traffic detected) */
211 IRINTR_RPKTEN = 0x20, /* receive packet interrupt enable*/ 211 IRINTR_RPKTEN = 0x20, /* receive packet interrupt enable*/
212 IRINTR_RPKTINT = 0x10, /* rx-packet transfered from fifo to memory finished */ 212 IRINTR_RPKTINT = 0x10, /* rx-packet transferred from fifo to memory finished */
213 IRINTR_TPKTEN = 0x08, /* transmit packet interrupt enable */ 213 IRINTR_TPKTEN = 0x08, /* transmit packet interrupt enable */
214 IRINTR_TPKTINT = 0x04, /* last bit of tx-packet+crc shifted to ir-pulser */ 214 IRINTR_TPKTINT = 0x04, /* last bit of tx-packet+crc shifted to ir-pulser */
215 IRINTR_OE_EN = 0x02, /* UART rx fifo overrun error interrupt enable */ 215 IRINTR_OE_EN = 0x02, /* UART rx fifo overrun error interrupt enable */
@@ -739,7 +739,7 @@ typedef struct vlsi_irda_dev {
739/* the remapped error flags we use for returning from frame 739/* the remapped error flags we use for returning from frame
740 * post-processing in vlsi_process_tx/rx() after it was completed 740 * post-processing in vlsi_process_tx/rx() after it was completed
741 * by the hardware. These functions either return the >=0 number 741 * by the hardware. These functions either return the >=0 number
742 * of transfered bytes in case of success or the negative (-) 742 * of transferred bytes in case of success or the negative (-)
743 * of the or'ed error flags. 743 * of the or'ed error flags.
744 */ 744 */
745 745
diff --git a/drivers/net/ixgbe/ixgbe_dcb.c b/drivers/net/ixgbe/ixgbe_dcb.c
index 41c529fac0ab..686a17aadef3 100644
--- a/drivers/net/ixgbe/ixgbe_dcb.c
+++ b/drivers/net/ixgbe/ixgbe_dcb.c
@@ -36,7 +36,7 @@
36/** 36/**
37 * ixgbe_ieee_credits - This calculates the ieee traffic class 37 * ixgbe_ieee_credits - This calculates the ieee traffic class
38 * credits from the configured bandwidth percentages. Credits 38 * credits from the configured bandwidth percentages. Credits
39 * are the smallest unit programable into the underlying 39 * are the smallest unit programmable into the underlying
40 * hardware. The IEEE 802.1Qaz specification do not use bandwidth 40 * hardware. The IEEE 802.1Qaz specification do not use bandwidth
41 * groups so this is much simplified from the CEE case. 41 * groups so this is much simplified from the CEE case.
42 */ 42 */
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index fec4c724c37a..327c8614198c 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -360,7 +360,7 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
360 return DCB_NO_HW_CHG; 360 return DCB_NO_HW_CHG;
361 361
362 /* 362 /*
363 * Only take down the adapter if an app change occured. FCoE 363 * Only take down the adapter if an app change occurred. FCoE
364 * may shuffle tx rings in this case and this can not be done 364 * may shuffle tx rings in this case and this can not be done
365 * without a reset currently. 365 * without a reset currently.
366 */ 366 */
@@ -599,7 +599,7 @@ static u8 ixgbe_dcbnl_setapp(struct net_device *netdev,
599 break; 599 break;
600 600
601 /* The FCoE application priority may be changed multiple 601 /* The FCoE application priority may be changed multiple
602 * times in quick sucession with switches that build up 602 * times in quick succession with switches that build up
603 * TLVs. To avoid creating uneeded device resets this 603 * TLVs. To avoid creating uneeded device resets this
604 * checks the actual HW configuration and clears 604 * checks the actual HW configuration and clears
605 * BIT_APP_UPCHG if a HW configuration change is not 605 * BIT_APP_UPCHG if a HW configuration change is not
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index f17e4a7ee731..6f8adc7f5d7c 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -644,7 +644,7 @@ void ixgbe_unmap_and_free_tx_resource(struct ixgbe_ring *tx_ring,
644 * @adapter: driver private struct 644 * @adapter: driver private struct
645 * @index: reg idx of queue to query (0-127) 645 * @index: reg idx of queue to query (0-127)
646 * 646 *
647 * Helper function to determine the traffic index for a paticular 647 * Helper function to determine the traffic index for a particular
648 * register index. 648 * register index.
649 * 649 *
650 * Returns : a tc index for use in range 0-7, or 0-3 650 * Returns : a tc index for use in range 0-7, or 0-3
@@ -3556,7 +3556,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
3556 } else { 3556 } else {
3557 /* 3557 /*
3558 * Write addresses to the MTA, if the attempt fails 3558 * Write addresses to the MTA, if the attempt fails
3559 * then we should just turn on promiscous mode so 3559 * then we should just turn on promiscuous mode so
3560 * that we can at least receive multicast traffic 3560 * that we can at least receive multicast traffic
3561 */ 3561 */
3562 hw->mac.ops.update_mc_addr_list(hw, netdev); 3562 hw->mac.ops.update_mc_addr_list(hw, netdev);
@@ -3567,7 +3567,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
3567 /* 3567 /*
3568 * Write addresses to available RAR registers, if there is not 3568 * Write addresses to available RAR registers, if there is not
3569 * sufficient space to store all the addresses then enable 3569 * sufficient space to store all the addresses then enable
3570 * unicast promiscous mode 3570 * unicast promiscuous mode
3571 */ 3571 */
3572 count = ixgbe_write_uc_addr_list(netdev); 3572 count = ixgbe_write_uc_addr_list(netdev);
3573 if (count < 0) { 3573 if (count < 0) {
@@ -4443,7 +4443,7 @@ static inline bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter)
4443} 4443}
4444 4444
4445/* 4445/*
4446 * ixgbe_set_num_queues: Allocate queues for device, feature dependant 4446 * ixgbe_set_num_queues: Allocate queues for device, feature dependent
4447 * @adapter: board private structure to initialize 4447 * @adapter: board private structure to initialize
4448 * 4448 *
4449 * This is the top level queue allocation routine. The order here is very 4449 * This is the top level queue allocation routine. The order here is very
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c
index f72f705f6183..df5b8aa4795d 100644
--- a/drivers/net/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ixgbe/ixgbe_phy.c
@@ -1694,7 +1694,7 @@ static void ixgbe_i2c_bus_clear(struct ixgbe_hw *hw)
1694} 1694}
1695 1695
1696/** 1696/**
1697 * ixgbe_tn_check_overtemp - Checks if an overtemp occured. 1697 * ixgbe_tn_check_overtemp - Checks if an overtemp occurred.
1698 * @hw: pointer to hardware structure 1698 * @hw: pointer to hardware structure
1699 * 1699 *
1700 * Checks if the LASI temp alarm status was triggered due to overtemp 1700 * Checks if the LASI temp alarm status was triggered due to overtemp
diff --git a/drivers/net/ixgbe/ixgbe_x540.c b/drivers/net/ixgbe/ixgbe_x540.c
index f47e93fe32be..d9323c08f5c7 100644
--- a/drivers/net/ixgbe/ixgbe_x540.c
+++ b/drivers/net/ixgbe/ixgbe_x540.c
@@ -573,7 +573,7 @@ static s32 ixgbe_acquire_swfw_sync_X540(struct ixgbe_hw *hw, u16 mask)
573 * @hw: pointer to hardware structure 573 * @hw: pointer to hardware structure
574 * @mask: Mask to specify which semaphore to release 574 * @mask: Mask to specify which semaphore to release
575 * 575 *
576 * Releases the SWFW semaphore throught the SW_FW_SYNC register 576 * Releases the SWFW semaphore through the SW_FW_SYNC register
577 * for the specified function (CSR, PHY0, PHY1, EVM, Flash) 577 * for the specified function (CSR, PHY0, PHY1, EVM, Flash)
578 **/ 578 **/
579static void ixgbe_release_swfw_sync_X540(struct ixgbe_hw *hw, u16 mask) 579static void ixgbe_release_swfw_sync_X540(struct ixgbe_hw *hw, u16 mask)
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 054ab05b7c6a..05fa7c85deed 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -1925,7 +1925,7 @@ static void ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter,
1925} 1925}
1926 1926
1927/* 1927/*
1928 * ixgbevf_set_num_queues: Allocate queues for device, feature dependant 1928 * ixgbevf_set_num_queues: Allocate queues for device, feature dependent
1929 * @adapter: board private structure to initialize 1929 * @adapter: board private structure to initialize
1930 * 1930 *
1931 * This is the top level queue allocation routine. The order here is very 1931 * This is the top level queue allocation routine. The order here is very
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index f690474f4409..994c80939c7a 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -273,7 +273,7 @@ jme_clear_pm(struct jme_adapter *jme)
273{ 273{
274 jwrite32(jme, JME_PMCS, 0xFFFF0000 | jme->reg_pmcs); 274 jwrite32(jme, JME_PMCS, 0xFFFF0000 | jme->reg_pmcs);
275 pci_set_power_state(jme->pdev, PCI_D0); 275 pci_set_power_state(jme->pdev, PCI_D0);
276 pci_enable_wake(jme->pdev, PCI_D0, false); 276 device_set_wakeup_enable(&jme->pdev->dev, false);
277} 277}
278 278
279static int 279static int
@@ -2538,6 +2538,8 @@ jme_set_wol(struct net_device *netdev,
2538 2538
2539 jwrite32(jme, JME_PMCS, jme->reg_pmcs); 2539 jwrite32(jme, JME_PMCS, jme->reg_pmcs);
2540 2540
2541 device_set_wakeup_enable(&jme->pdev->dev, jme->reg_pmcs);
2542
2541 return 0; 2543 return 0;
2542} 2544}
2543 2545
@@ -3172,9 +3174,9 @@ jme_shutdown(struct pci_dev *pdev)
3172} 3174}
3173 3175
3174#ifdef CONFIG_PM 3176#ifdef CONFIG_PM
3175static int 3177static int jme_suspend(struct device *dev)
3176jme_suspend(struct pci_dev *pdev, pm_message_t state)
3177{ 3178{
3179 struct pci_dev *pdev = to_pci_dev(dev);
3178 struct net_device *netdev = pci_get_drvdata(pdev); 3180 struct net_device *netdev = pci_get_drvdata(pdev);
3179 struct jme_adapter *jme = netdev_priv(netdev); 3181 struct jme_adapter *jme = netdev_priv(netdev);
3180 3182
@@ -3206,22 +3208,18 @@ jme_suspend(struct pci_dev *pdev, pm_message_t state)
3206 tasklet_hi_enable(&jme->rxclean_task); 3208 tasklet_hi_enable(&jme->rxclean_task);
3207 tasklet_hi_enable(&jme->rxempty_task); 3209 tasklet_hi_enable(&jme->rxempty_task);
3208 3210
3209 pci_save_state(pdev);
3210 jme_powersave_phy(jme); 3211 jme_powersave_phy(jme);
3211 pci_enable_wake(jme->pdev, PCI_D3hot, true);
3212 pci_set_power_state(pdev, PCI_D3hot);
3213 3212
3214 return 0; 3213 return 0;
3215} 3214}
3216 3215
3217static int 3216static int jme_resume(struct device *dev)
3218jme_resume(struct pci_dev *pdev)
3219{ 3217{
3218 struct pci_dev *pdev = to_pci_dev(dev);
3220 struct net_device *netdev = pci_get_drvdata(pdev); 3219 struct net_device *netdev = pci_get_drvdata(pdev);
3221 struct jme_adapter *jme = netdev_priv(netdev); 3220 struct jme_adapter *jme = netdev_priv(netdev);
3222 3221
3223 jme_clear_pm(jme); 3222 jwrite32(jme, JME_PMCS, 0xFFFF0000 | jme->reg_pmcs);
3224 pci_restore_state(pdev);
3225 3223
3226 jme_phy_on(jme); 3224 jme_phy_on(jme);
3227 if (test_bit(JME_FLAG_SSET, &jme->flags)) 3225 if (test_bit(JME_FLAG_SSET, &jme->flags))
@@ -3238,6 +3236,13 @@ jme_resume(struct pci_dev *pdev)
3238 3236
3239 return 0; 3237 return 0;
3240} 3238}
3239
3240static SIMPLE_DEV_PM_OPS(jme_pm_ops, jme_suspend, jme_resume);
3241#define JME_PM_OPS (&jme_pm_ops)
3242
3243#else
3244
3245#define JME_PM_OPS NULL
3241#endif 3246#endif
3242 3247
3243static DEFINE_PCI_DEVICE_TABLE(jme_pci_tbl) = { 3248static DEFINE_PCI_DEVICE_TABLE(jme_pci_tbl) = {
@@ -3251,11 +3256,8 @@ static struct pci_driver jme_driver = {
3251 .id_table = jme_pci_tbl, 3256 .id_table = jme_pci_tbl,
3252 .probe = jme_init_one, 3257 .probe = jme_init_one,
3253 .remove = __devexit_p(jme_remove_one), 3258 .remove = __devexit_p(jme_remove_one),
3254#ifdef CONFIG_PM
3255 .suspend = jme_suspend,
3256 .resume = jme_resume,
3257#endif /* CONFIG_PM */
3258 .shutdown = jme_shutdown, 3259 .shutdown = jme_shutdown,
3260 .driver.pm = JME_PM_OPS,
3259}; 3261};
3260 3262
3261static int __init 3263static int __init
diff --git a/drivers/net/ks8842.c b/drivers/net/ks8842.c
index 928b2b83cef5..f0d8346d0fa5 100644
--- a/drivers/net/ks8842.c
+++ b/drivers/net/ks8842.c
@@ -26,6 +26,7 @@
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/module.h> 27#include <linux/module.h>
28#include <linux/platform_device.h> 28#include <linux/platform_device.h>
29#include <linux/mfd/core.h>
29#include <linux/netdevice.h> 30#include <linux/netdevice.h>
30#include <linux/etherdevice.h> 31#include <linux/etherdevice.h>
31#include <linux/ethtool.h> 32#include <linux/ethtool.h>
@@ -320,7 +321,7 @@ static void ks8842_reset_hw(struct ks8842_adapter *adapter)
320 /* RX 2 kb high watermark */ 321 /* RX 2 kb high watermark */
321 ks8842_write16(adapter, 0, 0x1000, REG_QRFCR); 322 ks8842_write16(adapter, 0, 0x1000, REG_QRFCR);
322 323
323 /* aggresive back off in half duplex */ 324 /* aggressive back off in half duplex */
324 ks8842_enable_bits(adapter, 32, 1 << 8, REG_SGCR1); 325 ks8842_enable_bits(adapter, 32, 1 << 8, REG_SGCR1);
325 326
326 /* enable no excessive collison drop */ 327 /* enable no excessive collison drop */
@@ -1145,7 +1146,7 @@ static int __devinit ks8842_probe(struct platform_device *pdev)
1145 struct resource *iomem; 1146 struct resource *iomem;
1146 struct net_device *netdev; 1147 struct net_device *netdev;
1147 struct ks8842_adapter *adapter; 1148 struct ks8842_adapter *adapter;
1148 struct ks8842_platform_data *pdata = pdev->dev.platform_data; 1149 struct ks8842_platform_data *pdata = mfd_get_data(pdev);
1149 u16 id; 1150 u16 id;
1150 unsigned i; 1151 unsigned i;
1151 1152
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c
index 0fa4a9887ba2..bcd9ba68c9f2 100644
--- a/drivers/net/ks8851.c
+++ b/drivers/net/ks8851.c
@@ -141,7 +141,7 @@ static int msg_enable;
141 * 141 *
142 * All these calls issue SPI transactions to access the chip's registers. They 142 * All these calls issue SPI transactions to access the chip's registers. They
143 * all require that the necessary lock is held to prevent accesses when the 143 * all require that the necessary lock is held to prevent accesses when the
144 * chip is busy transfering packet data (RX/TX FIFO accesses). 144 * chip is busy transferring packet data (RX/TX FIFO accesses).
145 */ 145 */
146 146
147/** 147/**
@@ -483,7 +483,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
483 * 483 *
484 * This form of operation would require us to hold the SPI bus' 484 * This form of operation would require us to hold the SPI bus'
485 * chipselect low during the entie transaction to avoid any 485 * chipselect low during the entie transaction to avoid any
486 * reset to the data stream comming from the chip. 486 * reset to the data stream coming from the chip.
487 */ 487 */
488 488
489 for (; rxfc != 0; rxfc--) { 489 for (; rxfc != 0; rxfc--) {
@@ -634,7 +634,7 @@ static void ks8851_irq_work(struct work_struct *work)
634 634
635/** 635/**
636 * calc_txlen - calculate size of message to send packet 636 * calc_txlen - calculate size of message to send packet
637 * @len: Lenght of data 637 * @len: Length of data
638 * 638 *
639 * Returns the size of the TXFIFO message needed to send 639 * Returns the size of the TXFIFO message needed to send
640 * this packet. 640 * this packet.
@@ -1472,7 +1472,7 @@ static int ks8851_phy_reg(int reg)
1472 * @reg: The register to read. 1472 * @reg: The register to read.
1473 * 1473 *
1474 * This call reads data from the PHY register specified in @reg. Since the 1474 * This call reads data from the PHY register specified in @reg. Since the
1475 * device does not support all the MII registers, the non-existant values 1475 * device does not support all the MII registers, the non-existent values
1476 * are always returned as zero. 1476 * are always returned as zero.
1477 * 1477 *
1478 * We return zero for unsupported registers as the MII code does not check 1478 * We return zero for unsupported registers as the MII code does not check
diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
index 2e2c69b24062..61631cace913 100644
--- a/drivers/net/ks8851_mll.c
+++ b/drivers/net/ks8851_mll.c
@@ -470,7 +470,7 @@ static int msg_enable;
470 * 470 *
471 * All these calls issue transactions to access the chip's registers. They 471 * All these calls issue transactions to access the chip's registers. They
472 * all require that the necessary lock is held to prevent accesses when the 472 * all require that the necessary lock is held to prevent accesses when the
473 * chip is busy transfering packet data (RX/TX FIFO accesses). 473 * chip is busy transferring packet data (RX/TX FIFO accesses).
474 */ 474 */
475 475
476/** 476/**
@@ -1364,7 +1364,7 @@ static int ks_phy_reg(int reg)
1364 * @reg: The register to read. 1364 * @reg: The register to read.
1365 * 1365 *
1366 * This call reads data from the PHY register specified in @reg. Since the 1366 * This call reads data from the PHY register specified in @reg. Since the
1367 * device does not support all the MII registers, the non-existant values 1367 * device does not support all the MII registers, the non-existent values
1368 * are always returned as zero. 1368 * are always returned as zero.
1369 * 1369 *
1370 * We return zero for unsupported registers as the MII code does not check 1370 * We return zero for unsupported registers as the MII code does not check
diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c
index 540a8dcbcc46..7f7d5708a658 100644
--- a/drivers/net/ksz884x.c
+++ b/drivers/net/ksz884x.c
@@ -4898,7 +4898,7 @@ static netdev_tx_t netdev_tx(struct sk_buff *skb, struct net_device *dev)
4898 goto unlock; 4898 goto unlock;
4899 } 4899 }
4900 skb_copy_and_csum_dev(org_skb, skb->data); 4900 skb_copy_and_csum_dev(org_skb, skb->data);
4901 org_skb->ip_summed = 0; 4901 org_skb->ip_summed = CHECKSUM_NONE;
4902 skb->len = org_skb->len; 4902 skb->len = org_skb->len;
4903 copy_old_skb(org_skb, skb); 4903 copy_old_skb(org_skb, skb);
4904 } 4904 }
diff --git a/drivers/net/lib8390.c b/drivers/net/lib8390.c
index da74db4a03d4..17b75e5f1b0a 100644
--- a/drivers/net/lib8390.c
+++ b/drivers/net/lib8390.c
@@ -35,7 +35,7 @@
35 Alexey Kuznetsov : use the 8390's six bit hash multicast filter. 35 Alexey Kuznetsov : use the 8390's six bit hash multicast filter.
36 Paul Gortmaker : tweak ANK's above multicast changes a bit. 36 Paul Gortmaker : tweak ANK's above multicast changes a bit.
37 Paul Gortmaker : update packet statistics for v2.1.x 37 Paul Gortmaker : update packet statistics for v2.1.x
38 Alan Cox : support arbitary stupid port mappings on the 38 Alan Cox : support arbitrary stupid port mappings on the
39 68K Macintosh. Support >16bit I/O spaces 39 68K Macintosh. Support >16bit I/O spaces
40 Paul Gortmaker : add kmod support for auto-loading of the 8390 40 Paul Gortmaker : add kmod support for auto-loading of the 8390
41 module by all drivers that require it. 41 module by all drivers that require it.
@@ -121,7 +121,7 @@ static void __NS8390_init(struct net_device *dev, int startp);
121/* 121/*
122 * SMP and the 8390 setup. 122 * SMP and the 8390 setup.
123 * 123 *
124 * The 8390 isnt exactly designed to be multithreaded on RX/TX. There is 124 * The 8390 isn't exactly designed to be multithreaded on RX/TX. There is
125 * a page register that controls bank and packet buffer access. We guard 125 * a page register that controls bank and packet buffer access. We guard
126 * this with ei_local->page_lock. Nobody should assume or set the page other 126 * this with ei_local->page_lock. Nobody should assume or set the page other
127 * than zero when the lock is not held. Lock holders must restore page 0 127 * than zero when the lock is not held. Lock holders must restore page 0
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index ea0dc451da9c..d70fb76edb77 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -173,7 +173,8 @@ static void loopback_setup(struct net_device *dev)
173 | NETIF_F_RXCSUM 173 | NETIF_F_RXCSUM
174 | NETIF_F_HIGHDMA 174 | NETIF_F_HIGHDMA
175 | NETIF_F_LLTX 175 | NETIF_F_LLTX
176 | NETIF_F_NETNS_LOCAL; 176 | NETIF_F_NETNS_LOCAL
177 | NETIF_F_VLAN_CHALLENGED;
177 dev->ethtool_ops = &loopback_ethtool_ops; 178 dev->ethtool_ops = &loopback_ethtool_ops;
178 dev->header_ops = &eth_header_ops; 179 dev->header_ops = &eth_header_ops;
179 dev->netdev_ops = &loopback_ops; 180 dev->netdev_ops = &loopback_ops;
diff --git a/drivers/net/lp486e.c b/drivers/net/lp486e.c
index 3698824744cb..385a95311cd2 100644
--- a/drivers/net/lp486e.c
+++ b/drivers/net/lp486e.c
@@ -27,7 +27,7 @@
27 27
28 Credits: 28 Credits:
29 Thanks to Murphy Software BV for letting me write this in their time. 29 Thanks to Murphy Software BV for letting me write this in their time.
30 Well, actually, I get payed doing this... 30 Well, actually, I get paid doing this...
31 (Also: see http://www.murphy.nl for murphy, and my homepage ~ard for 31 (Also: see http://www.murphy.nl for murphy, and my homepage ~ard for
32 more information on the Professional Workstation) 32 more information on the Professional Workstation)
33 33
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 5b37d3c191e4..78e34e9e4f00 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -39,8 +39,11 @@ struct macvlan_port {
39 struct list_head vlans; 39 struct list_head vlans;
40 struct rcu_head rcu; 40 struct rcu_head rcu;
41 bool passthru; 41 bool passthru;
42 int count;
42}; 43};
43 44
45static void macvlan_port_destroy(struct net_device *dev);
46
44#define macvlan_port_get_rcu(dev) \ 47#define macvlan_port_get_rcu(dev) \
45 ((struct macvlan_port *) rcu_dereference(dev->rx_handler_data)) 48 ((struct macvlan_port *) rcu_dereference(dev->rx_handler_data))
46#define macvlan_port_get(dev) ((struct macvlan_port *) dev->rx_handler_data) 49#define macvlan_port_get(dev) ((struct macvlan_port *) dev->rx_handler_data)
@@ -457,8 +460,13 @@ static int macvlan_init(struct net_device *dev)
457static void macvlan_uninit(struct net_device *dev) 460static void macvlan_uninit(struct net_device *dev)
458{ 461{
459 struct macvlan_dev *vlan = netdev_priv(dev); 462 struct macvlan_dev *vlan = netdev_priv(dev);
463 struct macvlan_port *port = vlan->port;
460 464
461 free_percpu(vlan->pcpu_stats); 465 free_percpu(vlan->pcpu_stats);
466
467 port->count -= 1;
468 if (!port->count)
469 macvlan_port_destroy(port->dev);
462} 470}
463 471
464static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev, 472static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev,
@@ -691,12 +699,13 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
691 vlan->mode = nla_get_u32(data[IFLA_MACVLAN_MODE]); 699 vlan->mode = nla_get_u32(data[IFLA_MACVLAN_MODE]);
692 700
693 if (vlan->mode == MACVLAN_MODE_PASSTHRU) { 701 if (vlan->mode == MACVLAN_MODE_PASSTHRU) {
694 if (!list_empty(&port->vlans)) 702 if (port->count)
695 return -EINVAL; 703 return -EINVAL;
696 port->passthru = true; 704 port->passthru = true;
697 memcpy(dev->dev_addr, lowerdev->dev_addr, ETH_ALEN); 705 memcpy(dev->dev_addr, lowerdev->dev_addr, ETH_ALEN);
698 } 706 }
699 707
708 port->count += 1;
700 err = register_netdevice(dev); 709 err = register_netdevice(dev);
701 if (err < 0) 710 if (err < 0)
702 goto destroy_port; 711 goto destroy_port;
@@ -707,7 +716,8 @@ int macvlan_common_newlink(struct net *src_net, struct net_device *dev,
707 return 0; 716 return 0;
708 717
709destroy_port: 718destroy_port:
710 if (list_empty(&port->vlans)) 719 port->count -= 1;
720 if (!port->count)
711 macvlan_port_destroy(lowerdev); 721 macvlan_port_destroy(lowerdev);
712 722
713 return err; 723 return err;
@@ -725,13 +735,9 @@ static int macvlan_newlink(struct net *src_net, struct net_device *dev,
725void macvlan_dellink(struct net_device *dev, struct list_head *head) 735void macvlan_dellink(struct net_device *dev, struct list_head *head)
726{ 736{
727 struct macvlan_dev *vlan = netdev_priv(dev); 737 struct macvlan_dev *vlan = netdev_priv(dev);
728 struct macvlan_port *port = vlan->port;
729 738
730 list_del(&vlan->list); 739 list_del(&vlan->list);
731 unregister_netdevice_queue(dev, head); 740 unregister_netdevice_queue(dev, head);
732
733 if (list_empty(&port->vlans))
734 macvlan_port_destroy(port->dev);
735} 741}
736EXPORT_SYMBOL_GPL(macvlan_dellink); 742EXPORT_SYMBOL_GPL(macvlan_dellink);
737 743
diff --git a/drivers/net/meth.h b/drivers/net/meth.h
index a78dc1ca8c29..5b145c6bad60 100644
--- a/drivers/net/meth.h
+++ b/drivers/net/meth.h
@@ -144,7 +144,7 @@ typedef struct rx_packet {
144 /* Bits 22 through 28 are used to determine IPGR2 */ 144 /* Bits 22 through 28 are used to determine IPGR2 */
145 145
146#define METH_REV_SHIFT 29 /* Bits 29 through 31 are used to determine the revision */ 146#define METH_REV_SHIFT 29 /* Bits 29 through 31 are used to determine the revision */
147 /* 000: Inital revision */ 147 /* 000: Initial revision */
148 /* 001: First revision, Improved TX concatenation */ 148 /* 001: First revision, Improved TX concatenation */
149 149
150 150
@@ -193,7 +193,7 @@ typedef struct rx_packet {
193 /* 1: A TX message had the INT request bit set, the packet has been sent. */ 193 /* 1: A TX message had the INT request bit set, the packet has been sent. */
194#define METH_INT_TX_LINK_FAIL BIT(2) /* 0: No interrupt pending, 1: PHY has reported a link failure */ 194#define METH_INT_TX_LINK_FAIL BIT(2) /* 0: No interrupt pending, 1: PHY has reported a link failure */
195#define METH_INT_MEM_ERROR BIT(3) /* 0: No interrupt pending */ 195#define METH_INT_MEM_ERROR BIT(3) /* 0: No interrupt pending */
196 /* 1: A memory error occurred durring DMA, DMA stopped, Fatal */ 196 /* 1: A memory error occurred during DMA, DMA stopped, Fatal */
197#define METH_INT_TX_ABORT BIT(4) /* 0: No interrupt pending, 1: The TX aborted operation, DMA stopped, FATAL */ 197#define METH_INT_TX_ABORT BIT(4) /* 0: No interrupt pending, 1: The TX aborted operation, DMA stopped, FATAL */
198#define METH_INT_RX_THRESHOLD BIT(5) /* 0: No interrupt pending, 1: Selected receive threshold condition Valid */ 198#define METH_INT_RX_THRESHOLD BIT(5) /* 0: No interrupt pending, 1: Selected receive threshold condition Valid */
199#define METH_INT_RX_UNDERFLOW BIT(6) /* 0: No interrupt pending, 1: FIFO was empty, packet could not be queued */ 199#define METH_INT_RX_UNDERFLOW BIT(6) /* 0: No interrupt pending, 1: FIFO was empty, packet could not be queued */
diff --git a/drivers/net/mlx4/alloc.c b/drivers/net/mlx4/alloc.c
index 3a4277f6fac4..116cae334dad 100644
--- a/drivers/net/mlx4/alloc.c
+++ b/drivers/net/mlx4/alloc.c
@@ -62,6 +62,9 @@ u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap)
62 } else 62 } else
63 obj = -1; 63 obj = -1;
64 64
65 if (obj != -1)
66 --bitmap->avail;
67
65 spin_unlock(&bitmap->lock); 68 spin_unlock(&bitmap->lock);
66 69
67 return obj; 70 return obj;
@@ -101,11 +104,19 @@ u32 mlx4_bitmap_alloc_range(struct mlx4_bitmap *bitmap, int cnt, int align)
101 } else 104 } else
102 obj = -1; 105 obj = -1;
103 106
107 if (obj != -1)
108 bitmap->avail -= cnt;
109
104 spin_unlock(&bitmap->lock); 110 spin_unlock(&bitmap->lock);
105 111
106 return obj; 112 return obj;
107} 113}
108 114
115u32 mlx4_bitmap_avail(struct mlx4_bitmap *bitmap)
116{
117 return bitmap->avail;
118}
119
109void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt) 120void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt)
110{ 121{
111 obj &= bitmap->max + bitmap->reserved_top - 1; 122 obj &= bitmap->max + bitmap->reserved_top - 1;
@@ -115,6 +126,7 @@ void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt)
115 bitmap->last = min(bitmap->last, obj); 126 bitmap->last = min(bitmap->last, obj);
116 bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top) 127 bitmap->top = (bitmap->top + bitmap->max + bitmap->reserved_top)
117 & bitmap->mask; 128 & bitmap->mask;
129 bitmap->avail += cnt;
118 spin_unlock(&bitmap->lock); 130 spin_unlock(&bitmap->lock);
119} 131}
120 132
@@ -130,6 +142,7 @@ int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask,
130 bitmap->max = num - reserved_top; 142 bitmap->max = num - reserved_top;
131 bitmap->mask = mask; 143 bitmap->mask = mask;
132 bitmap->reserved_top = reserved_top; 144 bitmap->reserved_top = reserved_top;
145 bitmap->avail = num - reserved_top - reserved_bot;
133 spin_lock_init(&bitmap->lock); 146 spin_lock_init(&bitmap->lock);
134 bitmap->table = kzalloc(BITS_TO_LONGS(bitmap->max) * 147 bitmap->table = kzalloc(BITS_TO_LONGS(bitmap->max) *
135 sizeof (long), GFP_KERNEL); 148 sizeof (long), GFP_KERNEL);
diff --git a/drivers/net/mlx4/cq.c b/drivers/net/mlx4/cq.c
index 7cd34e9c7c7e..bd8ef9f2fa71 100644
--- a/drivers/net/mlx4/cq.c
+++ b/drivers/net/mlx4/cq.c
@@ -198,7 +198,7 @@ int mlx4_cq_alloc(struct mlx4_dev *dev, int nent, struct mlx4_mtt *mtt,
198 u64 mtt_addr; 198 u64 mtt_addr;
199 int err; 199 int err;
200 200
201 if (vector >= dev->caps.num_comp_vectors) 201 if (vector > dev->caps.num_comp_vectors + dev->caps.comp_pool)
202 return -EINVAL; 202 return -EINVAL;
203 203
204 cq->vector = vector; 204 cq->vector = vector;
diff --git a/drivers/net/mlx4/en_cq.c b/drivers/net/mlx4/en_cq.c
index 21786ad4455e..ec4b6d047fe0 100644
--- a/drivers/net/mlx4/en_cq.c
+++ b/drivers/net/mlx4/en_cq.c
@@ -51,13 +51,10 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv,
51 int err; 51 int err;
52 52
53 cq->size = entries; 53 cq->size = entries;
54 if (mode == RX) { 54 if (mode == RX)
55 cq->buf_size = cq->size * sizeof(struct mlx4_cqe); 55 cq->buf_size = cq->size * sizeof(struct mlx4_cqe);
56 cq->vector = ring % mdev->dev->caps.num_comp_vectors; 56 else
57 } else {
58 cq->buf_size = sizeof(struct mlx4_cqe); 57 cq->buf_size = sizeof(struct mlx4_cqe);
59 cq->vector = 0;
60 }
61 58
62 cq->ring = ring; 59 cq->ring = ring;
63 cq->is_tx = mode; 60 cq->is_tx = mode;
@@ -80,7 +77,8 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv,
80int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) 77int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq)
81{ 78{
82 struct mlx4_en_dev *mdev = priv->mdev; 79 struct mlx4_en_dev *mdev = priv->mdev;
83 int err; 80 int err = 0;
81 char name[25];
84 82
85 cq->dev = mdev->pndev[priv->port]; 83 cq->dev = mdev->pndev[priv->port];
86 cq->mcq.set_ci_db = cq->wqres.db.db; 84 cq->mcq.set_ci_db = cq->wqres.db.db;
@@ -89,6 +87,29 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq)
89 *cq->mcq.arm_db = 0; 87 *cq->mcq.arm_db = 0;
90 memset(cq->buf, 0, cq->buf_size); 88 memset(cq->buf, 0, cq->buf_size);
91 89
90 if (cq->is_tx == RX) {
91 if (mdev->dev->caps.comp_pool) {
92 if (!cq->vector) {
93 sprintf(name , "%s-rx-%d", priv->dev->name, cq->ring);
94 if (mlx4_assign_eq(mdev->dev, name, &cq->vector)) {
95 cq->vector = (cq->ring + 1 + priv->port) %
96 mdev->dev->caps.num_comp_vectors;
97 mlx4_warn(mdev, "Failed Assigning an EQ to "
98 "%s_rx-%d ,Falling back to legacy EQ's\n",
99 priv->dev->name, cq->ring);
100 }
101 }
102 } else {
103 cq->vector = (cq->ring + 1 + priv->port) %
104 mdev->dev->caps.num_comp_vectors;
105 }
106 } else {
107 if (!cq->vector || !mdev->dev->caps.comp_pool) {
108 /*Fallback to legacy pool in case of error*/
109 cq->vector = 0;
110 }
111 }
112
92 if (!cq->is_tx) 113 if (!cq->is_tx)
93 cq->size = priv->rx_ring[cq->ring].actual_size; 114 cq->size = priv->rx_ring[cq->ring].actual_size;
94 115
@@ -112,12 +133,15 @@ int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq)
112 return 0; 133 return 0;
113} 134}
114 135
115void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq) 136void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
137 bool reserve_vectors)
116{ 138{
117 struct mlx4_en_dev *mdev = priv->mdev; 139 struct mlx4_en_dev *mdev = priv->mdev;
118 140
119 mlx4_en_unmap_buffer(&cq->wqres.buf); 141 mlx4_en_unmap_buffer(&cq->wqres.buf);
120 mlx4_free_hwq_res(mdev->dev, &cq->wqres, cq->buf_size); 142 mlx4_free_hwq_res(mdev->dev, &cq->wqres, cq->buf_size);
143 if (priv->mdev->dev->caps.comp_pool && cq->vector && !reserve_vectors)
144 mlx4_release_eq(priv->mdev->dev, cq->vector);
121 cq->buf_size = 0; 145 cq->buf_size = 0;
122 cq->buf = NULL; 146 cq->buf = NULL;
123} 147}
diff --git a/drivers/net/mlx4/en_ethtool.c b/drivers/net/mlx4/en_ethtool.c
index 056152b3ff58..d54b7abf0225 100644
--- a/drivers/net/mlx4/en_ethtool.c
+++ b/drivers/net/mlx4/en_ethtool.c
@@ -45,7 +45,7 @@ mlx4_en_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo)
45 struct mlx4_en_priv *priv = netdev_priv(dev); 45 struct mlx4_en_priv *priv = netdev_priv(dev);
46 struct mlx4_en_dev *mdev = priv->mdev; 46 struct mlx4_en_dev *mdev = priv->mdev;
47 47
48 sprintf(drvinfo->driver, DRV_NAME " (%s)", mdev->dev->board_id); 48 strncpy(drvinfo->driver, DRV_NAME, 32);
49 strncpy(drvinfo->version, DRV_VERSION " (" DRV_RELDATE ")", 32); 49 strncpy(drvinfo->version, DRV_VERSION " (" DRV_RELDATE ")", 32);
50 sprintf(drvinfo->fw_version, "%d.%d.%d", 50 sprintf(drvinfo->fw_version, "%d.%d.%d",
51 (u16) (mdev->dev->caps.fw_ver >> 32), 51 (u16) (mdev->dev->caps.fw_ver >> 32),
@@ -131,8 +131,65 @@ static void mlx4_en_set_msglevel(struct net_device *dev, u32 val)
131static void mlx4_en_get_wol(struct net_device *netdev, 131static void mlx4_en_get_wol(struct net_device *netdev,
132 struct ethtool_wolinfo *wol) 132 struct ethtool_wolinfo *wol)
133{ 133{
134 wol->supported = 0; 134 struct mlx4_en_priv *priv = netdev_priv(netdev);
135 wol->wolopts = 0; 135 int err = 0;
136 u64 config = 0;
137
138 if (!priv->mdev->dev->caps.wol) {
139 wol->supported = 0;
140 wol->wolopts = 0;
141 return;
142 }
143
144 err = mlx4_wol_read(priv->mdev->dev, &config, priv->port);
145 if (err) {
146 en_err(priv, "Failed to get WoL information\n");
147 return;
148 }
149
150 if (config & MLX4_EN_WOL_MAGIC)
151 wol->supported = WAKE_MAGIC;
152 else
153 wol->supported = 0;
154
155 if (config & MLX4_EN_WOL_ENABLED)
156 wol->wolopts = WAKE_MAGIC;
157 else
158 wol->wolopts = 0;
159}
160
161static int mlx4_en_set_wol(struct net_device *netdev,
162 struct ethtool_wolinfo *wol)
163{
164 struct mlx4_en_priv *priv = netdev_priv(netdev);
165 u64 config = 0;
166 int err = 0;
167
168 if (!priv->mdev->dev->caps.wol)
169 return -EOPNOTSUPP;
170
171 if (wol->supported & ~WAKE_MAGIC)
172 return -EINVAL;
173
174 err = mlx4_wol_read(priv->mdev->dev, &config, priv->port);
175 if (err) {
176 en_err(priv, "Failed to get WoL info, unable to modify\n");
177 return err;
178 }
179
180 if (wol->wolopts & WAKE_MAGIC) {
181 config |= MLX4_EN_WOL_DO_MODIFY | MLX4_EN_WOL_ENABLED |
182 MLX4_EN_WOL_MAGIC;
183 } else {
184 config &= ~(MLX4_EN_WOL_ENABLED | MLX4_EN_WOL_MAGIC);
185 config |= MLX4_EN_WOL_DO_MODIFY;
186 }
187
188 err = mlx4_wol_write(priv->mdev->dev, config, priv->port);
189 if (err)
190 en_err(priv, "Failed to set WoL information\n");
191
192 return err;
136} 193}
137 194
138static int mlx4_en_get_sset_count(struct net_device *dev, int sset) 195static int mlx4_en_get_sset_count(struct net_device *dev, int sset)
@@ -388,7 +445,7 @@ static int mlx4_en_set_ringparam(struct net_device *dev,
388 mlx4_en_stop_port(dev); 445 mlx4_en_stop_port(dev);
389 } 446 }
390 447
391 mlx4_en_free_resources(priv); 448 mlx4_en_free_resources(priv, true);
392 449
393 priv->prof->tx_ring_size = tx_size; 450 priv->prof->tx_ring_size = tx_size;
394 priv->prof->rx_ring_size = rx_size; 451 priv->prof->rx_ring_size = rx_size;
@@ -442,6 +499,7 @@ const struct ethtool_ops mlx4_en_ethtool_ops = {
442 .get_ethtool_stats = mlx4_en_get_ethtool_stats, 499 .get_ethtool_stats = mlx4_en_get_ethtool_stats,
443 .self_test = mlx4_en_self_test, 500 .self_test = mlx4_en_self_test,
444 .get_wol = mlx4_en_get_wol, 501 .get_wol = mlx4_en_get_wol,
502 .set_wol = mlx4_en_set_wol,
445 .get_msglevel = mlx4_en_get_msglevel, 503 .get_msglevel = mlx4_en_get_msglevel,
446 .set_msglevel = mlx4_en_set_msglevel, 504 .set_msglevel = mlx4_en_set_msglevel,
447 .get_coalesce = mlx4_en_get_coalesce, 505 .get_coalesce = mlx4_en_get_coalesce,
diff --git a/drivers/net/mlx4/en_main.c b/drivers/net/mlx4/en_main.c
index 1ff6ca6466ed..9276b1b25586 100644
--- a/drivers/net/mlx4/en_main.c
+++ b/drivers/net/mlx4/en_main.c
@@ -236,21 +236,23 @@ static void *mlx4_en_add(struct mlx4_dev *dev)
236 goto err_mr; 236 goto err_mr;
237 } 237 }
238 238
239 /* Configure wich ports to start according to module parameters */ 239 /* Configure which ports to start according to module parameters */
240 mdev->port_cnt = 0; 240 mdev->port_cnt = 0;
241 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) 241 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH)
242 mdev->port_cnt++; 242 mdev->port_cnt++;
243 243
244 /* If we did not receive an explicit number of Rx rings, default to
245 * the number of completion vectors populated by the mlx4_core */
246 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) { 244 mlx4_foreach_port(i, dev, MLX4_PORT_TYPE_ETH) {
247 mlx4_info(mdev, "Using %d tx rings for port:%d\n", 245 if (!dev->caps.comp_pool) {
248 mdev->profile.prof[i].tx_ring_num, i); 246 mdev->profile.prof[i].rx_ring_num =
249 mdev->profile.prof[i].rx_ring_num = min_t(int, 247 rounddown_pow_of_two(max_t(int, MIN_RX_RINGS,
250 roundup_pow_of_two(dev->caps.num_comp_vectors), 248 min_t(int,
251 MAX_RX_RINGS); 249 dev->caps.num_comp_vectors,
252 mlx4_info(mdev, "Defaulting to %d rx rings for port:%d\n", 250 MAX_RX_RINGS)));
253 mdev->profile.prof[i].rx_ring_num, i); 251 } else {
252 mdev->profile.prof[i].rx_ring_num = rounddown_pow_of_two(
253 min_t(int, dev->caps.comp_pool/
254 dev->caps.num_ports - 1 , MAX_MSIX_P_PORT - 1));
255 }
254 } 256 }
255 257
256 /* Create our own workqueue for reset/multicast tasks 258 /* Create our own workqueue for reset/multicast tasks
@@ -294,7 +296,7 @@ static struct mlx4_interface mlx4_en_interface = {
294 .remove = mlx4_en_remove, 296 .remove = mlx4_en_remove,
295 .event = mlx4_en_event, 297 .event = mlx4_en_event,
296 .get_dev = mlx4_en_get_netdev, 298 .get_dev = mlx4_en_get_netdev,
297 .protocol = MLX4_PROTOCOL_EN, 299 .protocol = MLX4_PROT_ETH,
298}; 300};
299 301
300static int __init mlx4_en_init(void) 302static int __init mlx4_en_init(void)
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c
index 897f576b8b17..77063f91c564 100644
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -156,9 +156,8 @@ static void mlx4_en_do_set_mac(struct work_struct *work)
156 mutex_lock(&mdev->state_lock); 156 mutex_lock(&mdev->state_lock);
157 if (priv->port_up) { 157 if (priv->port_up) {
158 /* Remove old MAC and insert the new one */ 158 /* Remove old MAC and insert the new one */
159 mlx4_unregister_mac(mdev->dev, priv->port, priv->mac_index); 159 err = mlx4_replace_mac(mdev->dev, priv->port,
160 err = mlx4_register_mac(mdev->dev, priv->port, 160 priv->base_qpn, priv->mac, 0);
161 priv->mac, &priv->mac_index);
162 if (err) 161 if (err)
163 en_err(priv, "Failed changing HW MAC address\n"); 162 en_err(priv, "Failed changing HW MAC address\n");
164 } else 163 } else
@@ -214,6 +213,7 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
214 struct mlx4_en_dev *mdev = priv->mdev; 213 struct mlx4_en_dev *mdev = priv->mdev;
215 struct net_device *dev = priv->dev; 214 struct net_device *dev = priv->dev;
216 u64 mcast_addr = 0; 215 u64 mcast_addr = 0;
216 u8 mc_list[16] = {0};
217 int err; 217 int err;
218 218
219 mutex_lock(&mdev->state_lock); 219 mutex_lock(&mdev->state_lock);
@@ -239,11 +239,15 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
239 priv->flags |= MLX4_EN_FLAG_PROMISC; 239 priv->flags |= MLX4_EN_FLAG_PROMISC;
240 240
241 /* Enable promiscouos mode */ 241 /* Enable promiscouos mode */
242 err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port, 242 if (!mdev->dev->caps.vep_uc_steering)
243 priv->base_qpn, 1); 243 err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port,
244 priv->base_qpn, 1);
245 else
246 err = mlx4_unicast_promisc_add(mdev->dev, priv->base_qpn,
247 priv->port);
244 if (err) 248 if (err)
245 en_err(priv, "Failed enabling " 249 en_err(priv, "Failed enabling "
246 "promiscous mode\n"); 250 "promiscuous mode\n");
247 251
248 /* Disable port multicast filter (unconditionally) */ 252 /* Disable port multicast filter (unconditionally) */
249 err = mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0, 253 err = mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0,
@@ -252,16 +256,27 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
252 en_err(priv, "Failed disabling " 256 en_err(priv, "Failed disabling "
253 "multicast filter\n"); 257 "multicast filter\n");
254 258
255 /* Disable port VLAN filter */ 259 /* Add the default qp number as multicast promisc */
256 err = mlx4_SET_VLAN_FLTR(mdev->dev, priv->port, NULL); 260 if (!(priv->flags & MLX4_EN_FLAG_MC_PROMISC)) {
257 if (err) 261 err = mlx4_multicast_promisc_add(mdev->dev, priv->base_qpn,
258 en_err(priv, "Failed disabling VLAN filter\n"); 262 priv->port);
263 if (err)
264 en_err(priv, "Failed entering multicast promisc mode\n");
265 priv->flags |= MLX4_EN_FLAG_MC_PROMISC;
266 }
267
268 if (priv->vlgrp) {
269 /* Disable port VLAN filter */
270 err = mlx4_SET_VLAN_FLTR(mdev->dev, priv->port, NULL);
271 if (err)
272 en_err(priv, "Failed disabling VLAN filter\n");
273 }
259 } 274 }
260 goto out; 275 goto out;
261 } 276 }
262 277
263 /* 278 /*
264 * Not in promiscous mode 279 * Not in promiscuous mode
265 */ 280 */
266 281
267 if (priv->flags & MLX4_EN_FLAG_PROMISC) { 282 if (priv->flags & MLX4_EN_FLAG_PROMISC) {
@@ -270,10 +285,23 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
270 priv->flags &= ~MLX4_EN_FLAG_PROMISC; 285 priv->flags &= ~MLX4_EN_FLAG_PROMISC;
271 286
272 /* Disable promiscouos mode */ 287 /* Disable promiscouos mode */
273 err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port, 288 if (!mdev->dev->caps.vep_uc_steering)
274 priv->base_qpn, 0); 289 err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port,
290 priv->base_qpn, 0);
291 else
292 err = mlx4_unicast_promisc_remove(mdev->dev, priv->base_qpn,
293 priv->port);
275 if (err) 294 if (err)
276 en_err(priv, "Failed disabling promiscous mode\n"); 295 en_err(priv, "Failed disabling promiscuous mode\n");
296
297 /* Disable Multicast promisc */
298 if (priv->flags & MLX4_EN_FLAG_MC_PROMISC) {
299 err = mlx4_multicast_promisc_remove(mdev->dev, priv->base_qpn,
300 priv->port);
301 if (err)
302 en_err(priv, "Failed disabling multicast promiscuous mode\n");
303 priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC;
304 }
277 305
278 /* Enable port VLAN filter */ 306 /* Enable port VLAN filter */
279 err = mlx4_SET_VLAN_FLTR(mdev->dev, priv->port, priv->vlgrp); 307 err = mlx4_SET_VLAN_FLTR(mdev->dev, priv->port, priv->vlgrp);
@@ -287,14 +315,38 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
287 0, MLX4_MCAST_DISABLE); 315 0, MLX4_MCAST_DISABLE);
288 if (err) 316 if (err)
289 en_err(priv, "Failed disabling multicast filter\n"); 317 en_err(priv, "Failed disabling multicast filter\n");
318
319 /* Add the default qp number as multicast promisc */
320 if (!(priv->flags & MLX4_EN_FLAG_MC_PROMISC)) {
321 err = mlx4_multicast_promisc_add(mdev->dev, priv->base_qpn,
322 priv->port);
323 if (err)
324 en_err(priv, "Failed entering multicast promisc mode\n");
325 priv->flags |= MLX4_EN_FLAG_MC_PROMISC;
326 }
290 } else { 327 } else {
291 int i; 328 int i;
329 /* Disable Multicast promisc */
330 if (priv->flags & MLX4_EN_FLAG_MC_PROMISC) {
331 err = mlx4_multicast_promisc_remove(mdev->dev, priv->base_qpn,
332 priv->port);
333 if (err)
334 en_err(priv, "Failed disabling multicast promiscuous mode\n");
335 priv->flags &= ~MLX4_EN_FLAG_MC_PROMISC;
336 }
292 337
293 err = mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0, 338 err = mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0,
294 0, MLX4_MCAST_DISABLE); 339 0, MLX4_MCAST_DISABLE);
295 if (err) 340 if (err)
296 en_err(priv, "Failed disabling multicast filter\n"); 341 en_err(priv, "Failed disabling multicast filter\n");
297 342
343 /* Detach our qp from all the multicast addresses */
344 for (i = 0; i < priv->mc_addrs_cnt; i++) {
345 memcpy(&mc_list[10], priv->mc_addrs + i * ETH_ALEN, ETH_ALEN);
346 mc_list[5] = priv->port;
347 mlx4_multicast_detach(mdev->dev, &priv->rss_map.indir_qp,
348 mc_list, MLX4_PROT_ETH);
349 }
298 /* Flush mcast filter and init it with broadcast address */ 350 /* Flush mcast filter and init it with broadcast address */
299 mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, ETH_BCAST, 351 mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, ETH_BCAST,
300 1, MLX4_MCAST_CONFIG); 352 1, MLX4_MCAST_CONFIG);
@@ -307,6 +359,10 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
307 for (i = 0; i < priv->mc_addrs_cnt; i++) { 359 for (i = 0; i < priv->mc_addrs_cnt; i++) {
308 mcast_addr = 360 mcast_addr =
309 mlx4_en_mac_to_u64(priv->mc_addrs + i * ETH_ALEN); 361 mlx4_en_mac_to_u64(priv->mc_addrs + i * ETH_ALEN);
362 memcpy(&mc_list[10], priv->mc_addrs + i * ETH_ALEN, ETH_ALEN);
363 mc_list[5] = priv->port;
364 mlx4_multicast_attach(mdev->dev, &priv->rss_map.indir_qp,
365 mc_list, 0, MLX4_PROT_ETH);
310 mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 366 mlx4_SET_MCAST_FLTR(mdev->dev, priv->port,
311 mcast_addr, 0, MLX4_MCAST_CONFIG); 367 mcast_addr, 0, MLX4_MCAST_CONFIG);
312 } 368 }
@@ -314,8 +370,6 @@ static void mlx4_en_do_set_multicast(struct work_struct *work)
314 0, MLX4_MCAST_ENABLE); 370 0, MLX4_MCAST_ENABLE);
315 if (err) 371 if (err)
316 en_err(priv, "Failed enabling multicast filter\n"); 372 en_err(priv, "Failed enabling multicast filter\n");
317
318 mlx4_en_clear_list(dev);
319 } 373 }
320out: 374out:
321 mutex_unlock(&mdev->state_lock); 375 mutex_unlock(&mdev->state_lock);
@@ -417,7 +471,6 @@ static void mlx4_en_auto_moderation(struct mlx4_en_priv *priv)
417 unsigned long avg_pkt_size; 471 unsigned long avg_pkt_size;
418 unsigned long rx_packets; 472 unsigned long rx_packets;
419 unsigned long rx_bytes; 473 unsigned long rx_bytes;
420 unsigned long rx_byte_diff;
421 unsigned long tx_packets; 474 unsigned long tx_packets;
422 unsigned long tx_pkt_diff; 475 unsigned long tx_pkt_diff;
423 unsigned long rx_pkt_diff; 476 unsigned long rx_pkt_diff;
@@ -441,25 +494,20 @@ static void mlx4_en_auto_moderation(struct mlx4_en_priv *priv)
441 rx_pkt_diff = ((unsigned long) (rx_packets - 494 rx_pkt_diff = ((unsigned long) (rx_packets -
442 priv->last_moder_packets)); 495 priv->last_moder_packets));
443 packets = max(tx_pkt_diff, rx_pkt_diff); 496 packets = max(tx_pkt_diff, rx_pkt_diff);
444 rx_byte_diff = rx_bytes - priv->last_moder_bytes;
445 rx_byte_diff = rx_byte_diff ? rx_byte_diff : 1;
446 rate = packets * HZ / period; 497 rate = packets * HZ / period;
447 avg_pkt_size = packets ? ((unsigned long) (rx_bytes - 498 avg_pkt_size = packets ? ((unsigned long) (rx_bytes -
448 priv->last_moder_bytes)) / packets : 0; 499 priv->last_moder_bytes)) / packets : 0;
449 500
450 /* Apply auto-moderation only when packet rate exceeds a rate that 501 /* Apply auto-moderation only when packet rate exceeds a rate that
451 * it matters */ 502 * it matters */
452 if (rate > MLX4_EN_RX_RATE_THRESH) { 503 if (rate > MLX4_EN_RX_RATE_THRESH && avg_pkt_size > MLX4_EN_AVG_PKT_SMALL) {
453 /* If tx and rx packet rates are not balanced, assume that 504 /* If tx and rx packet rates are not balanced, assume that
454 * traffic is mainly BW bound and apply maximum moderation. 505 * traffic is mainly BW bound and apply maximum moderation.
455 * Otherwise, moderate according to packet rate */ 506 * Otherwise, moderate according to packet rate */
456 if (2 * tx_pkt_diff > 3 * rx_pkt_diff && 507 if (2 * tx_pkt_diff > 3 * rx_pkt_diff ||
457 rx_pkt_diff / rx_byte_diff < 508 2 * rx_pkt_diff > 3 * tx_pkt_diff) {
458 MLX4_EN_SMALL_PKT_SIZE)
459 moder_time = priv->rx_usecs_low;
460 else if (2 * rx_pkt_diff > 3 * tx_pkt_diff)
461 moder_time = priv->rx_usecs_high; 509 moder_time = priv->rx_usecs_high;
462 else { 510 } else {
463 if (rate < priv->pkt_rate_low) 511 if (rate < priv->pkt_rate_low)
464 moder_time = priv->rx_usecs_low; 512 moder_time = priv->rx_usecs_low;
465 else if (rate > priv->pkt_rate_high) 513 else if (rate > priv->pkt_rate_high)
@@ -471,9 +519,7 @@ static void mlx4_en_auto_moderation(struct mlx4_en_priv *priv)
471 priv->rx_usecs_low; 519 priv->rx_usecs_low;
472 } 520 }
473 } else { 521 } else {
474 /* When packet rate is low, use default moderation rather than 522 moder_time = priv->rx_usecs_low;
475 * 0 to prevent interrupt storms if traffic suddenly increases */
476 moder_time = priv->rx_usecs;
477 } 523 }
478 524
479 en_dbg(INTR, priv, "tx rate:%lu rx_rate:%lu\n", 525 en_dbg(INTR, priv, "tx rate:%lu rx_rate:%lu\n",
@@ -565,6 +611,8 @@ int mlx4_en_start_port(struct net_device *dev)
565 int err = 0; 611 int err = 0;
566 int i; 612 int i;
567 int j; 613 int j;
614 u8 mc_list[16] = {0};
615 char name[32];
568 616
569 if (priv->port_up) { 617 if (priv->port_up) {
570 en_dbg(DRV, priv, "start port called while port already up\n"); 618 en_dbg(DRV, priv, "start port called while port already up\n");
@@ -603,16 +651,35 @@ int mlx4_en_start_port(struct net_device *dev)
603 ++rx_index; 651 ++rx_index;
604 } 652 }
605 653
654 /* Set port mac number */
655 en_dbg(DRV, priv, "Setting mac for port %d\n", priv->port);
656 err = mlx4_register_mac(mdev->dev, priv->port,
657 priv->mac, &priv->base_qpn, 0);
658 if (err) {
659 en_err(priv, "Failed setting port mac\n");
660 goto cq_err;
661 }
662 mdev->mac_removed[priv->port] = 0;
663
606 err = mlx4_en_config_rss_steer(priv); 664 err = mlx4_en_config_rss_steer(priv);
607 if (err) { 665 if (err) {
608 en_err(priv, "Failed configuring rss steering\n"); 666 en_err(priv, "Failed configuring rss steering\n");
609 goto cq_err; 667 goto mac_err;
610 } 668 }
611 669
670 if (mdev->dev->caps.comp_pool && !priv->tx_vector) {
671 sprintf(name , "%s-tx", priv->dev->name);
672 if (mlx4_assign_eq(mdev->dev , name, &priv->tx_vector)) {
673 mlx4_warn(mdev, "Failed Assigning an EQ to "
674 "%s_tx ,Falling back to legacy "
675 "EQ's\n", priv->dev->name);
676 }
677 }
612 /* Configure tx cq's and rings */ 678 /* Configure tx cq's and rings */
613 for (i = 0; i < priv->tx_ring_num; i++) { 679 for (i = 0; i < priv->tx_ring_num; i++) {
614 /* Configure cq */ 680 /* Configure cq */
615 cq = &priv->tx_cq[i]; 681 cq = &priv->tx_cq[i];
682 cq->vector = priv->tx_vector;
616 err = mlx4_en_activate_cq(priv, cq); 683 err = mlx4_en_activate_cq(priv, cq);
617 if (err) { 684 if (err) {
618 en_err(priv, "Failed allocating Tx CQ\n"); 685 en_err(priv, "Failed allocating Tx CQ\n");
@@ -659,24 +726,25 @@ int mlx4_en_start_port(struct net_device *dev)
659 en_err(priv, "Failed setting default qp numbers\n"); 726 en_err(priv, "Failed setting default qp numbers\n");
660 goto tx_err; 727 goto tx_err;
661 } 728 }
662 /* Set port mac number */
663 en_dbg(DRV, priv, "Setting mac for port %d\n", priv->port);
664 err = mlx4_register_mac(mdev->dev, priv->port,
665 priv->mac, &priv->mac_index);
666 if (err) {
667 en_err(priv, "Failed setting port mac\n");
668 goto tx_err;
669 }
670 mdev->mac_removed[priv->port] = 0;
671 729
672 /* Init port */ 730 /* Init port */
673 en_dbg(HW, priv, "Initializing port\n"); 731 en_dbg(HW, priv, "Initializing port\n");
674 err = mlx4_INIT_PORT(mdev->dev, priv->port); 732 err = mlx4_INIT_PORT(mdev->dev, priv->port);
675 if (err) { 733 if (err) {
676 en_err(priv, "Failed Initializing port\n"); 734 en_err(priv, "Failed Initializing port\n");
677 goto mac_err; 735 goto tx_err;
678 } 736 }
679 737
738 /* Attach rx QP to bradcast address */
739 memset(&mc_list[10], 0xff, ETH_ALEN);
740 mc_list[5] = priv->port;
741 if (mlx4_multicast_attach(mdev->dev, &priv->rss_map.indir_qp, mc_list,
742 0, MLX4_PROT_ETH))
743 mlx4_warn(mdev, "Failed Attaching Broadcast\n");
744
745 /* Must redo promiscuous mode setup. */
746 priv->flags &= ~(MLX4_EN_FLAG_PROMISC | MLX4_EN_FLAG_MC_PROMISC);
747
680 /* Schedule multicast task to populate multicast list */ 748 /* Schedule multicast task to populate multicast list */
681 queue_work(mdev->workqueue, &priv->mcast_task); 749 queue_work(mdev->workqueue, &priv->mcast_task);
682 750
@@ -684,8 +752,6 @@ int mlx4_en_start_port(struct net_device *dev)
684 netif_tx_start_all_queues(dev); 752 netif_tx_start_all_queues(dev);
685 return 0; 753 return 0;
686 754
687mac_err:
688 mlx4_unregister_mac(mdev->dev, priv->port, priv->mac_index);
689tx_err: 755tx_err:
690 while (tx_index--) { 756 while (tx_index--) {
691 mlx4_en_deactivate_tx_ring(priv, &priv->tx_ring[tx_index]); 757 mlx4_en_deactivate_tx_ring(priv, &priv->tx_ring[tx_index]);
@@ -693,6 +759,8 @@ tx_err:
693 } 759 }
694 760
695 mlx4_en_release_rss_steer(priv); 761 mlx4_en_release_rss_steer(priv);
762mac_err:
763 mlx4_unregister_mac(mdev->dev, priv->port, priv->base_qpn);
696cq_err: 764cq_err:
697 while (rx_index--) 765 while (rx_index--)
698 mlx4_en_deactivate_cq(priv, &priv->rx_cq[rx_index]); 766 mlx4_en_deactivate_cq(priv, &priv->rx_cq[rx_index]);
@@ -708,6 +776,7 @@ void mlx4_en_stop_port(struct net_device *dev)
708 struct mlx4_en_priv *priv = netdev_priv(dev); 776 struct mlx4_en_priv *priv = netdev_priv(dev);
709 struct mlx4_en_dev *mdev = priv->mdev; 777 struct mlx4_en_dev *mdev = priv->mdev;
710 int i; 778 int i;
779 u8 mc_list[16] = {0};
711 780
712 if (!priv->port_up) { 781 if (!priv->port_up) {
713 en_dbg(DRV, priv, "stop port called while port already down\n"); 782 en_dbg(DRV, priv, "stop port called while port already down\n");
@@ -722,8 +791,23 @@ void mlx4_en_stop_port(struct net_device *dev)
722 /* Set port as not active */ 791 /* Set port as not active */
723 priv->port_up = false; 792 priv->port_up = false;
724 793
794 /* Detach All multicasts */
795 memset(&mc_list[10], 0xff, ETH_ALEN);
796 mc_list[5] = priv->port;
797 mlx4_multicast_detach(mdev->dev, &priv->rss_map.indir_qp, mc_list,
798 MLX4_PROT_ETH);
799 for (i = 0; i < priv->mc_addrs_cnt; i++) {
800 memcpy(&mc_list[10], priv->mc_addrs + i * ETH_ALEN, ETH_ALEN);
801 mc_list[5] = priv->port;
802 mlx4_multicast_detach(mdev->dev, &priv->rss_map.indir_qp,
803 mc_list, MLX4_PROT_ETH);
804 }
805 mlx4_en_clear_list(dev);
806 /* Flush multicast filter */
807 mlx4_SET_MCAST_FLTR(mdev->dev, priv->port, 0, 1, MLX4_MCAST_CONFIG);
808
725 /* Unregister Mac address for the port */ 809 /* Unregister Mac address for the port */
726 mlx4_unregister_mac(mdev->dev, priv->port, priv->mac_index); 810 mlx4_unregister_mac(mdev->dev, priv->port, priv->base_qpn);
727 mdev->mac_removed[priv->port] = 1; 811 mdev->mac_removed[priv->port] = 1;
728 812
729 /* Free TX Rings */ 813 /* Free TX Rings */
@@ -801,7 +885,6 @@ static int mlx4_en_open(struct net_device *dev)
801 priv->rx_ring[i].packets = 0; 885 priv->rx_ring[i].packets = 0;
802 } 886 }
803 887
804 mlx4_en_set_default_moderation(priv);
805 err = mlx4_en_start_port(dev); 888 err = mlx4_en_start_port(dev);
806 if (err) 889 if (err)
807 en_err(priv, "Failed starting port:%d\n", priv->port); 890 en_err(priv, "Failed starting port:%d\n", priv->port);
@@ -828,7 +911,7 @@ static int mlx4_en_close(struct net_device *dev)
828 return 0; 911 return 0;
829} 912}
830 913
831void mlx4_en_free_resources(struct mlx4_en_priv *priv) 914void mlx4_en_free_resources(struct mlx4_en_priv *priv, bool reserve_vectors)
832{ 915{
833 int i; 916 int i;
834 917
@@ -836,14 +919,14 @@ void mlx4_en_free_resources(struct mlx4_en_priv *priv)
836 if (priv->tx_ring[i].tx_info) 919 if (priv->tx_ring[i].tx_info)
837 mlx4_en_destroy_tx_ring(priv, &priv->tx_ring[i]); 920 mlx4_en_destroy_tx_ring(priv, &priv->tx_ring[i]);
838 if (priv->tx_cq[i].buf) 921 if (priv->tx_cq[i].buf)
839 mlx4_en_destroy_cq(priv, &priv->tx_cq[i]); 922 mlx4_en_destroy_cq(priv, &priv->tx_cq[i], reserve_vectors);
840 } 923 }
841 924
842 for (i = 0; i < priv->rx_ring_num; i++) { 925 for (i = 0; i < priv->rx_ring_num; i++) {
843 if (priv->rx_ring[i].rx_info) 926 if (priv->rx_ring[i].rx_info)
844 mlx4_en_destroy_rx_ring(priv, &priv->rx_ring[i]); 927 mlx4_en_destroy_rx_ring(priv, &priv->rx_ring[i]);
845 if (priv->rx_cq[i].buf) 928 if (priv->rx_cq[i].buf)
846 mlx4_en_destroy_cq(priv, &priv->rx_cq[i]); 929 mlx4_en_destroy_cq(priv, &priv->rx_cq[i], reserve_vectors);
847 } 930 }
848} 931}
849 932
@@ -851,6 +934,13 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
851{ 934{
852 struct mlx4_en_port_profile *prof = priv->prof; 935 struct mlx4_en_port_profile *prof = priv->prof;
853 int i; 936 int i;
937 int base_tx_qpn, err;
938
939 err = mlx4_qp_reserve_range(priv->mdev->dev, priv->tx_ring_num, 256, &base_tx_qpn);
940 if (err) {
941 en_err(priv, "failed reserving range for TX rings\n");
942 return err;
943 }
854 944
855 /* Create tx Rings */ 945 /* Create tx Rings */
856 for (i = 0; i < priv->tx_ring_num; i++) { 946 for (i = 0; i < priv->tx_ring_num; i++) {
@@ -858,7 +948,7 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
858 prof->tx_ring_size, i, TX)) 948 prof->tx_ring_size, i, TX))
859 goto err; 949 goto err;
860 950
861 if (mlx4_en_create_tx_ring(priv, &priv->tx_ring[i], 951 if (mlx4_en_create_tx_ring(priv, &priv->tx_ring[i], base_tx_qpn + i,
862 prof->tx_ring_size, TXBB_SIZE)) 952 prof->tx_ring_size, TXBB_SIZE))
863 goto err; 953 goto err;
864 } 954 }
@@ -878,6 +968,7 @@ int mlx4_en_alloc_resources(struct mlx4_en_priv *priv)
878 968
879err: 969err:
880 en_err(priv, "Failed to allocate NIC resources\n"); 970 en_err(priv, "Failed to allocate NIC resources\n");
971 mlx4_qp_release_range(priv->mdev->dev, base_tx_qpn, priv->tx_ring_num);
881 return -ENOMEM; 972 return -ENOMEM;
882} 973}
883 974
@@ -905,7 +996,7 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
905 mdev->pndev[priv->port] = NULL; 996 mdev->pndev[priv->port] = NULL;
906 mutex_unlock(&mdev->state_lock); 997 mutex_unlock(&mdev->state_lock);
907 998
908 mlx4_en_free_resources(priv); 999 mlx4_en_free_resources(priv, false);
909 free_netdev(dev); 1000 free_netdev(dev);
910} 1001}
911 1002
@@ -932,7 +1023,6 @@ static int mlx4_en_change_mtu(struct net_device *dev, int new_mtu)
932 en_dbg(DRV, priv, "Change MTU called with card down!?\n"); 1023 en_dbg(DRV, priv, "Change MTU called with card down!?\n");
933 } else { 1024 } else {
934 mlx4_en_stop_port(dev); 1025 mlx4_en_stop_port(dev);
935 mlx4_en_set_default_moderation(priv);
936 err = mlx4_en_start_port(dev); 1026 err = mlx4_en_start_port(dev);
937 if (err) { 1027 if (err) {
938 en_err(priv, "Failed restarting port:%d\n", 1028 en_err(priv, "Failed restarting port:%d\n",
@@ -1079,7 +1169,25 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
1079 en_warn(priv, "Using %d TX rings\n", prof->tx_ring_num); 1169 en_warn(priv, "Using %d TX rings\n", prof->tx_ring_num);
1080 en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num); 1170 en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num);
1081 1171
1172 /* Configure port */
1173 err = mlx4_SET_PORT_general(mdev->dev, priv->port,
1174 MLX4_EN_MIN_MTU,
1175 0, 0, 0, 0);
1176 if (err) {
1177 en_err(priv, "Failed setting port general configurations "
1178 "for port %d, with error %d\n", priv->port, err);
1179 goto out;
1180 }
1181
1182 /* Init port */
1183 en_warn(priv, "Initializing port\n");
1184 err = mlx4_INIT_PORT(mdev->dev, priv->port);
1185 if (err) {
1186 en_err(priv, "Failed Initializing port\n");
1187 goto out;
1188 }
1082 priv->registered = 1; 1189 priv->registered = 1;
1190 mlx4_en_set_default_moderation(priv);
1083 queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY); 1191 queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY);
1084 return 0; 1192 return 0;
1085 1193
diff --git a/drivers/net/mlx4/en_port.c b/drivers/net/mlx4/en_port.c
index 7f5a3221e0c1..f2a4f5dd313d 100644
--- a/drivers/net/mlx4/en_port.c
+++ b/drivers/net/mlx4/en_port.c
@@ -119,6 +119,10 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
119 struct mlx4_set_port_rqp_calc_context *context; 119 struct mlx4_set_port_rqp_calc_context *context;
120 int err; 120 int err;
121 u32 in_mod; 121 u32 in_mod;
122 u32 m_promisc = (dev->caps.vep_mc_steering) ? MCAST_DIRECT : MCAST_DEFAULT;
123
124 if (dev->caps.vep_mc_steering && dev->caps.vep_uc_steering)
125 return 0;
122 126
123 mailbox = mlx4_alloc_cmd_mailbox(dev); 127 mailbox = mlx4_alloc_cmd_mailbox(dev);
124 if (IS_ERR(mailbox)) 128 if (IS_ERR(mailbox))
@@ -127,8 +131,11 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_dev *dev, u8 port, u32 base_qpn,
127 memset(context, 0, sizeof *context); 131 memset(context, 0, sizeof *context);
128 132
129 context->base_qpn = cpu_to_be32(base_qpn); 133 context->base_qpn = cpu_to_be32(base_qpn);
130 context->promisc = cpu_to_be32(promisc << SET_PORT_PROMISC_EN_SHIFT | base_qpn); 134 context->n_mac = 0x7;
131 context->mcast = cpu_to_be32(1 << SET_PORT_PROMISC_MODE_SHIFT | base_qpn); 135 context->promisc = cpu_to_be32(promisc << SET_PORT_PROMISC_SHIFT |
136 base_qpn);
137 context->mcast = cpu_to_be32(m_promisc << SET_PORT_MC_PROMISC_SHIFT |
138 base_qpn);
132 context->intra_no_vlan = 0; 139 context->intra_no_vlan = 0;
133 context->no_vlan = MLX4_NO_VLAN_IDX; 140 context->no_vlan = MLX4_NO_VLAN_IDX;
134 context->intra_vlan_miss = 0; 141 context->intra_vlan_miss = 0;
@@ -206,7 +213,7 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
206 } 213 }
207 stats->tx_packets = 0; 214 stats->tx_packets = 0;
208 stats->tx_bytes = 0; 215 stats->tx_bytes = 0;
209 for (i = 0; i <= priv->tx_ring_num; i++) { 216 for (i = 0; i < priv->tx_ring_num; i++) {
210 stats->tx_packets += priv->tx_ring[i].packets; 217 stats->tx_packets += priv->tx_ring[i].packets;
211 stats->tx_bytes += priv->tx_ring[i].bytes; 218 stats->tx_bytes += priv->tx_ring[i].bytes;
212 } 219 }
diff --git a/drivers/net/mlx4/en_port.h b/drivers/net/mlx4/en_port.h
index 092e814b1981..e3d73e41c567 100644
--- a/drivers/net/mlx4/en_port.h
+++ b/drivers/net/mlx4/en_port.h
@@ -36,8 +36,8 @@
36 36
37 37
38#define SET_PORT_GEN_ALL_VALID 0x7 38#define SET_PORT_GEN_ALL_VALID 0x7
39#define SET_PORT_PROMISC_EN_SHIFT 31 39#define SET_PORT_PROMISC_SHIFT 31
40#define SET_PORT_PROMISC_MODE_SHIFT 30 40#define SET_PORT_MC_PROMISC_SHIFT 30
41 41
42enum { 42enum {
43 MLX4_CMD_SET_VLAN_FLTR = 0x47, 43 MLX4_CMD_SET_VLAN_FLTR = 0x47,
@@ -45,6 +45,12 @@ enum {
45 MLX4_CMD_DUMP_ETH_STATS = 0x49, 45 MLX4_CMD_DUMP_ETH_STATS = 0x49,
46}; 46};
47 47
48enum {
49 MCAST_DIRECT_ONLY = 0,
50 MCAST_DIRECT = 1,
51 MCAST_DEFAULT = 2
52};
53
48struct mlx4_set_port_general_context { 54struct mlx4_set_port_general_context {
49 u8 reserved[3]; 55 u8 reserved[3];
50 u8 flags; 56 u8 flags;
@@ -60,14 +66,17 @@ struct mlx4_set_port_general_context {
60 66
61struct mlx4_set_port_rqp_calc_context { 67struct mlx4_set_port_rqp_calc_context {
62 __be32 base_qpn; 68 __be32 base_qpn;
63 __be32 flags; 69 u8 rererved;
64 u8 reserved[3]; 70 u8 n_mac;
71 u8 n_vlan;
72 u8 n_prio;
73 u8 reserved2[3];
65 u8 mac_miss; 74 u8 mac_miss;
66 u8 intra_no_vlan; 75 u8 intra_no_vlan;
67 u8 no_vlan; 76 u8 no_vlan;
68 u8 intra_vlan_miss; 77 u8 intra_vlan_miss;
69 u8 vlan_miss; 78 u8 vlan_miss;
70 u8 reserved2[3]; 79 u8 reserved3[3];
71 u8 no_vlan_prio; 80 u8 no_vlan_prio;
72 __be32 promisc; 81 __be32 promisc;
73 __be32 mcast; 82 __be32 mcast;
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index 570f2508fb30..62dd21b06df4 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -345,6 +345,8 @@ int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv)
345 err = mlx4_en_init_allocator(priv, ring); 345 err = mlx4_en_init_allocator(priv, ring);
346 if (err) { 346 if (err) {
347 en_err(priv, "Failed initializing ring allocator\n"); 347 en_err(priv, "Failed initializing ring allocator\n");
348 if (ring->stride <= TXBB_SIZE)
349 ring->buf -= TXBB_SIZE;
348 ring_ind--; 350 ring_ind--;
349 goto err_allocator; 351 goto err_allocator;
350 } 352 }
@@ -369,6 +371,8 @@ err_buffers:
369 ring_ind = priv->rx_ring_num - 1; 371 ring_ind = priv->rx_ring_num - 1;
370err_allocator: 372err_allocator:
371 while (ring_ind >= 0) { 373 while (ring_ind >= 0) {
374 if (priv->rx_ring[ring_ind].stride <= TXBB_SIZE)
375 priv->rx_ring[ring_ind].buf -= TXBB_SIZE;
372 mlx4_en_destroy_allocator(priv, &priv->rx_ring[ring_ind]); 376 mlx4_en_destroy_allocator(priv, &priv->rx_ring[ring_ind]);
373 ring_ind--; 377 ring_ind--;
374 } 378 }
@@ -706,7 +710,7 @@ int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget)
706} 710}
707 711
708 712
709/* Calculate the last offset position that accomodates a full fragment 713/* Calculate the last offset position that accommodates a full fragment
710 * (assuming fagment size = stride-align) */ 714 * (assuming fagment size = stride-align) */
711static int mlx4_en_last_alloc_offset(struct mlx4_en_priv *priv, u16 stride, u16 align) 715static int mlx4_en_last_alloc_offset(struct mlx4_en_priv *priv, u16 stride, u16 align)
712{ 716{
@@ -845,16 +849,10 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv)
845 } 849 }
846 850
847 /* Configure RSS indirection qp */ 851 /* Configure RSS indirection qp */
848 err = mlx4_qp_reserve_range(mdev->dev, 1, 1, &priv->base_qpn);
849 if (err) {
850 en_err(priv, "Failed to reserve range for RSS "
851 "indirection qp\n");
852 goto rss_err;
853 }
854 err = mlx4_qp_alloc(mdev->dev, priv->base_qpn, &rss_map->indir_qp); 852 err = mlx4_qp_alloc(mdev->dev, priv->base_qpn, &rss_map->indir_qp);
855 if (err) { 853 if (err) {
856 en_err(priv, "Failed to allocate RSS indirection QP\n"); 854 en_err(priv, "Failed to allocate RSS indirection QP\n");
857 goto reserve_err; 855 goto rss_err;
858 } 856 }
859 rss_map->indir_qp.event = mlx4_en_sqp_event; 857 rss_map->indir_qp.event = mlx4_en_sqp_event;
860 mlx4_en_fill_qp_context(priv, 0, 0, 0, 1, priv->base_qpn, 858 mlx4_en_fill_qp_context(priv, 0, 0, 0, 1, priv->base_qpn,
@@ -881,8 +879,6 @@ indir_err:
881 MLX4_QP_STATE_RST, NULL, 0, 0, &rss_map->indir_qp); 879 MLX4_QP_STATE_RST, NULL, 0, 0, &rss_map->indir_qp);
882 mlx4_qp_remove(mdev->dev, &rss_map->indir_qp); 880 mlx4_qp_remove(mdev->dev, &rss_map->indir_qp);
883 mlx4_qp_free(mdev->dev, &rss_map->indir_qp); 881 mlx4_qp_free(mdev->dev, &rss_map->indir_qp);
884reserve_err:
885 mlx4_qp_release_range(mdev->dev, priv->base_qpn, 1);
886rss_err: 882rss_err:
887 for (i = 0; i < good_qps; i++) { 883 for (i = 0; i < good_qps; i++) {
888 mlx4_qp_modify(mdev->dev, NULL, rss_map->state[i], 884 mlx4_qp_modify(mdev->dev, NULL, rss_map->state[i],
@@ -904,7 +900,6 @@ void mlx4_en_release_rss_steer(struct mlx4_en_priv *priv)
904 MLX4_QP_STATE_RST, NULL, 0, 0, &rss_map->indir_qp); 900 MLX4_QP_STATE_RST, NULL, 0, 0, &rss_map->indir_qp);
905 mlx4_qp_remove(mdev->dev, &rss_map->indir_qp); 901 mlx4_qp_remove(mdev->dev, &rss_map->indir_qp);
906 mlx4_qp_free(mdev->dev, &rss_map->indir_qp); 902 mlx4_qp_free(mdev->dev, &rss_map->indir_qp);
907 mlx4_qp_release_range(mdev->dev, priv->base_qpn, 1);
908 903
909 for (i = 0; i < priv->rx_ring_num; i++) { 904 for (i = 0; i < priv->rx_ring_num; i++) {
910 mlx4_qp_modify(mdev->dev, NULL, rss_map->state[i], 905 mlx4_qp_modify(mdev->dev, NULL, rss_map->state[i],
diff --git a/drivers/net/mlx4/en_selftest.c b/drivers/net/mlx4/en_selftest.c
index 9c91a92da705..191a8dcd8a93 100644
--- a/drivers/net/mlx4/en_selftest.c
+++ b/drivers/net/mlx4/en_selftest.c
@@ -149,7 +149,7 @@ void mlx4_en_ex_selftest(struct net_device *dev, u32 *flags, u64 *buf)
149 149
150 netif_carrier_off(dev); 150 netif_carrier_off(dev);
151retry_tx: 151retry_tx:
152 /* Wait untill all tx queues are empty. 152 /* Wait until all tx queues are empty.
153 * there should not be any additional incoming traffic 153 * there should not be any additional incoming traffic
154 * since we turned the carrier off */ 154 * since we turned the carrier off */
155 msleep(200); 155 msleep(200);
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c
index a680cd4a5ab6..b229acf1855f 100644
--- a/drivers/net/mlx4/en_tx.c
+++ b/drivers/net/mlx4/en_tx.c
@@ -44,6 +44,7 @@
44 44
45enum { 45enum {
46 MAX_INLINE = 104, /* 128 - 16 - 4 - 4 */ 46 MAX_INLINE = 104, /* 128 - 16 - 4 - 4 */
47 MAX_BF = 256,
47}; 48};
48 49
49static int inline_thold __read_mostly = MAX_INLINE; 50static int inline_thold __read_mostly = MAX_INLINE;
@@ -52,7 +53,7 @@ module_param_named(inline_thold, inline_thold, int, 0444);
52MODULE_PARM_DESC(inline_thold, "threshold for using inline data"); 53MODULE_PARM_DESC(inline_thold, "threshold for using inline data");
53 54
54int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, 55int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
55 struct mlx4_en_tx_ring *ring, u32 size, 56 struct mlx4_en_tx_ring *ring, int qpn, u32 size,
56 u16 stride) 57 u16 stride)
57{ 58{
58 struct mlx4_en_dev *mdev = priv->mdev; 59 struct mlx4_en_dev *mdev = priv->mdev;
@@ -103,23 +104,25 @@ int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv,
103 "buf_size:%d dma:%llx\n", ring, ring->buf, ring->size, 104 "buf_size:%d dma:%llx\n", ring, ring->buf, ring->size,
104 ring->buf_size, (unsigned long long) ring->wqres.buf.direct.map); 105 ring->buf_size, (unsigned long long) ring->wqres.buf.direct.map);
105 106
106 err = mlx4_qp_reserve_range(mdev->dev, 1, 1, &ring->qpn); 107 ring->qpn = qpn;
107 if (err) {
108 en_err(priv, "Failed reserving qp for tx ring.\n");
109 goto err_map;
110 }
111
112 err = mlx4_qp_alloc(mdev->dev, ring->qpn, &ring->qp); 108 err = mlx4_qp_alloc(mdev->dev, ring->qpn, &ring->qp);
113 if (err) { 109 if (err) {
114 en_err(priv, "Failed allocating qp %d\n", ring->qpn); 110 en_err(priv, "Failed allocating qp %d\n", ring->qpn);
115 goto err_reserve; 111 goto err_map;
116 } 112 }
117 ring->qp.event = mlx4_en_sqp_event; 113 ring->qp.event = mlx4_en_sqp_event;
118 114
115 err = mlx4_bf_alloc(mdev->dev, &ring->bf);
116 if (err) {
117 en_dbg(DRV, priv, "working without blueflame (%d)", err);
118 ring->bf.uar = &mdev->priv_uar;
119 ring->bf.uar->map = mdev->uar_map;
120 ring->bf_enabled = false;
121 } else
122 ring->bf_enabled = true;
123
119 return 0; 124 return 0;
120 125
121err_reserve:
122 mlx4_qp_release_range(mdev->dev, ring->qpn, 1);
123err_map: 126err_map:
124 mlx4_en_unmap_buffer(&ring->wqres.buf); 127 mlx4_en_unmap_buffer(&ring->wqres.buf);
125err_hwq_res: 128err_hwq_res:
@@ -139,6 +142,8 @@ void mlx4_en_destroy_tx_ring(struct mlx4_en_priv *priv,
139 struct mlx4_en_dev *mdev = priv->mdev; 142 struct mlx4_en_dev *mdev = priv->mdev;
140 en_dbg(DRV, priv, "Destroying tx ring, qpn: %d\n", ring->qpn); 143 en_dbg(DRV, priv, "Destroying tx ring, qpn: %d\n", ring->qpn);
141 144
145 if (ring->bf_enabled)
146 mlx4_bf_free(mdev->dev, &ring->bf);
142 mlx4_qp_remove(mdev->dev, &ring->qp); 147 mlx4_qp_remove(mdev->dev, &ring->qp);
143 mlx4_qp_free(mdev->dev, &ring->qp); 148 mlx4_qp_free(mdev->dev, &ring->qp);
144 mlx4_qp_release_range(mdev->dev, ring->qpn, 1); 149 mlx4_qp_release_range(mdev->dev, ring->qpn, 1);
@@ -171,6 +176,8 @@ int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv,
171 176
172 mlx4_en_fill_qp_context(priv, ring->size, ring->stride, 1, 0, ring->qpn, 177 mlx4_en_fill_qp_context(priv, ring->size, ring->stride, 1, 0, ring->qpn,
173 ring->cqn, &ring->context); 178 ring->cqn, &ring->context);
179 if (ring->bf_enabled)
180 ring->context.usr_page = cpu_to_be32(ring->bf.uar->index);
174 181
175 err = mlx4_qp_to_ready(mdev->dev, &ring->wqres.mtt, &ring->context, 182 err = mlx4_qp_to_ready(mdev->dev, &ring->wqres.mtt, &ring->context,
176 &ring->qp, &ring->qp_state); 183 &ring->qp, &ring->qp_state);
@@ -591,6 +598,11 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb)
591 return skb_tx_hash(dev, skb); 598 return skb_tx_hash(dev, skb);
592} 599}
593 600
601static void mlx4_bf_copy(unsigned long *dst, unsigned long *src, unsigned bytecnt)
602{
603 __iowrite64_copy(dst, src, bytecnt / 8);
604}
605
594netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev) 606netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
595{ 607{
596 struct mlx4_en_priv *priv = netdev_priv(dev); 608 struct mlx4_en_priv *priv = netdev_priv(dev);
@@ -609,12 +621,13 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
609 int desc_size; 621 int desc_size;
610 int real_size; 622 int real_size;
611 dma_addr_t dma; 623 dma_addr_t dma;
612 u32 index; 624 u32 index, bf_index;
613 __be32 op_own; 625 __be32 op_own;
614 u16 vlan_tag = 0; 626 u16 vlan_tag = 0;
615 int i; 627 int i;
616 int lso_header_size; 628 int lso_header_size;
617 void *fragptr; 629 void *fragptr;
630 bool bounce = false;
618 631
619 if (!priv->port_up) 632 if (!priv->port_up)
620 goto tx_drop; 633 goto tx_drop;
@@ -623,7 +636,7 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
623 if (unlikely(!real_size)) 636 if (unlikely(!real_size))
624 goto tx_drop; 637 goto tx_drop;
625 638
626 /* Allign descriptor to TXBB size */ 639 /* Align descriptor to TXBB size */
627 desc_size = ALIGN(real_size, TXBB_SIZE); 640 desc_size = ALIGN(real_size, TXBB_SIZE);
628 nr_txbb = desc_size / TXBB_SIZE; 641 nr_txbb = desc_size / TXBB_SIZE;
629 if (unlikely(nr_txbb > MAX_DESC_TXBBS)) { 642 if (unlikely(nr_txbb > MAX_DESC_TXBBS)) {
@@ -657,13 +670,16 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
657 670
658 /* Packet is good - grab an index and transmit it */ 671 /* Packet is good - grab an index and transmit it */
659 index = ring->prod & ring->size_mask; 672 index = ring->prod & ring->size_mask;
673 bf_index = ring->prod;
660 674
661 /* See if we have enough space for whole descriptor TXBB for setting 675 /* See if we have enough space for whole descriptor TXBB for setting
662 * SW ownership on next descriptor; if not, use a bounce buffer. */ 676 * SW ownership on next descriptor; if not, use a bounce buffer. */
663 if (likely(index + nr_txbb <= ring->size)) 677 if (likely(index + nr_txbb <= ring->size))
664 tx_desc = ring->buf + index * TXBB_SIZE; 678 tx_desc = ring->buf + index * TXBB_SIZE;
665 else 679 else {
666 tx_desc = (struct mlx4_en_tx_desc *) ring->bounce_buf; 680 tx_desc = (struct mlx4_en_tx_desc *) ring->bounce_buf;
681 bounce = true;
682 }
667 683
668 /* Save skb in tx_info ring */ 684 /* Save skb in tx_info ring */
669 tx_info = &ring->tx_info[index]; 685 tx_info = &ring->tx_info[index];
@@ -768,21 +784,37 @@ netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev)
768 ring->prod += nr_txbb; 784 ring->prod += nr_txbb;
769 785
770 /* If we used a bounce buffer then copy descriptor back into place */ 786 /* If we used a bounce buffer then copy descriptor back into place */
771 if (tx_desc == (struct mlx4_en_tx_desc *) ring->bounce_buf) 787 if (bounce)
772 tx_desc = mlx4_en_bounce_to_desc(priv, ring, index, desc_size); 788 tx_desc = mlx4_en_bounce_to_desc(priv, ring, index, desc_size);
773 789
774 /* Run destructor before passing skb to HW */ 790 /* Run destructor before passing skb to HW */
775 if (likely(!skb_shared(skb))) 791 if (likely(!skb_shared(skb)))
776 skb_orphan(skb); 792 skb_orphan(skb);
777 793
778 /* Ensure new descirptor hits memory 794 if (ring->bf_enabled && desc_size <= MAX_BF && !bounce && !vlan_tag) {
779 * before setting ownership of this descriptor to HW */ 795 *(u32 *) (&tx_desc->ctrl.vlan_tag) |= ring->doorbell_qpn;
780 wmb(); 796 op_own |= htonl((bf_index & 0xffff) << 8);
781 tx_desc->ctrl.owner_opcode = op_own; 797 /* Ensure new descirptor hits memory
798 * before setting ownership of this descriptor to HW */
799 wmb();
800 tx_desc->ctrl.owner_opcode = op_own;
782 801
783 /* Ring doorbell! */ 802 wmb();
784 wmb(); 803
785 writel(ring->doorbell_qpn, mdev->uar_map + MLX4_SEND_DOORBELL); 804 mlx4_bf_copy(ring->bf.reg + ring->bf.offset, (unsigned long *) &tx_desc->ctrl,
805 desc_size);
806
807 wmb();
808
809 ring->bf.offset ^= ring->bf.buf_size;
810 } else {
811 /* Ensure new descirptor hits memory
812 * before setting ownership of this descriptor to HW */
813 wmb();
814 tx_desc->ctrl.owner_opcode = op_own;
815 wmb();
816 writel(ring->doorbell_qpn, ring->bf.uar->map + MLX4_SEND_DOORBELL);
817 }
786 818
787 /* Poll CQ here */ 819 /* Poll CQ here */
788 mlx4_en_xmit_poll(priv, tx_ind); 820 mlx4_en_xmit_poll(priv, tx_ind);
diff --git a/drivers/net/mlx4/eq.c b/drivers/net/mlx4/eq.c
index 552d0fce6f67..1ad1f6029af8 100644
--- a/drivers/net/mlx4/eq.c
+++ b/drivers/net/mlx4/eq.c
@@ -42,7 +42,7 @@
42#include "fw.h" 42#include "fw.h"
43 43
44enum { 44enum {
45 MLX4_IRQNAME_SIZE = 64 45 MLX4_IRQNAME_SIZE = 32
46}; 46};
47 47
48enum { 48enum {
@@ -317,8 +317,8 @@ static int mlx4_num_eq_uar(struct mlx4_dev *dev)
317 * we need to map, take the difference of highest index and 317 * we need to map, take the difference of highest index and
318 * the lowest index we'll use and add 1. 318 * the lowest index we'll use and add 1.
319 */ 319 */
320 return (dev->caps.num_comp_vectors + 1 + dev->caps.reserved_eqs) / 4 - 320 return (dev->caps.num_comp_vectors + 1 + dev->caps.reserved_eqs +
321 dev->caps.reserved_eqs / 4 + 1; 321 dev->caps.comp_pool)/4 - dev->caps.reserved_eqs/4 + 1;
322} 322}
323 323
324static void __iomem *mlx4_get_eq_uar(struct mlx4_dev *dev, struct mlx4_eq *eq) 324static void __iomem *mlx4_get_eq_uar(struct mlx4_dev *dev, struct mlx4_eq *eq)
@@ -496,16 +496,32 @@ static void mlx4_free_eq(struct mlx4_dev *dev,
496static void mlx4_free_irqs(struct mlx4_dev *dev) 496static void mlx4_free_irqs(struct mlx4_dev *dev)
497{ 497{
498 struct mlx4_eq_table *eq_table = &mlx4_priv(dev)->eq_table; 498 struct mlx4_eq_table *eq_table = &mlx4_priv(dev)->eq_table;
499 int i; 499 struct mlx4_priv *priv = mlx4_priv(dev);
500 int i, vec;
500 501
501 if (eq_table->have_irq) 502 if (eq_table->have_irq)
502 free_irq(dev->pdev->irq, dev); 503 free_irq(dev->pdev->irq, dev);
504
503 for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i) 505 for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i)
504 if (eq_table->eq[i].have_irq) { 506 if (eq_table->eq[i].have_irq) {
505 free_irq(eq_table->eq[i].irq, eq_table->eq + i); 507 free_irq(eq_table->eq[i].irq, eq_table->eq + i);
506 eq_table->eq[i].have_irq = 0; 508 eq_table->eq[i].have_irq = 0;
507 } 509 }
508 510
511 for (i = 0; i < dev->caps.comp_pool; i++) {
512 /*
513 * Freeing the assigned irq's
514 * all bits should be 0, but we need to validate
515 */
516 if (priv->msix_ctl.pool_bm & 1ULL << i) {
517 /* NO need protecting*/
518 vec = dev->caps.num_comp_vectors + 1 + i;
519 free_irq(priv->eq_table.eq[vec].irq,
520 &priv->eq_table.eq[vec]);
521 }
522 }
523
524
509 kfree(eq_table->irq_names); 525 kfree(eq_table->irq_names);
510} 526}
511 527
@@ -578,7 +594,8 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
578 (priv->eq_table.inta_pin < 32 ? 4 : 0); 594 (priv->eq_table.inta_pin < 32 ? 4 : 0);
579 595
580 priv->eq_table.irq_names = 596 priv->eq_table.irq_names =
581 kmalloc(MLX4_IRQNAME_SIZE * (dev->caps.num_comp_vectors + 1), 597 kmalloc(MLX4_IRQNAME_SIZE * (dev->caps.num_comp_vectors + 1 +
598 dev->caps.comp_pool),
582 GFP_KERNEL); 599 GFP_KERNEL);
583 if (!priv->eq_table.irq_names) { 600 if (!priv->eq_table.irq_names) {
584 err = -ENOMEM; 601 err = -ENOMEM;
@@ -586,7 +603,9 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
586 } 603 }
587 604
588 for (i = 0; i < dev->caps.num_comp_vectors; ++i) { 605 for (i = 0; i < dev->caps.num_comp_vectors; ++i) {
589 err = mlx4_create_eq(dev, dev->caps.num_cqs + MLX4_NUM_SPARE_EQE, 606 err = mlx4_create_eq(dev, dev->caps.num_cqs -
607 dev->caps.reserved_cqs +
608 MLX4_NUM_SPARE_EQE,
590 (dev->flags & MLX4_FLAG_MSI_X) ? i : 0, 609 (dev->flags & MLX4_FLAG_MSI_X) ? i : 0,
591 &priv->eq_table.eq[i]); 610 &priv->eq_table.eq[i]);
592 if (err) { 611 if (err) {
@@ -601,6 +620,22 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
601 if (err) 620 if (err)
602 goto err_out_comp; 621 goto err_out_comp;
603 622
623 /*if additional completion vectors poolsize is 0 this loop will not run*/
624 for (i = dev->caps.num_comp_vectors + 1;
625 i < dev->caps.num_comp_vectors + dev->caps.comp_pool + 1; ++i) {
626
627 err = mlx4_create_eq(dev, dev->caps.num_cqs -
628 dev->caps.reserved_cqs +
629 MLX4_NUM_SPARE_EQE,
630 (dev->flags & MLX4_FLAG_MSI_X) ? i : 0,
631 &priv->eq_table.eq[i]);
632 if (err) {
633 --i;
634 goto err_out_unmap;
635 }
636 }
637
638
604 if (dev->flags & MLX4_FLAG_MSI_X) { 639 if (dev->flags & MLX4_FLAG_MSI_X) {
605 const char *eq_name; 640 const char *eq_name;
606 641
@@ -686,7 +721,7 @@ void mlx4_cleanup_eq_table(struct mlx4_dev *dev)
686 721
687 mlx4_free_irqs(dev); 722 mlx4_free_irqs(dev);
688 723
689 for (i = 0; i < dev->caps.num_comp_vectors + 1; ++i) 724 for (i = 0; i < dev->caps.num_comp_vectors + dev->caps.comp_pool + 1; ++i)
690 mlx4_free_eq(dev, &priv->eq_table.eq[i]); 725 mlx4_free_eq(dev, &priv->eq_table.eq[i]);
691 726
692 mlx4_unmap_clr_int(dev); 727 mlx4_unmap_clr_int(dev);
@@ -743,3 +778,65 @@ int mlx4_test_interrupts(struct mlx4_dev *dev)
743 return err; 778 return err;
744} 779}
745EXPORT_SYMBOL(mlx4_test_interrupts); 780EXPORT_SYMBOL(mlx4_test_interrupts);
781
782int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector)
783{
784
785 struct mlx4_priv *priv = mlx4_priv(dev);
786 int vec = 0, err = 0, i;
787
788 spin_lock(&priv->msix_ctl.pool_lock);
789 for (i = 0; !vec && i < dev->caps.comp_pool; i++) {
790 if (~priv->msix_ctl.pool_bm & 1ULL << i) {
791 priv->msix_ctl.pool_bm |= 1ULL << i;
792 vec = dev->caps.num_comp_vectors + 1 + i;
793 snprintf(priv->eq_table.irq_names +
794 vec * MLX4_IRQNAME_SIZE,
795 MLX4_IRQNAME_SIZE, "%s", name);
796 err = request_irq(priv->eq_table.eq[vec].irq,
797 mlx4_msi_x_interrupt, 0,
798 &priv->eq_table.irq_names[vec<<5],
799 priv->eq_table.eq + vec);
800 if (err) {
801 /*zero out bit by fliping it*/
802 priv->msix_ctl.pool_bm ^= 1 << i;
803 vec = 0;
804 continue;
805 /*we dont want to break here*/
806 }
807 eq_set_ci(&priv->eq_table.eq[vec], 1);
808 }
809 }
810 spin_unlock(&priv->msix_ctl.pool_lock);
811
812 if (vec) {
813 *vector = vec;
814 } else {
815 *vector = 0;
816 err = (i == dev->caps.comp_pool) ? -ENOSPC : err;
817 }
818 return err;
819}
820EXPORT_SYMBOL(mlx4_assign_eq);
821
822void mlx4_release_eq(struct mlx4_dev *dev, int vec)
823{
824 struct mlx4_priv *priv = mlx4_priv(dev);
825 /*bm index*/
826 int i = vec - dev->caps.num_comp_vectors - 1;
827
828 if (likely(i >= 0)) {
829 /*sanity check , making sure were not trying to free irq's
830 Belonging to a legacy EQ*/
831 spin_lock(&priv->msix_ctl.pool_lock);
832 if (priv->msix_ctl.pool_bm & 1ULL << i) {
833 free_irq(priv->eq_table.eq[vec].irq,
834 &priv->eq_table.eq[vec]);
835 priv->msix_ctl.pool_bm &= ~(1ULL << i);
836 }
837 spin_unlock(&priv->msix_ctl.pool_lock);
838 }
839
840}
841EXPORT_SYMBOL(mlx4_release_eq);
842
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c
index 5de1db897835..67a209ba939d 100644
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -274,8 +274,11 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
274 dev_cap->stat_rate_support = stat_rate; 274 dev_cap->stat_rate_support = stat_rate;
275 MLX4_GET(field, outbox, QUERY_DEV_CAP_UDP_RSS_OFFSET); 275 MLX4_GET(field, outbox, QUERY_DEV_CAP_UDP_RSS_OFFSET);
276 dev_cap->udp_rss = field & 0x1; 276 dev_cap->udp_rss = field & 0x1;
277 dev_cap->vep_uc_steering = field & 0x2;
278 dev_cap->vep_mc_steering = field & 0x4;
277 MLX4_GET(field, outbox, QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET); 279 MLX4_GET(field, outbox, QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET);
278 dev_cap->loopback_support = field & 0x1; 280 dev_cap->loopback_support = field & 0x1;
281 dev_cap->wol = field & 0x40;
279 MLX4_GET(dev_cap->flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET); 282 MLX4_GET(dev_cap->flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET);
280 MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_UAR_OFFSET); 283 MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_UAR_OFFSET);
281 dev_cap->reserved_uars = field >> 4; 284 dev_cap->reserved_uars = field >> 4;
@@ -737,6 +740,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param)
737#define INIT_HCA_MC_BASE_OFFSET (INIT_HCA_MCAST_OFFSET + 0x00) 740#define INIT_HCA_MC_BASE_OFFSET (INIT_HCA_MCAST_OFFSET + 0x00)
738#define INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x12) 741#define INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x12)
739#define INIT_HCA_LOG_MC_HASH_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x16) 742#define INIT_HCA_LOG_MC_HASH_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x16)
743#define INIT_HCA_UC_STEERING_OFFSET (INIT_HCA_MCAST_OFFSET + 0x18)
740#define INIT_HCA_LOG_MC_TABLE_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x1b) 744#define INIT_HCA_LOG_MC_TABLE_SZ_OFFSET (INIT_HCA_MCAST_OFFSET + 0x1b)
741#define INIT_HCA_TPT_OFFSET 0x0f0 745#define INIT_HCA_TPT_OFFSET 0x0f0
742#define INIT_HCA_DMPT_BASE_OFFSET (INIT_HCA_TPT_OFFSET + 0x00) 746#define INIT_HCA_DMPT_BASE_OFFSET (INIT_HCA_TPT_OFFSET + 0x00)
@@ -797,6 +801,8 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param)
797 MLX4_PUT(inbox, param->mc_base, INIT_HCA_MC_BASE_OFFSET); 801 MLX4_PUT(inbox, param->mc_base, INIT_HCA_MC_BASE_OFFSET);
798 MLX4_PUT(inbox, param->log_mc_entry_sz, INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET); 802 MLX4_PUT(inbox, param->log_mc_entry_sz, INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET);
799 MLX4_PUT(inbox, param->log_mc_hash_sz, INIT_HCA_LOG_MC_HASH_SZ_OFFSET); 803 MLX4_PUT(inbox, param->log_mc_hash_sz, INIT_HCA_LOG_MC_HASH_SZ_OFFSET);
804 if (dev->caps.vep_mc_steering)
805 MLX4_PUT(inbox, (u8) (1 << 3), INIT_HCA_UC_STEERING_OFFSET);
800 MLX4_PUT(inbox, param->log_mc_table_sz, INIT_HCA_LOG_MC_TABLE_SZ_OFFSET); 806 MLX4_PUT(inbox, param->log_mc_table_sz, INIT_HCA_LOG_MC_TABLE_SZ_OFFSET);
801 807
802 /* TPT attributes */ 808 /* TPT attributes */
@@ -908,3 +914,22 @@ int mlx4_NOP(struct mlx4_dev *dev)
908 /* Input modifier of 0x1f means "finish as soon as possible." */ 914 /* Input modifier of 0x1f means "finish as soon as possible." */
909 return mlx4_cmd(dev, 0, 0x1f, 0, MLX4_CMD_NOP, 100); 915 return mlx4_cmd(dev, 0, 0x1f, 0, MLX4_CMD_NOP, 100);
910} 916}
917
918#define MLX4_WOL_SETUP_MODE (5 << 28)
919int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port)
920{
921 u32 in_mod = MLX4_WOL_SETUP_MODE | port << 8;
922
923 return mlx4_cmd_imm(dev, 0, config, in_mod, 0x3,
924 MLX4_CMD_MOD_STAT_CFG, MLX4_CMD_TIME_CLASS_A);
925}
926EXPORT_SYMBOL_GPL(mlx4_wol_read);
927
928int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port)
929{
930 u32 in_mod = MLX4_WOL_SETUP_MODE | port << 8;
931
932 return mlx4_cmd(dev, config, in_mod, 0x1, MLX4_CMD_MOD_STAT_CFG,
933 MLX4_CMD_TIME_CLASS_A);
934}
935EXPORT_SYMBOL_GPL(mlx4_wol_write);
diff --git a/drivers/net/mlx4/fw.h b/drivers/net/mlx4/fw.h
index 65cc72eb899d..88003ebc6185 100644
--- a/drivers/net/mlx4/fw.h
+++ b/drivers/net/mlx4/fw.h
@@ -80,6 +80,9 @@ struct mlx4_dev_cap {
80 u16 stat_rate_support; 80 u16 stat_rate_support;
81 int udp_rss; 81 int udp_rss;
82 int loopback_support; 82 int loopback_support;
83 int vep_uc_steering;
84 int vep_mc_steering;
85 int wol;
83 u32 flags; 86 u32 flags;
84 int reserved_uars; 87 int reserved_uars;
85 int uar_size; 88 int uar_size;
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index 2765a3ce9c24..3814fc9b1145 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -39,6 +39,7 @@
39#include <linux/pci.h> 39#include <linux/pci.h>
40#include <linux/dma-mapping.h> 40#include <linux/dma-mapping.h>
41#include <linux/slab.h> 41#include <linux/slab.h>
42#include <linux/io-mapping.h>
42 43
43#include <linux/mlx4/device.h> 44#include <linux/mlx4/device.h>
44#include <linux/mlx4/doorbell.h> 45#include <linux/mlx4/doorbell.h>
@@ -227,6 +228,9 @@ static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
227 dev->caps.stat_rate_support = dev_cap->stat_rate_support; 228 dev->caps.stat_rate_support = dev_cap->stat_rate_support;
228 dev->caps.udp_rss = dev_cap->udp_rss; 229 dev->caps.udp_rss = dev_cap->udp_rss;
229 dev->caps.loopback_support = dev_cap->loopback_support; 230 dev->caps.loopback_support = dev_cap->loopback_support;
231 dev->caps.vep_uc_steering = dev_cap->vep_uc_steering;
232 dev->caps.vep_mc_steering = dev_cap->vep_mc_steering;
233 dev->caps.wol = dev_cap->wol;
230 dev->caps.max_gso_sz = dev_cap->max_gso_sz; 234 dev->caps.max_gso_sz = dev_cap->max_gso_sz;
231 235
232 dev->caps.log_num_macs = log_num_mac; 236 dev->caps.log_num_macs = log_num_mac;
@@ -718,8 +722,31 @@ static void mlx4_free_icms(struct mlx4_dev *dev)
718 mlx4_free_icm(dev, priv->fw.aux_icm, 0); 722 mlx4_free_icm(dev, priv->fw.aux_icm, 0);
719} 723}
720 724
725static int map_bf_area(struct mlx4_dev *dev)
726{
727 struct mlx4_priv *priv = mlx4_priv(dev);
728 resource_size_t bf_start;
729 resource_size_t bf_len;
730 int err = 0;
731
732 bf_start = pci_resource_start(dev->pdev, 2) + (dev->caps.num_uars << PAGE_SHIFT);
733 bf_len = pci_resource_len(dev->pdev, 2) - (dev->caps.num_uars << PAGE_SHIFT);
734 priv->bf_mapping = io_mapping_create_wc(bf_start, bf_len);
735 if (!priv->bf_mapping)
736 err = -ENOMEM;
737
738 return err;
739}
740
741static void unmap_bf_area(struct mlx4_dev *dev)
742{
743 if (mlx4_priv(dev)->bf_mapping)
744 io_mapping_free(mlx4_priv(dev)->bf_mapping);
745}
746
721static void mlx4_close_hca(struct mlx4_dev *dev) 747static void mlx4_close_hca(struct mlx4_dev *dev)
722{ 748{
749 unmap_bf_area(dev);
723 mlx4_CLOSE_HCA(dev, 0); 750 mlx4_CLOSE_HCA(dev, 0);
724 mlx4_free_icms(dev); 751 mlx4_free_icms(dev);
725 mlx4_UNMAP_FA(dev); 752 mlx4_UNMAP_FA(dev);
@@ -772,6 +799,9 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
772 goto err_stop_fw; 799 goto err_stop_fw;
773 } 800 }
774 801
802 if (map_bf_area(dev))
803 mlx4_dbg(dev, "Failed to map blue flame area\n");
804
775 init_hca.log_uar_sz = ilog2(dev->caps.num_uars); 805 init_hca.log_uar_sz = ilog2(dev->caps.num_uars);
776 806
777 err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size); 807 err = mlx4_init_icm(dev, &dev_cap, &init_hca, icm_size);
@@ -802,6 +832,7 @@ err_free_icm:
802 mlx4_free_icms(dev); 832 mlx4_free_icms(dev);
803 833
804err_stop_fw: 834err_stop_fw:
835 unmap_bf_area(dev);
805 mlx4_UNMAP_FA(dev); 836 mlx4_UNMAP_FA(dev);
806 mlx4_free_icm(dev, priv->fw.fw_icm, 0); 837 mlx4_free_icm(dev, priv->fw.fw_icm, 0);
807 838
@@ -913,6 +944,10 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
913 } 944 }
914 945
915 for (port = 1; port <= dev->caps.num_ports; port++) { 946 for (port = 1; port <= dev->caps.num_ports; port++) {
947 enum mlx4_port_type port_type = 0;
948 mlx4_SENSE_PORT(dev, port, &port_type);
949 if (port_type)
950 dev->caps.port_type[port] = port_type;
916 ib_port_default_caps = 0; 951 ib_port_default_caps = 0;
917 err = mlx4_get_port_ib_caps(dev, port, &ib_port_default_caps); 952 err = mlx4_get_port_ib_caps(dev, port, &ib_port_default_caps);
918 if (err) 953 if (err)
@@ -927,6 +962,7 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
927 goto err_mcg_table_free; 962 goto err_mcg_table_free;
928 } 963 }
929 } 964 }
965 mlx4_set_port_mask(dev);
930 966
931 return 0; 967 return 0;
932 968
@@ -969,13 +1005,15 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
969{ 1005{
970 struct mlx4_priv *priv = mlx4_priv(dev); 1006 struct mlx4_priv *priv = mlx4_priv(dev);
971 struct msix_entry *entries; 1007 struct msix_entry *entries;
972 int nreq; 1008 int nreq = min_t(int, dev->caps.num_ports *
1009 min_t(int, num_online_cpus() + 1, MAX_MSIX_P_PORT)
1010 + MSIX_LEGACY_SZ, MAX_MSIX);
973 int err; 1011 int err;
974 int i; 1012 int i;
975 1013
976 if (msi_x) { 1014 if (msi_x) {
977 nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs, 1015 nreq = min_t(int, dev->caps.num_eqs - dev->caps.reserved_eqs,
978 num_possible_cpus() + 1); 1016 nreq);
979 entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL); 1017 entries = kcalloc(nreq, sizeof *entries, GFP_KERNEL);
980 if (!entries) 1018 if (!entries)
981 goto no_msi; 1019 goto no_msi;
@@ -998,7 +1036,15 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
998 goto no_msi; 1036 goto no_msi;
999 } 1037 }
1000 1038
1001 dev->caps.num_comp_vectors = nreq - 1; 1039 if (nreq <
1040 MSIX_LEGACY_SZ + dev->caps.num_ports * MIN_MSIX_P_PORT) {
1041 /*Working in legacy mode , all EQ's shared*/
1042 dev->caps.comp_pool = 0;
1043 dev->caps.num_comp_vectors = nreq - 1;
1044 } else {
1045 dev->caps.comp_pool = nreq - MSIX_LEGACY_SZ;
1046 dev->caps.num_comp_vectors = MSIX_LEGACY_SZ - 1;
1047 }
1002 for (i = 0; i < nreq; ++i) 1048 for (i = 0; i < nreq; ++i)
1003 priv->eq_table.eq[i].irq = entries[i].vector; 1049 priv->eq_table.eq[i].irq = entries[i].vector;
1004 1050
@@ -1010,6 +1056,7 @@ static void mlx4_enable_msi_x(struct mlx4_dev *dev)
1010 1056
1011no_msi: 1057no_msi:
1012 dev->caps.num_comp_vectors = 1; 1058 dev->caps.num_comp_vectors = 1;
1059 dev->caps.comp_pool = 0;
1013 1060
1014 for (i = 0; i < 2; ++i) 1061 for (i = 0; i < 2; ++i)
1015 priv->eq_table.eq[i].irq = dev->pdev->irq; 1062 priv->eq_table.eq[i].irq = dev->pdev->irq;
@@ -1049,6 +1096,59 @@ static void mlx4_cleanup_port_info(struct mlx4_port_info *info)
1049 device_remove_file(&info->dev->pdev->dev, &info->port_attr); 1096 device_remove_file(&info->dev->pdev->dev, &info->port_attr);
1050} 1097}
1051 1098
1099static int mlx4_init_steering(struct mlx4_dev *dev)
1100{
1101 struct mlx4_priv *priv = mlx4_priv(dev);
1102 int num_entries = dev->caps.num_ports;
1103 int i, j;
1104
1105 priv->steer = kzalloc(sizeof(struct mlx4_steer) * num_entries, GFP_KERNEL);
1106 if (!priv->steer)
1107 return -ENOMEM;
1108
1109 for (i = 0; i < num_entries; i++) {
1110 for (j = 0; j < MLX4_NUM_STEERS; j++) {
1111 INIT_LIST_HEAD(&priv->steer[i].promisc_qps[j]);
1112 INIT_LIST_HEAD(&priv->steer[i].steer_entries[j]);
1113 }
1114 INIT_LIST_HEAD(&priv->steer[i].high_prios);
1115 }
1116 return 0;
1117}
1118
1119static void mlx4_clear_steering(struct mlx4_dev *dev)
1120{
1121 struct mlx4_priv *priv = mlx4_priv(dev);
1122 struct mlx4_steer_index *entry, *tmp_entry;
1123 struct mlx4_promisc_qp *pqp, *tmp_pqp;
1124 int num_entries = dev->caps.num_ports;
1125 int i, j;
1126
1127 for (i = 0; i < num_entries; i++) {
1128 for (j = 0; j < MLX4_NUM_STEERS; j++) {
1129 list_for_each_entry_safe(pqp, tmp_pqp,
1130 &priv->steer[i].promisc_qps[j],
1131 list) {
1132 list_del(&pqp->list);
1133 kfree(pqp);
1134 }
1135 list_for_each_entry_safe(entry, tmp_entry,
1136 &priv->steer[i].steer_entries[j],
1137 list) {
1138 list_del(&entry->list);
1139 list_for_each_entry_safe(pqp, tmp_pqp,
1140 &entry->duplicates,
1141 list) {
1142 list_del(&pqp->list);
1143 kfree(pqp);
1144 }
1145 kfree(entry);
1146 }
1147 }
1148 }
1149 kfree(priv->steer);
1150}
1151
1052static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 1152static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
1053{ 1153{
1054 struct mlx4_priv *priv; 1154 struct mlx4_priv *priv;
@@ -1109,6 +1209,9 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
1109 } 1209 }
1110 } 1210 }
1111 1211
1212 /* Allow large DMA segments, up to the firmware limit of 1 GB */
1213 dma_set_max_seg_size(&pdev->dev, 1024 * 1024 * 1024);
1214
1112 priv = kzalloc(sizeof *priv, GFP_KERNEL); 1215 priv = kzalloc(sizeof *priv, GFP_KERNEL);
1113 if (!priv) { 1216 if (!priv) {
1114 dev_err(&pdev->dev, "Device struct alloc failed, " 1217 dev_err(&pdev->dev, "Device struct alloc failed, "
@@ -1127,6 +1230,11 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
1127 INIT_LIST_HEAD(&priv->pgdir_list); 1230 INIT_LIST_HEAD(&priv->pgdir_list);
1128 mutex_init(&priv->pgdir_mutex); 1231 mutex_init(&priv->pgdir_mutex);
1129 1232
1233 pci_read_config_byte(pdev, PCI_REVISION_ID, &dev->rev_id);
1234
1235 INIT_LIST_HEAD(&priv->bf_list);
1236 mutex_init(&priv->bf_mutex);
1237
1130 /* 1238 /*
1131 * Now reset the HCA before we touch the PCI capabilities or 1239 * Now reset the HCA before we touch the PCI capabilities or
1132 * attempt a firmware command, since a boot ROM may have left 1240 * attempt a firmware command, since a boot ROM may have left
@@ -1151,8 +1259,15 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
1151 if (err) 1259 if (err)
1152 goto err_close; 1260 goto err_close;
1153 1261
1262 priv->msix_ctl.pool_bm = 0;
1263 spin_lock_init(&priv->msix_ctl.pool_lock);
1264
1154 mlx4_enable_msi_x(dev); 1265 mlx4_enable_msi_x(dev);
1155 1266
1267 err = mlx4_init_steering(dev);
1268 if (err)
1269 goto err_free_eq;
1270
1156 err = mlx4_setup_hca(dev); 1271 err = mlx4_setup_hca(dev);
1157 if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X)) { 1272 if (err == -EBUSY && (dev->flags & MLX4_FLAG_MSI_X)) {
1158 dev->flags &= ~MLX4_FLAG_MSI_X; 1273 dev->flags &= ~MLX4_FLAG_MSI_X;
@@ -1161,7 +1276,7 @@ static int __mlx4_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
1161 } 1276 }
1162 1277
1163 if (err) 1278 if (err)
1164 goto err_free_eq; 1279 goto err_steer;
1165 1280
1166 for (port = 1; port <= dev->caps.num_ports; port++) { 1281 for (port = 1; port <= dev->caps.num_ports; port++) {
1167 err = mlx4_init_port_info(dev, port); 1282 err = mlx4_init_port_info(dev, port);
@@ -1194,6 +1309,9 @@ err_port:
1194 mlx4_cleanup_pd_table(dev); 1309 mlx4_cleanup_pd_table(dev);
1195 mlx4_cleanup_uar_table(dev); 1310 mlx4_cleanup_uar_table(dev);
1196 1311
1312err_steer:
1313 mlx4_clear_steering(dev);
1314
1197err_free_eq: 1315err_free_eq:
1198 mlx4_free_eq_table(dev); 1316 mlx4_free_eq_table(dev);
1199 1317
@@ -1253,6 +1371,7 @@ static void mlx4_remove_one(struct pci_dev *pdev)
1253 iounmap(priv->kar); 1371 iounmap(priv->kar);
1254 mlx4_uar_free(dev, &priv->driver_uar); 1372 mlx4_uar_free(dev, &priv->driver_uar);
1255 mlx4_cleanup_uar_table(dev); 1373 mlx4_cleanup_uar_table(dev);
1374 mlx4_clear_steering(dev);
1256 mlx4_free_eq_table(dev); 1375 mlx4_free_eq_table(dev);
1257 mlx4_close_hca(dev); 1376 mlx4_close_hca(dev);
1258 mlx4_cmd_cleanup(dev); 1377 mlx4_cmd_cleanup(dev);
diff --git a/drivers/net/mlx4/mcg.c b/drivers/net/mlx4/mcg.c
index 79cf42db2ea9..e63c37d6a115 100644
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -32,6 +32,7 @@
32 */ 32 */
33 33
34#include <linux/string.h> 34#include <linux/string.h>
35#include <linux/etherdevice.h>
35 36
36#include <linux/mlx4/cmd.h> 37#include <linux/mlx4/cmd.h>
37 38
@@ -40,38 +41,40 @@
40#define MGM_QPN_MASK 0x00FFFFFF 41#define MGM_QPN_MASK 0x00FFFFFF
41#define MGM_BLCK_LB_BIT 30 42#define MGM_BLCK_LB_BIT 30
42 43
43struct mlx4_mgm {
44 __be32 next_gid_index;
45 __be32 members_count;
46 u32 reserved[2];
47 u8 gid[16];
48 __be32 qp[MLX4_QP_PER_MGM];
49};
50
51static const u8 zero_gid[16]; /* automatically initialized to 0 */ 44static const u8 zero_gid[16]; /* automatically initialized to 0 */
52 45
53static int mlx4_READ_MCG(struct mlx4_dev *dev, int index, 46static int mlx4_READ_ENTRY(struct mlx4_dev *dev, int index,
54 struct mlx4_cmd_mailbox *mailbox) 47 struct mlx4_cmd_mailbox *mailbox)
55{ 48{
56 return mlx4_cmd_box(dev, 0, mailbox->dma, index, 0, MLX4_CMD_READ_MCG, 49 return mlx4_cmd_box(dev, 0, mailbox->dma, index, 0, MLX4_CMD_READ_MCG,
57 MLX4_CMD_TIME_CLASS_A); 50 MLX4_CMD_TIME_CLASS_A);
58} 51}
59 52
60static int mlx4_WRITE_MCG(struct mlx4_dev *dev, int index, 53static int mlx4_WRITE_ENTRY(struct mlx4_dev *dev, int index,
61 struct mlx4_cmd_mailbox *mailbox) 54 struct mlx4_cmd_mailbox *mailbox)
62{ 55{
63 return mlx4_cmd(dev, mailbox->dma, index, 0, MLX4_CMD_WRITE_MCG, 56 return mlx4_cmd(dev, mailbox->dma, index, 0, MLX4_CMD_WRITE_MCG,
64 MLX4_CMD_TIME_CLASS_A); 57 MLX4_CMD_TIME_CLASS_A);
65} 58}
66 59
67static int mlx4_MGID_HASH(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox, 60static int mlx4_WRITE_PROMISC(struct mlx4_dev *dev, u8 vep_num, u8 port, u8 steer,
68 u16 *hash) 61 struct mlx4_cmd_mailbox *mailbox)
62{
63 u32 in_mod;
64
65 in_mod = (u32) vep_num << 24 | (u32) port << 16 | steer << 1;
66 return mlx4_cmd(dev, mailbox->dma, in_mod, 0x1,
67 MLX4_CMD_WRITE_MCG, MLX4_CMD_TIME_CLASS_A);
68}
69
70static int mlx4_GID_HASH(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox,
71 u16 *hash, u8 op_mod)
69{ 72{
70 u64 imm; 73 u64 imm;
71 int err; 74 int err;
72 75
73 err = mlx4_cmd_imm(dev, mailbox->dma, &imm, 0, 0, MLX4_CMD_MGID_HASH, 76 err = mlx4_cmd_imm(dev, mailbox->dma, &imm, 0, op_mod,
74 MLX4_CMD_TIME_CLASS_A); 77 MLX4_CMD_MGID_HASH, MLX4_CMD_TIME_CLASS_A);
75 78
76 if (!err) 79 if (!err)
77 *hash = imm; 80 *hash = imm;
@@ -79,6 +82,458 @@ static int mlx4_MGID_HASH(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox
79 return err; 82 return err;
80} 83}
81 84
85static struct mlx4_promisc_qp *get_promisc_qp(struct mlx4_dev *dev, u8 pf_num,
86 enum mlx4_steer_type steer,
87 u32 qpn)
88{
89 struct mlx4_steer *s_steer = &mlx4_priv(dev)->steer[pf_num];
90 struct mlx4_promisc_qp *pqp;
91
92 list_for_each_entry(pqp, &s_steer->promisc_qps[steer], list) {
93 if (pqp->qpn == qpn)
94 return pqp;
95 }
96 /* not found */
97 return NULL;
98}
99
100/*
101 * Add new entry to steering data structure.
102 * All promisc QPs should be added as well
103 */
104static int new_steering_entry(struct mlx4_dev *dev, u8 vep_num, u8 port,
105 enum mlx4_steer_type steer,
106 unsigned int index, u32 qpn)
107{
108 struct mlx4_steer *s_steer;
109 struct mlx4_cmd_mailbox *mailbox;
110 struct mlx4_mgm *mgm;
111 u32 members_count;
112 struct mlx4_steer_index *new_entry;
113 struct mlx4_promisc_qp *pqp;
114 struct mlx4_promisc_qp *dqp = NULL;
115 u32 prot;
116 int err;
117 u8 pf_num;
118
119 pf_num = (dev->caps.num_ports == 1) ? vep_num : (vep_num << 1) | (port - 1);
120 s_steer = &mlx4_priv(dev)->steer[pf_num];
121 new_entry = kzalloc(sizeof *new_entry, GFP_KERNEL);
122 if (!new_entry)
123 return -ENOMEM;
124
125 INIT_LIST_HEAD(&new_entry->duplicates);
126 new_entry->index = index;
127 list_add_tail(&new_entry->list, &s_steer->steer_entries[steer]);
128
129 /* If the given qpn is also a promisc qp,
130 * it should be inserted to duplicates list
131 */
132 pqp = get_promisc_qp(dev, pf_num, steer, qpn);
133 if (pqp) {
134 dqp = kmalloc(sizeof *dqp, GFP_KERNEL);
135 if (!dqp) {
136 err = -ENOMEM;
137 goto out_alloc;
138 }
139 dqp->qpn = qpn;
140 list_add_tail(&dqp->list, &new_entry->duplicates);
141 }
142
143 /* if no promisc qps for this vep, we are done */
144 if (list_empty(&s_steer->promisc_qps[steer]))
145 return 0;
146
147 /* now need to add all the promisc qps to the new
148 * steering entry, as they should also receive the packets
149 * destined to this address */
150 mailbox = mlx4_alloc_cmd_mailbox(dev);
151 if (IS_ERR(mailbox)) {
152 err = -ENOMEM;
153 goto out_alloc;
154 }
155 mgm = mailbox->buf;
156
157 err = mlx4_READ_ENTRY(dev, index, mailbox);
158 if (err)
159 goto out_mailbox;
160
161 members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
162 prot = be32_to_cpu(mgm->members_count) >> 30;
163 list_for_each_entry(pqp, &s_steer->promisc_qps[steer], list) {
164 /* don't add already existing qpn */
165 if (pqp->qpn == qpn)
166 continue;
167 if (members_count == MLX4_QP_PER_MGM) {
168 /* out of space */
169 err = -ENOMEM;
170 goto out_mailbox;
171 }
172
173 /* add the qpn */
174 mgm->qp[members_count++] = cpu_to_be32(pqp->qpn & MGM_QPN_MASK);
175 }
176 /* update the qps count and update the entry with all the promisc qps*/
177 mgm->members_count = cpu_to_be32(members_count | (prot << 30));
178 err = mlx4_WRITE_ENTRY(dev, index, mailbox);
179
180out_mailbox:
181 mlx4_free_cmd_mailbox(dev, mailbox);
182 if (!err)
183 return 0;
184out_alloc:
185 if (dqp) {
186 list_del(&dqp->list);
187 kfree(dqp);
188 }
189 list_del(&new_entry->list);
190 kfree(new_entry);
191 return err;
192}
193
194/* update the data structures with existing steering entry */
195static int existing_steering_entry(struct mlx4_dev *dev, u8 vep_num, u8 port,
196 enum mlx4_steer_type steer,
197 unsigned int index, u32 qpn)
198{
199 struct mlx4_steer *s_steer;
200 struct mlx4_steer_index *tmp_entry, *entry = NULL;
201 struct mlx4_promisc_qp *pqp;
202 struct mlx4_promisc_qp *dqp;
203 u8 pf_num;
204
205 pf_num = (dev->caps.num_ports == 1) ? vep_num : (vep_num << 1) | (port - 1);
206 s_steer = &mlx4_priv(dev)->steer[pf_num];
207
208 pqp = get_promisc_qp(dev, pf_num, steer, qpn);
209 if (!pqp)
210 return 0; /* nothing to do */
211
212 list_for_each_entry(tmp_entry, &s_steer->steer_entries[steer], list) {
213 if (tmp_entry->index == index) {
214 entry = tmp_entry;
215 break;
216 }
217 }
218 if (unlikely(!entry)) {
219 mlx4_warn(dev, "Steering entry at index %x is not registered\n", index);
220 return -EINVAL;
221 }
222
223 /* the given qpn is listed as a promisc qpn
224 * we need to add it as a duplicate to this entry
225 * for future references */
226 list_for_each_entry(dqp, &entry->duplicates, list) {
227 if (qpn == dqp->qpn)
228 return 0; /* qp is already duplicated */
229 }
230
231 /* add the qp as a duplicate on this index */
232 dqp = kmalloc(sizeof *dqp, GFP_KERNEL);
233 if (!dqp)
234 return -ENOMEM;
235 dqp->qpn = qpn;
236 list_add_tail(&dqp->list, &entry->duplicates);
237
238 return 0;
239}
240
241/* Check whether a qpn is a duplicate on steering entry
242 * If so, it should not be removed from mgm */
243static bool check_duplicate_entry(struct mlx4_dev *dev, u8 vep_num, u8 port,
244 enum mlx4_steer_type steer,
245 unsigned int index, u32 qpn)
246{
247 struct mlx4_steer *s_steer;
248 struct mlx4_steer_index *tmp_entry, *entry = NULL;
249 struct mlx4_promisc_qp *dqp, *tmp_dqp;
250 u8 pf_num;
251
252 pf_num = (dev->caps.num_ports == 1) ? vep_num : (vep_num << 1) | (port - 1);
253 s_steer = &mlx4_priv(dev)->steer[pf_num];
254
255 /* if qp is not promisc, it cannot be duplicated */
256 if (!get_promisc_qp(dev, pf_num, steer, qpn))
257 return false;
258
259 /* The qp is promisc qp so it is a duplicate on this index
260 * Find the index entry, and remove the duplicate */
261 list_for_each_entry(tmp_entry, &s_steer->steer_entries[steer], list) {
262 if (tmp_entry->index == index) {
263 entry = tmp_entry;
264 break;
265 }
266 }
267 if (unlikely(!entry)) {
268 mlx4_warn(dev, "Steering entry for index %x is not registered\n", index);
269 return false;
270 }
271 list_for_each_entry_safe(dqp, tmp_dqp, &entry->duplicates, list) {
272 if (dqp->qpn == qpn) {
273 list_del(&dqp->list);
274 kfree(dqp);
275 }
276 }
277 return true;
278}
279
280/* I a steering entry contains only promisc QPs, it can be removed. */
281static bool can_remove_steering_entry(struct mlx4_dev *dev, u8 vep_num, u8 port,
282 enum mlx4_steer_type steer,
283 unsigned int index, u32 tqpn)
284{
285 struct mlx4_steer *s_steer;
286 struct mlx4_cmd_mailbox *mailbox;
287 struct mlx4_mgm *mgm;
288 struct mlx4_steer_index *entry = NULL, *tmp_entry;
289 u32 qpn;
290 u32 members_count;
291 bool ret = false;
292 int i;
293 u8 pf_num;
294
295 pf_num = (dev->caps.num_ports == 1) ? vep_num : (vep_num << 1) | (port - 1);
296 s_steer = &mlx4_priv(dev)->steer[pf_num];
297
298 mailbox = mlx4_alloc_cmd_mailbox(dev);
299 if (IS_ERR(mailbox))
300 return false;
301 mgm = mailbox->buf;
302
303 if (mlx4_READ_ENTRY(dev, index, mailbox))
304 goto out;
305 members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
306 for (i = 0; i < members_count; i++) {
307 qpn = be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK;
308 if (!get_promisc_qp(dev, pf_num, steer, qpn) && qpn != tqpn) {
309 /* the qp is not promisc, the entry can't be removed */
310 goto out;
311 }
312 }
313 /* All the qps currently registered for this entry are promiscuous,
314 * Checking for duplicates */
315 ret = true;
316 list_for_each_entry_safe(entry, tmp_entry, &s_steer->steer_entries[steer], list) {
317 if (entry->index == index) {
318 if (list_empty(&entry->duplicates)) {
319 list_del(&entry->list);
320 kfree(entry);
321 } else {
322 /* This entry contains duplicates so it shouldn't be removed */
323 ret = false;
324 goto out;
325 }
326 }
327 }
328
329out:
330 mlx4_free_cmd_mailbox(dev, mailbox);
331 return ret;
332}
333
334static int add_promisc_qp(struct mlx4_dev *dev, u8 vep_num, u8 port,
335 enum mlx4_steer_type steer, u32 qpn)
336{
337 struct mlx4_steer *s_steer;
338 struct mlx4_cmd_mailbox *mailbox;
339 struct mlx4_mgm *mgm;
340 struct mlx4_steer_index *entry;
341 struct mlx4_promisc_qp *pqp;
342 struct mlx4_promisc_qp *dqp;
343 u32 members_count;
344 u32 prot;
345 int i;
346 bool found;
347 int last_index;
348 int err;
349 u8 pf_num;
350 struct mlx4_priv *priv = mlx4_priv(dev);
351 pf_num = (dev->caps.num_ports == 1) ? vep_num : (vep_num << 1) | (port - 1);
352 s_steer = &mlx4_priv(dev)->steer[pf_num];
353
354 mutex_lock(&priv->mcg_table.mutex);
355
356 if (get_promisc_qp(dev, pf_num, steer, qpn)) {
357 err = 0; /* Noting to do, already exists */
358 goto out_mutex;
359 }
360
361 pqp = kmalloc(sizeof *pqp, GFP_KERNEL);
362 if (!pqp) {
363 err = -ENOMEM;
364 goto out_mutex;
365 }
366 pqp->qpn = qpn;
367
368 mailbox = mlx4_alloc_cmd_mailbox(dev);
369 if (IS_ERR(mailbox)) {
370 err = -ENOMEM;
371 goto out_alloc;
372 }
373 mgm = mailbox->buf;
374
375 /* the promisc qp needs to be added for each one of the steering
376 * entries, if it already exists, needs to be added as a duplicate
377 * for this entry */
378 list_for_each_entry(entry, &s_steer->steer_entries[steer], list) {
379 err = mlx4_READ_ENTRY(dev, entry->index, mailbox);
380 if (err)
381 goto out_mailbox;
382
383 members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
384 prot = be32_to_cpu(mgm->members_count) >> 30;
385 found = false;
386 for (i = 0; i < members_count; i++) {
387 if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qpn) {
388 /* Entry already exists, add to duplicates */
389 dqp = kmalloc(sizeof *dqp, GFP_KERNEL);
390 if (!dqp)
391 goto out_mailbox;
392 dqp->qpn = qpn;
393 list_add_tail(&dqp->list, &entry->duplicates);
394 found = true;
395 }
396 }
397 if (!found) {
398 /* Need to add the qpn to mgm */
399 if (members_count == MLX4_QP_PER_MGM) {
400 /* entry is full */
401 err = -ENOMEM;
402 goto out_mailbox;
403 }
404 mgm->qp[members_count++] = cpu_to_be32(qpn & MGM_QPN_MASK);
405 mgm->members_count = cpu_to_be32(members_count | (prot << 30));
406 err = mlx4_WRITE_ENTRY(dev, entry->index, mailbox);
407 if (err)
408 goto out_mailbox;
409 }
410 last_index = entry->index;
411 }
412
413 /* add the new qpn to list of promisc qps */
414 list_add_tail(&pqp->list, &s_steer->promisc_qps[steer]);
415 /* now need to add all the promisc qps to default entry */
416 memset(mgm, 0, sizeof *mgm);
417 members_count = 0;
418 list_for_each_entry(dqp, &s_steer->promisc_qps[steer], list)
419 mgm->qp[members_count++] = cpu_to_be32(dqp->qpn & MGM_QPN_MASK);
420 mgm->members_count = cpu_to_be32(members_count | MLX4_PROT_ETH << 30);
421
422 err = mlx4_WRITE_PROMISC(dev, vep_num, port, steer, mailbox);
423 if (err)
424 goto out_list;
425
426 mlx4_free_cmd_mailbox(dev, mailbox);
427 mutex_unlock(&priv->mcg_table.mutex);
428 return 0;
429
430out_list:
431 list_del(&pqp->list);
432out_mailbox:
433 mlx4_free_cmd_mailbox(dev, mailbox);
434out_alloc:
435 kfree(pqp);
436out_mutex:
437 mutex_unlock(&priv->mcg_table.mutex);
438 return err;
439}
440
441static int remove_promisc_qp(struct mlx4_dev *dev, u8 vep_num, u8 port,
442 enum mlx4_steer_type steer, u32 qpn)
443{
444 struct mlx4_priv *priv = mlx4_priv(dev);
445 struct mlx4_steer *s_steer;
446 struct mlx4_cmd_mailbox *mailbox;
447 struct mlx4_mgm *mgm;
448 struct mlx4_steer_index *entry;
449 struct mlx4_promisc_qp *pqp;
450 struct mlx4_promisc_qp *dqp;
451 u32 members_count;
452 bool found;
453 bool back_to_list = false;
454 int loc, i;
455 int err;
456 u8 pf_num;
457
458 pf_num = (dev->caps.num_ports == 1) ? vep_num : (vep_num << 1) | (port - 1);
459 s_steer = &mlx4_priv(dev)->steer[pf_num];
460 mutex_lock(&priv->mcg_table.mutex);
461
462 pqp = get_promisc_qp(dev, pf_num, steer, qpn);
463 if (unlikely(!pqp)) {
464 mlx4_warn(dev, "QP %x is not promiscuous QP\n", qpn);
465 /* nothing to do */
466 err = 0;
467 goto out_mutex;
468 }
469
470 /*remove from list of promisc qps */
471 list_del(&pqp->list);
472
473 /* set the default entry not to include the removed one */
474 mailbox = mlx4_alloc_cmd_mailbox(dev);
475 if (IS_ERR(mailbox)) {
476 err = -ENOMEM;
477 back_to_list = true;
478 goto out_list;
479 }
480 mgm = mailbox->buf;
481 members_count = 0;
482 list_for_each_entry(dqp, &s_steer->promisc_qps[steer], list)
483 mgm->qp[members_count++] = cpu_to_be32(dqp->qpn & MGM_QPN_MASK);
484 mgm->members_count = cpu_to_be32(members_count | MLX4_PROT_ETH << 30);
485
486 err = mlx4_WRITE_PROMISC(dev, vep_num, port, steer, mailbox);
487 if (err)
488 goto out_mailbox;
489
490 /* remove the qp from all the steering entries*/
491 list_for_each_entry(entry, &s_steer->steer_entries[steer], list) {
492 found = false;
493 list_for_each_entry(dqp, &entry->duplicates, list) {
494 if (dqp->qpn == qpn) {
495 found = true;
496 break;
497 }
498 }
499 if (found) {
500 /* a duplicate, no need to change the mgm,
501 * only update the duplicates list */
502 list_del(&dqp->list);
503 kfree(dqp);
504 } else {
505 err = mlx4_READ_ENTRY(dev, entry->index, mailbox);
506 if (err)
507 goto out_mailbox;
508 members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
509 for (loc = -1, i = 0; i < members_count; ++i)
510 if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qpn)
511 loc = i;
512
513 mgm->members_count = cpu_to_be32(--members_count |
514 (MLX4_PROT_ETH << 30));
515 mgm->qp[loc] = mgm->qp[i - 1];
516 mgm->qp[i - 1] = 0;
517
518 err = mlx4_WRITE_ENTRY(dev, entry->index, mailbox);
519 if (err)
520 goto out_mailbox;
521 }
522
523 }
524
525out_mailbox:
526 mlx4_free_cmd_mailbox(dev, mailbox);
527out_list:
528 if (back_to_list)
529 list_add_tail(&pqp->list, &s_steer->promisc_qps[steer]);
530 else
531 kfree(pqp);
532out_mutex:
533 mutex_unlock(&priv->mcg_table.mutex);
534 return err;
535}
536
82/* 537/*
83 * Caller must hold MCG table semaphore. gid and mgm parameters must 538 * Caller must hold MCG table semaphore. gid and mgm parameters must
84 * be properly aligned for command interface. 539 * be properly aligned for command interface.
@@ -94,15 +549,17 @@ static int mlx4_MGID_HASH(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox
94 * If no AMGM exists for given gid, *index = -1, *prev = index of last 549 * If no AMGM exists for given gid, *index = -1, *prev = index of last
95 * entry in hash chain and *mgm holds end of hash chain. 550 * entry in hash chain and *mgm holds end of hash chain.
96 */ 551 */
97static int find_mgm(struct mlx4_dev *dev, 552static int find_entry(struct mlx4_dev *dev, u8 port,
98 u8 *gid, enum mlx4_protocol protocol, 553 u8 *gid, enum mlx4_protocol prot,
99 struct mlx4_cmd_mailbox *mgm_mailbox, 554 enum mlx4_steer_type steer,
100 u16 *hash, int *prev, int *index) 555 struct mlx4_cmd_mailbox *mgm_mailbox,
556 u16 *hash, int *prev, int *index)
101{ 557{
102 struct mlx4_cmd_mailbox *mailbox; 558 struct mlx4_cmd_mailbox *mailbox;
103 struct mlx4_mgm *mgm = mgm_mailbox->buf; 559 struct mlx4_mgm *mgm = mgm_mailbox->buf;
104 u8 *mgid; 560 u8 *mgid;
105 int err; 561 int err;
562 u8 op_mod = (prot == MLX4_PROT_ETH) ? !!(dev->caps.vep_mc_steering) : 0;
106 563
107 mailbox = mlx4_alloc_cmd_mailbox(dev); 564 mailbox = mlx4_alloc_cmd_mailbox(dev);
108 if (IS_ERR(mailbox)) 565 if (IS_ERR(mailbox))
@@ -111,7 +568,7 @@ static int find_mgm(struct mlx4_dev *dev,
111 568
112 memcpy(mgid, gid, 16); 569 memcpy(mgid, gid, 16);
113 570
114 err = mlx4_MGID_HASH(dev, mailbox, hash); 571 err = mlx4_GID_HASH(dev, mailbox, hash, op_mod);
115 mlx4_free_cmd_mailbox(dev, mailbox); 572 mlx4_free_cmd_mailbox(dev, mailbox);
116 if (err) 573 if (err)
117 return err; 574 return err;
@@ -123,11 +580,11 @@ static int find_mgm(struct mlx4_dev *dev,
123 *prev = -1; 580 *prev = -1;
124 581
125 do { 582 do {
126 err = mlx4_READ_MCG(dev, *index, mgm_mailbox); 583 err = mlx4_READ_ENTRY(dev, *index, mgm_mailbox);
127 if (err) 584 if (err)
128 return err; 585 return err;
129 586
130 if (!memcmp(mgm->gid, zero_gid, 16)) { 587 if (!(be32_to_cpu(mgm->members_count) & 0xffffff)) {
131 if (*index != *hash) { 588 if (*index != *hash) {
132 mlx4_err(dev, "Found zero MGID in AMGM.\n"); 589 mlx4_err(dev, "Found zero MGID in AMGM.\n");
133 err = -EINVAL; 590 err = -EINVAL;
@@ -136,7 +593,7 @@ static int find_mgm(struct mlx4_dev *dev,
136 } 593 }
137 594
138 if (!memcmp(mgm->gid, gid, 16) && 595 if (!memcmp(mgm->gid, gid, 16) &&
139 be32_to_cpu(mgm->members_count) >> 30 == protocol) 596 be32_to_cpu(mgm->members_count) >> 30 == prot)
140 return err; 597 return err;
141 598
142 *prev = *index; 599 *prev = *index;
@@ -147,8 +604,9 @@ static int find_mgm(struct mlx4_dev *dev,
147 return err; 604 return err;
148} 605}
149 606
150int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], 607int mlx4_qp_attach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
151 int block_mcast_loopback, enum mlx4_protocol protocol) 608 int block_mcast_loopback, enum mlx4_protocol prot,
609 enum mlx4_steer_type steer)
152{ 610{
153 struct mlx4_priv *priv = mlx4_priv(dev); 611 struct mlx4_priv *priv = mlx4_priv(dev);
154 struct mlx4_cmd_mailbox *mailbox; 612 struct mlx4_cmd_mailbox *mailbox;
@@ -159,6 +617,8 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
159 int link = 0; 617 int link = 0;
160 int i; 618 int i;
161 int err; 619 int err;
620 u8 port = gid[5];
621 u8 new_entry = 0;
162 622
163 mailbox = mlx4_alloc_cmd_mailbox(dev); 623 mailbox = mlx4_alloc_cmd_mailbox(dev);
164 if (IS_ERR(mailbox)) 624 if (IS_ERR(mailbox))
@@ -166,14 +626,16 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
166 mgm = mailbox->buf; 626 mgm = mailbox->buf;
167 627
168 mutex_lock(&priv->mcg_table.mutex); 628 mutex_lock(&priv->mcg_table.mutex);
169 629 err = find_entry(dev, port, gid, prot, steer,
170 err = find_mgm(dev, gid, protocol, mailbox, &hash, &prev, &index); 630 mailbox, &hash, &prev, &index);
171 if (err) 631 if (err)
172 goto out; 632 goto out;
173 633
174 if (index != -1) { 634 if (index != -1) {
175 if (!memcmp(mgm->gid, zero_gid, 16)) 635 if (!(be32_to_cpu(mgm->members_count) & 0xffffff)) {
636 new_entry = 1;
176 memcpy(mgm->gid, gid, 16); 637 memcpy(mgm->gid, gid, 16);
638 }
177 } else { 639 } else {
178 link = 1; 640 link = 1;
179 641
@@ -209,26 +671,34 @@ int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
209 else 671 else
210 mgm->qp[members_count++] = cpu_to_be32(qp->qpn & MGM_QPN_MASK); 672 mgm->qp[members_count++] = cpu_to_be32(qp->qpn & MGM_QPN_MASK);
211 673
212 mgm->members_count = cpu_to_be32(members_count | (u32) protocol << 30); 674 mgm->members_count = cpu_to_be32(members_count | (u32) prot << 30);
213 675
214 err = mlx4_WRITE_MCG(dev, index, mailbox); 676 err = mlx4_WRITE_ENTRY(dev, index, mailbox);
215 if (err) 677 if (err)
216 goto out; 678 goto out;
217 679
218 if (!link) 680 if (!link)
219 goto out; 681 goto out;
220 682
221 err = mlx4_READ_MCG(dev, prev, mailbox); 683 err = mlx4_READ_ENTRY(dev, prev, mailbox);
222 if (err) 684 if (err)
223 goto out; 685 goto out;
224 686
225 mgm->next_gid_index = cpu_to_be32(index << 6); 687 mgm->next_gid_index = cpu_to_be32(index << 6);
226 688
227 err = mlx4_WRITE_MCG(dev, prev, mailbox); 689 err = mlx4_WRITE_ENTRY(dev, prev, mailbox);
228 if (err) 690 if (err)
229 goto out; 691 goto out;
230 692
231out: 693out:
694 if (prot == MLX4_PROT_ETH) {
695 /* manage the steering entry for promisc mode */
696 if (new_entry)
697 new_steering_entry(dev, 0, port, steer, index, qp->qpn);
698 else
699 existing_steering_entry(dev, 0, port, steer,
700 index, qp->qpn);
701 }
232 if (err && link && index != -1) { 702 if (err && link && index != -1) {
233 if (index < dev->caps.num_mgms) 703 if (index < dev->caps.num_mgms)
234 mlx4_warn(dev, "Got AMGM index %d < %d", 704 mlx4_warn(dev, "Got AMGM index %d < %d",
@@ -242,10 +712,9 @@ out:
242 mlx4_free_cmd_mailbox(dev, mailbox); 712 mlx4_free_cmd_mailbox(dev, mailbox);
243 return err; 713 return err;
244} 714}
245EXPORT_SYMBOL_GPL(mlx4_multicast_attach);
246 715
247int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], 716int mlx4_qp_detach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
248 enum mlx4_protocol protocol) 717 enum mlx4_protocol prot, enum mlx4_steer_type steer)
249{ 718{
250 struct mlx4_priv *priv = mlx4_priv(dev); 719 struct mlx4_priv *priv = mlx4_priv(dev);
251 struct mlx4_cmd_mailbox *mailbox; 720 struct mlx4_cmd_mailbox *mailbox;
@@ -255,6 +724,8 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
255 int prev, index; 724 int prev, index;
256 int i, loc; 725 int i, loc;
257 int err; 726 int err;
727 u8 port = gid[5];
728 bool removed_entry = false;
258 729
259 mailbox = mlx4_alloc_cmd_mailbox(dev); 730 mailbox = mlx4_alloc_cmd_mailbox(dev);
260 if (IS_ERR(mailbox)) 731 if (IS_ERR(mailbox))
@@ -263,7 +734,8 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
263 734
264 mutex_lock(&priv->mcg_table.mutex); 735 mutex_lock(&priv->mcg_table.mutex);
265 736
266 err = find_mgm(dev, gid, protocol, mailbox, &hash, &prev, &index); 737 err = find_entry(dev, port, gid, prot, steer,
738 mailbox, &hash, &prev, &index);
267 if (err) 739 if (err)
268 goto out; 740 goto out;
269 741
@@ -273,6 +745,11 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
273 goto out; 745 goto out;
274 } 746 }
275 747
748 /* if this pq is also a promisc qp, it shouldn't be removed */
749 if (prot == MLX4_PROT_ETH &&
750 check_duplicate_entry(dev, 0, port, steer, index, qp->qpn))
751 goto out;
752
276 members_count = be32_to_cpu(mgm->members_count) & 0xffffff; 753 members_count = be32_to_cpu(mgm->members_count) & 0xffffff;
277 for (loc = -1, i = 0; i < members_count; ++i) 754 for (loc = -1, i = 0; i < members_count; ++i)
278 if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qp->qpn) 755 if ((be32_to_cpu(mgm->qp[i]) & MGM_QPN_MASK) == qp->qpn)
@@ -285,26 +762,31 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
285 } 762 }
286 763
287 764
288 mgm->members_count = cpu_to_be32(--members_count | (u32) protocol << 30); 765 mgm->members_count = cpu_to_be32(--members_count | (u32) prot << 30);
289 mgm->qp[loc] = mgm->qp[i - 1]; 766 mgm->qp[loc] = mgm->qp[i - 1];
290 mgm->qp[i - 1] = 0; 767 mgm->qp[i - 1] = 0;
291 768
292 if (i != 1) { 769 if (prot == MLX4_PROT_ETH)
293 err = mlx4_WRITE_MCG(dev, index, mailbox); 770 removed_entry = can_remove_steering_entry(dev, 0, port, steer, index, qp->qpn);
771 if (i != 1 && (prot != MLX4_PROT_ETH || !removed_entry)) {
772 err = mlx4_WRITE_ENTRY(dev, index, mailbox);
294 goto out; 773 goto out;
295 } 774 }
296 775
776 /* We are going to delete the entry, members count should be 0 */
777 mgm->members_count = cpu_to_be32((u32) prot << 30);
778
297 if (prev == -1) { 779 if (prev == -1) {
298 /* Remove entry from MGM */ 780 /* Remove entry from MGM */
299 int amgm_index = be32_to_cpu(mgm->next_gid_index) >> 6; 781 int amgm_index = be32_to_cpu(mgm->next_gid_index) >> 6;
300 if (amgm_index) { 782 if (amgm_index) {
301 err = mlx4_READ_MCG(dev, amgm_index, mailbox); 783 err = mlx4_READ_ENTRY(dev, amgm_index, mailbox);
302 if (err) 784 if (err)
303 goto out; 785 goto out;
304 } else 786 } else
305 memset(mgm->gid, 0, 16); 787 memset(mgm->gid, 0, 16);
306 788
307 err = mlx4_WRITE_MCG(dev, index, mailbox); 789 err = mlx4_WRITE_ENTRY(dev, index, mailbox);
308 if (err) 790 if (err)
309 goto out; 791 goto out;
310 792
@@ -319,13 +801,13 @@ int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
319 } else { 801 } else {
320 /* Remove entry from AMGM */ 802 /* Remove entry from AMGM */
321 int cur_next_index = be32_to_cpu(mgm->next_gid_index) >> 6; 803 int cur_next_index = be32_to_cpu(mgm->next_gid_index) >> 6;
322 err = mlx4_READ_MCG(dev, prev, mailbox); 804 err = mlx4_READ_ENTRY(dev, prev, mailbox);
323 if (err) 805 if (err)
324 goto out; 806 goto out;
325 807
326 mgm->next_gid_index = cpu_to_be32(cur_next_index << 6); 808 mgm->next_gid_index = cpu_to_be32(cur_next_index << 6);
327 809
328 err = mlx4_WRITE_MCG(dev, prev, mailbox); 810 err = mlx4_WRITE_ENTRY(dev, prev, mailbox);
329 if (err) 811 if (err)
330 goto out; 812 goto out;
331 813
@@ -343,8 +825,85 @@ out:
343 mlx4_free_cmd_mailbox(dev, mailbox); 825 mlx4_free_cmd_mailbox(dev, mailbox);
344 return err; 826 return err;
345} 827}
828
829
830int mlx4_multicast_attach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
831 int block_mcast_loopback, enum mlx4_protocol prot)
832{
833 enum mlx4_steer_type steer;
834
835 steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER;
836
837 if (prot == MLX4_PROT_ETH && !dev->caps.vep_mc_steering)
838 return 0;
839
840 if (prot == MLX4_PROT_ETH)
841 gid[7] |= (steer << 1);
842
843 return mlx4_qp_attach_common(dev, qp, gid,
844 block_mcast_loopback, prot,
845 steer);
846}
847EXPORT_SYMBOL_GPL(mlx4_multicast_attach);
848
849int mlx4_multicast_detach(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
850 enum mlx4_protocol prot)
851{
852 enum mlx4_steer_type steer;
853
854 steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER;
855
856 if (prot == MLX4_PROT_ETH && !dev->caps.vep_mc_steering)
857 return 0;
858
859 if (prot == MLX4_PROT_ETH) {
860 gid[7] |= (steer << 1);
861 }
862
863 return mlx4_qp_detach_common(dev, qp, gid, prot, steer);
864}
346EXPORT_SYMBOL_GPL(mlx4_multicast_detach); 865EXPORT_SYMBOL_GPL(mlx4_multicast_detach);
347 866
867
868int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port)
869{
870 if (!dev->caps.vep_mc_steering)
871 return 0;
872
873
874 return add_promisc_qp(dev, 0, port, MLX4_MC_STEER, qpn);
875}
876EXPORT_SYMBOL_GPL(mlx4_multicast_promisc_add);
877
878int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port)
879{
880 if (!dev->caps.vep_mc_steering)
881 return 0;
882
883
884 return remove_promisc_qp(dev, 0, port, MLX4_MC_STEER, qpn);
885}
886EXPORT_SYMBOL_GPL(mlx4_multicast_promisc_remove);
887
888int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port)
889{
890 if (!dev->caps.vep_mc_steering)
891 return 0;
892
893
894 return add_promisc_qp(dev, 0, port, MLX4_UC_STEER, qpn);
895}
896EXPORT_SYMBOL_GPL(mlx4_unicast_promisc_add);
897
898int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port)
899{
900 if (!dev->caps.vep_mc_steering)
901 return 0;
902
903 return remove_promisc_qp(dev, 0, port, MLX4_UC_STEER, qpn);
904}
905EXPORT_SYMBOL_GPL(mlx4_unicast_promisc_remove);
906
348int mlx4_init_mcg_table(struct mlx4_dev *dev) 907int mlx4_init_mcg_table(struct mlx4_dev *dev)
349{ 908{
350 struct mlx4_priv *priv = mlx4_priv(dev); 909 struct mlx4_priv *priv = mlx4_priv(dev);
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index 0da5bb7285b4..dd7d745fbab4 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -105,6 +105,7 @@ struct mlx4_bitmap {
105 u32 max; 105 u32 max;
106 u32 reserved_top; 106 u32 reserved_top;
107 u32 mask; 107 u32 mask;
108 u32 avail;
108 spinlock_t lock; 109 spinlock_t lock;
109 unsigned long *table; 110 unsigned long *table;
110}; 111};
@@ -162,6 +163,27 @@ struct mlx4_fw {
162 u8 catas_bar; 163 u8 catas_bar;
163}; 164};
164 165
166#define MGM_QPN_MASK 0x00FFFFFF
167#define MGM_BLCK_LB_BIT 30
168
169struct mlx4_promisc_qp {
170 struct list_head list;
171 u32 qpn;
172};
173
174struct mlx4_steer_index {
175 struct list_head list;
176 unsigned int index;
177 struct list_head duplicates;
178};
179
180struct mlx4_mgm {
181 __be32 next_gid_index;
182 __be32 members_count;
183 u32 reserved[2];
184 u8 gid[16];
185 __be32 qp[MLX4_QP_PER_MGM];
186};
165struct mlx4_cmd { 187struct mlx4_cmd {
166 struct pci_pool *pool; 188 struct pci_pool *pool;
167 void __iomem *hcr; 189 void __iomem *hcr;
@@ -265,6 +287,10 @@ struct mlx4_vlan_table {
265 int max; 287 int max;
266}; 288};
267 289
290struct mlx4_mac_entry {
291 u64 mac;
292};
293
268struct mlx4_port_info { 294struct mlx4_port_info {
269 struct mlx4_dev *dev; 295 struct mlx4_dev *dev;
270 int port; 296 int port;
@@ -272,7 +298,9 @@ struct mlx4_port_info {
272 struct device_attribute port_attr; 298 struct device_attribute port_attr;
273 enum mlx4_port_type tmp_type; 299 enum mlx4_port_type tmp_type;
274 struct mlx4_mac_table mac_table; 300 struct mlx4_mac_table mac_table;
301 struct radix_tree_root mac_tree;
275 struct mlx4_vlan_table vlan_table; 302 struct mlx4_vlan_table vlan_table;
303 int base_qpn;
276}; 304};
277 305
278struct mlx4_sense { 306struct mlx4_sense {
@@ -282,6 +310,17 @@ struct mlx4_sense {
282 struct delayed_work sense_poll; 310 struct delayed_work sense_poll;
283}; 311};
284 312
313struct mlx4_msix_ctl {
314 u64 pool_bm;
315 spinlock_t pool_lock;
316};
317
318struct mlx4_steer {
319 struct list_head promisc_qps[MLX4_NUM_STEERS];
320 struct list_head steer_entries[MLX4_NUM_STEERS];
321 struct list_head high_prios;
322};
323
285struct mlx4_priv { 324struct mlx4_priv {
286 struct mlx4_dev dev; 325 struct mlx4_dev dev;
287 326
@@ -313,6 +352,11 @@ struct mlx4_priv {
313 struct mlx4_port_info port[MLX4_MAX_PORTS + 1]; 352 struct mlx4_port_info port[MLX4_MAX_PORTS + 1];
314 struct mlx4_sense sense; 353 struct mlx4_sense sense;
315 struct mutex port_mutex; 354 struct mutex port_mutex;
355 struct mlx4_msix_ctl msix_ctl;
356 struct mlx4_steer *steer;
357 struct list_head bf_list;
358 struct mutex bf_mutex;
359 struct io_mapping *bf_mapping;
316}; 360};
317 361
318static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev) 362static inline struct mlx4_priv *mlx4_priv(struct mlx4_dev *dev)
@@ -328,6 +372,7 @@ u32 mlx4_bitmap_alloc(struct mlx4_bitmap *bitmap);
328void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj); 372void mlx4_bitmap_free(struct mlx4_bitmap *bitmap, u32 obj);
329u32 mlx4_bitmap_alloc_range(struct mlx4_bitmap *bitmap, int cnt, int align); 373u32 mlx4_bitmap_alloc_range(struct mlx4_bitmap *bitmap, int cnt, int align);
330void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt); 374void mlx4_bitmap_free_range(struct mlx4_bitmap *bitmap, u32 obj, int cnt);
375u32 mlx4_bitmap_avail(struct mlx4_bitmap *bitmap);
331int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask, 376int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask,
332 u32 reserved_bot, u32 resetrved_top); 377 u32 reserved_bot, u32 resetrved_top);
333void mlx4_bitmap_cleanup(struct mlx4_bitmap *bitmap); 378void mlx4_bitmap_cleanup(struct mlx4_bitmap *bitmap);
@@ -386,6 +431,8 @@ void mlx4_srq_event(struct mlx4_dev *dev, u32 srqn, int event_type);
386 431
387void mlx4_handle_catas_err(struct mlx4_dev *dev); 432void mlx4_handle_catas_err(struct mlx4_dev *dev);
388 433
434int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port,
435 enum mlx4_port_type *type);
389void mlx4_do_sense_ports(struct mlx4_dev *dev, 436void mlx4_do_sense_ports(struct mlx4_dev *dev,
390 enum mlx4_port_type *stype, 437 enum mlx4_port_type *stype,
391 enum mlx4_port_type *defaults); 438 enum mlx4_port_type *defaults);
@@ -403,4 +450,9 @@ void mlx4_init_vlan_table(struct mlx4_dev *dev, struct mlx4_vlan_table *table);
403int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port); 450int mlx4_SET_PORT(struct mlx4_dev *dev, u8 port);
404int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps); 451int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps);
405 452
453int mlx4_qp_detach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
454 enum mlx4_protocol prot, enum mlx4_steer_type steer);
455int mlx4_qp_attach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16],
456 int block_mcast_loopback, enum mlx4_protocol prot,
457 enum mlx4_steer_type steer);
406#endif /* MLX4_H */ 458#endif /* MLX4_H */
diff --git a/drivers/net/mlx4/mlx4_en.h b/drivers/net/mlx4/mlx4_en.h
index dfed6a07c2d7..e30f6099c0de 100644
--- a/drivers/net/mlx4/mlx4_en.h
+++ b/drivers/net/mlx4/mlx4_en.h
@@ -49,8 +49,8 @@
49#include "en_port.h" 49#include "en_port.h"
50 50
51#define DRV_NAME "mlx4_en" 51#define DRV_NAME "mlx4_en"
52#define DRV_VERSION "1.5.1.6" 52#define DRV_VERSION "1.5.4.1"
53#define DRV_RELDATE "August 2010" 53#define DRV_RELDATE "March 2011"
54 54
55#define MLX4_EN_MSG_LEVEL (NETIF_MSG_LINK | NETIF_MSG_IFDOWN) 55#define MLX4_EN_MSG_LEVEL (NETIF_MSG_LINK | NETIF_MSG_IFDOWN)
56 56
@@ -62,6 +62,7 @@
62#define MLX4_EN_PAGE_SHIFT 12 62#define MLX4_EN_PAGE_SHIFT 12
63#define MLX4_EN_PAGE_SIZE (1 << MLX4_EN_PAGE_SHIFT) 63#define MLX4_EN_PAGE_SIZE (1 << MLX4_EN_PAGE_SHIFT)
64#define MAX_RX_RINGS 16 64#define MAX_RX_RINGS 16
65#define MIN_RX_RINGS 4
65#define TXBB_SIZE 64 66#define TXBB_SIZE 64
66#define HEADROOM (2048 / TXBB_SIZE + 1) 67#define HEADROOM (2048 / TXBB_SIZE + 1)
67#define STAMP_STRIDE 64 68#define STAMP_STRIDE 64
@@ -124,6 +125,7 @@ enum {
124#define MLX4_EN_RX_SIZE_THRESH 1024 125#define MLX4_EN_RX_SIZE_THRESH 1024
125#define MLX4_EN_RX_RATE_THRESH (1000000 / MLX4_EN_RX_COAL_TIME_HIGH) 126#define MLX4_EN_RX_RATE_THRESH (1000000 / MLX4_EN_RX_COAL_TIME_HIGH)
126#define MLX4_EN_SAMPLE_INTERVAL 0 127#define MLX4_EN_SAMPLE_INTERVAL 0
128#define MLX4_EN_AVG_PKT_SMALL 256
127 129
128#define MLX4_EN_AUTO_CONF 0xffff 130#define MLX4_EN_AUTO_CONF 0xffff
129 131
@@ -214,6 +216,9 @@ struct mlx4_en_tx_desc {
214 216
215#define MLX4_EN_USE_SRQ 0x01000000 217#define MLX4_EN_USE_SRQ 0x01000000
216 218
219#define MLX4_EN_CX3_LOW_ID 0x1000
220#define MLX4_EN_CX3_HIGH_ID 0x1005
221
217struct mlx4_en_rx_alloc { 222struct mlx4_en_rx_alloc {
218 struct page *page; 223 struct page *page;
219 u16 offset; 224 u16 offset;
@@ -243,6 +248,8 @@ struct mlx4_en_tx_ring {
243 unsigned long bytes; 248 unsigned long bytes;
244 unsigned long packets; 249 unsigned long packets;
245 spinlock_t comp_lock; 250 spinlock_t comp_lock;
251 struct mlx4_bf bf;
252 bool bf_enabled;
246}; 253};
247 254
248struct mlx4_en_rx_desc { 255struct mlx4_en_rx_desc {
@@ -453,6 +460,7 @@ struct mlx4_en_priv {
453 struct mlx4_en_rss_map rss_map; 460 struct mlx4_en_rss_map rss_map;
454 u32 flags; 461 u32 flags;
455#define MLX4_EN_FLAG_PROMISC 0x1 462#define MLX4_EN_FLAG_PROMISC 0x1
463#define MLX4_EN_FLAG_MC_PROMISC 0x2
456 u32 tx_ring_num; 464 u32 tx_ring_num;
457 u32 rx_ring_num; 465 u32 rx_ring_num;
458 u32 rx_skb_size; 466 u32 rx_skb_size;
@@ -461,6 +469,7 @@ struct mlx4_en_priv {
461 u16 log_rx_info; 469 u16 log_rx_info;
462 470
463 struct mlx4_en_tx_ring tx_ring[MAX_TX_RINGS]; 471 struct mlx4_en_tx_ring tx_ring[MAX_TX_RINGS];
472 int tx_vector;
464 struct mlx4_en_rx_ring rx_ring[MAX_RX_RINGS]; 473 struct mlx4_en_rx_ring rx_ring[MAX_RX_RINGS];
465 struct mlx4_en_cq tx_cq[MAX_TX_RINGS]; 474 struct mlx4_en_cq tx_cq[MAX_TX_RINGS];
466 struct mlx4_en_cq rx_cq[MAX_RX_RINGS]; 475 struct mlx4_en_cq rx_cq[MAX_RX_RINGS];
@@ -476,6 +485,13 @@ struct mlx4_en_priv {
476 int mc_addrs_cnt; 485 int mc_addrs_cnt;
477 struct mlx4_en_stat_out_mbox hw_stats; 486 struct mlx4_en_stat_out_mbox hw_stats;
478 int vids[128]; 487 int vids[128];
488 bool wol;
489};
490
491enum mlx4_en_wol {
492 MLX4_EN_WOL_MAGIC = (1ULL << 61),
493 MLX4_EN_WOL_ENABLED = (1ULL << 62),
494 MLX4_EN_WOL_DO_MODIFY = (1ULL << 63),
479}; 495};
480 496
481 497
@@ -486,12 +502,13 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
486int mlx4_en_start_port(struct net_device *dev); 502int mlx4_en_start_port(struct net_device *dev);
487void mlx4_en_stop_port(struct net_device *dev); 503void mlx4_en_stop_port(struct net_device *dev);
488 504
489void mlx4_en_free_resources(struct mlx4_en_priv *priv); 505void mlx4_en_free_resources(struct mlx4_en_priv *priv, bool reserve_vectors);
490int mlx4_en_alloc_resources(struct mlx4_en_priv *priv); 506int mlx4_en_alloc_resources(struct mlx4_en_priv *priv);
491 507
492int mlx4_en_create_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq, 508int mlx4_en_create_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
493 int entries, int ring, enum cq_type mode); 509 int entries, int ring, enum cq_type mode);
494void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq); 510void mlx4_en_destroy_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq,
511 bool reserve_vectors);
495int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq); 512int mlx4_en_activate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
496void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq); 513void mlx4_en_deactivate_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
497int mlx4_en_set_cq_moder(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq); 514int mlx4_en_set_cq_moder(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
@@ -503,7 +520,7 @@ u16 mlx4_en_select_queue(struct net_device *dev, struct sk_buff *skb);
503netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev); 520netdev_tx_t mlx4_en_xmit(struct sk_buff *skb, struct net_device *dev);
504 521
505int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring *ring, 522int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring *ring,
506 u32 size, u16 stride); 523 int qpn, u32 size, u16 stride);
507void mlx4_en_destroy_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring *ring); 524void mlx4_en_destroy_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring *ring);
508int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv, 525int mlx4_en_activate_tx_ring(struct mlx4_en_priv *priv,
509 struct mlx4_en_tx_ring *ring, 526 struct mlx4_en_tx_ring *ring,
diff --git a/drivers/net/mlx4/pd.c b/drivers/net/mlx4/pd.c
index c4988d6bd5b2..1286b886dcea 100644
--- a/drivers/net/mlx4/pd.c
+++ b/drivers/net/mlx4/pd.c
@@ -32,12 +32,17 @@
32 */ 32 */
33 33
34#include <linux/errno.h> 34#include <linux/errno.h>
35#include <linux/io-mapping.h>
35 36
36#include <asm/page.h> 37#include <asm/page.h>
37 38
38#include "mlx4.h" 39#include "mlx4.h"
39#include "icm.h" 40#include "icm.h"
40 41
42enum {
43 MLX4_NUM_RESERVED_UARS = 8
44};
45
41int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn) 46int mlx4_pd_alloc(struct mlx4_dev *dev, u32 *pdn)
42{ 47{
43 struct mlx4_priv *priv = mlx4_priv(dev); 48 struct mlx4_priv *priv = mlx4_priv(dev);
@@ -77,6 +82,7 @@ int mlx4_uar_alloc(struct mlx4_dev *dev, struct mlx4_uar *uar)
77 return -ENOMEM; 82 return -ENOMEM;
78 83
79 uar->pfn = (pci_resource_start(dev->pdev, 2) >> PAGE_SHIFT) + uar->index; 84 uar->pfn = (pci_resource_start(dev->pdev, 2) >> PAGE_SHIFT) + uar->index;
85 uar->map = NULL;
80 86
81 return 0; 87 return 0;
82} 88}
@@ -88,6 +94,102 @@ void mlx4_uar_free(struct mlx4_dev *dev, struct mlx4_uar *uar)
88} 94}
89EXPORT_SYMBOL_GPL(mlx4_uar_free); 95EXPORT_SYMBOL_GPL(mlx4_uar_free);
90 96
97int mlx4_bf_alloc(struct mlx4_dev *dev, struct mlx4_bf *bf)
98{
99 struct mlx4_priv *priv = mlx4_priv(dev);
100 struct mlx4_uar *uar;
101 int err = 0;
102 int idx;
103
104 if (!priv->bf_mapping)
105 return -ENOMEM;
106
107 mutex_lock(&priv->bf_mutex);
108 if (!list_empty(&priv->bf_list))
109 uar = list_entry(priv->bf_list.next, struct mlx4_uar, bf_list);
110 else {
111 if (mlx4_bitmap_avail(&priv->uar_table.bitmap) < MLX4_NUM_RESERVED_UARS) {
112 err = -ENOMEM;
113 goto out;
114 }
115 uar = kmalloc(sizeof *uar, GFP_KERNEL);
116 if (!uar) {
117 err = -ENOMEM;
118 goto out;
119 }
120 err = mlx4_uar_alloc(dev, uar);
121 if (err)
122 goto free_kmalloc;
123
124 uar->map = ioremap(uar->pfn << PAGE_SHIFT, PAGE_SIZE);
125 if (!uar->map) {
126 err = -ENOMEM;
127 goto free_uar;
128 }
129
130 uar->bf_map = io_mapping_map_wc(priv->bf_mapping, uar->index << PAGE_SHIFT);
131 if (!uar->bf_map) {
132 err = -ENOMEM;
133 goto unamp_uar;
134 }
135 uar->free_bf_bmap = 0;
136 list_add(&uar->bf_list, &priv->bf_list);
137 }
138
139 bf->uar = uar;
140 idx = ffz(uar->free_bf_bmap);
141 uar->free_bf_bmap |= 1 << idx;
142 bf->uar = uar;
143 bf->offset = 0;
144 bf->buf_size = dev->caps.bf_reg_size / 2;
145 bf->reg = uar->bf_map + idx * dev->caps.bf_reg_size;
146 if (uar->free_bf_bmap == (1 << dev->caps.bf_regs_per_page) - 1)
147 list_del_init(&uar->bf_list);
148
149 goto out;
150
151unamp_uar:
152 bf->uar = NULL;
153 iounmap(uar->map);
154
155free_uar:
156 mlx4_uar_free(dev, uar);
157
158free_kmalloc:
159 kfree(uar);
160
161out:
162 mutex_unlock(&priv->bf_mutex);
163 return err;
164}
165EXPORT_SYMBOL_GPL(mlx4_bf_alloc);
166
167void mlx4_bf_free(struct mlx4_dev *dev, struct mlx4_bf *bf)
168{
169 struct mlx4_priv *priv = mlx4_priv(dev);
170 int idx;
171
172 if (!bf->uar || !bf->uar->bf_map)
173 return;
174
175 mutex_lock(&priv->bf_mutex);
176 idx = (bf->reg - bf->uar->bf_map) / dev->caps.bf_reg_size;
177 bf->uar->free_bf_bmap &= ~(1 << idx);
178 if (!bf->uar->free_bf_bmap) {
179 if (!list_empty(&bf->uar->bf_list))
180 list_del(&bf->uar->bf_list);
181
182 io_mapping_unmap(bf->uar->bf_map);
183 iounmap(bf->uar->map);
184 mlx4_uar_free(dev, bf->uar);
185 kfree(bf->uar);
186 } else if (list_empty(&bf->uar->bf_list))
187 list_add(&bf->uar->bf_list, &priv->bf_list);
188
189 mutex_unlock(&priv->bf_mutex);
190}
191EXPORT_SYMBOL_GPL(mlx4_bf_free);
192
91int mlx4_init_uar_table(struct mlx4_dev *dev) 193int mlx4_init_uar_table(struct mlx4_dev *dev)
92{ 194{
93 if (dev->caps.num_uars <= 128) { 195 if (dev->caps.num_uars <= 128) {
diff --git a/drivers/net/mlx4/port.c b/drivers/net/mlx4/port.c
index 451339559bdc..8856659fb43c 100644
--- a/drivers/net/mlx4/port.c
+++ b/drivers/net/mlx4/port.c
@@ -90,12 +90,79 @@ static int mlx4_set_port_mac_table(struct mlx4_dev *dev, u8 port,
90 return err; 90 return err;
91} 91}
92 92
93int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index) 93static int mlx4_uc_steer_add(struct mlx4_dev *dev, u8 port,
94 u64 mac, int *qpn, u8 reserve)
94{ 95{
95 struct mlx4_mac_table *table = &mlx4_priv(dev)->port[port].mac_table; 96 struct mlx4_qp qp;
97 u8 gid[16] = {0};
98 int err;
99
100 if (reserve) {
101 err = mlx4_qp_reserve_range(dev, 1, 1, qpn);
102 if (err) {
103 mlx4_err(dev, "Failed to reserve qp for mac registration\n");
104 return err;
105 }
106 }
107 qp.qpn = *qpn;
108
109 mac &= 0xffffffffffffULL;
110 mac = cpu_to_be64(mac << 16);
111 memcpy(&gid[10], &mac, ETH_ALEN);
112 gid[5] = port;
113 gid[7] = MLX4_UC_STEER << 1;
114
115 err = mlx4_qp_attach_common(dev, &qp, gid, 0,
116 MLX4_PROT_ETH, MLX4_UC_STEER);
117 if (err && reserve)
118 mlx4_qp_release_range(dev, *qpn, 1);
119
120 return err;
121}
122
123static void mlx4_uc_steer_release(struct mlx4_dev *dev, u8 port,
124 u64 mac, int qpn, u8 free)
125{
126 struct mlx4_qp qp;
127 u8 gid[16] = {0};
128
129 qp.qpn = qpn;
130 mac &= 0xffffffffffffULL;
131 mac = cpu_to_be64(mac << 16);
132 memcpy(&gid[10], &mac, ETH_ALEN);
133 gid[5] = port;
134 gid[7] = MLX4_UC_STEER << 1;
135
136 mlx4_qp_detach_common(dev, &qp, gid, MLX4_PROT_ETH, MLX4_UC_STEER);
137 if (free)
138 mlx4_qp_release_range(dev, qpn, 1);
139}
140
141int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *qpn, u8 wrap)
142{
143 struct mlx4_port_info *info = &mlx4_priv(dev)->port[port];
144 struct mlx4_mac_table *table = &info->mac_table;
145 struct mlx4_mac_entry *entry;
96 int i, err = 0; 146 int i, err = 0;
97 int free = -1; 147 int free = -1;
98 148
149 if (dev->caps.vep_uc_steering) {
150 err = mlx4_uc_steer_add(dev, port, mac, qpn, 1);
151 if (!err) {
152 entry = kmalloc(sizeof *entry, GFP_KERNEL);
153 if (!entry) {
154 mlx4_uc_steer_release(dev, port, mac, *qpn, 1);
155 return -ENOMEM;
156 }
157 entry->mac = mac;
158 err = radix_tree_insert(&info->mac_tree, *qpn, entry);
159 if (err) {
160 mlx4_uc_steer_release(dev, port, mac, *qpn, 1);
161 return err;
162 }
163 } else
164 return err;
165 }
99 mlx4_dbg(dev, "Registering MAC: 0x%llx\n", (unsigned long long) mac); 166 mlx4_dbg(dev, "Registering MAC: 0x%llx\n", (unsigned long long) mac);
100 mutex_lock(&table->mutex); 167 mutex_lock(&table->mutex);
101 for (i = 0; i < MLX4_MAX_MAC_NUM - 1; i++) { 168 for (i = 0; i < MLX4_MAX_MAC_NUM - 1; i++) {
@@ -105,8 +172,7 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index)
105 } 172 }
106 173
107 if (mac == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) { 174 if (mac == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i]))) {
108 /* MAC already registered, increase refernce count */ 175 /* MAC already registered, increase references count */
109 *index = i;
110 ++table->refs[i]; 176 ++table->refs[i];
111 goto out; 177 goto out;
112 } 178 }
@@ -137,7 +203,8 @@ int mlx4_register_mac(struct mlx4_dev *dev, u8 port, u64 mac, int *index)
137 goto out; 203 goto out;
138 } 204 }
139 205
140 *index = free; 206 if (!dev->caps.vep_uc_steering)
207 *qpn = info->base_qpn + free;
141 ++table->total; 208 ++table->total;
142out: 209out:
143 mutex_unlock(&table->mutex); 210 mutex_unlock(&table->mutex);
@@ -145,20 +212,52 @@ out:
145} 212}
146EXPORT_SYMBOL_GPL(mlx4_register_mac); 213EXPORT_SYMBOL_GPL(mlx4_register_mac);
147 214
148void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int index) 215static int validate_index(struct mlx4_dev *dev,
216 struct mlx4_mac_table *table, int index)
149{ 217{
150 struct mlx4_mac_table *table = &mlx4_priv(dev)->port[port].mac_table; 218 int err = 0;
151 219
152 mutex_lock(&table->mutex); 220 if (index < 0 || index >= table->max || !table->entries[index]) {
153 if (!table->refs[index]) { 221 mlx4_warn(dev, "No valid Mac entry for the given index\n");
154 mlx4_warn(dev, "No MAC entry for index %d\n", index); 222 err = -EINVAL;
155 goto out;
156 } 223 }
157 if (--table->refs[index]) { 224 return err;
158 mlx4_warn(dev, "Have more references for index %d," 225}
159 "no need to modify MAC table\n", index); 226
160 goto out; 227static int find_index(struct mlx4_dev *dev,
228 struct mlx4_mac_table *table, u64 mac)
229{
230 int i;
231 for (i = 0; i < MLX4_MAX_MAC_NUM; i++) {
232 if (mac == (MLX4_MAC_MASK & be64_to_cpu(table->entries[i])))
233 return i;
161 } 234 }
235 /* Mac not found */
236 return -EINVAL;
237}
238
239void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, int qpn)
240{
241 struct mlx4_port_info *info = &mlx4_priv(dev)->port[port];
242 struct mlx4_mac_table *table = &info->mac_table;
243 int index = qpn - info->base_qpn;
244 struct mlx4_mac_entry *entry;
245
246 if (dev->caps.vep_uc_steering) {
247 entry = radix_tree_lookup(&info->mac_tree, qpn);
248 if (entry) {
249 mlx4_uc_steer_release(dev, port, entry->mac, qpn, 1);
250 radix_tree_delete(&info->mac_tree, qpn);
251 index = find_index(dev, table, entry->mac);
252 kfree(entry);
253 }
254 }
255
256 mutex_lock(&table->mutex);
257
258 if (validate_index(dev, table, index))
259 goto out;
260
162 table->entries[index] = 0; 261 table->entries[index] = 0;
163 mlx4_set_port_mac_table(dev, port, table->entries); 262 mlx4_set_port_mac_table(dev, port, table->entries);
164 --table->total; 263 --table->total;
@@ -167,6 +266,44 @@ out:
167} 266}
168EXPORT_SYMBOL_GPL(mlx4_unregister_mac); 267EXPORT_SYMBOL_GPL(mlx4_unregister_mac);
169 268
269int mlx4_replace_mac(struct mlx4_dev *dev, u8 port, int qpn, u64 new_mac, u8 wrap)
270{
271 struct mlx4_port_info *info = &mlx4_priv(dev)->port[port];
272 struct mlx4_mac_table *table = &info->mac_table;
273 int index = qpn - info->base_qpn;
274 struct mlx4_mac_entry *entry;
275 int err;
276
277 if (dev->caps.vep_uc_steering) {
278 entry = radix_tree_lookup(&info->mac_tree, qpn);
279 if (!entry)
280 return -EINVAL;
281 index = find_index(dev, table, entry->mac);
282 mlx4_uc_steer_release(dev, port, entry->mac, qpn, 0);
283 entry->mac = new_mac;
284 err = mlx4_uc_steer_add(dev, port, entry->mac, &qpn, 0);
285 if (err || index < 0)
286 return err;
287 }
288
289 mutex_lock(&table->mutex);
290
291 err = validate_index(dev, table, index);
292 if (err)
293 goto out;
294
295 table->entries[index] = cpu_to_be64(new_mac | MLX4_MAC_VALID);
296
297 err = mlx4_set_port_mac_table(dev, port, table->entries);
298 if (unlikely(err)) {
299 mlx4_err(dev, "Failed adding MAC: 0x%llx\n", (unsigned long long) new_mac);
300 table->entries[index] = 0;
301 }
302out:
303 mutex_unlock(&table->mutex);
304 return err;
305}
306EXPORT_SYMBOL_GPL(mlx4_replace_mac);
170static int mlx4_set_port_vlan_table(struct mlx4_dev *dev, u8 port, 307static int mlx4_set_port_vlan_table(struct mlx4_dev *dev, u8 port,
171 __be32 *entries) 308 __be32 *entries)
172{ 309{
@@ -223,7 +360,7 @@ int mlx4_register_vlan(struct mlx4_dev *dev, u8 port, u16 vlan, int *index)
223 if (table->refs[i] && 360 if (table->refs[i] &&
224 (vlan == (MLX4_VLAN_MASK & 361 (vlan == (MLX4_VLAN_MASK &
225 be32_to_cpu(table->entries[i])))) { 362 be32_to_cpu(table->entries[i])))) {
226 /* Vlan already registered, increase refernce count */ 363 /* Vlan already registered, increase references count */
227 *index = i; 364 *index = i;
228 ++table->refs[i]; 365 ++table->refs[i];
229 goto out; 366 goto out;
diff --git a/drivers/net/mlx4/profile.c b/drivers/net/mlx4/profile.c
index e749f82865fe..b967647d0c76 100644
--- a/drivers/net/mlx4/profile.c
+++ b/drivers/net/mlx4/profile.c
@@ -107,9 +107,7 @@ u64 mlx4_make_profile(struct mlx4_dev *dev,
107 profile[MLX4_RES_AUXC].num = request->num_qp; 107 profile[MLX4_RES_AUXC].num = request->num_qp;
108 profile[MLX4_RES_SRQ].num = request->num_srq; 108 profile[MLX4_RES_SRQ].num = request->num_srq;
109 profile[MLX4_RES_CQ].num = request->num_cq; 109 profile[MLX4_RES_CQ].num = request->num_cq;
110 profile[MLX4_RES_EQ].num = min_t(unsigned, dev_cap->max_eqs, 110 profile[MLX4_RES_EQ].num = min_t(unsigned, dev_cap->max_eqs, MAX_MSIX);
111 dev_cap->reserved_eqs +
112 num_possible_cpus() + 1);
113 profile[MLX4_RES_DMPT].num = request->num_mpt; 111 profile[MLX4_RES_DMPT].num = request->num_mpt;
114 profile[MLX4_RES_CMPT].num = MLX4_NUM_CMPTS; 112 profile[MLX4_RES_CMPT].num = MLX4_NUM_CMPTS;
115 profile[MLX4_RES_MTT].num = request->num_mtt; 113 profile[MLX4_RES_MTT].num = request->num_mtt;
diff --git a/drivers/net/mlx4/sense.c b/drivers/net/mlx4/sense.c
index 015fbe785c13..e2337a7411d9 100644
--- a/drivers/net/mlx4/sense.c
+++ b/drivers/net/mlx4/sense.c
@@ -38,8 +38,8 @@
38 38
39#include "mlx4.h" 39#include "mlx4.h"
40 40
41static int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port, 41int mlx4_SENSE_PORT(struct mlx4_dev *dev, int port,
42 enum mlx4_port_type *type) 42 enum mlx4_port_type *type)
43{ 43{
44 u64 out_param; 44 u64 out_param;
45 int err = 0; 45 int err = 0;
diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index a7f2eed9a08a..1446de59ae53 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -1312,17 +1312,26 @@ myri10ge_unmap_rx_page(struct pci_dev *pdev,
1312 * page into an skb */ 1312 * page into an skb */
1313 1313
1314static inline int 1314static inline int
1315myri10ge_rx_done(struct myri10ge_slice_state *ss, struct myri10ge_rx_buf *rx, 1315myri10ge_rx_done(struct myri10ge_slice_state *ss, int len, __wsum csum,
1316 int bytes, int len, __wsum csum) 1316 int lro_enabled)
1317{ 1317{
1318 struct myri10ge_priv *mgp = ss->mgp; 1318 struct myri10ge_priv *mgp = ss->mgp;
1319 struct sk_buff *skb; 1319 struct sk_buff *skb;
1320 struct skb_frag_struct rx_frags[MYRI10GE_MAX_FRAGS_PER_FRAME]; 1320 struct skb_frag_struct rx_frags[MYRI10GE_MAX_FRAGS_PER_FRAME];
1321 int i, idx, hlen, remainder; 1321 struct myri10ge_rx_buf *rx;
1322 int i, idx, hlen, remainder, bytes;
1322 struct pci_dev *pdev = mgp->pdev; 1323 struct pci_dev *pdev = mgp->pdev;
1323 struct net_device *dev = mgp->dev; 1324 struct net_device *dev = mgp->dev;
1324 u8 *va; 1325 u8 *va;
1325 1326
1327 if (len <= mgp->small_bytes) {
1328 rx = &ss->rx_small;
1329 bytes = mgp->small_bytes;
1330 } else {
1331 rx = &ss->rx_big;
1332 bytes = mgp->big_bytes;
1333 }
1334
1326 len += MXGEFW_PAD; 1335 len += MXGEFW_PAD;
1327 idx = rx->cnt & rx->mask; 1336 idx = rx->cnt & rx->mask;
1328 va = page_address(rx->info[idx].page) + rx->info[idx].page_offset; 1337 va = page_address(rx->info[idx].page) + rx->info[idx].page_offset;
@@ -1341,7 +1350,7 @@ myri10ge_rx_done(struct myri10ge_slice_state *ss, struct myri10ge_rx_buf *rx,
1341 remainder -= MYRI10GE_ALLOC_SIZE; 1350 remainder -= MYRI10GE_ALLOC_SIZE;
1342 } 1351 }
1343 1352
1344 if (dev->features & NETIF_F_LRO) { 1353 if (lro_enabled) {
1345 rx_frags[0].page_offset += MXGEFW_PAD; 1354 rx_frags[0].page_offset += MXGEFW_PAD;
1346 rx_frags[0].size -= MXGEFW_PAD; 1355 rx_frags[0].size -= MXGEFW_PAD;
1347 len -= MXGEFW_PAD; 1356 len -= MXGEFW_PAD;
@@ -1463,7 +1472,7 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget)
1463{ 1472{
1464 struct myri10ge_rx_done *rx_done = &ss->rx_done; 1473 struct myri10ge_rx_done *rx_done = &ss->rx_done;
1465 struct myri10ge_priv *mgp = ss->mgp; 1474 struct myri10ge_priv *mgp = ss->mgp;
1466 struct net_device *netdev = mgp->dev; 1475
1467 unsigned long rx_bytes = 0; 1476 unsigned long rx_bytes = 0;
1468 unsigned long rx_packets = 0; 1477 unsigned long rx_packets = 0;
1469 unsigned long rx_ok; 1478 unsigned long rx_ok;
@@ -1474,18 +1483,18 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget)
1474 u16 length; 1483 u16 length;
1475 __wsum checksum; 1484 __wsum checksum;
1476 1485
1486 /*
1487 * Prevent compiler from generating more than one ->features memory
1488 * access to avoid theoretical race condition with functions that
1489 * change NETIF_F_LRO flag at runtime.
1490 */
1491 bool lro_enabled = ACCESS_ONCE(mgp->dev->features) & NETIF_F_LRO;
1492
1477 while (rx_done->entry[idx].length != 0 && work_done < budget) { 1493 while (rx_done->entry[idx].length != 0 && work_done < budget) {
1478 length = ntohs(rx_done->entry[idx].length); 1494 length = ntohs(rx_done->entry[idx].length);
1479 rx_done->entry[idx].length = 0; 1495 rx_done->entry[idx].length = 0;
1480 checksum = csum_unfold(rx_done->entry[idx].checksum); 1496 checksum = csum_unfold(rx_done->entry[idx].checksum);
1481 if (length <= mgp->small_bytes) 1497 rx_ok = myri10ge_rx_done(ss, length, checksum, lro_enabled);
1482 rx_ok = myri10ge_rx_done(ss, &ss->rx_small,
1483 mgp->small_bytes,
1484 length, checksum);
1485 else
1486 rx_ok = myri10ge_rx_done(ss, &ss->rx_big,
1487 mgp->big_bytes,
1488 length, checksum);
1489 rx_packets += rx_ok; 1498 rx_packets += rx_ok;
1490 rx_bytes += rx_ok * (unsigned long)length; 1499 rx_bytes += rx_ok * (unsigned long)length;
1491 cnt++; 1500 cnt++;
@@ -1497,7 +1506,7 @@ myri10ge_clean_rx_done(struct myri10ge_slice_state *ss, int budget)
1497 ss->stats.rx_packets += rx_packets; 1506 ss->stats.rx_packets += rx_packets;
1498 ss->stats.rx_bytes += rx_bytes; 1507 ss->stats.rx_bytes += rx_bytes;
1499 1508
1500 if (netdev->features & NETIF_F_LRO) 1509 if (lro_enabled)
1501 lro_flush_all(&rx_done->lro_mgr); 1510 lro_flush_all(&rx_done->lro_mgr);
1502 1511
1503 /* restock receive rings if needed */ 1512 /* restock receive rings if needed */
@@ -3645,6 +3654,7 @@ static void myri10ge_free_slices(struct myri10ge_priv *mgp)
3645 dma_free_coherent(&pdev->dev, bytes, 3654 dma_free_coherent(&pdev->dev, bytes,
3646 ss->fw_stats, ss->fw_stats_bus); 3655 ss->fw_stats, ss->fw_stats_bus);
3647 ss->fw_stats = NULL; 3656 ss->fw_stats = NULL;
3657 netif_napi_del(&ss->napi);
3648 } 3658 }
3649 } 3659 }
3650 kfree(mgp->ss); 3660 kfree(mgp->ss);
@@ -3692,7 +3702,7 @@ abort:
3692 3702
3693/* 3703/*
3694 * This function determines the number of slices supported. 3704 * This function determines the number of slices supported.
3695 * The number slices is the minumum of the number of CPUS, 3705 * The number slices is the minimum of the number of CPUS,
3696 * the number of MSI-X irqs supported, the number of slices 3706 * the number of MSI-X irqs supported, the number of slices
3697 * supported by the firmware 3707 * supported by the firmware
3698 */ 3708 */
diff --git a/drivers/net/myri_sbus.c b/drivers/net/myri_sbus.c
index a761076b69c3..53aeea4b536e 100644
--- a/drivers/net/myri_sbus.c
+++ b/drivers/net/myri_sbus.c
@@ -1009,7 +1009,7 @@ static int __devinit myri_sbus_probe(struct platform_device *op)
1009 1009
1010 /* Map in the MyriCOM register/localram set. */ 1010 /* Map in the MyriCOM register/localram set. */
1011 if (mp->eeprom.cpuvers < CPUVERS_4_0) { 1011 if (mp->eeprom.cpuvers < CPUVERS_4_0) {
1012 /* XXX Makes no sense, if control reg is non-existant this 1012 /* XXX Makes no sense, if control reg is non-existent this
1013 * XXX driver cannot function at all... maybe pre-4.0 is 1013 * XXX driver cannot function at all... maybe pre-4.0 is
1014 * XXX only a valid version for PCI cards? Ask feldy... 1014 * XXX only a valid version for PCI cards? Ask feldy...
1015 */ 1015 */
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 2fd39630b1e5..1074231f0a0d 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -203,7 +203,7 @@ skbuff at an offset of "+2", 16-byte aligning the IP header.
203IIId. Synchronization 203IIId. Synchronization
204 204
205Most operations are synchronized on the np->lock irq spinlock, except the 205Most operations are synchronized on the np->lock irq spinlock, except the
206recieve and transmit paths which are synchronised using a combination of 206receive and transmit paths which are synchronised using a combination of
207hardware descriptor ownership, disabling interrupts and NAPI poll scheduling. 207hardware descriptor ownership, disabling interrupts and NAPI poll scheduling.
208 208
209IVb. References 209IVb. References
@@ -726,7 +726,7 @@ static void move_int_phy(struct net_device *dev, int addr)
726 * There are two addresses we must avoid: 726 * There are two addresses we must avoid:
727 * - the address on the external phy that is used for transmission. 727 * - the address on the external phy that is used for transmission.
728 * - the address that we want to access. User space can access phys 728 * - the address that we want to access. User space can access phys
729 * on the mii bus with SIOCGMIIREG/SIOCSMIIREG, independant from the 729 * on the mii bus with SIOCGMIIREG/SIOCSMIIREG, independent from the
730 * phy that is used for transmission. 730 * phy that is used for transmission.
731 */ 731 */
732 732
@@ -860,6 +860,9 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
860 prev_eedata = eedata; 860 prev_eedata = eedata;
861 } 861 }
862 862
863 /* Store MAC Address in perm_addr */
864 memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN);
865
863 dev->base_addr = (unsigned long __force) ioaddr; 866 dev->base_addr = (unsigned long __force) ioaddr;
864 dev->irq = irq; 867 dev->irq = irq;
865 868
@@ -1982,7 +1985,7 @@ static void init_ring(struct net_device *dev)
1982 1985
1983 np->rx_head_desc = &np->rx_ring[0]; 1986 np->rx_head_desc = &np->rx_ring[0];
1984 1987
1985 /* Please be carefull before changing this loop - at least gcc-2.95.1 1988 /* Please be careful before changing this loop - at least gcc-2.95.1
1986 * miscompiles it otherwise. 1989 * miscompiles it otherwise.
1987 */ 1990 */
1988 /* Initialize all Rx descriptors. */ 1991 /* Initialize all Rx descriptors. */
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index d7299f1a4940..679dc8519c5b 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -174,7 +174,7 @@
174 174
175#define MAX_NUM_CARDS 4 175#define MAX_NUM_CARDS 4
176 176
177#define MAX_BUFFERS_PER_CMD 32 177#define NETXEN_MAX_FRAGS_PER_TX 14
178#define MAX_TSO_HEADER_DESC 2 178#define MAX_TSO_HEADER_DESC 2
179#define MGMT_CMD_DESC_RESV 4 179#define MGMT_CMD_DESC_RESV 4
180#define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \ 180#define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \
@@ -558,7 +558,7 @@ struct netxen_recv_crb {
558 */ 558 */
559struct netxen_cmd_buffer { 559struct netxen_cmd_buffer {
560 struct sk_buff *skb; 560 struct sk_buff *skb;
561 struct netxen_skb_frag frag_array[MAX_BUFFERS_PER_CMD + 1]; 561 struct netxen_skb_frag frag_array[MAX_SKB_FRAGS + 1];
562 u32 frag_count; 562 u32 frag_count;
563}; 563};
564 564
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 653d308e0f5d..3bdcc803ec68 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -871,7 +871,7 @@ static int netxen_nic_set_flags(struct net_device *netdev, u32 data)
871 struct netxen_adapter *adapter = netdev_priv(netdev); 871 struct netxen_adapter *adapter = netdev_priv(netdev);
872 int hw_lro; 872 int hw_lro;
873 873
874 if (data & ~ETH_FLAG_LRO) 874 if (ethtool_invalid_flags(netdev, data, ETH_FLAG_LRO))
875 return -EINVAL; 875 return -EINVAL;
876 876
877 if (!(adapter->capabilities & NX_FW_CAPABILITY_HW_LRO)) 877 if (!(adapter->capabilities & NX_FW_CAPABILITY_HW_LRO))
diff --git a/drivers/net/netxen/netxen_nic_hdr.h b/drivers/net/netxen/netxen_nic_hdr.h
index d8bd73d7e296..dc1967c1f312 100644
--- a/drivers/net/netxen/netxen_nic_hdr.h
+++ b/drivers/net/netxen/netxen_nic_hdr.h
@@ -780,7 +780,7 @@ enum {
780 780
781/* 781/*
782 * capabilities register, can be used to selectively enable/disable features 782 * capabilities register, can be used to selectively enable/disable features
783 * for backward compability 783 * for backward compatibility
784 */ 784 */
785#define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8) 785#define CRB_NIC_CAPABILITIES_HOST NETXEN_NIC_REG(0x1a8)
786#define CRB_NIC_MSI_MODE_HOST NETXEN_NIC_REG(0x270) 786#define CRB_NIC_MSI_MODE_HOST NETXEN_NIC_REG(0x270)
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 83348dc4b184..e8a4b6655999 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -1844,6 +1844,8 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1844 struct cmd_desc_type0 *hwdesc, *first_desc; 1844 struct cmd_desc_type0 *hwdesc, *first_desc;
1845 struct pci_dev *pdev; 1845 struct pci_dev *pdev;
1846 int i, k; 1846 int i, k;
1847 int delta = 0;
1848 struct skb_frag_struct *frag;
1847 1849
1848 u32 producer; 1850 u32 producer;
1849 int frag_count, no_of_desc; 1851 int frag_count, no_of_desc;
@@ -1851,6 +1853,21 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1851 1853
1852 frag_count = skb_shinfo(skb)->nr_frags + 1; 1854 frag_count = skb_shinfo(skb)->nr_frags + 1;
1853 1855
1856 /* 14 frags supported for normal packet and
1857 * 32 frags supported for TSO packet
1858 */
1859 if (!skb_is_gso(skb) && frag_count > NETXEN_MAX_FRAGS_PER_TX) {
1860
1861 for (i = 0; i < (frag_count - NETXEN_MAX_FRAGS_PER_TX); i++) {
1862 frag = &skb_shinfo(skb)->frags[i];
1863 delta += frag->size;
1864 }
1865
1866 if (!__pskb_pull_tail(skb, delta))
1867 goto drop_packet;
1868
1869 frag_count = 1 + skb_shinfo(skb)->nr_frags;
1870 }
1854 /* 4 fragments per cmd des */ 1871 /* 4 fragments per cmd des */
1855 no_of_desc = (frag_count + 3) >> 2; 1872 no_of_desc = (frag_count + 3) >> 2;
1856 1873
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 40fa59e2fd5c..32678b6c6b39 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -9501,7 +9501,7 @@ static struct niu_parent * __devinit niu_new_parent(struct niu *np,
9501 struct niu_parent *p; 9501 struct niu_parent *p;
9502 int i; 9502 int i;
9503 9503
9504 plat_dev = platform_device_register_simple("niu", niu_parent_index, 9504 plat_dev = platform_device_register_simple("niu-board", niu_parent_index,
9505 NULL, 0); 9505 NULL, 0);
9506 if (IS_ERR(plat_dev)) 9506 if (IS_ERR(plat_dev))
9507 return NULL; 9507 return NULL;
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index a41b2cf4d917..6667e0667a88 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -512,7 +512,7 @@ static void ns83820_vlan_rx_register(struct net_device *ndev, struct vlan_group
512/* Packet Receiver 512/* Packet Receiver
513 * 513 *
514 * The hardware supports linked lists of receive descriptors for 514 * The hardware supports linked lists of receive descriptors for
515 * which ownership is transfered back and forth by means of an 515 * which ownership is transferred back and forth by means of an
516 * ownership bit. While the hardware does support the use of a 516 * ownership bit. While the hardware does support the use of a
517 * ring for receive descriptors, we only make use of a chain in 517 * ring for receive descriptors, we only make use of a chain in
518 * an attempt to reduce bus traffic under heavy load scenarios. 518 * an attempt to reduce bus traffic under heavy load scenarios.
@@ -1147,7 +1147,7 @@ again:
1147#ifdef NS83820_VLAN_ACCEL_SUPPORT 1147#ifdef NS83820_VLAN_ACCEL_SUPPORT
1148 if(vlan_tx_tag_present(skb)) { 1148 if(vlan_tx_tag_present(skb)) {
1149 /* fetch the vlan tag info out of the 1149 /* fetch the vlan tag info out of the
1150 * ancilliary data if the vlan code 1150 * ancillary data if the vlan code
1151 * is using hw vlan acceleration 1151 * is using hw vlan acceleration
1152 */ 1152 */
1153 short tag = vlan_tx_tag_get(skb); 1153 short tag = vlan_tx_tag_get(skb);
diff --git a/drivers/net/pch_gbe/pch_gbe.h b/drivers/net/pch_gbe/pch_gbe.h
index e1e33c80fb25..bf126e76fabf 100644
--- a/drivers/net/pch_gbe/pch_gbe.h
+++ b/drivers/net/pch_gbe/pch_gbe.h
@@ -351,7 +351,7 @@ struct pch_gbe_functions {
351}; 351};
352 352
353/** 353/**
354 * struct pch_gbe_mac_info - MAC infomation 354 * struct pch_gbe_mac_info - MAC information
355 * @addr[6]: Store the MAC address 355 * @addr[6]: Store the MAC address
356 * @fc: Mode of flow control 356 * @fc: Mode of flow control
357 * @fc_autoneg: Auto negotiation enable for flow control setting 357 * @fc_autoneg: Auto negotiation enable for flow control setting
@@ -375,7 +375,7 @@ struct pch_gbe_mac_info {
375}; 375};
376 376
377/** 377/**
378 * struct pch_gbe_phy_info - PHY infomation 378 * struct pch_gbe_phy_info - PHY information
379 * @addr: PHY address 379 * @addr: PHY address
380 * @id: PHY's identifier 380 * @id: PHY's identifier
381 * @revision: PHY's revision 381 * @revision: PHY's revision
@@ -393,7 +393,7 @@ struct pch_gbe_phy_info {
393/*! 393/*!
394 * @ingroup Gigabit Ether driver Layer 394 * @ingroup Gigabit Ether driver Layer
395 * @struct pch_gbe_bus_info 395 * @struct pch_gbe_bus_info
396 * @brief Bus infomation 396 * @brief Bus information
397 */ 397 */
398struct pch_gbe_bus_info { 398struct pch_gbe_bus_info {
399 u8 type; 399 u8 type;
@@ -404,7 +404,7 @@ struct pch_gbe_bus_info {
404/*! 404/*!
405 * @ingroup Gigabit Ether driver Layer 405 * @ingroup Gigabit Ether driver Layer
406 * @struct pch_gbe_hw 406 * @struct pch_gbe_hw
407 * @brief Hardware infomation 407 * @brief Hardware information
408 */ 408 */
409struct pch_gbe_hw { 409struct pch_gbe_hw {
410 void *back; 410 void *back;
@@ -462,7 +462,7 @@ struct pch_gbe_tx_desc {
462 462
463 463
464/** 464/**
465 * struct pch_gbe_buffer - Buffer infomation 465 * struct pch_gbe_buffer - Buffer information
466 * @skb: pointer to a socket buffer 466 * @skb: pointer to a socket buffer
467 * @dma: DMA address 467 * @dma: DMA address
468 * @time_stamp: time stamp 468 * @time_stamp: time stamp
@@ -477,7 +477,7 @@ struct pch_gbe_buffer {
477}; 477};
478 478
479/** 479/**
480 * struct pch_gbe_tx_ring - tx ring infomation 480 * struct pch_gbe_tx_ring - tx ring information
481 * @tx_lock: spinlock structs 481 * @tx_lock: spinlock structs
482 * @desc: pointer to the descriptor ring memory 482 * @desc: pointer to the descriptor ring memory
483 * @dma: physical address of the descriptor ring 483 * @dma: physical address of the descriptor ring
@@ -499,7 +499,7 @@ struct pch_gbe_tx_ring {
499}; 499};
500 500
501/** 501/**
502 * struct pch_gbe_rx_ring - rx ring infomation 502 * struct pch_gbe_rx_ring - rx ring information
503 * @desc: pointer to the descriptor ring memory 503 * @desc: pointer to the descriptor ring memory
504 * @dma: physical address of the descriptor ring 504 * @dma: physical address of the descriptor ring
505 * @size: length of descriptor ring in bytes 505 * @size: length of descriptor ring in bytes
diff --git a/drivers/net/pch_gbe/pch_gbe_ethtool.c b/drivers/net/pch_gbe/pch_gbe_ethtool.c
index c8c873b31a89..d2174a40d708 100644
--- a/drivers/net/pch_gbe/pch_gbe_ethtool.c
+++ b/drivers/net/pch_gbe/pch_gbe_ethtool.c
@@ -21,7 +21,7 @@
21#include "pch_gbe_api.h" 21#include "pch_gbe_api.h"
22 22
23/** 23/**
24 * pch_gbe_stats - Stats item infomation 24 * pch_gbe_stats - Stats item information
25 */ 25 */
26struct pch_gbe_stats { 26struct pch_gbe_stats {
27 char string[ETH_GSTRING_LEN]; 27 char string[ETH_GSTRING_LEN];
diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c
index 8c66e22c3a0a..2ef2f9cdefa6 100644
--- a/drivers/net/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/pch_gbe/pch_gbe_main.c
@@ -1011,7 +1011,7 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
1011 tmp_skb->len = skb->len; 1011 tmp_skb->len = skb->len;
1012 memcpy(&tmp_skb->data[ETH_HLEN + 2], &skb->data[ETH_HLEN], 1012 memcpy(&tmp_skb->data[ETH_HLEN + 2], &skb->data[ETH_HLEN],
1013 (skb->len - ETH_HLEN)); 1013 (skb->len - ETH_HLEN));
1014 /*-- Set Buffer infomation --*/ 1014 /*-- Set Buffer information --*/
1015 buffer_info->length = tmp_skb->len; 1015 buffer_info->length = tmp_skb->len;
1016 buffer_info->dma = dma_map_single(&adapter->pdev->dev, tmp_skb->data, 1016 buffer_info->dma = dma_map_single(&adapter->pdev->dev, tmp_skb->data,
1017 buffer_info->length, 1017 buffer_info->length,
@@ -1540,7 +1540,7 @@ int pch_gbe_setup_tx_resources(struct pch_gbe_adapter *adapter,
1540 size = (int)sizeof(struct pch_gbe_buffer) * tx_ring->count; 1540 size = (int)sizeof(struct pch_gbe_buffer) * tx_ring->count;
1541 tx_ring->buffer_info = vzalloc(size); 1541 tx_ring->buffer_info = vzalloc(size);
1542 if (!tx_ring->buffer_info) { 1542 if (!tx_ring->buffer_info) {
1543 pr_err("Unable to allocate memory for the buffer infomation\n"); 1543 pr_err("Unable to allocate memory for the buffer information\n");
1544 return -ENOMEM; 1544 return -ENOMEM;
1545 } 1545 }
1546 1546
@@ -2441,7 +2441,7 @@ static struct pci_error_handlers pch_gbe_err_handler = {
2441 .resume = pch_gbe_io_resume 2441 .resume = pch_gbe_io_resume
2442}; 2442};
2443 2443
2444static struct pci_driver pch_gbe_pcidev = { 2444static struct pci_driver pch_gbe_driver = {
2445 .name = KBUILD_MODNAME, 2445 .name = KBUILD_MODNAME,
2446 .id_table = pch_gbe_pcidev_id, 2446 .id_table = pch_gbe_pcidev_id,
2447 .probe = pch_gbe_probe, 2447 .probe = pch_gbe_probe,
@@ -2458,7 +2458,7 @@ static int __init pch_gbe_init_module(void)
2458{ 2458{
2459 int ret; 2459 int ret;
2460 2460
2461 ret = pci_register_driver(&pch_gbe_pcidev); 2461 ret = pci_register_driver(&pch_gbe_driver);
2462 if (copybreak != PCH_GBE_COPYBREAK_DEFAULT) { 2462 if (copybreak != PCH_GBE_COPYBREAK_DEFAULT) {
2463 if (copybreak == 0) { 2463 if (copybreak == 0) {
2464 pr_info("copybreak disabled\n"); 2464 pr_info("copybreak disabled\n");
@@ -2472,7 +2472,7 @@ static int __init pch_gbe_init_module(void)
2472 2472
2473static void __exit pch_gbe_exit_module(void) 2473static void __exit pch_gbe_exit_module(void)
2474{ 2474{
2475 pci_unregister_driver(&pch_gbe_pcidev); 2475 pci_unregister_driver(&pch_gbe_driver);
2476} 2476}
2477 2477
2478module_init(pch_gbe_init_module); 2478module_init(pch_gbe_init_module);
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index 1766dc4f07e1..c0f23376a462 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -214,7 +214,7 @@ static struct {
214 { "SMC1211TX EZCard 10/100 (RealTek RTL8139)" }, 214 { "SMC1211TX EZCard 10/100 (RealTek RTL8139)" },
215/* { MPX5030, "Accton MPX5030 (RealTek RTL8139)" },*/ 215/* { MPX5030, "Accton MPX5030 (RealTek RTL8139)" },*/
216 { "Delta Electronics 8139 10/100BaseTX" }, 216 { "Delta Electronics 8139 10/100BaseTX" },
217 { "Addtron Technolgy 8139 10/100BaseTX" }, 217 { "Addtron Technology 8139 10/100BaseTX" },
218}; 218};
219 219
220 220
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 321b12f82645..81ac330f931d 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -950,7 +950,7 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev)
950} 950}
951 951
952/* Update statistics. 952/* Update statistics.
953 Suprisingly this need not be run single-threaded, but it effectively is. 953 Surprisingly this need not be run single-threaded, but it effectively is.
954 The counters clear when read, so the adds must merely be atomic. 954 The counters clear when read, so the adds must merely be atomic.
955 */ 955 */
956static void update_stats(struct net_device *dev) 956static void update_stats(struct net_device *dev)
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index d3cb77205863..3077d72e8222 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -780,7 +780,7 @@ module_exit(exit_axnet_cs);
780 Alexey Kuznetsov : use the 8390's six bit hash multicast filter. 780 Alexey Kuznetsov : use the 8390's six bit hash multicast filter.
781 Paul Gortmaker : tweak ANK's above multicast changes a bit. 781 Paul Gortmaker : tweak ANK's above multicast changes a bit.
782 Paul Gortmaker : update packet statistics for v2.1.x 782 Paul Gortmaker : update packet statistics for v2.1.x
783 Alan Cox : support arbitary stupid port mappings on the 783 Alan Cox : support arbitrary stupid port mappings on the
784 68K Macintosh. Support >16bit I/O spaces 784 68K Macintosh. Support >16bit I/O spaces
785 Paul Gortmaker : add kmod support for auto-loading of the 8390 785 Paul Gortmaker : add kmod support for auto-loading of the 8390
786 module by all drivers that require it. 786 module by all drivers that require it.
@@ -842,7 +842,7 @@ static void do_set_multicast_list(struct net_device *dev);
842/* 842/*
843 * SMP and the 8390 setup. 843 * SMP and the 8390 setup.
844 * 844 *
845 * The 8390 isnt exactly designed to be multithreaded on RX/TX. There is 845 * The 8390 isn't exactly designed to be multithreaded on RX/TX. There is
846 * a page register that controls bank and packet buffer access. We guard 846 * a page register that controls bank and packet buffer access. We guard
847 * this with ei_local->page_lock. Nobody should assume or set the page other 847 * this with ei_local->page_lock. Nobody should assume or set the page other
848 * than zero when the lock is not held. Lock holders must restore page 0 848 * than zero when the lock is not held. Lock holders must restore page 0
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 8a9ff5318923..108591756440 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -1264,7 +1264,7 @@ static netdev_tx_t smc_start_xmit(struct sk_buff *skb,
1264 1264
1265/*====================================================================== 1265/*======================================================================
1266 1266
1267 Handle a Tx anomolous event. Entered while in Window 2. 1267 Handle a Tx anomalous event. Entered while in Window 2.
1268 1268
1269======================================================================*/ 1269======================================================================*/
1270 1270
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index aee3bb0358bf..768037602dff 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -1651,7 +1651,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1651 /* 1651 /*
1652 * On selected chips turn on the BCR18:NOUFLO bit. This stops transmit 1652 * On selected chips turn on the BCR18:NOUFLO bit. This stops transmit
1653 * starting until the packet is loaded. Strike one for reliability, lose 1653 * starting until the packet is loaded. Strike one for reliability, lose
1654 * one for latency - although on PCI this isnt a big loss. Older chips 1654 * one for latency - although on PCI this isn't a big loss. Older chips
1655 * have FIFO's smaller than a packet, so you can't do this. 1655 * have FIFO's smaller than a packet, so you can't do this.
1656 * Turn on BCR18:BurstRdEn and BCR18:BurstWrEn. 1656 * Turn on BCR18:BurstRdEn and BCR18:BurstWrEn.
1657 */ 1657 */
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 993c52c82aeb..ff109fe5af6b 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -442,11 +442,11 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
442 u32 flags, phy_interface_t interface) 442 u32 flags, phy_interface_t interface)
443{ 443{
444 struct device *d = &phydev->dev; 444 struct device *d = &phydev->dev;
445 int err;
445 446
446 /* Assume that if there is no driver, that it doesn't 447 /* Assume that if there is no driver, that it doesn't
447 * exist, and we should use the genphy driver. */ 448 * exist, and we should use the genphy driver. */
448 if (NULL == d->driver) { 449 if (NULL == d->driver) {
449 int err;
450 d->driver = &genphy_driver.driver; 450 d->driver = &genphy_driver.driver;
451 451
452 err = d->driver->probe(d); 452 err = d->driver->probe(d);
@@ -474,7 +474,11 @@ static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
474 /* Do initial configuration here, now that 474 /* Do initial configuration here, now that
475 * we have certain key parameters 475 * we have certain key parameters
476 * (dev_flags and interface) */ 476 * (dev_flags and interface) */
477 return phy_init_hw(phydev); 477 err = phy_init_hw(phydev);
478 if (err)
479 phy_detach(phydev);
480
481 return err;
478} 482}
479 483
480/** 484/**
@@ -534,7 +538,7 @@ EXPORT_SYMBOL(phy_detach);
534/* Generic PHY support and helper functions */ 538/* Generic PHY support and helper functions */
535 539
536/** 540/**
537 * genphy_config_advert - sanitize and advertise auto-negotation parameters 541 * genphy_config_advert - sanitize and advertise auto-negotiation parameters
538 * @phydev: target phy_device struct 542 * @phydev: target phy_device struct
539 * 543 *
540 * Description: Writes MII_ADVERTISE with the appropriate values, 544 * Description: Writes MII_ADVERTISE with the appropriate values,
@@ -683,7 +687,7 @@ int genphy_config_aneg(struct phy_device *phydev)
683 return result; 687 return result;
684 688
685 if (result == 0) { 689 if (result == 0) {
686 /* Advertisment hasn't changed, but maybe aneg was never on to 690 /* Advertisement hasn't changed, but maybe aneg was never on to
687 * begin with? Or maybe phy was isolated? */ 691 * begin with? Or maybe phy was isolated? */
688 int ctl = phy_read(phydev, MII_BMCR); 692 int ctl = phy_read(phydev, MII_BMCR);
689 693
diff --git a/drivers/net/ppp_deflate.c b/drivers/net/ppp_deflate.c
index 43583309a65d..31e9407a0739 100644
--- a/drivers/net/ppp_deflate.c
+++ b/drivers/net/ppp_deflate.c
@@ -129,7 +129,7 @@ static void *z_comp_alloc(unsigned char *options, int opt_len)
129 129
130 state->strm.next_in = NULL; 130 state->strm.next_in = NULL;
131 state->w_size = w_size; 131 state->w_size = w_size;
132 state->strm.workspace = vmalloc(zlib_deflate_workspacesize()); 132 state->strm.workspace = vmalloc(zlib_deflate_workspacesize(-w_size, 8));
133 if (state->strm.workspace == NULL) 133 if (state->strm.workspace == NULL)
134 goto out_free; 134 goto out_free;
135 135
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index 9f6d670748d1..4609bc0e2f56 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1448,7 +1448,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1448 1448
1449 /* 1449 /*
1450 *check if we are on the last channel or 1450 *check if we are on the last channel or
1451 *we exceded the lenght of the data to 1451 *we exceded the length of the data to
1452 *fragment 1452 *fragment
1453 */ 1453 */
1454 if ((nfree <= 0) || (flen > len)) 1454 if ((nfree <= 0) || (flen > len))
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index 4e6b72f57de8..2573f525f11c 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -178,7 +178,7 @@ ppp_print_buffer (const char *name, const __u8 *buf, int count)
178 * way to fix this is to use a rwlock in the tty struct, but for now 178 * way to fix this is to use a rwlock in the tty struct, but for now
179 * we use a single global rwlock for all ttys in ppp line discipline. 179 * we use a single global rwlock for all ttys in ppp line discipline.
180 * 180 *
181 * FIXME: Fixed in tty_io nowdays. 181 * FIXME: Fixed in tty_io nowadays.
182 */ 182 */
183static DEFINE_RWLOCK(disc_data_lock); 183static DEFINE_RWLOCK(disc_data_lock);
184 184
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c
index 78c0e3c9b2b5..718879b35b7d 100644
--- a/drivers/net/pppoe.c
+++ b/drivers/net/pppoe.c
@@ -115,7 +115,7 @@ struct pppoe_net {
115 * 2) Session stage (MAC and SID are known) 115 * 2) Session stage (MAC and SID are known)
116 * 116 *
117 * Ethernet frames have a special tag for this but 117 * Ethernet frames have a special tag for this but
118 * we use simplier approach based on session id 118 * we use simpler approach based on session id
119 */ 119 */
120static inline bool stage_session(__be16 sid) 120static inline bool stage_session(__be16 sid)
121{ 121{
@@ -317,7 +317,7 @@ static void pppoe_flush_dev(struct net_device *dev)
317 lock_sock(sk); 317 lock_sock(sk);
318 318
319 if (po->pppoe_dev == dev && 319 if (po->pppoe_dev == dev &&
320 sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND)) { 320 sk->sk_state & (PPPOX_CONNECTED | PPPOX_BOUND | PPPOX_ZOMBIE)) {
321 pppox_unbind_sock(sk); 321 pppox_unbind_sock(sk);
322 sk->sk_state = PPPOX_ZOMBIE; 322 sk->sk_state = PPPOX_ZOMBIE;
323 sk->sk_state_change(sk); 323 sk->sk_state_change(sk);
diff --git a/drivers/net/ps3_gelic_net.c b/drivers/net/ps3_gelic_net.c
index 5ecfa4b1e758..ffdf7349ef7a 100644
--- a/drivers/net/ps3_gelic_net.c
+++ b/drivers/net/ps3_gelic_net.c
@@ -632,7 +632,7 @@ static inline void gelic_card_enable_rxdmac(struct gelic_card *card)
632 * @card: card structure 632 * @card: card structure
633 * 633 *
634 * gelic_card_disable_rxdmac terminates processing on the DMA controller by 634 * gelic_card_disable_rxdmac terminates processing on the DMA controller by
635 * turing off DMA and issueing a force end 635 * turing off DMA and issuing a force end
636 */ 636 */
637static inline void gelic_card_disable_rxdmac(struct gelic_card *card) 637static inline void gelic_card_disable_rxdmac(struct gelic_card *card)
638{ 638{
@@ -650,7 +650,7 @@ static inline void gelic_card_disable_rxdmac(struct gelic_card *card)
650 * @card: card structure 650 * @card: card structure
651 * 651 *
652 * gelic_card_disable_txdmac terminates processing on the DMA controller by 652 * gelic_card_disable_txdmac terminates processing on the DMA controller by
653 * turing off DMA and issueing a force end 653 * turing off DMA and issuing a force end
654 */ 654 */
655static inline void gelic_card_disable_txdmac(struct gelic_card *card) 655static inline void gelic_card_disable_txdmac(struct gelic_card *card)
656{ 656{
diff --git a/drivers/net/ps3_gelic_net.h b/drivers/net/ps3_gelic_net.h
index 32521ae5e824..fadadf9097a3 100644
--- a/drivers/net/ps3_gelic_net.h
+++ b/drivers/net/ps3_gelic_net.h
@@ -117,7 +117,7 @@ enum gelic_descr_rx_error {
117 GELIC_DESCR_RXDATAERR = 0x00020000, /* IP packet format error */ 117 GELIC_DESCR_RXDATAERR = 0x00020000, /* IP packet format error */
118 GELIC_DESCR_RXCALERR = 0x00010000, /* cariier extension length 118 GELIC_DESCR_RXCALERR = 0x00010000, /* cariier extension length
119 * error */ 119 * error */
120 GELIC_DESCR_RXCREXERR = 0x00008000, /* carrier extention error */ 120 GELIC_DESCR_RXCREXERR = 0x00008000, /* carrier extension error */
121 GELIC_DESCR_RXMLTCST = 0x00004000, /* multicast address frame */ 121 GELIC_DESCR_RXMLTCST = 0x00004000, /* multicast address frame */
122 /* bit 13..0 reserved */ 122 /* bit 13..0 reserved */
123}; 123};
diff --git a/drivers/net/ps3_gelic_wireless.c b/drivers/net/ps3_gelic_wireless.c
index 4a624a29393f..b5ae29d20f2e 100644
--- a/drivers/net/ps3_gelic_wireless.c
+++ b/drivers/net/ps3_gelic_wireless.c
@@ -814,7 +814,7 @@ static int gelic_wl_set_auth(struct net_device *netdev,
814 * you will not decide suitable cipher from 814 * you will not decide suitable cipher from
815 * its beacon. 815 * its beacon.
816 * You should have knowledge about the AP's 816 * You should have knowledge about the AP's
817 * cipher infomation in other method prior to 817 * cipher information in other method prior to
818 * the association. 818 * the association.
819 */ 819 */
820 if (!precise_ie()) 820 if (!precise_ie())
diff --git a/drivers/net/pxa168_eth.c b/drivers/net/pxa168_eth.c
index 1b63c8aef121..89f7540d90f9 100644
--- a/drivers/net/pxa168_eth.c
+++ b/drivers/net/pxa168_eth.c
@@ -462,7 +462,7 @@ static u32 hash_function(unsigned char *mac_addr_orig)
462 * pep - ETHERNET . 462 * pep - ETHERNET .
463 * mac_addr - MAC address. 463 * mac_addr - MAC address.
464 * skip - if 1, skip this address.Used in case of deleting an entry which is a 464 * skip - if 1, skip this address.Used in case of deleting an entry which is a
465 * part of chain in the hash table.We cant just delete the entry since 465 * part of chain in the hash table.We can't just delete the entry since
466 * that will break the chain.We need to defragment the tables time to 466 * that will break the chain.We need to defragment the tables time to
467 * time. 467 * time.
468 * rd - 0 Discard packet upon match. 468 * rd - 0 Discard packet upon match.
diff --git a/drivers/net/qla3xxx.h b/drivers/net/qla3xxx.h
index 3362a661248c..73e234366a82 100644
--- a/drivers/net/qla3xxx.h
+++ b/drivers/net/qla3xxx.h
@@ -770,7 +770,7 @@ enum {
770 FM93C56A_WDS = 0x0, 770 FM93C56A_WDS = 0x0,
771 FM93C56A_ERASE = 0x3, 771 FM93C56A_ERASE = 0x3,
772 FM93C56A_ERASE_ALL = 0x0, 772 FM93C56A_ERASE_ALL = 0x0,
773/* Command Extentions */ 773/* Command Extensions */
774 FM93C56A_WEN_EXT = 0x3, 774 FM93C56A_WEN_EXT = 0x3,
775 FM93C56A_WRITE_ALL_EXT = 0x1, 775 FM93C56A_WRITE_ALL_EXT = 0x1,
776 FM93C56A_WDS_EXT = 0x0, 776 FM93C56A_WDS_EXT = 0x0,
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index dc44564ef6f9..b0dead00b2d1 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -99,6 +99,7 @@
99#define TX_UDPV6_PKT 0x0c 99#define TX_UDPV6_PKT 0x0c
100 100
101/* Tx defines */ 101/* Tx defines */
102#define QLCNIC_MAX_FRAGS_PER_TX 14
102#define MAX_TSO_HEADER_DESC 2 103#define MAX_TSO_HEADER_DESC 2
103#define MGMT_CMD_DESC_RESV 4 104#define MGMT_CMD_DESC_RESV 4
104#define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \ 105#define TX_STOP_THRESH ((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 4c14510e2a87..45b2755d6cba 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -1003,7 +1003,7 @@ static int qlcnic_set_flags(struct net_device *netdev, u32 data)
1003 struct qlcnic_adapter *adapter = netdev_priv(netdev); 1003 struct qlcnic_adapter *adapter = netdev_priv(netdev);
1004 int hw_lro; 1004 int hw_lro;
1005 1005
1006 if (data & ~ETH_FLAG_LRO) 1006 if (ethtool_invalid_flags(netdev, data, ETH_FLAG_LRO))
1007 return -EINVAL; 1007 return -EINVAL;
1008 1008
1009 if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO)) 1009 if (!(adapter->capabilities & QLCNIC_FW_CAPABILITY_HW_LRO))
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index cd88c7e1bfa9..cb1a1ef36c0a 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -2099,6 +2099,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2099 struct cmd_desc_type0 *hwdesc, *first_desc; 2099 struct cmd_desc_type0 *hwdesc, *first_desc;
2100 struct pci_dev *pdev; 2100 struct pci_dev *pdev;
2101 struct ethhdr *phdr; 2101 struct ethhdr *phdr;
2102 int delta = 0;
2102 int i, k; 2103 int i, k;
2103 2104
2104 u32 producer; 2105 u32 producer;
@@ -2118,6 +2119,19 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2118 } 2119 }
2119 2120
2120 frag_count = skb_shinfo(skb)->nr_frags + 1; 2121 frag_count = skb_shinfo(skb)->nr_frags + 1;
2122 /* 14 frags supported for normal packet and
2123 * 32 frags supported for TSO packet
2124 */
2125 if (!skb_is_gso(skb) && frag_count > QLCNIC_MAX_FRAGS_PER_TX) {
2126
2127 for (i = 0; i < (frag_count - QLCNIC_MAX_FRAGS_PER_TX); i++)
2128 delta += skb_shinfo(skb)->frags[i].size;
2129
2130 if (!__pskb_pull_tail(skb, delta))
2131 goto drop_packet;
2132
2133 frag_count = 1 + skb_shinfo(skb)->nr_frags;
2134 }
2121 2135
2122 /* 4 fragments per cmd des */ 2136 /* 4 fragments per cmd des */
2123 no_of_desc = (frag_count + 3) >> 2; 2137 no_of_desc = (frag_count + 3) >> 2;
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index 49bfa5813068..5bb311945436 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -660,7 +660,7 @@ static void ql_disable_interrupts(struct ql_adapter *qdev)
660/* If we're running with multiple MSI-X vectors then we enable on the fly. 660/* If we're running with multiple MSI-X vectors then we enable on the fly.
661 * Otherwise, we may have multiple outstanding workers and don't want to 661 * Otherwise, we may have multiple outstanding workers and don't want to
662 * enable until the last one finishes. In this case, the irq_cnt gets 662 * enable until the last one finishes. In this case, the irq_cnt gets
663 * incremented everytime we queue a worker and decremented everytime 663 * incremented every time we queue a worker and decremented every time
664 * a worker finishes. Once it hits zero we enable the interrupt. 664 * a worker finishes. Once it hits zero we enable the interrupt.
665 */ 665 */
666u32 ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr) 666u32 ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr)
@@ -3299,7 +3299,7 @@ msi:
3299 * will service it. An example would be if there are 3299 * will service it. An example would be if there are
3300 * 2 vectors (so 2 RSS rings) and 8 TX completion rings. 3300 * 2 vectors (so 2 RSS rings) and 8 TX completion rings.
3301 * This would mean that vector 0 would service RSS ring 0 3301 * This would mean that vector 0 would service RSS ring 0
3302 * and TX competion rings 0,1,2 and 3. Vector 1 would 3302 * and TX completion rings 0,1,2 and 3. Vector 1 would
3303 * service RSS ring 1 and TX completion rings 4,5,6 and 7. 3303 * service RSS ring 1 and TX completion rings 4,5,6 and 7.
3304 */ 3304 */
3305static void ql_set_tx_vect(struct ql_adapter *qdev) 3305static void ql_set_tx_vect(struct ql_adapter *qdev)
@@ -4152,7 +4152,7 @@ static int ql_change_rx_buffers(struct ql_adapter *qdev)
4152 int i, status; 4152 int i, status;
4153 u32 lbq_buf_len; 4153 u32 lbq_buf_len;
4154 4154
4155 /* Wait for an oustanding reset to complete. */ 4155 /* Wait for an outstanding reset to complete. */
4156 if (!test_bit(QL_ADAPTER_UP, &qdev->flags)) { 4156 if (!test_bit(QL_ADAPTER_UP, &qdev->flags)) {
4157 int i = 3; 4157 int i = 3;
4158 while (i-- && !test_bit(QL_ADAPTER_UP, &qdev->flags)) { 4158 while (i-- && !test_bit(QL_ADAPTER_UP, &qdev->flags)) {
@@ -4281,7 +4281,7 @@ static void qlge_set_multicast_list(struct net_device *ndev)
4281 if (ql_set_routing_reg 4281 if (ql_set_routing_reg
4282 (qdev, RT_IDX_PROMISCUOUS_SLOT, RT_IDX_VALID, 1)) { 4282 (qdev, RT_IDX_PROMISCUOUS_SLOT, RT_IDX_VALID, 1)) {
4283 netif_err(qdev, hw, qdev->ndev, 4283 netif_err(qdev, hw, qdev->ndev,
4284 "Failed to set promiscous mode.\n"); 4284 "Failed to set promiscuous mode.\n");
4285 } else { 4285 } else {
4286 set_bit(QL_PROMISCUOUS, &qdev->flags); 4286 set_bit(QL_PROMISCUOUS, &qdev->flags);
4287 } 4287 }
@@ -4291,7 +4291,7 @@ static void qlge_set_multicast_list(struct net_device *ndev)
4291 if (ql_set_routing_reg 4291 if (ql_set_routing_reg
4292 (qdev, RT_IDX_PROMISCUOUS_SLOT, RT_IDX_VALID, 0)) { 4292 (qdev, RT_IDX_PROMISCUOUS_SLOT, RT_IDX_VALID, 0)) {
4293 netif_err(qdev, hw, qdev->ndev, 4293 netif_err(qdev, hw, qdev->ndev,
4294 "Failed to clear promiscous mode.\n"); 4294 "Failed to clear promiscuous mode.\n");
4295 } else { 4295 } else {
4296 clear_bit(QL_PROMISCUOUS, &qdev->flags); 4296 clear_bit(QL_PROMISCUOUS, &qdev->flags);
4297 } 4297 }
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index e3ebd90ae651..200a363c3bf5 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -535,7 +535,7 @@ static int r6040_rx(struct net_device *dev, int limit)
535 /* RX dribble */ 535 /* RX dribble */
536 if (err & DSC_RX_ERR_DRI) 536 if (err & DSC_RX_ERR_DRI)
537 dev->stats.rx_frame_errors++; 537 dev->stats.rx_frame_errors++;
538 /* Buffer lenght exceeded */ 538 /* Buffer length exceeded */
539 if (err & DSC_RX_ERR_BUF) 539 if (err & DSC_RX_ERR_BUF)
540 dev->stats.rx_length_errors++; 540 dev->stats.rx_length_errors++;
541 /* Packet too long */ 541 /* Packet too long */
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 5e403511289d..493b0de3848b 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -2685,9 +2685,9 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
2685 rtl8169_set_speed(dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL, 2685 rtl8169_set_speed(dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL,
2686 ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full | 2686 ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
2687 ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full | 2687 ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full |
2688 tp->mii.supports_gmii ? 2688 (tp->mii.supports_gmii ?
2689 ADVERTISED_1000baseT_Half | 2689 ADVERTISED_1000baseT_Half |
2690 ADVERTISED_1000baseT_Full : 0); 2690 ADVERTISED_1000baseT_Full : 0));
2691 2691
2692 if (RTL_R8(PHYstatus) & TBI_Enable) 2692 if (RTL_R8(PHYstatus) & TBI_Enable)
2693 netif_info(tp, link, dev, "TBI auto-negotiating\n"); 2693 netif_info(tp, link, dev, "TBI auto-negotiating\n");
diff --git a/drivers/net/rionet.c b/drivers/net/rionet.c
index 44150f2f7bfd..26afbaae23f0 100644
--- a/drivers/net/rionet.c
+++ b/drivers/net/rionet.c
@@ -382,7 +382,7 @@ static void rionet_remove(struct rio_dev *rdev)
382 struct rionet_peer *peer, *tmp; 382 struct rionet_peer *peer, *tmp;
383 383
384 free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ? 384 free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ?
385 __ilog2(sizeof(void *)) + 4 : 0); 385 __fls(sizeof(void *)) + 4 : 0);
386 unregister_netdev(ndev); 386 unregister_netdev(ndev);
387 free_netdev(ndev); 387 free_netdev(ndev);
388 388
@@ -450,7 +450,7 @@ static int rionet_setup_netdev(struct rio_mport *mport)
450 } 450 }
451 451
452 rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL, 452 rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
453 mport->sys_size ? __ilog2(sizeof(void *)) + 4 : 0); 453 mport->sys_size ? __fls(sizeof(void *)) + 4 : 0);
454 if (!rionet_active) { 454 if (!rionet_active) {
455 rc = -ENOMEM; 455 rc = -ENOMEM;
456 goto out; 456 goto out;
@@ -571,5 +571,5 @@ static void __exit rionet_exit(void)
571 rio_unregister_driver(&rionet_driver); 571 rio_unregister_driver(&rionet_driver);
572} 572}
573 573
574module_init(rionet_init); 574late_initcall(rionet_init);
575module_exit(rionet_exit); 575module_exit(rionet_exit);
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 2ad6364103ea..337bdcd5abc9 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -2353,7 +2353,7 @@ static int start_nic(struct s2io_nic *nic)
2353 2353
2354 if (s2io_link_fault_indication(nic) == MAC_RMAC_ERR_TIMER) { 2354 if (s2io_link_fault_indication(nic) == MAC_RMAC_ERR_TIMER) {
2355 /* 2355 /*
2356 * Dont see link state interrupts initally on some switches, 2356 * Dont see link state interrupts initially on some switches,
2357 * so directly scheduling the link state task here. 2357 * so directly scheduling the link state task here.
2358 */ 2358 */
2359 schedule_work(&nic->set_link_task); 2359 schedule_work(&nic->set_link_task);
@@ -3563,7 +3563,7 @@ static void s2io_reset(struct s2io_nic *sp)
3563 } 3563 }
3564 3564
3565 /* 3565 /*
3566 * Clear spurious ECC interrupts that would have occured on 3566 * Clear spurious ECC interrupts that would have occurred on
3567 * XFRAME II cards after reset. 3567 * XFRAME II cards after reset.
3568 */ 3568 */
3569 if (sp->device_type == XFRAME_II_DEVICE) { 3569 if (sp->device_type == XFRAME_II_DEVICE) {
@@ -4065,7 +4065,7 @@ static int s2io_close(struct net_device *dev)
4065 * Description : 4065 * Description :
4066 * This function is the Tx entry point of the driver. S2IO NIC supports 4066 * This function is the Tx entry point of the driver. S2IO NIC supports
4067 * certain protocol assist features on Tx side, namely CSO, S/G, LSO. 4067 * certain protocol assist features on Tx side, namely CSO, S/G, LSO.
4068 * NOTE: when device cant queue the pkt,just the trans_start variable will 4068 * NOTE: when device can't queue the pkt,just the trans_start variable will
4069 * not be upadted. 4069 * not be upadted.
4070 * Return value: 4070 * Return value:
4071 * 0 on success & 1 on failure. 4071 * 0 on success & 1 on failure.
@@ -6726,7 +6726,7 @@ static int s2io_ethtool_set_flags(struct net_device *dev, u32 data)
6726 int rc = 0; 6726 int rc = 0;
6727 int changed = 0; 6727 int changed = 0;
6728 6728
6729 if (data & ~ETH_FLAG_LRO) 6729 if (ethtool_invalid_flags(dev, data, ETH_FLAG_LRO))
6730 return -EINVAL; 6730 return -EINVAL;
6731 6731
6732 if (data & ETH_FLAG_LRO) { 6732 if (data & ETH_FLAG_LRO) {
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h
index 7d160306b651..2d144979f6f8 100644
--- a/drivers/net/s2io.h
+++ b/drivers/net/s2io.h
@@ -376,7 +376,7 @@ static const u16 fifo_selector[MAX_TX_FIFOS] = {0, 1, 3, 3, 7, 7, 7, 7};
376/* Maintains Per FIFO related information. */ 376/* Maintains Per FIFO related information. */
377struct tx_fifo_config { 377struct tx_fifo_config {
378#define MAX_AVAILABLE_TXDS 8192 378#define MAX_AVAILABLE_TXDS 8192
379 u32 fifo_len; /* specifies len of FIFO upto 8192, ie no of TxDLs */ 379 u32 fifo_len; /* specifies len of FIFO up to 8192, ie no of TxDLs */
380/* Priority definition */ 380/* Priority definition */
381#define TX_FIFO_PRI_0 0 /*Highest */ 381#define TX_FIFO_PRI_0 0 /*Highest */
382#define TX_FIFO_PRI_1 1 382#define TX_FIFO_PRI_1 1
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c
index b8bd936374f2..a3c2aab53de8 100644
--- a/drivers/net/sfc/efx.c
+++ b/drivers/net/sfc/efx.c
@@ -328,7 +328,8 @@ static int efx_poll(struct napi_struct *napi, int budget)
328 * processing to finish, then directly poll (and ack ) the eventq. 328 * processing to finish, then directly poll (and ack ) the eventq.
329 * Finally reenable NAPI and interrupts. 329 * Finally reenable NAPI and interrupts.
330 * 330 *
331 * Since we are touching interrupts the caller should hold the suspend lock 331 * This is for use only during a loopback self-test. It must not
332 * deliver any packets up the stack as this can result in deadlock.
332 */ 333 */
333void efx_process_channel_now(struct efx_channel *channel) 334void efx_process_channel_now(struct efx_channel *channel)
334{ 335{
@@ -336,6 +337,7 @@ void efx_process_channel_now(struct efx_channel *channel)
336 337
337 BUG_ON(channel->channel >= efx->n_channels); 338 BUG_ON(channel->channel >= efx->n_channels);
338 BUG_ON(!channel->enabled); 339 BUG_ON(!channel->enabled);
340 BUG_ON(!efx->loopback_selftest);
339 341
340 /* Disable interrupts and wait for ISRs to complete */ 342 /* Disable interrupts and wait for ISRs to complete */
341 efx_nic_disable_interrupts(efx); 343 efx_nic_disable_interrupts(efx);
@@ -1054,6 +1056,7 @@ static int efx_init_io(struct efx_nic *efx)
1054{ 1056{
1055 struct pci_dev *pci_dev = efx->pci_dev; 1057 struct pci_dev *pci_dev = efx->pci_dev;
1056 dma_addr_t dma_mask = efx->type->max_dma_mask; 1058 dma_addr_t dma_mask = efx->type->max_dma_mask;
1059 bool use_wc;
1057 int rc; 1060 int rc;
1058 1061
1059 netif_dbg(efx, probe, efx->net_dev, "initialising I/O\n"); 1062 netif_dbg(efx, probe, efx->net_dev, "initialising I/O\n");
@@ -1104,8 +1107,21 @@ static int efx_init_io(struct efx_nic *efx)
1104 rc = -EIO; 1107 rc = -EIO;
1105 goto fail3; 1108 goto fail3;
1106 } 1109 }
1107 efx->membase = ioremap_wc(efx->membase_phys, 1110
1108 efx->type->mem_map_size); 1111 /* bug22643: If SR-IOV is enabled then tx push over a write combined
1112 * mapping is unsafe. We need to disable write combining in this case.
1113 * MSI is unsupported when SR-IOV is enabled, and the firmware will
1114 * have removed the MSI capability. So write combining is safe if
1115 * there is an MSI capability.
1116 */
1117 use_wc = (!EFX_WORKAROUND_22643(efx) ||
1118 pci_find_capability(pci_dev, PCI_CAP_ID_MSI));
1119 if (use_wc)
1120 efx->membase = ioremap_wc(efx->membase_phys,
1121 efx->type->mem_map_size);
1122 else
1123 efx->membase = ioremap_nocache(efx->membase_phys,
1124 efx->type->mem_map_size);
1109 if (!efx->membase) { 1125 if (!efx->membase) {
1110 netif_err(efx, probe, efx->net_dev, 1126 netif_err(efx, probe, efx->net_dev,
1111 "could not map memory BAR at %llx+%x\n", 1127 "could not map memory BAR at %llx+%x\n",
@@ -1422,7 +1438,7 @@ static void efx_start_all(struct efx_nic *efx)
1422 * restart the transmit interface early so the watchdog timer stops */ 1438 * restart the transmit interface early so the watchdog timer stops */
1423 efx_start_port(efx); 1439 efx_start_port(efx);
1424 1440
1425 if (efx_dev_registered(efx)) 1441 if (efx_dev_registered(efx) && !efx->port_inhibited)
1426 netif_tx_wake_all_queues(efx->net_dev); 1442 netif_tx_wake_all_queues(efx->net_dev);
1427 1443
1428 efx_for_each_channel(channel, efx) 1444 efx_for_each_channel(channel, efx)
diff --git a/drivers/net/sfc/falcon.c b/drivers/net/sfc/falcon.c
index 734fcfb52e85..d96b23769bd1 100644
--- a/drivers/net/sfc/falcon.c
+++ b/drivers/net/sfc/falcon.c
@@ -692,7 +692,7 @@ static int falcon_gmii_wait(struct efx_nic *efx)
692 efx_oword_t md_stat; 692 efx_oword_t md_stat;
693 int count; 693 int count;
694 694
695 /* wait upto 50ms - taken max from datasheet */ 695 /* wait up to 50ms - taken max from datasheet */
696 for (count = 0; count < 5000; count++) { 696 for (count = 0; count < 5000; count++) {
697 efx_reado(efx, &md_stat, FR_AB_MD_STAT); 697 efx_reado(efx, &md_stat, FR_AB_MD_STAT);
698 if (EFX_OWORD_FIELD(md_stat, FRF_AB_MD_BSY) == 0) { 698 if (EFX_OWORD_FIELD(md_stat, FRF_AB_MD_BSY) == 0) {
@@ -1221,7 +1221,7 @@ static int falcon_reset_sram(struct efx_nic *efx)
1221 1221
1222 return 0; 1222 return 0;
1223 } 1223 }
1224 } while (++count < 20); /* wait upto 0.4 sec */ 1224 } while (++count < 20); /* wait up to 0.4 sec */
1225 1225
1226 netif_err(efx, hw, efx->net_dev, "timed out waiting for SRAM reset\n"); 1226 netif_err(efx, hw, efx->net_dev, "timed out waiting for SRAM reset\n");
1227 return -ETIMEDOUT; 1227 return -ETIMEDOUT;
diff --git a/drivers/net/sfc/io.h b/drivers/net/sfc/io.h
index d9d8c2ef1074..cc978803d484 100644
--- a/drivers/net/sfc/io.h
+++ b/drivers/net/sfc/io.h
@@ -152,6 +152,7 @@ static inline void efx_reado(struct efx_nic *efx, efx_oword_t *value,
152 152
153 spin_lock_irqsave(&efx->biu_lock, flags); 153 spin_lock_irqsave(&efx->biu_lock, flags);
154 value->u32[0] = _efx_readd(efx, reg + 0); 154 value->u32[0] = _efx_readd(efx, reg + 0);
155 rmb();
155 value->u32[1] = _efx_readd(efx, reg + 4); 156 value->u32[1] = _efx_readd(efx, reg + 4);
156 value->u32[2] = _efx_readd(efx, reg + 8); 157 value->u32[2] = _efx_readd(efx, reg + 8);
157 value->u32[3] = _efx_readd(efx, reg + 12); 158 value->u32[3] = _efx_readd(efx, reg + 12);
@@ -174,6 +175,7 @@ static inline void efx_sram_readq(struct efx_nic *efx, void __iomem *membase,
174 value->u64[0] = (__force __le64)__raw_readq(membase + addr); 175 value->u64[0] = (__force __le64)__raw_readq(membase + addr);
175#else 176#else
176 value->u32[0] = (__force __le32)__raw_readl(membase + addr); 177 value->u32[0] = (__force __le32)__raw_readl(membase + addr);
178 rmb();
177 value->u32[1] = (__force __le32)__raw_readl(membase + addr + 4); 179 value->u32[1] = (__force __le32)__raw_readl(membase + addr + 4);
178#endif 180#endif
179 spin_unlock_irqrestore(&efx->biu_lock, flags); 181 spin_unlock_irqrestore(&efx->biu_lock, flags);
diff --git a/drivers/net/sfc/mcdi.c b/drivers/net/sfc/mcdi.c
index 5e118f0d2479..d98479030ef2 100644
--- a/drivers/net/sfc/mcdi.c
+++ b/drivers/net/sfc/mcdi.c
@@ -453,7 +453,7 @@ static void efx_mcdi_ev_death(struct efx_nic *efx, int rc)
453 * 453 *
454 * There's a race here with efx_mcdi_rpc(), because we might receive 454 * There's a race here with efx_mcdi_rpc(), because we might receive
455 * a REBOOT event *before* the request has been copied out. In polled 455 * a REBOOT event *before* the request has been copied out. In polled
456 * mode (during startup) this is irrelevent, because efx_mcdi_complete() 456 * mode (during startup) this is irrelevant, because efx_mcdi_complete()
457 * is ignored. In event mode, this condition is just an edge-case of 457 * is ignored. In event mode, this condition is just an edge-case of
458 * receiving a REBOOT event after posting the MCDI request. Did the mc 458 * receiving a REBOOT event after posting the MCDI request. Did the mc
459 * reboot before or after the copyout? The best we can do always is 459 * reboot before or after the copyout? The best we can do always is
diff --git a/drivers/net/sfc/mcdi_pcol.h b/drivers/net/sfc/mcdi_pcol.h
index b86a15f221ad..41fe06fa0600 100644
--- a/drivers/net/sfc/mcdi_pcol.h
+++ b/drivers/net/sfc/mcdi_pcol.h
@@ -103,7 +103,7 @@
103 * 103 *
104 * If Code==CMDDONE, then the fields are further interpreted as: 104 * If Code==CMDDONE, then the fields are further interpreted as:
105 * 105 *
106 * - LEVEL==INFO Command succeded 106 * - LEVEL==INFO Command succeeded
107 * - LEVEL==ERR Command failed 107 * - LEVEL==ERR Command failed
108 * 108 *
109 * 0 8 16 24 32 109 * 0 8 16 24 32
@@ -572,7 +572,7 @@
572 (4*(_numwords)) 572 (4*(_numwords))
573 573
574/* MC_CMD_SET_RAND_SEED: 574/* MC_CMD_SET_RAND_SEED:
575 * Set the 16byte seed for the MC psuedo-random generator 575 * Set the 16byte seed for the MC pseudo-random generator
576 */ 576 */
577#define MC_CMD_SET_RAND_SEED 0x1a 577#define MC_CMD_SET_RAND_SEED 0x1a
578#define MC_CMD_SET_RAND_SEED_IN_LEN 16 578#define MC_CMD_SET_RAND_SEED_IN_LEN 16
@@ -1162,7 +1162,7 @@
1162#define MC_CMD_MAC_STATS_CMD_CLEAR_WIDTH 1 1162#define MC_CMD_MAC_STATS_CMD_CLEAR_WIDTH 1
1163#define MC_CMD_MAC_STATS_CMD_PERIODIC_CHANGE_LBN 2 1163#define MC_CMD_MAC_STATS_CMD_PERIODIC_CHANGE_LBN 2
1164#define MC_CMD_MAC_STATS_CMD_PERIODIC_CHANGE_WIDTH 1 1164#define MC_CMD_MAC_STATS_CMD_PERIODIC_CHANGE_WIDTH 1
1165/* Remaining PERIOD* fields only relevent when PERIODIC_CHANGE is set */ 1165/* Remaining PERIOD* fields only relevant when PERIODIC_CHANGE is set */
1166#define MC_CMD_MAC_STATS_CMD_PERIODIC_ENABLE_LBN 3 1166#define MC_CMD_MAC_STATS_CMD_PERIODIC_ENABLE_LBN 3
1167#define MC_CMD_MAC_STATS_CMD_PERIODIC_ENABLE_WIDTH 1 1167#define MC_CMD_MAC_STATS_CMD_PERIODIC_ENABLE_WIDTH 1
1168#define MC_CMD_MAC_STATS_CMD_PERIODIC_CLEAR_LBN 4 1168#define MC_CMD_MAC_STATS_CMD_PERIODIC_CLEAR_LBN 4
diff --git a/drivers/net/sfc/mcdi_phy.c b/drivers/net/sfc/mcdi_phy.c
index ec3f740f5465..7e3c65b0c99f 100644
--- a/drivers/net/sfc/mcdi_phy.c
+++ b/drivers/net/sfc/mcdi_phy.c
@@ -449,7 +449,7 @@ void efx_mcdi_phy_check_fcntl(struct efx_nic *efx, u32 lpa)
449 struct efx_mcdi_phy_data *phy_cfg = efx->phy_data; 449 struct efx_mcdi_phy_data *phy_cfg = efx->phy_data;
450 u32 rmtadv; 450 u32 rmtadv;
451 451
452 /* The link partner capabilities are only relevent if the 452 /* The link partner capabilities are only relevant if the
453 * link supports flow control autonegotiation */ 453 * link supports flow control autonegotiation */
454 if (~phy_cfg->supported_cap & (1 << MC_CMD_PHY_CAP_AN_LBN)) 454 if (~phy_cfg->supported_cap & (1 << MC_CMD_PHY_CAP_AN_LBN))
455 return; 455 return;
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h
index 215d5c51bfa0..191a311da2dc 100644
--- a/drivers/net/sfc/net_driver.h
+++ b/drivers/net/sfc/net_driver.h
@@ -330,7 +330,6 @@ enum efx_rx_alloc_method {
330 * @eventq_mask: Event queue pointer mask 330 * @eventq_mask: Event queue pointer mask
331 * @eventq_read_ptr: Event queue read pointer 331 * @eventq_read_ptr: Event queue read pointer
332 * @last_eventq_read_ptr: Last event queue read pointer value. 332 * @last_eventq_read_ptr: Last event queue read pointer value.
333 * @magic_count: Event queue test event count
334 * @irq_count: Number of IRQs since last adaptive moderation decision 333 * @irq_count: Number of IRQs since last adaptive moderation decision
335 * @irq_mod_score: IRQ moderation score 334 * @irq_mod_score: IRQ moderation score
336 * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors 335 * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors
@@ -360,7 +359,6 @@ struct efx_channel {
360 unsigned int eventq_mask; 359 unsigned int eventq_mask;
361 unsigned int eventq_read_ptr; 360 unsigned int eventq_read_ptr;
362 unsigned int last_eventq_read_ptr; 361 unsigned int last_eventq_read_ptr;
363 unsigned int magic_count;
364 362
365 unsigned int irq_count; 363 unsigned int irq_count;
366 unsigned int irq_mod_score; 364 unsigned int irq_mod_score;
@@ -670,7 +668,7 @@ struct efx_filter_state;
670 * @irq_zero_count: Number of legacy IRQs seen with queue flags == 0 668 * @irq_zero_count: Number of legacy IRQs seen with queue flags == 0
671 * @fatal_irq_level: IRQ level (bit number) used for serious errors 669 * @fatal_irq_level: IRQ level (bit number) used for serious errors
672 * @mtd_list: List of MTDs attached to the NIC 670 * @mtd_list: List of MTDs attached to the NIC
673 * @nic_data: Hardware dependant state 671 * @nic_data: Hardware dependent state
674 * @mac_lock: MAC access lock. Protects @port_enabled, @phy_mode, 672 * @mac_lock: MAC access lock. Protects @port_enabled, @phy_mode,
675 * @port_inhibited, efx_monitor() and efx_reconfigure_port() 673 * @port_inhibited, efx_monitor() and efx_reconfigure_port()
676 * @port_enabled: Port enabled indicator. 674 * @port_enabled: Port enabled indicator.
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c
index e8396614daf3..10f1cb79c147 100644
--- a/drivers/net/sfc/nic.c
+++ b/drivers/net/sfc/nic.c
@@ -84,7 +84,8 @@ static inline void efx_write_buf_tbl(struct efx_nic *efx, efx_qword_t *value,
84static inline efx_qword_t *efx_event(struct efx_channel *channel, 84static inline efx_qword_t *efx_event(struct efx_channel *channel,
85 unsigned int index) 85 unsigned int index)
86{ 86{
87 return ((efx_qword_t *) (channel->eventq.addr)) + index; 87 return ((efx_qword_t *) (channel->eventq.addr)) +
88 (index & channel->eventq_mask);
88} 89}
89 90
90/* See if an event is present 91/* See if an event is present
@@ -673,7 +674,8 @@ void efx_nic_eventq_read_ack(struct efx_channel *channel)
673 efx_dword_t reg; 674 efx_dword_t reg;
674 struct efx_nic *efx = channel->efx; 675 struct efx_nic *efx = channel->efx;
675 676
676 EFX_POPULATE_DWORD_1(reg, FRF_AZ_EVQ_RPTR, channel->eventq_read_ptr); 677 EFX_POPULATE_DWORD_1(reg, FRF_AZ_EVQ_RPTR,
678 channel->eventq_read_ptr & channel->eventq_mask);
677 efx_writed_table(efx, &reg, efx->type->evq_rptr_tbl_base, 679 efx_writed_table(efx, &reg, efx->type->evq_rptr_tbl_base,
678 channel->channel); 680 channel->channel);
679} 681}
@@ -908,7 +910,7 @@ efx_handle_generated_event(struct efx_channel *channel, efx_qword_t *event)
908 910
909 code = EFX_QWORD_FIELD(*event, FSF_AZ_DRV_GEN_EV_MAGIC); 911 code = EFX_QWORD_FIELD(*event, FSF_AZ_DRV_GEN_EV_MAGIC);
910 if (code == EFX_CHANNEL_MAGIC_TEST(channel)) 912 if (code == EFX_CHANNEL_MAGIC_TEST(channel))
911 ++channel->magic_count; 913 ; /* ignore */
912 else if (code == EFX_CHANNEL_MAGIC_FILL(channel)) 914 else if (code == EFX_CHANNEL_MAGIC_FILL(channel))
913 /* The queue must be empty, so we won't receive any rx 915 /* The queue must be empty, so we won't receive any rx
914 * events, so efx_process_channel() won't refill the 916 * events, so efx_process_channel() won't refill the
@@ -1015,8 +1017,7 @@ int efx_nic_process_eventq(struct efx_channel *channel, int budget)
1015 /* Clear this event by marking it all ones */ 1017 /* Clear this event by marking it all ones */
1016 EFX_SET_QWORD(*p_event); 1018 EFX_SET_QWORD(*p_event);
1017 1019
1018 /* Increment read pointer */ 1020 ++read_ptr;
1019 read_ptr = (read_ptr + 1) & channel->eventq_mask;
1020 1021
1021 ev_code = EFX_QWORD_FIELD(event, FSF_AZ_EV_CODE); 1022 ev_code = EFX_QWORD_FIELD(event, FSF_AZ_EV_CODE);
1022 1023
@@ -1060,6 +1061,13 @@ out:
1060 return spent; 1061 return spent;
1061} 1062}
1062 1063
1064/* Check whether an event is present in the eventq at the current
1065 * read pointer. Only useful for self-test.
1066 */
1067bool efx_nic_event_present(struct efx_channel *channel)
1068{
1069 return efx_event_present(efx_event(channel, channel->eventq_read_ptr));
1070}
1063 1071
1064/* Allocate buffer table entries for event queue */ 1072/* Allocate buffer table entries for event queue */
1065int efx_nic_probe_eventq(struct efx_channel *channel) 1073int efx_nic_probe_eventq(struct efx_channel *channel)
@@ -1165,7 +1173,7 @@ static void efx_poll_flush_events(struct efx_nic *efx)
1165 struct efx_tx_queue *tx_queue; 1173 struct efx_tx_queue *tx_queue;
1166 struct efx_rx_queue *rx_queue; 1174 struct efx_rx_queue *rx_queue;
1167 unsigned int read_ptr = channel->eventq_read_ptr; 1175 unsigned int read_ptr = channel->eventq_read_ptr;
1168 unsigned int end_ptr = (read_ptr - 1) & channel->eventq_mask; 1176 unsigned int end_ptr = read_ptr + channel->eventq_mask - 1;
1169 1177
1170 do { 1178 do {
1171 efx_qword_t *event = efx_event(channel, read_ptr); 1179 efx_qword_t *event = efx_event(channel, read_ptr);
@@ -1205,7 +1213,7 @@ static void efx_poll_flush_events(struct efx_nic *efx)
1205 * it's ok to throw away every non-flush event */ 1213 * it's ok to throw away every non-flush event */
1206 EFX_SET_QWORD(*event); 1214 EFX_SET_QWORD(*event);
1207 1215
1208 read_ptr = (read_ptr + 1) & channel->eventq_mask; 1216 ++read_ptr;
1209 } while (read_ptr != end_ptr); 1217 } while (read_ptr != end_ptr);
1210 1218
1211 channel->eventq_read_ptr = read_ptr; 1219 channel->eventq_read_ptr = read_ptr;
diff --git a/drivers/net/sfc/nic.h b/drivers/net/sfc/nic.h
index d9de1b647d41..a42db6e35be3 100644
--- a/drivers/net/sfc/nic.h
+++ b/drivers/net/sfc/nic.h
@@ -184,6 +184,7 @@ extern void efx_nic_fini_eventq(struct efx_channel *channel);
184extern void efx_nic_remove_eventq(struct efx_channel *channel); 184extern void efx_nic_remove_eventq(struct efx_channel *channel);
185extern int efx_nic_process_eventq(struct efx_channel *channel, int rx_quota); 185extern int efx_nic_process_eventq(struct efx_channel *channel, int rx_quota);
186extern void efx_nic_eventq_read_ack(struct efx_channel *channel); 186extern void efx_nic_eventq_read_ack(struct efx_channel *channel);
187extern bool efx_nic_event_present(struct efx_channel *channel);
187 188
188/* MAC/PHY */ 189/* MAC/PHY */
189extern void falcon_drain_tx_fifo(struct efx_nic *efx); 190extern void falcon_drain_tx_fifo(struct efx_nic *efx);
diff --git a/drivers/net/sfc/selftest.c b/drivers/net/sfc/selftest.c
index a0f49b348d62..50ad3bcaf68a 100644
--- a/drivers/net/sfc/selftest.c
+++ b/drivers/net/sfc/selftest.c
@@ -131,8 +131,6 @@ static int efx_test_chip(struct efx_nic *efx, struct efx_self_tests *tests)
131static int efx_test_interrupts(struct efx_nic *efx, 131static int efx_test_interrupts(struct efx_nic *efx,
132 struct efx_self_tests *tests) 132 struct efx_self_tests *tests)
133{ 133{
134 struct efx_channel *channel;
135
136 netif_dbg(efx, drv, efx->net_dev, "testing interrupts\n"); 134 netif_dbg(efx, drv, efx->net_dev, "testing interrupts\n");
137 tests->interrupt = -1; 135 tests->interrupt = -1;
138 136
@@ -140,15 +138,6 @@ static int efx_test_interrupts(struct efx_nic *efx,
140 efx->last_irq_cpu = -1; 138 efx->last_irq_cpu = -1;
141 smp_wmb(); 139 smp_wmb();
142 140
143 /* ACK each interrupting event queue. Receiving an interrupt due to
144 * traffic before a test event is raised is considered a pass */
145 efx_for_each_channel(channel, efx) {
146 if (channel->work_pending)
147 efx_process_channel_now(channel);
148 if (efx->last_irq_cpu >= 0)
149 goto success;
150 }
151
152 efx_nic_generate_interrupt(efx); 141 efx_nic_generate_interrupt(efx);
153 142
154 /* Wait for arrival of test interrupt. */ 143 /* Wait for arrival of test interrupt. */
@@ -173,13 +162,13 @@ static int efx_test_eventq_irq(struct efx_channel *channel,
173 struct efx_self_tests *tests) 162 struct efx_self_tests *tests)
174{ 163{
175 struct efx_nic *efx = channel->efx; 164 struct efx_nic *efx = channel->efx;
176 unsigned int magic_count, count; 165 unsigned int read_ptr, count;
177 166
178 tests->eventq_dma[channel->channel] = -1; 167 tests->eventq_dma[channel->channel] = -1;
179 tests->eventq_int[channel->channel] = -1; 168 tests->eventq_int[channel->channel] = -1;
180 tests->eventq_poll[channel->channel] = -1; 169 tests->eventq_poll[channel->channel] = -1;
181 170
182 magic_count = channel->magic_count; 171 read_ptr = channel->eventq_read_ptr;
183 channel->efx->last_irq_cpu = -1; 172 channel->efx->last_irq_cpu = -1;
184 smp_wmb(); 173 smp_wmb();
185 174
@@ -190,10 +179,7 @@ static int efx_test_eventq_irq(struct efx_channel *channel,
190 do { 179 do {
191 schedule_timeout_uninterruptible(HZ / 100); 180 schedule_timeout_uninterruptible(HZ / 100);
192 181
193 if (channel->work_pending) 182 if (ACCESS_ONCE(channel->eventq_read_ptr) != read_ptr)
194 efx_process_channel_now(channel);
195
196 if (channel->magic_count != magic_count)
197 goto eventq_ok; 183 goto eventq_ok;
198 } while (++count < 2); 184 } while (++count < 2);
199 185
@@ -211,8 +197,7 @@ static int efx_test_eventq_irq(struct efx_channel *channel,
211 } 197 }
212 198
213 /* Check to see if event was received even if interrupt wasn't */ 199 /* Check to see if event was received even if interrupt wasn't */
214 efx_process_channel_now(channel); 200 if (efx_nic_event_present(channel)) {
215 if (channel->magic_count != magic_count) {
216 netif_err(efx, drv, efx->net_dev, 201 netif_err(efx, drv, efx->net_dev,
217 "channel %d event was generated, but " 202 "channel %d event was generated, but "
218 "failed to trigger an interrupt\n", channel->channel); 203 "failed to trigger an interrupt\n", channel->channel);
@@ -770,6 +755,8 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
770 __efx_reconfigure_port(efx); 755 __efx_reconfigure_port(efx);
771 mutex_unlock(&efx->mac_lock); 756 mutex_unlock(&efx->mac_lock);
772 757
758 netif_tx_wake_all_queues(efx->net_dev);
759
773 return rc_test; 760 return rc_test;
774} 761}
775 762
diff --git a/drivers/net/sfc/tx.c b/drivers/net/sfc/tx.c
index 139801908217..d2c85dfdf3bf 100644
--- a/drivers/net/sfc/tx.c
+++ b/drivers/net/sfc/tx.c
@@ -435,7 +435,8 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index)
435 * queue state. */ 435 * queue state. */
436 smp_mb(); 436 smp_mb();
437 if (unlikely(netif_tx_queue_stopped(tx_queue->core_txq)) && 437 if (unlikely(netif_tx_queue_stopped(tx_queue->core_txq)) &&
438 likely(efx->port_enabled)) { 438 likely(efx->port_enabled) &&
439 likely(!efx->port_inhibited)) {
439 fill_level = tx_queue->insert_count - tx_queue->read_count; 440 fill_level = tx_queue->insert_count - tx_queue->read_count;
440 if (fill_level < EFX_TXQ_THRESHOLD(efx)) { 441 if (fill_level < EFX_TXQ_THRESHOLD(efx)) {
441 EFX_BUG_ON_PARANOID(!efx_dev_registered(efx)); 442 EFX_BUG_ON_PARANOID(!efx_dev_registered(efx));
diff --git a/drivers/net/sfc/workarounds.h b/drivers/net/sfc/workarounds.h
index e4dd3a7f304b..99ff11400cef 100644
--- a/drivers/net/sfc/workarounds.h
+++ b/drivers/net/sfc/workarounds.h
@@ -38,6 +38,8 @@
38#define EFX_WORKAROUND_15783 EFX_WORKAROUND_ALWAYS 38#define EFX_WORKAROUND_15783 EFX_WORKAROUND_ALWAYS
39/* Legacy interrupt storm when interrupt fifo fills */ 39/* Legacy interrupt storm when interrupt fifo fills */
40#define EFX_WORKAROUND_17213 EFX_WORKAROUND_SIENA 40#define EFX_WORKAROUND_17213 EFX_WORKAROUND_SIENA
41/* Write combining and sriov=enabled are incompatible */
42#define EFX_WORKAROUND_22643 EFX_WORKAROUND_SIENA
41 43
42/* Spurious parity errors in TSORT buffers */ 44/* Spurious parity errors in TSORT buffers */
43#define EFX_WORKAROUND_5129 EFX_WORKAROUND_FALCON_A 45#define EFX_WORKAROUND_5129 EFX_WORKAROUND_FALCON_A
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index f016e613a492..54415c7b84a2 100644
--- a/drivers/net/sgiseeq.c
+++ b/drivers/net/sgiseeq.c
@@ -33,7 +33,7 @@ static char *sgiseeqstr = "SGI Seeq8003";
33 * with that in mind, I've decided to make this driver look completely like a 33 * with that in mind, I've decided to make this driver look completely like a
34 * stupid Lance from a driver architecture perspective. Only difference is that 34 * stupid Lance from a driver architecture perspective. Only difference is that
35 * here our "ring buffer" looks and acts like a real Lance one does but is 35 * here our "ring buffer" looks and acts like a real Lance one does but is
36 * layed out like how the HPC DMA and the Seeq want it to. You'd be surprised 36 * laid out like how the HPC DMA and the Seeq want it to. You'd be surprised
37 * how a stupid idea like this can pay off in performance, not to mention 37 * how a stupid idea like this can pay off in performance, not to mention
38 * making this driver 2,000 times easier to write. ;-) 38 * making this driver 2,000 times easier to write. ;-)
39 */ 39 */
@@ -77,7 +77,7 @@ struct sgiseeq_tx_desc {
77}; 77};
78 78
79/* 79/*
80 * Warning: This structure is layed out in a certain way because HPC dma 80 * Warning: This structure is laid out in a certain way because HPC dma
81 * descriptors must be 8-byte aligned. So don't touch this without 81 * descriptors must be 8-byte aligned. So don't touch this without
82 * some care. 82 * some care.
83 */ 83 */
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index e9e7a530552c..8a72a979ee71 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -1875,7 +1875,7 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
1875 if (ret) 1875 if (ret)
1876 goto out_unregister; 1876 goto out_unregister;
1877 1877
1878 /* print device infomation */ 1878 /* print device information */
1879 pr_info("Base address at 0x%x, %pM, IRQ %d.\n", 1879 pr_info("Base address at 0x%x, %pM, IRQ %d.\n",
1880 (u32)ndev->base_addr, ndev->dev_addr, ndev->irq); 1880 (u32)ndev->base_addr, ndev->dev_addr, ndev->irq);
1881 1881
diff --git a/drivers/net/sis190.c b/drivers/net/sis190.c
index 3406ed870917..b436e007eea0 100644
--- a/drivers/net/sis190.c
+++ b/drivers/net/sis190.c
@@ -93,7 +93,7 @@ enum sis190_registers {
93 IntrStatus = 0x20, 93 IntrStatus = 0x20,
94 IntrMask = 0x24, 94 IntrMask = 0x24,
95 IntrControl = 0x28, 95 IntrControl = 0x28,
96 IntrTimer = 0x2c, // unused (Interupt Timer) 96 IntrTimer = 0x2c, // unused (Interrupt Timer)
97 PMControl = 0x30, // unused (Power Mgmt Control/Status) 97 PMControl = 0x30, // unused (Power Mgmt Control/Status)
98 rsv2 = 0x34, // reserved 98 rsv2 = 0x34, // reserved
99 ROMControl = 0x38, 99 ROMControl = 0x38,
@@ -234,7 +234,7 @@ enum _DescStatusBit {
234 RxSizeMask = 0x0000ffff 234 RxSizeMask = 0x0000ffff
235 /* 235 /*
236 * The asic could apparently do vlan, TSO, jumbo (sis191 only) and 236 * The asic could apparently do vlan, TSO, jumbo (sis191 only) and
237 * provide two (unused with Linux) Tx queues. No publically 237 * provide two (unused with Linux) Tx queues. No publicly
238 * available documentation alas. 238 * available documentation alas.
239 */ 239 */
240}; 240};
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c
index 84d4167eee9a..484f795a779d 100644
--- a/drivers/net/sis900.c
+++ b/drivers/net/sis900.c
@@ -240,7 +240,8 @@ static const struct ethtool_ops sis900_ethtool_ops;
240 * @net_dev: the net device to get address for 240 * @net_dev: the net device to get address for
241 * 241 *
242 * Older SiS900 and friends, use EEPROM to store MAC address. 242 * Older SiS900 and friends, use EEPROM to store MAC address.
243 * MAC address is read from read_eeprom() into @net_dev->dev_addr. 243 * MAC address is read from read_eeprom() into @net_dev->dev_addr and
244 * @net_dev->perm_addr.
244 */ 245 */
245 246
246static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_device *net_dev) 247static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_device *net_dev)
@@ -261,6 +262,9 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de
261 for (i = 0; i < 3; i++) 262 for (i = 0; i < 3; i++)
262 ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); 263 ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
263 264
265 /* Store MAC Address in perm_addr */
266 memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
267
264 return 1; 268 return 1;
265} 269}
266 270
@@ -271,7 +275,8 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de
271 * 275 *
272 * SiS630E model, use APC CMOS RAM to store MAC address. 276 * SiS630E model, use APC CMOS RAM to store MAC address.
273 * APC CMOS RAM is accessed through ISA bridge. 277 * APC CMOS RAM is accessed through ISA bridge.
274 * MAC address is read into @net_dev->dev_addr. 278 * MAC address is read into @net_dev->dev_addr and
279 * @net_dev->perm_addr.
275 */ 280 */
276 281
277static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev, 282static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
@@ -296,6 +301,10 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
296 outb(0x09 + i, 0x70); 301 outb(0x09 + i, 0x70);
297 ((u8 *)(net_dev->dev_addr))[i] = inb(0x71); 302 ((u8 *)(net_dev->dev_addr))[i] = inb(0x71);
298 } 303 }
304
305 /* Store MAC Address in perm_addr */
306 memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
307
299 pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40); 308 pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40);
300 pci_dev_put(isa_bridge); 309 pci_dev_put(isa_bridge);
301 310
@@ -310,7 +319,7 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
310 * 319 *
311 * SiS635 model, set MAC Reload Bit to load Mac address from APC 320 * SiS635 model, set MAC Reload Bit to load Mac address from APC
312 * to rfdr. rfdr is accessed through rfcr. MAC address is read into 321 * to rfdr. rfdr is accessed through rfcr. MAC address is read into
313 * @net_dev->dev_addr. 322 * @net_dev->dev_addr and @net_dev->perm_addr.
314 */ 323 */
315 324
316static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, 325static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
@@ -334,6 +343,9 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
334 *( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr); 343 *( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr);
335 } 344 }
336 345
346 /* Store MAC Address in perm_addr */
347 memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
348
337 /* enable packet filtering */ 349 /* enable packet filtering */
338 outl(rfcrSave | RFEN, rfcr + ioaddr); 350 outl(rfcrSave | RFEN, rfcr + ioaddr);
339 351
@@ -353,7 +365,7 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
353 * EEDONE signal to refuse EEPROM access by LAN. 365 * EEDONE signal to refuse EEPROM access by LAN.
354 * The EEPROM map of SiS962 or SiS963 is different to SiS900. 366 * The EEPROM map of SiS962 or SiS963 is different to SiS900.
355 * The signature field in SiS962 or SiS963 spec is meaningless. 367 * The signature field in SiS962 or SiS963 spec is meaningless.
356 * MAC address is read into @net_dev->dev_addr. 368 * MAC address is read into @net_dev->dev_addr and @net_dev->perm_addr.
357 */ 369 */
358 370
359static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev, 371static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev,
@@ -372,6 +384,9 @@ static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev,
372 for (i = 0; i < 3; i++) 384 for (i = 0; i < 3; i++)
373 ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr); 385 ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
374 386
387 /* Store MAC Address in perm_addr */
388 memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
389
375 outl(EEDONE, ee_addr); 390 outl(EEDONE, ee_addr);
376 return 1; 391 return 1;
377 } else { 392 } else {
@@ -1180,7 +1195,7 @@ sis900_init_rx_ring(struct net_device *net_dev)
1180 * 1195 *
1181 * 630E equalizer workaround rule(Cyrus Huang 08/15) 1196 * 630E equalizer workaround rule(Cyrus Huang 08/15)
1182 * PHY register 14h(Test) 1197 * PHY register 14h(Test)
1183 * Bit 14: 0 -- Automatically dectect (default) 1198 * Bit 14: 0 -- Automatically detect (default)
1184 * 1 -- Manually set Equalizer filter 1199 * 1 -- Manually set Equalizer filter
1185 * Bit 13: 0 -- (Default) 1200 * Bit 13: 0 -- (Default)
1186 * 1 -- Speed up convergence of equalizer setting 1201 * 1 -- Speed up convergence of equalizer setting
@@ -1192,7 +1207,7 @@ sis900_init_rx_ring(struct net_device *net_dev)
1192 * Then set equalizer value, and set Bit 14 to 1, Bit 9 to 0 1207 * Then set equalizer value, and set Bit 14 to 1, Bit 9 to 0
1193 * Link Off:Set Bit 13 to 1, Bit 14 to 0 1208 * Link Off:Set Bit 13 to 1, Bit 14 to 0
1194 * Calculate Equalizer value: 1209 * Calculate Equalizer value:
1195 * When Link is ON and Bit 14 is 0, SIS900PHY will auto-dectect proper equalizer value. 1210 * When Link is ON and Bit 14 is 0, SIS900PHY will auto-detect proper equalizer value.
1196 * When the equalizer is stable, this value is not a fixed value. It will be within 1211 * When the equalizer is stable, this value is not a fixed value. It will be within
1197 * a small range(eg. 7~9). Then we get a minimum and a maximum value(eg. min=7, max=9) 1212 * a small range(eg. 7~9). Then we get a minimum and a maximum value(eg. min=7, max=9)
1198 * 0 <= max <= 4 --> set equalizer to max 1213 * 0 <= max <= 4 --> set equalizer to max
@@ -1723,7 +1738,7 @@ static int sis900_rx(struct net_device *net_dev)
1723 rx_size = data_size - CRC_SIZE; 1738 rx_size = data_size - CRC_SIZE;
1724 1739
1725#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 1740#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
1726 /* ``TOOLONG'' flag means jumbo packet recived. */ 1741 /* ``TOOLONG'' flag means jumbo packet received. */
1727 if ((rx_status & TOOLONG) && data_size <= MAX_FRAME_SIZE) 1742 if ((rx_status & TOOLONG) && data_size <= MAX_FRAME_SIZE)
1728 rx_status &= (~ ((unsigned int)TOOLONG)); 1743 rx_status &= (~ ((unsigned int)TOOLONG));
1729#endif 1744#endif
diff --git a/drivers/net/skfp/Makefile b/drivers/net/skfp/Makefile
index cb23580fcffa..b0be0234abf6 100644
--- a/drivers/net/skfp/Makefile
+++ b/drivers/net/skfp/Makefile
@@ -17,4 +17,4 @@ skfp-objs := skfddi.o hwmtm.o fplustm.o smt.o cfm.o \
17# projects. To keep the source common for all those drivers (and 17# projects. To keep the source common for all those drivers (and
18# thus simplify fixes to it), please do not clean it up! 18# thus simplify fixes to it), please do not clean it up!
19 19
20EXTRA_CFLAGS += -Idrivers/net/skfp -DPCI -DMEM_MAPPED_IO -Wno-strict-prototypes 20ccflags-y := -Idrivers/net/skfp -DPCI -DMEM_MAPPED_IO -Wno-strict-prototypes
diff --git a/drivers/net/skfp/ess.c b/drivers/net/skfp/ess.c
index 8639a0884f5c..2fc5987b41dc 100644
--- a/drivers/net/skfp/ess.c
+++ b/drivers/net/skfp/ess.c
@@ -241,7 +241,7 @@ int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
241 != SMT_RDF_SUCCESS) || 241 != SMT_RDF_SUCCESS) ||
242 (sm->smt_tid != smc->ess.alloc_trans_id)) { 242 (sm->smt_tid != smc->ess.alloc_trans_id)) {
243 243
244 DB_ESS("ESS: Allocation Responce not accepted\n",0,0) ; 244 DB_ESS("ESS: Allocation Response not accepted\n",0,0) ;
245 return fs; 245 return fs;
246 } 246 }
247 247
@@ -393,7 +393,7 @@ static int process_bw_alloc(struct s_smc *smc, long int payload, long int overhe
393 * | T-NEG | 393 * | T-NEG |
394 * - - 394 * - -
395 * 395 *
396 * T-NEG is discribed by the equation: 396 * T-NEG is described by the equation:
397 * 397 *
398 * (-) fddiMACT-NEG 398 * (-) fddiMACT-NEG
399 * T-NEG = ------------------- 399 * T-NEG = -------------------
@@ -479,7 +479,7 @@ static void ess_send_response(struct s_smc *smc, struct smt_header *sm,
479 void *p ; 479 void *p ;
480 480
481 /* 481 /*
482 * get and initialize the responce frame 482 * get and initialize the response frame
483 */ 483 */
484 if (sba_cmd == CHANGE_ALLOCATION) { 484 if (sba_cmd == CHANGE_ALLOCATION) {
485 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REPLY, 485 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REPLY,
@@ -578,7 +578,7 @@ static void ess_send_alc_req(struct s_smc *smc)
578 } 578 }
579 579
580 /* 580 /*
581 * get and initialize the responce frame 581 * get and initialize the response frame
582 */ 582 */
583 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REQUEST, 583 if (!(mb=smt_build_frame(smc,SMT_RAF,SMT_REQUEST,
584 sizeof(struct smt_sba_alc_req)))) 584 sizeof(struct smt_sba_alc_req))))
diff --git a/drivers/net/skfp/fplustm.c b/drivers/net/skfp/fplustm.c
index ca4e7bb6a5a8..a20ed1a98099 100644
--- a/drivers/net/skfp/fplustm.c
+++ b/drivers/net/skfp/fplustm.c
@@ -340,7 +340,7 @@ static void mac_counter_init(struct s_smc *smc)
340 outpw(FM_A(FM_LCNTR),0) ; 340 outpw(FM_A(FM_LCNTR),0) ;
341 outpw(FM_A(FM_ECNTR),0) ; 341 outpw(FM_A(FM_ECNTR),0) ;
342 /* 342 /*
343 * clear internal error counter stucture 343 * clear internal error counter structure
344 */ 344 */
345 ec = (u_long *)&smc->hw.fp.err_stats ; 345 ec = (u_long *)&smc->hw.fp.err_stats ;
346 for (i = (sizeof(struct err_st)/sizeof(long)) ; i ; i--) 346 for (i = (sizeof(struct err_st)/sizeof(long)) ; i ; i--)
@@ -1262,8 +1262,8 @@ Function DOWNCALL/INTERN (SMT, fplustm.c)
1262 1262
1263Para mode = 1 RX_ENABLE_ALLMULTI enable all multicasts 1263Para mode = 1 RX_ENABLE_ALLMULTI enable all multicasts
1264 2 RX_DISABLE_ALLMULTI disable "enable all multicasts" 1264 2 RX_DISABLE_ALLMULTI disable "enable all multicasts"
1265 3 RX_ENABLE_PROMISC enable promiscous 1265 3 RX_ENABLE_PROMISC enable promiscuous
1266 4 RX_DISABLE_PROMISC disable promiscous 1266 4 RX_DISABLE_PROMISC disable promiscuous
1267 5 RX_ENABLE_NSA enable reception of NSA frames 1267 5 RX_ENABLE_NSA enable reception of NSA frames
1268 6 RX_DISABLE_NSA disable reception of NSA frames 1268 6 RX_DISABLE_NSA disable reception of NSA frames
1269 1269
diff --git a/drivers/net/skfp/h/cmtdef.h b/drivers/net/skfp/h/cmtdef.h
index f2f771d8be76..5a6c6122ccb0 100644
--- a/drivers/net/skfp/h/cmtdef.h
+++ b/drivers/net/skfp/h/cmtdef.h
@@ -19,7 +19,7 @@
19 19
20/* 20/*
21 * implementation specific constants 21 * implementation specific constants
22 * MODIIFY THE FOLLWOING THREE DEFINES 22 * MODIIFY THE FOLLOWING THREE DEFINES
23 */ 23 */
24#define AMDPLC /* if Amd PLC chip used */ 24#define AMDPLC /* if Amd PLC chip used */
25#ifdef CONC 25#ifdef CONC
@@ -456,7 +456,7 @@ struct s_plc {
456 u_long soft_err ; /* error counter */ 456 u_long soft_err ; /* error counter */
457 u_long parity_err ; /* error counter */ 457 u_long parity_err ; /* error counter */
458 u_long ebuf_err ; /* error counter */ 458 u_long ebuf_err ; /* error counter */
459 u_long ebuf_cont ; /* continous error counter */ 459 u_long ebuf_cont ; /* continuous error counter */
460 u_long phyinv ; /* error counter */ 460 u_long phyinv ; /* error counter */
461 u_long vsym_ctr ; /* error counter */ 461 u_long vsym_ctr ; /* error counter */
462 u_long mini_ctr ; /* error counter */ 462 u_long mini_ctr ; /* error counter */
diff --git a/drivers/net/skfp/h/fplustm.h b/drivers/net/skfp/h/fplustm.h
index 6d738e1e2393..d43191ed938b 100644
--- a/drivers/net/skfp/h/fplustm.h
+++ b/drivers/net/skfp/h/fplustm.h
@@ -237,8 +237,8 @@ struct s_smt_fp {
237 */ 237 */
238#define RX_ENABLE_ALLMULTI 1 /* enable all multicasts */ 238#define RX_ENABLE_ALLMULTI 1 /* enable all multicasts */
239#define RX_DISABLE_ALLMULTI 2 /* disable "enable all multicasts" */ 239#define RX_DISABLE_ALLMULTI 2 /* disable "enable all multicasts" */
240#define RX_ENABLE_PROMISC 3 /* enable promiscous */ 240#define RX_ENABLE_PROMISC 3 /* enable promiscuous */
241#define RX_DISABLE_PROMISC 4 /* disable promiscous */ 241#define RX_DISABLE_PROMISC 4 /* disable promiscuous */
242#define RX_ENABLE_NSA 5 /* enable reception of NSA frames */ 242#define RX_ENABLE_NSA 5 /* enable reception of NSA frames */
243#define RX_DISABLE_NSA 6 /* disable reception of NSA frames */ 243#define RX_DISABLE_NSA 6 /* disable reception of NSA frames */
244 244
diff --git a/drivers/net/skfp/h/smc.h b/drivers/net/skfp/h/smc.h
index 026a83b9f743..c774a95902f5 100644
--- a/drivers/net/skfp/h/smc.h
+++ b/drivers/net/skfp/h/smc.h
@@ -388,7 +388,7 @@ struct smt_config {
388 u_long rmt_t_poll ; /* RMT : claim/beacon poller */ 388 u_long rmt_t_poll ; /* RMT : claim/beacon poller */
389 u_long rmt_dup_mac_behavior ; /* Flag for the beavior of SMT if 389 u_long rmt_dup_mac_behavior ; /* Flag for the beavior of SMT if
390 * a Duplicate MAC Address was detected. 390 * a Duplicate MAC Address was detected.
391 * FALSE: SMT will leave finaly the ring 391 * FALSE: SMT will leave finally the ring
392 * TRUE: SMT will reinstert into the ring 392 * TRUE: SMT will reinstert into the ring
393 */ 393 */
394 u_long mac_d_max ; /* MAC : D_Max timer value */ 394 u_long mac_d_max ; /* MAC : D_Max timer value */
diff --git a/drivers/net/skfp/h/smt.h b/drivers/net/skfp/h/smt.h
index 2976757a36fb..2030f9cbb24b 100644
--- a/drivers/net/skfp/h/smt.h
+++ b/drivers/net/skfp/h/smt.h
@@ -793,7 +793,7 @@ struct smt_rdf {
793} ; 793} ;
794 794
795/* 795/*
796 * SBA Request Allocation Responce Frame 796 * SBA Request Allocation Response Frame
797 */ 797 */
798struct smt_sba_alc_res { 798struct smt_sba_alc_res {
799 struct smt_header smt ; /* generic header */ 799 struct smt_header smt ; /* generic header */
diff --git a/drivers/net/skfp/h/supern_2.h b/drivers/net/skfp/h/supern_2.h
index 5ba0b8306753..0b73690280f6 100644
--- a/drivers/net/skfp/h/supern_2.h
+++ b/drivers/net/skfp/h/supern_2.h
@@ -14,7 +14,7 @@
14 14
15/* 15/*
16 defines for AMD Supernet II chip set 16 defines for AMD Supernet II chip set
17 the chips are refered to as 17 the chips are referred to as
18 FPLUS Formac Plus 18 FPLUS Formac Plus
19 PLC Physical Layer 19 PLC Physical Layer
20 20
@@ -386,7 +386,7 @@ struct tx_queue {
386#define FM_MDISRCV (4<<8) /* disable receive function */ 386#define FM_MDISRCV (4<<8) /* disable receive function */
387#define FM_MRES0 (5<<8) /* reserve */ 387#define FM_MRES0 (5<<8) /* reserve */
388#define FM_MLIMPROM (6<<8) /* limited-promiscuous mode */ 388#define FM_MLIMPROM (6<<8) /* limited-promiscuous mode */
389#define FM_MPROMISCOUS (7<<8) /* address detection : promiscous */ 389#define FM_MPROMISCOUS (7<<8) /* address detection : promiscuous */
390 390
391#define FM_SELSA 0x0800 /* select-short-address bit */ 391#define FM_SELSA 0x0800 /* select-short-address bit */
392 392
diff --git a/drivers/net/skfp/hwmtm.c b/drivers/net/skfp/hwmtm.c
index af5a755e269d..e26398b5a7dc 100644
--- a/drivers/net/skfp/hwmtm.c
+++ b/drivers/net/skfp/hwmtm.c
@@ -691,7 +691,7 @@ static u_long repair_rxd_ring(struct s_smc *smc, struct s_smt_rx_queue *queue)
691 * interrupt service routine, handles the interrupt requests 691 * interrupt service routine, handles the interrupt requests
692 * generated by the FDDI adapter. 692 * generated by the FDDI adapter.
693 * 693 *
694 * NOTE: The operating system dependent module must garantee that the 694 * NOTE: The operating system dependent module must guarantee that the
695 * interrupts of the adapter are disabled when it calls fddi_isr. 695 * interrupts of the adapter are disabled when it calls fddi_isr.
696 * 696 *
697 * About the USE_BREAK_ISR mechanismn: 697 * About the USE_BREAK_ISR mechanismn:
diff --git a/drivers/net/skfp/pcmplc.c b/drivers/net/skfp/pcmplc.c
index 112d35b1bf0e..88d02d0a42c4 100644
--- a/drivers/net/skfp/pcmplc.c
+++ b/drivers/net/skfp/pcmplc.c
@@ -1680,7 +1680,7 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
1680 * Prevent counter from being wrapped after 1680 * Prevent counter from being wrapped after
1681 * hanging years in that interrupt. 1681 * hanging years in that interrupt.
1682 */ 1682 */
1683 plc->ebuf_cont++ ; /* Ebuf continous error */ 1683 plc->ebuf_cont++ ; /* Ebuf continuous error */
1684 } 1684 }
1685 1685
1686#ifdef SUPERNET_3 1686#ifdef SUPERNET_3
@@ -1717,8 +1717,8 @@ void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
1717 } 1717 }
1718#endif /* SUPERNET_3 */ 1718#endif /* SUPERNET_3 */
1719 } else { 1719 } else {
1720 /* Reset the continous error variable */ 1720 /* Reset the continuous error variable */
1721 plc->ebuf_cont = 0 ; /* reset Ebuf continous error */ 1721 plc->ebuf_cont = 0 ; /* reset Ebuf continuous error */
1722 } 1722 }
1723 if (cmd & PL_PHYINV) { /* physical layer invalid signal */ 1723 if (cmd & PL_PHYINV) { /* physical layer invalid signal */
1724 plc->phyinv++ ; 1724 plc->phyinv++ ;
diff --git a/drivers/net/skfp/smt.c b/drivers/net/skfp/smt.c
index 1e1bd0c201c8..08d94329c12f 100644
--- a/drivers/net/skfp/smt.c
+++ b/drivers/net/skfp/smt.c
@@ -219,7 +219,7 @@ void smt_emulate_token_ct(struct s_smc *smc, int mac_index)
219 219
220 /* 220 /*
221 * Only when ring is up we will have a token count. The 221 * Only when ring is up we will have a token count. The
222 * flag is unfortunatly a single instance value. This 222 * flag is unfortunately a single instance value. This
223 * doesn't matter now, because we currently have only 223 * doesn't matter now, because we currently have only
224 * one MAC instance. 224 * one MAC instance.
225 */ 225 */
diff --git a/drivers/net/skge.h b/drivers/net/skge.h
index 507addcaffa3..51c0214ac25c 100644
--- a/drivers/net/skge.h
+++ b/drivers/net/skge.h
@@ -1038,7 +1038,7 @@ enum {
1038 1038
1039 PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */ 1039 PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */
1040 PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */ 1040 PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */
1041 PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occured */ 1041 PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occurred */
1042 PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */ 1042 PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */
1043 PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */ 1043 PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */
1044 PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */ 1044 PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */
@@ -1721,8 +1721,8 @@ enum {
1721 GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */ 1721 GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */
1722 GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */ 1722 GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */
1723 GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */ 1723 GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */
1724 GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occured */ 1724 GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occurred */
1725 GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occured */ 1725 GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occurred */
1726 1726
1727 GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */ 1727 GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */
1728 GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */ 1728 GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */
@@ -2227,7 +2227,7 @@ enum {
2227 XM_ST_BC = 1<<7, /* Bit 7: Broadcast packet */ 2227 XM_ST_BC = 1<<7, /* Bit 7: Broadcast packet */
2228 XM_ST_MC = 1<<6, /* Bit 6: Multicast packet */ 2228 XM_ST_MC = 1<<6, /* Bit 6: Multicast packet */
2229 XM_ST_UC = 1<<5, /* Bit 5: Unicast packet */ 2229 XM_ST_UC = 1<<5, /* Bit 5: Unicast packet */
2230 XM_ST_TX_UR = 1<<4, /* Bit 4: FIFO Underrun occured */ 2230 XM_ST_TX_UR = 1<<4, /* Bit 4: FIFO Underrun occurred */
2231 XM_ST_CS_ERR = 1<<3, /* Bit 3: Carrier Sense Error */ 2231 XM_ST_CS_ERR = 1<<3, /* Bit 3: Carrier Sense Error */
2232 XM_ST_LAT_COL = 1<<2, /* Bit 2: Late Collision Error */ 2232 XM_ST_LAT_COL = 1<<2, /* Bit 2: Late Collision Error */
2233 XM_ST_MUL_COL = 1<<1, /* Bit 1: Multiple Collisions */ 2233 XM_ST_MUL_COL = 1<<1, /* Bit 1: Multiple Collisions */
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 2a91868788f7..ff8d262dc276 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -932,7 +932,7 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
932 sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); 932 sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR);
933 sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); 933 sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON);
934 934
935 /* On chips without ram buffer, pause is controled by MAC level */ 935 /* On chips without ram buffer, pause is controlled by MAC level */
936 if (!(hw->flags & SKY2_HW_RAM_BUFFER)) { 936 if (!(hw->flags & SKY2_HW_RAM_BUFFER)) {
937 /* Pause threshold is scaled by 8 in bytes */ 937 /* Pause threshold is scaled by 8 in bytes */
938 if (hw->chip_id == CHIP_ID_YUKON_FE_P && 938 if (hw->chip_id == CHIP_ID_YUKON_FE_P &&
@@ -3255,7 +3255,7 @@ static void sky2_reset(struct sky2_hw *hw)
3255 3255
3256/* Take device down (offline). 3256/* Take device down (offline).
3257 * Equivalent to doing dev_stop() but this does not 3257 * Equivalent to doing dev_stop() but this does not
3258 * inform upper layers of the transistion. 3258 * inform upper layers of the transition.
3259 */ 3259 */
3260static void sky2_detach(struct net_device *dev) 3260static void sky2_detach(struct net_device *dev)
3261{ 3261{
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 6861b0e8db9a..0c6d10c5f053 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -1194,7 +1194,7 @@ enum {
1194 1194
1195 PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */ 1195 PHY_ST_PRE_SUP = 1<<6, /* Bit 6: Preamble Suppression */
1196 PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */ 1196 PHY_ST_AN_OVER = 1<<5, /* Bit 5: Auto-Negotiation Over */
1197 PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occured */ 1197 PHY_ST_REM_FLT = 1<<4, /* Bit 4: Remote Fault Condition Occurred */
1198 PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */ 1198 PHY_ST_AN_CAP = 1<<3, /* Bit 3: Auto-Negotiation Capability */
1199 PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */ 1199 PHY_ST_LSYNC = 1<<2, /* Bit 2: Link Synchronized */
1200 PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */ 1200 PHY_ST_JAB_DET = 1<<1, /* Bit 1: Jabber Detected */
@@ -1725,8 +1725,8 @@ enum {
1725 GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */ 1725 GM_GPSR_LINK_UP = 1<<12, /* Bit 12: Link Up Status */
1726 GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */ 1726 GM_GPSR_PAUSE = 1<<11, /* Bit 11: Pause State */
1727 GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */ 1727 GM_GPSR_TX_ACTIVE = 1<<10, /* Bit 10: Tx in Progress */
1728 GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occured */ 1728 GM_GPSR_EXC_COL = 1<<9, /* Bit 9: Excessive Collisions Occurred */
1729 GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occured */ 1729 GM_GPSR_LAT_COL = 1<<8, /* Bit 8: Late Collisions Occurred */
1730 1730
1731 GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */ 1731 GM_GPSR_PHY_ST_CH = 1<<5, /* Bit 5: PHY Status Change */
1732 GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */ 1732 GM_GPSR_GIG_SPEED = 1<<4, /* Bit 4: Gigabit Speed (1 = 1000 Mbps) */
diff --git a/drivers/net/smc91x.h b/drivers/net/smc91x.h
index 68d48ab6eacf..5f53fbbf67be 100644
--- a/drivers/net/smc91x.h
+++ b/drivers/net/smc91x.h
@@ -921,7 +921,7 @@ static const char * chip_ids[ 16 ] = {
921 * Hack Alert: Some setups just can't write 8 or 16 bits reliably when not 921 * Hack Alert: Some setups just can't write 8 or 16 bits reliably when not
922 * aligned to a 32 bit boundary. I tell you that does exist! 922 * aligned to a 32 bit boundary. I tell you that does exist!
923 * Fortunately the affected register accesses can be easily worked around 923 * Fortunately the affected register accesses can be easily worked around
924 * since we can write zeroes to the preceeding 16 bits without adverse 924 * since we can write zeroes to the preceding 16 bits without adverse
925 * effects and use a 32-bit access. 925 * effects and use a 32-bit access.
926 * 926 *
927 * Enforce it on any 32-bit capable setup for now. 927 * Enforce it on any 32-bit capable setup for now.
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
index 1566259c1f27..4b42ecc63dcf 100644
--- a/drivers/net/smsc911x.c
+++ b/drivers/net/smsc911x.c
@@ -1669,7 +1669,7 @@ static int smsc911x_eeprom_send_cmd(struct smsc911x_data *pdata, u32 op)
1669 } 1669 }
1670 1670
1671 if (e2cmd & E2P_CMD_EPC_TIMEOUT_) { 1671 if (e2cmd & E2P_CMD_EPC_TIMEOUT_) {
1672 SMSC_TRACE(DRV, "Error occured during eeprom operation"); 1672 SMSC_TRACE(DRV, "Error occurred during eeprom operation");
1673 return -EINVAL; 1673 return -EINVAL;
1674 } 1674 }
1675 1675
@@ -1818,6 +1818,7 @@ static int __devinit smsc911x_init(struct net_device *dev)
1818 SMSC_TRACE(PROBE, "PHY will be autodetected."); 1818 SMSC_TRACE(PROBE, "PHY will be autodetected.");
1819 1819
1820 spin_lock_init(&pdata->dev_lock); 1820 spin_lock_init(&pdata->dev_lock);
1821 spin_lock_init(&pdata->mac_lock);
1821 1822
1822 if (pdata->ioaddr == 0) { 1823 if (pdata->ioaddr == 0) {
1823 SMSC_WARNING(PROBE, "pdata->ioaddr: 0x00000000"); 1824 SMSC_WARNING(PROBE, "pdata->ioaddr: 0x00000000");
@@ -1895,8 +1896,11 @@ static int __devinit smsc911x_init(struct net_device *dev)
1895 /* workaround for platforms without an eeprom, where the mac address 1896 /* workaround for platforms without an eeprom, where the mac address
1896 * is stored elsewhere and set by the bootloader. This saves the 1897 * is stored elsewhere and set by the bootloader. This saves the
1897 * mac address before resetting the device */ 1898 * mac address before resetting the device */
1898 if (pdata->config.flags & SMSC911X_SAVE_MAC_ADDRESS) 1899 if (pdata->config.flags & SMSC911X_SAVE_MAC_ADDRESS) {
1900 spin_lock_irq(&pdata->mac_lock);
1899 smsc911x_read_mac_address(dev); 1901 smsc911x_read_mac_address(dev);
1902 spin_unlock_irq(&pdata->mac_lock);
1903 }
1900 1904
1901 /* Reset the LAN911x */ 1905 /* Reset the LAN911x */
1902 if (smsc911x_soft_reset(pdata)) 1906 if (smsc911x_soft_reset(pdata))
@@ -2059,8 +2063,6 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
2059 SMSC_TRACE(PROBE, "Network interface: \"%s\"", dev->name); 2063 SMSC_TRACE(PROBE, "Network interface: \"%s\"", dev->name);
2060 } 2064 }
2061 2065
2062 spin_lock_init(&pdata->mac_lock);
2063
2064 retval = smsc911x_mii_init(pdev, dev); 2066 retval = smsc911x_mii_init(pdev, dev);
2065 if (retval) { 2067 if (retval) {
2066 SMSC_WARNING(PROBE, 2068 SMSC_WARNING(PROBE,
diff --git a/drivers/net/smsc9420.c b/drivers/net/smsc9420.c
index b09ee1c319e8..4c92ad8be765 100644
--- a/drivers/net/smsc9420.c
+++ b/drivers/net/smsc9420.c
@@ -364,7 +364,7 @@ static int smsc9420_eeprom_send_cmd(struct smsc9420_pdata *pd, u32 op)
364 } 364 }
365 365
366 if (e2cmd & E2P_CMD_EPC_TIMEOUT_) { 366 if (e2cmd & E2P_CMD_EPC_TIMEOUT_) {
367 smsc_info(HW, "Error occured during eeprom operation"); 367 smsc_info(HW, "Error occurred during eeprom operation");
368 return -EINVAL; 368 return -EINVAL;
369 } 369 }
370 370
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index a4f2bd52e546..36045f3b0327 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -144,11 +144,7 @@ static int full_duplex[MAX_UNITS] = {0, };
144/* Time in jiffies before concluding the transmitter is hung. */ 144/* Time in jiffies before concluding the transmitter is hung. */
145#define TX_TIMEOUT (2 * HZ) 145#define TX_TIMEOUT (2 * HZ)
146 146
147/* 147#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
148 * This SUCKS.
149 * We need a much better method to determine if dma_addr_t is 64-bit.
150 */
151#if (defined(__i386__) && defined(CONFIG_HIGHMEM64G)) || defined(__x86_64__) || defined (__ia64__) || defined(__alpha__) || (defined(CONFIG_MIPS) && ((defined(CONFIG_HIGHMEM) && defined(CONFIG_64BIT_PHYS_ADDR)) || defined(CONFIG_64BIT))) || (defined(__powerpc64__) || defined(CONFIG_PHYS_64BIT))
152/* 64-bit dma_addr_t */ 148/* 64-bit dma_addr_t */
153#define ADDR_64BITS /* This chip uses 64 bit addresses. */ 149#define ADDR_64BITS /* This chip uses 64 bit addresses. */
154#define netdrv_addr_t __le64 150#define netdrv_addr_t __le64
diff --git a/drivers/net/stmmac/dwmac_lib.c b/drivers/net/stmmac/dwmac_lib.c
index d65fab1ba790..e25093510b0c 100644
--- a/drivers/net/stmmac/dwmac_lib.c
+++ b/drivers/net/stmmac/dwmac_lib.c
@@ -26,9 +26,9 @@
26 26
27#undef DWMAC_DMA_DEBUG 27#undef DWMAC_DMA_DEBUG
28#ifdef DWMAC_DMA_DEBUG 28#ifdef DWMAC_DMA_DEBUG
29#define DBG(fmt, args...) printk(fmt, ## args) 29#define DWMAC_LIB_DBG(fmt, args...) printk(fmt, ## args)
30#else 30#else
31#define DBG(fmt, args...) do { } while (0) 31#define DWMAC_LIB_DBG(fmt, args...) do { } while (0)
32#endif 32#endif
33 33
34/* CSR1 enables the transmit DMA to check for new descriptor */ 34/* CSR1 enables the transmit DMA to check for new descriptor */
@@ -152,7 +152,7 @@ int dwmac_dma_interrupt(void __iomem *ioaddr,
152 /* read the status register (CSR5) */ 152 /* read the status register (CSR5) */
153 u32 intr_status = readl(ioaddr + DMA_STATUS); 153 u32 intr_status = readl(ioaddr + DMA_STATUS);
154 154
155 DBG(INFO, "%s: [CSR5: 0x%08x]\n", __func__, intr_status); 155 DWMAC_LIB_DBG(KERN_INFO "%s: [CSR5: 0x%08x]\n", __func__, intr_status);
156#ifdef DWMAC_DMA_DEBUG 156#ifdef DWMAC_DMA_DEBUG
157 /* It displays the DMA process states (CSR5 register) */ 157 /* It displays the DMA process states (CSR5 register) */
158 show_tx_process_state(intr_status); 158 show_tx_process_state(intr_status);
@@ -160,43 +160,43 @@ int dwmac_dma_interrupt(void __iomem *ioaddr,
160#endif 160#endif
161 /* ABNORMAL interrupts */ 161 /* ABNORMAL interrupts */
162 if (unlikely(intr_status & DMA_STATUS_AIS)) { 162 if (unlikely(intr_status & DMA_STATUS_AIS)) {
163 DBG(INFO, "CSR5[15] DMA ABNORMAL IRQ: "); 163 DWMAC_LIB_DBG(KERN_INFO "CSR5[15] DMA ABNORMAL IRQ: ");
164 if (unlikely(intr_status & DMA_STATUS_UNF)) { 164 if (unlikely(intr_status & DMA_STATUS_UNF)) {
165 DBG(INFO, "transmit underflow\n"); 165 DWMAC_LIB_DBG(KERN_INFO "transmit underflow\n");
166 ret = tx_hard_error_bump_tc; 166 ret = tx_hard_error_bump_tc;
167 x->tx_undeflow_irq++; 167 x->tx_undeflow_irq++;
168 } 168 }
169 if (unlikely(intr_status & DMA_STATUS_TJT)) { 169 if (unlikely(intr_status & DMA_STATUS_TJT)) {
170 DBG(INFO, "transmit jabber\n"); 170 DWMAC_LIB_DBG(KERN_INFO "transmit jabber\n");
171 x->tx_jabber_irq++; 171 x->tx_jabber_irq++;
172 } 172 }
173 if (unlikely(intr_status & DMA_STATUS_OVF)) { 173 if (unlikely(intr_status & DMA_STATUS_OVF)) {
174 DBG(INFO, "recv overflow\n"); 174 DWMAC_LIB_DBG(KERN_INFO "recv overflow\n");
175 x->rx_overflow_irq++; 175 x->rx_overflow_irq++;
176 } 176 }
177 if (unlikely(intr_status & DMA_STATUS_RU)) { 177 if (unlikely(intr_status & DMA_STATUS_RU)) {
178 DBG(INFO, "receive buffer unavailable\n"); 178 DWMAC_LIB_DBG(KERN_INFO "receive buffer unavailable\n");
179 x->rx_buf_unav_irq++; 179 x->rx_buf_unav_irq++;
180 } 180 }
181 if (unlikely(intr_status & DMA_STATUS_RPS)) { 181 if (unlikely(intr_status & DMA_STATUS_RPS)) {
182 DBG(INFO, "receive process stopped\n"); 182 DWMAC_LIB_DBG(KERN_INFO "receive process stopped\n");
183 x->rx_process_stopped_irq++; 183 x->rx_process_stopped_irq++;
184 } 184 }
185 if (unlikely(intr_status & DMA_STATUS_RWT)) { 185 if (unlikely(intr_status & DMA_STATUS_RWT)) {
186 DBG(INFO, "receive watchdog\n"); 186 DWMAC_LIB_DBG(KERN_INFO "receive watchdog\n");
187 x->rx_watchdog_irq++; 187 x->rx_watchdog_irq++;
188 } 188 }
189 if (unlikely(intr_status & DMA_STATUS_ETI)) { 189 if (unlikely(intr_status & DMA_STATUS_ETI)) {
190 DBG(INFO, "transmit early interrupt\n"); 190 DWMAC_LIB_DBG(KERN_INFO "transmit early interrupt\n");
191 x->tx_early_irq++; 191 x->tx_early_irq++;
192 } 192 }
193 if (unlikely(intr_status & DMA_STATUS_TPS)) { 193 if (unlikely(intr_status & DMA_STATUS_TPS)) {
194 DBG(INFO, "transmit process stopped\n"); 194 DWMAC_LIB_DBG(KERN_INFO "transmit process stopped\n");
195 x->tx_process_stopped_irq++; 195 x->tx_process_stopped_irq++;
196 ret = tx_hard_error; 196 ret = tx_hard_error;
197 } 197 }
198 if (unlikely(intr_status & DMA_STATUS_FBI)) { 198 if (unlikely(intr_status & DMA_STATUS_FBI)) {
199 DBG(INFO, "fatal bus error\n"); 199 DWMAC_LIB_DBG(KERN_INFO "fatal bus error\n");
200 x->fatal_bus_error_irq++; 200 x->fatal_bus_error_irq++;
201 ret = tx_hard_error; 201 ret = tx_hard_error;
202 } 202 }
@@ -215,7 +215,7 @@ int dwmac_dma_interrupt(void __iomem *ioaddr,
215 /* Clear the interrupt by writing a logic 1 to the CSR5[15-0] */ 215 /* Clear the interrupt by writing a logic 1 to the CSR5[15-0] */
216 writel((intr_status & 0x1ffff), ioaddr + DMA_STATUS); 216 writel((intr_status & 0x1ffff), ioaddr + DMA_STATUS);
217 217
218 DBG(INFO, "\n\n"); 218 DWMAC_LIB_DBG(KERN_INFO "\n\n");
219 return ret; 219 return ret;
220} 220}
221 221
diff --git a/drivers/net/stmmac/norm_desc.c b/drivers/net/stmmac/norm_desc.c
index cd0cc76f7a1c..029c2a2cf524 100644
--- a/drivers/net/stmmac/norm_desc.c
+++ b/drivers/net/stmmac/norm_desc.c
@@ -67,7 +67,7 @@ static int ndesc_get_tx_len(struct dma_desc *p)
67 67
68/* This function verifies if each incoming frame has some errors 68/* This function verifies if each incoming frame has some errors
69 * and, if required, updates the multicast statistics. 69 * and, if required, updates the multicast statistics.
70 * In case of success, it returns csum_none becasue the device 70 * In case of success, it returns csum_none because the device
71 * is not able to compute the csum in HW. */ 71 * is not able to compute the csum in HW. */
72static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x, 72static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x,
73 struct dma_desc *p) 73 struct dma_desc *p)
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c
index 0e5f03135b50..cc973fc38405 100644
--- a/drivers/net/stmmac/stmmac_main.c
+++ b/drivers/net/stmmac/stmmac_main.c
@@ -750,7 +750,6 @@ static void stmmac_dma_interrupt(struct stmmac_priv *priv)
750 priv->hw->dma->dma_mode(priv->ioaddr, tc, SF_DMA_MODE); 750 priv->hw->dma->dma_mode(priv->ioaddr, tc, SF_DMA_MODE);
751 priv->xstats.threshold = tc; 751 priv->xstats.threshold = tc;
752 } 752 }
753 stmmac_tx_err(priv);
754 } else if (unlikely(status == tx_hard_error)) 753 } else if (unlikely(status == tx_hard_error))
755 stmmac_tx_err(priv); 754 stmmac_tx_err(priv);
756} 755}
@@ -781,21 +780,6 @@ static int stmmac_open(struct net_device *dev)
781 780
782 stmmac_verify_args(); 781 stmmac_verify_args();
783 782
784 ret = stmmac_init_phy(dev);
785 if (unlikely(ret)) {
786 pr_err("%s: Cannot attach to PHY (error: %d)\n", __func__, ret);
787 return ret;
788 }
789
790 /* Request the IRQ lines */
791 ret = request_irq(dev->irq, stmmac_interrupt,
792 IRQF_SHARED, dev->name, dev);
793 if (unlikely(ret < 0)) {
794 pr_err("%s: ERROR: allocating the IRQ %d (error: %d)\n",
795 __func__, dev->irq, ret);
796 return ret;
797 }
798
799#ifdef CONFIG_STMMAC_TIMER 783#ifdef CONFIG_STMMAC_TIMER
800 priv->tm = kzalloc(sizeof(struct stmmac_timer *), GFP_KERNEL); 784 priv->tm = kzalloc(sizeof(struct stmmac_timer *), GFP_KERNEL);
801 if (unlikely(priv->tm == NULL)) { 785 if (unlikely(priv->tm == NULL)) {
@@ -814,6 +798,11 @@ static int stmmac_open(struct net_device *dev)
814 } else 798 } else
815 priv->tm->enable = 1; 799 priv->tm->enable = 1;
816#endif 800#endif
801 ret = stmmac_init_phy(dev);
802 if (unlikely(ret)) {
803 pr_err("%s: Cannot attach to PHY (error: %d)\n", __func__, ret);
804 goto open_error;
805 }
817 806
818 /* Create and initialize the TX/RX descriptors chains. */ 807 /* Create and initialize the TX/RX descriptors chains. */
819 priv->dma_tx_size = STMMAC_ALIGN(dma_txsize); 808 priv->dma_tx_size = STMMAC_ALIGN(dma_txsize);
@@ -822,12 +811,11 @@ static int stmmac_open(struct net_device *dev)
822 init_dma_desc_rings(dev); 811 init_dma_desc_rings(dev);
823 812
824 /* DMA initialization and SW reset */ 813 /* DMA initialization and SW reset */
825 if (unlikely(priv->hw->dma->init(priv->ioaddr, priv->plat->pbl, 814 ret = priv->hw->dma->init(priv->ioaddr, priv->plat->pbl,
826 priv->dma_tx_phy, 815 priv->dma_tx_phy, priv->dma_rx_phy);
827 priv->dma_rx_phy) < 0)) { 816 if (ret < 0) {
828
829 pr_err("%s: DMA initialization failed\n", __func__); 817 pr_err("%s: DMA initialization failed\n", __func__);
830 return -1; 818 goto open_error;
831 } 819 }
832 820
833 /* Copy the MAC addr into the HW */ 821 /* Copy the MAC addr into the HW */
@@ -848,6 +836,15 @@ static int stmmac_open(struct net_device *dev)
848 writel(0xffffffff, priv->ioaddr + MMC_HIGH_INTR_MASK); 836 writel(0xffffffff, priv->ioaddr + MMC_HIGH_INTR_MASK);
849 writel(0xffffffff, priv->ioaddr + MMC_LOW_INTR_MASK); 837 writel(0xffffffff, priv->ioaddr + MMC_LOW_INTR_MASK);
850 838
839 /* Request the IRQ lines */
840 ret = request_irq(dev->irq, stmmac_interrupt,
841 IRQF_SHARED, dev->name, dev);
842 if (unlikely(ret < 0)) {
843 pr_err("%s: ERROR: allocating the IRQ %d (error: %d)\n",
844 __func__, dev->irq, ret);
845 goto open_error;
846 }
847
851 /* Enable the MAC Rx/Tx */ 848 /* Enable the MAC Rx/Tx */
852 stmmac_enable_mac(priv->ioaddr); 849 stmmac_enable_mac(priv->ioaddr);
853 850
@@ -878,7 +875,17 @@ static int stmmac_open(struct net_device *dev)
878 napi_enable(&priv->napi); 875 napi_enable(&priv->napi);
879 skb_queue_head_init(&priv->rx_recycle); 876 skb_queue_head_init(&priv->rx_recycle);
880 netif_start_queue(dev); 877 netif_start_queue(dev);
878
881 return 0; 879 return 0;
880
881open_error:
882#ifdef CONFIG_STMMAC_TIMER
883 kfree(priv->tm);
884#endif
885 if (priv->phydev)
886 phy_disconnect(priv->phydev);
887
888 return ret;
882} 889}
883 890
884/** 891/**
diff --git a/drivers/net/sunbmac.h b/drivers/net/sunbmac.h
index 8db88945b889..4943e975a731 100644
--- a/drivers/net/sunbmac.h
+++ b/drivers/net/sunbmac.h
@@ -185,7 +185,7 @@
185#define BIGMAC_RXCFG_ENABLE 0x00000001 /* Enable the receiver */ 185#define BIGMAC_RXCFG_ENABLE 0x00000001 /* Enable the receiver */
186#define BIGMAC_RXCFG_FIFO 0x0000000e /* Default rx fthresh... */ 186#define BIGMAC_RXCFG_FIFO 0x0000000e /* Default rx fthresh... */
187#define BIGMAC_RXCFG_PSTRIP 0x00000020 /* Pad byte strip enable */ 187#define BIGMAC_RXCFG_PSTRIP 0x00000020 /* Pad byte strip enable */
188#define BIGMAC_RXCFG_PMISC 0x00000040 /* Enable promiscous mode */ 188#define BIGMAC_RXCFG_PMISC 0x00000040 /* Enable promiscuous mode */
189#define BIGMAC_RXCFG_DERR 0x00000080 /* Disable error checking */ 189#define BIGMAC_RXCFG_DERR 0x00000080 /* Disable error checking */
190#define BIGMAC_RXCFG_DCRCS 0x00000100 /* Disable CRC stripping */ 190#define BIGMAC_RXCFG_DCRCS 0x00000100 /* Disable CRC stripping */
191#define BIGMAC_RXCFG_ME 0x00000200 /* Receive packets addressed to me */ 191#define BIGMAC_RXCFG_ME 0x00000200 /* Receive packets addressed to me */
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index c1a344829b54..d3be735c4719 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -1150,7 +1150,7 @@ static void gem_pcs_reinit_adv(struct gem *gp)
1150 val &= ~(PCS_CFG_ENABLE | PCS_CFG_TO); 1150 val &= ~(PCS_CFG_ENABLE | PCS_CFG_TO);
1151 writel(val, gp->regs + PCS_CFG); 1151 writel(val, gp->regs + PCS_CFG);
1152 1152
1153 /* Advertise all capabilities except assymetric 1153 /* Advertise all capabilities except asymmetric
1154 * pause. 1154 * pause.
1155 */ 1155 */
1156 val = readl(gp->regs + PCS_MIIADV); 1156 val = readl(gp->regs + PCS_MIIADV);
diff --git a/drivers/net/sunhme.h b/drivers/net/sunhme.h
index 756b5bf3aa89..64f278360d89 100644
--- a/drivers/net/sunhme.h
+++ b/drivers/net/sunhme.h
@@ -223,7 +223,7 @@
223/* BigMac receive config register. */ 223/* BigMac receive config register. */
224#define BIGMAC_RXCFG_ENABLE 0x00000001 /* Enable the receiver */ 224#define BIGMAC_RXCFG_ENABLE 0x00000001 /* Enable the receiver */
225#define BIGMAC_RXCFG_PSTRIP 0x00000020 /* Pad byte strip enable */ 225#define BIGMAC_RXCFG_PSTRIP 0x00000020 /* Pad byte strip enable */
226#define BIGMAC_RXCFG_PMISC 0x00000040 /* Enable promiscous mode */ 226#define BIGMAC_RXCFG_PMISC 0x00000040 /* Enable promiscuous mode */
227#define BIGMAC_RXCFG_DERR 0x00000080 /* Disable error checking */ 227#define BIGMAC_RXCFG_DERR 0x00000080 /* Disable error checking */
228#define BIGMAC_RXCFG_DCRCS 0x00000100 /* Disable CRC stripping */ 228#define BIGMAC_RXCFG_DCRCS 0x00000100 /* Disable CRC stripping */
229#define BIGMAC_RXCFG_REJME 0x00000200 /* Reject packets addressed to me */ 229#define BIGMAC_RXCFG_REJME 0x00000200 /* Reject packets addressed to me */
diff --git a/drivers/net/tc35815.c b/drivers/net/tc35815.c
index b6eec8cea209..7ca51cebcddd 100644
--- a/drivers/net/tc35815.c
+++ b/drivers/net/tc35815.c
@@ -119,13 +119,13 @@ struct tc35815_regs {
119/* 119/*
120 * Bit assignments 120 * Bit assignments
121 */ 121 */
122/* DMA_Ctl bit asign ------------------------------------------------------- */ 122/* DMA_Ctl bit assign ------------------------------------------------------- */
123#define DMA_RxAlign 0x00c00000 /* 1:Reception Alignment */ 123#define DMA_RxAlign 0x00c00000 /* 1:Reception Alignment */
124#define DMA_RxAlign_1 0x00400000 124#define DMA_RxAlign_1 0x00400000
125#define DMA_RxAlign_2 0x00800000 125#define DMA_RxAlign_2 0x00800000
126#define DMA_RxAlign_3 0x00c00000 126#define DMA_RxAlign_3 0x00c00000
127#define DMA_M66EnStat 0x00080000 /* 1:66MHz Enable State */ 127#define DMA_M66EnStat 0x00080000 /* 1:66MHz Enable State */
128#define DMA_IntMask 0x00040000 /* 1:Interupt mask */ 128#define DMA_IntMask 0x00040000 /* 1:Interrupt mask */
129#define DMA_SWIntReq 0x00020000 /* 1:Software Interrupt request */ 129#define DMA_SWIntReq 0x00020000 /* 1:Software Interrupt request */
130#define DMA_TxWakeUp 0x00010000 /* 1:Transmit Wake Up */ 130#define DMA_TxWakeUp 0x00010000 /* 1:Transmit Wake Up */
131#define DMA_RxBigE 0x00008000 /* 1:Receive Big Endian */ 131#define DMA_RxBigE 0x00008000 /* 1:Receive Big Endian */
@@ -134,11 +134,11 @@ struct tc35815_regs {
134#define DMA_PowrMgmnt 0x00001000 /* 1:Power Management */ 134#define DMA_PowrMgmnt 0x00001000 /* 1:Power Management */
135#define DMA_DmBurst_Mask 0x000001fc /* DMA Burst size */ 135#define DMA_DmBurst_Mask 0x000001fc /* DMA Burst size */
136 136
137/* RxFragSize bit asign ---------------------------------------------------- */ 137/* RxFragSize bit assign ---------------------------------------------------- */
138#define RxFrag_EnPack 0x00008000 /* 1:Enable Packing */ 138#define RxFrag_EnPack 0x00008000 /* 1:Enable Packing */
139#define RxFrag_MinFragMask 0x00000ffc /* Minimum Fragment */ 139#define RxFrag_MinFragMask 0x00000ffc /* Minimum Fragment */
140 140
141/* MAC_Ctl bit asign ------------------------------------------------------- */ 141/* MAC_Ctl bit assign ------------------------------------------------------- */
142#define MAC_Link10 0x00008000 /* 1:Link Status 10Mbits */ 142#define MAC_Link10 0x00008000 /* 1:Link Status 10Mbits */
143#define MAC_EnMissRoll 0x00002000 /* 1:Enable Missed Roll */ 143#define MAC_EnMissRoll 0x00002000 /* 1:Enable Missed Roll */
144#define MAC_MissRoll 0x00000400 /* 1:Missed Roll */ 144#define MAC_MissRoll 0x00000400 /* 1:Missed Roll */
@@ -152,7 +152,7 @@ struct tc35815_regs {
152#define MAC_HaltImm 0x00000002 /* 1:Halt Immediate */ 152#define MAC_HaltImm 0x00000002 /* 1:Halt Immediate */
153#define MAC_HaltReq 0x00000001 /* 1:Halt request */ 153#define MAC_HaltReq 0x00000001 /* 1:Halt request */
154 154
155/* PROM_Ctl bit asign ------------------------------------------------------ */ 155/* PROM_Ctl bit assign ------------------------------------------------------ */
156#define PROM_Busy 0x00008000 /* 1:Busy (Start Operation) */ 156#define PROM_Busy 0x00008000 /* 1:Busy (Start Operation) */
157#define PROM_Read 0x00004000 /*10:Read operation */ 157#define PROM_Read 0x00004000 /*10:Read operation */
158#define PROM_Write 0x00002000 /*01:Write operation */ 158#define PROM_Write 0x00002000 /*01:Write operation */
@@ -162,7 +162,7 @@ struct tc35815_regs {
162#define PROM_Addr_Ena 0x00000030 /*11xxxx:PROM Write enable */ 162#define PROM_Addr_Ena 0x00000030 /*11xxxx:PROM Write enable */
163 /*00xxxx: disable */ 163 /*00xxxx: disable */
164 164
165/* CAM_Ctl bit asign ------------------------------------------------------- */ 165/* CAM_Ctl bit assign ------------------------------------------------------- */
166#define CAM_CompEn 0x00000010 /* 1:CAM Compare Enable */ 166#define CAM_CompEn 0x00000010 /* 1:CAM Compare Enable */
167#define CAM_NegCAM 0x00000008 /* 1:Reject packets CAM recognizes,*/ 167#define CAM_NegCAM 0x00000008 /* 1:Reject packets CAM recognizes,*/
168 /* accept other */ 168 /* accept other */
@@ -170,7 +170,7 @@ struct tc35815_regs {
170#define CAM_GroupAcc 0x00000002 /* 1:Multicast assept */ 170#define CAM_GroupAcc 0x00000002 /* 1:Multicast assept */
171#define CAM_StationAcc 0x00000001 /* 1:unicast accept */ 171#define CAM_StationAcc 0x00000001 /* 1:unicast accept */
172 172
173/* CAM_Ena bit asign ------------------------------------------------------- */ 173/* CAM_Ena bit assign ------------------------------------------------------- */
174#define CAM_ENTRY_MAX 21 /* CAM Data entry max count */ 174#define CAM_ENTRY_MAX 21 /* CAM Data entry max count */
175#define CAM_Ena_Mask ((1<<CAM_ENTRY_MAX)-1) /* CAM Enable bits (Max 21bits) */ 175#define CAM_Ena_Mask ((1<<CAM_ENTRY_MAX)-1) /* CAM Enable bits (Max 21bits) */
176#define CAM_Ena_Bit(index) (1 << (index)) 176#define CAM_Ena_Bit(index) (1 << (index))
@@ -178,7 +178,7 @@ struct tc35815_regs {
178#define CAM_ENTRY_SOURCE 1 178#define CAM_ENTRY_SOURCE 1
179#define CAM_ENTRY_MACCTL 20 179#define CAM_ENTRY_MACCTL 20
180 180
181/* Tx_Ctl bit asign -------------------------------------------------------- */ 181/* Tx_Ctl bit assign -------------------------------------------------------- */
182#define Tx_En 0x00000001 /* 1:Transmit enable */ 182#define Tx_En 0x00000001 /* 1:Transmit enable */
183#define Tx_TxHalt 0x00000002 /* 1:Transmit Halt Request */ 183#define Tx_TxHalt 0x00000002 /* 1:Transmit Halt Request */
184#define Tx_NoPad 0x00000004 /* 1:Suppress Padding */ 184#define Tx_NoPad 0x00000004 /* 1:Suppress Padding */
@@ -192,7 +192,7 @@ struct tc35815_regs {
192#define Tx_EnTxPar 0x00002000 /* 1:Enable Transmit Parity */ 192#define Tx_EnTxPar 0x00002000 /* 1:Enable Transmit Parity */
193#define Tx_EnComp 0x00004000 /* 1:Enable Completion */ 193#define Tx_EnComp 0x00004000 /* 1:Enable Completion */
194 194
195/* Tx_Stat bit asign ------------------------------------------------------- */ 195/* Tx_Stat bit assign ------------------------------------------------------- */
196#define Tx_TxColl_MASK 0x0000000F /* Tx Collision Count */ 196#define Tx_TxColl_MASK 0x0000000F /* Tx Collision Count */
197#define Tx_ExColl 0x00000010 /* Excessive Collision */ 197#define Tx_ExColl 0x00000010 /* Excessive Collision */
198#define Tx_TXDefer 0x00000020 /* Transmit Defered */ 198#define Tx_TXDefer 0x00000020 /* Transmit Defered */
@@ -208,7 +208,7 @@ struct tc35815_regs {
208#define Tx_Halted 0x00008000 /* Tx Halted */ 208#define Tx_Halted 0x00008000 /* Tx Halted */
209#define Tx_SQErr 0x00010000 /* Signal Quality Error(SQE) */ 209#define Tx_SQErr 0x00010000 /* Signal Quality Error(SQE) */
210 210
211/* Rx_Ctl bit asign -------------------------------------------------------- */ 211/* Rx_Ctl bit assign -------------------------------------------------------- */
212#define Rx_EnGood 0x00004000 /* 1:Enable Good */ 212#define Rx_EnGood 0x00004000 /* 1:Enable Good */
213#define Rx_EnRxPar 0x00002000 /* 1:Enable Receive Parity */ 213#define Rx_EnRxPar 0x00002000 /* 1:Enable Receive Parity */
214#define Rx_EnLongErr 0x00000800 /* 1:Enable Long Error */ 214#define Rx_EnLongErr 0x00000800 /* 1:Enable Long Error */
@@ -222,7 +222,7 @@ struct tc35815_regs {
222#define Rx_RxHalt 0x00000002 /* 1:Receive Halt Request */ 222#define Rx_RxHalt 0x00000002 /* 1:Receive Halt Request */
223#define Rx_RxEn 0x00000001 /* 1:Receive Intrrupt Enable */ 223#define Rx_RxEn 0x00000001 /* 1:Receive Intrrupt Enable */
224 224
225/* Rx_Stat bit asign ------------------------------------------------------- */ 225/* Rx_Stat bit assign ------------------------------------------------------- */
226#define Rx_Halted 0x00008000 /* Rx Halted */ 226#define Rx_Halted 0x00008000 /* Rx Halted */
227#define Rx_Good 0x00004000 /* Rx Good */ 227#define Rx_Good 0x00004000 /* Rx Good */
228#define Rx_RxPar 0x00002000 /* Rx Parity Error */ 228#define Rx_RxPar 0x00002000 /* Rx Parity Error */
@@ -238,7 +238,7 @@ struct tc35815_regs {
238 238
239#define Rx_Stat_Mask 0x0000FFF0 /* Rx All Status Mask */ 239#define Rx_Stat_Mask 0x0000FFF0 /* Rx All Status Mask */
240 240
241/* Int_En bit asign -------------------------------------------------------- */ 241/* Int_En bit assign -------------------------------------------------------- */
242#define Int_NRAbtEn 0x00000800 /* 1:Non-recoverable Abort Enable */ 242#define Int_NRAbtEn 0x00000800 /* 1:Non-recoverable Abort Enable */
243#define Int_TxCtlCmpEn 0x00000400 /* 1:Transmit Ctl Complete Enable */ 243#define Int_TxCtlCmpEn 0x00000400 /* 1:Transmit Ctl Complete Enable */
244#define Int_DmParErrEn 0x00000200 /* 1:DMA Parity Error Enable */ 244#define Int_DmParErrEn 0x00000200 /* 1:DMA Parity Error Enable */
@@ -253,7 +253,7 @@ struct tc35815_regs {
253#define Int_FDAExEn 0x00000001 /* 1:Free Descriptor Area */ 253#define Int_FDAExEn 0x00000001 /* 1:Free Descriptor Area */
254 /* Exhausted Enable */ 254 /* Exhausted Enable */
255 255
256/* Int_Src bit asign ------------------------------------------------------- */ 256/* Int_Src bit assign ------------------------------------------------------- */
257#define Int_NRabt 0x00004000 /* 1:Non Recoverable error */ 257#define Int_NRabt 0x00004000 /* 1:Non Recoverable error */
258#define Int_DmParErrStat 0x00002000 /* 1:DMA Parity Error & Clear */ 258#define Int_DmParErrStat 0x00002000 /* 1:DMA Parity Error & Clear */
259#define Int_BLEx 0x00001000 /* 1:Buffer List Empty & Clear */ 259#define Int_BLEx 0x00001000 /* 1:Buffer List Empty & Clear */
@@ -270,8 +270,8 @@ struct tc35815_regs {
270#define Int_IntMacRx 0x00000002 /* 1:Rx controller & Clear */ 270#define Int_IntMacRx 0x00000002 /* 1:Rx controller & Clear */
271#define Int_IntMacTx 0x00000001 /* 1:Tx controller & Clear */ 271#define Int_IntMacTx 0x00000001 /* 1:Tx controller & Clear */
272 272
273/* MD_CA bit asign --------------------------------------------------------- */ 273/* MD_CA bit assign --------------------------------------------------------- */
274#define MD_CA_PreSup 0x00001000 /* 1:Preamble Supress */ 274#define MD_CA_PreSup 0x00001000 /* 1:Preamble Suppress */
275#define MD_CA_Busy 0x00000800 /* 1:Busy (Start Operation) */ 275#define MD_CA_Busy 0x00000800 /* 1:Busy (Start Operation) */
276#define MD_CA_Wr 0x00000400 /* 1:Write 0:Read */ 276#define MD_CA_Wr 0x00000400 /* 1:Write 0:Read */
277 277
@@ -296,7 +296,7 @@ struct BDesc {
296 296
297#define FD_ALIGN 16 297#define FD_ALIGN 16
298 298
299/* Frame Descripter bit asign ---------------------------------------------- */ 299/* Frame Descripter bit assign ---------------------------------------------- */
300#define FD_FDLength_MASK 0x0000FFFF /* Length MASK */ 300#define FD_FDLength_MASK 0x0000FFFF /* Length MASK */
301#define FD_BDCnt_MASK 0x001F0000 /* BD count MASK in FD */ 301#define FD_BDCnt_MASK 0x001F0000 /* BD count MASK in FD */
302#define FD_FrmOpt_MASK 0x7C000000 /* Frame option MASK */ 302#define FD_FrmOpt_MASK 0x7C000000 /* Frame option MASK */
@@ -309,8 +309,8 @@ struct BDesc {
309#define FD_Next_EOL 0x00000001 /* FD EOL indicator */ 309#define FD_Next_EOL 0x00000001 /* FD EOL indicator */
310#define FD_BDCnt_SHIFT 16 310#define FD_BDCnt_SHIFT 16
311 311
312/* Buffer Descripter bit asign --------------------------------------------- */ 312/* Buffer Descripter bit assign --------------------------------------------- */
313#define BD_BuffLength_MASK 0x0000FFFF /* Recieve Data Size */ 313#define BD_BuffLength_MASK 0x0000FFFF /* Receive Data Size */
314#define BD_RxBDID_MASK 0x00FF0000 /* BD ID Number MASK */ 314#define BD_RxBDID_MASK 0x00FF0000 /* BD ID Number MASK */
315#define BD_RxBDSeqN_MASK 0x7F000000 /* Rx BD Sequence Number */ 315#define BD_RxBDSeqN_MASK 0x7F000000 /* Rx BD Sequence Number */
316#define BD_CownsBD 0x80000000 /* BD Controller owner bit */ 316#define BD_CownsBD 0x80000000 /* BD Controller owner bit */
@@ -339,7 +339,7 @@ struct BDesc {
339#define TX_THRESHOLD 1024 339#define TX_THRESHOLD 1024
340/* used threshold with packet max byte for low pci transfer ability.*/ 340/* used threshold with packet max byte for low pci transfer ability.*/
341#define TX_THRESHOLD_MAX 1536 341#define TX_THRESHOLD_MAX 1536
342/* setting threshold max value when overrun error occured this count. */ 342/* setting threshold max value when overrun error occurred this count. */
343#define TX_THRESHOLD_KEEP_LIMIT 10 343#define TX_THRESHOLD_KEEP_LIMIT 10
344 344
345/* 16 + RX_BUF_NUM * 8 + RX_FD_NUM * 16 + TX_FD_NUM * 32 <= PAGE_SIZE*FD_PAGE_NUM */ 345/* 16 + RX_BUF_NUM * 8 + RX_FD_NUM * 16 + TX_FD_NUM * 32 <= PAGE_SIZE*FD_PAGE_NUM */
diff --git a/drivers/net/tehuti.c b/drivers/net/tehuti.c
index 3397618d4d96..8564ec5cfb7f 100644
--- a/drivers/net/tehuti.c
+++ b/drivers/net/tehuti.c
@@ -645,7 +645,7 @@ static int bdx_ioctl_priv(struct net_device *ndev, struct ifreq *ifr, int cmd)
645 if (cmd != SIOCDEVPRIVATE) { 645 if (cmd != SIOCDEVPRIVATE) {
646 error = copy_from_user(data, ifr->ifr_data, sizeof(data)); 646 error = copy_from_user(data, ifr->ifr_data, sizeof(data));
647 if (error) { 647 if (error) {
648 pr_err("cant copy from user\n"); 648 pr_err("can't copy from user\n");
649 RET(-EFAULT); 649 RET(-EFAULT);
650 } 650 }
651 DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]); 651 DBG("%d 0x%x 0x%x\n", data[0], data[1], data[2]);
@@ -999,7 +999,7 @@ static inline void bdx_rxdb_free_elem(struct rxdb *db, int n)
999 * 999 *
1000 * RxD fifo is smaller than RxF fifo by design. Upon high load, RxD will be 1000 * RxD fifo is smaller than RxF fifo by design. Upon high load, RxD will be
1001 * filled and packets will be dropped by nic without getting into host or 1001 * filled and packets will be dropped by nic without getting into host or
1002 * cousing interrupt. Anyway, in that condition, host has no chance to proccess 1002 * cousing interrupt. Anyway, in that condition, host has no chance to process
1003 * all packets, but dropping in nic is cheaper, since it takes 0 cpu cycles 1003 * all packets, but dropping in nic is cheaper, since it takes 0 cpu cycles
1004 */ 1004 */
1005 1005
@@ -1200,8 +1200,8 @@ static void bdx_recycle_skb(struct bdx_priv *priv, struct rxd_desc *rxdd)
1200 RET(); 1200 RET();
1201} 1201}
1202 1202
1203/* bdx_rx_receive - recieves full packets from RXD fifo and pass them to OS 1203/* bdx_rx_receive - receives full packets from RXD fifo and pass them to OS
1204 * NOTE: a special treatment is given to non-continous descriptors 1204 * NOTE: a special treatment is given to non-continuous descriptors
1205 * that start near the end, wraps around and continue at the beginning. a second 1205 * that start near the end, wraps around and continue at the beginning. a second
1206 * part is copied right after the first, and then descriptor is interpreted as 1206 * part is copied right after the first, and then descriptor is interpreted as
1207 * normal. fifo has an extra space to allow such operations 1207 * normal. fifo has an extra space to allow such operations
@@ -1584,9 +1584,9 @@ err_mem:
1584} 1584}
1585 1585
1586/* 1586/*
1587 * bdx_tx_space - calculates avalable space in TX fifo 1587 * bdx_tx_space - calculates available space in TX fifo
1588 * @priv - NIC private structure 1588 * @priv - NIC private structure
1589 * Returns avaliable space in TX fifo in bytes 1589 * Returns available space in TX fifo in bytes
1590 */ 1590 */
1591static inline int bdx_tx_space(struct bdx_priv *priv) 1591static inline int bdx_tx_space(struct bdx_priv *priv)
1592{ 1592{
diff --git a/drivers/net/tehuti.h b/drivers/net/tehuti.h
index b6ba8601e2b5..c5642fefc9e7 100644
--- a/drivers/net/tehuti.h
+++ b/drivers/net/tehuti.h
@@ -502,7 +502,7 @@ struct txd_desc {
502#define GMAC_RX_FILTER_ACRC 0x0010 /* accept crc error */ 502#define GMAC_RX_FILTER_ACRC 0x0010 /* accept crc error */
503#define GMAC_RX_FILTER_AM 0x0008 /* accept multicast */ 503#define GMAC_RX_FILTER_AM 0x0008 /* accept multicast */
504#define GMAC_RX_FILTER_AB 0x0004 /* accept broadcast */ 504#define GMAC_RX_FILTER_AB 0x0004 /* accept broadcast */
505#define GMAC_RX_FILTER_PRM 0x0001 /* [0:1] promiscous mode */ 505#define GMAC_RX_FILTER_PRM 0x0001 /* [0:1] promiscuous mode */
506 506
507#define MAX_FRAME_AB_VAL 0x3fff /* 13:0 */ 507#define MAX_FRAME_AB_VAL 0x3fff /* 13:0 */
508 508
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index ebec88882c3b..b8c5f35577e4 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -48,9 +48,9 @@
48#include <net/ip.h> 48#include <net/ip.h>
49 49
50#include <asm/system.h> 50#include <asm/system.h>
51#include <asm/io.h> 51#include <linux/io.h>
52#include <asm/byteorder.h> 52#include <asm/byteorder.h>
53#include <asm/uaccess.h> 53#include <linux/uaccess.h>
54 54
55#ifdef CONFIG_SPARC 55#ifdef CONFIG_SPARC
56#include <asm/idprom.h> 56#include <asm/idprom.h>
@@ -9712,7 +9712,7 @@ static int tg3_get_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom,
9712 eeprom->len += b_count; 9712 eeprom->len += b_count;
9713 } 9713 }
9714 9714
9715 /* read bytes upto the last 4 byte boundary */ 9715 /* read bytes up to the last 4 byte boundary */
9716 pd = &data[eeprom->len]; 9716 pd = &data[eeprom->len];
9717 for (i = 0; i < (len - (len & 3)); i += 4) { 9717 for (i = 0; i < (len - (len & 3)); i += 4) {
9718 ret = tg3_nvram_read_be32(tp, offset + i, &val); 9718 ret = tg3_nvram_read_be32(tp, offset + i, &val);
@@ -13118,7 +13118,7 @@ done:
13118 13118
13119static struct pci_dev * __devinit tg3_find_peer(struct tg3 *); 13119static struct pci_dev * __devinit tg3_find_peer(struct tg3 *);
13120 13120
13121static void inline vlan_features_add(struct net_device *dev, unsigned long flags) 13121static inline void vlan_features_add(struct net_device *dev, unsigned long flags)
13122{ 13122{
13123 dev->vlan_features |= flags; 13123 dev->vlan_features |= flags;
13124} 13124}
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 73884b69b749..5e96706ad108 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2130,7 +2130,7 @@
2130#define MII_TG3_DSP_EXP96 0x0f96 2130#define MII_TG3_DSP_EXP96 0x0f96
2131#define MII_TG3_DSP_EXP97 0x0f97 2131#define MII_TG3_DSP_EXP97 0x0f97
2132 2132
2133#define MII_TG3_AUX_CTRL 0x18 /* auxilliary control register */ 2133#define MII_TG3_AUX_CTRL 0x18 /* auxiliary control register */
2134 2134
2135#define MII_TG3_AUXCTL_PCTL_100TX_LPWR 0x0010 2135#define MII_TG3_AUXCTL_PCTL_100TX_LPWR 0x0010
2136#define MII_TG3_AUXCTL_PCTL_SPR_ISOLATE 0x0020 2136#define MII_TG3_AUXCTL_PCTL_SPR_ISOLATE 0x0020
@@ -2146,7 +2146,7 @@
2146#define MII_TG3_AUXCTL_ACTL_TX_6DB 0x0400 2146#define MII_TG3_AUXCTL_ACTL_TX_6DB 0x0400
2147#define MII_TG3_AUXCTL_SHDWSEL_AUXCTL 0x0000 2147#define MII_TG3_AUXCTL_SHDWSEL_AUXCTL 0x0000
2148 2148
2149#define MII_TG3_AUX_STAT 0x19 /* auxilliary status register */ 2149#define MII_TG3_AUX_STAT 0x19 /* auxiliary status register */
2150#define MII_TG3_AUX_STAT_LPASS 0x0004 2150#define MII_TG3_AUX_STAT_LPASS 0x0004
2151#define MII_TG3_AUX_STAT_SPDMASK 0x0700 2151#define MII_TG3_AUX_STAT_SPDMASK 0x0700
2152#define MII_TG3_AUX_STAT_10HALF 0x0100 2152#define MII_TG3_AUX_STAT_10HALF 0x0100
diff --git a/drivers/net/tokenring/3c359.c b/drivers/net/tokenring/3c359.c
index 10800f16a231..ff32befd8443 100644
--- a/drivers/net/tokenring/3c359.c
+++ b/drivers/net/tokenring/3c359.c
@@ -208,7 +208,7 @@ static void print_rx_state(struct net_device *dev)
208 * passing/getting the next value from the nic. As with all requests 208 * passing/getting the next value from the nic. As with all requests
209 * on this nic it has to be done in two stages, a) tell the nic which 209 * on this nic it has to be done in two stages, a) tell the nic which
210 * memory address you want to access and b) pass/get the value from the nic. 210 * memory address you want to access and b) pass/get the value from the nic.
211 * With the EEProm, you have to wait before and inbetween access a) and b). 211 * With the EEProm, you have to wait before and between access a) and b).
212 * As this is only read at initialization time and the wait period is very 212 * As this is only read at initialization time and the wait period is very
213 * small we shouldn't have to worry about scheduling issues. 213 * small we shouldn't have to worry about scheduling issues.
214 */ 214 */
@@ -1251,7 +1251,7 @@ static netdev_tx_t xl_xmit(struct sk_buff *skb, struct net_device *dev)
1251/* 1251/*
1252 * The NIC has told us that a packet has been downloaded onto the card, we must 1252 * The NIC has told us that a packet has been downloaded onto the card, we must
1253 * find out which packet it has done, clear the skb and information for the packet 1253 * find out which packet it has done, clear the skb and information for the packet
1254 * then advance around the ring for all tranmitted packets 1254 * then advance around the ring for all transmitted packets
1255 */ 1255 */
1256 1256
1257static void xl_dn_comp(struct net_device *dev) 1257static void xl_dn_comp(struct net_device *dev)
@@ -1568,7 +1568,7 @@ static void xl_arb_cmd(struct net_device *dev)
1568 if (lan_status_diff & LSC_SOFT_ERR) 1568 if (lan_status_diff & LSC_SOFT_ERR)
1569 printk(KERN_WARNING "%s: Adapter transmitted Soft Error Report Mac Frame\n",dev->name); 1569 printk(KERN_WARNING "%s: Adapter transmitted Soft Error Report Mac Frame\n",dev->name);
1570 if (lan_status_diff & LSC_TRAN_BCN) 1570 if (lan_status_diff & LSC_TRAN_BCN)
1571 printk(KERN_INFO "%s: We are tranmitting the beacon, aaah\n",dev->name); 1571 printk(KERN_INFO "%s: We are transmitting the beacon, aaah\n",dev->name);
1572 if (lan_status_diff & LSC_SS) 1572 if (lan_status_diff & LSC_SS)
1573 printk(KERN_INFO "%s: Single Station on the ring\n", dev->name); 1573 printk(KERN_INFO "%s: Single Station on the ring\n", dev->name);
1574 if (lan_status_diff & LSC_RING_REC) 1574 if (lan_status_diff & LSC_RING_REC)
diff --git a/drivers/net/tokenring/lanstreamer.c b/drivers/net/tokenring/lanstreamer.c
index 5bd140704533..9354ca9da576 100644
--- a/drivers/net/tokenring/lanstreamer.c
+++ b/drivers/net/tokenring/lanstreamer.c
@@ -1675,7 +1675,7 @@ drop_frame:
1675 if (lan_status_diff & LSC_SOFT_ERR) 1675 if (lan_status_diff & LSC_SOFT_ERR)
1676 printk(KERN_WARNING "%s: Adapter transmitted Soft Error Report Mac Frame\n", dev->name); 1676 printk(KERN_WARNING "%s: Adapter transmitted Soft Error Report Mac Frame\n", dev->name);
1677 if (lan_status_diff & LSC_TRAN_BCN) 1677 if (lan_status_diff & LSC_TRAN_BCN)
1678 printk(KERN_INFO "%s: We are tranmitting the beacon, aaah\n", dev->name); 1678 printk(KERN_INFO "%s: We are transmitting the beacon, aaah\n", dev->name);
1679 if (lan_status_diff & LSC_SS) 1679 if (lan_status_diff & LSC_SS)
1680 printk(KERN_INFO "%s: Single Station on the ring\n", dev->name); 1680 printk(KERN_INFO "%s: Single Station on the ring\n", dev->name);
1681 if (lan_status_diff & LSC_RING_REC) 1681 if (lan_status_diff & LSC_RING_REC)
diff --git a/drivers/net/tokenring/madgemc.c b/drivers/net/tokenring/madgemc.c
index 785ad1a2157b..2bedc0ace812 100644
--- a/drivers/net/tokenring/madgemc.c
+++ b/drivers/net/tokenring/madgemc.c
@@ -73,7 +73,7 @@ static void madgemc_setint(struct net_device *dev, int val);
73static irqreturn_t madgemc_interrupt(int irq, void *dev_id); 73static irqreturn_t madgemc_interrupt(int irq, void *dev_id);
74 74
75/* 75/*
76 * These work around paging, however they don't guarentee you're on the 76 * These work around paging, however they don't guarantee you're on the
77 * right page. 77 * right page.
78 */ 78 */
79#define SIFREADB(reg) (inb(dev->base_addr + ((reg<0x8)?reg:reg-0x8))) 79#define SIFREADB(reg) (inb(dev->base_addr + ((reg<0x8)?reg:reg-0x8)))
@@ -387,7 +387,7 @@ getout:
387 * both with their own disadvantages... 387 * both with their own disadvantages...
388 * 388 *
389 * 1) Read in the SIFSTS register from the TMS controller. This 389 * 1) Read in the SIFSTS register from the TMS controller. This
390 * is guarenteed to be accurate, however, there's a fairly 390 * is guaranteed to be accurate, however, there's a fairly
391 * large performance penalty for doing so: the Madge chips 391 * large performance penalty for doing so: the Madge chips
392 * must request the register from the Eagle, the Eagle must 392 * must request the register from the Eagle, the Eagle must
393 * read them from its internal bus, and then take the route 393 * read them from its internal bus, and then take the route
@@ -454,7 +454,7 @@ static irqreturn_t madgemc_interrupt(int irq, void *dev_id)
454} 454}
455 455
456/* 456/*
457 * Set the card to the prefered ring speed. 457 * Set the card to the preferred ring speed.
458 * 458 *
459 * Unlike newer cards, the MC16/32 have their speed selection 459 * Unlike newer cards, the MC16/32 have their speed selection
460 * circuit connected to the Madge ASICs and not to the TMS380 460 * circuit connected to the Madge ASICs and not to the TMS380
diff --git a/drivers/net/tokenring/olympic.c b/drivers/net/tokenring/olympic.c
index 3d2fbe60b46e..2684003b8ab6 100644
--- a/drivers/net/tokenring/olympic.c
+++ b/drivers/net/tokenring/olympic.c
@@ -1500,7 +1500,7 @@ drop_frame:
1500 if (lan_status_diff & LSC_SOFT_ERR) 1500 if (lan_status_diff & LSC_SOFT_ERR)
1501 printk(KERN_WARNING "%s: Adapter transmitted Soft Error Report Mac Frame\n",dev->name); 1501 printk(KERN_WARNING "%s: Adapter transmitted Soft Error Report Mac Frame\n",dev->name);
1502 if (lan_status_diff & LSC_TRAN_BCN) 1502 if (lan_status_diff & LSC_TRAN_BCN)
1503 printk(KERN_INFO "%s: We are tranmitting the beacon, aaah\n",dev->name); 1503 printk(KERN_INFO "%s: We are transmitting the beacon, aaah\n",dev->name);
1504 if (lan_status_diff & LSC_SS) 1504 if (lan_status_diff & LSC_SS)
1505 printk(KERN_INFO "%s: Single Station on the ring\n", dev->name); 1505 printk(KERN_INFO "%s: Single Station on the ring\n", dev->name);
1506 if (lan_status_diff & LSC_RING_REC) 1506 if (lan_status_diff & LSC_RING_REC)
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index 63db5a6762ae..d9044aba7afa 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -393,7 +393,7 @@ static int smctr_alloc_shared_memory(struct net_device *dev)
393 tp->rx_bdb_end[NON_MAC_QUEUE] = (BDBlock *)smctr_malloc(dev, 0); 393 tp->rx_bdb_end[NON_MAC_QUEUE] = (BDBlock *)smctr_malloc(dev, 0);
394 394
395 /* Allocate MAC transmit buffers. 395 /* Allocate MAC transmit buffers.
396 * MAC Tx Buffers doen't have to be on an ODD Boundry. 396 * MAC Tx Buffers doen't have to be on an ODD Boundary.
397 */ 397 */
398 tp->tx_buff_head[MAC_QUEUE] 398 tp->tx_buff_head[MAC_QUEUE]
399 = (__u16 *)smctr_malloc(dev, tp->tx_buff_size[MAC_QUEUE]); 399 = (__u16 *)smctr_malloc(dev, tp->tx_buff_size[MAC_QUEUE]);
@@ -415,7 +415,7 @@ static int smctr_alloc_shared_memory(struct net_device *dev)
415 415
416 /* Allocate Non-MAC transmit buffers. 416 /* Allocate Non-MAC transmit buffers.
417 * ?? For maximum Netware performance, put Tx Buffers on 417 * ?? For maximum Netware performance, put Tx Buffers on
418 * ODD Boundry and then restore malloc to Even Boundrys. 418 * ODD Boundary and then restore malloc to Even Boundrys.
419 */ 419 */
420 smctr_malloc(dev, 1L); 420 smctr_malloc(dev, 1L);
421 tp->tx_buff_head[NON_MAC_QUEUE] 421 tp->tx_buff_head[NON_MAC_QUEUE]
@@ -1311,7 +1311,7 @@ static unsigned int smctr_get_num_rx_bdbs(struct net_device *dev)
1311 mem_used += sizeof(BDBlock) * tp->num_rx_bdbs[MAC_QUEUE]; 1311 mem_used += sizeof(BDBlock) * tp->num_rx_bdbs[MAC_QUEUE];
1312 1312
1313 /* Allocate MAC transmit buffers. 1313 /* Allocate MAC transmit buffers.
1314 * MAC transmit buffers don't have to be on an ODD Boundry. 1314 * MAC transmit buffers don't have to be on an ODD Boundary.
1315 */ 1315 */
1316 mem_used += tp->tx_buff_size[MAC_QUEUE]; 1316 mem_used += tp->tx_buff_size[MAC_QUEUE];
1317 1317
@@ -1325,7 +1325,7 @@ static unsigned int smctr_get_num_rx_bdbs(struct net_device *dev)
1325 1325
1326 /* Allocate Non-MAC transmit buffers. 1326 /* Allocate Non-MAC transmit buffers.
1327 * For maximum Netware performance, put Tx Buffers on 1327 * For maximum Netware performance, put Tx Buffers on
1328 * ODD Boundry,and then restore malloc to Even Boundrys. 1328 * ODD Boundary,and then restore malloc to Even Boundrys.
1329 */ 1329 */
1330 mem_used += 1L; 1330 mem_used += 1L;
1331 mem_used += tp->tx_buff_size[NON_MAC_QUEUE]; 1331 mem_used += tp->tx_buff_size[NON_MAC_QUEUE];
@@ -3069,8 +3069,8 @@ static int smctr_load_node_addr(struct net_device *dev)
3069 * disabled.!? 3069 * disabled.!?
3070 * 3070 *
3071 * NOTE 2: If the monitor_state is MS_BEACON_TEST_STATE and the receive_mask 3071 * NOTE 2: If the monitor_state is MS_BEACON_TEST_STATE and the receive_mask
3072 * has any multi-cast or promiscous bits set, the receive_mask needs to 3072 * has any multi-cast or promiscuous bits set, the receive_mask needs to
3073 * be changed to clear the multi-cast or promiscous mode bits, the lobe_test 3073 * be changed to clear the multi-cast or promiscuous mode bits, the lobe_test
3074 * run, and then the receive mask set back to its original value if the test 3074 * run, and then the receive mask set back to its original value if the test
3075 * is successful. 3075 * is successful.
3076 */ 3076 */
diff --git a/drivers/net/tokenring/tms380tr.h b/drivers/net/tokenring/tms380tr.h
index 60b30ee38dcb..e5a617c586c2 100644
--- a/drivers/net/tokenring/tms380tr.h
+++ b/drivers/net/tokenring/tms380tr.h
@@ -442,7 +442,7 @@ typedef struct {
442#define PASS_FIRST_BUF_ONLY 0x0100 /* Passes only first internal buffer 442#define PASS_FIRST_BUF_ONLY 0x0100 /* Passes only first internal buffer
443 * of each received frame; FrameSize 443 * of each received frame; FrameSize
444 * of RPLs must contain internal 444 * of RPLs must contain internal
445 * BUFFER_SIZE bits for promiscous mode. 445 * BUFFER_SIZE bits for promiscuous mode.
446 */ 446 */
447#define ENABLE_FULL_DUPLEX_SELECTION 0x2000 447#define ENABLE_FULL_DUPLEX_SELECTION 0x2000
448 /* Enable the use of full-duplex 448 /* Enable the use of full-duplex
diff --git a/drivers/net/tsi108_eth.h b/drivers/net/tsi108_eth.h
index 5a77ae6c5f36..5fee7d78dc6d 100644
--- a/drivers/net/tsi108_eth.h
+++ b/drivers/net/tsi108_eth.h
@@ -305,9 +305,9 @@
305#define TSI108_TX_CRC (1 << 5) /* Generate CRC for this packet */ 305#define TSI108_TX_CRC (1 << 5) /* Generate CRC for this packet */
306#define TSI108_TX_INT (1 << 14) /* Generate an IRQ after frag. processed */ 306#define TSI108_TX_INT (1 << 14) /* Generate an IRQ after frag. processed */
307#define TSI108_TX_RETRY (0xf << 16) /* 4 bit field indicating num. of retries */ 307#define TSI108_TX_RETRY (0xf << 16) /* 4 bit field indicating num. of retries */
308#define TSI108_TX_COL (1 << 20) /* Set if a collision occured */ 308#define TSI108_TX_COL (1 << 20) /* Set if a collision occurred */
309#define TSI108_TX_LCOL (1 << 24) /* Set if a late collision occured */ 309#define TSI108_TX_LCOL (1 << 24) /* Set if a late collision occurred */
310#define TSI108_TX_UNDER (1 << 25) /* Set if a FIFO underrun occured */ 310#define TSI108_TX_UNDER (1 << 25) /* Set if a FIFO underrun occurred */
311#define TSI108_TX_RLIM (1 << 26) /* Set if the retry limit was reached */ 311#define TSI108_TX_RLIM (1 << 26) /* Set if the retry limit was reached */
312#define TSI108_TX_OK (1 << 30) /* Set if the frame TX was successful */ 312#define TSI108_TX_OK (1 << 30) /* Set if the frame TX was successful */
313#define TSI108_TX_OWN (1 << 31) /* Set if the device owns the descriptor */ 313#define TSI108_TX_OWN (1 << 31) /* Set if the device owns the descriptor */
@@ -332,7 +332,7 @@ typedef struct {
332#define TSI108_RX_RUNT (1 << 4)/* Packet is less than minimum size */ 332#define TSI108_RX_RUNT (1 << 4)/* Packet is less than minimum size */
333#define TSI108_RX_HASH (1 << 7)/* Hash table match */ 333#define TSI108_RX_HASH (1 << 7)/* Hash table match */
334#define TSI108_RX_BAD (1 << 8) /* Bad frame */ 334#define TSI108_RX_BAD (1 << 8) /* Bad frame */
335#define TSI108_RX_OVER (1 << 9) /* FIFO overrun occured */ 335#define TSI108_RX_OVER (1 << 9) /* FIFO overrun occurred */
336#define TSI108_RX_TRUNC (1 << 11) /* Packet truncated due to excess length */ 336#define TSI108_RX_TRUNC (1 << 11) /* Packet truncated due to excess length */
337#define TSI108_RX_CRC (1 << 12) /* Packet had a CRC error */ 337#define TSI108_RX_CRC (1 << 12) /* Packet had a CRC error */
338#define TSI108_RX_INT (1 << 13) /* Generate an IRQ after frag. processed */ 338#define TSI108_RX_INT (1 << 13) /* Generate an IRQ after frag. processed */
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 4dbd493b996b..efaa1d69b720 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -79,7 +79,7 @@
79 every usable DECchip board, I pinched Donald's 'next_module' field to 79 every usable DECchip board, I pinched Donald's 'next_module' field to
80 link my modules together. 80 link my modules together.
81 81
82 Upto 15 EISA cards can be supported under this driver, limited primarily 82 Up to 15 EISA cards can be supported under this driver, limited primarily
83 by the available IRQ lines. I have checked different configurations of 83 by the available IRQ lines. I have checked different configurations of
84 multiple depca, EtherWORKS 3 cards and de4x5 cards and have not found a 84 multiple depca, EtherWORKS 3 cards and de4x5 cards and have not found a
85 problem yet (provided you have at least depca.c v0.38) ... 85 problem yet (provided you have at least depca.c v0.38) ...
@@ -517,7 +517,7 @@ struct mii_phy {
517 u_int mci; /* 21142 MII Connector Interrupt info */ 517 u_int mci; /* 21142 MII Connector Interrupt info */
518}; 518};
519 519
520#define DE4X5_MAX_PHY 8 /* Allow upto 8 attached PHY devices per board */ 520#define DE4X5_MAX_PHY 8 /* Allow up to 8 attached PHY devices per board */
521 521
522struct sia_phy { 522struct sia_phy {
523 u_char mc; /* Media Code */ 523 u_char mc; /* Media Code */
@@ -1436,7 +1436,7 @@ de4x5_sw_reset(struct net_device *dev)
1436 1436
1437 /* Poll for setup frame completion (adapter interrupts are disabled now) */ 1437 /* Poll for setup frame completion (adapter interrupts are disabled now) */
1438 1438
1439 for (j=0, i=0;(i<500) && (j==0);i++) { /* Upto 500ms delay */ 1439 for (j=0, i=0;(i<500) && (j==0);i++) { /* Up to 500ms delay */
1440 mdelay(1); 1440 mdelay(1);
1441 if ((s32)le32_to_cpu(lp->tx_ring[lp->tx_new].status) >= 0) j=1; 1441 if ((s32)le32_to_cpu(lp->tx_ring[lp->tx_new].status) >= 0) j=1;
1442 } 1442 }
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c
index 7064e035757a..fb07f48910ae 100644
--- a/drivers/net/tulip/dmfe.c
+++ b/drivers/net/tulip/dmfe.c
@@ -1224,7 +1224,7 @@ static void dmfe_timer(unsigned long data)
1224 1224
1225 1225
1226 /* If chip reports that link is failed it could be because external 1226 /* If chip reports that link is failed it could be because external
1227 PHY link status pin is not conected correctly to chip 1227 PHY link status pin is not connected correctly to chip
1228 To be sure ask PHY too. 1228 To be sure ask PHY too.
1229 */ 1229 */
1230 1230
diff --git a/drivers/net/tulip/eeprom.c b/drivers/net/tulip/eeprom.c
index 3031ed9c4a1a..296486bf0956 100644
--- a/drivers/net/tulip/eeprom.c
+++ b/drivers/net/tulip/eeprom.c
@@ -115,7 +115,7 @@ static void __devinit tulip_build_fake_mediatable(struct tulip_private *tp)
115 0x02, /* phy reset sequence length */ 115 0x02, /* phy reset sequence length */
116 0x01, 0x00, /* phy reset sequence */ 116 0x01, 0x00, /* phy reset sequence */
117 0x00, 0x78, /* media capabilities */ 117 0x00, 0x78, /* media capabilities */
118 0x00, 0xe0, /* nway advertisment */ 118 0x00, 0xe0, /* nway advertisement */
119 0x00, 0x05, /* fdx bit map */ 119 0x00, 0x05, /* fdx bit map */
120 0x00, 0x06 /* ttm bit map */ 120 0x00, 0x06 /* ttm bit map */
121 }; 121 };
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 7fa5ec2de942..82653cb07857 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -846,7 +846,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
846 if(typhoon_num_free_tx(txRing) < (numDesc + 2)) { 846 if(typhoon_num_free_tx(txRing) < (numDesc + 2)) {
847 netif_stop_queue(dev); 847 netif_stop_queue(dev);
848 848
849 /* A Tx complete IRQ could have gotten inbetween, making 849 /* A Tx complete IRQ could have gotten between, making
850 * the ring free again. Only need to recheck here, since 850 * the ring free again. Only need to recheck here, since
851 * Tx is serialized. 851 * Tx is serialized.
852 */ 852 */
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h
index 055b87ab4f07..d12fcad145e9 100644
--- a/drivers/net/ucc_geth.h
+++ b/drivers/net/ucc_geth.h
@@ -80,7 +80,7 @@ struct ucc_geth {
80 frames) received that were between 128 80 frames) received that were between 128
81 (Including FCS length==4) and 255 octets */ 81 (Including FCS length==4) and 255 octets */
82 u32 txok; /* Total number of octets residing in frames 82 u32 txok; /* Total number of octets residing in frames
83 that where involved in successfull 83 that where involved in successful
84 transmission */ 84 transmission */
85 u16 txcf; /* Total number of PAUSE control frames 85 u16 txcf; /* Total number of PAUSE control frames
86 transmitted by this MAC */ 86 transmitted by this MAC */
@@ -759,7 +759,7 @@ struct ucc_geth_hardware_statistics {
759 frames) received that were between 128 759 frames) received that were between 128
760 (Including FCS length==4) and 255 octets */ 760 (Including FCS length==4) and 255 octets */
761 u32 txok; /* Total number of octets residing in frames 761 u32 txok; /* Total number of octets residing in frames
762 that where involved in successfull 762 that where involved in successful
763 transmission */ 763 transmission */
764 u16 txcf; /* Total number of PAUSE control frames 764 u16 txcf; /* Total number of PAUSE control frames
765 transmitted by this MAC */ 765 transmitted by this MAC */
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig
index 6f600cced6e1..3ec22c307797 100644
--- a/drivers/net/usb/Kconfig
+++ b/drivers/net/usb/Kconfig
@@ -433,4 +433,19 @@ config USB_SIERRA_NET
433 To compile this driver as a module, choose M here: the 433 To compile this driver as a module, choose M here: the
434 module will be called sierra_net. 434 module will be called sierra_net.
435 435
436config USB_VL600
437 tristate "LG VL600 modem dongle"
438 depends on USB_NET_CDCETHER
439 select USB_ACM
440 help
441 Select this if you want to use an LG Electronics 4G/LTE usb modem
442 called VL600. This driver only handles the ethernet
443 interface exposed by the modem firmware. To establish a connection
444 you will first need a userspace program that sends the right
445 command to the modem through its CDC ACM port, and most
446 likely also a DHCP client. See this thread about using the
447 4G modem from Verizon:
448
449 http://ubuntuforums.org/showpost.php?p=10589647&postcount=17
450
436endmenu 451endmenu
diff --git a/drivers/net/usb/Makefile b/drivers/net/usb/Makefile
index cac170301187..c7ec8a5f0a90 100644
--- a/drivers/net/usb/Makefile
+++ b/drivers/net/usb/Makefile
@@ -27,4 +27,5 @@ obj-$(CONFIG_USB_IPHETH) += ipheth.o
27obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o 27obj-$(CONFIG_USB_SIERRA_NET) += sierra_net.o
28obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o 28obj-$(CONFIG_USB_NET_CX82310_ETH) += cx82310_eth.o
29obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o 29obj-$(CONFIG_USB_NET_CDC_NCM) += cdc_ncm.o
30obj-$(CONFIG_USB_VL600) += lg-vl600.o
30 31
diff --git a/drivers/net/usb/cdc_eem.c b/drivers/net/usb/cdc_eem.c
index 5f3b97668e63..882f53f708df 100644
--- a/drivers/net/usb/cdc_eem.c
+++ b/drivers/net/usb/cdc_eem.c
@@ -190,7 +190,7 @@ static int eem_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
190 190
191 /* 191 /*
192 * EEM packet header format: 192 * EEM packet header format:
193 * b0..14: EEM type dependant (Data or Command) 193 * b0..14: EEM type dependent (Data or Command)
194 * b15: bmType 194 * b15: bmType
195 */ 195 */
196 header = get_unaligned_le16(skb->data); 196 header = get_unaligned_le16(skb->data);
@@ -340,7 +340,7 @@ next:
340 340
341static const struct driver_info eem_info = { 341static const struct driver_info eem_info = {
342 .description = "CDC EEM Device", 342 .description = "CDC EEM Device",
343 .flags = FLAG_ETHER, 343 .flags = FLAG_ETHER | FLAG_POINTTOPOINT,
344 .bind = eem_bind, 344 .bind = eem_bind,
345 .rx_fixup = eem_rx_fixup, 345 .rx_fixup = eem_rx_fixup,
346 .tx_fixup = eem_tx_fixup, 346 .tx_fixup = eem_tx_fixup,
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 9a60e415d76b..341f7056a800 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -378,7 +378,7 @@ static void dumpspeed(struct usbnet *dev, __le32 *speeds)
378 __le32_to_cpu(speeds[1]) / 1000); 378 __le32_to_cpu(speeds[1]) / 1000);
379} 379}
380 380
381static void cdc_status(struct usbnet *dev, struct urb *urb) 381void usbnet_cdc_status(struct usbnet *dev, struct urb *urb)
382{ 382{
383 struct usb_cdc_notification *event; 383 struct usb_cdc_notification *event;
384 384
@@ -418,8 +418,9 @@ static void cdc_status(struct usbnet *dev, struct urb *urb)
418 break; 418 break;
419 } 419 }
420} 420}
421EXPORT_SYMBOL_GPL(usbnet_cdc_status);
421 422
422static int cdc_bind(struct usbnet *dev, struct usb_interface *intf) 423int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
423{ 424{
424 int status; 425 int status;
425 struct cdc_state *info = (void *) &dev->data; 426 struct cdc_state *info = (void *) &dev->data;
@@ -441,6 +442,7 @@ static int cdc_bind(struct usbnet *dev, struct usb_interface *intf)
441 */ 442 */
442 return 0; 443 return 0;
443} 444}
445EXPORT_SYMBOL_GPL(usbnet_cdc_bind);
444 446
445static int cdc_manage_power(struct usbnet *dev, int on) 447static int cdc_manage_power(struct usbnet *dev, int on)
446{ 448{
@@ -450,20 +452,20 @@ static int cdc_manage_power(struct usbnet *dev, int on)
450 452
451static const struct driver_info cdc_info = { 453static const struct driver_info cdc_info = {
452 .description = "CDC Ethernet Device", 454 .description = "CDC Ethernet Device",
453 .flags = FLAG_ETHER, 455 .flags = FLAG_ETHER | FLAG_POINTTOPOINT,
454 // .check_connect = cdc_check_connect, 456 // .check_connect = cdc_check_connect,
455 .bind = cdc_bind, 457 .bind = usbnet_cdc_bind,
456 .unbind = usbnet_cdc_unbind, 458 .unbind = usbnet_cdc_unbind,
457 .status = cdc_status, 459 .status = usbnet_cdc_status,
458 .manage_power = cdc_manage_power, 460 .manage_power = cdc_manage_power,
459}; 461};
460 462
461static const struct driver_info mbm_info = { 463static const struct driver_info mbm_info = {
462 .description = "Mobile Broadband Network Device", 464 .description = "Mobile Broadband Network Device",
463 .flags = FLAG_WWAN, 465 .flags = FLAG_WWAN,
464 .bind = cdc_bind, 466 .bind = usbnet_cdc_bind,
465 .unbind = usbnet_cdc_unbind, 467 .unbind = usbnet_cdc_unbind,
466 .status = cdc_status, 468 .status = usbnet_cdc_status,
467 .manage_power = cdc_manage_power, 469 .manage_power = cdc_manage_power,
468}; 470};
469 471
@@ -560,6 +562,13 @@ static const struct usb_device_id products [] = {
560 .driver_info = 0, 562 .driver_info = 0,
561}, 563},
562 564
565/* LG Electronics VL600 wants additional headers on every frame */
566{
567 USB_DEVICE_AND_INTERFACE_INFO(0x1004, 0x61aa, USB_CLASS_COMM,
568 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
569 .driver_info = 0,
570},
571
563/* 572/*
564 * WHITELIST!!! 573 * WHITELIST!!!
565 * 574 *
diff --git a/drivers/net/usb/cdc_ncm.c b/drivers/net/usb/cdc_ncm.c
index 7113168473cf..967371f04454 100644
--- a/drivers/net/usb/cdc_ncm.c
+++ b/drivers/net/usb/cdc_ncm.c
@@ -1237,7 +1237,7 @@ static int cdc_ncm_manage_power(struct usbnet *dev, int status)
1237 1237
1238static const struct driver_info cdc_ncm_info = { 1238static const struct driver_info cdc_ncm_info = {
1239 .description = "CDC NCM", 1239 .description = "CDC NCM",
1240 .flags = FLAG_NO_SETINT | FLAG_MULTI_PACKET, 1240 .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT | FLAG_MULTI_PACKET,
1241 .bind = cdc_ncm_bind, 1241 .bind = cdc_ncm_bind,
1242 .unbind = cdc_ncm_unbind, 1242 .unbind = cdc_ncm_unbind,
1243 .check_connect = cdc_ncm_check_connect, 1243 .check_connect = cdc_ncm_check_connect,
diff --git a/drivers/net/usb/cdc_subset.c b/drivers/net/usb/cdc_subset.c
index ca39ace0b0eb..fc5f13d47ad9 100644
--- a/drivers/net/usb/cdc_subset.c
+++ b/drivers/net/usb/cdc_subset.c
@@ -89,6 +89,7 @@ static int always_connected (struct usbnet *dev)
89 89
90static const struct driver_info ali_m5632_info = { 90static const struct driver_info ali_m5632_info = {
91 .description = "ALi M5632", 91 .description = "ALi M5632",
92 .flags = FLAG_POINTTOPOINT,
92}; 93};
93 94
94#endif 95#endif
@@ -110,6 +111,7 @@ static const struct driver_info ali_m5632_info = {
110 111
111static const struct driver_info an2720_info = { 112static const struct driver_info an2720_info = {
112 .description = "AnchorChips/Cypress 2720", 113 .description = "AnchorChips/Cypress 2720",
114 .flags = FLAG_POINTTOPOINT,
113 // no reset available! 115 // no reset available!
114 // no check_connect available! 116 // no check_connect available!
115 117
@@ -132,6 +134,7 @@ static const struct driver_info an2720_info = {
132 134
133static const struct driver_info belkin_info = { 135static const struct driver_info belkin_info = {
134 .description = "Belkin, eTEK, or compatible", 136 .description = "Belkin, eTEK, or compatible",
137 .flags = FLAG_POINTTOPOINT,
135}; 138};
136 139
137#endif /* CONFIG_USB_BELKIN */ 140#endif /* CONFIG_USB_BELKIN */
@@ -157,6 +160,7 @@ static const struct driver_info belkin_info = {
157static const struct driver_info epson2888_info = { 160static const struct driver_info epson2888_info = {
158 .description = "Epson USB Device", 161 .description = "Epson USB Device",
159 .check_connect = always_connected, 162 .check_connect = always_connected,
163 .flags = FLAG_POINTTOPOINT,
160 164
161 .in = 4, .out = 3, 165 .in = 4, .out = 3,
162}; 166};
@@ -173,6 +177,7 @@ static const struct driver_info epson2888_info = {
173#define HAVE_HARDWARE 177#define HAVE_HARDWARE
174static const struct driver_info kc2190_info = { 178static const struct driver_info kc2190_info = {
175 .description = "KC Technology KC-190", 179 .description = "KC Technology KC-190",
180 .flags = FLAG_POINTTOPOINT,
176}; 181};
177#endif /* CONFIG_USB_KC2190 */ 182#endif /* CONFIG_USB_KC2190 */
178 183
@@ -200,16 +205,19 @@ static const struct driver_info kc2190_info = {
200static const struct driver_info linuxdev_info = { 205static const struct driver_info linuxdev_info = {
201 .description = "Linux Device", 206 .description = "Linux Device",
202 .check_connect = always_connected, 207 .check_connect = always_connected,
208 .flags = FLAG_POINTTOPOINT,
203}; 209};
204 210
205static const struct driver_info yopy_info = { 211static const struct driver_info yopy_info = {
206 .description = "Yopy", 212 .description = "Yopy",
207 .check_connect = always_connected, 213 .check_connect = always_connected,
214 .flags = FLAG_POINTTOPOINT,
208}; 215};
209 216
210static const struct driver_info blob_info = { 217static const struct driver_info blob_info = {
211 .description = "Boot Loader OBject", 218 .description = "Boot Loader OBject",
212 .check_connect = always_connected, 219 .check_connect = always_connected,
220 .flags = FLAG_POINTTOPOINT,
213}; 221};
214 222
215#endif /* CONFIG_USB_ARMLINUX */ 223#endif /* CONFIG_USB_ARMLINUX */
diff --git a/drivers/net/usb/gl620a.c b/drivers/net/usb/gl620a.c
index dcd57c37ef73..c4cfd1dea881 100644
--- a/drivers/net/usb/gl620a.c
+++ b/drivers/net/usb/gl620a.c
@@ -193,7 +193,7 @@ static int genelink_bind(struct usbnet *dev, struct usb_interface *intf)
193 193
194static const struct driver_info genelink_info = { 194static const struct driver_info genelink_info = {
195 .description = "Genesys GeneLink", 195 .description = "Genesys GeneLink",
196 .flags = FLAG_FRAMING_GL | FLAG_NO_SETINT, 196 .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_GL | FLAG_NO_SETINT,
197 .bind = genelink_bind, 197 .bind = genelink_bind,
198 .rx_fixup = genelink_rx_fixup, 198 .rx_fixup = genelink_rx_fixup,
199 .tx_fixup = genelink_tx_fixup, 199 .tx_fixup = genelink_tx_fixup,
diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
index 7dc84971f26f..ad0298f9b5f9 100644
--- a/drivers/net/usb/kaweth.c
+++ b/drivers/net/usb/kaweth.c
@@ -1221,7 +1221,7 @@ static void kaweth_disconnect(struct usb_interface *intf)
1221 1221
1222 usb_set_intfdata(intf, NULL); 1222 usb_set_intfdata(intf, NULL);
1223 if (!kaweth) { 1223 if (!kaweth) {
1224 dev_warn(&intf->dev, "unregistering non-existant device\n"); 1224 dev_warn(&intf->dev, "unregistering non-existent device\n");
1225 return; 1225 return;
1226 } 1226 }
1227 netdev = kaweth->net; 1227 netdev = kaweth->net;
diff --git a/drivers/net/usb/lg-vl600.c b/drivers/net/usb/lg-vl600.c
new file mode 100644
index 000000000000..1d83ccfd7277
--- /dev/null
+++ b/drivers/net/usb/lg-vl600.c
@@ -0,0 +1,346 @@
1/*
2 * Ethernet interface part of the LG VL600 LTE modem (4G dongle)
3 *
4 * Copyright (C) 2011 Intel Corporation
5 * Author: Andrzej Zaborowski <balrogg@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#include <linux/etherdevice.h>
22#include <linux/ethtool.h>
23#include <linux/mii.h>
24#include <linux/usb.h>
25#include <linux/usb/cdc.h>
26#include <linux/usb/usbnet.h>
27#include <linux/if_ether.h>
28#include <linux/if_arp.h>
29#include <linux/inetdevice.h>
30
31/*
32 * The device has a CDC ACM port for modem control (it claims to be
33 * CDC ACM anyway) and a CDC Ethernet port for actual network data.
34 * It will however ignore data on both ports that is not encapsulated
35 * in a specific way, any data returned is also encapsulated the same
36 * way. The headers don't seem to follow any popular standard.
37 *
38 * This driver adds and strips these headers from the ethernet frames
39 * sent/received from the CDC Ethernet port. The proprietary header
40 * replaces the standard ethernet header in a packet so only actual
41 * ethernet frames are allowed. The headers allow some form of
42 * multiplexing by using non standard values of the .h_proto field.
43 * Windows/Mac drivers do send a couple of such frames to the device
44 * during initialisation, with protocol set to 0x0906 or 0x0b06 and (what
45 * seems to be) a flag in the .dummy_flags. This doesn't seem necessary
46 * for modem operation but can possibly be used for GPS or other funcitons.
47 */
48
49struct vl600_frame_hdr {
50 __le32 len;
51 __le32 serial;
52 __le32 pkt_cnt;
53 __le32 dummy_flags;
54 __le32 dummy;
55 __le32 magic;
56} __attribute__((packed));
57
58struct vl600_pkt_hdr {
59 __le32 dummy[2];
60 __le32 len;
61 __be16 h_proto;
62} __attribute__((packed));
63
64struct vl600_state {
65 struct sk_buff *current_rx_buf;
66};
67
68static int vl600_bind(struct usbnet *dev, struct usb_interface *intf)
69{
70 int ret;
71 struct vl600_state *s = kzalloc(sizeof(struct vl600_state), GFP_KERNEL);
72
73 if (!s)
74 return -ENOMEM;
75
76 ret = usbnet_cdc_bind(dev, intf);
77 if (ret) {
78 kfree(s);
79 return ret;
80 }
81
82 dev->driver_priv = s;
83
84 /* ARP packets don't go through, but they're also of no use. The
85 * subnet has only two hosts anyway: us and the gateway / DHCP
86 * server (probably simulated by modem firmware or network operator)
87 * whose address changes everytime we connect to the intarwebz and
88 * who doesn't bother answering ARP requests either. So hardware
89 * addresses have no meaning, the destination and the source of every
90 * packet depend only on whether it is on the IN or OUT endpoint. */
91 dev->net->flags |= IFF_NOARP;
92
93 return ret;
94}
95
96static void vl600_unbind(struct usbnet *dev, struct usb_interface *intf)
97{
98 struct vl600_state *s = dev->driver_priv;
99
100 if (s->current_rx_buf)
101 dev_kfree_skb(s->current_rx_buf);
102
103 kfree(s);
104
105 return usbnet_cdc_unbind(dev, intf);
106}
107
108static int vl600_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
109{
110 struct vl600_frame_hdr *frame;
111 struct vl600_pkt_hdr *packet;
112 struct ethhdr *ethhdr;
113 int packet_len, count;
114 struct sk_buff *buf = skb;
115 struct sk_buff *clone;
116 struct vl600_state *s = dev->driver_priv;
117
118 /* Frame lengths are generally 4B multiplies but every couple of
119 * hours there's an odd number of bytes sized yet correct frame,
120 * so don't require this. */
121
122 /* Allow a packet (or multiple packets batched together) to be
123 * split across many frames. We don't allow a new batch to
124 * begin in the same frame another one is ending however, and no
125 * leading or trailing pad bytes. */
126 if (s->current_rx_buf) {
127 frame = (struct vl600_frame_hdr *) s->current_rx_buf->data;
128 if (skb->len + s->current_rx_buf->len >
129 le32_to_cpup(&frame->len)) {
130 netif_err(dev, ifup, dev->net, "Fragment too long\n");
131 dev->net->stats.rx_length_errors++;
132 goto error;
133 }
134
135 buf = s->current_rx_buf;
136 memcpy(skb_put(buf, skb->len), skb->data, skb->len);
137 } else if (skb->len < 4) {
138 netif_err(dev, ifup, dev->net, "Frame too short\n");
139 dev->net->stats.rx_length_errors++;
140 goto error;
141 }
142
143 frame = (struct vl600_frame_hdr *) buf->data;
144 /* NOTE: Should check that frame->magic == 0x53544448?
145 * Otherwise if we receive garbage at the beginning of the frame
146 * we may end up allocating a huge buffer and saving all the
147 * future incoming data into it. */
148
149 if (buf->len < sizeof(*frame) ||
150 buf->len != le32_to_cpup(&frame->len)) {
151 /* Save this fragment for later assembly */
152 if (s->current_rx_buf)
153 return 0;
154
155 s->current_rx_buf = skb_copy_expand(skb, 0,
156 le32_to_cpup(&frame->len), GFP_ATOMIC);
157 if (!s->current_rx_buf) {
158 netif_err(dev, ifup, dev->net, "Reserving %i bytes "
159 "for packet assembly failed.\n",
160 le32_to_cpup(&frame->len));
161 dev->net->stats.rx_errors++;
162 }
163
164 return 0;
165 }
166
167 count = le32_to_cpup(&frame->pkt_cnt);
168
169 skb_pull(buf, sizeof(*frame));
170
171 while (count--) {
172 if (buf->len < sizeof(*packet)) {
173 netif_err(dev, ifup, dev->net, "Packet too short\n");
174 goto error;
175 }
176
177 packet = (struct vl600_pkt_hdr *) buf->data;
178 packet_len = sizeof(*packet) + le32_to_cpup(&packet->len);
179 if (packet_len > buf->len) {
180 netif_err(dev, ifup, dev->net,
181 "Bad packet length stored in header\n");
182 goto error;
183 }
184
185 /* Packet header is same size as the ethernet header
186 * (sizeof(*packet) == sizeof(*ethhdr)), additionally
187 * the h_proto field is in the same place so we just leave it
188 * alone and fill in the remaining fields.
189 */
190 ethhdr = (struct ethhdr *) skb->data;
191 if (be16_to_cpup(&ethhdr->h_proto) == ETH_P_ARP &&
192 buf->len > 0x26) {
193 /* Copy the addresses from packet contents */
194 memcpy(ethhdr->h_source,
195 &buf->data[sizeof(*ethhdr) + 0x8],
196 ETH_ALEN);
197 memcpy(ethhdr->h_dest,
198 &buf->data[sizeof(*ethhdr) + 0x12],
199 ETH_ALEN);
200 } else {
201 memset(ethhdr->h_source, 0, ETH_ALEN);
202 memcpy(ethhdr->h_dest, dev->net->dev_addr, ETH_ALEN);
203 }
204
205 if (count) {
206 /* Not the last packet in this batch */
207 clone = skb_clone(buf, GFP_ATOMIC);
208 if (!clone)
209 goto error;
210
211 skb_trim(clone, packet_len);
212 usbnet_skb_return(dev, clone);
213
214 skb_pull(buf, (packet_len + 3) & ~3);
215 } else {
216 skb_trim(buf, packet_len);
217
218 if (s->current_rx_buf) {
219 usbnet_skb_return(dev, buf);
220 s->current_rx_buf = NULL;
221 return 0;
222 }
223
224 return 1;
225 }
226 }
227
228error:
229 if (s->current_rx_buf) {
230 dev_kfree_skb_any(s->current_rx_buf);
231 s->current_rx_buf = NULL;
232 }
233 dev->net->stats.rx_errors++;
234 return 0;
235}
236
237static struct sk_buff *vl600_tx_fixup(struct usbnet *dev,
238 struct sk_buff *skb, gfp_t flags)
239{
240 struct sk_buff *ret;
241 struct vl600_frame_hdr *frame;
242 struct vl600_pkt_hdr *packet;
243 static uint32_t serial = 1;
244 int orig_len = skb->len - sizeof(struct ethhdr);
245 int full_len = (skb->len + sizeof(struct vl600_frame_hdr) + 3) & ~3;
246
247 frame = (struct vl600_frame_hdr *) skb->data;
248 if (skb->len > sizeof(*frame) && skb->len == le32_to_cpup(&frame->len))
249 return skb; /* Already encapsulated? */
250
251 if (skb->len < sizeof(struct ethhdr))
252 /* Drop, device can only deal with ethernet packets */
253 return NULL;
254
255 if (!skb_cloned(skb)) {
256 int headroom = skb_headroom(skb);
257 int tailroom = skb_tailroom(skb);
258
259 if (tailroom >= full_len - skb->len - sizeof(*frame) &&
260 headroom >= sizeof(*frame))
261 /* There's enough head and tail room */
262 goto encapsulate;
263
264 if (headroom + tailroom + skb->len >= full_len) {
265 /* There's enough total room, just readjust */
266 skb->data = memmove(skb->head + sizeof(*frame),
267 skb->data, skb->len);
268 skb_set_tail_pointer(skb, skb->len);
269 goto encapsulate;
270 }
271 }
272
273 /* Alloc a new skb with the required size */
274 ret = skb_copy_expand(skb, sizeof(struct vl600_frame_hdr), full_len -
275 skb->len - sizeof(struct vl600_frame_hdr), flags);
276 dev_kfree_skb_any(skb);
277 if (!ret)
278 return ret;
279 skb = ret;
280
281encapsulate:
282 /* Packet header is same size as ethernet packet header
283 * (sizeof(*packet) == sizeof(struct ethhdr)), additionally the
284 * h_proto field is in the same place so we just leave it alone and
285 * overwrite the remaining fields.
286 */
287 packet = (struct vl600_pkt_hdr *) skb->data;
288 memset(&packet->dummy, 0, sizeof(packet->dummy));
289 packet->len = cpu_to_le32(orig_len);
290
291 frame = (struct vl600_frame_hdr *) skb_push(skb, sizeof(*frame));
292 memset(frame, 0, sizeof(*frame));
293 frame->len = cpu_to_le32(full_len);
294 frame->serial = cpu_to_le32(serial++);
295 frame->pkt_cnt = cpu_to_le32(1);
296
297 if (skb->len < full_len) /* Pad */
298 skb_put(skb, full_len - skb->len);
299
300 return skb;
301}
302
303static const struct driver_info vl600_info = {
304 .description = "LG VL600 modem",
305 .flags = FLAG_ETHER | FLAG_RX_ASSEMBLE,
306 .bind = vl600_bind,
307 .unbind = vl600_unbind,
308 .status = usbnet_cdc_status,
309 .rx_fixup = vl600_rx_fixup,
310 .tx_fixup = vl600_tx_fixup,
311};
312
313static const struct usb_device_id products[] = {
314 {
315 USB_DEVICE_AND_INTERFACE_INFO(0x1004, 0x61aa, USB_CLASS_COMM,
316 USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
317 .driver_info = (unsigned long) &vl600_info,
318 },
319 {}, /* End */
320};
321MODULE_DEVICE_TABLE(usb, products);
322
323static struct usb_driver lg_vl600_driver = {
324 .name = "lg-vl600",
325 .id_table = products,
326 .probe = usbnet_probe,
327 .disconnect = usbnet_disconnect,
328 .suspend = usbnet_suspend,
329 .resume = usbnet_resume,
330};
331
332static int __init vl600_init(void)
333{
334 return usb_register(&lg_vl600_driver);
335}
336module_init(vl600_init);
337
338static void __exit vl600_exit(void)
339{
340 usb_deregister(&lg_vl600_driver);
341}
342module_exit(vl600_exit);
343
344MODULE_AUTHOR("Anrzej Zaborowski");
345MODULE_DESCRIPTION("LG-VL600 modem's ethernet link");
346MODULE_LICENSE("GPL");
diff --git a/drivers/net/usb/net1080.c b/drivers/net/usb/net1080.c
index ba72a7281cb0..01db4602a39e 100644
--- a/drivers/net/usb/net1080.c
+++ b/drivers/net/usb/net1080.c
@@ -560,7 +560,7 @@ static int net1080_bind(struct usbnet *dev, struct usb_interface *intf)
560 560
561static const struct driver_info net1080_info = { 561static const struct driver_info net1080_info = {
562 .description = "NetChip TurboCONNECT", 562 .description = "NetChip TurboCONNECT",
563 .flags = FLAG_FRAMING_NC, 563 .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_NC,
564 .bind = net1080_bind, 564 .bind = net1080_bind,
565 .reset = net1080_reset, 565 .reset = net1080_reset,
566 .check_connect = net1080_check_connect, 566 .check_connect = net1080_check_connect,
diff --git a/drivers/net/usb/plusb.c b/drivers/net/usb/plusb.c
index 08ad269f6b4e..823c53751307 100644
--- a/drivers/net/usb/plusb.c
+++ b/drivers/net/usb/plusb.c
@@ -96,7 +96,7 @@ static int pl_reset(struct usbnet *dev)
96 96
97static const struct driver_info prolific_info = { 97static const struct driver_info prolific_info = {
98 .description = "Prolific PL-2301/PL-2302", 98 .description = "Prolific PL-2301/PL-2302",
99 .flags = FLAG_NO_SETINT, 99 .flags = FLAG_POINTTOPOINT | FLAG_NO_SETINT,
100 /* some PL-2302 versions seem to fail usb_set_interface() */ 100 /* some PL-2302 versions seem to fail usb_set_interface() */
101 .reset = pl_reset, 101 .reset = pl_reset,
102}; 102};
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index dd8a4adf48ca..5994a25c56ac 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -573,7 +573,7 @@ EXPORT_SYMBOL_GPL(rndis_tx_fixup);
573 573
574static const struct driver_info rndis_info = { 574static const struct driver_info rndis_info = {
575 .description = "RNDIS device", 575 .description = "RNDIS device",
576 .flags = FLAG_ETHER | FLAG_FRAMING_RN | FLAG_NO_SETINT, 576 .flags = FLAG_ETHER | FLAG_POINTTOPOINT | FLAG_FRAMING_RN | FLAG_NO_SETINT,
577 .bind = rndis_bind, 577 .bind = rndis_bind,
578 .unbind = rndis_unbind, 578 .unbind = rndis_unbind,
579 .status = rndis_status, 579 .status = rndis_status,
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index bc86f4b6ecc2..47a6c870b51f 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -49,6 +49,8 @@
49 49
50struct smsc95xx_priv { 50struct smsc95xx_priv {
51 u32 mac_cr; 51 u32 mac_cr;
52 u32 hash_hi;
53 u32 hash_lo;
52 spinlock_t mac_cr_lock; 54 spinlock_t mac_cr_lock;
53 bool use_tx_csum; 55 bool use_tx_csum;
54 bool use_rx_csum; 56 bool use_rx_csum;
@@ -370,10 +372,11 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
370{ 372{
371 struct usbnet *dev = netdev_priv(netdev); 373 struct usbnet *dev = netdev_priv(netdev);
372 struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]); 374 struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
373 u32 hash_hi = 0;
374 u32 hash_lo = 0;
375 unsigned long flags; 375 unsigned long flags;
376 376
377 pdata->hash_hi = 0;
378 pdata->hash_lo = 0;
379
377 spin_lock_irqsave(&pdata->mac_cr_lock, flags); 380 spin_lock_irqsave(&pdata->mac_cr_lock, flags);
378 381
379 if (dev->net->flags & IFF_PROMISC) { 382 if (dev->net->flags & IFF_PROMISC) {
@@ -394,13 +397,13 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
394 u32 bitnum = smsc95xx_hash(ha->addr); 397 u32 bitnum = smsc95xx_hash(ha->addr);
395 u32 mask = 0x01 << (bitnum & 0x1F); 398 u32 mask = 0x01 << (bitnum & 0x1F);
396 if (bitnum & 0x20) 399 if (bitnum & 0x20)
397 hash_hi |= mask; 400 pdata->hash_hi |= mask;
398 else 401 else
399 hash_lo |= mask; 402 pdata->hash_lo |= mask;
400 } 403 }
401 404
402 netif_dbg(dev, drv, dev->net, "HASHH=0x%08X, HASHL=0x%08X\n", 405 netif_dbg(dev, drv, dev->net, "HASHH=0x%08X, HASHL=0x%08X\n",
403 hash_hi, hash_lo); 406 pdata->hash_hi, pdata->hash_lo);
404 } else { 407 } else {
405 netif_dbg(dev, drv, dev->net, "receive own packets only\n"); 408 netif_dbg(dev, drv, dev->net, "receive own packets only\n");
406 pdata->mac_cr &= 409 pdata->mac_cr &=
@@ -410,8 +413,8 @@ static void smsc95xx_set_multicast(struct net_device *netdev)
410 spin_unlock_irqrestore(&pdata->mac_cr_lock, flags); 413 spin_unlock_irqrestore(&pdata->mac_cr_lock, flags);
411 414
412 /* Initiate async writes, as we can't wait for completion here */ 415 /* Initiate async writes, as we can't wait for completion here */
413 smsc95xx_write_reg_async(dev, HASHH, &hash_hi); 416 smsc95xx_write_reg_async(dev, HASHH, &pdata->hash_hi);
414 smsc95xx_write_reg_async(dev, HASHL, &hash_lo); 417 smsc95xx_write_reg_async(dev, HASHL, &pdata->hash_lo);
415 smsc95xx_write_reg_async(dev, MAC_CR, &pdata->mac_cr); 418 smsc95xx_write_reg_async(dev, MAC_CR, &pdata->mac_cr);
416} 419}
417 420
@@ -1310,6 +1313,21 @@ static const struct usb_device_id products[] = {
1310 USB_DEVICE(0x0424, 0x9909), 1313 USB_DEVICE(0x0424, 0x9909),
1311 .driver_info = (unsigned long) &smsc95xx_info, 1314 .driver_info = (unsigned long) &smsc95xx_info,
1312 }, 1315 },
1316 {
1317 /* SMSC LAN9530 USB Ethernet Device */
1318 USB_DEVICE(0x0424, 0x9530),
1319 .driver_info = (unsigned long) &smsc95xx_info,
1320 },
1321 {
1322 /* SMSC LAN9730 USB Ethernet Device */
1323 USB_DEVICE(0x0424, 0x9730),
1324 .driver_info = (unsigned long) &smsc95xx_info,
1325 },
1326 {
1327 /* SMSC LAN89530 USB Ethernet Device */
1328 USB_DEVICE(0x0424, 0x9E08),
1329 .driver_info = (unsigned long) &smsc95xx_info,
1330 },
1313 { }, /* END */ 1331 { }, /* END */
1314}; 1332};
1315MODULE_DEVICE_TABLE(usb, products); 1333MODULE_DEVICE_TABLE(usb, products);
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 95c41d56631c..069c1cf0fdf7 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -387,8 +387,12 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
387static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) 387static inline void rx_process (struct usbnet *dev, struct sk_buff *skb)
388{ 388{
389 if (dev->driver_info->rx_fixup && 389 if (dev->driver_info->rx_fixup &&
390 !dev->driver_info->rx_fixup (dev, skb)) 390 !dev->driver_info->rx_fixup (dev, skb)) {
391 goto error; 391 /* With RX_ASSEMBLE, rx_fixup() must update counters */
392 if (!(dev->driver_info->flags & FLAG_RX_ASSEMBLE))
393 dev->net->stats.rx_errors++;
394 goto done;
395 }
392 // else network stack removes extra byte if we forced a short packet 396 // else network stack removes extra byte if we forced a short packet
393 397
394 if (skb->len) { 398 if (skb->len) {
@@ -401,8 +405,8 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb)
401 } 405 }
402 406
403 netif_dbg(dev, rx_err, dev->net, "drop\n"); 407 netif_dbg(dev, rx_err, dev->net, "drop\n");
404error:
405 dev->net->stats.rx_errors++; 408 dev->net->stats.rx_errors++;
409done:
406 skb_queue_tail(&dev->done, skb); 410 skb_queue_tail(&dev->done, skb);
407} 411}
408 412
@@ -1376,7 +1380,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
1376 // else "eth%d" when there's reasonable doubt. userspace 1380 // else "eth%d" when there's reasonable doubt. userspace
1377 // can rename the link if it knows better. 1381 // can rename the link if it knows better.
1378 if ((dev->driver_info->flags & FLAG_ETHER) != 0 && 1382 if ((dev->driver_info->flags & FLAG_ETHER) != 0 &&
1379 (net->dev_addr [0] & 0x02) == 0) 1383 ((dev->driver_info->flags & FLAG_POINTTOPOINT) == 0 ||
1384 (net->dev_addr [0] & 0x02) == 0))
1380 strcpy (net->name, "eth%d"); 1385 strcpy (net->name, "eth%d");
1381 /* WLAN devices should always be named "wlan%d" */ 1386 /* WLAN devices should always be named "wlan%d" */
1382 if ((dev->driver_info->flags & FLAG_WLAN) != 0) 1387 if ((dev->driver_info->flags & FLAG_WLAN) != 0)
diff --git a/drivers/net/usb/zaurus.c b/drivers/net/usb/zaurus.c
index 3eb0b167b5b4..241756e0e86f 100644
--- a/drivers/net/usb/zaurus.c
+++ b/drivers/net/usb/zaurus.c
@@ -102,7 +102,7 @@ static int always_connected (struct usbnet *dev)
102 102
103static const struct driver_info zaurus_sl5x00_info = { 103static const struct driver_info zaurus_sl5x00_info = {
104 .description = "Sharp Zaurus SL-5x00", 104 .description = "Sharp Zaurus SL-5x00",
105 .flags = FLAG_FRAMING_Z, 105 .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_Z,
106 .check_connect = always_connected, 106 .check_connect = always_connected,
107 .bind = zaurus_bind, 107 .bind = zaurus_bind,
108 .unbind = usbnet_cdc_unbind, 108 .unbind = usbnet_cdc_unbind,
@@ -112,7 +112,7 @@ static const struct driver_info zaurus_sl5x00_info = {
112 112
113static const struct driver_info zaurus_pxa_info = { 113static const struct driver_info zaurus_pxa_info = {
114 .description = "Sharp Zaurus, PXA-2xx based", 114 .description = "Sharp Zaurus, PXA-2xx based",
115 .flags = FLAG_FRAMING_Z, 115 .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_Z,
116 .check_connect = always_connected, 116 .check_connect = always_connected,
117 .bind = zaurus_bind, 117 .bind = zaurus_bind,
118 .unbind = usbnet_cdc_unbind, 118 .unbind = usbnet_cdc_unbind,
@@ -122,7 +122,7 @@ static const struct driver_info zaurus_pxa_info = {
122 122
123static const struct driver_info olympus_mxl_info = { 123static const struct driver_info olympus_mxl_info = {
124 .description = "Olympus R1000", 124 .description = "Olympus R1000",
125 .flags = FLAG_FRAMING_Z, 125 .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_Z,
126 .check_connect = always_connected, 126 .check_connect = always_connected,
127 .bind = zaurus_bind, 127 .bind = zaurus_bind,
128 .unbind = usbnet_cdc_unbind, 128 .unbind = usbnet_cdc_unbind,
@@ -258,7 +258,7 @@ bad_desc:
258 258
259static const struct driver_info bogus_mdlm_info = { 259static const struct driver_info bogus_mdlm_info = {
260 .description = "pseudo-MDLM (BLAN) device", 260 .description = "pseudo-MDLM (BLAN) device",
261 .flags = FLAG_FRAMING_Z, 261 .flags = FLAG_POINTTOPOINT | FLAG_FRAMING_Z,
262 .check_connect = always_connected, 262 .check_connect = always_connected,
263 .tx_fixup = zaurus_tx_fixup, 263 .tx_fixup = zaurus_tx_fixup,
264 .bind = blan_mdlm_bind, 264 .bind = blan_mdlm_bind,
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 105d7f0630cc..2de9b90c5f8f 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -171,7 +171,7 @@ static netdev_tx_t veth_xmit(struct sk_buff *skb, struct net_device *dev)
171 if (skb->ip_summed == CHECKSUM_NONE) 171 if (skb->ip_summed == CHECKSUM_NONE)
172 skb->ip_summed = rcv_priv->ip_summed; 172 skb->ip_summed = rcv_priv->ip_summed;
173 173
174 length = skb->len + ETH_HLEN; 174 length = skb->len;
175 if (dev_forward_skb(rcv, skb) != NET_RX_SUCCESS) 175 if (dev_forward_skb(rcv, skb) != NET_RX_SUCCESS)
176 goto rx_drop; 176 goto rx_drop;
177 177
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c
index 5e7f069eab53..eb5d75df5d5d 100644
--- a/drivers/net/via-rhine.c
+++ b/drivers/net/via-rhine.c
@@ -1861,7 +1861,7 @@ static void rhine_restart_tx(struct net_device *dev) {
1861 u32 intr_status; 1861 u32 intr_status;
1862 1862
1863 /* 1863 /*
1864 * If new errors occured, we need to sort them out before doing Tx. 1864 * If new errors occurred, we need to sort them out before doing Tx.
1865 * In that case the ISR will be back here RSN anyway. 1865 * In that case the ISR will be back here RSN anyway.
1866 */ 1866 */
1867 intr_status = get_intr_status(dev); 1867 intr_status = get_intr_status(dev);
@@ -1887,7 +1887,7 @@ static void rhine_restart_tx(struct net_device *dev) {
1887 /* This should never happen */ 1887 /* This should never happen */
1888 if (debug > 1) 1888 if (debug > 1)
1889 printk(KERN_WARNING "%s: rhine_restart_tx() " 1889 printk(KERN_WARNING "%s: rhine_restart_tx() "
1890 "Another error occured %8.8x.\n", 1890 "Another error occurred %8.8x.\n",
1891 dev->name, intr_status); 1891 dev->name, intr_status);
1892 } 1892 }
1893 1893
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index 0d6fec6b7d93..4fe051753842 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -292,7 +292,7 @@ VELOCITY_PARAM(DMA_length, "DMA length");
292/* IP_byte_align[] is used for IP header DWORD byte aligned 292/* IP_byte_align[] is used for IP header DWORD byte aligned
293 0: indicate the IP header won't be DWORD byte aligned.(Default) . 293 0: indicate the IP header won't be DWORD byte aligned.(Default) .
294 1: indicate the IP header will be DWORD byte aligned. 294 1: indicate the IP header will be DWORD byte aligned.
295 In some enviroment, the IP header should be DWORD byte aligned, 295 In some environment, the IP header should be DWORD byte aligned,
296 or the packet will be droped when we receive it. (eg: IPVS) 296 or the packet will be droped when we receive it. (eg: IPVS)
297*/ 297*/
298VELOCITY_PARAM(IP_byte_align, "Enable IP header dword aligned"); 298VELOCITY_PARAM(IP_byte_align, "Enable IP header dword aligned");
@@ -1994,7 +1994,7 @@ static inline void velocity_rx_csum(struct rx_desc *rd, struct sk_buff *skb)
1994 * @dev: network device 1994 * @dev: network device
1995 * 1995 *
1996 * Replace the current skb that is scheduled for Rx processing by a 1996 * Replace the current skb that is scheduled for Rx processing by a
1997 * shorter, immediatly allocated skb, if the received packet is small 1997 * shorter, immediately allocated skb, if the received packet is small
1998 * enough. This function returns a negative value if the received 1998 * enough. This function returns a negative value if the received
1999 * packet is too big or if memory is exhausted. 1999 * packet is too big or if memory is exhausted.
2000 */ 2000 */
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
index cc14b4a75048..0d47c3a05307 100644
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
@@ -892,7 +892,7 @@ vmxnet3_prepare_tso(struct sk_buff *skb,
892 * Transmits a pkt thru a given tq 892 * Transmits a pkt thru a given tq
893 * Returns: 893 * Returns:
894 * NETDEV_TX_OK: descriptors are setup successfully 894 * NETDEV_TX_OK: descriptors are setup successfully
895 * NETDEV_TX_OK: error occured, the pkt is dropped 895 * NETDEV_TX_OK: error occurred, the pkt is dropped
896 * NETDEV_TX_BUSY: tx ring is full, queue is stopped 896 * NETDEV_TX_BUSY: tx ring is full, queue is stopped
897 * 897 *
898 * Side-effects: 898 * Side-effects:
@@ -2685,7 +2685,7 @@ vmxnet3_read_mac_addr(struct vmxnet3_adapter *adapter, u8 *mac)
2685 * Enable MSIx vectors. 2685 * Enable MSIx vectors.
2686 * Returns : 2686 * Returns :
2687 * 0 on successful enabling of required vectors, 2687 * 0 on successful enabling of required vectors,
2688 * VMXNET3_LINUX_MIN_MSIX_VECT when only minumum number of vectors required 2688 * VMXNET3_LINUX_MIN_MSIX_VECT when only minimum number of vectors required
2689 * could be enabled. 2689 * could be enabled.
2690 * number of vectors which can be enabled otherwise (this number is smaller 2690 * number of vectors which can be enabled otherwise (this number is smaller
2691 * than VMXNET3_LINUX_MIN_MSIX_VECT) 2691 * than VMXNET3_LINUX_MIN_MSIX_VECT)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
index 81254be85b92..51f2ef142a5b 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
@@ -304,8 +304,8 @@ vmxnet3_set_flags(struct net_device *netdev, u32 data)
304 u8 lro_present = (netdev->features & NETIF_F_LRO) == 0 ? 0 : 1; 304 u8 lro_present = (netdev->features & NETIF_F_LRO) == 0 ? 0 : 1;
305 unsigned long flags; 305 unsigned long flags;
306 306
307 if (data & ~ETH_FLAG_LRO) 307 if (ethtool_invalid_flags(netdev, data, ETH_FLAG_LRO))
308 return -EOPNOTSUPP; 308 return -EINVAL;
309 309
310 if (lro_requested ^ lro_present) { 310 if (lro_requested ^ lro_present) {
311 /* toggle the LRO feature*/ 311 /* toggle the LRO feature*/
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c
index e74e4b42592d..401bebf59502 100644
--- a/drivers/net/vxge/vxge-config.c
+++ b/drivers/net/vxge/vxge-config.c
@@ -187,7 +187,7 @@ vxge_hw_vpath_fw_api(struct __vxge_hw_virtualpath *vpath, u32 action,
187 VXGE_HW_DEF_DEVICE_POLL_MILLIS); 187 VXGE_HW_DEF_DEVICE_POLL_MILLIS);
188 188
189 /* The __vxge_hw_device_register_poll can udelay for a significant 189 /* The __vxge_hw_device_register_poll can udelay for a significant
190 * amount of time, blocking other proccess from the CPU. If it delays 190 * amount of time, blocking other process from the CPU. If it delays
191 * for ~5secs, a NMI error can occur. A way around this is to give up 191 * for ~5secs, a NMI error can occur. A way around this is to give up
192 * the processor via msleep, but this is not allowed is under lock. 192 * the processor via msleep, but this is not allowed is under lock.
193 * So, only allow it to sleep for ~4secs if open. Otherwise, delay for 193 * So, only allow it to sleep for ~4secs if open. Otherwise, delay for
diff --git a/drivers/net/vxge/vxge-ethtool.c b/drivers/net/vxge/vxge-ethtool.c
index 1dd3a21b3a43..c5eb034107fd 100644
--- a/drivers/net/vxge/vxge-ethtool.c
+++ b/drivers/net/vxge/vxge-ethtool.c
@@ -1117,8 +1117,8 @@ static int vxge_set_flags(struct net_device *dev, u32 data)
1117 struct vxgedev *vdev = netdev_priv(dev); 1117 struct vxgedev *vdev = netdev_priv(dev);
1118 enum vxge_hw_status status; 1118 enum vxge_hw_status status;
1119 1119
1120 if (data & ~ETH_FLAG_RXHASH) 1120 if (ethtool_invalid_flags(dev, data, ETH_FLAG_RXHASH))
1121 return -EOPNOTSUPP; 1121 return -EINVAL;
1122 1122
1123 if (!!(data & ETH_FLAG_RXHASH) == vdev->devh->config.rth_en) 1123 if (!!(data & ETH_FLAG_RXHASH) == vdev->devh->config.rth_en)
1124 return 0; 1124 return 0;
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index 395423aeec00..aff68c1118d4 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -2282,7 +2282,7 @@ vxge_alarm_msix_handle(int irq, void *dev_id)
2282 VXGE_HW_VPATH_MSIX_ACTIVE) + VXGE_ALARM_MSIX_ID; 2282 VXGE_HW_VPATH_MSIX_ACTIVE) + VXGE_ALARM_MSIX_ID;
2283 2283
2284 for (i = 0; i < vdev->no_of_vpath; i++) { 2284 for (i = 0; i < vdev->no_of_vpath; i++) {
2285 /* Reduce the chance of loosing alarm interrupts by masking 2285 /* Reduce the chance of losing alarm interrupts by masking
2286 * the vector. A pending bit will be set if an alarm is 2286 * the vector. A pending bit will be set if an alarm is
2287 * generated and on unmask the interrupt will be fired. 2287 * generated and on unmask the interrupt will be fired.
2288 */ 2288 */
@@ -2788,7 +2788,7 @@ static int vxge_open(struct net_device *dev)
2788 } 2788 }
2789 2789
2790 /* Enable vpath to sniff all unicast/multicast traffic that not 2790 /* Enable vpath to sniff all unicast/multicast traffic that not
2791 * addressed to them. We allow promiscous mode for PF only 2791 * addressed to them. We allow promiscuous mode for PF only
2792 */ 2792 */
2793 2793
2794 val64 = 0; 2794 val64 = 0;
@@ -2890,7 +2890,7 @@ out0:
2890 return ret; 2890 return ret;
2891} 2891}
2892 2892
2893/* Loop throught the mac address list and delete all the entries */ 2893/* Loop through the mac address list and delete all the entries */
2894static void vxge_free_mac_add_list(struct vxge_vpath *vpath) 2894static void vxge_free_mac_add_list(struct vxge_vpath *vpath)
2895{ 2895{
2896 2896
@@ -2957,7 +2957,7 @@ static int do_vxge_close(struct net_device *dev, int do_io)
2957 val64); 2957 val64);
2958 } 2958 }
2959 2959
2960 /* Remove the function 0 from promiscous mode */ 2960 /* Remove the function 0 from promiscuous mode */
2961 vxge_hw_mgmt_reg_write(vdev->devh, 2961 vxge_hw_mgmt_reg_write(vdev->devh,
2962 vxge_hw_mgmt_reg_type_mrpcim, 2962 vxge_hw_mgmt_reg_type_mrpcim,
2963 0, 2963 0,
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c
index 8674f331311c..2638b8d97b8f 100644
--- a/drivers/net/vxge/vxge-traffic.c
+++ b/drivers/net/vxge/vxge-traffic.c
@@ -1111,7 +1111,7 @@ void vxge_hw_channel_dtr_free(struct __vxge_hw_channel *channel, void *dtrh)
1111 * vxge_hw_channel_dtr_count 1111 * vxge_hw_channel_dtr_count
1112 * @channel: Channel handle. Obtained via vxge_hw_channel_open(). 1112 * @channel: Channel handle. Obtained via vxge_hw_channel_open().
1113 * 1113 *
1114 * Retreive number of DTRs available. This function can not be called 1114 * Retrieve number of DTRs available. This function can not be called
1115 * from data path. ring_initial_replenishi() is the only user. 1115 * from data path. ring_initial_replenishi() is the only user.
1116 */ 1116 */
1117int vxge_hw_channel_dtr_count(struct __vxge_hw_channel *channel) 1117int vxge_hw_channel_dtr_count(struct __vxge_hw_channel *channel)
@@ -2060,7 +2060,7 @@ enum vxge_hw_status vxge_hw_vpath_promisc_enable(
2060 2060
2061 vpath = vp->vpath; 2061 vpath = vp->vpath;
2062 2062
2063 /* Enable promiscous mode for function 0 only */ 2063 /* Enable promiscuous mode for function 0 only */
2064 if (!(vpath->hldev->access_rights & 2064 if (!(vpath->hldev->access_rights &
2065 VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM)) 2065 VXGE_HW_DEVICE_ACCESS_RIGHT_MRPCIM))
2066 return VXGE_HW_OK; 2066 return VXGE_HW_OK;
diff --git a/drivers/net/vxge/vxge-traffic.h b/drivers/net/vxge/vxge-traffic.h
index 9d9dfda4c7ab..6c2fc0b72af5 100644
--- a/drivers/net/vxge/vxge-traffic.h
+++ b/drivers/net/vxge/vxge-traffic.h
@@ -681,7 +681,7 @@ struct vxge_hw_xmac_aggr_stats {
681 * @rx_red_discard: Count of received frames that are discarded because of RED 681 * @rx_red_discard: Count of received frames that are discarded because of RED
682 * (Random Early Discard). 682 * (Random Early Discard).
683 * @rx_xgmii_ctrl_err_cnt: Maintains a count of unexpected or misplaced control 683 * @rx_xgmii_ctrl_err_cnt: Maintains a count of unexpected or misplaced control
684 * characters occuring between times of normal data transmission 684 * characters occurring between times of normal data transmission
685 * (i.e. not included in RX_XGMII_DATA_ERR_CNT). This counter is 685 * (i.e. not included in RX_XGMII_DATA_ERR_CNT). This counter is
686 * incremented when either - 686 * incremented when either -
687 * 1) The Reconciliation Sublayer (RS) is expecting one control 687 * 1) The Reconciliation Sublayer (RS) is expecting one control
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index 10bafd59f9c3..6fb6f8e667d0 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -329,7 +329,7 @@ static int startmicrocode(struct cosa_data *cosa, int address);
329static int readmem(struct cosa_data *cosa, char __user *data, int addr, int len); 329static int readmem(struct cosa_data *cosa, char __user *data, int addr, int len);
330static int cosa_reset_and_read_id(struct cosa_data *cosa, char *id); 330static int cosa_reset_and_read_id(struct cosa_data *cosa, char *id);
331 331
332/* Auxilliary functions */ 332/* Auxiliary functions */
333static int get_wait_data(struct cosa_data *cosa); 333static int get_wait_data(struct cosa_data *cosa);
334static int put_wait_data(struct cosa_data *cosa, int data); 334static int put_wait_data(struct cosa_data *cosa, int data);
335static int puthexnumber(struct cosa_data *cosa, int number); 335static int puthexnumber(struct cosa_data *cosa, int number);
diff --git a/drivers/net/wan/dscc4.c b/drivers/net/wan/dscc4.c
index 4578e5b4b411..acb9ea830628 100644
--- a/drivers/net/wan/dscc4.c
+++ b/drivers/net/wan/dscc4.c
@@ -56,7 +56,7 @@
56 * IV. Notes 56 * IV. Notes
57 * The current error (XDU, RFO) recovery code is untested. 57 * The current error (XDU, RFO) recovery code is untested.
58 * So far, RDO takes his RX channel down and the right sequence to enable it 58 * So far, RDO takes his RX channel down and the right sequence to enable it
59 * again is still a mistery. If RDO happens, plan a reboot. More details 59 * again is still a mystery. If RDO happens, plan a reboot. More details
60 * in the code (NB: as this happens, TX still works). 60 * in the code (NB: as this happens, TX still works).
61 * Don't mess the cables during operation, especially on DTE ports. I don't 61 * Don't mess the cables during operation, especially on DTE ports. I don't
62 * suggest it for DCE either but at least one can get some messages instead 62 * suggest it for DCE either but at least one can get some messages instead
@@ -1065,7 +1065,7 @@ static int dscc4_open(struct net_device *dev)
1065 1065
1066 /* 1066 /*
1067 * Due to various bugs, there is no way to reliably reset a 1067 * Due to various bugs, there is no way to reliably reset a
1068 * specific port (manufacturer's dependant special PCI #RST wiring 1068 * specific port (manufacturer's dependent special PCI #RST wiring
1069 * apart: it affects all ports). Thus the device goes in the best 1069 * apart: it affects all ports). Thus the device goes in the best
1070 * silent mode possible at dscc4_close() time and simply claims to 1070 * silent mode possible at dscc4_close() time and simply claims to
1071 * be up if it's opened again. It still isn't possible to change 1071 * be up if it's opened again. It still isn't possible to change
@@ -1230,9 +1230,9 @@ static inline int dscc4_check_clock_ability(int port)
1230 * scaling. Of course some rounding may take place. 1230 * scaling. Of course some rounding may take place.
1231 * - no high speed mode (40Mb/s). May be trivial to do but I don't have an 1231 * - no high speed mode (40Mb/s). May be trivial to do but I don't have an
1232 * appropriate external clocking device for testing. 1232 * appropriate external clocking device for testing.
1233 * - no time-slot/clock mode 5: shameless lazyness. 1233 * - no time-slot/clock mode 5: shameless laziness.
1234 * 1234 *
1235 * The clock signals wiring can be (is ?) manufacturer dependant. Good luck. 1235 * The clock signals wiring can be (is ?) manufacturer dependent. Good luck.
1236 * 1236 *
1237 * BIG FAT WARNING: if the device isn't provided enough clocking signal, it 1237 * BIG FAT WARNING: if the device isn't provided enough clocking signal, it
1238 * won't pass the init sequence. For example, straight back-to-back DTE without 1238 * won't pass the init sequence. For example, straight back-to-back DTE without
diff --git a/drivers/net/wan/hostess_sv11.c b/drivers/net/wan/hostess_sv11.c
index 48edc5f4dac8..e817583e6ec5 100644
--- a/drivers/net/wan/hostess_sv11.c
+++ b/drivers/net/wan/hostess_sv11.c
@@ -15,7 +15,7 @@
15 * The hardware does the bus handling to avoid the need for delays between 15 * The hardware does the bus handling to avoid the need for delays between
16 * touching control registers. 16 * touching control registers.
17 * 17 *
18 * Port B isnt wired (why - beats me) 18 * Port B isn't wired (why - beats me)
19 * 19 *
20 * Generic HDLC port Copyright (C) 2008 Krzysztof Halasa <khc@pm.waw.pl> 20 * Generic HDLC port Copyright (C) 2008 Krzysztof Halasa <khc@pm.waw.pl>
21 */ 21 */
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index 6c571e198835..f1e1643dc3eb 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -178,7 +178,7 @@
178 * 178 *
179 * The resulting average clock frequency (assuming 33.333 MHz oscillator) is: 179 * The resulting average clock frequency (assuming 33.333 MHz oscillator) is:
180 * freq = 66.666 MHz / (A + (B + 1) / (C + 1)) 180 * freq = 66.666 MHz / (A + (B + 1) / (C + 1))
181 * minumum freq = 66.666 MHz / (A + 1) 181 * minimum freq = 66.666 MHz / (A + 1)
182 * maximum freq = 66.666 MHz / A 182 * maximum freq = 66.666 MHz / A
183 * 183 *
184 * Example: A = 2, B = 2, C = 7, CLOCK_CR register = 2 << 22 | 2 << 12 | 7 184 * Example: A = 2, B = 2, C = 7, CLOCK_CR register = 2 << 22 | 2 << 12 | 7
@@ -230,7 +230,7 @@
230#define PKT_PIPE_MODE_WRITE 0x57 230#define PKT_PIPE_MODE_WRITE 0x57
231 231
232/* HDLC packet status values - desc->status */ 232/* HDLC packet status values - desc->status */
233#define ERR_SHUTDOWN 1 /* stop or shutdown occurrance */ 233#define ERR_SHUTDOWN 1 /* stop or shutdown occurrence */
234#define ERR_HDLC_ALIGN 2 /* HDLC alignment error */ 234#define ERR_HDLC_ALIGN 2 /* HDLC alignment error */
235#define ERR_HDLC_FCS 3 /* HDLC Frame Check Sum error */ 235#define ERR_HDLC_FCS 3 /* HDLC Frame Check Sum error */
236#define ERR_RXFREE_Q_EMPTY 4 /* RX-free queue became empty while receiving 236#define ERR_RXFREE_Q_EMPTY 4 /* RX-free queue became empty while receiving
diff --git a/drivers/net/wan/lmc/Makefile b/drivers/net/wan/lmc/Makefile
index dabdcfed4efd..609710d64eb5 100644
--- a/drivers/net/wan/lmc/Makefile
+++ b/drivers/net/wan/lmc/Makefile
@@ -14,4 +14,4 @@ lmc-objs := lmc_debug.o lmc_media.o lmc_main.o lmc_proto.o
14# -DDEBUG \ 14# -DDEBUG \
15# -DLMC_PACKET_LOG 15# -DLMC_PACKET_LOG
16 16
17EXTRA_CFLAGS += -I. $(DBGDEF) 17ccflags-y := -I. $(DBGDEF)
diff --git a/drivers/net/wan/lmc/lmc_main.c b/drivers/net/wan/lmc/lmc_main.c
index 70feb84df670..b7f2358d23be 100644
--- a/drivers/net/wan/lmc/lmc_main.c
+++ b/drivers/net/wan/lmc/lmc_main.c
@@ -24,7 +24,7 @@
24 * 24 *
25 * Linux driver notes: 25 * Linux driver notes:
26 * Linux uses the device struct lmc_private to pass private information 26 * Linux uses the device struct lmc_private to pass private information
27 * arround. 27 * around.
28 * 28 *
29 * The initialization portion of this driver (the lmc_reset() and the 29 * The initialization portion of this driver (the lmc_reset() and the
30 * lmc_dec_reset() functions, as well as the led controls and the 30 * lmc_dec_reset() functions, as well as the led controls and the
diff --git a/drivers/net/wan/lmc/lmc_var.h b/drivers/net/wan/lmc/lmc_var.h
index 65d01978e784..01ad45218d19 100644
--- a/drivers/net/wan/lmc/lmc_var.h
+++ b/drivers/net/wan/lmc/lmc_var.h
@@ -180,7 +180,7 @@ struct lmc___ctl {
180 180
181 181
182/* 182/*
183 * Carefull, look at the data sheet, there's more to this 183 * Careful, look at the data sheet, there's more to this
184 * structure than meets the eye. It should probably be: 184 * structure than meets the eye. It should probably be:
185 * 185 *
186 * struct tulip_desc_t { 186 * struct tulip_desc_t {
@@ -380,7 +380,7 @@ struct lmc___softc {
380/* CSR6 settings */ 380/* CSR6 settings */
381#define OPERATION_MODE 0x00000200 /* Full Duplex */ 381#define OPERATION_MODE 0x00000200 /* Full Duplex */
382#define PROMISC_MODE 0x00000040 /* Promiscuous Mode */ 382#define PROMISC_MODE 0x00000040 /* Promiscuous Mode */
383#define RECIEVE_ALL 0x40000000 /* Recieve All */ 383#define RECIEVE_ALL 0x40000000 /* Receive All */
384#define PASS_BAD_FRAMES 0x00000008 /* Pass Bad Frames */ 384#define PASS_BAD_FRAMES 0x00000008 /* Pass Bad Frames */
385 385
386/* Dec control registers CSR6 as well */ 386/* Dec control registers CSR6 as well */
@@ -398,7 +398,7 @@ struct lmc___softc {
398#define TULIP_CMD_RECEIVEALL 0x40000000L /* (RW) Receivel all frames? */ 398#define TULIP_CMD_RECEIVEALL 0x40000000L /* (RW) Receivel all frames? */
399#define TULIP_CMD_MUSTBEONE 0x02000000L /* (RW) Must Be One (21140) */ 399#define TULIP_CMD_MUSTBEONE 0x02000000L /* (RW) Must Be One (21140) */
400#define TULIP_CMD_TXTHRSHLDCTL 0x00400000L /* (RW) Transmit Threshold Mode (21140) */ 400#define TULIP_CMD_TXTHRSHLDCTL 0x00400000L /* (RW) Transmit Threshold Mode (21140) */
401#define TULIP_CMD_STOREFWD 0x00200000L /* (RW) Store and Foward (21140) */ 401#define TULIP_CMD_STOREFWD 0x00200000L /* (RW) Store and Forward (21140) */
402#define TULIP_CMD_NOHEARTBEAT 0x00080000L /* (RW) No Heartbeat (21140) */ 402#define TULIP_CMD_NOHEARTBEAT 0x00080000L /* (RW) No Heartbeat (21140) */
403#define TULIP_CMD_PORTSELECT 0x00040000L /* (RW) Post Select (100Mb) (21140) */ 403#define TULIP_CMD_PORTSELECT 0x00040000L /* (RW) Post Select (100Mb) (21140) */
404#define TULIP_CMD_FULLDUPLEX 0x00000200L /* (RW) Full Duplex Mode */ 404#define TULIP_CMD_FULLDUPLEX 0x00000200L /* (RW) Full Duplex Mode */
diff --git a/drivers/net/wan/z85230.c b/drivers/net/wan/z85230.c
index 93956861ea21..0806232e0f8f 100644
--- a/drivers/net/wan/z85230.c
+++ b/drivers/net/wan/z85230.c
@@ -542,7 +542,7 @@ static void z8530_dma_tx(struct z8530_channel *chan)
542 z8530_tx(chan); 542 z8530_tx(chan);
543 return; 543 return;
544 } 544 }
545 /* This shouldnt occur in DMA mode */ 545 /* This shouldn't occur in DMA mode */
546 printk(KERN_ERR "DMA tx - bogus event!\n"); 546 printk(KERN_ERR "DMA tx - bogus event!\n");
547 z8530_tx(chan); 547 z8530_tx(chan);
548} 548}
@@ -1219,7 +1219,7 @@ static const char *z8530_type_name[]={
1219 * @io: the port value in question 1219 * @io: the port value in question
1220 * 1220 *
1221 * Describe a Z8530 in a standard format. We must pass the I/O as 1221 * Describe a Z8530 in a standard format. We must pass the I/O as
1222 * the port offset isnt predictable. The main reason for this function 1222 * the port offset isn't predictable. The main reason for this function
1223 * is to try and get a common format of report. 1223 * is to try and get a common format of report.
1224 */ 1224 */
1225 1225
@@ -1588,7 +1588,7 @@ static void z8530_rx_done(struct z8530_channel *c)
1588 unsigned long flags; 1588 unsigned long flags;
1589 1589
1590 /* 1590 /*
1591 * Complete this DMA. Neccessary to find the length 1591 * Complete this DMA. Necessary to find the length
1592 */ 1592 */
1593 1593
1594 flags=claim_dma_lock(); 1594 flags=claim_dma_lock();
@@ -1657,7 +1657,7 @@ static void z8530_rx_done(struct z8530_channel *c)
1657 * fifo length for this. Thus we want to flip to the new 1657 * fifo length for this. Thus we want to flip to the new
1658 * buffer and then mess around copying and allocating 1658 * buffer and then mess around copying and allocating
1659 * things. For the current case it doesn't matter but 1659 * things. For the current case it doesn't matter but
1660 * if you build a system where the sync irq isnt blocked 1660 * if you build a system where the sync irq isn't blocked
1661 * by the kernel IRQ disable then you need only block the 1661 * by the kernel IRQ disable then you need only block the
1662 * sync IRQ for the RT_LOCK area. 1662 * sync IRQ for the RT_LOCK area.
1663 * 1663 *
diff --git a/drivers/net/wimax/i2400m/control.c b/drivers/net/wimax/i2400m/control.c
index 12b84ed0e38a..727d728649b7 100644
--- a/drivers/net/wimax/i2400m/control.c
+++ b/drivers/net/wimax/i2400m/control.c
@@ -378,7 +378,7 @@ void i2400m_report_tlv_system_state(struct i2400m *i2400m,
378 * the device's state as sometimes we need to do a link-renew (the BS 378 * the device's state as sometimes we need to do a link-renew (the BS
379 * wants us to renew a DHCP lease, for example). 379 * wants us to renew a DHCP lease, for example).
380 * 380 *
381 * In fact, doc says that everytime we get a link-up, we should do a 381 * In fact, doc says that every time we get a link-up, we should do a
382 * DHCP negotiation... 382 * DHCP negotiation...
383 */ 383 */
384static 384static
@@ -675,7 +675,7 @@ void i2400m_msg_to_dev_cancel_wait(struct i2400m *i2400m, int code)
675 * - the ack message wasn't formatted correctly 675 * - the ack message wasn't formatted correctly
676 * 676 *
677 * The returned skb has been allocated with wimax_msg_to_user_alloc(), 677 * The returned skb has been allocated with wimax_msg_to_user_alloc(),
678 * it contains the reponse in a netlink attribute and is ready to be 678 * it contains the response in a netlink attribute and is ready to be
679 * passed up to user space with wimax_msg_to_user_send(). To access 679 * passed up to user space with wimax_msg_to_user_send(). To access
680 * the payload and its length, use wimax_msg_{data,len}() on the skb. 680 * the payload and its length, use wimax_msg_{data,len}() on the skb.
681 * 681 *
diff --git a/drivers/net/wimax/i2400m/driver.c b/drivers/net/wimax/i2400m/driver.c
index 65bc334ed57b..47cae7150bc1 100644
--- a/drivers/net/wimax/i2400m/driver.c
+++ b/drivers/net/wimax/i2400m/driver.c
@@ -654,7 +654,7 @@ void __i2400m_dev_reset_handle(struct work_struct *ws)
654 if (result == -EUCLEAN) { 654 if (result == -EUCLEAN) {
655 /* 655 /*
656 * We come here because the reset during operational mode 656 * We come here because the reset during operational mode
657 * wasn't successully done and need to proceed to a bus 657 * wasn't successfully done and need to proceed to a bus
658 * reset. For the dev_reset_handle() to be able to handle 658 * reset. For the dev_reset_handle() to be able to handle
659 * the reset event later properly, we restore boot_mode back 659 * the reset event later properly, we restore boot_mode back
660 * to the state before previous reset. ie: just like we are 660 * to the state before previous reset. ie: just like we are
@@ -755,7 +755,7 @@ EXPORT_SYMBOL_GPL(i2400m_error_recovery);
755 * Alloc the command and ack buffers for boot mode 755 * Alloc the command and ack buffers for boot mode
756 * 756 *
757 * Get the buffers needed to deal with boot mode messages. These 757 * Get the buffers needed to deal with boot mode messages. These
758 * buffers need to be allocated before the sdio recieve irq is setup. 758 * buffers need to be allocated before the sdio receive irq is setup.
759 */ 759 */
760static 760static
761int i2400m_bm_buf_alloc(struct i2400m *i2400m) 761int i2400m_bm_buf_alloc(struct i2400m *i2400m)
diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c
index 8b55a5b14152..85dadd5bf4be 100644
--- a/drivers/net/wimax/i2400m/fw.c
+++ b/drivers/net/wimax/i2400m/fw.c
@@ -54,7 +54,7 @@
54 * endpoint and read from it in the notification endpoint. In SDIO we 54 * endpoint and read from it in the notification endpoint. In SDIO we
55 * talk to it via the write address and read from the read address. 55 * talk to it via the write address and read from the read address.
56 * 56 *
57 * Upon entrance to boot mode, the device sends (preceeded with a few 57 * Upon entrance to boot mode, the device sends (preceded with a few
58 * zero length packets (ZLPs) on the notification endpoint in USB) a 58 * zero length packets (ZLPs) on the notification endpoint in USB) a
59 * reboot barker (4 le32 words with the same value). We ack it by 59 * reboot barker (4 le32 words with the same value). We ack it by
60 * sending the same barker to the device. The device acks with a 60 * sending the same barker to the device. The device acks with a
@@ -1589,7 +1589,7 @@ int i2400m_dev_bootstrap(struct i2400m *i2400m, enum i2400m_bri flags)
1589 i2400m->fw_name = fw_name; 1589 i2400m->fw_name = fw_name;
1590 ret = i2400m_fw_bootstrap(i2400m, fw, flags); 1590 ret = i2400m_fw_bootstrap(i2400m, fw, flags);
1591 release_firmware(fw); 1591 release_firmware(fw);
1592 if (ret >= 0) /* firmware loaded succesfully */ 1592 if (ret >= 0) /* firmware loaded successfully */
1593 break; 1593 break;
1594 i2400m->fw_name = NULL; 1594 i2400m->fw_name = NULL;
1595 } 1595 }
diff --git a/drivers/net/wimax/i2400m/i2400m-usb.h b/drivers/net/wimax/i2400m/i2400m-usb.h
index eb80243e22df..6650fde99e1d 100644
--- a/drivers/net/wimax/i2400m/i2400m-usb.h
+++ b/drivers/net/wimax/i2400m/i2400m-usb.h
@@ -105,14 +105,14 @@ static inline void edc_init(struct edc *edc)
105 * 105 *
106 * @edc: pointer to error density counter. 106 * @edc: pointer to error density counter.
107 * @max_err: maximum number of errors we can accept over the timeframe 107 * @max_err: maximum number of errors we can accept over the timeframe
108 * @timeframe: lenght of the timeframe (in jiffies). 108 * @timeframe: length of the timeframe (in jiffies).
109 * 109 *
110 * Returns: !0 1 if maximum acceptable errors per timeframe has been 110 * Returns: !0 1 if maximum acceptable errors per timeframe has been
111 * exceeded. 0 otherwise. 111 * exceeded. 0 otherwise.
112 * 112 *
113 * This is way to determine if the number of acceptable errors per time 113 * This is way to determine if the number of acceptable errors per time
114 * period has been exceeded. It is not accurate as there are cases in which 114 * period has been exceeded. It is not accurate as there are cases in which
115 * this scheme will not work, for example if there are periodic occurences 115 * this scheme will not work, for example if there are periodic occurrences
116 * of errors that straddle updates to the start time. This scheme is 116 * of errors that straddle updates to the start time. This scheme is
117 * sufficient for our usage. 117 * sufficient for our usage.
118 * 118 *
@@ -204,7 +204,7 @@ enum {
204 * usb_autopm_get/put_interface() barriers when executing 204 * usb_autopm_get/put_interface() barriers when executing
205 * commands. See doc in i2400mu_suspend() for more information. 205 * commands. See doc in i2400mu_suspend() for more information.
206 * 206 *
207 * @rx_size_auto_shrink: if true, the rx_size is shrinked 207 * @rx_size_auto_shrink: if true, the rx_size is shrunk
208 * automatically based on the average size of the received 208 * automatically based on the average size of the received
209 * transactions. This allows the receive code to allocate smaller 209 * transactions. This allows the receive code to allocate smaller
210 * chunks of memory and thus reduce pressure on the memory 210 * chunks of memory and thus reduce pressure on the memory
diff --git a/drivers/net/wimax/i2400m/i2400m.h b/drivers/net/wimax/i2400m/i2400m.h
index 030cbfd31704..5eacc653a94d 100644
--- a/drivers/net/wimax/i2400m/i2400m.h
+++ b/drivers/net/wimax/i2400m/i2400m.h
@@ -526,7 +526,7 @@ struct i2400m_barker_db;
526 * 526 *
527 * @barker: barker type that the device uses; this is initialized by 527 * @barker: barker type that the device uses; this is initialized by
528 * i2400m_is_boot_barker() the first time it is called. Then it 528 * i2400m_is_boot_barker() the first time it is called. Then it
529 * won't change during the life cycle of the device and everytime 529 * won't change during the life cycle of the device and every time
530 * a boot barker is received, it is just verified for it being the 530 * a boot barker is received, it is just verified for it being the
531 * same. 531 * same.
532 * 532 *
@@ -928,7 +928,7 @@ extern void i2400m_report_tlv_rf_switches_status(
928 struct i2400m *, const struct i2400m_tlv_rf_switches_status *); 928 struct i2400m *, const struct i2400m_tlv_rf_switches_status *);
929 929
930/* 930/*
931 * Helpers for firmware backwards compability 931 * Helpers for firmware backwards compatibility
932 * 932 *
933 * As we aim to support at least the firmware version that was 933 * As we aim to support at least the firmware version that was
934 * released with the previous kernel/driver release, some code will be 934 * released with the previous kernel/driver release, some code will be
diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c
index 94742e1eafe0..2edd8fe1c1f3 100644
--- a/drivers/net/wimax/i2400m/netdev.c
+++ b/drivers/net/wimax/i2400m/netdev.c
@@ -166,7 +166,7 @@ void i2400m_wake_tx_work(struct work_struct *ws)
166 d_fnstart(3, dev, "(ws %p i2400m %p skb %p)\n", ws, i2400m, skb); 166 d_fnstart(3, dev, "(ws %p i2400m %p skb %p)\n", ws, i2400m, skb);
167 result = -EINVAL; 167 result = -EINVAL;
168 if (skb == NULL) { 168 if (skb == NULL) {
169 dev_err(dev, "WAKE&TX: skb dissapeared!\n"); 169 dev_err(dev, "WAKE&TX: skb disappeared!\n");
170 goto out_put; 170 goto out_put;
171 } 171 }
172 /* If we have, somehow, lost the connection after this was 172 /* If we have, somehow, lost the connection after this was
diff --git a/drivers/net/wimax/i2400m/op-rfkill.c b/drivers/net/wimax/i2400m/op-rfkill.c
index 9e02b90b0080..b0dba35a8ad2 100644
--- a/drivers/net/wimax/i2400m/op-rfkill.c
+++ b/drivers/net/wimax/i2400m/op-rfkill.c
@@ -27,7 +27,7 @@
27 * - report changes in the HW RF Kill switch [with 27 * - report changes in the HW RF Kill switch [with
28 * wimax_rfkill_{sw,hw}_report(), which happens when we detect those 28 * wimax_rfkill_{sw,hw}_report(), which happens when we detect those
29 * indications coming through hardware reports]. We also do it on 29 * indications coming through hardware reports]. We also do it on
30 * initialization to let the stack know the intial HW state. 30 * initialization to let the stack know the initial HW state.
31 * 31 *
32 * - implement indications from the stack to change the SW RF Kill 32 * - implement indications from the stack to change the SW RF Kill
33 * switch (coming from sysfs, the wimax stack or user space). 33 * switch (coming from sysfs, the wimax stack or user space).
@@ -73,7 +73,7 @@ int i2400m_radio_is(struct i2400m *i2400m, enum wimax_rf_state state)
73 * Generic Netlink will call this function when a message is sent from 73 * Generic Netlink will call this function when a message is sent from
74 * userspace to change the software RF-Kill switch status. 74 * userspace to change the software RF-Kill switch status.
75 * 75 *
76 * This function will set the device's sofware RF-Kill switch state to 76 * This function will set the device's software RF-Kill switch state to
77 * match what is requested. 77 * match what is requested.
78 * 78 *
79 * NOTE: the i2400m has a strict state machine; we can only set the 79 * NOTE: the i2400m has a strict state machine; we can only set the
diff --git a/drivers/net/wimax/i2400m/rx.c b/drivers/net/wimax/i2400m/rx.c
index 844133b44af0..2f94a872101f 100644
--- a/drivers/net/wimax/i2400m/rx.c
+++ b/drivers/net/wimax/i2400m/rx.c
@@ -349,7 +349,7 @@ error_no_waiter:
349 * 349 *
350 * For reports: We can't clone the original skb where the data is 350 * For reports: We can't clone the original skb where the data is
351 * because we need to send this up via netlink; netlink has to add 351 * because we need to send this up via netlink; netlink has to add
352 * headers and we can't overwrite what's preceeding the payload...as 352 * headers and we can't overwrite what's preceding the payload...as
353 * it is another message. So we just dup them. 353 * it is another message. So we just dup them.
354 */ 354 */
355static 355static
@@ -425,7 +425,7 @@ error_check:
425 * 425 *
426 * As in i2400m_rx_ctl(), we can't clone the original skb where the 426 * As in i2400m_rx_ctl(), we can't clone the original skb where the
427 * data is because we need to send this up via netlink; netlink has to 427 * data is because we need to send this up via netlink; netlink has to
428 * add headers and we can't overwrite what's preceeding the 428 * add headers and we can't overwrite what's preceding the
429 * payload...as it is another message. So we just dup them. 429 * payload...as it is another message. So we just dup them.
430 */ 430 */
431static 431static
diff --git a/drivers/net/wimax/i2400m/tx.c b/drivers/net/wimax/i2400m/tx.c
index 3f819efc06b5..4b30ed11d785 100644
--- a/drivers/net/wimax/i2400m/tx.c
+++ b/drivers/net/wimax/i2400m/tx.c
@@ -149,7 +149,7 @@
149 * (with a moved message header to make sure it is size-aligned to 149 * (with a moved message header to make sure it is size-aligned to
150 * 16), TAIL room that was unusable (and thus is marked with a message 150 * 16), TAIL room that was unusable (and thus is marked with a message
151 * header that says 'skip this') and at the head of the buffer, an 151 * header that says 'skip this') and at the head of the buffer, an
152 * imcomplete message with a couple of payloads. 152 * incomplete message with a couple of payloads.
153 * 153 *
154 * N ___________________________________________________ 154 * N ___________________________________________________
155 * | | 155 * | |
@@ -819,7 +819,7 @@ EXPORT_SYMBOL_GPL(i2400m_tx);
819 * the FIF that is ready for transmission. 819 * the FIF that is ready for transmission.
820 * 820 *
821 * It sets the state in @i2400m to indicate the bus-specific driver is 821 * It sets the state in @i2400m to indicate the bus-specific driver is
822 * transfering that message (i2400m->tx_msg_size). 822 * transferring that message (i2400m->tx_msg_size).
823 * 823 *
824 * Once the transfer is completed, call i2400m_tx_msg_sent(). 824 * Once the transfer is completed, call i2400m_tx_msg_sent().
825 * 825 *
diff --git a/drivers/net/wimax/i2400m/usb-fw.c b/drivers/net/wimax/i2400m/usb-fw.c
index b58ec56b86f8..1fda46c55eb3 100644
--- a/drivers/net/wimax/i2400m/usb-fw.c
+++ b/drivers/net/wimax/i2400m/usb-fw.c
@@ -169,7 +169,7 @@ retry:
169 * 169 *
170 * Command can be a raw command, which requires no preparation (and 170 * Command can be a raw command, which requires no preparation (and
171 * which might not even be following the command format). Checks that 171 * which might not even be following the command format). Checks that
172 * the right amount of data was transfered. 172 * the right amount of data was transferred.
173 * 173 *
174 * To satisfy USB requirements (no onstack, vmalloc or in data segment 174 * To satisfy USB requirements (no onstack, vmalloc or in data segment
175 * buffers), we copy the command to i2400m->bm_cmd_buf and send it from 175 * buffers), we copy the command to i2400m->bm_cmd_buf and send it from
diff --git a/drivers/net/wimax/i2400m/usb-rx.c b/drivers/net/wimax/i2400m/usb-rx.c
index a26483a812a5..e3257681e360 100644
--- a/drivers/net/wimax/i2400m/usb-rx.c
+++ b/drivers/net/wimax/i2400m/usb-rx.c
@@ -58,7 +58,7 @@
58 * a zillion reads; by serializing, we are throttling. 58 * a zillion reads; by serializing, we are throttling.
59 * 59 *
60 * - RX data processing can get heavy enough so that it is not 60 * - RX data processing can get heavy enough so that it is not
61 * appropiate for doing it in the USB callback; thus we run it in a 61 * appropriate for doing it in the USB callback; thus we run it in a
62 * process context. 62 * process context.
63 * 63 *
64 * We provide a read buffer of an arbitrary size (short of a page); if 64 * We provide a read buffer of an arbitrary size (short of a page); if
diff --git a/drivers/net/wimax/i2400m/usb-tx.c b/drivers/net/wimax/i2400m/usb-tx.c
index c65b9979f87e..ac357acfb3e9 100644
--- a/drivers/net/wimax/i2400m/usb-tx.c
+++ b/drivers/net/wimax/i2400m/usb-tx.c
@@ -168,7 +168,7 @@ retry:
168/* 168/*
169 * Get the next TX message in the TX FIFO and send it to the device 169 * Get the next TX message in the TX FIFO and send it to the device
170 * 170 *
171 * Note we exit the loop if i2400mu_tx() fails; that funtion only 171 * Note we exit the loop if i2400mu_tx() fails; that function only
172 * fails on hard error (failing to tx a buffer not being one of them, 172 * fails on hard error (failing to tx a buffer not being one of them,
173 * see its doc). 173 * see its doc).
174 * 174 *
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 57a79b0475f6..4e5c7a11f04a 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -1884,7 +1884,7 @@ static int airo_open(struct net_device *dev) {
1884 /* Make sure the card is configured. 1884 /* Make sure the card is configured.
1885 * Wireless Extensions may postpone config changes until the card 1885 * Wireless Extensions may postpone config changes until the card
1886 * is open (to pipeline changes and speed-up card setup). If 1886 * is open (to pipeline changes and speed-up card setup). If
1887 * those changes are not yet commited, do it now - Jean II */ 1887 * those changes are not yet committed, do it now - Jean II */
1888 if (test_bit(FLAG_COMMIT, &ai->flags)) { 1888 if (test_bit(FLAG_COMMIT, &ai->flags)) {
1889 disable_MAC(ai, 1); 1889 disable_MAC(ai, 1);
1890 writeConfigRid(ai, 1); 1890 writeConfigRid(ai, 1);
@@ -1992,7 +1992,7 @@ static int mpi_send_packet (struct net_device *dev)
1992/* 1992/*
1993 * Magic, the cards firmware needs a length count (2 bytes) in the host buffer 1993 * Magic, the cards firmware needs a length count (2 bytes) in the host buffer
1994 * right after TXFID_HDR.The TXFID_HDR contains the status short so payloadlen 1994 * right after TXFID_HDR.The TXFID_HDR contains the status short so payloadlen
1995 * is immediatly after it. ------------------------------------------------ 1995 * is immediately after it. ------------------------------------------------
1996 * |TXFIDHDR+STATUS|PAYLOADLEN|802.3HDR|PACKETDATA| 1996 * |TXFIDHDR+STATUS|PAYLOADLEN|802.3HDR|PACKETDATA|
1997 * ------------------------------------------------ 1997 * ------------------------------------------------
1998 */ 1998 */
@@ -2006,7 +2006,7 @@ static int mpi_send_packet (struct net_device *dev)
2006 sizeof(wifictlhdr8023) + 2 ; 2006 sizeof(wifictlhdr8023) + 2 ;
2007 2007
2008 /* 2008 /*
2009 * Firmware automaticly puts 802 header on so 2009 * Firmware automatically puts 802 header on so
2010 * we don't need to account for it in the length 2010 * we don't need to account for it in the length
2011 */ 2011 */
2012 if (test_bit(FLAG_MIC_CAPABLE, &ai->flags) && ai->micstats.enabled && 2012 if (test_bit(FLAG_MIC_CAPABLE, &ai->flags) && ai->micstats.enabled &&
@@ -2531,7 +2531,7 @@ static int mpi_init_descriptors (struct airo_info *ai)
2531/* 2531/*
2532 * We are setting up three things here: 2532 * We are setting up three things here:
2533 * 1) Map AUX memory for descriptors: Rid, TxFid, or RxFid. 2533 * 1) Map AUX memory for descriptors: Rid, TxFid, or RxFid.
2534 * 2) Map PCI memory for issueing commands. 2534 * 2) Map PCI memory for issuing commands.
2535 * 3) Allocate memory (shared) to send and receive ethernet frames. 2535 * 3) Allocate memory (shared) to send and receive ethernet frames.
2536 */ 2536 */
2537static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci) 2537static int mpi_map_card(struct airo_info *ai, struct pci_dev *pci)
@@ -3947,7 +3947,7 @@ static u16 issuecommand(struct airo_info *ai, Cmd *pCmd, Resp *pRsp) {
3947 3947
3948 if ( max_tries == -1 ) { 3948 if ( max_tries == -1 ) {
3949 airo_print_err(ai->dev->name, 3949 airo_print_err(ai->dev->name,
3950 "Max tries exceeded when issueing command"); 3950 "Max tries exceeded when issuing command");
3951 if (IN4500(ai, COMMAND) & COMMAND_BUSY) 3951 if (IN4500(ai, COMMAND) & COMMAND_BUSY)
3952 OUT4500(ai, EVACK, EV_CLEARCOMMANDBUSY); 3952 OUT4500(ai, EVACK, EV_CLEARCOMMANDBUSY);
3953 return ERROR; 3953 return ERROR;
@@ -4173,7 +4173,7 @@ done:
4173} 4173}
4174 4174
4175/* Note, that we are using BAP1 which is also used by transmit, so 4175/* Note, that we are using BAP1 which is also used by transmit, so
4176 * make sure this isnt called when a transmit is happening */ 4176 * make sure this isn't called when a transmit is happening */
4177static int PC4500_writerid(struct airo_info *ai, u16 rid, 4177static int PC4500_writerid(struct airo_info *ai, u16 rid,
4178 const void *pBuf, int len, int lock) 4178 const void *pBuf, int len, int lock)
4179{ 4179{
@@ -4776,7 +4776,7 @@ static int proc_stats_rid_open( struct inode *inode,
4776 if (!statsLabels[i]) continue; 4776 if (!statsLabels[i]) continue;
4777 if (j+strlen(statsLabels[i])+16>4096) { 4777 if (j+strlen(statsLabels[i])+16>4096) {
4778 airo_print_warn(apriv->dev->name, 4778 airo_print_warn(apriv->dev->name,
4779 "Potentially disasterous buffer overflow averted!"); 4779 "Potentially disastrous buffer overflow averted!");
4780 break; 4780 break;
4781 } 4781 }
4782 j+=sprintf(data->rbuffer+j, "%s: %u\n", statsLabels[i], 4782 j+=sprintf(data->rbuffer+j, "%s: %u\n", statsLabels[i],
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index b761fec0d721..ccc2edaaeda0 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -974,7 +974,7 @@ void ar9170_rx(struct ar9170 *ar, struct sk_buff *skb)
974 if (ar->rx_failover_missing <= 0) { 974 if (ar->rx_failover_missing <= 0) {
975 /* 975 /*
976 * nested ar9170_rx call! 976 * nested ar9170_rx call!
977 * termination is guranteed, even when the 977 * termination is guaranteed, even when the
978 * combined frame also have a element with 978 * combined frame also have a element with
979 * a bad tag. 979 * a bad tag.
980 */ 980 */
diff --git a/drivers/net/wireless/ath/ar9170/phy.c b/drivers/net/wireless/ath/ar9170/phy.c
index 0dbfcf79ac96..aa8d06ba1ee4 100644
--- a/drivers/net/wireless/ath/ar9170/phy.c
+++ b/drivers/net/wireless/ath/ar9170/phy.c
@@ -424,7 +424,7 @@ static u32 ar9170_get_default_phy_reg_val(u32 reg, bool is_2ghz, bool is_40mhz)
424 424
425/* 425/*
426 * initialize some phy regs from eeprom values in modal_header[] 426 * initialize some phy regs from eeprom values in modal_header[]
427 * acc. to band and bandwith 427 * acc. to band and bandwidth
428 */ 428 */
429static int ar9170_init_phy_from_eeprom(struct ar9170 *ar, 429static int ar9170_init_phy_from_eeprom(struct ar9170 *ar,
430 bool is_2ghz, bool is_40mhz) 430 bool is_2ghz, bool is_40mhz)
diff --git a/drivers/net/wireless/ath/ath5k/ani.h b/drivers/net/wireless/ath/ath5k/ani.h
index d0a664039c87..034015397093 100644
--- a/drivers/net/wireless/ath/ath5k/ani.h
+++ b/drivers/net/wireless/ath/ath5k/ani.h
@@ -27,7 +27,7 @@
27#define ATH5K_ANI_RSSI_THR_HIGH 40 27#define ATH5K_ANI_RSSI_THR_HIGH 40
28#define ATH5K_ANI_RSSI_THR_LOW 7 28#define ATH5K_ANI_RSSI_THR_LOW 7
29 29
30/* maximum availabe levels */ 30/* maximum available levels */
31#define ATH5K_ANI_MAX_FIRSTEP_LVL 2 31#define ATH5K_ANI_MAX_FIRSTEP_LVL 2
32#define ATH5K_ANI_MAX_NOISE_IMM_LVL 1 32#define ATH5K_ANI_MAX_NOISE_IMM_LVL 1
33 33
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 4d7f21ee111c..349a5963931b 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -1953,7 +1953,7 @@ ath5k_beacon_update_timers(struct ath5k_softc *sc, u64 bc_tsf)
1953 1953
1954#define FUDGE AR5K_TUNE_SW_BEACON_RESP + 3 1954#define FUDGE AR5K_TUNE_SW_BEACON_RESP + 3
1955 /* We use FUDGE to make sure the next TBTT is ahead of the current TU. 1955 /* We use FUDGE to make sure the next TBTT is ahead of the current TU.
1956 * Since we later substract AR5K_TUNE_SW_BEACON_RESP (10) in the timer 1956 * Since we later subtract AR5K_TUNE_SW_BEACON_RESP (10) in the timer
1957 * configuration we need to make sure it is bigger than that. */ 1957 * configuration we need to make sure it is bigger than that. */
1958 1958
1959 if (bc_tsf == -1) { 1959 if (bc_tsf == -1) {
@@ -1971,7 +1971,7 @@ ath5k_beacon_update_timers(struct ath5k_softc *sc, u64 bc_tsf)
1971 intval |= AR5K_BEACON_RESET_TSF; 1971 intval |= AR5K_BEACON_RESET_TSF;
1972 } else if (bc_tsf > hw_tsf) { 1972 } else if (bc_tsf > hw_tsf) {
1973 /* 1973 /*
1974 * beacon received, SW merge happend but HW TSF not yet updated. 1974 * beacon received, SW merge happened but HW TSF not yet updated.
1975 * not possible to reconfigure timers yet, but next time we 1975 * not possible to reconfigure timers yet, but next time we
1976 * receive a beacon with the same BSSID, the hardware will 1976 * receive a beacon with the same BSSID, the hardware will
1977 * automatically update the TSF and then we need to reconfigure 1977 * automatically update the TSF and then we need to reconfigure
@@ -2651,7 +2651,7 @@ ath5k_reset(struct ath5k_softc *sc, struct ieee80211_channel *chan,
2651 synchronize_irq(sc->irq); 2651 synchronize_irq(sc->irq);
2652 stop_tasklets(sc); 2652 stop_tasklets(sc);
2653 2653
2654 /* Save ani mode and disable ANI durring 2654 /* Save ani mode and disable ANI during
2655 * reset. If we don't we might get false 2655 * reset. If we don't we might get false
2656 * PHY error interrupts. */ 2656 * PHY error interrupts. */
2657 ani_mode = ah->ah_sc->ani_state.ani_mode; 2657 ani_mode = ah->ah_sc->ani_state.ani_mode;
diff --git a/drivers/net/wireless/ath/ath5k/desc.c b/drivers/net/wireless/ath/ath5k/desc.c
index 16b44ff7dd3e..a8fcc94269f7 100644
--- a/drivers/net/wireless/ath/ath5k/desc.c
+++ b/drivers/net/wireless/ath/ath5k/desc.c
@@ -51,7 +51,7 @@ ath5k_hw_setup_2word_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,
51 /* 51 /*
52 * Validate input 52 * Validate input
53 * - Zero retries don't make sense. 53 * - Zero retries don't make sense.
54 * - A zero rate will put the HW into a mode where it continously sends 54 * - A zero rate will put the HW into a mode where it continuously sends
55 * noise on the channel, so it is important to avoid this. 55 * noise on the channel, so it is important to avoid this.
56 */ 56 */
57 if (unlikely(tx_tries0 == 0)) { 57 if (unlikely(tx_tries0 == 0)) {
@@ -190,7 +190,7 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah,
190 /* 190 /*
191 * Validate input 191 * Validate input
192 * - Zero retries don't make sense. 192 * - Zero retries don't make sense.
193 * - A zero rate will put the HW into a mode where it continously sends 193 * - A zero rate will put the HW into a mode where it continuously sends
194 * noise on the channel, so it is important to avoid this. 194 * noise on the channel, so it is important to avoid this.
195 */ 195 */
196 if (unlikely(tx_tries0 == 0)) { 196 if (unlikely(tx_tries0 == 0)) {
@@ -300,7 +300,7 @@ ath5k_hw_setup_mrr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,
300 /* 300 /*
301 * Rates can be 0 as long as the retry count is 0 too. 301 * Rates can be 0 as long as the retry count is 0 too.
302 * A zero rate and nonzero retry count will put the HW into a mode where 302 * A zero rate and nonzero retry count will put the HW into a mode where
303 * it continously sends noise on the channel, so it is important to 303 * it continuously sends noise on the channel, so it is important to
304 * avoid this. 304 * avoid this.
305 */ 305 */
306 if (unlikely((tx_rate1 == 0 && tx_tries1 != 0) || 306 if (unlikely((tx_rate1 == 0 && tx_tries1 != 0) ||
@@ -342,7 +342,7 @@ ath5k_hw_setup_mrr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,
342\***********************/ 342\***********************/
343 343
344/* 344/*
345 * Proccess the tx status descriptor on 5210/5211 345 * Process the tx status descriptor on 5210/5211
346 */ 346 */
347static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah, 347static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah,
348 struct ath5k_desc *desc, struct ath5k_tx_status *ts) 348 struct ath5k_desc *desc, struct ath5k_tx_status *ts)
@@ -394,7 +394,7 @@ static int ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah,
394} 394}
395 395
396/* 396/*
397 * Proccess a tx status descriptor on 5212 397 * Process a tx status descriptor on 5212
398 */ 398 */
399static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah, 399static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah,
400 struct ath5k_desc *desc, struct ath5k_tx_status *ts) 400 struct ath5k_desc *desc, struct ath5k_tx_status *ts)
@@ -519,7 +519,7 @@ int ath5k_hw_setup_rx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc,
519} 519}
520 520
521/* 521/*
522 * Proccess the rx status descriptor on 5210/5211 522 * Process the rx status descriptor on 5210/5211
523 */ 523 */
524static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah, 524static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah,
525 struct ath5k_desc *desc, struct ath5k_rx_status *rs) 525 struct ath5k_desc *desc, struct ath5k_rx_status *rs)
@@ -602,7 +602,7 @@ static int ath5k_hw_proc_5210_rx_status(struct ath5k_hw *ah,
602} 602}
603 603
604/* 604/*
605 * Proccess the rx status descriptor on 5212 605 * Process the rx status descriptor on 5212
606 */ 606 */
607static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah, 607static int ath5k_hw_proc_5212_rx_status(struct ath5k_hw *ah,
608 struct ath5k_desc *desc, 608 struct ath5k_desc *desc,
diff --git a/drivers/net/wireless/ath/ath5k/eeprom.c b/drivers/net/wireless/ath/ath5k/eeprom.c
index b6561f785c6e..efb672cb31e4 100644
--- a/drivers/net/wireless/ath/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath/ath5k/eeprom.c
@@ -1080,7 +1080,7 @@ ath5k_eeprom_read_pcal_info_5112(struct ath5k_hw *ah, int mode)
1080 * 1080 *
1081 * To recreate the curves we read here the points and interpolate 1081 * To recreate the curves we read here the points and interpolate
1082 * later. Note that in most cases only 2 (higher and lower) curves are 1082 * later. Note that in most cases only 2 (higher and lower) curves are
1083 * used (like RF5112) but vendors have the oportunity to include all 1083 * used (like RF5112) but vendors have the opportunity to include all
1084 * 4 curves on eeprom. The final curve (higher power) has an extra 1084 * 4 curves on eeprom. The final curve (higher power) has an extra
1085 * point for better accuracy like RF5112. 1085 * point for better accuracy like RF5112.
1086 */ 1086 */
@@ -1302,7 +1302,7 @@ ath5k_eeprom_read_pcal_info_2413(struct ath5k_hw *ah, int mode)
1302 /* 1302 /*
1303 * Pd gain 0 is not the last pd gain 1303 * Pd gain 0 is not the last pd gain
1304 * so it only has 2 pd points. 1304 * so it only has 2 pd points.
1305 * Continue wih pd gain 1. 1305 * Continue with pd gain 1.
1306 */ 1306 */
1307 pcinfo->pwr_i[1] = (val >> 10) & 0x1f; 1307 pcinfo->pwr_i[1] = (val >> 10) & 0x1f;
1308 1308
diff --git a/drivers/net/wireless/ath/ath5k/pci.c b/drivers/net/wireless/ath/ath5k/pci.c
index 66598a0d1df0..3c44689a700b 100644
--- a/drivers/net/wireless/ath/ath5k/pci.c
+++ b/drivers/net/wireless/ath/ath5k/pci.c
@@ -57,7 +57,7 @@ static void ath5k_pci_read_cachesize(struct ath_common *common, int *csz)
57 *csz = (int)u8tmp; 57 *csz = (int)u8tmp;
58 58
59 /* 59 /*
60 * This check was put in to avoid "unplesant" consequences if 60 * This check was put in to avoid "unpleasant" consequences if
61 * the bootrom has not fully initialized all PCI devices. 61 * the bootrom has not fully initialized all PCI devices.
62 * Sometimes the cache line size register is not set 62 * Sometimes the cache line size register is not set
63 */ 63 */
diff --git a/drivers/net/wireless/ath/ath5k/pcu.c b/drivers/net/wireless/ath/ath5k/pcu.c
index a702817daf72..d9b3f828455a 100644
--- a/drivers/net/wireless/ath/ath5k/pcu.c
+++ b/drivers/net/wireless/ath/ath5k/pcu.c
@@ -472,7 +472,7 @@ void ath5k_hw_set_rx_filter(struct ath5k_hw *ah, u32 filter)
472 } 472 }
473 473
474 /* 474 /*
475 * The AR5210 uses promiscous mode to detect radar activity 475 * The AR5210 uses promiscuous mode to detect radar activity
476 */ 476 */
477 if (ah->ah_version == AR5K_AR5210 && 477 if (ah->ah_version == AR5K_AR5210 &&
478 (filter & AR5K_RX_FILTER_RADARERR)) { 478 (filter & AR5K_RX_FILTER_RADARERR)) {
@@ -706,8 +706,8 @@ ath5k_check_timer_win(int a, int b, int window, int intval)
706 * The need for this function arises from the fact that we have 4 separate 706 * The need for this function arises from the fact that we have 4 separate
707 * HW timer registers (TIMER0 - TIMER3), which are closely related to the 707 * HW timer registers (TIMER0 - TIMER3), which are closely related to the
708 * next beacon target time (NBTT), and that the HW updates these timers 708 * next beacon target time (NBTT), and that the HW updates these timers
709 * seperately based on the current TSF value. The hardware increments each 709 * separately based on the current TSF value. The hardware increments each
710 * timer by the beacon interval, when the local TSF coverted to TU is equal 710 * timer by the beacon interval, when the local TSF converted to TU is equal
711 * to the value stored in the timer. 711 * to the value stored in the timer.
712 * 712 *
713 * The reception of a beacon with the same BSSID can update the local HW TSF 713 * The reception of a beacon with the same BSSID can update the local HW TSF
diff --git a/drivers/net/wireless/ath/ath5k/phy.c b/drivers/net/wireless/ath/ath5k/phy.c
index 62ce2f4e8605..55441913344d 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -335,11 +335,11 @@ static void ath5k_hw_wait_for_synth(struct ath5k_hw *ah,
335 * http://madwifi-project.org/ticket/1659 335 * http://madwifi-project.org/ticket/1659
336 * with various measurements and diagrams 336 * with various measurements and diagrams
337 * 337 *
338 * TODO: Deal with power drops due to probes by setting an apropriate 338 * TODO: Deal with power drops due to probes by setting an appropriate
339 * tx power on the probe packets ! Make this part of the calibration process. 339 * tx power on the probe packets ! Make this part of the calibration process.
340 */ 340 */
341 341
342/* Initialize ah_gain durring attach */ 342/* Initialize ah_gain during attach */
343int ath5k_hw_rfgain_opt_init(struct ath5k_hw *ah) 343int ath5k_hw_rfgain_opt_init(struct ath5k_hw *ah)
344{ 344{
345 /* Initialize the gain optimization values */ 345 /* Initialize the gain optimization values */
@@ -1049,7 +1049,7 @@ static int ath5k_hw_rfregs_init(struct ath5k_hw *ah,
1049\**************************/ 1049\**************************/
1050 1050
1051/* 1051/*
1052 * Convertion needed for RF5110 1052 * Conversion needed for RF5110
1053 */ 1053 */
1054static u32 ath5k_hw_rf5110_chan2athchan(struct ieee80211_channel *channel) 1054static u32 ath5k_hw_rf5110_chan2athchan(struct ieee80211_channel *channel)
1055{ 1055{
@@ -1088,7 +1088,7 @@ static int ath5k_hw_rf5110_channel(struct ath5k_hw *ah,
1088} 1088}
1089 1089
1090/* 1090/*
1091 * Convertion needed for 5111 1091 * Conversion needed for 5111
1092 */ 1092 */
1093static int ath5k_hw_rf5111_chan2athchan(unsigned int ieee, 1093static int ath5k_hw_rf5111_chan2athchan(unsigned int ieee,
1094 struct ath5k_athchan_2ghz *athchan) 1094 struct ath5k_athchan_2ghz *athchan)
@@ -2201,7 +2201,7 @@ ath5k_create_power_curve(s16 pmin, s16 pmax,
2201/* 2201/*
2202 * Get the surrounding per-channel power calibration piers 2202 * Get the surrounding per-channel power calibration piers
2203 * for a given frequency so that we can interpolate between 2203 * for a given frequency so that we can interpolate between
2204 * them and come up with an apropriate dataset for our current 2204 * them and come up with an appropriate dataset for our current
2205 * channel. 2205 * channel.
2206 */ 2206 */
2207static void 2207static void
@@ -2618,7 +2618,7 @@ ath5k_write_pcdac_table(struct ath5k_hw *ah)
2618/* 2618/*
2619 * Set the gain boundaries and create final Power to PDADC table 2619 * Set the gain boundaries and create final Power to PDADC table
2620 * 2620 *
2621 * We can have up to 4 pd curves, we need to do a simmilar process 2621 * We can have up to 4 pd curves, we need to do a similar process
2622 * as we do for RF5112. This time we don't have an edge_flag but we 2622 * as we do for RF5112. This time we don't have an edge_flag but we
2623 * set the gain boundaries on a separate register. 2623 * set the gain boundaries on a separate register.
2624 */ 2624 */
@@ -2826,13 +2826,13 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
2826 u32 target = channel->center_freq; 2826 u32 target = channel->center_freq;
2827 int pdg, i; 2827 int pdg, i;
2828 2828
2829 /* Get surounding freq piers for this channel */ 2829 /* Get surrounding freq piers for this channel */
2830 ath5k_get_chan_pcal_surrounding_piers(ah, channel, 2830 ath5k_get_chan_pcal_surrounding_piers(ah, channel,
2831 &pcinfo_L, 2831 &pcinfo_L,
2832 &pcinfo_R); 2832 &pcinfo_R);
2833 2833
2834 /* Loop over pd gain curves on 2834 /* Loop over pd gain curves on
2835 * surounding freq piers by index */ 2835 * surrounding freq piers by index */
2836 for (pdg = 0; pdg < ee->ee_pd_gains[ee_mode]; pdg++) { 2836 for (pdg = 0; pdg < ee->ee_pd_gains[ee_mode]; pdg++) {
2837 2837
2838 /* Fill curves in reverse order 2838 /* Fill curves in reverse order
@@ -2923,7 +2923,7 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
2923 } 2923 }
2924 2924
2925 /* Interpolate between curves 2925 /* Interpolate between curves
2926 * of surounding freq piers to 2926 * of surrounding freq piers to
2927 * get the final curve for this 2927 * get the final curve for this
2928 * pd gain. Re-use tmpL for interpolation 2928 * pd gain. Re-use tmpL for interpolation
2929 * output */ 2929 * output */
@@ -2947,7 +2947,7 @@ ath5k_setup_channel_powertable(struct ath5k_hw *ah,
2947 2947
2948 /* Fill min and max power levels for this 2948 /* Fill min and max power levels for this
2949 * channel by interpolating the values on 2949 * channel by interpolating the values on
2950 * surounding channels to complete the dataset */ 2950 * surrounding channels to complete the dataset */
2951 ah->ah_txpower.txp_min_pwr = ath5k_get_interpolated_value(target, 2951 ah->ah_txpower.txp_min_pwr = ath5k_get_interpolated_value(target,
2952 (s16) pcinfo_L->freq, 2952 (s16) pcinfo_L->freq,
2953 (s16) pcinfo_R->freq, 2953 (s16) pcinfo_R->freq,
@@ -3179,7 +3179,7 @@ ath5k_hw_txpower(struct ath5k_hw *ah, struct ieee80211_channel *channel,
3179 3179
3180 /* FIXME: TPC scale reduction */ 3180 /* FIXME: TPC scale reduction */
3181 3181
3182 /* Get surounding channels for per-rate power table 3182 /* Get surrounding channels for per-rate power table
3183 * calibration */ 3183 * calibration */
3184 ath5k_get_rate_pcal_data(ah, channel, &rate_info); 3184 ath5k_get_rate_pcal_data(ah, channel, &rate_info);
3185 3185
diff --git a/drivers/net/wireless/ath/ath5k/reg.h b/drivers/net/wireless/ath/ath5k/reg.h
index e1c9abd8c879..d12b827033c1 100644
--- a/drivers/net/wireless/ath/ath5k/reg.h
+++ b/drivers/net/wireless/ath/ath5k/reg.h
@@ -132,8 +132,8 @@
132 * As i can see in ar5k_ar5210_tx_start Reyk uses some of the values of BCR 132 * As i can see in ar5k_ar5210_tx_start Reyk uses some of the values of BCR
133 * for this register, so i guess TQ1V,TQ1FV and BDMAE have the same meaning 133 * for this register, so i guess TQ1V,TQ1FV and BDMAE have the same meaning
134 * here and SNP/SNAP means "snapshot" (so this register gets synced with BCR). 134 * here and SNP/SNAP means "snapshot" (so this register gets synced with BCR).
135 * So SNAPPEDBCRVALID sould also stand for "snapped BCR -values- valid", so i 135 * So SNAPPEDBCRVALID should also stand for "snapped BCR -values- valid", so i
136 * renamed it to SNAPSHOTSVALID to make more sense. I realy have no idea what 136 * renamed it to SNAPSHOTSVALID to make more sense. I really have no idea what
137 * else can it be. I also renamed SNPBCMD to SNPADHOC to match BCR. 137 * else can it be. I also renamed SNPBCMD to SNPADHOC to match BCR.
138 */ 138 */
139#define AR5K_BSR 0x002c /* Register Address */ 139#define AR5K_BSR 0x002c /* Register Address */
@@ -283,7 +283,7 @@
283 */ 283 */
284#define AR5K_ISR 0x001c /* Register Address [5210] */ 284#define AR5K_ISR 0x001c /* Register Address [5210] */
285#define AR5K_PISR 0x0080 /* Register Address [5211+] */ 285#define AR5K_PISR 0x0080 /* Register Address [5211+] */
286#define AR5K_ISR_RXOK 0x00000001 /* Frame successfuly recieved */ 286#define AR5K_ISR_RXOK 0x00000001 /* Frame successfuly received */
287#define AR5K_ISR_RXDESC 0x00000002 /* RX descriptor request */ 287#define AR5K_ISR_RXDESC 0x00000002 /* RX descriptor request */
288#define AR5K_ISR_RXERR 0x00000004 /* Receive error */ 288#define AR5K_ISR_RXERR 0x00000004 /* Receive error */
289#define AR5K_ISR_RXNOFRM 0x00000008 /* No frame received (receive timeout) */ 289#define AR5K_ISR_RXNOFRM 0x00000008 /* No frame received (receive timeout) */
@@ -372,12 +372,12 @@
372/* 372/*
373 * Interrupt Mask Registers 373 * Interrupt Mask Registers
374 * 374 *
375 * As whith ISRs 5210 has one IMR (AR5K_IMR) and 5211/5212 has one primary 375 * As with ISRs 5210 has one IMR (AR5K_IMR) and 5211/5212 has one primary
376 * (AR5K_PIMR) and 4 secondary IMRs (AR5K_SIMRx). Note that ISR/IMR flags match. 376 * (AR5K_PIMR) and 4 secondary IMRs (AR5K_SIMRx). Note that ISR/IMR flags match.
377 */ 377 */
378#define AR5K_IMR 0x0020 /* Register Address [5210] */ 378#define AR5K_IMR 0x0020 /* Register Address [5210] */
379#define AR5K_PIMR 0x00a0 /* Register Address [5211+] */ 379#define AR5K_PIMR 0x00a0 /* Register Address [5211+] */
380#define AR5K_IMR_RXOK 0x00000001 /* Frame successfuly recieved*/ 380#define AR5K_IMR_RXOK 0x00000001 /* Frame successfuly received*/
381#define AR5K_IMR_RXDESC 0x00000002 /* RX descriptor request*/ 381#define AR5K_IMR_RXDESC 0x00000002 /* RX descriptor request*/
382#define AR5K_IMR_RXERR 0x00000004 /* Receive error*/ 382#define AR5K_IMR_RXERR 0x00000004 /* Receive error*/
383#define AR5K_IMR_RXNOFRM 0x00000008 /* No frame received (receive timeout)*/ 383#define AR5K_IMR_RXNOFRM 0x00000008 /* No frame received (receive timeout)*/
@@ -895,7 +895,7 @@
895#define AR5K_PCICFG_SL_INTEN 0x00000800 /* Enable interrupts when asleep */ 895#define AR5K_PCICFG_SL_INTEN 0x00000800 /* Enable interrupts when asleep */
896#define AR5K_PCICFG_LED_BCTL 0x00001000 /* Led blink (?) [5210] */ 896#define AR5K_PCICFG_LED_BCTL 0x00001000 /* Led blink (?) [5210] */
897#define AR5K_PCICFG_RETRY_FIX 0x00001000 /* Enable pci core retry fix */ 897#define AR5K_PCICFG_RETRY_FIX 0x00001000 /* Enable pci core retry fix */
898#define AR5K_PCICFG_SL_INPEN 0x00002000 /* Sleep even whith pending interrupts*/ 898#define AR5K_PCICFG_SL_INPEN 0x00002000 /* Sleep even with pending interrupts*/
899#define AR5K_PCICFG_SPWR_DN 0x00010000 /* Mask for power status */ 899#define AR5K_PCICFG_SPWR_DN 0x00010000 /* Mask for power status */
900#define AR5K_PCICFG_LEDMODE 0x000e0000 /* Ledmode [5211+] */ 900#define AR5K_PCICFG_LEDMODE 0x000e0000 /* Ledmode [5211+] */
901#define AR5K_PCICFG_LEDMODE_PROP 0x00000000 /* Blink on standard traffic [5211+] */ 901#define AR5K_PCICFG_LEDMODE_PROP 0x00000000 /* Blink on standard traffic [5211+] */
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index ffcf44a4058b..106c0b06cf55 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -142,7 +142,7 @@ static void ar5008_hw_force_bias(struct ath_hw *ah, u16 synth_freq)
142 142
143/** 143/**
144 * ar5008_hw_set_channel - tune to a channel on the external AR2133/AR5133 radios 144 * ar5008_hw_set_channel - tune to a channel on the external AR2133/AR5133 radios
145 * @ah: atheros hardware stucture 145 * @ah: atheros hardware structure
146 * @chan: 146 * @chan:
147 * 147 *
148 * For the external AR2133/AR5133 radios, takes the MHz channel value and set 148 * For the external AR2133/AR5133 radios, takes the MHz channel value and set
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
index 4a9271802991..6eadf975ae48 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
@@ -3240,7 +3240,7 @@ static int ar9300_compress_decision(struct ath_hw *ah,
3240 eep = ar9003_eeprom_struct_find_by_id(reference); 3240 eep = ar9003_eeprom_struct_find_by_id(reference);
3241 if (eep == NULL) { 3241 if (eep == NULL) {
3242 ath_dbg(common, ATH_DBG_EEPROM, 3242 ath_dbg(common, ATH_DBG_EEPROM,
3243 "cant find reference eeprom struct %d\n", 3243 "can't find reference eeprom struct %d\n",
3244 reference); 3244 reference);
3245 return -1; 3245 return -1;
3246 } 3246 }
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c
index f1b8af64569c..2d10239ce829 100644
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
@@ -1040,7 +1040,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
1040 } 1040 }
1041 1041
1042 ret = ath9k_htc_hw_init(hif_dev->htc_handle, 1042 ret = ath9k_htc_hw_init(hif_dev->htc_handle,
1043 &hif_dev->udev->dev, hif_dev->device_id, 1043 &interface->dev, hif_dev->device_id,
1044 hif_dev->udev->product, id->driver_info); 1044 hif_dev->udev->product, id->driver_info);
1045 if (ret) { 1045 if (ret) {
1046 ret = -EINVAL; 1046 ret = -EINVAL;
@@ -1158,7 +1158,7 @@ fail_resume:
1158#endif 1158#endif
1159 1159
1160static struct usb_driver ath9k_hif_usb_driver = { 1160static struct usb_driver ath9k_hif_usb_driver = {
1161 .name = "ath9k_hif_usb", 1161 .name = KBUILD_MODNAME,
1162 .probe = ath9k_hif_usb_probe, 1162 .probe = ath9k_hif_usb_probe,
1163 .disconnect = ath9k_hif_usb_disconnect, 1163 .disconnect = ath9k_hif_usb_disconnect,
1164#ifdef CONFIG_PM 1164#ifdef CONFIG_PM
diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.c b/drivers/net/wireless/ath/ath9k/htc_hst.c
index c41ab8c30161..62e139a30a74 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.c
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.c
@@ -360,7 +360,7 @@ ret:
360 * HTC Messages are handled directly here and the obtained SKB 360 * HTC Messages are handled directly here and the obtained SKB
361 * is freed. 361 * is freed.
362 * 362 *
363 * Sevice messages (Data, WMI) passed to the corresponding 363 * Service messages (Data, WMI) passed to the corresponding
364 * endpoint RX handlers, which have to free the SKB. 364 * endpoint RX handlers, which have to free the SKB.
365 */ 365 */
366void ath9k_htc_rx_msg(struct htc_target *htc_handle, 366void ath9k_htc_rx_msg(struct htc_target *htc_handle,
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 338b07502f1a..c95bc5cc1a1f 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1254,15 +1254,6 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
1254 ah->txchainmask = common->tx_chainmask; 1254 ah->txchainmask = common->tx_chainmask;
1255 ah->rxchainmask = common->rx_chainmask; 1255 ah->rxchainmask = common->rx_chainmask;
1256 1256
1257 if ((common->bus_ops->ath_bus_type != ATH_USB) && !ah->chip_fullsleep) {
1258 ath9k_hw_abortpcurecv(ah);
1259 if (!ath9k_hw_stopdmarecv(ah)) {
1260 ath_dbg(common, ATH_DBG_XMIT,
1261 "Failed to stop receive dma\n");
1262 bChannelChange = false;
1263 }
1264 }
1265
1266 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE)) 1257 if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
1267 return -EIO; 1258 return -EIO;
1268 1259
@@ -2546,6 +2537,7 @@ static struct {
2546 { AR_SREV_VERSION_9287, "9287" }, 2537 { AR_SREV_VERSION_9287, "9287" },
2547 { AR_SREV_VERSION_9271, "9271" }, 2538 { AR_SREV_VERSION_9271, "9271" },
2548 { AR_SREV_VERSION_9300, "9300" }, 2539 { AR_SREV_VERSION_9300, "9300" },
2540 { AR_SREV_VERSION_9485, "9485" },
2549}; 2541};
2550 2542
2551/* For devices with external radios */ 2543/* For devices with external radios */
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c
index 562257ac52cf..edc1cbbfecaf 100644
--- a/drivers/net/wireless/ath/ath9k/mac.c
+++ b/drivers/net/wireless/ath/ath9k/mac.c
@@ -751,28 +751,47 @@ void ath9k_hw_abortpcurecv(struct ath_hw *ah)
751} 751}
752EXPORT_SYMBOL(ath9k_hw_abortpcurecv); 752EXPORT_SYMBOL(ath9k_hw_abortpcurecv);
753 753
754bool ath9k_hw_stopdmarecv(struct ath_hw *ah) 754bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
755{ 755{
756#define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */ 756#define AH_RX_STOP_DMA_TIMEOUT 10000 /* usec */
757#define AH_RX_TIME_QUANTUM 100 /* usec */ 757#define AH_RX_TIME_QUANTUM 100 /* usec */
758 struct ath_common *common = ath9k_hw_common(ah); 758 struct ath_common *common = ath9k_hw_common(ah);
759 u32 mac_status, last_mac_status = 0;
759 int i; 760 int i;
760 761
762 /* Enable access to the DMA observation bus */
763 REG_WRITE(ah, AR_MACMISC,
764 ((AR_MACMISC_DMA_OBS_LINE_8 << AR_MACMISC_DMA_OBS_S) |
765 (AR_MACMISC_MISC_OBS_BUS_1 <<
766 AR_MACMISC_MISC_OBS_BUS_MSB_S)));
767
761 REG_WRITE(ah, AR_CR, AR_CR_RXD); 768 REG_WRITE(ah, AR_CR, AR_CR_RXD);
762 769
763 /* Wait for rx enable bit to go low */ 770 /* Wait for rx enable bit to go low */
764 for (i = AH_RX_STOP_DMA_TIMEOUT / AH_TIME_QUANTUM; i != 0; i--) { 771 for (i = AH_RX_STOP_DMA_TIMEOUT / AH_TIME_QUANTUM; i != 0; i--) {
765 if ((REG_READ(ah, AR_CR) & AR_CR_RXE) == 0) 772 if ((REG_READ(ah, AR_CR) & AR_CR_RXE) == 0)
766 break; 773 break;
774
775 if (!AR_SREV_9300_20_OR_LATER(ah)) {
776 mac_status = REG_READ(ah, AR_DMADBG_7) & 0x7f0;
777 if (mac_status == 0x1c0 && mac_status == last_mac_status) {
778 *reset = true;
779 break;
780 }
781
782 last_mac_status = mac_status;
783 }
784
767 udelay(AH_TIME_QUANTUM); 785 udelay(AH_TIME_QUANTUM);
768 } 786 }
769 787
770 if (i == 0) { 788 if (i == 0) {
771 ath_err(common, 789 ath_err(common,
772 "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n", 790 "DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n",
773 AH_RX_STOP_DMA_TIMEOUT / 1000, 791 AH_RX_STOP_DMA_TIMEOUT / 1000,
774 REG_READ(ah, AR_CR), 792 REG_READ(ah, AR_CR),
775 REG_READ(ah, AR_DIAG_SW)); 793 REG_READ(ah, AR_DIAG_SW),
794 REG_READ(ah, AR_DMADBG_7));
776 return false; 795 return false;
777 } else { 796 } else {
778 return true; 797 return true;
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index b2b2ff852c32..c2a59386fb9c 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -695,7 +695,7 @@ bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set);
695void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp); 695void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp);
696void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning); 696void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning);
697void ath9k_hw_abortpcurecv(struct ath_hw *ah); 697void ath9k_hw_abortpcurecv(struct ath_hw *ah);
698bool ath9k_hw_stopdmarecv(struct ath_hw *ah); 698bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset);
699int ath9k_hw_beaconq_setup(struct ath_hw *ah); 699int ath9k_hw_beaconq_setup(struct ath_hw *ah);
700 700
701/* Interrupt Handling */ 701/* Interrupt Handling */
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 115f162c617a..17d04ff8d678 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1048,6 +1048,8 @@ static int ath9k_start(struct ieee80211_hw *hw)
1048 "Starting driver with initial channel: %d MHz\n", 1048 "Starting driver with initial channel: %d MHz\n",
1049 curchan->center_freq); 1049 curchan->center_freq);
1050 1050
1051 ath9k_ps_wakeup(sc);
1052
1051 mutex_lock(&sc->mutex); 1053 mutex_lock(&sc->mutex);
1052 1054
1053 /* setup initial channel */ 1055 /* setup initial channel */
@@ -1143,6 +1145,8 @@ static int ath9k_start(struct ieee80211_hw *hw)
1143mutex_unlock: 1145mutex_unlock:
1144 mutex_unlock(&sc->mutex); 1146 mutex_unlock(&sc->mutex);
1145 1147
1148 ath9k_ps_restore(sc);
1149
1146 return r; 1150 return r;
1147} 1151}
1148 1152
@@ -1372,7 +1376,6 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
1372 1376
1373 ath9k_calculate_iter_data(hw, vif, &iter_data); 1377 ath9k_calculate_iter_data(hw, vif, &iter_data);
1374 1378
1375 ath9k_ps_wakeup(sc);
1376 /* Set BSSID mask. */ 1379 /* Set BSSID mask. */
1377 memcpy(common->bssidmask, iter_data.mask, ETH_ALEN); 1380 memcpy(common->bssidmask, iter_data.mask, ETH_ALEN);
1378 ath_hw_setbssidmask(common); 1381 ath_hw_setbssidmask(common);
@@ -1407,7 +1410,6 @@ static void ath9k_calculate_summary_state(struct ieee80211_hw *hw,
1407 } 1410 }
1408 1411
1409 ath9k_hw_set_interrupts(ah, ah->imask); 1412 ath9k_hw_set_interrupts(ah, ah->imask);
1410 ath9k_ps_restore(sc);
1411 1413
1412 /* Set up ANI */ 1414 /* Set up ANI */
1413 if ((iter_data.naps + iter_data.nadhocs) > 0) { 1415 if ((iter_data.naps + iter_data.nadhocs) > 0) {
@@ -1453,6 +1455,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1453 struct ath_vif *avp = (void *)vif->drv_priv; 1455 struct ath_vif *avp = (void *)vif->drv_priv;
1454 int ret = 0; 1456 int ret = 0;
1455 1457
1458 ath9k_ps_wakeup(sc);
1456 mutex_lock(&sc->mutex); 1459 mutex_lock(&sc->mutex);
1457 1460
1458 switch (vif->type) { 1461 switch (vif->type) {
@@ -1499,6 +1502,7 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
1499 ath9k_do_vif_add_setup(hw, vif); 1502 ath9k_do_vif_add_setup(hw, vif);
1500out: 1503out:
1501 mutex_unlock(&sc->mutex); 1504 mutex_unlock(&sc->mutex);
1505 ath9k_ps_restore(sc);
1502 return ret; 1506 return ret;
1503} 1507}
1504 1508
@@ -1513,6 +1517,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
1513 1517
1514 ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n"); 1518 ath_dbg(common, ATH_DBG_CONFIG, "Change Interface\n");
1515 mutex_lock(&sc->mutex); 1519 mutex_lock(&sc->mutex);
1520 ath9k_ps_wakeup(sc);
1516 1521
1517 /* See if new interface type is valid. */ 1522 /* See if new interface type is valid. */
1518 if ((new_type == NL80211_IFTYPE_ADHOC) && 1523 if ((new_type == NL80211_IFTYPE_ADHOC) &&
@@ -1542,6 +1547,7 @@ static int ath9k_change_interface(struct ieee80211_hw *hw,
1542 1547
1543 ath9k_do_vif_add_setup(hw, vif); 1548 ath9k_do_vif_add_setup(hw, vif);
1544out: 1549out:
1550 ath9k_ps_restore(sc);
1545 mutex_unlock(&sc->mutex); 1551 mutex_unlock(&sc->mutex);
1546 return ret; 1552 return ret;
1547} 1553}
@@ -1554,6 +1560,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
1554 1560
1555 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n"); 1561 ath_dbg(common, ATH_DBG_CONFIG, "Detach Interface\n");
1556 1562
1563 ath9k_ps_wakeup(sc);
1557 mutex_lock(&sc->mutex); 1564 mutex_lock(&sc->mutex);
1558 1565
1559 sc->nvifs--; 1566 sc->nvifs--;
@@ -1565,6 +1572,7 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
1565 ath9k_calculate_summary_state(hw, NULL); 1572 ath9k_calculate_summary_state(hw, NULL);
1566 1573
1567 mutex_unlock(&sc->mutex); 1574 mutex_unlock(&sc->mutex);
1575 ath9k_ps_restore(sc);
1568} 1576}
1569 1577
1570static void ath9k_enable_ps(struct ath_softc *sc) 1578static void ath9k_enable_ps(struct ath_softc *sc)
@@ -1805,6 +1813,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
1805 1813
1806 txq = sc->tx.txq_map[queue]; 1814 txq = sc->tx.txq_map[queue];
1807 1815
1816 ath9k_ps_wakeup(sc);
1808 mutex_lock(&sc->mutex); 1817 mutex_lock(&sc->mutex);
1809 1818
1810 memset(&qi, 0, sizeof(struct ath9k_tx_queue_info)); 1819 memset(&qi, 0, sizeof(struct ath9k_tx_queue_info));
@@ -1828,6 +1837,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
1828 ath_beaconq_config(sc); 1837 ath_beaconq_config(sc);
1829 1838
1830 mutex_unlock(&sc->mutex); 1839 mutex_unlock(&sc->mutex);
1840 ath9k_ps_restore(sc);
1831 1841
1832 return ret; 1842 return ret;
1833} 1843}
@@ -1890,6 +1900,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
1890 int slottime; 1900 int slottime;
1891 int error; 1901 int error;
1892 1902
1903 ath9k_ps_wakeup(sc);
1893 mutex_lock(&sc->mutex); 1904 mutex_lock(&sc->mutex);
1894 1905
1895 if (changed & BSS_CHANGED_BSSID) { 1906 if (changed & BSS_CHANGED_BSSID) {
@@ -1990,6 +2001,7 @@ static void ath9k_bss_info_changed(struct ieee80211_hw *hw,
1990 } 2001 }
1991 2002
1992 mutex_unlock(&sc->mutex); 2003 mutex_unlock(&sc->mutex);
2004 ath9k_ps_restore(sc);
1993} 2005}
1994 2006
1995static u64 ath9k_get_tsf(struct ieee80211_hw *hw) 2007static u64 ath9k_get_tsf(struct ieee80211_hw *hw)
@@ -2160,6 +2172,8 @@ static void ath9k_flush(struct ieee80211_hw *hw, bool drop)
2160 if (!ath_drain_all_txq(sc, false)) 2172 if (!ath_drain_all_txq(sc, false))
2161 ath_reset(sc, false); 2173 ath_reset(sc, false);
2162 2174
2175 ieee80211_wake_queues(hw);
2176
2163out: 2177out:
2164 ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0); 2178 ieee80211_queue_delayed_work(hw, &sc->tx_complete_work, 0);
2165 mutex_unlock(&sc->mutex); 2179 mutex_unlock(&sc->mutex);
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index e83128c50f7b..9c65459be100 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -44,7 +44,7 @@ static void ath_pci_read_cachesize(struct ath_common *common, int *csz)
44 *csz = (int)u8tmp; 44 *csz = (int)u8tmp;
45 45
46 /* 46 /*
47 * This check was put in to avoid "unplesant" consequences if 47 * This check was put in to avoid "unpleasant" consequences if
48 * the bootrom has not fully initialized all PCI devices. 48 * the bootrom has not fully initialized all PCI devices.
49 * Sometimes the cache line size register is not set 49 * Sometimes the cache line size register is not set
50 */ 50 */
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 960d717ca7c2..4c0d36a6980f 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -792,7 +792,7 @@ static void ath_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
792 792
793 tx_info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE; 793 tx_info->flags |= IEEE80211_TX_CTL_RATE_CTRL_PROBE;
794 } else { 794 } else {
795 /* Set the choosen rate. No RTS for first series entry. */ 795 /* Set the chosen rate. No RTS for first series entry. */
796 ath_rc_rate_set_series(rate_table, &rates[i++], txrc, 796 ath_rc_rate_set_series(rate_table, &rates[i++], txrc,
797 try_per_rate, rix, 0); 797 try_per_rate, rix, 0);
798 } 798 }
@@ -1328,7 +1328,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
1328 1328
1329 hdr = (struct ieee80211_hdr *)skb->data; 1329 hdr = (struct ieee80211_hdr *)skb->data;
1330 fc = hdr->frame_control; 1330 fc = hdr->frame_control;
1331 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++) { 1331 for (i = 0; i < sc->hw->max_rates; i++) {
1332 struct ieee80211_tx_rate *rate = &tx_info->status.rates[i]; 1332 struct ieee80211_tx_rate *rate = &tx_info->status.rates[i];
1333 if (!rate->count) 1333 if (!rate->count)
1334 break; 1334 break;
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index a9c3f4672aa0..dcd19bc337d1 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -486,12 +486,12 @@ start_recv:
486bool ath_stoprecv(struct ath_softc *sc) 486bool ath_stoprecv(struct ath_softc *sc)
487{ 487{
488 struct ath_hw *ah = sc->sc_ah; 488 struct ath_hw *ah = sc->sc_ah;
489 bool stopped; 489 bool stopped, reset = false;
490 490
491 spin_lock_bh(&sc->rx.rxbuflock); 491 spin_lock_bh(&sc->rx.rxbuflock);
492 ath9k_hw_abortpcurecv(ah); 492 ath9k_hw_abortpcurecv(ah);
493 ath9k_hw_setrxfilter(ah, 0); 493 ath9k_hw_setrxfilter(ah, 0);
494 stopped = ath9k_hw_stopdmarecv(ah); 494 stopped = ath9k_hw_stopdmarecv(ah, &reset);
495 495
496 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) 496 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
497 ath_edma_stop_recv(sc); 497 ath_edma_stop_recv(sc);
@@ -506,7 +506,7 @@ bool ath_stoprecv(struct ath_softc *sc)
506 "confusing the DMA engine when we start RX up\n"); 506 "confusing the DMA engine when we start RX up\n");
507 ATH_DBG_WARN_ON_ONCE(!stopped); 507 ATH_DBG_WARN_ON_ONCE(!stopped);
508 } 508 }
509 return stopped; 509 return stopped || reset;
510} 510}
511 511
512void ath_flushrecv(struct ath_softc *sc) 512void ath_flushrecv(struct ath_softc *sc)
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index ef22096d40c9..88fa7fdffd05 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -628,8 +628,8 @@ static u32 ath_lookup_rate(struct ath_softc *sc, struct ath_buf *bf,
628 (u32)ATH_AMPDU_LIMIT_MAX); 628 (u32)ATH_AMPDU_LIMIT_MAX);
629 629
630 /* 630 /*
631 * h/w can accept aggregates upto 16 bit lengths (65535). 631 * h/w can accept aggregates up to 16 bit lengths (65535).
632 * The IE, however can hold upto 65536, which shows up here 632 * The IE, however can hold up to 65536, which shows up here
633 * as zero. Ignore 65536 since we are constrained by hw. 633 * as zero. Ignore 65536 since we are constrained by hw.
634 */ 634 */
635 if (tid->an->maxampdu) 635 if (tid->an->maxampdu)
@@ -1725,8 +1725,8 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf,
1725 u8 tidno; 1725 u8 tidno;
1726 1726
1727 spin_lock_bh(&txctl->txq->axq_lock); 1727 spin_lock_bh(&txctl->txq->axq_lock);
1728 1728 if ((sc->sc_flags & SC_OP_TXAGGR) && txctl->an &&
1729 if (ieee80211_is_data_qos(hdr->frame_control) && txctl->an) { 1729 ieee80211_is_data_qos(hdr->frame_control)) {
1730 tidno = ieee80211_get_qos_ctl(hdr)[0] & 1730 tidno = ieee80211_get_qos_ctl(hdr)[0] &
1731 IEEE80211_QOS_CTL_TID_MASK; 1731 IEEE80211_QOS_CTL_TID_MASK;
1732 tid = ATH_AN_2_TID(txctl->an, tidno); 1732 tid = ATH_AN_2_TID(txctl->an, tidno);
diff --git a/drivers/net/wireless/ath/carl9170/carl9170.h b/drivers/net/wireless/ath/carl9170/carl9170.h
index c6a5fae634a0..3d4ed5863732 100644
--- a/drivers/net/wireless/ath/carl9170/carl9170.h
+++ b/drivers/net/wireless/ath/carl9170/carl9170.h
@@ -161,7 +161,7 @@ struct carl9170_sta_tid {
161 * Naturally: The higher the limit, the faster the device CAN send. 161 * Naturally: The higher the limit, the faster the device CAN send.
162 * However, even a slight over-commitment at the wrong time and the 162 * However, even a slight over-commitment at the wrong time and the
163 * hardware is doomed to send all already-queued frames at suboptimal 163 * hardware is doomed to send all already-queued frames at suboptimal
164 * rates. This in turn leads to an enourmous amount of unsuccessful 164 * rates. This in turn leads to an enormous amount of unsuccessful
165 * retries => Latency goes up, whereas the throughput goes down. CRASH! 165 * retries => Latency goes up, whereas the throughput goes down. CRASH!
166 */ 166 */
167#define CARL9170_NUM_TX_LIMIT_HARD ((AR9170_TXQ_DEPTH * 3) / 2) 167#define CARL9170_NUM_TX_LIMIT_HARD ((AR9170_TXQ_DEPTH * 3) / 2)
@@ -443,6 +443,7 @@ struct carl9170_ba_stats {
443 u8 ampdu_len; 443 u8 ampdu_len;
444 u8 ampdu_ack_len; 444 u8 ampdu_ack_len;
445 bool clear; 445 bool clear;
446 bool req;
446}; 447};
447 448
448struct carl9170_sta_info { 449struct carl9170_sta_info {
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c
index ede3d7e5a048..89fe60accf85 100644
--- a/drivers/net/wireless/ath/carl9170/main.c
+++ b/drivers/net/wireless/ath/carl9170/main.c
@@ -1355,6 +1355,7 @@ static int carl9170_op_ampdu_action(struct ieee80211_hw *hw,
1355 tid_info = rcu_dereference(sta_info->agg[tid]); 1355 tid_info = rcu_dereference(sta_info->agg[tid]);
1356 1356
1357 sta_info->stats[tid].clear = true; 1357 sta_info->stats[tid].clear = true;
1358 sta_info->stats[tid].req = false;
1358 1359
1359 if (tid_info) { 1360 if (tid_info) {
1360 bitmap_zero(tid_info->bitmap, CARL9170_BAW_SIZE); 1361 bitmap_zero(tid_info->bitmap, CARL9170_BAW_SIZE);
diff --git a/drivers/net/wireless/ath/carl9170/phy.c b/drivers/net/wireless/ath/carl9170/phy.c
index b6b0de600506..b6ae0e179c8d 100644
--- a/drivers/net/wireless/ath/carl9170/phy.c
+++ b/drivers/net/wireless/ath/carl9170/phy.c
@@ -427,7 +427,7 @@ static u32 carl9170_def_val(u32 reg, bool is_2ghz, bool is_40mhz)
427 427
428/* 428/*
429 * initialize some phy regs from eeprom values in modal_header[] 429 * initialize some phy regs from eeprom values in modal_header[]
430 * acc. to band and bandwith 430 * acc. to band and bandwidth
431 */ 431 */
432static int carl9170_init_phy_from_eeprom(struct ar9170 *ar, 432static int carl9170_init_phy_from_eeprom(struct ar9170 *ar,
433 bool is_2ghz, bool is_40mhz) 433 bool is_2ghz, bool is_40mhz)
diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c
index 84866a4b8350..ec21ea9fd8d5 100644
--- a/drivers/net/wireless/ath/carl9170/rx.c
+++ b/drivers/net/wireless/ath/carl9170/rx.c
@@ -849,7 +849,7 @@ static void carl9170_rx_stream(struct ar9170 *ar, void *buf, unsigned int len)
849 /* 849 /*
850 * nested carl9170_rx_stream call! 850 * nested carl9170_rx_stream call!
851 * 851 *
852 * termination is guranteed, even when the 852 * termination is guaranteed, even when the
853 * combined frame also have an element with 853 * combined frame also have an element with
854 * a bad tag. 854 * a bad tag.
855 */ 855 */
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c
index 0ef70b6fc512..cb70ed7ec5cc 100644
--- a/drivers/net/wireless/ath/carl9170/tx.c
+++ b/drivers/net/wireless/ath/carl9170/tx.c
@@ -383,6 +383,7 @@ static void carl9170_tx_status_process_ampdu(struct ar9170 *ar,
383 383
384 if (sta_info->stats[tid].clear) { 384 if (sta_info->stats[tid].clear) {
385 sta_info->stats[tid].clear = false; 385 sta_info->stats[tid].clear = false;
386 sta_info->stats[tid].req = false;
386 sta_info->stats[tid].ampdu_len = 0; 387 sta_info->stats[tid].ampdu_len = 0;
387 sta_info->stats[tid].ampdu_ack_len = 0; 388 sta_info->stats[tid].ampdu_ack_len = 0;
388 } 389 }
@@ -391,10 +392,16 @@ static void carl9170_tx_status_process_ampdu(struct ar9170 *ar,
391 if (txinfo->status.rates[0].count == 1) 392 if (txinfo->status.rates[0].count == 1)
392 sta_info->stats[tid].ampdu_ack_len++; 393 sta_info->stats[tid].ampdu_ack_len++;
393 394
395 if (!(txinfo->flags & IEEE80211_TX_STAT_ACK))
396 sta_info->stats[tid].req = true;
397
394 if (super->f.mac_control & cpu_to_le16(AR9170_TX_MAC_IMM_BA)) { 398 if (super->f.mac_control & cpu_to_le16(AR9170_TX_MAC_IMM_BA)) {
395 super->s.rix = sta_info->stats[tid].ampdu_len; 399 super->s.rix = sta_info->stats[tid].ampdu_len;
396 super->s.cnt = sta_info->stats[tid].ampdu_ack_len; 400 super->s.cnt = sta_info->stats[tid].ampdu_ack_len;
397 txinfo->flags |= IEEE80211_TX_STAT_AMPDU; 401 txinfo->flags |= IEEE80211_TX_STAT_AMPDU;
402 if (sta_info->stats[tid].req)
403 txinfo->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
404
398 sta_info->stats[tid].clear = true; 405 sta_info->stats[tid].clear = true;
399 } 406 }
400 spin_unlock_bh(&tid_info->lock); 407 spin_unlock_bh(&tid_info->lock);
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c
index f82c400be288..2fb53d067512 100644
--- a/drivers/net/wireless/ath/carl9170/usb.c
+++ b/drivers/net/wireless/ath/carl9170/usb.c
@@ -430,7 +430,7 @@ static void carl9170_usb_rx_complete(struct urb *urb)
430 * The system is too slow to cope with 430 * The system is too slow to cope with
431 * the enormous workload. We have simply 431 * the enormous workload. We have simply
432 * run out of active rx urbs and this 432 * run out of active rx urbs and this
433 * unfortunatly leads to an unpredictable 433 * unfortunately leads to an unpredictable
434 * device. 434 * device.
435 */ 435 */
436 436
diff --git a/drivers/net/wireless/ath/hw.c b/drivers/net/wireless/ath/hw.c
index 183c28281385..cc11d66f15bc 100644
--- a/drivers/net/wireless/ath/hw.c
+++ b/drivers/net/wireless/ath/hw.c
@@ -86,7 +86,7 @@
86 * IFRAME-01: 0110 86 * IFRAME-01: 0110
87 * 87 *
88 * An easy eye-inspeciton of this already should tell you that this frame 88 * An easy eye-inspeciton of this already should tell you that this frame
89 * will not pass our check. This is beacuse the bssid_mask tells the 89 * will not pass our check. This is because the bssid_mask tells the
90 * hardware to only look at the second least significant bit and the 90 * hardware to only look at the second least significant bit and the
91 * common bit amongst the MAC and BSSIDs is 0, this frame has the 2nd LSB 91 * common bit amongst the MAC and BSSIDs is 0, this frame has the 2nd LSB
92 * as 1, which does not match 0. 92 * as 1, which does not match 0.
diff --git a/drivers/net/wireless/ath/regd.c b/drivers/net/wireless/ath/regd.c
index f828f294ba89..0e1b8793c864 100644
--- a/drivers/net/wireless/ath/regd.c
+++ b/drivers/net/wireless/ath/regd.c
@@ -268,7 +268,7 @@ ath_reg_apply_active_scan_flags(struct wiphy *wiphy,
268 } 268 }
269 269
270 /* 270 /*
271 * If a country IE has been recieved check its rule for this 271 * If a country IE has been received check its rule for this
272 * channel first before enabling active scan. The passive scan 272 * channel first before enabling active scan. The passive scan
273 * would have been enforced by the initial processing of our 273 * would have been enforced by the initial processing of our
274 * custom regulatory domain. 274 * custom regulatory domain.
@@ -476,7 +476,7 @@ ath_regd_init_wiphy(struct ath_regulatory *reg,
476 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY; 476 wiphy->flags |= WIPHY_FLAG_CUSTOM_REGULATORY;
477 } else { 477 } else {
478 /* 478 /*
479 * This gets applied in the case of the absense of CRDA, 479 * This gets applied in the case of the absence of CRDA,
480 * it's our own custom world regulatory domain, similar to 480 * it's our own custom world regulatory domain, similar to
481 * cfg80211's but we enable passive scanning. 481 * cfg80211's but we enable passive scanning.
482 */ 482 */
diff --git a/drivers/net/wireless/ath/regd_common.h b/drivers/net/wireless/ath/regd_common.h
index 248c670fdfbe..5c2cfe694152 100644
--- a/drivers/net/wireless/ath/regd_common.h
+++ b/drivers/net/wireless/ath/regd_common.h
@@ -195,6 +195,7 @@ static struct reg_dmn_pair_mapping regDomainPairs[] = {
195 {APL9_WORLD, CTL_ETSI, CTL_ETSI}, 195 {APL9_WORLD, CTL_ETSI, CTL_ETSI},
196 196
197 {APL3_FCCA, CTL_FCC, CTL_FCC}, 197 {APL3_FCCA, CTL_FCC, CTL_FCC},
198 {APL7_FCCA, CTL_FCC, CTL_FCC},
198 {APL1_ETSIC, CTL_FCC, CTL_ETSI}, 199 {APL1_ETSIC, CTL_FCC, CTL_ETSI},
199 {APL2_ETSIC, CTL_FCC, CTL_ETSI}, 200 {APL2_ETSIC, CTL_FCC, CTL_ETSI},
200 {APL2_APLD, CTL_FCC, NO_CTL}, 201 {APL2_APLD, CTL_FCC, NO_CTL},
diff --git a/drivers/net/wireless/atmel.c b/drivers/net/wireless/atmel.c
index 46e382ed46aa..39a11e8af4fa 100644
--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -439,7 +439,7 @@ static u8 mac_reader[] = {
439}; 439};
440 440
441struct atmel_private { 441struct atmel_private {
442 void *card; /* Bus dependent stucture varies for PCcard */ 442 void *card; /* Bus dependent structure varies for PCcard */
443 int (*present_callback)(void *); /* And callback which uses it */ 443 int (*present_callback)(void *); /* And callback which uses it */
444 char firmware_id[32]; 444 char firmware_id[32];
445 AtmelFWType firmware_type; 445 AtmelFWType firmware_type;
@@ -3895,7 +3895,7 @@ static int reset_atmel_card(struct net_device *dev)
3895 3895
3896 This routine is also responsible for initialising some 3896 This routine is also responsible for initialising some
3897 hardware-specific fields in the atmel_private structure, 3897 hardware-specific fields in the atmel_private structure,
3898 including a copy of the firmware's hostinfo stucture 3898 including a copy of the firmware's hostinfo structure
3899 which is the route into the rest of the firmware datastructures. */ 3899 which is the route into the rest of the firmware datastructures. */
3900 3900
3901 struct atmel_private *priv = netdev_priv(dev); 3901 struct atmel_private *priv = netdev_priv(dev);
diff --git a/drivers/net/wireless/atmel_cs.c b/drivers/net/wireless/atmel_cs.c
index c96e19da2949..05263516c113 100644
--- a/drivers/net/wireless/atmel_cs.c
+++ b/drivers/net/wireless/atmel_cs.c
@@ -99,7 +99,7 @@ static void atmel_detach(struct pcmcia_device *link)
99} 99}
100 100
101/* Call-back function to interrogate PCMCIA-specific information 101/* Call-back function to interrogate PCMCIA-specific information
102 about the current existance of the card */ 102 about the current existence of the card */
103static int card_present(void *arg) 103static int card_present(void *arg)
104{ 104{
105 struct pcmcia_device *link = (struct pcmcia_device *)arg; 105 struct pcmcia_device *link = (struct pcmcia_device *)arg;
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index bd4cb75b6ca3..229f4388f790 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -648,7 +648,7 @@ struct b43_request_fw_context {
648 char errors[B43_NR_FWTYPES][128]; 648 char errors[B43_NR_FWTYPES][128];
649 /* Temporary buffer for storing the firmware name. */ 649 /* Temporary buffer for storing the firmware name. */
650 char fwname[64]; 650 char fwname[64];
651 /* A fatal error occured while requesting. Firmware reqest 651 /* A fatal error occurred while requesting. Firmware reqest
652 * can not continue, as any other reqest will also fail. */ 652 * can not continue, as any other reqest will also fail. */
653 int fatal_failure; 653 int fatal_failure;
654}; 654};
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index 3d5566e7af0a..ff0f5ba14b2c 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -1536,7 +1536,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
1536 dmaaddr = meta->dmaaddr; 1536 dmaaddr = meta->dmaaddr;
1537 goto drop_recycle_buffer; 1537 goto drop_recycle_buffer;
1538 } 1538 }
1539 if (unlikely(len > ring->rx_buffersize)) { 1539 if (unlikely(len + ring->frameoffset > ring->rx_buffersize)) {
1540 /* The data did not fit into one descriptor buffer 1540 /* The data did not fit into one descriptor buffer
1541 * and is split over multiple buffers. 1541 * and is split over multiple buffers.
1542 * This should never happen, as we try to allocate buffers 1542 * This should never happen, as we try to allocate buffers
diff --git a/drivers/net/wireless/b43/dma.h b/drivers/net/wireless/b43/dma.h
index a01c2100f166..e8a80a1251bf 100644
--- a/drivers/net/wireless/b43/dma.h
+++ b/drivers/net/wireless/b43/dma.h
@@ -163,7 +163,7 @@ struct b43_dmadesc_generic {
163/* DMA engine tuning knobs */ 163/* DMA engine tuning knobs */
164#define B43_TXRING_SLOTS 256 164#define B43_TXRING_SLOTS 256
165#define B43_RXRING_SLOTS 64 165#define B43_RXRING_SLOTS 64
166#define B43_DMA0_RX_BUFFERSIZE IEEE80211_MAX_FRAME_LEN 166#define B43_DMA0_RX_BUFFERSIZE (B43_DMA0_RX_FRAMEOFFSET + IEEE80211_MAX_FRAME_LEN)
167 167
168/* Pointer poison */ 168/* Pointer poison */
169#define B43_DMA_PTR_POISON ((void *)ERR_PTR(-ENOMEM)) 169#define B43_DMA_PTR_POISON ((void *)ERR_PTR(-ENOMEM))
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 57eb5b649730..d59b0168c14a 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4010,7 +4010,7 @@ static int b43_wireless_core_start(struct b43_wldev *dev)
4010 b43_mac_enable(dev); 4010 b43_mac_enable(dev);
4011 b43_write32(dev, B43_MMIO_GEN_IRQ_MASK, dev->irq_mask); 4011 b43_write32(dev, B43_MMIO_GEN_IRQ_MASK, dev->irq_mask);
4012 4012
4013 /* Start maintainance work */ 4013 /* Start maintenance work */
4014 b43_periodic_tasks_setup(dev); 4014 b43_periodic_tasks_setup(dev);
4015 4015
4016 b43_leds_init(dev); 4016 b43_leds_init(dev);
diff --git a/drivers/net/wireless/b43/phy_g.h b/drivers/net/wireless/b43/phy_g.h
index 8569fdd4c6be..5413c906a3e7 100644
--- a/drivers/net/wireless/b43/phy_g.h
+++ b/drivers/net/wireless/b43/phy_g.h
@@ -164,7 +164,7 @@ struct b43_phy_g {
164 /* Current Interference Mitigation mode */ 164 /* Current Interference Mitigation mode */
165 int interfmode; 165 int interfmode;
166 /* Stack of saved values from the Interference Mitigation code. 166 /* Stack of saved values from the Interference Mitigation code.
167 * Each value in the stack is layed out as follows: 167 * Each value in the stack is laid out as follows:
168 * bit 0-11: offset 168 * bit 0-11: offset
169 * bit 12-15: register ID 169 * bit 12-15: register ID
170 * bit 16-32: value 170 * bit 16-32: value
diff --git a/drivers/net/wireless/b43/phy_n.h b/drivers/net/wireless/b43/phy_n.h
index 001e841f118c..e789a89f1047 100644
--- a/drivers/net/wireless/b43/phy_n.h
+++ b/drivers/net/wireless/b43/phy_n.h
@@ -703,7 +703,7 @@
703#define B43_NPHY_CHAN_ESTHANG B43_PHY_N(0x21D) /* Channel estimate hang */ 703#define B43_NPHY_CHAN_ESTHANG B43_PHY_N(0x21D) /* Channel estimate hang */
704#define B43_NPHY_FINERX2_CGC B43_PHY_N(0x221) /* Fine RX 2 clock gate control */ 704#define B43_NPHY_FINERX2_CGC B43_PHY_N(0x221) /* Fine RX 2 clock gate control */
705#define B43_NPHY_FINERX2_CGC_DECGC 0x0008 /* Decode gated clocks */ 705#define B43_NPHY_FINERX2_CGC_DECGC 0x0008 /* Decode gated clocks */
706#define B43_NPHY_TXPCTL_INIT B43_PHY_N(0x222) /* TX power controll init */ 706#define B43_NPHY_TXPCTL_INIT B43_PHY_N(0x222) /* TX power control init */
707#define B43_NPHY_TXPCTL_INIT_PIDXI1 0x00FF /* Power index init 1 */ 707#define B43_NPHY_TXPCTL_INIT_PIDXI1 0x00FF /* Power index init 1 */
708#define B43_NPHY_TXPCTL_INIT_PIDXI1_SHIFT 0 708#define B43_NPHY_TXPCTL_INIT_PIDXI1_SHIFT 0
709#define B43_NPHY_PAPD_EN0 B43_PHY_N(0x297) /* PAPD Enable0 TBD */ 709#define B43_NPHY_PAPD_EN0 B43_PHY_N(0x297) /* PAPD Enable0 TBD */
diff --git a/drivers/net/wireless/b43legacy/b43legacy.h b/drivers/net/wireless/b43legacy/b43legacy.h
index c81b2f53b0c5..23583be1ee0b 100644
--- a/drivers/net/wireless/b43legacy/b43legacy.h
+++ b/drivers/net/wireless/b43legacy/b43legacy.h
@@ -488,7 +488,7 @@ struct b43legacy_phy {
488 /* Current Interference Mitigation mode */ 488 /* Current Interference Mitigation mode */
489 int interfmode; 489 int interfmode;
490 /* Stack of saved values from the Interference Mitigation code. 490 /* Stack of saved values from the Interference Mitigation code.
491 * Each value in the stack is layed out as follows: 491 * Each value in the stack is laid out as follows:
492 * bit 0-11: offset 492 * bit 0-11: offset
493 * bit 12-15: register ID 493 * bit 12-15: register ID
494 * bit 16-32: value 494 * bit 16-32: value
diff --git a/drivers/net/wireless/hostap/hostap_ap.c b/drivers/net/wireless/hostap/hostap_ap.c
index 18d63f57777d..3d05dc15c6b8 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -2359,7 +2359,7 @@ int prism2_ap_get_sta_qual(local_info_t *local, struct sockaddr addr[],
2359} 2359}
2360 2360
2361 2361
2362/* Translate our list of Access Points & Stations to a card independant 2362/* Translate our list of Access Points & Stations to a card independent
2363 * format that the Wireless Tools will understand - Jean II */ 2363 * format that the Wireless Tools will understand - Jean II */
2364int prism2_ap_translate_scan(struct net_device *dev, 2364int prism2_ap_translate_scan(struct net_device *dev,
2365 struct iw_request_info *info, char *buffer) 2365 struct iw_request_info *info, char *buffer)
diff --git a/drivers/net/wireless/hostap/hostap_ap.h b/drivers/net/wireless/hostap/hostap_ap.h
index 655ceeba9612..334e2d0b8e11 100644
--- a/drivers/net/wireless/hostap/hostap_ap.h
+++ b/drivers/net/wireless/hostap/hostap_ap.h
@@ -114,7 +114,7 @@ struct sta_info {
114 * has passed since last received frame from the station, a nullfunc data 114 * has passed since last received frame from the station, a nullfunc data
115 * frame is sent to the station. If this frame is not acknowledged and no other 115 * frame is sent to the station. If this frame is not acknowledged and no other
116 * frames have been received, the station will be disassociated after 116 * frames have been received, the station will be disassociated after
117 * AP_DISASSOC_DELAY. Similarily, a the station will be deauthenticated after 117 * AP_DISASSOC_DELAY. Similarly, a the station will be deauthenticated after
118 * AP_DEAUTH_DELAY. AP_TIMEOUT_RESOLUTION is the resolution that is used with 118 * AP_DEAUTH_DELAY. AP_TIMEOUT_RESOLUTION is the resolution that is used with
119 * max inactivity timer. */ 119 * max inactivity timer. */
120#define AP_MAX_INACTIVITY_SEC (5 * 60) 120#define AP_MAX_INACTIVITY_SEC (5 * 60)
diff --git a/drivers/net/wireless/hostap/hostap_config.h b/drivers/net/wireless/hostap/hostap_config.h
index 30acd39d76a2..2c8f71f0ed45 100644
--- a/drivers/net/wireless/hostap/hostap_config.h
+++ b/drivers/net/wireless/hostap/hostap_config.h
@@ -30,9 +30,9 @@
30 30
31/* Following defines can be used to remove unneeded parts of the driver, e.g., 31/* Following defines can be used to remove unneeded parts of the driver, e.g.,
32 * to limit the size of the kernel module. Definitions can be added here in 32 * to limit the size of the kernel module. Definitions can be added here in
33 * hostap_config.h or they can be added to make command with EXTRA_CFLAGS, 33 * hostap_config.h or they can be added to make command with ccflags-y,
34 * e.g., 34 * e.g.,
35 * 'make pccard EXTRA_CFLAGS="-DPRISM2_NO_DEBUG -DPRISM2_NO_PROCFS_DEBUG"' 35 * 'make pccard ccflags-y="-DPRISM2_NO_DEBUG -DPRISM2_NO_PROCFS_DEBUG"'
36 */ 36 */
37 37
38/* Do not include debug messages into the driver */ 38/* Do not include debug messages into the driver */
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c
index 6038633ef361..12de46407c71 100644
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1945,7 +1945,7 @@ static char * __prism2_translate_scan(local_info_t *local,
1945} 1945}
1946 1946
1947 1947
1948/* Translate scan data returned from the card to a card independant 1948/* Translate scan data returned from the card to a card independent
1949 * format that the Wireless Tools will understand - Jean II */ 1949 * format that the Wireless Tools will understand - Jean II */
1950static inline int prism2_translate_scan(local_info_t *local, 1950static inline int prism2_translate_scan(local_info_t *local,
1951 struct iw_request_info *info, 1951 struct iw_request_info *info,
@@ -2043,7 +2043,7 @@ static inline int prism2_ioctl_giwscan_sta(struct net_device *dev,
2043 * until results are ready for various reasons. 2043 * until results are ready for various reasons.
2044 * First, managing wait queues is complex and racy 2044 * First, managing wait queues is complex and racy
2045 * (there may be multiple simultaneous callers). 2045 * (there may be multiple simultaneous callers).
2046 * Second, we grab some rtnetlink lock before comming 2046 * Second, we grab some rtnetlink lock before coming
2047 * here (in dev_ioctl()). 2047 * here (in dev_ioctl()).
2048 * Third, the caller can wait on the Wireless Event 2048 * Third, the caller can wait on the Wireless Event
2049 * - Jean II */ 2049 * - Jean II */
diff --git a/drivers/net/wireless/hostap/hostap_wlan.h b/drivers/net/wireless/hostap/hostap_wlan.h
index 1c66b3c1030d..88dc6a52bdf1 100644
--- a/drivers/net/wireless/hostap/hostap_wlan.h
+++ b/drivers/net/wireless/hostap/hostap_wlan.h
@@ -853,7 +853,7 @@ struct local_info {
853 struct work_struct comms_qual_update; 853 struct work_struct comms_qual_update;
854 854
855 /* RSSI to dBm adjustment (for RX descriptor fields) */ 855 /* RSSI to dBm adjustment (for RX descriptor fields) */
856 int rssi_to_dBm; /* substract from RSSI to get approximate dBm value */ 856 int rssi_to_dBm; /* subtract from RSSI to get approximate dBm value */
857 857
858 /* BSS list / protected by local->lock */ 858 /* BSS list / protected by local->lock */
859 struct list_head bss_list; 859 struct list_head bss_list;
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 4b97f918daff..44307753587d 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -63,7 +63,7 @@ When data is sent to the firmware, the first TBD is used to indicate to the
63firmware if a Command or Data is being sent. If it is Command, all of the 63firmware if a Command or Data is being sent. If it is Command, all of the
64command information is contained within the physical address referred to by the 64command information is contained within the physical address referred to by the
65TBD. If it is Data, the first TBD indicates the type of data packet, number 65TBD. If it is Data, the first TBD indicates the type of data packet, number
66of fragments, etc. The next TBD then referrs to the actual packet location. 66of fragments, etc. The next TBD then refers to the actual packet location.
67 67
68The Tx flow cycle is as follows: 68The Tx flow cycle is as follows:
69 69
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 160881f234cc..42c3fe37af64 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -1181,7 +1181,7 @@ static void ipw_led_shutdown(struct ipw_priv *priv)
1181/* 1181/*
1182 * The following adds a new attribute to the sysfs representation 1182 * The following adds a new attribute to the sysfs representation
1183 * of this device driver (i.e. a new file in /sys/bus/pci/drivers/ipw/) 1183 * of this device driver (i.e. a new file in /sys/bus/pci/drivers/ipw/)
1184 * used for controling the debug level. 1184 * used for controlling the debug level.
1185 * 1185 *
1186 * See the level definitions in ipw for details. 1186 * See the level definitions in ipw for details.
1187 */ 1187 */
@@ -3763,7 +3763,7 @@ static int ipw_queue_tx_init(struct ipw_priv *priv,
3763 3763
3764 q->txb = kmalloc(sizeof(q->txb[0]) * count, GFP_KERNEL); 3764 q->txb = kmalloc(sizeof(q->txb[0]) * count, GFP_KERNEL);
3765 if (!q->txb) { 3765 if (!q->txb) {
3766 IPW_ERROR("vmalloc for auxilary BD structures failed\n"); 3766 IPW_ERROR("vmalloc for auxiliary BD structures failed\n");
3767 return -ENOMEM; 3767 return -ENOMEM;
3768 } 3768 }
3769 3769
@@ -5581,7 +5581,7 @@ static int ipw_find_adhoc_network(struct ipw_priv *priv,
5581 return 0; 5581 return 0;
5582 } 5582 }
5583 5583
5584 /* Verify privacy compatability */ 5584 /* Verify privacy compatibility */
5585 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != 5585 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) !=
5586 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5586 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5587 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded " 5587 IPW_DEBUG_MERGE("Network '%s (%pM)' excluded "
@@ -5808,7 +5808,7 @@ static int ipw_best_network(struct ipw_priv *priv,
5808 return 0; 5808 return 0;
5809 } 5809 }
5810 5810
5811 /* Verify privacy compatability */ 5811 /* Verify privacy compatibility */
5812 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) != 5812 if (((priv->capability & CAP_PRIVACY_ON) ? 1 : 0) !=
5813 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) { 5813 ((network->capability & WLAN_CAPABILITY_PRIVACY) ? 1 : 0)) {
5814 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded " 5814 IPW_DEBUG_ASSOC("Network '%s (%pM)' excluded "
@@ -8184,7 +8184,7 @@ static void ipw_handle_promiscuous_rx(struct ipw_priv *priv,
8184static int is_network_packet(struct ipw_priv *priv, 8184static int is_network_packet(struct ipw_priv *priv,
8185 struct libipw_hdr_4addr *header) 8185 struct libipw_hdr_4addr *header)
8186{ 8186{
8187 /* Filter incoming packets to determine if they are targetted toward 8187 /* Filter incoming packets to determine if they are targeted toward
8188 * this network, discarding packets coming from ourselves */ 8188 * this network, discarding packets coming from ourselves */
8189 switch (priv->ieee->iw_mode) { 8189 switch (priv->ieee->iw_mode) {
8190 case IW_MODE_ADHOC: /* Header: Dest. | Source | BSSID */ 8190 case IW_MODE_ADHOC: /* Header: Dest. | Source | BSSID */
@@ -8340,9 +8340,9 @@ static void ipw_handle_mgmt_packet(struct ipw_priv *priv,
8340} 8340}
8341 8341
8342/* 8342/*
8343 * Main entry function for recieving a packet with 80211 headers. This 8343 * Main entry function for receiving a packet with 80211 headers. This
8344 * should be called when ever the FW has notified us that there is a new 8344 * should be called when ever the FW has notified us that there is a new
8345 * skb in the recieve queue. 8345 * skb in the receive queue.
8346 */ 8346 */
8347static void ipw_rx(struct ipw_priv *priv) 8347static void ipw_rx(struct ipw_priv *priv)
8348{ 8348{
@@ -8683,7 +8683,7 @@ static int ipw_sw_reset(struct ipw_priv *priv, int option)
8683 * functions defined in ipw_main to provide the HW interaction. 8683 * functions defined in ipw_main to provide the HW interaction.
8684 * 8684 *
8685 * The exception to this is the use of the ipw_get_ordinal() 8685 * The exception to this is the use of the ipw_get_ordinal()
8686 * function used to poll the hardware vs. making unecessary calls. 8686 * function used to poll the hardware vs. making unnecessary calls.
8687 * 8687 *
8688 */ 8688 */
8689 8689
@@ -10419,7 +10419,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
10419 10419
10420 memset(&dummystats, 0, sizeof(dummystats)); 10420 memset(&dummystats, 0, sizeof(dummystats));
10421 10421
10422 /* Filtering of fragment chains is done agains the first fragment */ 10422 /* Filtering of fragment chains is done against the first fragment */
10423 hdr = (void *)txb->fragments[0]->data; 10423 hdr = (void *)txb->fragments[0]->data;
10424 if (libipw_is_management(le16_to_cpu(hdr->frame_control))) { 10424 if (libipw_is_management(le16_to_cpu(hdr->frame_control))) {
10425 if (filter & IPW_PROM_NO_MGMT) 10425 if (filter & IPW_PROM_NO_MGMT)
diff --git a/drivers/net/wireless/ipw2x00/libipw_rx.c b/drivers/net/wireless/ipw2x00/libipw_rx.c
index 0de1b1893220..e5ad76cd77da 100644
--- a/drivers/net/wireless/ipw2x00/libipw_rx.c
+++ b/drivers/net/wireless/ipw2x00/libipw_rx.c
@@ -925,7 +925,7 @@ drop_free:
925static u8 qos_oui[QOS_OUI_LEN] = { 0x00, 0x50, 0xF2 }; 925static u8 qos_oui[QOS_OUI_LEN] = { 0x00, 0x50, 0xF2 };
926 926
927/* 927/*
928* Make ther structure we read from the beacon packet has 928* Make the structure we read from the beacon packet to have
929* the right values 929* the right values
930*/ 930*/
931static int libipw_verify_qos_info(struct libipw_qos_information_element 931static int libipw_verify_qos_info(struct libipw_qos_information_element
diff --git a/drivers/net/wireless/iwlegacy/Kconfig b/drivers/net/wireless/iwlegacy/Kconfig
index 2a45dd44cc12..aef65cd47661 100644
--- a/drivers/net/wireless/iwlegacy/Kconfig
+++ b/drivers/net/wireless/iwlegacy/Kconfig
@@ -1,6 +1,5 @@
1config IWLWIFI_LEGACY 1config IWLWIFI_LEGACY
2 tristate "Intel Wireless Wifi legacy devices" 2 tristate
3 depends on PCI && MAC80211
4 select FW_LOADER 3 select FW_LOADER
5 select NEW_LEDS 4 select NEW_LEDS
6 select LEDS_CLASS 5 select LEDS_CLASS
@@ -65,7 +64,8 @@ endmenu
65 64
66config IWL4965 65config IWL4965
67 tristate "Intel Wireless WiFi 4965AGN (iwl4965)" 66 tristate "Intel Wireless WiFi 4965AGN (iwl4965)"
68 depends on IWLWIFI_LEGACY 67 depends on PCI && MAC80211
68 select IWLWIFI_LEGACY
69 ---help--- 69 ---help---
70 This option enables support for 70 This option enables support for
71 71
@@ -92,7 +92,8 @@ config IWL4965
92 92
93config IWL3945 93config IWL3945
94 tristate "Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945)" 94 tristate "Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945)"
95 depends on IWLWIFI_LEGACY 95 depends on PCI && MAC80211
96 select IWLWIFI_LEGACY
96 ---help--- 97 ---help---
97 Select to build the driver supporting the: 98 Select to build the driver supporting the:
98 99
diff --git a/drivers/net/wireless/iwlegacy/iwl-3945-hw.h b/drivers/net/wireless/iwlegacy/iwl-3945-hw.h
index 779d3cb86e2c..5c3a68d3af12 100644
--- a/drivers/net/wireless/iwlegacy/iwl-3945-hw.h
+++ b/drivers/net/wireless/iwlegacy/iwl-3945-hw.h
@@ -74,8 +74,6 @@
74/* RSSI to dBm */ 74/* RSSI to dBm */
75#define IWL39_RSSI_OFFSET 95 75#define IWL39_RSSI_OFFSET 95
76 76
77#define IWL_DEFAULT_TX_POWER 0x0F
78
79/* 77/*
80 * EEPROM related constants, enums, and structures. 78 * EEPROM related constants, enums, and structures.
81 */ 79 */
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-hw.h b/drivers/net/wireless/iwlegacy/iwl-4965-hw.h
index 08b189c8472d..fc6fa2886d9c 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-hw.h
@@ -804,9 +804,6 @@ struct iwl4965_scd_bc_tbl {
804 804
805#define IWL4965_DEFAULT_TX_RETRY 15 805#define IWL4965_DEFAULT_TX_RETRY 15
806 806
807/* Limit range of txpower output target to be between these values */
808#define IWL4965_TX_POWER_TARGET_POWER_MIN (0) /* 0 dBm: 1 milliwatt */
809
810/* EEPROM */ 807/* EEPROM */
811#define IWL4965_FIRST_AMPDU_QUEUE 10 808#define IWL4965_FIRST_AMPDU_QUEUE 10
812 809
diff --git a/drivers/net/wireless/iwlegacy/iwl-core.c b/drivers/net/wireless/iwlegacy/iwl-core.c
index d418b647be80..c1511b14b239 100644
--- a/drivers/net/wireless/iwlegacy/iwl-core.c
+++ b/drivers/net/wireless/iwlegacy/iwl-core.c
@@ -160,6 +160,7 @@ int iwl_legacy_init_geos(struct iwl_priv *priv)
160 struct ieee80211_channel *geo_ch; 160 struct ieee80211_channel *geo_ch;
161 struct ieee80211_rate *rates; 161 struct ieee80211_rate *rates;
162 int i = 0; 162 int i = 0;
163 s8 max_tx_power = 0;
163 164
164 if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates || 165 if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||
165 priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) { 166 priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {
@@ -235,8 +236,8 @@ int iwl_legacy_init_geos(struct iwl_priv *priv)
235 236
236 geo_ch->flags |= ch->ht40_extension_channel; 237 geo_ch->flags |= ch->ht40_extension_channel;
237 238
238 if (ch->max_power_avg > priv->tx_power_device_lmt) 239 if (ch->max_power_avg > max_tx_power)
239 priv->tx_power_device_lmt = ch->max_power_avg; 240 max_tx_power = ch->max_power_avg;
240 } else { 241 } else {
241 geo_ch->flags |= IEEE80211_CHAN_DISABLED; 242 geo_ch->flags |= IEEE80211_CHAN_DISABLED;
242 } 243 }
@@ -249,6 +250,10 @@ int iwl_legacy_init_geos(struct iwl_priv *priv)
249 geo_ch->flags); 250 geo_ch->flags);
250 } 251 }
251 252
253 priv->tx_power_device_lmt = max_tx_power;
254 priv->tx_power_user_lmt = max_tx_power;
255 priv->tx_power_next = max_tx_power;
256
252 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) && 257 if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
253 priv->cfg->sku & IWL_SKU_A) { 258 priv->cfg->sku & IWL_SKU_A) {
254 IWL_INFO(priv, "Incorrectly detected BG card as ABG. " 259 IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
@@ -1030,7 +1035,7 @@ int iwl_legacy_apm_init(struct iwl_priv *priv)
1030 /* 1035 /*
1031 * Enable HAP INTA (interrupt from management bus) to 1036 * Enable HAP INTA (interrupt from management bus) to
1032 * wake device's PCI Express link L1a -> L0s 1037 * wake device's PCI Express link L1a -> L0s
1033 * NOTE: This is no-op for 3945 (non-existant bit) 1038 * NOTE: This is no-op for 3945 (non-existent bit)
1034 */ 1039 */
1035 iwl_legacy_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1040 iwl_legacy_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1036 CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A); 1041 CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A);
@@ -1124,11 +1129,11 @@ int iwl_legacy_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
1124 if (!priv->cfg->ops->lib->send_tx_power) 1129 if (!priv->cfg->ops->lib->send_tx_power)
1125 return -EOPNOTSUPP; 1130 return -EOPNOTSUPP;
1126 1131
1127 if (tx_power < IWL4965_TX_POWER_TARGET_POWER_MIN) { 1132 /* 0 dBm mean 1 milliwatt */
1133 if (tx_power < 0) {
1128 IWL_WARN(priv, 1134 IWL_WARN(priv,
1129 "Requested user TXPOWER %d below lower limit %d.\n", 1135 "Requested user TXPOWER %d below 1 mW.\n",
1130 tx_power, 1136 tx_power);
1131 IWL4965_TX_POWER_TARGET_POWER_MIN);
1132 return -EINVAL; 1137 return -EINVAL;
1133 } 1138 }
1134 1139
@@ -1805,6 +1810,15 @@ iwl_legacy_mac_change_interface(struct ieee80211_hw *hw,
1805 1810
1806 mutex_lock(&priv->mutex); 1811 mutex_lock(&priv->mutex);
1807 1812
1813 if (!ctx->vif || !iwl_legacy_is_ready_rf(priv)) {
1814 /*
1815 * Huh? But wait ... this can maybe happen when
1816 * we're in the middle of a firmware restart!
1817 */
1818 err = -EBUSY;
1819 goto out;
1820 }
1821
1808 interface_modes = ctx->interface_modes | ctx->exclusive_interface_modes; 1822 interface_modes = ctx->interface_modes | ctx->exclusive_interface_modes;
1809 1823
1810 if (!(interface_modes & BIT(newtype))) { 1824 if (!(interface_modes & BIT(newtype))) {
@@ -1832,6 +1846,7 @@ iwl_legacy_mac_change_interface(struct ieee80211_hw *hw,
1832 /* success */ 1846 /* success */
1833 iwl_legacy_teardown_interface(priv, vif, true); 1847 iwl_legacy_teardown_interface(priv, vif, true);
1834 vif->type = newtype; 1848 vif->type = newtype;
1849 vif->p2p = newp2p;
1835 err = iwl_legacy_setup_interface(priv, ctx); 1850 err = iwl_legacy_setup_interface(priv, ctx);
1836 WARN_ON(err); 1851 WARN_ON(err);
1837 /* 1852 /*
diff --git a/drivers/net/wireless/iwlegacy/iwl-eeprom.c b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
index 04c5648027df..cb346d1a9ffa 100644
--- a/drivers/net/wireless/iwlegacy/iwl-eeprom.c
+++ b/drivers/net/wireless/iwlegacy/iwl-eeprom.c
@@ -471,13 +471,6 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv)
471 flags & EEPROM_CHANNEL_RADAR)) 471 flags & EEPROM_CHANNEL_RADAR))
472 ? "" : "not "); 472 ? "" : "not ");
473 473
474 /* Set the tx_power_user_lmt to the highest power
475 * supported by any channel */
476 if (eeprom_ch_info[ch].max_power_avg >
477 priv->tx_power_user_lmt)
478 priv->tx_power_user_lmt =
479 eeprom_ch_info[ch].max_power_avg;
480
481 ch_info++; 474 ch_info++;
482 } 475 }
483 } 476 }
diff --git a/drivers/net/wireless/iwlegacy/iwl-fh.h b/drivers/net/wireless/iwlegacy/iwl-fh.h
index 4e20c7e5c883..6e6091816e36 100644
--- a/drivers/net/wireless/iwlegacy/iwl-fh.h
+++ b/drivers/net/wireless/iwlegacy/iwl-fh.h
@@ -436,7 +436,7 @@
436 * @finished_rb_num [0:11] - Indicates the index of the current RB 436 * @finished_rb_num [0:11] - Indicates the index of the current RB
437 * in which the last frame was written to 437 * in which the last frame was written to
438 * @finished_fr_num [0:11] - Indicates the index of the RX Frame 438 * @finished_fr_num [0:11] - Indicates the index of the RX Frame
439 * which was transfered 439 * which was transferred
440 */ 440 */
441struct iwl_rb_status { 441struct iwl_rb_status {
442 __le16 closed_rb_num; 442 __le16 closed_rb_num;
diff --git a/drivers/net/wireless/iwlegacy/iwl-scan.c b/drivers/net/wireless/iwlegacy/iwl-scan.c
index 60f597f796ca..353234a02c6d 100644
--- a/drivers/net/wireless/iwlegacy/iwl-scan.c
+++ b/drivers/net/wireless/iwlegacy/iwl-scan.c
@@ -143,7 +143,7 @@ static void iwl_legacy_do_scan_abort(struct iwl_priv *priv)
143 IWL_DEBUG_SCAN(priv, "Send scan abort failed %d\n", ret); 143 IWL_DEBUG_SCAN(priv, "Send scan abort failed %d\n", ret);
144 iwl_legacy_force_scan_end(priv); 144 iwl_legacy_force_scan_end(priv);
145 } else 145 } else
146 IWL_DEBUG_SCAN(priv, "Sucessfully send scan abort\n"); 146 IWL_DEBUG_SCAN(priv, "Successfully send scan abort\n");
147} 147}
148 148
149/** 149/**
diff --git a/drivers/net/wireless/iwlegacy/iwl-sta.c b/drivers/net/wireless/iwlegacy/iwl-sta.c
index 47c9da3834ea..66f0fb2bbe00 100644
--- a/drivers/net/wireless/iwlegacy/iwl-sta.c
+++ b/drivers/net/wireless/iwlegacy/iwl-sta.c
@@ -110,7 +110,7 @@ static int iwl_legacy_process_add_sta_resp(struct iwl_priv *priv,
110 /* 110 /*
111 * XXX: The MAC address in the command buffer is often changed from 111 * XXX: The MAC address in the command buffer is often changed from
112 * the original sent to the device. That is, the MAC address 112 * the original sent to the device. That is, the MAC address
113 * written to the command buffer often is not the same MAC adress 113 * written to the command buffer often is not the same MAC address
114 * read from the command buffer when the command returns. This 114 * read from the command buffer when the command returns. This
115 * issue has not yet been resolved and this debugging is left to 115 * issue has not yet been resolved and this debugging is left to
116 * observe the problem. 116 * observe the problem.
diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c
index ab87e1b73529..cc7ebcee60e5 100644
--- a/drivers/net/wireless/iwlegacy/iwl3945-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c
@@ -93,6 +93,7 @@ MODULE_LICENSE("GPL");
93struct iwl_mod_params iwl3945_mod_params = { 93struct iwl_mod_params iwl3945_mod_params = {
94 .sw_crypto = 1, 94 .sw_crypto = 1,
95 .restart_fw = 1, 95 .restart_fw = 1,
96 .disable_hw_scan = 1,
96 /* the rest are 0 by default */ 97 /* the rest are 0 by default */
97}; 98};
98 99
@@ -3824,10 +3825,6 @@ static int iwl3945_init_drv(struct iwl_priv *priv)
3824 priv->force_reset[IWL_FW_RESET].reset_duration = 3825 priv->force_reset[IWL_FW_RESET].reset_duration =
3825 IWL_DELAY_NEXT_FORCE_FW_RELOAD; 3826 IWL_DELAY_NEXT_FORCE_FW_RELOAD;
3826 3827
3827
3828 priv->tx_power_user_lmt = IWL_DEFAULT_TX_POWER;
3829 priv->tx_power_next = IWL_DEFAULT_TX_POWER;
3830
3831 if (eeprom->version < EEPROM_3945_EEPROM_VERSION) { 3828 if (eeprom->version < EEPROM_3945_EEPROM_VERSION) {
3832 IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n", 3829 IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n",
3833 eeprom->version); 3830 eeprom->version);
@@ -3960,8 +3957,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e
3960 * "the hard way", rather than using device's scan. 3957 * "the hard way", rather than using device's scan.
3961 */ 3958 */
3962 if (iwl3945_mod_params.disable_hw_scan) { 3959 if (iwl3945_mod_params.disable_hw_scan) {
3963 dev_printk(KERN_DEBUG, &(pdev->dev), 3960 IWL_DEBUG_INFO(priv, "Disabling hw_scan\n");
3964 "sw scan support is deprecated\n");
3965 iwl3945_hw_ops.hw_scan = NULL; 3961 iwl3945_hw_ops.hw_scan = NULL;
3966 } 3962 }
3967 3963
@@ -4280,8 +4276,7 @@ MODULE_PARM_DESC(swcrypto,
4280 "using software crypto (default 1 [software])"); 4276 "using software crypto (default 1 [software])");
4281module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan, 4277module_param_named(disable_hw_scan, iwl3945_mod_params.disable_hw_scan,
4282 int, S_IRUGO); 4278 int, S_IRUGO);
4283MODULE_PARM_DESC(disable_hw_scan, 4279MODULE_PARM_DESC(disable_hw_scan, "disable hardware scanning (default 1)");
4284 "disable hardware scanning (default 0) (deprecated)");
4285#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG 4280#ifdef CONFIG_IWLWIFI_LEGACY_DEBUG
4286module_param_named(debug, iwlegacy_debug_level, uint, S_IRUGO | S_IWUSR); 4281module_param_named(debug, iwlegacy_debug_level, uint, S_IRUGO | S_IWUSR);
4287MODULE_PARM_DESC(debug, "debug output mask"); 4282MODULE_PARM_DESC(debug, "debug output mask");
diff --git a/drivers/net/wireless/iwlegacy/iwl4965-base.c b/drivers/net/wireless/iwlegacy/iwl4965-base.c
index 91b3d8b9d7a5..d484c3678163 100644
--- a/drivers/net/wireless/iwlegacy/iwl4965-base.c
+++ b/drivers/net/wireless/iwlegacy/iwl4965-base.c
@@ -3140,12 +3140,6 @@ static int iwl4965_init_drv(struct iwl_priv *priv)
3140 3140
3141 iwl_legacy_init_scan_params(priv); 3141 iwl_legacy_init_scan_params(priv);
3142 3142
3143 /* Set the tx_power_user_lmt to the lowest power level
3144 * this value will get overwritten by channel max power avg
3145 * from eeprom */
3146 priv->tx_power_user_lmt = IWL4965_TX_POWER_TARGET_POWER_MIN;
3147 priv->tx_power_next = IWL4965_TX_POWER_TARGET_POWER_MIN;
3148
3149 ret = iwl_legacy_init_channel_map(priv); 3143 ret = iwl_legacy_init_channel_map(priv);
3150 if (ret) { 3144 if (ret) {
3151 IWL_ERR(priv, "initializing regulatory failed: %d\n", ret); 3145 IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 3ea31b659d1a..22e045b5bcee 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -530,6 +530,9 @@ static struct iwl_ht_params iwl5000_ht_params = {
530struct iwl_cfg iwl5300_agn_cfg = { 530struct iwl_cfg iwl5300_agn_cfg = {
531 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN", 531 .name = "Intel(R) Ultimate N WiFi Link 5300 AGN",
532 IWL_DEVICE_5000, 532 IWL_DEVICE_5000,
533 /* at least EEPROM 0x11A has wrong info */
534 .valid_tx_ant = ANT_ABC, /* .cfg overwrite */
535 .valid_rx_ant = ANT_ABC, /* .cfg overwrite */
533 .ht_params = &iwl5000_ht_params, 536 .ht_params = &iwl5000_ht_params,
534}; 537};
535 538
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ict.c b/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
index b5cb3be0eb4b..ed0148d714de 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-ict.c
@@ -69,7 +69,7 @@ int iwl_alloc_isr_ict(struct iwl_priv *priv)
69 if (!priv->_agn.ict_tbl_vir) 69 if (!priv->_agn.ict_tbl_vir)
70 return -ENOMEM; 70 return -ENOMEM;
71 71
72 /* align table to PAGE_SIZE boundry */ 72 /* align table to PAGE_SIZE boundary */
73 priv->_agn.aligned_ict_tbl_dma = ALIGN(priv->_agn.ict_tbl_dma, PAGE_SIZE); 73 priv->_agn.aligned_ict_tbl_dma = ALIGN(priv->_agn.ict_tbl_dma, PAGE_SIZE);
74 74
75 IWL_DEBUG_ISR(priv, "ict dma addr %Lx dma aligned %Lx diff %d\n", 75 IWL_DEBUG_ISR(priv, "ict dma addr %Lx dma aligned %Lx diff %d\n",
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index 2003c1d4295f..08ccb9496f76 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -2265,7 +2265,7 @@ signed long iwlagn_wait_notification(struct iwl_priv *priv,
2265 int ret; 2265 int ret;
2266 2266
2267 ret = wait_event_timeout(priv->_agn.notif_waitq, 2267 ret = wait_event_timeout(priv->_agn.notif_waitq,
2268 &wait_entry->triggered, 2268 wait_entry->triggered,
2269 timeout); 2269 timeout);
2270 2270
2271 spin_lock_bh(&priv->_agn.notif_wait_lock); 2271 spin_lock_bh(&priv->_agn.notif_wait_lock);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 31233a330372..d1e2eb9d76bc 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -3009,14 +3009,17 @@ static int iwl_mac_offchannel_tx_cancel_wait(struct ieee80211_hw *hw)
3009 3009
3010 mutex_lock(&priv->mutex); 3010 mutex_lock(&priv->mutex);
3011 3011
3012 if (!priv->_agn.offchan_tx_skb) 3012 if (!priv->_agn.offchan_tx_skb) {
3013 return -EINVAL; 3013 ret = -EINVAL;
3014 goto unlock;
3015 }
3014 3016
3015 priv->_agn.offchan_tx_skb = NULL; 3017 priv->_agn.offchan_tx_skb = NULL;
3016 3018
3017 ret = iwl_scan_cancel_timeout(priv, 200); 3019 ret = iwl_scan_cancel_timeout(priv, 200);
3018 if (ret) 3020 if (ret)
3019 ret = -EIO; 3021 ret = -EIO;
3022unlock:
3020 mutex_unlock(&priv->mutex); 3023 mutex_unlock(&priv->mutex);
3021 3024
3022 return ret; 3025 return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 6c30fa652e27..bafbe57c9602 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1040,7 +1040,7 @@ int iwl_apm_init(struct iwl_priv *priv)
1040 /* 1040 /*
1041 * Enable HAP INTA (interrupt from management bus) to 1041 * Enable HAP INTA (interrupt from management bus) to
1042 * wake device's PCI Express link L1a -> L0s 1042 * wake device's PCI Express link L1a -> L0s
1043 * NOTE: This is no-op for 3945 (non-existant bit) 1043 * NOTE: This is no-op for 3945 (non-existent bit)
1044 */ 1044 */
1045 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG, 1045 iwl_set_bit(priv, CSR_HW_IF_CONFIG_REG,
1046 CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A); 1046 CSR_HW_IF_CONFIG_REG_BIT_HAP_WAKE_L1A);
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.h b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
index 98aa8af01192..20b66469d68f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-eeprom.h
+++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.h
@@ -241,7 +241,7 @@ struct iwl_eeprom_enhanced_txpwr {
241 241
242/* 6x00 Specific */ 242/* 6x00 Specific */
243#define EEPROM_6000_TX_POWER_VERSION (4) 243#define EEPROM_6000_TX_POWER_VERSION (4)
244#define EEPROM_6000_EEPROM_VERSION (0x434) 244#define EEPROM_6000_EEPROM_VERSION (0x423)
245 245
246/* 6x50 Specific */ 246/* 6x50 Specific */
247#define EEPROM_6050_TX_POWER_VERSION (4) 247#define EEPROM_6050_TX_POWER_VERSION (4)
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h
index 55b8370bc6d4..474009a244d4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fh.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fh.h
@@ -436,7 +436,7 @@
436 * @finished_rb_num [0:11] - Indicates the index of the current RB 436 * @finished_rb_num [0:11] - Indicates the index of the current RB
437 * in which the last frame was written to 437 * in which the last frame was written to
438 * @finished_fr_num [0:11] - Indicates the index of the RX Frame 438 * @finished_fr_num [0:11] - Indicates the index of the RX Frame
439 * which was transfered 439 * which was transferred
440 */ 440 */
441struct iwl_rb_status { 441struct iwl_rb_status {
442 __le16 closed_rb_num; 442 __le16 closed_rb_num;
diff --git a/drivers/net/wireless/iwlwifi/iwl-scan.c b/drivers/net/wireless/iwlwifi/iwl-scan.c
index 3a4d9e6b0421..914c77e44588 100644
--- a/drivers/net/wireless/iwlwifi/iwl-scan.c
+++ b/drivers/net/wireless/iwlwifi/iwl-scan.c
@@ -143,7 +143,7 @@ static void iwl_do_scan_abort(struct iwl_priv *priv)
143 IWL_DEBUG_SCAN(priv, "Send scan abort failed %d\n", ret); 143 IWL_DEBUG_SCAN(priv, "Send scan abort failed %d\n", ret);
144 iwl_force_scan_end(priv); 144 iwl_force_scan_end(priv);
145 } else 145 } else
146 IWL_DEBUG_SCAN(priv, "Sucessfully send scan abort\n"); 146 IWL_DEBUG_SCAN(priv, "Successfully send scan abort\n");
147} 147}
148 148
149/** 149/**
diff --git a/drivers/net/wireless/iwmc3200wifi/hal.c b/drivers/net/wireless/iwmc3200wifi/hal.c
index 907ac890997c..1cabcb39643f 100644
--- a/drivers/net/wireless/iwmc3200wifi/hal.c
+++ b/drivers/net/wireless/iwmc3200wifi/hal.c
@@ -57,7 +57,7 @@
57 * This is due to the fact the host talks exclusively 57 * This is due to the fact the host talks exclusively
58 * to the UMAC and so there needs to be a special UMAC 58 * to the UMAC and so there needs to be a special UMAC
59 * command for talking to the LMAC. 59 * command for talking to the LMAC.
60 * This is how a wifi command is layed out: 60 * This is how a wifi command is laid out:
61 * ------------------------ 61 * ------------------------
62 * | iwm_udma_out_wifi_hdr | 62 * | iwm_udma_out_wifi_hdr |
63 * ------------------------ 63 * ------------------------
@@ -72,7 +72,7 @@
72 * Those commands are handled by the device's bootrom, 72 * Those commands are handled by the device's bootrom,
73 * and are typically sent when the UMAC and the LMAC 73 * and are typically sent when the UMAC and the LMAC
74 * are not yet available. 74 * are not yet available.
75 * * This is how a non-wifi command is layed out: 75 * * This is how a non-wifi command is laid out:
76 * --------------------------- 76 * ---------------------------
77 * | iwm_udma_out_nonwifi_hdr | 77 * | iwm_udma_out_nonwifi_hdr |
78 * --------------------------- 78 * ---------------------------
diff --git a/drivers/net/wireless/iwmc3200wifi/tx.c b/drivers/net/wireless/iwmc3200wifi/tx.c
index 3216621fc55a..be98074c0608 100644
--- a/drivers/net/wireless/iwmc3200wifi/tx.c
+++ b/drivers/net/wireless/iwmc3200wifi/tx.c
@@ -197,7 +197,7 @@ int iwm_tx_credit_alloc(struct iwm_priv *iwm, int id, int nb)
197 spin_lock(&iwm->tx_credit.lock); 197 spin_lock(&iwm->tx_credit.lock);
198 198
199 if (!iwm_tx_credit_ok(iwm, id, nb)) { 199 if (!iwm_tx_credit_ok(iwm, id, nb)) {
200 IWM_DBG_TX(iwm, DBG, "No credit avaliable for pool[%d]\n", id); 200 IWM_DBG_TX(iwm, DBG, "No credit available for pool[%d]\n", id);
201 ret = -ENOSPC; 201 ret = -ENOSPC;
202 goto out; 202 goto out;
203 } 203 }
diff --git a/drivers/net/wireless/libertas/README b/drivers/net/wireless/libertas/README
index 60fd1afe89ac..1453eec82a99 100644
--- a/drivers/net/wireless/libertas/README
+++ b/drivers/net/wireless/libertas/README
@@ -70,7 +70,7 @@ rdrf
70 These commands are used to read the MAC, BBP and RF registers from the 70 These commands are used to read the MAC, BBP and RF registers from the
71 card. These commands take one parameter that specifies the offset 71 card. These commands take one parameter that specifies the offset
72 location that is to be read. This parameter must be specified in 72 location that is to be read. This parameter must be specified in
73 hexadecimal (its possible to preceed preceding the number with a "0x"). 73 hexadecimal (its possible to precede preceding the number with a "0x").
74 74
75 Path: /sys/kernel/debug/libertas_wireless/ethX/registers/ 75 Path: /sys/kernel/debug/libertas_wireless/ethX/registers/
76 76
@@ -84,7 +84,7 @@ wrrf
84 These commands are used to write the MAC, BBP and RF registers in the 84 These commands are used to write the MAC, BBP and RF registers in the
85 card. These commands take two parameters that specify the offset 85 card. These commands take two parameters that specify the offset
86 location and the value that is to be written. This parameters must 86 location and the value that is to be written. This parameters must
87 be specified in hexadecimal (its possible to preceed the number 87 be specified in hexadecimal (its possible to precede the number
88 with a "0x"). 88 with a "0x").
89 89
90 Usage: 90 Usage:
diff --git a/drivers/net/wireless/libertas/cfg.c b/drivers/net/wireless/libertas/cfg.c
index 30ef0351bfc4..5caa2ac14d61 100644
--- a/drivers/net/wireless/libertas/cfg.c
+++ b/drivers/net/wireless/libertas/cfg.c
@@ -1350,7 +1350,7 @@ static int lbs_cfg_connect(struct wiphy *wiphy, struct net_device *dev,
1350 * we remove all keys like in the WPA/WPA2 setup, 1350 * we remove all keys like in the WPA/WPA2 setup,
1351 * we just don't set RSN. 1351 * we just don't set RSN.
1352 * 1352 *
1353 * Therefore: fall-throught 1353 * Therefore: fall-through
1354 */ 1354 */
1355 case WLAN_CIPHER_SUITE_TKIP: 1355 case WLAN_CIPHER_SUITE_TKIP:
1356 case WLAN_CIPHER_SUITE_CCMP: 1356 case WLAN_CIPHER_SUITE_CCMP:
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index fc8121190d38..8712cb213f2f 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -913,7 +913,7 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
913 goto out3; 913 goto out3;
914 } 914 }
915 915
916 /* Clear any interrupt cause that happend while sending 916 /* Clear any interrupt cause that happened while sending
917 * firmware/initializing card */ 917 * firmware/initializing card */
918 if_cs_write16(card, IF_CS_CARD_INT_CAUSE, IF_CS_BIT_MASK); 918 if_cs_write16(card, IF_CS_CARD_INT_CAUSE, IF_CS_BIT_MASK);
919 if_cs_enable_ints(card); 919 if_cs_enable_ints(card);
diff --git a/drivers/net/wireless/libertas/if_spi.h b/drivers/net/wireless/libertas/if_spi.h
index 8b1417d3b71b..d2ac1dcd7e2e 100644
--- a/drivers/net/wireless/libertas/if_spi.h
+++ b/drivers/net/wireless/libertas/if_spi.h
@@ -66,7 +66,7 @@
66#define IF_SPI_HOST_INT_CTRL_REG 0x40 /* Host interrupt controller reg */ 66#define IF_SPI_HOST_INT_CTRL_REG 0x40 /* Host interrupt controller reg */
67 67
68#define IF_SPI_CARD_INT_CAUSE_REG 0x44 /* Card interrupt cause reg */ 68#define IF_SPI_CARD_INT_CAUSE_REG 0x44 /* Card interrupt cause reg */
69#define IF_SPI_CARD_INT_STATUS_REG 0x48 /* Card interupt status reg */ 69#define IF_SPI_CARD_INT_STATUS_REG 0x48 /* Card interrupt status reg */
70#define IF_SPI_CARD_INT_EVENT_MASK_REG 0x4C /* Card interrupt event mask */ 70#define IF_SPI_CARD_INT_EVENT_MASK_REG 0x4C /* Card interrupt event mask */
71#define IF_SPI_CARD_INT_STATUS_MASK_REG 0x50 /* Card interrupt status mask */ 71#define IF_SPI_CARD_INT_STATUS_MASK_REG 0x50 /* Card interrupt status mask */
72 72
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 56f439d58013..f4f4257a9d67 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -62,7 +62,7 @@ MODULE_PARM_DESC(fake_hw_scan, "Install fake (no-op) hw-scan handler");
62 * an intersection to occur but each device will still use their 62 * an intersection to occur but each device will still use their
63 * respective regulatory requested domains. Subsequent radios will 63 * respective regulatory requested domains. Subsequent radios will
64 * use the resulting intersection. 64 * use the resulting intersection.
65 * @HWSIM_REGTEST_WORLD_ROAM: Used for testing the world roaming. We acomplish 65 * @HWSIM_REGTEST_WORLD_ROAM: Used for testing the world roaming. We accomplish
66 * this by using a custom beacon-capable regulatory domain for the first 66 * this by using a custom beacon-capable regulatory domain for the first
67 * radio. All other device world roam. 67 * radio. All other device world roam.
68 * @HWSIM_REGTEST_CUSTOM_WORLD: Used for testing the custom world regulatory 68 * @HWSIM_REGTEST_CUSTOM_WORLD: Used for testing the custom world regulatory
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 36952274950e..c1ceb4b23971 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -137,6 +137,7 @@ struct mwl8k_tx_queue {
137struct mwl8k_priv { 137struct mwl8k_priv {
138 struct ieee80211_hw *hw; 138 struct ieee80211_hw *hw;
139 struct pci_dev *pdev; 139 struct pci_dev *pdev;
140 int irq;
140 141
141 struct mwl8k_device_info *device_info; 142 struct mwl8k_device_info *device_info;
142 143
@@ -3761,9 +3762,11 @@ static int mwl8k_start(struct ieee80211_hw *hw)
3761 rc = request_irq(priv->pdev->irq, mwl8k_interrupt, 3762 rc = request_irq(priv->pdev->irq, mwl8k_interrupt,
3762 IRQF_SHARED, MWL8K_NAME, hw); 3763 IRQF_SHARED, MWL8K_NAME, hw);
3763 if (rc) { 3764 if (rc) {
3765 priv->irq = -1;
3764 wiphy_err(hw->wiphy, "failed to register IRQ handler\n"); 3766 wiphy_err(hw->wiphy, "failed to register IRQ handler\n");
3765 return -EIO; 3767 return -EIO;
3766 } 3768 }
3769 priv->irq = priv->pdev->irq;
3767 3770
3768 /* Enable TX reclaim and RX tasklets. */ 3771 /* Enable TX reclaim and RX tasklets. */
3769 tasklet_enable(&priv->poll_tx_task); 3772 tasklet_enable(&priv->poll_tx_task);
@@ -3800,6 +3803,7 @@ static int mwl8k_start(struct ieee80211_hw *hw)
3800 if (rc) { 3803 if (rc) {
3801 iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); 3804 iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK);
3802 free_irq(priv->pdev->irq, hw); 3805 free_irq(priv->pdev->irq, hw);
3806 priv->irq = -1;
3803 tasklet_disable(&priv->poll_tx_task); 3807 tasklet_disable(&priv->poll_tx_task);
3804 tasklet_disable(&priv->poll_rx_task); 3808 tasklet_disable(&priv->poll_rx_task);
3805 } 3809 }
@@ -3818,7 +3822,10 @@ static void mwl8k_stop(struct ieee80211_hw *hw)
3818 3822
3819 /* Disable interrupts */ 3823 /* Disable interrupts */
3820 iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK); 3824 iowrite32(0, priv->regs + MWL8K_HIU_A2H_INTERRUPT_MASK);
3821 free_irq(priv->pdev->irq, hw); 3825 if (priv->irq != -1) {
3826 free_irq(priv->pdev->irq, hw);
3827 priv->irq = -1;
3828 }
3822 3829
3823 /* Stop finalize join worker */ 3830 /* Stop finalize join worker */
3824 cancel_work_sync(&priv->finalize_join_worker); 3831 cancel_work_sync(&priv->finalize_join_worker);
diff --git a/drivers/net/wireless/orinoco/cfg.c b/drivers/net/wireless/orinoco/cfg.c
index 09fae2f0ea08..736bbb9bd1d0 100644
--- a/drivers/net/wireless/orinoco/cfg.c
+++ b/drivers/net/wireless/orinoco/cfg.c
@@ -153,6 +153,9 @@ static int orinoco_scan(struct wiphy *wiphy, struct net_device *dev,
153 priv->scan_request = request; 153 priv->scan_request = request;
154 154
155 err = orinoco_hw_trigger_scan(priv, request->ssids); 155 err = orinoco_hw_trigger_scan(priv, request->ssids);
156 /* On error the we aren't processing the request */
157 if (err)
158 priv->scan_request = NULL;
156 159
157 return err; 160 return err;
158} 161}
diff --git a/drivers/net/wireless/orinoco/hw.c b/drivers/net/wireless/orinoco/hw.c
index b4772c1c6135..3c7877a7c31c 100644
--- a/drivers/net/wireless/orinoco/hw.c
+++ b/drivers/net/wireless/orinoco/hw.c
@@ -1031,7 +1031,7 @@ int __orinoco_hw_set_tkip_key(struct orinoco_private *priv, int key_idx,
1031 else 1031 else
1032 buf.tsc[4] = 0x10; 1032 buf.tsc[4] = 0x10;
1033 1033
1034 /* Wait upto 100ms for tx queue to empty */ 1034 /* Wait up to 100ms for tx queue to empty */
1035 for (k = 100; k > 0; k--) { 1035 for (k = 100; k > 0; k--) {
1036 udelay(1000); 1036 udelay(1000);
1037 ret = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_TXQUEUEEMPTY, 1037 ret = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_TXQUEUEEMPTY,
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c
index f3d396e7544b..62c6b2b37dbe 100644
--- a/drivers/net/wireless/orinoco/main.c
+++ b/drivers/net/wireless/orinoco/main.c
@@ -1376,13 +1376,13 @@ static void orinoco_process_scan_results(struct work_struct *work)
1376 1376
1377 spin_lock_irqsave(&priv->scan_lock, flags); 1377 spin_lock_irqsave(&priv->scan_lock, flags);
1378 list_for_each_entry_safe(sd, temp, &priv->scan_list, list) { 1378 list_for_each_entry_safe(sd, temp, &priv->scan_list, list) {
1379 spin_unlock_irqrestore(&priv->scan_lock, flags);
1380 1379
1381 buf = sd->buf; 1380 buf = sd->buf;
1382 len = sd->len; 1381 len = sd->len;
1383 type = sd->type; 1382 type = sd->type;
1384 1383
1385 list_del(&sd->list); 1384 list_del(&sd->list);
1385 spin_unlock_irqrestore(&priv->scan_lock, flags);
1386 kfree(sd); 1386 kfree(sd);
1387 1387
1388 if (len > 0) { 1388 if (len > 0) {
diff --git a/drivers/net/wireless/p54/main.c b/drivers/net/wireless/p54/main.c
index 356e6bb443a6..a946991989c6 100644
--- a/drivers/net/wireless/p54/main.c
+++ b/drivers/net/wireless/p54/main.c
@@ -465,7 +465,7 @@ static int p54_set_key(struct ieee80211_hw *dev, enum set_key_cmd cmd,
465 465
466 if (slot < 0) { 466 if (slot < 0) {
467 /* 467 /*
468 * The device supports the choosen algorithm, but the 468 * The device supports the chosen algorithm, but the
469 * firmware does not provide enough key slots to store 469 * firmware does not provide enough key slots to store
470 * all of them. 470 * all of them.
471 * But encryption offload for outgoing frames is always 471 * But encryption offload for outgoing frames is always
diff --git a/drivers/net/wireless/p54/p54spi.c b/drivers/net/wireless/p54/p54spi.c
index 18d24b7b1e34..6d9204fef90b 100644
--- a/drivers/net/wireless/p54/p54spi.c
+++ b/drivers/net/wireless/p54/p54spi.c
@@ -287,7 +287,7 @@ static void p54spi_power_on(struct p54s_priv *priv)
287 enable_irq(gpio_to_irq(p54spi_gpio_irq)); 287 enable_irq(gpio_to_irq(p54spi_gpio_irq));
288 288
289 /* 289 /*
290 * need to wait a while before device can be accessed, the lenght 290 * need to wait a while before device can be accessed, the length
291 * is just a guess 291 * is just a guess
292 */ 292 */
293 msleep(10); 293 msleep(10);
@@ -649,8 +649,7 @@ static int __devinit p54spi_probe(struct spi_device *spi)
649 goto err_free_common; 649 goto err_free_common;
650 } 650 }
651 651
652 set_irq_type(gpio_to_irq(p54spi_gpio_irq), 652 irq_set_irq_type(gpio_to_irq(p54spi_gpio_irq), IRQ_TYPE_EDGE_RISING);
653 IRQ_TYPE_EDGE_RISING);
654 653
655 disable_irq(gpio_to_irq(p54spi_gpio_irq)); 654 disable_irq(gpio_to_irq(p54spi_gpio_irq));
656 655
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
index 9b344a921e74..e18358725b69 100644
--- a/drivers/net/wireless/p54/p54usb.c
+++ b/drivers/net/wireless/p54/p54usb.c
@@ -56,6 +56,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
56 {USB_DEVICE(0x0846, 0x4210)}, /* Netgear WG121 the second ? */ 56 {USB_DEVICE(0x0846, 0x4210)}, /* Netgear WG121 the second ? */
57 {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ 57 {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */
58 {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ 58 {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */
59 {USB_DEVICE(0x0bf8, 0x1007)}, /* Fujitsu E-5400 USB */
59 {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */ 60 {USB_DEVICE(0x0cde, 0x0006)}, /* Medion 40900, Roper Europe */
60 {USB_DEVICE(0x0db0, 0x6826)}, /* MSI UB54G (MS-6826) */ 61 {USB_DEVICE(0x0db0, 0x6826)}, /* MSI UB54G (MS-6826) */
61 {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */ 62 {USB_DEVICE(0x107b, 0x55f2)}, /* Gateway WGU-210 (Gemtek) */
@@ -68,6 +69,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
68 {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */ 69 {USB_DEVICE(0x1915, 0x2235)}, /* Linksys WUSB54G Portable OEM */
69 {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */ 70 {USB_DEVICE(0x2001, 0x3701)}, /* DLink DWL-G120 Spinnaker */
70 {USB_DEVICE(0x2001, 0x3703)}, /* DLink DWL-G122 */ 71 {USB_DEVICE(0x2001, 0x3703)}, /* DLink DWL-G122 */
72 {USB_DEVICE(0x2001, 0x3762)}, /* Conceptronic C54U */
71 {USB_DEVICE(0x5041, 0x2234)}, /* Linksys WUSB54G */ 73 {USB_DEVICE(0x5041, 0x2234)}, /* Linksys WUSB54G */
72 {USB_DEVICE(0x5041, 0x2235)}, /* Linksys WUSB54G Portable */ 74 {USB_DEVICE(0x5041, 0x2235)}, /* Linksys WUSB54G Portable */
73 75
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 7834c26c2954..042842e704de 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -703,7 +703,7 @@ void p54_tx_80211(struct ieee80211_hw *dev, struct sk_buff *skb)
703 struct p54_tx_info *p54info; 703 struct p54_tx_info *p54info;
704 struct p54_hdr *hdr; 704 struct p54_hdr *hdr;
705 struct p54_tx_data *txhdr; 705 struct p54_tx_data *txhdr;
706 unsigned int padding, len, extra_len; 706 unsigned int padding, len, extra_len = 0;
707 int i, j, ridx; 707 int i, j, ridx;
708 u16 hdr_flags = 0, aid = 0; 708 u16 hdr_flags = 0, aid = 0;
709 u8 rate, queue = 0, crypt_offset = 0; 709 u8 rate, queue = 0, crypt_offset = 0;
diff --git a/drivers/net/wireless/prism54/islpci_eth.c b/drivers/net/wireless/prism54/islpci_eth.c
index d44f8e20cce0..266d45bf86f5 100644
--- a/drivers/net/wireless/prism54/islpci_eth.c
+++ b/drivers/net/wireless/prism54/islpci_eth.c
@@ -113,7 +113,7 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
113 * be aligned on a 4-byte boundary. If WDS is enabled add another 6 bytes 113 * be aligned on a 4-byte boundary. If WDS is enabled add another 6 bytes
114 * and add WDS address information */ 114 * and add WDS address information */
115 if (likely(((long) skb->data & 0x03) | init_wds)) { 115 if (likely(((long) skb->data & 0x03) | init_wds)) {
116 /* get the number of bytes to add and re-allign */ 116 /* get the number of bytes to add and re-align */
117 offset = (4 - (long) skb->data) & 0x03; 117 offset = (4 - (long) skb->data) & 0x03;
118 offset += init_wds ? 6 : 0; 118 offset += init_wds ? 6 : 0;
119 119
@@ -342,7 +342,7 @@ islpci_eth_receive(islpci_private *priv)
342 priv->pci_map_rx_address[index], 342 priv->pci_map_rx_address[index],
343 MAX_FRAGMENT_SIZE_RX + 2, PCI_DMA_FROMDEVICE); 343 MAX_FRAGMENT_SIZE_RX + 2, PCI_DMA_FROMDEVICE);
344 344
345 /* update the skb structure and allign the buffer */ 345 /* update the skb structure and align the buffer */
346 skb_put(skb, size); 346 skb_put(skb, size);
347 if (offset) { 347 if (offset) {
348 /* shift the buffer allocation offset bytes to get the right frame */ 348 /* shift the buffer allocation offset bytes to get the right frame */
diff --git a/drivers/net/wireless/rayctl.h b/drivers/net/wireless/rayctl.h
index 49d9b267bc0f..d7646f299bd3 100644
--- a/drivers/net/wireless/rayctl.h
+++ b/drivers/net/wireless/rayctl.h
@@ -578,7 +578,7 @@ struct tx_msg {
578 UCHAR var[1]; 578 UCHAR var[1];
579}; 579};
580 580
581/****** ECF Receive Control Stucture (RCS) Area at Shared RAM offset 0x0800 */ 581/****** ECF Receive Control Structure (RCS) Area at Shared RAM offset 0x0800 */
582/* Structures for command specific parameters (rcs.var) */ 582/* Structures for command specific parameters (rcs.var) */
583struct rx_packet_cmd { 583struct rx_packet_cmd {
584 UCHAR rx_data_ptr[2]; 584 UCHAR rx_data_ptr[2];
diff --git a/drivers/net/wireless/rt2x00/rt2800.h b/drivers/net/wireless/rt2x00/rt2800.h
index 70b9abbdeb9e..8fbc5fa965e0 100644
--- a/drivers/net/wireless/rt2x00/rt2800.h
+++ b/drivers/net/wireless/rt2x00/rt2800.h
@@ -616,7 +616,7 @@
616 * READ_CONTROL: 0 write BBP, 1 read BBP 616 * READ_CONTROL: 0 write BBP, 1 read BBP
617 * BUSY: ASIC is busy executing BBP commands 617 * BUSY: ASIC is busy executing BBP commands
618 * BBP_PAR_DUR: 0 4 MAC clocks, 1 8 MAC clocks 618 * BBP_PAR_DUR: 0 4 MAC clocks, 1 8 MAC clocks
619 * BBP_RW_MODE: 0 serial, 1 paralell 619 * BBP_RW_MODE: 0 serial, 1 parallel
620 */ 620 */
621#define BBP_CSR_CFG 0x101c 621#define BBP_CSR_CFG 0x101c
622#define BBP_CSR_CFG_VALUE FIELD32(0x000000ff) 622#define BBP_CSR_CFG_VALUE FIELD32(0x000000ff)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 2ee6cebb9b25..dbf74d07d947 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1518,7 +1518,7 @@ static void rt2800_config_channel_rf2xxx(struct rt2x00_dev *rt2x00dev,
1518 if (rf->channel > 14) { 1518 if (rf->channel > 14) {
1519 /* 1519 /*
1520 * When TX power is below 0, we should increase it by 7 to 1520 * When TX power is below 0, we should increase it by 7 to
1521 * make it a positive value (Minumum value is -7). 1521 * make it a positive value (Minimum value is -7).
1522 * However this means that values between 0 and 7 have 1522 * However this means that values between 0 and 7 have
1523 * double meaning, and we should set a 7DBm boost flag. 1523 * double meaning, and we should set a 7DBm boost flag.
1524 */ 1524 */
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index f1a92144996f..37509d019910 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -719,6 +719,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
719 { USB_DEVICE(0x0b05, 0x1732), USB_DEVICE_DATA(&rt2800usb_ops) }, 719 { USB_DEVICE(0x0b05, 0x1732), USB_DEVICE_DATA(&rt2800usb_ops) },
720 { USB_DEVICE(0x0b05, 0x1742), USB_DEVICE_DATA(&rt2800usb_ops) }, 720 { USB_DEVICE(0x0b05, 0x1742), USB_DEVICE_DATA(&rt2800usb_ops) },
721 { USB_DEVICE(0x0b05, 0x1784), USB_DEVICE_DATA(&rt2800usb_ops) }, 721 { USB_DEVICE(0x0b05, 0x1784), USB_DEVICE_DATA(&rt2800usb_ops) },
722 { USB_DEVICE(0x1761, 0x0b05), USB_DEVICE_DATA(&rt2800usb_ops) },
722 /* AzureWave */ 723 /* AzureWave */
723 { USB_DEVICE(0x13d3, 0x3247), USB_DEVICE_DATA(&rt2800usb_ops) }, 724 { USB_DEVICE(0x13d3, 0x3247), USB_DEVICE_DATA(&rt2800usb_ops) },
724 { USB_DEVICE(0x13d3, 0x3273), USB_DEVICE_DATA(&rt2800usb_ops) }, 725 { USB_DEVICE(0x13d3, 0x3273), USB_DEVICE_DATA(&rt2800usb_ops) },
@@ -729,8 +730,12 @@ static struct usb_device_id rt2800usb_device_table[] = {
729 { USB_DEVICE(0x050d, 0x8053), USB_DEVICE_DATA(&rt2800usb_ops) }, 730 { USB_DEVICE(0x050d, 0x8053), USB_DEVICE_DATA(&rt2800usb_ops) },
730 { USB_DEVICE(0x050d, 0x805c), USB_DEVICE_DATA(&rt2800usb_ops) }, 731 { USB_DEVICE(0x050d, 0x805c), USB_DEVICE_DATA(&rt2800usb_ops) },
731 { USB_DEVICE(0x050d, 0x815c), USB_DEVICE_DATA(&rt2800usb_ops) }, 732 { USB_DEVICE(0x050d, 0x815c), USB_DEVICE_DATA(&rt2800usb_ops) },
733 { USB_DEVICE(0x050d, 0x825b), USB_DEVICE_DATA(&rt2800usb_ops) },
734 { USB_DEVICE(0x050d, 0x935a), USB_DEVICE_DATA(&rt2800usb_ops) },
735 { USB_DEVICE(0x050d, 0x935b), USB_DEVICE_DATA(&rt2800usb_ops) },
732 /* Buffalo */ 736 /* Buffalo */
733 { USB_DEVICE(0x0411, 0x00e8), USB_DEVICE_DATA(&rt2800usb_ops) }, 737 { USB_DEVICE(0x0411, 0x00e8), USB_DEVICE_DATA(&rt2800usb_ops) },
738 { USB_DEVICE(0x0411, 0x016f), USB_DEVICE_DATA(&rt2800usb_ops) },
734 /* Conceptronic */ 739 /* Conceptronic */
735 { USB_DEVICE(0x14b2, 0x3c06), USB_DEVICE_DATA(&rt2800usb_ops) }, 740 { USB_DEVICE(0x14b2, 0x3c06), USB_DEVICE_DATA(&rt2800usb_ops) },
736 { USB_DEVICE(0x14b2, 0x3c07), USB_DEVICE_DATA(&rt2800usb_ops) }, 741 { USB_DEVICE(0x14b2, 0x3c07), USB_DEVICE_DATA(&rt2800usb_ops) },
@@ -817,6 +822,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
817 /* Pegatron */ 822 /* Pegatron */
818 { USB_DEVICE(0x1d4d, 0x000c), USB_DEVICE_DATA(&rt2800usb_ops) }, 823 { USB_DEVICE(0x1d4d, 0x000c), USB_DEVICE_DATA(&rt2800usb_ops) },
819 { USB_DEVICE(0x1d4d, 0x000e), USB_DEVICE_DATA(&rt2800usb_ops) }, 824 { USB_DEVICE(0x1d4d, 0x000e), USB_DEVICE_DATA(&rt2800usb_ops) },
825 { USB_DEVICE(0x1d4d, 0x0011), USB_DEVICE_DATA(&rt2800usb_ops) },
820 /* Philips */ 826 /* Philips */
821 { USB_DEVICE(0x0471, 0x200f), USB_DEVICE_DATA(&rt2800usb_ops) }, 827 { USB_DEVICE(0x0471, 0x200f), USB_DEVICE_DATA(&rt2800usb_ops) },
822 /* Planex */ 828 /* Planex */
@@ -898,6 +904,8 @@ static struct usb_device_id rt2800usb_device_table[] = {
898 { USB_DEVICE(0x148f, 0x3572), USB_DEVICE_DATA(&rt2800usb_ops) }, 904 { USB_DEVICE(0x148f, 0x3572), USB_DEVICE_DATA(&rt2800usb_ops) },
899 /* Sitecom */ 905 /* Sitecom */
900 { USB_DEVICE(0x0df6, 0x0041), USB_DEVICE_DATA(&rt2800usb_ops) }, 906 { USB_DEVICE(0x0df6, 0x0041), USB_DEVICE_DATA(&rt2800usb_ops) },
907 /* Toshiba */
908 { USB_DEVICE(0x0930, 0x0a07), USB_DEVICE_DATA(&rt2800usb_ops) },
901 /* Zinwell */ 909 /* Zinwell */
902 { USB_DEVICE(0x5a57, 0x0284), USB_DEVICE_DATA(&rt2800usb_ops) }, 910 { USB_DEVICE(0x5a57, 0x0284), USB_DEVICE_DATA(&rt2800usb_ops) },
903#endif 911#endif
@@ -913,7 +921,6 @@ static struct usb_device_id rt2800usb_device_table[] = {
913 { USB_DEVICE(0x0b05, 0x1760), USB_DEVICE_DATA(&rt2800usb_ops) }, 921 { USB_DEVICE(0x0b05, 0x1760), USB_DEVICE_DATA(&rt2800usb_ops) },
914 { USB_DEVICE(0x0b05, 0x1761), USB_DEVICE_DATA(&rt2800usb_ops) }, 922 { USB_DEVICE(0x0b05, 0x1761), USB_DEVICE_DATA(&rt2800usb_ops) },
915 { USB_DEVICE(0x0b05, 0x1790), USB_DEVICE_DATA(&rt2800usb_ops) }, 923 { USB_DEVICE(0x0b05, 0x1790), USB_DEVICE_DATA(&rt2800usb_ops) },
916 { USB_DEVICE(0x1761, 0x0b05), USB_DEVICE_DATA(&rt2800usb_ops) },
917 /* AzureWave */ 924 /* AzureWave */
918 { USB_DEVICE(0x13d3, 0x3262), USB_DEVICE_DATA(&rt2800usb_ops) }, 925 { USB_DEVICE(0x13d3, 0x3262), USB_DEVICE_DATA(&rt2800usb_ops) },
919 { USB_DEVICE(0x13d3, 0x3284), USB_DEVICE_DATA(&rt2800usb_ops) }, 926 { USB_DEVICE(0x13d3, 0x3284), USB_DEVICE_DATA(&rt2800usb_ops) },
@@ -937,6 +944,8 @@ static struct usb_device_id rt2800usb_device_table[] = {
937 { USB_DEVICE(0x07d1, 0x3c13), USB_DEVICE_DATA(&rt2800usb_ops) }, 944 { USB_DEVICE(0x07d1, 0x3c13), USB_DEVICE_DATA(&rt2800usb_ops) },
938 { USB_DEVICE(0x07d1, 0x3c15), USB_DEVICE_DATA(&rt2800usb_ops) }, 945 { USB_DEVICE(0x07d1, 0x3c15), USB_DEVICE_DATA(&rt2800usb_ops) },
939 { USB_DEVICE(0x07d1, 0x3c17), USB_DEVICE_DATA(&rt2800usb_ops) }, 946 { USB_DEVICE(0x07d1, 0x3c17), USB_DEVICE_DATA(&rt2800usb_ops) },
947 /* Edimax */
948 { USB_DEVICE(0x7392, 0x4085), USB_DEVICE_DATA(&rt2800usb_ops) },
940 /* Encore */ 949 /* Encore */
941 { USB_DEVICE(0x203d, 0x14a1), USB_DEVICE_DATA(&rt2800usb_ops) }, 950 { USB_DEVICE(0x203d, 0x14a1), USB_DEVICE_DATA(&rt2800usb_ops) },
942 /* Gemtek */ 951 /* Gemtek */
@@ -959,8 +968,8 @@ static struct usb_device_id rt2800usb_device_table[] = {
959 { USB_DEVICE(0x05a6, 0x0101), USB_DEVICE_DATA(&rt2800usb_ops) }, 968 { USB_DEVICE(0x05a6, 0x0101), USB_DEVICE_DATA(&rt2800usb_ops) },
960 { USB_DEVICE(0x1d4d, 0x0002), USB_DEVICE_DATA(&rt2800usb_ops) }, 969 { USB_DEVICE(0x1d4d, 0x0002), USB_DEVICE_DATA(&rt2800usb_ops) },
961 { USB_DEVICE(0x1d4d, 0x0010), USB_DEVICE_DATA(&rt2800usb_ops) }, 970 { USB_DEVICE(0x1d4d, 0x0010), USB_DEVICE_DATA(&rt2800usb_ops) },
962 { USB_DEVICE(0x1d4d, 0x0011), USB_DEVICE_DATA(&rt2800usb_ops) },
963 /* Planex */ 971 /* Planex */
972 { USB_DEVICE(0x2019, 0x5201), USB_DEVICE_DATA(&rt2800usb_ops) },
964 { USB_DEVICE(0x2019, 0xab24), USB_DEVICE_DATA(&rt2800usb_ops) }, 973 { USB_DEVICE(0x2019, 0xab24), USB_DEVICE_DATA(&rt2800usb_ops) },
965 /* Qcom */ 974 /* Qcom */
966 { USB_DEVICE(0x18e8, 0x6259), USB_DEVICE_DATA(&rt2800usb_ops) }, 975 { USB_DEVICE(0x18e8, 0x6259), USB_DEVICE_DATA(&rt2800usb_ops) },
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
index a3940d7300a4..7f10239f56a8 100644
--- a/drivers/net/wireless/rt2x00/rt2x00.h
+++ b/drivers/net/wireless/rt2x00/rt2x00.h
@@ -484,13 +484,13 @@ struct rt2x00intf_conf {
484 enum nl80211_iftype type; 484 enum nl80211_iftype type;
485 485
486 /* 486 /*
487 * TSF sync value, this is dependant on the operation type. 487 * TSF sync value, this is dependent on the operation type.
488 */ 488 */
489 enum tsf_sync sync; 489 enum tsf_sync sync;
490 490
491 /* 491 /*
492 * The MAC and BSSID addressess are simple array of bytes, 492 * The MAC and BSSID addresses are simple array of bytes,
493 * these arrays are little endian, so when sending the addressess 493 * these arrays are little endian, so when sending the addresses
494 * to the drivers, copy the it into a endian-signed variable. 494 * to the drivers, copy the it into a endian-signed variable.
495 * 495 *
496 * Note that all devices (except rt2500usb) have 32 bits 496 * Note that all devices (except rt2500usb) have 32 bits
@@ -1131,7 +1131,7 @@ void rt2x00queue_stop_queue(struct data_queue *queue);
1131 * @drop: True to drop all pending frames. 1131 * @drop: True to drop all pending frames.
1132 * 1132 *
1133 * This function will flush the queue. After this call 1133 * This function will flush the queue. After this call
1134 * the queue is guarenteed to be empty. 1134 * the queue is guaranteed to be empty.
1135 */ 1135 */
1136void rt2x00queue_flush_queue(struct data_queue *queue, bool drop); 1136void rt2x00queue_flush_queue(struct data_queue *queue, bool drop);
1137 1137
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index e7f67d5eda52..9416e36de29e 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -60,7 +60,7 @@ void rt2x00lib_config_intf(struct rt2x00_dev *rt2x00dev,
60 * Note that when NULL is passed as address we will send 60 * Note that when NULL is passed as address we will send
61 * 00:00:00:00:00 to the device to clear the address. 61 * 00:00:00:00:00 to the device to clear the address.
62 * This will prevent the device being confused when it wants 62 * This will prevent the device being confused when it wants
63 * to ACK frames or consideres itself associated. 63 * to ACK frames or considers itself associated.
64 */ 64 */
65 memset(conf.mac, 0, sizeof(conf.mac)); 65 memset(conf.mac, 0, sizeof(conf.mac));
66 if (mac) 66 if (mac)
diff --git a/drivers/net/wireless/rt2x00/rt2x00crypto.c b/drivers/net/wireless/rt2x00/rt2x00crypto.c
index 5e9074bf2b8e..3f5688fbf3f7 100644
--- a/drivers/net/wireless/rt2x00/rt2x00crypto.c
+++ b/drivers/net/wireless/rt2x00/rt2x00crypto.c
@@ -237,7 +237,7 @@ void rt2x00crypto_rx_insert_iv(struct sk_buff *skb,
237 } 237 }
238 238
239 /* 239 /*
240 * NOTE: Always count the payload as transfered, 240 * NOTE: Always count the payload as transferred,
241 * even when alignment was set to zero. This is required 241 * even when alignment was set to zero. This is required
242 * for determining the correct offset for the ICV data. 242 * for determining the correct offset for the ICV data.
243 */ 243 */
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
index 9de9dbe94399..84eb6ad36377 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dev.c
+++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
@@ -1062,8 +1062,10 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
1062 * Stop all work. 1062 * Stop all work.
1063 */ 1063 */
1064 cancel_work_sync(&rt2x00dev->intf_work); 1064 cancel_work_sync(&rt2x00dev->intf_work);
1065 cancel_work_sync(&rt2x00dev->rxdone_work); 1065 if (rt2x00_is_usb(rt2x00dev)) {
1066 cancel_work_sync(&rt2x00dev->txdone_work); 1066 cancel_work_sync(&rt2x00dev->rxdone_work);
1067 cancel_work_sync(&rt2x00dev->txdone_work);
1068 }
1067 destroy_workqueue(rt2x00dev->workqueue); 1069 destroy_workqueue(rt2x00dev->workqueue);
1068 1070
1069 /* 1071 /*
diff --git a/drivers/net/wireless/rt2x00/rt2x00dump.h b/drivers/net/wireless/rt2x00/rt2x00dump.h
index 5d6e0b83151f..063ebcce97f8 100644
--- a/drivers/net/wireless/rt2x00/rt2x00dump.h
+++ b/drivers/net/wireless/rt2x00/rt2x00dump.h
@@ -51,7 +51,7 @@
51 * [rt2x00dump header][hardware descriptor][ieee802.11 frame] 51 * [rt2x00dump header][hardware descriptor][ieee802.11 frame]
52 * 52 *
53 * rt2x00dump header: The description of the dumped frame, as well as 53 * rt2x00dump header: The description of the dumped frame, as well as
54 * additional information usefull for debugging. See &rt2x00dump_hdr. 54 * additional information useful for debugging. See &rt2x00dump_hdr.
55 * hardware descriptor: Descriptor that was used to receive or transmit 55 * hardware descriptor: Descriptor that was used to receive or transmit
56 * the frame. 56 * the frame.
57 * ieee802.11 frame: The actual frame that was received or transmitted. 57 * ieee802.11 frame: The actual frame that was received or transmitted.
diff --git a/drivers/net/wireless/rt2x00/rt2x00link.c b/drivers/net/wireless/rt2x00/rt2x00link.c
index c975b0a12e95..29abfdeb0b65 100644
--- a/drivers/net/wireless/rt2x00/rt2x00link.c
+++ b/drivers/net/wireless/rt2x00/rt2x00link.c
@@ -283,7 +283,7 @@ void rt2x00link_start_tuner(struct rt2x00_dev *rt2x00dev)
283 /** 283 /**
284 * While scanning, link tuning is disabled. By default 284 * While scanning, link tuning is disabled. By default
285 * the most sensitive settings will be used to make sure 285 * the most sensitive settings will be used to make sure
286 * that all beacons and probe responses will be recieved 286 * that all beacons and probe responses will be received
287 * during the scan. 287 * during the scan.
288 */ 288 */
289 if (test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) 289 if (test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags))
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 4b3c70eeef1f..4358051bfe1a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -546,7 +546,7 @@ int rt2x00queue_write_tx_frame(struct data_queue *queue, struct sk_buff *skb,
546 } 546 }
547 547
548 /* 548 /*
549 * When DMA allocation is required we should guarentee to the 549 * When DMA allocation is required we should guarantee to the
550 * driver that the DMA is aligned to a 4-byte boundary. 550 * driver that the DMA is aligned to a 4-byte boundary.
551 * However some drivers require L2 padding to pad the payload 551 * However some drivers require L2 padding to pad the payload
552 * rather then the header. This could be a requirement for 552 * rather then the header. This could be a requirement for
@@ -689,7 +689,7 @@ void rt2x00queue_for_each_entry(struct data_queue *queue,
689 spin_unlock_irqrestore(&queue->index_lock, irqflags); 689 spin_unlock_irqrestore(&queue->index_lock, irqflags);
690 690
691 /* 691 /*
692 * Start from the TX done pointer, this guarentees that we will 692 * Start from the TX done pointer, this guarantees that we will
693 * send out all frames in the correct order. 693 * send out all frames in the correct order.
694 */ 694 */
695 if (index_start < index_end) { 695 if (index_start < index_end) {
@@ -883,7 +883,7 @@ void rt2x00queue_flush_queue(struct data_queue *queue, bool drop)
883 } 883 }
884 884
885 /* 885 /*
886 * Check if driver supports flushing, we can only guarentee 886 * Check if driver supports flushing, we can only guarantee
887 * full support for flushing if the driver is able 887 * full support for flushing if the driver is able
888 * to cancel all pending frames (drop = true). 888 * to cancel all pending frames (drop = true).
889 */ 889 */
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h
index 0c8b0c699679..217861f8d95f 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.h
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.h
@@ -344,8 +344,8 @@ struct txentry_desc {
344 * only be touched after the device has signaled it is done with it. 344 * only be touched after the device has signaled it is done with it.
345 * @ENTRY_DATA_PENDING: This entry contains a valid frame and is waiting 345 * @ENTRY_DATA_PENDING: This entry contains a valid frame and is waiting
346 * for the signal to start sending. 346 * for the signal to start sending.
347 * @ENTRY_DATA_IO_FAILED: Hardware indicated that an IO error occured 347 * @ENTRY_DATA_IO_FAILED: Hardware indicated that an IO error occurred
348 * while transfering the data to the hardware. No TX status report will 348 * while transferring the data to the hardware. No TX status report will
349 * be expected from the hardware. 349 * be expected from the hardware.
350 * @ENTRY_DATA_STATUS_PENDING: The entry has been send to the device and 350 * @ENTRY_DATA_STATUS_PENDING: The entry has been send to the device and
351 * returned. It is now waiting for the status reporting before the 351 * returned. It is now waiting for the status reporting before the
@@ -365,7 +365,7 @@ enum queue_entry_flags {
365 * @flags: Entry flags, see &enum queue_entry_flags. 365 * @flags: Entry flags, see &enum queue_entry_flags.
366 * @queue: The data queue (&struct data_queue) to which this entry belongs. 366 * @queue: The data queue (&struct data_queue) to which this entry belongs.
367 * @skb: The buffer which is currently being transmitted (for TX queue), 367 * @skb: The buffer which is currently being transmitted (for TX queue),
368 * or used to directly recieve data in (for RX queue). 368 * or used to directly receive data in (for RX queue).
369 * @entry_idx: The entry index number. 369 * @entry_idx: The entry index number.
370 * @priv_data: Private data belonging to this queue entry. The pointer 370 * @priv_data: Private data belonging to this queue entry. The pointer
371 * points to data specific to a particular driver and queue type. 371 * points to data specific to a particular driver and queue type.
@@ -388,7 +388,7 @@ struct queue_entry {
388 * @Q_INDEX: Index pointer to the current entry in the queue, if this entry is 388 * @Q_INDEX: Index pointer to the current entry in the queue, if this entry is
389 * owned by the hardware then the queue is considered to be full. 389 * owned by the hardware then the queue is considered to be full.
390 * @Q_INDEX_DMA_DONE: Index pointer for the next entry which will have been 390 * @Q_INDEX_DMA_DONE: Index pointer for the next entry which will have been
391 * transfered to the hardware. 391 * transferred to the hardware.
392 * @Q_INDEX_DONE: Index pointer to the next entry which will be completed by 392 * @Q_INDEX_DONE: Index pointer to the next entry which will be completed by
393 * the hardware and for which we need to run the txdone handler. If this 393 * the hardware and for which we need to run the txdone handler. If this
394 * entry is not owned by the hardware the queue is considered to be empty. 394 * entry is not owned by the hardware the queue is considered to be empty.
@@ -627,7 +627,7 @@ static inline int rt2x00queue_threshold(struct data_queue *queue)
627} 627}
628 628
629/** 629/**
630 * rt2x00queue_status_timeout - Check if a timeout occured for STATUS reports 630 * rt2x00queue_status_timeout - Check if a timeout occurred for STATUS reports
631 * @queue: Queue to check. 631 * @queue: Queue to check.
632 */ 632 */
633static inline int rt2x00queue_status_timeout(struct data_queue *queue) 633static inline int rt2x00queue_status_timeout(struct data_queue *queue)
@@ -637,7 +637,7 @@ static inline int rt2x00queue_status_timeout(struct data_queue *queue)
637} 637}
638 638
639/** 639/**
640 * rt2x00queue_timeout - Check if a timeout occured for DMA transfers 640 * rt2x00queue_timeout - Check if a timeout occurred for DMA transfers
641 * @queue: Queue to check. 641 * @queue: Queue to check.
642 */ 642 */
643static inline int rt2x00queue_dma_timeout(struct data_queue *queue) 643static inline int rt2x00queue_dma_timeout(struct data_queue *queue)
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index fbe735f5b352..36f388f97d65 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -173,7 +173,7 @@ static void rt2x00usb_work_txdone_entry(struct queue_entry *entry)
173 /* 173 /*
174 * If the transfer to hardware succeeded, it does not mean the 174 * If the transfer to hardware succeeded, it does not mean the
175 * frame was send out correctly. It only means the frame 175 * frame was send out correctly. It only means the frame
176 * was succesfully pushed to the hardware, we have no 176 * was successfully pushed to the hardware, we have no
177 * way to determine the transmission status right now. 177 * way to determine the transmission status right now.
178 * (Only indirectly by looking at the failed TX counters 178 * (Only indirectly by looking at the failed TX counters
179 * in the register). 179 * in the register).
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.h b/drivers/net/wireless/rt2x00/rt2x00usb.h
index 6aaf51fc7ad8..e11c759ac9ed 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.h
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.h
@@ -400,7 +400,7 @@ void rt2x00usb_flush_queue(struct data_queue *queue);
400 * @rt2x00dev: Pointer to &struct rt2x00_dev 400 * @rt2x00dev: Pointer to &struct rt2x00_dev
401 * 401 *
402 * Check the health of the USB communication and determine 402 * Check the health of the USB communication and determine
403 * if timeouts have occured. If this is the case, this function 403 * if timeouts have occurred. If this is the case, this function
404 * will reset all communication to restore functionality again. 404 * will reset all communication to restore functionality again.
405 */ 405 */
406void rt2x00usb_watchdog(struct rt2x00_dev *rt2x00dev); 406void rt2x00usb_watchdog(struct rt2x00_dev *rt2x00dev);
diff --git a/drivers/net/wireless/rtlwifi/base.c b/drivers/net/wireless/rtlwifi/base.c
index bb0c781f4a1b..0d7d93e1d398 100644
--- a/drivers/net/wireless/rtlwifi/base.c
+++ b/drivers/net/wireless/rtlwifi/base.c
@@ -520,7 +520,7 @@ void rtl_get_tcb_desc(struct ieee80211_hw *hw,
520 *because hw will nerver use hw_rate 520 *because hw will nerver use hw_rate
521 *when tcb_desc->use_driver_rate = false 521 *when tcb_desc->use_driver_rate = false
522 *so we never set highest N rate here, 522 *so we never set highest N rate here,
523 *and N rate will all be controled by FW 523 *and N rate will all be controlled by FW
524 *when tcb_desc->use_driver_rate = false 524 *when tcb_desc->use_driver_rate = false
525 */ 525 */
526 if (rtlmac->ht_enable) { 526 if (rtlmac->ht_enable) {
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
index 4f92cba6810a..590f14f45a89 100644
--- a/drivers/net/wireless/rtlwifi/efuse.c
+++ b/drivers/net/wireless/rtlwifi/efuse.c
@@ -410,8 +410,8 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
410 410
411 if (!efuse_shadow_update_chk(hw)) { 411 if (!efuse_shadow_update_chk(hw)) {
412 efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]); 412 efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]);
413 memcpy((void *)&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0], 413 memcpy(&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0],
414 (void *)&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], 414 &rtlefuse->efuse_map[EFUSE_INIT_MAP][0],
415 rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]); 415 rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]);
416 416
417 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, 417 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD,
@@ -446,9 +446,9 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
446 446
447 if (word_en != 0x0F) { 447 if (word_en != 0x0F) {
448 u8 tmpdata[8]; 448 u8 tmpdata[8];
449 memcpy((void *)tmpdata, 449 memcpy(tmpdata,
450 (void *)(&rtlefuse-> 450 &rtlefuse->efuse_map[EFUSE_MODIFY_MAP][base],
451 efuse_map[EFUSE_MODIFY_MAP][base]), 8); 451 8);
452 RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_LOUD, 452 RT_PRINT_DATA(rtlpriv, COMP_INIT, DBG_LOUD,
453 ("U-efuse\n"), tmpdata, 8); 453 ("U-efuse\n"), tmpdata, 8);
454 454
@@ -465,8 +465,8 @@ bool efuse_shadow_update(struct ieee80211_hw *hw)
465 efuse_power_switch(hw, true, false); 465 efuse_power_switch(hw, true, false);
466 efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]); 466 efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]);
467 467
468 memcpy((void *)&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0], 468 memcpy(&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0],
469 (void *)&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], 469 &rtlefuse->efuse_map[EFUSE_INIT_MAP][0],
470 rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]); 470 rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]);
471 471
472 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, ("<---\n")); 472 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, ("<---\n"));
@@ -479,13 +479,12 @@ void rtl_efuse_shadow_map_update(struct ieee80211_hw *hw)
479 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw)); 479 struct rtl_efuse *rtlefuse = rtl_efuse(rtl_priv(hw));
480 480
481 if (rtlefuse->autoload_failflag == true) { 481 if (rtlefuse->autoload_failflag == true) {
482 memset((void *)(&rtlefuse->efuse_map[EFUSE_INIT_MAP][0]), 128, 482 memset(&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], 0xFF, 128);
483 0xFF);
484 } else 483 } else
485 efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]); 484 efuse_read_all_map(hw, &rtlefuse->efuse_map[EFUSE_INIT_MAP][0]);
486 485
487 memcpy((void *)&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0], 486 memcpy(&rtlefuse->efuse_map[EFUSE_MODIFY_MAP][0],
488 (void *)&rtlefuse->efuse_map[EFUSE_INIT_MAP][0], 487 &rtlefuse->efuse_map[EFUSE_INIT_MAP][0],
489 rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]); 488 rtlpriv->cfg->maps[EFUSE_HWSET_MAX_SIZE]);
490 489
491} 490}
@@ -686,7 +685,7 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data)
686 685
687 u8 efuse_data, word_cnts = 0; 686 u8 efuse_data, word_cnts = 0;
688 u16 efuse_addr = 0; 687 u16 efuse_addr = 0;
689 u8 hworden; 688 u8 hworden = 0;
690 u8 tmpdata[8]; 689 u8 tmpdata[8];
691 690
692 if (data == NULL) 691 if (data == NULL)
@@ -694,8 +693,8 @@ static int efuse_pg_packet_read(struct ieee80211_hw *hw, u8 offset, u8 *data)
694 if (offset > 15) 693 if (offset > 15)
695 return false; 694 return false;
696 695
697 memset((void *)data, PGPKT_DATA_SIZE * sizeof(u8), 0xff); 696 memset(data, 0xff, PGPKT_DATA_SIZE * sizeof(u8));
698 memset((void *)tmpdata, PGPKT_DATA_SIZE * sizeof(u8), 0xff); 697 memset(tmpdata, 0xff, PGPKT_DATA_SIZE * sizeof(u8));
699 698
700 while (bcontinual && (efuse_addr < EFUSE_MAX_SIZE)) { 699 while (bcontinual && (efuse_addr < EFUSE_MAX_SIZE)) {
701 if (readstate & PG_STATE_HEADER) { 700 if (readstate & PG_STATE_HEADER) {
@@ -862,7 +861,7 @@ static void efuse_write_data_case2(struct ieee80211_hw *hw, u16 *efuse_addr,
862 861
863 tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en); 862 tmp_word_cnts = efuse_calculate_word_cnts(tmp_pkt.word_en);
864 863
865 memset((void *)originaldata, 8 * sizeof(u8), 0xff); 864 memset(originaldata, 0xff, 8 * sizeof(u8));
866 865
867 if (efuse_pg_packet_read(hw, tmp_pkt.offset, originaldata)) { 866 if (efuse_pg_packet_read(hw, tmp_pkt.offset, originaldata)) {
868 badworden = efuse_word_enable_data_write(hw, 867 badworden = efuse_word_enable_data_write(hw,
@@ -917,7 +916,7 @@ static int efuse_pg_packet_write(struct ieee80211_hw *hw,
917 target_pkt.offset = offset; 916 target_pkt.offset = offset;
918 target_pkt.word_en = word_en; 917 target_pkt.word_en = word_en;
919 918
920 memset((void *)target_pkt.data, 8 * sizeof(u8), 0xFF); 919 memset(target_pkt.data, 0xFF, 8 * sizeof(u8));
921 920
922 efuse_word_enable_data_read(word_en, data, target_pkt.data); 921 efuse_word_enable_data_read(word_en, data, target_pkt.data);
923 target_word_cnts = efuse_calculate_word_cnts(target_pkt.word_en); 922 target_word_cnts = efuse_calculate_word_cnts(target_pkt.word_en);
@@ -1022,7 +1021,7 @@ static u8 efuse_word_enable_data_write(struct ieee80211_hw *hw,
1022 u8 badworden = 0x0F; 1021 u8 badworden = 0x0F;
1023 u8 tmpdata[8]; 1022 u8 tmpdata[8];
1024 1023
1025 memset((void *)tmpdata, PGPKT_DATA_SIZE, 0xff); 1024 memset(tmpdata, 0xff, PGPKT_DATA_SIZE);
1026 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD, 1025 RT_TRACE(rtlpriv, COMP_EFUSE, DBG_LOUD,
1027 ("word_en = %x efuse_addr=%x\n", word_en, efuse_addr)); 1026 ("word_en = %x efuse_addr=%x\n", word_en, efuse_addr));
1028 1027
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index baa2efeeedf6..c3a8c0965c07 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -395,7 +395,7 @@ static void rtl_pci_init_aspm(struct ieee80211_hw *hw)
395 * 0 - Disable ASPM, 395 * 0 - Disable ASPM,
396 * 1 - Enable ASPM without Clock Req, 396 * 1 - Enable ASPM without Clock Req,
397 * 2 - Enable ASPM with Clock Req, 397 * 2 - Enable ASPM with Clock Req,
398 * 3 - Alwyas Enable ASPM with Clock Req, 398 * 3 - Always Enable ASPM with Clock Req,
399 * 4 - Always Enable ASPM without Clock Req. 399 * 4 - Always Enable ASPM without Clock Req.
400 * set defult to RTL8192CE:3 RTL8192E:2 400 * set defult to RTL8192CE:3 RTL8192E:2
401 * */ 401 * */
diff --git a/drivers/net/wireless/rtlwifi/regd.c b/drivers/net/wireless/rtlwifi/regd.c
index 3336ca999dfd..d26f957981ad 100644
--- a/drivers/net/wireless/rtlwifi/regd.c
+++ b/drivers/net/wireless/rtlwifi/regd.c
@@ -179,7 +179,7 @@ static void _rtl_reg_apply_active_scan_flags(struct wiphy *wiphy,
179 } 179 }
180 180
181 /* 181 /*
182 *If a country IE has been recieved check its rule for this 182 *If a country IE has been received check its rule for this
183 *channel first before enabling active scan. The passive scan 183 *channel first before enabling active scan. The passive scan
184 *would have been enforced by the initial processing of our 184 *would have been enforced by the initial processing of our
185 *custom regulatory domain. 185 *custom regulatory domain.
diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
index 5ef91374b230..28a6ce3bc239 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c
@@ -303,7 +303,7 @@ static void _rtl92c_fill_h2c_command(struct ieee80211_hw *hw,
303 u16 box_reg, box_extreg; 303 u16 box_reg, box_extreg;
304 u8 u1b_tmp; 304 u8 u1b_tmp;
305 bool isfw_read = false; 305 bool isfw_read = false;
306 u8 buf_index; 306 u8 buf_index = 0;
307 bool bwrite_sucess = false; 307 bool bwrite_sucess = false;
308 u8 wait_h2c_limmit = 100; 308 u8 wait_h2c_limmit = 100;
309 u8 wait_writeh2c_limmit = 100; 309 u8 wait_writeh2c_limmit = 100;
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index a4b2613d6a8c..f5d85735d642 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -246,7 +246,7 @@ static void _rtl_usb_io_handler_init(struct device *dev,
246 246
247static void _rtl_usb_io_handler_release(struct ieee80211_hw *hw) 247static void _rtl_usb_io_handler_release(struct ieee80211_hw *hw)
248{ 248{
249 struct rtl_priv *rtlpriv = rtl_priv(hw); 249 struct rtl_priv __maybe_unused *rtlpriv = rtl_priv(hw);
250 250
251 mutex_destroy(&rtlpriv->io.bb_mutex); 251 mutex_destroy(&rtlpriv->io.bb_mutex);
252} 252}
diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
index 01226f8e70f9..07db95ff9bc5 100644
--- a/drivers/net/wireless/rtlwifi/wifi.h
+++ b/drivers/net/wireless/rtlwifi/wifi.h
@@ -1555,7 +1555,7 @@ struct rtl_priv {
1555 1555
1556 1556
1557/*************************************** 1557/***************************************
1558 Bluetooth Co-existance Related 1558 Bluetooth Co-existence Related
1559****************************************/ 1559****************************************/
1560 1560
1561enum bt_ant_num { 1561enum bt_ant_num {
diff --git a/drivers/net/wireless/wl1251/cmd.c b/drivers/net/wireless/wl1251/cmd.c
index 0ade4bd617c0..81f164bc4888 100644
--- a/drivers/net/wireless/wl1251/cmd.c
+++ b/drivers/net/wireless/wl1251/cmd.c
@@ -104,7 +104,7 @@ int wl1251_cmd_test(struct wl1251 *wl, void *buf, size_t buf_len, u8 answer)
104 * @wl: wl struct 104 * @wl: wl struct
105 * @id: acx id 105 * @id: acx id
106 * @buf: buffer for the response, including all headers, must work with dma 106 * @buf: buffer for the response, including all headers, must work with dma
107 * @len: lenght of buf 107 * @len: length of buf
108 */ 108 */
109int wl1251_cmd_interrogate(struct wl1251 *wl, u16 id, void *buf, size_t len) 109int wl1251_cmd_interrogate(struct wl1251 *wl, u16 id, void *buf, size_t len)
110{ 110{
diff --git a/drivers/net/wireless/wl1251/rx.c b/drivers/net/wireless/wl1251/rx.c
index c1b3b3f03da2..6af35265c900 100644
--- a/drivers/net/wireless/wl1251/rx.c
+++ b/drivers/net/wireless/wl1251/rx.c
@@ -179,7 +179,7 @@ static void wl1251_rx_body(struct wl1251 *wl,
179 rx_buffer = skb_put(skb, length); 179 rx_buffer = skb_put(skb, length);
180 wl1251_mem_read(wl, rx_packet_ring_addr, rx_buffer, length); 180 wl1251_mem_read(wl, rx_packet_ring_addr, rx_buffer, length);
181 181
182 /* The actual lenght doesn't include the target's alignment */ 182 /* The actual length doesn't include the target's alignment */
183 skb->len = desc->length - PLCP_HEADER_LENGTH; 183 skb->len = desc->length - PLCP_HEADER_LENGTH;
184 184
185 fc = (u16 *)skb->data; 185 fc = (u16 *)skb->data;
diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c
index d550b5e68d3c..f51a0241a440 100644
--- a/drivers/net/wireless/wl1251/sdio.c
+++ b/drivers/net/wireless/wl1251/sdio.c
@@ -265,7 +265,7 @@ static int wl1251_sdio_probe(struct sdio_func *func,
265 goto disable; 265 goto disable;
266 } 266 }
267 267
268 set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING); 268 irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
269 disable_irq(wl->irq); 269 disable_irq(wl->irq);
270 270
271 wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq; 271 wl1251_sdio_ops.enable_irq = wl1251_enable_line_irq;
diff --git a/drivers/net/wireless/wl1251/spi.c b/drivers/net/wireless/wl1251/spi.c
index ac872b38960f..af6448c4d3e2 100644
--- a/drivers/net/wireless/wl1251/spi.c
+++ b/drivers/net/wireless/wl1251/spi.c
@@ -286,7 +286,7 @@ static int __devinit wl1251_spi_probe(struct spi_device *spi)
286 goto out_free; 286 goto out_free;
287 } 287 }
288 288
289 set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING); 289 irq_set_irq_type(wl->irq, IRQ_TYPE_EDGE_RISING);
290 290
291 disable_irq(wl->irq); 291 disable_irq(wl->irq);
292 292
diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index f0aa7ab97bf7..96324336f936 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -359,7 +359,7 @@ int wl1271_cmd_test(struct wl1271 *wl, void *buf, size_t buf_len, u8 answer)
359 * @wl: wl struct 359 * @wl: wl struct
360 * @id: acx id 360 * @id: acx id
361 * @buf: buffer for the response, including all headers, must work with dma 361 * @buf: buffer for the response, including all headers, must work with dma
362 * @len: lenght of buf 362 * @len: length of buf
363 */ 363 */
364int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len) 364int wl1271_cmd_interrogate(struct wl1271 *wl, u16 id, void *buf, size_t len)
365{ 365{
diff --git a/drivers/net/wireless/wl12xx/conf.h b/drivers/net/wireless/wl12xx/conf.h
index 856a8a2fff4f..8a8323896eec 100644
--- a/drivers/net/wireless/wl12xx/conf.h
+++ b/drivers/net/wireless/wl12xx/conf.h
@@ -497,7 +497,7 @@ struct conf_rx_settings {
497#define CONF_TX_RATE_RETRY_LIMIT 10 497#define CONF_TX_RATE_RETRY_LIMIT 10
498 498
499/* 499/*
500 * Rates supported for data packets when operating as AP. Note the absense 500 * Rates supported for data packets when operating as AP. Note the absence
501 * of the 22Mbps rate. There is a FW limitation on 12 rates so we must drop 501 * of the 22Mbps rate. There is a FW limitation on 12 rates so we must drop
502 * one. The rate dropped is not mandatory under any operating mode. 502 * one. The rate dropped is not mandatory under any operating mode.
503 */ 503 */
@@ -572,7 +572,7 @@ enum conf_tx_ac {
572 CONF_TX_AC_BK = 1, /* background */ 572 CONF_TX_AC_BK = 1, /* background */
573 CONF_TX_AC_VI = 2, /* video */ 573 CONF_TX_AC_VI = 2, /* video */
574 CONF_TX_AC_VO = 3, /* voice */ 574 CONF_TX_AC_VO = 3, /* voice */
575 CONF_TX_AC_CTS2SELF = 4, /* fictious AC, follows AC_VO */ 575 CONF_TX_AC_CTS2SELF = 4, /* fictitious AC, follows AC_VO */
576 CONF_TX_AC_ANY_TID = 0x1f 576 CONF_TX_AC_ANY_TID = 0x1f
577}; 577};
578 578
@@ -1169,7 +1169,7 @@ struct conf_memory_settings {
1169 1169
1170 /* 1170 /*
1171 * Minimum required free tx memory blocks in order to assure optimum 1171 * Minimum required free tx memory blocks in order to assure optimum
1172 * performence 1172 * performance
1173 * 1173 *
1174 * Range: 0-120 1174 * Range: 0-120
1175 */ 1175 */
@@ -1177,7 +1177,7 @@ struct conf_memory_settings {
1177 1177
1178 /* 1178 /*
1179 * Minimum required free rx memory blocks in order to assure optimum 1179 * Minimum required free rx memory blocks in order to assure optimum
1180 * performence 1180 * performance
1181 * 1181 *
1182 * Range: 0-120 1182 * Range: 0-120
1183 */ 1183 */
diff --git a/drivers/net/wireless/wl12xx/io.h b/drivers/net/wireless/wl12xx/io.h
index c1aac8292089..00c771ea70bf 100644
--- a/drivers/net/wireless/wl12xx/io.h
+++ b/drivers/net/wireless/wl12xx/io.h
@@ -94,7 +94,7 @@ static inline int wl1271_translate_addr(struct wl1271 *wl, int addr)
94 * translated region. 94 * translated region.
95 * 95 *
96 * The translated regions occur next to each other in physical device 96 * The translated regions occur next to each other in physical device
97 * memory, so just add the sizes of the preceeding address regions to 97 * memory, so just add the sizes of the preceding address regions to
98 * get the offset to the new region. 98 * get the offset to the new region.
99 * 99 *
100 * Currently, only the two first regions are addressed, and the 100 * Currently, only the two first regions are addressed, and the
diff --git a/drivers/net/wireless/wl12xx/sdio.c b/drivers/net/wireless/wl12xx/sdio.c
index 5b9dbeafec06..b1c7d031c391 100644
--- a/drivers/net/wireless/wl12xx/sdio.c
+++ b/drivers/net/wireless/wl12xx/sdio.c
@@ -340,7 +340,7 @@ module_init(wl1271_init);
340module_exit(wl1271_exit); 340module_exit(wl1271_exit);
341 341
342MODULE_LICENSE("GPL"); 342MODULE_LICENSE("GPL");
343MODULE_AUTHOR("Luciano Coelho <luciano.coelho@nokia.com>"); 343MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
344MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); 344MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>");
345MODULE_FIRMWARE(WL1271_FW_NAME); 345MODULE_FIRMWARE(WL1271_FW_NAME);
346MODULE_FIRMWARE(WL1271_AP_FW_NAME); 346MODULE_FIRMWARE(WL1271_AP_FW_NAME);
diff --git a/drivers/net/wireless/wl12xx/spi.c b/drivers/net/wireless/wl12xx/spi.c
index 18cf01719ae0..ffc745b17f4d 100644
--- a/drivers/net/wireless/wl12xx/spi.c
+++ b/drivers/net/wireless/wl12xx/spi.c
@@ -487,7 +487,7 @@ module_init(wl1271_init);
487module_exit(wl1271_exit); 487module_exit(wl1271_exit);
488 488
489MODULE_LICENSE("GPL"); 489MODULE_LICENSE("GPL");
490MODULE_AUTHOR("Luciano Coelho <luciano.coelho@nokia.com>"); 490MODULE_AUTHOR("Luciano Coelho <coelho@ti.com>");
491MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>"); 491MODULE_AUTHOR("Juuso Oikarinen <juuso.oikarinen@nokia.com>");
492MODULE_FIRMWARE(WL1271_FW_NAME); 492MODULE_FIRMWARE(WL1271_FW_NAME);
493MODULE_FIRMWARE(WL1271_AP_FW_NAME); 493MODULE_FIRMWARE(WL1271_AP_FW_NAME);
diff --git a/drivers/net/wireless/wl12xx/testmode.c b/drivers/net/wireless/wl12xx/testmode.c
index e64403b6896d..6ec06a4a4c6d 100644
--- a/drivers/net/wireless/wl12xx/testmode.c
+++ b/drivers/net/wireless/wl12xx/testmode.c
@@ -204,7 +204,10 @@ static int wl1271_tm_cmd_nvs_push(struct wl1271 *wl, struct nlattr *tb[])
204 204
205 kfree(wl->nvs); 205 kfree(wl->nvs);
206 206
207 wl->nvs = kzalloc(sizeof(struct wl1271_nvs_file), GFP_KERNEL); 207 if (len != sizeof(struct wl1271_nvs_file))
208 return -EINVAL;
209
210 wl->nvs = kzalloc(len, GFP_KERNEL);
208 if (!wl->nvs) { 211 if (!wl->nvs) {
209 wl1271_error("could not allocate memory for the nvs file"); 212 wl1271_error("could not allocate memory for the nvs file");
210 ret = -ENOMEM; 213 ret = -ENOMEM;
diff --git a/drivers/net/wireless/wl3501_cs.c b/drivers/net/wireless/wl3501_cs.c
index 3e5befe4d03b..fc08f36fe1f5 100644
--- a/drivers/net/wireless/wl3501_cs.c
+++ b/drivers/net/wireless/wl3501_cs.c
@@ -290,7 +290,7 @@ static void wl3501_get_from_wla(struct wl3501_card *this, u16 src, void *dest,
290 * \ \- IEEE 802.11 -/ \-------------- len --------------/ 290 * \ \- IEEE 802.11 -/ \-------------- len --------------/
291 * \-struct wl3501_80211_tx_hdr--/ \-------- Ethernet Frame -------/ 291 * \-struct wl3501_80211_tx_hdr--/ \-------- Ethernet Frame -------/
292 * 292 *
293 * Return = Postion in Card 293 * Return = Position in Card
294 */ 294 */
295static u16 wl3501_get_tx_buffer(struct wl3501_card *this, u16 len) 295static u16 wl3501_get_tx_buffer(struct wl3501_card *this, u16 len)
296{ 296{
@@ -1932,7 +1932,7 @@ static int wl3501_config(struct pcmcia_device *link)
1932 this->base_addr = dev->base_addr; 1932 this->base_addr = dev->base_addr;
1933 1933
1934 if (!wl3501_get_flash_mac_addr(this)) { 1934 if (!wl3501_get_flash_mac_addr(this)) {
1935 printk(KERN_WARNING "%s: Cant read MAC addr in flash ROM?\n", 1935 printk(KERN_WARNING "%s: Can't read MAC addr in flash ROM?\n",
1936 dev->name); 1936 dev->name);
1937 unregister_netdev(dev); 1937 unregister_netdev(dev);
1938 goto failed; 1938 goto failed;
diff --git a/drivers/net/wireless/zd1211rw/Makefile b/drivers/net/wireless/zd1211rw/Makefile
index 1907eafb9b16..5728a918e508 100644
--- a/drivers/net/wireless/zd1211rw/Makefile
+++ b/drivers/net/wireless/zd1211rw/Makefile
@@ -5,7 +5,5 @@ zd1211rw-objs := zd_chip.o zd_mac.o \
5 zd_rf_al7230b.o zd_rf_uw2453.o \ 5 zd_rf_al7230b.o zd_rf_uw2453.o \
6 zd_rf.o zd_usb.o 6 zd_rf.o zd_usb.o
7 7
8ifeq ($(CONFIG_ZD1211RW_DEBUG),y) 8ccflags-$(CONFIG_ZD1211RW_DEBUG) := -DDEBUG
9EXTRA_CFLAGS += -DDEBUG
10endif
11 9
diff --git a/drivers/net/wireless/zd1211rw/zd_rf_rf2959.c b/drivers/net/wireless/zd1211rw/zd_rf_rf2959.c
index 0597d862fbd2..e36117486c91 100644
--- a/drivers/net/wireless/zd1211rw/zd_rf_rf2959.c
+++ b/drivers/net/wireless/zd1211rw/zd_rf_rf2959.c
@@ -169,7 +169,7 @@ static int rf2959_init_hw(struct zd_rf *rf)
169 { CR85, 0x00 }, { CR86, 0x10 }, { CR87, 0x2A }, 169 { CR85, 0x00 }, { CR86, 0x10 }, { CR87, 0x2A },
170 { CR88, 0x10 }, { CR89, 0x24 }, { CR90, 0x18 }, 170 { CR88, 0x10 }, { CR89, 0x24 }, { CR90, 0x18 },
171 /* { CR91, 0x18 }, */ 171 /* { CR91, 0x18 }, */
172 /* should solve continous CTS frame problems */ 172 /* should solve continuous CTS frame problems */
173 { CR91, 0x00 }, 173 { CR91, 0x00 },
174 { CR92, 0x0a }, { CR93, 0x00 }, { CR94, 0x01 }, 174 { CR92, 0x0a }, { CR93, 0x00 }, { CR94, 0x01 },
175 { CR95, 0x00 }, { CR96, 0x40 }, { CR97, 0x37 }, 175 { CR95, 0x00 }, { CR96, 0x40 }, { CR97, 0x37 },
diff --git a/drivers/net/wireless/zd1211rw/zd_rf_uw2453.c b/drivers/net/wireless/zd1211rw/zd_rf_uw2453.c
index 9e74eb1b67d5..ba0a0ccb1fa0 100644
--- a/drivers/net/wireless/zd1211rw/zd_rf_uw2453.c
+++ b/drivers/net/wireless/zd1211rw/zd_rf_uw2453.c
@@ -353,7 +353,7 @@ static int uw2453_init_hw(struct zd_rf *rf)
353 }; 353 };
354 354
355 static const u32 rv[] = { 355 static const u32 rv[] = {
356 UW2453_REGWRITE(4, 0x2b), /* configure reciever gain */ 356 UW2453_REGWRITE(4, 0x2b), /* configure receiver gain */
357 UW2453_REGWRITE(5, 0x19e4f), /* configure transmitter gain */ 357 UW2453_REGWRITE(5, 0x19e4f), /* configure transmitter gain */
358 UW2453_REGWRITE(6, 0xf81ad), /* enable RX/TX filter tuning */ 358 UW2453_REGWRITE(6, 0xf81ad), /* enable RX/TX filter tuning */
359 UW2453_REGWRITE(7, 0x3fffe), /* disable TX gain in test mode */ 359 UW2453_REGWRITE(7, 0x3fffe), /* disable TX gain in test mode */
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c
index 81e80489a052..ab607bbd6291 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.c
+++ b/drivers/net/wireless/zd1211rw/zd_usb.c
@@ -60,6 +60,7 @@ static struct usb_device_id usb_ids[] = {
60 { USB_DEVICE(0x157e, 0x300a), .driver_info = DEVICE_ZD1211 }, 60 { USB_DEVICE(0x157e, 0x300a), .driver_info = DEVICE_ZD1211 },
61 { USB_DEVICE(0x157e, 0x300b), .driver_info = DEVICE_ZD1211 }, 61 { USB_DEVICE(0x157e, 0x300b), .driver_info = DEVICE_ZD1211 },
62 { USB_DEVICE(0x157e, 0x3204), .driver_info = DEVICE_ZD1211 }, 62 { USB_DEVICE(0x157e, 0x3204), .driver_info = DEVICE_ZD1211 },
63 { USB_DEVICE(0x157e, 0x3207), .driver_info = DEVICE_ZD1211 },
63 { USB_DEVICE(0x1740, 0x2000), .driver_info = DEVICE_ZD1211 }, 64 { USB_DEVICE(0x1740, 0x2000), .driver_info = DEVICE_ZD1211 },
64 { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 }, 65 { USB_DEVICE(0x6891, 0xa727), .driver_info = DEVICE_ZD1211 },
65 /* ZD1211B */ 66 /* ZD1211B */
@@ -642,7 +643,7 @@ static void rx_urb_complete(struct urb *urb)
642 usb = urb->context; 643 usb = urb->context;
643 rx = &usb->rx; 644 rx = &usb->rx;
644 645
645 zd_usb_reset_rx_idle_timer(usb); 646 tasklet_schedule(&rx->reset_timer_tasklet);
646 647
647 if (length%rx->usb_packet_size > rx->usb_packet_size-4) { 648 if (length%rx->usb_packet_size > rx->usb_packet_size-4) {
648 /* If there is an old first fragment, we don't care. */ 649 /* If there is an old first fragment, we don't care. */
@@ -811,6 +812,7 @@ void zd_usb_disable_rx(struct zd_usb *usb)
811 __zd_usb_disable_rx(usb); 812 __zd_usb_disable_rx(usb);
812 mutex_unlock(&rx->setup_mutex); 813 mutex_unlock(&rx->setup_mutex);
813 814
815 tasklet_kill(&rx->reset_timer_tasklet);
814 cancel_delayed_work_sync(&rx->idle_work); 816 cancel_delayed_work_sync(&rx->idle_work);
815} 817}
816 818
@@ -1105,6 +1107,13 @@ static void zd_rx_idle_timer_handler(struct work_struct *work)
1105 zd_usb_reset_rx(usb); 1107 zd_usb_reset_rx(usb);
1106} 1108}
1107 1109
1110static void zd_usb_reset_rx_idle_timer_tasklet(unsigned long param)
1111{
1112 struct zd_usb *usb = (struct zd_usb *)param;
1113
1114 zd_usb_reset_rx_idle_timer(usb);
1115}
1116
1108void zd_usb_reset_rx_idle_timer(struct zd_usb *usb) 1117void zd_usb_reset_rx_idle_timer(struct zd_usb *usb)
1109{ 1118{
1110 struct zd_usb_rx *rx = &usb->rx; 1119 struct zd_usb_rx *rx = &usb->rx;
@@ -1126,6 +1135,7 @@ static inline void init_usb_interrupt(struct zd_usb *usb)
1126static inline void init_usb_rx(struct zd_usb *usb) 1135static inline void init_usb_rx(struct zd_usb *usb)
1127{ 1136{
1128 struct zd_usb_rx *rx = &usb->rx; 1137 struct zd_usb_rx *rx = &usb->rx;
1138
1129 spin_lock_init(&rx->lock); 1139 spin_lock_init(&rx->lock);
1130 mutex_init(&rx->setup_mutex); 1140 mutex_init(&rx->setup_mutex);
1131 if (interface_to_usbdev(usb->intf)->speed == USB_SPEED_HIGH) { 1141 if (interface_to_usbdev(usb->intf)->speed == USB_SPEED_HIGH) {
@@ -1135,11 +1145,14 @@ static inline void init_usb_rx(struct zd_usb *usb)
1135 } 1145 }
1136 ZD_ASSERT(rx->fragment_length == 0); 1146 ZD_ASSERT(rx->fragment_length == 0);
1137 INIT_DELAYED_WORK(&rx->idle_work, zd_rx_idle_timer_handler); 1147 INIT_DELAYED_WORK(&rx->idle_work, zd_rx_idle_timer_handler);
1148 rx->reset_timer_tasklet.func = zd_usb_reset_rx_idle_timer_tasklet;
1149 rx->reset_timer_tasklet.data = (unsigned long)usb;
1138} 1150}
1139 1151
1140static inline void init_usb_tx(struct zd_usb *usb) 1152static inline void init_usb_tx(struct zd_usb *usb)
1141{ 1153{
1142 struct zd_usb_tx *tx = &usb->tx; 1154 struct zd_usb_tx *tx = &usb->tx;
1155
1143 spin_lock_init(&tx->lock); 1156 spin_lock_init(&tx->lock);
1144 atomic_set(&tx->enabled, 0); 1157 atomic_set(&tx->enabled, 0);
1145 tx->stopped = 0; 1158 tx->stopped = 0;
@@ -1670,6 +1683,10 @@ static void iowrite16v_urb_complete(struct urb *urb)
1670 1683
1671 if (urb->status && !usb->cmd_error) 1684 if (urb->status && !usb->cmd_error)
1672 usb->cmd_error = urb->status; 1685 usb->cmd_error = urb->status;
1686
1687 if (!usb->cmd_error &&
1688 urb->actual_length != urb->transfer_buffer_length)
1689 usb->cmd_error = -EIO;
1673} 1690}
1674 1691
1675static int zd_submit_waiting_urb(struct zd_usb *usb, bool last) 1692static int zd_submit_waiting_urb(struct zd_usb *usb, bool last)
@@ -1804,7 +1821,7 @@ int zd_usb_iowrite16v_async(struct zd_usb *usb, const struct zd_ioreq16 *ioreqs,
1804 usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT), 1821 usb_fill_int_urb(urb, udev, usb_sndintpipe(udev, EP_REGS_OUT),
1805 req, req_len, iowrite16v_urb_complete, usb, 1822 req, req_len, iowrite16v_urb_complete, usb,
1806 ep->desc.bInterval); 1823 ep->desc.bInterval);
1807 urb->transfer_flags |= URB_FREE_BUFFER | URB_SHORT_NOT_OK; 1824 urb->transfer_flags |= URB_FREE_BUFFER;
1808 1825
1809 /* Submit previous URB */ 1826 /* Submit previous URB */
1810 r = zd_submit_waiting_urb(usb, false); 1827 r = zd_submit_waiting_urb(usb, false);
diff --git a/drivers/net/wireless/zd1211rw/zd_usb.h b/drivers/net/wireless/zd1211rw/zd_usb.h
index b3df2c8116cc..325d0f989257 100644
--- a/drivers/net/wireless/zd1211rw/zd_usb.h
+++ b/drivers/net/wireless/zd1211rw/zd_usb.h
@@ -183,6 +183,7 @@ struct zd_usb_rx {
183 spinlock_t lock; 183 spinlock_t lock;
184 struct mutex setup_mutex; 184 struct mutex setup_mutex;
185 struct delayed_work idle_work; 185 struct delayed_work idle_work;
186 struct tasklet_struct reset_timer_tasklet;
186 u8 fragment[2 * USB_MAX_RX_SIZE]; 187 u8 fragment[2 * USB_MAX_RX_SIZE];
187 unsigned int fragment_length; 188 unsigned int fragment_length;
188 unsigned int usb_packet_size; 189 unsigned int usb_packet_size;
diff --git a/drivers/net/xilinx_emaclite.c b/drivers/net/xilinx_emaclite.c
index 2642af4ee491..372572c0adc6 100644
--- a/drivers/net/xilinx_emaclite.c
+++ b/drivers/net/xilinx_emaclite.c
@@ -786,7 +786,7 @@ static int xemaclite_mdio_read(struct mii_bus *bus, int phy_id, int reg)
786 * @reg: register number to write to 786 * @reg: register number to write to
787 * @val: value to write to the register number specified by reg 787 * @val: value to write to the register number specified by reg
788 * 788 *
789 * This fucntion waits till the device is ready to accept a new MDIO 789 * This function waits till the device is ready to accept a new MDIO
790 * request and then writes the val to the MDIO Write Data register. 790 * request and then writes the val to the MDIO Write Data register.
791 */ 791 */
792static int xemaclite_mdio_write(struct mii_bus *bus, int phy_id, int reg, 792static int xemaclite_mdio_write(struct mii_bus *bus, int phy_id, int reg,
diff --git a/drivers/net/znet.c b/drivers/net/znet.c
index ae07b3dfbcc1..ec2800ff8d42 100644
--- a/drivers/net/znet.c
+++ b/drivers/net/znet.c
@@ -652,7 +652,7 @@ static irqreturn_t znet_interrupt(int irq, void *dev_id)
652 dev->stats.tx_errors++; 652 dev->stats.tx_errors++;
653 653
654 /* Transceiver may be stuck if cable 654 /* Transceiver may be stuck if cable
655 * was removed while emiting a 655 * was removed while emitting a
656 * packet. Flip it off, then on to 656 * packet. Flip it off, then on to
657 * reset it. This is very empirical, 657 * reset it. This is very empirical,
658 * but it seems to work. */ 658 * but it seems to work. */