History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next

Pull networking changes from David Miller: 1) Allow to dump, monitor, and change the bridge multicast database using netlink. From Cong Wang. 2) RFC 5961 TCP blind data injection attack mitigation, from Eric Dumazet. 3) Networking user namespace support from Eric W. Biederman. 4) tuntap/virtio-net multiqueue support by Jason Wang. 5) Support for checksum offload of encapsulated packets (basically, tunneled traffic can still be checksummed by HW). From Joseph Gasparakis. 6) Allow BPF filter access to VLAN tags, from Eric Dumazet and Daniel Borkmann. 7) Bridge port parameters over netlink and BPDU blocking support from Stephen Hemminger. 8) Improve data access patterns during inet socket demux by rearranging socket layout, from Eric Dumazet. 9) TIPC protocol updates and cleanups from Ying Xue, Paul Gortmaker, and Jon Maloy. 10) Update TCP socket hash sizing to be more in line with current day realities. The existing heurstics were choosen a decade ago. From Eric Dumazet. 11) Fix races, queue bloat, and excessive wakeups in ATM and associated drivers, from Krzysztof Mazur and David Woodhouse. 12) Support DOVE (Distributed Overlay Virtual Ethernet) extensions in VXLAN driver, from David Stevens. 13) Add "oops_only" mode to netconsole, from Amerigo Wang. 14) Support set and query of VEB/VEPA bridge mode via PF_BRIDGE, also allow DCB netlink to work on namespaces other than the initial namespace. From John Fastabend. 15) Support PTP in the Tigon3 driver, from Matt Carlson. 16) tun/vhost zero copy fixes and improvements, plus turn it on by default, from Michael S. Tsirkin. 17) Support per-association statistics in SCTP, from Michele Baldessari. And many, many, driver updates, cleanups, and improvements. Too numerous to mention individually. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1722 commits) net/mlx4_en: Add support for destination MAC in steering rules net/mlx4_en: Use generic etherdevice.h functions. net: ethtool: Add destination MAC address to flow steering API bridge: add support of adding and deleting mdb entries bridge: notify mdb changes via netlink ndisc: Unexport ndisc_{build,send}_skb(). uapi: add missing netconf.h to export list pkt_sched: avoid requeues if possible solos-pci: fix double-free of TX skb in DMA mode bnx2: Fix accidental reversions. bna: Driver Version Updated to 3.1.2.1 bna: Firmware update bna: Add RX State bna: Rx Page Based Allocation bna: TX Intr Coalescing Fix bna: Tx and Rx Optimizations bna: Code Cleanup and Enhancements ath9k: check pdata variable before dereferencing it ath5k: RX timestamp is reported at end of frame ath9k_htc: RX timestamp is reported at end of frame ...

Linus Torvalds committed 13 years ago

Commit 6be35c72 parents e37aa63 520dfe31353 files · +82940 −34585Browse files

Unified · Split

1353 files
  1. Documentation/ABI/testing/sysfs-bus-mdio +9 −0
  2. Documentation/ABI/testing/sysfs-class-net-batman-adv +6 −5
  3. Documentation/ABI/testing/sysfs-class-net-grcan +35 −0
  4. Documentation/ABI/testing/sysfs-class-net-mesh +20 −20
  5. Documentation/devicetree/bindings/net/can/grcan.txt +28 −0
  6. Documentation/devicetree/bindings/net/cdns-emac.txt +23 −0
  7. Documentation/devicetree/bindings/net/cpsw.txt +13 −35
  8. Documentation/kernel-parameters.txt +18 −0
  9. Documentation/networking/batman-adv.txt +2 −1
  10. Documentation/networking/ip-sysctl.txt +39 −17
  11. Documentation/networking/packet_mmap.txt +222 −24
  12. Documentation/networking/stmmac.txt +15 −13
  13. MAINTAINERS +22 −5
  14. arch/alpha/include/asm/socket.h +1 −0
  15. arch/arm/boot/dts/am335x-bone.dts +8 −0
  16. arch/arm/boot/dts/am335x-evm.dts +8 −0
  17. arch/arm/boot/dts/am33xx.dtsi +47 −0
  18. arch/arm/boot/dts/imx6q.dtsi +3 −2
  19. arch/arm/configs/omap2plus_defconfig +3 −0
  20. arch/arm/mach-at91/Kconfig +0 −4
  21. arch/arm/mach-at91/board-csb337.c +2 −0
  22. arch/arm/mach-at91/include/mach/at91rm9200_emac.h +0 −138
  23. arch/arm/mach-imx/mach-imx6q.c +12 −0
  24. arch/arm/mach-omap2/omap_hwmod_33xx_data.c +31 −0
  25. arch/arm/net/bpf_jit_32.c +24 −5
  26. arch/arm/net/bpf_jit_32.h +2 −0
  27. arch/avr32/Kconfig +0 −1
  28. arch/avr32/include/uapi/asm/socket.h +1 −0
  29. arch/cris/include/asm/socket.h +1 −0
  30. arch/frv/include/uapi/asm/socket.h +1 −0
  31. arch/h8300/include/asm/socket.h +1 −0
  32. arch/ia64/include/uapi/asm/socket.h +1 −0
  33. arch/m32r/include/asm/socket.h +1 −0
  34. arch/m68k/include/uapi/asm/socket.h +1 −0
  35. arch/mips/bcm47xx/nvram.c +2 −2
  36. arch/mips/bcm47xx/wgt634u.c +4 −4
  37. arch/mips/include/uapi/asm/socket.h +1 −0
  38. arch/mn10300/include/uapi/asm/socket.h +1 −0
  39. arch/parisc/include/uapi/asm/socket.h +1 −0
  40. arch/powerpc/include/asm/ppc-opcode.h +3 −0
  41. arch/powerpc/include/uapi/asm/socket.h +1 −0
  42. arch/powerpc/net/bpf_jit.h +6 −0
  43. arch/powerpc/net/bpf_jit_comp.c +25 −0
  44. arch/s390/include/uapi/asm/socket.h +1 −0
  45. arch/sparc/include/uapi/asm/socket.h +1 −0
  46. arch/sparc/net/bpf_jit_comp.c +19 −0
  47. arch/x86/net/bpf_jit_comp.c +21 −0
  48. arch/xtensa/include/uapi/asm/socket.h +1 −0
  49. drivers/atm/solos-pci.c +35 −53
  50. drivers/bcma/bcma_private.h +4 −2
  51. drivers/bcma/driver_chipcommon.c +126 −9
  52. drivers/bcma/driver_chipcommon_nflash.c +3 −0
  53. drivers/bcma/driver_chipcommon_pmu.c +25 −19
  54. drivers/bcma/driver_chipcommon_sflash.c +32 −3
  55. drivers/bcma/driver_mips.c +33 −19
  56. drivers/bcma/driver_pci_host.c +16 −8
  57. drivers/bcma/host_pci.c +3 −3
  58. drivers/bcma/main.c +48 −14
  59. drivers/bcma/sprom.c +4 −1
  60. drivers/bluetooth/btmrvl_sdio.c +17 −11
  61. drivers/bluetooth/btusb.c +1 −0
  62. drivers/dma/ioat/dca.c +23 −0
  63. drivers/isdn/hardware/mISDN/hfcpci.c +1 −1
  64. drivers/isdn/hardware/mISDN/mISDNisar.c +1 −1
  65. drivers/isdn/hisax/callc.c +1 −1
  66. drivers/isdn/hisax/hfc_pci.c +1 −1
  67. drivers/isdn/hisax/hfc_sx.c +1 −1
  68. drivers/isdn/mISDN/l1oip_core.c +1 −4
  69. drivers/isdn/mISDN/tei.c +10 −10
  70. drivers/isdn/pcbit/layer2.c +1 −1
  71. drivers/net/arcnet/com20020-pci.c +3 −3
  72. drivers/net/bonding/bond_alb.c +163 −34
  73. drivers/net/bonding/bond_alb.h +24 −4
  74. drivers/net/bonding/bond_debugfs.c +3 −2
  75. drivers/net/bonding/bond_main.c +7 −12
  76. drivers/net/bonding/bonding.h +13 −0
  77. drivers/net/can/Kconfig +9 −0
  78. drivers/net/can/Makefile +1 −0
  79. drivers/net/can/at91_can.c +5 −4
  80. drivers/net/can/bfin_can.c +4 −3
  81. drivers/net/can/c_can/c_can.c +12 −0
  82. drivers/net/can/c_can/c_can.h +3 −0
  83. drivers/net/can/c_can/c_can_pci.c +4 −4
  84. drivers/net/can/c_can/c_can_platform.c +32 −4
  85. drivers/net/can/cc770/cc770_isa.c +9 −9
  86. drivers/net/can/cc770/cc770_platform.c +10 −8
  87. drivers/net/can/dev.c +1 −2
  88. drivers/net/can/flexcan.c +7 −5
  89. drivers/net/can/grcan.c +1756 −0
  90. drivers/net/can/janz-ican3.c +14 −14
  91. drivers/net/can/mcp251x.c +3 −3
  92. drivers/net/can/mscan/mpc5xxx_can.c +17 −20
  93. drivers/net/can/mscan/mscan.c +0 −8
  94. drivers/net/can/mscan/mscan.h +0 −1
  95. drivers/net/can/pch_can.c +3 −3
  96. drivers/net/can/sja1000/Kconfig +2 −1
  97. drivers/net/can/sja1000/ems_pci.c +2 −2
  98. drivers/net/can/sja1000/ems_pcmcia.c +2 −3
  99. drivers/net/can/sja1000/kvaser_pci.c +4 −4
  100. drivers/net/can/sja1000/peak_pci.c +3 −4
  101. drivers/net/can/sja1000/peak_pcmcia.c +1 −1
  102. drivers/net/can/sja1000/plx_pci.c +29 −10
  103. drivers/net/can/sja1000/sja1000.c +0 −8
  104. drivers/net/can/sja1000/sja1000.h +0 −1
  105. drivers/net/can/sja1000/sja1000_isa.c +8 −8
  106. drivers/net/can/sja1000/sja1000_of_platform.c +8 −6
  107. drivers/net/can/sja1000/sja1000_platform.c +1 −0
  108. drivers/net/can/sja1000/tscan1.c +4 −4
  109. drivers/net/can/softing/softing_cs.c +5 −6
  110. drivers/net/can/softing/softing_main.c +7 −7
  111. drivers/net/can/ti_hecc.c +3 −2
  112. drivers/net/can/usb/Kconfig +29 −0
  113. drivers/net/can/usb/Makefile +1 −0
  114. drivers/net/can/usb/ems_usb.c +0 −7
  115. drivers/net/can/usb/esd_usb2.c +29 −16
  116. drivers/net/can/usb/kvaser_usb.c +1627 −0
  117. drivers/net/can/usb/peak_usb/pcan_usb_core.c +0 −5
  118. drivers/net/can/usb/peak_usb/pcan_usb_core.h +0 −1
  119. drivers/net/dsa/Kconfig +4 −1
  120. drivers/net/ethernet/3com/3c509.c +13 −16
  121. drivers/net/ethernet/3com/3c59x.c +10 −11
  122. drivers/net/ethernet/3com/Kconfig +1 −1
  123. drivers/net/ethernet/3com/typhoon.c +5 −5
  124. drivers/net/ethernet/8390/ax88796.c +8 −8
  125. drivers/net/ethernet/8390/etherh.c +4 −10
  126. drivers/net/ethernet/8390/hydra.c +9 −9
  127. drivers/net/ethernet/8390/ne2k-pci.c +6 −6
  128. drivers/net/ethernet/8390/ne3210.c +2 −2
  129. drivers/net/ethernet/8390/zorro8390.c +8 −9
  130. drivers/net/ethernet/adaptec/starfire.c +6 −6
  131. drivers/net/ethernet/adi/Kconfig +1 −1
  132. drivers/net/ethernet/adi/bfin_mac.c +201 −70
  133. drivers/net/ethernet/adi/bfin_mac.h +8 −5
  134. drivers/net/ethernet/aeroflex/greth.c +3 −3
  135. drivers/net/ethernet/alteon/acenic.c +15 −16
  136. drivers/net/ethernet/amd/a2065.c +8 −8
  137. drivers/net/ethernet/amd/am79c961a.c +1 −1
  138. drivers/net/ethernet/amd/amd8111e.c +4 −4
  139. drivers/net/ethernet/amd/ariadne.c +5 −5
  140. drivers/net/ethernet/amd/au1000_eth.c +3 −3
  141. drivers/net/ethernet/amd/declance.c +4 −4
  142. drivers/net/ethernet/amd/depca.c +5 −5
  143. drivers/net/ethernet/amd/hplance.c +7 −10
  144. drivers/net/ethernet/amd/pcnet32.c +5 −5
  145. drivers/net/ethernet/amd/sunlance.c +6 −6
  146. drivers/net/ethernet/apple/bmac.c +2 −2
  147. drivers/net/ethernet/apple/mace.c +2 −2
  148. drivers/net/ethernet/apple/macmace.c +3 −3
  149. drivers/net/ethernet/atheros/atl1c/atl1c_main.c +7 −8
  150. drivers/net/ethernet/atheros/atl1e/atl1e_main.c +5 −6
  151. drivers/net/ethernet/atheros/atl1e/atl1e_param.c +4 −3
  152. drivers/net/ethernet/atheros/atlx/atl1.c +8 −9
  153. drivers/net/ethernet/atheros/atlx/atl2.c +8 −9
  154. drivers/net/ethernet/broadcom/Kconfig +1 −0
  155. drivers/net/ethernet/broadcom/b44.c +5 −5
  156. drivers/net/ethernet/broadcom/bcm63xx_enet.c +6 −6
  157. drivers/net/ethernet/broadcom/bnx2.c +515 −507
  158. drivers/net/ethernet/broadcom/bnx2.h +67 −67
  159. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +88 −53
  160. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +359 −169
  161. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +67 −24
  162. drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c +31 −10
  163. drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +18 −11
  164. drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h +5 −0
  165. drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h +46 −8
  166. drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h +22 −7
  167. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +653 −338
  168. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h +8 −10
  169. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +728 −458
  170. drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +56 −3
  171. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +55 −4
  172. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +12 −0
  173. drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +1 −0
  174. drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h +3 −0
  175. drivers/net/ethernet/broadcom/cnic.c +102 −87
  176. drivers/net/ethernet/broadcom/cnic.h +8 −22
  177. drivers/net/ethernet/broadcom/cnic_if.h +2 −5
  178. drivers/net/ethernet/broadcom/sb1250-mac.c +1 −1
  179. drivers/net/ethernet/broadcom/tg3.c +565 −161
  180. drivers/net/ethernet/broadcom/tg3.h +65 −3
  181. drivers/net/ethernet/brocade/bna/bfa_ioc.c +0 −4
  182. drivers/net/ethernet/brocade/bna/bfi_enet.h +1 −0
  183. drivers/net/ethernet/brocade/bna/bna.h +2 −0
  184. drivers/net/ethernet/brocade/bna/bna_hw_defs.h +2 −1
  185. drivers/net/ethernet/brocade/bna/bna_tx_rx.c +89 −49
  186. drivers/net/ethernet/brocade/bna/bna_types.h +3 −6
  187. drivers/net/ethernet/brocade/bna/bnad.c +523 −420
  188. drivers/net/ethernet/brocade/bna/bnad.h +41 −25
  189. drivers/net/ethernet/brocade/bna/bnad_ethtool.c +1 −0
  190. drivers/net/ethernet/brocade/bna/cna.h +2 −2
  191. drivers/net/ethernet/cadence/Kconfig +2 −7
  192. drivers/net/ethernet/cadence/at91_ether.c +261 −1022
  193. drivers/net/ethernet/cadence/at91_ether.h +0 −112
  194. drivers/net/ethernet/cadence/macb.c +391 −173
  195. drivers/net/ethernet/cadence/macb.h +60 −7
  196. drivers/net/ethernet/calxeda/xgmac.c +26 −33
  197. drivers/net/ethernet/chelsio/Kconfig +1 −1
  198. drivers/net/ethernet/chelsio/cxgb/cxgb2.c +3 −4
  199. drivers/net/ethernet/chelsio/cxgb/sge.c +2 −15
  200. drivers/net/ethernet/chelsio/cxgb/subr.c +6 −7
  201. drivers/net/ethernet/chelsio/cxgb/tp.c +1 −1
  202. drivers/net/ethernet/chelsio/cxgb3/common.h +3 −4
  203. drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +6 −8
  204. drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +2 −2
  205. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +12 −13
  206. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +6 −8
  207. drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +11 −11
  208. drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h +2 −2
  209. drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c +3 −4
  210. drivers/net/ethernet/cisco/Kconfig +1 −1
  211. drivers/net/ethernet/cisco/enic/Kconfig +1 −1
  212. drivers/net/ethernet/cisco/enic/enic_main.c +3 −4
  213. drivers/net/ethernet/davicom/dm9000.c +9 −9
  214. drivers/net/ethernet/dec/ewrk3.c +1 −2
  215. drivers/net/ethernet/dec/tulip/de2104x.c +8 −8
  216. drivers/net/ethernet/dec/tulip/de4x5.c +9 −9
  217. drivers/net/ethernet/dec/tulip/dmfe.c +5 −6
  218. drivers/net/ethernet/dec/tulip/eeprom.c +5 −5
  219. drivers/net/ethernet/dec/tulip/media.c +1 −1
  220. drivers/net/ethernet/dec/tulip/tulip_core.c +5 −7
  221. drivers/net/ethernet/dec/tulip/uli526x.c +6 −6
  222. drivers/net/ethernet/dec/tulip/winbond-840.c +4 −5
  223. drivers/net/ethernet/dec/tulip/xircom_cb.c +3 −3
  224. drivers/net/ethernet/dlink/dl2k.c +5 −19
  225. drivers/net/ethernet/dlink/sundance.c +87 −8
  226. drivers/net/ethernet/dnet.c +4 −7
  227. drivers/net/ethernet/emulex/Kconfig +1 −1
  228. drivers/net/ethernet/emulex/benet/Kconfig +1 −1
  229. drivers/net/ethernet/emulex/benet/be.h +27 −24
  230. drivers/net/ethernet/emulex/benet/be_cmds.c +391 −18
  231. drivers/net/ethernet/emulex/benet/be_cmds.h +148 −29
  232. drivers/net/ethernet/emulex/benet/be_ethtool.c +49 −31
  233. drivers/net/ethernet/emulex/benet/be_hw.h +9 −11
  234. drivers/net/ethernet/emulex/benet/be_main.c +509 −340
  235. drivers/net/ethernet/emulex/benet/be_roce.c +1 −4
  236. drivers/net/ethernet/ethoc.c +4 −4
  237. drivers/net/ethernet/fealnx.c +6 −6
  238. drivers/net/ethernet/freescale/Kconfig +9 −0
  239. drivers/net/ethernet/freescale/Makefile +1 −0
  240. drivers/net/ethernet/freescale/fec.c +92 −79
  241. drivers/net/ethernet/freescale/fec.h +119 −0
  242. drivers/net/ethernet/freescale/fec_mpc52xx.c +1 −1
  243. drivers/net/ethernet/freescale/fec_ptp.c +383 −0
  244. drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +1 −1
  245. drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c +2 −3
  246. drivers/net/ethernet/freescale/fs_enet/mii-fec.c +1 −1
  247. drivers/net/ethernet/freescale/gianfar.c +8 −6
  248. drivers/net/ethernet/freescale/xgmac_mdio.c +2 −2
  249. drivers/net/ethernet/hp/hp100.c +9 −9
  250. drivers/net/ethernet/i825xx/ether1.c +7 −13
  251. drivers/net/ethernet/i825xx/lasi_82596.c +4 −4
  252. drivers/net/ethernet/i825xx/lib82596.c +1 −1
  253. drivers/net/ethernet/i825xx/sni_82596.c +4 −4
  254. drivers/net/ethernet/ibm/Kconfig +2 −3
  255. drivers/net/ethernet/ibm/ehea/ehea_main.c +8 −8
  256. drivers/net/ethernet/ibm/emac/core.c +12 −12
  257. drivers/net/ethernet/ibm/emac/mal.c +5 −8
  258. drivers/net/ethernet/ibm/emac/rgmii.c +3 −3
  259. drivers/net/ethernet/ibm/emac/tah.c +3 −3
  260. drivers/net/ethernet/ibm/emac/zmii.c +3 −3
  261. drivers/net/ethernet/ibm/ibmveth.c +3 −4
  262. drivers/net/ethernet/icplus/ipg.c +3 −4
  263. drivers/net/ethernet/intel/Kconfig +3 −27
  264. drivers/net/ethernet/intel/e100.c +3 −4
  265. drivers/net/ethernet/intel/e1000/e1000_hw.c +15 −2
  266. drivers/net/ethernet/intel/e1000/e1000_main.c +6 −7
  267. drivers/net/ethernet/intel/e1000/e1000_param.c +7 −7
  268. drivers/net/ethernet/intel/e1000e/80003es2lan.c +23 −43
  269. drivers/net/ethernet/intel/e1000e/82571.c +38 −77
  270. drivers/net/ethernet/intel/e1000e/defines.h +9 −18
  271. drivers/net/ethernet/intel/e1000e/e1000.h +5 −12
  272. drivers/net/ethernet/intel/e1000e/ethtool.c +24 −45
  273. drivers/net/ethernet/intel/e1000e/hw.h +2 −4
  274. drivers/net/ethernet/intel/e1000e/ich8lan.c +81 −162
  275. drivers/net/ethernet/intel/e1000e/mac.c +45 −90
  276. drivers/net/ethernet/intel/e1000e/manage.c +3 −6
  277. drivers/net/ethernet/intel/e1000e/netdev.c +132 −199
  278. drivers/net/ethernet/intel/e1000e/nvm.c +5 −10
  279. drivers/net/ethernet/intel/e1000e/param.c +21 −39
  280. drivers/net/ethernet/intel/e1000e/phy.c +47 −94
  281. drivers/net/ethernet/intel/igb/Makefile +1 −3
  282. drivers/net/ethernet/intel/igb/e1000_82575.c +58 −19
  283. drivers/net/ethernet/intel/igb/e1000_82575.h +3 −0
  284. drivers/net/ethernet/intel/igb/e1000_defines.h +22 −0
  285. drivers/net/ethernet/intel/igb/e1000_i210.c +241 −128
  286. drivers/net/ethernet/intel/igb/e1000_i210.h +17 −0
  287. drivers/net/ethernet/intel/igb/e1000_mac.c +128 −0
  288. drivers/net/ethernet/intel/igb/e1000_mac.h +1 −0
  289. drivers/net/ethernet/intel/igb/e1000_nvm.c +83 −16
  290. drivers/net/ethernet/intel/igb/e1000_nvm.h +16 −0
  291. drivers/net/ethernet/intel/igb/e1000_phy.c +37 −12
  292. drivers/net/ethernet/intel/igb/e1000_phy.h +1 −0
  293. drivers/net/ethernet/intel/igb/igb.h +65 −47
  294. drivers/net/ethernet/intel/igb/igb_ethtool.c +328 −78
  295. drivers/net/ethernet/intel/igb/igb_main.c +962 −612
  296. drivers/net/ethernet/intel/igb/igb_ptp.c +58 −44
  297. drivers/net/ethernet/intel/igbvf/defines.h +1 −0
  298. drivers/net/ethernet/intel/igbvf/igbvf.h +1 −1
  299. drivers/net/ethernet/intel/igbvf/netdev.c +32 −9
  300. drivers/net/ethernet/intel/ixgb/ixgb_main.c +5 −5
  301. drivers/net/ethernet/intel/ixgb/ixgb_param.c +3 −3
  302. drivers/net/ethernet/intel/ixgbe/Makefile +1 −2
  303. drivers/net/ethernet/intel/ixgbe/ixgbe.h +7 −8
  304. drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +130 −30
  305. drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +69 −31
  306. drivers/net/ethernet/intel/ixgbe/ixgbe_common.h +2 −1
  307. drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c +48 −67
  308. drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +55 −54
  309. drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +4 −0
  310. drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c +20 −2
  311. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +257 −161
  312. drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h +29 −2
  313. drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c +65 −99
  314. drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +328 −142
  315. drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +3 −9
  316. drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c +1 −1
  317. drivers/net/ethernet/intel/ixgbevf/defines.h +5 −2
  318. drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +9 −7
  319. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +273 −130
  320. drivers/net/ethernet/intel/ixgbevf/mbx.h +10 −0
  321. drivers/net/ethernet/intel/ixgbevf/vf.c +61 −0
  322. drivers/net/ethernet/intel/ixgbevf/vf.h +2 −0
  323. drivers/net/ethernet/jme.c +3 −3
  324. drivers/net/ethernet/lantiq_etop.c +2 −2
  325. drivers/net/ethernet/marvell/pxa168_eth.c +3 −4
  326. drivers/net/ethernet/marvell/skge.c +4 −5
  327. drivers/net/ethernet/marvell/sky2.c +17 −18
  328. drivers/net/ethernet/mellanox/Kconfig +1 −1
  329. drivers/net/ethernet/mellanox/mlx4/Kconfig +1 −2
  330. drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +116 −39
  331. drivers/net/ethernet/mellanox/mlx4/en_main.c +1 −1
  332. drivers/net/ethernet/mellanox/mlx4/en_netdev.c +16 −12
  333. drivers/net/ethernet/mellanox/mlx4/en_rx.c +3 −6
  334. drivers/net/ethernet/mellanox/mlx4/en_tx.c +1 −1
  335. drivers/net/ethernet/mellanox/mlx4/main.c +3 −4
  336. drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +8 −19
  337. drivers/net/ethernet/micrel/ks8695net.c +5 −8
  338. drivers/net/ethernet/micrel/ks8842.c +3 −3
  339. drivers/net/ethernet/micrel/ks8851.c +3 −3
  340. drivers/net/ethernet/micrel/ks8851_mll.c +3 −3
  341. drivers/net/ethernet/micrel/ksz884x.c +3 −15
  342. drivers/net/ethernet/microchip/enc28j60.c +3 −3
  343. drivers/net/ethernet/myricom/Kconfig +0 −1
  344. drivers/net/ethernet/myricom/myri10ge/myri10ge.c +79 −206
  345. drivers/net/ethernet/natsemi/ibmlana.c +2 −2
  346. drivers/net/ethernet/natsemi/jazzsonic.c +4 −4
  347. drivers/net/ethernet/natsemi/macsonic.c +10 −11
  348. drivers/net/ethernet/natsemi/natsemi.c +6 −7
  349. drivers/net/ethernet/natsemi/ns83820.c +4 −4
  350. drivers/net/ethernet/natsemi/xtsonic.c +3 −3
  351. drivers/net/ethernet/neterion/Kconfig +1 −1
  352. drivers/net/ethernet/neterion/s2io.c +6 −5
  353. drivers/net/ethernet/neterion/s2io.h +2 −3
  354. drivers/net/ethernet/neterion/vxge/vxge-config.c +3 −3
  355. drivers/net/ethernet/neterion/vxge/vxge-config.h +3 −3
  356. drivers/net/ethernet/neterion/vxge/vxge-main.c +12 −15
  357. drivers/net/ethernet/nuvoton/w90p910_ether.c +3 −3
  358. drivers/net/ethernet/nvidia/forcedeth.c +3 −3
  359. drivers/net/ethernet/nxp/lpc_eth.c +2 −4
  360. drivers/net/ethernet/octeon/octeon_mgmt.c +3 −3
  361. drivers/net/ethernet/oki-semi/pch_gbe/Kconfig +1 −16
  362. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h +0 −2
  363. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +0 −14
  364. drivers/net/ethernet/packetengines/hamachi.c +6 −6
  365. drivers/net/ethernet/packetengines/yellowfin.c +6 −6
  366. drivers/net/ethernet/pasemi/pasemi_mac.c +3 −3
  367. drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c +50 −43
  368. drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +5 −5
  369. drivers/net/ethernet/qlogic/qla3xxx.c +5 −19
  370. drivers/net/ethernet/qlogic/qlcnic/Makefile +2 −1
  371. drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +194 −327
  372. drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c +70 −44
  373. drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +38 −35
  374. drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h +24 −32
  375. drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +163 −586
  376. drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c +114 −738
  377. drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +1309 −0
  378. drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +316 −1870
  379. drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +629 −0
  380. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +960 −0
  381. drivers/net/ethernet/qlogic/qlge/qlge_dbg.c +8 −8
  382. drivers/net/ethernet/qlogic/qlge/qlge_main.c +6 −6
  383. drivers/net/ethernet/rdc/r6040.c +4 −5
  384. drivers/net/ethernet/realtek/8139cp.c +44 −31
  385. drivers/net/ethernet/realtek/8139too.c +7 −7
  386. drivers/net/ethernet/realtek/atp.c +2 −56
  387. drivers/net/ethernet/realtek/atp.h +0 −2
  388. drivers/net/ethernet/realtek/r8169.c +103 −67
  389. drivers/net/ethernet/renesas/sh_eth.c +1 −1
  390. drivers/net/ethernet/s6gmac.c +3 −3
  391. drivers/net/ethernet/seeq/ether3.c +8 −14
  392. drivers/net/ethernet/seeq/sgiseeq.c +1 −1
  393. drivers/net/ethernet/sfc/Kconfig +2 −8
  394. drivers/net/ethernet/sfc/Makefile +1 −2
  395. drivers/net/ethernet/sfc/efx.c +8 −8
  396. drivers/net/ethernet/sfc/efx.h +13 −0
  397. drivers/net/ethernet/sfc/ethtool.c +14 −11
  398. drivers/net/ethernet/sfc/falcon.c +2 −0
  399. drivers/net/ethernet/sfc/io.h +14 −29
  400. drivers/net/ethernet/sfc/mcdi.c +15 −8
  401. drivers/net/ethernet/sfc/net_driver.h +3 −2
  402. drivers/net/ethernet/sfc/nic.c +66 −15
  403. drivers/net/ethernet/sfc/nic.h +2 −26
  404. drivers/net/ethernet/sfc/rx.c +1 −5
  405. drivers/net/ethernet/sfc/selftest.c +2 −2
  406. drivers/net/ethernet/sfc/siena.c +15 −2
  407. drivers/net/ethernet/sfc/siena_sriov.c +3 −5
  408. drivers/net/ethernet/sgi/ioc3-eth.c +5 −6
  409. drivers/net/ethernet/sgi/meth.c +1 −1
  410. drivers/net/ethernet/silan/sc92031.c +3 −4
  411. drivers/net/ethernet/sis/sis190.c +13 −14
  412. drivers/net/ethernet/sis/sis900.c +15 −14
  413. drivers/net/ethernet/smsc/epic100.c +6 −7
  414. drivers/net/ethernet/smsc/smc911x.c +5 −15
  415. drivers/net/ethernet/smsc/smc911x.h +8 −8
  416. drivers/net/ethernet/smsc/smc91x.c +6 −16
  417. drivers/net/ethernet/smsc/smc91x.h +10 −10
  418. drivers/net/ethernet/smsc/smsc911x.c +13 −19
  419. drivers/net/ethernet/smsc/smsc9420.c +3 −3
  420. drivers/net/ethernet/stmicro/stmmac/Kconfig +0 −25
  421. drivers/net/ethernet/stmicro/stmmac/Makefile +0 −1
  422. drivers/net/ethernet/stmicro/stmmac/common.h +30 −9
  423. drivers/net/ethernet/stmicro/stmmac/dwmac1000.h +0 −3
  424. drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c +6 −0
  425. drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h +4 −3
  426. drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c +16 −4
  427. drivers/net/ethernet/stmicro/stmmac/stmmac.h +7 −7
  428. drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +94 −6
  429. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +108 −153
  430. drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +4 −4
  431. drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +7 −7
  432. drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c +0 −134
  433. drivers/net/ethernet/stmicro/stmmac/stmmac_timer.h +0 −46
  434. drivers/net/ethernet/sun/cassini.c +6 −7
  435. drivers/net/ethernet/sun/niu.c +56 −65
  436. drivers/net/ethernet/sun/sunbmac.c +5 −5
  437. drivers/net/ethernet/sun/sungem.c +3 −4
  438. drivers/net/ethernet/sun/sunhme.c +10 −10
  439. drivers/net/ethernet/sun/sunqe.c +6 −6
  440. drivers/net/ethernet/sun/sunvnet.c +7 −8
  441. drivers/net/ethernet/tehuti/tehuti.c +3 −3
  442. drivers/net/ethernet/ti/Kconfig +9 −0
  443. drivers/net/ethernet/ti/Makefile +1 −1
  444. drivers/net/ethernet/ti/cpmac.c +5 −5
  445. drivers/net/ethernet/ti/cpsw.c +466 −169
  446. drivers/net/ethernet/ti/cpsw_ale.c +28 −3
  447. drivers/net/ethernet/ti/cpsw_ale.h +1 −0
  448. drivers/net/ethernet/ti/cpts.c +427 −0
  449. drivers/net/ethernet/ti/cpts.h +146 −0
  450. drivers/net/ethernet/ti/davinci_emac.c +3 −3
  451. drivers/net/ethernet/ti/davinci_mdio.c +4 −4
  452. drivers/net/ethernet/ti/tlan.c +5 −6
  453. drivers/net/ethernet/toshiba/ps3_gelic_net.c +10 −12
  454. drivers/net/ethernet/toshiba/ps3_gelic_wireless.c +5 −5
  455. drivers/net/ethernet/toshiba/spider_net.c +3 −3
  456. drivers/net/ethernet/toshiba/tc35815.c +9 −9
  457. drivers/net/ethernet/via/via-rhine.c +6 −7
  458. drivers/net/ethernet/via/via-velocity.c +16 −12
  459. drivers/net/ethernet/wiznet/w5100.c +4 −6
  460. drivers/net/ethernet/wiznet/w5300.c +4 −6
  461. drivers/net/ethernet/xilinx/ll_temac_main.c +4 −4
  462. drivers/net/ethernet/xilinx/xilinx_axienet_main.c +4 −4
  463. drivers/net/ethernet/xilinx/xilinx_emaclite.c +4 −4
  464. drivers/net/ethernet/xscale/ixp4xx_eth.c +2 −2
  465. drivers/net/fddi/defxx.c +22 −24
  466. drivers/net/fddi/skfp/skfddi.c +2 −2
  467. drivers/net/hippi/rrunner.c +5 −6
  468. drivers/net/hyperv/rndis_filter.c +4 −6
  469. drivers/net/ieee802154/at86rf230.c +3 −3
  470. drivers/net/ieee802154/fakehard.c +3 −3
  471. drivers/net/ieee802154/fakelb.c +3 −3
  472. drivers/net/ieee802154/mrf24j40.c +3 −3
  473. drivers/net/irda/au1k_ir.c +4 −4
  474. drivers/net/irda/bfin_sir.c +4 −4
  475. drivers/net/irda/ep7211-sir.c +27 −46
  476. drivers/net/irda/sh_irda.c +3 −7
  477. drivers/net/irda/sh_sir.c +3 −3
  478. drivers/net/irda/smsc-ircc2.c +3 −3
  479. drivers/net/irda/via-ircc.c +7 −8
  480. drivers/net/irda/vlsi_ir.c +3 −3
  481. drivers/net/netconsole.c +6 −0
  482. drivers/net/phy/davicom.c +6 −0
  483. drivers/net/phy/dp83640.c +77 −1
  484. drivers/net/phy/mdio-gpio.c +7 −7
  485. drivers/net/phy/mdio-mux-gpio.c +3 −3
  486. drivers/net/phy/mdio-mux-mmioreg.c +3 −3
  487. drivers/net/phy/mdio-octeon.c +3 −3
  488. drivers/net/phy/mdio_bus.c +14 −0
  489. drivers/net/phy/micrel.c +44 −0
  490. drivers/net/phy/smsc.c +68 −27
  491. drivers/net/phy/spi_ks8995.c +3 −3
  492. drivers/net/ppp/ppp_generic.c +1 −1
  493. drivers/net/tun.c +640 −235
  494. drivers/net/usb/Kconfig +22 −0
  495. drivers/net/usb/Makefile +1 −0
  496. drivers/net/usb/asix_common.c +13 −104
  497. drivers/net/usb/asix_devices.c +16 −3
  498. drivers/net/usb/cdc_mbim.c +412 −0
  499. drivers/net/usb/cdc_ncm.c +293 −352
  500. drivers/net/usb/dm9601.c +15 −92
  501. drivers/net/usb/int51x1.c +3 −49
  502. drivers/net/usb/mcs7830.c +6 −79
  503. drivers/net/usb/net1080.c +30 −80
  504. drivers/net/usb/plusb.c +4 −7
  505. drivers/net/usb/sierra_net.c +18 −29
  506. drivers/net/usb/smsc75xx.c +1095 −311
  507. drivers/net/usb/smsc95xx.c +807 −281
  508. drivers/net/usb/smsc95xx.h +25 −0
  509. drivers/net/usb/usbnet.c +196 −0
  510. drivers/net/veth.c +2 −1
  511. drivers/net/virtio_net.c +546 −196
  512. drivers/net/vmxnet3/vmxnet3_drv.c +21 −21
  513. drivers/net/vxlan.c +257 −29
  514. drivers/net/wan/Makefile +2 −2
  515. drivers/net/wan/dscc4.c +3 −4
  516. drivers/net/wan/farsync.c +5 −5
  517. drivers/net/wan/hd64570.c +2 −3
  518. drivers/net/wan/hd64572.c +2 −3
  519. drivers/net/wan/ixp4xx_hss.c +2 −2
  520. drivers/net/wan/lmc/lmc_main.c +3 −4
  521. drivers/net/wan/pc300too.c +2 −2
  522. drivers/net/wan/pci200syn.c +2 −2
  523. drivers/net/wan/wanxl.c +2 −2
  524. drivers/net/wan/wanxlfw.S +1 −0
  525. drivers/net/wireless/adm8211.c +3 −3
  526. drivers/net/wireless/airo.c +4 −4
  527. drivers/net/wireless/at76c50x-usb.c +40 −45
  528. drivers/net/wireless/ath/Kconfig +6 −2
  529. drivers/net/wireless/ath/Makefile +1 −0
  530. drivers/net/wireless/ath/ar5523/Kconfig +8 −0
  531. drivers/net/wireless/ath/ar5523/Makefile +1 −0
  532. drivers/net/wireless/ath/ar5523/ar5523.c +1798 −0
  533. drivers/net/wireless/ath/ar5523/ar5523.h +152 −0
  534. drivers/net/wireless/ath/ar5523/ar5523_hw.h +431 −0
  535. drivers/net/wireless/ath/ath5k/Kconfig +1 −0
  536. drivers/net/wireless/ath/ath5k/ahb.c +1 −14
  537. drivers/net/wireless/ath/ath5k/base.c +11 −20
  538. drivers/net/wireless/ath/ath5k/led.c +1 −1
  539. drivers/net/wireless/ath/ath5k/mac80211-ops.c +4 −3
  540. drivers/net/wireless/ath/ath5k/pci.c +3 −3
  541. drivers/net/wireless/ath/ath5k/reset.c +3 −3
  542. drivers/net/wireless/ath/ath6kl/Kconfig +9 −0
  543. drivers/net/wireless/ath/ath6kl/Makefile +1 −0
  544. drivers/net/wireless/ath/ath6kl/cfg80211.c +264 −146
  545. drivers/net/wireless/ath/ath6kl/cfg80211.h +0 −1
  546. drivers/net/wireless/ath/ath6kl/core.c +21 −0
  547. drivers/net/wireless/ath/ath6kl/core.h +67 −2
  548. drivers/net/wireless/ath/ath6kl/debug.h +1 −0
  549. drivers/net/wireless/ath/ath6kl/hif.c +3 −9
  550. drivers/net/wireless/ath/ath6kl/htc_mbox.c +3 −10
  551. drivers/net/wireless/ath/ath6kl/htc_pipe.c +6 −8
  552. drivers/net/wireless/ath/ath6kl/init.c +78 −14
  553. drivers/net/wireless/ath/ath6kl/main.c +46 −9
  554. drivers/net/wireless/ath/ath6kl/recovery.c +160 −0
  555. drivers/net/wireless/ath/ath6kl/sdio.c +7 −20
  556. drivers/net/wireless/ath/ath6kl/txrx.c +33 −14
  557. drivers/net/wireless/ath/ath6kl/usb.c +26 −6
  558. drivers/net/wireless/ath/ath6kl/wmi.c +220 −64
  559. drivers/net/wireless/ath/ath6kl/wmi.h +69 −9
  560. drivers/net/wireless/ath/ath9k/Kconfig +1 −0
  561. drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h +86 −86
  562. drivers/net/wireless/ath/ath9k/ar9003_calib.c +81 −0
  563. drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +54 −32
  564. drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +3 −3
  565. drivers/net/wireless/ath/ath9k/ar9003_hw.c +17 −13
  566. drivers/net/wireless/ath/ath9k/ar9003_mci.c +64 −7
  567. drivers/net/wireless/ath/ath9k/ar9003_mci.h +7 −1
  568. drivers/net/wireless/ath/ath9k/ar9003_paprd.c +64 −23
  569. drivers/net/wireless/ath/ath9k/ar9003_phy.c +1 −1
  570. drivers/net/wireless/ath/ath9k/ar9003_phy.h +54 −22
  571. drivers/net/wireless/ath/ath9k/ar9340_initvals.h +4 −2
  572. drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h +1 −1
  573. drivers/net/wireless/ath/ath9k/ar9485_initvals.h +275 −63
  574. drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h +2 −2
  575. drivers/net/wireless/ath/ath9k/ath9k.h +29 −15
  576. drivers/net/wireless/ath/ath9k/beacon.c +1 −1
  577. drivers/net/wireless/ath/ath9k/btcoex.c +46 −17
  578. drivers/net/wireless/ath/ath9k/btcoex.h +8 −0
  579. drivers/net/wireless/ath/ath9k/calib.c +2 −0
  580. drivers/net/wireless/ath/ath9k/calib.h +3 −0
  581. drivers/net/wireless/ath/ath9k/common.h +0 −8
  582. drivers/net/wireless/ath/ath9k/debug.c +287 −152
  583. drivers/net/wireless/ath/ath9k/debug.h +32 −1
  584. drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c +9 −3
  585. drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h +2 −2
  586. drivers/net/wireless/ath/ath9k/eeprom.c +27 −2
  587. drivers/net/wireless/ath/ath9k/eeprom.h +1 −1
  588. drivers/net/wireless/ath/ath9k/eeprom_4k.c +2 −6
  589. drivers/net/wireless/ath/ath9k/eeprom_9287.c +2 −7
  590. drivers/net/wireless/ath/ath9k/eeprom_def.c +3 −7
  591. drivers/net/wireless/ath/ath9k/gpio.c +113 −23
  592. drivers/net/wireless/ath/ath9k/htc.h +2 −2
  593. drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +4 −4
  594. drivers/net/wireless/ath/ath9k/htc_drv_debug.c +4 −4
  595. drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +1 −1
  596. drivers/net/wireless/ath/ath9k/htc_drv_init.c +21 −4
  597. drivers/net/wireless/ath/ath9k/htc_drv_main.c +14 −30
  598. drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +14 −14
  599. drivers/net/wireless/ath/ath9k/hw.c +7 −8
  600. drivers/net/wireless/ath/ath9k/hw.h +8 −5
  601. drivers/net/wireless/ath/ath9k/init.c +61 −6
  602. drivers/net/wireless/ath/ath9k/link.c +27 −12
  603. drivers/net/wireless/ath/ath9k/main.c +38 −165
  604. drivers/net/wireless/ath/ath9k/mci.c +192 −19
  605. drivers/net/wireless/ath/ath9k/mci.h +36 −0
  606. drivers/net/wireless/ath/ath9k/pci.c +4 −23
  607. drivers/net/wireless/ath/ath9k/rc.c +31 −22
  608. drivers/net/wireless/ath/ath9k/rc.h +16 −0
  609. drivers/net/wireless/ath/ath9k/recv.c +5 −2
  610. drivers/net/wireless/ath/ath9k/reg.h +9 −4
  611. drivers/net/wireless/ath/ath9k/wow.c +1 −1
  612. drivers/net/wireless/ath/ath9k/xmit.c +11 −10
  613. drivers/net/wireless/ath/carl9170/Kconfig +1 −0
  614. drivers/net/wireless/ath/carl9170/fw.c +0 −5
  615. drivers/net/wireless/ath/carl9170/mac.c +18 −3
  616. drivers/net/wireless/ath/carl9170/rx.c +37 −16
  617. drivers/net/wireless/ath/carl9170/tx.c +7 −0
  618. drivers/net/wireless/ath/carl9170/usb.c +7 −0
  619. drivers/net/wireless/ath/hw.c +10 −10
  620. drivers/net/wireless/atmel_pci.c +3 −3
  621. drivers/net/wireless/b43/dma.c +5 −2
  622. drivers/net/wireless/b43/main.c +9 −5
  623. drivers/net/wireless/b43/pcmcia.c +3 −3
  624. drivers/net/wireless/b43/pio.c +2 −2
  625. drivers/net/wireless/b43/sdio.c +3 −3
  626. drivers/net/wireless/b43/xmit.c +1 −1
  627. drivers/net/wireless/b43legacy/b43legacy.h +5 −0
  628. drivers/net/wireless/b43legacy/main.c +31 −6
  629. drivers/net/wireless/b43legacy/xmit.c +1 −1
  630. drivers/net/wireless/brcm80211/Kconfig +9 −6
  631. drivers/net/wireless/brcm80211/brcmfmac/Makefile +2 −0
  632. drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +21 −37
  633. drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +94 −88
  634. drivers/net/wireless/brcm80211/brcmfmac/dhd.h +58 −198
  635. drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h +74 −24
  636. drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c +11 −115
  637. drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +166 −727
  638. drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c +4 −5
  639. drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h +27 −19
  640. drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +206 −510
  641. drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h +2 −13
  642. drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +293 −286
  643. drivers/net/wireless/brcm80211/brcmfmac/fweh.c +447 −0
  644. drivers/net/wireless/brcm80211/brcmfmac/fweh.h +215 −0
  645. drivers/net/wireless/brcm80211/brcmfmac/fwil.c +344 −0
  646. drivers/net/wireless/brcm80211/brcmfmac/fwil.h +39 −0
  647. drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c +7 −7
  648. drivers/net/wireless/brcm80211/brcmfmac/usb.c +175 −229
  649. drivers/net/wireless/brcm80211/brcmfmac/usb.h +5 −13
  650. drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +986 −1966
  651. drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h +103 −225
  652. drivers/net/wireless/brcm80211/brcmsmac/Makefile +2 −1
  653. drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +3 −3
  654. drivers/net/wireless/brcm80211/brcmsmac/ampdu.c +319 −404
  655. drivers/net/wireless/brcm80211/brcmsmac/ampdu.h +26 −3
  656. drivers/net/wireless/brcm80211/brcmsmac/antsel.c +3 −1
  657. drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h +169 −6
  658. drivers/net/wireless/brcm80211/brcmsmac/channel.c +5 −5
  659. drivers/net/wireless/brcm80211/brcmsmac/debug.c +156 −0
  660. drivers/net/wireless/brcm80211/brcmsmac/debug.h +75 −0
  661. drivers/net/wireless/brcm80211/brcmsmac/dma.c +227 −118
  662. drivers/net/wireless/brcm80211/brcmsmac/dma.h +7 −4
  663. drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +82 −75
  664. drivers/net/wireless/brcm80211/brcmsmac/main.c +394 −867
  665. drivers/net/wireless/brcm80211/brcmsmac/main.h +2 −46
  666. drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c +291 −180
  667. drivers/net/wireless/brcm80211/brcmsmac/phy/phytbl_lcn.c +32 −32
  668. drivers/net/wireless/brcm80211/brcmsmac/pub.h +3 −39
  669. drivers/net/wireless/brcm80211/brcmsmac/stf.c +5 −3
  670. drivers/net/wireless/brcm80211/brcmsmac/types.h +1 −2
  671. drivers/net/wireless/brcm80211/include/defs.h +8 −3
  672. drivers/net/wireless/hostap/hostap_80211_rx.c +1 −1
  673. drivers/net/wireless/ipw2x00/ipw2100.c +3 −6
  674. drivers/net/wireless/ipw2x00/ipw2200.c +28 −24
  675. drivers/net/wireless/ipw2x00/libipw.h +1 −1
  676. drivers/net/wireless/ipw2x00/libipw_geo.c +1 −2
  677. drivers/net/wireless/ipw2x00/libipw_rx.c +3 −3
  678. drivers/net/wireless/iwlegacy/3945-mac.c +2 −2
  679. drivers/net/wireless/iwlegacy/3945.c +1 −1
  680. drivers/net/wireless/iwlegacy/4965-mac.c +4 −4
  681. drivers/net/wireless/iwlegacy/common.h +2 −3
  682. drivers/net/wireless/iwlwifi/Kconfig +0 −9
  683. drivers/net/wireless/iwlwifi/dvm/agn.h +2 −2
  684. drivers/net/wireless/iwlwifi/dvm/calib.c +7 −7
  685. drivers/net/wireless/iwlwifi/dvm/commands.h +3 −4
  686. drivers/net/wireless/iwlwifi/dvm/debugfs.c +7 −7
  687. drivers/net/wireless/iwlwifi/dvm/dev.h +1 −2
  688. drivers/net/wireless/iwlwifi/dvm/devices.c +4 −4
  689. drivers/net/wireless/iwlwifi/dvm/lib.c +24 −25
  690. drivers/net/wireless/iwlwifi/dvm/mac80211.c +15 −13
  691. drivers/net/wireless/iwlwifi/dvm/main.c +37 −41
  692. drivers/net/wireless/iwlwifi/dvm/rs.c +22 −22
  693. drivers/net/wireless/iwlwifi/dvm/rx.c +2 −4
  694. drivers/net/wireless/iwlwifi/dvm/rxon.c +2 −2
  695. drivers/net/wireless/iwlwifi/dvm/scan.c +7 −6
  696. drivers/net/wireless/iwlwifi/dvm/sta.c +6 −6
  697. drivers/net/wireless/iwlwifi/dvm/tx.c +30 −46
  698. drivers/net/wireless/iwlwifi/dvm/ucode.c +7 −7
  699. drivers/net/wireless/iwlwifi/iwl-config.h +5 −5
  700. drivers/net/wireless/iwlwifi/iwl-devtrace.h +121 −8
  701. drivers/net/wireless/iwlwifi/iwl-drv.c +3 −3
  702. drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c +57 −29
  703. drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h +19 −26
  704. drivers/net/wireless/iwlwifi/iwl-fh.h +1 −1
  705. drivers/net/wireless/iwlwifi/iwl-io.c +22 −22
  706. drivers/net/wireless/iwlwifi/iwl-io.h +6 −6
  707. drivers/net/wireless/iwlwifi/iwl-prph.h +3 −0
  708. drivers/net/wireless/iwlwifi/iwl-trans.h +43 −14
  709. drivers/net/wireless/iwlwifi/pcie/1000.c +4 −4
  710. drivers/net/wireless/iwlwifi/pcie/2000.c +8 −8
  711. drivers/net/wireless/iwlwifi/pcie/5000.c +6 −6
  712. drivers/net/wireless/iwlwifi/pcie/6000.c +14 −14
  713. drivers/net/wireless/iwlwifi/pcie/drv.c +10 −6
  714. drivers/net/wireless/iwlwifi/pcie/internal.h +64 −53
  715. drivers/net/wireless/iwlwifi/pcie/rx.c +307 −106
  716. drivers/net/wireless/iwlwifi/pcie/trans.c +95 −969
  717. drivers/net/wireless/iwlwifi/pcie/tx.c +997 −262
  718. drivers/net/wireless/libertas/cfg.c +20 −13
  719. drivers/net/wireless/libertas/if_sdio.c +30 −9
  720. drivers/net/wireless/libertas/if_spi.c +3 −3
  721. drivers/net/wireless/libertas/mesh.c +1 −1
  722. drivers/net/wireless/mac80211_hwsim.c +473 −112
  723. drivers/net/wireless/mwifiex/11n_aggr.c +4 −4
  724. drivers/net/wireless/mwifiex/11n_rxreorder.c +3 −5
  725. drivers/net/wireless/mwifiex/Kconfig +0 −1
  726. drivers/net/wireless/mwifiex/cfg80211.c +55 −34
  727. drivers/net/wireless/mwifiex/cmdevt.c +15 −9
  728. drivers/net/wireless/mwifiex/debugfs.c +8 −2
  729. drivers/net/wireless/mwifiex/fw.h +2 −0
  730. drivers/net/wireless/mwifiex/init.c +28 −11
  731. drivers/net/wireless/mwifiex/join.c +2 −4
  732. drivers/net/wireless/mwifiex/main.c +41 −53
  733. drivers/net/wireless/mwifiex/main.h +8 −11
  734. drivers/net/wireless/mwifiex/scan.c +36 −19
  735. drivers/net/wireless/mwifiex/sdio.c +36 −3
  736. drivers/net/wireless/mwifiex/sdio.h +1 −0
  737. drivers/net/wireless/mwifiex/sta_cmdresp.c +0 −4
  738. drivers/net/wireless/mwifiex/sta_event.c +3 −7
  739. drivers/net/wireless/mwifiex/sta_ioctl.c +32 −17
  740. drivers/net/wireless/mwifiex/sta_rx.c +8 −18
  741. drivers/net/wireless/mwifiex/txrx.c +25 −13
  742. drivers/net/wireless/mwifiex/uap_cmd.c +10 −1
  743. drivers/net/wireless/mwifiex/uap_event.c +7 −0
  744. drivers/net/wireless/mwifiex/uap_txrx.c +5 −12
  745. drivers/net/wireless/mwifiex/usb.c +2 −2
  746. drivers/net/wireless/mwifiex/util.c +3 −16
  747. drivers/net/wireless/mwifiex/wmm.c +6 −6
  748. drivers/net/wireless/mwifiex/wmm.h +2 −0
  749. drivers/net/wireless/mwl8k.c +50 −21
  750. drivers/net/wireless/orinoco/cfg.c +5 −6
  751. drivers/net/wireless/orinoco/main.h +1 −1
  752. drivers/net/wireless/orinoco/orinoco_nortel.c +2 −2
  753. drivers/net/wireless/orinoco/orinoco_pci.c +2 −2
  754. drivers/net/wireless/orinoco/orinoco_plx.c +2 −2
  755. drivers/net/wireless/orinoco/orinoco_tmd.c +2 −2
  756. drivers/net/wireless/orinoco/orinoco_usb.c +4 −5
  757. drivers/net/wireless/p54/eeprom.c +3 −2
  758. drivers/net/wireless/p54/p54pci.c +6 −13
  759. drivers/net/wireless/p54/p54spi.c +3 −3
  760. drivers/net/wireless/p54/p54usb.c +3 −3
  761. drivers/net/wireless/p54/txrx.c +5 −1
  762. drivers/net/wireless/rndis_wlan.c +9 −3
  763. drivers/net/wireless/rt2x00/rt2400pci.c +1 −1
  764. drivers/net/wireless/rt2x00/rt2500pci.c +1 −1
  765. drivers/net/wireless/rt2x00/rt2800.h +4 −2
  766. drivers/net/wireless/rt2x00/rt2800lib.c +150 −95
  767. drivers/net/wireless/rt2x00/rt2800pci.c +2 −2
  768. drivers/net/wireless/rt2x00/rt2800usb.c +2 −0
  769. drivers/net/wireless/rt2x00/rt2x00dev.c +23 −13
  770. drivers/net/wireless/rt2x00/rt2x00mac.c +3 −3
  771. drivers/net/wireless/rt2x00/rt61pci.c +1 −1
  772. drivers/net/wireless/rtl818x/rtl8180/dev.c +4 −4
  773. drivers/net/wireless/rtl818x/rtl8187/dev.c +4 −4
  774. drivers/net/wireless/rtlwifi/Kconfig +11 −0
  775. drivers/net/wireless/rtlwifi/Makefile +3 −1
  776. drivers/net/wireless/rtlwifi/base.c +24 −0
  777. drivers/net/wireless/rtlwifi/base.h +2 −0
  778. drivers/net/wireless/rtlwifi/cam.c +3 −6
  779. drivers/net/wireless/rtlwifi/core.c +2 −3
  780. drivers/net/wireless/rtlwifi/debug.h +2 −0
  781. drivers/net/wireless/rtlwifi/pci.c +18 −6
  782. drivers/net/wireless/rtlwifi/pci.h +5 −1
  783. drivers/net/wireless/rtlwifi/rc.c +2 −1
  784. drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c +104 −123
  785. drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c +44 −44
  786. drivers/net/wireless/rtlwifi/rtl8192ce/def.h +3 −0
  787. drivers/net/wireless/rtlwifi/rtl8192ce/dm.c +12 −18
  788. drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +70 −23
  789. drivers/net/wireless/rtlwifi/rtl8192ce/phy.c +2 −0
  790. drivers/net/wireless/rtlwifi/rtl8192ce/rf.c +8 −15
  791. drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +3 −12
  792. drivers/net/wireless/rtlwifi/rtl8192ce/trx.c +20 −28
  793. drivers/net/wireless/rtlwifi/rtl8192cu/dm.c +12 −18
  794. drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +7 −9
  795. drivers/net/wireless/rtlwifi/rtl8192cu/mac.c +10 −15
  796. drivers/net/wireless/rtlwifi/rtl8192cu/rf.c +8 −14
  797. drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +1 −1
  798. drivers/net/wireless/rtlwifi/rtl8192de/dm.c +47 −48
  799. drivers/net/wireless/rtlwifi/rtl8192de/phy.c +23 −42
  800. drivers/net/wireless/rtlwifi/rtl8192de/rf.c +8 −10
  801. drivers/net/wireless/rtlwifi/rtl8192de/sw.c +2 −9
  802. drivers/net/wireless/rtlwifi/rtl8192de/trx.c +18 −23
  803. drivers/net/wireless/rtlwifi/rtl8192se/def.h +1 −2
  804. drivers/net/wireless/rtlwifi/rtl8192se/dm.c +46 −51
  805. drivers/net/wireless/rtlwifi/rtl8192se/hw.c +5 −4
  806. drivers/net/wireless/rtlwifi/rtl8192se/hw.h +1 −1
  807. drivers/net/wireless/rtlwifi/rtl8192se/phy.c +23 −41
  808. drivers/net/wireless/rtlwifi/rtl8192se/rf.c +4 −7
  809. drivers/net/wireless/rtlwifi/rtl8192se/sw.c +5 −15
  810. drivers/net/wireless/rtlwifi/rtl8192se/trx.c +11 −12
  811. drivers/net/wireless/rtlwifi/rtl8723ae/Makefile +22 −0
  812. drivers/net/wireless/rtlwifi/rtl8723ae/btc.h +41 −0
  813. drivers/net/wireless/rtlwifi/rtl8723ae/def.h +163 −0
  814. drivers/net/wireless/rtlwifi/rtl8723ae/dm.c +920 −0
  815. drivers/net/wireless/rtlwifi/rtl8723ae/dm.h +149 −0
  816. drivers/net/wireless/rtlwifi/rtl8723ae/fw.c +745 −0
  817. drivers/net/wireless/rtlwifi/rtl8723ae/fw.h +101 −0
  818. drivers/net/wireless/rtlwifi/rtl8723ae/hal_bt_coexist.c +542 −0
  819. drivers/net/wireless/rtlwifi/rtl8723ae/hal_bt_coexist.h +160 −0
  820. drivers/net/wireless/rtlwifi/rtl8723ae/hal_btc.c +1786 −0
  821. drivers/net/wireless/rtlwifi/rtl8723ae/hal_btc.h +151 −0
  822. drivers/net/wireless/rtlwifi/rtl8723ae/hw.c +2380 −0
  823. drivers/net/wireless/rtlwifi/rtl8723ae/hw.h +73 −0
  824. drivers/net/wireless/rtlwifi/rtl8723ae/led.c +151 −0
  825. drivers/net/wireless/rtlwifi/rtl8723ae/led.h +39 −0
  826. drivers/net/wireless/rtlwifi/rtl8723ae/phy.c +2044 −0
  827. drivers/net/wireless/rtlwifi/rtl8723ae/phy.h +224 −0
  828. drivers/net/wireless/rtlwifi/rtl8723ae/pwrseq.c +109 −0
  829. drivers/net/wireless/rtlwifi/rtl8723ae/pwrseq.h +322 −0
  830. drivers/net/wireless/rtlwifi/rtl8723ae/pwrseqcmd.c +129 −0
  831. drivers/net/wireless/rtlwifi/rtl8723ae/pwrseqcmd.h +98 −0
  832. drivers/net/wireless/rtlwifi/rtl8723ae/reg.h +2097 −0
  833. drivers/net/wireless/rtlwifi/rtl8723ae/rf.c +505 −0
  834. drivers/net/wireless/rtlwifi/rtl8723ae/rf.h +43 −0
  835. drivers/net/wireless/rtlwifi/rtl8723ae/sw.c +380 −0
  836. drivers/net/wireless/rtlwifi/rtl8723ae/sw.h +37 −0
  837. drivers/net/wireless/rtlwifi/rtl8723ae/table.c +738 −0
  838. drivers/net/wireless/rtlwifi/rtl8723ae/table.h +50 −0
  839. drivers/net/wireless/rtlwifi/rtl8723ae/trx.c +670 −0
  840. drivers/net/wireless/rtlwifi/rtl8723ae/trx.h +725 −0
  841. drivers/net/wireless/rtlwifi/stats.c +268 −0
  842. drivers/net/wireless/rtlwifi/stats.h +46 −0
  843. drivers/net/wireless/rtlwifi/usb.c +1 −1
  844. drivers/net/wireless/rtlwifi/usb.h +1 −1
  845. drivers/net/wireless/rtlwifi/wifi.h +129 −32
  846. drivers/net/wireless/ti/wl1251/main.c +3 −1
  847. drivers/net/wireless/ti/wl1251/rx.c +1 −1
  848. drivers/net/wireless/ti/wl1251/sdio.c +2 −2
  849. drivers/net/wireless/ti/wl1251/spi.c +3 −3
  850. drivers/net/wireless/ti/wl12xx/main.c +3 −3
  851. drivers/net/wireless/ti/wl18xx/main.c +3 −3
  852. drivers/net/wireless/ti/wlcore/cmd.c +3 −1
  853. drivers/net/wireless/ti/wlcore/main.c +8 −7
  854. drivers/net/wireless/ti/wlcore/sdio.c +4 −4
  855. drivers/net/wireless/ti/wlcore/spi.c +3 −3
  856. drivers/net/wireless/ti/wlcore/wlcore.h +2 −2
  857. drivers/net/xen-netfront.c +5 −5
  858. drivers/nfc/Makefile +1 −1
  859. drivers/nfc/pn533.c +10 −8
  860. drivers/nfc/pn544/Makefile +7 −0
  861. drivers/nfc/pn544/i2c.c +500 −0
  862. drivers/nfc/pn544/pn544.c +259 −420
  863. drivers/nfc/pn544/pn544.h +32 −0
  864. drivers/pps/Kconfig +0 −1
  865. drivers/ptp/Kconfig +8 −11
  866. drivers/ptp/ptp_chardev.c +56 −5
  867. drivers/s390/net/claw.c +0 −2
  868. drivers/s390/net/ctcm_main.c +0 −2
  869. drivers/s390/net/ctcm_mpc.c +0 −3
  870. drivers/s390/net/qeth_core.h +1 −0
  871. drivers/s390/net/qeth_core_main.c +28 −21
  872. drivers/s390/net/qeth_l2_main.c +2 −2
  873. drivers/s390/net/qeth_l3_main.c +4 −4
  874. drivers/ssb/b43_pci_bridge.c +1 −0
  875. drivers/ssb/driver_chipcommon.c +91 −9
  876. drivers/ssb/driver_chipcommon_pmu.c +30 −0
  877. drivers/ssb/driver_extif.c +22 −2
  878. drivers/ssb/driver_mipscore.c +16 −14
  879. drivers/ssb/embedded.c +35 −0
  880. drivers/ssb/main.c +9 −2
  881. drivers/ssb/ssb_private.h +31 −0
  882. drivers/vhost/net.c +134 −13
  883. drivers/vhost/tcm_vhost.c +5 −4
  884. drivers/vhost/vhost.c +10 −49
  885. drivers/vhost/vhost.h +5 −9
  886. fs/proc/proc_sysctl.c +5 −4
  887. include/linux/ath9k_platform.h +2 −0
  888. include/linux/atmdev.h +2 −0
  889. include/linux/bcm47xx_wdt.h +19 −0
  890. include/linux/bcma/bcma.h +6 −1
  891. include/linux/bcma/bcma_driver_chipcommon.h +10 −2
  892. include/linux/bcma/bcma_driver_mips.h +3 −0
  893. include/linux/bcma/bcma_regs.h +4 −1
  894. include/linux/etherdevice.h +20 −0
  895. include/linux/filter.h +3 −0
  896. include/linux/hdlc/Kbuild +0 −1
  897. include/linux/ieee80211.h +146 −42
  898. include/linux/if_tunnel.h +17 −0
  899. include/linux/inetdevice.h +3 −0
  900. include/linux/ip.h +5 −0
  901. include/linux/ipv6.h +23 −15
  902. include/linux/ktime.h +19 −0
  903. include/linux/micrel_phy.h +1 −0
  904. include/linux/netdevice.h +34 −10
  905. include/linux/netfilter_ipv6/ip6_tables.h +0 −9
  906. include/linux/nfc/pn544.h +0 −104
  907. include/linux/openvswitch.h +1 −0
  908. include/linux/pci.h +14 −0
  909. include/linux/platform_data/cpsw.h +4 −19
  910. include/linux/platform_data/macb.h +1 −0
  911. include/linux/platform_data/pn544.h +44 −0
  912. include/linux/rtnetlink.h +3 −0
  913. include/linux/skbuff.h +99 −3
  914. include/linux/smscphy.h +5 −0
  915. include/linux/ssb/ssb.h +2 −0
  916. include/linux/ssb/ssb_driver_chipcommon.h +3 −2
  917. include/linux/ssb/ssb_driver_extif.h +48 −4
  918. include/linux/ssb/ssb_driver_mips.h +7 −3
  919. include/linux/ssb/ssb_regs.h +1 −1
  920. include/linux/stmmac.h +1 −0
  921. include/linux/sysctl.h +1 −2
  922. include/linux/tcp.h +10 −0
  923. include/linux/timecompare.h +0 −125
  924. include/linux/udp.h +5 −0
  925. include/linux/usb/cdc_ncm.h +134 −0
  926. include/linux/usb/usbnet.h +10 −0
  927. include/net/addrconf.h +3 −0
  928. include/net/af_unix.h +0 −1
  929. include/net/bluetooth/a2mp.h +23 −1
  930. include/net/bluetooth/amp.h +54 −0
  931. include/net/bluetooth/bluetooth.h +0 −1
  932. include/net/bluetooth/hci.h +67 −2
  933. include/net/bluetooth/hci_core.h +96 −27
  934. include/net/bluetooth/l2cap.h +47 −3
  935. include/net/cfg80211.h +238 −68
  936. include/net/cls_cgroup.h +3 −3
  937. include/net/gro_cells.h +9 −5
  938. include/net/ieee80211_radiotap.h +24 −0
  939. include/net/inet_hashtables.h +26 −24
  940. include/net/inet_sock.h +5 −3
  941. include/net/inet_timewait_sock.h +5 −2
  942. include/net/ip6_checksum.h +35 −0
  943. include/net/ip6_fib.h +19 −1
  944. include/net/ip6_route.h +0 −3
  945. include/net/ip_vs.h +143 −52
  946. include/net/ipip.h +21 −19
  947. include/net/ipv6.h +19 −0
  948. include/net/mac80211.h +257 −18
  949. include/net/ndisc.h +0 −15
  950. include/net/net_namespace.h +16 −8
  951. include/net/netfilter/nf_conntrack.h +1 −1
  952. include/net/netfilter/nf_nat.h +15 −0
  953. include/net/netfilter/nf_queue.h +2 −6
  954. include/net/netns/sctp.h +3 −0
  955. include/net/nfc/hci.h +20 −1
  956. include/net/nfc/nfc.h +1 −1
  957. include/net/protocol.h +15 −16
  958. include/net/request_sock.h +8 −4
  959. include/net/route.h +6 −3
  960. include/net/rtnetlink.h +1 −1
  961. include/net/sch_generic.h +7 −0
  962. include/net/sctp/command.h +22 −16
  963. include/net/sctp/constants.h +0 −8
  964. include/net/sctp/sctp.h +12 −0
  965. include/net/sctp/sm.h +2 −0
  966. include/net/sctp/structs.h +39 −0
  967. include/net/sctp/ulpqueue.h +1 −1
  968. include/net/sctp/user.h +27 −0
  969. include/net/sock.h +23 −5
  970. include/net/tcp.h +0 −1
  971. include/uapi/asm-generic/socket.h +1 −0
  972. include/uapi/linux/Kbuild +1 −0
  973. include/uapi/linux/ethtool.h +7 −4
  974. include/uapi/linux/filter.h +3 −1
  975. include/uapi/linux/hdlc/Kbuild +1 −0
  976. include/uapi/linux/hdlc/ioctl.h +5 −2
  977. include/uapi/linux/if_bridge.h +81 −0
  978. include/uapi/linux/if_ether.h +1 −0
  979. include/uapi/linux/if_link.h +22 −0
  980. include/uapi/linux/if_packet.h +1 −0
  981. include/uapi/linux/if_tun.h +7 −0
  982. include/uapi/linux/if_tunnel.h +20 −0
  983. include/uapi/linux/in6.h +1 −0
  984. include/uapi/linux/inet_diag.h +2 −1
  985. include/uapi/linux/ipv6.h +1 −0
  986. include/uapi/linux/ipv6_route.h +3 −0
  987. include/uapi/linux/netconf.h +24 −0
  988. include/uapi/linux/netfilter/nfnetlink_conntrack.h +2 −0
  989. include/uapi/linux/netfilter_ipv6/ip6_tables.h +3 −0
  990. include/uapi/linux/nfc.h +15 −0
  991. include/uapi/linux/nl80211.h +159 −18
  992. include/uapi/linux/ptp_clock.h +14 −0
  993. include/uapi/linux/rtnetlink.h +26 −0
  994. include/uapi/linux/unix_diag.h +1 −0
  995. include/uapi/linux/usb/cdc.h +23 −0
  996. include/uapi/linux/virtio_net.h +27 −0
  997. kernel/nsproxy.c +1 −1
  998. kernel/time/Makefile +1 −1
  999. kernel/time/timecompare.c +0 −193
  1000. net/8021q/vlan.c +8 −7
  1001. net/8021q/vlan_dev.c +9 −3
  1002. net/atm/br2684.c +71 −20
  1003. net/atm/common.c +12 −0
  1004. net/atm/pppoatm.c +63 −5
  1005. net/batman-adv/Kconfig +11 −0
  1006. net/batman-adv/Makefile +1 −0
  1007. net/batman-adv/bat_iv_ogm.c +29 −22
  1008. net/batman-adv/bitarray.c +10 −13
  1009. net/batman-adv/bridge_loop_avoidance.c +70 −61
  1010. net/batman-adv/bridge_loop_avoidance.h +2 −4
  1011. net/batman-adv/debugfs.c +49 −11
  1012. net/batman-adv/distributed-arp-table.c +1066 −0
  1013. net/batman-adv/distributed-arp-table.h +167 −0
  1014. net/batman-adv/gateway_client.c +4 −15
  1015. net/batman-adv/hard-interface.c +47 −4
  1016. net/batman-adv/hash.h +22 −0
  1017. net/batman-adv/icmp_socket.c +10 −6
  1018. net/batman-adv/main.c +79 −10
  1019. net/batman-adv/main.h +28 −8
  1020. net/batman-adv/originator.c +5 −17
  1021. net/batman-adv/packet.h +69 −17
  1022. net/batman-adv/routing.c +194 −121
  1023. net/batman-adv/send.c +41 −2
  1024. net/batman-adv/send.h +3 −0
  1025. net/batman-adv/soft-interface.c +85 −9
  1026. net/batman-adv/sysfs.c +8 −50
  1027. net/batman-adv/translation-table.c +314 −212
  1028. net/batman-adv/translation-table.h +5 −3
  1029. net/batman-adv/types.h +89 −13
  1030. net/batman-adv/unicast.c +125 −18
  1031. net/batman-adv/unicast.h +35 −1
  1032. net/batman-adv/vis.c +14 −30
  1033. net/bluetooth/Kconfig +1 −1
  1034. net/bluetooth/Makefile +1 −1
  1035. net/bluetooth/a2mp.c +429 −30
  1036. net/bluetooth/af_bluetooth.c +4 −6
  1037. net/bluetooth/amp.c +471 −0
  1038. net/bluetooth/bnep/core.c +1 −2
  1039. net/bluetooth/bnep/netdev.c +0 −1
  1040. net/bluetooth/cmtp/capi.c +1 −1
  1041. net/bluetooth/cmtp/core.c +1 −1
  1042. net/bluetooth/cmtp/sock.c +1 −1
  1043. net/bluetooth/hci_conn.c +70 −6
  1044. net/bluetooth/hci_core.c +163 −70
  1045. net/bluetooth/hci_event.c +525 −37
  1046. net/bluetooth/hci_sysfs.c +5 −5
  1047. net/bluetooth/hidp/core.c +6 −2
  1048. net/bluetooth/l2cap_core.c +1284 −327
  1049. net/bluetooth/l2cap_sock.c +63 −31
  1050. net/bluetooth/lib.c +0 −14
  1051. net/bluetooth/mgmt.c +71 −34
  1052. net/bluetooth/rfcomm/core.c +9 −10
  1053. net/bluetooth/rfcomm/sock.c +6 −7
  1054. net/bluetooth/rfcomm/tty.c +3 −3
  1055. net/bluetooth/sco.c +80 −18
  1056. net/bluetooth/smp.c +1 −1
  1057. net/bridge/Makefile +1 −1
  1058. net/bridge/br_device.c +3 −1
  1059. net/bridge/br_input.c +1 −16
  1060. net/bridge/br_ioctl.c +13 −12
  1061. net/bridge/br_mdb.c +481 −0
  1062. net/bridge/br_multicast.c +52 −29
  1063. net/bridge/br_netlink.c +154 −95
  1064. net/bridge/br_private.h +40 −6
  1065. net/bridge/br_stp.c +21 −1
  1066. net/bridge/br_stp_bpdu.c +7 −0
  1067. net/bridge/br_sysfs_br.c +9 −13
  1068. net/bridge/br_sysfs_if.c +31 −16
  1069. net/caif/caif_usb.c +7 −11
  1070. net/caif/cfctrl.c +1 −2
  1071. net/can/gw.c +6 −0
  1072. net/core/dev.c +176 −60
  1073. net/core/ethtool.c +1 −1
  1074. net/core/filter.c +139 −0
  1075. net/core/flow.c +1 −3
  1076. net/core/neighbour.c +15 −5
  1077. net/core/net-sysfs.c +10 −7
  1078. net/core/net_namespace.c +12 −11
  1079. net/core/netpoll.c +4 −2
  1080. net/core/netprio_cgroup.c +1 −1
  1081. net/core/pktgen.c +14 −33
  1082. net/core/rtnetlink.c +224 −6
  1083. net/core/scm.c +3 −3
  1084. net/core/skbuff.c +31 −3
  1085. net/core/sock.c +74 −10
  1086. net/core/sysctl_net_core.c +5 −0
  1087. net/dcb/dcbnl.c +4 −4
  1088. net/dccp/minisocks.c +1 −2
  1089. net/decnet/dn_dev.c +6 −0
  1090. net/decnet/dn_fib.c +6 −0
  1091. net/dsa/Kconfig +8 −10
  1092. net/ieee802154/6lowpan.c +2 −1
  1093. net/ipv4/af_inet.c +64 −29
  1094. net/ipv4/arp.c +1 −1
  1095. net/ipv4/devinet.c +192 −6
  1096. net/ipv4/fib_frontend.c +1 −1
  1097. net/ipv4/fib_semantics.c +1 −1
  1098. net/ipv4/inet_connection_sock.c +18 −7
  1099. net/ipv4/inet_diag.c +4 −1
  1100. net/ipv4/inet_hashtables.c +23 −13
  1101. net/ipv4/ip_fragment.c +4 −0
  1102. net/ipv4/ip_gre.c +7 −25
  1103. net/ipv4/ip_options.c +3 −3
  1104. net/ipv4/ip_output.c +4 −0
  1105. net/ipv4/ip_sockglue.c +3 −2
  1106. net/ipv4/ip_vti.c +6 −20
  1107. net/ipv4/ipconfig.c +4 −2
  1108. net/ipv4/ipip.c +219 −52
  1109. net/ipv4/ipmr.c +121 −16
  1110. net/ipv4/netfilter/arp_tables.c +4 −4
  1111. net/ipv4/netfilter/ip_tables.c +4 −4
  1112. net/ipv4/netfilter/ipt_CLUSTERIP.c +7 −2
  1113. net/ipv4/netfilter/iptable_nat.c +5 −3
  1114. net/ipv4/protocol.c +21 −0
  1115. net/ipv4/route.c +25 −2
  1116. net/ipv4/syncookies.c +1 −1
  1117. net/ipv4/sysctl_net_ipv4.c +3 −0
  1118. net/ipv4/tcp.c +14 −11
  1119. net/ipv4/tcp_cong.c +2 −1
  1120. net/ipv4/tcp_input.c +26 −19
  1121. net/ipv4/tcp_ipv4.c +15 −23
  1122. net/ipv4/tcp_minisocks.c +4 −4
  1123. net/ipv4/tcp_output.c +5 −0
  1124. net/ipv4/tcp_timer.c +4 −4
  1125. net/ipv6/Makefile +4 −1
  1126. net/ipv6/addrconf.c +183 −20
  1127. net/ipv6/af_inet6.c +3 −242
  1128. net/ipv6/ah6.c +5 −5
  1129. net/ipv6/anycast.c +5 −2
  1130. net/ipv6/datagram.c +4 −4
  1131. net/ipv6/exthdrs.c +13 −57
  1132. net/ipv6/exthdrs_core.c +168 −0
  1133. net/ipv6/exthdrs_offload.c +41 −0
  1134. net/ipv6/fib6_rules.c +1 −1
  1135. net/ipv6/icmp.c +1 −1
  1136. net/ipv6/inet6_hashtables.c +19 −8
  1137. net/ipv6/ip6_fib.c +57 −0
  1138. net/ipv6/ip6_flowlabel.c +2 −1
  1139. net/ipv6/ip6_gre.c +7 −22
  1140. net/ipv6/ip6_offload.c +282 −0
  1141. net/ipv6/ip6_offload.h +18 −0
  1142. net/ipv6/ip6_output.c +3 −69
  1143. net/ipv6/ip6_tunnel.c +244 −44
  1144. net/ipv6/ip6mr.c +132 −25
  1145. net/ipv6/ipv6_sockglue.c +5 −4
  1146. net/ipv6/mcast.c +5 −2
  1147. net/ipv6/ndisc.c +25 −37
  1148. net/ipv6/netfilter/ip6_tables.c +6 −111
  1149. net/ipv6/netfilter/ip6t_rpfilter.c +1 −1
  1150. net/ipv6/netfilter/ip6table_nat.c +5 −3
  1151. net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +68 −2
  1152. net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +2 −2
  1153. net/ipv6/netfilter/nf_defrag_ipv6_hooks.c +3 −3
  1154. net/ipv6/netfilter/nf_nat_proto_icmpv6.c +1 −1
  1155. net/ipv6/output_core.c +76 −0
  1156. net/ipv6/protocol.c +25 −0
  1157. net/ipv6/raw.c +3 −3
  1158. net/ipv6/reassembly.c +4 −0
  1159. net/ipv6/route.c +163 −47
  1160. net/ipv6/sit.c +365 −94
  1161. net/ipv6/syncookies.c +1 −1
  1162. net/ipv6/tcp_ipv6.c +12 −112
  1163. net/ipv6/tcpv6_offload.c +95 −0
  1164. net/ipv6/udp.c +0 −94
  1165. net/ipv6/udp_offload.c +120 −0
  1166. net/ipv6/xfrm6_policy.c +3 −18
  1167. net/ipv6/xfrm6_state.c +2 −2
  1168. net/key/af_key.c +1 −1
  1169. net/l2tp/l2tp_netlink.c +1 −1
  1170. net/llc/af_llc.c +1 −1
  1171. net/mac80211/Kconfig +1 −1
  1172. net/mac80211/Makefile +1 −0
  1173. net/mac80211/aes_cmac.c +18 −0
  1174. net/mac80211/agg-rx.c +1 −1
  1175. net/mac80211/agg-tx.c +7 −7
  1176. net/mac80211/cfg.c +310 −189
  1177. net/mac80211/chan.c +295 −116
  1178. net/mac80211/debugfs.h +3 −3
  1179. net/mac80211/debugfs_key.c +20 −3
  1180. net/mac80211/debugfs_netdev.c +40 −38
  1181. net/mac80211/debugfs_sta.c +53 −6
  1182. net/mac80211/driver-ops.h +136 −4
  1183. net/mac80211/ht.c +2 −2
  1184. net/mac80211/ibss.c +90 −81
  1185. net/mac80211/ieee80211_i.h +167 −47
  1186. net/mac80211/iface.c +106 −37
  1187. net/mac80211/key.c +8 −7
  1188. net/mac80211/key.h +6 −5
  1189. net/mac80211/main.c +109 −41
  1190. net/mac80211/mesh.c +50 −32
  1191. net/mac80211/mesh.h +2 −16
  1192. net/mac80211/mesh_plink.c +33 −31
  1193. net/mac80211/mesh_sync.c +15 −90
  1194. net/mac80211/mlme.c +565 −170
  1195. net/mac80211/offchannel.c +13 −9
  1196. net/mac80211/pm.c +45 −1
  1197. net/mac80211/rate.c +2 −3
  1198. net/mac80211/rate.h +11 −1
  1199. net/mac80211/rc80211_minstrel.c +5 −4
  1200. net/mac80211/rc80211_minstrel_ht.c +3 −5
  1201. net/mac80211/rx.c +176 −74
  1202. net/mac80211/scan.c +37 −24
  1203. net/mac80211/sta_info.c +50 −19
  1204. net/mac80211/sta_info.h +18 −13
  1205. net/mac80211/status.c +87 −82
  1206. net/mac80211/trace.h +208 −38
  1207. net/mac80211/tx.c +174 −117
  1208. net/mac80211/util.c +250 −113
  1209. net/mac80211/vht.c +35 −0
  1210. net/mac80211/wme.c +23 −17
  1211. net/mac80211/wpa.c +4 −1
  1212. net/mac802154/tx.c +5 −2
  1213. net/mac802154/wpan.c +3 −1
  1214. net/netfilter/core.c +0 −2
  1215. net/netfilter/ipset/ip_set_core.c +161 −84
  1216. net/netfilter/ipvs/Kconfig +3 −4
  1217. net/netfilter/ipvs/ip_vs_conn.c +6 −9
  1218. net/netfilter/ipvs/ip_vs_core.c +228 −176
  1219. net/netfilter/ipvs/ip_vs_ctl.c +6 −2
  1220. net/netfilter/ipvs/ip_vs_dh.c +1 −1
  1221. net/netfilter/ipvs/ip_vs_lblc.c +6 −1
  1222. net/netfilter/ipvs/ip_vs_lblcr.c +5 −1
  1223. net/netfilter/ipvs/ip_vs_nfct.c +1 −1
  1224. net/netfilter/ipvs/ip_vs_pe_sip.c +13 −5
  1225. net/netfilter/ipvs/ip_vs_proto.c +3 −3
  1226. net/netfilter/ipvs/ip_vs_proto_ah_esp.c +4 −5
  1227. net/netfilter/ipvs/ip_vs_proto_sctp.c +18 −24
  1228. net/netfilter/ipvs/ip_vs_proto_tcp.c +17 −23
  1229. net/netfilter/ipvs/ip_vs_proto_udp.c +18 −23
  1230. net/netfilter/ipvs/ip_vs_sched.c +1 −1
  1231. net/netfilter/ipvs/ip_vs_sh.c +1 −1
  1232. net/netfilter/ipvs/ip_vs_xmit.c +46 −35
  1233. net/netfilter/nf_conntrack_acct.c +4 −0
  1234. net/netfilter/nf_conntrack_core.c +13 −18
  1235. net/netfilter/nf_conntrack_ecache.c +4 −0
  1236. net/netfilter/nf_conntrack_helper.c +4 −0
  1237. net/netfilter/nf_conntrack_netlink.c +115 −3
  1238. net/netfilter/nf_conntrack_proto_dccp.c +6 −2
  1239. net/netfilter/nf_conntrack_proto_tcp.c +2 −0
  1240. net/netfilter/nf_conntrack_standalone.c +4 −0
  1241. net/netfilter/nf_conntrack_timestamp.c +4 −0
  1242. net/netfilter/nf_queue.c +13 −139
  1243. net/netfilter/nfnetlink.c +1 −1
  1244. net/netfilter/nfnetlink_queue_core.c +5 −9
  1245. net/netfilter/xt_HMARK.c +4 −4
  1246. net/netfilter/xt_ipvs.c +2 −2
  1247. net/netlink/af_netlink.c +1 −1
  1248. net/nfc/Kconfig +2 −2
  1249. net/nfc/core.c +25 −8
  1250. net/nfc/hci/command.c +12 −16
  1251. net/nfc/hci/core.c +73 −17
  1252. net/nfc/hci/llc.c +1 −1
  1253. net/nfc/hci/llc_shdlc.c +3 −4
  1254. net/nfc/llcp/Kconfig +2 −2
  1255. net/nfc/llcp/commands.c +127 −21
  1256. net/nfc/llcp/llcp.c +219 −29
  1257. net/nfc/llcp/llcp.h +13 −0
  1258. net/nfc/llcp/sock.c +39 −3
  1259. net/nfc/nci/Kconfig +2 −2
  1260. net/nfc/nci/core.c +13 −16
  1261. net/nfc/netlink.c +155 −2
  1262. net/nfc/nfc.h +6 −0
  1263. net/nfc/rawsock.c +0 −1
  1264. net/openvswitch/actions.c +97 −0
  1265. net/openvswitch/datapath.c +25 −2
  1266. net/openvswitch/flow.c +24 −4
  1267. net/openvswitch/flow.h +5 −3
  1268. net/openvswitch/vport-netdev.c +10 −4
  1269. net/openvswitch/vport-netdev.h +3 −0
  1270. net/openvswitch/vport.c +2 −3
  1271. net/packet/af_packet.c +46 −4
  1272. net/packet/internal.h +1 −0
  1273. net/phonet/pn_netlink.c +6 −0
  1274. net/rds/ib.h +1 −1
  1275. net/rds/ib_recv.c +13 −11
  1276. net/rfkill/rfkill-gpio.c +1 −1
  1277. net/rfkill/rfkill-regulator.c +3 −3
  1278. net/sched/Kconfig +1 −1
  1279. net/sched/act_api.c +3 −0
  1280. net/sched/cls_api.c +2 −0
  1281. net/sched/cls_cgroup.c +24 −0
  1282. net/sched/sch_api.c +15 −5
  1283. net/sched/sch_cbq.c +1 −2
  1284. net/sched/sch_generic.c +6 −5
  1285. net/sched/sch_htb.c +92 −47
  1286. net/sched/sch_mq.c +3 −1
  1287. net/sched/sch_mqprio.c +4 −0
  1288. net/sched/sch_qfq.c +566 −264
  1289. net/sctp/Kconfig +13 −26
  1290. net/sctp/associola.c +12 −4
  1291. net/sctp/endpointola.c +4 −1
  1292. net/sctp/inqueue.c +2 −0
  1293. net/sctp/ipv6.c +1 −1
  1294. net/sctp/output.c +9 −5
  1295. net/sctp/outqueue.c +10 −2
  1296. net/sctp/proc.c +18 −3
  1297. net/sctp/protocol.c +12 −3
  1298. net/sctp/sm_make_chunk.c +22 −2
  1299. net/sctp/sm_sideeffect.c +31 −24
  1300. net/sctp/sm_statefuns.c +16 −4
  1301. net/sctp/socket.c +81 −7
  1302. net/sctp/sysctl.c +59 −0
  1303. net/sctp/transport.c +15 −5
  1304. net/sctp/tsnmap.c +2 −6
  1305. net/sctp/ulpqueue.c +1 −2
  1306. net/socket.c +0 −8
  1307. net/sysctl_net.c +12 −3
  1308. net/tipc/Kconfig +1 −12
  1309. net/tipc/bcast.c +12 −15
  1310. net/tipc/bearer.c +11 −99
  1311. net/tipc/bearer.h +3 −21
  1312. net/tipc/core.c +0 −5
  1313. net/tipc/discover.c +1 −1
  1314. net/tipc/link.c +99 −133
  1315. net/tipc/link.h +0 −4
  1316. net/tipc/name_distr.c +1 −1
  1317. net/tipc/node.c +6 −9
  1318. net/tipc/node.h +2 −4
  1319. net/tipc/port.c +23 −9
  1320. net/tipc/port.h +4 −2
  1321. net/tipc/socket.c +246 −165
  1322. net/tipc/subscr.c +1 −1
  1323. net/unix/diag.c +3 −0
  1324. net/unix/sysctl_net_unix.c +4 −0
  1325. net/wireless/Kconfig +2 −3
  1326. net/wireless/Makefile +3 −1
  1327. net/wireless/ap.c +3 −1
  1328. net/wireless/chan.c +263 −50
  1329. net/wireless/core.c +16 −7
  1330. net/wireless/core.h +16 −16
  1331. net/wireless/ethtool.c +7 −8
  1332. net/wireless/ibss.c +21 −15
  1333. net/wireless/mesh.c +24 −35
  1334. net/wireless/mlme.c +75 −41
  1335. net/wireless/nl80211.c +583 −285
  1336. net/wireless/nl80211.h +3 −5
  1337. net/wireless/rdev-ops.h +878 −0
  1338. net/wireless/reg.c +1 −1
  1339. net/wireless/reg.h +1 −1
  1340. net/wireless/scan.c +349 −266
  1341. net/wireless/sme.c +18 −7
  1342. net/wireless/sysfs.c +3 −2
  1343. net/wireless/trace.c +7 −0
  1344. net/wireless/trace.h +2324 −0
  1345. net/wireless/util.c +186 −11
  1346. net/wireless/wext-compat.c +41 −35
  1347. net/wireless/wext-sme.c +16 −3
  1348. net/xfrm/xfrm_ipcomp.c +3 −5
  1349. net/xfrm/xfrm_replay.c +6 −7
  1350. net/xfrm/xfrm_sysctl.c +4 −0
  1351. net/xfrm/xfrm_user.c +1 −1
  1352. security/selinux/nlmsgtab.c +3 −0
  1353. tools/virtio/virtio_test.c +1 −1
Documentation/ABI/testing/sysfs-bus-mdio+9−0
@@ -0,0 +1,9 @@
1+What: /sys/bus/mdio_bus/devices/.../phy_id
2+Date: November 2012
3+KernelVersion: 3.8
4+Contact: netdev@vger.kernel.org
5+Description:
6+ This attribute contains the 32-bit PHY Identifier as reported
7+ by the device during bus enumeration, encoded in hexadecimal.
8+ This ID is used to match the device with the appropriate
9+ driver.
Documentation/ABI/testing/sysfs-class-net-batman-adv+6−5
@@ -1,4 +1,10 @@
11
2+What: /sys/class/net/<iface>/batman-adv/iface_status
3+Date: May 2010
4+Contact: Marek Lindner <lindner_marek@yahoo.de>
5+Description:
6+ Indicates the status of <iface> as it is seen by batman.
7+
28 What: /sys/class/net/<iface>/batman-adv/mesh_iface
39 Date: May 2010
410 Contact: Marek Lindner <lindner_marek@yahoo.de>
@@ -7,8 +13,3 @@ Description: · 2 unmodified lines
713 displays the batman mesh interface this <iface>
814 currently is associated with.
915
10−What: /sys/class/net/<iface>/batman-adv/iface_status
11−Date: May 2010
12−Contact: Marek Lindner <lindner_marek@yahoo.de>
13−Description:
14− Indicates the status of <iface> as it is seen by batman.
Documentation/ABI/testing/sysfs-class-net-grcan+35−0
@@ -0,0 +1,35 @@
1+
2+What: /sys/class/net/<iface>/grcan/enable0
3+Date: October 2012
4+KernelVersion: 3.8
5+Contact: Andreas Larsson <andreas@gaisler.com>
6+Description:
7+ Hardware configuration of physical interface 0. This file reads
8+ and writes the "Enable 0" bit of the configuration register.
9+ Possible values: 0 or 1. See the GRCAN chapter of the GRLIB IP
10+ core library documentation for details. The default value is 0
11+ or set by the module parameter grcan.enable0 and can be read at
12+ /sys/module/grcan/parameters/enable0.
13+
14+What: /sys/class/net/<iface>/grcan/enable1
15+Date: October 2012
16+KernelVersion: 3.8
17+Contact: Andreas Larsson <andreas@gaisler.com>
18+Description:
19+ Hardware configuration of physical interface 1. This file reads
20+ and writes the "Enable 1" bit of the configuration register.
21+ Possible values: 0 or 1. See the GRCAN chapter of the GRLIB IP
22+ core library documentation for details. The default value is 0
23+ or set by the module parameter grcan.enable1 and can be read at
24+ /sys/module/grcan/parameters/enable1.
25+
26+What: /sys/class/net/<iface>/grcan/select
27+Date: October 2012
28+KernelVersion: 3.8
29+Contact: Andreas Larsson <andreas@gaisler.com>
30+Description:
31+ Configuration of which physical interface to be used. Possible
32+ values: 0 or 1. See the GRCAN chapter of the GRLIB IP core
33+ library documentation for details. The default value is 0 or is
34+ set by the module parameter grcan.select and can be read at
35+ /sys/module/grcan/parameters/select.
Documentation/ABI/testing/sysfs-class-net-mesh+20−20
@@ -6,6 +6,14 @@ Description: · 5 unmodified lines
66 Indicates whether the batman protocol messages of the
77 mesh <mesh_iface> shall be aggregated or not.
88
9+What: /sys/class/net/<mesh_iface>/mesh/ap_isolation
10+Date: May 2011
11+Contact: Antonio Quartulli <ordex@autistici.org>
12+Description:
13+ Indicates whether the data traffic going from a
14+ wireless client to another wireless client will be
15+ silently dropped.
16+
917 What: /sys/class/net/<mesh_iface>/mesh/bonding
1018 Date: June 2010
1119 Contact: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
@@ -31,14 +39,6 @@ Description: · 19 unmodified lines
3139 mesh will be fragmented or silently discarded if the
3240 packet size exceeds the outgoing interface MTU.
3341
34−What: /sys/class/net/<mesh_iface>/mesh/ap_isolation
35−Date: May 2011
36−Contact: Antonio Quartulli <ordex@autistici.org>
37−Description:
38− Indicates whether the data traffic going from a
39− wireless client to another wireless client will be
40− silently dropped.
41−
4242 What: /sys/class/net/<mesh_iface>/mesh/gw_bandwidth
4343 Date: October 2010
4444 Contact: Marek Lindner <lindner_marek@yahoo.de>
@@ -60,6 +60,13 @@ Description: · 15 unmodified lines
6060 Defines the selection criteria this node will use
6161 to choose a gateway if gw_mode was set to 'client'.
6262
63+What: /sys/class/net/<mesh_iface>/mesh/hop_penalty
64+Date: Oct 2010
65+Contact: Linus Lüssing <linus.luessing@web.de>
66+Description:
67+ Defines the penalty which will be applied to an
68+ originator message's tq-field on every hop.
69+
6370 What: /sys/class/net/<mesh_iface>/mesh/orig_interval
6471 Date: May 2010
6572 Contact: Marek Lindner <lindner_marek@yahoo.de>
@@ -67,19 +74,12 @@ Description: · 1 unmodified line
6774 Defines the interval in milliseconds in which batman
6875 sends its protocol messages.
6976
70−What: /sys/class/net/<mesh_iface>/mesh/hop_penalty
71−Date: Oct 2010
72−Contact: Linus Lüssing <linus.luessing@web.de>
73−Description:
74− Defines the penalty which will be applied to an
75− originator message's tq-field on every hop.
76−
77−What: /sys/class/net/<mesh_iface>/mesh/routing_algo
78−Date: Dec 2011
79−Contact: Marek Lindner <lindner_marek@yahoo.de>
77+What: /sys/class/net/<mesh_iface>/mesh/routing_algo
78+Date: Dec 2011
79+Contact: Marek Lindner <lindner_marek@yahoo.de>
8080 Description:
81− Defines the routing procotol this mesh instance
82− uses to find the optimal paths through the mesh.
81+ Defines the routing procotol this mesh instance
82+ uses to find the optimal paths through the mesh.
8383
8484 What: /sys/class/net/<mesh_iface>/mesh/vis_mode
8585 Date: May 2010
Documentation/devicetree/bindings/net/can/grcan.txt+28−0
@@ -0,0 +1,28 @@
1+Aeroflex Gaisler GRCAN and GRHCAN CAN controllers.
2+
3+The GRCAN and CRHCAN CAN controllers are available in the GRLIB VHDL IP core
4+library.
5+
6+Note: These properties are built from the AMBA plug&play in a Leon SPARC system
7+(the ordinary environment for GRCAN and GRHCAN). There are no dts files for
8+sparc.
9+
10+Required properties:
11+
12+- name : Should be "GAISLER_GRCAN", "01_03d", "GAISLER_GRHCAN" or "01_034"
13+
14+- reg : Address and length of the register set for the device
15+
16+- freq : Frequency of the external oscillator clock in Hz (the frequency of
17+ the amba bus in the ordinary case)
18+
19+- interrupts : Interrupt number for this device
20+
21+Optional properties:
22+
23+- systemid : If not present or if the value of the least significant 16 bits
24+ of this 32-bit property is smaller than GRCAN_TXBUG_SAFE_GRLIB_VERSION
25+ a bug workaround is activated.
26+
27+For further information look in the documentation for the GLIB IP core library:
28+http://www.gaisler.com/products/grlib/grip.pdf
Documentation/devicetree/bindings/net/cdns-emac.txt+23−0
@@ -0,0 +1,23 @@
1+* Cadence EMAC Ethernet controller
2+
3+Required properties:
4+- compatible: Should be "cdns,[<chip>-]{emac}"
5+ Use "cdns,at91rm9200-emac" Atmel at91rm9200 SoC.
6+ or the generic form: "cdns,emac".
7+- reg: Address and length of the register set for the device
8+- interrupts: Should contain macb interrupt
9+- phy-mode: String, operation mode of the PHY interface.
10+ Supported values are: "mii", "rmii".
11+
12+Optional properties:
13+- local-mac-address: 6 bytes, mac address
14+
15+Examples:
16+
17+ macb0: ethernet@fffc4000 {
18+ compatible = "cdns,at91rm9200-emac";
19+ reg = <0xfffc4000 0x4000>;
20+ interrupts = <21>;
21+ phy-mode = "rmii";
22+ local-mac-address = [3a 0e 03 04 05 06];
23+ };
Documentation/devicetree/bindings/net/cpsw.txt+13−35
@@ -9,21 +9,15 @@ Required properties: · 8 unmodified lines
99 number
1010 - interrupt-parent : The parent interrupt controller
1111 - cpdma_channels : Specifies number of channels in CPDMA
12−- host_port_no : Specifies host port shift
13−- cpdma_reg_ofs : Specifies CPDMA submodule register offset
14−- cpdma_sram_ofs : Specifies CPDMA SRAM offset
15−- ale_reg_ofs : Specifies ALE submodule register offset
1612 - ale_entries : Specifies No of entries ALE can hold
17−- host_port_reg_ofs : Specifies host port register offset
18−- hw_stats_reg_ofs : Specifies hardware statistics register offset
19−- bd_ram_ofs : Specifies internal desciptor RAM offset
2013 - bd_ram_size : Specifies internal descriptor RAM size
2114 - rx_descs : Specifies number of Rx descriptors
2215 - mac_control : Specifies Default MAC control register content
2316 for the specific platform
2417 - slaves : Specifies number for slaves
25−- slave_reg_ofs : Specifies slave register offset
26−- sliver_reg_ofs : Specifies slave sliver register offset
18+- cpts_active_slave : Specifies the slave to use for time stamping
19+- cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds
20+- cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds
2721 - phy_id : Specifies slave phy id
2822 - mac-address : Specifies slave MAC address
2923
@@ -45,30 +39,22 @@ Examples: · 15 unmodified lines
4539 interrupts = <55 0x4>;
4640 interrupt-parent = <&intc>;
4741 cpdma_channels = <8>;
48− host_port_no = <0>;
49− cpdma_reg_ofs = <0x800>;
50− cpdma_sram_ofs = <0xa00>;
51− ale_reg_ofs = <0xd00>;
5242 ale_entries = <1024>;
53− host_port_reg_ofs = <0x108>;
54− hw_stats_reg_ofs = <0x900>;
55− bd_ram_ofs = <0x2000>;
5643 bd_ram_size = <0x2000>;
5744 no_bd_ram = <0>;
5845 rx_descs = <64>;
5946 mac_control = <0x20>;
6047 slaves = <2>;
48+ cpts_active_slave = <0>;
49+ cpts_clock_mult = <0x80000000>;
50+ cpts_clock_shift = <29>;
6151 cpsw_emac0: slave@0 {
62− slave_reg_ofs = <0x208>;
63− sliver_reg_ofs = <0xd80>;
64− phy_id = "davinci_mdio.16:00";
52+ phy_id = <&davinci_mdio>, <0>;
6553 /* Filled in by U-Boot */
6654 mac-address = [ 00 00 00 00 00 00 ];
6755 };
6856 cpsw_emac1: slave@1 {
69− slave_reg_ofs = <0x308>;
70− sliver_reg_ofs = <0xdc0>;
71− phy_id = "davinci_mdio.16:01";
57+ phy_id = <&davinci_mdio>, <1>;
7258 /* Filled in by U-Boot */
7359 mac-address = [ 00 00 00 00 00 00 ];
7460 };
@@ -79,30 +65,22 @@ Examples: · 4 unmodified lines
7965 compatible = "ti,cpsw";
8066 ti,hwmods = "cpgmac0";
8167 cpdma_channels = <8>;
82− host_port_no = <0>;
83− cpdma_reg_ofs = <0x800>;
84− cpdma_sram_ofs = <0xa00>;
85− ale_reg_ofs = <0xd00>;
8668 ale_entries = <1024>;
87− host_port_reg_ofs = <0x108>;
88− hw_stats_reg_ofs = <0x900>;
89− bd_ram_ofs = <0x2000>;
9069 bd_ram_size = <0x2000>;
9170 no_bd_ram = <0>;
9271 rx_descs = <64>;
9372 mac_control = <0x20>;
9473 slaves = <2>;
74+ cpts_active_slave = <0>;
75+ cpts_clock_mult = <0x80000000>;
76+ cpts_clock_shift = <29>;
9577 cpsw_emac0: slave@0 {
96− slave_reg_ofs = <0x208>;
97− sliver_reg_ofs = <0xd80>;
98− phy_id = "davinci_mdio.16:00";
78+ phy_id = <&davinci_mdio>, <0>;
9979 /* Filled in by U-Boot */
10080 mac-address = [ 00 00 00 00 00 00 ];
10181 };
10282 cpsw_emac1: slave@1 {
103− slave_reg_ofs = <0x308>;
104− sliver_reg_ofs = <0xdc0>;
105− phy_id = "davinci_mdio.16:01";
83+ phy_id = <&davinci_mdio>, <1>;
10684 /* Filled in by U-Boot */
10785 mac-address = [ 00 00 00 00 00 00 ];
10886 };
Documentation/kernel-parameters.txt+18−0
@@ -905,6 +905,24 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 904 unmodified lines
905905 gpt [EFI] Forces disk with valid GPT signature but
906906 invalid Protective MBR to be treated as GPT.
907907
908+ grcan.enable0= [HW] Configuration of physical interface 0. Determines
909+ the "Enable 0" bit of the configuration register.
910+ Format: 0 | 1
911+ Default: 0
912+ grcan.enable1= [HW] Configuration of physical interface 1. Determines
913+ the "Enable 0" bit of the configuration register.
914+ Format: 0 | 1
915+ Default: 0
916+ grcan.select= [HW] Select which physical interface to use.
917+ Format: 0 | 1
918+ Default: 0
919+ grcan.txsize= [HW] Sets the size of the tx buffer.
920+ Format: <unsigned int> such that (txsize & ~0x1fffc0) == 0.
921+ Default: 1024
922+ grcan.rxsize= [HW] Sets the size of the rx buffer.
923+ Format: <unsigned int> such that (rxsize & ~0x1fffc0) == 0.
924+ Default: 1024
925+
908926 hashdist= [KNL,NUMA] Large hashes allocated during boot
909927 are distributed across NUMA nodes. Defaults on
910928 for 64-bit NUMA, off otherwise.
Documentation/networking/batman-adv.txt+2−1
@@ -203,7 +203,8 @@ abled during run time. Following log_levels are defined: · 202 unmodified lines
203203 2 - Enable messages related to route added / changed / deleted
204204 4 - Enable messages related to translation table operations
205205 8 - Enable messages related to bridge loop avoidance
206−15 - enable all messages
206+16 - Enable messaged related to DAT, ARP snooping and parsing
207+31 - Enable all messages
207208
208209 The debug output can be changed at runtime using the file
209210 /sys/class/net/bat0/mesh/log_level. e.g.
Documentation/networking/ip-sysctl.txt+39−17
@@ -30,16 +30,24 @@ neigh/default/gc_thresh3 - INTEGER · 29 unmodified lines
3030 Maximum number of neighbor entries allowed. Increase this
3131 when using large numbers of interfaces and when communicating
3232 with large numbers of directly-connected peers.
33+ Default: 1024
3334
3435 neigh/default/unres_qlen_bytes - INTEGER
3536 The maximum number of bytes which may be used by packets
3637 queued for each unresolved address by other network layers.
3738 (added in linux 3.3)
39+ Seting negative value is meaningless and will retrun error.
40+ Default: 65536 Bytes(64KB)
3841
3942 neigh/default/unres_qlen - INTEGER
4043 The maximum number of packets which may be queued for each
4144 unresolved address by other network layers.
4245 (deprecated in linux 3.3) : use unres_qlen_bytes instead.
46+ Prior to linux 3.3, the default value is 3 which may cause
47+ unexpected packet loss. The current default value is calculated
48+ according to default value of unres_qlen_bytes and true size of
49+ packet.
50+ Default: 31
4351
4452 mtu_expires - INTEGER
4553 Time, in seconds, that cached PMTU information is kept.
@@ -199,15 +207,16 @@ tcp_early_retrans - INTEGER · 153 unmodified lines
199207 Default: 2
200208
201209 tcp_ecn - INTEGER
202− Enable Explicit Congestion Notification (ECN) in TCP. ECN is only
203− used when both ends of the TCP flow support it. It is useful to
204− avoid losses due to congestion (when the bottleneck router supports
205− ECN).
210+ Control use of Explicit Congestion Notification (ECN) by TCP.
211+ ECN is used only when both ends of the TCP connection indicate
212+ support for it. This feature is useful in avoiding losses due
213+ to congestion by allowing supporting routers to signal
214+ congestion before having to drop packets.
206215 Possible values are:
207− 0 disable ECN
208− 1 ECN enabled
209− 2 Only server-side ECN enabled. If the other end does
210− not support ECN, behavior is like with ECN disabled.
216+ 0 Disable ECN. Neither initiate nor accept ECN.
217+ 1 Always request ECN on outgoing connection attempts.
218+ 2 Enable ECN when requested by incomming connections
219+ but do not request ECN on outgoing connections.
211220 Default: 2
212221
213222 tcp_fack - BOOLEAN
@@ -215,15 +224,14 @@ tcp_fack - BOOLEAN · 1 unmodified line
215224 The value is not used, if tcp_sack is not enabled.
216225
217226 tcp_fin_timeout - INTEGER
218− Time to hold socket in state FIN-WAIT-2, if it was closed
219− by our side. Peer can be broken and never close its side,
220− or even died unexpectedly. Default value is 60sec.
221− Usual value used in 2.2 was 180 seconds, you may restore
222− it, but remember that if your machine is even underloaded WEB server,
223− you risk to overflow memory with kilotons of dead sockets,
224− FIN-WAIT-2 sockets are less dangerous than FIN-WAIT-1,
225− because they eat maximum 1.5K of memory, but they tend
226− to live longer. Cf. tcp_max_orphans.
227+ The length of time an orphaned (no longer referenced by any
228+ application) connection will remain in the FIN_WAIT_2 state
229+ before it is aborted at the local end. While a perfectly
230+ valid "receive only" state for an un-orphaned connection, an
231+ orphaned connection in FIN_WAIT_2 state could otherwise wait
232+ forever for the remote to close its end of the connection.
233+ Cf. tcp_max_orphans
234+ Default: 60 seconds
227235
228236 tcp_frto - INTEGER
229237 Enables Forward RTO-Recovery (F-RTO) defined in RFC4138.
@@ -1514,6 +1522,20 @@ cookie_preserve_enable - BOOLEAN · 1284 unmodified lines
15141522
15151523 Default: 1
15161524
1525+cookie_hmac_alg - STRING
1526+ Select the hmac algorithm used when generating the cookie value sent by
1527+ a listening sctp socket to a connecting client in the INIT-ACK chunk.
1528+ Valid values are:
1529+ * md5
1530+ * sha1
1531+ * none
1532+ Ability to assign md5 or sha1 as the selected alg is predicated on the
1533+ configuarion of those algorithms at build time (CONFIG_CRYPTO_MD5 and
1534+ CONFIG_CRYPTO_SHA1).
1535+
1536+ Default: Dependent on configuration. MD5 if available, else SHA1 if
1537+ available, else none.
1538+
15171539 rcvbuf_policy - INTEGER
15181540 Determines if the receive buffer is attributed to the socket or to
15191541 association. SCTP supports the capability to create multiple
Documentation/networking/packet_mmap.txt+222−24
@@ -3,9 +3,9 @@ · 2 unmodified lines
33 --------------------------------------------------------------------------------
44
55 This file documents the mmap() facility available with the PACKET
6−socket interface on 2.4 and 2.6 kernels. This type of sockets is used for
7−capture network traffic with utilities like tcpdump or any other that needs
8−raw access to network interface.
6+socket interface on 2.4/2.6/3.x kernels. This type of sockets is used for
7+i) capture network traffic with utilities like tcpdump, ii) transmit network
8+traffic, or any other that needs raw access to network interface.
99
1010 You can find the latest version of this document at:
1111 http://wiki.ipxwarzone.com/index.php5?title=Linux_packet_mmap
@@ -21,19 +21,18 @@ Please send your comments to · 9 unmodified lines
2121 + Why use PACKET_MMAP
2222 --------------------------------------------------------------------------------
2323
24−In Linux 2.4/2.6 if PACKET_MMAP is not enabled, the capture process is very
25−inefficient. It uses very limited buffers and requires one system call
26−to capture each packet, it requires two if you want to get packet's
27−timestamp (like libpcap always does).
24+In Linux 2.4/2.6/3.x if PACKET_MMAP is not enabled, the capture process is very
25+inefficient. It uses very limited buffers and requires one system call to
26+capture each packet, it requires two if you want to get packet's timestamp
27+(like libpcap always does).
2828
2929 In the other hand PACKET_MMAP is very efficient. PACKET_MMAP provides a size
3030 configurable circular buffer mapped in user space that can be used to either
3131 send or receive packets. This way reading packets just needs to wait for them,
3232 most of the time there is no need to issue a single system call. Concerning
3333 transmission, multiple packets can be sent through one system call to get the
34−highest bandwidth.
35−By using a shared buffer between the kernel and the user also has the benefit
36−of minimizing packet copies.
34+highest bandwidth. By using a shared buffer between the kernel and the user
35+also has the benefit of minimizing packet copies.
3736
3837 It's fine to use PACKET_MMAP to improve the performance of the capture and
3938 transmission process, but it isn't everything. At least, if you are capturing
@@ -41,7 +40,8 @@ at high speeds (this is relative to the cpu speed), you should check if the · 1 unmodified line
4140 device driver of your network interface card supports some sort of interrupt
4241 load mitigation or (even better) if it supports NAPI, also make sure it is
4342 enabled. For transmission, check the MTU (Maximum Transmission Unit) used and
44−supported by devices of your network.
43+supported by devices of your network. CPU IRQ pinning of your network interface
44+card can also be an advantage.
4545
4646 --------------------------------------------------------------------------------
4747 + How to use mmap() to improve capture process
@@ -87,9 +87,7 @@ the following process: · 39 unmodified lines
8787 socket creation and destruction is straight forward, and is done
8888 the same way with or without PACKET_MMAP:
8989
90−int fd;
91−
92−fd= socket(PF_PACKET, mode, htons(ETH_P_ALL))
90+ int fd = socket(PF_PACKET, mode, htons(ETH_P_ALL));
9391
9492 where mode is SOCK_RAW for the raw interface were link level
9593 information can be captured or SOCK_DGRAM for the cooked
@@ -163,11 +161,23 @@ As capture, each frame contains two parts: · 67 unmodified lines
163161
164162 A complete tutorial is available at: http://wiki.gnu-log.net/
165163
164+By default, the user should put data at :
165+ frame base + TPACKET_HDRLEN - sizeof(struct sockaddr_ll)
166+
167+So, whatever you choose for the socket mode (SOCK_DGRAM or SOCK_RAW),
168+the beginning of the user data will be at :
169+ frame base + TPACKET_ALIGN(sizeof(struct tpacket_hdr))
170+
171+If you wish to put user data at a custom offset from the beginning of
172+the frame (for payload alignment with SOCK_RAW mode for instance) you
173+can set tp_net (with SOCK_DGRAM) or tp_mac (with SOCK_RAW). In order
174+to make this work it must be enabled previously with setsockopt()
175+and the PACKET_TX_HAS_OFF option.
176+
166177 --------------------------------------------------------------------------------
167178 + PACKET_MMAP settings
168179 --------------------------------------------------------------------------------
169180
170−
171181 To setup PACKET_MMAP from user level code is done with a call like
172182
173183 - Capture process
@@ -201,7 +211,6 @@ indeed, packet_set_ring checks that the following condition is true · 27 unmodified lines
201211
202212 frames_per_block * tp_block_nr == tp_frame_nr
203213
204−
205214 Lets see an example, with the following values:
206215
207216 tp_block_size= 4096
@@ -227,7 +236,6 @@ be spawned across two blocks, so there are some details you have to take into · 19 unmodified lines
227236 account when choosing the frame_size. See "Mapping and use of the circular
228237 buffer (ring)".
229238
230−
231239 --------------------------------------------------------------------------------
232240 + PACKET_MMAP setting constraints
233241 --------------------------------------------------------------------------------
@@ -264,7 +272,6 @@ User space programs can include /usr/include/sys/user.h and · 30 unmodified lines
264272 The pagesize can also be determined dynamically with the getpagesize (2)
265273 system call.
266274
267−
268275 Block number limit
269276 --------------------
270277
@@ -284,7 +291,6 @@ called pg_vec, its size limits the number of blocks that can be allocated. · 13 unmodified lines
284291 v block #2
285292 block #1
286293
287−
288294 kmalloc allocates any number of bytes of physically contiguous memory from
289295 a pool of pre-determined sizes. This pool of memory is maintained by the slab
290296 allocator which is at the end the responsible for doing the allocation and
@@ -299,7 +305,6 @@ pointers to blocks is · 8 unmodified lines
299305
300306 131072/4 = 32768 blocks
301307
302−
303308 PACKET_MMAP buffer size calculator
304309 ------------------------------------
305310
@@ -340,7 +345,6 @@ and a value for <frame size> of 2048 bytes. These parameters will yield · 34 unmodified lines
340345 and hence the buffer will have a 262144 MiB size. So it can hold
341346 262144 MiB / 2048 bytes = 134217728 frames
342347
343−
344348 Actually, this buffer size is not possible with an i386 architecture.
345349 Remember that the memory is allocated in kernel space, in the case of
346350 an i386 kernel's memory size is limited to 1GiB.
@@ -372,7 +376,6 @@ the following (from include/linux/if_packet.h): · 25 unmodified lines
372376 - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16.
373377 - Pad to align to TPACKET_ALIGNMENT=16
374378 */
375−
376379
377380 The following are conditions that are checked in packet_set_ring
378381
@@ -413,7 +416,6 @@ and the following flags apply: · 34 unmodified lines
413416 #define TP_STATUS_LOSING 4
414417 #define TP_STATUS_CSUMNOTREADY 8
415418
416−
417419 TP_STATUS_COPY : This flag indicates that the frame (and associated
418420 meta information) has been truncated because it's
419421 larger than tp_frame_size. This packet can be
@@ -462,7 +464,6 @@ packets are in the ring: · 42 unmodified lines
462464 It doesn't incur in a race condition to first check the status value and
463465 then poll for frames.
464466
465−
466467 ++ Transmission process
467468 Those defines are also used for transmission:
468469
@@ -493,6 +494,196 @@ The user can also use poll() to check if a buffer is available: · 24 unmodified lines
493494 pfd.events = POLLOUT;
494495 retval = poll(&pfd, 1, timeout);
495496
497+-------------------------------------------------------------------------------
498++ What TPACKET versions are available and when to use them?
499+-------------------------------------------------------------------------------
500+
501+ int val = tpacket_version;
502+ setsockopt(fd, SOL_PACKET, PACKET_VERSION, &val, sizeof(val));
503+ getsockopt(fd, SOL_PACKET, PACKET_VERSION, &val, sizeof(val));
504+
505+where 'tpacket_version' can be TPACKET_V1 (default), TPACKET_V2, TPACKET_V3.
506+
507+TPACKET_V1:
508+ - Default if not otherwise specified by setsockopt(2)
509+ - RX_RING, TX_RING available
510+ - VLAN metadata information available for packets
511+ (TP_STATUS_VLAN_VALID)
512+
513+TPACKET_V1 --> TPACKET_V2:
514+ - Made 64 bit clean due to unsigned long usage in TPACKET_V1
515+ structures, thus this also works on 64 bit kernel with 32 bit
516+ userspace and the like
517+ - Timestamp resolution in nanoseconds instead of microseconds
518+ - RX_RING, TX_RING available
519+ - How to switch to TPACKET_V2:
520+ 1. Replace struct tpacket_hdr by struct tpacket2_hdr
521+ 2. Query header len and save
522+ 3. Set protocol version to 2, set up ring as usual
523+ 4. For getting the sockaddr_ll,
524+ use (void *)hdr + TPACKET_ALIGN(hdrlen) instead of
525+ (void *)hdr + TPACKET_ALIGN(sizeof(struct tpacket_hdr))
526+
527+TPACKET_V2 --> TPACKET_V3:
528+ - Flexible buffer implementation:
529+ 1. Blocks can be configured with non-static frame-size
530+ 2. Read/poll is at a block-level (as opposed to packet-level)
531+ 3. Added poll timeout to avoid indefinite user-space wait
532+ on idle links
533+ 4. Added user-configurable knobs:
534+ 4.1 block::timeout
535+ 4.2 tpkt_hdr::sk_rxhash
536+ - RX Hash data available in user space
537+ - Currently only RX_RING available
538+
539+-------------------------------------------------------------------------------
540++ AF_PACKET fanout mode
541+-------------------------------------------------------------------------------
542+
543+In the AF_PACKET fanout mode, packet reception can be load balanced among
544+processes. This also works in combination with mmap(2) on packet sockets.
545+
546+Minimal example code by David S. Miller (try things like "./test eth0 hash",
547+"./test eth0 lb", etc.):
548+
549+#include <stddef.h>
550+#include <stdlib.h>
551+#include <stdio.h>
552+#include <string.h>
553+
554+#include <sys/types.h>
555+#include <sys/wait.h>
556+#include <sys/socket.h>
557+#include <sys/ioctl.h>
558+
559+#include <unistd.h>
560+
561+#include <linux/if_ether.h>
562+#include <linux/if_packet.h>
563+
564+#include <net/if.h>
565+
566+static const char *device_name;
567+static int fanout_type;
568+static int fanout_id;
569+
570+#ifndef PACKET_FANOUT
571+# define PACKET_FANOUT 18
572+# define PACKET_FANOUT_HASH 0
573+# define PACKET_FANOUT_LB 1
574+#endif
575+
576+static int setup_socket(void)
577+{
578+ int err, fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_IP));
579+ struct sockaddr_ll ll;
580+ struct ifreq ifr;
581+ int fanout_arg;
582+
583+ if (fd < 0) {
584+ perror("socket");
585+ return EXIT_FAILURE;
586+ }
587+
588+ memset(&ifr, 0, sizeof(ifr));
589+ strcpy(ifr.ifr_name, device_name);
590+ err = ioctl(fd, SIOCGIFINDEX, &ifr);
591+ if (err < 0) {
592+ perror("SIOCGIFINDEX");
593+ return EXIT_FAILURE;
594+ }
595+
596+ memset(&ll, 0, sizeof(ll));
597+ ll.sll_family = AF_PACKET;
598+ ll.sll_ifindex = ifr.ifr_ifindex;
599+ err = bind(fd, (struct sockaddr *) &ll, sizeof(ll));
600+ if (err < 0) {
601+ perror("bind");
602+ return EXIT_FAILURE;
603+ }
604+
605+ fanout_arg = (fanout_id | (fanout_type << 16));
606+ err = setsockopt(fd, SOL_PACKET, PACKET_FANOUT,
607+ &fanout_arg, sizeof(fanout_arg));
608+ if (err) {
609+ perror("setsockopt");
610+ return EXIT_FAILURE;
611+ }
612+
613+ return fd;
614+}
615+
616+static void fanout_thread(void)
617+{
618+ int fd = setup_socket();
619+ int limit = 10000;
620+
621+ if (fd < 0)
622+ exit(fd);
623+
624+ while (limit-- > 0) {
625+ char buf[1600];
626+ int err;
627+
628+ err = read(fd, buf, sizeof(buf));
629+ if (err < 0) {
630+ perror("read");
631+ exit(EXIT_FAILURE);
632+ }
633+ if ((limit % 10) == 0)
634+ fprintf(stdout, "(%d) \n", getpid());
635+ }
636+
637+ fprintf(stdout, "%d: Received 10000 packets\n", getpid());
638+
639+ close(fd);
640+ exit(0);
641+}
642+
643+int main(int argc, char **argp)
644+{
645+ int fd, err;
646+ int i;
647+
648+ if (argc != 3) {
649+ fprintf(stderr, "Usage: %s INTERFACE {hash|lb}\n", argp[0]);
650+ return EXIT_FAILURE;
651+ }
652+
653+ if (!strcmp(argp[2], "hash"))
654+ fanout_type = PACKET_FANOUT_HASH;
655+ else if (!strcmp(argp[2], "lb"))
656+ fanout_type = PACKET_FANOUT_LB;
657+ else {
658+ fprintf(stderr, "Unknown fanout type [%s]\n", argp[2]);
659+ exit(EXIT_FAILURE);
660+ }
661+
662+ device_name = argp[1];
663+ fanout_id = getpid() & 0xffff;
664+
665+ for (i = 0; i < 4; i++) {
666+ pid_t pid = fork();
667+
668+ switch (pid) {
669+ case 0:
670+ fanout_thread();
671+
672+ case -1:
673+ perror("fork");
674+ exit(EXIT_FAILURE);
675+ }
676+ }
677+
678+ for (i = 0; i < 4; i++) {
679+ int status;
680+
681+ wait(&status);
682+ }
683+
684+ return 0;
685+}
686+
496687 -------------------------------------------------------------------------------
497688 + PACKET_TIMESTAMP
498689 -------------------------------------------------------------------------------
@@ -519,6 +710,13 @@ the networking stack is used (the behavior before this setting was added). · 20 unmodified lines
519710 See include/linux/net_tstamp.h and Documentation/networking/timestamping
520711 for more information on hardware timestamps.
521712
713+-------------------------------------------------------------------------------
714++ Miscellaneous bits
715+-------------------------------------------------------------------------------
716+
717+- Packet sockets work well together with Linux socket filters, thus you also
718+ might want to have a look at Documentation/networking/filter.txt
719+
522720 --------------------------------------------------------------------------------
523721 + THANKS
524722 --------------------------------------------------------------------------------
Documentation/networking/stmmac.txt+15−13
@@ -29,11 +29,9 @@ The kernel configuration option is STMMAC_ETH: · 28 unmodified lines
2929 dma_txsize: DMA tx ring size;
3030 buf_sz: DMA buffer size;
3131 tc: control the HW FIFO threshold;
32− tx_coe: Enable/Disable Tx Checksum Offload engine;
3332 watchdog: transmit timeout (in milliseconds);
3433 flow_ctrl: Flow control ability [on/off];
3534 pause: Flow Control Pause Time;
36− tmrate: timer period (only if timer optimisation is configured).
3735
3836 3) Command line options
3937 Driver parameters can be also passed in command line by using:
@@ -60,17 +58,19 @@ Then the poll method will be scheduled at some future point. · 20 unmodified lines
6058 The incoming packets are stored, by the DMA, in a list of pre-allocated socket
6159 buffers in order to avoid the memcpy (Zero-copy).
6260
63−4.3) Timer-Driver Interrupt
64−Instead of having the device that asynchronously notifies the frame receptions,
65−the driver configures a timer to generate an interrupt at regular intervals.
66−Based on the granularity of the timer, the frames that are received by the
67−device will experience different levels of latency. Some NICs have dedicated
68−timer device to perform this task. STMMAC can use either the RTC device or the
69−TMU channel 2 on STLinux platforms.
70−The timers frequency can be passed to the driver as parameter; when change it,
71−take care of both hardware capability and network stability/performance impact.
72−Several performance tests on STM platforms showed this optimisation allows to
73−spare the CPU while having the maximum throughput.
61+4.3) Interrupt Mitigation
62+The driver is able to mitigate the number of its DMA interrupts
63+using NAPI for the reception on chips older than the 3.50.
64+New chips have an HW RX-Watchdog used for this mitigation.
65+
66+On Tx-side, the mitigation schema is based on a SW timer that calls the
67+tx function (stmmac_tx) to reclaim the resource after transmitting the
68+frames.
69+Also there is another parameter (like a threshold) used to program
70+the descriptors avoiding to set the interrupt on completion bit in
71+when the frame is sent (xmit).
72+
73+Mitigation parameters can be tuned by ethtool.
7474
7575 4.4) WOL
7676 Wake up on Lan feature through Magic and Unicast frames are supported for the
@@ -121,6 +121,7 @@ struct plat_stmmacenet_data { · 44 unmodified lines
121121 int bugged_jumbo;
122122 int pmt;
123123 int force_sf_dma_mode;
124+ int riwt_off;
124125 void (*fix_mac_speed)(void *priv, unsigned int speed);
125126 void (*bus_setup)(void __iomem *ioaddr);
126127 int (*init)(struct platform_device *pdev);
@@ -156,6 +157,7 @@ Where: · 29 unmodified lines
156157 o pmt: core has the embedded power module (optional).
157158 o force_sf_dma_mode: force DMA to use the Store and Forward mode
158159 instead of the Threshold.
160+ o riwt_off: force to disable the RX watchdog feature and switch to NAPI mode.
159161 o fix_mac_speed: this callback is used for modifying some syscfg registers
160162 (on ST SoCs) according to the link speed negotiated by the
161163 physical layer .
MAINTAINERS+22−5
@@ -1680,10 +1680,9 @@ F: drivers/net/ethernet/broadcom/tg3.* · 1679 unmodified lines
16801680
16811681 BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
16821682 M: Brett Rudley <brudley@broadcom.com>
1683−M: Roland Vossen <rvossen@broadcom.com>
16841683 M: Arend van Spriel <arend@broadcom.com>
16851684 M: Franky (Zhenhui) Lin <frankyl@broadcom.com>
1686−M: Kan Yan <kanyan@broadcom.com>
1685+M: Hante Meuleman <meuleman@broadcom.com>
16871686 L: linux-wireless@vger.kernel.org
16881687 L: brcm80211-dev-list@broadcom.com
16891688 S: Supported
@@ -3949,7 +3948,9 @@ M: Greg Rose <gregory.v.rose@intel.com> · 2259 unmodified lines
39493948 M: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
39503949 M: Alex Duyck <alexander.h.duyck@intel.com>
39513950 M: John Ronciak <john.ronciak@intel.com>
3951+M: Tushar Dave <tushar.n.dave@intel.com>
39523952 L: e1000-devel@lists.sourceforge.net
3953+W: http://www.intel.com/support/feedback.htm
39533954 W: http://e1000.sourceforge.net/
39543955 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net.git
39553956 T: git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next.git
@@ -4833,6 +4834,14 @@ F: Documentation/scsi/megaraid.txt · 877 unmodified lines
48334834 F: drivers/scsi/megaraid.*
48344835 F: drivers/scsi/megaraid/
48354836
4837+MELLANOX ETHERNET DRIVER (mlx4_en)
4838+M: Amir Vadai <amirv@mellanox.com>
4839+L: netdev@vger.kernel.org
4840+S: Supported
4841+W: http://www.mellanox.com
4842+Q: http://patchwork.ozlabs.org/project/netdev/list/
4843+F: drivers/net/ethernet/mellanox/mlx4/en_*
4844+
48364845 MEMORY MANAGEMENT
48374846 L: linux-mm@kvack.org
48384847 W: http://www.linux-mm.org
@@ -5075,7 +5084,7 @@ NETWORKING [GENERAL] · 236 unmodified lines
50755084 M: "David S. Miller" <davem@davemloft.net>
50765085 L: netdev@vger.kernel.org
50775086 W: http://www.linuxfoundation.org/en/Net
5078−W: http://patchwork.ozlabs.org/project/netdev/list/
5087+Q: http://patchwork.ozlabs.org/project/netdev/list/
50795088 T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
50805089 T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
50815090 S: Maintained
@@ -5135,6 +5144,7 @@ F: drivers/net/wireless/ · 53 unmodified lines
51355144 NETWORKING DRIVERS
51365145 L: netdev@vger.kernel.org
51375146 W: http://www.linuxfoundation.org/en/Net
5147+Q: http://patchwork.ozlabs.org/project/netdev/list/
51385148 T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
51395149 T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
51405150 S: Odd Fixes
@@ -5167,6 +5177,7 @@ F: net/nfc/ · 26 unmodified lines
51675177 F: include/linux/nfc.h
51685178 F: include/net/nfc/
51695179 F: drivers/nfc/
5180+F: include/linux/platform_data/pn544.h
51705181
51715182 NFS, SUNRPC, AND LOCKD CLIENTS
51725183 M: Trond Myklebust <Trond.Myklebust@netapp.com>
@@ -6442,6 +6453,7 @@ F: drivers/scsi/st* · 1269 unmodified lines
64426453 SCTP PROTOCOL
64436454 M: Vlad Yasevich <vyasevich@gmail.com>
64446455 M: Sridhar Samudrala <sri@us.ibm.com>
6456+M: Neil Horman <nhorman@tuxdriver.com>
64456457 L: linux-sctp@vger.kernel.org
64466458 W: http://lksctp.sourceforge.net
64476459 S: Maintained
@@ -7469,8 +7481,7 @@ S: Maintained · 1021 unmodified lines
74697481 F: drivers/net/ethernet/dec/tulip/
74707482
74717483 TUN/TAP driver
7472−M: Maxim Krasnyansky <maxk@qualcomm.com>
7473−L: vtun@office.satix.net
7484+M: Maxim Krasnyansky <maxk@qti.qualcomm.com>
74747485 W: http://vtun.sourceforge.net/tun
74757486 S: Maintained
74767487 F: Documentation/networking/tuntap.txt
@@ -7592,6 +7603,12 @@ S: Maintained · 115 unmodified lines
75927603 F: Documentation/usb/acm.txt
75937604 F: drivers/usb/class/cdc-acm.*
75947605
7606+USB AR5523 WIRELESS DRIVER
7607+M: Pontus Fuchs <pontus.fuchs@gmail.com>
7608+L: linux-wireless@vger.kernel.org
7609+S: Maintained
7610+F: drivers/net/wireless/ath/ar5523/
7611+
75957612 USB ATTACHED SCSI
75967613 M: Matthew Wilcox <willy@linux.intel.com>
75977614 M: Sarah Sharp <sarah.a.sharp@linux.intel.com>
arch/alpha/include/asm/socket.h+1−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
4747 /* Socket filtering */
4848 #define SO_ATTACH_FILTER 26
4949 #define SO_DETACH_FILTER 27
50+#define SO_GET_FILTER SO_ATTACH_FILTER
5051
5152 #define SO_PEERNAME 28
5253 #define SO_TIMESTAMP 29
arch/arm/boot/dts/am335x-bone.dts+8−0
@@ -128,3 +128,11 @@ · 127 unmodified lines
128128 };
129129 };
130130 };
131+
132+&cpsw_emac0 {
133+ phy_id = <&davinci_mdio>, <0>;
134+};
135+
136+&cpsw_emac1 {
137+ phy_id = <&davinci_mdio>, <1>;
138+};
arch/arm/boot/dts/am335x-evm.dts+8−0
@@ -236,3 +236,11 @@ · 235 unmodified lines
236236 };
237237 };
238238 };
239+
240+&cpsw_emac0 {
241+ phy_id = <&davinci_mdio>, <0>;
242+};
243+
244+&cpsw_emac1 {
245+ phy_id = <&davinci_mdio>, <1>;
246+};
arch/arm/boot/dts/am33xx.dtsi+47−0
@@ -338,5 +338,52 @@ · 337 unmodified lines
338338 power = <250>;
339339 ti,hwmods = "usb_otg_hs";
340340 };
341+
342+ mac: ethernet@4a100000 {
343+ compatible = "ti,cpsw";
344+ ti,hwmods = "cpgmac0";
345+ cpdma_channels = <8>;
346+ ale_entries = <1024>;
347+ bd_ram_size = <0x2000>;
348+ no_bd_ram = <0>;
349+ rx_descs = <64>;
350+ mac_control = <0x20>;
351+ slaves = <2>;
352+ cpts_active_slave = <0>;
353+ cpts_clock_mult = <0x80000000>;
354+ cpts_clock_shift = <29>;
355+ reg = <0x4a100000 0x800
356+ 0x4a101200 0x100>;
357+ #address-cells = <1>;
358+ #size-cells = <1>;
359+ interrupt-parent = <&intc>;
360+ /*
361+ * c0_rx_thresh_pend
362+ * c0_rx_pend
363+ * c0_tx_pend
364+ * c0_misc_pend
365+ */
366+ interrupts = <40 41 42 43>;
367+ ranges;
368+
369+ davinci_mdio: mdio@4a101000 {
370+ compatible = "ti,davinci_mdio";
371+ #address-cells = <1>;
372+ #size-cells = <0>;
373+ ti,hwmods = "davinci_mdio";
374+ bus_freq = <1000000>;
375+ reg = <0x4a101000 0x100>;
376+ };
377+
378+ cpsw_emac0: slave@4a100200 {
379+ /* Filled in by U-Boot */
380+ mac-address = [ 00 00 00 00 00 00 ];
381+ };
382+
383+ cpsw_emac1: slave@4a100300 {
384+ /* Filled in by U-Boot */
385+ mac-address = [ 00 00 00 00 00 00 ];
386+ };
387+ };
341388 };
342389 };
arch/arm/boot/dts/imx6q.dtsi+3−2
@@ -596,6 +596,7 @@ · 595 unmodified lines
596596 66 0x1b0b0 /* MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 */
597597 70 0x1b0b0 /* MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 */
598598 48 0x1b0b0 /* MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL */
599+ 1033 0x4001b0a8 /* MX6Q_PAD_GPIO_16__ENET_ANATOP_ETHERNET_REF_OUT*/
599600 >;
600601 };
601602
@@ -849,8 +850,8 @@ · 247 unmodified lines
849850 compatible = "fsl,imx6q-fec";
850851 reg = <0x02188000 0x4000>;
851852 interrupts = <0 118 0x04 0 119 0x04>;
852− clocks = <&clks 117>, <&clks 117>;
853− clock-names = "ipg", "ahb";
853+ clocks = <&clks 117>, <&clks 117>, <&clks 177>;
854+ clock-names = "ipg", "ahb", "ptp";
854855 status = "disabled";
855856 };
856857
arch/arm/configs/omap2plus_defconfig+3−0
@@ -240,3 +240,6 @@ CONFIG_CRC_ITU_T=y · 239 unmodified lines
240240 CONFIG_CRC7=y
241241 CONFIG_LIBCRC32C=y
242242 CONFIG_SOC_OMAP5=y
243+CONFIG_TI_DAVINCI_MDIO=y
244+CONFIG_TI_DAVINCI_CPDMA=y
245+CONFIG_TI_CPSW=y
arch/arm/mach-at91/Kconfig+0−4
@@ -39,7 +39,6 @@ config SOC_AT91RM9200 · 38 unmodified lines
3939 config SOC_AT91SAM9260
4040 bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
4141 select HAVE_AT91_DBGU0
42− select HAVE_NET_MACB
4342 select SOC_AT91SAM9
4443 help
4544 Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
@@ -57,7 +56,6 @@ config SOC_AT91SAM9263 · 11 unmodified lines
5756 bool "AT91SAM9263"
5857 select HAVE_AT91_DBGU1
5958 select HAVE_FB_ATMEL
60− select HAVE_NET_MACB
6159 select SOC_AT91SAM9
6260
6361 config SOC_AT91SAM9RL
@@ -70,7 +68,6 @@ config SOC_AT91SAM9G45 · 6 unmodified lines
7068 bool "AT91SAM9G45 or AT91SAM9M10 families"
7169 select HAVE_AT91_DBGU1
7270 select HAVE_FB_ATMEL
73− select HAVE_NET_MACB
7471 select SOC_AT91SAM9
7572 help
7673 Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
@@ -80,7 +77,6 @@ config SOC_AT91SAM9X5 · 3 unmodified lines
8077 bool "AT91SAM9x5 family"
8178 select HAVE_AT91_DBGU0
8279 select HAVE_FB_ATMEL
83− select HAVE_NET_MACB
8480 select SOC_AT91SAM9
8581 help
8682 Select this if you are using one of Atmel's AT91SAM9x5 family SoC.
arch/arm/mach-at91/board-csb337.c+2−0
@@ -53,6 +53,8 @@ static void __init csb337_init_early(void) · 52 unmodified lines
5353 static struct macb_platform_data __initdata csb337_eth_data = {
5454 .phy_irq_pin = AT91_PIN_PC2,
5555 .is_rmii = 0,
56+ /* The CSB337 bootloader stores the MAC the wrong-way around */
57+ .rev_eth_addr = 1,
5658 };
5759
5860 static struct at91_usbh_data __initdata csb337_usbh_data = {
arch/arm/mach-at91/include/mach/at91rm9200_emac.h+0−138
@@ -1,138 +0,0 @@
1−/*
2− * arch/arm/mach-at91/include/mach/at91rm9200_emac.h
3− *
4− * Copyright (C) 2005 Ivan Kokshaysky
5− * Copyright (C) SAN People
6− *
7− * Ethernet MAC registers.
8− * Based on AT91RM9200 datasheet revision E.
9− *
10− * This program is free software; you can redistribute it and/or modify
11− * it under the terms of the GNU General Public License as published by
12− * the Free Software Foundation; either version 2 of the License, or
13− * (at your option) any later version.
14− */
15−
16−#ifndef AT91RM9200_EMAC_H
17−#define AT91RM9200_EMAC_H
18−
19−#define AT91_EMAC_CTL 0x00 /* Control Register */
20−#define AT91_EMAC_LB (1 << 0) /* Loopback */
21−#define AT91_EMAC_LBL (1 << 1) /* Loopback Local */
22−#define AT91_EMAC_RE (1 << 2) /* Receive Enable */
23−#define AT91_EMAC_TE (1 << 3) /* Transmit Enable */
24−#define AT91_EMAC_MPE (1 << 4) /* Management Port Enable */
25−#define AT91_EMAC_CSR (1 << 5) /* Clear Statistics Registers */
26−#define AT91_EMAC_INCSTAT (1 << 6) /* Increment Statistics Registers */
27−#define AT91_EMAC_WES (1 << 7) /* Write Enable for Statistics Registers */
28−#define AT91_EMAC_BP (1 << 8) /* Back Pressure */
29−
30−#define AT91_EMAC_CFG 0x04 /* Configuration Register */
31−#define AT91_EMAC_SPD (1 << 0) /* Speed */
32−#define AT91_EMAC_FD (1 << 1) /* Full Duplex */
33−#define AT91_EMAC_BR (1 << 2) /* Bit Rate */
34−#define AT91_EMAC_CAF (1 << 4) /* Copy All Frames */
35−#define AT91_EMAC_NBC (1 << 5) /* No Broadcast */
36−#define AT91_EMAC_MTI (1 << 6) /* Multicast Hash Enable */
37−#define AT91_EMAC_UNI (1 << 7) /* Unicast Hash Enable */
38−#define AT91_EMAC_BIG (1 << 8) /* Receive 1522 Bytes */
39−#define AT91_EMAC_EAE (1 << 9) /* External Address Match Enable */
40−#define AT91_EMAC_CLK (3 << 10) /* MDC Clock Divisor */
41−#define AT91_EMAC_CLK_DIV8 (0 << 10)
42−#define AT91_EMAC_CLK_DIV16 (1 << 10)
43−#define AT91_EMAC_CLK_DIV32 (2 << 10)
44−#define AT91_EMAC_CLK_DIV64 (3 << 10)
45−#define AT91_EMAC_RTY (1 << 12) /* Retry Test */
46−#define AT91_EMAC_RMII (1 << 13) /* Reduce MII (RMII) */
47−
48−#define AT91_EMAC_SR 0x08 /* Status Register */
49−#define AT91_EMAC_SR_LINK (1 << 0) /* Link */
50−#define AT91_EMAC_SR_MDIO (1 << 1) /* MDIO pin */
51−#define AT91_EMAC_SR_IDLE (1 << 2) /* PHY idle */
52−
53−#define AT91_EMAC_TAR 0x0c /* Transmit Address Register */
54−
55−#define AT91_EMAC_TCR 0x10 /* Transmit Control Register */
56−#define AT91_EMAC_LEN (0x7ff << 0) /* Transmit Frame Length */
57−#define AT91_EMAC_NCRC (1 << 15) /* No CRC */
58−
59−#define AT91_EMAC_TSR 0x14 /* Transmit Status Register */
60−#define AT91_EMAC_TSR_OVR (1 << 0) /* Transmit Buffer Overrun */
61−#define AT91_EMAC_TSR_COL (1 << 1) /* Collision Occurred */
62−#define AT91_EMAC_TSR_RLE (1 << 2) /* Retry Limit Exceeded */
63−#define AT91_EMAC_TSR_IDLE (1 << 3) /* Transmitter Idle */
64−#define AT91_EMAC_TSR_BNQ (1 << 4) /* Transmit Buffer not Queued */
65−#define AT91_EMAC_TSR_COMP (1 << 5) /* Transmit Complete */
66−#define AT91_EMAC_TSR_UND (1 << 6) /* Transmit Underrun */
67−
68−#define AT91_EMAC_RBQP 0x18 /* Receive Buffer Queue Pointer */
69−
70−#define AT91_EMAC_RSR 0x20 /* Receive Status Register */
71−#define AT91_EMAC_RSR_BNA (1 << 0) /* Buffer Not Available */
72−#define AT91_EMAC_RSR_REC (1 << 1) /* Frame Received */
73−#define AT91_EMAC_RSR_OVR (1 << 2) /* RX Overrun */
74−
75−#define AT91_EMAC_ISR 0x24 /* Interrupt Status Register */
76−#define AT91_EMAC_DONE (1 << 0) /* Management Done */
77−#define AT91_EMAC_RCOM (1 << 1) /* Receive Complete */
78−#define AT91_EMAC_RBNA (1 << 2) /* Receive Buffer Not Available */
79−#define AT91_EMAC_TOVR (1 << 3) /* Transmit Buffer Overrun */
80−#define AT91_EMAC_TUND (1 << 4) /* Transmit Buffer Underrun */
81−#define AT91_EMAC_RTRY (1 << 5) /* Retry Limit */
82−#define AT91_EMAC_TBRE (1 << 6) /* Transmit Buffer Register Empty */
83−#define AT91_EMAC_TCOM (1 << 7) /* Transmit Complete */
84−#define AT91_EMAC_TIDLE (1 << 8) /* Transmit Idle */
85−#define AT91_EMAC_LINK (1 << 9) /* Link */
86−#define AT91_EMAC_ROVR (1 << 10) /* RX Overrun */
87−#define AT91_EMAC_ABT (1 << 11) /* Abort */
88−
89−#define AT91_EMAC_IER 0x28 /* Interrupt Enable Register */
90−#define AT91_EMAC_IDR 0x2c /* Interrupt Disable Register */
91−#define AT91_EMAC_IMR 0x30 /* Interrupt Mask Register */
92−
93−#define AT91_EMAC_MAN 0x34 /* PHY Maintenance Register */
94−#define AT91_EMAC_DATA (0xffff << 0) /* MDIO Data */
95−#define AT91_EMAC_REGA (0x1f << 18) /* MDIO Register */
96−#define AT91_EMAC_PHYA (0x1f << 23) /* MDIO PHY Address */
97−#define AT91_EMAC_RW (3 << 28) /* Read/Write operation */
98−#define AT91_EMAC_RW_W (1 << 28)
99−#define AT91_EMAC_RW_R (2 << 28)
100−#define AT91_EMAC_MAN_802_3 0x40020000 /* IEEE 802.3 value */
101−
102−/*
103− * Statistics Registers.
104− */
105−#define AT91_EMAC_FRA 0x40 /* Frames Transmitted OK */
106−#define AT91_EMAC_SCOL 0x44 /* Single Collision Frame */
107−#define AT91_EMAC_MCOL 0x48 /* Multiple Collision Frame */
108−#define AT91_EMAC_OK 0x4c /* Frames Received OK */
109−#define AT91_EMAC_SEQE 0x50 /* Frame Check Sequence Error */
110−#define AT91_EMAC_ALE 0x54 /* Alignmemt Error */
111−#define AT91_EMAC_DTE 0x58 /* Deffered Transmission Frame */
112−#define AT91_EMAC_LCOL 0x5c /* Late Collision */
113−#define AT91_EMAC_ECOL 0x60 /* Excessive Collision */
114−#define AT91_EMAC_TUE 0x64 /* Transmit Underrun Error */
115−#define AT91_EMAC_CSE 0x68 /* Carrier Sense Error */
116−#define AT91_EMAC_DRFC 0x6c /* Discard RX Frame */
117−#define AT91_EMAC_ROV 0x70 /* Receive Overrun */
118−#define AT91_EMAC_CDE 0x74 /* Code Error */
119−#define AT91_EMAC_ELR 0x78 /* Excessive Length Error */
120−#define AT91_EMAC_RJB 0x7c /* Receive Jabber */
121−#define AT91_EMAC_USF 0x80 /* Undersize Frame */
122−#define AT91_EMAC_SQEE 0x84 /* SQE Test Error */
123−
124−/*
125− * Address Registers.
126− */
127−#define AT91_EMAC_HSL 0x90 /* Hash Address Low [31:0] */
128−#define AT91_EMAC_HSH 0x94 /* Hash Address High [63:32] */
129−#define AT91_EMAC_SA1L 0x98 /* Specific Address 1 Low, bytes 0-3 */
130−#define AT91_EMAC_SA1H 0x9c /* Specific Address 1 High, bytes 4-5 */
131−#define AT91_EMAC_SA2L 0xa0 /* Specific Address 2 Low, bytes 0-3 */
132−#define AT91_EMAC_SA2H 0xa4 /* Specific Address 2 High, bytes 4-5 */
133−#define AT91_EMAC_SA3L 0xa8 /* Specific Address 3 Low, bytes 0-3 */
134−#define AT91_EMAC_SA3H 0xac /* Specific Address 3 High, bytes 4-5 */
135−#define AT91_EMAC_SA4L 0xb0 /* Specific Address 4 Low, bytes 0-3 */
136−#define AT91_EMAC_SA4H 0xb4 /* Specific Address 4 High, bytes 4-5 */
137−
138−#endif
arch/arm/mach-imx/mach-imx6q.c+12−0
@@ -117,6 +117,17 @@ static void __init imx6q_sabrelite_init(void) · 116 unmodified lines
117117 imx6q_sabrelite_cko1_setup();
118118 }
119119
120+static void __init imx6q_1588_init(void)
121+{
122+ struct regmap *gpr;
123+
124+ gpr = syscon_regmap_lookup_by_compatible("fsl,imx6q-iomuxc-gpr");
125+ if (!IS_ERR(gpr))
126+ regmap_update_bits(gpr, 0x4, 1 << 21, 1 << 21);
127+ else
128+ pr_err("failed to find fsl,imx6q-iomux-gpr regmap\n");
129+
130+}
120131 static void __init imx6q_usb_init(void)
121132 {
122133 struct regmap *anatop;
@@ -153,6 +164,7 @@ static void __init imx6q_init_machine(void) · 30 unmodified lines
153164
154165 imx6q_pm_init();
155166 imx6q_usb_init();
167+ imx6q_1588_init();
156168 }
157169
158170 static struct cpuidle_driver imx6q_cpuidle_driver = {
arch/arm/mach-omap2/omap_hwmod_33xx_data.c+31−0
@@ -674,6 +674,7 @@ static struct omap_hwmod am33xx_cpgmac0_hwmod = { · 673 unmodified lines
674674 .name = "cpgmac0",
675675 .class = &am33xx_cpgmac0_hwmod_class,
676676 .clkdm_name = "cpsw_125mhz_clkdm",
677+ .flags = (HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY),
677678 .mpu_irqs = am33xx_cpgmac0_irqs,
678679 .main_clk = "cpsw_125mhz_gclk",
679680 .prcm = {
@@ -684,6 +685,20 @@ static struct omap_hwmod am33xx_cpgmac0_hwmod = { · 4 unmodified lines
684685 },
685686 };
686687
688+/*
689+ * mdio class
690+ */
691+static struct omap_hwmod_class am33xx_mdio_hwmod_class = {
692+ .name = "davinci_mdio",
693+};
694+
695+static struct omap_hwmod am33xx_mdio_hwmod = {
696+ .name = "davinci_mdio",
697+ .class = &am33xx_mdio_hwmod_class,
698+ .clkdm_name = "cpsw_125mhz_clkdm",
699+ .main_clk = "cpsw_125mhz_gclk",
700+};
701+
687702 /*
688703 * dcan class
689704 */
@@ -2501,6 +2516,21 @@ static struct omap_hwmod_ocp_if am33xx_l4_hs__cpgmac0 = { · 1811 unmodified lines
25012516 .user = OCP_USER_MPU,
25022517 };
25032518
2519+struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
2520+ {
2521+ .pa_start = 0x4A101000,
2522+ .pa_end = 0x4A101000 + SZ_256 - 1,
2523+ },
2524+ { }
2525+};
2526+
2527+struct omap_hwmod_ocp_if am33xx_cpgmac0__mdio = {
2528+ .master = &am33xx_cpgmac0_hwmod,
2529+ .slave = &am33xx_mdio_hwmod,
2530+ .addr = am33xx_mdio_addr_space,
2531+ .user = OCP_USER_MPU,
2532+};
2533+
25042534 static struct omap_hwmod_addr_space am33xx_elm_addr_space[] = {
25052535 {
25062536 .pa_start = 0x48080000,
@@ -3371,6 +3401,7 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { · 864 unmodified lines
33713401 &am33xx_l3_main__tptc2,
33723402 &am33xx_l3_s__usbss,
33733403 &am33xx_l4_hs__cpgmac0,
3404+ &am33xx_cpgmac0__mdio,
33743405 NULL,
33753406 };
33763407
arch/arm/net/bpf_jit_32.c+24−5
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <linux/netdevice.h>
1717 #include <linux/string.h>
1818 #include <linux/slab.h>
19+#include <linux/if_vlan.h>
1920 #include <asm/cacheflush.h>
2021 #include <asm/hwcap.h>
2122
@@ -168,6 +169,8 @@ static inline bool is_load_to_a(u16 inst) · 146 unmodified lines
168169 case BPF_S_ANC_MARK:
169170 case BPF_S_ANC_PROTOCOL:
170171 case BPF_S_ANC_RXHASH:
172+ case BPF_S_ANC_VLAN_TAG:
173+ case BPF_S_ANC_VLAN_TAG_PRESENT:
171174 case BPF_S_ANC_QUEUE:
172175 return true;
173176 default:
@@ -646,6 +649,16 @@ load_ind: · 472 unmodified lines
646649 update_on_xread(ctx);
647650 emit(ARM_ORR_R(r_A, r_A, r_X), ctx);
648651 break;
652+ case BPF_S_ALU_XOR_K:
653+ /* A ^= K; */
654+ OP_IMM3(ARM_EOR, r_A, r_A, k, ctx);
655+ break;
656+ case BPF_S_ANC_ALU_XOR_X:
657+ case BPF_S_ALU_XOR_X:
658+ /* A ^= X */
659+ update_on_xread(ctx);
660+ emit(ARM_EOR_R(r_A, r_A, r_X), ctx);
661+ break;
649662 case BPF_S_ALU_AND_K:
650663 /* A &= K */
651664 OP_IMM3(ARM_AND, r_A, r_A, k, ctx);
@@ -762,11 +775,6 @@ b_epilogue: · 110 unmodified lines
762775 update_on_xread(ctx);
763776 emit(ARM_MOV_R(r_A, r_X), ctx);
764777 break;
765− case BPF_S_ANC_ALU_XOR_X:
766− /* A ^= X */
767− update_on_xread(ctx);
768− emit(ARM_EOR_R(r_A, r_A, r_X), ctx);
769− break;
770778 case BPF_S_ANC_PROTOCOL:
771779 /* A = ntohs(skb->protocol) */
772780 ctx->seen |= SEEN_SKB;
@@ -810,6 +818,17 @@ b_epilogue: · 37 unmodified lines
810818 off = offsetof(struct sk_buff, rxhash);
811819 emit(ARM_LDR_I(r_A, r_skb, off), ctx);
812820 break;
821+ case BPF_S_ANC_VLAN_TAG:
822+ case BPF_S_ANC_VLAN_TAG_PRESENT:
823+ ctx->seen |= SEEN_SKB;
824+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2);
825+ off = offsetof(struct sk_buff, vlan_tci);
826+ emit(ARM_LDRH_I(r_A, r_skb, off), ctx);
827+ if (inst->code == BPF_S_ANC_VLAN_TAG)
828+ OP_IMM3(ARM_AND, r_A, r_A, VLAN_VID_MASK, ctx);
829+ else
830+ OP_IMM3(ARM_AND, r_A, r_A, VLAN_TAG_PRESENT, ctx);
831+ break;
813832 case BPF_S_ANC_QUEUE:
814833 ctx->seen |= SEEN_SKB;
815834 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff,
arch/arm/net/bpf_jit_32.h+2−0
@@ -69,6 +69,7 @@ · 68 unmodified lines
6969 #define ARM_INST_CMP_I 0x03500000
7070
7171 #define ARM_INST_EOR_R 0x00200000
72+#define ARM_INST_EOR_I 0x02200000
7273
7374 #define ARM_INST_LDRB_I 0x05d00000
7475 #define ARM_INST_LDRB_R 0x07d00000
@@ -135,6 +136,7 @@ · 60 unmodified lines
135136 #define ARM_CMP_I(rn, imm) _AL3_I(ARM_INST_CMP, 0, rn, imm)
136137
137138 #define ARM_EOR_R(rd, rn, rm) _AL3_R(ARM_INST_EOR, rd, rn, rm)
139+#define ARM_EOR_I(rd, rn, imm) _AL3_I(ARM_INST_EOR, rd, rn, imm)
138140
139141 #define ARM_LDR_I(rt, rn, off) (ARM_INST_LDR_I | (rt) << 12 | (rn) << 16 \
140142 | (off))
arch/avr32/Kconfig+0−1
@@ -82,7 +82,6 @@ config PLATFORM_AT32AP · 81 unmodified lines
8282 select ARCH_REQUIRE_GPIOLIB
8383 select GENERIC_ALLOCATOR
8484 select HAVE_FB_ATMEL
85− select HAVE_NET_MACB
8685
8786 #
8887 # CPU types
arch/avr32/include/uapi/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 /* Socket filtering */
4141 #define SO_ATTACH_FILTER 26
4242 #define SO_DETACH_FILTER 27
43+#define SO_GET_FILTER SO_ATTACH_FILTER
4344
4445 #define SO_PEERNAME 28
4546 #define SO_TIMESTAMP 29
arch/cris/include/asm/socket.h+1−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
4242 /* Socket filtering */
4343 #define SO_ATTACH_FILTER 26
4444 #define SO_DETACH_FILTER 27
45+#define SO_GET_FILTER SO_ATTACH_FILTER
4546
4647 #define SO_PEERNAME 28
4748 #define SO_TIMESTAMP 29
arch/frv/include/uapi/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 /* Socket filtering */
4141 #define SO_ATTACH_FILTER 26
4242 #define SO_DETACH_FILTER 27
43+#define SO_GET_FILTER SO_ATTACH_FILTER
4344
4445 #define SO_PEERNAME 28
4546 #define SO_TIMESTAMP 29
arch/h8300/include/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 /* Socket filtering */
4141 #define SO_ATTACH_FILTER 26
4242 #define SO_DETACH_FILTER 27
43+#define SO_GET_FILTER SO_ATTACH_FILTER
4344
4445 #define SO_PEERNAME 28
4546 #define SO_TIMESTAMP 29
arch/ia64/include/uapi/asm/socket.h+1−0
@@ -49,6 +49,7 @@ · 48 unmodified lines
4949 /* Socket filtering */
5050 #define SO_ATTACH_FILTER 26
5151 #define SO_DETACH_FILTER 27
52+#define SO_GET_FILTER SO_ATTACH_FILTER
5253
5354 #define SO_PEERNAME 28
5455 #define SO_TIMESTAMP 29
arch/m32r/include/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 /* Socket filtering */
4141 #define SO_ATTACH_FILTER 26
4242 #define SO_DETACH_FILTER 27
43+#define SO_GET_FILTER SO_ATTACH_FILTER
4344
4445 #define SO_PEERNAME 28
4546 #define SO_TIMESTAMP 29
arch/m68k/include/uapi/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 /* Socket filtering */
4141 #define SO_ATTACH_FILTER 26
4242 #define SO_DETACH_FILTER 27
43+#define SO_GET_FILTER SO_ATTACH_FILTER
4344
4445 #define SO_PEERNAME 28
4546 #define SO_TIMESTAMP 29
arch/mips/bcm47xx/nvram.c+2−2
@@ -43,8 +43,8 @@ static void early_nvram_init(void) · 42 unmodified lines
4343 #ifdef CONFIG_BCM47XX_SSB
4444 case BCM47XX_BUS_TYPE_SSB:
4545 mcore_ssb = &bcm47xx_bus.ssb.mipscore;
46− base = mcore_ssb->flash_window;
47− lim = mcore_ssb->flash_window_size;
46+ base = mcore_ssb->pflash.window;
47+ lim = mcore_ssb->pflash.window_size;
4848 break;
4949 #endif
5050 #ifdef CONFIG_BCM47XX_BCMA
arch/mips/bcm47xx/wgt634u.c+4−4
@@ -156,10 +156,10 @@ static int __init wgt634u_init(void) · 155 unmodified lines
156156 SSB_CHIPCO_IRQ_GPIO);
157157 }
158158
159− wgt634u_flash_data.width = mcore->flash_buswidth;
160− wgt634u_flash_resource.start = mcore->flash_window;
161− wgt634u_flash_resource.end = mcore->flash_window
162− + mcore->flash_window_size
159+ wgt634u_flash_data.width = mcore->pflash.buswidth;
160+ wgt634u_flash_resource.start = mcore->pflash.window;
161+ wgt634u_flash_resource.end = mcore->pflash.window
162+ + mcore->pflash.window_size
163163 - 1;
164164 return platform_add_devices(wgt634u_devices,
165165 ARRAY_SIZE(wgt634u_devices));
arch/mips/include/uapi/asm/socket.h+1−0
@@ -63,6 +63,7 @@ To add: #define SO_REUSEPORT 0x0200 /* Allow local address and port reuse. */ · 62 unmodified lines
6363 /* Socket filtering */
6464 #define SO_ATTACH_FILTER 26
6565 #define SO_DETACH_FILTER 27
66+#define SO_GET_FILTER SO_ATTACH_FILTER
6667
6768 #define SO_PEERNAME 28
6869 #define SO_TIMESTAMP 29
arch/mn10300/include/uapi/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
4040 /* Socket filtering */
4141 #define SO_ATTACH_FILTER 26
4242 #define SO_DETACH_FILTER 27
43+#define SO_GET_FILTER SO_ATTACH_FILTER
4344
4445 #define SO_PEERNAME 28
4546 #define SO_TIMESTAMP 29
arch/parisc/include/uapi/asm/socket.h+1−0
@@ -48,6 +48,7 @@ · 47 unmodified lines
4848 /* Socket filtering */
4949 #define SO_ATTACH_FILTER 0x401a
5050 #define SO_DETACH_FILTER 0x401b
51+#define SO_GET_FILTER SO_ATTACH_FILTER
5152
5253 #define SO_ACCEPTCONN 0x401c
5354
arch/powerpc/include/asm/ppc-opcode.h+3−0
@@ -168,9 +168,12 @@ · 167 unmodified lines
168168 #define PPC_INST_AND 0x7c000038
169169 #define PPC_INST_ANDDOT 0x7c000039
170170 #define PPC_INST_OR 0x7c000378
171+#define PPC_INST_XOR 0x7c000278
171172 #define PPC_INST_ANDI 0x70000000
172173 #define PPC_INST_ORI 0x60000000
173174 #define PPC_INST_ORIS 0x64000000
175+#define PPC_INST_XORI 0x68000000
176+#define PPC_INST_XORIS 0x6c000000
174177 #define PPC_INST_NEG 0x7c0000d0
175178 #define PPC_INST_BRANCH 0x48000000
176179 #define PPC_INST_BRANCH_COND 0x40800000
arch/powerpc/include/uapi/asm/socket.h+1−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
4747 /* Socket filtering */
4848 #define SO_ATTACH_FILTER 26
4949 #define SO_DETACH_FILTER 27
50+#define SO_GET_FILTER SO_ATTACH_FILTER
5051
5152 #define SO_PEERNAME 28
5253 #define SO_TIMESTAMP 29
arch/powerpc/net/bpf_jit.h+6−0
@@ -134,6 +134,12 @@ DECLARE_LOAD_FUNC(sk_load_byte_msh); · 133 unmodified lines
134134 ___PPC_RS(a) | IMM_L(i))
135135 #define PPC_ORIS(d, a, i) EMIT(PPC_INST_ORIS | ___PPC_RA(d) | \
136136 ___PPC_RS(a) | IMM_L(i))
137+#define PPC_XOR(d, a, b) EMIT(PPC_INST_XOR | ___PPC_RA(d) | \
138+ ___PPC_RS(a) | ___PPC_RB(b))
139+#define PPC_XORI(d, a, i) EMIT(PPC_INST_XORI | ___PPC_RA(d) | \
140+ ___PPC_RS(a) | IMM_L(i))
141+#define PPC_XORIS(d, a, i) EMIT(PPC_INST_XORIS | ___PPC_RA(d) | \
142+ ___PPC_RS(a) | IMM_L(i))
137143 #define PPC_SLW(d, a, s) EMIT(PPC_INST_SLW | ___PPC_RA(d) | \
138144 ___PPC_RS(a) | ___PPC_RB(s))
139145 #define PPC_SRW(d, a, s) EMIT(PPC_INST_SRW | ___PPC_RA(d) | \
arch/powerpc/net/bpf_jit_comp.c+25−0
@@ -13,6 +13,8 @@ · 12 unmodified lines
1313 #include <asm/cacheflush.h>
1414 #include <linux/netdevice.h>
1515 #include <linux/filter.h>
16+#include <linux/if_vlan.h>
17+
1618 #include "bpf_jit.h"
1719
1820 #ifndef __BIG_ENDIAN
@@ -89,6 +91,8 @@ static void bpf_jit_build_prologue(struct sk_filter *fp, u32 *image, · 70 unmodified lines
8991 case BPF_S_ANC_IFINDEX:
9092 case BPF_S_ANC_MARK:
9193 case BPF_S_ANC_RXHASH:
94+ case BPF_S_ANC_VLAN_TAG:
95+ case BPF_S_ANC_VLAN_TAG_PRESENT:
9296 case BPF_S_ANC_CPU:
9397 case BPF_S_ANC_QUEUE:
9498 case BPF_S_LD_W_ABS:
@@ -232,6 +236,17 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, · 137 unmodified lines
232236 if (K >= 65536)
233237 PPC_ORIS(r_A, r_A, IMM_H(K));
234238 break;
239+ case BPF_S_ANC_ALU_XOR_X:
240+ case BPF_S_ALU_XOR_X: /* A ^= X */
241+ ctx->seen |= SEEN_XREG;
242+ PPC_XOR(r_A, r_A, r_X);
243+ break;
244+ case BPF_S_ALU_XOR_K: /* A ^= K */
245+ if (IMM_L(K))
246+ PPC_XORI(r_A, r_A, IMM_L(K));
247+ if (K >= 65536)
248+ PPC_XORIS(r_A, r_A, IMM_H(K));
249+ break;
235250 case BPF_S_ALU_LSH_X: /* A <<= X; */
236251 ctx->seen |= SEEN_XREG;
237252 PPC_SLW(r_A, r_A, r_X);
@@ -371,6 +386,16 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, · 133 unmodified lines
371386 PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,
372387 rxhash));
373388 break;
389+ case BPF_S_ANC_VLAN_TAG:
390+ case BPF_S_ANC_VLAN_TAG_PRESENT:
391+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2);
392+ PPC_LHZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,
393+ vlan_tci));
394+ if (filter[i].code == BPF_S_ANC_VLAN_TAG)
395+ PPC_ANDI(r_A, r_A, VLAN_VID_MASK);
396+ else
397+ PPC_ANDI(r_A, r_A, VLAN_TAG_PRESENT);
398+ break;
374399 case BPF_S_ANC_QUEUE:
375400 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff,
376401 queue_mapping) != 2);
arch/s390/include/uapi/asm/socket.h+1−0
@@ -46,6 +46,7 @@ · 45 unmodified lines
4646 /* Socket filtering */
4747 #define SO_ATTACH_FILTER 26
4848 #define SO_DETACH_FILTER 27
49+#define SO_GET_FILTER SO_ATTACH_FILTER
4950
5051 #define SO_PEERNAME 28
5152 #define SO_TIMESTAMP 29
arch/sparc/include/uapi/asm/socket.h+1−0
@@ -41,6 +41,7 @@ · 40 unmodified lines
4141
4242 #define SO_ATTACH_FILTER 0x001a
4343 #define SO_DETACH_FILTER 0x001b
44+#define SO_GET_FILTER SO_ATTACH_FILTER
4445
4546 #define SO_PEERNAME 0x001c
4647 #define SO_TIMESTAMP 0x001d
arch/sparc/net/bpf_jit_comp.c+19−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
33 #include <linux/netdevice.h>
44 #include <linux/filter.h>
55 #include <linux/cache.h>
6+#include <linux/if_vlan.h>
67
78 #include <asm/cacheflush.h>
89 #include <asm/ptrace.h>
@@ -312,6 +313,12 @@ do { *prog++ = BR_OPC | WDISP22(OFF); \ · 303 unmodified lines
312313 #define emit_addi(R1, IMM, R3) \
313314 *prog++ = (ADD | IMMED | RS1(R1) | S13(IMM) | RD(R3))
314315
316+#define emit_and(R1, R2, R3) \
317+ *prog++ = (AND | RS1(R1) | RS2(R2) | RD(R3))
318+
319+#define emit_andi(R1, IMM, R3) \
320+ *prog++ = (AND | IMMED | RS1(R1) | S13(IMM) | RD(R3))
321+
315322 #define emit_alloc_stack(SZ) \
316323 *prog++ = (SUB | IMMED | RS1(SP) | S13(SZ) | RD(SP))
317324
@@ -415,6 +422,8 @@ void bpf_jit_compile(struct sk_filter *fp) · 97 unmodified lines
415422 case BPF_S_ANC_IFINDEX:
416423 case BPF_S_ANC_MARK:
417424 case BPF_S_ANC_RXHASH:
425+ case BPF_S_ANC_VLAN_TAG:
426+ case BPF_S_ANC_VLAN_TAG_PRESENT:
418427 case BPF_S_ANC_CPU:
419428 case BPF_S_ANC_QUEUE:
420429 case BPF_S_LD_W_ABS:
@@ -600,6 +609,16 @@ void bpf_jit_compile(struct sk_filter *fp) · 179 unmodified lines
600609 case BPF_S_ANC_RXHASH:
601610 emit_skb_load32(rxhash, r_A);
602611 break;
612+ case BPF_S_ANC_VLAN_TAG:
613+ case BPF_S_ANC_VLAN_TAG_PRESENT:
614+ emit_skb_load16(vlan_tci, r_A);
615+ if (filter[i].code == BPF_S_ANC_VLAN_TAG) {
616+ emit_andi(r_A, VLAN_VID_MASK, r_A);
617+ } else {
618+ emit_loadimm(VLAN_TAG_PRESENT, r_TMP);
619+ emit_and(r_A, r_TMP, r_A);
620+ }
621+ break;
603622
604623 case BPF_S_LD_IMM:
605624 emit_loadimm(K, r_A);
arch/x86/net/bpf_jit_comp.c+21−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #include <asm/cacheflush.h>
1212 #include <linux/netdevice.h>
1313 #include <linux/filter.h>
14+#include <linux/if_vlan.h>
1415
1516 /*
1617 * Conventions :
@@ -212,6 +213,8 @@ void bpf_jit_compile(struct sk_filter *fp) · 195 unmodified lines
212213 case BPF_S_ANC_MARK:
213214 case BPF_S_ANC_RXHASH:
214215 case BPF_S_ANC_CPU:
216+ case BPF_S_ANC_VLAN_TAG:
217+ case BPF_S_ANC_VLAN_TAG_PRESENT:
215218 case BPF_S_ANC_QUEUE:
216219 case BPF_S_LD_W_ABS:
217220 case BPF_S_LD_H_ABS:
@@ -515,6 +518,24 @@ void bpf_jit_compile(struct sk_filter *fp) · 297 unmodified lines
515518 CLEAR_A();
516519 #endif
517520 break;
521+ case BPF_S_ANC_VLAN_TAG:
522+ case BPF_S_ANC_VLAN_TAG_PRESENT:
523+ BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, vlan_tci) != 2);
524+ if (is_imm8(offsetof(struct sk_buff, vlan_tci))) {
525+ /* movzwl off8(%rdi),%eax */
526+ EMIT4(0x0f, 0xb7, 0x47, offsetof(struct sk_buff, vlan_tci));
527+ } else {
528+ EMIT3(0x0f, 0xb7, 0x87); /* movzwl off32(%rdi),%eax */
529+ EMIT(offsetof(struct sk_buff, vlan_tci), 4);
530+ }
531+ BUILD_BUG_ON(VLAN_TAG_PRESENT != 0x1000);
532+ if (filter[i].code == BPF_S_ANC_VLAN_TAG) {
533+ EMIT3(0x80, 0xe4, 0xef); /* and $0xef,%ah */
534+ } else {
535+ EMIT3(0xc1, 0xe8, 0x0c); /* shr $0xc,%eax */
536+ EMIT3(0x83, 0xe0, 0x01); /* and $0x1,%eax */
537+ }
538+ break;
518539 case BPF_S_LD_W_ABS:
519540 func = CHOOSE_LOAD_FUNC(K, sk_load_word);
520541 common_load: seen |= SEEN_DATAREF;
arch/xtensa/include/uapi/asm/socket.h+1−0
@@ -52,6 +52,7 @@ · 51 unmodified lines
5252
5353 #define SO_ATTACH_FILTER 26
5454 #define SO_DETACH_FILTER 27
55+#define SO_GET_FILTER SO_ATTACH_FILTER
5556
5657 #define SO_PEERNAME 28
5758 #define SO_TIMESTAMP 29
drivers/atm/solos-pci.c+35−53
@@ -164,7 +164,6 @@ static void fpga_queue(struct solos_card *card, int port, struct sk_buff *skb, · 163 unmodified lines
164164 static uint32_t fpga_tx(struct solos_card *);
165165 static irqreturn_t solos_irq(int irq, void *dev_id);
166166 static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
167−static int list_vccs(int vci);
168167 static int atm_init(struct solos_card *, struct device *);
169168 static void atm_remove(struct solos_card *);
170169 static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);
@@ -710,7 +709,8 @@ void solos_bh(unsigned long card_arg) · 539 unmodified lines
710709 dev_warn(&card->dev->dev, "Received packet for unknown VPI.VCI %d.%d on port %d\n",
711710 le16_to_cpu(header->vpi), le16_to_cpu(header->vci),
712711 port);
713− continue;
712+ dev_kfree_skb_any(skb);
713+ break;
714714 }
715715 atm_charge(vcc, skb->truesize);
716716 vcc->push(vcc, skb);
@@ -790,44 +790,6 @@ static struct atm_vcc *find_vcc(struct atm_dev *dev, short vpi, int vci) · 73 unmodified lines
790790 return vcc;
791791 }
792792
793−static int list_vccs(int vci)
794−{
795− struct hlist_head *head;
796− struct atm_vcc *vcc;
797− struct hlist_node *node;
798− struct sock *s;
799− int num_found = 0;
800− int i;
801−
802− read_lock(&vcc_sklist_lock);
803− if (vci != 0){
804− head = &vcc_hash[vci & (VCC_HTABLE_SIZE -1)];
805− sk_for_each(s, node, head) {
806− num_found ++;
807− vcc = atm_sk(s);
808− printk(KERN_DEBUG "Device: %d Vpi: %d Vci: %d\n",
809− vcc->dev->number,
810− vcc->vpi,
811− vcc->vci);
812− }
813− } else {
814− for(i = 0; i < VCC_HTABLE_SIZE; i++){
815− head = &vcc_hash[i];
816− sk_for_each(s, node, head) {
817− num_found ++;
818− vcc = atm_sk(s);
819− printk(KERN_DEBUG "Device: %d Vpi: %d Vci: %d\n",
820− vcc->dev->number,
821− vcc->vpi,
822− vcc->vci);
823− }
824− }
825− }
826− read_unlock(&vcc_sklist_lock);
827− return num_found;
828−}
829−
830−
831793 static int popen(struct atm_vcc *vcc)
832794 {
833795 struct solos_card *card = vcc->dev->dev_data;
@@ -840,7 +802,7 @@ static int popen(struct atm_vcc *vcc) · 6 unmodified lines
840802 return -EINVAL;
841803 }
842804
843− skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
805+ skb = alloc_skb(sizeof(*header), GFP_KERNEL);
844806 if (!skb) {
845807 if (net_ratelimit())
846808 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in popen()\n");
@@ -857,8 +819,6 @@ static int popen(struct atm_vcc *vcc) · 10 unmodified lines
857819
858820 set_bit(ATM_VF_ADDR, &vcc->flags);
859821 set_bit(ATM_VF_READY, &vcc->flags);
860− list_vccs(0);
861−
862822
863823 return 0;
864824 }
@@ -866,10 +826,21 @@ static int popen(struct atm_vcc *vcc) · 1 unmodified line
866826 static void pclose(struct atm_vcc *vcc)
867827 {
868828 struct solos_card *card = vcc->dev->dev_data;
869− struct sk_buff *skb;
829+ unsigned char port = SOLOS_CHAN(vcc->dev);
830+ struct sk_buff *skb, *tmpskb;
870831 struct pkt_hdr *header;
871832
872− skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
833+ /* Remove any yet-to-be-transmitted packets from the pending queue */
834+ spin_lock(&card->tx_queue_lock);
835+ skb_queue_walk_safe(&card->tx_queue[port], skb, tmpskb) {
836+ if (SKB_CB(skb)->vcc == vcc) {
837+ skb_unlink(skb, &card->tx_queue[port]);
838+ solos_pop(vcc, skb);
839+ }
840+ }
841+ spin_unlock(&card->tx_queue_lock);
842+
843+ skb = alloc_skb(sizeof(*header), GFP_KERNEL);
873844 if (!skb) {
874845 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in pclose()\n");
875846 return;
@@ -881,15 +852,22 @@ static void pclose(struct atm_vcc *vcc) · 5 unmodified lines
881852 header->vci = cpu_to_le16(vcc->vci);
882853 header->type = cpu_to_le16(PKT_PCLOSE);
883854
884− fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, NULL);
855+ skb_get(skb);
856+ fpga_queue(card, port, skb, NULL);
885857
886− clear_bit(ATM_VF_ADDR, &vcc->flags);
887− clear_bit(ATM_VF_READY, &vcc->flags);
858+ if (!wait_event_timeout(card->param_wq, !skb_shared(skb), 5 * HZ))
859+ dev_warn(&card->dev->dev,
860+ "Timeout waiting for VCC close on port %d\n", port);
861+
862+ dev_kfree_skb(skb);
888863
889864 /* Hold up vcc_destroy_socket() (our caller) until solos_bh() in the
890865 tasklet has finished processing any incoming packets (and, more to
891866 the point, using the vcc pointer). */
892867 tasklet_unlock_wait(&card->tlet);
868+
869+ clear_bit(ATM_VF_ADDR, &vcc->flags);
870+
893871 return;
894872 }
895873
@@ -967,10 +945,11 @@ static uint32_t fpga_tx(struct solos_card *card) · 71 unmodified lines
967945 for (port = 0; tx_pending; tx_pending >>= 1, port++) {
968946 if (tx_pending & 1) {
969947 struct sk_buff *oldskb = card->tx_skb[port];
970− if (oldskb)
948+ if (oldskb) {
971949 pci_unmap_single(card->dev, SKB_CB(oldskb)->dma_addr,
972950 oldskb->len, PCI_DMA_TODEVICE);
973−
951+ card->tx_skb[port] = NULL;
952+ }
974953 spin_lock(&card->tx_queue_lock);
975954 skb = skb_dequeue(&card->tx_queue[port]);
976955 if (!skb)
@@ -1011,9 +990,10 @@ static uint32_t fpga_tx(struct solos_card *card) · 34 unmodified lines
1011990 if (vcc) {
1012991 atomic_inc(&vcc->stats->tx);
1013992 solos_pop(vcc, oldskb);
1014− } else
993+ } else {
1015994 dev_kfree_skb_irq(oldskb);
1016−
995+ wake_up(&card->param_wq);
996+ }
1017997 }
1018998 }
1019999 /* For non-DMA TX, write the 'TX start' bit for all four ports simultaneously */
@@ -1248,7 +1228,7 @@ static int atm_init(struct solos_card *card, struct device *parent) · 228 unmodified lines
12481228 card->atmdev[i]->phy_data = (void *)(unsigned long)i;
12491229 atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_FOUND);
12501230
1251− skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
1231+ skb = alloc_skb(sizeof(*header), GFP_KERNEL);
12521232 if (!skb) {
12531233 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in atm_init()\n");
12541234 continue;
@@ -1345,6 +1325,8 @@ static struct pci_driver fpga_driver = { · 90 unmodified lines
13451325
13461326 static int __init solos_pci_init(void)
13471327 {
1328+ BUILD_BUG_ON(sizeof(struct solos_skb_cb) > sizeof(((struct sk_buff *)0)->cb));
1329+
13481330 printk(KERN_INFO "Solos PCI Driver Version %s\n", VERSION);
13491331 return pci_register_driver(&fpga_driver);
13501332 }
drivers/bcma/bcma_private.h+4−2
@@ -48,8 +48,8 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc); · 47 unmodified lines
4848 #endif /* CONFIG_BCMA_DRIVER_MIPS */
4949
5050 /* driver_chipcommon_pmu.c */
51−u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc);
52−u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc);
51+u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc);
52+u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc);
5353
5454 #ifdef CONFIG_BCMA_SFLASH
5555 /* driver_chipcommon_sflash.c */
@@ -84,6 +84,8 @@ extern void __exit bcma_host_pci_exit(void); · 28 unmodified lines
8484 /* driver_pci.c */
8585 u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
8686
87+extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
88+
8789 #ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
8890 bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc);
8991 void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);
drivers/bcma/driver_chipcommon.c+126−9
@@ -4,12 +4,15 @@ · 3 unmodified lines
44 *
55 * Copyright 2005, Broadcom Corporation
66 * Copyright 2006, 2007, Michael Buesch <m@bues.ch>
7+ * Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de>
78 *
89 * Licensed under the GNU/GPL. See COPYING for details.
910 */
1011
1112 #include "bcma_private.h"
13+#include <linux/bcm47xx_wdt.h>
1214 #include <linux/export.h>
15+#include <linux/platform_device.h>
1316 #include <linux/bcma/bcma.h>
1417
1518 static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,
@@ -22,12 +25,93 @@ static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset, · 6 unmodified lines
2225 return value;
2326 }
2427
25−void bcma_core_chipcommon_init(struct bcma_drv_cc *cc)
28+static u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc)
2629 {
27− u32 leddc_on = 10;
28− u32 leddc_off = 90;
30+ if (cc->capabilities & BCMA_CC_CAP_PMU)
31+ return bcma_pmu_get_alp_clock(cc);
2932
30− if (cc->setup_done)
33+ return 20000000;
34+}
35+
36+static u32 bcma_chipco_watchdog_get_max_timer(struct bcma_drv_cc *cc)
37+{
38+ struct bcma_bus *bus = cc->core->bus;
39+ u32 nb;
40+
41+ if (cc->capabilities & BCMA_CC_CAP_PMU) {
42+ if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
43+ nb = 32;
44+ else if (cc->core->id.rev < 26)
45+ nb = 16;
46+ else
47+ nb = (cc->core->id.rev >= 37) ? 32 : 24;
48+ } else {
49+ nb = 28;
50+ }
51+ if (nb == 32)
52+ return 0xffffffff;
53+ else
54+ return (1 << nb) - 1;
55+}
56+
57+static u32 bcma_chipco_watchdog_timer_set_wdt(struct bcm47xx_wdt *wdt,
58+ u32 ticks)
59+{
60+ struct bcma_drv_cc *cc = bcm47xx_wdt_get_drvdata(wdt);
61+
62+ return bcma_chipco_watchdog_timer_set(cc, ticks);
63+}
64+
65+static u32 bcma_chipco_watchdog_timer_set_ms_wdt(struct bcm47xx_wdt *wdt,
66+ u32 ms)
67+{
68+ struct bcma_drv_cc *cc = bcm47xx_wdt_get_drvdata(wdt);
69+ u32 ticks;
70+
71+ ticks = bcma_chipco_watchdog_timer_set(cc, cc->ticks_per_ms * ms);
72+ return ticks / cc->ticks_per_ms;
73+}
74+
75+static int bcma_chipco_watchdog_ticks_per_ms(struct bcma_drv_cc *cc)
76+{
77+ struct bcma_bus *bus = cc->core->bus;
78+
79+ if (cc->capabilities & BCMA_CC_CAP_PMU) {
80+ if (bus->chipinfo.id == BCMA_CHIP_ID_BCM4706)
81+ /* 4706 CC and PMU watchdogs are clocked at 1/4 of ALP clock */
82+ return bcma_chipco_get_alp_clock(cc) / 4000;
83+ else
84+ /* based on 32KHz ILP clock */
85+ return 32;
86+ } else {
87+ return bcma_chipco_get_alp_clock(cc) / 1000;
88+ }
89+}
90+
91+int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc)
92+{
93+ struct bcm47xx_wdt wdt = {};
94+ struct platform_device *pdev;
95+
96+ wdt.driver_data = cc;
97+ wdt.timer_set = bcma_chipco_watchdog_timer_set_wdt;
98+ wdt.timer_set_ms = bcma_chipco_watchdog_timer_set_ms_wdt;
99+ wdt.max_timer_ms = bcma_chipco_watchdog_get_max_timer(cc) / cc->ticks_per_ms;
100+
101+ pdev = platform_device_register_data(NULL, "bcm47xx-wdt",
102+ cc->core->bus->num, &wdt,
103+ sizeof(wdt));
104+ if (IS_ERR(pdev))
105+ return PTR_ERR(pdev);
106+
107+ cc->watchdog = pdev;
108+
109+ return 0;
110+}
111+
112+void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
113+{
114+ if (cc->early_setup_done)
31115 return;
32116
33117 if (cc->core->id.rev >= 11)
@@ -36,6 +120,22 @@ void bcma_core_chipcommon_init(struct bcma_drv_cc *cc) · 2 unmodified lines
36120 if (cc->core->id.rev >= 35)
37121 cc->capabilities_ext = bcma_cc_read32(cc, BCMA_CC_CAP_EXT);
38122
123+ if (cc->capabilities & BCMA_CC_CAP_PMU)
124+ bcma_pmu_early_init(cc);
125+
126+ cc->early_setup_done = true;
127+}
128+
129+void bcma_core_chipcommon_init(struct bcma_drv_cc *cc)
130+{
131+ u32 leddc_on = 10;
132+ u32 leddc_off = 90;
133+
134+ if (cc->setup_done)
135+ return;
136+
137+ bcma_core_chipcommon_early_init(cc);
138+
39139 if (cc->core->id.rev >= 20) {
40140 bcma_cc_write32(cc, BCMA_CC_GPIOPULLUP, 0);
41141 bcma_cc_write32(cc, BCMA_CC_GPIOPULLDOWN, 0);
@@ -56,15 +156,33 @@ void bcma_core_chipcommon_init(struct bcma_drv_cc *cc) · 14 unmodified lines
56156 ((leddc_on << BCMA_CC_GPIOTIMER_ONTIME_SHIFT) |
57157 (leddc_off << BCMA_CC_GPIOTIMER_OFFTIME_SHIFT)));
58158 }
159+ cc->ticks_per_ms = bcma_chipco_watchdog_ticks_per_ms(cc);
59160
60161 cc->setup_done = true;
61162 }
62163
63164 /* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */
64−void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks)
165+u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks)
65166 {
66− /* instant NMI */
67− bcma_cc_write32(cc, BCMA_CC_WATCHDOG, ticks);
167+ u32 maxt;
168+ enum bcma_clkmode clkmode;
169+
170+ maxt = bcma_chipco_watchdog_get_max_timer(cc);
171+ if (cc->capabilities & BCMA_CC_CAP_PMU) {
172+ if (ticks == 1)
173+ ticks = 2;
174+ else if (ticks > maxt)
175+ ticks = maxt;
176+ bcma_cc_write32(cc, BCMA_CC_PMU_WATCHDOG, ticks);
177+ } else {
178+ clkmode = ticks ? BCMA_CLKMODE_FAST : BCMA_CLKMODE_DYNAMIC;
179+ bcma_core_set_clockmode(cc->core, clkmode);
180+ if (ticks > maxt)
181+ ticks = maxt;
182+ /* instant NMI */
183+ bcma_cc_write32(cc, BCMA_CC_WATCHDOG, ticks);
184+ }
185+ return ticks;
68186 }
69187
70188 void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value)
@@ -118,8 +236,7 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc) · 47 unmodified lines
118236 struct bcma_serial_port *ports = cc->serial_ports;
119237
120238 if (ccrev >= 11 && ccrev != 15) {
121− /* Fixed ALP clock */
122− baud_base = bcma_pmu_alp_clock(cc);
239+ baud_base = bcma_chipco_get_alp_clock(cc);
123240 if (ccrev >= 21) {
124241 /* Turn off UART clock before switching clocksource. */
125242 bcma_cc_write32(cc, BCMA_CC_CORECTL,
drivers/bcma/driver_chipcommon_nflash.c+3−0
@@ -32,6 +32,9 @@ int bcma_nflash_init(struct bcma_drv_cc *cc) · 31 unmodified lines
3232 }
3333
3434 cc->nflash.present = true;
35+ if (cc->core->id.rev == 38 &&
36+ (cc->status & BCMA_CC_CHIPST_5357_NAND_BOOT))
37+ cc->nflash.boot = true;
3538
3639 /* Prepare platform device, but don't register it yet. It's too early,
3740 * malloc (required by device_private_init) is not available yet. */
drivers/bcma/driver_chipcommon_pmu.c+25−19
@@ -144,7 +144,7 @@ static void bcma_pmu_workarounds(struct bcma_drv_cc *cc) · 143 unmodified lines
144144 }
145145 }
146146
147−void bcma_pmu_init(struct bcma_drv_cc *cc)
147+void bcma_pmu_early_init(struct bcma_drv_cc *cc)
148148 {
149149 u32 pmucap;
150150
@@ -153,7 +153,10 @@ void bcma_pmu_init(struct bcma_drv_cc *cc) · 2 unmodified lines
153153
154154 bcma_debug(cc->core->bus, "Found rev %u PMU (capabilities 0x%08X)\n",
155155 cc->pmu.rev, pmucap);
156+}
156157
158+void bcma_pmu_init(struct bcma_drv_cc *cc)
159+{
157160 if (cc->pmu.rev == 1)
158161 bcma_cc_mask32(cc, BCMA_CC_PMU_CTL,
159162 ~BCMA_CC_PMU_CTL_NOILPONW);
@@ -165,7 +168,7 @@ void bcma_pmu_init(struct bcma_drv_cc *cc) · 5 unmodified lines
165168 bcma_pmu_workarounds(cc);
166169 }
167170
168−u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc)
171+u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc)
169172 {
170173 struct bcma_bus *bus = cc->core->bus;
171174
@@ -193,7 +196,7 @@ u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc) · 21 unmodified lines
193196 /* Find the output of the "m" pll divider given pll controls that start with
194197 * pllreg "pll0" i.e. 12 for main 6 for phy, 0 for misc.
195198 */
196−static u32 bcma_pmu_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m)
199+static u32 bcma_pmu_pll_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m)
197200 {
198201 u32 tmp, div, ndiv, p1, p2, fc;
199202 struct bcma_bus *bus = cc->core->bus;
@@ -222,14 +225,14 @@ static u32 bcma_pmu_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m) · 22 unmodified lines
222225 ndiv = (tmp & BCMA_CC_PPL_NDIV_MASK) >> BCMA_CC_PPL_NDIV_SHIFT;
223226
224227 /* Do calculation in Mhz */
225− fc = bcma_pmu_alp_clock(cc) / 1000000;
228+ fc = bcma_pmu_get_alp_clock(cc) / 1000000;
226229 fc = (p1 * ndiv * fc) / p2;
227230
228231 /* Return clock in Hertz */
229232 return (fc / div) * 1000000;
230233 }
231234
232−static u32 bcma_pmu_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m)
235+static u32 bcma_pmu_pll_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m)
233236 {
234237 u32 tmp, ndiv, p1div, p2div;
235238 u32 clock;
@@ -260,7 +263,7 @@ static u32 bcma_pmu_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m) · 24 unmodified lines
260263 }
261264
262265 /* query bus clock frequency for PMU-enabled chipcommon */
263−static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)
266+static u32 bcma_pmu_get_bus_clock(struct bcma_drv_cc *cc)
264267 {
265268 struct bcma_bus *bus = cc->core->bus;
266269
@@ -268,40 +271,42 @@ static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc) · 1 unmodified line
268271 case BCMA_CHIP_ID_BCM4716:
269272 case BCMA_CHIP_ID_BCM4748:
270273 case BCMA_CHIP_ID_BCM47162:
271− return bcma_pmu_clock(cc, BCMA_CC_PMU4716_MAINPLL_PLL0,
272− BCMA_CC_PMU5_MAINPLL_SSB);
274+ return bcma_pmu_pll_clock(cc, BCMA_CC_PMU4716_MAINPLL_PLL0,
275+ BCMA_CC_PMU5_MAINPLL_SSB);
273276 case BCMA_CHIP_ID_BCM5356:
274− return bcma_pmu_clock(cc, BCMA_CC_PMU5356_MAINPLL_PLL0,
275− BCMA_CC_PMU5_MAINPLL_SSB);
277+ return bcma_pmu_pll_clock(cc, BCMA_CC_PMU5356_MAINPLL_PLL0,
278+ BCMA_CC_PMU5_MAINPLL_SSB);
276279 case BCMA_CHIP_ID_BCM5357:
277280 case BCMA_CHIP_ID_BCM4749:
278− return bcma_pmu_clock(cc, BCMA_CC_PMU5357_MAINPLL_PLL0,
279− BCMA_CC_PMU5_MAINPLL_SSB);
281+ return bcma_pmu_pll_clock(cc, BCMA_CC_PMU5357_MAINPLL_PLL0,
282+ BCMA_CC_PMU5_MAINPLL_SSB);
280283 case BCMA_CHIP_ID_BCM4706:
281− return bcma_pmu_clock_bcm4706(cc, BCMA_CC_PMU4706_MAINPLL_PLL0,
282− BCMA_CC_PMU5_MAINPLL_SSB);
284+ return bcma_pmu_pll_clock_bcm4706(cc,
285+ BCMA_CC_PMU4706_MAINPLL_PLL0,
286+ BCMA_CC_PMU5_MAINPLL_SSB);
283287 case BCMA_CHIP_ID_BCM53572:
284288 return 75000000;
285289 default:
286− bcma_warn(bus, "No backplane clock specified for %04X device, pmu rev. %d, using default %d Hz\n",
290+ bcma_warn(bus, "No bus clock specified for %04X device, pmu rev. %d, using default %d Hz\n",
287291 bus->chipinfo.id, cc->pmu.rev, BCMA_CC_PMU_HT_CLOCK);
288292 }
289293 return BCMA_CC_PMU_HT_CLOCK;
290294 }
291295
292296 /* query cpu clock frequency for PMU-enabled chipcommon */
293−u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc)
297+u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc)
294298 {
295299 struct bcma_bus *bus = cc->core->bus;
296300
297301 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53572)
298302 return 300000000;
299303
304+ /* New PMUs can have different clock for bus and CPU */
300305 if (cc->pmu.rev >= 5) {
301306 u32 pll;
302307 switch (bus->chipinfo.id) {
303308 case BCMA_CHIP_ID_BCM4706:
304− return bcma_pmu_clock_bcm4706(cc,
309+ return bcma_pmu_pll_clock_bcm4706(cc,
305310 BCMA_CC_PMU4706_MAINPLL_PLL0,
306311 BCMA_CC_PMU5_MAINPLL_CPU);
307312 case BCMA_CHIP_ID_BCM5356:
@@ -316,10 +321,11 @@ u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc) · 8 unmodified lines
316321 break;
317322 }
318323
319− return bcma_pmu_clock(cc, pll, BCMA_CC_PMU5_MAINPLL_CPU);
324+ return bcma_pmu_pll_clock(cc, pll, BCMA_CC_PMU5_MAINPLL_CPU);
320325 }
321326
322− return bcma_pmu_get_clockcontrol(cc);
327+ /* On old PMUs CPU has the same clock as the bus */
328+ return bcma_pmu_get_bus_clock(cc);
323329 }
324330
325331 static void bcma_pmu_spuravoid_pll_write(struct bcma_drv_cc *cc, u32 offset,
drivers/bcma/driver_chipcommon_sflash.c+32−3
@@ -12,7 +12,7 @@ · 11 unmodified lines
1212
1313 static struct resource bcma_sflash_resource = {
1414 .name = "bcma_sflash",
15− .start = BCMA_SFLASH,
15+ .start = BCMA_SOC_FLASH2,
1616 .end = 0,
1717 .flags = IORESOURCE_MEM | IORESOURCE_READONLY,
1818 };
@@ -31,15 +31,42 @@ struct bcma_sflash_tbl_e { · 12 unmodified lines
3131 };
3232
3333 static struct bcma_sflash_tbl_e bcma_sflash_st_tbl[] = {
34− { "", 0x14, 0x10000, 32, },
34+ { "M25P20", 0x11, 0x10000, 4, },
35+ { "M25P40", 0x12, 0x10000, 8, },
36+
37+ { "M25P16", 0x14, 0x10000, 32, },
38+ { "M25P32", 0x14, 0x10000, 64, },
39+ { "M25P64", 0x16, 0x10000, 128, },
40+ { "M25FL128", 0x17, 0x10000, 256, },
3541 { 0 },
3642 };
3743
3844 static struct bcma_sflash_tbl_e bcma_sflash_sst_tbl[] = {
45+ { "SST25WF512", 1, 0x1000, 16, },
46+ { "SST25VF512", 0x48, 0x1000, 16, },
47+ { "SST25WF010", 2, 0x1000, 32, },
48+ { "SST25VF010", 0x49, 0x1000, 32, },
49+ { "SST25WF020", 3, 0x1000, 64, },
50+ { "SST25VF020", 0x43, 0x1000, 64, },
51+ { "SST25WF040", 4, 0x1000, 128, },
52+ { "SST25VF040", 0x44, 0x1000, 128, },
53+ { "SST25VF040B", 0x8d, 0x1000, 128, },
54+ { "SST25WF080", 5, 0x1000, 256, },
55+ { "SST25VF080B", 0x8e, 0x1000, 256, },
56+ { "SST25VF016", 0x41, 0x1000, 512, },
57+ { "SST25VF032", 0x4a, 0x1000, 1024, },
58+ { "SST25VF064", 0x4b, 0x1000, 2048, },
3959 { 0 },
4060 };
4161
4262 static struct bcma_sflash_tbl_e bcma_sflash_at_tbl[] = {
63+ { "AT45DB011", 0xc, 256, 512, },
64+ { "AT45DB021", 0x14, 256, 1024, },
65+ { "AT45DB041", 0x1c, 256, 2048, },
66+ { "AT45DB081", 0x24, 256, 4096, },
67+ { "AT45DB161", 0x2c, 512, 4096, },
68+ { "AT45DB321", 0x34, 512, 8192, },
69+ { "AT45DB642", 0x3c, 1024, 8192, },
4370 { 0 },
4471 };
4572
@@ -84,6 +111,8 @@ int bcma_sflash_init(struct bcma_drv_cc *cc) · 38 unmodified lines
84111 break;
85112 }
86113 break;
114+ case 0x13:
115+ return -ENOTSUPP;
87116 default:
88117 for (e = bcma_sflash_st_tbl; e->name; e++) {
89118 if (e->id == id)
@@ -116,7 +145,7 @@ int bcma_sflash_init(struct bcma_drv_cc *cc) · 26 unmodified lines
116145 return -ENOTSUPP;
117146 }
118147
119− sflash->window = BCMA_SFLASH;
148+ sflash->window = BCMA_SOC_FLASH2;
120149 sflash->blocksize = e->blocksize;
121150 sflash->numblocks = e->numblocks;
122151 sflash->size = sflash->blocksize * sflash->numblocks;
drivers/bcma/driver_mips.c+33−19
@@ -115,7 +115,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq) · 114 unmodified lines
115115 bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) &
116116 ~(1 << irqflag));
117117 else
118− bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq), 0);
118+ bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(oldirq), 0);
119119
120120 /* assign the new one */
121121 if (irq == 0) {
@@ -171,7 +171,7 @@ u32 bcma_cpu_clock(struct bcma_drv_mips *mcore) · 49 unmodified lines
171171 struct bcma_bus *bus = mcore->core->bus;
172172
173173 if (bus->drv_cc.capabilities & BCMA_CC_CAP_PMU)
174− return bcma_pmu_get_clockcpu(&bus->drv_cc);
174+ return bcma_pmu_get_cpu_clock(&bus->drv_cc);
175175
176176 bcma_err(bus, "No PMU available, need this to get the cpu clock\n");
177177 return 0;
@@ -181,47 +181,66 @@ EXPORT_SYMBOL(bcma_cpu_clock); · 3 unmodified lines
181181 static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
182182 {
183183 struct bcma_bus *bus = mcore->core->bus;
184+ struct bcma_drv_cc *cc = &bus->drv_cc;
184185
185− switch (bus->drv_cc.capabilities & BCMA_CC_CAP_FLASHT) {
186+ switch (cc->capabilities & BCMA_CC_CAP_FLASHT) {
186187 case BCMA_CC_FLASHT_STSER:
187188 case BCMA_CC_FLASHT_ATSER:
188189 bcma_debug(bus, "Found serial flash\n");
189− bcma_sflash_init(&bus->drv_cc);
190+ bcma_sflash_init(cc);
190191 break;
191192 case BCMA_CC_FLASHT_PARA:
192193 bcma_debug(bus, "Found parallel flash\n");
193− bus->drv_cc.pflash.window = 0x1c000000;
194− bus->drv_cc.pflash.window_size = 0x02000000;
194+ cc->pflash.present = true;
195+ cc->pflash.window = BCMA_SOC_FLASH2;
196+ cc->pflash.window_size = BCMA_SOC_FLASH2_SZ;
195197
196− if ((bcma_read32(bus->drv_cc.core, BCMA_CC_FLASH_CFG) &
198+ if ((bcma_read32(cc->core, BCMA_CC_FLASH_CFG) &
197199 BCMA_CC_FLASH_CFG_DS) == 0)
198− bus->drv_cc.pflash.buswidth = 1;
200+ cc->pflash.buswidth = 1;
199201 else
200− bus->drv_cc.pflash.buswidth = 2;
202+ cc->pflash.buswidth = 2;
201203 break;
202204 default:
203205 bcma_err(bus, "Flash type not supported\n");
204206 }
205207
206− if (bus->drv_cc.core->id.rev == 38 ||
208+ if (cc->core->id.rev == 38 ||
207209 bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) {
208− if (bus->drv_cc.capabilities & BCMA_CC_CAP_NFLASH) {
210+ if (cc->capabilities & BCMA_CC_CAP_NFLASH) {
209211 bcma_debug(bus, "Found NAND flash\n");
210− bcma_nflash_init(&bus->drv_cc);
212+ bcma_nflash_init(cc);
211213 }
212214 }
213215 }
214216
217+void bcma_core_mips_early_init(struct bcma_drv_mips *mcore)
218+{
219+ struct bcma_bus *bus = mcore->core->bus;
220+
221+ if (mcore->early_setup_done)
222+ return;
223+
224+ bcma_chipco_serial_init(&bus->drv_cc);
225+ bcma_core_mips_flash_detect(mcore);
226+
227+ mcore->early_setup_done = true;
228+}
229+
215230 void bcma_core_mips_init(struct bcma_drv_mips *mcore)
216231 {
217232 struct bcma_bus *bus;
218233 struct bcma_device *core;
219234 bus = mcore->core->bus;
220235
236+ if (mcore->setup_done)
237+ return;
238+
221239 bcma_info(bus, "Initializing MIPS core...\n");
222240
223− if (!mcore->setup_done)
224− mcore->assigned_irqs = 1;
241+ bcma_core_mips_early_init(mcore);
242+
243+ mcore->assigned_irqs = 1;
225244
226245 /* Assign IRQs to all cores on the bus */
227246 list_for_each_entry(core, &bus->cores, list) {
@@ -256,10 +275,5 @@ void bcma_core_mips_init(struct bcma_drv_mips *mcore) · 28 unmodified lines
256275 bcma_info(bus, "IRQ reconfiguration done\n");
257276 bcma_core_mips_dump_irq(bus);
258277
259− if (mcore->setup_done)
260− return;
261−
262− bcma_chipco_serial_init(&bus->drv_cc);
263− bcma_core_mips_flash_detect(mcore);
264278 mcore->setup_done = true;
265279 }
drivers/bcma/driver_pci_host.c+16−8
@@ -35,11 +35,6 @@ bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc) · 34 unmodified lines
3535 chipid_top != 0x5300)
3636 return false;
3737
38− if (bus->sprom.boardflags_lo & BCMA_CORE_PCI_BFL_NOPCI) {
39− bcma_info(bus, "This PCI core is disabled and not working\n");
40− return false;
41− }
42−
4338 bcma_core_enable(pc->core, 0);
4439
4540 return !mips_busprobe32(tmp, pc->core->io_addr);
@@ -396,6 +391,11 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc) · 350 unmodified lines
396391
397392 bcma_info(bus, "PCIEcore in host mode found\n");
398393
394+ if (bus->sprom.boardflags_lo & BCMA_CORE_PCI_BFL_NOPCI) {
395+ bcma_info(bus, "This PCIE core is disabled and not working\n");
396+ return;
397+ }
398+
399399 pc_host = kzalloc(sizeof(*pc_host), GFP_KERNEL);
400400 if (!pc_host) {
401401 bcma_err(bus, "can not allocate memory");
@@ -452,6 +452,8 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc) · 50 unmodified lines
452452 pc_host->mem_resource.start = BCMA_SOC_PCI_MEM;
453453 pc_host->mem_resource.end = BCMA_SOC_PCI_MEM +
454454 BCMA_SOC_PCI_MEM_SZ - 1;
455+ pc_host->io_resource.start = 0x100;
456+ pc_host->io_resource.end = 0x47F;
455457 pci_membase_1G = BCMA_SOC_PCIE_DMA_H32;
456458 pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,
457459 tmp | BCMA_SOC_PCI_MEM);
@@ -459,6 +461,8 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc) · 1 unmodified line
459461 pc_host->mem_resource.start = BCMA_SOC_PCI1_MEM;
460462 pc_host->mem_resource.end = BCMA_SOC_PCI1_MEM +
461463 BCMA_SOC_PCI_MEM_SZ - 1;
464+ pc_host->io_resource.start = 0x480;
465+ pc_host->io_resource.end = 0x7FF;
462466 pci_membase_1G = BCMA_SOC_PCIE1_DMA_H32;
463467 pc_host->host_cfg_addr = BCMA_SOC_PCI1_CFG;
464468 pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,
@@ -534,7 +538,7 @@ DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, bcma_core_pci_fixup_pcibridge); · 69 unmodified lines
534538 static void bcma_core_pci_fixup_addresses(struct pci_dev *dev)
535539 {
536540 struct resource *res;
537− int pos;
541+ int pos, err;
538542
539543 if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) {
540544 /* This is not a device on the PCI-core bridge. */
@@ -547,8 +551,12 @@ static void bcma_core_pci_fixup_addresses(struct pci_dev *dev) · 6 unmodified lines
547551
548552 for (pos = 0; pos < 6; pos++) {
549553 res = &dev->resource[pos];
550− if (res->flags & (IORESOURCE_IO | IORESOURCE_MEM))
551− pci_assign_resource(dev, pos);
554+ if (res->flags & (IORESOURCE_IO | IORESOURCE_MEM)) {
555+ err = pci_assign_resource(dev, pos);
556+ if (err)
557+ pr_err("PCI: Problem fixing up the addresses on %s\n",
558+ pci_name(dev));
559+ }
552560 }
553561 }
554562 DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, bcma_core_pci_fixup_addresses);
drivers/bcma/host_pci.c+3−3
@@ -238,7 +238,7 @@ static void __devexit bcma_host_pci_remove(struct pci_dev *dev) · 237 unmodified lines
238238 pci_set_drvdata(dev, NULL);
239239 }
240240
241−#ifdef CONFIG_PM
241+#ifdef CONFIG_PM_SLEEP
242242 static int bcma_host_pci_suspend(struct device *dev)
243243 {
244244 struct pci_dev *pdev = to_pci_dev(dev);
@@ -261,11 +261,11 @@ static SIMPLE_DEV_PM_OPS(bcma_pm_ops, bcma_host_pci_suspend, · 16 unmodified lines
261261 bcma_host_pci_resume);
262262 #define BCMA_PM_OPS (&bcma_pm_ops)
263263
264−#else /* CONFIG_PM */
264+#else /* CONFIG_PM_SLEEP */
265265
266266 #define BCMA_PM_OPS NULL
267267
268−#endif /* CONFIG_PM */
268+#endif /* CONFIG_PM_SLEEP */
269269
270270 static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
271271 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },
drivers/bcma/main.c+48−14
@@ -81,6 +81,18 @@ struct bcma_device *bcma_find_core(struct bcma_bus *bus, u16 coreid) · 80 unmodified lines
8181 }
8282 EXPORT_SYMBOL_GPL(bcma_find_core);
8383
84+static struct bcma_device *bcma_find_core_unit(struct bcma_bus *bus, u16 coreid,
85+ u8 unit)
86+{
87+ struct bcma_device *core;
88+
89+ list_for_each_entry(core, &bus->cores, list) {
90+ if (core->id.id == coreid && core->core_unit == unit)
91+ return core;
92+ }
93+ return NULL;
94+}
95+
8496 static void bcma_release_core_dev(struct device *dev)
8597 {
8698 struct bcma_device *core = container_of(dev, struct bcma_device, dev);
@@ -153,6 +165,12 @@ static int bcma_register_cores(struct bcma_bus *bus) · 66 unmodified lines
153165 }
154166 #endif
155167
168+ if (bus->hosttype == BCMA_HOSTTYPE_SOC) {
169+ err = bcma_chipco_watchdog_register(&bus->drv_cc);
170+ if (err)
171+ bcma_err(bus, "Error registering watchdog driver\n");
172+ }
173+
156174 return 0;
157175 }
158176
@@ -165,6 +183,8 @@ static void bcma_unregister_cores(struct bcma_bus *bus) · 6 unmodified lines
165183 if (core->dev_registered)
166184 device_unregister(&core->dev);
167185 }
186+ if (bus->hosttype == BCMA_HOSTTYPE_SOC)
187+ platform_device_unregister(bus->drv_cc.watchdog);
168188 }
169189
170190 int __devinit bcma_bus_register(struct bcma_bus *bus)
@@ -183,6 +203,20 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) · 12 unmodified lines
183203 return -1;
184204 }
185205
206+ /* Early init CC core */
207+ core = bcma_find_core(bus, bcma_cc_core_id(bus));
208+ if (core) {
209+ bus->drv_cc.core = core;
210+ bcma_core_chipcommon_early_init(&bus->drv_cc);
211+ }
212+
213+ /* Try to get SPROM */
214+ err = bcma_sprom_get(bus);
215+ if (err == -ENOENT) {
216+ bcma_err(bus, "No SPROM available\n");
217+ } else if (err)
218+ bcma_err(bus, "Failed to get SPROM: %d\n", err);
219+
186220 /* Init CC core */
187221 core = bcma_find_core(bus, bcma_cc_core_id(bus));
188222 if (core) {
@@ -198,10 +232,17 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) · 9 unmodified lines
198232 }
199233
200234 /* Init PCIE core */
201− core = bcma_find_core(bus, BCMA_CORE_PCIE);
235+ core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 0);
236+ if (core) {
237+ bus->drv_pci[0].core = core;
238+ bcma_core_pci_init(&bus->drv_pci[0]);
239+ }
240+
241+ /* Init PCIE core */
242+ core = bcma_find_core_unit(bus, BCMA_CORE_PCIE, 1);
202243 if (core) {
203− bus->drv_pci.core = core;
204− bcma_core_pci_init(&bus->drv_pci);
244+ bus->drv_pci[1].core = core;
245+ bcma_core_pci_init(&bus->drv_pci[1]);
205246 }
206247
207248 /* Init GBIT MAC COMMON core */
@@ -211,13 +252,6 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) · 3 unmodified lines
211252 bcma_core_gmac_cmn_init(&bus->drv_gmac_cmn);
212253 }
213254
214− /* Try to get SPROM */
215− err = bcma_sprom_get(bus);
216− if (err == -ENOENT) {
217− bcma_err(bus, "No SPROM available\n");
218− } else if (err)
219− bcma_err(bus, "Failed to get SPROM: %d\n", err);
220−
221255 /* Register found cores */
222256 bcma_register_cores(bus);
223257
@@ -275,18 +309,18 @@ int __init bcma_bus_early_register(struct bcma_bus *bus, · 51 unmodified lines
275309 return -1;
276310 }
277311
278− /* Init CC core */
312+ /* Early init CC core */
279313 core = bcma_find_core(bus, bcma_cc_core_id(bus));
280314 if (core) {
281315 bus->drv_cc.core = core;
282− bcma_core_chipcommon_init(&bus->drv_cc);
316+ bcma_core_chipcommon_early_init(&bus->drv_cc);
283317 }
284318
285− /* Init MIPS core */
319+ /* Early init MIPS core */
286320 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K);
287321 if (core) {
288322 bus->drv_mips.core = core;
289− bcma_core_mips_init(&bus->drv_mips);
323+ bcma_core_mips_early_init(&bus->drv_mips);
290324 }
291325
292326 bcma_info(bus, "Early bus registered\n");
drivers/bcma/sprom.c+4−1
@@ -595,8 +595,11 @@ int bcma_sprom_get(struct bcma_bus *bus) · 594 unmodified lines
595595 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true);
596596
597597 err = bcma_sprom_valid(sprom);
598− if (err)
598+ if (err) {
599+ bcma_warn(bus, "invalid sprom read from the PCIe card, try to use fallback sprom\n");
600+ err = bcma_fill_sprom_with_fallback(bus, &bus->sprom);
599601 goto out;
602+ }
600603
601604 bcma_sprom_extract_r8(bus, sprom);
602605
drivers/bluetooth/btmrvl_sdio.c+17−11
@@ -492,7 +492,7 @@ done: · 491 unmodified lines
492492 static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
493493 {
494494 u16 buf_len = 0;
495− int ret, buf_block_len, blksz;
495+ int ret, num_blocks, blksz;
496496 struct sk_buff *skb = NULL;
497497 u32 type;
498498 u8 *payload = NULL;
@@ -514,18 +514,17 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) · 15 unmodified lines
514514 }
515515
516516 blksz = SDIO_BLOCK_SIZE;
517− buf_block_len = (buf_len + blksz - 1) / blksz;
517+ num_blocks = DIV_ROUND_UP(buf_len, blksz);
518518
519519 if (buf_len <= SDIO_HEADER_LEN
520− || (buf_block_len * blksz) > ALLOC_BUF_SIZE) {
520+ || (num_blocks * blksz) > ALLOC_BUF_SIZE) {
521521 BT_ERR("invalid packet length: %d", buf_len);
522522 ret = -EINVAL;
523523 goto exit;
524524 }
525525
526526 /* Allocate buffer */
527− skb = bt_skb_alloc(buf_block_len * blksz + BTSDIO_DMA_ALIGN,
528− GFP_ATOMIC);
527+ skb = bt_skb_alloc(num_blocks * blksz + BTSDIO_DMA_ALIGN, GFP_ATOMIC);
529528 if (skb == NULL) {
530529 BT_ERR("No free skb");
531530 goto exit;
@@ -541,7 +540,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) · 9 unmodified lines
541540 payload = skb->data;
542541
543542 ret = sdio_readsb(card->func, payload, card->ioport,
544− buf_block_len * blksz);
543+ num_blocks * blksz);
545544 if (ret < 0) {
546545 BT_ERR("readsb failed: %d", ret);
547546 ret = -EIO;
@@ -553,7 +552,16 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) · 5 unmodified lines
553552 */
554553
555554 buf_len = payload[0];
556− buf_len |= (u16) payload[1] << 8;
555+ buf_len |= payload[1] << 8;
556+ buf_len |= payload[2] << 16;
557+
558+ if (buf_len > blksz * num_blocks) {
559+ BT_ERR("Skip incorrect packet: hdrlen %d buffer %d",
560+ buf_len, blksz * num_blocks);
561+ ret = -EIO;
562+ goto exit;
563+ }
564+
557565 type = payload[3];
558566
559567 switch (type) {
@@ -589,8 +597,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) · 29 unmodified lines
589597
590598 default:
591599 BT_ERR("Unknown packet type:%d", type);
592− print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, payload,
593− blksz * buf_block_len);
600+ BT_ERR("hex: %*ph", blksz * num_blocks, payload);
594601
595602 kfree_skb(skb);
596603 skb = NULL;
@@ -849,8 +856,7 @@ static int btmrvl_sdio_host_to_card(struct btmrvl_private *priv, · 252 unmodified lines
849856 if (ret < 0) {
850857 i++;
851858 BT_ERR("i=%d writesb failed: %d", i, ret);
852− print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
853− payload, nb);
859+ BT_ERR("hex: %*ph", nb, payload);
854860 ret = -EIO;
855861 if (i > MAX_WRITE_IOMEM_RETRY)
856862 goto exit;
drivers/bluetooth/btusb.c+1−0
@@ -96,6 +96,7 @@ static struct usb_device_id btusb_table[] = { · 95 unmodified lines
9696 { USB_DEVICE(0x0c10, 0x0000) },
9797
9898 /* Broadcom BCM20702A0 */
99+ { USB_DEVICE(0x0b05, 0x17b5) },
99100 { USB_DEVICE(0x04ca, 0x2003) },
100101 { USB_DEVICE(0x0489, 0xe042) },
101102 { USB_DEVICE(0x413c, 0x8197) },
drivers/dma/ioat/dca.c+23−0
@@ -604,6 +604,23 @@ static int ioat3_dca_count_dca_slots(void *iobase, u16 dca_offset) · 603 unmodified lines
604604 return slots;
605605 }
606606
607+static inline int dca3_tag_map_invalid(u8 *tag_map)
608+{
609+ /*
610+ * If the tag map is not programmed by the BIOS the default is:
611+ * 0x80 0x80 0x80 0x80 0x80 0x00 0x00 0x00
612+ *
613+ * This an invalid map and will result in only 2 possible tags
614+ * 0x1F and 0x00. 0x00 is an invalid DCA tag so we know that
615+ * this entire definition is invalid.
616+ */
617+ return ((tag_map[0] == DCA_TAG_MAP_VALID) &&
618+ (tag_map[1] == DCA_TAG_MAP_VALID) &&
619+ (tag_map[2] == DCA_TAG_MAP_VALID) &&
620+ (tag_map[3] == DCA_TAG_MAP_VALID) &&
621+ (tag_map[4] == DCA_TAG_MAP_VALID));
622+}
623+
607624 struct dca_provider * __devinit
608625 ioat3_dca_init(struct pci_dev *pdev, void __iomem *iobase)
609626 {
@@ -674,6 +691,12 @@ ioat3_dca_init(struct pci_dev *pdev, void __iomem *iobase) · 64 unmodified lines
674691 ioatdca->tag_map[i] = bit & DCA_TAG_MAP_MASK;
675692 }
676693
694+ if (dca3_tag_map_invalid(ioatdca->tag_map)) {
695+ dev_err(&pdev->dev, "APICID_TAG_MAP set incorrectly by BIOS, disabling DCA\n");
696+ free_dca_provider(dca);
697+ return NULL;
698+ }
699+
677700 err = register_dca_provider(dca, &pdev->dev);
678701 if (err) {
679702 free_dca_provider(dca);
drivers/isdn/hardware/mISDN/hfcpci.c+1−1
@@ -490,7 +490,7 @@ receive_dmsg(struct hfc_pci *hc) · 489 unmodified lines
490490 (df->data[le16_to_cpu(zp->z1)])) {
491491 if (dch->debug & DEBUG_HW)
492492 printk(KERN_DEBUG
493− "empty_fifo hfcpci paket inv. len "
493+ "empty_fifo hfcpci packet inv. len "
494494 "%d or crc %d\n",
495495 rcnt,
496496 df->data[le16_to_cpu(zp->z1)]);
drivers/isdn/hardware/mISDN/mISDNisar.c+1−1
@@ -1302,7 +1302,7 @@ modeisar(struct isar_ch *ch, u32 bprotocol) · 1301 unmodified lines
13021302 &ch->is->Flags))
13031303 ch->dpath = 1;
13041304 else {
1305− pr_info("modeisar both pathes in use\n");
1305+ pr_info("modeisar both paths in use\n");
13061306 return -EBUSY;
13071307 }
13081308 if (bprotocol == ISDN_P_B_HDLC)
drivers/isdn/hisax/callc.c+1−1
@@ -35,7 +35,7 @@ static int chancount; · 34 unmodified lines
3535 /* experimental REJECT after ALERTING for CALLBACK to beat the 4s delay */
3636 #define ALERT_REJECT 0
3737
38−/* Value to delay the sending of the first B-channel paket after CONNECT
38+/* Value to delay the sending of the first B-channel packet after CONNECT
3939 * here is no value given by ITU, but experience shows that 300 ms will
4040 * work on many networks, if you or your other side is behind local exchanges
4141 * a greater value may be recommented. If the delay is to short the first paket
drivers/isdn/hisax/hfc_pci.c+1−1
@@ -354,7 +354,7 @@ receive_dmsg(struct IsdnCardState *cs) · 353 unmodified lines
354354 if ((rcnt > MAX_DFRAME_LEN + 3) || (rcnt < 4) ||
355355 (df->data[zp->z1])) {
356356 if (cs->debug & L1_DEB_WARN)
357− debugl1(cs, "empty_fifo hfcpci paket inv. len %d or crc %d", rcnt, df->data[zp->z1]);
357+ debugl1(cs, "empty_fifo hfcpci packet inv. len %d or crc %d", rcnt, df->data[zp->z1]);
358358 #ifdef ERROR_STATISTIC
359359 cs->err_rx++;
360360 #endif
drivers/isdn/hisax/hfc_sx.c+1−1
@@ -270,7 +270,7 @@ read_fifo(struct IsdnCardState *cs, u_char fifo, int trans_max) · 269 unmodified lines
270270
271271 if ((count > fifo_size) || (count < 4)) {
272272 if (cs->debug & L1_DEB_WARN)
273− debugl1(cs, "hfcsx_read_fifo %d paket inv. len %d ", fifo , count);
273+ debugl1(cs, "hfcsx_read_fifo %d packet inv. len %d ", fifo , count);
274274 while (count) {
275275 count--; /* empty fifo */
276276 Read_hfc(cs, HFCSX_FIF_DRD);
drivers/isdn/mISDN/l1oip_core.c+1−4
@@ -277,7 +277,6 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask, · 276 unmodified lines
277277 u16 timebase, u8 *buf, int len)
278278 {
279279 u8 *p;
280− int multi = 0;
281280 u8 frame[len + 32];
282281 struct socket *socket = NULL;
283282
@@ -317,9 +316,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask, · 33 unmodified lines
317316 *p++ = hc->id >> 8;
318317 *p++ = hc->id;
319318 }
320− *p++ = (multi == 1) ? 0x80 : 0x00 + channel; /* m-flag, channel */
321− if (multi == 1)
322− *p++ = len; /* length */
319+ *p++ = 0x00 + channel; /* m-flag, channel */
323320 *p++ = timebase >> 8; /* time base */
324321 *p++ = timebase;
325322
drivers/isdn/mISDN/tei.c+10−10
@@ -250,7 +250,7 @@ tei_debug(struct FsmInst *fi, char *fmt, ...) · 249 unmodified lines
250250 static int
251251 get_free_id(struct manager *mgr)
252252 {
253− u64 ids = 0;
253+ DECLARE_BITMAP(ids, 64) = { [0 ... BITS_TO_LONGS(64) - 1] = 0 };
254254 int i;
255255 struct layer2 *l2;
256256
@@ -261,11 +261,11 @@ get_free_id(struct manager *mgr) · 4 unmodified lines
261261 __func__);
262262 return -EBUSY;
263263 }
264− test_and_set_bit(l2->ch.nr, (u_long *)&ids);
264+ __set_bit(l2->ch.nr, ids);
265265 }
266− for (i = 1; i < 64; i++)
267− if (!test_bit(i, (u_long *)&ids))
268− return i;
266+ i = find_next_zero_bit(ids, 64, 1);
267+ if (i < 64)
268+ return i;
269269 printk(KERN_WARNING "%s: more as 63 layer2 for one device\n",
270270 __func__);
271271 return -EBUSY;
@@ -274,7 +274,7 @@ get_free_id(struct manager *mgr) · 2 unmodified lines
274274 static int
275275 get_free_tei(struct manager *mgr)
276276 {
277− u64 ids = 0;
277+ DECLARE_BITMAP(ids, 64) = { [0 ... BITS_TO_LONGS(64) - 1] = 0 };
278278 int i;
279279 struct layer2 *l2;
280280
@@ -288,11 +288,11 @@ get_free_tei(struct manager *mgr) · 7 unmodified lines
288288 continue;
289289 i -= 64;
290290
291− test_and_set_bit(i, (u_long *)&ids);
291+ __set_bit(i, ids);
292292 }
293− for (i = 0; i < 64; i++)
294− if (!test_bit(i, (u_long *)&ids))
295− return i + 64;
293+ i = find_first_zero_bit(ids, 64);
294+ if (i < 64)
295+ return i + 64;
296296 printk(KERN_WARNING "%s: more as 63 dynamic tei for one device\n",
297297 __func__);
298298 return -1;
drivers/isdn/pcbit/layer2.c+1−1
@@ -508,7 +508,7 @@ pcbit_irq_handler(int interrupt, void *devptr) · 507 unmodified lines
508508 return IRQ_NONE;
509509 }
510510 if (dev->interrupt) {
511− printk(KERN_DEBUG "pcbit: reentering interrupt hander\n");
511+ printk(KERN_DEBUG "pcbit: reentering interrupt handler\n");
512512 return IRQ_HANDLED;
513513 }
514514 dev->interrupt = 1;
drivers/net/arcnet/com20020-pci.c+3−3
@@ -61,7 +61,7 @@ module_param(clockp, int, 0); · 60 unmodified lines
6161 module_param(clockm, int, 0);
6262 MODULE_LICENSE("GPL");
6363
64−static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
64+static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
6565 {
6666 struct net_device *dev;
6767 struct arcnet_local *lp;
@@ -135,7 +135,7 @@ out_dev: · 67 unmodified lines
135135 return err;
136136 }
137137
138−static void __devexit com20020pci_remove(struct pci_dev *pdev)
138+static void com20020pci_remove(struct pci_dev *pdev)
139139 {
140140 struct net_device *dev = pci_get_drvdata(pdev);
141141 unregister_netdev(dev);
@@ -178,7 +178,7 @@ static struct pci_driver com20020pci_driver = { · 36 unmodified lines
178178 .name = "com20020",
179179 .id_table = com20020pci_id_table,
180180 .probe = com20020pci_probe,
181− .remove = __devexit_p(com20020pci_remove),
181+ .remove = com20020pci_remove,
182182 };
183183
184184 static int __init com20020pci_init(void)
drivers/net/bonding/bond_alb.c+163−34
@@ -84,6 +84,10 @@ static inline struct arp_pkt *arp_pkt(const struct sk_buff *skb) · 83 unmodified lines
8484
8585 /* Forward declaration */
8686 static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]);
87+static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp);
88+static void rlb_src_unlink(struct bonding *bond, u32 index);
89+static void rlb_src_link(struct bonding *bond, u32 ip_src_hash,
90+ u32 ip_dst_hash);
8791
8892 static inline u8 _simple_hash(const u8 *hash_start, int hash_size)
8993 {
@@ -354,6 +358,18 @@ static int rlb_arp_recv(const struct sk_buff *skb, struct bonding *bond, · 264 unmodified lines
354358 if (!arp)
355359 goto out;
356360
361+ /* We received an ARP from arp->ip_src.
362+ * We might have used this IP address previously (on the bonding host
363+ * itself or on a system that is bridged together with the bond).
364+ * However, if arp->mac_src is different than what is stored in
365+ * rx_hashtbl, some other host is now using the IP and we must prevent
366+ * sending out client updates with this IP address and the old MAC
367+ * address.
368+ * Clean up all hash table entries that have this address as ip_src but
369+ * have a different mac_src.
370+ */
371+ rlb_purge_src_ip(bond, arp);
372+
357373 if (arp->op_code == htons(ARPOP_REPLY)) {
358374 /* update rx hash table for this ARP */
359375 rlb_update_entry_from_arp(bond, arp);
@@ -432,9 +448,9 @@ static void rlb_clear_slave(struct bonding *bond, struct slave *slave) · 72 unmodified lines
432448 _lock_rx_hashtbl_bh(bond);
433449
434450 rx_hash_table = bond_info->rx_hashtbl;
435− index = bond_info->rx_hashtbl_head;
451+ index = bond_info->rx_hashtbl_used_head;
436452 for (; index != RLB_NULL_INDEX; index = next_index) {
437− next_index = rx_hash_table[index].next;
453+ next_index = rx_hash_table[index].used_next;
438454 if (rx_hash_table[index].slave == slave) {
439455 struct slave *assigned_slave = rlb_next_rx_slave(bond);
440456
@@ -519,8 +535,9 @@ static void rlb_update_rx_clients(struct bonding *bond) · 78 unmodified lines
519535
520536 _lock_rx_hashtbl_bh(bond);
521537
522− hash_index = bond_info->rx_hashtbl_head;
523− for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
538+ hash_index = bond_info->rx_hashtbl_used_head;
539+ for (; hash_index != RLB_NULL_INDEX;
540+ hash_index = client_info->used_next) {
524541 client_info = &(bond_info->rx_hashtbl[hash_index]);
525542 if (client_info->ntt) {
526543 rlb_update_client(client_info);
@@ -548,8 +565,9 @@ static void rlb_req_update_slave_clients(struct bonding *bond, struct slave *sla · 21 unmodified lines
548565
549566 _lock_rx_hashtbl_bh(bond);
550567
551− hash_index = bond_info->rx_hashtbl_head;
552− for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
568+ hash_index = bond_info->rx_hashtbl_used_head;
569+ for (; hash_index != RLB_NULL_INDEX;
570+ hash_index = client_info->used_next) {
553571 client_info = &(bond_info->rx_hashtbl[hash_index]);
554572
555573 if ((client_info->slave == slave) &&
@@ -578,8 +596,9 @@ static void rlb_req_update_subnet_clients(struct bonding *bond, __be32 src_ip) · 22 unmodified lines
578596
579597 _lock_rx_hashtbl(bond);
580598
581− hash_index = bond_info->rx_hashtbl_head;
582− for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
599+ hash_index = bond_info->rx_hashtbl_used_head;
600+ for (; hash_index != RLB_NULL_INDEX;
601+ hash_index = client_info->used_next) {
583602 client_info = &(bond_info->rx_hashtbl[hash_index]);
584603
585604 if (!client_info->slave) {
@@ -625,6 +644,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon · 39 unmodified lines
625644 /* update mac address from arp */
626645 memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN);
627646 }
647+ memcpy(client_info->mac_src, arp->mac_src, ETH_ALEN);
628648
629649 assigned_slave = client_info->slave;
630650 if (assigned_slave) {
@@ -647,6 +667,17 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon · 16 unmodified lines
647667 assigned_slave = rlb_next_rx_slave(bond);
648668
649669 if (assigned_slave) {
670+ if (!(client_info->assigned &&
671+ client_info->ip_src == arp->ip_src)) {
672+ /* ip_src is going to be updated,
673+ * fix the src hash list
674+ */
675+ u32 hash_src = _simple_hash((u8 *)&arp->ip_src,
676+ sizeof(arp->ip_src));
677+ rlb_src_unlink(bond, hash_index);
678+ rlb_src_link(bond, hash_src, hash_index);
679+ }
680+
650681 client_info->ip_src = arp->ip_src;
651682 client_info->ip_dst = arp->ip_dst;
652683 /* arp->mac_dst is broadcast for arp reqeusts.
@@ -654,6 +685,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon · 1 unmodified line
654685 * upon receiving an arp reply.
655686 */
656687 memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN);
688+ memcpy(client_info->mac_src, arp->mac_src, ETH_ALEN);
657689 client_info->slave = assigned_slave;
658690
659691 if (!ether_addr_equal_64bits(client_info->mac_dst, mac_bcast)) {
@@ -669,11 +701,11 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon · 9 unmodified lines
669701 }
670702
671703 if (!client_info->assigned) {
672− u32 prev_tbl_head = bond_info->rx_hashtbl_head;
673− bond_info->rx_hashtbl_head = hash_index;
674− client_info->next = prev_tbl_head;
704+ u32 prev_tbl_head = bond_info->rx_hashtbl_used_head;
705+ bond_info->rx_hashtbl_used_head = hash_index;
706+ client_info->used_next = prev_tbl_head;
675707 if (prev_tbl_head != RLB_NULL_INDEX) {
676− bond_info->rx_hashtbl[prev_tbl_head].prev =
708+ bond_info->rx_hashtbl[prev_tbl_head].used_prev =
677709 hash_index;
678710 }
679711 client_info->assigned = 1;
@@ -694,6 +726,12 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) · 14 unmodified lines
694726 struct arp_pkt *arp = arp_pkt(skb);
695727 struct slave *tx_slave = NULL;
696728
729+ /* Don't modify or load balance ARPs that do not originate locally
730+ * (e.g.,arrive via a bridge).
731+ */
732+ if (!bond_slave_has_mac(bond, arp->mac_src))
733+ return NULL;
734+
697735 if (arp->op_code == htons(ARPOP_REPLY)) {
698736 /* the arp must be sent on the selected
699737 * rx channel
@@ -740,8 +778,9 @@ static void rlb_rebalance(struct bonding *bond) · 40 unmodified lines
740778 _lock_rx_hashtbl_bh(bond);
741779
742780 ntt = 0;
743− hash_index = bond_info->rx_hashtbl_head;
744− for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
781+ hash_index = bond_info->rx_hashtbl_used_head;
782+ for (; hash_index != RLB_NULL_INDEX;
783+ hash_index = client_info->used_next) {
745784 client_info = &(bond_info->rx_hashtbl[hash_index]);
746785 assigned_slave = rlb_next_rx_slave(bond);
747786 if (assigned_slave && (client_info->slave != assigned_slave)) {
@@ -759,11 +798,113 @@ static void rlb_rebalance(struct bonding *bond) · 11 unmodified lines
759798 }
760799
761800 /* Caller must hold rx_hashtbl lock */
801+static void rlb_init_table_entry_dst(struct rlb_client_info *entry)
802+{
803+ entry->used_next = RLB_NULL_INDEX;
804+ entry->used_prev = RLB_NULL_INDEX;
805+ entry->assigned = 0;
806+ entry->slave = NULL;
807+ entry->tag = 0;
808+}
809+static void rlb_init_table_entry_src(struct rlb_client_info *entry)
810+{
811+ entry->src_first = RLB_NULL_INDEX;
812+ entry->src_prev = RLB_NULL_INDEX;
813+ entry->src_next = RLB_NULL_INDEX;
814+}
815+
762816 static void rlb_init_table_entry(struct rlb_client_info *entry)
763817 {
764818 memset(entry, 0, sizeof(struct rlb_client_info));
765− entry->next = RLB_NULL_INDEX;
766− entry->prev = RLB_NULL_INDEX;
819+ rlb_init_table_entry_dst(entry);
820+ rlb_init_table_entry_src(entry);
821+}
822+
823+static void rlb_delete_table_entry_dst(struct bonding *bond, u32 index)
824+{
825+ struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
826+ u32 next_index = bond_info->rx_hashtbl[index].used_next;
827+ u32 prev_index = bond_info->rx_hashtbl[index].used_prev;
828+
829+ if (index == bond_info->rx_hashtbl_used_head)
830+ bond_info->rx_hashtbl_used_head = next_index;
831+ if (prev_index != RLB_NULL_INDEX)
832+ bond_info->rx_hashtbl[prev_index].used_next = next_index;
833+ if (next_index != RLB_NULL_INDEX)
834+ bond_info->rx_hashtbl[next_index].used_prev = prev_index;
835+}
836+
837+/* unlink a rlb hash table entry from the src list */
838+static void rlb_src_unlink(struct bonding *bond, u32 index)
839+{
840+ struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
841+ u32 next_index = bond_info->rx_hashtbl[index].src_next;
842+ u32 prev_index = bond_info->rx_hashtbl[index].src_prev;
843+
844+ bond_info->rx_hashtbl[index].src_next = RLB_NULL_INDEX;
845+ bond_info->rx_hashtbl[index].src_prev = RLB_NULL_INDEX;
846+
847+ if (next_index != RLB_NULL_INDEX)
848+ bond_info->rx_hashtbl[next_index].src_prev = prev_index;
849+
850+ if (prev_index == RLB_NULL_INDEX)
851+ return;
852+
853+ /* is prev_index pointing to the head of this list? */
854+ if (bond_info->rx_hashtbl[prev_index].src_first == index)
855+ bond_info->rx_hashtbl[prev_index].src_first = next_index;
856+ else
857+ bond_info->rx_hashtbl[prev_index].src_next = next_index;
858+
859+}
860+
861+static void rlb_delete_table_entry(struct bonding *bond, u32 index)
862+{
863+ struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
864+ struct rlb_client_info *entry = &(bond_info->rx_hashtbl[index]);
865+
866+ rlb_delete_table_entry_dst(bond, index);
867+ rlb_init_table_entry_dst(entry);
868+
869+ rlb_src_unlink(bond, index);
870+}
871+
872+/* add the rx_hashtbl[ip_dst_hash] entry to the list
873+ * of entries with identical ip_src_hash
874+ */
875+static void rlb_src_link(struct bonding *bond, u32 ip_src_hash, u32 ip_dst_hash)
876+{
877+ struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
878+ u32 next;
879+
880+ bond_info->rx_hashtbl[ip_dst_hash].src_prev = ip_src_hash;
881+ next = bond_info->rx_hashtbl[ip_src_hash].src_first;
882+ bond_info->rx_hashtbl[ip_dst_hash].src_next = next;
883+ if (next != RLB_NULL_INDEX)
884+ bond_info->rx_hashtbl[next].src_prev = ip_dst_hash;
885+ bond_info->rx_hashtbl[ip_src_hash].src_first = ip_dst_hash;
886+}
887+
888+/* deletes all rx_hashtbl entries with arp->ip_src if their mac_src does
889+ * not match arp->mac_src */
890+static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp)
891+{
892+ struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
893+ u32 ip_src_hash = _simple_hash((u8*)&(arp->ip_src), sizeof(arp->ip_src));
894+ u32 index;
895+
896+ _lock_rx_hashtbl_bh(bond);
897+
898+ index = bond_info->rx_hashtbl[ip_src_hash].src_first;
899+ while (index != RLB_NULL_INDEX) {
900+ struct rlb_client_info *entry = &(bond_info->rx_hashtbl[index]);
901+ u32 next_index = entry->src_next;
902+ if (entry->ip_src == arp->ip_src &&
903+ !ether_addr_equal_64bits(arp->mac_src, entry->mac_src))
904+ rlb_delete_table_entry(bond, index);
905+ index = next_index;
906+ }
907+ _unlock_rx_hashtbl_bh(bond);
767908 }
768909
769910 static int rlb_initialize(struct bonding *bond)
@@ -781,7 +922,7 @@ static int rlb_initialize(struct bonding *bond) · 11 unmodified lines
781922
782923 bond_info->rx_hashtbl = new_hashtbl;
783924
784− bond_info->rx_hashtbl_head = RLB_NULL_INDEX;
925+ bond_info->rx_hashtbl_used_head = RLB_NULL_INDEX;
785926
786927 for (i = 0; i < RLB_HASH_TABLE_SIZE; i++) {
787928 rlb_init_table_entry(bond_info->rx_hashtbl + i);
@@ -803,7 +944,7 @@ static void rlb_deinitialize(struct bonding *bond) · 15 unmodified lines
803944
804945 kfree(bond_info->rx_hashtbl);
805946 bond_info->rx_hashtbl = NULL;
806− bond_info->rx_hashtbl_head = RLB_NULL_INDEX;
947+ bond_info->rx_hashtbl_used_head = RLB_NULL_INDEX;
807948
808949 _unlock_rx_hashtbl_bh(bond);
809950 }
@@ -815,25 +956,13 @@ static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id) · 5 unmodified lines
815956
816957 _lock_rx_hashtbl_bh(bond);
817958
818− curr_index = bond_info->rx_hashtbl_head;
959+ curr_index = bond_info->rx_hashtbl_used_head;
819960 while (curr_index != RLB_NULL_INDEX) {
820961 struct rlb_client_info *curr = &(bond_info->rx_hashtbl[curr_index]);
821− u32 next_index = bond_info->rx_hashtbl[curr_index].next;
822− u32 prev_index = bond_info->rx_hashtbl[curr_index].prev;
823−
824− if (curr->tag && (curr->vlan_id == vlan_id)) {
825− if (curr_index == bond_info->rx_hashtbl_head) {
826− bond_info->rx_hashtbl_head = next_index;
827− }
828− if (prev_index != RLB_NULL_INDEX) {
829− bond_info->rx_hashtbl[prev_index].next = next_index;
830− }
831− if (next_index != RLB_NULL_INDEX) {
832− bond_info->rx_hashtbl[next_index].prev = prev_index;
833− }
962+ u32 next_index = bond_info->rx_hashtbl[curr_index].used_next;
834963
835− rlb_init_table_entry(curr);
836− }
964+ if (curr->tag && (curr->vlan_id == vlan_id))
965+ rlb_delete_table_entry(bond, curr_index);
837966
838967 curr_index = next_index;
839968 }
drivers/net/bonding/bond_alb.h+24−4
@@ -94,15 +94,35 @@ struct tlb_client_info { · 93 unmodified lines
9494
9595 /* -------------------------------------------------------------------------
9696 * struct rlb_client_info contains all info related to a specific rx client
97− * connection. This is the Clients Hash Table entry struct
97+ * connection. This is the Clients Hash Table entry struct.
98+ * Note that this is not a proper hash table; if a new client's IP address
99+ * hash collides with an existing client entry, the old entry is replaced.
100+ *
101+ * There is a linked list (linked by the used_next and used_prev members)
102+ * linking all the used entries of the hash table. This allows updating
103+ * all the clients without walking over all the unused elements of the table.
104+ *
105+ * There are also linked lists of entries with identical hash(ip_src). These
106+ * allow cleaning up the table from ip_src<->mac_src associations that have
107+ * become outdated and would cause sending out invalid ARP updates to the
108+ * network. These are linked by the (src_next and src_prev members).
98109 * -------------------------------------------------------------------------
99110 */
100111 struct rlb_client_info {
101112 __be32 ip_src; /* the server IP address */
102113 __be32 ip_dst; /* the client IP address */
114+ u8 mac_src[ETH_ALEN]; /* the server MAC address */
103115 u8 mac_dst[ETH_ALEN]; /* the client MAC address */
104− u32 next; /* The next Hash table entry index */
105− u32 prev; /* The previous Hash table entry index */
116+
117+ /* list of used hash table entries, starting at rx_hashtbl_used_head */
118+ u32 used_next;
119+ u32 used_prev;
120+
121+ /* ip_src based hashing */
122+ u32 src_next; /* next entry with same hash(ip_src) */
123+ u32 src_prev; /* prev entry with same hash(ip_src) */
124+ u32 src_first; /* first entry with hash(ip_src) == this entry's index */
125+
106126 u8 assigned; /* checking whether this entry is assigned */
107127 u8 ntt; /* flag - need to transmit client info */
108128 struct slave *slave; /* the slave assigned to this client */
@@ -131,7 +151,7 @@ struct alb_bond_info { · 22 unmodified lines
131151 int rlb_enabled;
132152 struct rlb_client_info *rx_hashtbl; /* Receive hash table */
133153 spinlock_t rx_hashtbl_lock;
134− u32 rx_hashtbl_head;
154+ u32 rx_hashtbl_used_head;
135155 u8 rx_ntt; /* flag - need to transmit
136156 * to all rx clients
137157 */
drivers/net/bonding/bond_debugfs.c+3−2
@@ -31,8 +31,9 @@ static int bond_debug_rlb_hash_show(struct seq_file *m, void *v) · 30 unmodified lines
3131
3232 spin_lock_bh(&(BOND_ALB_INFO(bond).rx_hashtbl_lock));
3333
34− hash_index = bond_info->rx_hashtbl_head;
35− for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {
34+ hash_index = bond_info->rx_hashtbl_used_head;
35+ for (; hash_index != RLB_NULL_INDEX;
36+ hash_index = client_info->used_next) {
3637 client_info = &(bond_info->rx_hashtbl[hash_index]);
3738 seq_printf(m, "%-15pI4 %-15pI4 %-17pM %s\n",
3839 &client_info->ip_src,
drivers/net/bonding/bond_main.c+7−12
@@ -615,15 +615,9 @@ static int bond_check_dev_link(struct bonding *bond, · 614 unmodified lines
615615 return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
616616
617617 /* Try to get link status using Ethtool first. */
618− if (slave_dev->ethtool_ops) {
619− if (slave_dev->ethtool_ops->get_link) {
620− u32 link;
621−
622− link = slave_dev->ethtool_ops->get_link(slave_dev);
623−
624− return link ? BMSR_LSTATUS : 0;
625− }
626− }
618+ if (slave_dev->ethtool_ops->get_link)
619+ return slave_dev->ethtool_ops->get_link(slave_dev) ?
620+ BMSR_LSTATUS : 0;
627621
628622 /* Ethtool can't be used, fallback to MII ioctls. */
629623 ioctl = slave_ops->ndo_do_ioctl;
@@ -1510,8 +1504,9 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) · 880 unmodified lines
15101504 int link_reporting;
15111505 int res = 0;
15121506
1513− if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL &&
1514− slave_ops->ndo_do_ioctl == NULL) {
1507+ if (!bond->params.use_carrier &&
1508+ slave_dev->ethtool_ops->get_link == NULL &&
1509+ slave_ops->ndo_do_ioctl == NULL) {
15151510 pr_warning("%s: Warning: no link monitoring support for %s\n",
15161511 bond_dev->name, slave_dev->name);
15171512 }
@@ -1838,7 +1833,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) · 320 unmodified lines
18381833 * anyway (it holds no special properties of the bond device),
18391834 * so we can change it without calling change_active_interface()
18401835 */
1841− if (!bond->curr_active_slave)
1836+ if (!bond->curr_active_slave && new_slave->link == BOND_LINK_UP)
18421837 bond->curr_active_slave = new_slave;
18431838
18441839 break;
drivers/net/bonding/bonding.h+13−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <linux/in6.h>
2323 #include <linux/netpoll.h>
2424 #include <linux/inetdevice.h>
25+#include <linux/etherdevice.h>
2526 #include "bond_3ad.h"
2627 #include "bond_alb.h"
2728
@@ -450,6 +451,18 @@ static inline void bond_destroy_proc_dir(struct bond_net *bn) · 422 unmodified lines
450451 }
451452 #endif
452453
454+static inline struct slave *bond_slave_has_mac(struct bonding *bond,
455+ const u8 *mac)
456+{
457+ int i = 0;
458+ struct slave *tmp;
459+
460+ bond_for_each_slave(bond, tmp, i)
461+ if (ether_addr_equal_64bits(mac, tmp->dev->dev_addr))
462+ return tmp;
463+
464+ return NULL;
465+}
453466
454467 /* exported from bond_main.c */
455468 extern int bond_net_id;
drivers/net/can/Kconfig+9−0
@@ -110,6 +110,15 @@ config PCH_CAN · 109 unmodified lines
110110 is an IOH for x86 embedded processor (Intel Atom E6xx series).
111111 This driver can access CAN bus.
112112
113+config CAN_GRCAN
114+ tristate "Aeroflex Gaisler GRCAN and GRHCAN CAN devices"
115+ depends on CAN_DEV && OF
116+ ---help---
117+ Say Y here if you want to use Aeroflex Gaisler GRCAN or GRHCAN.
118+ Note that the driver supports little endian, even though little
119+ endian syntheses of the cores would need some modifications on
120+ the hardware level to work.
121+
113122 source "drivers/net/can/mscan/Kconfig"
114123
115124 source "drivers/net/can/sja1000/Kconfig"
drivers/net/can/Makefile+1−0
@@ -22,5 +22,6 @@ obj-$(CONFIG_CAN_BFIN) += bfin_can.o · 21 unmodified lines
2222 obj-$(CONFIG_CAN_JANZ_ICAN3) += janz-ican3.o
2323 obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o
2424 obj-$(CONFIG_PCH_CAN) += pch_can.o
25+obj-$(CONFIG_CAN_GRCAN) += grcan.o
2526
2627 ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
drivers/net/can/at91_can.c+5−4
@@ -154,7 +154,7 @@ struct at91_priv { · 153 unmodified lines
154154 canid_t mb0_id;
155155 };
156156
157−static const struct at91_devtype_data at91_devtype_data[] __devinitconst = {
157+static const struct at91_devtype_data at91_devtype_data[] = {
158158 [AT91_DEVTYPE_SAM9263] = {
159159 .rx_first = 1,
160160 .rx_split = 8,
@@ -1241,7 +1241,7 @@ static struct attribute_group at91_sysfs_attr_group = { · 1080 unmodified lines
12411241 .attrs = at91_sysfs_attrs,
12421242 };
12431243
1244−static int __devinit at91_can_probe(struct platform_device *pdev)
1244+static int at91_can_probe(struct platform_device *pdev)
12451245 {
12461246 const struct at91_devtype_data *devtype_data;
12471247 enum at91_devtype devtype;
@@ -1338,7 +1338,7 @@ static int __devinit at91_can_probe(struct platform_device *pdev) · 90 unmodified lines
13381338 return err;
13391339 }
13401340
1341−static int __devexit at91_can_remove(struct platform_device *pdev)
1341+static int at91_can_remove(struct platform_device *pdev)
13421342 {
13431343 struct net_device *dev = platform_get_drvdata(pdev);
13441344 struct at91_priv *priv = netdev_priv(dev);
@@ -1371,10 +1371,11 @@ static const struct platform_device_id at91_can_id_table[] = { · 26 unmodified lines
13711371 /* sentinel */
13721372 }
13731373 };
1374+MODULE_DEVICE_TABLE(platform, at91_can_id_table);
13741375
13751376 static struct platform_driver at91_can_driver = {
13761377 .probe = at91_can_probe,
1377− .remove = __devexit_p(at91_can_remove),
1378+ .remove = at91_can_remove,
13781379 .driver = {
13791380 .name = KBUILD_MODNAME,
13801381 .owner = THIS_MODULE,
drivers/net/can/bfin_can.c+4−3
@@ -531,7 +531,7 @@ static const struct net_device_ops bfin_can_netdev_ops = { · 530 unmodified lines
531531 .ndo_start_xmit = bfin_can_start_xmit,
532532 };
533533
534−static int __devinit bfin_can_probe(struct platform_device *pdev)
534+static int bfin_can_probe(struct platform_device *pdev)
535535 {
536536 int err;
537537 struct net_device *dev;
@@ -611,7 +611,7 @@ exit: · 73 unmodified lines
611611 return err;
612612 }
613613
614−static int __devexit bfin_can_remove(struct platform_device *pdev)
614+static int bfin_can_remove(struct platform_device *pdev)
615615 {
616616 struct net_device *dev = dev_get_drvdata(&pdev->dev);
617617 struct bfin_can_priv *priv = netdev_priv(dev);
@@ -677,7 +677,7 @@ static int bfin_can_resume(struct platform_device *pdev) · 59 unmodified lines
677677
678678 static struct platform_driver bfin_can_driver = {
679679 .probe = bfin_can_probe,
680− .remove = __devexit_p(bfin_can_remove),
680+ .remove = bfin_can_remove,
681681 .suspend = bfin_can_suspend,
682682 .resume = bfin_can_resume,
683683 .driver = {
@@ -691,3 +691,4 @@ module_platform_driver(bfin_can_driver); · 7 unmodified lines
691691 MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
692692 MODULE_LICENSE("GPL");
693693 MODULE_DESCRIPTION("Blackfin on-chip CAN netdevice driver");
694+MODULE_ALIAS("platform:" DRV_NAME);
drivers/net/can/c_can/c_can.c+12−0
@@ -233,6 +233,12 @@ static inline void c_can_pm_runtime_put_sync(const struct c_can_priv *priv) · 232 unmodified lines
233233 pm_runtime_put_sync(priv->device);
234234 }
235235
236+static inline void c_can_reset_ram(const struct c_can_priv *priv, bool enable)
237+{
238+ if (priv->raminit)
239+ priv->raminit(priv, enable);
240+}
241+
236242 static inline int get_tx_next_msg_obj(const struct c_can_priv *priv)
237243 {
238244 return (priv->tx_next & C_CAN_NEXT_MSG_OBJ_MASK) +
@@ -1090,6 +1096,7 @@ static int c_can_open(struct net_device *dev) · 851 unmodified lines
10901096 struct c_can_priv *priv = netdev_priv(dev);
10911097
10921098 c_can_pm_runtime_get_sync(priv);
1099+ c_can_reset_ram(priv, true);
10931100
10941101 /* open the can device */
10951102 err = open_candev(dev);
@@ -1118,6 +1125,7 @@ static int c_can_open(struct net_device *dev) · 22 unmodified lines
11181125 exit_irq_fail:
11191126 close_candev(dev);
11201127 exit_open_fail:
1128+ c_can_reset_ram(priv, false);
11211129 c_can_pm_runtime_put_sync(priv);
11221130 return err;
11231131 }
@@ -1131,6 +1139,8 @@ static int c_can_close(struct net_device *dev) · 7 unmodified lines
11311139 c_can_stop(dev);
11321140 free_irq(dev->irq, dev);
11331141 close_candev(dev);
1142+
1143+ c_can_reset_ram(priv, false);
11341144 c_can_pm_runtime_put_sync(priv);
11351145
11361146 return 0;
@@ -1188,6 +1198,7 @@ int c_can_power_down(struct net_device *dev) · 51 unmodified lines
11881198
11891199 c_can_stop(dev);
11901200
1201+ c_can_reset_ram(priv, false);
11911202 c_can_pm_runtime_put_sync(priv);
11921203
11931204 return 0;
@@ -1206,6 +1217,7 @@ int c_can_power_up(struct net_device *dev) · 12 unmodified lines
12061217 WARN_ON(priv->type != BOSCH_D_CAN);
12071218
12081219 c_can_pm_runtime_get_sync(priv);
1220+ c_can_reset_ram(priv, true);
12091221
12101222 /* Clear PDR and INIT bits */
12111223 val = priv->read_reg(priv, C_CAN_CTRL_EX_REG);
drivers/net/can/c_can/c_can.h+3−0
@@ -169,6 +169,9 @@ struct c_can_priv { · 168 unmodified lines
169169 void *priv; /* for board-specific data */
170170 u16 irqstatus;
171171 enum c_can_dev_id type;
172+ u32 __iomem *raminit_ctrlreg;
173+ unsigned int instance;
174+ void (*raminit) (const struct c_can_priv *priv, bool enable);
172175 };
173176
174177 struct net_device *alloc_c_can_dev(void);
drivers/net/can/c_can/c_can_pci.c+4−4
@@ -63,8 +63,8 @@ static void c_can_pci_write_reg_aligned_to_32bit(struct c_can_priv *priv, · 62 unmodified lines
6363 writew(val, priv->base + 2 * priv->regs[index]);
6464 }
6565
66−static int __devinit c_can_pci_probe(struct pci_dev *pdev,
67− const struct pci_device_id *ent)
66+static int c_can_pci_probe(struct pci_dev *pdev,
67+ const struct pci_device_id *ent)
6868 {
6969 struct c_can_pci_data *c_can_pci_data = (void *)ent->driver_data;
7070 struct c_can_priv *priv;
@@ -174,7 +174,7 @@ out: · 103 unmodified lines
174174 return ret;
175175 }
176176
177−static void __devexit c_can_pci_remove(struct pci_dev *pdev)
177+static void c_can_pci_remove(struct pci_dev *pdev)
178178 {
179179 struct net_device *dev = pci_get_drvdata(pdev);
180180 struct c_can_priv *priv = netdev_priv(dev);
@@ -210,7 +210,7 @@ static struct pci_driver c_can_pci_driver = { · 29 unmodified lines
210210 .name = KBUILD_MODNAME,
211211 .id_table = c_can_pci_tbl,
212212 .probe = c_can_pci_probe,
213− .remove = __devexit_p(c_can_pci_remove),
213+ .remove = c_can_pci_remove,
214214 };
215215
216216 module_pci_driver(c_can_pci_driver);
drivers/net/can/c_can/c_can_platform.c+32−4
@@ -38,6 +38,8 @@ · 37 unmodified lines
3838
3939 #include "c_can.h"
4040
41+#define CAN_RAMINIT_START_MASK(i) (1 << (i))
42+
4143 /*
4244 * 16-bit c_can registers can be arranged differently in the memory
4345 * architecture of different implementations. For example: 16-bit
@@ -68,6 +70,18 @@ static void c_can_plat_write_reg_aligned_to_32bit(struct c_can_priv *priv, · 24 unmodified lines
6870 writew(val, priv->base + 2 * priv->regs[index]);
6971 }
7072
73+static void c_can_hw_raminit(const struct c_can_priv *priv, bool enable)
74+{
75+ u32 val;
76+
77+ val = readl(priv->raminit_ctrlreg);
78+ if (enable)
79+ val |= CAN_RAMINIT_START_MASK(priv->instance);
80+ else
81+ val &= ~CAN_RAMINIT_START_MASK(priv->instance);
82+ writel(val, priv->raminit_ctrlreg);
83+}
84+
7185 static struct platform_device_id c_can_id_table[] = {
7286 [BOSCH_C_CAN_PLATFORM] = {
7387 .name = KBUILD_MODNAME,
@@ -83,14 +97,16 @@ static struct platform_device_id c_can_id_table[] = { · 9 unmodified lines
8397 }, {
8498 }
8599 };
100+MODULE_DEVICE_TABLE(platform, c_can_id_table);
86101
87102 static const struct of_device_id c_can_of_table[] = {
88103 { .compatible = "bosch,c_can", .data = &c_can_id_table[BOSCH_C_CAN] },
89104 { .compatible = "bosch,d_can", .data = &c_can_id_table[BOSCH_D_CAN] },
90105 { /* sentinel */ },
91106 };
107+MODULE_DEVICE_TABLE(of, c_can_of_table);
92108
93−static int __devinit c_can_plat_probe(struct platform_device *pdev)
109+static int c_can_plat_probe(struct platform_device *pdev)
94110 {
95111 int ret;
96112 void __iomem *addr;
@@ -99,7 +115,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev) · 2 unmodified lines
99115 const struct of_device_id *match;
100116 const struct platform_device_id *id;
101117 struct pinctrl *pinctrl;
102− struct resource *mem;
118+ struct resource *mem, *res;
103119 int irq;
104120 struct clk *clk;
105121
@@ -178,6 +194,18 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev) · 72 unmodified lines
178194 priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
179195 priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;
180196 priv->write_reg = c_can_plat_write_reg_aligned_to_16bit;
197+
198+ if (pdev->dev.of_node)
199+ priv->instance = of_alias_get_id(pdev->dev.of_node, "d_can");
200+ else
201+ priv->instance = pdev->id;
202+
203+ res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
204+ priv->raminit_ctrlreg = devm_request_and_ioremap(&pdev->dev, res);
205+ if (!priv->raminit_ctrlreg || priv->instance < 0)
206+ dev_info(&pdev->dev, "control memory is not used for raminit\n");
207+ else
208+ priv->raminit = c_can_hw_raminit;
181209 break;
182210 default:
183211 ret = -EINVAL;
@@ -220,7 +248,7 @@ exit: · 36 unmodified lines
220248 return ret;
221249 }
222250
223−static int __devexit c_can_plat_remove(struct platform_device *pdev)
251+static int c_can_plat_remove(struct platform_device *pdev)
224252 {
225253 struct net_device *dev = platform_get_drvdata(pdev);
226254 struct c_can_priv *priv = netdev_priv(dev);
@@ -306,7 +334,7 @@ static struct platform_driver c_can_plat_driver = { · 79 unmodified lines
306334 .of_match_table = of_match_ptr(c_can_of_table),
307335 },
308336 .probe = c_can_plat_probe,
309− .remove = __devexit_p(c_can_plat_remove),
337+ .remove = c_can_plat_remove,
310338 .suspend = c_can_suspend,
311339 .resume = c_can_resume,
312340 .id_table = c_can_id_table,
drivers/net/can/cc770/cc770_isa.c+9−9
@@ -75,12 +75,12 @@ MODULE_LICENSE("GPL v2"); · 74 unmodified lines
7575
7676 static unsigned long port[MAXDEV];
7777 static unsigned long mem[MAXDEV];
78−static int __devinitdata irq[MAXDEV];
79−static int __devinitdata clk[MAXDEV];
80−static u8 __devinitdata cir[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
81−static u8 __devinitdata cor[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
82−static u8 __devinitdata bcr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
83−static int __devinitdata indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};
78+static int irq[MAXDEV];
79+static int clk[MAXDEV];
80+static u8 cir[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
81+static u8 cor[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
82+static u8 bcr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
83+static int indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};
8484
8585 module_param_array(port, ulong, NULL, S_IRUGO);
8686 MODULE_PARM_DESC(port, "I/O port number");
@@ -166,7 +166,7 @@ static void cc770_isa_port_write_reg_indirect(const struct cc770_priv *priv, · 79 unmodified lines
166166 spin_unlock_irqrestore(&cc770_isa_port_lock, flags);
167167 }
168168
169−static int __devinit cc770_isa_probe(struct platform_device *pdev)
169+static int cc770_isa_probe(struct platform_device *pdev)
170170 {
171171 struct net_device *dev;
172172 struct cc770_priv *priv;
@@ -291,7 +291,7 @@ static int __devinit cc770_isa_probe(struct platform_device *pdev) · 118 unmodified lines
291291 return err;
292292 }
293293
294−static int __devexit cc770_isa_remove(struct platform_device *pdev)
294+static int cc770_isa_remove(struct platform_device *pdev)
295295 {
296296 struct net_device *dev = dev_get_drvdata(&pdev->dev);
297297 struct cc770_priv *priv = netdev_priv(dev);
@@ -316,7 +316,7 @@ static int __devexit cc770_isa_remove(struct platform_device *pdev) · 18 unmodified lines
316316
317317 static struct platform_driver cc770_isa_driver = {
318318 .probe = cc770_isa_probe,
319− .remove = __devexit_p(cc770_isa_remove),
319+ .remove = cc770_isa_remove,
320320 .driver = {
321321 .name = KBUILD_MODNAME,
322322 .owner = THIS_MODULE,
drivers/net/can/cc770/cc770_platform.c+10−8
@@ -60,6 +60,7 @@ · 59 unmodified lines
6060 MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");
6161 MODULE_DESCRIPTION("Socket-CAN driver for CC770 on the platform bus");
6262 MODULE_LICENSE("GPL v2");
63+MODULE_ALIAS("platform:" DRV_NAME);
6364
6465 #define CC770_PLATFORM_CAN_CLOCK 16000000
6566
@@ -74,8 +75,8 @@ static void cc770_platform_write_reg(const struct cc770_priv *priv, int reg, · 8 unmodified lines
7475 iowrite8(val, priv->reg_base + reg);
7576 }
7677
77−static int __devinit cc770_get_of_node_data(struct platform_device *pdev,
78− struct cc770_priv *priv)
78+static int cc770_get_of_node_data(struct platform_device *pdev,
79+ struct cc770_priv *priv)
7980 {
8081 struct device_node *np = pdev->dev.of_node;
8182 const u32 *prop;
@@ -147,8 +148,8 @@ static int __devinit cc770_get_of_node_data(struct platform_device *pdev, · 65 unmodified lines
147148 return 0;
148149 }
149150
150−static int __devinit cc770_get_platform_data(struct platform_device *pdev,
151− struct cc770_priv *priv)
151+static int cc770_get_platform_data(struct platform_device *pdev,
152+ struct cc770_priv *priv)
152153 {
153154
154155 struct cc770_platform_data *pdata = pdev->dev.platform_data;
@@ -163,7 +164,7 @@ static int __devinit cc770_get_platform_data(struct platform_device *pdev, · 8 unmodified lines
163164 return 0;
164165 }
165166
166−static int __devinit cc770_platform_probe(struct platform_device *pdev)
167+static int cc770_platform_probe(struct platform_device *pdev)
167168 {
168169 struct net_device *dev;
169170 struct cc770_priv *priv;
@@ -237,7 +238,7 @@ exit_release_mem: · 67 unmodified lines
237238 return err;
238239 }
239240
240−static int __devexit cc770_platform_remove(struct platform_device *pdev)
241+static int cc770_platform_remove(struct platform_device *pdev)
241242 {
242243 struct net_device *dev = dev_get_drvdata(&pdev->dev);
243244 struct cc770_priv *priv = netdev_priv(dev);
@@ -253,11 +254,12 @@ static int __devexit cc770_platform_remove(struct platform_device *pdev) · 9 unmodified lines
253254 return 0;
254255 }
255256
256−static struct of_device_id __devinitdata cc770_platform_table[] = {
257+static struct of_device_id cc770_platform_table[] = {
257258 {.compatible = "bosch,cc770"}, /* CC770 from Bosch */
258259 {.compatible = "intc,82527"}, /* AN82527 from Intel CP */
259260 {},
260261 };
262+MODULE_DEVICE_TABLE(of, cc770_platform_table);
261263
262264 static struct platform_driver cc770_platform_driver = {
263265 .driver = {
@@ -266,7 +268,7 @@ static struct platform_driver cc770_platform_driver = { · 2 unmodified lines
266268 .of_match_table = cc770_platform_table,
267269 },
268270 .probe = cc770_platform_probe,
269− .remove = __devexit_p(cc770_platform_remove),
271+ .remove = cc770_platform_remove,
270272 };
271273
272274 module_platform_driver(cc770_platform_driver);
drivers/net/can/dev.c+1−2
@@ -609,8 +609,7 @@ void close_candev(struct net_device *dev) · 608 unmodified lines
609609 {
610610 struct can_priv *priv = netdev_priv(dev);
611611
612− if (del_timer_sync(&priv->restart_timer))
613− dev_put(dev);
612+ del_timer_sync(&priv->restart_timer);
614613 can_flush_echo_skb(dev);
615614 }
616615 EXPORT_SYMBOL_GPL(close_candev);
drivers/net/can/flexcan.c+7−5
@@ -922,7 +922,7 @@ static const struct net_device_ops flexcan_netdev_ops = { · 921 unmodified lines
922922 .ndo_start_xmit = flexcan_start_xmit,
923923 };
924924
925−static int __devinit register_flexcandev(struct net_device *dev)
925+static int register_flexcandev(struct net_device *dev)
926926 {
927927 struct flexcan_priv *priv = netdev_priv(dev);
928928 struct flexcan_regs __iomem *regs = priv->base;
@@ -968,7 +968,7 @@ static int __devinit register_flexcandev(struct net_device *dev) · 39 unmodified lines
968968 return err;
969969 }
970970
971−static void __devexit unregister_flexcandev(struct net_device *dev)
971+static void unregister_flexcandev(struct net_device *dev)
972972 {
973973 unregister_candev(dev);
974974 }
@@ -979,13 +979,15 @@ static const struct of_device_id flexcan_of_match[] = { · 4 unmodified lines
979979 { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, },
980980 { /* sentinel */ },
981981 };
982+MODULE_DEVICE_TABLE(of, flexcan_of_match);
982983
983984 static const struct platform_device_id flexcan_id_table[] = {
984985 { .name = "flexcan", .driver_data = (kernel_ulong_t)&fsl_p1010_devtype_data, },
985986 { /* sentinel */ },
986987 };
988+MODULE_DEVICE_TABLE(platform, flexcan_id_table);
987989
988−static int __devinit flexcan_probe(struct platform_device *pdev)
990+static int flexcan_probe(struct platform_device *pdev)
989991 {
990992 const struct of_device_id *of_id;
991993 const struct flexcan_devtype_data *devtype_data;
@@ -1107,7 +1109,7 @@ static int __devinit flexcan_probe(struct platform_device *pdev) · 115 unmodified lines
11071109 return err;
11081110 }
11091111
1110−static int __devexit flexcan_remove(struct platform_device *pdev)
1112+static int flexcan_remove(struct platform_device *pdev)
11111113 {
11121114 struct net_device *dev = platform_get_drvdata(pdev);
11131115 struct flexcan_priv *priv = netdev_priv(dev);
@@ -1168,7 +1170,7 @@ static struct platform_driver flexcan_driver = { · 54 unmodified lines
11681170 .of_match_table = flexcan_of_match,
11691171 },
11701172 .probe = flexcan_probe,
1171− .remove = __devexit_p(flexcan_remove),
1173+ .remove = flexcan_remove,
11721174 .suspend = flexcan_suspend,
11731175 .resume = flexcan_resume,
11741176 .id_table = flexcan_id_table,
drivers/net/can/grcan.c+1756−0
@@ -0,0 +1,1756 @@
1+/*
2+ * Socket CAN driver for Aeroflex Gaisler GRCAN and GRHCAN.
3+ *
4+ * 2012 (c) Aeroflex Gaisler AB
5+ *
6+ * This driver supports GRCAN and GRHCAN CAN controllers available in the GRLIB
7+ * VHDL IP core library.
8+ *
9+ * Full documentation of the GRCAN core can be found here:
10+ * http://www.gaisler.com/products/grlib/grip.pdf
11+ *
12+ * See "Documentation/devicetree/bindings/net/can/grcan.txt" for information on
13+ * open firmware properties.
14+ *
15+ * See "Documentation/ABI/testing/sysfs-class-net-grcan" for information on the
16+ * sysfs interface.
17+ *
18+ * See "Documentation/kernel-parameters.txt" for information on the module
19+ * parameters.
20+ *
21+ * This program is free software; you can redistribute it and/or modify it
22+ * under the terms of the GNU General Public License as published by the
23+ * Free Software Foundation; either version 2 of the License, or (at your
24+ * option) any later version.
25+ *
26+ * Contributors: Andreas Larsson <andreas@gaisler.com>
27+ */
28+
29+#include <linux/kernel.h>
30+#include <linux/module.h>
31+#include <linux/interrupt.h>
32+#include <linux/netdevice.h>
33+#include <linux/delay.h>
34+#include <linux/io.h>
35+#include <linux/can/dev.h>
36+#include <linux/spinlock.h>
37+
38+#include <linux/of_platform.h>
39+#include <asm/prom.h>
40+
41+#include <linux/of_irq.h>
42+
43+#include <linux/dma-mapping.h>
44+
45+#define DRV_NAME "grcan"
46+
47+#define GRCAN_NAPI_WEIGHT 32
48+
49+#define GRCAN_RESERVE_SIZE(slot1, slot2) (((slot2) - (slot1)) / 4 - 1)
50+
51+struct grcan_registers {
52+ u32 conf; /* 0x00 */
53+ u32 stat; /* 0x04 */
54+ u32 ctrl; /* 0x08 */
55+ u32 __reserved1[GRCAN_RESERVE_SIZE(0x08, 0x18)];
56+ u32 smask; /* 0x18 - CanMASK */
57+ u32 scode; /* 0x1c - CanCODE */
58+ u32 __reserved2[GRCAN_RESERVE_SIZE(0x1c, 0x100)];
59+ u32 pimsr; /* 0x100 */
60+ u32 pimr; /* 0x104 */
61+ u32 pisr; /* 0x108 */
62+ u32 pir; /* 0x10C */
63+ u32 imr; /* 0x110 */
64+ u32 picr; /* 0x114 */
65+ u32 __reserved3[GRCAN_RESERVE_SIZE(0x114, 0x200)];
66+ u32 txctrl; /* 0x200 */
67+ u32 txaddr; /* 0x204 */
68+ u32 txsize; /* 0x208 */
69+ u32 txwr; /* 0x20C */
70+ u32 txrd; /* 0x210 */
71+ u32 txirq; /* 0x214 */
72+ u32 __reserved4[GRCAN_RESERVE_SIZE(0x214, 0x300)];
73+ u32 rxctrl; /* 0x300 */
74+ u32 rxaddr; /* 0x304 */
75+ u32 rxsize; /* 0x308 */
76+ u32 rxwr; /* 0x30C */
77+ u32 rxrd; /* 0x310 */
78+ u32 rxirq; /* 0x314 */
79+ u32 rxmask; /* 0x318 */
80+ u32 rxcode; /* 0x31C */
81+};
82+
83+#define GRCAN_CONF_ABORT 0x00000001
84+#define GRCAN_CONF_ENABLE0 0x00000002
85+#define GRCAN_CONF_ENABLE1 0x00000004
86+#define GRCAN_CONF_SELECT 0x00000008
87+#define GRCAN_CONF_SILENT 0x00000010
88+#define GRCAN_CONF_SAM 0x00000020 /* Available in some hardware */
89+#define GRCAN_CONF_BPR 0x00000300 /* Note: not BRP */
90+#define GRCAN_CONF_RSJ 0x00007000
91+#define GRCAN_CONF_PS1 0x00f00000
92+#define GRCAN_CONF_PS2 0x000f0000
93+#define GRCAN_CONF_SCALER 0xff000000
94+#define GRCAN_CONF_OPERATION \
95+ (GRCAN_CONF_ABORT | GRCAN_CONF_ENABLE0 | GRCAN_CONF_ENABLE1 \
96+ | GRCAN_CONF_SELECT | GRCAN_CONF_SILENT | GRCAN_CONF_SAM)
97+#define GRCAN_CONF_TIMING \
98+ (GRCAN_CONF_BPR | GRCAN_CONF_RSJ | GRCAN_CONF_PS1 \
99+ | GRCAN_CONF_PS2 | GRCAN_CONF_SCALER)
100+
101+#define GRCAN_CONF_RSJ_MIN 1
102+#define GRCAN_CONF_RSJ_MAX 4
103+#define GRCAN_CONF_PS1_MIN 1
104+#define GRCAN_CONF_PS1_MAX 15
105+#define GRCAN_CONF_PS2_MIN 2
106+#define GRCAN_CONF_PS2_MAX 8
107+#define GRCAN_CONF_SCALER_MIN 0
108+#define GRCAN_CONF_SCALER_MAX 255
109+#define GRCAN_CONF_SCALER_INC 1
110+
111+#define GRCAN_CONF_BPR_BIT 8
112+#define GRCAN_CONF_RSJ_BIT 12
113+#define GRCAN_CONF_PS1_BIT 20
114+#define GRCAN_CONF_PS2_BIT 16
115+#define GRCAN_CONF_SCALER_BIT 24
116+
117+#define GRCAN_STAT_PASS 0x000001
118+#define GRCAN_STAT_OFF 0x000002
119+#define GRCAN_STAT_OR 0x000004
120+#define GRCAN_STAT_AHBERR 0x000008
121+#define GRCAN_STAT_ACTIVE 0x000010
122+#define GRCAN_STAT_RXERRCNT 0x00ff00
123+#define GRCAN_STAT_TXERRCNT 0xff0000
124+
125+#define GRCAN_STAT_ERRCTR_RELATED (GRCAN_STAT_PASS | GRCAN_STAT_OFF)
126+
127+#define GRCAN_STAT_RXERRCNT_BIT 8
128+#define GRCAN_STAT_TXERRCNT_BIT 16
129+
130+#define GRCAN_STAT_ERRCNT_WARNING_LIMIT 96
131+#define GRCAN_STAT_ERRCNT_PASSIVE_LIMIT 127
132+
133+#define GRCAN_CTRL_RESET 0x2
134+#define GRCAN_CTRL_ENABLE 0x1
135+
136+#define GRCAN_TXCTRL_ENABLE 0x1
137+#define GRCAN_TXCTRL_ONGOING 0x2
138+#define GRCAN_TXCTRL_SINGLE 0x4
139+
140+#define GRCAN_RXCTRL_ENABLE 0x1
141+#define GRCAN_RXCTRL_ONGOING 0x2
142+
143+/* Relative offset of IRQ sources to AMBA Plug&Play */
144+#define GRCAN_IRQIX_IRQ 0
145+#define GRCAN_IRQIX_TXSYNC 1
146+#define GRCAN_IRQIX_RXSYNC 2
147+
148+#define GRCAN_IRQ_PASS 0x00001
149+#define GRCAN_IRQ_OFF 0x00002
150+#define GRCAN_IRQ_OR 0x00004
151+#define GRCAN_IRQ_RXAHBERR 0x00008
152+#define GRCAN_IRQ_TXAHBERR 0x00010
153+#define GRCAN_IRQ_RXIRQ 0x00020
154+#define GRCAN_IRQ_TXIRQ 0x00040
155+#define GRCAN_IRQ_RXFULL 0x00080
156+#define GRCAN_IRQ_TXEMPTY 0x00100
157+#define GRCAN_IRQ_RX 0x00200
158+#define GRCAN_IRQ_TX 0x00400
159+#define GRCAN_IRQ_RXSYNC 0x00800
160+#define GRCAN_IRQ_TXSYNC 0x01000
161+#define GRCAN_IRQ_RXERRCTR 0x02000
162+#define GRCAN_IRQ_TXERRCTR 0x04000
163+#define GRCAN_IRQ_RXMISS 0x08000
164+#define GRCAN_IRQ_TXLOSS 0x10000
165+
166+#define GRCAN_IRQ_NONE 0
167+#define GRCAN_IRQ_ALL \
168+ (GRCAN_IRQ_PASS | GRCAN_IRQ_OFF | GRCAN_IRQ_OR \
169+ | GRCAN_IRQ_RXAHBERR | GRCAN_IRQ_TXAHBERR \
170+ | GRCAN_IRQ_RXIRQ | GRCAN_IRQ_TXIRQ \
171+ | GRCAN_IRQ_RXFULL | GRCAN_IRQ_TXEMPTY \
172+ | GRCAN_IRQ_RX | GRCAN_IRQ_TX | GRCAN_IRQ_RXSYNC \
173+ | GRCAN_IRQ_TXSYNC | GRCAN_IRQ_RXERRCTR \
174+ | GRCAN_IRQ_TXERRCTR | GRCAN_IRQ_RXMISS \
175+ | GRCAN_IRQ_TXLOSS)
176+
177+#define GRCAN_IRQ_ERRCTR_RELATED (GRCAN_IRQ_RXERRCTR | GRCAN_IRQ_TXERRCTR \
178+ | GRCAN_IRQ_PASS | GRCAN_IRQ_OFF)
179+#define GRCAN_IRQ_ERRORS (GRCAN_IRQ_ERRCTR_RELATED | GRCAN_IRQ_OR \
180+ | GRCAN_IRQ_TXAHBERR | GRCAN_IRQ_RXAHBERR \
181+ | GRCAN_IRQ_TXLOSS)
182+#define GRCAN_IRQ_DEFAULT (GRCAN_IRQ_RX | GRCAN_IRQ_TX | GRCAN_IRQ_ERRORS)
183+
184+#define GRCAN_MSG_SIZE 16
185+
186+#define GRCAN_MSG_IDE 0x80000000
187+#define GRCAN_MSG_RTR 0x40000000
188+#define GRCAN_MSG_BID 0x1ffc0000
189+#define GRCAN_MSG_EID 0x1fffffff
190+#define GRCAN_MSG_IDE_BIT 31
191+#define GRCAN_MSG_RTR_BIT 30
192+#define GRCAN_MSG_BID_BIT 18
193+#define GRCAN_MSG_EID_BIT 0
194+
195+#define GRCAN_MSG_DLC 0xf0000000
196+#define GRCAN_MSG_TXERRC 0x00ff0000
197+#define GRCAN_MSG_RXERRC 0x0000ff00
198+#define GRCAN_MSG_DLC_BIT 28
199+#define GRCAN_MSG_TXERRC_BIT 16
200+#define GRCAN_MSG_RXERRC_BIT 8
201+#define GRCAN_MSG_AHBERR 0x00000008
202+#define GRCAN_MSG_OR 0x00000004
203+#define GRCAN_MSG_OFF 0x00000002
204+#define GRCAN_MSG_PASS 0x00000001
205+
206+#define GRCAN_MSG_DATA_SLOT_INDEX(i) (2 + (i) / 4)
207+#define GRCAN_MSG_DATA_SHIFT(i) ((3 - (i) % 4) * 8)
208+
209+#define GRCAN_BUFFER_ALIGNMENT 1024
210+#define GRCAN_DEFAULT_BUFFER_SIZE 1024
211+#define GRCAN_VALID_TR_SIZE_MASK 0x001fffc0
212+
213+#define GRCAN_INVALID_BUFFER_SIZE(s) \
214+ ((s) == 0 || ((s) & ~GRCAN_VALID_TR_SIZE_MASK))
215+
216+#if GRCAN_INVALID_BUFFER_SIZE(GRCAN_DEFAULT_BUFFER_SIZE)
217+#error "Invalid default buffer size"
218+#endif
219+
220+struct grcan_dma_buffer {
221+ size_t size;
222+ void *buf;
223+ dma_addr_t handle;
224+};
225+
226+struct grcan_dma {
227+ size_t base_size;
228+ void *base_buf;
229+ dma_addr_t base_handle;
230+ struct grcan_dma_buffer tx;
231+ struct grcan_dma_buffer rx;
232+};
233+
234+/* GRCAN configuration parameters */
235+struct grcan_device_config {
236+ unsigned short enable0;
237+ unsigned short enable1;
238+ unsigned short select;
239+ unsigned int txsize;
240+ unsigned int rxsize;
241+};
242+
243+#define GRCAN_DEFAULT_DEVICE_CONFIG { \
244+ .enable0 = 0, \
245+ .enable1 = 0, \
246+ .select = 0, \
247+ .txsize = GRCAN_DEFAULT_BUFFER_SIZE, \
248+ .rxsize = GRCAN_DEFAULT_BUFFER_SIZE, \
249+ }
250+
251+#define GRCAN_TXBUG_SAFE_GRLIB_VERSION 0x4100
252+#define GRLIB_VERSION_MASK 0xffff
253+
254+/* GRCAN private data structure */
255+struct grcan_priv {
256+ struct can_priv can; /* must be the first member */
257+ struct net_device *dev;
258+ struct napi_struct napi;
259+
260+ struct grcan_registers __iomem *regs; /* ioremap'ed registers */
261+ struct grcan_device_config config;
262+ struct grcan_dma dma;
263+
264+ struct sk_buff **echo_skb; /* We allocate this on our own */
265+ u8 *txdlc; /* Length of queued frames */
266+
267+ /* The echo skb pointer, pointing into echo_skb and indicating which
268+ * frames can be echoed back. See the "Notes on the tx cyclic buffer
269+ * handling"-comment for grcan_start_xmit for more details.
270+ */
271+ u32 eskbp;
272+
273+ /* Lock for controlling changes to the netif tx queue state, accesses to
274+ * the echo_skb pointer eskbp and for making sure that a running reset
275+ * and/or a close of the interface is done without interference from
276+ * other parts of the code.
277+ *
278+ * The echo_skb pointer, eskbp, should only be accessed under this lock
279+ * as it can be changed in several places and together with decisions on
280+ * whether to wake up the tx queue.
281+ *
282+ * The tx queue must never be woken up if there is a running reset or
283+ * close in progress.
284+ *
285+ * A running reset (see below on need_txbug_workaround) should never be
286+ * done if the interface is closing down and several running resets
287+ * should never be scheduled simultaneously.
288+ */
289+ spinlock_t lock;
290+
291+ /* Whether a workaround is needed due to a bug in older hardware. In
292+ * this case, the driver both tries to prevent the bug from being
293+ * triggered and recovers, if the bug nevertheless happens, by doing a
294+ * running reset. A running reset, resets the device and continues from
295+ * where it were without being noticeable from outside the driver (apart
296+ * from slight delays).
297+ */
298+ bool need_txbug_workaround;
299+
300+ /* To trigger initization of running reset and to trigger running reset
301+ * respectively in the case of a hanged device due to a txbug.
302+ */
303+ struct timer_list hang_timer;
304+ struct timer_list rr_timer;
305+
306+ /* To avoid waking up the netif queue and restarting timers
307+ * when a reset is scheduled or when closing of the device is
308+ * undergoing
309+ */
310+ bool resetting;
311+ bool closing;
312+};
313+
314+/* Wait time for a short wait for ongoing to clear */
315+#define GRCAN_SHORTWAIT_USECS 10
316+
317+/* Limit on the number of transmitted bits of an eff frame according to the CAN
318+ * specification: 1 bit start of frame, 32 bits arbitration field, 6 bits
319+ * control field, 8 bytes data field, 16 bits crc field, 2 bits ACK field and 7
320+ * bits end of frame
321+ */
322+#define GRCAN_EFF_FRAME_MAX_BITS (1+32+6+8*8+16+2+7)
323+
324+#if defined(__BIG_ENDIAN)
325+static inline u32 grcan_read_reg(u32 __iomem *reg)
326+{
327+ return ioread32be(reg);
328+}
329+
330+static inline void grcan_write_reg(u32 __iomem *reg, u32 val)
331+{
332+ iowrite32be(val, reg);
333+}
334+#else
335+static inline u32 grcan_read_reg(u32 __iomem *reg)
336+{
337+ return ioread32(reg);
338+}
339+
340+static inline void grcan_write_reg(u32 __iomem *reg, u32 val)
341+{
342+ iowrite32(val, reg);
343+}
344+#endif
345+
346+static inline void grcan_clear_bits(u32 __iomem *reg, u32 mask)
347+{
348+ grcan_write_reg(reg, grcan_read_reg(reg) & ~mask);
349+}
350+
351+static inline void grcan_set_bits(u32 __iomem *reg, u32 mask)
352+{
353+ grcan_write_reg(reg, grcan_read_reg(reg) | mask);
354+}
355+
356+static inline u32 grcan_read_bits(u32 __iomem *reg, u32 mask)
357+{
358+ return grcan_read_reg(reg) & mask;
359+}
360+
361+static inline void grcan_write_bits(u32 __iomem *reg, u32 value, u32 mask)
362+{
363+ u32 old = grcan_read_reg(reg);
364+
365+ grcan_write_reg(reg, (old & ~mask) | (value & mask));
366+}
367+
368+/* a and b should both be in [0,size] and a == b == size should not hold */
369+static inline u32 grcan_ring_add(u32 a, u32 b, u32 size)
370+{
371+ u32 sum = a + b;
372+
373+ if (sum < size)
374+ return sum;
375+ else
376+ return sum - size;
377+}
378+
379+/* a and b should both be in [0,size) */
380+static inline u32 grcan_ring_sub(u32 a, u32 b, u32 size)
381+{
382+ return grcan_ring_add(a, size - b, size);
383+}
384+
385+/* Available slots for new transmissions */
386+static inline u32 grcan_txspace(size_t txsize, u32 txwr, u32 eskbp)
387+{
388+ u32 slots = txsize / GRCAN_MSG_SIZE - 1;
389+ u32 used = grcan_ring_sub(txwr, eskbp, txsize) / GRCAN_MSG_SIZE;
390+
391+ return slots - used;
392+}
393+
394+/* Configuration parameters that can be set via module parameters */
395+static struct grcan_device_config grcan_module_config =
396+ GRCAN_DEFAULT_DEVICE_CONFIG;
397+
398+static const struct can_bittiming_const grcan_bittiming_const = {
399+ .name = DRV_NAME,
400+ .tseg1_min = GRCAN_CONF_PS1_MIN + 1,
401+ .tseg1_max = GRCAN_CONF_PS1_MAX + 1,
402+ .tseg2_min = GRCAN_CONF_PS2_MIN,
403+ .tseg2_max = GRCAN_CONF_PS2_MAX,
404+ .sjw_max = GRCAN_CONF_RSJ_MAX,
405+ .brp_min = GRCAN_CONF_SCALER_MIN + 1,
406+ .brp_max = GRCAN_CONF_SCALER_MAX + 1,
407+ .brp_inc = GRCAN_CONF_SCALER_INC,
408+};
409+
410+static int grcan_set_bittiming(struct net_device *dev)
411+{
412+ struct grcan_priv *priv = netdev_priv(dev);
413+ struct grcan_registers __iomem *regs = priv->regs;
414+ struct can_bittiming *bt = &priv->can.bittiming;
415+ u32 timing = 0;
416+ int bpr, rsj, ps1, ps2, scaler;
417+
418+ /* Should never happen - function will not be called when
419+ * device is up
420+ */
421+ if (grcan_read_bits(&regs->ctrl, GRCAN_CTRL_ENABLE))
422+ return -EBUSY;
423+
424+ bpr = 0; /* Note bpr and brp are different concepts */
425+ rsj = bt->sjw;
426+ ps1 = (bt->prop_seg + bt->phase_seg1) - 1; /* tseg1 - 1 */
427+ ps2 = bt->phase_seg2;
428+ scaler = (bt->brp - 1);
429+ netdev_dbg(dev, "Request for BPR=%d, RSJ=%d, PS1=%d, PS2=%d, SCALER=%d",
430+ bpr, rsj, ps1, ps2, scaler);
431+ if (!(ps1 > ps2)) {
432+ netdev_err(dev, "PS1 > PS2 must hold: PS1=%d, PS2=%d\n",
433+ ps1, ps2);
434+ return -EINVAL;
435+ }
436+ if (!(ps2 >= rsj)) {
437+ netdev_err(dev, "PS2 >= RSJ must hold: PS2=%d, RSJ=%d\n",
438+ ps2, rsj);
439+ return -EINVAL;
440+ }
441+
442+ timing |= (bpr << GRCAN_CONF_BPR_BIT) & GRCAN_CONF_BPR;
443+ timing |= (rsj << GRCAN_CONF_RSJ_BIT) & GRCAN_CONF_RSJ;
444+ timing |= (ps1 << GRCAN_CONF_PS1_BIT) & GRCAN_CONF_PS1;
445+ timing |= (ps2 << GRCAN_CONF_PS2_BIT) & GRCAN_CONF_PS2;
446+ timing |= (scaler << GRCAN_CONF_SCALER_BIT) & GRCAN_CONF_SCALER;
447+ netdev_info(dev, "setting timing=0x%x\n", timing);
448+ grcan_write_bits(&regs->conf, timing, GRCAN_CONF_TIMING);
449+
450+ return 0;
451+}
452+
453+static int grcan_get_berr_counter(const struct net_device *dev,
454+ struct can_berr_counter *bec)
455+{
456+ struct grcan_priv *priv = netdev_priv(dev);
457+ struct grcan_registers __iomem *regs = priv->regs;
458+ u32 status = grcan_read_reg(&regs->stat);
459+
460+ bec->txerr = (status & GRCAN_STAT_TXERRCNT) >> GRCAN_STAT_TXERRCNT_BIT;
461+ bec->rxerr = (status & GRCAN_STAT_RXERRCNT) >> GRCAN_STAT_RXERRCNT_BIT;
462+ return 0;
463+}
464+
465+static int grcan_poll(struct napi_struct *napi, int budget);
466+
467+/* Reset device, but keep configuration information */
468+static void grcan_reset(struct net_device *dev)
469+{
470+ struct grcan_priv *priv = netdev_priv(dev);
471+ struct grcan_registers __iomem *regs = priv->regs;
472+ u32 config = grcan_read_reg(&regs->conf);
473+
474+ grcan_set_bits(&regs->ctrl, GRCAN_CTRL_RESET);
475+ grcan_write_reg(&regs->conf, config);
476+
477+ priv->eskbp = grcan_read_reg(&regs->txrd);
478+ priv->can.state = CAN_STATE_STOPPED;
479+
480+ /* Turn off hardware filtering - regs->rxcode set to 0 by reset */
481+ grcan_write_reg(&regs->rxmask, 0);
482+}
483+
484+/* stop device without changing any configurations */
485+static void grcan_stop_hardware(struct net_device *dev)
486+{
487+ struct grcan_priv *priv = netdev_priv(dev);
488+ struct grcan_registers __iomem *regs = priv->regs;
489+
490+ grcan_write_reg(&regs->imr, GRCAN_IRQ_NONE);
491+ grcan_clear_bits(&regs->txctrl, GRCAN_TXCTRL_ENABLE);
492+ grcan_clear_bits(&regs->rxctrl, GRCAN_RXCTRL_ENABLE);
493+ grcan_clear_bits(&regs->ctrl, GRCAN_CTRL_ENABLE);
494+}
495+
496+/* Let priv->eskbp catch up to regs->txrd and echo back the skbs if echo
497+ * is true and free them otherwise.
498+ *
499+ * If budget is >= 0, stop after handling at most budget skbs. Otherwise,
500+ * continue until priv->eskbp catches up to regs->txrd.
501+ *
502+ * priv->lock *must* be held when calling this function
503+ */
504+static int catch_up_echo_skb(struct net_device *dev, int budget, bool echo)
505+{
506+ struct grcan_priv *priv = netdev_priv(dev);
507+ struct grcan_registers __iomem *regs = priv->regs;
508+ struct grcan_dma *dma = &priv->dma;
509+ struct net_device_stats *stats = &dev->stats;
510+ int i, work_done;
511+
512+ /* Updates to priv->eskbp and wake-ups of the queue needs to
513+ * be atomic towards the reads of priv->eskbp and shut-downs
514+ * of the queue in grcan_start_xmit.
515+ */
516+ u32 txrd = grcan_read_reg(&regs->txrd);
517+
518+ for (work_done = 0; work_done < budget || budget < 0; work_done++) {
519+ if (priv->eskbp == txrd)
520+ break;
521+ i = priv->eskbp / GRCAN_MSG_SIZE;
522+ if (echo) {
523+ /* Normal echo of messages */
524+ stats->tx_packets++;
525+ stats->tx_bytes += priv->txdlc[i];
526+ priv->txdlc[i] = 0;
527+ can_get_echo_skb(dev, i);
528+ } else {
529+ /* For cleanup of untransmitted messages */
530+ can_free_echo_skb(dev, i);
531+ }
532+
533+ priv->eskbp = grcan_ring_add(priv->eskbp, GRCAN_MSG_SIZE,
534+ dma->tx.size);
535+ txrd = grcan_read_reg(&regs->txrd);
536+ }
537+ return work_done;
538+}
539+
540+static void grcan_lost_one_shot_frame(struct net_device *dev)
541+{
542+ struct grcan_priv *priv = netdev_priv(dev);
543+ struct grcan_registers __iomem *regs = priv->regs;
544+ struct grcan_dma *dma = &priv->dma;
545+ u32 txrd;
546+ unsigned long flags;
547+
548+ spin_lock_irqsave(&priv->lock, flags);
549+
550+ catch_up_echo_skb(dev, -1, true);
551+
552+ if (unlikely(grcan_read_bits(&regs->txctrl, GRCAN_TXCTRL_ENABLE))) {
553+ /* Should never happen */
554+ netdev_err(dev, "TXCTRL enabled at TXLOSS in one shot mode\n");
555+ } else {
556+ /* By the time an GRCAN_IRQ_TXLOSS is generated in
557+ * one-shot mode there is no problem in writing
558+ * to TXRD even in versions of the hardware in
559+ * which GRCAN_TXCTRL_ONGOING is not cleared properly
560+ * in one-shot mode.
561+ */
562+
563+ /* Skip message and discard echo-skb */
564+ txrd = grcan_read_reg(&regs->txrd);
565+ txrd = grcan_ring_add(txrd, GRCAN_MSG_SIZE, dma->tx.size);
566+ grcan_write_reg(&regs->txrd, txrd);
567+ catch_up_echo_skb(dev, -1, false);
568+
569+ if (!priv->resetting && !priv->closing &&
570+ !(priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)) {
571+ netif_wake_queue(dev);
572+ grcan_set_bits(&regs->txctrl, GRCAN_TXCTRL_ENABLE);
573+ }
574+ }
575+
576+ spin_unlock_irqrestore(&priv->lock, flags);
577+}
578+
579+static void grcan_err(struct net_device *dev, u32 sources, u32 status)
580+{
581+ struct grcan_priv *priv = netdev_priv(dev);
582+ struct grcan_registers __iomem *regs = priv->regs;
583+ struct grcan_dma *dma = &priv->dma;
584+ struct net_device_stats *stats = &dev->stats;
585+ struct can_frame cf;
586+
587+ /* Zero potential error_frame */
588+ memset(&cf, 0, sizeof(cf));
589+
590+ /* Message lost interrupt. This might be due to arbitration error, but
591+ * is also triggered when there is no one else on the can bus or when
592+ * there is a problem with the hardware interface or the bus itself. As
593+ * arbitration errors can not be singled out, no error frames are
594+ * generated reporting this event as an arbitration error.
595+ */
596+ if (sources & GRCAN_IRQ_TXLOSS) {
597+ /* Take care of failed one-shot transmit */
598+ if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT)
599+ grcan_lost_one_shot_frame(dev);
600+
601+ /* Stop printing as soon as error passive or bus off is in
602+ * effect to limit the amount of txloss debug printouts.
603+ */
604+ if (!(status & GRCAN_STAT_ERRCTR_RELATED)) {
605+ netdev_dbg(dev, "tx message lost\n");
606+ stats->tx_errors++;
607+ }
608+ }
609+
610+ /* Conditions dealing with the error counters. There is no interrupt for
611+ * error warning, but there are interrupts for increases of the error
612+ * counters.
613+ */
614+ if ((sources & GRCAN_IRQ_ERRCTR_RELATED) ||
615+ (status & GRCAN_STAT_ERRCTR_RELATED)) {
616+ enum can_state state = priv->can.state;
617+ enum can_state oldstate = state;
618+ u32 txerr = (status & GRCAN_STAT_TXERRCNT)
619+ >> GRCAN_STAT_TXERRCNT_BIT;
620+ u32 rxerr = (status & GRCAN_STAT_RXERRCNT)
621+ >> GRCAN_STAT_RXERRCNT_BIT;
622+
623+ /* Figure out current state */
624+ if (status & GRCAN_STAT_OFF) {
625+ state = CAN_STATE_BUS_OFF;
626+ } else if (status & GRCAN_STAT_PASS) {
627+ state = CAN_STATE_ERROR_PASSIVE;
628+ } else if (txerr >= GRCAN_STAT_ERRCNT_WARNING_LIMIT ||
629+ rxerr >= GRCAN_STAT_ERRCNT_WARNING_LIMIT) {
630+ state = CAN_STATE_ERROR_WARNING;
631+ } else {
632+ state = CAN_STATE_ERROR_ACTIVE;
633+ }
634+
635+ /* Handle and report state changes */
636+ if (state != oldstate) {
637+ switch (state) {
638+ case CAN_STATE_BUS_OFF:
639+ netdev_dbg(dev, "bus-off\n");
640+ netif_carrier_off(dev);
641+ priv->can.can_stats.bus_off++;
642+
643+ /* Prevent the hardware from recovering from bus
644+ * off on its own if restart is disabled.
645+ */
646+ if (!priv->can.restart_ms)
647+ grcan_stop_hardware(dev);
648+
649+ cf.can_id |= CAN_ERR_BUSOFF;
650+ break;
651+
652+ case CAN_STATE_ERROR_PASSIVE:
653+ netdev_dbg(dev, "Error passive condition\n");
654+ priv->can.can_stats.error_passive++;
655+
656+ cf.can_id |= CAN_ERR_CRTL;
657+ if (txerr >= GRCAN_STAT_ERRCNT_PASSIVE_LIMIT)
658+ cf.data[1] |= CAN_ERR_CRTL_TX_PASSIVE;
659+ if (rxerr >= GRCAN_STAT_ERRCNT_PASSIVE_LIMIT)
660+ cf.data[1] |= CAN_ERR_CRTL_RX_PASSIVE;
661+ break;
662+
663+ case CAN_STATE_ERROR_WARNING:
664+ netdev_dbg(dev, "Error warning condition\n");
665+ priv->can.can_stats.error_warning++;
666+
667+ cf.can_id |= CAN_ERR_CRTL;
668+ if (txerr >= GRCAN_STAT_ERRCNT_WARNING_LIMIT)
669+ cf.data[1] |= CAN_ERR_CRTL_TX_WARNING;
670+ if (rxerr >= GRCAN_STAT_ERRCNT_WARNING_LIMIT)
671+ cf.data[1] |= CAN_ERR_CRTL_RX_WARNING;
672+ break;
673+
674+ case CAN_STATE_ERROR_ACTIVE:
675+ netdev_dbg(dev, "Error active condition\n");
676+ cf.can_id |= CAN_ERR_CRTL;
677+ break;
678+
679+ default:
680+ /* There are no others at this point */
681+ break;
682+ }
683+ cf.data[6] = txerr;
684+ cf.data[7] = rxerr;
685+ priv->can.state = state;
686+ }
687+
688+ /* Report automatic restarts */
689+ if (priv->can.restart_ms && oldstate == CAN_STATE_BUS_OFF) {
690+ unsigned long flags;
691+
692+ cf.can_id |= CAN_ERR_RESTARTED;
693+ netdev_dbg(dev, "restarted\n");
694+ priv->can.can_stats.restarts++;
695+ netif_carrier_on(dev);
696+
697+ spin_lock_irqsave(&priv->lock, flags);
698+
699+ if (!priv->resetting && !priv->closing) {
700+ u32 txwr = grcan_read_reg(&regs->txwr);
701+
702+ if (grcan_txspace(dma->tx.size, txwr,
703+ priv->eskbp))
704+ netif_wake_queue(dev);
705+ }
706+
707+ spin_unlock_irqrestore(&priv->lock, flags);
708+ }
709+ }
710+
711+ /* Data overrun interrupt */
712+ if ((sources & GRCAN_IRQ_OR) || (status & GRCAN_STAT_OR)) {
713+ netdev_dbg(dev, "got data overrun interrupt\n");
714+ stats->rx_over_errors++;
715+ stats->rx_errors++;
716+
717+ cf.can_id |= CAN_ERR_CRTL;
718+ cf.data[1] |= CAN_ERR_CRTL_RX_OVERFLOW;
719+ }
720+
721+ /* AHB bus error interrupts (not CAN bus errors) - shut down the
722+ * device.
723+ */
724+ if (sources & (GRCAN_IRQ_TXAHBERR | GRCAN_IRQ_RXAHBERR) ||
725+ (status & GRCAN_STAT_AHBERR)) {
726+ char *txrx = "";
727+ unsigned long flags;
728+
729+ if (sources & GRCAN_IRQ_TXAHBERR) {
730+ txrx = "on tx ";
731+ stats->tx_errors++;
732+ } else if (sources & GRCAN_IRQ_RXAHBERR) {
733+ txrx = "on rx ";
734+ stats->rx_errors++;
735+ }
736+ netdev_err(dev, "Fatal AHB buss error %s- halting device\n",
737+ txrx);
738+
739+ spin_lock_irqsave(&priv->lock, flags);
740+
741+ /* Prevent anything to be enabled again and halt device */
742+ priv->closing = true;
743+ netif_stop_queue(dev);
744+ grcan_stop_hardware(dev);
745+ priv->can.state = CAN_STATE_STOPPED;
746+
747+ spin_unlock_irqrestore(&priv->lock, flags);
748+ }
749+
750+ /* Pass on error frame if something to report,
751+ * i.e. id contains some information
752+ */
753+ if (cf.can_id) {
754+ struct can_frame *skb_cf;
755+ struct sk_buff *skb = alloc_can_err_skb(dev, &skb_cf);
756+
757+ if (skb == NULL) {
758+ netdev_dbg(dev, "could not allocate error frame\n");
759+ return;
760+ }
761+ skb_cf->can_id |= cf.can_id;
762+ memcpy(skb_cf->data, cf.data, sizeof(cf.data));
763+
764+ netif_rx(skb);
765+ }
766+}
767+
768+static irqreturn_t grcan_interrupt(int irq, void *dev_id)
769+{
770+ struct net_device *dev = dev_id;
771+ struct grcan_priv *priv = netdev_priv(dev);
772+ struct grcan_registers __iomem *regs = priv->regs;
773+ u32 sources, status;
774+
775+ /* Find out the source */
776+ sources = grcan_read_reg(&regs->pimsr);
777+ if (!sources)
778+ return IRQ_NONE;
779+ grcan_write_reg(&regs->picr, sources);
780+ status = grcan_read_reg(&regs->stat);
781+
782+ /* If we got TX progress, the device has not hanged,
783+ * so disable the hang timer
784+ */
785+ if (priv->need_txbug_workaround &&
786+ (sources & (GRCAN_IRQ_TX | GRCAN_IRQ_TXLOSS))) {
787+ del_timer(&priv->hang_timer);
788+ }
789+
790+ /* Frame(s) received or transmitted */
791+ if (sources & (GRCAN_IRQ_TX | GRCAN_IRQ_RX)) {
792+ /* Disable tx/rx interrupts and schedule poll(). No need for
793+ * locking as interference from a running reset at worst leads
794+ * to an extra interrupt.
795+ */
796+ grcan_clear_bits(&regs->imr, GRCAN_IRQ_TX | GRCAN_IRQ_RX);
797+ napi_schedule(&priv->napi);
798+ }
799+
800+ /* (Potential) error conditions to take care of */
801+ if (sources & GRCAN_IRQ_ERRORS)
802+ grcan_err(dev, sources, status);
803+
804+ return IRQ_HANDLED;
805+}
806+
807+/* Reset device and restart operations from where they were.
808+ *
809+ * This assumes that RXCTRL & RXCTRL is properly disabled and that RX
810+ * is not ONGOING (TX might be stuck in ONGOING due to a harwrware bug
811+ * for single shot)
812+ */
813+static void grcan_running_reset(unsigned long data)
814+{
815+ struct net_device *dev = (struct net_device *)data;
816+ struct grcan_priv *priv = netdev_priv(dev);
817+ struct grcan_registers __iomem *regs = priv->regs;
818+ unsigned long flags;
819+
820+ /* This temporarily messes with eskbp, so we need to lock
821+ * priv->lock
822+ */
823+ spin_lock_irqsave(&priv->lock, flags);
824+
825+ priv->resetting = false;
826+ del_timer(&priv->hang_timer);
827+ del_timer(&priv->rr_timer);
828+
829+ if (!priv->closing) {
830+ /* Save and reset - config register preserved by grcan_reset */
831+ u32 imr = grcan_read_reg(&regs->imr);
832+
833+ u32 txaddr = grcan_read_reg(&regs->txaddr);
834+ u32 txsize = grcan_read_reg(&regs->txsize);
835+ u32 txwr = grcan_read_reg(&regs->txwr);
836+ u32 txrd = grcan_read_reg(&regs->txrd);
837+ u32 eskbp = priv->eskbp;
838+
839+ u32 rxaddr = grcan_read_reg(&regs->rxaddr);
840+ u32 rxsize = grcan_read_reg(&regs->rxsize);
841+ u32 rxwr = grcan_read_reg(&regs->rxwr);
842+ u32 rxrd = grcan_read_reg(&regs->rxrd);
843+
844+ grcan_reset(dev);
845+
846+ /* Restore */
847+ grcan_write_reg(&regs->txaddr, txaddr);
848+ grcan_write_reg(&regs->txsize, txsize);
849+ grcan_write_reg(&regs->txwr, txwr);
850+ grcan_write_reg(&regs->txrd, txrd);
851+ priv->eskbp = eskbp;
852+
853+ grcan_write_reg(&regs->rxaddr, rxaddr);
854+ grcan_write_reg(&regs->rxsize, rxsize);
855+ grcan_write_reg(&regs->rxwr, rxwr);
856+ grcan_write_reg(&regs->rxrd, rxrd);
857+
858+ /* Turn on device again */
859+ grcan_write_reg(&regs->imr, imr);
860+ priv->can.state = CAN_STATE_ERROR_ACTIVE;
861+ grcan_write_reg(&regs->txctrl, GRCAN_TXCTRL_ENABLE
862+ | (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT
863+ ? GRCAN_TXCTRL_SINGLE : 0));
864+ grcan_write_reg(&regs->rxctrl, GRCAN_RXCTRL_ENABLE);
865+ grcan_write_reg(&regs->ctrl, GRCAN_CTRL_ENABLE);
866+
867+ /* Start queue if there is size and listen-onle mode is not
868+ * enabled
869+ */
870+ if (grcan_txspace(priv->dma.tx.size, txwr, priv->eskbp) &&
871+ !(priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY))
872+ netif_wake_queue(dev);
873+ }
874+
875+ spin_unlock_irqrestore(&priv->lock, flags);
876+
877+ netdev_err(dev, "Device reset and restored\n");
878+}
879+
880+/* Waiting time in usecs corresponding to the transmission of three maximum
881+ * sized can frames in the given bitrate (in bits/sec). Waiting for this amount
882+ * of time makes sure that the can controller have time to finish sending or
883+ * receiving a frame with a good margin.
884+ *
885+ * usecs/sec * number of frames * bits/frame / bits/sec
886+ */
887+static inline u32 grcan_ongoing_wait_usecs(__u32 bitrate)
888+{
889+ return 1000000 * 3 * GRCAN_EFF_FRAME_MAX_BITS / bitrate;
890+}
891+
892+/* Set timer so that it will not fire until after a period in which the can
893+ * controller have a good margin to finish transmitting a frame unless it has
894+ * hanged
895+ */
896+static inline void grcan_reset_timer(struct timer_list *timer, __u32 bitrate)
897+{
898+ u32 wait_jiffies = usecs_to_jiffies(grcan_ongoing_wait_usecs(bitrate));
899+
900+ mod_timer(timer, jiffies + wait_jiffies);
901+}
902+
903+/* Disable channels and schedule a running reset */
904+static void grcan_initiate_running_reset(unsigned long data)
905+{
906+ struct net_device *dev = (struct net_device *)data;
907+ struct grcan_priv *priv = netdev_priv(dev);
908+ struct grcan_registers __iomem *regs = priv->regs;
909+ unsigned long flags;
910+
911+ netdev_err(dev, "Device seems hanged - reset scheduled\n");
912+
913+ spin_lock_irqsave(&priv->lock, flags);
914+
915+ /* The main body of this function must never be executed again
916+ * until after an execution of grcan_running_reset
917+ */
918+ if (!priv->resetting && !priv->closing) {
919+ priv->resetting = true;
920+ netif_stop_queue(dev);
921+ grcan_clear_bits(&regs->txctrl, GRCAN_TXCTRL_ENABLE);
922+ grcan_clear_bits(&regs->rxctrl, GRCAN_RXCTRL_ENABLE);
923+ grcan_reset_timer(&priv->rr_timer, priv->can.bittiming.bitrate);
924+ }
925+
926+ spin_unlock_irqrestore(&priv->lock, flags);
927+}
928+
929+static void grcan_free_dma_buffers(struct net_device *dev)
930+{
931+ struct grcan_priv *priv = netdev_priv(dev);
932+ struct grcan_dma *dma = &priv->dma;
933+
934+ dma_free_coherent(&dev->dev, dma->base_size, dma->base_buf,
935+ dma->base_handle);
936+ memset(dma, 0, sizeof(*dma));
937+}
938+
939+static int grcan_allocate_dma_buffers(struct net_device *dev,
940+ size_t tsize, size_t rsize)
941+{
942+ struct grcan_priv *priv = netdev_priv(dev);
943+ struct grcan_dma *dma = &priv->dma;
944+ struct grcan_dma_buffer *large = rsize > tsize ? &dma->rx : &dma->tx;
945+ struct grcan_dma_buffer *small = rsize > tsize ? &dma->tx : &dma->rx;
946+ size_t shift;
947+
948+ /* Need a whole number of GRCAN_BUFFER_ALIGNMENT for the large,
949+ * i.e. first buffer
950+ */
951+ size_t maxs = max(tsize, rsize);
952+ size_t lsize = ALIGN(maxs, GRCAN_BUFFER_ALIGNMENT);
953+
954+ /* Put the small buffer after that */
955+ size_t ssize = min(tsize, rsize);
956+
957+ /* Extra GRCAN_BUFFER_ALIGNMENT to allow for alignment */
958+ dma->base_size = lsize + ssize + GRCAN_BUFFER_ALIGNMENT;
959+ dma->base_buf = dma_alloc_coherent(&dev->dev,
960+ dma->base_size,
961+ &dma->base_handle,
962+ GFP_KERNEL);
963+
964+ if (!dma->base_buf)
965+ return -ENOMEM;
966+
967+ dma->tx.size = tsize;
968+ dma->rx.size = rsize;
969+
970+ large->handle = ALIGN(dma->base_handle, GRCAN_BUFFER_ALIGNMENT);
971+ small->handle = large->handle + lsize;
972+ shift = large->handle - dma->base_handle;
973+
974+ large->buf = dma->base_buf + shift;
975+ small->buf = large->buf + lsize;
976+
977+ return 0;
978+}
979+
980+/* priv->lock *must* be held when calling this function */
981+static int grcan_start(struct net_device *dev)
982+{
983+ struct grcan_priv *priv = netdev_priv(dev);
984+ struct grcan_registers __iomem *regs = priv->regs;
985+ u32 confop, txctrl;
986+
987+ grcan_reset(dev);
988+
989+ grcan_write_reg(&regs->txaddr, priv->dma.tx.handle);
990+ grcan_write_reg(&regs->txsize, priv->dma.tx.size);
991+ /* regs->txwr, regs->txrd and priv->eskbp already set to 0 by reset */
992+
993+ grcan_write_reg(&regs->rxaddr, priv->dma.rx.handle);
994+ grcan_write_reg(&regs->rxsize, priv->dma.rx.size);
995+ /* regs->rxwr and regs->rxrd already set to 0 by reset */
996+
997+ /* Enable interrupts */
998+ grcan_read_reg(&regs->pir);
999+ grcan_write_reg(&regs->imr, GRCAN_IRQ_DEFAULT);
1000+
1001+ /* Enable interfaces, channels and device */
1002+ confop = GRCAN_CONF_ABORT
1003+ | (priv->config.enable0 ? GRCAN_CONF_ENABLE0 : 0)
1004+ | (priv->config.enable1 ? GRCAN_CONF_ENABLE1 : 0)
1005+ | (priv->config.select ? GRCAN_CONF_SELECT : 0)
1006+ | (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY ?
1007+ GRCAN_CONF_SILENT : 0)
1008+ | (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES ?
1009+ GRCAN_CONF_SAM : 0);
1010+ grcan_write_bits(&regs->conf, confop, GRCAN_CONF_OPERATION);
1011+ txctrl = GRCAN_TXCTRL_ENABLE
1012+ | (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT
1013+ ? GRCAN_TXCTRL_SINGLE : 0);
1014+ grcan_write_reg(&regs->txctrl, txctrl);
1015+ grcan_write_reg(&regs->rxctrl, GRCAN_RXCTRL_ENABLE);
1016+ grcan_write_reg(&regs->ctrl, GRCAN_CTRL_ENABLE);
1017+
1018+ priv->can.state = CAN_STATE_ERROR_ACTIVE;
1019+
1020+ return 0;
1021+}
1022+
1023+static int grcan_set_mode(struct net_device *dev, enum can_mode mode)
1024+{
1025+ struct grcan_priv *priv = netdev_priv(dev);
1026+ unsigned long flags;
1027+ int err = 0;
1028+
1029+ if (mode == CAN_MODE_START) {
1030+ /* This might be called to restart the device to recover from
1031+ * bus off errors
1032+ */
1033+ spin_lock_irqsave(&priv->lock, flags);
1034+ if (priv->closing || priv->resetting) {
1035+ err = -EBUSY;
1036+ } else {
1037+ netdev_info(dev, "Restarting device\n");
1038+ grcan_start(dev);
1039+ if (!(priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY))
1040+ netif_wake_queue(dev);
1041+ }
1042+ spin_unlock_irqrestore(&priv->lock, flags);
1043+ return err;
1044+ }
1045+ return -EOPNOTSUPP;
1046+}
1047+
1048+static int grcan_open(struct net_device *dev)
1049+{
1050+ struct grcan_priv *priv = netdev_priv(dev);
1051+ struct grcan_dma *dma = &priv->dma;
1052+ unsigned long flags;
1053+ int err;
1054+
1055+ /* Allocate memory */
1056+ err = grcan_allocate_dma_buffers(dev, priv->config.txsize,
1057+ priv->config.rxsize);
1058+ if (err) {
1059+ netdev_err(dev, "could not allocate DMA buffers\n");
1060+ return err;
1061+ }
1062+
1063+ priv->echo_skb = kzalloc(dma->tx.size * sizeof(*priv->echo_skb),
1064+ GFP_KERNEL);
1065+ if (!priv->echo_skb) {
1066+ err = -ENOMEM;
1067+ goto exit_free_dma_buffers;
1068+ }
1069+ priv->can.echo_skb_max = dma->tx.size;
1070+ priv->can.echo_skb = priv->echo_skb;
1071+
1072+ priv->txdlc = kzalloc(dma->tx.size * sizeof(*priv->txdlc), GFP_KERNEL);
1073+ if (!priv->txdlc) {
1074+ err = -ENOMEM;
1075+ goto exit_free_echo_skb;
1076+ }
1077+
1078+ /* Get can device up */
1079+ err = open_candev(dev);
1080+ if (err)
1081+ goto exit_free_txdlc;
1082+
1083+ err = request_irq(dev->irq, grcan_interrupt, IRQF_SHARED,
1084+ dev->name, dev);
1085+ if (err)
1086+ goto exit_close_candev;
1087+
1088+ spin_lock_irqsave(&priv->lock, flags);
1089+
1090+ napi_enable(&priv->napi);
1091+ grcan_start(dev);
1092+ if (!(priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY))
1093+ netif_start_queue(dev);
1094+ priv->resetting = false;
1095+ priv->closing = false;
1096+
1097+ spin_unlock_irqrestore(&priv->lock, flags);
1098+
1099+ return 0;
1100+
1101+exit_close_candev:
1102+ close_candev(dev);
1103+exit_free_txdlc:
1104+ kfree(priv->txdlc);
1105+exit_free_echo_skb:
1106+ kfree(priv->echo_skb);
1107+exit_free_dma_buffers:
1108+ grcan_free_dma_buffers(dev);
1109+ return err;
1110+}
1111+
1112+static int grcan_close(struct net_device *dev)
1113+{
1114+ struct grcan_priv *priv = netdev_priv(dev);
1115+ unsigned long flags;
1116+
1117+ napi_disable(&priv->napi);
1118+
1119+ spin_lock_irqsave(&priv->lock, flags);
1120+
1121+ priv->closing = true;
1122+ if (priv->need_txbug_workaround) {
1123+ del_timer_sync(&priv->hang_timer);
1124+ del_timer_sync(&priv->rr_timer);
1125+ }
1126+ netif_stop_queue(dev);
1127+ grcan_stop_hardware(dev);
1128+ priv->can.state = CAN_STATE_STOPPED;
1129+
1130+ spin_unlock_irqrestore(&priv->lock, flags);
1131+
1132+ free_irq(dev->irq, dev);
1133+ close_candev(dev);
1134+
1135+ grcan_free_dma_buffers(dev);
1136+ priv->can.echo_skb_max = 0;
1137+ priv->can.echo_skb = NULL;
1138+ kfree(priv->echo_skb);
1139+ kfree(priv->txdlc);
1140+
1141+ return 0;
1142+}
1143+
1144+static int grcan_transmit_catch_up(struct net_device *dev, int budget)
1145+{
1146+ struct grcan_priv *priv = netdev_priv(dev);
1147+ unsigned long flags;
1148+ int work_done;
1149+
1150+ spin_lock_irqsave(&priv->lock, flags);
1151+
1152+ work_done = catch_up_echo_skb(dev, budget, true);
1153+ if (work_done) {
1154+ if (!priv->resetting && !priv->closing &&
1155+ !(priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY))
1156+ netif_wake_queue(dev);
1157+
1158+ /* With napi we don't get TX interrupts for a while,
1159+ * so prevent a running reset while catching up
1160+ */
1161+ if (priv->need_txbug_workaround)
1162+ del_timer(&priv->hang_timer);
1163+ }
1164+
1165+ spin_unlock_irqrestore(&priv->lock, flags);
1166+
1167+ return work_done;
1168+}
1169+
1170+static int grcan_receive(struct net_device *dev, int budget)
1171+{
1172+ struct grcan_priv *priv = netdev_priv(dev);
1173+ struct grcan_registers __iomem *regs = priv->regs;
1174+ struct grcan_dma *dma = &priv->dma;
1175+ struct net_device_stats *stats = &dev->stats;
1176+ struct can_frame *cf;
1177+ struct sk_buff *skb;
1178+ u32 wr, rd, startrd;
1179+ u32 *slot;
1180+ u32 i, rtr, eff, j, shift;
1181+ int work_done = 0;
1182+
1183+ rd = grcan_read_reg(&regs->rxrd);
1184+ startrd = rd;
1185+ for (work_done = 0; work_done < budget; work_done++) {
1186+ /* Check for packet to receive */
1187+ wr = grcan_read_reg(&regs->rxwr);
1188+ if (rd == wr)
1189+ break;
1190+
1191+ /* Take care of packet */
1192+ skb = alloc_can_skb(dev, &cf);
1193+ if (skb == NULL) {
1194+ netdev_err(dev,
1195+ "dropping frame: skb allocation failed\n");
1196+ stats->rx_dropped++;
1197+ continue;
1198+ }
1199+
1200+ slot = dma->rx.buf + rd;
1201+ eff = slot[0] & GRCAN_MSG_IDE;
1202+ rtr = slot[0] & GRCAN_MSG_RTR;
1203+ if (eff) {
1204+ cf->can_id = ((slot[0] & GRCAN_MSG_EID)
1205+ >> GRCAN_MSG_EID_BIT);
1206+ cf->can_id |= CAN_EFF_FLAG;
1207+ } else {
1208+ cf->can_id = ((slot[0] & GRCAN_MSG_BID)
1209+ >> GRCAN_MSG_BID_BIT);
1210+ }
1211+ cf->can_dlc = get_can_dlc((slot[1] & GRCAN_MSG_DLC)
1212+ >> GRCAN_MSG_DLC_BIT);
1213+ if (rtr) {
1214+ cf->can_id |= CAN_RTR_FLAG;
1215+ } else {
1216+ for (i = 0; i < cf->can_dlc; i++) {
1217+ j = GRCAN_MSG_DATA_SLOT_INDEX(i);
1218+ shift = GRCAN_MSG_DATA_SHIFT(i);
1219+ cf->data[i] = (u8)(slot[j] >> shift);
1220+ }
1221+ }
1222+ netif_receive_skb(skb);
1223+
1224+ /* Update statistics and read pointer */
1225+ stats->rx_packets++;
1226+ stats->rx_bytes += cf->can_dlc;
1227+ rd = grcan_ring_add(rd, GRCAN_MSG_SIZE, dma->rx.size);
1228+ }
1229+
1230+ /* Make sure everything is read before allowing hardware to
1231+ * use the memory
1232+ */
1233+ mb();
1234+
1235+ /* Update read pointer - no need to check for ongoing */
1236+ if (likely(rd != startrd))
1237+ grcan_write_reg(&regs->rxrd, rd);
1238+
1239+ return work_done;
1240+}
1241+
1242+static int grcan_poll(struct napi_struct *napi, int budget)
1243+{
1244+ struct grcan_priv *priv = container_of(napi, struct grcan_priv, napi);
1245+ struct net_device *dev = priv->dev;
1246+ struct grcan_registers __iomem *regs = priv->regs;
1247+ unsigned long flags;
1248+ int tx_work_done, rx_work_done;
1249+ int rx_budget = budget / 2;
1250+ int tx_budget = budget - rx_budget;
1251+
1252+ /* Half of the budget for receiveing messages */
1253+ rx_work_done = grcan_receive(dev, rx_budget);
1254+
1255+ /* Half of the budget for transmitting messages as that can trigger echo
1256+ * frames being received
1257+ */
1258+ tx_work_done = grcan_transmit_catch_up(dev, tx_budget);
1259+
1260+ if (rx_work_done < rx_budget && tx_work_done < tx_budget) {
1261+ napi_complete(napi);
1262+
1263+ /* Guarantee no interference with a running reset that otherwise
1264+ * could turn off interrupts.
1265+ */
1266+ spin_lock_irqsave(&priv->lock, flags);
1267+
1268+ /* Enable tx and rx interrupts again. No need to check
1269+ * priv->closing as napi_disable in grcan_close is waiting for
1270+ * scheduled napi calls to finish.
1271+ */
1272+ grcan_set_bits(&regs->imr, GRCAN_IRQ_TX | GRCAN_IRQ_RX);
1273+
1274+ spin_unlock_irqrestore(&priv->lock, flags);
1275+ }
1276+
1277+ return rx_work_done + tx_work_done;
1278+}
1279+
1280+/* Work tx bug by waiting while for the risky situation to clear. If that fails,
1281+ * drop a frame in one-shot mode or indicate a busy device otherwise.
1282+ *
1283+ * Returns 0 on successful wait. Otherwise it sets *netdev_tx_status to the
1284+ * value that should be returned by grcan_start_xmit when aborting the xmit.
1285+ */
1286+static int grcan_txbug_workaround(struct net_device *dev, struct sk_buff *skb,
1287+ u32 txwr, u32 oneshotmode,
1288+ netdev_tx_t *netdev_tx_status)
1289+{
1290+ struct grcan_priv *priv = netdev_priv(dev);
1291+ struct grcan_registers __iomem *regs = priv->regs;
1292+ struct grcan_dma *dma = &priv->dma;
1293+ int i;
1294+ unsigned long flags;
1295+
1296+ /* Wait a while for ongoing to be cleared or read pointer to catch up to
1297+ * write pointer. The latter is needed due to a bug in older versions of
1298+ * GRCAN in which ONGOING is not cleared properly one-shot mode when a
1299+ * transmission fails.
1300+ */
1301+ for (i = 0; i < GRCAN_SHORTWAIT_USECS; i++) {
1302+ udelay(1);
1303+ if (!grcan_read_bits(&regs->txctrl, GRCAN_TXCTRL_ONGOING) ||
1304+ grcan_read_reg(&regs->txrd) == txwr) {
1305+ return 0;
1306+ }
1307+ }
1308+
1309+ /* Clean up, in case the situation was not resolved */
1310+ spin_lock_irqsave(&priv->lock, flags);
1311+ if (!priv->resetting && !priv->closing) {
1312+ /* Queue might have been stopped earlier in grcan_start_xmit */
1313+ if (grcan_txspace(dma->tx.size, txwr, priv->eskbp))
1314+ netif_wake_queue(dev);
1315+ /* Set a timer to resolve a hanged tx controller */
1316+ if (!timer_pending(&priv->hang_timer))
1317+ grcan_reset_timer(&priv->hang_timer,
1318+ priv->can.bittiming.bitrate);
1319+ }
1320+ spin_unlock_irqrestore(&priv->lock, flags);
1321+
1322+ if (oneshotmode) {
1323+ /* In one-shot mode we should never end up here because
1324+ * then the interrupt handler increases txrd on TXLOSS,
1325+ * but it is consistent with one-shot mode to drop the
1326+ * frame in this case.
1327+ */
1328+ kfree_skb(skb);
1329+ *netdev_tx_status = NETDEV_TX_OK;
1330+ } else {
1331+ /* In normal mode the socket-can transmission queue get
1332+ * to keep the frame so that it can be retransmitted
1333+ * later
1334+ */
1335+ *netdev_tx_status = NETDEV_TX_BUSY;
1336+ }
1337+ return -EBUSY;
1338+}
1339+
1340+/* Notes on the tx cyclic buffer handling:
1341+ *
1342+ * regs->txwr - the next slot for the driver to put data to be sent
1343+ * regs->txrd - the next slot for the device to read data
1344+ * priv->eskbp - the next slot for the driver to call can_put_echo_skb for
1345+ *
1346+ * grcan_start_xmit can enter more messages as long as regs->txwr does
1347+ * not reach priv->eskbp (within 1 message gap)
1348+ *
1349+ * The device sends messages until regs->txrd reaches regs->txwr
1350+ *
1351+ * The interrupt calls handler calls can_put_echo_skb until
1352+ * priv->eskbp reaches regs->txrd
1353+ */
1354+static netdev_tx_t grcan_start_xmit(struct sk_buff *skb,
1355+ struct net_device *dev)
1356+{
1357+ struct grcan_priv *priv = netdev_priv(dev);
1358+ struct grcan_registers __iomem *regs = priv->regs;
1359+ struct grcan_dma *dma = &priv->dma;
1360+ struct can_frame *cf = (struct can_frame *)skb->data;
1361+ u32 id, txwr, txrd, space, txctrl;
1362+ int slotindex;
1363+ u32 *slot;
1364+ u32 i, rtr, eff, dlc, tmp, err;
1365+ int j, shift;
1366+ unsigned long flags;
1367+ u32 oneshotmode = priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT;
1368+
1369+ if (can_dropped_invalid_skb(dev, skb))
1370+ return NETDEV_TX_OK;
1371+
1372+ /* Trying to transmit in silent mode will generate error interrupts, but
1373+ * this should never happen - the queue should not have been started.
1374+ */
1375+ if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
1376+ return NETDEV_TX_BUSY;
1377+
1378+ /* Reads of priv->eskbp and shut-downs of the queue needs to
1379+ * be atomic towards the updates to priv->eskbp and wake-ups
1380+ * of the queue in the interrupt handler.
1381+ */
1382+ spin_lock_irqsave(&priv->lock, flags);
1383+
1384+ txwr = grcan_read_reg(&regs->txwr);
1385+ space = grcan_txspace(dma->tx.size, txwr, priv->eskbp);
1386+
1387+ slotindex = txwr / GRCAN_MSG_SIZE;
1388+ slot = dma->tx.buf + txwr;
1389+
1390+ if (unlikely(space == 1))
1391+ netif_stop_queue(dev);
1392+
1393+ spin_unlock_irqrestore(&priv->lock, flags);
1394+ /* End of critical section*/
1395+
1396+ /* This should never happen. If circular buffer is full, the
1397+ * netif_stop_queue should have been stopped already.
1398+ */
1399+ if (unlikely(!space)) {
1400+ netdev_err(dev, "No buffer space, but queue is non-stopped.\n");
1401+ return NETDEV_TX_BUSY;
1402+ }
1403+
1404+ /* Convert and write CAN message to DMA buffer */
1405+ eff = cf->can_id & CAN_EFF_FLAG;
1406+ rtr = cf->can_id & CAN_RTR_FLAG;
1407+ id = cf->can_id & (eff ? CAN_EFF_MASK : CAN_SFF_MASK);
1408+ dlc = cf->can_dlc;
1409+ if (eff)
1410+ tmp = (id << GRCAN_MSG_EID_BIT) & GRCAN_MSG_EID;
1411+ else
1412+ tmp = (id << GRCAN_MSG_BID_BIT) & GRCAN_MSG_BID;
1413+ slot[0] = (eff ? GRCAN_MSG_IDE : 0) | (rtr ? GRCAN_MSG_RTR : 0) | tmp;
1414+
1415+ slot[1] = ((dlc << GRCAN_MSG_DLC_BIT) & GRCAN_MSG_DLC);
1416+ slot[2] = 0;
1417+ slot[3] = 0;
1418+ for (i = 0; i < dlc; i++) {
1419+ j = GRCAN_MSG_DATA_SLOT_INDEX(i);
1420+ shift = GRCAN_MSG_DATA_SHIFT(i);
1421+ slot[j] |= cf->data[i] << shift;
1422+ }
1423+
1424+ /* Checking that channel has not been disabled. These cases
1425+ * should never happen
1426+ */
1427+ txctrl = grcan_read_reg(&regs->txctrl);
1428+ if (!(txctrl & GRCAN_TXCTRL_ENABLE))
1429+ netdev_err(dev, "tx channel spuriously disabled\n");
1430+
1431+ if (oneshotmode && !(txctrl & GRCAN_TXCTRL_SINGLE))
1432+ netdev_err(dev, "one-shot mode spuriously disabled\n");
1433+
1434+ /* Bug workaround for old version of grcan where updating txwr
1435+ * in the same clock cycle as the controller updates txrd to
1436+ * the current txwr could hang the can controller
1437+ */
1438+ if (priv->need_txbug_workaround) {
1439+ txrd = grcan_read_reg(&regs->txrd);
1440+ if (unlikely(grcan_ring_sub(txwr, txrd, dma->tx.size) == 1)) {
1441+ netdev_tx_t txstatus;
1442+
1443+ err = grcan_txbug_workaround(dev, skb, txwr,
1444+ oneshotmode, &txstatus);
1445+ if (err)
1446+ return txstatus;
1447+ }
1448+ }
1449+
1450+ /* Prepare skb for echoing. This must be after the bug workaround above
1451+ * as ownership of the skb is passed on by calling can_put_echo_skb.
1452+ * Returning NETDEV_TX_BUSY or accessing skb or cf after a call to
1453+ * can_put_echo_skb would be an error unless other measures are
1454+ * taken.
1455+ */
1456+ priv->txdlc[slotindex] = cf->can_dlc; /* Store dlc for statistics */
1457+ can_put_echo_skb(skb, dev, slotindex);
1458+
1459+ /* Make sure everything is written before allowing hardware to
1460+ * read from the memory
1461+ */
1462+ wmb();
1463+
1464+ /* Update write pointer to start transmission */
1465+ grcan_write_reg(&regs->txwr,
1466+ grcan_ring_add(txwr, GRCAN_MSG_SIZE, dma->tx.size));
1467+
1468+ return NETDEV_TX_OK;
1469+}
1470+
1471+/* ========== Setting up sysfs interface and module parameters ========== */
1472+
1473+#define GRCAN_NOT_BOOL(unsigned_val) ((unsigned_val) > 1)
1474+
1475+#define GRCAN_MODULE_PARAM(name, mtype, valcheckf, desc) \
1476+ static void grcan_sanitize_##name(struct platform_device *pd) \
1477+ { \
1478+ struct grcan_device_config grcan_default_config \
1479+ = GRCAN_DEFAULT_DEVICE_CONFIG; \
1480+ if (valcheckf(grcan_module_config.name)) { \
1481+ dev_err(&pd->dev, \
1482+ "Invalid module parameter value for " \
1483+ #name " - setting default\n"); \
1484+ grcan_module_config.name = \
1485+ grcan_default_config.name; \
1486+ } \
1487+ } \
1488+ module_param_named(name, grcan_module_config.name, \
1489+ mtype, S_IRUGO); \
1490+ MODULE_PARM_DESC(name, desc)
1491+
1492+#define GRCAN_CONFIG_ATTR(name, desc) \
1493+ static ssize_t grcan_store_##name(struct device *sdev, \
1494+ struct device_attribute *att, \
1495+ const char *buf, \
1496+ size_t count) \
1497+ { \
1498+ struct net_device *dev = to_net_dev(sdev); \
1499+ struct grcan_priv *priv = netdev_priv(dev); \
1500+ u8 val; \
1501+ int ret; \
1502+ if (dev->flags & IFF_UP) \
1503+ return -EBUSY; \
1504+ ret = kstrtou8(buf, 0, &val); \
1505+ if (ret < 0 || val > 1) \
1506+ return -EINVAL; \
1507+ priv->config.name = val; \
1508+ return count; \
1509+ } \
1510+ static ssize_t grcan_show_##name(struct device *sdev, \
1511+ struct device_attribute *att, \
1512+ char *buf) \
1513+ { \
1514+ struct net_device *dev = to_net_dev(sdev); \
1515+ struct grcan_priv *priv = netdev_priv(dev); \
1516+ return sprintf(buf, "%d\n", priv->config.name); \
1517+ } \
1518+ static DEVICE_ATTR(name, S_IRUGO | S_IWUSR, \
1519+ grcan_show_##name, \
1520+ grcan_store_##name); \
1521+ GRCAN_MODULE_PARAM(name, ushort, GRCAN_NOT_BOOL, desc)
1522+
1523+/* The following configuration options are made available both via module
1524+ * parameters and writable sysfs files. See the chapter about GRCAN in the
1525+ * documentation for the GRLIB VHDL library for further details.
1526+ */
1527+GRCAN_CONFIG_ATTR(enable0,
1528+ "Configuration of physical interface 0. Determines\n" \
1529+ "the \"Enable 0\" bit of the configuration register.\n" \
1530+ "Format: 0 | 1\nDefault: 0\n");
1531+
1532+GRCAN_CONFIG_ATTR(enable1,
1533+ "Configuration of physical interface 1. Determines\n" \
1534+ "the \"Enable 1\" bit of the configuration register.\n" \
1535+ "Format: 0 | 1\nDefault: 0\n");
1536+
1537+GRCAN_CONFIG_ATTR(select,
1538+ "Select which physical interface to use.\n" \
1539+ "Format: 0 | 1\nDefault: 0\n");
1540+
1541+/* The tx and rx buffer size configuration options are only available via module
1542+ * parameters.
1543+ */
1544+GRCAN_MODULE_PARAM(txsize, uint, GRCAN_INVALID_BUFFER_SIZE,
1545+ "Sets the size of the tx buffer.\n" \
1546+ "Format: <unsigned int> where (txsize & ~0x1fffc0) == 0\n" \
1547+ "Default: 1024\n");
1548+GRCAN_MODULE_PARAM(rxsize, uint, GRCAN_INVALID_BUFFER_SIZE,
1549+ "Sets the size of the rx buffer.\n" \
1550+ "Format: <unsigned int> where (size & ~0x1fffc0) == 0\n" \
1551+ "Default: 1024\n");
1552+
1553+/* Function that makes sure that configuration done using
1554+ * module parameters are set to valid values
1555+ */
1556+static void grcan_sanitize_module_config(struct platform_device *ofdev)
1557+{
1558+ grcan_sanitize_enable0(ofdev);
1559+ grcan_sanitize_enable1(ofdev);
1560+ grcan_sanitize_select(ofdev);
1561+ grcan_sanitize_txsize(ofdev);
1562+ grcan_sanitize_rxsize(ofdev);
1563+}
1564+
1565+static const struct attribute *const sysfs_grcan_attrs[] = {
1566+ /* Config attrs */
1567+ &dev_attr_enable0.attr,
1568+ &dev_attr_enable1.attr,
1569+ &dev_attr_select.attr,
1570+ NULL,
1571+};
1572+
1573+static const struct attribute_group sysfs_grcan_group = {
1574+ .name = "grcan",
1575+ .attrs = (struct attribute **)sysfs_grcan_attrs,
1576+};
1577+
1578+/* ========== Setting up the driver ========== */
1579+
1580+static const struct net_device_ops grcan_netdev_ops = {
1581+ .ndo_open = grcan_open,
1582+ .ndo_stop = grcan_close,
1583+ .ndo_start_xmit = grcan_start_xmit,
1584+};
1585+
1586+static int grcan_setup_netdev(struct platform_device *ofdev,
1587+ void __iomem *base,
1588+ int irq, u32 ambafreq, bool txbug)
1589+{
1590+ struct net_device *dev;
1591+ struct grcan_priv *priv;
1592+ struct grcan_registers __iomem *regs;
1593+ int err;
1594+
1595+ dev = alloc_candev(sizeof(struct grcan_priv), 0);
1596+ if (!dev)
1597+ return -ENOMEM;
1598+
1599+ dev->irq = irq;
1600+ dev->flags |= IFF_ECHO;
1601+ dev->netdev_ops = &grcan_netdev_ops;
1602+ dev->sysfs_groups[0] = &sysfs_grcan_group;
1603+
1604+ priv = netdev_priv(dev);
1605+ memcpy(&priv->config, &grcan_module_config,
1606+ sizeof(struct grcan_device_config));
1607+ priv->dev = dev;
1608+ priv->regs = base;
1609+ priv->can.bittiming_const = &grcan_bittiming_const;
1610+ priv->can.do_set_bittiming = grcan_set_bittiming;
1611+ priv->can.do_set_mode = grcan_set_mode;
1612+ priv->can.do_get_berr_counter = grcan_get_berr_counter;
1613+ priv->can.clock.freq = ambafreq;
1614+ priv->can.ctrlmode_supported =
1615+ CAN_CTRLMODE_LISTENONLY | CAN_CTRLMODE_ONE_SHOT;
1616+ priv->need_txbug_workaround = txbug;
1617+
1618+ /* Discover if triple sampling is supported by hardware */
1619+ regs = priv->regs;
1620+ grcan_set_bits(&regs->ctrl, GRCAN_CTRL_RESET);
1621+ grcan_set_bits(&regs->conf, GRCAN_CONF_SAM);
1622+ if (grcan_read_bits(&regs->conf, GRCAN_CONF_SAM)) {
1623+ priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
1624+ dev_dbg(&ofdev->dev, "Hardware supports triple-sampling\n");
1625+ }
1626+
1627+ spin_lock_init(&priv->lock);
1628+
1629+ if (priv->need_txbug_workaround) {
1630+ init_timer(&priv->rr_timer);
1631+ priv->rr_timer.function = grcan_running_reset;
1632+ priv->rr_timer.data = (unsigned long)dev;
1633+
1634+ init_timer(&priv->hang_timer);
1635+ priv->hang_timer.function = grcan_initiate_running_reset;
1636+ priv->hang_timer.data = (unsigned long)dev;
1637+ }
1638+
1639+ netif_napi_add(dev, &priv->napi, grcan_poll, GRCAN_NAPI_WEIGHT);
1640+
1641+ SET_NETDEV_DEV(dev, &ofdev->dev);
1642+ dev_info(&ofdev->dev, "regs=0x%p, irq=%d, clock=%d\n",
1643+ priv->regs, dev->irq, priv->can.clock.freq);
1644+
1645+ err = register_candev(dev);
1646+ if (err)
1647+ goto exit_free_candev;
1648+
1649+ dev_set_drvdata(&ofdev->dev, dev);
1650+
1651+ /* Reset device to allow bit-timing to be set. No need to call
1652+ * grcan_reset at this stage. That is done in grcan_open.
1653+ */
1654+ grcan_write_reg(&regs->ctrl, GRCAN_CTRL_RESET);
1655+
1656+ return 0;
1657+exit_free_candev:
1658+ free_candev(dev);
1659+ return err;
1660+}
1661+
1662+static int grcan_probe(struct platform_device *ofdev)
1663+{
1664+ struct device_node *np = ofdev->dev.of_node;
1665+ struct resource *res;
1666+ u32 sysid, ambafreq;
1667+ int irq, err;
1668+ void __iomem *base;
1669+ bool txbug = true;
1670+
1671+ /* Compare GRLIB version number with the first that does not
1672+ * have the tx bug (see start_xmit)
1673+ */
1674+ err = of_property_read_u32(np, "systemid", &sysid);
1675+ if (!err && ((sysid & GRLIB_VERSION_MASK)
1676+ >= GRCAN_TXBUG_SAFE_GRLIB_VERSION))
1677+ txbug = false;
1678+
1679+ err = of_property_read_u32(np, "freq", &ambafreq);
1680+ if (err) {
1681+ dev_err(&ofdev->dev, "unable to fetch \"freq\" property\n");
1682+ goto exit_error;
1683+ }
1684+
1685+ res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
1686+ base = devm_request_and_ioremap(&ofdev->dev, res);
1687+ if (!base) {
1688+ dev_err(&ofdev->dev, "couldn't map IO resource\n");
1689+ err = -EADDRNOTAVAIL;
1690+ goto exit_error;
1691+ }
1692+
1693+ irq = irq_of_parse_and_map(np, GRCAN_IRQIX_IRQ);
1694+ if (!irq) {
1695+ dev_err(&ofdev->dev, "no irq found\n");
1696+ err = -ENODEV;
1697+ goto exit_error;
1698+ }
1699+
1700+ grcan_sanitize_module_config(ofdev);
1701+
1702+ err = grcan_setup_netdev(ofdev, base, irq, ambafreq, txbug);
1703+ if (err)
1704+ goto exit_dispose_irq;
1705+
1706+ return 0;
1707+
1708+exit_dispose_irq:
1709+ irq_dispose_mapping(irq);
1710+exit_error:
1711+ dev_err(&ofdev->dev,
1712+ "%s socket CAN driver initialization failed with error %d\n",
1713+ DRV_NAME, err);
1714+ return err;
1715+}
1716+
1717+static int grcan_remove(struct platform_device *ofdev)
1718+{
1719+ struct net_device *dev = dev_get_drvdata(&ofdev->dev);
1720+ struct grcan_priv *priv = netdev_priv(dev);
1721+
1722+ unregister_candev(dev); /* Will in turn call grcan_close */
1723+
1724+ irq_dispose_mapping(dev->irq);
1725+ dev_set_drvdata(&ofdev->dev, NULL);
1726+ netif_napi_del(&priv->napi);
1727+ free_candev(dev);
1728+
1729+ return 0;
1730+}
1731+
1732+static struct of_device_id grcan_match[] = {
1733+ {.name = "GAISLER_GRCAN"},
1734+ {.name = "01_03d"},
1735+ {.name = "GAISLER_GRHCAN"},
1736+ {.name = "01_034"},
1737+ {},
1738+};
1739+
1740+MODULE_DEVICE_TABLE(of, grcan_match);
1741+
1742+static struct platform_driver grcan_driver = {
1743+ .driver = {
1744+ .name = DRV_NAME,
1745+ .owner = THIS_MODULE,
1746+ .of_match_table = grcan_match,
1747+ },
1748+ .probe = grcan_probe,
1749+ .remove = grcan_remove,
1750+};
1751+
1752+module_platform_driver(grcan_driver);
1753+
1754+MODULE_AUTHOR("Aeroflex Gaisler AB.");
1755+MODULE_DESCRIPTION("Socket CAN driver for Aeroflex Gaisler GRCAN");
1756+MODULE_LICENSE("GPL");
drivers/net/can/janz-ican3.c+14−14
@@ -365,7 +365,7 @@ static int ican3_old_send_msg(struct ican3_dev *mod, struct ican3_msg *msg) · 364 unmodified lines
365365 * ICAN3 "new-style" Host Interface Setup
366366 */
367367
368−static void __devinit ican3_init_new_host_interface(struct ican3_dev *mod)
368+static void ican3_init_new_host_interface(struct ican3_dev *mod)
369369 {
370370 struct ican3_new_desc desc;
371371 unsigned long flags;
@@ -444,7 +444,7 @@ static void __devinit ican3_init_new_host_interface(struct ican3_dev *mod) · 72 unmodified lines
444444 * ICAN3 Fast Host Interface Setup
445445 */
446446
447−static void __devinit ican3_init_fast_host_interface(struct ican3_dev *mod)
447+static void ican3_init_fast_host_interface(struct ican3_dev *mod)
448448 {
449449 struct ican3_fast_desc desc;
450450 unsigned long flags;
@@ -631,7 +631,7 @@ static int ican3_recv_msg(struct ican3_dev *mod, struct ican3_msg *msg) · 180 unmodified lines
631631 * Quick Pre-constructed Messages
632632 */
633633
634−static int __devinit ican3_msg_connect(struct ican3_dev *mod)
634+static int ican3_msg_connect(struct ican3_dev *mod)
635635 {
636636 struct ican3_msg msg;
637637
@@ -642,7 +642,7 @@ static int __devinit ican3_msg_connect(struct ican3_dev *mod) · 4 unmodified lines
642642 return ican3_send_msg(mod, &msg);
643643 }
644644
645−static int __devexit ican3_msg_disconnect(struct ican3_dev *mod)
645+static int ican3_msg_disconnect(struct ican3_dev *mod)
646646 {
647647 struct ican3_msg msg;
648648
@@ -653,7 +653,7 @@ static int __devexit ican3_msg_disconnect(struct ican3_dev *mod) · 4 unmodified lines
653653 return ican3_send_msg(mod, &msg);
654654 }
655655
656−static int __devinit ican3_msg_newhostif(struct ican3_dev *mod)
656+static int ican3_msg_newhostif(struct ican3_dev *mod)
657657 {
658658 struct ican3_msg msg;
659659 int ret;
@@ -674,7 +674,7 @@ static int __devinit ican3_msg_newhostif(struct ican3_dev *mod) · 14 unmodified lines
674674 return 0;
675675 }
676676
677−static int __devinit ican3_msg_fasthostif(struct ican3_dev *mod)
677+static int ican3_msg_fasthostif(struct ican3_dev *mod)
678678 {
679679 struct ican3_msg msg;
680680 unsigned int addr;
@@ -707,7 +707,7 @@ static int __devinit ican3_msg_fasthostif(struct ican3_dev *mod) · 26 unmodified lines
707707 * Setup the CAN filter to either accept or reject all
708708 * messages from the CAN bus.
709709 */
710−static int __devinit ican3_set_id_filter(struct ican3_dev *mod, bool accept)
710+static int ican3_set_id_filter(struct ican3_dev *mod, bool accept)
711711 {
712712 struct ican3_msg msg;
713713 int ret;
@@ -1421,7 +1421,7 @@ static int ican3_reset_module(struct ican3_dev *mod) · 707 unmodified lines
14211421 return -ETIMEDOUT;
14221422 }
14231423
1424−static void __devexit ican3_shutdown_module(struct ican3_dev *mod)
1424+static void ican3_shutdown_module(struct ican3_dev *mod)
14251425 {
14261426 ican3_msg_disconnect(mod);
14271427 ican3_reset_module(mod);
@@ -1430,7 +1430,7 @@ static void __devexit ican3_shutdown_module(struct ican3_dev *mod) · 2 unmodified lines
14301430 /*
14311431 * Startup an ICAN module, bringing it into fast mode
14321432 */
1433−static int __devinit ican3_startup_module(struct ican3_dev *mod)
1433+static int ican3_startup_module(struct ican3_dev *mod)
14341434 {
14351435 int ret;
14361436
@@ -1692,7 +1692,7 @@ static int ican3_get_berr_counter(const struct net_device *ndev, · 255 unmodified lines
16921692 return ret;
16931693
16941694 ret = wait_for_completion_timeout(&mod->buserror_comp, HZ);
1695− if (ret <= 0) {
1695+ if (ret == 0) {
16961696 dev_info(mod->dev, "%s timed out\n", __func__);
16971697 return -ETIMEDOUT;
16981698 }
@@ -1718,7 +1718,7 @@ static ssize_t ican3_sysfs_show_term(struct device *dev, · 19 unmodified lines
17181718 return ret;
17191719
17201720 ret = wait_for_completion_timeout(&mod->termination_comp, HZ);
1721− if (ret <= 0) {
1721+ if (ret == 0) {
17221722 dev_info(mod->dev, "%s timed out\n", __func__);
17231723 return -ETIMEDOUT;
17241724 }
@@ -1760,7 +1760,7 @@ static struct attribute_group ican3_sysfs_attr_group = { · 35 unmodified lines
17601760 * PCI Subsystem
17611761 */
17621762
1763−static int __devinit ican3_probe(struct platform_device *pdev)
1763+static int ican3_probe(struct platform_device *pdev)
17641764 {
17651765 struct janz_platform_data *pdata;
17661766 struct net_device *ndev;
@@ -1898,7 +1898,7 @@ out_return: · 131 unmodified lines
18981898 return ret;
18991899 }
19001900
1901−static int __devexit ican3_remove(struct platform_device *pdev)
1901+static int ican3_remove(struct platform_device *pdev)
19021902 {
19031903 struct net_device *ndev = platform_get_drvdata(pdev);
19041904 struct ican3_dev *mod = netdev_priv(ndev);
@@ -1927,7 +1927,7 @@ static struct platform_driver ican3_driver = { · 22 unmodified lines
19271927 .owner = THIS_MODULE,
19281928 },
19291929 .probe = ican3_probe,
1930− .remove = __devexit_p(ican3_remove),
1930+ .remove = ican3_remove,
19311931 };
19321932
19331933 module_platform_driver(ican3_driver);
drivers/net/can/mcp251x.c+3−3
@@ -981,7 +981,7 @@ static const struct net_device_ops mcp251x_netdev_ops = { · 980 unmodified lines
981981 .ndo_start_xmit = mcp251x_hard_start_xmit,
982982 };
983983
984−static int __devinit mcp251x_can_probe(struct spi_device *spi)
984+static int mcp251x_can_probe(struct spi_device *spi)
985985 {
986986 struct net_device *net;
987987 struct mcp251x_priv *priv;
@@ -1100,7 +1100,7 @@ error_out: · 112 unmodified lines
11001100 return ret;
11011101 }
11021102
1103−static int __devexit mcp251x_can_remove(struct spi_device *spi)
1103+static int mcp251x_can_remove(struct spi_device *spi)
11041104 {
11051105 struct mcp251x_platform_data *pdata = spi->dev.platform_data;
11061106 struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
@@ -1198,7 +1198,7 @@ static struct spi_driver mcp251x_can_driver = { · 91 unmodified lines
11981198
11991199 .id_table = mcp251x_id_table,
12001200 .probe = mcp251x_can_probe,
1201− .remove = __devexit_p(mcp251x_can_remove),
1201+ .remove = mcp251x_can_remove,
12021202 .suspend = mcp251x_can_suspend,
12031203 .resume = mcp251x_can_resume,
12041204 };
drivers/net/can/mscan/mpc5xxx_can.c+17−20
@@ -43,14 +43,13 @@ struct mpc5xxx_can_data { · 42 unmodified lines
4343 };
4444
4545 #ifdef CONFIG_PPC_MPC52xx
46−static struct of_device_id __devinitdata mpc52xx_cdm_ids[] = {
46+static struct of_device_id mpc52xx_cdm_ids[] = {
4747 { .compatible = "fsl,mpc5200-cdm", },
4848 {}
4949 };
5050
51−static u32 __devinit mpc52xx_can_get_clock(struct platform_device *ofdev,
52− const char *clock_name,
53− int *mscan_clksrc)
51+static u32 mpc52xx_can_get_clock(struct platform_device *ofdev,
52+ const char *clock_name, int *mscan_clksrc)
5453 {
5554 unsigned int pvr;
5655 struct mpc52xx_cdm __iomem *cdm;
@@ -101,9 +100,8 @@ static u32 __devinit mpc52xx_can_get_clock(struct platform_device *ofdev, · 44 unmodified lines
101100 return freq;
102101 }
103102 #else /* !CONFIG_PPC_MPC52xx */
104−static u32 __devinit mpc52xx_can_get_clock(struct platform_device *ofdev,
105− const char *clock_name,
106− int *mscan_clksrc)
103+static u32 mpc52xx_can_get_clock(struct platform_device *ofdev,
104+ const char *clock_name, int *mscan_clksrc)
107105 {
108106 return 0;
109107 }
@@ -124,14 +122,13 @@ struct mpc512x_clockctl { · 14 unmodified lines
124122 u32 mccr[4]; /* MSCAN Clk Ctrl Reg 1-3 */
125123 };
126124
127−static struct of_device_id __devinitdata mpc512x_clock_ids[] = {
125+static struct of_device_id mpc512x_clock_ids[] = {
128126 { .compatible = "fsl,mpc5121-clock", },
129127 {}
130128 };
131129
132−static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
133− const char *clock_name,
134− int *mscan_clksrc)
130+static u32 mpc512x_can_get_clock(struct platform_device *ofdev,
131+ const char *clock_name, int *mscan_clksrc)
135132 {
136133 struct mpc512x_clockctl __iomem *clockctl;
137134 struct device_node *np_clock;
@@ -239,16 +236,15 @@ exit_put: · 101 unmodified lines
239236 return freq;
240237 }
241238 #else /* !CONFIG_PPC_MPC512x */
242−static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,
243− const char *clock_name,
244− int *mscan_clksrc)
239+static u32 mpc512x_can_get_clock(struct platform_device *ofdev,
240+ const char *clock_name, int *mscan_clksrc)
245241 {
246242 return 0;
247243 }
248244 #endif /* CONFIG_PPC_MPC512x */
249245
250246 static const struct of_device_id mpc5xxx_can_table[];
251−static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
247+static int mpc5xxx_can_probe(struct platform_device *ofdev)
252248 {
253249 const struct of_device_id *match;
254250 const struct mpc5xxx_can_data *data;
@@ -323,7 +319,7 @@ exit_unmap_mem: · 68 unmodified lines
323319 return err;
324320 }
325321
326−static int __devexit mpc5xxx_can_remove(struct platform_device *ofdev)
322+static int mpc5xxx_can_remove(struct platform_device *ofdev)
327323 {
328324 struct net_device *dev = dev_get_drvdata(&ofdev->dev);
329325 struct mscan_priv *priv = netdev_priv(dev);
@@ -380,22 +376,23 @@ static int mpc5xxx_can_resume(struct platform_device *ofdev) · 50 unmodified lines
380376 }
381377 #endif
382378
383−static const struct mpc5xxx_can_data __devinitconst mpc5200_can_data = {
379+static const struct mpc5xxx_can_data mpc5200_can_data = {
384380 .type = MSCAN_TYPE_MPC5200,
385381 .get_clock = mpc52xx_can_get_clock,
386382 };
387383
388−static const struct mpc5xxx_can_data __devinitconst mpc5121_can_data = {
384+static const struct mpc5xxx_can_data mpc5121_can_data = {
389385 .type = MSCAN_TYPE_MPC5121,
390386 .get_clock = mpc512x_can_get_clock,
391387 };
392388
393−static const struct of_device_id __devinitconst mpc5xxx_can_table[] = {
389+static const struct of_device_id mpc5xxx_can_table[] = {
394390 { .compatible = "fsl,mpc5200-mscan", .data = &mpc5200_can_data, },
395391 /* Note that only MPC5121 Rev. 2 (and later) is supported */
396392 { .compatible = "fsl,mpc5121-mscan", .data = &mpc5121_can_data, },
397393 {},
398394 };
395+MODULE_DEVICE_TABLE(of, mpc5xxx_can_table);
399396
400397 static struct platform_driver mpc5xxx_can_driver = {
401398 .driver = {
@@ -404,7 +401,7 @@ static struct platform_driver mpc5xxx_can_driver = { · 2 unmodified lines
404401 .of_match_table = mpc5xxx_can_table,
405402 },
406403 .probe = mpc5xxx_can_probe,
407− .remove = __devexit_p(mpc5xxx_can_remove),
404+ .remove = mpc5xxx_can_remove,
408405 #ifdef CONFIG_PM
409406 .suspend = mpc5xxx_can_suspend,
410407 .resume = mpc5xxx_can_resume,
drivers/net/can/mscan/mscan.c+0−8
@@ -517,12 +517,8 @@ static irqreturn_t mscan_isr(int irq, void *dev_id) · 516 unmodified lines
517517
518518 static int mscan_do_set_mode(struct net_device *dev, enum can_mode mode)
519519 {
520− struct mscan_priv *priv = netdev_priv(dev);
521520 int ret = 0;
522521
523− if (!priv->open_time)
524− return -EINVAL;
525−
526522 switch (mode) {
527523 case CAN_MODE_START:
528524 ret = mscan_restart(dev);
@@ -590,8 +586,6 @@ static int mscan_open(struct net_device *dev) · 61 unmodified lines
590586 goto exit_napi_disable;
591587 }
592588
593− priv->open_time = jiffies;
594−
595589 if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
596590 setbits8(&regs->canctl1, MSCAN_LISTEN);
597591 else
@@ -606,7 +600,6 @@ static int mscan_open(struct net_device *dev) · 8 unmodified lines
606600 return 0;
607601
608602 exit_free_irq:
609− priv->open_time = 0;
610603 free_irq(dev->irq, dev);
611604 exit_napi_disable:
612605 napi_disable(&priv->napi);
@@ -627,7 +620,6 @@ static int mscan_close(struct net_device *dev) · 14 unmodified lines
627620 mscan_set_mode(dev, MSCAN_INIT_MODE);
628621 close_candev(dev);
629622 free_irq(dev->irq, dev);
630− priv->open_time = 0;
631623
632624 return 0;
633625 }
drivers/net/can/mscan/mscan.h+0−1
@@ -281,7 +281,6 @@ struct tx_queue_entry { · 280 unmodified lines
281281 struct mscan_priv {
282282 struct can_priv can; /* must be the first member */
283283 unsigned int type; /* MSCAN type variants */
284− long open_time;
285284 unsigned long flags;
286285 void __iomem *reg_base; /* ioremap'ed address to registers */
287286 u8 shadow_statflg;
drivers/net/can/pch_can.c+3−3
@@ -954,7 +954,7 @@ static const struct net_device_ops pch_can_netdev_ops = { · 953 unmodified lines
954954 .ndo_start_xmit = pch_xmit,
955955 };
956956
957−static void __devexit pch_can_remove(struct pci_dev *pdev)
957+static void pch_can_remove(struct pci_dev *pdev)
958958 {
959959 struct net_device *ndev = pci_get_drvdata(pdev);
960960 struct pch_can_priv *priv = netdev_priv(ndev);
@@ -1178,7 +1178,7 @@ static int pch_can_get_berr_counter(const struct net_device *dev, · 217 unmodified lines
11781178 return 0;
11791179 }
11801180
1181−static int __devinit pch_can_probe(struct pci_dev *pdev,
1181+static int pch_can_probe(struct pci_dev *pdev,
11821182 const struct pci_device_id *id)
11831183 {
11841184 struct net_device *ndev;
@@ -1269,7 +1269,7 @@ static struct pci_driver pch_can_pci_driver = { · 84 unmodified lines
12691269 .name = "pch_can",
12701270 .id_table = pch_pci_tbl,
12711271 .probe = pch_can_probe,
1272− .remove = __devexit_p(pch_can_remove),
1272+ .remove = pch_can_remove,
12731273 .suspend = pch_can_suspend,
12741274 .resume = pch_can_resume,
12751275 };
drivers/net/can/sja1000/Kconfig+2−1
@@ -21,7 +21,7 @@ config CAN_SJA1000_PLATFORM · 20 unmodified lines
2121
2222 config CAN_SJA1000_OF_PLATFORM
2323 tristate "Generic OF Platform Bus based SJA1000 driver"
24− depends on PPC_OF
24+ depends on OF
2525 ---help---
2626 This driver adds support for the SJA1000 chips connected to
2727 the OpenFirmware "platform bus" found on embedded systems with
@@ -93,6 +93,7 @@ config CAN_PLX_PCI · 65 unmodified lines
9393 - Marathon CAN-bus-PCI card (http://www.marathon.ru/)
9494 - TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)
9595 - IXXAT Automation PC-I 04/PCI card (http://www.ixxat.com/)
96+ - Connect Tech Inc. CANpro/104-Plus Opto (CRG001) card (http://www.connecttech.com)
9697
9798 config CAN_TSCAN1
9899 tristate "TS-CAN1 PC104 boards"
drivers/net/can/sja1000/ems_pci.c+2−2
@@ -220,8 +220,8 @@ static void ems_pci_card_reset(struct ems_pci_card *card) · 219 unmodified lines
220220 * Probe PCI device for EMS CAN signature and register each available
221221 * CAN channel to SJA1000 Socket-CAN subsystem.
222222 */
223−static int __devinit ems_pci_add_card(struct pci_dev *pdev,
224− const struct pci_device_id *ent)
223+static int ems_pci_add_card(struct pci_dev *pdev,
224+ const struct pci_device_id *ent)
225225 {
226226 struct sja1000_priv *priv;
227227 struct net_device *dev;
drivers/net/can/sja1000/ems_pcmcia.c+2−3
@@ -166,8 +166,7 @@ static void ems_pcmcia_del_card(struct pcmcia_device *pdev) · 165 unmodified lines
166166 * Probe PCI device for EMS CAN signature and register each available
167167 * CAN channel to SJA1000 Socket-CAN subsystem.
168168 */
169−static int __devinit ems_pcmcia_add_card(struct pcmcia_device *pdev,
170− unsigned long base)
169+static int ems_pcmcia_add_card(struct pcmcia_device *pdev, unsigned long base)
171170 {
172171 struct sja1000_priv *priv;
173172 struct net_device *dev;
@@ -256,7 +255,7 @@ failure_cleanup: · 82 unmodified lines
256255 /*
257256 * Setup PCMCIA socket and probe for EMS CPC-CARD
258257 */
259−static int __devinit ems_pcmcia_probe(struct pcmcia_device *dev)
258+static int ems_pcmcia_probe(struct pcmcia_device *dev)
260259 {
261260 int csval;
262261
drivers/net/can/sja1000/kvaser_pci.c+4−4
@@ -290,8 +290,8 @@ failure: · 289 unmodified lines
290290 return err;
291291 }
292292
293−static int __devinit kvaser_pci_init_one(struct pci_dev *pdev,
294− const struct pci_device_id *ent)
293+static int kvaser_pci_init_one(struct pci_dev *pdev,
294+ const struct pci_device_id *ent)
295295 {
296296 int err;
297297 struct net_device *master_dev = NULL;
@@ -379,7 +379,7 @@ failure: · 81 unmodified lines
379379
380380 }
381381
382−static void __devexit kvaser_pci_remove_one(struct pci_dev *pdev)
382+static void kvaser_pci_remove_one(struct pci_dev *pdev)
383383 {
384384 struct net_device *dev = pci_get_drvdata(pdev);
385385
@@ -394,7 +394,7 @@ static struct pci_driver kvaser_pci_driver = { · 8 unmodified lines
394394 .name = DRV_NAME,
395395 .id_table = kvaser_pci_tbl,
396396 .probe = kvaser_pci_init_one,
397− .remove = __devexit_p(kvaser_pci_remove_one),
397+ .remove = kvaser_pci_remove_one,
398398 };
399399
400400 module_pci_driver(kvaser_pci_driver);
drivers/net/can/sja1000/peak_pci.c+3−4
@@ -551,8 +551,7 @@ static void peak_pci_post_irq(const struct sja1000_priv *priv) · 550 unmodified lines
551551 writew(chan->icr_mask, chan->cfg_base + PITA_ICR);
552552 }
553553
554−static int __devinit peak_pci_probe(struct pci_dev *pdev,
555− const struct pci_device_id *ent)
554+static int peak_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
556555 {
557556 struct sja1000_priv *priv;
558557 struct peak_pci_chan *chan;
@@ -717,7 +716,7 @@ failure_disable_pci: · 158 unmodified lines
717716 return err;
718717 }
719718
720−static void __devexit peak_pci_remove(struct pci_dev *pdev)
719+static void peak_pci_remove(struct pci_dev *pdev)
721720 {
722721 struct net_device *dev = pci_get_drvdata(pdev); /* Last device */
723722 struct sja1000_priv *priv = netdev_priv(dev);
@@ -757,7 +756,7 @@ static struct pci_driver peak_pci_driver = { · 33 unmodified lines
757756 .name = DRV_NAME,
758757 .id_table = peak_pci_tbl,
759758 .probe = peak_pci_probe,
760− .remove = __devexit_p(peak_pci_remove),
759+ .remove = peak_pci_remove,
761760 };
762761
763762 module_pci_driver(peak_pci_driver);
drivers/net/can/sja1000/peak_pcmcia.c+1−1
@@ -632,7 +632,7 @@ static void pcan_free(struct pcmcia_device *pdev) · 631 unmodified lines
632632 /*
633633 * setup PCMCIA socket and probe for PEAK-System PC-CARD
634634 */
635−static int __devinit pcan_probe(struct pcmcia_device *pdev)
635+static int pcan_probe(struct pcmcia_device *pdev)
636636 {
637637 struct pcan_pccard *card;
638638 int err;
drivers/net/can/sja1000/plx_pci.c+29−10
@@ -44,6 +44,7 @@ MODULE_SUPPORTED_DEVICE("Adlink PCI-7841/cPCI-7841, " · 43 unmodified lines
4444 "esd CAN-PCI/CPCI/PCI104/200, "
4545 "esd CAN-PCI/PMC/266, "
4646 "esd CAN-PCIe/2000, "
47+ "Connect Tech Inc. CANpro/104-Plus Opto (CRG001), "
4748 "IXXAT PC-I 04/PCI")
4849 MODULE_LICENSE("GPL v2");
4950
@@ -131,6 +132,9 @@ struct plx_pci_card { · 81 unmodified lines
131132 #define TEWS_PCI_VENDOR_ID 0x1498
132133 #define TEWS_PCI_DEVICE_ID_TMPC810 0x032A
133134
135+#define CTI_PCI_VENDOR_ID 0x12c4
136+#define CTI_PCI_DEVICE_ID_CRG001 0x0900
137+
134138 static void plx_pci_reset_common(struct pci_dev *pdev);
135139 static void plx_pci_reset_marathon(struct pci_dev *pdev);
136140 static void plx9056_pci_reset_common(struct pci_dev *pdev);
@@ -158,7 +162,7 @@ struct plx_pci_card_info { · 21 unmodified lines
158162 void (*reset_func)(struct pci_dev *pdev);
159163 };
160164
161−static struct plx_pci_card_info plx_pci_card_info_adlink __devinitdata = {
165+static struct plx_pci_card_info plx_pci_card_info_adlink = {
162166 "Adlink PCI-7841/cPCI-7841", 2,
163167 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
164168 {1, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x80, 0x80} },
@@ -166,7 +170,7 @@ static struct plx_pci_card_info plx_pci_card_info_adlink __devinitdata = { · 1 unmodified line
166170 /* based on PLX9052 */
167171 };
168172
169−static struct plx_pci_card_info plx_pci_card_info_adlink_se __devinitdata = {
173+static struct plx_pci_card_info plx_pci_card_info_adlink_se = {
170174 "Adlink PCI-7841/cPCI-7841 SE", 2,
171175 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
172176 {0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x80, 0x80} },
@@ -174,7 +178,7 @@ static struct plx_pci_card_info plx_pci_card_info_adlink_se __devinitdata = { · 1 unmodified line
174178 /* based on PLX9052 */
175179 };
176180
177−static struct plx_pci_card_info plx_pci_card_info_esd200 __devinitdata = {
181+static struct plx_pci_card_info plx_pci_card_info_esd200 = {
178182 "esd CAN-PCI/CPCI/PCI104/200", 2,
179183 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
180184 {0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },
@@ -182,7 +186,7 @@ static struct plx_pci_card_info plx_pci_card_info_esd200 __devinitdata = { · 1 unmodified line
182186 /* based on PLX9030/9050 */
183187 };
184188
185−static struct plx_pci_card_info plx_pci_card_info_esd266 __devinitdata = {
189+static struct plx_pci_card_info plx_pci_card_info_esd266 = {
186190 "esd CAN-PCI/PMC/266", 2,
187191 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
188192 {0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },
@@ -190,7 +194,7 @@ static struct plx_pci_card_info plx_pci_card_info_esd266 __devinitdata = { · 1 unmodified line
190194 /* based on PLX9056 */
191195 };
192196
193−static struct plx_pci_card_info plx_pci_card_info_esd2000 __devinitdata = {
197+static struct plx_pci_card_info plx_pci_card_info_esd2000 = {
194198 "esd CAN-PCIe/2000", 2,
195199 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
196200 {0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },
@@ -198,7 +202,7 @@ static struct plx_pci_card_info plx_pci_card_info_esd2000 __devinitdata = { · 1 unmodified line
198202 /* based on PEX8311 */
199203 };
200204
201−static struct plx_pci_card_info plx_pci_card_info_ixxat __devinitdata = {
205+static struct plx_pci_card_info plx_pci_card_info_ixxat = {
202206 "IXXAT PC-I 04/PCI", 2,
203207 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
204208 {0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x200, 0x80} },
@@ -206,7 +210,7 @@ static struct plx_pci_card_info plx_pci_card_info_ixxat __devinitdata = { · 1 unmodified line
206210 /* based on PLX9050 */
207211 };
208212
209−static struct plx_pci_card_info plx_pci_card_info_marathon __devinitdata = {
213+static struct plx_pci_card_info plx_pci_card_info_marathon = {
210214 "Marathon CAN-bus-PCI", 2,
211215 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
212216 {0, 0x00, 0x00}, { {2, 0x00, 0x00}, {4, 0x00, 0x00} },
@@ -214,7 +218,7 @@ static struct plx_pci_card_info plx_pci_card_info_marathon __devinitdata = { · 1 unmodified line
214218 /* based on PLX9052 */
215219 };
216220
217−static struct plx_pci_card_info plx_pci_card_info_tews __devinitdata = {
221+static struct plx_pci_card_info plx_pci_card_info_tews = {
218222 "TEWS TECHNOLOGIES TPMC810", 2,
219223 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
220224 {0, 0x00, 0x00}, { {2, 0x000, 0x80}, {2, 0x100, 0x80} },
@@ -222,6 +226,14 @@ static struct plx_pci_card_info plx_pci_card_info_tews __devinitdata = { · 1 unmodified line
222226 /* based on PLX9030 */
223227 };
224228
229+static struct plx_pci_card_info plx_pci_card_info_cti = {
230+ "Connect Tech Inc. CANpro/104-Plus Opto (CRG001)", 2,
231+ PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
232+ {0, 0x00, 0x00}, { {2, 0x000, 0x80}, {2, 0x100, 0x80} },
233+ &plx_pci_reset_common
234+ /* based on PLX9030 */
235+};
236+
225237 static DEFINE_PCI_DEVICE_TABLE(plx_pci_tbl) = {
226238 {
227239 /* Adlink PCI-7841/cPCI-7841 */
@@ -300,6 +312,13 @@ static DEFINE_PCI_DEVICE_TABLE(plx_pci_tbl) = { · 72 unmodified lines
300312 0, 0,
301313 (kernel_ulong_t)&plx_pci_card_info_tews
302314 },
315+ {
316+ /* Connect Tech Inc. CANpro/104-Plus Opto (CRG001) card */
317+ PCI_VENDOR_ID_PLX, PCI_DEVICE_ID_PLX_9030,
318+ CTI_PCI_VENDOR_ID, CTI_PCI_DEVICE_ID_CRG001,
319+ 0, 0,
320+ (kernel_ulong_t)&plx_pci_card_info_cti
321+ },
303322 { 0,}
304323 };
305324 MODULE_DEVICE_TABLE(pci, plx_pci_tbl);
@@ -465,8 +484,8 @@ static void plx_pci_del_card(struct pci_dev *pdev) · 159 unmodified lines
465484 * Probe PLX90xx based device for the SJA1000 chips and register each
466485 * available CAN channel to SJA1000 Socket-CAN subsystem.
467486 */
468−static int __devinit plx_pci_add_card(struct pci_dev *pdev,
469− const struct pci_device_id *ent)
487+static int plx_pci_add_card(struct pci_dev *pdev,
488+ const struct pci_device_id *ent)
470489 {
471490 struct sja1000_priv *priv;
472491 struct net_device *dev;
drivers/net/can/sja1000/sja1000.c+0−8
@@ -188,11 +188,6 @@ static void sja1000_start(struct net_device *dev) · 187 unmodified lines
188188
189189 static int sja1000_set_mode(struct net_device *dev, enum can_mode mode)
190190 {
191− struct sja1000_priv *priv = netdev_priv(dev);
192−
193− if (!priv->open_time)
194− return -EINVAL;
195−
196191 switch (mode) {
197192 case CAN_MODE_START:
198193 sja1000_start(dev);
@@ -579,7 +574,6 @@ static int sja1000_open(struct net_device *dev) · 380 unmodified lines
579574
580575 /* init and start chi */
581576 sja1000_start(dev);
582− priv->open_time = jiffies;
583577
584578 netif_start_queue(dev);
585579
@@ -598,8 +592,6 @@ static int sja1000_close(struct net_device *dev) · 12 unmodified lines
598592
599593 close_candev(dev);
600594
601− priv->open_time = 0;
602−
603595 return 0;
604596 }
605597
drivers/net/can/sja1000/sja1000.h+0−1
@@ -152,7 +152,6 @@ · 151 unmodified lines
152152 */
153153 struct sja1000_priv {
154154 struct can_priv can; /* must be the first member */
155− int open_time;
156155 struct sk_buff *echo_skb;
157156
158157 /* the lower-layer is responsible for appropriate locking */
drivers/net/can/sja1000/sja1000_isa.c+8−8
@@ -42,11 +42,11 @@ MODULE_LICENSE("GPL v2"); · 41 unmodified lines
4242
4343 static unsigned long port[MAXDEV];
4444 static unsigned long mem[MAXDEV];
45−static int __devinitdata irq[MAXDEV];
46−static int __devinitdata clk[MAXDEV];
47−static unsigned char __devinitdata cdr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
48−static unsigned char __devinitdata ocr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
49−static int __devinitdata indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};
45+static int irq[MAXDEV];
46+static int clk[MAXDEV];
47+static unsigned char cdr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
48+static unsigned char ocr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
49+static int indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};
5050
5151 module_param_array(port, ulong, NULL, S_IRUGO);
5252 MODULE_PARM_DESC(port, "I/O port number");
@@ -117,7 +117,7 @@ static void sja1000_isa_port_write_reg_indirect(const struct sja1000_priv *priv, · 64 unmodified lines
117117 outb(val, base + 1);
118118 }
119119
120−static int __devinit sja1000_isa_probe(struct platform_device *pdev)
120+static int sja1000_isa_probe(struct platform_device *pdev)
121121 {
122122 struct net_device *dev;
123123 struct sja1000_priv *priv;
@@ -223,7 +223,7 @@ static int __devinit sja1000_isa_probe(struct platform_device *pdev) · 99 unmodified lines
223223 return err;
224224 }
225225
226−static int __devexit sja1000_isa_remove(struct platform_device *pdev)
226+static int sja1000_isa_remove(struct platform_device *pdev)
227227 {
228228 struct net_device *dev = dev_get_drvdata(&pdev->dev);
229229 struct sja1000_priv *priv = netdev_priv(dev);
@@ -248,7 +248,7 @@ static int __devexit sja1000_isa_remove(struct platform_device *pdev) · 18 unmodified lines
248248
249249 static struct platform_driver sja1000_isa_driver = {
250250 .probe = sja1000_isa_probe,
251− .remove = __devexit_p(sja1000_isa_remove),
251+ .remove = sja1000_isa_remove,
252252 .driver = {
253253 .name = DRV_NAME,
254254 .owner = THIS_MODULE,
drivers/net/can/sja1000/sja1000_of_platform.c+8−6
@@ -42,6 +42,8 @@ · 41 unmodified lines
4242 #include <linux/can/dev.h>
4343
4444 #include <linux/of_platform.h>
45+#include <linux/of_address.h>
46+#include <linux/of_irq.h>
4547 #include <asm/prom.h>
4648
4749 #include "sja1000.h"
@@ -59,16 +61,16 @@ MODULE_LICENSE("GPL v2"); · 11 unmodified lines
5961
6062 static u8 sja1000_ofp_read_reg(const struct sja1000_priv *priv, int reg)
6163 {
62− return in_8(priv->reg_base + reg);
64+ return ioread8(priv->reg_base + reg);
6365 }
6466
6567 static void sja1000_ofp_write_reg(const struct sja1000_priv *priv,
6668 int reg, u8 val)
6769 {
68− out_8(priv->reg_base + reg, val);
70+ iowrite8(val, priv->reg_base + reg);
6971 }
7072
71−static int __devexit sja1000_ofp_remove(struct platform_device *ofdev)
73+static int sja1000_ofp_remove(struct platform_device *ofdev)
7274 {
7375 struct net_device *dev = dev_get_drvdata(&ofdev->dev);
7476 struct sja1000_priv *priv = netdev_priv(dev);
@@ -88,7 +90,7 @@ static int __devexit sja1000_ofp_remove(struct platform_device *ofdev) · 13 unmodified lines
8890 return 0;
8991 }
9092
91−static int __devinit sja1000_ofp_probe(struct platform_device *ofdev)
93+static int sja1000_ofp_probe(struct platform_device *ofdev)
9294 {
9395 struct device_node *np = ofdev->dev.of_node;
9496 struct net_device *dev;
@@ -204,7 +206,7 @@ exit_release_mem: · 109 unmodified lines
204206 return err;
205207 }
206208
207−static struct of_device_id __devinitdata sja1000_ofp_table[] = {
209+static struct of_device_id sja1000_ofp_table[] = {
208210 {.compatible = "nxp,sja1000"},
209211 {},
210212 };
@@ -217,7 +219,7 @@ static struct platform_driver sja1000_ofp_driver = { · 6 unmodified lines
217219 .of_match_table = sja1000_ofp_table,
218220 },
219221 .probe = sja1000_ofp_probe,
220− .remove = __devexit_p(sja1000_ofp_remove),
222+ .remove = sja1000_ofp_remove,
221223 };
222224
223225 module_platform_driver(sja1000_ofp_driver);
drivers/net/can/sja1000/sja1000_platform.c+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434
3535 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
3636 MODULE_DESCRIPTION("Socket-CAN driver for SJA1000 on the platform bus");
37+MODULE_ALIAS("platform:" DRV_NAME);
3738 MODULE_LICENSE("GPL v2");
3839
3940 static u8 sp_read_reg8(const struct sja1000_priv *priv, int reg)
drivers/net/can/sja1000/tscan1.c+4−4
@@ -71,7 +71,7 @@ MODULE_LICENSE("GPL"); · 70 unmodified lines
7171 #define TSCAN1_SJA1000_XTAL 16000000
7272
7373 /* SJA1000 IO base addresses */
74−static const unsigned short tscan1_sja1000_addresses[] __devinitconst = {
74+static const unsigned short tscan1_sja1000_addresses[] = {
7575 0x100, 0x120, 0x180, 0x1a0, 0x200, 0x240, 0x280, 0x320
7676 };
7777
@@ -88,7 +88,7 @@ static void tscan1_write(const struct sja1000_priv *priv, int reg, u8 val) · 10 unmodified lines
8888 }
8989
9090 /* Probe for a TS-CAN1 board with JP2:JP1 jumper setting ID */
91−static int __devinit tscan1_probe(struct device *dev, unsigned id)
91+static int tscan1_probe(struct device *dev, unsigned id)
9292 {
9393 struct net_device *netdev;
9494 struct sja1000_priv *priv;
@@ -171,7 +171,7 @@ static int __devinit tscan1_probe(struct device *dev, unsigned id) · 76 unmodified lines
171171 return -ENXIO;
172172 }
173173
174−static int __devexit tscan1_remove(struct device *dev, unsigned id /*unused*/)
174+static int tscan1_remove(struct device *dev, unsigned id /*unused*/)
175175 {
176176 struct net_device *netdev;
177177 struct sja1000_priv *priv;
@@ -197,7 +197,7 @@ static int __devexit tscan1_remove(struct device *dev, unsigned id /*unused*/) · 19 unmodified lines
197197
198198 static struct isa_driver tscan1_isa_driver = {
199199 .probe = tscan1_probe,
200− .remove = __devexit_p(tscan1_remove),
200+ .remove = tscan1_remove,
201201 .driver = {
202202 .name = "tscan1",
203203 },
drivers/net/can/softing/softing_cs.c+5−6
@@ -159,7 +159,7 @@ MODULE_FIRMWARE(fw_dir "bcard2.bin"); · 158 unmodified lines
159159 MODULE_FIRMWARE(fw_dir "ldcard2.bin");
160160 MODULE_FIRMWARE(fw_dir "cancrd2.bin");
161161
162−static __devinit const struct softing_platform_data
162+static const struct softing_platform_data
163163 *softingcs_find_platform_data(unsigned int manf, unsigned int prod)
164164 {
165165 const struct softing_platform_data *lp;
@@ -193,8 +193,7 @@ static int softingcs_enable_irq(struct platform_device *pdev, int v) · 27 unmodified lines
193193 /*
194194 * pcmcia check
195195 */
196−static __devinit int softingcs_probe_config(struct pcmcia_device *pcmcia,
197− void *priv_data)
196+static int softingcs_probe_config(struct pcmcia_device *pcmcia, void *priv_data)
198197 {
199198 struct softing_platform_data *pdat = priv_data;
200199 struct resource *pres;
@@ -215,7 +214,7 @@ static __devinit int softingcs_probe_config(struct pcmcia_device *pcmcia, · 14 unmodified lines
215214 return pcmcia_request_window(pcmcia, pres, memspeed);
216215 }
217216
218−static __devexit void softingcs_remove(struct pcmcia_device *pcmcia)
217+static void softingcs_remove(struct pcmcia_device *pcmcia)
219218 {
220219 struct platform_device *pdev = pcmcia->priv;
221220
@@ -235,7 +234,7 @@ static void softingcs_pdev_release(struct device *dev) · 13 unmodified lines
235234 kfree(pdev);
236235 }
237236
238−static __devinit int softingcs_probe(struct pcmcia_device *pcmcia)
237+static int softingcs_probe(struct pcmcia_device *pcmcia)
239238 {
240239 int ret;
241240 struct platform_device *pdev;
@@ -338,7 +337,7 @@ static struct pcmcia_driver softingcs_driver = { · 96 unmodified lines
338337 .name = "softingcs",
339338 .id_table = softingcs_ids,
340339 .probe = softingcs_probe,
341− .remove = __devexit_p(softingcs_remove),
340+ .remove = softingcs_remove,
342341 };
343342
344343 static int __init softingcs_start(void)
drivers/net/can/softing/softing_main.c+7−7
@@ -478,7 +478,7 @@ static void softing_card_shutdown(struct softing *card) · 477 unmodified lines
478478 mutex_unlock(&card->fw.lock);
479479 }
480480
481−static __devinit int softing_card_boot(struct softing *card)
481+static int softing_card_boot(struct softing *card)
482482 {
483483 int ret, j;
484484 static const uint8_t stream[] = {
@@ -645,8 +645,8 @@ static const struct can_bittiming_const softing_btr_const = { · 160 unmodified lines
645645 };
646646
647647
648−static __devinit struct net_device *softing_netdev_create(struct softing *card,
649− uint16_t chip_id)
648+static struct net_device *softing_netdev_create(struct softing *card,
649+ uint16_t chip_id)
650650 {
651651 struct net_device *netdev;
652652 struct softing_priv *priv;
@@ -676,7 +676,7 @@ static __devinit struct net_device *softing_netdev_create(struct softing *card, · 23 unmodified lines
676676 return netdev;
677677 }
678678
679−static __devinit int softing_netdev_register(struct net_device *netdev)
679+static int softing_netdev_register(struct net_device *netdev)
680680 {
681681 int ret;
682682
@@ -745,7 +745,7 @@ static const struct attribute_group softing_pdev_group = { · 62 unmodified lines
745745 /*
746746 * platform driver
747747 */
748−static __devexit int softing_pdev_remove(struct platform_device *pdev)
748+static int softing_pdev_remove(struct platform_device *pdev)
749749 {
750750 struct softing *card = platform_get_drvdata(pdev);
751751 int j;
@@ -766,7 +766,7 @@ static __devexit int softing_pdev_remove(struct platform_device *pdev) · 14 unmodified lines
766766 return 0;
767767 }
768768
769−static __devinit int softing_pdev_probe(struct platform_device *pdev)
769+static int softing_pdev_probe(struct platform_device *pdev)
770770 {
771771 const struct softing_platform_data *pdat = pdev->dev.platform_data;
772772 struct softing *card;
@@ -871,7 +871,7 @@ static struct platform_driver softing_driver = { · 98 unmodified lines
871871 .owner = THIS_MODULE,
872872 },
873873 .probe = softing_pdev_probe,
874− .remove = __devexit_p(softing_pdev_remove),
874+ .remove = softing_pdev_remove,
875875 };
876876
877877 module_platform_driver(softing_driver);
drivers/net/can/ti_hecc.c+3−2
@@ -978,7 +978,7 @@ probe_exit: · 977 unmodified lines
978978 return err;
979979 }
980980
981−static int __devexit ti_hecc_remove(struct platform_device *pdev)
981+static int ti_hecc_remove(struct platform_device *pdev)
982982 {
983983 struct resource *res;
984984 struct net_device *ndev = platform_get_drvdata(pdev);
@@ -1045,7 +1045,7 @@ static struct platform_driver ti_hecc_driver = { · 60 unmodified lines
10451045 .owner = THIS_MODULE,
10461046 },
10471047 .probe = ti_hecc_probe,
1048− .remove = __devexit_p(ti_hecc_remove),
1048+ .remove = ti_hecc_remove,
10491049 .suspend = ti_hecc_suspend,
10501050 .resume = ti_hecc_resume,
10511051 };
@@ -1055,3 +1055,4 @@ module_platform_driver(ti_hecc_driver); · 3 unmodified lines
10551055 MODULE_AUTHOR("Anant Gole <anantgole@ti.com>");
10561056 MODULE_LICENSE("GPL v2");
10571057 MODULE_DESCRIPTION(DRV_DESC);
1058+MODULE_ALIAS("platform:" DRV_NAME);
drivers/net/can/usb/Kconfig+29−0
@@ -13,6 +13,35 @@ config CAN_ESD_USB2 · 12 unmodified lines
1313 This driver supports the CAN-USB/2 interface
1414 from esd electronic system design gmbh (http://www.esd.eu).
1515
16+config CAN_KVASER_USB
17+ tristate "Kvaser CAN/USB interface"
18+ ---help---
19+ This driver adds support for Kvaser CAN/USB devices like Kvaser
20+ Leaf Light.
21+
22+ The driver gives support for the following devices:
23+ - Kvaser Leaf Light
24+ - Kvaser Leaf Professional HS
25+ - Kvaser Leaf SemiPro HS
26+ - Kvaser Leaf Professional LS
27+ - Kvaser Leaf Professional SWC
28+ - Kvaser Leaf Professional LIN
29+ - Kvaser Leaf SemiPro LS
30+ - Kvaser Leaf SemiPro SWC
31+ - Kvaser Memorator II HS/HS
32+ - Kvaser USBcan Professional HS/HS
33+ - Kvaser Leaf Light GI
34+ - Kvaser Leaf Professional HS (OBD-II connector)
35+ - Kvaser Memorator Professional HS/LS
36+ - Kvaser Leaf Light "China"
37+ - Kvaser BlackBird SemiPro
38+ - Kvaser USBcan R
39+
40+ If unsure, say N.
41+
42+ To compile this driver as a module, choose M here: the
43+ module will be called kvaser_usb.
44+
1645 config CAN_PEAK_USB
1746 tristate "PEAK PCAN-USB/USB Pro interfaces"
1847 ---help---
drivers/net/can/usb/Makefile+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
44
55 obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o
66 obj-$(CONFIG_CAN_ESD_USB2) += esd_usb2.o
7+obj-$(CONFIG_CAN_KVASER_USB) += kvaser_usb.o
78 obj-$(CONFIG_CAN_PEAK_USB) += peak_usb/
89
910 ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
drivers/net/can/usb/ems_usb.c+0−7
@@ -245,7 +245,6 @@ struct ems_tx_urb_context { · 244 unmodified lines
245245
246246 struct ems_usb {
247247 struct can_priv can; /* must be the first member */
248− int open_time;
249248
250249 struct sk_buff *echo_skb[MAX_TX_URBS];
251250
@@ -728,7 +727,6 @@ static int ems_usb_open(struct net_device *netdev) · 476 unmodified lines
728727 return err;
729728 }
730729
731− dev->open_time = jiffies;
732730
733731 netif_start_queue(netdev);
734732
@@ -878,8 +876,6 @@ static int ems_usb_close(struct net_device *netdev) · 143 unmodified lines
878876
879877 close_candev(netdev);
880878
881− dev->open_time = 0;
882−
883879 return 0;
884880 }
885881
@@ -905,9 +901,6 @@ static int ems_usb_set_mode(struct net_device *netdev, enum can_mode mode) · 19 unmodified lines
905901 {
906902 struct ems_usb *dev = netdev_priv(netdev);
907903
908− if (!dev->open_time)
909− return -EINVAL;
910−
911904 switch (mode) {
912905 case CAN_MODE_START:
913906 if (ems_usb_write_mode(dev, SJA1000_MOD_NORMAL))
drivers/net/can/usb/esd_usb2.c+29−16
@@ -1,7 +1,7 @@
11 /*
2− * CAN driver for esd CAN-USB/2
2+ * CAN driver for esd CAN-USB/2 and CAN-USB/Micro
33 *
4− * Copyright (C) 2010 Matthias Fuchs <matthias.fuchs@esd.eu>, esd gmbh
4+ * Copyright (C) 2010-2012 Matthias Fuchs <matthias.fuchs@esd.eu>, esd gmbh
55 *
66 * This program is free software; you can redistribute it and/or modify it
77 * under the terms of the GNU General Public License as published
@@ -28,14 +28,16 @@ · 20 unmodified lines
2828 #include <linux/can/error.h>
2929
3030 MODULE_AUTHOR("Matthias Fuchs <matthias.fuchs@esd.eu>");
31−MODULE_DESCRIPTION("CAN driver for esd CAN-USB/2 interfaces");
31+MODULE_DESCRIPTION("CAN driver for esd CAN-USB/2 and CAN-USB/Micro interfaces");
3232 MODULE_LICENSE("GPL v2");
3333
3434 /* Define these values to match your devices */
3535 #define USB_ESDGMBH_VENDOR_ID 0x0ab4
3636 #define USB_CANUSB2_PRODUCT_ID 0x0010
37+#define USB_CANUSBM_PRODUCT_ID 0x0011
3738
3839 #define ESD_USB2_CAN_CLOCK 60000000
40+#define ESD_USBM_CAN_CLOCK 36000000
3941 #define ESD_USB2_MAX_NETS 2
4042
4143 /* USB2 commands */
@@ -69,6 +71,7 @@ MODULE_LICENSE("GPL v2"); · 27 unmodified lines
6971 #define ESD_USB2_TSEG2_SHIFT 20
7072 #define ESD_USB2_SJW_MAX 4
7173 #define ESD_USB2_SJW_SHIFT 14
74+#define ESD_USBM_SJW_SHIFT 24
7275 #define ESD_USB2_BRP_MIN 1
7376 #define ESD_USB2_BRP_MAX 1024
7477 #define ESD_USB2_BRP_INC 1
@@ -183,6 +186,7 @@ struct __attribute__ ((packed)) esd_usb2_msg { · 108 unmodified lines
183186
184187 static struct usb_device_id esd_usb2_table[] = {
185188 {USB_DEVICE(USB_ESDGMBH_VENDOR_ID, USB_CANUSB2_PRODUCT_ID)},
189+ {USB_DEVICE(USB_ESDGMBH_VENDOR_ID, USB_CANUSBM_PRODUCT_ID)},
186190 {}
187191 };
188192 MODULE_DEVICE_TABLE(usb, esd_usb2_table);
@@ -213,7 +217,6 @@ struct esd_usb2_net_priv { · 24 unmodified lines
213217 struct usb_anchor tx_submitted;
214218 struct esd_tx_urb_context tx_contexts[MAX_TX_URBS];
215219
216− int open_time;
217220 struct esd_usb2 *usb2;
218221 struct net_device *netdev;
219222 int index;
@@ -691,8 +694,6 @@ static int esd_usb2_open(struct net_device *netdev) · 471 unmodified lines
691694 return err;
692695 }
693696
694− priv->open_time = jiffies;
695−
696697 netif_start_queue(netdev);
697698
698699 return 0;
@@ -860,8 +861,6 @@ static int esd_usb2_close(struct net_device *netdev) · 161 unmodified lines
860861
861862 close_candev(netdev);
862863
863− priv->open_time = 0;
864−
865864 return 0;
866865 }
867866
@@ -889,11 +888,22 @@ static int esd_usb2_set_bittiming(struct net_device *netdev) · 21 unmodified lines
889888 struct can_bittiming *bt = &priv->can.bittiming;
890889 struct esd_usb2_msg msg;
891890 u32 canbtr;
891+ int sjw_shift;
892892
893893 canbtr = ESD_USB2_UBR;
894+ if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
895+ canbtr |= ESD_USB2_LOM;
896+
894897 canbtr |= (bt->brp - 1) & (ESD_USB2_BRP_MAX - 1);
898+
899+ if (le16_to_cpu(priv->usb2->udev->descriptor.idProduct) ==
900+ USB_CANUSBM_PRODUCT_ID)
901+ sjw_shift = ESD_USBM_SJW_SHIFT;
902+ else
903+ sjw_shift = ESD_USB2_SJW_SHIFT;
904+
895905 canbtr |= ((bt->sjw - 1) & (ESD_USB2_SJW_MAX - 1))
896− << ESD_USB2_SJW_SHIFT;
906+ << sjw_shift;
897907 canbtr |= ((bt->prop_seg + bt->phase_seg1 - 1)
898908 & (ESD_USB2_TSEG1_MAX - 1))
899909 << ESD_USB2_TSEG1_SHIFT;
@@ -926,11 +936,6 @@ static int esd_usb2_get_berr_counter(const struct net_device *netdev, · 26 unmodified lines
926936
927937 static int esd_usb2_set_mode(struct net_device *netdev, enum can_mode mode)
928938 {
929− struct esd_usb2_net_priv *priv = netdev_priv(netdev);
930−
931− if (!priv->open_time)
932− return -EINVAL;
933−
934939 switch (mode) {
935940 case CAN_MODE_START:
936941 netif_wake_queue(netdev);
@@ -971,12 +976,20 @@ static int esd_usb2_probe_one_net(struct usb_interface *intf, int index) · 34 unmodified lines
971976 priv->index = index;
972977
973978 priv->can.state = CAN_STATE_STOPPED;
974− priv->can.clock.freq = ESD_USB2_CAN_CLOCK;
979+ priv->can.ctrlmode_supported = CAN_CTRLMODE_LISTENONLY;
980+
981+ if (le16_to_cpu(dev->udev->descriptor.idProduct) ==
982+ USB_CANUSBM_PRODUCT_ID)
983+ priv->can.clock.freq = ESD_USBM_CAN_CLOCK;
984+ else {
985+ priv->can.clock.freq = ESD_USB2_CAN_CLOCK;
986+ priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
987+ }
988+
975989 priv->can.bittiming_const = &esd_usb2_bittiming_const;
976990 priv->can.do_set_bittiming = esd_usb2_set_bittiming;
977991 priv->can.do_set_mode = esd_usb2_set_mode;
978992 priv->can.do_get_berr_counter = esd_usb2_get_berr_counter;
979− priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES;
980993
981994 netdev->flags |= IFF_ECHO; /* we support local echo */
982995
drivers/net/can/usb/kvaser_usb.c+1627−0
@@ -0,0 +1,1627 @@
1+/*
2+ * This program is free software; you can redistribute it and/or
3+ * modify it under the terms of the GNU General Public License as
4+ * published by the Free Software Foundation version 2.
5+ *
6+ * Parts of this driver are based on the following:
7+ * - Kvaser linux leaf driver (version 4.78)
8+ * - CAN driver for esd CAN-USB/2
9+ *
10+ * Copyright (C) 2002-2006 KVASER AB, Sweden. All rights reserved.
11+ * Copyright (C) 2010 Matthias Fuchs <matthias.fuchs@esd.eu>, esd gmbh
12+ * Copyright (C) 2012 Olivier Sobrie <olivier@sobrie.be>
13+ */
14+
15+#include <linux/init.h>
16+#include <linux/completion.h>
17+#include <linux/module.h>
18+#include <linux/netdevice.h>
19+#include <linux/usb.h>
20+
21+#include <linux/can.h>
22+#include <linux/can/dev.h>
23+#include <linux/can/error.h>
24+
25+#define MAX_TX_URBS 16
26+#define MAX_RX_URBS 4
27+#define START_TIMEOUT 1000 /* msecs */
28+#define STOP_TIMEOUT 1000 /* msecs */
29+#define USB_SEND_TIMEOUT 1000 /* msecs */
30+#define USB_RECV_TIMEOUT 1000 /* msecs */
31+#define RX_BUFFER_SIZE 3072
32+#define CAN_USB_CLOCK 8000000
33+#define MAX_NET_DEVICES 3
34+
35+/* Kvaser USB devices */
36+#define KVASER_VENDOR_ID 0x0bfd
37+#define USB_LEAF_DEVEL_PRODUCT_ID 10
38+#define USB_LEAF_LITE_PRODUCT_ID 11
39+#define USB_LEAF_PRO_PRODUCT_ID 12
40+#define USB_LEAF_SPRO_PRODUCT_ID 14
41+#define USB_LEAF_PRO_LS_PRODUCT_ID 15
42+#define USB_LEAF_PRO_SWC_PRODUCT_ID 16
43+#define USB_LEAF_PRO_LIN_PRODUCT_ID 17
44+#define USB_LEAF_SPRO_LS_PRODUCT_ID 18
45+#define USB_LEAF_SPRO_SWC_PRODUCT_ID 19
46+#define USB_MEMO2_DEVEL_PRODUCT_ID 22
47+#define USB_MEMO2_HSHS_PRODUCT_ID 23
48+#define USB_UPRO_HSHS_PRODUCT_ID 24
49+#define USB_LEAF_LITE_GI_PRODUCT_ID 25
50+#define USB_LEAF_PRO_OBDII_PRODUCT_ID 26
51+#define USB_MEMO2_HSLS_PRODUCT_ID 27
52+#define USB_LEAF_LITE_CH_PRODUCT_ID 28
53+#define USB_BLACKBIRD_SPRO_PRODUCT_ID 29
54+#define USB_OEM_MERCURY_PRODUCT_ID 34
55+#define USB_OEM_LEAF_PRODUCT_ID 35
56+#define USB_CAN_R_PRODUCT_ID 39
57+
58+/* USB devices features */
59+#define KVASER_HAS_SILENT_MODE BIT(0)
60+#define KVASER_HAS_TXRX_ERRORS BIT(1)
61+
62+/* Message header size */
63+#define MSG_HEADER_LEN 2
64+
65+/* Can message flags */
66+#define MSG_FLAG_ERROR_FRAME BIT(0)
67+#define MSG_FLAG_OVERRUN BIT(1)
68+#define MSG_FLAG_NERR BIT(2)
69+#define MSG_FLAG_WAKEUP BIT(3)
70+#define MSG_FLAG_REMOTE_FRAME BIT(4)
71+#define MSG_FLAG_RESERVED BIT(5)
72+#define MSG_FLAG_TX_ACK BIT(6)
73+#define MSG_FLAG_TX_REQUEST BIT(7)
74+
75+/* Can states */
76+#define M16C_STATE_BUS_RESET BIT(0)
77+#define M16C_STATE_BUS_ERROR BIT(4)
78+#define M16C_STATE_BUS_PASSIVE BIT(5)
79+#define M16C_STATE_BUS_OFF BIT(6)
80+
81+/* Can msg ids */
82+#define CMD_RX_STD_MESSAGE 12
83+#define CMD_TX_STD_MESSAGE 13
84+#define CMD_RX_EXT_MESSAGE 14
85+#define CMD_TX_EXT_MESSAGE 15
86+#define CMD_SET_BUS_PARAMS 16
87+#define CMD_GET_BUS_PARAMS 17
88+#define CMD_GET_BUS_PARAMS_REPLY 18
89+#define CMD_GET_CHIP_STATE 19
90+#define CMD_CHIP_STATE_EVENT 20
91+#define CMD_SET_CTRL_MODE 21
92+#define CMD_GET_CTRL_MODE 22
93+#define CMD_GET_CTRL_MODE_REPLY 23
94+#define CMD_RESET_CHIP 24
95+#define CMD_RESET_CARD 25
96+#define CMD_START_CHIP 26
97+#define CMD_START_CHIP_REPLY 27
98+#define CMD_STOP_CHIP 28
99+#define CMD_STOP_CHIP_REPLY 29
100+#define CMD_GET_CARD_INFO2 32
101+#define CMD_GET_CARD_INFO 34
102+#define CMD_GET_CARD_INFO_REPLY 35
103+#define CMD_GET_SOFTWARE_INFO 38
104+#define CMD_GET_SOFTWARE_INFO_REPLY 39
105+#define CMD_ERROR_EVENT 45
106+#define CMD_FLUSH_QUEUE 48
107+#define CMD_RESET_ERROR_COUNTER 49
108+#define CMD_TX_ACKNOWLEDGE 50
109+#define CMD_CAN_ERROR_EVENT 51
110+#define CMD_USB_THROTTLE 77
111+#define CMD_LOG_MESSAGE 106
112+
113+/* error factors */
114+#define M16C_EF_ACKE BIT(0)
115+#define M16C_EF_CRCE BIT(1)
116+#define M16C_EF_FORME BIT(2)
117+#define M16C_EF_STFE BIT(3)
118+#define M16C_EF_BITE0 BIT(4)
119+#define M16C_EF_BITE1 BIT(5)
120+#define M16C_EF_RCVE BIT(6)
121+#define M16C_EF_TRE BIT(7)
122+
123+/* bittiming parameters */
124+#define KVASER_USB_TSEG1_MIN 1
125+#define KVASER_USB_TSEG1_MAX 16
126+#define KVASER_USB_TSEG2_MIN 1
127+#define KVASER_USB_TSEG2_MAX 8
128+#define KVASER_USB_SJW_MAX 4
129+#define KVASER_USB_BRP_MIN 1
130+#define KVASER_USB_BRP_MAX 64
131+#define KVASER_USB_BRP_INC 1
132+
133+/* ctrl modes */
134+#define KVASER_CTRL_MODE_NORMAL 1
135+#define KVASER_CTRL_MODE_SILENT 2
136+#define KVASER_CTRL_MODE_SELFRECEPTION 3
137+#define KVASER_CTRL_MODE_OFF 4
138+
139+struct kvaser_msg_simple {
140+ u8 tid;
141+ u8 channel;
142+} __packed;
143+
144+struct kvaser_msg_cardinfo {
145+ u8 tid;
146+ u8 nchannels;
147+ __le32 serial_number;
148+ __le32 padding;
149+ __le32 clock_resolution;
150+ __le32 mfgdate;
151+ u8 ean[8];
152+ u8 hw_revision;
153+ u8 usb_hs_mode;
154+ __le16 padding2;
155+} __packed;
156+
157+struct kvaser_msg_cardinfo2 {
158+ u8 tid;
159+ u8 channel;
160+ u8 pcb_id[24];
161+ __le32 oem_unlock_code;
162+} __packed;
163+
164+struct kvaser_msg_softinfo {
165+ u8 tid;
166+ u8 channel;
167+ __le32 sw_options;
168+ __le32 fw_version;
169+ __le16 max_outstanding_tx;
170+ __le16 padding[9];
171+} __packed;
172+
173+struct kvaser_msg_busparams {
174+ u8 tid;
175+ u8 channel;
176+ __le32 bitrate;
177+ u8 tseg1;
178+ u8 tseg2;
179+ u8 sjw;
180+ u8 no_samp;
181+} __packed;
182+
183+struct kvaser_msg_tx_can {
184+ u8 channel;
185+ u8 tid;
186+ u8 msg[14];
187+ u8 padding;
188+ u8 flags;
189+} __packed;
190+
191+struct kvaser_msg_rx_can {
192+ u8 channel;
193+ u8 flag;
194+ __le16 time[3];
195+ u8 msg[14];
196+} __packed;
197+
198+struct kvaser_msg_chip_state_event {
199+ u8 tid;
200+ u8 channel;
201+ __le16 time[3];
202+ u8 tx_errors_count;
203+ u8 rx_errors_count;
204+ u8 status;
205+ u8 padding[3];
206+} __packed;
207+
208+struct kvaser_msg_tx_acknowledge {
209+ u8 channel;
210+ u8 tid;
211+ __le16 time[3];
212+ u8 flags;
213+ u8 time_offset;
214+} __packed;
215+
216+struct kvaser_msg_error_event {
217+ u8 tid;
218+ u8 flags;
219+ __le16 time[3];
220+ u8 channel;
221+ u8 padding;
222+ u8 tx_errors_count;
223+ u8 rx_errors_count;
224+ u8 status;
225+ u8 error_factor;
226+} __packed;
227+
228+struct kvaser_msg_ctrl_mode {
229+ u8 tid;
230+ u8 channel;
231+ u8 ctrl_mode;
232+ u8 padding[3];
233+} __packed;
234+
235+struct kvaser_msg_flush_queue {
236+ u8 tid;
237+ u8 channel;
238+ u8 flags;
239+ u8 padding[3];
240+} __packed;
241+
242+struct kvaser_msg_log_message {
243+ u8 channel;
244+ u8 flags;
245+ __le16 time[3];
246+ u8 dlc;
247+ u8 time_offset;
248+ __le32 id;
249+ u8 data[8];
250+} __packed;
251+
252+struct kvaser_msg {
253+ u8 len;
254+ u8 id;
255+ union {
256+ struct kvaser_msg_simple simple;
257+ struct kvaser_msg_cardinfo cardinfo;
258+ struct kvaser_msg_cardinfo2 cardinfo2;
259+ struct kvaser_msg_softinfo softinfo;
260+ struct kvaser_msg_busparams busparams;
261+ struct kvaser_msg_tx_can tx_can;
262+ struct kvaser_msg_rx_can rx_can;
263+ struct kvaser_msg_chip_state_event chip_state_event;
264+ struct kvaser_msg_tx_acknowledge tx_acknowledge;
265+ struct kvaser_msg_error_event error_event;
266+ struct kvaser_msg_ctrl_mode ctrl_mode;
267+ struct kvaser_msg_flush_queue flush_queue;
268+ struct kvaser_msg_log_message log_message;
269+ } u;
270+} __packed;
271+
272+struct kvaser_usb_tx_urb_context {
273+ struct kvaser_usb_net_priv *priv;
274+ u32 echo_index;
275+ int dlc;
276+};
277+
278+struct kvaser_usb {
279+ struct usb_device *udev;
280+ struct kvaser_usb_net_priv *nets[MAX_NET_DEVICES];
281+
282+ struct usb_endpoint_descriptor *bulk_in, *bulk_out;
283+ struct usb_anchor rx_submitted;
284+
285+ u32 fw_version;
286+ unsigned int nchannels;
287+
288+ bool rxinitdone;
289+ void *rxbuf[MAX_RX_URBS];
290+ dma_addr_t rxbuf_dma[MAX_RX_URBS];
291+};
292+
293+struct kvaser_usb_net_priv {
294+ struct can_priv can;
295+
296+ atomic_t active_tx_urbs;
297+ struct usb_anchor tx_submitted;
298+ struct kvaser_usb_tx_urb_context tx_contexts[MAX_TX_URBS];
299+
300+ struct completion start_comp, stop_comp;
301+
302+ struct kvaser_usb *dev;
303+ struct net_device *netdev;
304+ int channel;
305+
306+ struct can_berr_counter bec;
307+};
308+
309+static const struct usb_device_id kvaser_usb_table[] = {
310+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_DEVEL_PRODUCT_ID) },
311+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_PRODUCT_ID) },
312+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_PRODUCT_ID),
313+ .driver_info = KVASER_HAS_TXRX_ERRORS |
314+ KVASER_HAS_SILENT_MODE },
315+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_SPRO_PRODUCT_ID),
316+ .driver_info = KVASER_HAS_TXRX_ERRORS |
317+ KVASER_HAS_SILENT_MODE },
318+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_LS_PRODUCT_ID),
319+ .driver_info = KVASER_HAS_TXRX_ERRORS |
320+ KVASER_HAS_SILENT_MODE },
321+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_SWC_PRODUCT_ID),
322+ .driver_info = KVASER_HAS_TXRX_ERRORS |
323+ KVASER_HAS_SILENT_MODE },
324+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_LIN_PRODUCT_ID),
325+ .driver_info = KVASER_HAS_TXRX_ERRORS |
326+ KVASER_HAS_SILENT_MODE },
327+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_SPRO_LS_PRODUCT_ID),
328+ .driver_info = KVASER_HAS_TXRX_ERRORS |
329+ KVASER_HAS_SILENT_MODE },
330+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_SPRO_SWC_PRODUCT_ID),
331+ .driver_info = KVASER_HAS_TXRX_ERRORS |
332+ KVASER_HAS_SILENT_MODE },
333+ { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO2_DEVEL_PRODUCT_ID),
334+ .driver_info = KVASER_HAS_TXRX_ERRORS |
335+ KVASER_HAS_SILENT_MODE },
336+ { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO2_HSHS_PRODUCT_ID),
337+ .driver_info = KVASER_HAS_TXRX_ERRORS |
338+ KVASER_HAS_SILENT_MODE },
339+ { USB_DEVICE(KVASER_VENDOR_ID, USB_UPRO_HSHS_PRODUCT_ID),
340+ .driver_info = KVASER_HAS_TXRX_ERRORS },
341+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_GI_PRODUCT_ID) },
342+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_PRO_OBDII_PRODUCT_ID),
343+ .driver_info = KVASER_HAS_TXRX_ERRORS |
344+ KVASER_HAS_SILENT_MODE },
345+ { USB_DEVICE(KVASER_VENDOR_ID, USB_MEMO2_HSLS_PRODUCT_ID),
346+ .driver_info = KVASER_HAS_TXRX_ERRORS },
347+ { USB_DEVICE(KVASER_VENDOR_ID, USB_LEAF_LITE_CH_PRODUCT_ID),
348+ .driver_info = KVASER_HAS_TXRX_ERRORS },
349+ { USB_DEVICE(KVASER_VENDOR_ID, USB_BLACKBIRD_SPRO_PRODUCT_ID),
350+ .driver_info = KVASER_HAS_TXRX_ERRORS },
351+ { USB_DEVICE(KVASER_VENDOR_ID, USB_OEM_MERCURY_PRODUCT_ID),
352+ .driver_info = KVASER_HAS_TXRX_ERRORS },
353+ { USB_DEVICE(KVASER_VENDOR_ID, USB_OEM_LEAF_PRODUCT_ID),
354+ .driver_info = KVASER_HAS_TXRX_ERRORS },
355+ { USB_DEVICE(KVASER_VENDOR_ID, USB_CAN_R_PRODUCT_ID),
356+ .driver_info = KVASER_HAS_TXRX_ERRORS },
357+ { }
358+};
359+MODULE_DEVICE_TABLE(usb, kvaser_usb_table);
360+
361+static inline int kvaser_usb_send_msg(const struct kvaser_usb *dev,
362+ struct kvaser_msg *msg)
363+{
364+ int actual_len;
365+
366+ return usb_bulk_msg(dev->udev,
367+ usb_sndbulkpipe(dev->udev,
368+ dev->bulk_out->bEndpointAddress),
369+ msg, msg->len, &actual_len,
370+ USB_SEND_TIMEOUT);
371+}
372+
373+static int kvaser_usb_wait_msg(const struct kvaser_usb *dev, u8 id,
374+ struct kvaser_msg *msg)
375+{
376+ struct kvaser_msg *tmp;
377+ void *buf;
378+ int actual_len;
379+ int err;
380+ int pos = 0;
381+
382+ buf = kzalloc(RX_BUFFER_SIZE, GFP_KERNEL);
383+ if (!buf)
384+ return -ENOMEM;
385+
386+ err = usb_bulk_msg(dev->udev,
387+ usb_rcvbulkpipe(dev->udev,
388+ dev->bulk_in->bEndpointAddress),
389+ buf, RX_BUFFER_SIZE, &actual_len,
390+ USB_RECV_TIMEOUT);
391+ if (err < 0)
392+ goto end;
393+
394+ while (pos <= actual_len - MSG_HEADER_LEN) {
395+ tmp = buf + pos;
396+
397+ if (!tmp->len)
398+ break;
399+
400+ if (pos + tmp->len > actual_len) {
401+ dev_err(dev->udev->dev.parent, "Format error\n");
402+ break;
403+ }
404+
405+ if (tmp->id == id) {
406+ memcpy(msg, tmp, tmp->len);
407+ goto end;
408+ }
409+
410+ pos += tmp->len;
411+ }
412+
413+ err = -EINVAL;
414+
415+end:
416+ kfree(buf);
417+
418+ return err;
419+}
420+
421+static int kvaser_usb_send_simple_msg(const struct kvaser_usb *dev,
422+ u8 msg_id, int channel)
423+{
424+ struct kvaser_msg *msg;
425+ int rc;
426+
427+ msg = kmalloc(sizeof(*msg), GFP_KERNEL);
428+ if (!msg)
429+ return -ENOMEM;
430+
431+ msg->id = msg_id;
432+ msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_simple);
433+ msg->u.simple.channel = channel;
434+ msg->u.simple.tid = 0xff;
435+
436+ rc = kvaser_usb_send_msg(dev, msg);
437+
438+ kfree(msg);
439+ return rc;
440+}
441+
442+static int kvaser_usb_get_software_info(struct kvaser_usb *dev)
443+{
444+ struct kvaser_msg msg;
445+ int err;
446+
447+ err = kvaser_usb_send_simple_msg(dev, CMD_GET_SOFTWARE_INFO, 0);
448+ if (err)
449+ return err;
450+
451+ err = kvaser_usb_wait_msg(dev, CMD_GET_SOFTWARE_INFO_REPLY, &msg);
452+ if (err)
453+ return err;
454+
455+ dev->fw_version = le32_to_cpu(msg.u.softinfo.fw_version);
456+
457+ return 0;
458+}
459+
460+static int kvaser_usb_get_card_info(struct kvaser_usb *dev)
461+{
462+ struct kvaser_msg msg;
463+ int err;
464+
465+ err = kvaser_usb_send_simple_msg(dev, CMD_GET_CARD_INFO, 0);
466+ if (err)
467+ return err;
468+
469+ err = kvaser_usb_wait_msg(dev, CMD_GET_CARD_INFO_REPLY, &msg);
470+ if (err)
471+ return err;
472+
473+ dev->nchannels = msg.u.cardinfo.nchannels;
474+
475+ return 0;
476+}
477+
478+static void kvaser_usb_tx_acknowledge(const struct kvaser_usb *dev,
479+ const struct kvaser_msg *msg)
480+{
481+ struct net_device_stats *stats;
482+ struct kvaser_usb_tx_urb_context *context;
483+ struct kvaser_usb_net_priv *priv;
484+ struct sk_buff *skb;
485+ struct can_frame *cf;
486+ u8 channel = msg->u.tx_acknowledge.channel;
487+ u8 tid = msg->u.tx_acknowledge.tid;
488+
489+ if (channel >= dev->nchannels) {
490+ dev_err(dev->udev->dev.parent,
491+ "Invalid channel number (%d)\n", channel);
492+ return;
493+ }
494+
495+ priv = dev->nets[channel];
496+
497+ if (!netif_device_present(priv->netdev))
498+ return;
499+
500+ stats = &priv->netdev->stats;
501+
502+ context = &priv->tx_contexts[tid % MAX_TX_URBS];
503+
504+ /* Sometimes the state change doesn't come after a bus-off event */
505+ if (priv->can.restart_ms &&
506+ (priv->can.state >= CAN_STATE_BUS_OFF)) {
507+ skb = alloc_can_err_skb(priv->netdev, &cf);
508+ if (skb) {
509+ cf->can_id |= CAN_ERR_RESTARTED;
510+ netif_rx(skb);
511+
512+ stats->rx_packets++;
513+ stats->rx_bytes += cf->can_dlc;
514+ } else {
515+ netdev_err(priv->netdev,
516+ "No memory left for err_skb\n");
517+ }
518+
519+ priv->can.can_stats.restarts++;
520+ netif_carrier_on(priv->netdev);
521+
522+ priv->can.state = CAN_STATE_ERROR_ACTIVE;
523+ }
524+
525+ stats->tx_packets++;
526+ stats->tx_bytes += context->dlc;
527+ can_get_echo_skb(priv->netdev, context->echo_index);
528+
529+ context->echo_index = MAX_TX_URBS;
530+ atomic_dec(&priv->active_tx_urbs);
531+
532+ netif_wake_queue(priv->netdev);
533+}
534+
535+static void kvaser_usb_simple_msg_callback(struct urb *urb)
536+{
537+ struct net_device *netdev = urb->context;
538+
539+ kfree(urb->transfer_buffer);
540+
541+ if (urb->status)
542+ netdev_warn(netdev, "urb status received: %d\n",
543+ urb->status);
544+}
545+
546+static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv,
547+ u8 msg_id)
548+{
549+ struct kvaser_usb *dev = priv->dev;
550+ struct net_device *netdev = priv->netdev;
551+ struct kvaser_msg *msg;
552+ struct urb *urb;
553+ void *buf;
554+ int err;
555+
556+ urb = usb_alloc_urb(0, GFP_ATOMIC);
557+ if (!urb) {
558+ netdev_err(netdev, "No memory left for URBs\n");
559+ return -ENOMEM;
560+ }
561+
562+ buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC);
563+ if (!buf) {
564+ netdev_err(netdev, "No memory left for USB buffer\n");
565+ usb_free_urb(urb);
566+ return -ENOMEM;
567+ }
568+
569+ msg = (struct kvaser_msg *)buf;
570+ msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_simple);
571+ msg->id = msg_id;
572+ msg->u.simple.channel = priv->channel;
573+
574+ usb_fill_bulk_urb(urb, dev->udev,
575+ usb_sndbulkpipe(dev->udev,
576+ dev->bulk_out->bEndpointAddress),
577+ buf, msg->len,
578+ kvaser_usb_simple_msg_callback, priv);
579+ usb_anchor_urb(urb, &priv->tx_submitted);
580+
581+ err = usb_submit_urb(urb, GFP_ATOMIC);
582+ if (err) {
583+ netdev_err(netdev, "Error transmitting URB\n");
584+ usb_unanchor_urb(urb);
585+ usb_free_urb(urb);
586+ kfree(buf);
587+ return err;
588+ }
589+
590+ usb_free_urb(urb);
591+
592+ return 0;
593+}
594+
595+static void kvaser_usb_unlink_tx_urbs(struct kvaser_usb_net_priv *priv)
596+{
597+ int i;
598+
599+ usb_kill_anchored_urbs(&priv->tx_submitted);
600+ atomic_set(&priv->active_tx_urbs, 0);
601+
602+ for (i = 0; i < MAX_TX_URBS; i++)
603+ priv->tx_contexts[i].echo_index = MAX_TX_URBS;
604+}
605+
606+static void kvaser_usb_rx_error(const struct kvaser_usb *dev,
607+ const struct kvaser_msg *msg)
608+{
609+ struct can_frame *cf;
610+ struct sk_buff *skb;
611+ struct net_device_stats *stats;
612+ struct kvaser_usb_net_priv *priv;
613+ unsigned int new_state;
614+ u8 channel, status, txerr, rxerr, error_factor;
615+
616+ switch (msg->id) {
617+ case CMD_CAN_ERROR_EVENT:
618+ channel = msg->u.error_event.channel;
619+ status = msg->u.error_event.status;
620+ txerr = msg->u.error_event.tx_errors_count;
621+ rxerr = msg->u.error_event.rx_errors_count;
622+ error_factor = msg->u.error_event.error_factor;
623+ break;
624+ case CMD_LOG_MESSAGE:
625+ channel = msg->u.log_message.channel;
626+ status = msg->u.log_message.data[0];
627+ txerr = msg->u.log_message.data[2];
628+ rxerr = msg->u.log_message.data[3];
629+ error_factor = msg->u.log_message.data[1];
630+ break;
631+ case CMD_CHIP_STATE_EVENT:
632+ channel = msg->u.chip_state_event.channel;
633+ status = msg->u.chip_state_event.status;
634+ txerr = msg->u.chip_state_event.tx_errors_count;
635+ rxerr = msg->u.chip_state_event.rx_errors_count;
636+ error_factor = 0;
637+ break;
638+ default:
639+ dev_err(dev->udev->dev.parent, "Invalid msg id (%d)\n",
640+ msg->id);
641+ return;
642+ }
643+
644+ if (channel >= dev->nchannels) {
645+ dev_err(dev->udev->dev.parent,
646+ "Invalid channel number (%d)\n", channel);
647+ return;
648+ }
649+
650+ priv = dev->nets[channel];
651+ stats = &priv->netdev->stats;
652+
653+ if (status & M16C_STATE_BUS_RESET) {
654+ kvaser_usb_unlink_tx_urbs(priv);
655+ return;
656+ }
657+
658+ skb = alloc_can_err_skb(priv->netdev, &cf);
659+ if (!skb) {
660+ stats->rx_dropped++;
661+ return;
662+ }
663+
664+ new_state = priv->can.state;
665+
666+ netdev_dbg(priv->netdev, "Error status: 0x%02x\n", status);
667+
668+ if (status & M16C_STATE_BUS_OFF) {
669+ cf->can_id |= CAN_ERR_BUSOFF;
670+
671+ priv->can.can_stats.bus_off++;
672+ if (!priv->can.restart_ms)
673+ kvaser_usb_simple_msg_async(priv, CMD_STOP_CHIP);
674+
675+ netif_carrier_off(priv->netdev);
676+
677+ new_state = CAN_STATE_BUS_OFF;
678+ } else if (status & M16C_STATE_BUS_PASSIVE) {
679+ if (priv->can.state != CAN_STATE_ERROR_PASSIVE) {
680+ cf->can_id |= CAN_ERR_CRTL;
681+
682+ if (txerr || rxerr)
683+ cf->data[1] = (txerr > rxerr)
684+ ? CAN_ERR_CRTL_TX_PASSIVE
685+ : CAN_ERR_CRTL_RX_PASSIVE;
686+ else
687+ cf->data[1] = CAN_ERR_CRTL_TX_PASSIVE |
688+ CAN_ERR_CRTL_RX_PASSIVE;
689+
690+ priv->can.can_stats.error_passive++;
691+ }
692+
693+ new_state = CAN_STATE_ERROR_PASSIVE;
694+ }
695+
696+ if (status == M16C_STATE_BUS_ERROR) {
697+ if ((priv->can.state < CAN_STATE_ERROR_WARNING) &&
698+ ((txerr >= 96) || (rxerr >= 96))) {
699+ cf->can_id |= CAN_ERR_CRTL;
700+ cf->data[1] = (txerr > rxerr)
701+ ? CAN_ERR_CRTL_TX_WARNING
702+ : CAN_ERR_CRTL_RX_WARNING;
703+
704+ priv->can.can_stats.error_warning++;
705+ new_state = CAN_STATE_ERROR_WARNING;
706+ } else if (priv->can.state > CAN_STATE_ERROR_ACTIVE) {
707+ cf->can_id |= CAN_ERR_PROT;
708+ cf->data[2] = CAN_ERR_PROT_ACTIVE;
709+
710+ new_state = CAN_STATE_ERROR_ACTIVE;
711+ }
712+ }
713+
714+ if (!status) {
715+ cf->can_id |= CAN_ERR_PROT;
716+ cf->data[2] = CAN_ERR_PROT_ACTIVE;
717+
718+ new_state = CAN_STATE_ERROR_ACTIVE;
719+ }
720+
721+ if (priv->can.restart_ms &&
722+ (priv->can.state >= CAN_STATE_BUS_OFF) &&
723+ (new_state < CAN_STATE_BUS_OFF)) {
724+ cf->can_id |= CAN_ERR_RESTARTED;
725+ netif_carrier_on(priv->netdev);
726+
727+ priv->can.can_stats.restarts++;
728+ }
729+
730+ if (error_factor) {
731+ priv->can.can_stats.bus_error++;
732+ stats->rx_errors++;
733+
734+ cf->can_id |= CAN_ERR_BUSERROR | CAN_ERR_PROT;
735+
736+ if (error_factor & M16C_EF_ACKE)
737+ cf->data[3] |= (CAN_ERR_PROT_LOC_ACK);
738+ if (error_factor & M16C_EF_CRCE)
739+ cf->data[3] |= (CAN_ERR_PROT_LOC_CRC_SEQ |
740+ CAN_ERR_PROT_LOC_CRC_DEL);
741+ if (error_factor & M16C_EF_FORME)
742+ cf->data[2] |= CAN_ERR_PROT_FORM;
743+ if (error_factor & M16C_EF_STFE)
744+ cf->data[2] |= CAN_ERR_PROT_STUFF;
745+ if (error_factor & M16C_EF_BITE0)
746+ cf->data[2] |= CAN_ERR_PROT_BIT0;
747+ if (error_factor & M16C_EF_BITE1)
748+ cf->data[2] |= CAN_ERR_PROT_BIT1;
749+ if (error_factor & M16C_EF_TRE)
750+ cf->data[2] |= CAN_ERR_PROT_TX;
751+ }
752+
753+ cf->data[6] = txerr;
754+ cf->data[7] = rxerr;
755+
756+ priv->bec.txerr = txerr;
757+ priv->bec.rxerr = rxerr;
758+
759+ priv->can.state = new_state;
760+
761+ netif_rx(skb);
762+
763+ stats->rx_packets++;
764+ stats->rx_bytes += cf->can_dlc;
765+}
766+
767+static void kvaser_usb_rx_can_err(const struct kvaser_usb_net_priv *priv,
768+ const struct kvaser_msg *msg)
769+{
770+ struct can_frame *cf;
771+ struct sk_buff *skb;
772+ struct net_device_stats *stats = &priv->netdev->stats;
773+
774+ if (msg->u.rx_can.flag & (MSG_FLAG_ERROR_FRAME |
775+ MSG_FLAG_NERR)) {
776+ netdev_err(priv->netdev, "Unknow error (flags: 0x%02x)\n",
777+ msg->u.rx_can.flag);
778+
779+ stats->rx_errors++;
780+ return;
781+ }
782+
783+ if (msg->u.rx_can.flag & MSG_FLAG_OVERRUN) {
784+ skb = alloc_can_err_skb(priv->netdev, &cf);
785+ if (!skb) {
786+ stats->rx_dropped++;
787+ return;
788+ }
789+
790+ cf->can_id |= CAN_ERR_CRTL;
791+ cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
792+
793+ stats->rx_over_errors++;
794+ stats->rx_errors++;
795+
796+ netif_rx(skb);
797+
798+ stats->rx_packets++;
799+ stats->rx_bytes += cf->can_dlc;
800+ }
801+}
802+
803+static void kvaser_usb_rx_can_msg(const struct kvaser_usb *dev,
804+ const struct kvaser_msg *msg)
805+{
806+ struct kvaser_usb_net_priv *priv;
807+ struct can_frame *cf;
808+ struct sk_buff *skb;
809+ struct net_device_stats *stats;
810+ u8 channel = msg->u.rx_can.channel;
811+
812+ if (channel >= dev->nchannels) {
813+ dev_err(dev->udev->dev.parent,
814+ "Invalid channel number (%d)\n", channel);
815+ return;
816+ }
817+
818+ priv = dev->nets[channel];
819+ stats = &priv->netdev->stats;
820+
821+ if (msg->u.rx_can.flag & (MSG_FLAG_ERROR_FRAME | MSG_FLAG_NERR |
822+ MSG_FLAG_OVERRUN)) {
823+ kvaser_usb_rx_can_err(priv, msg);
824+ return;
825+ } else if (msg->u.rx_can.flag & ~MSG_FLAG_REMOTE_FRAME) {
826+ netdev_warn(priv->netdev,
827+ "Unhandled frame (flags: 0x%02x)",
828+ msg->u.rx_can.flag);
829+ return;
830+ }
831+
832+ skb = alloc_can_skb(priv->netdev, &cf);
833+ if (!skb) {
834+ stats->tx_dropped++;
835+ return;
836+ }
837+
838+ cf->can_id = ((msg->u.rx_can.msg[0] & 0x1f) << 6) |
839+ (msg->u.rx_can.msg[1] & 0x3f);
840+ cf->can_dlc = get_can_dlc(msg->u.rx_can.msg[5]);
841+
842+ if (msg->id == CMD_RX_EXT_MESSAGE) {
843+ cf->can_id <<= 18;
844+ cf->can_id |= ((msg->u.rx_can.msg[2] & 0x0f) << 14) |
845+ ((msg->u.rx_can.msg[3] & 0xff) << 6) |
846+ (msg->u.rx_can.msg[4] & 0x3f);
847+ cf->can_id |= CAN_EFF_FLAG;
848+ }
849+
850+ if (msg->u.rx_can.flag & MSG_FLAG_REMOTE_FRAME)
851+ cf->can_id |= CAN_RTR_FLAG;
852+ else
853+ memcpy(cf->data, &msg->u.rx_can.msg[6], cf->can_dlc);
854+
855+ netif_rx(skb);
856+
857+ stats->rx_packets++;
858+ stats->rx_bytes += cf->can_dlc;
859+}
860+
861+static void kvaser_usb_start_chip_reply(const struct kvaser_usb *dev,
862+ const struct kvaser_msg *msg)
863+{
864+ struct kvaser_usb_net_priv *priv;
865+ u8 channel = msg->u.simple.channel;
866+
867+ if (channel >= dev->nchannels) {
868+ dev_err(dev->udev->dev.parent,
869+ "Invalid channel number (%d)\n", channel);
870+ return;
871+ }
872+
873+ priv = dev->nets[channel];
874+
875+ if (completion_done(&priv->start_comp) &&
876+ netif_queue_stopped(priv->netdev)) {
877+ netif_wake_queue(priv->netdev);
878+ } else {
879+ netif_start_queue(priv->netdev);
880+ complete(&priv->start_comp);
881+ }
882+}
883+
884+static void kvaser_usb_stop_chip_reply(const struct kvaser_usb *dev,
885+ const struct kvaser_msg *msg)
886+{
887+ struct kvaser_usb_net_priv *priv;
888+ u8 channel = msg->u.simple.channel;
889+
890+ if (channel >= dev->nchannels) {
891+ dev_err(dev->udev->dev.parent,
892+ "Invalid channel number (%d)\n", channel);
893+ return;
894+ }
895+
896+ priv = dev->nets[channel];
897+
898+ complete(&priv->stop_comp);
899+}
900+
901+static void kvaser_usb_handle_message(const struct kvaser_usb *dev,
902+ const struct kvaser_msg *msg)
903+{
904+ switch (msg->id) {
905+ case CMD_START_CHIP_REPLY:
906+ kvaser_usb_start_chip_reply(dev, msg);
907+ break;
908+
909+ case CMD_STOP_CHIP_REPLY:
910+ kvaser_usb_stop_chip_reply(dev, msg);
911+ break;
912+
913+ case CMD_RX_STD_MESSAGE:
914+ case CMD_RX_EXT_MESSAGE:
915+ kvaser_usb_rx_can_msg(dev, msg);
916+ break;
917+
918+ case CMD_CHIP_STATE_EVENT:
919+ case CMD_CAN_ERROR_EVENT:
920+ kvaser_usb_rx_error(dev, msg);
921+ break;
922+
923+ case CMD_LOG_MESSAGE:
924+ if (msg->u.log_message.flags & MSG_FLAG_ERROR_FRAME)
925+ kvaser_usb_rx_error(dev, msg);
926+ break;
927+
928+ case CMD_TX_ACKNOWLEDGE:
929+ kvaser_usb_tx_acknowledge(dev, msg);
930+ break;
931+
932+ default:
933+ dev_warn(dev->udev->dev.parent,
934+ "Unhandled message (%d)\n", msg->id);
935+ break;
936+ }
937+}
938+
939+static void kvaser_usb_read_bulk_callback(struct urb *urb)
940+{
941+ struct kvaser_usb *dev = urb->context;
942+ struct kvaser_msg *msg;
943+ int pos = 0;
944+ int err, i;
945+
946+ switch (urb->status) {
947+ case 0:
948+ break;
949+ case -ENOENT:
950+ case -ESHUTDOWN:
951+ return;
952+ default:
953+ dev_info(dev->udev->dev.parent, "Rx URB aborted (%d)\n",
954+ urb->status);
955+ goto resubmit_urb;
956+ }
957+
958+ while (pos <= urb->actual_length - MSG_HEADER_LEN) {
959+ msg = urb->transfer_buffer + pos;
960+
961+ if (!msg->len)
962+ break;
963+
964+ if (pos + msg->len > urb->actual_length) {
965+ dev_err(dev->udev->dev.parent, "Format error\n");
966+ break;
967+ }
968+
969+ kvaser_usb_handle_message(dev, msg);
970+
971+ pos += msg->len;
972+ }
973+
974+resubmit_urb:
975+ usb_fill_bulk_urb(urb, dev->udev,
976+ usb_rcvbulkpipe(dev->udev,
977+ dev->bulk_in->bEndpointAddress),
978+ urb->transfer_buffer, RX_BUFFER_SIZE,
979+ kvaser_usb_read_bulk_callback, dev);
980+
981+ err = usb_submit_urb(urb, GFP_ATOMIC);
982+ if (err == -ENODEV) {
983+ for (i = 0; i < dev->nchannels; i++) {
984+ if (!dev->nets[i])
985+ continue;
986+
987+ netif_device_detach(dev->nets[i]->netdev);
988+ }
989+ } else if (err) {
990+ dev_err(dev->udev->dev.parent,
991+ "Failed resubmitting read bulk urb: %d\n", err);
992+ }
993+
994+ return;
995+}
996+
997+static int kvaser_usb_setup_rx_urbs(struct kvaser_usb *dev)
998+{
999+ int i, err = 0;
1000+
1001+ if (dev->rxinitdone)
1002+ return 0;
1003+
1004+ for (i = 0; i < MAX_RX_URBS; i++) {
1005+ struct urb *urb = NULL;
1006+ u8 *buf = NULL;
1007+ dma_addr_t buf_dma;
1008+
1009+ urb = usb_alloc_urb(0, GFP_KERNEL);
1010+ if (!urb) {
1011+ dev_warn(dev->udev->dev.parent,
1012+ "No memory left for URBs\n");
1013+ err = -ENOMEM;
1014+ break;
1015+ }
1016+
1017+ buf = usb_alloc_coherent(dev->udev, RX_BUFFER_SIZE,
1018+ GFP_KERNEL, &buf_dma);
1019+ if (!buf) {
1020+ dev_warn(dev->udev->dev.parent,
1021+ "No memory left for USB buffer\n");
1022+ usb_free_urb(urb);
1023+ err = -ENOMEM;
1024+ break;
1025+ }
1026+
1027+ usb_fill_bulk_urb(urb, dev->udev,
1028+ usb_rcvbulkpipe(dev->udev,
1029+ dev->bulk_in->bEndpointAddress),
1030+ buf, RX_BUFFER_SIZE,
1031+ kvaser_usb_read_bulk_callback,
1032+ dev);
1033+ urb->transfer_dma = buf_dma;
1034+ urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
1035+ usb_anchor_urb(urb, &dev->rx_submitted);
1036+
1037+ err = usb_submit_urb(urb, GFP_KERNEL);
1038+ if (err) {
1039+ usb_unanchor_urb(urb);
1040+ usb_free_coherent(dev->udev, RX_BUFFER_SIZE, buf,
1041+ buf_dma);
1042+ usb_free_urb(urb);
1043+ break;
1044+ }
1045+
1046+ dev->rxbuf[i] = buf;
1047+ dev->rxbuf_dma[i] = buf_dma;
1048+
1049+ usb_free_urb(urb);
1050+ }
1051+
1052+ if (i == 0) {
1053+ dev_warn(dev->udev->dev.parent,
1054+ "Cannot setup read URBs, error %d\n", err);
1055+ return err;
1056+ } else if (i < MAX_RX_URBS) {
1057+ dev_warn(dev->udev->dev.parent,
1058+ "RX performances may be slow\n");
1059+ }
1060+
1061+ dev->rxinitdone = true;
1062+
1063+ return 0;
1064+}
1065+
1066+static int kvaser_usb_set_opt_mode(const struct kvaser_usb_net_priv *priv)
1067+{
1068+ struct kvaser_msg *msg;
1069+ int rc;
1070+
1071+ msg = kmalloc(sizeof(*msg), GFP_KERNEL);
1072+ if (!msg)
1073+ return -ENOMEM;
1074+
1075+ msg->id = CMD_SET_CTRL_MODE;
1076+ msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_ctrl_mode);
1077+ msg->u.ctrl_mode.tid = 0xff;
1078+ msg->u.ctrl_mode.channel = priv->channel;
1079+
1080+ if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
1081+ msg->u.ctrl_mode.ctrl_mode = KVASER_CTRL_MODE_SILENT;
1082+ else
1083+ msg->u.ctrl_mode.ctrl_mode = KVASER_CTRL_MODE_NORMAL;
1084+
1085+ rc = kvaser_usb_send_msg(priv->dev, msg);
1086+
1087+ kfree(msg);
1088+ return rc;
1089+}
1090+
1091+static int kvaser_usb_start_chip(struct kvaser_usb_net_priv *priv)
1092+{
1093+ int err;
1094+
1095+ init_completion(&priv->start_comp);
1096+
1097+ err = kvaser_usb_send_simple_msg(priv->dev, CMD_START_CHIP,
1098+ priv->channel);
1099+ if (err)
1100+ return err;
1101+
1102+ if (!wait_for_completion_timeout(&priv->start_comp,
1103+ msecs_to_jiffies(START_TIMEOUT)))
1104+ return -ETIMEDOUT;
1105+
1106+ return 0;
1107+}
1108+
1109+static int kvaser_usb_open(struct net_device *netdev)
1110+{
1111+ struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
1112+ struct kvaser_usb *dev = priv->dev;
1113+ int err;
1114+
1115+ err = open_candev(netdev);
1116+ if (err)
1117+ return err;
1118+
1119+ err = kvaser_usb_setup_rx_urbs(dev);
1120+ if (err)
1121+ goto error;
1122+
1123+ err = kvaser_usb_set_opt_mode(priv);
1124+ if (err)
1125+ goto error;
1126+
1127+ err = kvaser_usb_start_chip(priv);
1128+ if (err) {
1129+ netdev_warn(netdev, "Cannot start device, error %d\n", err);
1130+ goto error;
1131+ }
1132+
1133+ priv->can.state = CAN_STATE_ERROR_ACTIVE;
1134+
1135+ return 0;
1136+
1137+error:
1138+ close_candev(netdev);
1139+ return err;
1140+}
1141+
1142+static void kvaser_usb_unlink_all_urbs(struct kvaser_usb *dev)
1143+{
1144+ int i;
1145+
1146+ usb_kill_anchored_urbs(&dev->rx_submitted);
1147+
1148+ for (i = 0; i < MAX_RX_URBS; i++)
1149+ usb_free_coherent(dev->udev, RX_BUFFER_SIZE,
1150+ dev->rxbuf[i],
1151+ dev->rxbuf_dma[i]);
1152+
1153+ for (i = 0; i < MAX_NET_DEVICES; i++) {
1154+ struct kvaser_usb_net_priv *priv = dev->nets[i];
1155+
1156+ if (priv)
1157+ kvaser_usb_unlink_tx_urbs(priv);
1158+ }
1159+}
1160+
1161+static int kvaser_usb_stop_chip(struct kvaser_usb_net_priv *priv)
1162+{
1163+ int err;
1164+
1165+ init_completion(&priv->stop_comp);
1166+
1167+ err = kvaser_usb_send_simple_msg(priv->dev, CMD_STOP_CHIP,
1168+ priv->channel);
1169+ if (err)
1170+ return err;
1171+
1172+ if (!wait_for_completion_timeout(&priv->stop_comp,
1173+ msecs_to_jiffies(STOP_TIMEOUT)))
1174+ return -ETIMEDOUT;
1175+
1176+ return 0;
1177+}
1178+
1179+static int kvaser_usb_flush_queue(struct kvaser_usb_net_priv *priv)
1180+{
1181+ struct kvaser_msg *msg;
1182+ int rc;
1183+
1184+ msg = kmalloc(sizeof(*msg), GFP_KERNEL);
1185+ if (!msg)
1186+ return -ENOMEM;
1187+
1188+ msg->id = CMD_FLUSH_QUEUE;
1189+ msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_flush_queue);
1190+ msg->u.flush_queue.channel = priv->channel;
1191+ msg->u.flush_queue.flags = 0x00;
1192+
1193+ rc = kvaser_usb_send_msg(priv->dev, msg);
1194+
1195+ kfree(msg);
1196+ return rc;
1197+}
1198+
1199+static int kvaser_usb_close(struct net_device *netdev)
1200+{
1201+ struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
1202+ struct kvaser_usb *dev = priv->dev;
1203+ int err;
1204+
1205+ netif_stop_queue(netdev);
1206+
1207+ err = kvaser_usb_flush_queue(priv);
1208+ if (err)
1209+ netdev_warn(netdev, "Cannot flush queue, error %d\n", err);
1210+
1211+ if (kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, priv->channel))
1212+ netdev_warn(netdev, "Cannot reset card, error %d\n", err);
1213+
1214+ err = kvaser_usb_stop_chip(priv);
1215+ if (err)
1216+ netdev_warn(netdev, "Cannot stop device, error %d\n", err);
1217+
1218+ priv->can.state = CAN_STATE_STOPPED;
1219+ close_candev(priv->netdev);
1220+
1221+ return 0;
1222+}
1223+
1224+static void kvaser_usb_write_bulk_callback(struct urb *urb)
1225+{
1226+ struct kvaser_usb_tx_urb_context *context = urb->context;
1227+ struct kvaser_usb_net_priv *priv;
1228+ struct net_device *netdev;
1229+
1230+ if (WARN_ON(!context))
1231+ return;
1232+
1233+ priv = context->priv;
1234+ netdev = priv->netdev;
1235+
1236+ kfree(urb->transfer_buffer);
1237+
1238+ if (!netif_device_present(netdev))
1239+ return;
1240+
1241+ if (urb->status)
1242+ netdev_info(netdev, "Tx URB aborted (%d)\n", urb->status);
1243+}
1244+
1245+static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb,
1246+ struct net_device *netdev)
1247+{
1248+ struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
1249+ struct kvaser_usb *dev = priv->dev;
1250+ struct net_device_stats *stats = &netdev->stats;
1251+ struct can_frame *cf = (struct can_frame *)skb->data;
1252+ struct kvaser_usb_tx_urb_context *context = NULL;
1253+ struct urb *urb;
1254+ void *buf;
1255+ struct kvaser_msg *msg;
1256+ int i, err;
1257+ int ret = NETDEV_TX_OK;
1258+
1259+ if (can_dropped_invalid_skb(netdev, skb))
1260+ return NETDEV_TX_OK;
1261+
1262+ urb = usb_alloc_urb(0, GFP_ATOMIC);
1263+ if (!urb) {
1264+ netdev_err(netdev, "No memory left for URBs\n");
1265+ stats->tx_dropped++;
1266+ goto nourbmem;
1267+ }
1268+
1269+ buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC);
1270+ if (!buf) {
1271+ netdev_err(netdev, "No memory left for USB buffer\n");
1272+ stats->tx_dropped++;
1273+ goto nobufmem;
1274+ }
1275+
1276+ msg = buf;
1277+ msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_tx_can);
1278+ msg->u.tx_can.flags = 0;
1279+ msg->u.tx_can.channel = priv->channel;
1280+
1281+ if (cf->can_id & CAN_EFF_FLAG) {
1282+ msg->id = CMD_TX_EXT_MESSAGE;
1283+ msg->u.tx_can.msg[0] = (cf->can_id >> 24) & 0x1f;
1284+ msg->u.tx_can.msg[1] = (cf->can_id >> 18) & 0x3f;
1285+ msg->u.tx_can.msg[2] = (cf->can_id >> 14) & 0x0f;
1286+ msg->u.tx_can.msg[3] = (cf->can_id >> 6) & 0xff;
1287+ msg->u.tx_can.msg[4] = cf->can_id & 0x3f;
1288+ } else {
1289+ msg->id = CMD_TX_STD_MESSAGE;
1290+ msg->u.tx_can.msg[0] = (cf->can_id >> 6) & 0x1f;
1291+ msg->u.tx_can.msg[1] = cf->can_id & 0x3f;
1292+ }
1293+
1294+ msg->u.tx_can.msg[5] = cf->can_dlc;
1295+ memcpy(&msg->u.tx_can.msg[6], cf->data, cf->can_dlc);
1296+
1297+ if (cf->can_id & CAN_RTR_FLAG)
1298+ msg->u.tx_can.flags |= MSG_FLAG_REMOTE_FRAME;
1299+
1300+ for (i = 0; i < ARRAY_SIZE(priv->tx_contexts); i++) {
1301+ if (priv->tx_contexts[i].echo_index == MAX_TX_URBS) {
1302+ context = &priv->tx_contexts[i];
1303+ break;
1304+ }
1305+ }
1306+
1307+ if (!context) {
1308+ netdev_warn(netdev, "cannot find free context\n");
1309+ ret = NETDEV_TX_BUSY;
1310+ goto releasebuf;
1311+ }
1312+
1313+ context->priv = priv;
1314+ context->echo_index = i;
1315+ context->dlc = cf->can_dlc;
1316+
1317+ msg->u.tx_can.tid = context->echo_index;
1318+
1319+ usb_fill_bulk_urb(urb, dev->udev,
1320+ usb_sndbulkpipe(dev->udev,
1321+ dev->bulk_out->bEndpointAddress),
1322+ buf, msg->len,
1323+ kvaser_usb_write_bulk_callback, context);
1324+ usb_anchor_urb(urb, &priv->tx_submitted);
1325+
1326+ can_put_echo_skb(skb, netdev, context->echo_index);
1327+
1328+ atomic_inc(&priv->active_tx_urbs);
1329+
1330+ if (atomic_read(&priv->active_tx_urbs) >= MAX_TX_URBS)
1331+ netif_stop_queue(netdev);
1332+
1333+ err = usb_submit_urb(urb, GFP_ATOMIC);
1334+ if (unlikely(err)) {
1335+ can_free_echo_skb(netdev, context->echo_index);
1336+
1337+ skb = NULL; /* set to NULL to avoid double free in
1338+ * dev_kfree_skb(skb) */
1339+
1340+ atomic_dec(&priv->active_tx_urbs);
1341+ usb_unanchor_urb(urb);
1342+
1343+ stats->tx_dropped++;
1344+
1345+ if (err == -ENODEV)
1346+ netif_device_detach(netdev);
1347+ else
1348+ netdev_warn(netdev, "Failed tx_urb %d\n", err);
1349+
1350+ goto releasebuf;
1351+ }
1352+
1353+ usb_free_urb(urb);
1354+
1355+ return NETDEV_TX_OK;
1356+
1357+releasebuf:
1358+ kfree(buf);
1359+nobufmem:
1360+ usb_free_urb(urb);
1361+nourbmem:
1362+ dev_kfree_skb(skb);
1363+ return ret;
1364+}
1365+
1366+static const struct net_device_ops kvaser_usb_netdev_ops = {
1367+ .ndo_open = kvaser_usb_open,
1368+ .ndo_stop = kvaser_usb_close,
1369+ .ndo_start_xmit = kvaser_usb_start_xmit,
1370+};
1371+
1372+static const struct can_bittiming_const kvaser_usb_bittiming_const = {
1373+ .name = "kvaser_usb",
1374+ .tseg1_min = KVASER_USB_TSEG1_MIN,
1375+ .tseg1_max = KVASER_USB_TSEG1_MAX,
1376+ .tseg2_min = KVASER_USB_TSEG2_MIN,
1377+ .tseg2_max = KVASER_USB_TSEG2_MAX,
1378+ .sjw_max = KVASER_USB_SJW_MAX,
1379+ .brp_min = KVASER_USB_BRP_MIN,
1380+ .brp_max = KVASER_USB_BRP_MAX,
1381+ .brp_inc = KVASER_USB_BRP_INC,
1382+};
1383+
1384+static int kvaser_usb_set_bittiming(struct net_device *netdev)
1385+{
1386+ struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
1387+ struct can_bittiming *bt = &priv->can.bittiming;
1388+ struct kvaser_usb *dev = priv->dev;
1389+ struct kvaser_msg *msg;
1390+ int rc;
1391+
1392+ msg = kmalloc(sizeof(*msg), GFP_KERNEL);
1393+ if (!msg)
1394+ return -ENOMEM;
1395+
1396+ msg->id = CMD_SET_BUS_PARAMS;
1397+ msg->len = MSG_HEADER_LEN + sizeof(struct kvaser_msg_busparams);
1398+ msg->u.busparams.channel = priv->channel;
1399+ msg->u.busparams.tid = 0xff;
1400+ msg->u.busparams.bitrate = cpu_to_le32(bt->bitrate);
1401+ msg->u.busparams.sjw = bt->sjw;
1402+ msg->u.busparams.tseg1 = bt->prop_seg + bt->phase_seg1;
1403+ msg->u.busparams.tseg2 = bt->phase_seg2;
1404+
1405+ if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)
1406+ msg->u.busparams.no_samp = 3;
1407+ else
1408+ msg->u.busparams.no_samp = 1;
1409+
1410+ rc = kvaser_usb_send_msg(dev, msg);
1411+
1412+ kfree(msg);
1413+ return rc;
1414+}
1415+
1416+static int kvaser_usb_set_mode(struct net_device *netdev,
1417+ enum can_mode mode)
1418+{
1419+ struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
1420+ int err;
1421+
1422+ switch (mode) {
1423+ case CAN_MODE_START:
1424+ err = kvaser_usb_simple_msg_async(priv, CMD_START_CHIP);
1425+ if (err)
1426+ return err;
1427+ break;
1428+ default:
1429+ return -EOPNOTSUPP;
1430+ }
1431+
1432+ return 0;
1433+}
1434+
1435+static int kvaser_usb_get_berr_counter(const struct net_device *netdev,
1436+ struct can_berr_counter *bec)
1437+{
1438+ struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
1439+
1440+ *bec = priv->bec;
1441+
1442+ return 0;
1443+}
1444+
1445+static void kvaser_usb_remove_interfaces(struct kvaser_usb *dev)
1446+{
1447+ int i;
1448+
1449+ for (i = 0; i < dev->nchannels; i++) {
1450+ if (!dev->nets[i])
1451+ continue;
1452+
1453+ unregister_netdev(dev->nets[i]->netdev);
1454+ }
1455+
1456+ kvaser_usb_unlink_all_urbs(dev);
1457+
1458+ for (i = 0; i < dev->nchannels; i++) {
1459+ if (!dev->nets[i])
1460+ continue;
1461+
1462+ free_candev(dev->nets[i]->netdev);
1463+ }
1464+}
1465+
1466+static int kvaser_usb_init_one(struct usb_interface *intf,
1467+ const struct usb_device_id *id, int channel)
1468+{
1469+ struct kvaser_usb *dev = usb_get_intfdata(intf);
1470+ struct net_device *netdev;
1471+ struct kvaser_usb_net_priv *priv;
1472+ int i, err;
1473+
1474+ netdev = alloc_candev(sizeof(*priv), MAX_TX_URBS);
1475+ if (!netdev) {
1476+ dev_err(&intf->dev, "Cannot alloc candev\n");
1477+ return -ENOMEM;
1478+ }
1479+
1480+ priv = netdev_priv(netdev);
1481+
1482+ init_completion(&priv->start_comp);
1483+ init_completion(&priv->stop_comp);
1484+
1485+ init_usb_anchor(&priv->tx_submitted);
1486+ atomic_set(&priv->active_tx_urbs, 0);
1487+
1488+ for (i = 0; i < ARRAY_SIZE(priv->tx_contexts); i++)
1489+ priv->tx_contexts[i].echo_index = MAX_TX_URBS;
1490+
1491+ priv->dev = dev;
1492+ priv->netdev = netdev;
1493+ priv->channel = channel;
1494+
1495+ priv->can.state = CAN_STATE_STOPPED;
1496+ priv->can.clock.freq = CAN_USB_CLOCK;
1497+ priv->can.bittiming_const = &kvaser_usb_bittiming_const;
1498+ priv->can.do_set_bittiming = kvaser_usb_set_bittiming;
1499+ priv->can.do_set_mode = kvaser_usb_set_mode;
1500+ if (id->driver_info & KVASER_HAS_TXRX_ERRORS)
1501+ priv->can.do_get_berr_counter = kvaser_usb_get_berr_counter;
1502+ priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES;
1503+ if (id->driver_info & KVASER_HAS_SILENT_MODE)
1504+ priv->can.ctrlmode_supported |= CAN_CTRLMODE_LISTENONLY;
1505+
1506+ netdev->flags |= IFF_ECHO;
1507+
1508+ netdev->netdev_ops = &kvaser_usb_netdev_ops;
1509+
1510+ SET_NETDEV_DEV(netdev, &intf->dev);
1511+
1512+ dev->nets[channel] = priv;
1513+
1514+ err = register_candev(netdev);
1515+ if (err) {
1516+ dev_err(&intf->dev, "Failed to register can device\n");
1517+ free_candev(netdev);
1518+ dev->nets[channel] = NULL;
1519+ return err;
1520+ }
1521+
1522+ netdev_dbg(netdev, "device registered\n");
1523+
1524+ return 0;
1525+}
1526+
1527+static void kvaser_usb_get_endpoints(const struct usb_interface *intf,
1528+ struct usb_endpoint_descriptor **in,
1529+ struct usb_endpoint_descriptor **out)
1530+{
1531+ const struct usb_host_interface *iface_desc;
1532+ struct usb_endpoint_descriptor *endpoint;
1533+ int i;
1534+
1535+ iface_desc = &intf->altsetting[0];
1536+
1537+ for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
1538+ endpoint = &iface_desc->endpoint[i].desc;
1539+
1540+ if (usb_endpoint_is_bulk_in(endpoint))
1541+ *in = endpoint;
1542+
1543+ if (usb_endpoint_is_bulk_out(endpoint))
1544+ *out = endpoint;
1545+ }
1546+}
1547+
1548+static int kvaser_usb_probe(struct usb_interface *intf,
1549+ const struct usb_device_id *id)
1550+{
1551+ struct kvaser_usb *dev;
1552+ int err = -ENOMEM;
1553+ int i;
1554+
1555+ dev = devm_kzalloc(&intf->dev, sizeof(*dev), GFP_KERNEL);
1556+ if (!dev)
1557+ return -ENOMEM;
1558+
1559+ kvaser_usb_get_endpoints(intf, &dev->bulk_in, &dev->bulk_out);
1560+ if (!dev->bulk_in || !dev->bulk_out) {
1561+ dev_err(&intf->dev, "Cannot get usb endpoint(s)");
1562+ return err;
1563+ }
1564+
1565+ dev->udev = interface_to_usbdev(intf);
1566+
1567+ init_usb_anchor(&dev->rx_submitted);
1568+
1569+ usb_set_intfdata(intf, dev);
1570+
1571+ for (i = 0; i < MAX_NET_DEVICES; i++)
1572+ kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, i);
1573+
1574+ err = kvaser_usb_get_software_info(dev);
1575+ if (err) {
1576+ dev_err(&intf->dev,
1577+ "Cannot get software infos, error %d\n", err);
1578+ return err;
1579+ }
1580+
1581+ err = kvaser_usb_get_card_info(dev);
1582+ if (err) {
1583+ dev_err(&intf->dev,
1584+ "Cannot get card infos, error %d\n", err);
1585+ return err;
1586+ }
1587+
1588+ dev_dbg(&intf->dev, "Firmware version: %d.%d.%d\n",
1589+ ((dev->fw_version >> 24) & 0xff),
1590+ ((dev->fw_version >> 16) & 0xff),
1591+ (dev->fw_version & 0xffff));
1592+
1593+ for (i = 0; i < dev->nchannels; i++) {
1594+ err = kvaser_usb_init_one(intf, id, i);
1595+ if (err) {
1596+ kvaser_usb_remove_interfaces(dev);
1597+ return err;
1598+ }
1599+ }
1600+
1601+ return 0;
1602+}
1603+
1604+static void kvaser_usb_disconnect(struct usb_interface *intf)
1605+{
1606+ struct kvaser_usb *dev = usb_get_intfdata(intf);
1607+
1608+ usb_set_intfdata(intf, NULL);
1609+
1610+ if (!dev)
1611+ return;
1612+
1613+ kvaser_usb_remove_interfaces(dev);
1614+}
1615+
1616+static struct usb_driver kvaser_usb_driver = {
1617+ .name = "kvaser_usb",
1618+ .probe = kvaser_usb_probe,
1619+ .disconnect = kvaser_usb_disconnect,
1620+ .id_table = kvaser_usb_table,
1621+};
1622+
1623+module_usb_driver(kvaser_usb_driver);
1624+
1625+MODULE_AUTHOR("Olivier Sobrie <olivier@sobrie.be>");
1626+MODULE_DESCRIPTION("CAN driver for Kvaser CAN/USB devices");
1627+MODULE_LICENSE("GPL v2");
drivers/net/can/usb/peak_usb/pcan_usb_core.c+0−5
@@ -520,7 +520,6 @@ static int peak_usb_ndo_open(struct net_device *netdev) · 519 unmodified lines
520520 return err;
521521 }
522522
523− dev->open_time = jiffies;
524523 netif_start_queue(netdev);
525524
526525 return 0;
@@ -576,7 +575,6 @@ static int peak_usb_ndo_stop(struct net_device *netdev) · 49 unmodified lines
576575
577576 close_candev(netdev);
578577
579− dev->open_time = 0;
580578 dev->can.state = CAN_STATE_STOPPED;
581579
582580 /* can set bus off now */
@@ -661,9 +659,6 @@ static int peak_usb_set_mode(struct net_device *netdev, enum can_mode mode) · 78 unmodified lines
661659 struct peak_usb_device *dev = netdev_priv(netdev);
662660 int err = 0;
663661
664− if (!dev->open_time)
665− return -EINVAL;
666−
667662 switch (mode) {
668663 case CAN_MODE_START:
669664 err = peak_usb_restart(dev);
drivers/net/can/usb/peak_usb/pcan_usb_core.h+0−1
@@ -104,7 +104,6 @@ struct peak_usb_device { · 103 unmodified lines
104104 struct can_priv can;
105105 struct peak_usb_adapter *adapter;
106106 unsigned int ctrl_idx;
107− int open_time;
108107 u32 state;
109108
110109 struct sk_buff *echo_skb[PCAN_USB_MAX_TX_URBS];
drivers/net/dsa/Kconfig+4−1
@@ -1,5 +1,5 @@
11 menu "Distributed Switch Architecture drivers"
2− depends on NET_DSA
2+ depends on HAVE_NET_DSA
33
44 config NET_DSA_MV88E6XXX
55 tristate
@@ -7,6 +7,7 @@ config NET_DSA_MV88E6XXX · 1 unmodified line
77
88 config NET_DSA_MV88E6060
99 tristate "Marvell 88E6060 ethernet switch chip support"
10+ select NET_DSA
1011 select NET_DSA_TAG_TRAILER
1112 ---help---
1213 This enables support for the Marvell 88E6060 ethernet switch
@@ -18,6 +19,7 @@ config NET_DSA_MV88E6XXX_NEED_PPU · 5 unmodified lines
1819
1920 config NET_DSA_MV88E6131
2021 tristate "Marvell 88E6085/6095/6095F/6131 ethernet switch chip support"
22+ select NET_DSA
2123 select NET_DSA_MV88E6XXX
2224 select NET_DSA_MV88E6XXX_NEED_PPU
2325 select NET_DSA_TAG_DSA
@@ -27,6 +29,7 @@ config NET_DSA_MV88E6131 · 3 unmodified lines
2729
2830 config NET_DSA_MV88E6123_61_65
2931 tristate "Marvell 88E6123/6161/6165 ethernet switch chip support"
32+ select NET_DSA
3033 select NET_DSA_MV88E6XXX
3134 select NET_DSA_TAG_EDSA
3235 ---help---
drivers/net/ethernet/3com/3c509.c+13−16
@@ -92,7 +92,7 @@ · 91 unmodified lines
9292 #include <asm/io.h>
9393 #include <asm/irq.h>
9494
95−static char version[] __devinitdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n";
95+static char version[] = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n";
9696
9797 #ifdef EL3_DEBUG
9898 static int el3_debug = EL3_DEBUG;
@@ -184,7 +184,7 @@ static int max_interrupt_work = 10; · 85 unmodified lines
184184 static int nopnp;
185185 #endif
186186
187−static int __devinit el3_common_init(struct net_device *dev);
187+static int el3_common_init(struct net_device *dev);
188188 static void el3_common_remove(struct net_device *dev);
189189 static ushort id_read_eeprom(int index);
190190 static ushort read_eeprom(int ioaddr, int index);
@@ -270,9 +270,8 @@ static int el3_isa_id_sequence(__be16 *phys_addr) · 79 unmodified lines
270270
271271 }
272272
273−static void __devinit el3_dev_fill(struct net_device *dev, __be16 *phys_addr,
274− int ioaddr, int irq, int if_port,
275− enum el3_cardtype type)
273+static void el3_dev_fill(struct net_device *dev, __be16 *phys_addr, int ioaddr,
274+ int irq, int if_port, enum el3_cardtype type)
276275 {
277276 struct el3_private *lp = netdev_priv(dev);
278277
@@ -283,8 +282,7 @@ static void __devinit el3_dev_fill(struct net_device *dev, __be16 *phys_addr, · 4 unmodified lines
283282 lp->type = type;
284283 }
285284
286−static int __devinit el3_isa_match(struct device *pdev,
287− unsigned int ndev)
285+static int el3_isa_match(struct device *pdev, unsigned int ndev)
288286 {
289287 struct net_device *dev;
290288 int ioaddr, isa_irq, if_port, err;
@@ -341,7 +339,7 @@ static int __devinit el3_isa_match(struct device *pdev, · 50 unmodified lines
341339 return 1;
342340 }
343341
344−static int __devexit el3_isa_remove(struct device *pdev,
342+static int el3_isa_remove(struct device *pdev,
345343 unsigned int ndev)
346344 {
347345 el3_device_remove(pdev);
@@ -382,7 +380,7 @@ static int el3_isa_resume(struct device *dev, unsigned int n) · 34 unmodified lines
382380
383381 static struct isa_driver el3_isa_driver = {
384382 .match = el3_isa_match,
385− .remove = __devexit_p(el3_isa_remove),
383+ .remove = el3_isa_remove,
386384 #ifdef CONFIG_PM
387385 .suspend = el3_isa_suspend,
388386 .resume = el3_isa_resume,
@@ -406,8 +404,7 @@ static struct pnp_device_id el3_pnp_ids[] = { · 17 unmodified lines
406404 };
407405 MODULE_DEVICE_TABLE(pnp, el3_pnp_ids);
408406
409−static int __devinit el3_pnp_probe(struct pnp_dev *pdev,
410− const struct pnp_device_id *id)
407+static int el3_pnp_probe(struct pnp_dev *pdev, const struct pnp_device_id *id)
411408 {
412409 short i;
413410 int ioaddr, irq, if_port;
@@ -445,7 +442,7 @@ static int __devinit el3_pnp_probe(struct pnp_dev *pdev, · 31 unmodified lines
445442 return 0;
446443 }
447444
448−static void __devexit el3_pnp_remove(struct pnp_dev *pdev)
445+static void el3_pnp_remove(struct pnp_dev *pdev)
449446 {
450447 el3_common_remove(pnp_get_drvdata(pdev));
451448 pnp_set_drvdata(pdev, NULL);
@@ -467,7 +464,7 @@ static struct pnp_driver el3_pnp_driver = { · 15 unmodified lines
467464 .name = "3c509",
468465 .id_table = el3_pnp_ids,
469466 .probe = el3_pnp_probe,
470− .remove = __devexit_p(el3_pnp_remove),
467+ .remove = el3_pnp_remove,
471468 #ifdef CONFIG_PM
472469 .suspend = el3_pnp_suspend,
473470 .resume = el3_pnp_resume,
@@ -496,7 +493,7 @@ static struct eisa_driver el3_eisa_driver = { · 22 unmodified lines
496493 .driver = {
497494 .name = "3c579",
498495 .probe = el3_eisa_probe,
499− .remove = __devexit_p (el3_device_remove),
496+ .remove = el3_device_remove,
500497 .suspend = el3_suspend,
501498 .resume = el3_resume,
502499 }
@@ -519,7 +516,7 @@ static const struct net_device_ops netdev_ops = { · 16 unmodified lines
519516 #endif
520517 };
521518
522−static int __devinit el3_common_init(struct net_device *dev)
519+static int el3_common_init(struct net_device *dev)
523520 {
524521 struct el3_private *lp = netdev_priv(dev);
525522 int err;
@@ -618,7 +615,7 @@ static int __init el3_eisa_probe (struct device *device) · 92 unmodified lines
618615 /* This remove works for all device types.
619616 *
620617 * The net dev must be stored in the driver data field */
621−static int __devexit el3_device_remove (struct device *device)
618+static int el3_device_remove(struct device *device)
622619 {
623620 struct net_device *dev;
624621
drivers/net/ethernet/3com/3c59x.c+10−11
@@ -102,7 +102,7 @@ static int vortex_debug = 1; · 101 unmodified lines
102102 #include <linux/delay.h>
103103
104104
105−static const char version[] __devinitconst =
105+static const char version[] =
106106 DRV_NAME ": Donald Becker and others.\n";
107107
108108 MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
@@ -277,7 +277,7 @@ static struct vortex_chip_info { · 168 unmodified lines
277277 int flags;
278278 int drv_flags;
279279 int io_size;
280−} vortex_info_tbl[] __devinitdata = {
280+} vortex_info_tbl[] = {
281281 {"3c590 Vortex 10Mbps",
282282 PCI_USES_MASTER, IS_VORTEX, 32, },
283283 {"3c592 EISA 10Mbps Demon/Vortex", /* AKPM: from Don's 3c59x_cb.c 0.49H */
@@ -931,7 +931,7 @@ static int __init vortex_eisa_probe(struct device *device) · 647 unmodified lines
931931 return 0;
932932 }
933933
934−static int __devexit vortex_eisa_remove(struct device *device)
934+static int vortex_eisa_remove(struct device *device)
935935 {
936936 struct eisa_device *edev;
937937 struct net_device *dev;
@@ -962,7 +962,7 @@ static struct eisa_driver vortex_eisa_driver = { · 24 unmodified lines
962962 .driver = {
963963 .name = "3c59x",
964964 .probe = vortex_eisa_probe,
965− .remove = __devexit_p(vortex_eisa_remove)
965+ .remove = vortex_eisa_remove
966966 }
967967 };
968968
@@ -1000,8 +1000,8 @@ static int __init vortex_eisa_init(void) · 31 unmodified lines
10001000 }
10011001
10021002 /* returns count (>= 0), or negative on error */
1003−static int __devinit vortex_init_one(struct pci_dev *pdev,
1004− const struct pci_device_id *ent)
1003+static int vortex_init_one(struct pci_dev *pdev,
1004+ const struct pci_device_id *ent)
10051005 {
10061006 int rc, unit, pci_bar;
10071007 struct vortex_chip_info *vci;
@@ -1088,9 +1088,8 @@ static const struct net_device_ops vortex_netdev_ops = { · 80 unmodified lines
10881088 *
10891089 * NOTE: pdev can be NULL, for the case of a Compaq device
10901090 */
1091−static int __devinit vortex_probe1(struct device *gendev,
1092− void __iomem *ioaddr, int irq,
1093− int chip_idx, int card_idx)
1091+static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
1092+ int chip_idx, int card_idx)
10941093 {
10951094 struct vortex_private *vp;
10961095 int option;
@@ -3222,7 +3221,7 @@ static void acpi_set_WOL(struct net_device *dev) · 2125 unmodified lines
32223221 }
32233222
32243223
3225−static void __devexit vortex_remove_one(struct pci_dev *pdev)
3224+static void vortex_remove_one(struct pci_dev *pdev)
32263225 {
32273226 struct net_device *dev = pci_get_drvdata(pdev);
32283227 struct vortex_private *vp;
@@ -3265,7 +3264,7 @@ static void __devexit vortex_remove_one(struct pci_dev *pdev) · 36 unmodified lines
32653264 static struct pci_driver vortex_driver = {
32663265 .name = "3c59x",
32673266 .probe = vortex_init_one,
3268− .remove = __devexit_p(vortex_remove_one),
3267+ .remove = vortex_remove_one,
32693268 .id_table = vortex_pci_tbl,
32703269 .driver.pm = VORTEX_PM_OPS,
32713270 };
drivers/net/ethernet/3com/Kconfig+1−1
@@ -80,7 +80,7 @@ config PCMCIA_3C589 · 79 unmodified lines
8080
8181 config VORTEX
8282 tristate "3c590/3c900 series (592/595/597) \"Vortex/Boomerang\" support"
83− depends on (PCI || EISA)
83+ depends on (PCI || EISA) && HAS_IOPORT
8484 select NET_CORE
8585 select MII
8686 ---help---
drivers/net/ethernet/3com/typhoon.c+5−5
@@ -168,7 +168,7 @@ enum typhoon_cards { · 167 unmodified lines
168168 };
169169
170170 /* directly indexed by enum typhoon_cards, above */
171−static struct typhoon_card_info typhoon_card_info[] __devinitdata = {
171+static struct typhoon_card_info typhoon_card_info[] = {
172172 { "3Com Typhoon (3C990-TX)",
173173 TYPHOON_CRYPTO_NONE},
174174 { "3Com Typhoon (3CR990-TX-95)",
@@ -2200,7 +2200,7 @@ need_resume: · 2025 unmodified lines
22002200 }
22012201 #endif
22022202
2203−static int __devinit
2203+static int
22042204 typhoon_test_mmio(struct pci_dev *pdev)
22052205 {
22062206 void __iomem *ioaddr = pci_iomap(pdev, 1, 128);
@@ -2258,7 +2258,7 @@ static const struct net_device_ops typhoon_netdev_ops = { · 51 unmodified lines
22582258 .ndo_change_mtu = eth_change_mtu,
22592259 };
22602260
2261−static int __devinit
2261+static int
22622262 typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
22632263 {
22642264 struct net_device *dev;
@@ -2509,7 +2509,7 @@ error_out: · 244 unmodified lines
25092509 return err;
25102510 }
25112511
2512−static void __devexit
2512+static void
25132513 typhoon_remove_one(struct pci_dev *pdev)
25142514 {
25152515 struct net_device *dev = pci_get_drvdata(pdev);
@@ -2533,7 +2533,7 @@ static struct pci_driver typhoon_driver = { · 17 unmodified lines
25332533 .name = KBUILD_MODNAME,
25342534 .id_table = typhoon_pci_tbl,
25352535 .probe = typhoon_init_one,
2536− .remove = __devexit_p(typhoon_remove_one),
2536+ .remove = typhoon_remove_one,
25372537 #ifdef CONFIG_PM
25382538 .suspend = typhoon_suspend,
25392539 .resume = typhoon_resume,
drivers/net/ethernet/8390/ax88796.c+8−8
@@ -191,11 +191,11 @@ static void ax_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, · 190 unmodified lines
191191 ei_outb(E8390_RREAD+E8390_START, nic_base + NE_CMD);
192192
193193 if (ei_local->word16)
194− readsw(nic_base + NE_DATAPORT, hdr,
195− sizeof(struct e8390_pkt_hdr) >> 1);
194+ ioread16_rep(nic_base + NE_DATAPORT, hdr,
195+ sizeof(struct e8390_pkt_hdr) >> 1);
196196 else
197− readsb(nic_base + NE_DATAPORT, hdr,
198− sizeof(struct e8390_pkt_hdr));
197+ ioread8_rep(nic_base + NE_DATAPORT, hdr,
198+ sizeof(struct e8390_pkt_hdr));
199199
200200 ei_outb(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
201201 ei_local->dmaing &= ~0x01;
@@ -237,12 +237,12 @@ static void ax_block_input(struct net_device *dev, int count, · 35 unmodified lines
237237 ei_outb(E8390_RREAD+E8390_START, nic_base + NE_CMD);
238238
239239 if (ei_local->word16) {
240− readsw(nic_base + NE_DATAPORT, buf, count >> 1);
240+ ioread16_rep(nic_base + NE_DATAPORT, buf, count >> 1);
241241 if (count & 0x01)
242242 buf[count-1] = ei_inb(nic_base + NE_DATAPORT);
243243
244244 } else {
245− readsb(nic_base + NE_DATAPORT, buf, count);
245+ ioread8_rep(nic_base + NE_DATAPORT, buf, count);
246246 }
247247
248248 ei_local->dmaing &= ~1;
@@ -286,9 +286,9 @@ static void ax_block_output(struct net_device *dev, int count, · 37 unmodified lines
286286
287287 ei_outb(E8390_RWRITE+E8390_START, nic_base + NE_CMD);
288288 if (ei_local->word16)
289− writesw(nic_base + NE_DATAPORT, buf, count >> 1);
289+ iowrite16_rep(nic_base + NE_DATAPORT, buf, count >> 1);
290290 else
291− writesb(nic_base + NE_DATAPORT, buf, count);
291+ iowrite8_rep(nic_base + NE_DATAPORT, buf, count);
292292
293293 dma_start = jiffies;
294294
drivers/net/ethernet/8390/etherh.c+4−10
@@ -463,12 +463,6 @@ etherh_open(struct net_device *dev) · 462 unmodified lines
463463 {
464464 struct ei_device *ei_local = netdev_priv(dev);
465465
466− if (!is_valid_ether_addr(dev->dev_addr)) {
467− printk(KERN_WARNING "%s: invalid ethernet MAC address\n",
468− dev->name);
469− return -EINVAL;
470− }
471−
472466 if (request_irq(dev->irq, __ei_interrupt, 0, dev->name, dev))
473467 return -EAGAIN;
474468
@@ -527,7 +521,7 @@ static void __init etherh_banner(void) · 52 unmodified lines
527521 * Read the ethernet address string from the on board rom.
528522 * This is an ascii string...
529523 */
530−static int __devinit etherh_addr(char *addr, struct expansion_card *ec)
524+static int etherh_addr(char *addr, struct expansion_card *ec)
531525 {
532526 struct in_chunk_dir cd;
533527 char *s;
@@ -657,7 +651,7 @@ static const struct net_device_ops etherh_netdev_ops = { · 123 unmodified lines
657651 static u32 etherh_regoffsets[16];
658652 static u32 etherm_regoffsets[16];
659653
660−static int __devinit
654+static int
661655 etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
662656 {
663657 const struct etherh_data *data = id->data;
@@ -775,7 +769,7 @@ etherh_probe(struct expansion_card *ec, const struct ecard_id *id) · 111 unmodified lines
775769 return ret;
776770 }
777771
778−static void __devexit etherh_remove(struct expansion_card *ec)
772+static void etherh_remove(struct expansion_card *ec)
779773 {
780774 struct net_device *dev = ecard_get_drvdata(ec);
781775
@@ -839,7 +833,7 @@ static const struct ecard_id etherh_ids[] = { · 57 unmodified lines
839833
840834 static struct ecard_driver etherh_driver = {
841835 .probe = etherh_probe,
842− .remove = __devexit_p(etherh_remove),
836+ .remove = etherh_remove,
843837 .id_table = etherh_ids,
844838 .drv = {
845839 .name = DRV_NAME,
drivers/net/ethernet/8390/hydra.c+9−9
@@ -53,9 +53,9 @@ static const char version[] = · 52 unmodified lines
5353 #define WORDSWAP(a) ((((a)>>8)&0xff) | ((a)<<8))
5454
5555
56−static int __devinit hydra_init_one(struct zorro_dev *z,
56+static int hydra_init_one(struct zorro_dev *z,
5757 const struct zorro_device_id *ent);
58−static int __devinit hydra_init(struct zorro_dev *z);
58+static int hydra_init(struct zorro_dev *z);
5959 static int hydra_open(struct net_device *dev);
6060 static int hydra_close(struct net_device *dev);
6161 static void hydra_reset_8390(struct net_device *dev);
@@ -65,9 +65,9 @@ static void hydra_block_input(struct net_device *dev, int count, · 3 unmodified lines
6565 struct sk_buff *skb, int ring_offset);
6666 static void hydra_block_output(struct net_device *dev, int count,
6767 const unsigned char *buf, int start_page);
68−static void __devexit hydra_remove_one(struct zorro_dev *z);
68+static void hydra_remove_one(struct zorro_dev *z);
6969
70−static struct zorro_device_id hydra_zorro_tbl[] __devinitdata = {
70+static struct zorro_device_id hydra_zorro_tbl[] = {
7171 { ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET },
7272 { 0 }
7373 };
@@ -77,11 +77,11 @@ static struct zorro_driver hydra_driver = { · 3 unmodified lines
7777 .name = "hydra",
7878 .id_table = hydra_zorro_tbl,
7979 .probe = hydra_init_one,
80− .remove = __devexit_p(hydra_remove_one),
80+ .remove = hydra_remove_one,
8181 };
8282
83−static int __devinit hydra_init_one(struct zorro_dev *z,
84− const struct zorro_device_id *ent)
83+static int hydra_init_one(struct zorro_dev *z,
84+ const struct zorro_device_id *ent)
8585 {
8686 int err;
8787
@@ -110,7 +110,7 @@ static const struct net_device_ops hydra_netdev_ops = { · 22 unmodified lines
110110 #endif
111111 };
112112
113−static int __devinit hydra_init(struct zorro_dev *z)
113+static int hydra_init(struct zorro_dev *z)
114114 {
115115 struct net_device *dev;
116116 unsigned long board = ZTWO_VADDR(z->resource.start);
@@ -247,7 +247,7 @@ static void hydra_block_output(struct net_device *dev, int count, · 130 unmodified lines
247247 z_memcpy_toio(mem_base+((start_page - NESM_START_PG)<<8), buf, count);
248248 }
249249
250−static void __devexit hydra_remove_one(struct zorro_dev *z)
250+static void hydra_remove_one(struct zorro_dev *z)
251251 {
252252 struct net_device *dev = zorro_get_drvdata(z);
253253
drivers/net/ethernet/8390/ne2k-pci.c+6−6
@@ -61,7 +61,7 @@ static int options[MAX_UNITS]; · 60 unmodified lines
6161 #include "8390.h"
6262
6363 /* These identify the driver base version and may not be removed. */
64−static const char version[] __devinitconst =
64+static const char version[] =
6565 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE
6666 " D. Becker/P. Gortmaker\n";
6767
@@ -119,7 +119,7 @@ enum ne2k_pci_chipsets { · 51 unmodified lines
119119 static struct {
120120 char *name;
121121 int flags;
122−} pci_clone_list[] __devinitdata = {
122+} pci_clone_list[] = {
123123 {"RealTek RTL-8029", REALTEK_FDX},
124124 {"Winbond 89C940", 0},
125125 {"Compex RL2000", 0},
@@ -215,8 +215,8 @@ static const struct net_device_ops ne2k_netdev_ops = { · 89 unmodified lines
215215 #endif
216216 };
217217
218−static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
219− const struct pci_device_id *ent)
218+static int ne2k_pci_init_one(struct pci_dev *pdev,
219+ const struct pci_device_id *ent)
220220 {
221221 struct net_device *dev;
222222 int i;
@@ -647,7 +647,7 @@ static const struct ethtool_ops ne2k_pci_ethtool_ops = { · 424 unmodified lines
647647 .get_drvinfo = ne2k_pci_get_drvinfo,
648648 };
649649
650−static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev)
650+static void ne2k_pci_remove_one(struct pci_dev *pdev)
651651 {
652652 struct net_device *dev = pci_get_drvdata(pdev);
653653
@@ -696,7 +696,7 @@ static int ne2k_pci_resume (struct pci_dev *pdev) · 42 unmodified lines
696696 static struct pci_driver ne2k_driver = {
697697 .name = DRV_NAME,
698698 .probe = ne2k_pci_init_one,
699− .remove = __devexit_p(ne2k_pci_remove_one),
699+ .remove = ne2k_pci_remove_one,
700700 .id_table = ne2k_pci_tbl,
701701 #ifdef CONFIG_PM
702702 .suspend = ne2k_pci_suspend,
drivers/net/ethernet/8390/ne3210.c+2−2
@@ -222,7 +222,7 @@ static int __init ne3210_eisa_probe (struct device *device) · 221 unmodified lines
222222 return retval;
223223 }
224224
225−static int __devexit ne3210_eisa_remove (struct device *device)
225+static int ne3210_eisa_remove(struct device *device)
226226 {
227227 struct net_device *dev = dev_get_drvdata(device);
228228 unsigned long ioaddr = to_eisa_device (device)->base_addr;
@@ -324,7 +324,7 @@ static struct eisa_driver ne3210_eisa_driver = { · 95 unmodified lines
324324 .driver = {
325325 .name = "ne3210",
326326 .probe = ne3210_eisa_probe,
327− .remove = __devexit_p (ne3210_eisa_remove),
327+ .remove = ne3210_eisa_remove,
328328 },
329329 };
330330
drivers/net/ethernet/8390/zorro8390.c+8−9
@@ -75,7 +75,7 @@ static struct card_info { · 74 unmodified lines
7575 zorro_id id;
7676 const char *name;
7777 unsigned int offset;
78−} cards[] __devinitdata = {
78+} cards[] = {
7979 { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2, "Ariadne II", 0x0600 },
8080 { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, "X-Surf", 0x8600 },
8181 };
@@ -254,7 +254,7 @@ static int zorro8390_close(struct net_device *dev) · 172 unmodified lines
254254 return 0;
255255 }
256256
257−static void __devexit zorro8390_remove_one(struct zorro_dev *z)
257+static void zorro8390_remove_one(struct zorro_dev *z)
258258 {
259259 struct net_device *dev = zorro_get_drvdata(z);
260260
@@ -264,7 +264,7 @@ static void __devexit zorro8390_remove_one(struct zorro_dev *z) · 3 unmodified lines
264264 free_netdev(dev);
265265 }
266266
267−static struct zorro_device_id zorro8390_zorro_tbl[] __devinitdata = {
267+static struct zorro_device_id zorro8390_zorro_tbl[] = {
268268 { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2, },
269269 { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, },
270270 { 0 }
@@ -286,9 +286,8 @@ static const struct net_device_ops zorro8390_netdev_ops = { · 15 unmodified lines
286286 #endif
287287 };
288288
289−static int __devinit zorro8390_init(struct net_device *dev,
290− unsigned long board, const char *name,
291− unsigned long ioaddr)
289+static int zorro8390_init(struct net_device *dev, unsigned long board,
290+ const char *name, unsigned long ioaddr)
292291 {
293292 int i;
294293 int err;
@@ -396,8 +395,8 @@ static int __devinit zorro8390_init(struct net_device *dev, · 101 unmodified lines
396395 return 0;
397396 }
398397
399−static int __devinit zorro8390_init_one(struct zorro_dev *z,
400− const struct zorro_device_id *ent)
398+static int zorro8390_init_one(struct zorro_dev *z,
399+ const struct zorro_device_id *ent)
401400 {
402401 struct net_device *dev;
403402 unsigned long board, ioaddr;
@@ -432,7 +431,7 @@ static struct zorro_driver zorro8390_driver = { · 28 unmodified lines
432431 .name = "zorro8390",
433432 .id_table = zorro8390_zorro_tbl,
434433 .probe = zorro8390_init_one,
435− .remove = __devexit_p(zorro8390_remove_one),
434+ .remove = zorro8390_remove_one,
436435 };
437436
438437 static int __init zorro8390_init_module(void)
drivers/net/ethernet/adaptec/starfire.c+6−6
@@ -166,7 +166,7 @@ static int rx_copybreak /* = 0 */; · 165 unmodified lines
166166 #define FIRMWARE_TX "adaptec/starfire_tx.bin"
167167
168168 /* These identify the driver base version and may not be removed. */
169−static const char version[] __devinitconst =
169+static const char version[] =
170170 KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n"
171171 " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";
172172
@@ -295,7 +295,7 @@ MODULE_DEVICE_TABLE(pci, starfire_pci_tbl); · 122 unmodified lines
295295 static const struct chip_info {
296296 const char *name;
297297 int drv_flags;
298−} netdrv_tbl[] __devinitconst = {
298+} netdrv_tbl[] = {
299299 { "Adaptec Starfire 6915", CanHaveMII },
300300 };
301301
@@ -641,8 +641,8 @@ static const struct net_device_ops netdev_ops = { · 339 unmodified lines
641641 #endif
642642 };
643643
644−static int __devinit starfire_init_one(struct pci_dev *pdev,
645− const struct pci_device_id *ent)
644+static int starfire_init_one(struct pci_dev *pdev,
645+ const struct pci_device_id *ent)
646646 {
647647 struct device *d = &pdev->dev;
648648 struct netdev_private *np;
@@ -1990,7 +1990,7 @@ static int starfire_resume(struct pci_dev *pdev) · 1341 unmodified lines
19901990 #endif /* CONFIG_PM */
19911991
19921992
1993−static void __devexit starfire_remove_one (struct pci_dev *pdev)
1993+static void starfire_remove_one(struct pci_dev *pdev)
19941994 {
19951995 struct net_device *dev = pci_get_drvdata(pdev);
19961996 struct netdev_private *np = netdev_priv(dev);
@@ -2018,7 +2018,7 @@ static void __devexit starfire_remove_one (struct pci_dev *pdev) · 21 unmodified lines
20182018 static struct pci_driver starfire_driver = {
20192019 .name = DRV_NAME,
20202020 .probe = starfire_init_one,
2021− .remove = __devexit_p(starfire_remove_one),
2021+ .remove = starfire_remove_one,
20222022 #ifdef CONFIG_PM
20232023 .suspend = starfire_suspend,
20242024 .resume = starfire_resume,
drivers/net/ethernet/adi/Kconfig+1−1
@@ -61,7 +61,7 @@ config BFIN_RX_DESC_NUM · 60 unmodified lines
6161
6262 config BFIN_MAC_USE_HWSTAMP
6363 bool "Use IEEE 1588 hwstamp"
64− depends on BFIN_MAC && BF518
64+ select PTP_1588_CLOCK
6565 default y
6666 ---help---
6767 To support the IEEE 1588 Precision Time Protocol (PTP), select y here
drivers/net/ethernet/adi/bfin_mac.c+201−70
@@ -548,14 +548,17 @@ static int bfin_mac_ethtool_setwol(struct net_device *dev, · 547 unmodified lines
548548 return 0;
549549 }
550550
551+#ifdef CONFIG_BFIN_MAC_USE_HWSTAMP
551552 static int bfin_mac_ethtool_get_ts_info(struct net_device *dev,
552553 struct ethtool_ts_info *info)
553554 {
555+ struct bfin_mac_local *lp = netdev_priv(dev);
556+
554557 info->so_timestamping =
555558 SOF_TIMESTAMPING_TX_HARDWARE |
556559 SOF_TIMESTAMPING_RX_HARDWARE |
557− SOF_TIMESTAMPING_SYS_HARDWARE;
558− info->phc_index = -1;
560+ SOF_TIMESTAMPING_RAW_HARDWARE;
561+ info->phc_index = lp->phc_index;
559562 info->tx_types =
560563 (1 << HWTSTAMP_TX_OFF) |
561564 (1 << HWTSTAMP_TX_ON);
@@ -566,6 +569,7 @@ static int bfin_mac_ethtool_get_ts_info(struct net_device *dev, · 4 unmodified lines
566569 (1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT);
567570 return 0;
568571 }
572+#endif
569573
570574 static const struct ethtool_ops bfin_mac_ethtool_ops = {
571575 .get_settings = bfin_mac_ethtool_getsettings,
@@ -574,7 +578,9 @@ static const struct ethtool_ops bfin_mac_ethtool_ops = { · 2 unmodified lines
574578 .get_drvinfo = bfin_mac_ethtool_getdrvinfo,
575579 .get_wol = bfin_mac_ethtool_getwol,
576580 .set_wol = bfin_mac_ethtool_setwol,
581+#ifdef CONFIG_BFIN_MAC_USE_HWSTAMP
577582 .get_ts_info = bfin_mac_ethtool_get_ts_info,
583+#endif
578584 };
579585
580586 /**************************************************************************/
@@ -649,6 +655,20 @@ static int bfin_mac_set_mac_address(struct net_device *dev, void *p) · 68 unmodified lines
649655 #ifdef CONFIG_BFIN_MAC_USE_HWSTAMP
650656 #define bfin_mac_hwtstamp_is_none(cfg) ((cfg) == HWTSTAMP_FILTER_NONE)
651657
658+static u32 bfin_select_phc_clock(u32 input_clk, unsigned int *shift_result)
659+{
660+ u32 ipn = 1000000000UL / input_clk;
661+ u32 ppn = 1;
662+ unsigned int shift = 0;
663+
664+ while (ppn <= ipn) {
665+ ppn <<= 1;
666+ shift++;
667+ }
668+ *shift_result = shift;
669+ return 1000000000UL / ppn;
670+}
671+
652672 static int bfin_mac_hwtstamp_ioctl(struct net_device *netdev,
653673 struct ifreq *ifr, int cmd)
654674 {
@@ -798,19 +818,7 @@ static int bfin_mac_hwtstamp_ioctl(struct net_device *netdev, · 143 unmodified lines
798818 bfin_read_EMAC_PTP_TXSNAPLO();
799819 bfin_read_EMAC_PTP_TXSNAPHI();
800820
801− /*
802− * Set registers so that rollover occurs soon to test this.
803− */
804− bfin_write_EMAC_PTP_TIMELO(0x00000000);
805− bfin_write_EMAC_PTP_TIMEHI(0xFF800000);
806−
807821 SSYNC();
808−
809− lp->compare.last_update = 0;
810− timecounter_init(&lp->clock,
811− &lp->cycles,
812− ktime_to_ns(ktime_get_real()));
813− timecompare_update(&lp->compare, 0);
814822 }
815823
816824 lp->stamp_cfg = config;
@@ -818,15 +826,6 @@ static int bfin_mac_hwtstamp_ioctl(struct net_device *netdev, · 1 unmodified line
818826 -EFAULT : 0;
819827 }
820828
821−static void bfin_dump_hwtamp(char *s, ktime_t *hw, ktime_t *ts, struct timecompare *cmp)
822−{
823− ktime_t sys = ktime_get_real();
824−
825− pr_debug("%s %s hardware:%d,%d transform system:%d,%d system:%d,%d, cmp:%lld, %lld\n",
826− __func__, s, hw->tv.sec, hw->tv.nsec, ts->tv.sec, ts->tv.nsec, sys.tv.sec,
827− sys.tv.nsec, cmp->offset, cmp->skew);
828−}
829−
830829 static void bfin_tx_hwtstamp(struct net_device *netdev, struct sk_buff *skb)
831830 {
832831 struct bfin_mac_local *lp = netdev_priv(netdev);
@@ -857,15 +856,9 @@ static void bfin_tx_hwtstamp(struct net_device *netdev, struct sk_buff *skb) · 24 unmodified lines
857856 regval = bfin_read_EMAC_PTP_TXSNAPLO();
858857 regval |= (u64)bfin_read_EMAC_PTP_TXSNAPHI() << 32;
859858 memset(&shhwtstamps, 0, sizeof(shhwtstamps));
860− ns = timecounter_cyc2time(&lp->clock,
861− regval);
862− timecompare_update(&lp->compare, ns);
859+ ns = regval << lp->shift;
863860 shhwtstamps.hwtstamp = ns_to_ktime(ns);
864− shhwtstamps.syststamp =
865− timecompare_transform(&lp->compare, ns);
866861 skb_tstamp_tx(skb, &shhwtstamps);
867−
868− bfin_dump_hwtamp("TX", &shhwtstamps.hwtstamp, &shhwtstamps.syststamp, &lp->compare);
869862 }
870863 }
871864 }
@@ -888,55 +881,184 @@ static void bfin_rx_hwtstamp(struct net_device *netdev, struct sk_buff *skb) · 16 unmodified lines
888881
889882 regval = bfin_read_EMAC_PTP_RXSNAPLO();
890883 regval |= (u64)bfin_read_EMAC_PTP_RXSNAPHI() << 32;
891− ns = timecounter_cyc2time(&lp->clock, regval);
892− timecompare_update(&lp->compare, ns);
884+ ns = regval << lp->shift;
893885 memset(shhwtstamps, 0, sizeof(*shhwtstamps));
894886 shhwtstamps->hwtstamp = ns_to_ktime(ns);
895− shhwtstamps->syststamp = timecompare_transform(&lp->compare, ns);
887+}
888+
889+static void bfin_mac_hwtstamp_init(struct net_device *netdev)
890+{
891+ struct bfin_mac_local *lp = netdev_priv(netdev);
892+ u64 addend, ppb;
893+ u32 input_clk, phc_clk;
894+
895+ /* Initialize hardware timer */
896+ input_clk = get_sclk();
897+ phc_clk = bfin_select_phc_clock(input_clk, &lp->shift);
898+ addend = phc_clk * (1ULL << 32);
899+ do_div(addend, input_clk);
900+ bfin_write_EMAC_PTP_ADDEND((u32)addend);
901+
902+ lp->addend = addend;
903+ ppb = 1000000000ULL * input_clk;
904+ do_div(ppb, phc_clk);
905+ lp->max_ppb = ppb - 1000000000ULL - 1ULL;
896906
897− bfin_dump_hwtamp("RX", &shhwtstamps->hwtstamp, &shhwtstamps->syststamp, &lp->compare);
907+ /* Initialize hwstamp config */
908+ lp->stamp_cfg.rx_filter = HWTSTAMP_FILTER_NONE;
909+ lp->stamp_cfg.tx_type = HWTSTAMP_TX_OFF;
898910 }
899911
900−/*
901− * bfin_read_clock - read raw cycle counter (to be used by time counter)
902− */
903−static cycle_t bfin_read_clock(const struct cyclecounter *tc)
912+static u64 bfin_ptp_time_read(struct bfin_mac_local *lp)
904913 {
905− u64 stamp;
914+ u64 ns;
915+ u32 lo, hi;
916+
917+ lo = bfin_read_EMAC_PTP_TIMELO();
918+ hi = bfin_read_EMAC_PTP_TIMEHI();
906919
907− stamp = bfin_read_EMAC_PTP_TIMELO();
908− stamp |= (u64)bfin_read_EMAC_PTP_TIMEHI() << 32ULL;
920+ ns = ((u64) hi) << 32;
921+ ns |= lo;
922+ ns <<= lp->shift;
909923
910− return stamp;
924+ return ns;
911925 }
912926
913−#define PTP_CLK 25000000
927+static void bfin_ptp_time_write(struct bfin_mac_local *lp, u64 ns)
928+{
929+ u32 hi, lo;
914930
915−static void bfin_mac_hwtstamp_init(struct net_device *netdev)
931+ ns >>= lp->shift;
932+ hi = ns >> 32;
933+ lo = ns & 0xffffffff;
934+
935+ bfin_write_EMAC_PTP_TIMELO(lo);
936+ bfin_write_EMAC_PTP_TIMEHI(hi);
937+}
938+
939+/* PTP Hardware Clock operations */
940+
941+static int bfin_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb)
942+{
943+ u64 adj;
944+ u32 diff, addend;
945+ int neg_adj = 0;
946+ struct bfin_mac_local *lp =
947+ container_of(ptp, struct bfin_mac_local, caps);
948+
949+ if (ppb < 0) {
950+ neg_adj = 1;
951+ ppb = -ppb;
952+ }
953+ addend = lp->addend;
954+ adj = addend;
955+ adj *= ppb;
956+ diff = div_u64(adj, 1000000000ULL);
957+
958+ addend = neg_adj ? addend - diff : addend + diff;
959+
960+ bfin_write_EMAC_PTP_ADDEND(addend);
961+
962+ return 0;
963+}
964+
965+static int bfin_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)
966+{
967+ s64 now;
968+ unsigned long flags;
969+ struct bfin_mac_local *lp =
970+ container_of(ptp, struct bfin_mac_local, caps);
971+
972+ spin_lock_irqsave(&lp->phc_lock, flags);
973+
974+ now = bfin_ptp_time_read(lp);
975+ now += delta;
976+ bfin_ptp_time_write(lp, now);
977+
978+ spin_unlock_irqrestore(&lp->phc_lock, flags);
979+
980+ return 0;
981+}
982+
983+static int bfin_ptp_gettime(struct ptp_clock_info *ptp, struct timespec *ts)
984+{
985+ u64 ns;
986+ u32 remainder;
987+ unsigned long flags;
988+ struct bfin_mac_local *lp =
989+ container_of(ptp, struct bfin_mac_local, caps);
990+
991+ spin_lock_irqsave(&lp->phc_lock, flags);
992+
993+ ns = bfin_ptp_time_read(lp);
994+
995+ spin_unlock_irqrestore(&lp->phc_lock, flags);
996+
997+ ts->tv_sec = div_u64_rem(ns, 1000000000, &remainder);
998+ ts->tv_nsec = remainder;
999+ return 0;
1000+}
1001+
1002+static int bfin_ptp_settime(struct ptp_clock_info *ptp,
1003+ const struct timespec *ts)
1004+{
1005+ u64 ns;
1006+ unsigned long flags;
1007+ struct bfin_mac_local *lp =
1008+ container_of(ptp, struct bfin_mac_local, caps);
1009+
1010+ ns = ts->tv_sec * 1000000000ULL;
1011+ ns += ts->tv_nsec;
1012+
1013+ spin_lock_irqsave(&lp->phc_lock, flags);
1014+
1015+ bfin_ptp_time_write(lp, ns);
1016+
1017+ spin_unlock_irqrestore(&lp->phc_lock, flags);
1018+
1019+ return 0;
1020+}
1021+
1022+static int bfin_ptp_enable(struct ptp_clock_info *ptp,
1023+ struct ptp_clock_request *rq, int on)
1024+{
1025+ return -EOPNOTSUPP;
1026+}
1027+
1028+static struct ptp_clock_info bfin_ptp_caps = {
1029+ .owner = THIS_MODULE,
1030+ .name = "BF518 clock",
1031+ .max_adj = 0,
1032+ .n_alarm = 0,
1033+ .n_ext_ts = 0,
1034+ .n_per_out = 0,
1035+ .pps = 0,
1036+ .adjfreq = bfin_ptp_adjfreq,
1037+ .adjtime = bfin_ptp_adjtime,
1038+ .gettime = bfin_ptp_gettime,
1039+ .settime = bfin_ptp_settime,
1040+ .enable = bfin_ptp_enable,
1041+};
1042+
1043+static int bfin_phc_init(struct net_device *netdev, struct device *dev)
9161044 {
9171045 struct bfin_mac_local *lp = netdev_priv(netdev);
918− u64 append;
9191046
920− /* Initialize hardware timer */
921− append = PTP_CLK * (1ULL << 32);
922− do_div(append, get_sclk());
923− bfin_write_EMAC_PTP_ADDEND((u32)append);
924−
925− memset(&lp->cycles, 0, sizeof(lp->cycles));
926− lp->cycles.read = bfin_read_clock;
927− lp->cycles.mask = CLOCKSOURCE_MASK(64);
928− lp->cycles.mult = 1000000000 / PTP_CLK;
929− lp->cycles.shift = 0;
930−
931− /* Synchronize our NIC clock against system wall clock */
932− memset(&lp->compare, 0, sizeof(lp->compare));
933− lp->compare.source = &lp->clock;
934− lp->compare.target = ktime_get_real;
935− lp->compare.num_samples = 10;
1047+ lp->caps = bfin_ptp_caps;
1048+ lp->caps.max_adj = lp->max_ppb;
1049+ lp->clock = ptp_clock_register(&lp->caps, dev);
1050+ if (IS_ERR(lp->clock))
1051+ return PTR_ERR(lp->clock);
9361052
937− /* Initialize hwstamp config */
938− lp->stamp_cfg.rx_filter = HWTSTAMP_FILTER_NONE;
939− lp->stamp_cfg.tx_type = HWTSTAMP_TX_OFF;
1053+ lp->phc_index = ptp_clock_index(lp->clock);
1054+ spin_lock_init(&lp->phc_lock);
1055+
1056+ return 0;
1057+}
1058+
1059+static void bfin_phc_release(struct bfin_mac_local *lp)
1060+{
1061+ ptp_clock_unregister(lp->clock);
9401062 }
9411063
9421064 #else
@@ -945,6 +1067,8 @@ static void bfin_mac_hwtstamp_init(struct net_device *netdev) · 2 unmodified lines
9451067 # define bfin_mac_hwtstamp_ioctl(dev, ifr, cmd) (-EOPNOTSUPP)
9461068 # define bfin_rx_hwtstamp(dev, skb)
9471069 # define bfin_tx_hwtstamp(dev, skb)
1070+# define bfin_phc_init(netdev, dev) 0
1071+# define bfin_phc_release(lp)
9481072 #endif
9491073
9501074 static inline void _tx_reclaim_skb(void)
@@ -1479,7 +1603,7 @@ static const struct net_device_ops bfin_mac_netdev_ops = { · 528 unmodified lines
14791603 #endif
14801604 };
14811605
1482−static int __devinit bfin_mac_probe(struct platform_device *pdev)
1606+static int bfin_mac_probe(struct platform_device *pdev)
14831607 {
14841608 struct net_device *ndev;
14851609 struct bfin_mac_local *lp;
@@ -1579,12 +1703,17 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev) · 93 unmodified lines
15791703 }
15801704
15811705 bfin_mac_hwtstamp_init(ndev);
1706+ if (bfin_phc_init(ndev, &pdev->dev)) {
1707+ dev_err(&pdev->dev, "Cannot register PHC device!\n");
1708+ goto out_err_phc;
1709+ }
15821710
15831711 /* now, print out the card info, in a short format.. */
15841712 netdev_info(ndev, "%s, Version %s\n", DRV_DESC, DRV_VERSION);
15851713
15861714 return 0;
15871715
1716+out_err_phc:
15881717 out_err_reg_ndev:
15891718 free_irq(IRQ_MAC_RX, ndev);
15901719 out_err_request_irq:
@@ -1598,11 +1727,13 @@ out_err_probe_mac: · 7 unmodified lines
15981727 return rc;
15991728 }
16001729
1601−static int __devexit bfin_mac_remove(struct platform_device *pdev)
1730+static int bfin_mac_remove(struct platform_device *pdev)
16021731 {
16031732 struct net_device *ndev = platform_get_drvdata(pdev);
16041733 struct bfin_mac_local *lp = netdev_priv(ndev);
16051734
1735+ bfin_phc_release(lp);
1736+
16061737 platform_set_drvdata(pdev, NULL);
16071738
16081739 lp->mii_bus->priv = NULL;
@@ -1655,7 +1786,7 @@ static int bfin_mac_resume(struct platform_device *pdev) · 46 unmodified lines
16551786 #define bfin_mac_resume NULL
16561787 #endif /* CONFIG_PM */
16571788
1658−static int __devinit bfin_mii_bus_probe(struct platform_device *pdev)
1789+static int bfin_mii_bus_probe(struct platform_device *pdev)
16591790 {
16601791 struct mii_bus *miibus;
16611792 struct bfin_mii_bus_platform_data *mii_bus_pd;
@@ -1733,7 +1864,7 @@ out_err_alloc: · 71 unmodified lines
17331864 return rc;
17341865 }
17351866
1736−static int __devexit bfin_mii_bus_remove(struct platform_device *pdev)
1867+static int bfin_mii_bus_remove(struct platform_device *pdev)
17371868 {
17381869 struct mii_bus *miibus = platform_get_drvdata(pdev);
17391870 struct bfin_mii_bus_platform_data *mii_bus_pd =
@@ -1750,7 +1881,7 @@ static int __devexit bfin_mii_bus_remove(struct platform_device *pdev) · 10 unmodified lines
17501881
17511882 static struct platform_driver bfin_mii_bus_driver = {
17521883 .probe = bfin_mii_bus_probe,
1753− .remove = __devexit_p(bfin_mii_bus_remove),
1884+ .remove = bfin_mii_bus_remove,
17541885 .driver = {
17551886 .name = "bfin_mii_bus",
17561887 .owner = THIS_MODULE,
@@ -1759,7 +1890,7 @@ static struct platform_driver bfin_mii_bus_driver = { · 2 unmodified lines
17591890
17601891 static struct platform_driver bfin_mac_driver = {
17611892 .probe = bfin_mac_probe,
1762− .remove = __devexit_p(bfin_mac_remove),
1893+ .remove = bfin_mac_remove,
17631894 .resume = bfin_mac_resume,
17641895 .suspend = bfin_mac_suspend,
17651896 .driver = {
drivers/net/ethernet/adi/bfin_mac.h+8−5
@@ -11,8 +11,7 @@ · 10 unmodified lines
1111 #define _BFIN_MAC_H_
1212
1313 #include <linux/net_tstamp.h>
14−#include <linux/clocksource.h>
15−#include <linux/timecompare.h>
14+#include <linux/ptp_clock_kernel.h>
1615 #include <linux/timer.h>
1716 #include <linux/etherdevice.h>
1817 #include <linux/bfin_mac.h>
@@ -94,10 +93,14 @@ struct bfin_mac_local { · 75 unmodified lines
9493 struct mii_bus *mii_bus;
9594
9695 #if defined(CONFIG_BFIN_MAC_USE_HWSTAMP)
97− struct cyclecounter cycles;
98− struct timecounter clock;
99− struct timecompare compare;
96+ u32 addend;
97+ unsigned int shift;
98+ s32 max_ppb;
10099 struct hwtstamp_config stamp_cfg;
100+ struct ptp_clock_info caps;
101+ struct ptp_clock *clock;
102+ int phc_index;
103+ spinlock_t phc_lock; /* protects time lo/hi registers */
101104 #endif
102105 };
103106
drivers/net/ethernet/aeroflex/greth.c+3−3
@@ -1376,7 +1376,7 @@ error: · 1375 unmodified lines
13761376 }
13771377
13781378 /* Initialize the GRETH MAC */
1379−static int __devinit greth_of_probe(struct platform_device *ofdev)
1379+static int greth_of_probe(struct platform_device *ofdev)
13801380 {
13811381 struct net_device *dev;
13821382 struct greth_private *greth;
@@ -1576,7 +1576,7 @@ error1: · 193 unmodified lines
15761576 return err;
15771577 }
15781578
1579−static int __devexit greth_of_remove(struct platform_device *of_dev)
1579+static int greth_of_remove(struct platform_device *of_dev)
15801580 {
15811581 struct net_device *ndev = dev_get_drvdata(&of_dev->dev);
15821582 struct greth_private *greth = netdev_priv(ndev);
@@ -1619,7 +1619,7 @@ static struct platform_driver greth_of_driver = { · 36 unmodified lines
16191619 .of_match_table = greth_of_match,
16201620 },
16211621 .probe = greth_of_probe,
1622− .remove = __devexit_p(greth_of_remove),
1622+ .remove = greth_of_remove,
16231623 };
16241624
16251625 module_platform_driver(greth_of_driver);
drivers/net/ethernet/alteon/acenic.c+15−16
@@ -426,7 +426,7 @@ MODULE_PARM_DESC(max_rx_desc, "AceNIC/3C985/GA620 max number of receive descript · 425 unmodified lines
426426 MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/GA620 ratio of NIC memory used for TX/RX descriptors (range 0-63)");
427427
428428
429−static const char version[] __devinitconst =
429+static const char version[] =
430430 "acenic.c: v0.92 08/05/2002 Jes Sorensen, linux-acenic@SunSITE.dk\n"
431431 " http://home.cern.ch/~jes/gige/acenic.html\n";
432432
@@ -454,8 +454,8 @@ static const struct net_device_ops ace_netdev_ops = { · 21 unmodified lines
454454 .ndo_change_mtu = ace_change_mtu,
455455 };
456456
457−static int __devinit acenic_probe_one(struct pci_dev *pdev,
458− const struct pci_device_id *id)
457+static int acenic_probe_one(struct pci_dev *pdev,
458+ const struct pci_device_id *id)
459459 {
460460 struct net_device *dev;
461461 struct ace_private *ap;
@@ -603,7 +603,7 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev, · 141 unmodified lines
603603 return -ENODEV;
604604 }
605605
606−static void __devexit acenic_remove_one(struct pci_dev *pdev)
606+static void acenic_remove_one(struct pci_dev *pdev)
607607 {
608608 struct net_device *dev = pci_get_drvdata(pdev);
609609 struct ace_private *ap = netdev_priv(dev);
@@ -699,7 +699,7 @@ static struct pci_driver acenic_pci_driver = { · 89 unmodified lines
699699 .name = "acenic",
700700 .id_table = acenic_pci_tbl,
701701 .probe = acenic_probe_one,
702− .remove = __devexit_p(acenic_remove_one),
702+ .remove = acenic_remove_one,
703703 };
704704
705705 static int __init acenic_init(void)
@@ -871,7 +871,7 @@ static inline void ace_issue_cmd(struct ace_regs __iomem *regs, struct cmd *cmd) · 165 unmodified lines
871871 }
872872
873873
874−static int __devinit ace_init(struct net_device *dev)
874+static int ace_init(struct net_device *dev)
875875 {
876876 struct ace_private *ap;
877877 struct ace_regs __iomem *regs;
@@ -2824,8 +2824,8 @@ static struct net_device_stats *ace_get_stats(struct net_device *dev) · 1946 unmodified lines
28242824 }
28252825
28262826
2827−static void __devinit ace_copy(struct ace_regs __iomem *regs, const __be32 *src,
2828− u32 dest, int size)
2827+static void ace_copy(struct ace_regs __iomem *regs, const __be32 *src,
2828+ u32 dest, int size)
28292829 {
28302830 void __iomem *tdest;
28312831 short tsize, i;
@@ -2851,7 +2851,7 @@ static void __devinit ace_copy(struct ace_regs __iomem *regs, const __be32 *src, · 19 unmodified lines
28512851 }
28522852
28532853
2854−static void __devinit ace_clear(struct ace_regs __iomem *regs, u32 dest, int size)
2854+static void ace_clear(struct ace_regs __iomem *regs, u32 dest, int size)
28552855 {
28562856 void __iomem *tdest;
28572857 short tsize = 0, i;
@@ -2882,7 +2882,7 @@ static void __devinit ace_clear(struct ace_regs __iomem *regs, u32 dest, int siz · 24 unmodified lines
28822882 * This operation requires the NIC to be halted and is performed with
28832883 * interrupts disabled and with the spinlock hold.
28842884 */
2885−static int __devinit ace_load_firmware(struct net_device *dev)
2885+static int ace_load_firmware(struct net_device *dev)
28862886 {
28872887 const struct firmware *fw;
28882888 const char *fw_name = "acenic/tg2.bin";
@@ -2962,7 +2962,7 @@ static int __devinit ace_load_firmware(struct net_device *dev) · 73 unmodified lines
29622962 * Thanks to Stevarino Webinski for helping tracking down the bugs in the
29632963 * code i2c readout code by beta testing all my hacks.
29642964 */
2965−static void __devinit eeprom_start(struct ace_regs __iomem *regs)
2965+static void eeprom_start(struct ace_regs __iomem *regs)
29662966 {
29672967 u32 local;
29682968
@@ -2991,7 +2991,7 @@ static void __devinit eeprom_start(struct ace_regs __iomem *regs) · 22 unmodified lines
29912991 }
29922992
29932993
2994−static void __devinit eeprom_prep(struct ace_regs __iomem *regs, u8 magic)
2994+static void eeprom_prep(struct ace_regs __iomem *regs, u8 magic)
29952995 {
29962996 short i;
29972997 u32 local;
@@ -3028,7 +3028,7 @@ static void __devinit eeprom_prep(struct ace_regs __iomem *regs, u8 magic) · 30 unmodified lines
30283028 }
30293029
30303030
3031−static int __devinit eeprom_check_ack(struct ace_regs __iomem *regs)
3031+static int eeprom_check_ack(struct ace_regs __iomem *regs)
30323032 {
30333033 int state;
30343034 u32 local;
@@ -3056,7 +3056,7 @@ static int __devinit eeprom_check_ack(struct ace_regs __iomem *regs) · 21 unmodified lines
30563056 }
30573057
30583058
3059−static void __devinit eeprom_stop(struct ace_regs __iomem *regs)
3059+static void eeprom_stop(struct ace_regs __iomem *regs)
30603060 {
30613061 u32 local;
30623062
@@ -3091,8 +3091,7 @@ static void __devinit eeprom_stop(struct ace_regs __iomem *regs) · 28 unmodified lines
30913091 /*
30923092 * Read a whole byte from the EEPROM.
30933093 */
3094−static int __devinit read_eeprom_byte(struct net_device *dev,
3095− unsigned long offset)
3094+static int read_eeprom_byte(struct net_device *dev, unsigned long offset)
30963095 {
30973096 struct ace_private *ap = netdev_priv(dev);
30983097 struct ace_regs __iomem *regs = ap->regs;
drivers/net/ethernet/amd/a2065.c+8−8
@@ -639,12 +639,12 @@ static void lance_set_multicast(struct net_device *dev) · 638 unmodified lines
639639 netif_wake_queue(dev);
640640 }
641641
642−static int __devinit a2065_init_one(struct zorro_dev *z,
643− const struct zorro_device_id *ent);
644−static void __devexit a2065_remove_one(struct zorro_dev *z);
642+static int a2065_init_one(struct zorro_dev *z,
643+ const struct zorro_device_id *ent);
644+static void a2065_remove_one(struct zorro_dev *z);
645645
646646
647−static struct zorro_device_id a2065_zorro_tbl[] __devinitdata = {
647+static struct zorro_device_id a2065_zorro_tbl[] = {
648648 { ZORRO_PROD_CBM_A2065_1 },
649649 { ZORRO_PROD_CBM_A2065_2 },
650650 { ZORRO_PROD_AMERISTAR_A2065 },
@@ -656,7 +656,7 @@ static struct zorro_driver a2065_driver = { · 5 unmodified lines
656656 .name = "a2065",
657657 .id_table = a2065_zorro_tbl,
658658 .probe = a2065_init_one,
659− .remove = __devexit_p(a2065_remove_one),
659+ .remove = a2065_remove_one,
660660 };
661661
662662 static const struct net_device_ops lance_netdev_ops = {
@@ -670,8 +670,8 @@ static const struct net_device_ops lance_netdev_ops = { · 7 unmodified lines
670670 .ndo_set_mac_address = eth_mac_addr,
671671 };
672672
673−static int __devinit a2065_init_one(struct zorro_dev *z,
674− const struct zorro_device_id *ent)
673+static int a2065_init_one(struct zorro_dev *z,
674+ const struct zorro_device_id *ent)
675675 {
676676 struct net_device *dev;
677677 struct lance_private *priv;
@@ -754,7 +754,7 @@ static int __devinit a2065_init_one(struct zorro_dev *z, · 76 unmodified lines
754754 }
755755
756756
757−static void __devexit a2065_remove_one(struct zorro_dev *z)
757+static void a2065_remove_one(struct zorro_dev *z)
758758 {
759759 struct net_device *dev = zorro_get_drvdata(z);
760760
drivers/net/ethernet/amd/am79c961a.c+1−1
@@ -671,7 +671,7 @@ static const struct net_device_ops am79c961_netdev_ops = { · 670 unmodified lines
671671 #endif
672672 };
673673
674−static int __devinit am79c961_probe(struct platform_device *pdev)
674+static int am79c961_probe(struct platform_device *pdev)
675675 {
676676 struct resource *res;
677677 struct net_device *dev;
drivers/net/ethernet/amd/amd8111e.c+4−4
@@ -1702,7 +1702,7 @@ static int amd8111e_resume(struct pci_dev *pci_dev) · 1701 unmodified lines
17021702 }
17031703
17041704
1705−static void __devexit amd8111e_remove_one(struct pci_dev *pdev)
1705+static void amd8111e_remove_one(struct pci_dev *pdev)
17061706 {
17071707 struct net_device *dev = pci_get_drvdata(pdev);
17081708 if (dev) {
@@ -1774,7 +1774,7 @@ static void amd8111e_config_ipg(struct net_device* dev) · 65 unmodified lines
17741774
17751775 }
17761776
1777−static void __devinit amd8111e_probe_ext_phy(struct net_device* dev)
1777+static void amd8111e_probe_ext_phy(struct net_device *dev)
17781778 {
17791779 struct amd8111e_priv *lp = netdev_priv(dev);
17801780 int i;
@@ -1810,7 +1810,7 @@ static const struct net_device_ops amd8111e_netdev_ops = { · 29 unmodified lines
18101810 #endif
18111811 };
18121812
1813−static int __devinit amd8111e_probe_one(struct pci_dev *pdev,
1813+static int amd8111e_probe_one(struct pci_dev *pdev,
18141814 const struct pci_device_id *ent)
18151815 {
18161816 int err,i,pm_cap;
@@ -1976,7 +1976,7 @@ static struct pci_driver amd8111e_driver = { · 159 unmodified lines
19761976 .name = MODULE_NAME,
19771977 .id_table = amd8111e_pci_tbl,
19781978 .probe = amd8111e_probe_one,
1979− .remove = __devexit_p(amd8111e_remove_one),
1979+ .remove = amd8111e_remove_one,
19801980 .suspend = amd8111e_suspend,
19811981 .resume = amd8111e_resume
19821982 };
drivers/net/ethernet/amd/ariadne.c+5−5
@@ -682,7 +682,7 @@ static void set_multicast_list(struct net_device *dev) · 681 unmodified lines
682682 }
683683
684684
685−static void __devexit ariadne_remove_one(struct zorro_dev *z)
685+static void ariadne_remove_one(struct zorro_dev *z)
686686 {
687687 struct net_device *dev = zorro_get_drvdata(z);
688688
@@ -692,7 +692,7 @@ static void __devexit ariadne_remove_one(struct zorro_dev *z) · 3 unmodified lines
692692 free_netdev(dev);
693693 }
694694
695−static struct zorro_device_id ariadne_zorro_tbl[] __devinitdata = {
695+static struct zorro_device_id ariadne_zorro_tbl[] = {
696696 { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE },
697697 { 0 }
698698 };
@@ -710,8 +710,8 @@ static const struct net_device_ops ariadne_netdev_ops = { · 11 unmodified lines
710710 .ndo_set_mac_address = eth_mac_addr,
711711 };
712712
713−static int __devinit ariadne_init_one(struct zorro_dev *z,
714− const struct zorro_device_id *ent)
713+static int ariadne_init_one(struct zorro_dev *z,
714+ const struct zorro_device_id *ent)
715715 {
716716 unsigned long board = z->resource.start;
717717 unsigned long base_addr = board + ARIADNE_LANCE;
@@ -774,7 +774,7 @@ static struct zorro_driver ariadne_driver = { · 56 unmodified lines
774774 .name = "ariadne",
775775 .id_table = ariadne_zorro_tbl,
776776 .probe = ariadne_init_one,
777− .remove = __devexit_p(ariadne_remove_one),
777+ .remove = ariadne_remove_one,
778778 };
779779
780780 static int __init ariadne_init_module(void)
drivers/net/ethernet/amd/au1000_eth.c+3−3
@@ -1016,7 +1016,7 @@ static const struct net_device_ops au1000_netdev_ops = { · 1015 unmodified lines
10161016 .ndo_change_mtu = eth_change_mtu,
10171017 };
10181018
1019−static int __devinit au1000_probe(struct platform_device *pdev)
1019+static int au1000_probe(struct platform_device *pdev)
10201020 {
10211021 static unsigned version_printed;
10221022 struct au1000_private *aup = NULL;
@@ -1295,7 +1295,7 @@ out: · 272 unmodified lines
12951295 return err;
12961296 }
12971297
1298−static int __devexit au1000_remove(struct platform_device *pdev)
1298+static int au1000_remove(struct platform_device *pdev)
12991299 {
13001300 struct net_device *dev = platform_get_drvdata(pdev);
13011301 struct au1000_private *aup = netdev_priv(dev);
@@ -1340,7 +1340,7 @@ static int __devexit au1000_remove(struct platform_device *pdev) · 38 unmodified lines
13401340
13411341 static struct platform_driver au1000_eth_driver = {
13421342 .probe = au1000_probe,
1343− .remove = __devexit_p(au1000_remove),
1343+ .remove = au1000_remove,
13441344 .driver = {
13451345 .name = "au1000-eth",
13461346 .owner = THIS_MODULE,
drivers/net/ethernet/amd/declance.c+4−4
@@ -72,7 +72,7 @@ · 71 unmodified lines
7272 #include <asm/dec/machtype.h>
7373 #include <asm/dec/system.h>
7474
75−static char version[] __devinitdata =
75+static char version[] =
7676 "declance.c: v0.011 by Linux MIPS DECstation task force\n";
7777
7878 MODULE_AUTHOR("Linux MIPS DECstation task force");
@@ -1020,7 +1020,7 @@ static const struct net_device_ops lance_netdev_ops = { · 941 unmodified lines
10201020 .ndo_set_mac_address = eth_mac_addr,
10211021 };
10221022
1023−static int __devinit dec_lance_probe(struct device *bdev, const int type)
1023+static int dec_lance_probe(struct device *bdev, const int type)
10241024 {
10251025 static unsigned version_printed;
10261026 static const char fmt[] = "declance%d";
@@ -1322,7 +1322,7 @@ static void __exit dec_lance_platform_remove(void) · 295 unmodified lines
13221322 }
13231323
13241324 #ifdef CONFIG_TC
1325−static int __devinit dec_lance_tc_probe(struct device *dev);
1325+static int dec_lance_tc_probe(struct device *dev);
13261326 static int __exit dec_lance_tc_remove(struct device *dev);
13271327
13281328 static const struct tc_device_id dec_lance_tc_table[] = {
@@ -1341,7 +1341,7 @@ static struct tc_driver dec_lance_tc_driver = { · 12 unmodified lines
13411341 },
13421342 };
13431343
1344−static int __devinit dec_lance_tc_probe(struct device *dev)
1344+static int dec_lance_tc_probe(struct device *dev)
13451345 {
13461346 int status = dec_lance_probe(dev, PMAD_LANCE);
13471347 if (!status)
drivers/net/ethernet/amd/depca.c+5−5
@@ -338,21 +338,21 @@ static struct eisa_driver depca_eisa_driver = { · 337 unmodified lines
338338 .driver = {
339339 .name = depca_string,
340340 .probe = depca_eisa_probe,
341− .remove = __devexit_p (depca_device_remove)
341+ .remove = depca_device_remove
342342 }
343343 };
344344 #endif
345345
346346 static int depca_isa_probe (struct platform_device *);
347347
348−static int __devexit depca_isa_remove(struct platform_device *pdev)
348+static int depca_isa_remove(struct platform_device *pdev)
349349 {
350350 return depca_device_remove(&pdev->dev);
351351 }
352352
353353 static struct platform_driver depca_isa_driver = {
354354 .probe = depca_isa_probe,
355− .remove = __devexit_p(depca_isa_remove),
355+ .remove = depca_isa_remove,
356356 .driver = {
357357 .name = depca_string,
358358 },
@@ -1320,7 +1320,7 @@ static enum depca_type __init depca_shmem_probe (ulong *mem_start) · 961 unmodified lines
13201320 return adapter;
13211321 }
13221322
1323−static int __devinit depca_isa_probe (struct platform_device *device)
1323+static int depca_isa_probe(struct platform_device *device)
13241324 {
13251325 struct net_device *dev;
13261326 struct depca_private *lp;
@@ -1412,7 +1412,7 @@ static int __init depca_eisa_probe (struct device *device) · 85 unmodified lines
14121412 }
14131413 #endif
14141414
1415−static int __devexit depca_device_remove (struct device *device)
1415+static int depca_device_remove(struct device *device)
14161416 {
14171417 struct net_device *dev;
14181418 struct depca_private *lp;
drivers/net/ethernet/amd/hplance.c+7−10
@@ -46,11 +46,9 @@ struct hplance_private { · 45 unmodified lines
4646 * plus board-specific init, open and close actions.
4747 * Oh, and we need to tell the generic code how to read and write LANCE registers...
4848 */
49−static int __devinit hplance_init_one(struct dio_dev *d,
50− const struct dio_device_id *ent);
51−static void __devinit hplance_init(struct net_device *dev,
52− struct dio_dev *d);
53−static void __devexit hplance_remove_one(struct dio_dev *d);
49+static int hplance_init_one(struct dio_dev *d, const struct dio_device_id *ent);
50+static void hplance_init(struct net_device *dev, struct dio_dev *d);
51+static void hplance_remove_one(struct dio_dev *d);
5452 static void hplance_writerap(void *priv, unsigned short value);
5553 static void hplance_writerdp(void *priv, unsigned short value);
5654 static unsigned short hplance_readrdp(void *priv);
@@ -66,7 +64,7 @@ static struct dio_driver hplance_driver = { · 9 unmodified lines
6664 .name = "hplance",
6765 .id_table = hplance_dio_tbl,
6866 .probe = hplance_init_one,
69− .remove = __devexit_p(hplance_remove_one),
67+ .remove = hplance_remove_one,
7068 };
7169
7270 static const struct net_device_ops hplance_netdev_ops = {
@@ -83,8 +81,7 @@ static const struct net_device_ops hplance_netdev_ops = { · 10 unmodified lines
8381 };
8482
8583 /* Find all the HP Lance boards and initialise them... */
86−static int __devinit hplance_init_one(struct dio_dev *d,
87− const struct dio_device_id *ent)
84+static int hplance_init_one(struct dio_dev *d, const struct dio_device_id *ent)
8885 {
8986 struct net_device *dev;
9087 int err = -ENOMEM;
@@ -118,7 +115,7 @@ static int __devinit hplance_init_one(struct dio_dev *d, · 27 unmodified lines
118115 return err;
119116 }
120117
121−static void __devexit hplance_remove_one(struct dio_dev *d)
118+static void hplance_remove_one(struct dio_dev *d)
122119 {
123120 struct net_device *dev = dio_get_drvdata(d);
124121
@@ -128,7 +125,7 @@ static void __devexit hplance_remove_one(struct dio_dev *d) · 3 unmodified lines
128125 }
129126
130127 /* Initialise a single lance board at the given DIO device */
131−static void __devinit hplance_init(struct net_device *dev, struct dio_dev *d)
128+static void hplance_init(struct net_device *dev, struct dio_dev *d)
132129 {
133130 unsigned long va = (d->resource.start + DIO_VIRADDRBASE);
134131 struct hplance_private *lp;
drivers/net/ethernet/amd/pcnet32.c+5−5
@@ -1443,7 +1443,7 @@ static const struct ethtool_ops pcnet32_ethtool_ops = { · 1442 unmodified lines
14431443 /* only probes for non-PCI devices, the rest are handled by
14441444 * pci_register_driver via pcnet32_probe_pci */
14451445
1446−static void __devinit pcnet32_probe_vlbus(unsigned int *pcnet32_portlist)
1446+static void pcnet32_probe_vlbus(unsigned int *pcnet32_portlist)
14471447 {
14481448 unsigned int *port, ioaddr;
14491449
@@ -1462,7 +1462,7 @@ static void __devinit pcnet32_probe_vlbus(unsigned int *pcnet32_portlist) · 12 unmodified lines
14621462 }
14631463 }
14641464
1465−static int __devinit
1465+static int
14661466 pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
14671467 {
14681468 unsigned long ioaddr;
@@ -1521,7 +1521,7 @@ static const struct net_device_ops pcnet32_netdev_ops = { · 52 unmodified lines
15211521 * Called from both pcnet32_probe_vlbus and pcnet_probe_pci.
15221522 * pdev will be NULL when called from pcnet32_probe_vlbus.
15231523 */
1524−static int __devinit
1524+static int
15251525 pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
15261526 {
15271527 struct pcnet32_private *lp;
@@ -2823,7 +2823,7 @@ static int pcnet32_pm_resume(struct pci_dev *pdev) · 1295 unmodified lines
28232823 return 0;
28242824 }
28252825
2826−static void __devexit pcnet32_remove_one(struct pci_dev *pdev)
2826+static void pcnet32_remove_one(struct pci_dev *pdev)
28272827 {
28282828 struct net_device *dev = pci_get_drvdata(pdev);
28292829
@@ -2844,7 +2844,7 @@ static void __devexit pcnet32_remove_one(struct pci_dev *pdev) · 14 unmodified lines
28442844 static struct pci_driver pcnet32_driver = {
28452845 .name = DRV_NAME,
28462846 .probe = pcnet32_probe_pci,
2847− .remove = __devexit_p(pcnet32_remove_one),
2847+ .remove = pcnet32_remove_one,
28482848 .id_table = pcnet32_pci_tbl,
28492849 .suspend = pcnet32_pm_suspend,
28502850 .resume = pcnet32_pm_resume,
drivers/net/ethernet/amd/sunlance.c+6−6
@@ -1304,9 +1304,9 @@ static const struct net_device_ops sparc_lance_ops = { · 1303 unmodified lines
13041304 .ndo_validate_addr = eth_validate_addr,
13051305 };
13061306
1307−static int __devinit sparc_lance_probe_one(struct platform_device *op,
1308− struct platform_device *ledma,
1309− struct platform_device *lebuffer)
1307+static int sparc_lance_probe_one(struct platform_device *op,
1308+ struct platform_device *ledma,
1309+ struct platform_device *lebuffer)
13101310 {
13111311 struct device_node *dp = op->dev.of_node;
13121312 static unsigned version_printed;
@@ -1488,7 +1488,7 @@ fail: · 175 unmodified lines
14881488 return -ENODEV;
14891489 }
14901490
1491−static int __devinit sunlance_sbus_probe(struct platform_device *op)
1491+static int sunlance_sbus_probe(struct platform_device *op)
14921492 {
14931493 struct platform_device *parent = to_platform_device(op->dev.parent);
14941494 struct device_node *parent_dp = parent->dev.of_node;
@@ -1504,7 +1504,7 @@ static int __devinit sunlance_sbus_probe(struct platform_device *op) · 9 unmodified lines
15041504 return err;
15051505 }
15061506
1507−static int __devexit sunlance_sbus_remove(struct platform_device *op)
1507+static int sunlance_sbus_remove(struct platform_device *op)
15081508 {
15091509 struct lance_private *lp = dev_get_drvdata(&op->dev);
15101510 struct net_device *net_dev = lp->dev;
@@ -1536,7 +1536,7 @@ static struct platform_driver sunlance_sbus_driver = { · 25 unmodified lines
15361536 .of_match_table = sunlance_sbus_match,
15371537 },
15381538 .probe = sunlance_sbus_probe,
1539− .remove = __devexit_p(sunlance_sbus_remove),
1539+ .remove = sunlance_sbus_remove,
15401540 };
15411541
15421542 module_platform_driver(sunlance_sbus_driver);
drivers/net/ethernet/apple/bmac.c+2−2
@@ -1244,7 +1244,7 @@ static const struct net_device_ops bmac_netdev_ops = { · 1243 unmodified lines
12441244 .ndo_validate_addr = eth_validate_addr,
12451245 };
12461246
1247−static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_id *match)
1247+static int bmac_probe(struct macio_dev *mdev, const struct of_device_id *match)
12481248 {
12491249 int j, rev, ret;
12501250 struct bmac_data *bp;
@@ -1602,7 +1602,7 @@ bmac_proc_info(char *buffer, char **start, off_t offset, int length) · 351 unmodified lines
16021602 }
16031603 #endif
16041604
1605−static int __devexit bmac_remove(struct macio_dev *mdev)
1605+static int bmac_remove(struct macio_dev *mdev)
16061606 {
16071607 struct net_device *dev = macio_get_drvdata(mdev);
16081608 struct bmac_data *bp = netdev_priv(dev);
drivers/net/ethernet/apple/mace.c+2−2
@@ -106,7 +106,7 @@ static const struct net_device_ops mace_netdev_ops = { · 105 unmodified lines
106106 .ndo_validate_addr = eth_validate_addr,
107107 };
108108
109−static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_id *match)
109+static int mace_probe(struct macio_dev *mdev, const struct of_device_id *match)
110110 {
111111 struct device_node *mace = macio_get_of_node(mdev);
112112 struct net_device *dev;
@@ -271,7 +271,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i · 158 unmodified lines
271271 return rc;
272272 }
273273
274−static int __devexit mace_remove(struct macio_dev *mdev)
274+static int mace_remove(struct macio_dev *mdev)
275275 {
276276 struct net_device *dev = macio_get_drvdata(mdev);
277277 struct mace_data *mp;
drivers/net/ethernet/apple/macmace.c+3−3
@@ -195,7 +195,7 @@ static const struct net_device_ops mace_netdev_ops = { · 194 unmodified lines
195195 * model of Macintrash has a MACE (AV macintoshes)
196196 */
197197
198−static int __devinit mace_probe(struct platform_device *pdev)
198+static int mace_probe(struct platform_device *pdev)
199199 {
200200 int j;
201201 struct mace_data *mp;
@@ -746,7 +746,7 @@ MODULE_LICENSE("GPL"); · 544 unmodified lines
746746 MODULE_DESCRIPTION("Macintosh MACE ethernet driver");
747747 MODULE_ALIAS("platform:macmace");
748748
749−static int __devexit mac_mace_device_remove (struct platform_device *pdev)
749+static int mac_mace_device_remove(struct platform_device *pdev)
750750 {
751751 struct net_device *dev = platform_get_drvdata(pdev);
752752 struct mace_data *mp = netdev_priv(dev);
@@ -768,7 +768,7 @@ static int __devexit mac_mace_device_remove (struct platform_device *pdev) · 15 unmodified lines
768768
769769 static struct platform_driver mac_mace_driver = {
770770 .probe = mace_probe,
771− .remove = __devexit_p(mac_mace_device_remove),
771+ .remove = mac_mace_device_remove,
772772 .driver = {
773773 .name = mac_mace_string,
774774 .owner = THIS_MODULE,
drivers/net/ethernet/atheros/atl1c/atl1c_main.c+7−8
@@ -643,7 +643,7 @@ static int atl1c_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd) · 642 unmodified lines
643643 * @adapter: board private structure to initialize
644644 *
645645 */
646−static int __devinit atl1c_alloc_queues(struct atl1c_adapter *adapter)
646+static int atl1c_alloc_queues(struct atl1c_adapter *adapter)
647647 {
648648 return 0;
649649 }
@@ -702,7 +702,7 @@ struct atl1c_platform_patch { · 52 unmodified lines
702702 u32 patch_flag;
703703 #define ATL1C_LINK_PATCH 0x1
704704 };
705−static const struct atl1c_platform_patch plats[] __devinitconst = {
705+static const struct atl1c_platform_patch plats[] = {
706706 {0x2060, 0xC1, 0x1019, 0x8152, 0x1},
707707 {0x2060, 0xC1, 0x1019, 0x2060, 0x1},
708708 {0x2060, 0xC1, 0x1019, 0xE000, 0x1},
@@ -725,7 +725,7 @@ static const struct atl1c_platform_patch plats[] __devinitconst = { · 16 unmodified lines
725725 {0},
726726 };
727727
728−static void __devinit atl1c_patch_assign(struct atl1c_hw *hw)
728+static void atl1c_patch_assign(struct atl1c_hw *hw)
729729 {
730730 struct pci_dev *pdev = hw->adapter->pdev;
731731 u32 misc_ctrl;
@@ -764,7 +764,7 @@ static void __devinit atl1c_patch_assign(struct atl1c_hw *hw) · 32 unmodified lines
764764 * Fields are initialized based on PCI device information and
765765 * OS network device settings (MTU size).
766766 */
767−static int __devinit atl1c_sw_init(struct atl1c_adapter *adapter)
767+static int atl1c_sw_init(struct atl1c_adapter *adapter)
768768 {
769769 struct atl1c_hw *hw = &adapter->hw;
770770 struct pci_dev *pdev = adapter->pdev;
@@ -2442,8 +2442,7 @@ static int atl1c_init_netdev(struct net_device *netdev, struct pci_dev *pdev) · 1671 unmodified lines
24422442 * The OS initialization, configuring of the adapter private structure,
24432443 * and a hardware reset occur.
24442444 */
2445−static int __devinit atl1c_probe(struct pci_dev *pdev,
2446− const struct pci_device_id *ent)
2445+static int atl1c_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
24472446 {
24482447 struct net_device *netdev;
24492448 struct atl1c_adapter *adapter;
@@ -2587,7 +2586,7 @@ err_dma: · 137 unmodified lines
25872586 * Hot-Plug event, or because the driver is going to be removed from
25882587 * memory.
25892588 */
2590−static void __devexit atl1c_remove(struct pci_dev *pdev)
2589+static void atl1c_remove(struct pci_dev *pdev)
25912590 {
25922591 struct net_device *netdev = pci_get_drvdata(pdev);
25932592 struct atl1c_adapter *adapter = netdev_priv(netdev);
@@ -2697,7 +2696,7 @@ static struct pci_driver atl1c_driver = { · 103 unmodified lines
26972696 .name = atl1c_driver_name,
26982697 .id_table = atl1c_pci_tbl,
26992698 .probe = atl1c_probe,
2700− .remove = __devexit_p(atl1c_remove),
2699+ .remove = atl1c_remove,
27012700 .shutdown = atl1c_shutdown,
27022701 .err_handler = &atl1c_err_handler,
27032702 .driver.pm = &atl1c_pm_ops,
drivers/net/ethernet/atheros/atl1e/atl1e_main.c+5−6
@@ -534,7 +534,7 @@ static void atl1e_setup_pcicmd(struct pci_dev *pdev) · 533 unmodified lines
534534 * @adapter: board private structure to initialize
535535 *
536536 */
537−static int __devinit atl1e_alloc_queues(struct atl1e_adapter *adapter)
537+static int atl1e_alloc_queues(struct atl1e_adapter *adapter)
538538 {
539539 return 0;
540540 }
@@ -547,7 +547,7 @@ static int __devinit atl1e_alloc_queues(struct atl1e_adapter *adapter) · 6 unmodified lines
547547 * Fields are initialized based on PCI device information and
548548 * OS network device settings (MTU size).
549549 */
550−static int __devinit atl1e_sw_init(struct atl1e_adapter *adapter)
550+static int atl1e_sw_init(struct atl1e_adapter *adapter)
551551 {
552552 struct atl1e_hw *hw = &adapter->hw;
553553 struct pci_dev *pdev = adapter->pdev;
@@ -2235,8 +2235,7 @@ static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev) · 1681 unmodified lines
22352235 * The OS initialization, configuring of the adapter private structure,
22362236 * and a hardware reset occur.
22372237 */
2238−static int __devinit atl1e_probe(struct pci_dev *pdev,
2239− const struct pci_device_id *ent)
2238+static int atl1e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
22402239 {
22412240 struct net_device *netdev;
22422241 struct atl1e_adapter *adapter = NULL;
@@ -2387,7 +2386,7 @@ err_dma: · 144 unmodified lines
23872386 * Hot-Plug event, or because the driver is going to be removed from
23882387 * memory.
23892388 */
2390−static void __devexit atl1e_remove(struct pci_dev *pdev)
2389+static void atl1e_remove(struct pci_dev *pdev)
23912390 {
23922391 struct net_device *netdev = pci_get_drvdata(pdev);
23932392 struct atl1e_adapter *adapter = netdev_priv(netdev);
@@ -2499,7 +2498,7 @@ static struct pci_driver atl1e_driver = { · 105 unmodified lines
24992498 .name = atl1e_driver_name,
25002499 .id_table = atl1e_pci_tbl,
25012500 .probe = atl1e_probe,
2502− .remove = __devexit_p(atl1e_remove),
2501+ .remove = atl1e_remove,
25032502 /* Power Management Hooks */
25042503 #ifdef CONFIG_PM
25052504 .suspend = atl1e_suspend,
drivers/net/ethernet/atheros/atl1e/atl1e_param.c+4−3
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #define ATL1E_PARAM_INIT { [0 ... ATL1E_MAX_NIC] = OPTION_UNSET }
4141
4242 #define ATL1E_PARAM(x, desc) \
43− static int __devinitdata x[ATL1E_MAX_NIC + 1] = ATL1E_PARAM_INIT; \
43+ static int x[ATL1E_MAX_NIC + 1] = ATL1E_PARAM_INIT; \
4444 static unsigned int num_##x; \
4545 module_param_array_named(x, x, int, &num_##x, 0); \
4646 MODULE_PARM_DESC(x, desc);
@@ -116,7 +116,8 @@ struct atl1e_option { · 69 unmodified lines
116116 } arg;
117117 };
118118
119−static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, struct atl1e_adapter *adapter)
119+static int atl1e_validate_option(int *value, struct atl1e_option *opt,
120+ struct atl1e_adapter *adapter)
120121 {
121122 if (*value == OPTION_UNSET) {
122123 *value = opt->def;
@@ -177,7 +178,7 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, · 54 unmodified lines
177178 * value exists, a default value is used. The final value is stored
178179 * in a variable in the adapter structure.
179180 */
180−void __devinit atl1e_check_options(struct atl1e_adapter *adapter)
181+void atl1e_check_options(struct atl1e_adapter *adapter)
181182 {
182183 int bd = adapter->bd_number;
183184
drivers/net/ethernet/atheros/atlx/atl1.c+8−9
@@ -113,7 +113,7 @@ static const struct ethtool_ops atl1_ethtool_ops; · 112 unmodified lines
113113 *
114114 * Default Value: 100 (200us)
115115 */
116−static int __devinitdata int_mod_timer[ATL1_MAX_NIC+1] = ATL1_PARAM_INIT;
116+static int int_mod_timer[ATL1_MAX_NIC+1] = ATL1_PARAM_INIT;
117117 static unsigned int num_int_mod_timer;
118118 module_param_array_named(int_mod_timer, int_mod_timer, int,
119119 &num_int_mod_timer, 0);
@@ -143,8 +143,8 @@ struct atl1_option { · 23 unmodified lines
143143 } arg;
144144 };
145145
146−static int __devinit atl1_validate_option(int *value, struct atl1_option *opt,
147− struct pci_dev *pdev)
146+static int atl1_validate_option(int *value, struct atl1_option *opt,
147+ struct pci_dev *pdev)
148148 {
149149 if (*value == OPTION_UNSET) {
150150 *value = opt->def;
@@ -204,7 +204,7 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt, · 53 unmodified lines
204204 * value exists, a default value is used. The final value is stored
205205 * in a variable in the adapter structure.
206206 */
207−static void __devinit atl1_check_options(struct atl1_adapter *adapter)
207+static void atl1_check_options(struct atl1_adapter *adapter)
208208 {
209209 struct pci_dev *pdev = adapter->pdev;
210210 int bd = adapter->bd_number;
@@ -945,7 +945,7 @@ static void atl1_set_mac_addr(struct atl1_hw *hw) · 734 unmodified lines
945945 * Fields are initialized based on PCI device information and
946946 * OS network device settings (MTU size).
947947 */
948−static int __devinit atl1_sw_init(struct atl1_adapter *adapter)
948+static int atl1_sw_init(struct atl1_adapter *adapter)
949949 {
950950 struct atl1_hw *hw = &adapter->hw;
951951 struct net_device *netdev = adapter->netdev;
@@ -2934,8 +2934,7 @@ static const struct net_device_ops atl1_netdev_ops = { · 1982 unmodified lines
29342934 * The OS initialization, configuring of the adapter private structure,
29352935 * and a hardware reset occur.
29362936 */
2937−static int __devinit atl1_probe(struct pci_dev *pdev,
2938− const struct pci_device_id *ent)
2937+static int atl1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
29392938 {
29402939 struct net_device *netdev;
29412940 struct atl1_adapter *adapter;
@@ -3113,7 +3112,7 @@ err_request_regions: · 171 unmodified lines
31133112 * Hot-Plug event, or because the driver is going to be removed from
31143113 * memory.
31153114 */
3116−static void __devexit atl1_remove(struct pci_dev *pdev)
3115+static void atl1_remove(struct pci_dev *pdev)
31173116 {
31183117 struct net_device *netdev = pci_get_drvdata(pdev);
31193118 struct atl1_adapter *adapter;
@@ -3146,7 +3145,7 @@ static struct pci_driver atl1_driver = { · 26 unmodified lines
31463145 .name = ATLX_DRIVER_NAME,
31473146 .id_table = atl1_pci_tbl,
31483147 .probe = atl1_probe,
3149− .remove = __devexit_p(atl1_remove),
3148+ .remove = atl1_remove,
31503149 .shutdown = atl1_shutdown,
31513150 .driver.pm = ATL1_PM_OPS,
31523151 };
drivers/net/ethernet/atheros/atlx/atl2.c+8−9
@@ -83,7 +83,7 @@ static void atl2_check_options(struct atl2_adapter *adapter); · 82 unmodified lines
8383 * Fields are initialized based on PCI device information and
8484 * OS network device settings (MTU size).
8585 */
86−static int __devinit atl2_sw_init(struct atl2_adapter *adapter)
86+static int atl2_sw_init(struct atl2_adapter *adapter)
8787 {
8888 struct atl2_hw *hw = &adapter->hw;
8989 struct pci_dev *pdev = adapter->pdev;
@@ -1338,8 +1338,7 @@ static const struct net_device_ops atl2_netdev_ops = { · 1248 unmodified lines
13381338 * The OS initialization, configuring of the adapter private structure,
13391339 * and a hardware reset occur.
13401340 */
1341−static int __devinit atl2_probe(struct pci_dev *pdev,
1342− const struct pci_device_id *ent)
1341+static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
13431342 {
13441343 struct net_device *netdev;
13451344 struct atl2_adapter *adapter;
@@ -1498,7 +1497,7 @@ err_dma: · 152 unmodified lines
14981497 */
14991498 /* FIXME: write the original MAC address back in case it was changed from a
15001499 * BIOS-set value, as in atl1 -- CHS */
1501−static void __devexit atl2_remove(struct pci_dev *pdev)
1500+static void atl2_remove(struct pci_dev *pdev)
15021501 {
15031502 struct net_device *netdev = pci_get_drvdata(pdev);
15041503 struct atl2_adapter *adapter = netdev_priv(netdev);
@@ -1705,7 +1704,7 @@ static struct pci_driver atl2_driver = { · 200 unmodified lines
17051704 .name = atl2_driver_name,
17061705 .id_table = atl2_pci_tbl,
17071706 .probe = atl2_probe,
1708− .remove = __devexit_p(atl2_remove),
1707+ .remove = atl2_remove,
17091708 /* Power Management Hooks */
17101709 .suspend = atl2_suspend,
17111710 #ifdef CONFIG_PM
@@ -2845,12 +2844,12 @@ static void atl2_force_ps(struct atl2_hw *hw) · 1133 unmodified lines
28452844 */
28462845
28472846 #define ATL2_PARAM(X, desc) \
2848− static const int __devinitconst X[ATL2_MAX_NIC + 1] = ATL2_PARAM_INIT; \
2847+ static const int X[ATL2_MAX_NIC + 1] = ATL2_PARAM_INIT; \
28492848 MODULE_PARM(X, "1-" __MODULE_STRING(ATL2_MAX_NIC) "i"); \
28502849 MODULE_PARM_DESC(X, desc);
28512850 #else
28522851 #define ATL2_PARAM(X, desc) \
2853− static int __devinitdata X[ATL2_MAX_NIC+1] = ATL2_PARAM_INIT; \
2852+ static int X[ATL2_MAX_NIC+1] = ATL2_PARAM_INIT; \
28542853 static unsigned int num_##X; \
28552854 module_param_array_named(X, X, int, &num_##X, 0); \
28562855 MODULE_PARM_DESC(X, desc);
@@ -2934,7 +2933,7 @@ struct atl2_option { · 77 unmodified lines
29342933 } arg;
29352934 };
29362935
2937−static int __devinit atl2_validate_option(int *value, struct atl2_option *opt)
2936+static int atl2_validate_option(int *value, struct atl2_option *opt)
29382937 {
29392938 int i;
29402939 struct atl2_opt_list *ent;
@@ -2992,7 +2991,7 @@ static int __devinit atl2_validate_option(int *value, struct atl2_option *opt) · 51 unmodified lines
29922991 * value exists, a default value is used. The final value is stored
29932992 * in a variable in the adapter structure.
29942993 */
2995−static void __devinit atl2_check_options(struct atl2_adapter *adapter)
2994+static void atl2_check_options(struct atl2_adapter *adapter)
29962995 {
29972996 int val;
29982997 struct atl2_option opt;
drivers/net/ethernet/broadcom/Kconfig+1−0
@@ -102,6 +102,7 @@ config TIGON3 · 101 unmodified lines
102102 depends on PCI
103103 select PHYLIB
104104 select HWMON
105+ select PTP_1588_CLOCK
105106 ---help---
106107 This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
107108
drivers/net/ethernet/broadcom/b44.c+5−5
@@ -2083,7 +2083,7 @@ out: · 2082 unmodified lines
20832083 return err;
20842084 }
20852085
2086−static int __devinit b44_get_invariants(struct b44 *bp)
2086+static int b44_get_invariants(struct b44 *bp)
20872087 {
20882088 struct ssb_device *sdev = bp->sdev;
20892089 int err = 0;
@@ -2141,8 +2141,8 @@ static const struct net_device_ops b44_netdev_ops = { · 51 unmodified lines
21412141 #endif
21422142 };
21432143
2144−static int __devinit b44_init_one(struct ssb_device *sdev,
2145− const struct ssb_device_id *ent)
2144+static int b44_init_one(struct ssb_device *sdev,
2145+ const struct ssb_device_id *ent)
21462146 {
21472147 struct net_device *dev;
21482148 struct b44 *bp;
@@ -2249,7 +2249,7 @@ out: · 100 unmodified lines
22492249 return err;
22502250 }
22512251
2252−static void __devexit b44_remove_one(struct ssb_device *sdev)
2252+static void b44_remove_one(struct ssb_device *sdev)
22532253 {
22542254 struct net_device *dev = ssb_get_drvdata(sdev);
22552255
@@ -2340,7 +2340,7 @@ static struct ssb_driver b44_ssb_driver = { · 84 unmodified lines
23402340 .name = DRV_MODULE_NAME,
23412341 .id_table = b44_ssb_tbl,
23422342 .probe = b44_init_one,
2343− .remove = __devexit_p(b44_remove_one),
2343+ .remove = b44_remove_one,
23442344 .suspend = b44_suspend,
23452345 .resume = b44_resume,
23462346 };
drivers/net/ethernet/broadcom/bcm63xx_enet.c+6−6
@@ -1612,7 +1612,7 @@ static const struct net_device_ops bcm_enet_ops = { · 1611 unmodified lines
16121612 /*
16131613 * allocate netdevice, request register memory and register device.
16141614 */
1615−static int __devinit bcm_enet_probe(struct platform_device *pdev)
1615+static int bcm_enet_probe(struct platform_device *pdev)
16161616 {
16171617 struct bcm_enet_priv *priv;
16181618 struct net_device *dev;
@@ -1830,7 +1830,7 @@ out: · 211 unmodified lines
18301830 /*
18311831 * exit func, stops hardware and unregisters netdevice
18321832 */
1833−static int __devexit bcm_enet_remove(struct platform_device *pdev)
1833+static int bcm_enet_remove(struct platform_device *pdev)
18341834 {
18351835 struct bcm_enet_priv *priv;
18361836 struct net_device *dev;
@@ -1877,7 +1877,7 @@ static int __devexit bcm_enet_remove(struct platform_device *pdev) · 40 unmodified lines
18771877
18781878 struct platform_driver bcm63xx_enet_driver = {
18791879 .probe = bcm_enet_probe,
1880− .remove = __devexit_p(bcm_enet_remove),
1880+ .remove = bcm_enet_remove,
18811881 .driver = {
18821882 .name = "bcm63xx_enet",
18831883 .owner = THIS_MODULE,
@@ -1887,7 +1887,7 @@ struct platform_driver bcm63xx_enet_driver = { · 3 unmodified lines
18871887 /*
18881888 * reserve & remap memory space shared between all macs
18891889 */
1890−static int __devinit bcm_enet_shared_probe(struct platform_device *pdev)
1890+static int bcm_enet_shared_probe(struct platform_device *pdev)
18911891 {
18921892 struct resource *res;
18931893 unsigned int iomem_size;
@@ -1908,7 +1908,7 @@ static int __devinit bcm_enet_shared_probe(struct platform_device *pdev) · 14 unmodified lines
19081908 return 0;
19091909 }
19101910
1911−static int __devexit bcm_enet_shared_remove(struct platform_device *pdev)
1911+static int bcm_enet_shared_remove(struct platform_device *pdev)
19121912 {
19131913 struct resource *res;
19141914
@@ -1924,7 +1924,7 @@ static int __devexit bcm_enet_shared_remove(struct platform_device *pdev) · 9 unmodified lines
19241924 */
19251925 struct platform_driver bcm63xx_enet_shared_driver = {
19261926 .probe = bcm_enet_shared_probe,
1927− .remove = __devexit_p(bcm_enet_shared_remove),
1927+ .remove = bcm_enet_shared_remove,
19281928 .driver = {
19291929 .name = "bcm63xx_enet_shared",
19301930 .owner = THIS_MODULE,
drivers/net/ethernet/broadcom/bnx2.c+515−507
@@ -71,7 +71,7 @@ · 70 unmodified lines
7171 /* Time in jiffies before concluding the transmitter is hung. */
7272 #define TX_TIMEOUT (5*HZ)
7373
74−static char version[] __devinitdata =
74+static char version[] =
7575 "Broadcom NetXtreme II Gigabit Ethernet Driver " DRV_MODULE_NAME " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
7676
7777 MODULE_AUTHOR("Michael Chan <mchan@broadcom.com>");
@@ -106,7 +106,7 @@ typedef enum { · 28 unmodified lines
106106 /* indexed by board_t, above */
107107 static struct {
108108 char *name;
109−} board_info[] __devinitdata = {
109+} board_info[] = {
110110 { "Broadcom NetXtreme II BCM5706 1000Base-T" },
111111 { "HP NC370T Multifunction Gigabit Server Adapter" },
112112 { "HP NC370i Multifunction Gigabit Server Adapter" },
@@ -260,10 +260,10 @@ static inline u32 bnx2_tx_avail(struct bnx2 *bp, struct bnx2_tx_ring_info *txr) · 147 unmodified lines
260260 * needs to be skipped.
261261 */
262262 diff = txr->tx_prod - txr->tx_cons;
263− if (unlikely(diff >= TX_DESC_CNT)) {
263+ if (unlikely(diff >= BNX2_TX_DESC_CNT)) {
264264 diff &= 0xffff;
265− if (diff == TX_DESC_CNT)
266− diff = MAX_TX_DESC_CNT;
265+ if (diff == BNX2_TX_DESC_CNT)
266+ diff = BNX2_MAX_TX_DESC_CNT;
267267 }
268268 return bp->tx_ring_size - diff;
269269 }
@@ -274,8 +274,8 @@ bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset) · 4 unmodified lines
274274 u32 val;
275275
276276 spin_lock_bh(&bp->indirect_lock);
277− REG_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);
278− val = REG_RD(bp, BNX2_PCICFG_REG_WINDOW);
277+ BNX2_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);
278+ val = BNX2_RD(bp, BNX2_PCICFG_REG_WINDOW);
279279 spin_unlock_bh(&bp->indirect_lock);
280280 return val;
281281 }
@@ -284,8 +284,8 @@ static void · 2 unmodified lines
284284 bnx2_reg_wr_ind(struct bnx2 *bp, u32 offset, u32 val)
285285 {
286286 spin_lock_bh(&bp->indirect_lock);
287− REG_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);
288− REG_WR(bp, BNX2_PCICFG_REG_WINDOW, val);
287+ BNX2_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);
288+ BNX2_WR(bp, BNX2_PCICFG_REG_WINDOW, val);
289289 spin_unlock_bh(&bp->indirect_lock);
290290 }
291291
@@ -306,21 +306,21 @@ bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val) · 14 unmodified lines
306306 {
307307 offset += cid_addr;
308308 spin_lock_bh(&bp->indirect_lock);
309− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
309+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
310310 int i;
311311
312− REG_WR(bp, BNX2_CTX_CTX_DATA, val);
313− REG_WR(bp, BNX2_CTX_CTX_CTRL,
314− offset | BNX2_CTX_CTX_CTRL_WRITE_REQ);
312+ BNX2_WR(bp, BNX2_CTX_CTX_DATA, val);
313+ BNX2_WR(bp, BNX2_CTX_CTX_CTRL,
314+ offset | BNX2_CTX_CTX_CTRL_WRITE_REQ);
315315 for (i = 0; i < 5; i++) {
316− val = REG_RD(bp, BNX2_CTX_CTX_CTRL);
316+ val = BNX2_RD(bp, BNX2_CTX_CTX_CTRL);
317317 if ((val & BNX2_CTX_CTX_CTRL_WRITE_REQ) == 0)
318318 break;
319319 udelay(5);
320320 }
321321 } else {
322− REG_WR(bp, BNX2_CTX_DATA_ADR, offset);
323− REG_WR(bp, BNX2_CTX_DATA, val);
322+ BNX2_WR(bp, BNX2_CTX_DATA_ADR, offset);
323+ BNX2_WR(bp, BNX2_CTX_DATA, val);
324324 }
325325 spin_unlock_bh(&bp->indirect_lock);
326326 }
@@ -434,7 +434,6 @@ struct cnic_eth_dev *bnx2_cnic_probe(struct net_device *dev) · 107 unmodified lines
434434
435435 return cp;
436436 }
437−EXPORT_SYMBOL(bnx2_cnic_probe);
438437
439438 static void
440439 bnx2_cnic_stop(struct bnx2 *bp)
@@ -494,11 +493,11 @@ bnx2_read_phy(struct bnx2 *bp, u32 reg, u32 *val) · 53 unmodified lines
494493 int i, ret;
495494
496495 if (bp->phy_flags & BNX2_PHY_FLAG_INT_MODE_AUTO_POLLING) {
497− val1 = REG_RD(bp, BNX2_EMAC_MDIO_MODE);
496+ val1 = BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
498497 val1 &= ~BNX2_EMAC_MDIO_MODE_AUTO_POLL;
499498
500− REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
501− REG_RD(bp, BNX2_EMAC_MDIO_MODE);
499+ BNX2_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
500+ BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
502501
503502 udelay(40);
504503 }
@@ -506,16 +505,16 @@ bnx2_read_phy(struct bnx2 *bp, u32 reg, u32 *val) · 1 unmodified line
506505 val1 = (bp->phy_addr << 21) | (reg << 16) |
507506 BNX2_EMAC_MDIO_COMM_COMMAND_READ | BNX2_EMAC_MDIO_COMM_DISEXT |
508507 BNX2_EMAC_MDIO_COMM_START_BUSY;
509− REG_WR(bp, BNX2_EMAC_MDIO_COMM, val1);
508+ BNX2_WR(bp, BNX2_EMAC_MDIO_COMM, val1);
510509
511510 for (i = 0; i < 50; i++) {
512511 udelay(10);
513512
514− val1 = REG_RD(bp, BNX2_EMAC_MDIO_COMM);
513+ val1 = BNX2_RD(bp, BNX2_EMAC_MDIO_COMM);
515514 if (!(val1 & BNX2_EMAC_MDIO_COMM_START_BUSY)) {
516515 udelay(5);
517516
518− val1 = REG_RD(bp, BNX2_EMAC_MDIO_COMM);
517+ val1 = BNX2_RD(bp, BNX2_EMAC_MDIO_COMM);
519518 val1 &= BNX2_EMAC_MDIO_COMM_DATA;
520519
521520 break;
@@ -532,11 +531,11 @@ bnx2_read_phy(struct bnx2 *bp, u32 reg, u32 *val) · 10 unmodified lines
532531 }
533532
534533 if (bp->phy_flags & BNX2_PHY_FLAG_INT_MODE_AUTO_POLLING) {
535− val1 = REG_RD(bp, BNX2_EMAC_MDIO_MODE);
534+ val1 = BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
536535 val1 |= BNX2_EMAC_MDIO_MODE_AUTO_POLL;
537536
538− REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
539− REG_RD(bp, BNX2_EMAC_MDIO_MODE);
537+ BNX2_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
538+ BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
540539
541540 udelay(40);
542541 }
@@ -551,11 +550,11 @@ bnx2_write_phy(struct bnx2 *bp, u32 reg, u32 val) · 8 unmodified lines
551550 int i, ret;
552551
553552 if (bp->phy_flags & BNX2_PHY_FLAG_INT_MODE_AUTO_POLLING) {
554− val1 = REG_RD(bp, BNX2_EMAC_MDIO_MODE);
553+ val1 = BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
555554 val1 &= ~BNX2_EMAC_MDIO_MODE_AUTO_POLL;
556555
557− REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
558− REG_RD(bp, BNX2_EMAC_MDIO_MODE);
556+ BNX2_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
557+ BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
559558
560559 udelay(40);
561560 }
@@ -563,12 +562,12 @@ bnx2_write_phy(struct bnx2 *bp, u32 reg, u32 val) · 1 unmodified line
563562 val1 = (bp->phy_addr << 21) | (reg << 16) | val |
564563 BNX2_EMAC_MDIO_COMM_COMMAND_WRITE |
565564 BNX2_EMAC_MDIO_COMM_START_BUSY | BNX2_EMAC_MDIO_COMM_DISEXT;
566− REG_WR(bp, BNX2_EMAC_MDIO_COMM, val1);
565+ BNX2_WR(bp, BNX2_EMAC_MDIO_COMM, val1);
567566
568567 for (i = 0; i < 50; i++) {
569568 udelay(10);
570569
571− val1 = REG_RD(bp, BNX2_EMAC_MDIO_COMM);
570+ val1 = BNX2_RD(bp, BNX2_EMAC_MDIO_COMM);
572571 if (!(val1 & BNX2_EMAC_MDIO_COMM_START_BUSY)) {
573572 udelay(5);
574573 break;
@@ -581,11 +580,11 @@ bnx2_write_phy(struct bnx2 *bp, u32 reg, u32 val) · 6 unmodified lines
581580 ret = 0;
582581
583582 if (bp->phy_flags & BNX2_PHY_FLAG_INT_MODE_AUTO_POLLING) {
584− val1 = REG_RD(bp, BNX2_EMAC_MDIO_MODE);
583+ val1 = BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
585584 val1 |= BNX2_EMAC_MDIO_MODE_AUTO_POLL;
586585
587− REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
588− REG_RD(bp, BNX2_EMAC_MDIO_MODE);
586+ BNX2_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
587+ BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
589588
590589 udelay(40);
591590 }
@@ -601,10 +600,10 @@ bnx2_disable_int(struct bnx2 *bp) · 9 unmodified lines
601600
602601 for (i = 0; i < bp->irq_nvecs; i++) {
603602 bnapi = &bp->bnx2_napi[i];
604− REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
603+ BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
605604 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
606605 }
607− REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD);
606+ BNX2_RD(bp, BNX2_PCICFG_INT_ACK_CMD);
608607 }
609608
610609 static void
@@ -616,16 +615,16 @@ bnx2_enable_int(struct bnx2 *bp) · 5 unmodified lines
616615 for (i = 0; i < bp->irq_nvecs; i++) {
617616 bnapi = &bp->bnx2_napi[i];
618617
619− REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
620− BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
621− BNX2_PCICFG_INT_ACK_CMD_MASK_INT |
622− bnapi->last_status_idx);
618+ BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
619+ BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
620+ BNX2_PCICFG_INT_ACK_CMD_MASK_INT |
621+ bnapi->last_status_idx);
623622
624− REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
625− BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
626− bnapi->last_status_idx);
623+ BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
624+ BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
625+ bnapi->last_status_idx);
627626 }
628− REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW);
627+ BNX2_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW);
629628 }
630629
631630 static void
@@ -824,7 +823,7 @@ bnx2_free_mem(struct bnx2 *bp) · 192 unmodified lines
824823
825824 for (i = 0; i < bp->ctx_pages; i++) {
826825 if (bp->ctx_blk[i]) {
827− dma_free_coherent(&bp->pdev->dev, BCM_PAGE_SIZE,
826+ dma_free_coherent(&bp->pdev->dev, BNX2_PAGE_SIZE,
828827 bp->ctx_blk[i],
829828 bp->ctx_blk_mapping[i]);
830829 bp->ctx_blk[i] = NULL;
@@ -887,13 +886,13 @@ bnx2_alloc_mem(struct bnx2 *bp) · 56 unmodified lines
887886
888887 bp->stats_blk_mapping = bp->status_blk_mapping + status_blk_size;
889888
890− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
891− bp->ctx_pages = 0x2000 / BCM_PAGE_SIZE;
889+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
890+ bp->ctx_pages = 0x2000 / BNX2_PAGE_SIZE;
892891 if (bp->ctx_pages == 0)
893892 bp->ctx_pages = 1;
894893 for (i = 0; i < bp->ctx_pages; i++) {
895894 bp->ctx_blk[i] = dma_alloc_coherent(&bp->pdev->dev,
896− BCM_PAGE_SIZE,
895+ BNX2_PAGE_SIZE,
897896 &bp->ctx_blk_mapping[i],
898897 GFP_KERNEL);
899898 if (bp->ctx_blk[i] == NULL)
@@ -1034,7 +1033,7 @@ bnx2_resolve_flow_ctrl(struct bnx2 *bp) · 134 unmodified lines
10341033 }
10351034
10361035 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&
1037− (CHIP_NUM(bp) == CHIP_NUM_5708)) {
1036+ (BNX2_CHIP(bp) == BNX2_CHIP_5708)) {
10381037 u32 val;
10391038
10401039 bnx2_read_phy(bp, BCM5708S_1000X_STAT1, &val);
@@ -1294,14 +1293,14 @@ bnx2_set_mac_link(struct bnx2 *bp) · 253 unmodified lines
12941293 {
12951294 u32 val;
12961295
1297− REG_WR(bp, BNX2_EMAC_TX_LENGTHS, 0x2620);
1296+ BNX2_WR(bp, BNX2_EMAC_TX_LENGTHS, 0x2620);
12981297 if (bp->link_up && (bp->line_speed == SPEED_1000) &&
12991298 (bp->duplex == DUPLEX_HALF)) {
1300− REG_WR(bp, BNX2_EMAC_TX_LENGTHS, 0x26ff);
1299+ BNX2_WR(bp, BNX2_EMAC_TX_LENGTHS, 0x26ff);
13011300 }
13021301
13031302 /* Configure the EMAC mode register. */
1304− val = REG_RD(bp, BNX2_EMAC_MODE);
1303+ val = BNX2_RD(bp, BNX2_EMAC_MODE);
13051304
13061305 val &= ~(BNX2_EMAC_MODE_PORT | BNX2_EMAC_MODE_HALF_DUPLEX |
13071306 BNX2_EMAC_MODE_MAC_LOOP | BNX2_EMAC_MODE_FORCE_LINK |
@@ -1310,7 +1309,7 @@ bnx2_set_mac_link(struct bnx2 *bp) · 2 unmodified lines
13101309 if (bp->link_up) {
13111310 switch (bp->line_speed) {
13121311 case SPEED_10:
1313− if (CHIP_NUM(bp) != CHIP_NUM_5706) {
1312+ if (BNX2_CHIP(bp) != BNX2_CHIP_5706) {
13141313 val |= BNX2_EMAC_MODE_PORT_MII_10M;
13151314 break;
13161315 }
@@ -1333,25 +1332,25 @@ bnx2_set_mac_link(struct bnx2 *bp) · 16 unmodified lines
13331332 /* Set the MAC to operate in the appropriate duplex mode. */
13341333 if (bp->duplex == DUPLEX_HALF)
13351334 val |= BNX2_EMAC_MODE_HALF_DUPLEX;
1336− REG_WR(bp, BNX2_EMAC_MODE, val);
1335+ BNX2_WR(bp, BNX2_EMAC_MODE, val);
13371336
13381337 /* Enable/disable rx PAUSE. */
13391338 bp->rx_mode &= ~BNX2_EMAC_RX_MODE_FLOW_EN;
13401339
13411340 if (bp->flow_ctrl & FLOW_CTRL_RX)
13421341 bp->rx_mode |= BNX2_EMAC_RX_MODE_FLOW_EN;
1343− REG_WR(bp, BNX2_EMAC_RX_MODE, bp->rx_mode);
1342+ BNX2_WR(bp, BNX2_EMAC_RX_MODE, bp->rx_mode);
13441343
13451344 /* Enable/disable tx PAUSE. */
1346− val = REG_RD(bp, BNX2_EMAC_TX_MODE);
1345+ val = BNX2_RD(bp, BNX2_EMAC_TX_MODE);
13471346 val &= ~BNX2_EMAC_TX_MODE_FLOW_EN;
13481347
13491348 if (bp->flow_ctrl & FLOW_CTRL_TX)
13501349 val |= BNX2_EMAC_TX_MODE_FLOW_EN;
1351− REG_WR(bp, BNX2_EMAC_TX_MODE, val);
1350+ BNX2_WR(bp, BNX2_EMAC_TX_MODE, val);
13521351
13531352 /* Acknowledge the interrupt. */
1354− REG_WR(bp, BNX2_EMAC_STATUS, BNX2_EMAC_STATUS_LINK_CHANGE);
1353+ BNX2_WR(bp, BNX2_EMAC_STATUS, BNX2_EMAC_STATUS_LINK_CHANGE);
13551354
13561355 bnx2_init_all_rx_contexts(bp);
13571356 }
@@ -1360,7 +1359,7 @@ static void · 2 unmodified lines
13601359 bnx2_enable_bmsr1(struct bnx2 *bp)
13611360 {
13621361 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&
1363− (CHIP_NUM(bp) == CHIP_NUM_5709))
1362+ (BNX2_CHIP(bp) == BNX2_CHIP_5709))
13641363 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
13651364 MII_BNX2_BLK_ADDR_GP_STATUS);
13661365 }
@@ -1369,7 +1368,7 @@ static void · 2 unmodified lines
13691368 bnx2_disable_bmsr1(struct bnx2 *bp)
13701369 {
13711370 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&
1372− (CHIP_NUM(bp) == CHIP_NUM_5709))
1371+ (BNX2_CHIP(bp) == BNX2_CHIP_5709))
13731372 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
13741373 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
13751374 }
@@ -1386,7 +1385,7 @@ bnx2_test_and_enable_2g5(struct bnx2 *bp) · 10 unmodified lines
13861385 if (bp->autoneg & AUTONEG_SPEED)
13871386 bp->advertising |= ADVERTISED_2500baseX_Full;
13881387
1389− if (CHIP_NUM(bp) == CHIP_NUM_5709)
1388+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
13901389 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR, MII_BNX2_BLK_ADDR_OVER1G);
13911390
13921391 bnx2_read_phy(bp, bp->mii_up1, &up1);
@@ -1396,7 +1395,7 @@ bnx2_test_and_enable_2g5(struct bnx2 *bp) · 3 unmodified lines
13961395 ret = 0;
13971396 }
13981397
1399− if (CHIP_NUM(bp) == CHIP_NUM_5709)
1398+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
14001399 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
14011400 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
14021401
@@ -1412,7 +1411,7 @@ bnx2_test_and_disable_2g5(struct bnx2 *bp) · 9 unmodified lines
14121411 if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE))
14131412 return 0;
14141413
1415− if (CHIP_NUM(bp) == CHIP_NUM_5709)
1414+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
14161415 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR, MII_BNX2_BLK_ADDR_OVER1G);
14171416
14181417 bnx2_read_phy(bp, bp->mii_up1, &up1);
@@ -1422,7 +1421,7 @@ bnx2_test_and_disable_2g5(struct bnx2 *bp) · 3 unmodified lines
14221421 ret = 1;
14231422 }
14241423
1425− if (CHIP_NUM(bp) == CHIP_NUM_5709)
1424+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
14261425 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
14271426 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
14281427
@@ -1438,7 +1437,7 @@ bnx2_enable_forced_2g5(struct bnx2 *bp) · 9 unmodified lines
14381437 if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE))
14391438 return;
14401439
1441− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
1440+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
14421441 u32 val;
14431442
14441443 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
@@ -1454,7 +1453,7 @@ bnx2_enable_forced_2g5(struct bnx2 *bp) · 9 unmodified lines
14541453 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
14551454 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
14561455
1457− } else if (CHIP_NUM(bp) == CHIP_NUM_5708) {
1456+ } else if (BNX2_CHIP(bp) == BNX2_CHIP_5708) {
14581457 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
14591458 if (!err)
14601459 bmcr |= BCM5708S_BMCR_FORCE_2500;
@@ -1482,7 +1481,7 @@ bnx2_disable_forced_2g5(struct bnx2 *bp) · 21 unmodified lines
14821481 if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE))
14831482 return;
14841483
1485− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
1484+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
14861485 u32 val;
14871486
14881487 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
@@ -1496,7 +1495,7 @@ bnx2_disable_forced_2g5(struct bnx2 *bp) · 7 unmodified lines
14961495 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
14971496 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
14981497
1499− } else if (CHIP_NUM(bp) == CHIP_NUM_5708) {
1498+ } else if (BNX2_CHIP(bp) == BNX2_CHIP_5708) {
15001499 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
15011500 if (!err)
15021501 bmcr &= ~BCM5708S_BMCR_FORCE_2500;
@@ -1547,14 +1546,14 @@ bnx2_set_link(struct bnx2 *bp) · 44 unmodified lines
15471546 bnx2_disable_bmsr1(bp);
15481547
15491548 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&
1550− (CHIP_NUM(bp) == CHIP_NUM_5706)) {
1549+ (BNX2_CHIP(bp) == BNX2_CHIP_5706)) {
15511550 u32 val, an_dbg;
15521551
15531552 if (bp->phy_flags & BNX2_PHY_FLAG_FORCED_DOWN) {
15541553 bnx2_5706s_force_link_dn(bp, 0);
15551554 bp->phy_flags &= ~BNX2_PHY_FLAG_FORCED_DOWN;
15561555 }
1557− val = REG_RD(bp, BNX2_EMAC_STATUS);
1556+ val = BNX2_RD(bp, BNX2_EMAC_STATUS);
15581557
15591558 bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_AN_DBG);
15601559 bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &an_dbg);
@@ -1571,11 +1570,11 @@ bnx2_set_link(struct bnx2 *bp) · 10 unmodified lines
15711570 bp->link_up = 1;
15721571
15731572 if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {
1574− if (CHIP_NUM(bp) == CHIP_NUM_5706)
1573+ if (BNX2_CHIP(bp) == BNX2_CHIP_5706)
15751574 bnx2_5706s_linkup(bp);
1576− else if (CHIP_NUM(bp) == CHIP_NUM_5708)
1575+ else if (BNX2_CHIP(bp) == BNX2_CHIP_5708)
15771576 bnx2_5708s_linkup(bp);
1578− else if (CHIP_NUM(bp) == CHIP_NUM_5709)
1577+ else if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
15791578 bnx2_5709s_linkup(bp);
15801579 }
15811580 else {
@@ -1757,7 +1756,7 @@ __acquires(&bp->phy_lock) · 175 unmodified lines
17571756 new_bmcr = bmcr & ~BMCR_ANENABLE;
17581757 new_bmcr |= BMCR_SPEED1000;
17591758
1760− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
1759+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
17611760 if (bp->req_line_speed == SPEED_2500)
17621761 bnx2_enable_forced_2g5(bp);
17631762 else if (bp->req_line_speed == SPEED_1000) {
@@ -1765,7 +1764,7 @@ __acquires(&bp->phy_lock) · 1 unmodified line
17651764 new_bmcr &= ~0x2000;
17661765 }
17671766
1768− } else if (CHIP_NUM(bp) == CHIP_NUM_5708) {
1767+ } else if (BNX2_CHIP(bp) == BNX2_CHIP_5708) {
17691768 if (bp->req_line_speed == SPEED_2500)
17701769 new_bmcr |= BCM5708S_BMCR_FORCE_2500;
17711770 else
@@ -1942,8 +1941,8 @@ bnx2_send_heart_beat(struct bnx2 *bp) · 170 unmodified lines
19421941 spin_lock(&bp->indirect_lock);
19431942 msg = (u32) (++bp->fw_drv_pulse_wr_seq & BNX2_DRV_PULSE_SEQ_MASK);
19441943 addr = bp->shmem_base + BNX2_DRV_PULSE_MB;
1945− REG_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, addr);
1946− REG_WR(bp, BNX2_PCICFG_REG_WINDOW, msg);
1944+ BNX2_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, addr);
1945+ BNX2_WR(bp, BNX2_PCICFG_REG_WINDOW, msg);
19471946 spin_unlock(&bp->indirect_lock);
19481947 }
19491948
@@ -2230,9 +2229,9 @@ bnx2_init_5708s_phy(struct bnx2 *bp, int reset_phy) · 280 unmodified lines
22302229 bnx2_write_phy(bp, BCM5708S_UP1, val);
22312230 }
22322231
2233− if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||
2234− (CHIP_ID(bp) == CHIP_ID_5708_B0) ||
2235− (CHIP_ID(bp) == CHIP_ID_5708_B1)) {
2232+ if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_A0) ||
2233+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_B0) ||
2234+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_B1)) {
22362235 /* increase tx signal amplitude */
22372236 bnx2_write_phy(bp, BCM5708S_BLK_ADDR,
22382237 BCM5708S_BLK_ADDR_TX_MISC);
@@ -2268,8 +2267,8 @@ bnx2_init_5706s_phy(struct bnx2 *bp, int reset_phy) · 29 unmodified lines
22682267
22692268 bp->phy_flags &= ~BNX2_PHY_FLAG_PARALLEL_DETECT;
22702269
2271− if (CHIP_NUM(bp) == CHIP_NUM_5706)
2272− REG_WR(bp, BNX2_MISC_GP_HW_CTL0, 0x300);
2270+ if (BNX2_CHIP(bp) == BNX2_CHIP_5706)
2271+ BNX2_WR(bp, BNX2_MISC_GP_HW_CTL0, 0x300);
22732272
22742273 if (bp->dev->mtu > 1500) {
22752274 u32 val;
@@ -2368,7 +2367,7 @@ __acquires(&bp->phy_lock) · 92 unmodified lines
23682367 bp->mii_adv = MII_ADVERTISE;
23692368 bp->mii_lpa = MII_LPA;
23702369
2371− REG_WR(bp, BNX2_EMAC_ATTENTION_ENA, BNX2_EMAC_ATTENTION_ENA_LINK);
2370+ BNX2_WR(bp, BNX2_EMAC_ATTENTION_ENA, BNX2_EMAC_ATTENTION_ENA_LINK);
23722371
23732372 if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP)
23742373 goto setup_phy;
@@ -2379,11 +2378,11 @@ __acquires(&bp->phy_lock) · 4 unmodified lines
23792378 bp->phy_id |= val & 0xffff;
23802379
23812380 if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {
2382− if (CHIP_NUM(bp) == CHIP_NUM_5706)
2381+ if (BNX2_CHIP(bp) == BNX2_CHIP_5706)
23832382 rc = bnx2_init_5706s_phy(bp, reset_phy);
2384− else if (CHIP_NUM(bp) == CHIP_NUM_5708)
2383+ else if (BNX2_CHIP(bp) == BNX2_CHIP_5708)
23852384 rc = bnx2_init_5708s_phy(bp, reset_phy);
2386− else if (CHIP_NUM(bp) == CHIP_NUM_5709)
2385+ else if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
23872386 rc = bnx2_init_5709s_phy(bp, reset_phy);
23882387 }
23892388 else {
@@ -2402,10 +2401,10 @@ bnx2_set_mac_loopback(struct bnx2 *bp) · 12 unmodified lines
24022401 {
24032402 u32 mac_mode;
24042403
2405− mac_mode = REG_RD(bp, BNX2_EMAC_MODE);
2404+ mac_mode = BNX2_RD(bp, BNX2_EMAC_MODE);
24062405 mac_mode &= ~BNX2_EMAC_MODE_PORT;
24072406 mac_mode |= BNX2_EMAC_MODE_MAC_LOOP | BNX2_EMAC_MODE_FORCE_LINK;
2408− REG_WR(bp, BNX2_EMAC_MODE, mac_mode);
2407+ BNX2_WR(bp, BNX2_EMAC_MODE, mac_mode);
24092408 bp->link_up = 1;
24102409 return 0;
24112410 }
@@ -2431,13 +2430,13 @@ bnx2_set_phy_loopback(struct bnx2 *bp) · 19 unmodified lines
24312430 msleep(100);
24322431 }
24332432
2434− mac_mode = REG_RD(bp, BNX2_EMAC_MODE);
2433+ mac_mode = BNX2_RD(bp, BNX2_EMAC_MODE);
24352434 mac_mode &= ~(BNX2_EMAC_MODE_PORT | BNX2_EMAC_MODE_HALF_DUPLEX |
24362435 BNX2_EMAC_MODE_MAC_LOOP | BNX2_EMAC_MODE_FORCE_LINK |
24372436 BNX2_EMAC_MODE_25G_MODE);
24382437
24392438 mac_mode |= BNX2_EMAC_MODE_PORT_GMII;
2440− REG_WR(bp, BNX2_EMAC_MODE, mac_mode);
2439+ BNX2_WR(bp, BNX2_EMAC_MODE, mac_mode);
24412440 bp->link_up = 1;
24422441 return 0;
24432442 }
@@ -2449,7 +2448,7 @@ bnx2_dump_mcp_state(struct bnx2 *bp) · 5 unmodified lines
24492448 u32 mcp_p0, mcp_p1;
24502449
24512450 netdev_err(dev, "<--- start MCP states dump --->\n");
2452− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
2451+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
24532452 mcp_p0 = BNX2_MCP_STATE_P0;
24542453 mcp_p1 = BNX2_MCP_STATE_P1;
24552454 } else {
@@ -2538,10 +2537,10 @@ bnx2_init_5709_context(struct bnx2 *bp) · 82 unmodified lines
25382537 u32 val;
25392538
25402539 val = BNX2_CTX_COMMAND_ENABLED | BNX2_CTX_COMMAND_MEM_INIT | (1 << 12);
2541− val |= (BCM_PAGE_BITS - 8) << 16;
2542− REG_WR(bp, BNX2_CTX_COMMAND, val);
2540+ val |= (BNX2_PAGE_BITS - 8) << 16;
2541+ BNX2_WR(bp, BNX2_CTX_COMMAND, val);
25432542 for (i = 0; i < 10; i++) {
2544− val = REG_RD(bp, BNX2_CTX_COMMAND);
2543+ val = BNX2_RD(bp, BNX2_CTX_COMMAND);
25452544 if (!(val & BNX2_CTX_COMMAND_MEM_INIT))
25462545 break;
25472546 udelay(2);
@@ -2553,20 +2552,20 @@ bnx2_init_5709_context(struct bnx2 *bp) · 5 unmodified lines
25532552 int j;
25542553
25552554 if (bp->ctx_blk[i])
2556− memset(bp->ctx_blk[i], 0, BCM_PAGE_SIZE);
2555+ memset(bp->ctx_blk[i], 0, BNX2_PAGE_SIZE);
25572556 else
25582557 return -ENOMEM;
25592558
2560− REG_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA0,
2561− (bp->ctx_blk_mapping[i] & 0xffffffff) |
2562− BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID);
2563− REG_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA1,
2564− (u64) bp->ctx_blk_mapping[i] >> 32);
2565− REG_WR(bp, BNX2_CTX_HOST_PAGE_TBL_CTRL, i |
2566− BNX2_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ);
2559+ BNX2_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA0,
2560+ (bp->ctx_blk_mapping[i] & 0xffffffff) |
2561+ BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID);
2562+ BNX2_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA1,
2563+ (u64) bp->ctx_blk_mapping[i] >> 32);
2564+ BNX2_WR(bp, BNX2_CTX_HOST_PAGE_TBL_CTRL, i |
2565+ BNX2_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ);
25672566 for (j = 0; j < 10; j++) {
25682567
2569− val = REG_RD(bp, BNX2_CTX_HOST_PAGE_TBL_CTRL);
2568+ val = BNX2_RD(bp, BNX2_CTX_HOST_PAGE_TBL_CTRL);
25702569 if (!(val & BNX2_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ))
25712570 break;
25722571 udelay(5);
@@ -2591,7 +2590,7 @@ bnx2_init_context(struct bnx2 *bp) · 18 unmodified lines
25912590
25922591 vcid--;
25932592
2594− if (CHIP_ID(bp) == CHIP_ID_5706_A0) {
2593+ if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) {
25952594 u32 new_vcid;
25962595
25972596 vcid_addr = GET_PCID_ADDR(vcid);
@@ -2612,8 +2611,8 @@ bnx2_init_context(struct bnx2 *bp) · 14 unmodified lines
26122611 vcid_addr += (i << PHY_CTX_SHIFT);
26132612 pcid_addr += (i << PHY_CTX_SHIFT);
26142613
2615− REG_WR(bp, BNX2_CTX_VIRT_ADDR, vcid_addr);
2616− REG_WR(bp, BNX2_CTX_PAGE_TBL, pcid_addr);
2614+ BNX2_WR(bp, BNX2_CTX_VIRT_ADDR, vcid_addr);
2615+ BNX2_WR(bp, BNX2_CTX_PAGE_TBL, pcid_addr);
26172616
26182617 /* Zero out the context. */
26192618 for (offset = 0; offset < PHY_CTX_SIZE; offset += 4)
@@ -2633,7 +2632,7 @@ bnx2_alloc_bad_rbuf(struct bnx2 *bp) · 13 unmodified lines
26332632 if (good_mbuf == NULL)
26342633 return -ENOMEM;
26352634
2636− REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
2635+ BNX2_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
26372636 BNX2_MISC_ENABLE_SET_BITS_RX_MBUF_ENABLE);
26382637
26392638 good_mbuf_cnt = 0;
@@ -2678,21 +2677,21 @@ bnx2_set_mac_addr(struct bnx2 *bp, u8 *mac_addr, u32 pos) · 38 unmodified lines
26782677
26792678 val = (mac_addr[0] << 8) | mac_addr[1];
26802679
2681− REG_WR(bp, BNX2_EMAC_MAC_MATCH0 + (pos * 8), val);
2680+ BNX2_WR(bp, BNX2_EMAC_MAC_MATCH0 + (pos * 8), val);
26822681
26832682 val = (mac_addr[2] << 24) | (mac_addr[3] << 16) |
26842683 (mac_addr[4] << 8) | mac_addr[5];
26852684
2686− REG_WR(bp, BNX2_EMAC_MAC_MATCH1 + (pos * 8), val);
2685+ BNX2_WR(bp, BNX2_EMAC_MAC_MATCH1 + (pos * 8), val);
26872686 }
26882687
26892688 static inline int
26902689 bnx2_alloc_rx_page(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index, gfp_t gfp)
26912690 {
26922691 dma_addr_t mapping;
2693− struct sw_pg *rx_pg = &rxr->rx_pg_ring[index];
2694− struct rx_bd *rxbd =
2695− &rxr->rx_pg_desc_ring[RX_RING(index)][RX_IDX(index)];
2692+ struct bnx2_sw_pg *rx_pg = &rxr->rx_pg_ring[index];
2693+ struct bnx2_rx_bd *rxbd =
2694+ &rxr->rx_pg_desc_ring[BNX2_RX_RING(index)][BNX2_RX_IDX(index)];
26962695 struct page *page = alloc_page(gfp);
26972696
26982697 if (!page)
@@ -2714,7 +2713,7 @@ bnx2_alloc_rx_page(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index, gf · 15 unmodified lines
27142713 static void
27152714 bnx2_free_rx_page(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index)
27162715 {
2717− struct sw_pg *rx_pg = &rxr->rx_pg_ring[index];
2716+ struct bnx2_sw_pg *rx_pg = &rxr->rx_pg_ring[index];
27182717 struct page *page = rx_pg->page;
27192718
27202719 if (!page)
@@ -2731,9 +2730,10 @@ static inline int · 10 unmodified lines
27312730 bnx2_alloc_rx_data(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index, gfp_t gfp)
27322731 {
27332732 u8 *data;
2734− struct sw_bd *rx_buf = &rxr->rx_buf_ring[index];
2733+ struct bnx2_sw_bd *rx_buf = &rxr->rx_buf_ring[index];
27352734 dma_addr_t mapping;
2736− struct rx_bd *rxbd = &rxr->rx_desc_ring[RX_RING(index)][RX_IDX(index)];
2735+ struct bnx2_rx_bd *rxbd =
2736+ &rxr->rx_desc_ring[BNX2_RX_RING(index)][BNX2_RX_IDX(index)];
27372737
27382738 data = kmalloc(bp->rx_buf_size, gfp);
27392739 if (!data)
@@ -2770,9 +2770,9 @@ bnx2_phy_event_is_set(struct bnx2 *bp, struct bnx2_napi *bnapi, u32 event) · 30 unmodified lines
27702770 old_link_state = sblk->status_attn_bits_ack & event;
27712771 if (new_link_state != old_link_state) {
27722772 if (new_link_state)
2773− REG_WR(bp, BNX2_PCICFG_STATUS_BIT_SET_CMD, event);
2773+ BNX2_WR(bp, BNX2_PCICFG_STATUS_BIT_SET_CMD, event);
27742774 else
2775− REG_WR(bp, BNX2_PCICFG_STATUS_BIT_CLEAR_CMD, event);
2775+ BNX2_WR(bp, BNX2_PCICFG_STATUS_BIT_CLEAR_CMD, event);
27762776 } else
27772777 is_set = 0;
27782778
@@ -2802,7 +2802,7 @@ bnx2_get_hw_tx_cons(struct bnx2_napi *bnapi) · 23 unmodified lines
28022802 barrier();
28032803 cons = *bnapi->hw_tx_cons_ptr;
28042804 barrier();
2805− if (unlikely((cons & MAX_TX_DESC_CNT) == MAX_TX_DESC_CNT))
2805+ if (unlikely((cons & BNX2_MAX_TX_DESC_CNT) == BNX2_MAX_TX_DESC_CNT))
28062806 cons++;
28072807 return cons;
28082808 }
@@ -2823,11 +2823,11 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 14 unmodified lines
28232823 sw_cons = txr->tx_cons;
28242824
28252825 while (sw_cons != hw_cons) {
2826− struct sw_tx_bd *tx_buf;
2826+ struct bnx2_sw_tx_bd *tx_buf;
28272827 struct sk_buff *skb;
28282828 int i, last;
28292829
2830− sw_ring_cons = TX_RING_IDX(sw_cons);
2830+ sw_ring_cons = BNX2_TX_RING_IDX(sw_cons);
28312831
28322832 tx_buf = &txr->tx_buf_ring[sw_ring_cons];
28332833 skb = tx_buf->skb;
@@ -2841,7 +2841,7 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 7 unmodified lines
28412841
28422842 last_idx = sw_cons + tx_buf->nr_frags + 1;
28432843 last_ring_idx = sw_ring_cons + tx_buf->nr_frags + 1;
2844− if (unlikely(last_ring_idx >= MAX_TX_DESC_CNT)) {
2844+ if (unlikely(last_ring_idx >= BNX2_MAX_TX_DESC_CNT)) {
28452845 last_idx++;
28462846 }
28472847 if (((s16) ((s16) last_idx - (s16) hw_cons)) > 0) {
@@ -2856,17 +2856,18 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 8 unmodified lines
28562856 last = tx_buf->nr_frags;
28572857
28582858 for (i = 0; i < last; i++) {
2859− sw_cons = NEXT_TX_BD(sw_cons);
2859+ struct bnx2_sw_tx_bd *tx_buf;
28602860
2861+ sw_cons = BNX2_NEXT_TX_BD(sw_cons);
2862+
2863+ tx_buf = &txr->tx_buf_ring[BNX2_TX_RING_IDX(sw_cons)];
28612864 dma_unmap_page(&bp->pdev->dev,
2862− dma_unmap_addr(
2863− &txr->tx_buf_ring[TX_RING_IDX(sw_cons)],
2864− mapping),
2865+ dma_unmap_addr(tx_buf, mapping),
28652866 skb_frag_size(&skb_shinfo(skb)->frags[i]),
28662867 PCI_DMA_TODEVICE);
28672868 }
28682869
2869− sw_cons = NEXT_TX_BD(sw_cons);
2870+ sw_cons = BNX2_NEXT_TX_BD(sw_cons);
28702871
28712872 tx_bytes += skb->len;
28722873 dev_kfree_skb(skb);
@@ -2905,8 +2906,8 @@ static void · 32 unmodified lines
29052906 bnx2_reuse_rx_skb_pages(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr,
29062907 struct sk_buff *skb, int count)
29072908 {
2908− struct sw_pg *cons_rx_pg, *prod_rx_pg;
2909− struct rx_bd *cons_bd, *prod_bd;
2909+ struct bnx2_sw_pg *cons_rx_pg, *prod_rx_pg;
2910+ struct bnx2_rx_bd *cons_bd, *prod_bd;
29102911 int i;
29112912 u16 hw_prod, prod;
29122913 u16 cons = rxr->rx_pg_cons;
@@ -2933,12 +2934,14 @@ bnx2_reuse_rx_skb_pages(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, · 20 unmodified lines
29332934 hw_prod = rxr->rx_pg_prod;
29342935
29352936 for (i = 0; i < count; i++) {
2936− prod = RX_PG_RING_IDX(hw_prod);
2937+ prod = BNX2_RX_PG_RING_IDX(hw_prod);
29372938
29382939 prod_rx_pg = &rxr->rx_pg_ring[prod];
29392940 cons_rx_pg = &rxr->rx_pg_ring[cons];
2940− cons_bd = &rxr->rx_pg_desc_ring[RX_RING(cons)][RX_IDX(cons)];
2941− prod_bd = &rxr->rx_pg_desc_ring[RX_RING(prod)][RX_IDX(prod)];
2941+ cons_bd = &rxr->rx_pg_desc_ring[BNX2_RX_RING(cons)]
2942+ [BNX2_RX_IDX(cons)];
2943+ prod_bd = &rxr->rx_pg_desc_ring[BNX2_RX_RING(prod)]
2944+ [BNX2_RX_IDX(prod)];
29422945
29432946 if (prod != cons) {
29442947 prod_rx_pg->page = cons_rx_pg->page;
@@ -2950,8 +2953,8 @@ bnx2_reuse_rx_skb_pages(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, · 5 unmodified lines
29502953 prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo;
29512954
29522955 }
2953− cons = RX_PG_RING_IDX(NEXT_RX_BD(cons));
2954− hw_prod = NEXT_RX_BD(hw_prod);
2956+ cons = BNX2_RX_PG_RING_IDX(BNX2_NEXT_RX_BD(cons));
2957+ hw_prod = BNX2_NEXT_RX_BD(hw_prod);
29552958 }
29562959 rxr->rx_pg_prod = hw_prod;
29572960 rxr->rx_pg_cons = cons;
@@ -2961,8 +2964,8 @@ static inline void · 3 unmodified lines
29612964 bnx2_reuse_rx_data(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr,
29622965 u8 *data, u16 cons, u16 prod)
29632966 {
2964− struct sw_bd *cons_rx_buf, *prod_rx_buf;
2965− struct rx_bd *cons_bd, *prod_bd;
2967+ struct bnx2_sw_bd *cons_rx_buf, *prod_rx_buf;
2968+ struct bnx2_rx_bd *cons_bd, *prod_bd;
29662969
29672970 cons_rx_buf = &rxr->rx_buf_ring[cons];
29682971 prod_rx_buf = &rxr->rx_buf_ring[prod];
@@ -2981,8 +2984,8 @@ bnx2_reuse_rx_data(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, · 12 unmodified lines
29812984 dma_unmap_addr_set(prod_rx_buf, mapping,
29822985 dma_unmap_addr(cons_rx_buf, mapping));
29832986
2984− cons_bd = &rxr->rx_desc_ring[RX_RING(cons)][RX_IDX(cons)];
2985− prod_bd = &rxr->rx_desc_ring[RX_RING(prod)][RX_IDX(prod)];
2987+ cons_bd = &rxr->rx_desc_ring[BNX2_RX_RING(cons)][BNX2_RX_IDX(cons)];
2988+ prod_bd = &rxr->rx_desc_ring[BNX2_RX_RING(prod)][BNX2_RX_IDX(prod)];
29862989 prod_bd->rx_bd_haddr_hi = cons_bd->rx_bd_haddr_hi;
29872990 prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo;
29882991 }
@@ -3022,7 +3025,7 @@ error: · 33 unmodified lines
30223025 return skb;
30233026 } else {
30243027 unsigned int i, frag_len, frag_size, pages;
3025− struct sw_pg *rx_pg;
3028+ struct bnx2_sw_pg *rx_pg;
30263029 u16 pg_cons = rxr->rx_pg_cons;
30273030 u16 pg_prod = rxr->rx_pg_prod;
30283031
@@ -3065,7 +3068,7 @@ error: · 36 unmodified lines
30653068 rx_pg->page = NULL;
30663069
30673070 err = bnx2_alloc_rx_page(bp, rxr,
3068− RX_PG_RING_IDX(pg_prod),
3071+ BNX2_RX_PG_RING_IDX(pg_prod),
30693072 GFP_ATOMIC);
30703073 if (unlikely(err)) {
30713074 rxr->rx_pg_cons = pg_cons;
@@ -3083,8 +3086,8 @@ error: · 11 unmodified lines
30833086 skb->truesize += PAGE_SIZE;
30843087 skb->len += frag_len;
30853088
3086− pg_prod = NEXT_RX_BD(pg_prod);
3087− pg_cons = RX_PG_RING_IDX(NEXT_RX_BD(pg_cons));
3089+ pg_prod = BNX2_NEXT_RX_BD(pg_prod);
3090+ pg_cons = BNX2_RX_PG_RING_IDX(BNX2_NEXT_RX_BD(pg_cons));
30883091 }
30893092 rxr->rx_pg_prod = pg_prod;
30903093 rxr->rx_pg_cons = pg_cons;
@@ -3101,7 +3104,7 @@ bnx2_get_hw_rx_cons(struct bnx2_napi *bnapi) · 10 unmodified lines
31013104 barrier();
31023105 cons = *bnapi->hw_rx_cons_ptr;
31033106 barrier();
3104− if (unlikely((cons & MAX_RX_DESC_CNT) == MAX_RX_DESC_CNT))
3107+ if (unlikely((cons & BNX2_MAX_RX_DESC_CNT) == BNX2_MAX_RX_DESC_CNT))
31053108 cons++;
31063109 return cons;
31073110 }
@@ -3125,13 +3128,14 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 17 unmodified lines
31253128 while (sw_cons != hw_cons) {
31263129 unsigned int len, hdr_len;
31273130 u32 status;
3128− struct sw_bd *rx_buf, *next_rx_buf;
3131+ struct bnx2_sw_bd *rx_buf, *next_rx_buf;
31293132 struct sk_buff *skb;
31303133 dma_addr_t dma_addr;
31313134 u8 *data;
3135+ u16 next_ring_idx;
31323136
3133− sw_ring_cons = RX_RING_IDX(sw_cons);
3134− sw_ring_prod = RX_RING_IDX(sw_prod);
3137+ sw_ring_cons = BNX2_RX_RING_IDX(sw_cons);
3138+ sw_ring_prod = BNX2_RX_RING_IDX(sw_prod);
31353139
31363140 rx_buf = &rxr->rx_buf_ring[sw_ring_cons];
31373141 data = rx_buf->data;
@@ -3146,8 +3150,8 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 8 unmodified lines
31463150 BNX2_RX_OFFSET + BNX2_RX_COPY_THRESH,
31473151 PCI_DMA_FROMDEVICE);
31483152
3149− next_rx_buf =
3150− &rxr->rx_buf_ring[RX_RING_IDX(NEXT_RX_BD(sw_cons))];
3153+ next_ring_idx = BNX2_RX_RING_IDX(BNX2_NEXT_RX_BD(sw_cons));
3154+ next_rx_buf = &rxr->rx_buf_ring[next_ring_idx];
31513155 prefetch(get_l2_fhdr(next_rx_buf->data));
31523156
31533157 len = rx_hdr->l2_fhdr_pkt_len;
@@ -3239,8 +3243,8 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 85 unmodified lines
32393243 rx_pkt++;
32403244
32413245 next_rx:
3242− sw_cons = NEXT_RX_BD(sw_cons);
3243− sw_prod = NEXT_RX_BD(sw_prod);
3246+ sw_cons = BNX2_NEXT_RX_BD(sw_cons);
3247+ sw_prod = BNX2_NEXT_RX_BD(sw_prod);
32443248
32453249 if ((rx_pkt == budget))
32463250 break;
@@ -3255,11 +3259,11 @@ next_rx: · 8 unmodified lines
32553259 rxr->rx_prod = sw_prod;
32563260
32573261 if (pg_ring_used)
3258− REG_WR16(bp, rxr->rx_pg_bidx_addr, rxr->rx_pg_prod);
3262+ BNX2_WR16(bp, rxr->rx_pg_bidx_addr, rxr->rx_pg_prod);
32593263
3260− REG_WR16(bp, rxr->rx_bidx_addr, sw_prod);
3264+ BNX2_WR16(bp, rxr->rx_bidx_addr, sw_prod);
32613265
3262− REG_WR(bp, rxr->rx_bseq_addr, rxr->rx_prod_bseq);
3266+ BNX2_WR(bp, rxr->rx_bseq_addr, rxr->rx_prod_bseq);
32633267
32643268 mmiowb();
32653269
@@ -3277,7 +3281,7 @@ bnx2_msi(int irq, void *dev_instance) · 11 unmodified lines
32773281 struct bnx2 *bp = bnapi->bp;
32783282
32793283 prefetch(bnapi->status_blk.msi);
3280− REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3284+ BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
32813285 BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |
32823286 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
32833287
@@ -3321,18 +3325,18 @@ bnx2_interrupt(int irq, void *dev_instance) · 37 unmodified lines
33213325 * the status block write.
33223326 */
33233327 if ((sblk->status_idx == bnapi->last_status_idx) &&
3324− (REG_RD(bp, BNX2_PCICFG_MISC_STATUS) &
3328+ (BNX2_RD(bp, BNX2_PCICFG_MISC_STATUS) &
33253329 BNX2_PCICFG_MISC_STATUS_INTA_VALUE))
33263330 return IRQ_NONE;
33273331
3328− REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3332+ BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
33293333 BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |
33303334 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
33313335
33323336 /* Read back to deassert IRQ immediately to avoid too many
33333337 * spurious interrupts.
33343338 */
3335− REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD);
3339+ BNX2_RD(bp, BNX2_PCICFG_INT_ACK_CMD);
33363340
33373341 /* Return here if interrupt is shared and is disabled. */
33383342 if (unlikely(atomic_read(&bp->intr_sem) != 0))
@@ -3388,14 +3392,14 @@ bnx2_chk_missed_msi(struct bnx2 *bp) · 49 unmodified lines
33883392 u32 msi_ctrl;
33893393
33903394 if (bnx2_has_work(bnapi)) {
3391− msi_ctrl = REG_RD(bp, BNX2_PCICFG_MSI_CONTROL);
3395+ msi_ctrl = BNX2_RD(bp, BNX2_PCICFG_MSI_CONTROL);
33923396 if (!(msi_ctrl & BNX2_PCICFG_MSI_CONTROL_ENABLE))
33933397 return;
33943398
33953399 if (bnapi->last_status_idx == bp->idle_chk_status_idx) {
3396− REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl &
3397− ~BNX2_PCICFG_MSI_CONTROL_ENABLE);
3398− REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl);
3400+ BNX2_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl &
3401+ ~BNX2_PCICFG_MSI_CONTROL_ENABLE);
3402+ BNX2_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl);
33993403 bnx2_msi(bp->irq_tbl[0].vector, bnapi);
34003404 }
34013405 }
@@ -3434,9 +3438,9 @@ static void bnx2_poll_link(struct bnx2 *bp, struct bnx2_napi *bnapi) · 32 unmodified lines
34343438 /* This is needed to take care of transient status
34353439 * during link changes.
34363440 */
3437− REG_WR(bp, BNX2_HC_COMMAND,
3438− bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
3439− REG_RD(bp, BNX2_HC_COMMAND);
3441+ BNX2_WR(bp, BNX2_HC_COMMAND,
3442+ bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
3443+ BNX2_RD(bp, BNX2_HC_COMMAND);
34403444 }
34413445 }
34423446
@@ -3473,9 +3477,9 @@ static int bnx2_poll_msix(struct napi_struct *napi, int budget) · 30 unmodified lines
34733477 if (likely(!bnx2_has_fast_work(bnapi))) {
34743478
34753479 napi_complete(napi);
3476− REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
3477− BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3478− bnapi->last_status_idx);
3480+ BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
3481+ BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3482+ bnapi->last_status_idx);
34793483 break;
34803484 }
34813485 }
@@ -3511,19 +3515,19 @@ static int bnx2_poll(struct napi_struct *napi, int budget) · 29 unmodified lines
35113515 if (likely(!bnx2_has_work(bnapi))) {
35123516 napi_complete(napi);
35133517 if (likely(bp->flags & BNX2_FLAG_USING_MSI_OR_MSIX)) {
3514− REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3515− BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3516− bnapi->last_status_idx);
3518+ BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3519+ BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3520+ bnapi->last_status_idx);
35173521 break;
35183522 }
3519− REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3520− BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3521− BNX2_PCICFG_INT_ACK_CMD_MASK_INT |
3522− bnapi->last_status_idx);
3523−
3524− REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3525− BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3526− bnapi->last_status_idx);
3523+ BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3524+ BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3525+ BNX2_PCICFG_INT_ACK_CMD_MASK_INT |
3526+ bnapi->last_status_idx);
3527+
3528+ BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3529+ BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3530+ bnapi->last_status_idx);
35273531 break;
35283532 }
35293533 }
@@ -3561,8 +3565,8 @@ bnx2_set_rx_mode(struct net_device *dev) · 31 unmodified lines
35613565 }
35623566 else if (dev->flags & IFF_ALLMULTI) {
35633567 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {
3564− REG_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
3565− 0xffffffff);
3568+ BNX2_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
3569+ 0xffffffff);
35663570 }
35673571 sort_mode |= BNX2_RPM_SORT_USER0_MC_EN;
35683572 }
@@ -3584,8 +3588,8 @@ bnx2_set_rx_mode(struct net_device *dev) · 15 unmodified lines
35843588 }
35853589
35863590 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {
3587− REG_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
3588− mc_filter[i]);
3591+ BNX2_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
3592+ mc_filter[i]);
35893593 }
35903594
35913595 sort_mode |= BNX2_RPM_SORT_USER0_MC_HSH_EN;
@@ -3610,12 +3614,12 @@ bnx2_set_rx_mode(struct net_device *dev) · 18 unmodified lines
36103614
36113615 if (rx_mode != bp->rx_mode) {
36123616 bp->rx_mode = rx_mode;
3613− REG_WR(bp, BNX2_EMAC_RX_MODE, rx_mode);
3617+ BNX2_WR(bp, BNX2_EMAC_RX_MODE, rx_mode);
36143618 }
36153619
3616− REG_WR(bp, BNX2_RPM_SORT_USER0, 0x0);
3617− REG_WR(bp, BNX2_RPM_SORT_USER0, sort_mode);
3618− REG_WR(bp, BNX2_RPM_SORT_USER0, sort_mode | BNX2_RPM_SORT_USER0_ENA);
3620+ BNX2_WR(bp, BNX2_RPM_SORT_USER0, 0x0);
3621+ BNX2_WR(bp, BNX2_RPM_SORT_USER0, sort_mode);
3622+ BNX2_WR(bp, BNX2_RPM_SORT_USER0, sort_mode | BNX2_RPM_SORT_USER0_ENA);
36193623
36203624 spin_unlock_bh(&bp->phy_lock);
36213625 }
@@ -3663,10 +3667,10 @@ static int bnx2_request_uncached_firmware(struct bnx2 *bp) · 41 unmodified lines
36633667 const struct bnx2_rv2p_fw_file *rv2p_fw;
36643668 int rc;
36653669
3666− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
3670+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
36673671 mips_fw_file = FW_MIPS_FILE_09;
3668− if ((CHIP_ID(bp) == CHIP_ID_5709_A0) ||
3669− (CHIP_ID(bp) == CHIP_ID_5709_A1))
3672+ if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5709_A0) ||
3673+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5709_A1))
36703674 rv2p_fw_file = FW_RV2P_FILE_09_Ax;
36713675 else
36723676 rv2p_fw_file = FW_RV2P_FILE_09;
@@ -3756,13 +3760,13 @@ load_rv2p_fw(struct bnx2 *bp, u32 rv2p_proc, · 83 unmodified lines
37563760 }
37573761
37583762 for (i = 0; i < rv2p_code_len; i += 8) {
3759− REG_WR(bp, BNX2_RV2P_INSTR_HIGH, be32_to_cpu(*rv2p_code));
3763+ BNX2_WR(bp, BNX2_RV2P_INSTR_HIGH, be32_to_cpu(*rv2p_code));
37603764 rv2p_code++;
3761− REG_WR(bp, BNX2_RV2P_INSTR_LOW, be32_to_cpu(*rv2p_code));
3765+ BNX2_WR(bp, BNX2_RV2P_INSTR_LOW, be32_to_cpu(*rv2p_code));
37623766 rv2p_code++;
37633767
37643768 val = (i / 8) | cmd;
3765− REG_WR(bp, addr, val);
3769+ BNX2_WR(bp, addr, val);
37663770 }
37673771
37683772 rv2p_code = (__be32 *)(bp->rv2p_firmware->data + file_offset);
@@ -3772,22 +3776,22 @@ load_rv2p_fw(struct bnx2 *bp, u32 rv2p_proc, · 3 unmodified lines
37723776 loc = be32_to_cpu(fw_entry->fixup[i]);
37733777 if (loc && ((loc * 4) < rv2p_code_len)) {
37743778 code = be32_to_cpu(*(rv2p_code + loc - 1));
3775− REG_WR(bp, BNX2_RV2P_INSTR_HIGH, code);
3779+ BNX2_WR(bp, BNX2_RV2P_INSTR_HIGH, code);
37763780 code = be32_to_cpu(*(rv2p_code + loc));
37773781 code = rv2p_fw_fixup(rv2p_proc, i, loc, code);
3778− REG_WR(bp, BNX2_RV2P_INSTR_LOW, code);
3782+ BNX2_WR(bp, BNX2_RV2P_INSTR_LOW, code);
37793783
37803784 val = (loc / 2) | cmd;
3781− REG_WR(bp, addr, val);
3785+ BNX2_WR(bp, addr, val);
37823786 }
37833787 }
37843788
37853789 /* Reset the processor, un-stall is done later. */
37863790 if (rv2p_proc == RV2P_PROC1) {
3787− REG_WR(bp, BNX2_RV2P_COMMAND, BNX2_RV2P_COMMAND_PROC1_RESET);
3791+ BNX2_WR(bp, BNX2_RV2P_COMMAND, BNX2_RV2P_COMMAND_PROC1_RESET);
37883792 }
37893793 else {
3790− REG_WR(bp, BNX2_RV2P_COMMAND, BNX2_RV2P_COMMAND_PROC2_RESET);
3794+ BNX2_WR(bp, BNX2_RV2P_COMMAND, BNX2_RV2P_COMMAND_PROC2_RESET);
37913795 }
37923796
37933797 return 0;
@@ -3924,14 +3928,14 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state) · 130 unmodified lines
39243928 /* delay required during transition out of D3hot */
39253929 msleep(20);
39263930
3927− val = REG_RD(bp, BNX2_EMAC_MODE);
3931+ val = BNX2_RD(bp, BNX2_EMAC_MODE);
39283932 val |= BNX2_EMAC_MODE_MPKT_RCVD | BNX2_EMAC_MODE_ACPI_RCVD;
39293933 val &= ~BNX2_EMAC_MODE_MPKT;
3930− REG_WR(bp, BNX2_EMAC_MODE, val);
3934+ BNX2_WR(bp, BNX2_EMAC_MODE, val);
39313935
3932− val = REG_RD(bp, BNX2_RPM_CONFIG);
3936+ val = BNX2_RD(bp, BNX2_RPM_CONFIG);
39333937 val &= ~BNX2_RPM_CONFIG_ACPI_ENA;
3934− REG_WR(bp, BNX2_RPM_CONFIG, val);
3938+ BNX2_WR(bp, BNX2_RPM_CONFIG, val);
39353939 break;
39363940 }
39373941 case PCI_D3hot: {
@@ -3963,7 +3967,7 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state) · 25 unmodified lines
39633967
39643968 bnx2_set_mac_addr(bp, bp->dev->dev_addr, 0);
39653969
3966− val = REG_RD(bp, BNX2_EMAC_MODE);
3970+ val = BNX2_RD(bp, BNX2_EMAC_MODE);
39673971
39683972 /* Enable port mode. */
39693973 val &= ~BNX2_EMAC_MODE_PORT;
@@ -3978,32 +3982,32 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state) · 8 unmodified lines
39783982 val |= BNX2_EMAC_MODE_25G_MODE;
39793983 }
39803984
3981− REG_WR(bp, BNX2_EMAC_MODE, val);
3985+ BNX2_WR(bp, BNX2_EMAC_MODE, val);
39823986
39833987 /* receive all multicast */
39843988 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {
3985− REG_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
3986− 0xffffffff);
3989+ BNX2_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
3990+ 0xffffffff);
39873991 }
3988− REG_WR(bp, BNX2_EMAC_RX_MODE,
3989− BNX2_EMAC_RX_MODE_SORT_MODE);
3992+ BNX2_WR(bp, BNX2_EMAC_RX_MODE,
3993+ BNX2_EMAC_RX_MODE_SORT_MODE);
39903994
39913995 val = 1 | BNX2_RPM_SORT_USER0_BC_EN |
39923996 BNX2_RPM_SORT_USER0_MC_EN;
3993− REG_WR(bp, BNX2_RPM_SORT_USER0, 0x0);
3994− REG_WR(bp, BNX2_RPM_SORT_USER0, val);
3995− REG_WR(bp, BNX2_RPM_SORT_USER0, val |
3996− BNX2_RPM_SORT_USER0_ENA);
3997+ BNX2_WR(bp, BNX2_RPM_SORT_USER0, 0x0);
3998+ BNX2_WR(bp, BNX2_RPM_SORT_USER0, val);
3999+ BNX2_WR(bp, BNX2_RPM_SORT_USER0, val |
4000+ BNX2_RPM_SORT_USER0_ENA);
39974001
39984002 /* Need to enable EMAC and RPM for WOL. */
3999− REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
4000− BNX2_MISC_ENABLE_SET_BITS_RX_PARSER_MAC_ENABLE |
4001− BNX2_MISC_ENABLE_SET_BITS_TX_HEADER_Q_ENABLE |
4002− BNX2_MISC_ENABLE_SET_BITS_EMAC_ENABLE);
4003+ BNX2_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
4004+ BNX2_MISC_ENABLE_SET_BITS_RX_PARSER_MAC_ENABLE |
4005+ BNX2_MISC_ENABLE_SET_BITS_TX_HEADER_Q_ENABLE |
4006+ BNX2_MISC_ENABLE_SET_BITS_EMAC_ENABLE);
40034007
4004− val = REG_RD(bp, BNX2_RPM_CONFIG);
4008+ val = BNX2_RD(bp, BNX2_RPM_CONFIG);
40054009 val &= ~BNX2_RPM_CONFIG_ACPI_ENA;
4006− REG_WR(bp, BNX2_RPM_CONFIG, val);
4010+ BNX2_WR(bp, BNX2_RPM_CONFIG, val);
40074011
40084012 wol_msg = BNX2_DRV_MSG_CODE_SUSPEND_WOL;
40094013 }
@@ -4016,8 +4020,8 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state) · 6 unmodified lines
40164020 1, 0);
40174021
40184022 pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
4019− if ((CHIP_ID(bp) == CHIP_ID_5706_A0) ||
4020− (CHIP_ID(bp) == CHIP_ID_5706_A1)) {
4023+ if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) ||
4024+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1)) {
40214025
40224026 if (bp->wol)
40234027 pmcsr |= 3;
@@ -4050,9 +4054,9 @@ bnx2_acquire_nvram_lock(struct bnx2 *bp) · 26 unmodified lines
40504054 int j;
40514055
40524056 /* Request access to the flash interface. */
4053− REG_WR(bp, BNX2_NVM_SW_ARB, BNX2_NVM_SW_ARB_ARB_REQ_SET2);
4057+ BNX2_WR(bp, BNX2_NVM_SW_ARB, BNX2_NVM_SW_ARB_ARB_REQ_SET2);
40544058 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
4055− val = REG_RD(bp, BNX2_NVM_SW_ARB);
4059+ val = BNX2_RD(bp, BNX2_NVM_SW_ARB);
40564060 if (val & BNX2_NVM_SW_ARB_ARB_ARB2)
40574061 break;
40584062
@@ -4072,10 +4076,10 @@ bnx2_release_nvram_lock(struct bnx2 *bp) · 13 unmodified lines
40724076 u32 val;
40734077
40744078 /* Relinquish nvram interface. */
4075− REG_WR(bp, BNX2_NVM_SW_ARB, BNX2_NVM_SW_ARB_ARB_REQ_CLR2);
4079+ BNX2_WR(bp, BNX2_NVM_SW_ARB, BNX2_NVM_SW_ARB_ARB_REQ_CLR2);
40764080
40774081 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
4078− val = REG_RD(bp, BNX2_NVM_SW_ARB);
4082+ val = BNX2_RD(bp, BNX2_NVM_SW_ARB);
40794083 if (!(val & BNX2_NVM_SW_ARB_ARB_ARB2))
40804084 break;
40814085
@@ -4094,20 +4098,20 @@ bnx2_enable_nvram_write(struct bnx2 *bp) · 12 unmodified lines
40944098 {
40954099 u32 val;
40964100
4097− val = REG_RD(bp, BNX2_MISC_CFG);
4098− REG_WR(bp, BNX2_MISC_CFG, val | BNX2_MISC_CFG_NVM_WR_EN_PCI);
4101+ val = BNX2_RD(bp, BNX2_MISC_CFG);
4102+ BNX2_WR(bp, BNX2_MISC_CFG, val | BNX2_MISC_CFG_NVM_WR_EN_PCI);
40994103
41004104 if (bp->flash_info->flags & BNX2_NV_WREN) {
41014105 int j;
41024106
4103− REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
4104− REG_WR(bp, BNX2_NVM_COMMAND,
4105− BNX2_NVM_COMMAND_WREN | BNX2_NVM_COMMAND_DOIT);
4107+ BNX2_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
4108+ BNX2_WR(bp, BNX2_NVM_COMMAND,
4109+ BNX2_NVM_COMMAND_WREN | BNX2_NVM_COMMAND_DOIT);
41064110
41074111 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
41084112 udelay(5);
41094113
4110− val = REG_RD(bp, BNX2_NVM_COMMAND);
4114+ val = BNX2_RD(bp, BNX2_NVM_COMMAND);
41114115 if (val & BNX2_NVM_COMMAND_DONE)
41124116 break;
41134117 }
@@ -4123,8 +4127,8 @@ bnx2_disable_nvram_write(struct bnx2 *bp) · 9 unmodified lines
41234127 {
41244128 u32 val;
41254129
4126− val = REG_RD(bp, BNX2_MISC_CFG);
4127− REG_WR(bp, BNX2_MISC_CFG, val & ~BNX2_MISC_CFG_NVM_WR_EN);
4130+ val = BNX2_RD(bp, BNX2_MISC_CFG);
4131+ BNX2_WR(bp, BNX2_MISC_CFG, val & ~BNX2_MISC_CFG_NVM_WR_EN);
41284132 }
41294133
41304134
@@ -4133,10 +4137,10 @@ bnx2_enable_nvram_access(struct bnx2 *bp) · 2 unmodified lines
41334137 {
41344138 u32 val;
41354139
4136− val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE);
4140+ val = BNX2_RD(bp, BNX2_NVM_ACCESS_ENABLE);
41374141 /* Enable both bits, even on read. */
4138− REG_WR(bp, BNX2_NVM_ACCESS_ENABLE,
4139− val | BNX2_NVM_ACCESS_ENABLE_EN | BNX2_NVM_ACCESS_ENABLE_WR_EN);
4142+ BNX2_WR(bp, BNX2_NVM_ACCESS_ENABLE,
4143+ val | BNX2_NVM_ACCESS_ENABLE_EN | BNX2_NVM_ACCESS_ENABLE_WR_EN);
41404144 }
41414145
41424146 static void
@@ -4144,9 +4148,9 @@ bnx2_disable_nvram_access(struct bnx2 *bp) · 1 unmodified line
41444148 {
41454149 u32 val;
41464150
4147− val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE);
4151+ val = BNX2_RD(bp, BNX2_NVM_ACCESS_ENABLE);
41484152 /* Disable both bits, even after read. */
4149− REG_WR(bp, BNX2_NVM_ACCESS_ENABLE,
4153+ BNX2_WR(bp, BNX2_NVM_ACCESS_ENABLE,
41504154 val & ~(BNX2_NVM_ACCESS_ENABLE_EN |
41514155 BNX2_NVM_ACCESS_ENABLE_WR_EN));
41524156 }
@@ -4166,13 +4170,13 @@ bnx2_nvram_erase_page(struct bnx2 *bp, u32 offset) · 13 unmodified lines
41664170 BNX2_NVM_COMMAND_DOIT;
41674171
41684172 /* Need to clear DONE bit separately. */
4169− REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
4173+ BNX2_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
41704174
41714175 /* Address of the NVRAM to read from. */
4172− REG_WR(bp, BNX2_NVM_ADDR, offset & BNX2_NVM_ADDR_NVM_ADDR_VALUE);
4176+ BNX2_WR(bp, BNX2_NVM_ADDR, offset & BNX2_NVM_ADDR_NVM_ADDR_VALUE);
41734177
41744178 /* Issue an erase command. */
4175− REG_WR(bp, BNX2_NVM_COMMAND, cmd);
4179+ BNX2_WR(bp, BNX2_NVM_COMMAND, cmd);
41764180
41774181 /* Wait for completion. */
41784182 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
@@ -4180,7 +4184,7 @@ bnx2_nvram_erase_page(struct bnx2 *bp, u32 offset) · 1 unmodified line
41804184
41814185 udelay(5);
41824186
4183− val = REG_RD(bp, BNX2_NVM_COMMAND);
4187+ val = BNX2_RD(bp, BNX2_NVM_COMMAND);
41844188 if (val & BNX2_NVM_COMMAND_DONE)
41854189 break;
41864190 }
@@ -4208,13 +4212,13 @@ bnx2_nvram_read_dword(struct bnx2 *bp, u32 offset, u8 *ret_val, u32 cmd_flags) · 21 unmodified lines
42084212 }
42094213
42104214 /* Need to clear DONE bit separately. */
4211− REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
4215+ BNX2_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
42124216
42134217 /* Address of the NVRAM to read from. */
4214− REG_WR(bp, BNX2_NVM_ADDR, offset & BNX2_NVM_ADDR_NVM_ADDR_VALUE);
4218+ BNX2_WR(bp, BNX2_NVM_ADDR, offset & BNX2_NVM_ADDR_NVM_ADDR_VALUE);
42154219
42164220 /* Issue a read command. */
4217− REG_WR(bp, BNX2_NVM_COMMAND, cmd);
4221+ BNX2_WR(bp, BNX2_NVM_COMMAND, cmd);
42184222
42194223 /* Wait for completion. */
42204224 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
@@ -4222,9 +4226,9 @@ bnx2_nvram_read_dword(struct bnx2 *bp, u32 offset, u8 *ret_val, u32 cmd_flags) · 1 unmodified line
42224226
42234227 udelay(5);
42244228
4225− val = REG_RD(bp, BNX2_NVM_COMMAND);
4229+ val = BNX2_RD(bp, BNX2_NVM_COMMAND);
42264230 if (val & BNX2_NVM_COMMAND_DONE) {
4227− __be32 v = cpu_to_be32(REG_RD(bp, BNX2_NVM_READ));
4231+ __be32 v = cpu_to_be32(BNX2_RD(bp, BNX2_NVM_READ));
42284232 memcpy(ret_val, &v, 4);
42294233 break;
42304234 }
@@ -4254,24 +4258,24 @@ bnx2_nvram_write_dword(struct bnx2 *bp, u32 offset, u8 *val, u32 cmd_flags) · 23 unmodified lines
42544258 }
42554259
42564260 /* Need to clear DONE bit separately. */
4257− REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
4261+ BNX2_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
42584262
42594263 memcpy(&val32, val, 4);
42604264
42614265 /* Write the data. */
4262− REG_WR(bp, BNX2_NVM_WRITE, be32_to_cpu(val32));
4266+ BNX2_WR(bp, BNX2_NVM_WRITE, be32_to_cpu(val32));
42634267
42644268 /* Address of the NVRAM to write to. */
4265− REG_WR(bp, BNX2_NVM_ADDR, offset & BNX2_NVM_ADDR_NVM_ADDR_VALUE);
4269+ BNX2_WR(bp, BNX2_NVM_ADDR, offset & BNX2_NVM_ADDR_NVM_ADDR_VALUE);
42664270
42674271 /* Issue the write command. */
4268− REG_WR(bp, BNX2_NVM_COMMAND, cmd);
4272+ BNX2_WR(bp, BNX2_NVM_COMMAND, cmd);
42694273
42704274 /* Wait for completion. */
42714275 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
42724276 udelay(5);
42734277
4274− if (REG_RD(bp, BNX2_NVM_COMMAND) & BNX2_NVM_COMMAND_DONE)
4278+ if (BNX2_RD(bp, BNX2_NVM_COMMAND) & BNX2_NVM_COMMAND_DONE)
42754279 break;
42764280 }
42774281 if (j >= NVRAM_TIMEOUT_COUNT)
@@ -4287,13 +4291,13 @@ bnx2_init_nvram(struct bnx2 *bp) · 9 unmodified lines
42874291 int j, entry_count, rc = 0;
42884292 const struct flash_spec *flash;
42894293
4290− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
4294+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
42914295 bp->flash_info = &flash_5709;
42924296 goto get_flash_size;
42934297 }
42944298
42954299 /* Determine the selected interface. */
4296− val = REG_RD(bp, BNX2_NVM_CFG1);
4300+ val = BNX2_RD(bp, BNX2_NVM_CFG1);
42974301
42984302 entry_count = ARRAY_SIZE(flash_table);
42994303
@@ -4332,10 +4336,10 @@ bnx2_init_nvram(struct bnx2 *bp) · 32 unmodified lines
43324336 bnx2_enable_nvram_access(bp);
43334337
43344338 /* Reconfigure the flash interface */
4335− REG_WR(bp, BNX2_NVM_CFG1, flash->config1);
4336− REG_WR(bp, BNX2_NVM_CFG2, flash->config2);
4337− REG_WR(bp, BNX2_NVM_CFG3, flash->config3);
4338− REG_WR(bp, BNX2_NVM_WRITE1, flash->write1);
4339+ BNX2_WR(bp, BNX2_NVM_CFG1, flash->config1);
4340+ BNX2_WR(bp, BNX2_NVM_CFG2, flash->config2);
4341+ BNX2_WR(bp, BNX2_NVM_CFG3, flash->config3);
4342+ BNX2_WR(bp, BNX2_NVM_WRITE1, flash->write1);
43394343
43404344 /* Disable access to flash interface */
43414345 bnx2_disable_nvram_access(bp);
@@ -4696,10 +4700,10 @@ bnx2_init_fw_cap(struct bnx2 *bp) · 354 unmodified lines
46964700 static void
46974701 bnx2_setup_msix_tbl(struct bnx2 *bp)
46984702 {
4699− REG_WR(bp, BNX2_PCI_GRC_WINDOW_ADDR, BNX2_PCI_GRC_WINDOW_ADDR_SEP_WIN);
4703+ BNX2_WR(bp, BNX2_PCI_GRC_WINDOW_ADDR, BNX2_PCI_GRC_WINDOW_ADDR_SEP_WIN);
47004704
4701− REG_WR(bp, BNX2_PCI_GRC_WINDOW2_ADDR, BNX2_MSIX_TABLE_ADDR);
4702− REG_WR(bp, BNX2_PCI_GRC_WINDOW3_ADDR, BNX2_MSIX_PBA_ADDR);
4705+ BNX2_WR(bp, BNX2_PCI_GRC_WINDOW2_ADDR, BNX2_MSIX_TABLE_ADDR);
4706+ BNX2_WR(bp, BNX2_PCI_GRC_WINDOW3_ADDR, BNX2_MSIX_PBA_ADDR);
47034707 }
47044708
47054709 static int
@@ -4711,24 +4715,24 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 5 unmodified lines
47114715
47124716 /* Wait for the current PCI transaction to complete before
47134717 * issuing a reset. */
4714− if ((CHIP_NUM(bp) == CHIP_NUM_5706) ||
4715− (CHIP_NUM(bp) == CHIP_NUM_5708)) {
4716− REG_WR(bp, BNX2_MISC_ENABLE_CLR_BITS,
4717− BNX2_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE |
4718− BNX2_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE |
4719− BNX2_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE |
4720− BNX2_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE);
4721− val = REG_RD(bp, BNX2_MISC_ENABLE_CLR_BITS);
4718+ if ((BNX2_CHIP(bp) == BNX2_CHIP_5706) ||
4719+ (BNX2_CHIP(bp) == BNX2_CHIP_5708)) {
4720+ BNX2_WR(bp, BNX2_MISC_ENABLE_CLR_BITS,
4721+ BNX2_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE |
4722+ BNX2_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE |
4723+ BNX2_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE |
4724+ BNX2_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE);
4725+ val = BNX2_RD(bp, BNX2_MISC_ENABLE_CLR_BITS);
47224726 udelay(5);
47234727 } else { /* 5709 */
4724− val = REG_RD(bp, BNX2_MISC_NEW_CORE_CTL);
4728+ val = BNX2_RD(bp, BNX2_MISC_NEW_CORE_CTL);
47254729 val &= ~BNX2_MISC_NEW_CORE_CTL_DMA_ENABLE;
4726− REG_WR(bp, BNX2_MISC_NEW_CORE_CTL, val);
4727− val = REG_RD(bp, BNX2_MISC_NEW_CORE_CTL);
4730+ BNX2_WR(bp, BNX2_MISC_NEW_CORE_CTL, val);
4731+ val = BNX2_RD(bp, BNX2_MISC_NEW_CORE_CTL);
47284732
47294733 for (i = 0; i < 100; i++) {
47304734 msleep(1);
4731− val = REG_RD(bp, BNX2_PCICFG_DEVICE_CONTROL);
4735+ val = BNX2_RD(bp, BNX2_PCICFG_DEVICE_CONTROL);
47324736 if (!(val & BNX2_PCICFG_DEVICE_STATUS_NO_PEND))
47334737 break;
47344738 }
@@ -4744,17 +4748,17 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 9 unmodified lines
47444748
47454749 /* Do a dummy read to force the chip to complete all current transaction
47464750 * before we issue a reset. */
4747− val = REG_RD(bp, BNX2_MISC_ID);
4751+ val = BNX2_RD(bp, BNX2_MISC_ID);
47484752
4749− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
4750− REG_WR(bp, BNX2_MISC_COMMAND, BNX2_MISC_COMMAND_SW_RESET);
4751− REG_RD(bp, BNX2_MISC_COMMAND);
4753+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
4754+ BNX2_WR(bp, BNX2_MISC_COMMAND, BNX2_MISC_COMMAND_SW_RESET);
4755+ BNX2_RD(bp, BNX2_MISC_COMMAND);
47524756 udelay(5);
47534757
47544758 val = BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |
47554759 BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP;
47564760
4757− REG_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);
4761+ BNX2_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);
47584762
47594763 } else {
47604764 val = BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ |
@@ -4762,19 +4766,19 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 1 unmodified line
47624766 BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP;
47634767
47644768 /* Chip reset. */
4765− REG_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);
4769+ BNX2_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);
47664770
47674771 /* Reading back any register after chip reset will hang the
47684772 * bus on 5706 A0 and A1. The msleep below provides plenty
47694773 * of margin for write posting.
47704774 */
4771− if ((CHIP_ID(bp) == CHIP_ID_5706_A0) ||
4772− (CHIP_ID(bp) == CHIP_ID_5706_A1))
4775+ if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) ||
4776+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1))
47734777 msleep(20);
47744778
47754779 /* Reset takes approximate 30 usec */
47764780 for (i = 0; i < 10; i++) {
4777− val = REG_RD(bp, BNX2_PCICFG_MISC_CONFIG);
4781+ val = BNX2_RD(bp, BNX2_PCICFG_MISC_CONFIG);
47784782 if ((val & (BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ |
47794783 BNX2_PCICFG_MISC_CONFIG_CORE_RST_BSY)) == 0)
47804784 break;
@@ -4789,7 +4793,7 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 8 unmodified lines
47894793 }
47904794
47914795 /* Make sure byte swapping is properly configured. */
4792− val = REG_RD(bp, BNX2_PCI_SWAP_DIAG0);
4796+ val = BNX2_RD(bp, BNX2_PCI_SWAP_DIAG0);
47934797 if (val != 0x01020304) {
47944798 pr_err("Chip not in correct endian mode\n");
47954799 return -ENODEV;
@@ -4808,10 +4812,10 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 12 unmodified lines
48084812 bnx2_set_default_remote_link(bp);
48094813 spin_unlock_bh(&bp->phy_lock);
48104814
4811− if (CHIP_ID(bp) == CHIP_ID_5706_A0) {
4815+ if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) {
48124816 /* Adjust the voltage regular to two steps lower. The default
48134817 * of this register is 0x0000000e. */
4814− REG_WR(bp, BNX2_MISC_VREG_CONTROL, 0x000000fa);
4818+ BNX2_WR(bp, BNX2_MISC_VREG_CONTROL, 0x000000fa);
48154819
48164820 /* Remove bad rbuf memory from the free pool. */
48174821 rc = bnx2_alloc_bad_rbuf(bp);
@@ -4820,7 +4824,7 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 2 unmodified lines
48204824 if (bp->flags & BNX2_FLAG_USING_MSIX) {
48214825 bnx2_setup_msix_tbl(bp);
48224826 /* Prevent MSIX table reads and write from timing out */
4823− REG_WR(bp, BNX2_MISC_ECO_HW_CTL,
4827+ BNX2_WR(bp, BNX2_MISC_ECO_HW_CTL,
48244828 BNX2_MISC_ECO_HW_CTL_LARGE_GRC_TMOUT_EN);
48254829 }
48264830
@@ -4834,7 +4838,7 @@ bnx2_init_chip(struct bnx2 *bp) · 7 unmodified lines
48344838 int rc, i;
48354839
48364840 /* Make sure the interrupt is not active. */
4837− REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
4841+ BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
48384842
48394843 val = BNX2_DMA_CONFIG_DATA_BYTE_SWAP |
48404844 BNX2_DMA_CONFIG_DATA_WORD_SWAP |
@@ -4850,16 +4854,17 @@ bnx2_init_chip(struct bnx2 *bp) · 9 unmodified lines
48504854 if ((bp->flags & BNX2_FLAG_PCIX) && (bp->bus_speed_mhz == 133))
48514855 val |= (1 << 23);
48524856
4853− if ((CHIP_NUM(bp) == CHIP_NUM_5706) &&
4854− (CHIP_ID(bp) != CHIP_ID_5706_A0) && !(bp->flags & BNX2_FLAG_PCIX))
4857+ if ((BNX2_CHIP(bp) == BNX2_CHIP_5706) &&
4858+ (BNX2_CHIP_ID(bp) != BNX2_CHIP_ID_5706_A0) &&
4859+ !(bp->flags & BNX2_FLAG_PCIX))
48554860 val |= BNX2_DMA_CONFIG_CNTL_PING_PONG_DMA;
48564861
4857− REG_WR(bp, BNX2_DMA_CONFIG, val);
4862+ BNX2_WR(bp, BNX2_DMA_CONFIG, val);
48584863
4859− if (CHIP_ID(bp) == CHIP_ID_5706_A0) {
4860− val = REG_RD(bp, BNX2_TDMA_CONFIG);
4864+ if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) {
4865+ val = BNX2_RD(bp, BNX2_TDMA_CONFIG);
48614866 val |= BNX2_TDMA_CONFIG_ONE_DMA;
4862− REG_WR(bp, BNX2_TDMA_CONFIG, val);
4867+ BNX2_WR(bp, BNX2_TDMA_CONFIG, val);
48634868 }
48644869
48654870 if (bp->flags & BNX2_FLAG_PCIX) {
@@ -4871,14 +4876,14 @@ bnx2_init_chip(struct bnx2 *bp) · 5 unmodified lines
48714876 val16 & ~PCI_X_CMD_ERO);
48724877 }
48734878
4874− REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
4875− BNX2_MISC_ENABLE_SET_BITS_HOST_COALESCE_ENABLE |
4876− BNX2_MISC_ENABLE_STATUS_BITS_RX_V2P_ENABLE |
4877− BNX2_MISC_ENABLE_STATUS_BITS_CONTEXT_ENABLE);
4879+ BNX2_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
4880+ BNX2_MISC_ENABLE_SET_BITS_HOST_COALESCE_ENABLE |
4881+ BNX2_MISC_ENABLE_STATUS_BITS_RX_V2P_ENABLE |
4882+ BNX2_MISC_ENABLE_STATUS_BITS_CONTEXT_ENABLE);
48784883
48794884 /* Initialize context mapping and zero out the quick contexts. The
48804885 * context block must have already been enabled. */
4881− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
4886+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
48824887 rc = bnx2_init_5709_context(bp);
48834888 if (rc)
48844889 return rc;
@@ -4892,29 +4897,29 @@ bnx2_init_chip(struct bnx2 *bp) · 7 unmodified lines
48924897
48934898 bnx2_set_mac_addr(bp, bp->dev->dev_addr, 0);
48944899
4895− val = REG_RD(bp, BNX2_MQ_CONFIG);
4900+ val = BNX2_RD(bp, BNX2_MQ_CONFIG);
48964901 val &= ~BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE;
48974902 val |= BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE_256;
4898− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
4903+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
48994904 val |= BNX2_MQ_CONFIG_BIN_MQ_MODE;
4900− if (CHIP_REV(bp) == CHIP_REV_Ax)
4905+ if (BNX2_CHIP_REV(bp) == BNX2_CHIP_REV_Ax)
49014906 val |= BNX2_MQ_CONFIG_HALT_DIS;
49024907 }
49034908
4904− REG_WR(bp, BNX2_MQ_CONFIG, val);
4909+ BNX2_WR(bp, BNX2_MQ_CONFIG, val);
49054910
49064911 val = 0x10000 + (MAX_CID_CNT * MB_KERNEL_CTX_SIZE);
4907− REG_WR(bp, BNX2_MQ_KNL_BYP_WIND_START, val);
4908− REG_WR(bp, BNX2_MQ_KNL_WIND_END, val);
4912+ BNX2_WR(bp, BNX2_MQ_KNL_BYP_WIND_START, val);
4913+ BNX2_WR(bp, BNX2_MQ_KNL_WIND_END, val);
49094914
4910− val = (BCM_PAGE_BITS - 8) << 24;
4911− REG_WR(bp, BNX2_RV2P_CONFIG, val);
4915+ val = (BNX2_PAGE_BITS - 8) << 24;
4916+ BNX2_WR(bp, BNX2_RV2P_CONFIG, val);
49124917
49134918 /* Configure page size. */
4914− val = REG_RD(bp, BNX2_TBDR_CONFIG);
4919+ val = BNX2_RD(bp, BNX2_TBDR_CONFIG);
49154920 val &= ~BNX2_TBDR_CONFIG_PAGE_SIZE;
4916− val |= (BCM_PAGE_BITS - 8) << 24 | 0x40;
4917− REG_WR(bp, BNX2_TBDR_CONFIG, val);
4921+ val |= (BNX2_PAGE_BITS - 8) << 24 | 0x40;
4922+ BNX2_WR(bp, BNX2_TBDR_CONFIG, val);
49184923
49194924 val = bp->mac_addr[0] +
49204925 (bp->mac_addr[1] << 8) +
@@ -4922,14 +4927,14 @@ bnx2_init_chip(struct bnx2 *bp) · 1 unmodified line
49224927 bp->mac_addr[3] +
49234928 (bp->mac_addr[4] << 8) +
49244929 (bp->mac_addr[5] << 16);
4925− REG_WR(bp, BNX2_EMAC_BACKOFF_SEED, val);
4930+ BNX2_WR(bp, BNX2_EMAC_BACKOFF_SEED, val);
49264931
49274932 /* Program the MTU. Also include 4 bytes for CRC32. */
49284933 mtu = bp->dev->mtu;
49294934 val = mtu + ETH_HLEN + ETH_FCS_LEN;
49304935 if (val > (MAX_ETHERNET_PACKET_SIZE + 4))
49314936 val |= BNX2_EMAC_RX_MTU_SIZE_JUMBO_ENA;
4932− REG_WR(bp, BNX2_EMAC_RX_MTU_SIZE, val);
4937+ BNX2_WR(bp, BNX2_EMAC_RX_MTU_SIZE, val);
49334938
49344939 if (mtu < 1500)
49354940 mtu = 1500;
@@ -4947,43 +4952,43 @@ bnx2_init_chip(struct bnx2 *bp) · 11 unmodified lines
49474952 bp->rx_mode = BNX2_EMAC_RX_MODE_SORT_MODE;
49484953
49494954 /* Set up how to generate a link change interrupt. */
4950− REG_WR(bp, BNX2_EMAC_ATTENTION_ENA, BNX2_EMAC_ATTENTION_ENA_LINK);
4955+ BNX2_WR(bp, BNX2_EMAC_ATTENTION_ENA, BNX2_EMAC_ATTENTION_ENA_LINK);
49514956
4952− REG_WR(bp, BNX2_HC_STATUS_ADDR_L,
4953− (u64) bp->status_blk_mapping & 0xffffffff);
4954− REG_WR(bp, BNX2_HC_STATUS_ADDR_H, (u64) bp->status_blk_mapping >> 32);
4957+ BNX2_WR(bp, BNX2_HC_STATUS_ADDR_L,
4958+ (u64) bp->status_blk_mapping & 0xffffffff);
4959+ BNX2_WR(bp, BNX2_HC_STATUS_ADDR_H, (u64) bp->status_blk_mapping >> 32);
49554960
4956− REG_WR(bp, BNX2_HC_STATISTICS_ADDR_L,
4957− (u64) bp->stats_blk_mapping & 0xffffffff);
4958− REG_WR(bp, BNX2_HC_STATISTICS_ADDR_H,
4959− (u64) bp->stats_blk_mapping >> 32);
4961+ BNX2_WR(bp, BNX2_HC_STATISTICS_ADDR_L,
4962+ (u64) bp->stats_blk_mapping & 0xffffffff);
4963+ BNX2_WR(bp, BNX2_HC_STATISTICS_ADDR_H,
4964+ (u64) bp->stats_blk_mapping >> 32);
49604965
4961− REG_WR(bp, BNX2_HC_TX_QUICK_CONS_TRIP,
4962− (bp->tx_quick_cons_trip_int << 16) | bp->tx_quick_cons_trip);
4966+ BNX2_WR(bp, BNX2_HC_TX_QUICK_CONS_TRIP,
4967+ (bp->tx_quick_cons_trip_int << 16) | bp->tx_quick_cons_trip);
49634968
4964− REG_WR(bp, BNX2_HC_RX_QUICK_CONS_TRIP,
4965− (bp->rx_quick_cons_trip_int << 16) | bp->rx_quick_cons_trip);
4969+ BNX2_WR(bp, BNX2_HC_RX_QUICK_CONS_TRIP,
4970+ (bp->rx_quick_cons_trip_int << 16) | bp->rx_quick_cons_trip);
49664971
4967− REG_WR(bp, BNX2_HC_COMP_PROD_TRIP,
4968− (bp->comp_prod_trip_int << 16) | bp->comp_prod_trip);
4972+ BNX2_WR(bp, BNX2_HC_COMP_PROD_TRIP,
4973+ (bp->comp_prod_trip_int << 16) | bp->comp_prod_trip);
49694974
4970− REG_WR(bp, BNX2_HC_TX_TICKS, (bp->tx_ticks_int << 16) | bp->tx_ticks);
4975+ BNX2_WR(bp, BNX2_HC_TX_TICKS, (bp->tx_ticks_int << 16) | bp->tx_ticks);
49714976
4972− REG_WR(bp, BNX2_HC_RX_TICKS, (bp->rx_ticks_int << 16) | bp->rx_ticks);
4977+ BNX2_WR(bp, BNX2_HC_RX_TICKS, (bp->rx_ticks_int << 16) | bp->rx_ticks);
49734978
4974− REG_WR(bp, BNX2_HC_COM_TICKS,
4975− (bp->com_ticks_int << 16) | bp->com_ticks);
4979+ BNX2_WR(bp, BNX2_HC_COM_TICKS,
4980+ (bp->com_ticks_int << 16) | bp->com_ticks);
49764981
4977− REG_WR(bp, BNX2_HC_CMD_TICKS,
4978− (bp->cmd_ticks_int << 16) | bp->cmd_ticks);
4982+ BNX2_WR(bp, BNX2_HC_CMD_TICKS,
4983+ (bp->cmd_ticks_int << 16) | bp->cmd_ticks);
49794984
49804985 if (bp->flags & BNX2_FLAG_BROKEN_STATS)
4981− REG_WR(bp, BNX2_HC_STATS_TICKS, 0);
4986+ BNX2_WR(bp, BNX2_HC_STATS_TICKS, 0);
49824987 else
4983− REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks);
4984− REG_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */
4988+ BNX2_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks);
4989+ BNX2_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */
49854990
4986− if (CHIP_ID(bp) == CHIP_ID_5706_A1)
4991+ if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1)
49874992 val = BNX2_HC_CONFIG_COLLECT_STATS;
49884993 else {
49894994 val = BNX2_HC_CONFIG_RX_TMR_MODE | BNX2_HC_CONFIG_TX_TMR_MODE |
@@ -4991,8 +4996,8 @@ bnx2_init_chip(struct bnx2 *bp) · 1 unmodified line
49914996 }
49924997
49934998 if (bp->flags & BNX2_FLAG_USING_MSIX) {
4994− REG_WR(bp, BNX2_HC_MSIX_BIT_VECTOR,
4995− BNX2_HC_MSIX_BIT_VECTOR_VAL);
4999+ BNX2_WR(bp, BNX2_HC_MSIX_BIT_VECTOR,
5000+ BNX2_HC_MSIX_BIT_VECTOR_VAL);
49965001
49975002 val |= BNX2_HC_CONFIG_SB_ADDR_INC_128B;
49985003 }
@@ -5000,7 +5005,7 @@ bnx2_init_chip(struct bnx2 *bp) · 1 unmodified line
50005005 if (bp->flags & BNX2_FLAG_ONE_SHOT_MSI)
50015006 val |= BNX2_HC_CONFIG_ONE_SHOT | BNX2_HC_CONFIG_USE_INT_PARAM;
50025007
5003− REG_WR(bp, BNX2_HC_CONFIG, val);
5008+ BNX2_WR(bp, BNX2_HC_CONFIG, val);
50045009
50055010 if (bp->rx_ticks < 25)
50065011 bnx2_reg_wr_ind(bp, BNX2_FW_RX_LOW_LATENCY, 1);
@@ -5011,48 +5016,48 @@ bnx2_init_chip(struct bnx2 *bp) · 4 unmodified lines
50115016 u32 base = ((i - 1) * BNX2_HC_SB_CONFIG_SIZE) +
50125017 BNX2_HC_SB_CONFIG_1;
50135018
5014− REG_WR(bp, base,
5019+ BNX2_WR(bp, base,
50155020 BNX2_HC_SB_CONFIG_1_TX_TMR_MODE |
50165021 BNX2_HC_SB_CONFIG_1_RX_TMR_MODE |
50175022 BNX2_HC_SB_CONFIG_1_ONE_SHOT);
50185023
5019− REG_WR(bp, base + BNX2_HC_TX_QUICK_CONS_TRIP_OFF,
5024+ BNX2_WR(bp, base + BNX2_HC_TX_QUICK_CONS_TRIP_OFF,
50205025 (bp->tx_quick_cons_trip_int << 16) |
50215026 bp->tx_quick_cons_trip);
50225027
5023− REG_WR(bp, base + BNX2_HC_TX_TICKS_OFF,
5028+ BNX2_WR(bp, base + BNX2_HC_TX_TICKS_OFF,
50245029 (bp->tx_ticks_int << 16) | bp->tx_ticks);
50255030
5026− REG_WR(bp, base + BNX2_HC_RX_QUICK_CONS_TRIP_OFF,
5027− (bp->rx_quick_cons_trip_int << 16) |
5031+ BNX2_WR(bp, base + BNX2_HC_RX_QUICK_CONS_TRIP_OFF,
5032+ (bp->rx_quick_cons_trip_int << 16) |
50285033 bp->rx_quick_cons_trip);
50295034
5030− REG_WR(bp, base + BNX2_HC_RX_TICKS_OFF,
5035+ BNX2_WR(bp, base + BNX2_HC_RX_TICKS_OFF,
50315036 (bp->rx_ticks_int << 16) | bp->rx_ticks);
50325037 }
50335038
50345039 /* Clear internal stats counters. */
5035− REG_WR(bp, BNX2_HC_COMMAND, BNX2_HC_COMMAND_CLR_STAT_NOW);
5040+ BNX2_WR(bp, BNX2_HC_COMMAND, BNX2_HC_COMMAND_CLR_STAT_NOW);
50365041
5037− REG_WR(bp, BNX2_HC_ATTN_BITS_ENABLE, STATUS_ATTN_EVENTS);
5042+ BNX2_WR(bp, BNX2_HC_ATTN_BITS_ENABLE, STATUS_ATTN_EVENTS);
50385043
50395044 /* Initialize the receive filter. */
50405045 bnx2_set_rx_mode(bp->dev);
50415046
5042− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
5043− val = REG_RD(bp, BNX2_MISC_NEW_CORE_CTL);
5047+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
5048+ val = BNX2_RD(bp, BNX2_MISC_NEW_CORE_CTL);
50445049 val |= BNX2_MISC_NEW_CORE_CTL_DMA_ENABLE;
5045− REG_WR(bp, BNX2_MISC_NEW_CORE_CTL, val);
5050+ BNX2_WR(bp, BNX2_MISC_NEW_CORE_CTL, val);
50465051 }
50475052 rc = bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT2 | BNX2_DRV_MSG_CODE_RESET,
50485053 1, 0);
50495054
5050− REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS, BNX2_MISC_ENABLE_DEFAULT);
5051− REG_RD(bp, BNX2_MISC_ENABLE_SET_BITS);
5055+ BNX2_WR(bp, BNX2_MISC_ENABLE_SET_BITS, BNX2_MISC_ENABLE_DEFAULT);
5056+ BNX2_RD(bp, BNX2_MISC_ENABLE_SET_BITS);
50525057
50535058 udelay(20);
50545059
5055− bp->hc_cmd = REG_RD(bp, BNX2_HC_COMMAND);
5060+ bp->hc_cmd = BNX2_RD(bp, BNX2_HC_COMMAND);
50565061
50575062 return rc;
50585063 }
@@ -5086,7 +5091,7 @@ bnx2_init_tx_context(struct bnx2 *bp, u32 cid, struct bnx2_tx_ring_info *txr) · 27 unmodified lines
50865091 u32 val, offset0, offset1, offset2, offset3;
50875092 u32 cid_addr = GET_CID_ADDR(cid);
50885093
5089− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
5094+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
50905095 offset0 = BNX2_L2CTX_TYPE_XI;
50915096 offset1 = BNX2_L2CTX_CMD_TYPE_XI;
50925097 offset2 = BNX2_L2CTX_TBDR_BHADDR_HI_XI;
@@ -5113,7 +5118,7 @@ bnx2_init_tx_context(struct bnx2 *bp, u32 cid, struct bnx2_tx_ring_info *txr) · 20 unmodified lines
51135118 static void
51145119 bnx2_init_tx_ring(struct bnx2 *bp, int ring_num)
51155120 {
5116− struct tx_bd *txbd;
5121+ struct bnx2_tx_bd *txbd;
51175122 u32 cid = TX_CID;
51185123 struct bnx2_napi *bnapi;
51195124 struct bnx2_tx_ring_info *txr;
@@ -5128,7 +5133,7 @@ bnx2_init_tx_ring(struct bnx2 *bp, int ring_num) · 8 unmodified lines
51285133
51295134 bp->tx_wake_thresh = bp->tx_ring_size / 2;
51305135
5131− txbd = &txr->tx_desc_ring[MAX_TX_DESC_CNT];
5136+ txbd = &txr->tx_desc_ring[BNX2_MAX_TX_DESC_CNT];
51325137
51335138 txbd->tx_bd_haddr_hi = (u64) txr->tx_desc_mapping >> 32;
51345139 txbd->tx_bd_haddr_lo = (u64) txr->tx_desc_mapping & 0xffffffff;
@@ -5143,17 +5148,17 @@ bnx2_init_tx_ring(struct bnx2 *bp, int ring_num) · 8 unmodified lines
51435148 }
51445149
51455150 static void
5146−bnx2_init_rxbd_rings(struct rx_bd *rx_ring[], dma_addr_t dma[], u32 buf_size,
5147− int num_rings)
5151+bnx2_init_rxbd_rings(struct bnx2_rx_bd *rx_ring[], dma_addr_t dma[],
5152+ u32 buf_size, int num_rings)
51485153 {
51495154 int i;
5150− struct rx_bd *rxbd;
5155+ struct bnx2_rx_bd *rxbd;
51515156
51525157 for (i = 0; i < num_rings; i++) {
51535158 int j;
51545159
51555160 rxbd = &rx_ring[i][0];
5156− for (j = 0; j < MAX_RX_DESC_CNT; j++, rxbd++) {
5161+ for (j = 0; j < BNX2_MAX_RX_DESC_CNT; j++, rxbd++) {
51575162 rxbd->rx_bd_len = buf_size;
51585163 rxbd->rx_bd_flags = RX_BD_FLAGS_START | RX_BD_FLAGS_END;
51595164 }
@@ -5187,9 +5192,9 @@ bnx2_init_rx_ring(struct bnx2 *bp, int ring_num) · 27 unmodified lines
51875192
51885193 bnx2_init_rx_context(bp, cid);
51895194
5190− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
5191− val = REG_RD(bp, BNX2_MQ_MAP_L2_5);
5192− REG_WR(bp, BNX2_MQ_MAP_L2_5, val | BNX2_MQ_MAP_L2_5_ARM);
5195+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
5196+ val = BNX2_RD(bp, BNX2_MQ_MAP_L2_5);
5197+ BNX2_WR(bp, BNX2_MQ_MAP_L2_5, val | BNX2_MQ_MAP_L2_5_ARM);
51935198 }
51945199
51955200 bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_PG_BUF_SIZE, 0);
@@ -5208,8 +5213,8 @@ bnx2_init_rx_ring(struct bnx2 *bp, int ring_num) · 12 unmodified lines
52085213 val = (u64) rxr->rx_pg_desc_mapping[0] & 0xffffffff;
52095214 bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_NX_PG_BDHADDR_LO, val);
52105215
5211− if (CHIP_NUM(bp) == CHIP_NUM_5709)
5212− REG_WR(bp, BNX2_MQ_MAP_L2_3, BNX2_MQ_MAP_L2_3_DEFAULT);
5216+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
5217+ BNX2_WR(bp, BNX2_MQ_MAP_L2_3, BNX2_MQ_MAP_L2_3_DEFAULT);
52135218 }
52145219
52155220 val = (u64) rxr->rx_desc_mapping[0] >> 32;
@@ -5225,8 +5230,8 @@ bnx2_init_rx_ring(struct bnx2 *bp, int ring_num) · 9 unmodified lines
52255230 ring_num, i, bp->rx_pg_ring_size);
52265231 break;
52275232 }
5228− prod = NEXT_RX_BD(prod);
5229− ring_prod = RX_PG_RING_IDX(prod);
5233+ prod = BNX2_NEXT_RX_BD(prod);
5234+ ring_prod = BNX2_RX_PG_RING_IDX(prod);
52305235 }
52315236 rxr->rx_pg_prod = prod;
52325237
@@ -5237,8 +5242,8 @@ bnx2_init_rx_ring(struct bnx2 *bp, int ring_num) · 4 unmodified lines
52375242 ring_num, i, bp->rx_ring_size);
52385243 break;
52395244 }
5240− prod = NEXT_RX_BD(prod);
5241− ring_prod = RX_RING_IDX(prod);
5245+ prod = BNX2_NEXT_RX_BD(prod);
5246+ ring_prod = BNX2_RX_RING_IDX(prod);
52425247 }
52435248 rxr->rx_prod = prod;
52445249
@@ -5246,10 +5251,10 @@ bnx2_init_rx_ring(struct bnx2 *bp, int ring_num) · 1 unmodified line
52465251 rxr->rx_bseq_addr = MB_GET_CID_ADDR(cid) + BNX2_L2CTX_HOST_BSEQ;
52475252 rxr->rx_pg_bidx_addr = MB_GET_CID_ADDR(cid) + BNX2_L2CTX_HOST_PG_BDIDX;
52485253
5249− REG_WR16(bp, rxr->rx_pg_bidx_addr, rxr->rx_pg_prod);
5250− REG_WR16(bp, rxr->rx_bidx_addr, prod);
5254+ BNX2_WR16(bp, rxr->rx_pg_bidx_addr, rxr->rx_pg_prod);
5255+ BNX2_WR16(bp, rxr->rx_bidx_addr, prod);
52515256
5252− REG_WR(bp, rxr->rx_bseq_addr, rxr->rx_prod_bseq);
5257+ BNX2_WR(bp, rxr->rx_bseq_addr, rxr->rx_prod_bseq);
52535258 }
52545259
52555260 static void
@@ -5260,15 +5265,15 @@ bnx2_init_all_rings(struct bnx2 *bp) · 4 unmodified lines
52605265
52615266 bnx2_clear_ring_states(bp);
52625267
5263− REG_WR(bp, BNX2_TSCH_TSS_CFG, 0);
5268+ BNX2_WR(bp, BNX2_TSCH_TSS_CFG, 0);
52645269 for (i = 0; i < bp->num_tx_rings; i++)
52655270 bnx2_init_tx_ring(bp, i);
52665271
52675272 if (bp->num_tx_rings > 1)
5268− REG_WR(bp, BNX2_TSCH_TSS_CFG, ((bp->num_tx_rings - 1) << 24) |
5269− (TX_TSS_CID << 7));
5273+ BNX2_WR(bp, BNX2_TSCH_TSS_CFG, ((bp->num_tx_rings - 1) << 24) |
5274+ (TX_TSS_CID << 7));
52705275
5271− REG_WR(bp, BNX2_RLUP_RSS_CONFIG, 0);
5276+ BNX2_WR(bp, BNX2_RLUP_RSS_CONFIG, 0);
52725277 bnx2_reg_wr_ind(bp, BNX2_RXP_SCRATCH_RSS_TBL_SZ, 0);
52735278
52745279 for (i = 0; i < bp->num_rx_rings; i++)
@@ -5282,8 +5287,8 @@ bnx2_init_all_rings(struct bnx2 *bp) · 7 unmodified lines
52825287
52835288 tbl_32 |= (i % (bp->num_rx_rings - 1)) << shift;
52845289 if ((i % 8) == 7) {
5285− REG_WR(bp, BNX2_RLUP_RSS_DATA, tbl_32);
5286− REG_WR(bp, BNX2_RLUP_RSS_COMMAND, (i >> 3) |
5290+ BNX2_WR(bp, BNX2_RLUP_RSS_DATA, tbl_32);
5291+ BNX2_WR(bp, BNX2_RLUP_RSS_COMMAND, (i >> 3) |
52875292 BNX2_RLUP_RSS_COMMAND_RSS_WRITE_MASK |
52885293 BNX2_RLUP_RSS_COMMAND_WRITE |
52895294 BNX2_RLUP_RSS_COMMAND_HASH_MASK);
@@ -5294,7 +5299,7 @@ bnx2_init_all_rings(struct bnx2 *bp) · 4 unmodified lines
52945299 val = BNX2_RLUP_RSS_CONFIG_IPV4_RSS_TYPE_ALL_XI |
52955300 BNX2_RLUP_RSS_CONFIG_IPV6_RSS_TYPE_ALL_XI;
52965301
5297− REG_WR(bp, BNX2_RLUP_RSS_CONFIG, val);
5302+ BNX2_WR(bp, BNX2_RLUP_RSS_CONFIG, val);
52985303
52995304 }
53005305 }
@@ -5303,8 +5308,8 @@ static u32 bnx2_find_max_ring(u32 ring_size, u32 max_size) · 2 unmodified lines
53035308 {
53045309 u32 max, num_rings = 1;
53055310
5306− while (ring_size > MAX_RX_DESC_CNT) {
5307− ring_size -= MAX_RX_DESC_CNT;
5311+ while (ring_size > BNX2_MAX_RX_DESC_CNT) {
5312+ ring_size -= BNX2_MAX_RX_DESC_CNT;
53085313 num_rings++;
53095314 }
53105315 /* round to next power of 2 */
@@ -5337,13 +5342,14 @@ bnx2_set_rx_ring_size(struct bnx2 *bp, u32 size) · 26 unmodified lines
53375342 int pages = PAGE_ALIGN(bp->dev->mtu - 40) >> PAGE_SHIFT;
53385343
53395344 jumbo_size = size * pages;
5340− if (jumbo_size > MAX_TOTAL_RX_PG_DESC_CNT)
5341− jumbo_size = MAX_TOTAL_RX_PG_DESC_CNT;
5345+ if (jumbo_size > BNX2_MAX_TOTAL_RX_PG_DESC_CNT)
5346+ jumbo_size = BNX2_MAX_TOTAL_RX_PG_DESC_CNT;
53425347
53435348 bp->rx_pg_ring_size = jumbo_size;
53445349 bp->rx_max_pg_ring = bnx2_find_max_ring(jumbo_size,
5345− MAX_RX_PG_RINGS);
5346− bp->rx_max_pg_ring_idx = (bp->rx_max_pg_ring * RX_DESC_CNT) - 1;
5350+ BNX2_MAX_RX_PG_RINGS);
5351+ bp->rx_max_pg_ring_idx =
5352+ (bp->rx_max_pg_ring * BNX2_RX_DESC_CNT) - 1;
53475353 rx_size = BNX2_RX_COPY_THRESH + BNX2_RX_OFFSET;
53485354 bp->rx_copy_thresh = 0;
53495355 }
@@ -5354,8 +5360,8 @@ bnx2_set_rx_ring_size(struct bnx2 *bp, u32 size) · 4 unmodified lines
53545360 NET_SKB_PAD + SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
53555361 bp->rx_jumbo_thresh = rx_size - BNX2_RX_OFFSET;
53565362 bp->rx_ring_size = size;
5357− bp->rx_max_ring = bnx2_find_max_ring(size, MAX_RX_RINGS);
5358− bp->rx_max_ring_idx = (bp->rx_max_ring * RX_DESC_CNT) - 1;
5363+ bp->rx_max_ring = bnx2_find_max_ring(size, BNX2_MAX_RX_RINGS);
5364+ bp->rx_max_ring_idx = (bp->rx_max_ring * BNX2_RX_DESC_CNT) - 1;
53595365 }
53605366
53615367 static void
@@ -5371,13 +5377,13 @@ bnx2_free_tx_skbs(struct bnx2 *bp) · 9 unmodified lines
53715377 if (txr->tx_buf_ring == NULL)
53725378 continue;
53735379
5374− for (j = 0; j < TX_DESC_CNT; ) {
5375− struct sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];
5380+ for (j = 0; j < BNX2_TX_DESC_CNT; ) {
5381+ struct bnx2_sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];
53765382 struct sk_buff *skb = tx_buf->skb;
53775383 int k, last;
53785384
53795385 if (skb == NULL) {
5380− j = NEXT_TX_BD(j);
5386+ j = BNX2_NEXT_TX_BD(j);
53815387 continue;
53825388 }
53835389
@@ -5389,9 +5395,9 @@ bnx2_free_tx_skbs(struct bnx2 *bp) · 5 unmodified lines
53895395 tx_buf->skb = NULL;
53905396
53915397 last = tx_buf->nr_frags;
5392− j = NEXT_TX_BD(j);
5393− for (k = 0; k < last; k++, j = NEXT_TX_BD(j)) {
5394− tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)];
5398+ j = BNX2_NEXT_TX_BD(j);
5399+ for (k = 0; k < last; k++, j = BNX2_NEXT_TX_BD(j)) {
5400+ tx_buf = &txr->tx_buf_ring[BNX2_TX_RING_IDX(j)];
53955401 dma_unmap_page(&bp->pdev->dev,
53965402 dma_unmap_addr(tx_buf, mapping),
53975403 skb_frag_size(&skb_shinfo(skb)->frags[k]),
@@ -5417,7 +5423,7 @@ bnx2_free_rx_skbs(struct bnx2 *bp) · 19 unmodified lines
54175423 return;
54185424
54195425 for (j = 0; j < bp->rx_max_ring_idx; j++) {
5420− struct sw_bd *rx_buf = &rxr->rx_buf_ring[j];
5426+ struct bnx2_sw_bd *rx_buf = &rxr->rx_buf_ring[j];
54215427 u8 *data = rx_buf->data;
54225428
54235429 if (data == NULL)
@@ -5615,7 +5621,7 @@ bnx2_test_registers(struct bnx2 *bp) · 191 unmodified lines
56155621
56165622 ret = 0;
56175623 is_5709 = 0;
5618− if (CHIP_NUM(bp) == CHIP_NUM_5709)
5624+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
56195625 is_5709 = 1;
56205626
56215627 for (i = 0; reg_tbl[i].offset != 0xffff; i++) {
@@ -5714,7 +5720,7 @@ bnx2_test_memory(struct bnx2 *bp) · 92 unmodified lines
57145720 };
57155721 struct mem_entry *mem_tbl;
57165722
5717− if (CHIP_NUM(bp) == CHIP_NUM_5709)
5723+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
57185724 mem_tbl = mem_tbl_5709;
57195725 else
57205726 mem_tbl = mem_tbl_5706;
@@ -5741,8 +5747,8 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode) · 20 unmodified lines
57415747 unsigned char *packet;
57425748 u16 rx_start_idx, rx_idx;
57435749 dma_addr_t map;
5744− struct tx_bd *txbd;
5745− struct sw_bd *rx_buf;
5750+ struct bnx2_tx_bd *txbd;
5751+ struct bnx2_sw_bd *rx_buf;
57465752 struct l2_fhdr *rx_hdr;
57475753 int ret = -ENODEV;
57485754 struct bnx2_napi *bnapi = &bp->bnx2_napi[0], *tx_napi;
@@ -5784,17 +5790,17 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode) · 35 unmodified lines
57845790 return -EIO;
57855791 }
57865792
5787− REG_WR(bp, BNX2_HC_COMMAND,
5788− bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
5793+ BNX2_WR(bp, BNX2_HC_COMMAND,
5794+ bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
57895795
5790− REG_RD(bp, BNX2_HC_COMMAND);
5796+ BNX2_RD(bp, BNX2_HC_COMMAND);
57915797
57925798 udelay(5);
57935799 rx_start_idx = bnx2_get_hw_rx_cons(bnapi);
57945800
57955801 num_pkts = 0;
57965802
5797− txbd = &txr->tx_desc_ring[TX_RING_IDX(txr->tx_prod)];
5803+ txbd = &txr->tx_desc_ring[BNX2_TX_RING_IDX(txr->tx_prod)];
57985804
57995805 txbd->tx_bd_haddr_hi = (u64) map >> 32;
58005806 txbd->tx_bd_haddr_lo = (u64) map & 0xffffffff;
@@ -5802,18 +5808,18 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode) · 1 unmodified line
58025808 txbd->tx_bd_vlan_tag_flags = TX_BD_FLAGS_START | TX_BD_FLAGS_END;
58035809
58045810 num_pkts++;
5805− txr->tx_prod = NEXT_TX_BD(txr->tx_prod);
5811+ txr->tx_prod = BNX2_NEXT_TX_BD(txr->tx_prod);
58065812 txr->tx_prod_bseq += pkt_size;
58075813
5808− REG_WR16(bp, txr->tx_bidx_addr, txr->tx_prod);
5809− REG_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq);
5814+ BNX2_WR16(bp, txr->tx_bidx_addr, txr->tx_prod);
5815+ BNX2_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq);
58105816
58115817 udelay(100);
58125818
5813− REG_WR(bp, BNX2_HC_COMMAND,
5814− bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
5819+ BNX2_WR(bp, BNX2_HC_COMMAND,
5820+ bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
58155821
5816− REG_RD(bp, BNX2_HC_COMMAND);
5822+ BNX2_RD(bp, BNX2_HC_COMMAND);
58175823
58185824 udelay(5);
58195825
@@ -5962,14 +5968,14 @@ bnx2_test_intr(struct bnx2 *bp) · 142 unmodified lines
59625968 if (!netif_running(bp->dev))
59635969 return -ENODEV;
59645970
5965− status_idx = REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff;
5971+ status_idx = BNX2_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff;
59665972
59675973 /* This register is not touched during run-time. */
5968− REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW);
5969− REG_RD(bp, BNX2_HC_COMMAND);
5974+ BNX2_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW);
5975+ BNX2_RD(bp, BNX2_HC_COMMAND);
59705976
59715977 for (i = 0; i < 10; i++) {
5972− if ((REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff) !=
5978+ if ((BNX2_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff) !=
59735979 status_idx) {
59745980
59755981 break;
@@ -6132,11 +6138,11 @@ bnx2_timer(unsigned long data) · 156 unmodified lines
61326138
61336139 /* workaround occasional corrupted counters */
61346140 if ((bp->flags & BNX2_FLAG_BROKEN_STATS) && bp->stats_ticks)
6135− REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd |
6136− BNX2_HC_COMMAND_STATS_NOW);
6141+ BNX2_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd |
6142+ BNX2_HC_COMMAND_STATS_NOW);
61376143
61386144 if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {
6139− if (CHIP_NUM(bp) == CHIP_NUM_5706)
6145+ if (BNX2_CHIP(bp) == BNX2_CHIP_5706)
61406146 bnx2_5706_serdes_timer(bp);
61416147 else
61426148 bnx2_5708_serdes_timer(bp);
@@ -6205,13 +6211,13 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs) · 62 unmodified lines
62056211 const int len = sizeof(bp->irq_tbl[0].name);
62066212
62076213 bnx2_setup_msix_tbl(bp);
6208− REG_WR(bp, BNX2_PCI_MSIX_CONTROL, BNX2_MAX_MSIX_HW_VEC - 1);
6209− REG_WR(bp, BNX2_PCI_MSIX_TBL_OFF_BIR, BNX2_PCI_GRC_WINDOW2_BASE);
6210− REG_WR(bp, BNX2_PCI_MSIX_PBA_OFF_BIT, BNX2_PCI_GRC_WINDOW3_BASE);
6214+ BNX2_WR(bp, BNX2_PCI_MSIX_CONTROL, BNX2_MAX_MSIX_HW_VEC - 1);
6215+ BNX2_WR(bp, BNX2_PCI_MSIX_TBL_OFF_BIR, BNX2_PCI_GRC_WINDOW2_BASE);
6216+ BNX2_WR(bp, BNX2_PCI_MSIX_PBA_OFF_BIT, BNX2_PCI_GRC_WINDOW3_BASE);
62116217
62126218 /* Need to flush the previous three writes to ensure MSI-X
62136219 * is setup properly */
6214− REG_RD(bp, BNX2_PCI_MSIX_CONTROL);
6220+ BNX2_RD(bp, BNX2_PCI_MSIX_CONTROL);
62156221
62166222 for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
62176223 msix_ent[i].entry = i;
@@ -6274,7 +6280,7 @@ bnx2_setup_int_mode(struct bnx2 *bp, int dis_msi) · 56 unmodified lines
62746280 !(bp->flags & BNX2_FLAG_USING_MSIX)) {
62756281 if (pci_enable_msi(bp->pdev) == 0) {
62766282 bp->flags |= BNX2_FLAG_USING_MSI;
6277− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
6283+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
62786284 bp->flags |= BNX2_FLAG_ONE_SHOT_MSI;
62796285 bp->irq_tbl[0].handler = bnx2_msi_1shot;
62806286 } else
@@ -6464,22 +6470,22 @@ bnx2_dump_ftq(struct bnx2 *bp) · 183 unmodified lines
64646470 netdev_err(dev, "<--- end FTQ dump --->\n");
64656471 netdev_err(dev, "<--- start TBDC dump --->\n");
64666472 netdev_err(dev, "TBDC free cnt: %ld\n",
6467− REG_RD(bp, BNX2_TBDC_STATUS) & BNX2_TBDC_STATUS_FREE_CNT);
6473+ BNX2_RD(bp, BNX2_TBDC_STATUS) & BNX2_TBDC_STATUS_FREE_CNT);
64686474 netdev_err(dev, "LINE CID BIDX CMD VALIDS\n");
64696475 for (i = 0; i < 0x20; i++) {
64706476 int j = 0;
64716477
6472− REG_WR(bp, BNX2_TBDC_BD_ADDR, i);
6473− REG_WR(bp, BNX2_TBDC_CAM_OPCODE,
6474− BNX2_TBDC_CAM_OPCODE_OPCODE_CAM_READ);
6475− REG_WR(bp, BNX2_TBDC_COMMAND, BNX2_TBDC_COMMAND_CMD_REG_ARB);
6476− while ((REG_RD(bp, BNX2_TBDC_COMMAND) &
6478+ BNX2_WR(bp, BNX2_TBDC_BD_ADDR, i);
6479+ BNX2_WR(bp, BNX2_TBDC_CAM_OPCODE,
6480+ BNX2_TBDC_CAM_OPCODE_OPCODE_CAM_READ);
6481+ BNX2_WR(bp, BNX2_TBDC_COMMAND, BNX2_TBDC_COMMAND_CMD_REG_ARB);
6482+ while ((BNX2_RD(bp, BNX2_TBDC_COMMAND) &
64776483 BNX2_TBDC_COMMAND_CMD_REG_ARB) && j < 100)
64786484 j++;
64796485
6480− cid = REG_RD(bp, BNX2_TBDC_CID);
6481− bdidx = REG_RD(bp, BNX2_TBDC_BIDX);
6482− valid = REG_RD(bp, BNX2_TBDC_CAM_OPCODE);
6486+ cid = BNX2_RD(bp, BNX2_TBDC_CID);
6487+ bdidx = BNX2_RD(bp, BNX2_TBDC_BIDX);
6488+ valid = BNX2_RD(bp, BNX2_TBDC_CAM_OPCODE);
64836489 netdev_err(dev, "%02x %06x %04lx %02x [%x]\n",
64846490 i, cid, bdidx & BNX2_TBDC_BDIDX_BDIDX,
64856491 bdidx >> 24, (valid >> 8) & 0x0ff);
@@ -6500,15 +6506,15 @@ bnx2_dump_state(struct bnx2 *bp) · 14 unmodified lines
65006506 pci_read_config_dword(bp->pdev, BNX2_PCICFG_MISC_CONFIG, &val2);
65016507 netdev_err(dev, "DEBUG: PCI_PM[%08x] PCI_MISC_CFG[%08x]\n", val1, val2);
65026508 netdev_err(dev, "DEBUG: EMAC_TX_STATUS[%08x] EMAC_RX_STATUS[%08x]\n",
6503− REG_RD(bp, BNX2_EMAC_TX_STATUS),
6504− REG_RD(bp, BNX2_EMAC_RX_STATUS));
6509+ BNX2_RD(bp, BNX2_EMAC_TX_STATUS),
6510+ BNX2_RD(bp, BNX2_EMAC_RX_STATUS));
65056511 netdev_err(dev, "DEBUG: RPM_MGMT_PKT_CTRL[%08x]\n",
6506− REG_RD(bp, BNX2_RPM_MGMT_PKT_CTRL));
6512+ BNX2_RD(bp, BNX2_RPM_MGMT_PKT_CTRL));
65076513 netdev_err(dev, "DEBUG: HC_STATS_INTERRUPT_STATUS[%08x]\n",
6508− REG_RD(bp, BNX2_HC_STATS_INTERRUPT_STATUS));
6514+ BNX2_RD(bp, BNX2_HC_STATS_INTERRUPT_STATUS));
65096515 if (bp->flags & BNX2_FLAG_USING_MSIX)
65106516 netdev_err(dev, "DEBUG: PBA[%08x]\n",
6511− REG_RD(bp, BNX2_PCI_GRC_WINDOW3_BASE));
6517+ BNX2_RD(bp, BNX2_PCI_GRC_WINDOW3_BASE));
65126518 }
65136519
65146520 static void
@@ -6533,8 +6539,8 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) · 18 unmodified lines
65336539 {
65346540 struct bnx2 *bp = netdev_priv(dev);
65356541 dma_addr_t mapping;
6536− struct tx_bd *txbd;
6537− struct sw_tx_bd *tx_buf;
6542+ struct bnx2_tx_bd *txbd;
6543+ struct bnx2_sw_tx_bd *tx_buf;
65386544 u32 len, vlan_tag_flags, last_frag, mss;
65396545 u16 prod, ring_prod;
65406546 int i;
@@ -6557,7 +6563,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) · 16 unmodified lines
65576563 }
65586564 len = skb_headlen(skb);
65596565 prod = txr->tx_prod;
6560− ring_prod = TX_RING_IDX(prod);
6566+ ring_prod = BNX2_TX_RING_IDX(prod);
65616567
65626568 vlan_tag_flags = 0;
65636569 if (skb->ip_summed == CHECKSUM_PARTIAL) {
@@ -6627,8 +6633,8 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) · 63 unmodified lines
66276633 for (i = 0; i < last_frag; i++) {
66286634 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
66296635
6630− prod = NEXT_TX_BD(prod);
6631− ring_prod = TX_RING_IDX(prod);
6636+ prod = BNX2_NEXT_TX_BD(prod);
6637+ ring_prod = BNX2_TX_RING_IDX(prod);
66326638 txbd = &txr->tx_desc_ring[ring_prod];
66336639
66346640 len = skb_frag_size(frag);
@@ -6652,11 +6658,11 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) · 17 unmodified lines
66526658
66536659 netdev_tx_sent_queue(txq, skb->len);
66546660
6655− prod = NEXT_TX_BD(prod);
6661+ prod = BNX2_NEXT_TX_BD(prod);
66566662 txr->tx_prod_bseq += skb->len;
66576663
6658− REG_WR16(bp, txr->tx_bidx_addr, prod);
6659− REG_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq);
6664+ BNX2_WR16(bp, txr->tx_bidx_addr, prod);
6665+ BNX2_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq);
66606666
66616667 mmiowb();
66626668
@@ -6682,7 +6688,7 @@ dma_error: · 19 unmodified lines
66826688
66836689 /* start back at beginning and unmap skb */
66846690 prod = txr->tx_prod;
6685− ring_prod = TX_RING_IDX(prod);
6691+ ring_prod = BNX2_TX_RING_IDX(prod);
66866692 tx_buf = &txr->tx_buf_ring[ring_prod];
66876693 tx_buf->skb = NULL;
66886694 dma_unmap_single(&bp->pdev->dev, dma_unmap_addr(tx_buf, mapping),
@@ -6690,8 +6696,8 @@ dma_error: · 1 unmodified line
66906696
66916697 /* unmap remaining mapped pages */
66926698 for (i = 0; i < last_frag; i++) {
6693− prod = NEXT_TX_BD(prod);
6694− ring_prod = TX_RING_IDX(prod);
6699+ prod = BNX2_NEXT_TX_BD(prod);
6700+ ring_prod = BNX2_TX_RING_IDX(prod);
66956701 tx_buf = &txr->tx_buf_ring[ring_prod];
66966702 dma_unmap_page(&bp->pdev->dev, dma_unmap_addr(tx_buf, mapping),
66976703 skb_frag_size(&skb_shinfo(skb)->frags[i]),
@@ -6810,8 +6816,8 @@ bnx2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *net_stats) · 112 unmodified lines
68106816 GET_32BIT_NET_STATS(stat_Dot3StatsExcessiveCollisions) +
68116817 GET_32BIT_NET_STATS(stat_Dot3StatsLateCollisions);
68126818
6813− if ((CHIP_NUM(bp) == CHIP_NUM_5706) ||
6814− (CHIP_ID(bp) == CHIP_ID_5708_A0))
6819+ if ((BNX2_CHIP(bp) == BNX2_CHIP_5706) ||
6820+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_A0))
68156821 net_stats->tx_carrier_errors = 0;
68166822 else {
68176823 net_stats->tx_carrier_errors =
@@ -7030,7 +7036,7 @@ bnx2_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *_p) · 212 unmodified lines
70307036 offset = reg_boundaries[0];
70317037 p += offset;
70327038 while (offset < BNX2_REGDUMP_LEN) {
7033− *p++ = REG_RD(bp, offset);
7039+ *p++ = BNX2_RD(bp, offset);
70347040 offset += 4;
70357041 if (offset == reg_boundaries[i + 1]) {
70367042 offset = reg_boundaries[i + 2];
@@ -7254,13 +7260,13 @@ bnx2_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) · 217 unmodified lines
72547260 {
72557261 struct bnx2 *bp = netdev_priv(dev);
72567262
7257− ering->rx_max_pending = MAX_TOTAL_RX_DESC_CNT;
7258− ering->rx_jumbo_max_pending = MAX_TOTAL_RX_PG_DESC_CNT;
7263+ ering->rx_max_pending = BNX2_MAX_TOTAL_RX_DESC_CNT;
7264+ ering->rx_jumbo_max_pending = BNX2_MAX_TOTAL_RX_PG_DESC_CNT;
72597265
72607266 ering->rx_pending = bp->rx_ring_size;
72617267 ering->rx_jumbo_pending = bp->rx_pg_ring_size;
72627268
7263− ering->tx_max_pending = MAX_TX_DESC_CNT;
7269+ ering->tx_max_pending = BNX2_MAX_TX_DESC_CNT;
72647270 ering->tx_pending = bp->tx_ring_size;
72657271 }
72667272
@@ -7326,8 +7332,8 @@ bnx2_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) · 59 unmodified lines
73267332 struct bnx2 *bp = netdev_priv(dev);
73277333 int rc;
73287334
7329− if ((ering->rx_pending > MAX_TOTAL_RX_DESC_CNT) ||
7330− (ering->tx_pending > MAX_TX_DESC_CNT) ||
7335+ if ((ering->rx_pending > BNX2_MAX_TOTAL_RX_DESC_CNT) ||
7336+ (ering->tx_pending > BNX2_MAX_TX_DESC_CNT) ||
73317337 (ering->tx_pending <= MAX_SKB_FRAGS)) {
73327338
73337339 return -EINVAL;
@@ -7614,10 +7620,10 @@ bnx2_get_ethtool_stats(struct net_device *dev, · 280 unmodified lines
76147620 return;
76157621 }
76167622
7617− if ((CHIP_ID(bp) == CHIP_ID_5706_A0) ||
7618− (CHIP_ID(bp) == CHIP_ID_5706_A1) ||
7619− (CHIP_ID(bp) == CHIP_ID_5706_A2) ||
7620− (CHIP_ID(bp) == CHIP_ID_5708_A0))
7623+ if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) ||
7624+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1) ||
7625+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A2) ||
7626+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_A0))
76217627 stats_len_arr = bnx2_5706_stats_len_arr;
76227628 else
76237629 stats_len_arr = bnx2_5708_stats_len_arr;
@@ -7655,26 +7661,26 @@ bnx2_set_phys_id(struct net_device *dev, enum ethtool_phys_id_state state) · 31 unmodified lines
76557661 case ETHTOOL_ID_ACTIVE:
76567662 bnx2_set_power_state(bp, PCI_D0);
76577663
7658− bp->leds_save = REG_RD(bp, BNX2_MISC_CFG);
7659− REG_WR(bp, BNX2_MISC_CFG, BNX2_MISC_CFG_LEDMODE_MAC);
7664+ bp->leds_save = BNX2_RD(bp, BNX2_MISC_CFG);
7665+ BNX2_WR(bp, BNX2_MISC_CFG, BNX2_MISC_CFG_LEDMODE_MAC);
76607666 return 1; /* cycle on/off once per second */
76617667
76627668 case ETHTOOL_ID_ON:
7663− REG_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE |
7664− BNX2_EMAC_LED_1000MB_OVERRIDE |
7665− BNX2_EMAC_LED_100MB_OVERRIDE |
7666− BNX2_EMAC_LED_10MB_OVERRIDE |
7667− BNX2_EMAC_LED_TRAFFIC_OVERRIDE |
7668− BNX2_EMAC_LED_TRAFFIC);
7669+ BNX2_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE |
7670+ BNX2_EMAC_LED_1000MB_OVERRIDE |
7671+ BNX2_EMAC_LED_100MB_OVERRIDE |
7672+ BNX2_EMAC_LED_10MB_OVERRIDE |
7673+ BNX2_EMAC_LED_TRAFFIC_OVERRIDE |
7674+ BNX2_EMAC_LED_TRAFFIC);
76697675 break;
76707676
76717677 case ETHTOOL_ID_OFF:
7672− REG_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE);
7678+ BNX2_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE);
76737679 break;
76747680
76757681 case ETHTOOL_ID_INACTIVE:
7676− REG_WR(bp, BNX2_EMAC_LED, 0);
7677− REG_WR(bp, BNX2_MISC_CFG, bp->leds_save);
7682+ BNX2_WR(bp, BNX2_EMAC_LED, 0);
7683+ BNX2_WR(bp, BNX2_MISC_CFG, bp->leds_save);
76787684
76797685 if (!netif_running(dev))
76807686 bnx2_set_power_state(bp, PCI_D3hot);
@@ -7896,10 +7902,10 @@ poll_bnx2(struct net_device *dev) · 215 unmodified lines
78967902 }
78977903 #endif
78987904
7899−static void __devinit
7905+static void
79007906 bnx2_get_5709_media(struct bnx2 *bp)
79017907 {
7902− u32 val = REG_RD(bp, BNX2_MISC_DUAL_MEDIA_CTRL);
7908+ u32 val = BNX2_RD(bp, BNX2_MISC_DUAL_MEDIA_CTRL);
79037909 u32 bond_id = val & BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID;
79047910 u32 strap;
79057911
@@ -7934,18 +7940,18 @@ bnx2_get_5709_media(struct bnx2 *bp) · 28 unmodified lines
79347940 }
79357941 }
79367942
7937−static void __devinit
7943+static void
79387944 bnx2_get_pci_speed(struct bnx2 *bp)
79397945 {
79407946 u32 reg;
79417947
7942− reg = REG_RD(bp, BNX2_PCICFG_MISC_STATUS);
7948+ reg = BNX2_RD(bp, BNX2_PCICFG_MISC_STATUS);
79437949 if (reg & BNX2_PCICFG_MISC_STATUS_PCIX_DET) {
79447950 u32 clkreg;
79457951
79467952 bp->flags |= BNX2_FLAG_PCIX;
79477953
7948− clkreg = REG_RD(bp, BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS);
7954+ clkreg = BNX2_RD(bp, BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS);
79497955
79507956 clkreg &= BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET;
79517957 switch (clkreg) {
@@ -7986,7 +7992,7 @@ bnx2_get_pci_speed(struct bnx2 *bp) · 34 unmodified lines
79867992
79877993 }
79887994
7989−static void __devinit
7995+static void
79907996 bnx2_read_vpd_fw_ver(struct bnx2 *bp)
79917997 {
79927998 int rc, i, j;
@@ -8054,7 +8060,7 @@ vpd_done: · 61 unmodified lines
80548060 kfree(data);
80558061 }
80568062
8057−static int __devinit
8063+static int
80588064 bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
80598065 {
80608066 struct bnx2 *bp;
@@ -8131,20 +8137,20 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 70 unmodified lines
81318137 * Rely on CPU to do target byte swapping on big endian systems
81328138 * The chip's target access swapping will not swap all accesses
81338139 */
8134− REG_WR(bp, BNX2_PCICFG_MISC_CONFIG,
8135− BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |
8136− BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP);
8140+ BNX2_WR(bp, BNX2_PCICFG_MISC_CONFIG,
8141+ BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |
8142+ BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP);
81378143
8138− bp->chip_id = REG_RD(bp, BNX2_MISC_ID);
8144+ bp->chip_id = BNX2_RD(bp, BNX2_MISC_ID);
81398145
8140− if (CHIP_NUM(bp) == CHIP_NUM_5709) {
8146+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
81418147 if (!pci_is_pcie(pdev)) {
81428148 dev_err(&pdev->dev, "Not PCIE, aborting\n");
81438149 rc = -EIO;
81448150 goto err_out_unmap;
81458151 }
81468152 bp->flags |= BNX2_FLAG_PCIE;
8147− if (CHIP_REV(bp) == CHIP_REV_Ax)
8153+ if (BNX2_CHIP_REV(bp) == BNX2_CHIP_REV_Ax)
81488154 bp->flags |= BNX2_FLAG_JUMBO_BROKEN;
81498155
81508156 /* AER (Advanced Error Reporting) hooks */
@@ -8163,18 +8169,20 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 12 unmodified lines
81638169 bp->flags |= BNX2_FLAG_BROKEN_STATS;
81648170 }
81658171
8166− if (CHIP_NUM(bp) == CHIP_NUM_5709 && CHIP_REV(bp) != CHIP_REV_Ax) {
8172+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709 &&
8173+ BNX2_CHIP_REV(bp) != BNX2_CHIP_REV_Ax) {
81678174 if (pci_find_capability(pdev, PCI_CAP_ID_MSIX))
81688175 bp->flags |= BNX2_FLAG_MSIX_CAP;
81698176 }
81708177
8171− if (CHIP_ID(bp) != CHIP_ID_5706_A0 && CHIP_ID(bp) != CHIP_ID_5706_A1) {
8178+ if (BNX2_CHIP_ID(bp) != BNX2_CHIP_ID_5706_A0 &&
8179+ BNX2_CHIP_ID(bp) != BNX2_CHIP_ID_5706_A1) {
81728180 if (pci_find_capability(pdev, PCI_CAP_ID_MSI))
81738181 bp->flags |= BNX2_FLAG_MSI_CAP;
81748182 }
81758183
81768184 /* 5708 cannot support DMA addresses > 40-bit. */
8177− if (CHIP_NUM(bp) == CHIP_NUM_5708)
8185+ if (BNX2_CHIP(bp) == BNX2_CHIP_5708)
81788186 persist_dma_mask = dma_mask = DMA_BIT_MASK(40);
81798187 else
81808188 persist_dma_mask = dma_mask = DMA_BIT_MASK(64);
@@ -8197,12 +8205,11 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 16 unmodified lines
81978205 bnx2_get_pci_speed(bp);
81988206
81998207 /* 5706A0 may falsely detect SERR and PERR. */
8200− if (CHIP_ID(bp) == CHIP_ID_5706_A0) {
8201− reg = REG_RD(bp, PCI_COMMAND);
8208+ if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) {
8209+ reg = BNX2_RD(bp, PCI_COMMAND);
82028210 reg &= ~(PCI_COMMAND_SERR | PCI_COMMAND_PARITY);
8203− REG_WR(bp, PCI_COMMAND, reg);
8204− }
8205− else if ((CHIP_ID(bp) == CHIP_ID_5706_A1) &&
8211+ BNX2_WR(bp, PCI_COMMAND, reg);
8212+ } else if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1) &&
82068213 !(bp->flags & BNX2_FLAG_PCIX)) {
82078214
82088215 dev_err(&pdev->dev,
@@ -8299,7 +8306,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 90 unmodified lines
82998306 bp->mac_addr[4] = (u8) (reg >> 8);
83008307 bp->mac_addr[5] = (u8) reg;
83018308
8302− bp->tx_ring_size = MAX_TX_DESC_CNT;
8309+ bp->tx_ring_size = BNX2_MAX_TX_DESC_CNT;
83038310 bnx2_set_rx_ring_size(bp, 255);
83048311
83058312 bp->tx_quick_cons_trip_int = 2;
@@ -8319,9 +8326,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 13 unmodified lines
83198326 bp->phy_addr = 1;
83208327
83218328 /* Disable WOL support if we are running on a SERDES chip. */
8322− if (CHIP_NUM(bp) == CHIP_NUM_5709)
8329+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
83238330 bnx2_get_5709_media(bp);
8324− else if (CHIP_BOND_ID(bp) & CHIP_BOND_ID_SERDES_BIT)
8331+ else if (BNX2_CHIP_BOND(bp) & BNX2_CHIP_BOND_SERDES_BIT)
83258332 bp->phy_flags |= BNX2_PHY_FLAG_SERDES;
83268333
83278334 bp->phy_port = PORT_TP;
@@ -8332,7 +8339,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 4 unmodified lines
83328339 bp->flags |= BNX2_FLAG_NO_WOL;
83338340 bp->wol = 0;
83348341 }
8335− if (CHIP_NUM(bp) == CHIP_NUM_5706) {
8342+ if (BNX2_CHIP(bp) == BNX2_CHIP_5706) {
83368343 /* Don't do parallel detect on this board because of
83378344 * some board problems. The link will not go down
83388345 * if we do parallel detect.
@@ -8345,25 +8352,25 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 6 unmodified lines
83458352 if (reg & BNX2_SHARED_HW_CFG_PHY_2_5G)
83468353 bp->phy_flags |= BNX2_PHY_FLAG_2_5G_CAPABLE;
83478354 }
8348− } else if (CHIP_NUM(bp) == CHIP_NUM_5706 ||
8349− CHIP_NUM(bp) == CHIP_NUM_5708)
8355+ } else if (BNX2_CHIP(bp) == BNX2_CHIP_5706 ||
8356+ BNX2_CHIP(bp) == BNX2_CHIP_5708)
83508357 bp->phy_flags |= BNX2_PHY_FLAG_CRC_FIX;
8351− else if (CHIP_NUM(bp) == CHIP_NUM_5709 &&
8352− (CHIP_REV(bp) == CHIP_REV_Ax ||
8353− CHIP_REV(bp) == CHIP_REV_Bx))
8358+ else if (BNX2_CHIP(bp) == BNX2_CHIP_5709 &&
8359+ (BNX2_CHIP_REV(bp) == BNX2_CHIP_REV_Ax ||
8360+ BNX2_CHIP_REV(bp) == BNX2_CHIP_REV_Bx))
83548361 bp->phy_flags |= BNX2_PHY_FLAG_DIS_EARLY_DAC;
83558362
83568363 bnx2_init_fw_cap(bp);
83578364
8358− if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||
8359− (CHIP_ID(bp) == CHIP_ID_5708_B0) ||
8360− (CHIP_ID(bp) == CHIP_ID_5708_B1) ||
8361− !(REG_RD(bp, BNX2_PCI_CONFIG_3) & BNX2_PCI_CONFIG_3_VAUX_PRESET)) {
8365+ if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_A0) ||
8366+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_B0) ||
8367+ (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_B1) ||
8368+ !(BNX2_RD(bp, BNX2_PCI_CONFIG_3) & BNX2_PCI_CONFIG_3_VAUX_PRESET)) {
83628369 bp->flags |= BNX2_FLAG_NO_WOL;
83638370 bp->wol = 0;
83648371 }
83658372
8366− if (CHIP_ID(bp) == CHIP_ID_5706_A0) {
8373+ if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) {
83678374 bp->tx_quick_cons_trip_int =
83688375 bp->tx_quick_cons_trip;
83698376 bp->tx_ticks_int = bp->tx_ticks;
@@ -8385,7 +8392,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 15 unmodified lines
83858392 * AMD believes this incompatibility is unique to the 5706, and
83868393 * prefers to locally disable MSI rather than globally disabling it.
83878394 */
8388− if (CHIP_NUM(bp) == CHIP_NUM_5706 && disable_msi == 0) {
8395+ if (BNX2_CHIP(bp) == BNX2_CHIP_5706 && disable_msi == 0) {
83898396 struct pci_dev *amd_8132 = NULL;
83908397
83918398 while ((amd_8132 = pci_get_device(PCI_VENDOR_ID_AMD,
@@ -8414,6 +8421,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 22 unmodified lines
84148421 bp->cnic_eth_dev.max_iscsi_conn =
84158422 (bnx2_shmem_rd(bp, BNX2_ISCSI_MAX_CONN) &
84168423 BNX2_ISCSI_MAX_CONN_MASK) >> BNX2_ISCSI_MAX_CONN_SHIFT;
8424+ bp->cnic_probe = bnx2_cnic_probe;
84178425 #endif
84188426 pci_save_state(pdev);
84198427
@@ -8439,7 +8447,7 @@ err_out: · 19 unmodified lines
84398447 return rc;
84408448 }
84418449
8442−static char * __devinit
8450+static char *
84438451 bnx2_bus_string(struct bnx2 *bp, char *str)
84448452 {
84458453 char *s = str;
@@ -8505,7 +8513,7 @@ static const struct net_device_ops bnx2_netdev_ops = { · 59 unmodified lines
85058513 #endif
85068514 };
85078515
8508−static int __devinit
8516+static int
85098517 bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
85108518 {
85118519 static int version_printed = 0;
@@ -8541,7 +8549,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 29 unmodified lines
85418549 NETIF_F_TSO | NETIF_F_TSO_ECN |
85428550 NETIF_F_RXHASH | NETIF_F_RXCSUM;
85438551
8544− if (CHIP_NUM(bp) == CHIP_NUM_5709)
8552+ if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
85458553 dev->hw_features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
85468554
85478555 dev->vlan_features = dev->hw_features;
@@ -8556,8 +8564,8 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 8 unmodified lines
85568564
85578565 netdev_info(dev, "%s (%c%d) %s found at mem %lx, IRQ %d, "
85588566 "node addr %pM\n", board_info[ent->driver_data].name,
8559− ((CHIP_ID(bp) & 0xf000) >> 12) + 'A',
8560− ((CHIP_ID(bp) & 0x0ff0) >> 4),
8567+ ((BNX2_CHIP_ID(bp) & 0xf000) >> 12) + 'A',
8568+ ((BNX2_CHIP_ID(bp) & 0x0ff0) >> 4),
85618569 bnx2_bus_string(bp, str), (long)pci_resource_start(pdev, 0),
85628570 pdev->irq, dev->dev_addr);
85638571
@@ -8573,7 +8581,7 @@ err_free: · 9 unmodified lines
85738581 return rc;
85748582 }
85758583
8576−static void __devexit
8584+static void
85778585 bnx2_remove_one(struct pci_dev *pdev)
85788586 {
85798587 struct net_device *dev = pci_get_drvdata(pdev);
@@ -8752,7 +8760,7 @@ static struct pci_driver bnx2_pci_driver = { · 172 unmodified lines
87528760 .name = DRV_MODULE_NAME,
87538761 .id_table = bnx2_pci_tbl,
87548762 .probe = bnx2_init_one,
8755− .remove = __devexit_p(bnx2_remove_one),
8763+ .remove = bnx2_remove_one,
87568764 .suspend = bnx2_suspend,
87578765 .resume = bnx2_resume,
87588766 .err_handler = &bnx2_err_handler,
drivers/net/ethernet/broadcom/bnx2.h+67−67
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 /*
2121 * tx_bd definition
2222 */
23−struct tx_bd {
23+struct bnx2_tx_bd {
2424 u32 tx_bd_haddr_hi;
2525 u32 tx_bd_haddr_lo;
2626 u32 tx_bd_mss_nbytes;
@@ -48,7 +48,7 @@ struct tx_bd { · 21 unmodified lines
4848 /*
4949 * rx_bd definition
5050 */
51−struct rx_bd {
51+struct bnx2_rx_bd {
5252 u32 rx_bd_haddr_hi;
5353 u32 rx_bd_haddr_lo;
5454 u32 rx_bd_len;
@@ -6538,37 +6538,38 @@ struct l2_fhdr { · 6483 unmodified lines
65386538
65396539 /* Use CPU native page size up to 16K for the ring sizes. */
65406540 #if (PAGE_SHIFT > 14)
6541−#define BCM_PAGE_BITS 14
6541+#define BNX2_PAGE_BITS 14
65426542 #else
6543−#define BCM_PAGE_BITS PAGE_SHIFT
6543+#define BNX2_PAGE_BITS PAGE_SHIFT
65446544 #endif
6545−#define BCM_PAGE_SIZE (1 << BCM_PAGE_BITS)
6545+#define BNX2_PAGE_SIZE (1 << BNX2_PAGE_BITS)
65466546
6547−#define TX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct tx_bd))
6548−#define MAX_TX_DESC_CNT (TX_DESC_CNT - 1)
6547+#define BNX2_TX_DESC_CNT (BNX2_PAGE_SIZE / sizeof(struct bnx2_tx_bd))
6548+#define BNX2_MAX_TX_DESC_CNT (BNX2_TX_DESC_CNT - 1)
65496549
6550−#define MAX_RX_RINGS 8
6551−#define MAX_RX_PG_RINGS 32
6552−#define RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct rx_bd))
6553−#define MAX_RX_DESC_CNT (RX_DESC_CNT - 1)
6554−#define MAX_TOTAL_RX_DESC_CNT (MAX_RX_DESC_CNT * MAX_RX_RINGS)
6555−#define MAX_TOTAL_RX_PG_DESC_CNT (MAX_RX_DESC_CNT * MAX_RX_PG_RINGS)
6550+#define BNX2_MAX_RX_RINGS 8
6551+#define BNX2_MAX_RX_PG_RINGS 32
6552+#define BNX2_RX_DESC_CNT (BNX2_PAGE_SIZE / sizeof(struct bnx2_rx_bd))
6553+#define BNX2_MAX_RX_DESC_CNT (BNX2_RX_DESC_CNT - 1)
6554+#define BNX2_MAX_TOTAL_RX_DESC_CNT (BNX2_MAX_RX_DESC_CNT * BNX2_MAX_RX_RINGS)
6555+#define BNX2_MAX_TOTAL_RX_PG_DESC_CNT \
6556+ (BNX2_MAX_RX_DESC_CNT * BNX2_MAX_RX_PG_RINGS)
65566557
6557−#define NEXT_TX_BD(x) (((x) & (MAX_TX_DESC_CNT - 1)) == \
6558− (MAX_TX_DESC_CNT - 1)) ? \
6558+#define BNX2_NEXT_TX_BD(x) (((x) & (BNX2_MAX_TX_DESC_CNT - 1)) == \
6559+ (BNX2_MAX_TX_DESC_CNT - 1)) ? \
65596560 (x) + 2 : (x) + 1
65606561
6561−#define TX_RING_IDX(x) ((x) & MAX_TX_DESC_CNT)
6562+#define BNX2_TX_RING_IDX(x) ((x) & BNX2_MAX_TX_DESC_CNT)
65626563
6563−#define NEXT_RX_BD(x) (((x) & (MAX_RX_DESC_CNT - 1)) == \
6564− (MAX_RX_DESC_CNT - 1)) ? \
6564+#define BNX2_NEXT_RX_BD(x) (((x) & (BNX2_MAX_RX_DESC_CNT - 1)) == \
6565+ (BNX2_MAX_RX_DESC_CNT - 1)) ? \
65656566 (x) + 2 : (x) + 1
65666567
6567−#define RX_RING_IDX(x) ((x) & bp->rx_max_ring_idx)
6568−#define RX_PG_RING_IDX(x) ((x) & bp->rx_max_pg_ring_idx)
6568+#define BNX2_RX_RING_IDX(x) ((x) & bp->rx_max_ring_idx)
6569+#define BNX2_RX_PG_RING_IDX(x) ((x) & bp->rx_max_pg_ring_idx)
65696570
6570−#define RX_RING(x) (((x) & ~MAX_RX_DESC_CNT) >> (BCM_PAGE_BITS - 4))
6571−#define RX_IDX(x) ((x) & MAX_RX_DESC_CNT)
6571+#define BNX2_RX_RING(x) (((x) & ~BNX2_MAX_RX_DESC_CNT) >> (BNX2_PAGE_BITS - 4))
6572+#define BNX2_RX_IDX(x) ((x) & BNX2_MAX_RX_DESC_CNT)
65726573
65736574 /* Context size. */
65746575 #define CTX_SHIFT 7
@@ -6609,7 +6610,7 @@ struct l2_fhdr { · 34 unmodified lines
66096610 * RX ring buffer contains pointer to kmalloc() data only,
66106611 * skb are built only after Hardware filled the frame.
66116612 */
6612−struct sw_bd {
6613+struct bnx2_sw_bd {
66136614 u8 *data;
66146615 DEFINE_DMA_UNMAP_ADDR(mapping);
66156616 };
@@ -6623,23 +6624,23 @@ static inline struct l2_fhdr *get_l2_fhdr(u8 *data) · 7 unmodified lines
66236624 }
66246625
66256626
6626−struct sw_pg {
6627+struct bnx2_sw_pg {
66276628 struct page *page;
66286629 DEFINE_DMA_UNMAP_ADDR(mapping);
66296630 };
66306631
6631−struct sw_tx_bd {
6632+struct bnx2_sw_tx_bd {
66326633 struct sk_buff *skb;
66336634 DEFINE_DMA_UNMAP_ADDR(mapping);
66346635 unsigned short is_gso;
66356636 unsigned short nr_frags;
66366637 };
66376638
6638−#define SW_RXBD_RING_SIZE (sizeof(struct sw_bd) * RX_DESC_CNT)
6639−#define SW_RXPG_RING_SIZE (sizeof(struct sw_pg) * RX_DESC_CNT)
6640−#define RXBD_RING_SIZE (sizeof(struct rx_bd) * RX_DESC_CNT)
6641−#define SW_TXBD_RING_SIZE (sizeof(struct sw_tx_bd) * TX_DESC_CNT)
6642−#define TXBD_RING_SIZE (sizeof(struct tx_bd) * TX_DESC_CNT)
6639+#define SW_RXBD_RING_SIZE (sizeof(struct bnx2_sw_bd) * BNX2_RX_DESC_CNT)
6640+#define SW_RXPG_RING_SIZE (sizeof(struct bnx2_sw_pg) * BNX2_RX_DESC_CNT)
6641+#define RXBD_RING_SIZE (sizeof(struct bnx2_rx_bd) * BNX2_RX_DESC_CNT)
6642+#define SW_TXBD_RING_SIZE (sizeof(struct bnx2_sw_tx_bd) * BNX2_TX_DESC_CNT)
6643+#define TXBD_RING_SIZE (sizeof(struct bnx2_tx_bd) * BNX2_TX_DESC_CNT)
66436644
66446645 /* Buffered flash (Atmel: AT45DB011B) specific information */
66456646 #define SEEPROM_PAGE_BITS 2
@@ -6720,8 +6721,8 @@ struct bnx2_tx_ring_info { · 74 unmodified lines
67206721 u32 tx_bidx_addr;
67216722 u32 tx_bseq_addr;
67226723
6723− struct tx_bd *tx_desc_ring;
6724− struct sw_tx_bd *tx_buf_ring;
6724+ struct bnx2_tx_bd *tx_desc_ring;
6725+ struct bnx2_sw_tx_bd *tx_buf_ring;
67256726
67266727 u16 tx_cons;
67276728 u16 hw_tx_cons;
@@ -6741,13 +6742,13 @@ struct bnx2_rx_ring_info { · 13 unmodified lines
67416742 u16 rx_pg_prod;
67426743 u16 rx_pg_cons;
67436744
6744− struct sw_bd *rx_buf_ring;
6745− struct rx_bd *rx_desc_ring[MAX_RX_RINGS];
6746− struct sw_pg *rx_pg_ring;
6747− struct rx_bd *rx_pg_desc_ring[MAX_RX_PG_RINGS];
6745+ struct bnx2_sw_bd *rx_buf_ring;
6746+ struct bnx2_rx_bd *rx_desc_ring[BNX2_MAX_RX_RINGS];
6747+ struct bnx2_sw_pg *rx_pg_ring;
6748+ struct bnx2_rx_bd *rx_pg_desc_ring[BNX2_MAX_RX_PG_RINGS];
67486749
6749− dma_addr_t rx_desc_mapping[MAX_RX_RINGS];
6750− dma_addr_t rx_pg_desc_mapping[MAX_RX_PG_RINGS];
6750+ dma_addr_t rx_desc_mapping[BNX2_MAX_RX_RINGS];
6751+ dma_addr_t rx_pg_desc_mapping[BNX2_MAX_RX_PG_RINGS];
67516752 };
67526753
67536754 struct bnx2_napi {
@@ -6853,33 +6854,31 @@ struct bnx2 { · 99 unmodified lines
68536854
68546855 u32 chip_id;
68556856 /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */
6856−#define CHIP_NUM(bp) (((bp)->chip_id) & 0xffff0000)
6857−#define CHIP_NUM_5706 0x57060000
6858−#define CHIP_NUM_5708 0x57080000
6859−#define CHIP_NUM_5709 0x57090000
6860−
6861−#define CHIP_REV(bp) (((bp)->chip_id) & 0x0000f000)
6862−#define CHIP_REV_Ax 0x00000000
6863−#define CHIP_REV_Bx 0x00001000
6864−#define CHIP_REV_Cx 0x00002000
6865−
6866−#define CHIP_METAL(bp) (((bp)->chip_id) & 0x00000ff0)
6867−#define CHIP_BONDING(bp) (((bp)->chip_id) & 0x0000000f)
6868−
6869−#define CHIP_ID(bp) (((bp)->chip_id) & 0xfffffff0)
6870−#define CHIP_ID_5706_A0 0x57060000
6871−#define CHIP_ID_5706_A1 0x57060010
6872−#define CHIP_ID_5706_A2 0x57060020
6873−#define CHIP_ID_5708_A0 0x57080000
6874−#define CHIP_ID_5708_B0 0x57081000
6875−#define CHIP_ID_5708_B1 0x57081010
6876−#define CHIP_ID_5709_A0 0x57090000
6877−#define CHIP_ID_5709_A1 0x57090010
6878−
6879−#define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf)
6857+#define BNX2_CHIP(bp) (((bp)->chip_id) & 0xffff0000)
6858+#define BNX2_CHIP_5706 0x57060000
6859+#define BNX2_CHIP_5708 0x57080000
6860+#define BNX2_CHIP_5709 0x57090000
6861+
6862+#define BNX2_CHIP_REV(bp) (((bp)->chip_id) & 0x0000f000)
6863+#define BNX2_CHIP_REV_Ax 0x00000000
6864+#define BNX2_CHIP_REV_Bx 0x00001000
6865+#define BNX2_CHIP_REV_Cx 0x00002000
6866+
6867+#define BNX2_CHIP_METAL(bp) (((bp)->chip_id) & 0x00000ff0)
6868+#define BNX2_CHIP_BOND(bp) (((bp)->chip_id) & 0x0000000f)
6869+
6870+#define BNX2_CHIP_ID(bp) (((bp)->chip_id) & 0xfffffff0)
6871+#define BNX2_CHIP_ID_5706_A0 0x57060000
6872+#define BNX2_CHIP_ID_5706_A1 0x57060010
6873+#define BNX2_CHIP_ID_5706_A2 0x57060020
6874+#define BNX2_CHIP_ID_5708_A0 0x57080000
6875+#define BNX2_CHIP_ID_5708_B0 0x57081000
6876+#define BNX2_CHIP_ID_5708_B1 0x57081010
6877+#define BNX2_CHIP_ID_5709_A0 0x57090000
6878+#define BNX2_CHIP_ID_5709_A1 0x57090010
68806879
68816880 /* A serdes chip will have the first bit of the bond id set. */
6882−#define CHIP_BOND_ID_SERDES_BIT 0x01
6881+#define BNX2_CHIP_BOND_SERDES_BIT 0x01
68836882
68846883 u32 phy_addr;
68856884 u32 phy_id;
@@ -6985,19 +6984,20 @@ struct bnx2 { · 99 unmodified lines
69856984 #ifdef BCM_CNIC
69866985 struct mutex cnic_lock;
69876986 struct cnic_eth_dev cnic_eth_dev;
6987+ struct cnic_eth_dev *(*cnic_probe)(struct net_device *);
69886988 #endif
69896989
69906990 const struct firmware *mips_firmware;
69916991 const struct firmware *rv2p_firmware;
69926992 };
69936993
6994−#define REG_RD(bp, offset) \
6994+#define BNX2_RD(bp, offset) \
69956995 readl(bp->regview + offset)
69966996
6997−#define REG_WR(bp, offset, val) \
6997+#define BNX2_WR(bp, offset, val) \
69986998 writel(val, bp->regview + offset)
69996999
7000−#define REG_WR16(bp, offset, val) \
7000+#define BNX2_WR16(bp, offset, val) \
70017001 writew(val, bp->regview + offset)
70027002
70037003 struct cpu_reg {
@@ -7052,7 +7052,7 @@ struct bnx2_rv2p_fw_file { · 48 unmodified lines
70527052
70537053 #define RV2P_P1_FIXUP_PAGE_SIZE_IDX 0
70547054 #define RV2P_BD_PAGE_SIZE_MSK 0xffff
7055−#define RV2P_BD_PAGE_SIZE ((BCM_PAGE_SIZE / 16) - 1)
7055+#define RV2P_BD_PAGE_SIZE ((BNX2_PAGE_SIZE / 16) - 1)
70567056
70577057 #define RV2P_PROC1 0
70587058 #define RV2P_PROC2 1
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+88−53
@@ -34,25 +34,16 @@ · 33 unmodified lines
3434
3535 #include "bnx2x_hsi.h"
3636
37−#if defined(CONFIG_CNIC) || defined(CONFIG_CNIC_MODULE)
38−#define BCM_CNIC 1
3937 #include "../cnic_if.h"
40−#endif
4138
42−#ifdef BCM_CNIC
43−#define BNX2X_MIN_MSIX_VEC_CNT 3
44−#define BNX2X_MSIX_VEC_FP_START 2
45−#else
46−#define BNX2X_MIN_MSIX_VEC_CNT 2
47−#define BNX2X_MSIX_VEC_FP_START 1
48−#endif
39+
40+#define BNX2X_MIN_MSIX_VEC_CNT(bp) ((bp)->min_msix_vec_cnt)
4941
5042 #include <linux/mdio.h>
5143
5244 #include "bnx2x_reg.h"
5345 #include "bnx2x_fw_defs.h"
5446 #include "bnx2x_mfw_req.h"
55−#include "bnx2x_hsi.h"
5647 #include "bnx2x_link.h"
5748 #include "bnx2x_sp.h"
5849 #include "bnx2x_dcb.h"
@@ -256,15 +247,10 @@ enum { · 197 unmodified lines
256247 /* FCoE L2 */
257248 #define BNX2X_FCOE_ETH_CID(bp) (BNX2X_CNIC_START_ETH_CID(bp) + 1)
258249
259−/** Additional rings budgeting */
260−#ifdef BCM_CNIC
261−#define CNIC_PRESENT 1
262−#define FCOE_PRESENT 1
263−#else
264−#define CNIC_PRESENT 0
265−#define FCOE_PRESENT 0
266−#endif /* BCM_CNIC */
267−#define NON_ETH_CONTEXT_USE (FCOE_PRESENT)
250+#define CNIC_SUPPORT(bp) ((bp)->cnic_support)
251+#define CNIC_ENABLED(bp) ((bp)->cnic_enabled)
252+#define CNIC_LOADED(bp) ((bp)->cnic_loaded)
253+#define FCOE_INIT(bp) ((bp)->fcoe_init)
268254
269255 #define AEU_IN_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR \
270256 AEU_INPUTS_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR
@@ -297,9 +283,7 @@ enum { · 26 unmodified lines
297283 OOO_TXQ_IDX_OFFSET,
298284 };
299285 #define MAX_ETH_TXQ_IDX(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) * (bp)->max_cos)
300−#ifdef BCM_CNIC
301286 #define FCOE_TXQ_IDX(bp) (MAX_ETH_TXQ_IDX(bp) + FCOE_TXQ_IDX_OFFSET)
302−#endif
303287
304288 /* fast path */
305289 /*
@@ -505,7 +489,7 @@ struct bnx2x_fastpath { · 199 unmodified lines
505489 u32 ustorm_rx_prods_offset;
506490
507491 u32 rx_buf_size;
508−
492+ u32 rx_frag_size; /* 0 if kmalloced(), or rx_buf_size + NET_SKB_PAD */
509493 dma_addr_t status_blk_mapping;
510494
511495 enum bnx2x_tpa_mode_t mode;
@@ -585,15 +569,9 @@ struct bnx2x_fastpath { · 73 unmodified lines
585569 ->var)
586570
587571
588−#define IS_ETH_FP(fp) (fp->index < \
589− BNX2X_NUM_ETH_QUEUES(fp->bp))
590−#ifdef BCM_CNIC
591−#define IS_FCOE_FP(fp) (fp->index == FCOE_IDX(fp->bp))
592−#define IS_FCOE_IDX(idx) ((idx) == FCOE_IDX(bp))
593−#else
594−#define IS_FCOE_FP(fp) false
595−#define IS_FCOE_IDX(idx) false
596−#endif
572+#define IS_ETH_FP(fp) ((fp)->index < BNX2X_NUM_ETH_QUEUES((fp)->bp))
573+#define IS_FCOE_FP(fp) ((fp)->index == FCOE_IDX((fp)->bp))
574+#define IS_FCOE_IDX(idx) ((idx) == FCOE_IDX(bp))
597575
598576
599577 /* MC hsi */
@@ -886,6 +864,18 @@ struct bnx2x_common { · 286 unmodified lines
886864 (CHIP_REV(bp) == CHIP_REV_Bx))
887865 #define CHIP_IS_E3A0(bp) (CHIP_IS_E3(bp) && \
888866 (CHIP_REV(bp) == CHIP_REV_Ax))
867+/* This define is used in two main places:
868+ * 1. In the early stages of nic_load, to know if to configrue Parser / Searcher
869+ * to nic-only mode or to offload mode. Offload mode is configured if either the
870+ * chip is E1x (where MIC_MODE register is not applicable), or if cnic already
871+ * registered for this port (which means that the user wants storage services).
872+ * 2. During cnic-related load, to know if offload mode is already configured in
873+ * the HW or needs to be configrued.
874+ * Since the transition from nic-mode to offload-mode in HW causes traffic
875+ * coruption, nic-mode is configured only in ports on which storage services
876+ * where never requested.
877+ */
878+#define CONFIGURE_NIC_MODE(bp) (!CHIP_IS_E1x(bp) && !CNIC_ENABLED(bp))
889879
890880 int flash_size;
891881 #define BNX2X_NVRAM_1MB_SIZE 0x20000 /* 1M bit in bytes */
@@ -925,6 +915,7 @@ struct bnx2x_common { · 33 unmodified lines
925915 #define BNX2X_IGU_STAS_MSG_VF_CNT 64
926916 #define BNX2X_IGU_STAS_MSG_PF_CNT 4
927917
918+#define MAX_IGU_ATTN_ACK_TO 100
928919 /* end of common */
929920
930921 /* port */
@@ -946,7 +937,6 @@ struct bnx2x_port { · 15 unmodified lines
946937
947938 /* used to synchronize phy accesses */
948939 struct mutex phy_mutex;
949− int need_hw_lock;
950940
951941 u32 port_stx;
952942
@@ -1003,18 +993,15 @@ union cdu_context { · 50 unmodified lines
1003993 #define CDU_ILT_PAGE_SZ (8192 << CDU_ILT_PAGE_SZ_HW) /* 32K */
1004994 #define ILT_PAGE_CIDS (CDU_ILT_PAGE_SZ / sizeof(union cdu_context))
1005995
1006−#ifdef BCM_CNIC
1007996 #define CNIC_ISCSI_CID_MAX 256
1008997 #define CNIC_FCOE_CID_MAX 2048
1009998 #define CNIC_CID_MAX (CNIC_ISCSI_CID_MAX + CNIC_FCOE_CID_MAX)
1010999 #define CNIC_ILT_LINES DIV_ROUND_UP(CNIC_CID_MAX, ILT_PAGE_CIDS)
1011−#endif
10121000
10131001 #define QM_ILT_PAGE_SZ_HW 0
10141002 #define QM_ILT_PAGE_SZ (4096 << QM_ILT_PAGE_SZ_HW) /* 4K */
10151003 #define QM_CID_ROUND 1024
10161004
1017−#ifdef BCM_CNIC
10181005 /* TM (timers) host DB constants */
10191006 #define TM_ILT_PAGE_SZ_HW 0
10201007 #define TM_ILT_PAGE_SZ (4096 << TM_ILT_PAGE_SZ_HW) /* 4K */
@@ -1032,8 +1019,6 @@ union cdu_context { · 11 unmodified lines
10321019 #define SRC_T2_SZ SRC_ILT_SZ
10331020 #define SRC_ILT_LINES DIV_ROUND_UP(SRC_ILT_SZ, SRC_ILT_PAGE_SZ)
10341021
1035−#endif
1036−
10371022 #define MAX_DMAE_C 8
10381023
10391024 /* DMA memory not used in fastpath */
@@ -1201,6 +1186,7 @@ struct bnx2x_prev_path_list { · 161 unmodified lines
12011186 u8 slot;
12021187 u8 path;
12031188 struct list_head list;
1189+ u8 undi;
12041190 };
12051191
12061192 struct bnx2x_sp_objs {
@@ -1227,7 +1213,6 @@ struct bnx2x { · 20 unmodified lines
12271213 struct bnx2x_sp_objs *sp_objs;
12281214 struct bnx2x_fp_stats *fp_stats;
12291215 struct bnx2x_fp_txdata *bnx2x_txq;
1230− int bnx2x_txq_size;
12311216 void __iomem *regview;
12321217 void __iomem *doorbells;
12331218 u16 db_size;
@@ -1350,6 +1335,16 @@ struct bnx2x { · 116 unmodified lines
13501335 #define NO_ISCSI_OOO(bp) ((bp)->flags & NO_ISCSI_OOO_FLAG)
13511336 #define NO_FCOE(bp) ((bp)->flags & NO_FCOE_FLAG)
13521337
1338+ u8 cnic_support;
1339+ bool cnic_enabled;
1340+ bool cnic_loaded;
1341+ struct cnic_eth_dev *(*cnic_probe)(struct net_device *);
1342+
1343+ /* Flag that indicates that we can start looking for FCoE L2 queue
1344+ * completions in the default status block.
1345+ */
1346+ bool fcoe_init;
1347+
13531348 int pm_cap;
13541349 int mrrs;
13551350
@@ -1420,6 +1415,8 @@ struct bnx2x { · 64 unmodified lines
14201415 #define BNX2X_MAX_COS 3
14211416 #define BNX2X_MAX_TX_COS 2
14221417 int num_queues;
1418+ uint num_ethernet_queues;
1419+ uint num_cnic_queues;
14231420 int num_napi_queues;
14241421 int disable_tpa;
14251422
@@ -1433,6 +1430,7 @@ struct bnx2x { · 7 unmodified lines
14331430 u8 igu_dsb_id;
14341431 u8 igu_base_sb;
14351432 u8 igu_sb_cnt;
1433+ u8 min_msix_vec_cnt;
14361434
14371435 dma_addr_t def_status_blk_mapping;
14381436
@@ -1478,26 +1476,23 @@ struct bnx2x { · 39 unmodified lines
14781476 * Maximum supported number of RSS queues: number of IGU SBs minus one that goes
14791477 * to CNIC.
14801478 */
1481−#define BNX2X_MAX_RSS_COUNT(bp) ((bp)->igu_sb_cnt - CNIC_PRESENT)
1479+#define BNX2X_MAX_RSS_COUNT(bp) ((bp)->igu_sb_cnt - CNIC_SUPPORT(bp))
14821480
14831481 /*
14841482 * Maximum CID count that might be required by the bnx2x:
14851483 * Max RSS * Max_Tx_Multi_Cos + FCoE + iSCSI
14861484 */
14871485 #define BNX2X_L2_CID_COUNT(bp) (BNX2X_NUM_ETH_QUEUES(bp) * BNX2X_MULTI_TX_COS \
1488− + NON_ETH_CONTEXT_USE + CNIC_PRESENT)
1486+ + 2 * CNIC_SUPPORT(bp))
14891487 #define BNX2X_L2_MAX_CID(bp) (BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS \
1490− + NON_ETH_CONTEXT_USE + CNIC_PRESENT)
1488+ + 2 * CNIC_SUPPORT(bp))
14911489 #define L2_ILT_LINES(bp) (DIV_ROUND_UP(BNX2X_L2_CID_COUNT(bp),\
14921490 ILT_PAGE_CIDS))
14931491
14941492 int qm_cid_count;
14951493
1496− int dropless_fc;
1494+ bool dropless_fc;
14971495
1498−#ifdef BCM_CNIC
1499− u32 cnic_flags;
1500−#define BNX2X_CNIC_FLAG_MAC_SET 1
15011496 void *t2;
15021497 dma_addr_t t2_mapping;
15031498 struct cnic_ops __rcu *cnic_ops;
@@ -1518,7 +1513,6 @@ struct bnx2x { · 14 unmodified lines
15181513
15191514 /* Start index of the "special" (CNIC related) L2 cleints */
15201515 u8 cnic_base_cl_id;
1521−#endif
15221516
15231517 int dmae_ready;
15241518 /* used to synchronize dmae accesses */
@@ -1647,9 +1641,9 @@ struct bnx2x { · 122 unmodified lines
16471641 /* Tx queues may be less or equal to Rx queues */
16481642 extern int num_queues;
16491643 #define BNX2X_NUM_QUEUES(bp) (bp->num_queues)
1650−#define BNX2X_NUM_ETH_QUEUES(bp) (BNX2X_NUM_QUEUES(bp) - NON_ETH_CONTEXT_USE)
1644+#define BNX2X_NUM_ETH_QUEUES(bp) ((bp)->num_ethernet_queues)
16511645 #define BNX2X_NUM_NON_CNIC_QUEUES(bp) (BNX2X_NUM_QUEUES(bp) - \
1652− NON_ETH_CONTEXT_USE)
1646+ (bp)->num_cnic_queues)
16531647 #define BNX2X_NUM_RX_QUEUES(bp) BNX2X_NUM_QUEUES(bp)
16541648
16551649 #define is_multi(bp) (BNX2X_NUM_QUEUES(bp) > 1)
@@ -1689,6 +1683,13 @@ struct bnx2x_func_init_params { · 33 unmodified lines
16891683 u16 spq_prod; /* valid iff FUNC_FLG_SPQ */
16901684 };
16911685
1686+#define for_each_cnic_queue(bp, var) \
1687+ for ((var) = BNX2X_NUM_ETH_QUEUES(bp); (var) < BNX2X_NUM_QUEUES(bp); \
1688+ (var)++) \
1689+ if (skip_queue(bp, var)) \
1690+ continue; \
1691+ else
1692+
16921693 #define for_each_eth_queue(bp, var) \
16931694 for ((var) = 0; (var) < BNX2X_NUM_ETH_QUEUES(bp); (var)++)
16941695
@@ -1702,6 +1703,22 @@ struct bnx2x_func_init_params { · 7 unmodified lines
17021703 else
17031704
17041705 /* Skip forwarding FP */
1706+#define for_each_valid_rx_queue(bp, var) \
1707+ for ((var) = 0; \
1708+ (var) < (CNIC_LOADED(bp) ? BNX2X_NUM_QUEUES(bp) : \
1709+ BNX2X_NUM_ETH_QUEUES(bp)); \
1710+ (var)++) \
1711+ if (skip_rx_queue(bp, var)) \
1712+ continue; \
1713+ else
1714+
1715+#define for_each_rx_queue_cnic(bp, var) \
1716+ for ((var) = BNX2X_NUM_ETH_QUEUES(bp); (var) < BNX2X_NUM_QUEUES(bp); \
1717+ (var)++) \
1718+ if (skip_rx_queue(bp, var)) \
1719+ continue; \
1720+ else
1721+
17051722 #define for_each_rx_queue(bp, var) \
17061723 for ((var) = 0; (var) < BNX2X_NUM_QUEUES(bp); (var)++) \
17071724 if (skip_rx_queue(bp, var)) \
@@ -1709,6 +1726,22 @@ struct bnx2x_func_init_params { · 1 unmodified line
17091726 else
17101727
17111728 /* Skip OOO FP */
1729+#define for_each_valid_tx_queue(bp, var) \
1730+ for ((var) = 0; \
1731+ (var) < (CNIC_LOADED(bp) ? BNX2X_NUM_QUEUES(bp) : \
1732+ BNX2X_NUM_ETH_QUEUES(bp)); \
1733+ (var)++) \
1734+ if (skip_tx_queue(bp, var)) \
1735+ continue; \
1736+ else
1737+
1738+#define for_each_tx_queue_cnic(bp, var) \
1739+ for ((var) = BNX2X_NUM_ETH_QUEUES(bp); (var) < BNX2X_NUM_QUEUES(bp); \
1740+ (var)++) \
1741+ if (skip_tx_queue(bp, var)) \
1742+ continue; \
1743+ else
1744+
17121745 #define for_each_tx_queue(bp, var) \
17131746 for ((var) = 0; (var) < BNX2X_NUM_QUEUES(bp); (var)++) \
17141747 if (skip_tx_queue(bp, var)) \
@@ -2179,7 +2212,6 @@ void bnx2x_notify_link_changed(struct bnx2x *bp); · 464 unmodified lines
21792212 #define BNX2X_MF_SD_PROTOCOL(bp) \
21802213 ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK)
21812214
2182−#ifdef BCM_CNIC
21832215 #define BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) \
21842216 (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_ISCSI)
21852217
@@ -2196,9 +2228,12 @@ void bnx2x_notify_link_changed(struct bnx2x *bp); · 10 unmodified lines
21962228 #define IS_MF_STORAGE_SD(bp) (IS_MF_SD(bp) && \
21972229 (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \
21982230 BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)))
2199−#else
2200−#define IS_MF_FCOE_AFEX(bp) false
2201−#endif
22022231
2232+enum {
2233+ SWITCH_UPDATE,
2234+ AFEX_UPDATE,
2235+};
2236+
2237+#define NUM_MACS 8
22032238
22042239 #endif /* bnx2x.h */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+359−169
@@ -552,6 +552,23 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 551 unmodified lines
552552 return 0;
553553 }
554554
555+static void bnx2x_frag_free(const struct bnx2x_fastpath *fp, void *data)
556+{
557+ if (fp->rx_frag_size)
558+ put_page(virt_to_head_page(data));
559+ else
560+ kfree(data);
561+}
562+
563+static void *bnx2x_frag_alloc(const struct bnx2x_fastpath *fp)
564+{
565+ if (fp->rx_frag_size)
566+ return netdev_alloc_frag(fp->rx_frag_size);
567+
568+ return kmalloc(fp->rx_buf_size + NET_SKB_PAD, GFP_ATOMIC);
569+}
570+
571+
555572 static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
556573 struct bnx2x_agg_info *tpa_info,
557574 u16 pages,
@@ -574,15 +591,14 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 16 unmodified lines
574591 goto drop;
575592
576593 /* Try to allocate the new data */
577− new_data = kmalloc(fp->rx_buf_size + NET_SKB_PAD, GFP_ATOMIC);
578−
594+ new_data = bnx2x_frag_alloc(fp);
579595 /* Unmap skb in the pool anyway, as we are going to change
580596 pool entry status to BNX2X_TPA_STOP even if new skb allocation
581597 fails. */
582598 dma_unmap_single(&bp->pdev->dev, dma_unmap_addr(rx_buf, mapping),
583599 fp->rx_buf_size, DMA_FROM_DEVICE);
584600 if (likely(new_data))
585− skb = build_skb(data, 0);
601+ skb = build_skb(data, fp->rx_frag_size);
586602
587603 if (likely(skb)) {
588604 #ifdef BNX2X_STOP_ON_ERROR
@@ -619,7 +635,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 30 unmodified lines
619635
620636 return;
621637 }
622− kfree(new_data);
638+ bnx2x_frag_free(fp, new_data);
623639 drop:
624640 /* drop the packet and keep the buffer in the bin */
625641 DP(NETIF_MSG_RX_STATUS,
@@ -635,7 +651,7 @@ static int bnx2x_alloc_rx_data(struct bnx2x *bp, · 9 unmodified lines
635651 struct eth_rx_bd *rx_bd = &fp->rx_desc_ring[index];
636652 dma_addr_t mapping;
637653
638− data = kmalloc(fp->rx_buf_size + NET_SKB_PAD, GFP_ATOMIC);
654+ data = bnx2x_frag_alloc(fp);
639655 if (unlikely(data == NULL))
640656 return -ENOMEM;
641657
@@ -643,7 +659,7 @@ static int bnx2x_alloc_rx_data(struct bnx2x *bp, · 1 unmodified line
643659 fp->rx_buf_size,
644660 DMA_FROM_DEVICE);
645661 if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
646− kfree(data);
662+ bnx2x_frag_free(fp, data);
647663 BNX2X_ERR("Can't map rx data\n");
648664 return -ENOMEM;
649665 }
@@ -845,9 +861,9 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) · 195 unmodified lines
845861 dma_unmap_addr(rx_buf, mapping),
846862 fp->rx_buf_size,
847863 DMA_FROM_DEVICE);
848− skb = build_skb(data, 0);
864+ skb = build_skb(data, fp->rx_frag_size);
849865 if (unlikely(!skb)) {
850− kfree(data);
866+ bnx2x_frag_free(fp, data);
851867 bnx2x_fp_qstats(bp, fp)->
852868 rx_skb_alloc_failed++;
853869 goto next_rx;
@@ -948,14 +964,12 @@ void bnx2x_acquire_phy_lock(struct bnx2x *bp) · 94 unmodified lines
948964 {
949965 mutex_lock(&bp->port.phy_mutex);
950966
951− if (bp->port.need_hw_lock)
952− bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_MDIO);
967+ bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_MDIO);
953968 }
954969
955970 void bnx2x_release_phy_lock(struct bnx2x *bp)
956971 {
957− if (bp->port.need_hw_lock)
958− bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_MDIO);
972+ bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_MDIO);
959973
960974 mutex_unlock(&bp->port.phy_mutex);
961975 }
@@ -1147,11 +1161,30 @@ static void bnx2x_free_tpa_pool(struct bnx2x *bp, · 185 unmodified lines
11471161 dma_unmap_single(&bp->pdev->dev,
11481162 dma_unmap_addr(first_buf, mapping),
11491163 fp->rx_buf_size, DMA_FROM_DEVICE);
1150− kfree(data);
1164+ bnx2x_frag_free(fp, data);
11511165 first_buf->data = NULL;
11521166 }
11531167 }
11541168
1169+void bnx2x_init_rx_rings_cnic(struct bnx2x *bp)
1170+{
1171+ int j;
1172+
1173+ for_each_rx_queue_cnic(bp, j) {
1174+ struct bnx2x_fastpath *fp = &bp->fp[j];
1175+
1176+ fp->rx_bd_cons = 0;
1177+
1178+ /* Activate BD ring */
1179+ /* Warning!
1180+ * this will generate an interrupt (to the TSTORM)
1181+ * must only be done after chip is initialized
1182+ */
1183+ bnx2x_update_rx_prod(bp, fp, fp->rx_bd_prod, fp->rx_comp_prod,
1184+ fp->rx_sge_prod);
1185+ }
1186+}
1187+
11551188 void bnx2x_init_rx_rings(struct bnx2x *bp)
11561189 {
11571190 int func = BP_FUNC(bp);
@@ -1159,7 +1192,7 @@ void bnx2x_init_rx_rings(struct bnx2x *bp) · 1 unmodified line
11591192 int i, j;
11601193
11611194 /* Allocate TPA resources */
1162− for_each_rx_queue(bp, j) {
1195+ for_each_eth_queue(bp, j) {
11631196 struct bnx2x_fastpath *fp = &bp->fp[j];
11641197
11651198 DP(NETIF_MSG_IFUP,
@@ -1173,8 +1206,7 @@ void bnx2x_init_rx_rings(struct bnx2x *bp) · 7 unmodified lines
11731206 struct sw_rx_bd *first_buf =
11741207 &tpa_info->first_buf;
11751208
1176− first_buf->data = kmalloc(fp->rx_buf_size + NET_SKB_PAD,
1177− GFP_ATOMIC);
1209+ first_buf->data = bnx2x_frag_alloc(fp);
11781210 if (!first_buf->data) {
11791211 BNX2X_ERR("Failed to allocate TPA skb pool for queue[%d] - disabling TPA on this queue!\n",
11801212 j);
@@ -1217,7 +1249,7 @@ void bnx2x_init_rx_rings(struct bnx2x *bp) · 36 unmodified lines
12171249 }
12181250 }
12191251
1220− for_each_rx_queue(bp, j) {
1252+ for_each_eth_queue(bp, j) {
12211253 struct bnx2x_fastpath *fp = &bp->fp[j];
12221254
12231255 fp->rx_bd_cons = 0;
@@ -1244,29 +1276,45 @@ void bnx2x_init_rx_rings(struct bnx2x *bp) · 20 unmodified lines
12441276 }
12451277 }
12461278
1247−static void bnx2x_free_tx_skbs(struct bnx2x *bp)
1279+static void bnx2x_free_tx_skbs_queue(struct bnx2x_fastpath *fp)
12481280 {
1249− int i;
12501281 u8 cos;
1282+ struct bnx2x *bp = fp->bp;
12511283
1252− for_each_tx_queue(bp, i) {
1253− struct bnx2x_fastpath *fp = &bp->fp[i];
1254− for_each_cos_in_tx_queue(fp, cos) {
1255− struct bnx2x_fp_txdata *txdata = fp->txdata_ptr[cos];
1256− unsigned pkts_compl = 0, bytes_compl = 0;
1284+ for_each_cos_in_tx_queue(fp, cos) {
1285+ struct bnx2x_fp_txdata *txdata = fp->txdata_ptr[cos];
1286+ unsigned pkts_compl = 0, bytes_compl = 0;
12571287
1258− u16 sw_prod = txdata->tx_pkt_prod;
1259− u16 sw_cons = txdata->tx_pkt_cons;
1288+ u16 sw_prod = txdata->tx_pkt_prod;
1289+ u16 sw_cons = txdata->tx_pkt_cons;
12601290
1261− while (sw_cons != sw_prod) {
1262− bnx2x_free_tx_pkt(bp, txdata, TX_BD(sw_cons),
1263− &pkts_compl, &bytes_compl);
1264− sw_cons++;
1265− }
1266− netdev_tx_reset_queue(
1267− netdev_get_tx_queue(bp->dev,
1268− txdata->txq_index));
1291+ while (sw_cons != sw_prod) {
1292+ bnx2x_free_tx_pkt(bp, txdata, TX_BD(sw_cons),
1293+ &pkts_compl, &bytes_compl);
1294+ sw_cons++;
12691295 }
1296+
1297+ netdev_tx_reset_queue(
1298+ netdev_get_tx_queue(bp->dev,
1299+ txdata->txq_index));
1300+ }
1301+}
1302+
1303+static void bnx2x_free_tx_skbs_cnic(struct bnx2x *bp)
1304+{
1305+ int i;
1306+
1307+ for_each_tx_queue_cnic(bp, i) {
1308+ bnx2x_free_tx_skbs_queue(&bp->fp[i]);
1309+ }
1310+}
1311+
1312+static void bnx2x_free_tx_skbs(struct bnx2x *bp)
1313+{
1314+ int i;
1315+
1316+ for_each_eth_queue(bp, i) {
1317+ bnx2x_free_tx_skbs_queue(&bp->fp[i]);
12701318 }
12711319 }
12721320
@@ -1290,7 +1338,16 @@ static void bnx2x_free_rx_bds(struct bnx2x_fastpath *fp) · 17 unmodified lines
12901338 fp->rx_buf_size, DMA_FROM_DEVICE);
12911339
12921340 rx_buf->data = NULL;
1293− kfree(data);
1341+ bnx2x_frag_free(fp, data);
1342+ }
1343+}
1344+
1345+static void bnx2x_free_rx_skbs_cnic(struct bnx2x *bp)
1346+{
1347+ int j;
1348+
1349+ for_each_rx_queue_cnic(bp, j) {
1350+ bnx2x_free_rx_bds(&bp->fp[j]);
12941351 }
12951352 }
12961353
@@ -1298,7 +1355,7 @@ static void bnx2x_free_rx_skbs(struct bnx2x *bp) · 1 unmodified line
12981355 {
12991356 int j;
13001357
1301− for_each_rx_queue(bp, j) {
1358+ for_each_eth_queue(bp, j) {
13021359 struct bnx2x_fastpath *fp = &bp->fp[j];
13031360
13041361 bnx2x_free_rx_bds(fp);
@@ -1308,6 +1365,12 @@ static void bnx2x_free_rx_skbs(struct bnx2x *bp) · 3 unmodified lines
13081365 }
13091366 }
13101367
1368+void bnx2x_free_skbs_cnic(struct bnx2x *bp)
1369+{
1370+ bnx2x_free_tx_skbs_cnic(bp);
1371+ bnx2x_free_rx_skbs_cnic(bp);
1372+}
1373+
13111374 void bnx2x_free_skbs(struct bnx2x *bp)
13121375 {
13131376 bnx2x_free_tx_skbs(bp);
@@ -1347,11 +1410,12 @@ static void bnx2x_free_msix_irqs(struct bnx2x *bp, int nvecs) · 33 unmodified lines
13471410 DP(NETIF_MSG_IFDOWN, "released sp irq (%d)\n",
13481411 bp->msix_table[offset].vector);
13491412 offset++;
1350−#ifdef BCM_CNIC
1351− if (nvecs == offset)
1352− return;
1353− offset++;
1354−#endif
1413+
1414+ if (CNIC_SUPPORT(bp)) {
1415+ if (nvecs == offset)
1416+ return;
1417+ offset++;
1418+ }
13551419
13561420 for_each_eth_queue(bp, i) {
13571421 if (nvecs == offset)
@@ -1368,7 +1432,7 @@ void bnx2x_free_irq(struct bnx2x *bp) · 10 unmodified lines
13681432 if (bp->flags & USING_MSIX_FLAG &&
13691433 !(bp->flags & USING_SINGLE_MSIX_FLAG))
13701434 bnx2x_free_msix_irqs(bp, BNX2X_NUM_ETH_QUEUES(bp) +
1371− CNIC_PRESENT + 1);
1435+ CNIC_SUPPORT(bp) + 1);
13721436 else
13731437 free_irq(bp->dev->irq, bp->dev);
13741438 }
@@ -1382,12 +1446,14 @@ int bnx2x_enable_msix(struct bnx2x *bp) · 7 unmodified lines
13821446 bp->msix_table[0].entry);
13831447 msix_vec++;
13841448
1385−#ifdef BCM_CNIC
1386− bp->msix_table[msix_vec].entry = msix_vec;
1387− BNX2X_DEV_INFO("msix_table[%d].entry = %d (CNIC)\n",
1388− bp->msix_table[msix_vec].entry, bp->msix_table[msix_vec].entry);
1389− msix_vec++;
1390−#endif
1449+ /* Cnic requires an msix vector for itself */
1450+ if (CNIC_SUPPORT(bp)) {
1451+ bp->msix_table[msix_vec].entry = msix_vec;
1452+ BNX2X_DEV_INFO("msix_table[%d].entry = %d (CNIC)\n",
1453+ msix_vec, bp->msix_table[msix_vec].entry);
1454+ msix_vec++;
1455+ }
1456+
13911457 /* We need separate vectors for ETH queues only (not FCoE) */
13921458 for_each_eth_queue(bp, i) {
13931459 bp->msix_table[msix_vec].entry = msix_vec;
@@ -1396,7 +1462,7 @@ int bnx2x_enable_msix(struct bnx2x *bp) · 2 unmodified lines
13961462 msix_vec++;
13971463 }
13981464
1399− req_cnt = BNX2X_NUM_ETH_QUEUES(bp) + CNIC_PRESENT + 1;
1465+ req_cnt = BNX2X_NUM_ETH_QUEUES(bp) + CNIC_SUPPORT(bp) + 1;
14001466
14011467 rc = pci_enable_msix(bp->pdev, &bp->msix_table[0], req_cnt);
14021468
@@ -1404,7 +1470,7 @@ int bnx2x_enable_msix(struct bnx2x *bp) · 1 unmodified line
14041470 * reconfigure number of tx/rx queues according to available
14051471 * MSI-X vectors
14061472 */
1407− if (rc >= BNX2X_MIN_MSIX_VEC_CNT) {
1473+ if (rc >= BNX2X_MIN_MSIX_VEC_CNT(bp)) {
14081474 /* how less vectors we will have? */
14091475 int diff = req_cnt - rc;
14101476
@@ -1419,7 +1485,8 @@ int bnx2x_enable_msix(struct bnx2x *bp) · 8 unmodified lines
14191485 /*
14201486 * decrease number of queues by number of unallocated entries
14211487 */
1422− bp->num_queues -= diff;
1488+ bp->num_ethernet_queues -= diff;
1489+ bp->num_queues = bp->num_ethernet_queues + bp->num_cnic_queues;
14231490
14241491 BNX2X_DEV_INFO("New queue configuration set: %d\n",
14251492 bp->num_queues);
@@ -1435,6 +1502,9 @@ int bnx2x_enable_msix(struct bnx2x *bp) · 9 unmodified lines
14351502 BNX2X_DEV_INFO("Using single MSI-X vector\n");
14361503 bp->flags |= USING_SINGLE_MSIX_FLAG;
14371504
1505+ BNX2X_DEV_INFO("set number of queues to 1\n");
1506+ bp->num_ethernet_queues = 1;
1507+ bp->num_queues = bp->num_ethernet_queues + bp->num_cnic_queues;
14381508 } else if (rc < 0) {
14391509 BNX2X_DEV_INFO("MSI-X is not attainable rc %d\n", rc);
14401510 goto no_msix;
@@ -1464,9 +1534,9 @@ static int bnx2x_req_msix_irqs(struct bnx2x *bp) · 23 unmodified lines
14641534 return -EBUSY;
14651535 }
14661536
1467−#ifdef BCM_CNIC
1468− offset++;
1469−#endif
1537+ if (CNIC_SUPPORT(bp))
1538+ offset++;
1539+
14701540 for_each_eth_queue(bp, i) {
14711541 struct bnx2x_fastpath *fp = &bp->fp[i];
14721542 snprintf(fp->name, sizeof(fp->name), "%s-fp-%d",
@@ -1485,7 +1555,7 @@ static int bnx2x_req_msix_irqs(struct bnx2x *bp) · 12 unmodified lines
14851555 }
14861556
14871557 i = BNX2X_NUM_ETH_QUEUES(bp);
1488− offset = 1 + CNIC_PRESENT;
1558+ offset = 1 + CNIC_SUPPORT(bp);
14891559 netdev_info(bp->dev, "using MSI-X IRQs: sp %d fp[%d] %d ... fp[%d] %d\n",
14901560 bp->msix_table[0].vector,
14911561 0, bp->msix_table[offset].vector,
@@ -1556,19 +1626,35 @@ static int bnx2x_setup_irqs(struct bnx2x *bp) · 64 unmodified lines
15561626 return 0;
15571627 }
15581628
1629+static void bnx2x_napi_enable_cnic(struct bnx2x *bp)
1630+{
1631+ int i;
1632+
1633+ for_each_rx_queue_cnic(bp, i)
1634+ napi_enable(&bnx2x_fp(bp, i, napi));
1635+}
1636+
15591637 static void bnx2x_napi_enable(struct bnx2x *bp)
15601638 {
15611639 int i;
15621640
1563− for_each_rx_queue(bp, i)
1641+ for_each_eth_queue(bp, i)
15641642 napi_enable(&bnx2x_fp(bp, i, napi));
15651643 }
15661644
1645+static void bnx2x_napi_disable_cnic(struct bnx2x *bp)
1646+{
1647+ int i;
1648+
1649+ for_each_rx_queue_cnic(bp, i)
1650+ napi_disable(&bnx2x_fp(bp, i, napi));
1651+}
1652+
15671653 static void bnx2x_napi_disable(struct bnx2x *bp)
15681654 {
15691655 int i;
15701656
1571− for_each_rx_queue(bp, i)
1657+ for_each_eth_queue(bp, i)
15721658 napi_disable(&bnx2x_fp(bp, i, napi));
15731659 }
15741660
@@ -1576,6 +1662,8 @@ void bnx2x_netif_start(struct bnx2x *bp) · 1 unmodified line
15761662 {
15771663 if (netif_running(bp->dev)) {
15781664 bnx2x_napi_enable(bp);
1665+ if (CNIC_LOADED(bp))
1666+ bnx2x_napi_enable_cnic(bp);
15791667 bnx2x_int_enable(bp);
15801668 if (bp->state == BNX2X_STATE_OPEN)
15811669 netif_tx_wake_all_queues(bp->dev);
@@ -1586,14 +1674,15 @@ void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw) · 4 unmodified lines
15861674 {
15871675 bnx2x_int_disable_sync(bp, disable_hw);
15881676 bnx2x_napi_disable(bp);
1677+ if (CNIC_LOADED(bp))
1678+ bnx2x_napi_disable_cnic(bp);
15891679 }
15901680
15911681 u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb)
15921682 {
15931683 struct bnx2x *bp = netdev_priv(dev);
15941684
1595−#ifdef BCM_CNIC
1596− if (!NO_FCOE(bp)) {
1685+ if (CNIC_LOADED(bp) && !NO_FCOE(bp)) {
15971686 struct ethhdr *hdr = (struct ethhdr *)skb->data;
15981687 u16 ether_type = ntohs(hdr->h_proto);
15991688
@@ -1609,7 +1698,7 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) · 9 unmodified lines
16091698 if ((ether_type == ETH_P_FCOE) || (ether_type == ETH_P_FIP))
16101699 return bnx2x_fcoe_tx(bp, txq_index);
16111700 }
1612−#endif
1701+
16131702 /* select a non-FCoE queue */
16141703 return __skb_tx_hash(dev, skb, BNX2X_NUM_ETH_QUEUES(bp));
16151704 }
@@ -1618,15 +1707,15 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) · 2 unmodified lines
16181707 void bnx2x_set_num_queues(struct bnx2x *bp)
16191708 {
16201709 /* RSS queues */
1621− bp->num_queues = bnx2x_calc_num_queues(bp);
1710+ bp->num_ethernet_queues = bnx2x_calc_num_queues(bp);
16221711
1623−#ifdef BCM_CNIC
16241712 /* override in STORAGE SD modes */
16251713 if (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))
1626− bp->num_queues = 1;
1627−#endif
1714+ bp->num_ethernet_queues = 1;
1715+
16281716 /* Add special queues */
1629− bp->num_queues += NON_ETH_CONTEXT_USE;
1717+ bp->num_cnic_queues = CNIC_SUPPORT(bp); /* For FCOE */
1718+ bp->num_queues = bp->num_ethernet_queues + bp->num_cnic_queues;
16301719
16311720 BNX2X_DEV_INFO("set number of queues to %d\n", bp->num_queues);
16321721 }
@@ -1653,20 +1742,18 @@ void bnx2x_set_num_queues(struct bnx2x *bp) · 20 unmodified lines
16531742 * bnx2x_setup_tc() takes care of the proper TC mappings so that __skb_tx_hash()
16541743 * will return a proper Tx index if TC is enabled (netdev->num_tc > 0).
16551744 */
1656−static int bnx2x_set_real_num_queues(struct bnx2x *bp)
1745+static int bnx2x_set_real_num_queues(struct bnx2x *bp, int include_cnic)
16571746 {
16581747 int rc, tx, rx;
16591748
16601749 tx = BNX2X_NUM_ETH_QUEUES(bp) * bp->max_cos;
1661− rx = BNX2X_NUM_QUEUES(bp) - NON_ETH_CONTEXT_USE;
1750+ rx = BNX2X_NUM_ETH_QUEUES(bp);
16621751
16631752 /* account for fcoe queue */
1664−#ifdef BCM_CNIC
1665− if (!NO_FCOE(bp)) {
1666− rx += FCOE_PRESENT;
1667− tx += FCOE_PRESENT;
1753+ if (include_cnic && !NO_FCOE(bp)) {
1754+ rx++;
1755+ tx++;
16681756 }
1669−#endif
16701757
16711758 rc = netif_set_real_num_tx_queues(bp->dev, tx);
16721759 if (rc) {
@@ -1710,6 +1797,10 @@ static void bnx2x_set_rx_buf_size(struct bnx2x *bp) · 37 unmodified lines
17101797 mtu +
17111798 BNX2X_FW_RX_ALIGN_END;
17121799 /* Note : rx_buf_size doesnt take into account NET_SKB_PAD */
1800+ if (fp->rx_buf_size + NET_SKB_PAD <= PAGE_SIZE)
1801+ fp->rx_frag_size = fp->rx_buf_size + NET_SKB_PAD;
1802+ else
1803+ fp->rx_frag_size = 0;
17131804 }
17141805 }
17151806
@@ -1859,14 +1950,26 @@ static void bnx2x_squeeze_objects(struct bnx2x *bp) · 143 unmodified lines
18591950 (bp)->state = BNX2X_STATE_ERROR; \
18601951 goto label; \
18611952 } while (0)
1862−#else
1953+
1954+#define LOAD_ERROR_EXIT_CNIC(bp, label) \
1955+ do { \
1956+ bp->cnic_loaded = false; \
1957+ goto label; \
1958+ } while (0)
1959+#else /*BNX2X_STOP_ON_ERROR*/
18631960 #define LOAD_ERROR_EXIT(bp, label) \
18641961 do { \
18651962 (bp)->state = BNX2X_STATE_ERROR; \
18661963 (bp)->panic = 1; \
18671964 return -EBUSY; \
18681965 } while (0)
1869−#endif
1966+#define LOAD_ERROR_EXIT_CNIC(bp, label) \
1967+ do { \
1968+ bp->cnic_loaded = false; \
1969+ (bp)->panic = 1; \
1970+ return -EBUSY; \
1971+ } while (0)
1972+#endif /*BNX2X_STOP_ON_ERROR*/
18701973
18711974 bool bnx2x_test_firmware_version(struct bnx2x *bp, bool is_err)
18721975 {
@@ -1959,10 +2062,8 @@ static void bnx2x_bz_fp(struct bnx2x *bp, int index) · 86 unmodified lines
19592062 fp->max_cos = 1;
19602063
19612064 /* Init txdata pointers */
1962−#ifdef BCM_CNIC
19632065 if (IS_FCOE_FP(fp))
19642066 fp->txdata_ptr[0] = &bp->bnx2x_txq[FCOE_TXQ_IDX(bp)];
1965−#endif
19662067 if (IS_ETH_FP(fp))
19672068 for_each_cos_in_tx_queue(fp, cos)
19682069 fp->txdata_ptr[cos] = &bp->bnx2x_txq[cos *
@@ -1980,11 +2081,95 @@ static void bnx2x_bz_fp(struct bnx2x *bp, int index) · 11 unmodified lines
19802081 else if (bp->flags & GRO_ENABLE_FLAG)
19812082 fp->mode = TPA_MODE_GRO;
19822083
1983−#ifdef BCM_CNIC
19842084 /* We don't want TPA on an FCoE L2 ring */
19852085 if (IS_FCOE_FP(fp))
19862086 fp->disable_tpa = 1;
1987−#endif
2087+}
2088+
2089+int bnx2x_load_cnic(struct bnx2x *bp)
2090+{
2091+ int i, rc, port = BP_PORT(bp);
2092+
2093+ DP(NETIF_MSG_IFUP, "Starting CNIC-related load\n");
2094+
2095+ mutex_init(&bp->cnic_mutex);
2096+
2097+ rc = bnx2x_alloc_mem_cnic(bp);
2098+ if (rc) {
2099+ BNX2X_ERR("Unable to allocate bp memory for cnic\n");
2100+ LOAD_ERROR_EXIT_CNIC(bp, load_error_cnic0);
2101+ }
2102+
2103+ rc = bnx2x_alloc_fp_mem_cnic(bp);
2104+ if (rc) {
2105+ BNX2X_ERR("Unable to allocate memory for cnic fps\n");
2106+ LOAD_ERROR_EXIT_CNIC(bp, load_error_cnic0);
2107+ }
2108+
2109+ /* Update the number of queues with the cnic queues */
2110+ rc = bnx2x_set_real_num_queues(bp, 1);
2111+ if (rc) {
2112+ BNX2X_ERR("Unable to set real_num_queues including cnic\n");
2113+ LOAD_ERROR_EXIT_CNIC(bp, load_error_cnic0);
2114+ }
2115+
2116+ /* Add all CNIC NAPI objects */
2117+ bnx2x_add_all_napi_cnic(bp);
2118+ DP(NETIF_MSG_IFUP, "cnic napi added\n");
2119+ bnx2x_napi_enable_cnic(bp);
2120+
2121+ rc = bnx2x_init_hw_func_cnic(bp);
2122+ if (rc)
2123+ LOAD_ERROR_EXIT_CNIC(bp, load_error_cnic1);
2124+
2125+ bnx2x_nic_init_cnic(bp);
2126+
2127+ /* Enable Timer scan */
2128+ REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 1);
2129+
2130+ for_each_cnic_queue(bp, i) {
2131+ rc = bnx2x_setup_queue(bp, &bp->fp[i], 0);
2132+ if (rc) {
2133+ BNX2X_ERR("Queue setup failed\n");
2134+ LOAD_ERROR_EXIT(bp, load_error_cnic2);
2135+ }
2136+ }
2137+
2138+ /* Initialize Rx filter. */
2139+ netif_addr_lock_bh(bp->dev);
2140+ bnx2x_set_rx_mode(bp->dev);
2141+ netif_addr_unlock_bh(bp->dev);
2142+
2143+ /* re-read iscsi info */
2144+ bnx2x_get_iscsi_info(bp);
2145+ bnx2x_setup_cnic_irq_info(bp);
2146+ bnx2x_setup_cnic_info(bp);
2147+ bp->cnic_loaded = true;
2148+ if (bp->state == BNX2X_STATE_OPEN)
2149+ bnx2x_cnic_notify(bp, CNIC_CTL_START_CMD);
2150+
2151+
2152+ DP(NETIF_MSG_IFUP, "Ending successfully CNIC-related load\n");
2153+
2154+ return 0;
2155+
2156+#ifndef BNX2X_STOP_ON_ERROR
2157+load_error_cnic2:
2158+ /* Disable Timer scan */
2159+ REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 0);
2160+
2161+load_error_cnic1:
2162+ bnx2x_napi_disable_cnic(bp);
2163+ /* Update the number of queues without the cnic queues */
2164+ rc = bnx2x_set_real_num_queues(bp, 0);
2165+ if (rc)
2166+ BNX2X_ERR("Unable to set real_num_queues not including cnic\n");
2167+load_error_cnic0:
2168+ BNX2X_ERR("CNIC-related load failed\n");
2169+ bnx2x_free_fp_mem_cnic(bp);
2170+ bnx2x_free_mem_cnic(bp);
2171+ return rc;
2172+#endif /* ! BNX2X_STOP_ON_ERROR */
19882173 }
19892174
19902175
@@ -1995,6 +2180,10 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 4 unmodified lines
19952180 u32 load_code;
19962181 int i, rc;
19972182
2183+ DP(NETIF_MSG_IFUP, "Starting NIC load\n");
2184+ DP(NETIF_MSG_IFUP,
2185+ "CNIC is %s\n", CNIC_ENABLED(bp) ? "enabled" : "disabled");
2186+
19982187 #ifdef BNX2X_STOP_ON_ERROR
19992188 if (unlikely(bp->panic)) {
20002189 BNX2X_ERR("Can't load NIC when there is panic\n");
@@ -2022,9 +2211,11 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 21 unmodified lines
20222211 DP(NETIF_MSG_IFUP, "num queues: %d", bp->num_queues);
20232212 for_each_queue(bp, i)
20242213 bnx2x_bz_fp(bp, i);
2025− memset(bp->bnx2x_txq, 0, bp->bnx2x_txq_size *
2026− sizeof(struct bnx2x_fp_txdata));
2214+ memset(bp->bnx2x_txq, 0, (BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS +
2215+ bp->num_cnic_queues) *
2216+ sizeof(struct bnx2x_fp_txdata));
20272217
2218+ bp->fcoe_init = false;
20282219
20292220 /* Set the receive queues buffer size */
20302221 bnx2x_set_rx_buf_size(bp);
@@ -2034,9 +2225,9 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 3 unmodified lines
20342225
20352226 /* As long as bnx2x_alloc_mem() may possibly update
20362227 * bp->num_queues, bnx2x_set_real_num_queues() should always
2037− * come after it.
2228+ * come after it. At this stage cnic queues are not counted.
20382229 */
2039− rc = bnx2x_set_real_num_queues(bp);
2230+ rc = bnx2x_set_real_num_queues(bp, 0);
20402231 if (rc) {
20412232 BNX2X_ERR("Unable to set real_num_queues\n");
20422233 LOAD_ERROR_EXIT(bp, load_error0);
@@ -2050,6 +2241,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 7 unmodified lines
20502241
20512242 /* Add all NAPI objects */
20522243 bnx2x_add_all_napi(bp);
2244+ DP(NETIF_MSG_IFUP, "napi added\n");
20532245 bnx2x_napi_enable(bp);
20542246
20552247 /* set pf load just before approaching the MCP */
@@ -2073,7 +2265,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 17 unmodified lines
20732265 DRV_PULSE_SEQ_MASK);
20742266 BNX2X_DEV_INFO("drv_pulse 0x%x\n", bp->fw_drv_pulse_wr_seq);
20752267
2076− load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ, 0);
2268+ load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ,
2269+ DRV_MSG_CODE_LOAD_REQ_WITH_LFA);
20772270 if (!load_code) {
20782271 BNX2X_ERR("MCP response failure, aborting\n");
20792272 rc = -EBUSY;
@@ -2191,23 +2384,18 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 111 unmodified lines
21912384 LOAD_ERROR_EXIT(bp, load_error3);
21922385 }
21932386
2194−#ifdef BCM_CNIC
2195− /* Enable Timer scan */
2196− REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 1);
2197−#endif
2198−
2199− for_each_nondefault_queue(bp, i) {
2387+ for_each_nondefault_eth_queue(bp, i) {
22002388 rc = bnx2x_setup_queue(bp, &bp->fp[i], 0);
22012389 if (rc) {
22022390 BNX2X_ERR("Queue setup failed\n");
2203− LOAD_ERROR_EXIT(bp, load_error4);
2391+ LOAD_ERROR_EXIT(bp, load_error3);
22042392 }
22052393 }
22062394
22072395 rc = bnx2x_init_rss_pf(bp);
22082396 if (rc) {
22092397 BNX2X_ERR("PF RSS init failed\n");
2210− LOAD_ERROR_EXIT(bp, load_error4);
2398+ LOAD_ERROR_EXIT(bp, load_error3);
22112399 }
22122400
22132401 /* Now when Clients are configured we are ready to work */
@@ -2217,7 +2405,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 3 unmodified lines
22172405 rc = bnx2x_set_eth_mac(bp, true);
22182406 if (rc) {
22192407 BNX2X_ERR("Setting Ethernet MAC failed\n");
2220− LOAD_ERROR_EXIT(bp, load_error4);
2408+ LOAD_ERROR_EXIT(bp, load_error3);
22212409 }
22222410
22232411 if (bp->pending_max) {
@@ -2227,6 +2415,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 3 unmodified lines
22272415
22282416 if (bp->port.pmf)
22292417 bnx2x_initial_phy_init(bp, load_mode);
2418+ bp->link_params.feature_config_flags &= ~FEATURE_CONFIG_BOOT_FROM_SAN;
22302419
22312420 /* Start fast path */
22322421
@@ -2257,21 +2446,15 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 24 unmodified lines
22572446 }
22582447
22592448 if (bp->port.pmf)
2260− bnx2x_update_drv_flags(bp, 1 << DRV_FLAGS_DCB_CONFIGURED, 0);
2449+ bnx2x_update_drv_flags(bp, 1 << DRV_FLAGS_PORT_MASK, 0);
22612450 else
22622451 bnx2x__link_status_update(bp);
22632452
22642453 /* start the timer */
22652454 mod_timer(&bp->timer, jiffies + bp->current_interval);
22662455
2267−#ifdef BCM_CNIC
2268− /* re-read iscsi info */
2269− bnx2x_get_iscsi_info(bp);
2270− bnx2x_setup_cnic_irq_info(bp);
2271− bnx2x_setup_cnic_info(bp);
2272− if (bp->state == BNX2X_STATE_OPEN)
2273− bnx2x_cnic_notify(bp, CNIC_CTL_START_CMD);
2274−#endif
2456+ if (CNIC_ENABLED(bp))
2457+ bnx2x_load_cnic(bp);
22752458
22762459 /* mark driver is loaded in shmem2 */
22772460 if (SHMEM2_HAS(bp, drv_capabilities_flag)) {
@@ -2293,14 +2476,11 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 15 unmodified lines
22932476 if (bp->port.pmf && (bp->state != BNX2X_STATE_DIAG))
22942477 bnx2x_dcbx_init(bp, false);
22952478
2479+ DP(NETIF_MSG_IFUP, "Ending successfully NIC load\n");
2480+
22962481 return 0;
22972482
22982483 #ifndef BNX2X_STOP_ON_ERROR
2299−load_error4:
2300−#ifdef BCM_CNIC
2301− /* Disable Timer scan */
2302− REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 0);
2303−#endif
23042484 load_error3:
23052485 bnx2x_int_disable_sync(bp, 1);
23062486
@@ -2338,6 +2518,8 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) · 31 unmodified lines
23382518 int i;
23392519 bool global = false;
23402520
2521+ DP(NETIF_MSG_IFUP, "Starting NIC unload\n");
2522+
23412523 /* mark driver is unloaded in shmem2 */
23422524 if (SHMEM2_HAS(bp, drv_capabilities_flag)) {
23432525 u32 val;
@@ -2373,14 +2555,13 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) · 29 unmodified lines
23732555 bp->state = BNX2X_STATE_CLOSING_WAIT4_HALT;
23742556 smp_mb();
23752557
2558+ if (CNIC_LOADED(bp))
2559+ bnx2x_cnic_notify(bp, CNIC_CTL_STOP_CMD);
2560+
23762561 /* Stop Tx */
23772562 bnx2x_tx_disable(bp);
23782563 netdev_reset_tc(bp->dev);
23792564
2380−#ifdef BCM_CNIC
2381− bnx2x_cnic_notify(bp, CNIC_CTL_STOP_CMD);
2382−#endif
2383−
23842565 bp->rx_mode = BNX2X_RX_MODE_NONE;
23852566
23862567 del_timer_sync(&bp->timer);
@@ -2414,7 +2595,8 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) · 27 unmodified lines
24142595 bnx2x_netif_stop(bp, 1);
24152596 /* Delete all NAPI objects */
24162597 bnx2x_del_all_napi(bp);
2417−
2598+ if (CNIC_LOADED(bp))
2599+ bnx2x_del_all_napi_cnic(bp);
24182600 /* Release IRQs */
24192601 bnx2x_free_irq(bp);
24202602
@@ -2435,12 +2617,19 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) · 14 unmodified lines
24352617
24362618 /* Free SKBs, SGEs, TPA pool and driver internals */
24372619 bnx2x_free_skbs(bp);
2620+ if (CNIC_LOADED(bp))
2621+ bnx2x_free_skbs_cnic(bp);
24382622 for_each_rx_queue(bp, i)
24392623 bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE);
24402624
2625+ if (CNIC_LOADED(bp)) {
2626+ bnx2x_free_fp_mem_cnic(bp);
2627+ bnx2x_free_mem_cnic(bp);
2628+ }
24412629 bnx2x_free_mem(bp);
24422630
24432631 bp->state = BNX2X_STATE_CLOSED;
2632+ bp->cnic_loaded = false;
24442633
24452634 /* Check if there are pending parity attentions. If there are - set
24462635 * RECOVERY_IN_PROGRESS.
@@ -2460,6 +2649,8 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) · 13 unmodified lines
24602649 if (!bnx2x_clear_pf_load(bp) && bnx2x_reset_is_done(bp, BP_PATH(bp)))
24612650 bnx2x_disable_close_the_gate(bp);
24622651
2652+ DP(NETIF_MSG_IFUP, "Ending NIC unload\n");
2653+
24632654 return 0;
24642655 }
24652656
@@ -2550,7 +2741,7 @@ int bnx2x_poll(struct napi_struct *napi, int budget) · 84 unmodified lines
25502741
25512742 /* Fall out from the NAPI loop if needed */
25522743 if (!(bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))) {
2553−#ifdef BCM_CNIC
2744+
25542745 /* No need to update SB for FCoE L2 ring as long as
25552746 * it's connected to the default SB and the SB
25562747 * has been updated when NAPI was scheduled.
@@ -2559,8 +2750,6 @@ int bnx2x_poll(struct napi_struct *napi, int budget) · 2 unmodified lines
25592750 napi_complete(napi);
25602751 break;
25612752 }
2562−#endif
2563−
25642753 bnx2x_update_fpsb_idx(fp);
25652754 /* bnx2x_has_rx_work() reads the status block,
25662755 * thus we need to ensure that status block indices
@@ -2940,7 +3129,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 373 unmodified lines
29403129 txq_index = skb_get_queue_mapping(skb);
29413130 txq = netdev_get_tx_queue(dev, txq_index);
29423131
2943− BUG_ON(txq_index >= MAX_ETH_TXQ_IDX(bp) + FCOE_PRESENT);
3132+ BUG_ON(txq_index >= MAX_ETH_TXQ_IDX(bp) + (CNIC_LOADED(bp) ? 1 : 0));
29443133
29453134 txdata = &bp->bnx2x_txq[txq_index];
29463135
@@ -2958,11 +3147,16 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 11 unmodified lines
29583147 BDS_PER_TX_PKT +
29593148 NEXT_CNT_PER_TX_PKT(MAX_BDS_PER_TX_PKT))) {
29603149 /* Handle special storage cases separately */
2961− if (txdata->tx_ring_size != 0) {
2962− BNX2X_ERR("BUG! Tx ring full when queue awake!\n");
3150+ if (txdata->tx_ring_size == 0) {
3151+ struct bnx2x_eth_q_stats *q_stats =
3152+ bnx2x_fp_qstats(bp, txdata->parent_fp);
3153+ q_stats->driver_filtered_tx_pkt++;
3154+ dev_kfree_skb(skb);
3155+ return NETDEV_TX_OK;
3156+ }
29633157 bnx2x_fp_qstats(bp, txdata->parent_fp)->driver_xoff++;
29643158 netif_tx_stop_queue(txq);
2965− }
3159+ BNX2X_ERR("BUG! Tx ring full when queue awake!\n");
29663160
29673161 return NETDEV_TX_BUSY;
29683162 }
@@ -3339,13 +3533,11 @@ int bnx2x_change_mac_addr(struct net_device *dev, void *p) · 370 unmodified lines
33393533 return -EINVAL;
33403534 }
33413535
3342−#ifdef BCM_CNIC
33433536 if ((IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp)) &&
33443537 !is_zero_ether_addr(addr->sa_data)) {
33453538 BNX2X_ERR("Can't configure non-zero address on iSCSI or FCoE functions in MF-SD mode\n");
33463539 return -EINVAL;
33473540 }
3348−#endif
33493541
33503542 if (netif_running(dev)) {
33513543 rc = bnx2x_set_eth_mac(bp, false);
@@ -3369,13 +3561,11 @@ static void bnx2x_free_fp_mem_at(struct bnx2x *bp, int fp_index) · 17 unmodified lines
33693561 u8 cos;
33703562
33713563 /* Common */
3372−#ifdef BCM_CNIC
3564+
33733565 if (IS_FCOE_IDX(fp_index)) {
33743566 memset(sb, 0, sizeof(union host_hc_status_block));
33753567 fp->status_blk_mapping = 0;
3376−
33773568 } else {
3378−#endif
33793569 /* status blocks */
33803570 if (!CHIP_IS_E1x(bp))
33813571 BNX2X_PCI_FREE(sb->e2_sb,
@@ -3387,9 +3577,8 @@ static void bnx2x_free_fp_mem_at(struct bnx2x *bp, int fp_index) · 5 unmodified lines
33873577 bnx2x_fp(bp, fp_index,
33883578 status_blk_mapping),
33893579 sizeof(struct host_hc_status_block_e1x));
3390−#ifdef BCM_CNIC
33913580 }
3392−#endif
3581+
33933582 /* Rx */
33943583 if (!skip_rx_queue(bp, fp_index)) {
33953584 bnx2x_free_rx_bds(fp);
@@ -3431,10 +3620,17 @@ static void bnx2x_free_fp_mem_at(struct bnx2x *bp, int fp_index) · 35 unmodified lines
34313620 /* end of fastpath */
34323621 }
34333622
3623+void bnx2x_free_fp_mem_cnic(struct bnx2x *bp)
3624+{
3625+ int i;
3626+ for_each_cnic_queue(bp, i)
3627+ bnx2x_free_fp_mem_at(bp, i);
3628+}
3629+
34343630 void bnx2x_free_fp_mem(struct bnx2x *bp)
34353631 {
34363632 int i;
3437− for_each_queue(bp, i)
3633+ for_each_eth_queue(bp, i)
34383634 bnx2x_free_fp_mem_at(bp, i);
34393635 }
34403636
@@ -3519,14 +3715,11 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) · 78 unmodified lines
35193715 u8 cos;
35203716 int rx_ring_size = 0;
35213717
3522−#ifdef BCM_CNIC
35233718 if (!bp->rx_ring_size &&
35243719 (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))) {
35253720 rx_ring_size = MIN_RX_SIZE_NONTPA;
35263721 bp->rx_ring_size = rx_ring_size;
3527− } else
3528−#endif
3529− if (!bp->rx_ring_size) {
3722+ } else if (!bp->rx_ring_size) {
35303723 rx_ring_size = MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp);
35313724
35323725 if (CHIP_IS_E3(bp)) {
@@ -3550,9 +3743,8 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) · 17 unmodified lines
35503743
35513744 /* Common */
35523745 sb = &bnx2x_fp(bp, index, status_blk);
3553−#ifdef BCM_CNIC
3746+
35543747 if (!IS_FCOE_IDX(index)) {
3555−#endif
35563748 /* status blocks */
35573749 if (!CHIP_IS_E1x(bp))
35583750 BNX2X_PCI_ALLOC(sb->e2_sb,
@@ -3562,9 +3754,7 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) · 3 unmodified lines
35623754 BNX2X_PCI_ALLOC(sb->e1x_sb,
35633755 &bnx2x_fp(bp, index, status_blk_mapping),
35643756 sizeof(struct host_hc_status_block_e1x));
3565−#ifdef BCM_CNIC
35663757 }
3567−#endif
35683758
35693759 /* FCoE Queue uses Default SB and doesn't ACK the SB, thus no need to
35703760 * set shortcuts for it.
@@ -3641,31 +3831,31 @@ alloc_mem_err: · 70 unmodified lines
36413831 return 0;
36423832 }
36433833
3834+int bnx2x_alloc_fp_mem_cnic(struct bnx2x *bp)
3835+{
3836+ if (!NO_FCOE(bp))
3837+ /* FCoE */
3838+ if (bnx2x_alloc_fp_mem_at(bp, FCOE_IDX(bp)))
3839+ /* we will fail load process instead of mark
3840+ * NO_FCOE_FLAG
3841+ */
3842+ return -ENOMEM;
3843+
3844+ return 0;
3845+}
3846+
36443847 int bnx2x_alloc_fp_mem(struct bnx2x *bp)
36453848 {
36463849 int i;
36473850
3648− /**
3649− * 1. Allocate FP for leading - fatal if error
3650− * 2. {CNIC} Allocate FCoE FP - fatal if error
3651− * 3. {CNIC} Allocate OOO + FWD - disable OOO if error
3652− * 4. Allocate RSS - fix number of queues if error
3851+ /* 1. Allocate FP for leading - fatal if error
3852+ * 2. Allocate RSS - fix number of queues if error
36533853 */
36543854
36553855 /* leading */
36563856 if (bnx2x_alloc_fp_mem_at(bp, 0))
36573857 return -ENOMEM;
36583858
3659−#ifdef BCM_CNIC
3660− if (!NO_FCOE(bp))
3661− /* FCoE */
3662− if (bnx2x_alloc_fp_mem_at(bp, FCOE_IDX(bp)))
3663− /* we will fail load process instead of mark
3664− * NO_FCOE_FLAG
3665− */
3666− return -ENOMEM;
3667−#endif
3668−
36693859 /* RSS */
36703860 for_each_nondefault_eth_queue(bp, i)
36713861 if (bnx2x_alloc_fp_mem_at(bp, i))
@@ -3676,17 +3866,17 @@ int bnx2x_alloc_fp_mem(struct bnx2x *bp) · 4 unmodified lines
36763866 int delta = BNX2X_NUM_ETH_QUEUES(bp) - i;
36773867
36783868 WARN_ON(delta < 0);
3679−#ifdef BCM_CNIC
3680− /**
3681− * move non eth FPs next to last eth FP
3682− * must be done in that order
3683− * FCOE_IDX < FWD_IDX < OOO_IDX
3684− */
3869+ if (CNIC_SUPPORT(bp))
3870+ /* move non eth FPs next to last eth FP
3871+ * must be done in that order
3872+ * FCOE_IDX < FWD_IDX < OOO_IDX
3873+ */
36853874
3686− /* move FCoE fp even NO_FCOE_FLAG is on */
3687− bnx2x_move_fp(bp, FCOE_IDX(bp), FCOE_IDX(bp) - delta);
3688−#endif
3689− bp->num_queues -= delta;
3875+ /* move FCoE fp even NO_FCOE_FLAG is on */
3876+ bnx2x_move_fp(bp, FCOE_IDX(bp), FCOE_IDX(bp) - delta);
3877+ bp->num_ethernet_queues -= delta;
3878+ bp->num_queues = bp->num_ethernet_queues +
3879+ bp->num_cnic_queues;
36903880 BNX2X_ERR("Adjusted num of queues from %d to %d\n",
36913881 bp->num_queues + delta, bp->num_queues);
36923882 }
@@ -3705,13 +3895,13 @@ void bnx2x_free_mem_bp(struct bnx2x *bp) · 12 unmodified lines
37053895 kfree(bp->ilt);
37063896 }
37073897
3708−int __devinit bnx2x_alloc_mem_bp(struct bnx2x *bp)
3898+int bnx2x_alloc_mem_bp(struct bnx2x *bp)
37093899 {
37103900 struct bnx2x_fastpath *fp;
37113901 struct msix_entry *tbl;
37123902 struct bnx2x_ilt *ilt;
37133903 int msix_table_size = 0;
3714− int fp_array_size;
3904+ int fp_array_size, txq_array_size;
37153905 int i;
37163906
37173907 /*
@@ -3721,7 +3911,7 @@ int __devinit bnx2x_alloc_mem_bp(struct bnx2x *bp) · 3 unmodified lines
37213911 msix_table_size = bp->igu_sb_cnt + 1;
37223912
37233913 /* fp array: RSS plus CNIC related L2 queues */
3724− fp_array_size = BNX2X_MAX_RSS_COUNT(bp) + NON_ETH_CONTEXT_USE;
3914+ fp_array_size = BNX2X_MAX_RSS_COUNT(bp) + CNIC_SUPPORT(bp);
37253915 BNX2X_DEV_INFO("fp_array_size %d", fp_array_size);
37263916
37273917 fp = kcalloc(fp_array_size, sizeof(*fp), GFP_KERNEL);
@@ -3750,12 +3940,12 @@ int __devinit bnx2x_alloc_mem_bp(struct bnx2x *bp) · 22 unmodified lines
37503940 goto alloc_err;
37513941
37523942 /* Allocate memory for the transmission queues array */
3753− bp->bnx2x_txq_size = BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS;
3754−#ifdef BCM_CNIC
3755− bp->bnx2x_txq_size++;
3756−#endif
3757− bp->bnx2x_txq = kcalloc(bp->bnx2x_txq_size,
3758− sizeof(struct bnx2x_fp_txdata), GFP_KERNEL);
3943+ txq_array_size =
3944+ BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS + CNIC_SUPPORT(bp);
3945+ BNX2X_DEV_INFO("txq_array_size %d", txq_array_size);
3946+
3947+ bp->bnx2x_txq = kcalloc(txq_array_size, sizeof(struct bnx2x_fp_txdata),
3948+ GFP_KERNEL);
37593949 if (!bp->bnx2x_txq)
37603950 goto alloc_err;
37613951
@@ -3838,7 +4028,7 @@ int bnx2x_get_link_cfg_idx(struct bnx2x *bp) · 76 unmodified lines
38384028 return LINK_CONFIG_IDX(sel_phy_idx);
38394029 }
38404030
3841−#if defined(NETDEV_FCOE_WWNN) && defined(BCM_CNIC)
4031+#ifdef NETDEV_FCOE_WWNN
38424032 int bnx2x_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)
38434033 {
38444034 struct bnx2x *bp = netdev_priv(dev);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h+67−24
@@ -144,7 +144,7 @@ u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param); · 143 unmodified lines
144144 * @bp: driver handle
145145 * @load_mode: current mode
146146 */
147−u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode);
147+int bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode);
148148
149149 /**
150150 * bnx2x_link_set - configure hw according to link parameters structure.
@@ -238,7 +238,6 @@ irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance); · 87 unmodified lines
238238 * @dev_instance: private instance
239239 */
240240 irqreturn_t bnx2x_interrupt(int irq, void *dev_instance);
241−#ifdef BCM_CNIC
242241
243242 /**
244243 * bnx2x_cnic_notify - send command to cnic driver
@@ -262,8 +261,6 @@ void bnx2x_setup_cnic_irq_info(struct bnx2x *bp); · 17 unmodified lines
262261 */
263262 void bnx2x_setup_cnic_info(struct bnx2x *bp);
264263
265−#endif
266−
267264 /**
268265 * bnx2x_int_enable - enable HW interrupts.
269266 *
@@ -283,7 +280,7 @@ void bnx2x_int_enable(struct bnx2x *bp); · 13 unmodified lines
283280 void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw);
284281
285282 /**
286− * bnx2x_nic_init - init driver internals.
283+ * bnx2x_nic_init_cnic - init driver internals for cnic.
287284 *
288285 * @bp: driver handle
289286 * @load_code: COMMON, PORT or FUNCTION
@@ -293,8 +290,25 @@ void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw); · 3 unmodified lines
293290 * - status blocks
294291 * - etc.
295292 */
296−void bnx2x_nic_init(struct bnx2x *bp, u32 load_code);
293+void bnx2x_nic_init_cnic(struct bnx2x *bp);
297294
295+/**
296+ * bnx2x_nic_init - init driver internals.
297+ *
298+ * @bp: driver handle
299+ *
300+ * Initializes:
301+ * - rings
302+ * - status blocks
303+ * - etc.
304+ */
305+void bnx2x_nic_init(struct bnx2x *bp, u32 load_code);
306+/**
307+ * bnx2x_alloc_mem_cnic - allocate driver's memory for cnic.
308+ *
309+ * @bp: driver handle
310+ */
311+int bnx2x_alloc_mem_cnic(struct bnx2x *bp);
298312 /**
299313 * bnx2x_alloc_mem - allocate driver's memory.
300314 *
@@ -302,6 +316,12 @@ void bnx2x_nic_init(struct bnx2x *bp, u32 load_code); · 1 unmodified line
302316 */
303317 int bnx2x_alloc_mem(struct bnx2x *bp);
304318
319+/**
320+ * bnx2x_free_mem_cnic - release driver's memory for cnic.
321+ *
322+ * @bp: driver handle
323+ */
324+void bnx2x_free_mem_cnic(struct bnx2x *bp);
305325 /**
306326 * bnx2x_free_mem - release driver's memory.
307327 *
@@ -407,6 +427,7 @@ bool bnx2x_reset_is_done(struct bnx2x *bp, int engine); · 99 unmodified lines
407427 void bnx2x_set_reset_in_progress(struct bnx2x *bp);
408428 void bnx2x_set_reset_global(struct bnx2x *bp);
409429 void bnx2x_disable_close_the_gate(struct bnx2x *bp);
430+int bnx2x_init_hw_func_cnic(struct bnx2x *bp);
410431
411432 /**
412433 * bnx2x_sp_event - handle ramrods completion.
@@ -423,6 +444,14 @@ void bnx2x_sp_event(struct bnx2x_fastpath *fp, union eth_rx_cqe *rr_cqe); · 10 unmodified lines
423444 */
424445 void bnx2x_ilt_set_info(struct bnx2x *bp);
425446
447+/**
448+ * bnx2x_ilt_set_cnic_info - prepare ILT configurations for SRC
449+ * and TM.
450+ *
451+ * @bp: driver handle
452+ */
453+void bnx2x_ilt_set_info_cnic(struct bnx2x *bp);
454+
426455 /**
427456 * bnx2x_dcbx_init - initialize dcbx protocol.
428457 *
@@ -491,12 +520,17 @@ int bnx2x_resume(struct pci_dev *pdev); · 62 unmodified lines
491520 /* Release IRQ vectors */
492521 void bnx2x_free_irq(struct bnx2x *bp);
493522
523+void bnx2x_free_fp_mem_cnic(struct bnx2x *bp);
494524 void bnx2x_free_fp_mem(struct bnx2x *bp);
525+int bnx2x_alloc_fp_mem_cnic(struct bnx2x *bp);
495526 int bnx2x_alloc_fp_mem(struct bnx2x *bp);
496527 void bnx2x_init_rx_rings(struct bnx2x *bp);
528+void bnx2x_init_rx_rings_cnic(struct bnx2x *bp);
529+void bnx2x_free_skbs_cnic(struct bnx2x *bp);
497530 void bnx2x_free_skbs(struct bnx2x *bp);
498531 void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw);
499532 void bnx2x_netif_start(struct bnx2x *bp);
533+int bnx2x_load_cnic(struct bnx2x *bp);
500534
501535 /**
502536 * bnx2x_enable_msix - set msix configuration.
@@ -529,7 +563,7 @@ int bnx2x_poll(struct napi_struct *napi, int budget); · 26 unmodified lines
529563 *
530564 * @bp: driver handle
531565 */
532−int __devinit bnx2x_alloc_mem_bp(struct bnx2x *bp);
566+int bnx2x_alloc_mem_bp(struct bnx2x *bp);
533567
534568 /**
535569 * bnx2x_free_mem_bp - release memories outsize main driver structure
@@ -547,7 +581,7 @@ void bnx2x_free_mem_bp(struct bnx2x *bp); · 11 unmodified lines
547581 */
548582 int bnx2x_change_mtu(struct net_device *dev, int new_mtu);
549583
550−#if defined(NETDEV_FCOE_WWNN) && defined(BCM_CNIC)
584+#ifdef NETDEV_FCOE_WWNN
551585 /**
552586 * bnx2x_fcoe_get_wwn - return the requested WWN value for this port
553587 *
@@ -793,23 +827,39 @@ static inline void bnx2x_free_rx_sge(struct bnx2x *bp, · 239 unmodified lines
793827 sge->addr_lo = 0;
794828 }
795829
796−static inline void bnx2x_add_all_napi(struct bnx2x *bp)
830+static inline void bnx2x_add_all_napi_cnic(struct bnx2x *bp)
797831 {
798832 int i;
799833
800− bp->num_napi_queues = bp->num_queues;
834+ /* Add NAPI objects */
835+ for_each_rx_queue_cnic(bp, i)
836+ netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi),
837+ bnx2x_poll, BNX2X_NAPI_WEIGHT);
838+}
839+
840+static inline void bnx2x_add_all_napi(struct bnx2x *bp)
841+{
842+ int i;
801843
802844 /* Add NAPI objects */
803− for_each_rx_queue(bp, i)
845+ for_each_eth_queue(bp, i)
804846 netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi),
805847 bnx2x_poll, BNX2X_NAPI_WEIGHT);
806848 }
807849
850+static inline void bnx2x_del_all_napi_cnic(struct bnx2x *bp)
851+{
852+ int i;
853+
854+ for_each_rx_queue_cnic(bp, i)
855+ netif_napi_del(&bnx2x_fp(bp, i, napi));
856+}
857+
808858 static inline void bnx2x_del_all_napi(struct bnx2x *bp)
809859 {
810860 int i;
811861
812− for_each_rx_queue(bp, i)
862+ for_each_eth_queue(bp, i)
813863 netif_napi_del(&bnx2x_fp(bp, i, napi));
814864 }
815865
@@ -979,11 +1029,9 @@ static inline u8 bnx2x_stats_id(struct bnx2x_fastpath *fp) · 163 unmodified lines
9791029 {
9801030 struct bnx2x *bp = fp->bp;
9811031 if (!CHIP_IS_E1x(bp)) {
982−#ifdef BCM_CNIC
9831032 /* there are special statistics counters for FCoE 136..140 */
9841033 if (IS_FCOE_FP(fp))
9851034 return bp->cnic_base_cl_id + (bp->pf_num >> 1);
986−#endif
9871035 return fp->cl_id;
9881036 }
9891037 return fp->cl_id + BP_PORT(bp) * FP_SB_MAX_E1x;
@@ -1102,7 +1150,6 @@ static inline void bnx2x_init_txdata(struct bnx2x *bp, · 112 unmodified lines
11021150 txdata->cid, txdata->txq_index);
11031151 }
11041152
1105−#ifdef BCM_CNIC
11061153 static inline u8 bnx2x_cnic_eth_cl_id(struct bnx2x *bp, u8 cl_idx)
11071154 {
11081155 return bp->cnic_base_cl_id + cl_idx +
@@ -1162,7 +1209,6 @@ static inline void bnx2x_init_fcoe_fp(struct bnx2x *bp) · 53 unmodified lines
11621209 fp->index, bp, fp->status_blk.e2_sb, fp->cl_id, fp->fw_sb_id,
11631210 fp->igu_sb_id);
11641211 }
1165−#endif
11661212
11671213 static inline int bnx2x_clean_tx_queue(struct bnx2x *bp,
11681214 struct bnx2x_fp_txdata *txdata)
@@ -1280,7 +1326,7 @@ static inline bool bnx2x_mtu_allows_gro(int mtu) · 111 unmodified lines
12801326 */
12811327 return mtu <= SGE_PAGE_SIZE && (U_ETH_SGL_SIZE * fpp) <= MAX_SKB_FRAGS;
12821328 }
1283−#ifdef BCM_CNIC
1329+
12841330 /**
12851331 * bnx2x_get_iscsi_info - update iSCSI params according to licensing info.
12861332 *
@@ -1288,7 +1334,6 @@ static inline bool bnx2x_mtu_allows_gro(int mtu) · 1 unmodified line
12881334 *
12891335 */
12901336 void bnx2x_get_iscsi_info(struct bnx2x *bp);
1291−#endif
12921337
12931338 /**
12941339 * bnx2x_link_sync_notify - send notification to other functions.
@@ -1340,13 +1385,11 @@ static inline void bnx2x_update_drv_flags(struct bnx2x *bp, u32 flags, u32 set) · 45 unmodified lines
13401385
13411386 static inline bool bnx2x_is_valid_ether_addr(struct bnx2x *bp, u8 *addr)
13421387 {
1343− if (is_valid_ether_addr(addr))
1388+ if (is_valid_ether_addr(addr) ||
1389+ (is_zero_ether_addr(addr) &&
1390+ (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))))
13441391 return true;
1345−#ifdef BCM_CNIC
1346− if (is_zero_ether_addr(addr) &&
1347− (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp)))
1348− return true;
1349−#endif
1392+
13501393 return false;
13511394 }
13521395
drivers/net/ethernet/broadcom/bnx2x/bnx2x_dcb.c+31−10
@@ -413,8 +413,11 @@ static int bnx2x_dcbx_read_mib(struct bnx2x *bp, · 412 unmodified lines
413413
414414 static void bnx2x_pfc_set_pfc(struct bnx2x *bp)
415415 {
416+ int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
417+ GET_FLAGS(SHMEM2_RD(bp, drv_flags),
418+ 1 << DRV_FLAGS_DCB_MFW_CONFIGURED);
416419 if (bp->dcbx_port_params.pfc.enabled &&
417− !(bp->dcbx_error & DCBX_REMOTE_MIB_ERROR))
420+ (!(bp->dcbx_error & DCBX_REMOTE_MIB_ERROR) || mfw_configured))
418421 /*
419422 * 1. Fills up common PFC structures if required
420423 * 2. Configure NIG, MAC and BRB via the elink
@@ -552,10 +555,13 @@ static void bnx2x_dcbx_update_ets_config(struct bnx2x *bp) · 131 unmodified lines
552555
553556 static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp)
554557 {
558+ int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
559+ GET_FLAGS(SHMEM2_RD(bp, drv_flags),
560+ 1 << DRV_FLAGS_DCB_MFW_CONFIGURED);
555561 bnx2x_ets_disabled(&bp->link_params, &bp->link_vars);
556562
557563 if (!bp->dcbx_port_params.ets.enabled ||
558− (bp->dcbx_error & DCBX_REMOTE_MIB_ERROR))
564+ ((bp->dcbx_error & DCBX_REMOTE_MIB_ERROR) && !mfw_configured))
559565 return;
560566
561567 if (CHIP_IS_E3B0(bp))
@@ -1802,11 +1808,14 @@ static void bnx2x_dcbx_fw_struct(struct bnx2x *bp, · 1240 unmodified lines
18021808 u8 cos = 0, pri = 0;
18031809 struct priority_cos *tt2cos;
18041810 u32 *ttp = bp->dcbx_port_params.app.traffic_type_priority;
1811+ int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
1812+ GET_FLAGS(SHMEM2_RD(bp, drv_flags),
1813+ 1 << DRV_FLAGS_DCB_MFW_CONFIGURED);
18051814
18061815 memset(pfc_fw_cfg, 0, sizeof(*pfc_fw_cfg));
18071816
18081817 /* to disable DCB - the structure must be zeroed */
1809− if (bp->dcbx_error & DCBX_REMOTE_MIB_ERROR)
1818+ if ((bp->dcbx_error & DCBX_REMOTE_MIB_ERROR) && !mfw_configured)
18101819 return;
18111820
18121821 /*shortcut*/
@@ -1895,6 +1904,11 @@ static u8 bnx2x_dcbnl_set_state(struct net_device *netdev, u8 state) · 82 unmodified lines
18951904 struct bnx2x *bp = netdev_priv(netdev);
18961905 DP(BNX2X_MSG_DCB, "state = %s\n", state ? "on" : "off");
18971906
1907+ if (state && ((bp->dcbx_enabled == BNX2X_DCBX_ENABLED_OFF) ||
1908+ (bp->dcbx_enabled == BNX2X_DCBX_ENABLED_INVALID))) {
1909+ DP(BNX2X_MSG_DCB, "Can not set dcbx to enabled while it is disabled in nvm\n");
1910+ return 1;
1911+ }
18981912 bnx2x_dcbx_set_state(bp, (state ? true : false), bp->dcbx_enabled);
18991913 return 0;
19001914 }
@@ -1908,10 +1922,10 @@ static void bnx2x_dcbnl_get_perm_hw_addr(struct net_device *netdev, · 7 unmodified lines
19081922 /* first the HW mac address */
19091923 memcpy(perm_addr, netdev->dev_addr, netdev->addr_len);
19101924
1911−#ifdef BCM_CNIC
1912− /* second SAN address */
1913− memcpy(perm_addr+netdev->addr_len, bp->fip_mac, netdev->addr_len);
1914−#endif
1925+ if (CNIC_LOADED(bp))
1926+ /* second SAN address */
1927+ memcpy(perm_addr+netdev->addr_len, bp->fip_mac,
1928+ netdev->addr_len);
19151929 }
19161930
19171931 static void bnx2x_dcbnl_set_pg_tccfg_tx(struct net_device *netdev, int prio,
@@ -2038,10 +2052,13 @@ static void bnx2x_dcbnl_set_pfc_cfg(struct net_device *netdev, int prio, · 120 unmodified lines
20382052 if (!bnx2x_dcbnl_set_valid(bp) || prio >= MAX_PFC_PRIORITIES)
20392053 return;
20402054
2041− bp->dcbx_config_params.admin_pfc_bitmap |= ((setting ? 1 : 0) << prio);
20422055
2043− if (setting)
2056+ if (setting) {
2057+ bp->dcbx_config_params.admin_pfc_bitmap |= (1 << prio);
20442058 bp->dcbx_config_params.admin_pfc_tx_enable = 1;
2059+ } else {
2060+ bp->dcbx_config_params.admin_pfc_bitmap &= ~(1 << prio);
2061+ }
20452062 }
20462063
20472064 static void bnx2x_dcbnl_get_pfc_cfg(struct net_device *netdev, int prio,
@@ -2073,8 +2090,12 @@ static u8 bnx2x_dcbnl_set_all(struct net_device *netdev) · 25 unmodified lines
20732090 "Handling parity error recovery. Try again later\n");
20742091 return 1;
20752092 }
2076− if (netif_running(bp->dev))
2093+ if (netif_running(bp->dev)) {
2094+ bnx2x_update_drv_flags(bp,
2095+ 1 << DRV_FLAGS_DCB_MFW_CONFIGURED,
2096+ 1);
20772097 bnx2x_dcbx_init(bp, true);
2098+ }
20782099 DP(BNX2X_MSG_DCB, "set_dcbx_params done (%d)\n", rc);
20792100 if (rc)
20802101 return 1;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c+18−11
@@ -62,7 +62,9 @@ static const struct { · 61 unmodified lines
6262 8, "[%s]: tpa_aggregations" },
6363 { Q_STATS_OFFSET32(total_tpa_aggregated_frames_hi),
6464 8, "[%s]: tpa_aggregated_frames"},
65− { Q_STATS_OFFSET32(total_tpa_bytes_hi), 8, "[%s]: tpa_bytes"}
65+ { Q_STATS_OFFSET32(total_tpa_bytes_hi), 8, "[%s]: tpa_bytes"},
66+ { Q_STATS_OFFSET32(driver_filtered_tx_pkt),
67+ 4, "[%s]: driver_filtered_tx_pkt" }
6668 };
6769
6870 #define BNX2X_NUM_Q_STATS ARRAY_SIZE(bnx2x_q_stats_arr)
@@ -177,6 +179,8 @@ static const struct { · 108 unmodified lines
177179 4, STATS_FLAGS_FUNC, "recoverable_errors" },
178180 { STATS_OFFSET32(unrecoverable_error),
179181 4, STATS_FLAGS_FUNC, "unrecoverable_errors" },
182+ { STATS_OFFSET32(driver_filtered_tx_pkt),
183+ 4, STATS_FLAGS_FUNC, "driver_filtered_tx_pkt" },
180184 { STATS_OFFSET32(eee_tx_lpi),
181185 4, STATS_FLAGS_PORT, "Tx LPI entry count"}
182186 };
@@ -227,18 +231,14 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) · 44 unmodified lines
227231 cmd->advertising &= ~(ADVERTISED_10000baseT_Full);
228232 }
229233
230− if ((bp->state == BNX2X_STATE_OPEN) && (bp->link_vars.link_up)) {
231− if (!(bp->flags & MF_FUNC_DIS)) {
232− ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed);
234+ if ((bp->state == BNX2X_STATE_OPEN) && bp->link_vars.link_up &&
235+ !(bp->flags & MF_FUNC_DIS)) {
233236 cmd->duplex = bp->link_vars.duplex;
234− } else {
235− ethtool_cmd_speed_set(
236− cmd, bp->link_params.req_line_speed[cfg_idx]);
237− cmd->duplex = bp->link_params.req_duplex[cfg_idx];
238− }
239237
240238 if (IS_MF(bp) && !BP_NOMCP(bp))
241239 ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp));
240+ else
241+ ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed);
242242 } else {
243243 cmd->duplex = DUPLEX_UNKNOWN;
244244 ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN);
@@ -2660,20 +2660,25 @@ static int bnx2x_set_phys_id(struct net_device *dev, · 2415 unmodified lines
26602660 return 1; /* cycle on/off once per second */
26612661
26622662 case ETHTOOL_ID_ON:
2663+ bnx2x_acquire_phy_lock(bp);
26632664 bnx2x_set_led(&bp->link_params, &bp->link_vars,
26642665 LED_MODE_ON, SPEED_1000);
2666+ bnx2x_release_phy_lock(bp);
26652667 break;
26662668
26672669 case ETHTOOL_ID_OFF:
2670+ bnx2x_acquire_phy_lock(bp);
26682671 bnx2x_set_led(&bp->link_params, &bp->link_vars,
26692672 LED_MODE_FRONT_PANEL_OFF, 0);
2670−
2673+ bnx2x_release_phy_lock(bp);
26712674 break;
26722675
26732676 case ETHTOOL_ID_INACTIVE:
2677+ bnx2x_acquire_phy_lock(bp);
26742678 bnx2x_set_led(&bp->link_params, &bp->link_vars,
26752679 LED_MODE_OPER,
26762680 bp->link_vars.line_speed);
2681+ bnx2x_release_phy_lock(bp);
26772682 }
26782683
26792684 return 0;
@@ -2901,7 +2906,9 @@ static void bnx2x_get_channels(struct net_device *dev, · 221 unmodified lines
29012906 static void bnx2x_change_num_queues(struct bnx2x *bp, int num_rss)
29022907 {
29032908 bnx2x_disable_msi(bp);
2904− BNX2X_NUM_QUEUES(bp) = num_rss + NON_ETH_CONTEXT_USE;
2909+ bp->num_ethernet_queues = num_rss;
2910+ bp->num_queues = bp->num_ethernet_queues + bp->num_cnic_queues;
2911+ BNX2X_DEV_INFO("set number of queues to %d\n", bp->num_queues);
29052912 bnx2x_set_int_mode(bp);
29062913 }
29072914
drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h+5−0
@@ -23,6 +23,11 @@ · 22 unmodified lines
2323 (IRO[159].base + ((funcId) * IRO[159].m1))
2424 #define CSTORM_FUNC_EN_OFFSET(funcId) \
2525 (IRO[149].base + ((funcId) * IRO[149].m1))
26+#define CSTORM_HC_SYNC_LINE_INDEX_E1X_OFFSET(hcIndex, sbId) \
27+ (IRO[139].base + ((hcIndex) * IRO[139].m1) + ((sbId) * IRO[139].m2))
28+#define CSTORM_HC_SYNC_LINE_INDEX_E2_OFFSET(hcIndex, sbId) \
29+ (IRO[138].base + (((hcIndex)>>2) * IRO[138].m1) + (((hcIndex)&3) \
30+ * IRO[138].m2) + ((sbId) * IRO[138].m3))
2631 #define CSTORM_IGU_MODE_OFFSET (IRO[157].base)
2732 #define CSTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \
2833 (IRO[316].base + ((pfId) * IRO[316].m1))
drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h+46−8
@@ -500,7 +500,15 @@ struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */ · 499 unmodified lines
500500 u32 e3_cmn_pin_cfg1; /* 0x170 */
501501 #define PORT_HW_CFG_E3_OVER_CURRENT_MASK 0x000000FF
502502 #define PORT_HW_CFG_E3_OVER_CURRENT_SHIFT 0
503− u32 reserved0[7]; /* 0x174 */
503+
504+ /* pause on host ring */
505+ u32 generic_features; /* 0x174 */
506+ #define PORT_HW_CFG_PAUSE_ON_HOST_RING_MASK 0x00000001
507+ #define PORT_HW_CFG_PAUSE_ON_HOST_RING_SHIFT 0
508+ #define PORT_HW_CFG_PAUSE_ON_HOST_RING_DISABLED 0x00000000
509+ #define PORT_HW_CFG_PAUSE_ON_HOST_RING_ENABLED 0x00000001
510+
511+ u32 reserved0[6]; /* 0x178 */
504512
505513 u32 aeu_int_mask; /* 0x190 */
506514
@@ -695,6 +703,7 @@ struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */ · 188 unmodified lines
695703 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54618SE 0x00000e00
696704 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8722 0x00000f00
697705 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54616 0x00001000
706+ #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84834 0x00001100
698707 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_FAILURE 0x0000fd00
699708 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_NOT_CONN 0x0000ff00
700709
@@ -751,6 +760,7 @@ struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */ · 50 unmodified lines
751760 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE 0x00000e00
752761 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8722 0x00000f00
753762 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54616 0x00001000
763+ #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834 0x00001100
754764 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT_WC 0x0000fc00
755765 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE 0x0000fd00
756766 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN 0x0000ff00
@@ -1246,6 +1256,7 @@ struct drv_func_mb { · 489 unmodified lines
12461256 #define DRV_MSG_CODE_VRFY_AFEX_SUPPORTED 0xa2000000
12471257 #define REQ_BC_VER_4_VRFY_AFEX_SUPPORTED 0x00070002
12481258 #define REQ_BC_VER_4_SFP_TX_DISABLE_SUPPORTED 0x00070014
1259+ #define REQ_BC_VER_4_MT_SUPPORTED 0x00070201
12491260 #define REQ_BC_VER_4_PFC_STATS_SUPPORTED 0x00070201
12501261 #define REQ_BC_VER_4_FCOE_FEATURES 0x00070209
12511262
@@ -1515,12 +1526,13 @@ enum mf_cfg_afex_vlan_mode { · 263 unmodified lines
15151526 /* This structure is not applicable and should not be accessed on 57711 */
15161527 struct func_ext_cfg {
15171528 u32 func_cfg;
1518− #define MACP_FUNC_CFG_FLAGS_MASK 0x000000FF
1529+ #define MACP_FUNC_CFG_FLAGS_MASK 0x0000007F
15191530 #define MACP_FUNC_CFG_FLAGS_SHIFT 0
15201531 #define MACP_FUNC_CFG_FLAGS_ENABLED 0x00000001
15211532 #define MACP_FUNC_CFG_FLAGS_ETHERNET 0x00000002
15221533 #define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x00000004
15231534 #define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x00000008
1535+ #define MACP_FUNC_CFG_PAUSE_ON_HOST_RING 0x00000080
15241536
15251537 u32 iscsi_mac_addr_upper;
15261538 u32 iscsi_mac_addr_lower;
@@ -2085,8 +2097,13 @@ struct shmem2_region { · 558 unmodified lines
20852097
20862098 /* generic flags controlled by the driver */
20872099 u32 drv_flags;
2088− #define DRV_FLAGS_DCB_CONFIGURED 0x1
2100+ #define DRV_FLAGS_DCB_CONFIGURED 0x0
2101+ #define DRV_FLAGS_DCB_CONFIGURATION_ABORTED 0x1
2102+ #define DRV_FLAGS_DCB_MFW_CONFIGURED 0x2
20892103
2104+ #define DRV_FLAGS_PORT_MASK ((1 << DRV_FLAGS_DCB_CONFIGURED) | \
2105+ (1 << DRV_FLAGS_DCB_CONFIGURATION_ABORTED) | \
2106+ (1 << DRV_FLAGS_DCB_MFW_CONFIGURED))
20902107 /* pointer to extended dev_info shared data copied from nvm image */
20912108 u32 extended_dev_info_shared_addr;
20922109 u32 ncsi_oem_data_addr;
@@ -2159,6 +2176,16 @@ struct shmem2_region { · 66 unmodified lines
21592176 #define SHMEM_EEE_TIME_OUTPUT_BIT 0x80000000
21602177
21612178 u32 sizeof_port_stats;
2179+
2180+ /* Link Flap Avoidance */
2181+ u32 lfa_host_addr[PORT_MAX];
2182+ u32 reserved1;
2183+
2184+ u32 reserved2; /* Offset 0x148 */
2185+ u32 reserved3; /* Offset 0x14C */
2186+ u32 reserved4; /* Offset 0x150 */
2187+ u32 link_attr_sync[PORT_MAX]; /* Offset 0x154 */
2188+ #define LINK_ATTR_SYNC_KR2_ENABLE (1<<0)
21622189 };
21632190
21642191
@@ -4845,9 +4872,17 @@ struct vif_list_event_data { · 2680 unmodified lines
48454872 __le32 reserved2;
48464873 };
48474874
4848−/*
4849− * union for all event ring message types
4850− */
4875+/* function update event data */
4876+struct function_update_event_data {
4877+ u8 echo;
4878+ u8 reserved;
4879+ __le16 reserved0;
4880+ __le32 reserved1;
4881+ __le32 reserved2;
4882+};
4883+
4884+
4885+/* union for all event ring message types */
48514886 union event_data {
48524887 struct vf_pf_event_data vf_pf_event;
48534888 struct eth_event_data eth_event;
@@ -4855,6 +4890,7 @@ union event_data { · 1 unmodified line
48554890 struct vf_flr_event_data vf_flr_event;
48564891 struct malicious_vf_event_data malicious_vf_event;
48574892 struct vif_list_event_data vif_list_event;
4893+ struct function_update_event_data function_update_event;
48584894 };
48594895
48604896
@@ -4984,8 +5020,10 @@ struct function_update_data { · 123 unmodified lines
49845020 u8 allowed_priorities;
49855021 u8 network_cos_mode;
49865022 u8 lb_mode_en;
4987− u8 reserved0;
4988− __le32 reserved1;
5023+ u8 tx_switch_suspend_change_flg;
5024+ u8 tx_switch_suspend;
5025+ u8 echo;
5026+ __le16 reserved1;
49895027 };
49905028
49915029
drivers/net/ethernet/broadcom/bnx2x/bnx2x_init_ops.h+22−7
@@ -648,15 +648,25 @@ static int bnx2x_ilt_client_mem_op(struct bnx2x *bp, int cli_num, · 647 unmodified lines
648648 return rc;
649649 }
650650
651+static int bnx2x_ilt_mem_op_cnic(struct bnx2x *bp, u8 memop)
652+{
653+ int rc = 0;
654+
655+ if (CONFIGURE_NIC_MODE(bp))
656+ rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_SRC, memop);
657+ if (!rc)
658+ rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_TM, memop);
659+
660+ return rc;
661+}
662+
651663 static int bnx2x_ilt_mem_op(struct bnx2x *bp, u8 memop)
652664 {
653665 int rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_CDU, memop);
654666 if (!rc)
655667 rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_QM, memop);
656− if (!rc)
668+ if (!rc && CNIC_SUPPORT(bp) && !CONFIGURE_NIC_MODE(bp))
657669 rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_SRC, memop);
658− if (!rc)
659− rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_TM, memop);
660670
661671 return rc;
662672 }
@@ -781,12 +791,19 @@ static void bnx2x_ilt_client_id_init_op(struct bnx2x *bp, · 118 unmodified lines
781791 bnx2x_ilt_client_init_op(bp, ilt_cli, initop);
782792 }
783793
794+static void bnx2x_ilt_init_op_cnic(struct bnx2x *bp, u8 initop)
795+{
796+ if (CONFIGURE_NIC_MODE(bp))
797+ bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_SRC, initop);
798+ bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_TM, initop);
799+}
800+
784801 static void bnx2x_ilt_init_op(struct bnx2x *bp, u8 initop)
785802 {
786803 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_CDU, initop);
787804 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_QM, initop);
788− bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_SRC, initop);
789− bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_TM, initop);
805+ if (CNIC_SUPPORT(bp) && !CONFIGURE_NIC_MODE(bp))
806+ bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_SRC, initop);
790807 }
791808
792809 static void bnx2x_ilt_init_client_psz(struct bnx2x *bp, int cli_num,
@@ -890,7 +907,6 @@ static void bnx2x_qm_init_ptr_table(struct bnx2x *bp, int qm_cid_count, · 97 unmodified lines
890907 /****************************************************************************
891908 * SRC initializations
892909 ****************************************************************************/
893−#ifdef BCM_CNIC
894910 /* called during init func stage */
895911 static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2,
896912 dma_addr_t t2_mapping, int src_cid_count)
@@ -915,5 +931,4 @@ static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2, · 18 unmodified lines
915931 U64_HI((u64)t2_mapping +
916932 (src_cid_count-1) * sizeof(struct src_ent)));
917933 }
918−#endif
919934 #endif /* BNX2X_INIT_OPS_H */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c+653−338
@@ -121,6 +121,7 @@ · 120 unmodified lines
121121 #define GP_STATUS_10G_XFI MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_10G_XFI
122122 #define GP_STATUS_20G_DXGXS MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_20G_DXGXS
123123 #define GP_STATUS_10G_SFI MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_10G_SFI
124+#define GP_STATUS_20G_KR2 MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_20G_KR2
124125 #define LINK_10THD LINK_STATUS_SPEED_AND_DUPLEX_10THD
125126 #define LINK_10TFD LINK_STATUS_SPEED_AND_DUPLEX_10TFD
126127 #define LINK_100TXHD LINK_STATUS_SPEED_AND_DUPLEX_100TXHD
@@ -253,6 +254,12 @@ static int bnx2x_check_lfa(struct link_params *params) · 126 unmodified lines
253254 if (!(link_status & LINK_STATUS_LINK_UP))
254255 return LFA_LINK_DOWN;
255256
257+ /* if loaded after BOOT from SAN, don't flap the link in any case and
258+ * rely on link set by preboot driver
259+ */
260+ if (params->feature_config_flags & FEATURE_CONFIG_BOOT_FROM_SAN)
261+ return 0;
262+
256263 /* Verify that loopback mode is not set */
257264 if (params->loopback_mode)
258265 return LFA_LOOPBACK_ENABLED;
@@ -1440,30 +1447,47 @@ void bnx2x_pfc_statistic(struct link_params *params, struct link_vars *vars, · 1181 unmodified lines
14401447 /******************************************************************/
14411448 /* MAC/PBF section */
14421449 /******************************************************************/
1443−static void bnx2x_set_mdio_clk(struct bnx2x *bp, u32 chip_id, u8 port)
1450+static void bnx2x_set_mdio_clk(struct bnx2x *bp, u32 chip_id,
1451+ u32 emac_base)
14441452 {
1445− u32 mode, emac_base;
1453+ u32 new_mode, cur_mode;
1454+ u32 clc_cnt;
14461455 /* Set clause 45 mode, slow down the MDIO clock to 2.5MHz
14471456 * (a value of 49==0x31) and make sure that the AUTO poll is off
14481457 */
1458+ cur_mode = REG_RD(bp, emac_base + EMAC_REG_EMAC_MDIO_MODE);
14491459
1450− if (CHIP_IS_E2(bp))
1451− emac_base = GRCBASE_EMAC0;
1452− else
1453− emac_base = (port) ? GRCBASE_EMAC1 : GRCBASE_EMAC0;
1454− mode = REG_RD(bp, emac_base + EMAC_REG_EMAC_MDIO_MODE);
1455− mode &= ~(EMAC_MDIO_MODE_AUTO_POLL |
1456− EMAC_MDIO_MODE_CLOCK_CNT);
14571460 if (USES_WARPCORE(bp))
1458− mode |= (74L << EMAC_MDIO_MODE_CLOCK_CNT_BITSHIFT);
1461+ clc_cnt = 74L << EMAC_MDIO_MODE_CLOCK_CNT_BITSHIFT;
14591462 else
1460− mode |= (49L << EMAC_MDIO_MODE_CLOCK_CNT_BITSHIFT);
1463+ clc_cnt = 49L << EMAC_MDIO_MODE_CLOCK_CNT_BITSHIFT;
14611464
1462− mode |= (EMAC_MDIO_MODE_CLAUSE_45);
1463− REG_WR(bp, emac_base + EMAC_REG_EMAC_MDIO_MODE, mode);
1465+ if (((cur_mode & EMAC_MDIO_MODE_CLOCK_CNT) == clc_cnt) &&
1466+ (cur_mode & (EMAC_MDIO_MODE_CLAUSE_45)))
1467+ return;
14641468
1469+ new_mode = cur_mode &
1470+ ~(EMAC_MDIO_MODE_AUTO_POLL | EMAC_MDIO_MODE_CLOCK_CNT);
1471+ new_mode |= clc_cnt;
1472+ new_mode |= (EMAC_MDIO_MODE_CLAUSE_45);
1473+
1474+ DP(NETIF_MSG_LINK, "Changing emac_mode from 0x%x to 0x%x\n",
1475+ cur_mode, new_mode);
1476+ REG_WR(bp, emac_base + EMAC_REG_EMAC_MDIO_MODE, new_mode);
14651477 udelay(40);
14661478 }
1479+
1480+static void bnx2x_set_mdio_emac_per_phy(struct bnx2x *bp,
1481+ struct link_params *params)
1482+{
1483+ u8 phy_index;
1484+ /* Set mdio clock per phy */
1485+ for (phy_index = INT_PHY; phy_index < params->num_phys;
1486+ phy_index++)
1487+ bnx2x_set_mdio_clk(bp, params->chip_id,
1488+ params->phy[phy_index].mdio_ctrl);
1489+}
1490+
14671491 static u8 bnx2x_is_4_port_mode(struct bnx2x *bp)
14681492 {
14691493 u32 port4mode_ovwr_val;
@@ -1508,7 +1532,8 @@ static void bnx2x_emac_init(struct link_params *params, · 38 unmodified lines
15081532 }
15091533 timeout--;
15101534 } while (val & EMAC_MODE_RESET);
1511− bnx2x_set_mdio_clk(bp, params->chip_id, port);
1535+
1536+ bnx2x_set_mdio_emac_per_phy(bp, params);
15121537 /* Set mac address */
15131538 val = ((params->mac_addr[0] << 8) |
15141539 params->mac_addr[1]);
@@ -1664,7 +1689,10 @@ static void bnx2x_xmac_init(struct link_params *params, u32 max_speed) · 149 unmodified lines
16641689 * ports of the path
16651690 */
16661691
1667− if ((CHIP_NUM(bp) == CHIP_NUM_57840_4_10) &&
1692+ if (((CHIP_NUM(bp) == CHIP_NUM_57840_4_10) ||
1693+ (CHIP_NUM(bp) == CHIP_NUM_57840_2_20) ||
1694+ (CHIP_NUM(bp) == CHIP_NUM_57840_OBSOLETE)) &&
1695+ is_port4mode &&
16681696 (REG_RD(bp, MISC_REG_RESET_REG_2) &
16691697 MISC_REGISTERS_RESET_REG_2_XMAC)) {
16701698 DP(NETIF_MSG_LINK,
@@ -1760,6 +1788,18 @@ static int bnx2x_xmac_enable(struct link_params *params, · 89 unmodified lines
17601788 */
17611789 REG_WR(bp, NIG_REG_EGRESS_EMAC0_PORT + params->port*4, 0);
17621790
1791+ /* When XMAC is in XLGMII mode, disable sending idles for fault
1792+ * detection.
1793+ */
1794+ if (!(params->phy[INT_PHY].flags & FLAGS_TX_ERROR_CHECK)) {
1795+ REG_WR(bp, xmac_base + XMAC_REG_RX_LSS_CTRL,
1796+ (XMAC_RX_LSS_CTRL_REG_LOCAL_FAULT_DISABLE |
1797+ XMAC_RX_LSS_CTRL_REG_REMOTE_FAULT_DISABLE));
1798+ REG_WR(bp, xmac_base + XMAC_REG_CLEAR_RX_LSS_STATUS, 0);
1799+ REG_WR(bp, xmac_base + XMAC_REG_CLEAR_RX_LSS_STATUS,
1800+ XMAC_CLEAR_RX_LSS_STATUS_REG_CLEAR_LOCAL_FAULT_STATUS |
1801+ XMAC_CLEAR_RX_LSS_STATUS_REG_CLEAR_REMOTE_FAULT_STATUS);
1802+ }
17631803 /* Set Max packet size */
17641804 REG_WR(bp, xmac_base + XMAC_REG_RX_MAX_SIZE, 0x2710);
17651805
@@ -1780,6 +1820,12 @@ static int bnx2x_xmac_enable(struct link_params *params, · 14 unmodified lines
17801820 /* Enable TX and RX */
17811821 val = XMAC_CTRL_REG_TX_EN | XMAC_CTRL_REG_RX_EN;
17821822
1823+ /* Set MAC in XLGMII mode for dual-mode */
1824+ if ((vars->line_speed == SPEED_20000) &&
1825+ (params->phy[INT_PHY].supported &
1826+ SUPPORTED_20000baseKR2_Full))
1827+ val |= XMAC_CTRL_REG_XLGMII_ALIGN_ENB;
1828+
17831829 /* Check loopback mode */
17841830 if (lb)
17851831 val |= XMAC_CTRL_REG_LINE_LOCAL_LPBK;
@@ -2096,6 +2142,16 @@ static void bnx2x_update_mng(struct link_params *params, u32 link_status) · 310 unmodified lines
20962142 port_mb[params->port].link_status), link_status);
20972143 }
20982144
2145+static void bnx2x_update_link_attr(struct link_params *params, u32 link_attr)
2146+{
2147+ struct bnx2x *bp = params->bp;
2148+
2149+ if (SHMEM2_HAS(bp, link_attr_sync))
2150+ REG_WR(bp, params->shmem2_base +
2151+ offsetof(struct shmem2_region,
2152+ link_attr_sync[params->port]), link_attr);
2153+}
2154+
20992155 static void bnx2x_update_pfc_nig(struct link_params *params,
21002156 struct link_vars *vars,
21012157 struct bnx2x_nig_brb_pfc_port_params *nig_params)
@@ -2126,7 +2182,7 @@ static void bnx2x_update_pfc_nig(struct link_params *params, · 24 unmodified lines
21262182 if (CHIP_IS_E3(bp))
21272183 ppp_enable = 0;
21282184 else
2129− ppp_enable = 1;
2185+ ppp_enable = 1;
21302186 xcm_mask &= ~(port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN :
21312187 NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN);
21322188 xcm_out_en = 0;
@@ -2247,7 +2303,6 @@ int bnx2x_update_pfc(struct link_params *params, · 114 unmodified lines
22472303 return bnx2x_status;
22482304 }
22492305
2250−
22512306 static int bnx2x_bmac1_enable(struct link_params *params,
22522307 struct link_vars *vars,
22532308 u8 is_lb)
@@ -2651,6 +2706,13 @@ static int bnx2x_cl45_read(struct bnx2x *bp, struct bnx2x_phy *phy, · 397 unmodified lines
26512706 u32 val;
26522707 u16 i;
26532708 int rc = 0;
2709+ u32 chip_id;
2710+ if (phy->flags & FLAGS_MDC_MDIO_WA_G) {
2711+ chip_id = (REG_RD(bp, MISC_REG_CHIP_NUM) << 16) |
2712+ ((REG_RD(bp, MISC_REG_CHIP_REV) & 0xf) << 12);
2713+ bnx2x_set_mdio_clk(bp, chip_id, phy->mdio_ctrl);
2714+ }
2715+
26542716 if (phy->flags & FLAGS_MDC_MDIO_WA_B0)
26552717 bnx2x_bits_en(bp, phy->mdio_ctrl + EMAC_REG_EMAC_MDIO_STATUS,
26562718 EMAC_MDIO_STATUS_10MB);
@@ -2719,6 +2781,13 @@ static int bnx2x_cl45_write(struct bnx2x *bp, struct bnx2x_phy *phy, · 62 unmodified lines
27192781 u32 tmp;
27202782 u8 i;
27212783 int rc = 0;
2784+ u32 chip_id;
2785+ if (phy->flags & FLAGS_MDC_MDIO_WA_G) {
2786+ chip_id = (REG_RD(bp, MISC_REG_CHIP_NUM) << 16) |
2787+ ((REG_RD(bp, MISC_REG_CHIP_REV) & 0xf) << 12);
2788+ bnx2x_set_mdio_clk(bp, chip_id, phy->mdio_ctrl);
2789+ }
2790+
27222791 if (phy->flags & FLAGS_MDC_MDIO_WA_B0)
27232792 bnx2x_bits_en(bp, phy->mdio_ctrl + EMAC_REG_EMAC_MDIO_STATUS,
27242793 EMAC_MDIO_STATUS_10MB);
@@ -3147,6 +3216,15 @@ static void bnx2x_cl45_read_or_write(struct bnx2x *bp, struct bnx2x_phy *phy, · 422 unmodified lines
31473216 bnx2x_cl45_write(bp, phy, devad, reg, val | or_val);
31483217 }
31493218
3219+static void bnx2x_cl45_read_and_write(struct bnx2x *bp,
3220+ struct bnx2x_phy *phy,
3221+ u8 devad, u16 reg, u16 and_val)
3222+{
3223+ u16 val;
3224+ bnx2x_cl45_read(bp, phy, devad, reg, &val);
3225+ bnx2x_cl45_write(bp, phy, devad, reg, val & and_val);
3226+}
3227+
31503228 int bnx2x_phy_read(struct link_params *params, u8 phy_addr,
31513229 u8 devad, u16 reg, u16 *ret_val)
31523230 {
@@ -3551,6 +3629,44 @@ static u8 bnx2x_ext_phy_resolve_fc(struct bnx2x_phy *phy, · 398 unmodified lines
35513629 * init configuration, and set/clear SGMII flag. Internal
35523630 * phy init is done purely in phy_init stage.
35533631 */
3632+static void bnx2x_warpcore_enable_AN_KR2(struct bnx2x_phy *phy,
3633+ struct link_params *params,
3634+ struct link_vars *vars)
3635+{
3636+ struct bnx2x *bp = params->bp;
3637+ u16 i;
3638+ static struct bnx2x_reg_set reg_set[] = {
3639+ /* Step 1 - Program the TX/RX alignment markers */
3640+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL5, 0xa157},
3641+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL7, 0xcbe2},
3642+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL6, 0x7537},
3643+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL9, 0xa157},
3644+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL11, 0xcbe2},
3645+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL10, 0x7537},
3646+ /* Step 2 - Configure the NP registers */
3647+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_USERB0_CTRL, 0x000a},
3648+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL1, 0x6400},
3649+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL3, 0x0620},
3650+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CODE_FIELD, 0x0157},
3651+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI1, 0x6464},
3652+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI2, 0x3150},
3653+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI3, 0x3150},
3654+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_BAM_CODE, 0x0157},
3655+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_UD_CODE, 0x0620}
3656+ };
3657+ DP(NETIF_MSG_LINK, "Enabling 20G-KR2\n");
3658+
3659+ bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
3660+ MDIO_WC_REG_CL49_USERB0_CTRL, (3<<6));
3661+
3662+ for (i = 0; i < sizeof(reg_set)/sizeof(struct bnx2x_reg_set); i++)
3663+ bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg,
3664+ reg_set[i].val);
3665+
3666+ /* Start KR2 work-around timer which handles BCM8073 link-parner */
3667+ vars->link_attr_sync |= LINK_ATTR_SYNC_KR2_ENABLE;
3668+ bnx2x_update_link_attr(params, vars->link_attr_sync);
3669+}
35543670
35553671 static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy,
35563672 struct link_params *params)
@@ -3564,6 +3680,21 @@ static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy, · 7 unmodified lines
35643680 MDIO_WC_REG_DIGITAL4_MISC5, 0xc000);
35653681 }
35663682
3683+static void bnx2x_warpcore_restart_AN_KR(struct bnx2x_phy *phy,
3684+ struct link_params *params)
3685+{
3686+ /* Restart autoneg on the leading lane only */
3687+ struct bnx2x *bp = params->bp;
3688+ u16 lane = bnx2x_get_warpcore_lane(phy, params);
3689+ CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
3690+ MDIO_AER_BLOCK_AER_REG, lane);
3691+ bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
3692+ MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x1200);
3693+
3694+ /* Restore AER */
3695+ bnx2x_set_aer_mmd(params, phy);
3696+}
3697+
35673698 static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
35683699 struct link_params *params,
35693700 struct link_vars *vars) {
@@ -3576,7 +3707,9 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 6 unmodified lines
35763707 {MDIO_WC_DEVAD, MDIO_WC_REG_RX66_CONTROL, 0x7415},
35773708 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_MISC2, 0x6190},
35783709 /* Disable Autoneg: re-enable it after adv is done. */
3579− {MDIO_AN_DEVAD, MDIO_WC_REG_IEEE0BLK_MIICNTL, 0}
3710+ {MDIO_AN_DEVAD, MDIO_WC_REG_IEEE0BLK_MIICNTL, 0},
3711+ {MDIO_PMA_DEVAD, MDIO_WC_REG_PMD_KR_CONTROL, 0x2},
3712+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL72_USERB0_CL72_TX_FIR_TAP, 0},
35803713 };
35813714 DP(NETIF_MSG_LINK, "Enable Auto Negotiation for KR\n");
35823715 /* Set to default registers that may be overriden by 10G force */
@@ -3585,11 +3718,11 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 2 unmodified lines
35853718 reg_set[i].val);
35863719
35873720 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3588− MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, &cl72_ctrl);
3589− cl72_ctrl &= 0xf8ff;
3721+ MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, &cl72_ctrl);
3722+ cl72_ctrl &= 0x08ff;
35903723 cl72_ctrl |= 0x3800;
35913724 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3592− MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, cl72_ctrl);
3725+ MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, cl72_ctrl);
35933726
35943727 /* Check adding advertisement for 1G KX */
35953728 if (((vars->line_speed == SPEED_AUTO_NEG) &&
@@ -3624,6 +3757,16 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 28 unmodified lines
36243757 ((0x02 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) |
36253758 (0x06 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) |
36263759 (0x09 << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET)));
3760+ /* Configure the next lane if dual mode */
3761+ if (phy->flags & FLAGS_WC_DUAL_MODE)
3762+ bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3763+ MDIO_WC_REG_TX0_TX_DRIVER + 0x10*(lane+1),
3764+ ((0x02 <<
3765+ MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) |
3766+ (0x06 <<
3767+ MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) |
3768+ (0x09 <<
3769+ MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET)));
36273770 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
36283771 MDIO_WC_REG_CL72_USERB0_CL72_OS_DEF_CTRL,
36293772 0x03f0);
@@ -3670,10 +3813,26 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 40 unmodified lines
36703813 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
36713814 MDIO_WC_REG_DIGITAL3_UP1, 0x1f);
36723815
3673− /* Enable Autoneg */
3674− bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
3675− MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x1200);
3816+ if (((phy->req_line_speed == SPEED_AUTO_NEG) &&
3817+ (phy->speed_cap_mask & PORT_HW_CFG_SPEED_CAPABILITY_D0_20G)) ||
3818+ (phy->req_line_speed == SPEED_20000)) {
36763819
3820+ CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
3821+ MDIO_AER_BLOCK_AER_REG, lane);
3822+
3823+ bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
3824+ MDIO_WC_REG_RX1_PCI_CTRL + (0x10*lane),
3825+ (1<<11));
3826+
3827+ bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3828+ MDIO_WC_REG_XGXS_X2_CONTROL3, 0x7);
3829+ bnx2x_set_aer_mmd(params, phy);
3830+
3831+ bnx2x_warpcore_enable_AN_KR2(phy, params, vars);
3832+ }
3833+
3834+ /* Enable Autoneg: only on the main lane */
3835+ bnx2x_warpcore_restart_AN_KR(phy, params);
36773836 }
36783837
36793838 static void bnx2x_warpcore_set_10G_KR(struct bnx2x_phy *phy,
@@ -3692,9 +3851,7 @@ static void bnx2x_warpcore_set_10G_KR(struct bnx2x_phy *phy, · 12 unmodified lines
36923851 {MDIO_WC_DEVAD, MDIO_WC_REG_DIGITAL3_UP1, 0x1},
36933852 {MDIO_WC_DEVAD, MDIO_WC_REG_DIGITAL5_MISC7, 0xa},
36943853 /* Leave cl72 training enable, needed for KR */
3695− {MDIO_PMA_DEVAD,
3696− MDIO_WC_REG_PMD_IEEE9BLK_TENGBASE_KR_PMD_CONTROL_REGISTER_150,
3697− 0x2}
3854+ {MDIO_PMA_DEVAD, MDIO_WC_REG_PMD_KR_CONTROL, 0x2}
36983855 };
36993856
37003857 for (i = 0; i < sizeof(reg_set)/sizeof(struct bnx2x_reg_set); i++)
@@ -3764,27 +3921,21 @@ static void bnx2x_warpcore_set_10G_XFI(struct bnx2x_phy *phy, · 63 unmodified lines
37643921 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_CTRL, 0);
37653922
37663923 /* Disable 100FX Enable and Auto-Detect */
3767− bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3768− MDIO_WC_REG_FX100_CTRL1, &val);
3769− bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3770− MDIO_WC_REG_FX100_CTRL1, (val & 0xFFFA));
3924+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
3925+ MDIO_WC_REG_FX100_CTRL1, 0xFFFA);
37713926
37723927 /* Disable 100FX Idle detect */
37733928 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
37743929 MDIO_WC_REG_FX100_CTRL3, 0x0080);
37753930
37763931 /* Set Block address to Remote PHY & Clear forced_speed[5] */
3777− bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3778− MDIO_WC_REG_DIGITAL4_MISC3, &val);
3779− bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3780− MDIO_WC_REG_DIGITAL4_MISC3, (val & 0xFF7F));
3932+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
3933+ MDIO_WC_REG_DIGITAL4_MISC3, 0xFF7F);
37813934
37823935 /* Turn off auto-detect & fiber mode */
3783− bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3784− MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1, &val);
3785− bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3786− MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1,
3787− (val & 0xFFEE));
3936+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
3937+ MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1,
3938+ 0xFFEE);
37883939
37893940 /* Set filter_force_link, disable_false_link and parallel_detect */
37903941 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
@@ -3846,22 +3997,65 @@ static void bnx2x_warpcore_set_10G_XFI(struct bnx2x_phy *phy, · 55 unmodified lines
38463997 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x100);
38473998
38483999 /* Release tx_fifo_reset */
4000+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4001+ MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X3,
4002+ 0xFFFE);
4003+ /* Release rxSeqStart */
4004+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4005+ MDIO_WC_REG_DSC2B0_DSC_MISC_CTRL0, 0x7FFF);
4006+}
4007+
4008+static void bnx2x_warpcore_set_20G_force_KR2(struct bnx2x_phy *phy,
4009+ struct link_params *params)
4010+{
4011+ u16 val;
4012+ struct bnx2x *bp = params->bp;
4013+ /* Set global registers, so set AER lane to 0 */
4014+ CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
4015+ MDIO_AER_BLOCK_AER_REG, 0);
4016+
4017+ /* Disable sequencer */
4018+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4019+ MDIO_WC_REG_XGXSBLK0_XGXSCONTROL, ~(1<<13));
4020+
4021+ bnx2x_set_aer_mmd(params, phy);
4022+
4023+ bnx2x_cl45_read_and_write(bp, phy, MDIO_PMA_DEVAD,
4024+ MDIO_WC_REG_PMD_KR_CONTROL, ~(1<<1));
4025+ bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,
4026+ MDIO_AN_REG_CTRL, 0);
4027+ /* Turn off CL73 */
38494028 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3850− MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X3, &val);
4029+ MDIO_WC_REG_CL73_USERB0_CTRL, &val);
4030+ val &= ~(1<<5);
4031+ val |= (1<<6);
38514032 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3852− MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X3, val & 0xFFFE);
4033+ MDIO_WC_REG_CL73_USERB0_CTRL, val);
4034+
4035+ /* Set 20G KR2 force speed */
4036+ bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
4037+ MDIO_WC_REG_SERDESDIGITAL_MISC1, 0x1f);
4038+
4039+ bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
4040+ MDIO_WC_REG_DIGITAL4_MISC3, (1<<7));
38534041
3854− /* Release rxSeqStart */
38554042 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3856− MDIO_WC_REG_DSC2B0_DSC_MISC_CTRL0, &val);
4043+ MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, &val);
4044+ val &= ~(3<<14);
4045+ val |= (1<<15);
38574046 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3858− MDIO_WC_REG_DSC2B0_DSC_MISC_CTRL0, (val & 0x7FFF));
3859−}
4047+ MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, val);
4048+ bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4049+ MDIO_WC_REG_CL72_USERB0_CL72_TX_FIR_TAP, 0x835A);
38604050
3861−static void bnx2x_warpcore_set_20G_KR2(struct bnx2x *bp,
3862− struct bnx2x_phy *phy)
3863−{
3864− DP(NETIF_MSG_LINK, "KR2 still not supported !!!\n");
4051+ /* Enable sequencer (over lane 0) */
4052+ CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
4053+ MDIO_AER_BLOCK_AER_REG, 0);
4054+
4055+ bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
4056+ MDIO_WC_REG_XGXSBLK0_XGXSCONTROL, (1<<13));
4057+
4058+ bnx2x_set_aer_mmd(params, phy);
38654059 }
38664060
38674061 static void bnx2x_warpcore_set_20G_DXGXS(struct bnx2x *bp,
@@ -3931,20 +4125,16 @@ static void bnx2x_warpcore_set_sgmii_speed(struct bnx2x_phy *phy, · 63 unmodified lines
39314125 u16 val16, digctrl_kx1, digctrl_kx2;
39324126
39334127 /* Clear XFI clock comp in non-10G single lane mode. */
3934− bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3935− MDIO_WC_REG_RX66_CONTROL, &val16);
3936− bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3937− MDIO_WC_REG_RX66_CONTROL, val16 & ~(3<<13));
4128+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4129+ MDIO_WC_REG_RX66_CONTROL, ~(3<<13));
39384130
39394131 bnx2x_warpcore_set_lpi_passthrough(phy, params);
39404132
39414133 if (always_autoneg || phy->req_line_speed == SPEED_AUTO_NEG) {
39424134 /* SGMII Autoneg */
3943− bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3944− MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16);
3945− bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3946− MDIO_WC_REG_COMBO_IEEE0_MIICTRL,
3947− val16 | 0x1000);
4135+ bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
4136+ MDIO_WC_REG_COMBO_IEEE0_MIICTRL,
4137+ 0x1000);
39484138 DP(NETIF_MSG_LINK, "set SGMII AUTONEG\n");
39494139 } else {
39504140 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
@@ -4086,7 +4276,7 @@ static int bnx2x_get_mod_abs_int_cfg(struct bnx2x *bp, · 135 unmodified lines
40864276 if ((cfg_pin < PIN_CFG_GPIO0_P0) ||
40874277 (cfg_pin > PIN_CFG_GPIO3_P1)) {
40884278 DP(NETIF_MSG_LINK,
4089− "ERROR: Invalid cfg pin %x for module detect indication\n",
4279+ "No cfg pin %x for module detect indication\n",
40904280 cfg_pin);
40914281 return -EINVAL;
40924282 }
@@ -4097,7 +4287,7 @@ static int bnx2x_get_mod_abs_int_cfg(struct bnx2x *bp, · 4 unmodified lines
40974287 *gpio_num = MISC_REGISTERS_GPIO_3;
40984288 *gpio_port = port;
40994289 }
4100− DP(NETIF_MSG_LINK, "MOD_ABS int GPIO%d_P%d\n", *gpio_num, *gpio_port);
4290+
41014291 return 0;
41024292 }
41034293
@@ -4120,7 +4310,7 @@ static int bnx2x_is_sfp_module_plugged(struct bnx2x_phy *phy, · 16 unmodified lines
41204310 return 0;
41214311 }
41224312 static int bnx2x_warpcore_get_sigdet(struct bnx2x_phy *phy,
4123− struct link_params *params)
4313+ struct link_params *params)
41244314 {
41254315 u16 gp2_status_reg0, lane;
41264316 struct bnx2x *bp = params->bp;
@@ -4134,8 +4324,8 @@ static int bnx2x_warpcore_get_sigdet(struct bnx2x_phy *phy, · 7 unmodified lines
41344324 }
41354325
41364326 static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy,
4137− struct link_params *params,
4138− struct link_vars *vars)
4327+ struct link_params *params,
4328+ struct link_vars *vars)
41394329 {
41404330 struct bnx2x *bp = params->bp;
41414331 u32 serdes_net_if;
@@ -4163,7 +4353,7 @@ static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy, · 21 unmodified lines
41634353 case PORT_HW_CFG_NET_SERDES_IF_KR:
41644354 /* Do we get link yet? */
41654355 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD, 0x81d1,
4166− &gp_status1);
4356+ &gp_status1);
41674357 lnkup = (gp_status1 >> (8+lane)) & 0x1;/* 1G */
41684358 /*10G KR*/
41694359 lnkup_kr = (gp_status1 >> (12+lane)) & 0x1;
@@ -4215,6 +4405,27 @@ static void bnx2x_warpcore_config_sfi(struct bnx2x_phy *phy, · 45 unmodified lines
42154405 }
42164406 }
42174407
4408+static void bnx2x_sfp_e3_set_transmitter(struct link_params *params,
4409+ struct bnx2x_phy *phy,
4410+ u8 tx_en)
4411+{
4412+ struct bnx2x *bp = params->bp;
4413+ u32 cfg_pin;
4414+ u8 port = params->port;
4415+
4416+ cfg_pin = REG_RD(bp, params->shmem_base +
4417+ offsetof(struct shmem_region,
4418+ dev_info.port_hw_config[port].e3_sfp_ctrl)) &
4419+ PORT_HW_CFG_E3_TX_LASER_MASK;
4420+ /* Set the !tx_en since this pin is DISABLE_TX_LASER */
4421+ DP(NETIF_MSG_LINK, "Setting WC TX to %d\n", tx_en);
4422+
4423+ /* For 20G, the expected pin to be used is 3 pins after the current */
4424+ bnx2x_set_cfg_pin(bp, cfg_pin, tx_en ^ 1);
4425+ if (phy->speed_cap_mask & PORT_HW_CFG_SPEED_CAPABILITY_D0_20G)
4426+ bnx2x_set_cfg_pin(bp, cfg_pin + 3, tx_en ^ 1);
4427+}
4428+
42184429 static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy,
42194430 struct link_params *params,
42204431 struct link_vars *vars)
@@ -4275,9 +4486,14 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, · 54 unmodified lines
42754486 break;
42764487
42774488 case PORT_HW_CFG_NET_SERDES_IF_SFI:
4278− /* Issue Module detection */
4489+ /* Issue Module detection if module is plugged, or
4490+ * enabled transmitter to avoid current leakage in case
4491+ * no module is connected
4492+ */
42794493 if (bnx2x_is_sfp_module_plugged(phy, params))
42804494 bnx2x_sfp_module_detection(phy, params);
4495+ else
4496+ bnx2x_sfp_e3_set_transmitter(params, phy, 1);
42814497
42824498 bnx2x_warpcore_config_sfi(phy, params);
42834499 break;
@@ -4293,16 +4509,14 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, · 9 unmodified lines
42934509
42944510 bnx2x_sfp_module_detection(phy, params);
42954511 break;
4296−
42974512 case PORT_HW_CFG_NET_SERDES_IF_KR2:
4298− if (vars->line_speed != SPEED_20000) {
4299− DP(NETIF_MSG_LINK, "Speed not supported yet\n");
4300− return;
4513+ if (!params->loopback_mode) {
4514+ bnx2x_warpcore_enable_AN_KR(phy, params, vars);
4515+ } else {
4516+ DP(NETIF_MSG_LINK, "Setting KR 20G-Force\n");
4517+ bnx2x_warpcore_set_20G_force_KR2(phy, params);
43014518 }
4302− DP(NETIF_MSG_LINK, "Setting 20G KR2\n");
4303− bnx2x_warpcore_set_20G_KR2(bp, phy);
43044519 break;
4305−
43064520 default:
43074521 DP(NETIF_MSG_LINK,
43084522 "Unsupported Serdes Net Interface 0x%x\n",
@@ -4316,68 +4530,35 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, · 7 unmodified lines
43164530 DP(NETIF_MSG_LINK, "Exit config init\n");
43174531 }
43184532
4319−static void bnx2x_sfp_e3_set_transmitter(struct link_params *params,
4320− struct bnx2x_phy *phy,
4321− u8 tx_en)
4322−{
4323− struct bnx2x *bp = params->bp;
4324− u32 cfg_pin;
4325− u8 port = params->port;
4326−
4327− cfg_pin = REG_RD(bp, params->shmem_base +
4328− offsetof(struct shmem_region,
4329− dev_info.port_hw_config[port].e3_sfp_ctrl)) &
4330− PORT_HW_CFG_TX_LASER_MASK;
4331− /* Set the !tx_en since this pin is DISABLE_TX_LASER */
4332− DP(NETIF_MSG_LINK, "Setting WC TX to %d\n", tx_en);
4333− /* For 20G, the expected pin to be used is 3 pins after the current */
4334−
4335− bnx2x_set_cfg_pin(bp, cfg_pin, tx_en ^ 1);
4336− if (phy->speed_cap_mask & PORT_HW_CFG_SPEED_CAPABILITY_D0_20G)
4337− bnx2x_set_cfg_pin(bp, cfg_pin + 3, tx_en ^ 1);
4338−}
4339−
43404533 static void bnx2x_warpcore_link_reset(struct bnx2x_phy *phy,
43414534 struct link_params *params)
43424535 {
43434536 struct bnx2x *bp = params->bp;
43444537 u16 val16, lane;
43454538 bnx2x_sfp_e3_set_transmitter(params, phy, 0);
4346− bnx2x_set_mdio_clk(bp, params->chip_id, params->port);
4539+ bnx2x_set_mdio_emac_per_phy(bp, params);
43474540 bnx2x_set_aer_mmd(params, phy);
43484541 /* Global register */
43494542 bnx2x_warpcore_reset_lane(bp, phy, 1);
43504543
43514544 /* Clear loopback settings (if any) */
43524545 /* 10G & 20G */
4353− bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
4354− MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16);
4355− bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4356− MDIO_WC_REG_COMBO_IEEE0_MIICTRL, val16 &
4357− 0xBFFF);
4546+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4547+ MDIO_WC_REG_COMBO_IEEE0_MIICTRL, 0xBFFF);
43584548
4359− bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
4360− MDIO_WC_REG_IEEE0BLK_MIICNTL, &val16);
4361− bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4362− MDIO_WC_REG_IEEE0BLK_MIICNTL, val16 & 0xfffe);
4549+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4550+ MDIO_WC_REG_IEEE0BLK_MIICNTL, 0xfffe);
43634551
43644552 /* Update those 1-copy registers */
43654553 CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
43664554 MDIO_AER_BLOCK_AER_REG, 0);
43674555 /* Enable 1G MDIO (1-copy) */
4368− bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
4369− MDIO_WC_REG_XGXSBLK0_XGXSCONTROL,
4370− &val16);
4371− bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4372− MDIO_WC_REG_XGXSBLK0_XGXSCONTROL,
4373− val16 & ~0x10);
4374−
4375− bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
4376− MDIO_WC_REG_XGXSBLK1_LANECTRL2, &val16);
4377− bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4378− MDIO_WC_REG_XGXSBLK1_LANECTRL2,
4379− val16 & 0xff00);
4556+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4557+ MDIO_WC_REG_XGXSBLK0_XGXSCONTROL,
4558+ ~0x10);
43804559
4560+ bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4561+ MDIO_WC_REG_XGXSBLK1_LANECTRL2, 0xff00);
43814562 lane = bnx2x_get_warpcore_lane(phy, params);
43824563 /* Disable CL36 PCS Tx */
43834564 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
@@ -4413,8 +4594,9 @@ static void bnx2x_set_warpcore_loopback(struct bnx2x_phy *phy, · 29 unmodified lines
44134594 DP(NETIF_MSG_LINK, "Setting Warpcore loopback type %x, speed %d\n",
44144595 params->loopback_mode, phy->req_line_speed);
44154596
4416− if (phy->req_line_speed < SPEED_10000) {
4417− /* 10/100/1000 */
4597+ if (phy->req_line_speed < SPEED_10000 ||
4598+ phy->supported & SUPPORTED_20000baseKR2_Full) {
4599+ /* 10/100/1000/20G-KR2 */
44184600
44194601 /* Update those 1-copy registers */
44204602 CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
@@ -4427,18 +4609,20 @@ static void bnx2x_set_warpcore_loopback(struct bnx2x_phy *phy, · 6 unmodified lines
44274609 lane = bnx2x_get_warpcore_lane(phy, params);
44284610 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
44294611 MDIO_WC_REG_XGXSBLK1_LANECTRL2, &val16);
4612+ val16 |= (1<<lane);
4613+ if (phy->flags & FLAGS_WC_DUAL_MODE)
4614+ val16 |= (2<<lane);
44304615 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4431− MDIO_WC_REG_XGXSBLK1_LANECTRL2,
4432− val16 | (1<<lane));
4616+ MDIO_WC_REG_XGXSBLK1_LANECTRL2,
4617+ val16);
44334618
44344619 /* Switch back to 4-copy registers */
44354620 bnx2x_set_aer_mmd(params, phy);
44364621 } else {
4437− /* 10G & 20G */
4622+ /* 10G / 20G-DXGXS */
44384623 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
44394624 MDIO_WC_REG_COMBO_IEEE0_MIICTRL,
44404625 0x4000);
4441−
44424626 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
44434627 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x1);
44444628 }
@@ -4603,6 +4787,10 @@ void bnx2x_link_status_update(struct link_params *params, · 158 unmodified lines
46034787 params->feature_config_flags &=
46044788 ~FEATURE_CONFIG_PFC_ENABLED;
46054789
4790+ if (SHMEM2_HAS(bp, link_attr_sync))
4791+ vars->link_attr_sync = SHMEM2_RD(bp,
4792+ link_attr_sync[params->port]);
4793+
46064794 DP(NETIF_MSG_LINK, "link_status 0x%x phy_link_up %x int_mask 0x%x\n",
46074795 vars->link_status, vars->phy_link_up, vars->aeu_int_mask);
46084796 DP(NETIF_MSG_LINK, "line_speed %x duplex %x flow_ctrl 0x%x\n",
@@ -5332,6 +5520,7 @@ static int bnx2x_get_link_speed_duplex(struct bnx2x_phy *phy, · 723 unmodified lines
53325520 vars->link_status |= LINK_10GTFD;
53335521 break;
53345522 case GP_STATUS_20G_DXGXS:
5523+ case GP_STATUS_20G_KR2:
53355524 vars->line_speed = SPEED_20000;
53365525 vars->link_status |= LINK_20GTFD;
53375526 break;
@@ -5439,7 +5628,15 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, · 101 unmodified lines
54395628 int rc = 0;
54405629 lane = bnx2x_get_warpcore_lane(phy, params);
54415630 /* Read gp_status */
5442− if (phy->req_line_speed > SPEED_10000) {
5631+ if ((params->loopback_mode) &&
5632+ (phy->flags & FLAGS_WC_DUAL_MODE)) {
5633+ bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
5634+ MDIO_WC_REG_DIGITAL5_LINK_STATUS, &link_up);
5635+ bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
5636+ MDIO_WC_REG_DIGITAL5_LINK_STATUS, &link_up);
5637+ link_up &= 0x1;
5638+ } else if ((phy->req_line_speed > SPEED_10000) &&
5639+ (phy->supported & SUPPORTED_20000baseMLD2_Full)) {
54435640 u16 temp_link_up;
54445641 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
54455642 1, &temp_link_up);
@@ -5452,12 +5649,22 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, · 6 unmodified lines
54525649 bnx2x_ext_phy_resolve_fc(phy, params, vars);
54535650 } else {
54545651 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
5455− MDIO_WC_REG_GP2_STATUS_GP_2_1, &gp_status1);
5652+ MDIO_WC_REG_GP2_STATUS_GP_2_1,
5653+ &gp_status1);
54565654 DP(NETIF_MSG_LINK, "0x81d1 = 0x%x\n", gp_status1);
5457− /* Check for either KR or generic link up. */
5458− gp_status1 = ((gp_status1 >> 8) & 0xf) |
5459− ((gp_status1 >> 12) & 0xf);
5460− link_up = gp_status1 & (1 << lane);
5655+ /* Check for either KR, 1G, or AN up. */
5656+ link_up = ((gp_status1 >> 8) |
5657+ (gp_status1 >> 12) |
5658+ (gp_status1)) &
5659+ (1 << lane);
5660+ if (phy->supported & SUPPORTED_20000baseKR2_Full) {
5661+ u16 an_link;
5662+ bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD,
5663+ MDIO_AN_REG_STATUS, &an_link);
5664+ bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD,
5665+ MDIO_AN_REG_STATUS, &an_link);
5666+ link_up |= (an_link & (1<<2));
5667+ }
54615668 if (link_up && SINGLE_MEDIA_DIRECT(params)) {
54625669 u16 pd, gp_status4;
54635670 if (phy->req_line_speed == SPEED_AUTO_NEG) {
@@ -5522,7 +5729,7 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, · 58 unmodified lines
55225729 if ((lane & 1) == 0)
55235730 gp_speed <<= 8;
55245731 gp_speed &= 0x3f00;
5525−
5732+ link_up = !!link_up;
55265733
55275734 rc = bnx2x_get_link_speed_duplex(phy, params, vars, link_up, gp_speed,
55285735 duplex);
@@ -6683,7 +6890,7 @@ int bnx2x_link_update(struct link_params *params, struct link_vars *vars) · 1154 unmodified lines
66836890 } else if (prev_line_speed != vars->line_speed) {
66846891 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4,
66856892 0);
6686− usleep_range(1000, 2000);
6893+ usleep_range(1000, 2000);
66876894 }
66886895 }
66896896
@@ -6753,7 +6960,7 @@ void bnx2x_ext_phy_hw_reset(struct bnx2x *bp, u8 port) · 63 unmodified lines
67536960 {
67546961 bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_1,
67556962 MISC_REGISTERS_GPIO_OUTPUT_LOW, port);
6756− usleep_range(1000, 2000);
6963+ usleep_range(1000, 2000);
67576964 bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_1,
67586965 MISC_REGISTERS_GPIO_OUTPUT_HIGH, port);
67596966 }
@@ -6894,7 +7101,7 @@ static int bnx2x_8073_8727_external_rom_boot(struct bnx2x *bp, · 134 unmodified lines
68947101 MDIO_PMA_DEVAD,
68957102 MDIO_PMA_REG_M8051_MSGOUT_REG, &fw_msgout);
68967103
6897− usleep_range(1000, 2000);
7104+ usleep_range(1000, 2000);
68987105 } while (fw_ver1 == 0 || fw_ver1 == 0x4321 ||
68997106 ((fw_msgout & 0xff) != 0x03 && (phy->type ==
69007107 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073)));
@@ -7604,13 +7811,12 @@ static int bnx2x_8726_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 703 unmodified lines
76047811 if ((val & MDIO_PMA_REG_SFP_TWO_WIRE_CTRL_STATUS_MASK) ==
76057812 MDIO_PMA_REG_SFP_TWO_WIRE_STATUS_IDLE)
76067813 return 0;
7607− usleep_range(1000, 2000);
7814+ usleep_range(1000, 2000);
76087815 }
76097816 return -EINVAL;
76107817 }
76117818
76127819 static void bnx2x_warpcore_power_module(struct link_params *params,
7613− struct bnx2x_phy *phy,
76147820 u8 power)
76157821 {
76167822 u32 pin_cfg;
@@ -7652,10 +7858,10 @@ static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 35 unmodified lines
76527858 addr32 = addr & (~0x3);
76537859 do {
76547860 if ((!is_init) && (cnt == I2C_WA_PWR_ITER)) {
7655− bnx2x_warpcore_power_module(params, phy, 0);
7861+ bnx2x_warpcore_power_module(params, 0);
76567862 /* Note that 100us are not enough here */
76577863 usleep_range(1000, 2000);
7658− bnx2x_warpcore_power_module(params, phy, 1);
7864+ bnx2x_warpcore_power_module(params, 1);
76597865 }
76607866 rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt,
76617867 data_array);
@@ -7715,7 +7921,7 @@ static int bnx2x_8727_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 53 unmodified lines
77157921 /* Wait appropriate time for two-wire command to finish before
77167922 * polling the status register
77177923 */
7718− usleep_range(1000, 2000);
7924+ usleep_range(1000, 2000);
77197925
77207926 /* Wait up to 500us for command complete status */
77217927 for (i = 0; i < 100; i++) {
@@ -7751,7 +7957,7 @@ static int bnx2x_8727_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 29 unmodified lines
77517957 if ((val & MDIO_PMA_REG_SFP_TWO_WIRE_CTRL_STATUS_MASK) ==
77527958 MDIO_PMA_REG_SFP_TWO_WIRE_STATUS_IDLE)
77537959 return 0;
7754− usleep_range(1000, 2000);
7960+ usleep_range(1000, 2000);
77557961 }
77567962
77577963 return -EINVAL;
@@ -7786,9 +7992,8 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, · 28 unmodified lines
77867992 {
77877993 struct bnx2x *bp = params->bp;
77887994 u32 sync_offset = 0, phy_idx, media_types;
7789− u8 val[2], check_limiting_mode = 0;
7995+ u8 gport, val[2], check_limiting_mode = 0;
77907996 *edc_mode = EDC_MODE_LIMITING;
7791−
77927997 phy->media_type = ETH_PHY_UNSPECIFIED;
77937998 /* First check for copper cable */
77947999 if (bnx2x_read_sfp_module_eeprom(phy,
@@ -7843,8 +8048,15 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, · 48 unmodified lines
78438048 SFP_EEPROM_COMP_CODE_LR_MASK |
78448049 SFP_EEPROM_COMP_CODE_LRM_MASK)) == 0) {
78458050 DP(NETIF_MSG_LINK, "1G Optic module detected\n");
8051+ gport = params->port;
78468052 phy->media_type = ETH_PHY_SFP_1G_FIBER;
78478053 phy->req_line_speed = SPEED_1000;
8054+ if (!CHIP_IS_E1x(bp))
8055+ gport = BP_PATH(bp) + (params->port << 1);
8056+ netdev_err(bp->dev, "Warning: Link speed was forced to 1000Mbps."
8057+ " Current SFP module in port %d is not"
8058+ " compliant with 10G Ethernet\n",
8059+ gport);
78488060 } else {
78498061 int idx, cfg_idx = 0;
78508062 DP(NETIF_MSG_LINK, "10G Optic module detected\n");
@@ -8241,7 +8453,7 @@ static void bnx2x_warpcore_hw_reset(struct bnx2x_phy *phy, · 390 unmodified lines
82418453 struct link_params *params)
82428454 {
82438455 struct bnx2x *bp = params->bp;
8244− bnx2x_warpcore_power_module(params, phy, 0);
8456+ bnx2x_warpcore_power_module(params, 0);
82458457 /* Put Warpcore in low power mode */
82468458 REG_WR(bp, MISC_REG_WC0_RESET, 0x0c0e);
82478459
@@ -8264,7 +8476,7 @@ static void bnx2x_power_sfp_module(struct link_params *params, · 16 unmodified lines
82648476 bnx2x_8727_power_module(params->bp, phy, power);
82658477 break;
82668478 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT:
8267− bnx2x_warpcore_power_module(params, phy, power);
8479+ bnx2x_warpcore_power_module(params, power);
82688480 break;
82698481 default:
82708482 break;
@@ -8337,7 +8549,8 @@ int bnx2x_sfp_module_detection(struct bnx2x_phy *phy, · 66 unmodified lines
83378549 u32 val = REG_RD(bp, params->shmem_base +
83388550 offsetof(struct shmem_region, dev_info.
83398551 port_feature_config[params->port].config));
8340−
8552+ /* Enabled transmitter by default */
8553+ bnx2x_sfp_set_transmitter(params, phy, 1);
83418554 DP(NETIF_MSG_LINK, "SFP+ module plugged in/out detected on port %d\n",
83428555 params->port);
83438556 /* Power up module */
@@ -8370,14 +8583,12 @@ int bnx2x_sfp_module_detection(struct bnx2x_phy *phy, · 26 unmodified lines
83708583 */
83718584 bnx2x_set_limiting_mode(params, phy, edc_mode);
83728585
8373− /* Enable transmit for this module if the module is approved, or
8374− * if unapproved modules should also enable the Tx laser
8586+ /* Disable transmit for this module if the module is not approved, and
8587+ * laser needs to be disabled.
83758588 */
8376− if (rc == 0 ||
8377− (val & PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK) !=
8378− PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER)
8379− bnx2x_sfp_set_transmitter(params, phy, 1);
8380− else
8589+ if ((rc) &&
8590+ ((val & PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK) ==
8591+ PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER))
83818592 bnx2x_sfp_set_transmitter(params, phy, 0);
83828593
83838594 return rc;
@@ -8389,11 +8600,13 @@ void bnx2x_handle_module_detect_int(struct link_params *params) · 5 unmodified lines
83898600 struct bnx2x_phy *phy;
83908601 u32 gpio_val;
83918602 u8 gpio_num, gpio_port;
8392− if (CHIP_IS_E3(bp))
8603+ if (CHIP_IS_E3(bp)) {
83938604 phy = &params->phy[INT_PHY];
8394− else
8605+ /* Always enable TX laser,will be disabled in case of fault */
8606+ bnx2x_sfp_set_transmitter(params, phy, 1);
8607+ } else {
83958608 phy = &params->phy[EXT_PHY1];
8396−
8609+ }
83978610 if (bnx2x_get_mod_abs_int_cfg(bp, params->chip_id, params->shmem_base,
83988611 params->port, &gpio_num, &gpio_port) ==
83998612 -EINVAL) {
@@ -8409,7 +8622,7 @@ void bnx2x_handle_module_detect_int(struct link_params *params) · 9 unmodified lines
84098622
84108623 /* Call the handling function in case module is detected */
84118624 if (gpio_val == 0) {
8412− bnx2x_set_mdio_clk(bp, params->chip_id, params->port);
8625+ bnx2x_set_mdio_emac_per_phy(bp, params);
84138626 bnx2x_set_aer_mmd(params, phy);
84148627
84158628 bnx2x_power_sfp_module(params, phy, 1);
@@ -8438,10 +8651,6 @@ void bnx2x_handle_module_detect_int(struct link_params *params) · 22 unmodified lines
84388651 DP(NETIF_MSG_LINK, "SFP+ module is not initialized\n");
84398652 }
84408653 } else {
8441− u32 val = REG_RD(bp, params->shmem_base +
8442− offsetof(struct shmem_region, dev_info.
8443− port_feature_config[params->port].
8444− config));
84458654 bnx2x_set_gpio_int(bp, gpio_num,
84468655 MISC_REGISTERS_GPIO_INT_OUTPUT_SET,
84478656 gpio_port);
@@ -8449,10 +8658,6 @@ void bnx2x_handle_module_detect_int(struct link_params *params) · 1 unmodified line
84498658 * Disable transmit for this module
84508659 */
84518660 phy->media_type = ETH_PHY_NOT_PRESENT;
8452− if (((val & PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK) ==
8453− PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER) ||
8454− CHIP_IS_E3(bp))
8455− bnx2x_sfp_set_transmitter(params, phy, 0);
84568661 }
84578662 }
84588663
@@ -9192,6 +9397,7 @@ static u8 bnx2x_8727_read_status(struct bnx2x_phy *phy, · 733 unmodified lines
91929397 bnx2x_cl45_read(bp, phy,
91939398 MDIO_PMA_DEVAD,
91949399 MDIO_PMA_LASI_RXSTAT, &rx_alarm_status);
9400+ bnx2x_8727_power_module(params->bp, phy, 0);
91959401 return 0;
91969402 }
91979403 } /* Over current check */
@@ -9296,20 +9502,28 @@ static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy, · 98 unmodified lines
92969502 struct bnx2x *bp,
92979503 u8 port)
92989504 {
9299− u16 val, fw_ver1, fw_ver2, cnt;
9505+ u16 val, fw_ver2, cnt, i;
9506+ static struct bnx2x_reg_set reg_set[] = {
9507+ {MDIO_PMA_DEVAD, 0xA819, 0x0014},
9508+ {MDIO_PMA_DEVAD, 0xA81A, 0xc200},
9509+ {MDIO_PMA_DEVAD, 0xA81B, 0x0000},
9510+ {MDIO_PMA_DEVAD, 0xA81C, 0x0300},
9511+ {MDIO_PMA_DEVAD, 0xA817, 0x0009}
9512+ };
9513+ u16 fw_ver1;
93009514
9301− if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
9515+ if ((phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) ||
9516+ (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834)) {
93029517 bnx2x_cl45_read(bp, phy, MDIO_CTL_DEVAD, 0x400f, &fw_ver1);
93039518 bnx2x_save_spirom_version(bp, port, fw_ver1 & 0xfff,
93049519 phy->ver_addr);
93059520 } else {
93069521 /* For 32-bit registers in 848xx, access via MDIO2ARM i/f. */
93079522 /* (1) set reg 0xc200_0014(SPI_BRIDGE_CTRL_2) to 0x03000000 */
9308− bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA819, 0x0014);
9309− bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81A, 0xc200);
9310− bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81B, 0x0000);
9311− bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81C, 0x0300);
9312− bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA817, 0x0009);
9523+ for (i = 0; i < sizeof(reg_set)/sizeof(struct bnx2x_reg_set);
9524+ i++)
9525+ bnx2x_cl45_write(bp, phy, reg_set[i].devad,
9526+ reg_set[i].reg, reg_set[i].val);
93139527
93149528 for (cnt = 0; cnt < 100; cnt++) {
93159529 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA818, &val);
@@ -9357,8 +9571,16 @@ static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy, · 41 unmodified lines
93579571 static void bnx2x_848xx_set_led(struct bnx2x *bp,
93589572 struct bnx2x_phy *phy)
93599573 {
9360− u16 val, offset;
9361−
9574+ u16 val, offset, i;
9575+ static struct bnx2x_reg_set reg_set[] = {
9576+ {MDIO_PMA_DEVAD, MDIO_PMA_REG_8481_LED1_MASK, 0x0080},
9577+ {MDIO_PMA_DEVAD, MDIO_PMA_REG_8481_LED2_MASK, 0x0018},
9578+ {MDIO_PMA_DEVAD, MDIO_PMA_REG_8481_LED3_MASK, 0x0006},
9579+ {MDIO_PMA_DEVAD, MDIO_PMA_REG_8481_LED3_BLINK, 0x0000},
9580+ {MDIO_PMA_DEVAD, MDIO_PMA_REG_84823_CTL_SLOW_CLK_CNT_HIGH,
9581+ MDIO_PMA_REG_84823_BLINK_RATE_VAL_15P9HZ},
9582+ {MDIO_AN_DEVAD, 0xFFFB, 0xFFFD}
9583+ };
93629584 /* PHYC_CTL_LED_CTL */
93639585 bnx2x_cl45_read(bp, phy,
93649586 MDIO_PMA_DEVAD,
@@ -9370,49 +9592,20 @@ static void bnx2x_848xx_set_led(struct bnx2x *bp, · 5 unmodified lines
93709592 MDIO_PMA_DEVAD,
93719593 MDIO_PMA_REG_8481_LINK_SIGNAL, val);
93729594
9373− bnx2x_cl45_write(bp, phy,
9374− MDIO_PMA_DEVAD,
9375− MDIO_PMA_REG_8481_LED1_MASK,
9376− 0x80);
9377−
9378− bnx2x_cl45_write(bp, phy,
9379− MDIO_PMA_DEVAD,
9380− MDIO_PMA_REG_8481_LED2_MASK,
9381− 0x18);
9382−
9383− /* Select activity source by Tx and Rx, as suggested by PHY AE */
9384− bnx2x_cl45_write(bp, phy,
9385− MDIO_PMA_DEVAD,
9386− MDIO_PMA_REG_8481_LED3_MASK,
9387− 0x0006);
9388−
9389− /* Select the closest activity blink rate to that in 10/100/1000 */
9390− bnx2x_cl45_write(bp, phy,
9391− MDIO_PMA_DEVAD,
9392− MDIO_PMA_REG_8481_LED3_BLINK,
9393− 0);
9394−
9395− /* Configure the blink rate to ~15.9 Hz */
9396− bnx2x_cl45_write(bp, phy,
9397− MDIO_PMA_DEVAD,
9398− MDIO_PMA_REG_84823_CTL_SLOW_CLK_CNT_HIGH,
9399− MDIO_PMA_REG_84823_BLINK_RATE_VAL_15P9HZ);
9595+ for (i = 0; i < sizeof(reg_set)/sizeof(struct bnx2x_reg_set); i++)
9596+ bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg,
9597+ reg_set[i].val);
94009598
9401− if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833)
9599+ if ((phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) ||
9600+ (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834))
94029601 offset = MDIO_PMA_REG_84833_CTL_LED_CTL_1;
94039602 else
94049603 offset = MDIO_PMA_REG_84823_CTL_LED_CTL_1;
94059604
9406− bnx2x_cl45_read(bp, phy,
9407− MDIO_PMA_DEVAD, offset, &val);
9408− val |= MDIO_PMA_REG_84823_LED3_STRETCH_EN; /* stretch_en for LED3*/
9409− bnx2x_cl45_write(bp, phy,
9410− MDIO_PMA_DEVAD, offset, val);
9411−
9412− /* 'Interrupt Mask' */
9413− bnx2x_cl45_write(bp, phy,
9414− MDIO_AN_DEVAD,
9415− 0xFFFB, 0xFFFD);
9605+ /* stretch_en for LED3*/
9606+ bnx2x_cl45_read_or_write(bp, phy,
9607+ MDIO_PMA_DEVAD, offset,
9608+ MDIO_PMA_REG_84823_LED3_STRETCH_EN);
94169609 }
94179610
94189611 static void bnx2x_848xx_specific_func(struct bnx2x_phy *phy,
@@ -9422,7 +9615,8 @@ static void bnx2x_848xx_specific_func(struct bnx2x_phy *phy, · 3 unmodified lines
94229615 struct bnx2x *bp = params->bp;
94239616 switch (action) {
94249617 case PHY_INIT:
9425− if (phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
9618+ if ((phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) &&
9619+ (phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834)) {
94269620 /* Save spirom version */
94279621 bnx2x_save_848xx_spirom_version(phy, bp, params->port);
94289622 }
@@ -9443,7 +9637,7 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, · 14 unmodified lines
94439637 struct link_vars *vars)
94449638 {
94459639 struct bnx2x *bp = params->bp;
9446− u16 autoneg_val, an_1000_val, an_10_100_val, an_10g_val;
9640+ u16 autoneg_val, an_1000_val, an_10_100_val;
94479641
94489642 bnx2x_848xx_specific_func(phy, params, PHY_INIT);
94499643 bnx2x_cl45_write(bp, phy,
@@ -9542,11 +9736,12 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, · 92 unmodified lines
95429736 if (phy->req_duplex == DUPLEX_FULL)
95439737 autoneg_val |= (1<<8);
95449738
9545− /* Always write this if this is not 84833.
9546− * For 84833, write it only when it's a forced speed.
9739+ /* Always write this if this is not 84833/4.
9740+ * For 84833/4, write it only when it's a forced speed.
95479741 */
9548− if ((phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) ||
9549− ((autoneg_val & (1<<12)) == 0))
9742+ if (((phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) &&
9743+ (phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834)) ||
9744+ ((autoneg_val & (1<<12)) == 0))
95509745 bnx2x_cl45_write(bp, phy,
95519746 MDIO_AN_DEVAD,
95529747 MDIO_AN_REG_8481_LEGACY_MII_CTRL, autoneg_val);
@@ -9558,14 +9753,11 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, · 5 unmodified lines
95589753 DP(NETIF_MSG_LINK, "Advertising 10G\n");
95599754 /* Restart autoneg for 10G*/
95609755
9561− bnx2x_cl45_read(bp, phy,
9562− MDIO_AN_DEVAD,
9563− MDIO_AN_REG_8481_10GBASE_T_AN_CTRL,
9564− &an_10g_val);
9565− bnx2x_cl45_write(bp, phy,
9566− MDIO_AN_DEVAD,
9567− MDIO_AN_REG_8481_10GBASE_T_AN_CTRL,
9568− an_10g_val | 0x1000);
9756+ bnx2x_cl45_read_or_write(
9757+ bp, phy,
9758+ MDIO_AN_DEVAD,
9759+ MDIO_AN_REG_8481_10GBASE_T_AN_CTRL,
9760+ 0x1000);
95699761 bnx2x_cl45_write(bp, phy,
95709762 MDIO_AN_DEVAD, MDIO_AN_REG_CTRL,
95719763 0x3200);
@@ -9598,9 +9790,8 @@ static int bnx2x_8481_config_init(struct bnx2x_phy *phy, · 26 unmodified lines
95989790 #define PHY84833_CMDHDLR_WAIT 300
95999791 #define PHY84833_CMDHDLR_MAX_ARGS 5
96009792 static int bnx2x_84833_cmd_hdlr(struct bnx2x_phy *phy,
9601− struct link_params *params,
9602− u16 fw_cmd,
9603− u16 cmd_args[], int argc)
9793+ struct link_params *params, u16 fw_cmd,
9794+ u16 cmd_args[], int argc)
96049795 {
96059796 int idx;
96069797 u16 val;
@@ -9614,7 +9805,7 @@ static int bnx2x_84833_cmd_hdlr(struct bnx2x_phy *phy, · 7 unmodified lines
96149805 MDIO_84833_CMD_HDLR_STATUS, &val);
96159806 if (val == PHY84833_STATUS_CMD_OPEN_FOR_CMDS)
96169807 break;
9617− usleep_range(1000, 2000);
9808+ usleep_range(1000, 2000);
96189809 }
96199810 if (idx >= PHY84833_CMDHDLR_WAIT) {
96209811 DP(NETIF_MSG_LINK, "FW cmd: FW not ready.\n");
@@ -9635,7 +9826,7 @@ static int bnx2x_84833_cmd_hdlr(struct bnx2x_phy *phy, · 14 unmodified lines
96359826 if ((val == PHY84833_STATUS_CMD_COMPLETE_PASS) ||
96369827 (val == PHY84833_STATUS_CMD_COMPLETE_ERROR))
96379828 break;
9638− usleep_range(1000, 2000);
9829+ usleep_range(1000, 2000);
96399830 }
96409831 if ((idx >= PHY84833_CMDHDLR_WAIT) ||
96419832 (val == PHY84833_STATUS_CMD_COMPLETE_ERROR)) {
@@ -9654,7 +9845,6 @@ static int bnx2x_84833_cmd_hdlr(struct bnx2x_phy *phy, · 12 unmodified lines
96549845 return 0;
96559846 }
96569847
9657−
96589848 static int bnx2x_84833_pair_swap_cfg(struct bnx2x_phy *phy,
96599849 struct link_params *params,
96609850 struct link_vars *vars)
@@ -9802,11 +9992,11 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 141 unmodified lines
98029992 struct bnx2x *bp = params->bp;
98039993 u8 port, initialize = 1;
98049994 u16 val;
9805− u32 actual_phy_selection, cms_enable;
9995+ u32 actual_phy_selection;
98069996 u16 cmd_args[PHY84833_CMDHDLR_MAX_ARGS];
98079997 int rc = 0;
98089998
9809− usleep_range(1000, 2000);
9999+ usleep_range(1000, 2000);
981010000
981110001 if (!(CHIP_IS_E1x(bp)))
981210002 port = BP_PATH(bp);
@@ -9828,7 +10018,8 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 15 unmodified lines
982810018
982910019 /* Wait for GPHY to come out of reset */
983010020 msleep(50);
9831− if (phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
10021+ if ((phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) &&
10022+ (phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834)) {
983210023 /* BCM84823 requires that XGXS links up first @ 10G for normal
983310024 * behavior.
983410025 */
@@ -9884,7 +10075,8 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 49 unmodified lines
988410075 DP(NETIF_MSG_LINK, "Multi_phy config = 0x%x, Media control = 0x%x\n",
988510076 params->multi_phy_config, val);
988610077
9887− if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
10078+ if ((phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) ||
10079+ (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834)) {
988810080 bnx2x_84833_pair_swap_cfg(phy, params, vars);
988910081
989010082 /* Keep AutogrEEEn disabled. */
@@ -9904,7 +10096,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 13 unmodified lines
990410096 bnx2x_save_848xx_spirom_version(phy, bp, params->port);
990510097 /* 84833 PHY has a better feature and doesn't need to support this. */
990610098 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823) {
9907− cms_enable = REG_RD(bp, params->shmem_base +
10099+ u32 cms_enable = REG_RD(bp, params->shmem_base +
990810100 offsetof(struct shmem_region,
990910101 dev_info.port_hw_config[params->port].default_cfg)) &
991010102 PORT_HW_CFG_ENABLE_CMS_MASK;
@@ -9933,7 +10125,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 22 unmodified lines
993310125 return rc;
993410126 }
993510127
9936− if ((params->req_duplex[actual_phy_selection] == DUPLEX_FULL) &&
10128+ if ((phy->req_duplex == DUPLEX_FULL) &&
993710129 (params->eee_mode & EEE_MODE_ADV_LPI) &&
993810130 (bnx2x_eee_calc_timer(params) ||
993910131 !(params->eee_mode & EEE_MODE_ENABLE_LPI)))
@@ -9948,15 +10140,13 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 8 unmodified lines
994810140 vars->eee_status &= ~SHMEM_EEE_SUPPORTED_MASK;
994910141 }
995010142
9951− if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) {
10143+ if ((phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) ||
10144+ (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834)) {
995210145 /* Bring PHY out of super isolate mode as the final step. */
9953− bnx2x_cl45_read(bp, phy,
9954− MDIO_CTL_DEVAD,
9955− MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val);
9956− val &= ~MDIO_84833_SUPER_ISOLATE;
9957− bnx2x_cl45_write(bp, phy,
9958− MDIO_CTL_DEVAD,
9959− MDIO_84833_TOP_CFG_XGPHY_STRAP1, val);
10146+ bnx2x_cl45_read_and_write(bp, phy,
10147+ MDIO_CTL_DEVAD,
10148+ MDIO_84833_TOP_CFG_XGPHY_STRAP1,
10149+ (u16)~MDIO_84833_SUPER_ISOLATE);
996010150 }
996110151 return rc;
996210152 }
@@ -10090,7 +10280,6 @@ static u8 bnx2x_848xx_read_status(struct bnx2x_phy *phy, · 127 unmodified lines
1009010280 return link_up;
1009110281 }
1009210282
10093−
1009410283 static int bnx2x_848xx_format_ver(u32 raw_ver, u8 *str, u16 *len)
1009510284 {
1009610285 int status = 0;
@@ -10962,7 +11151,7 @@ static void bnx2x_7101_set_link_led(struct bnx2x_phy *phy, · 865 unmodified lines
1096211151 /* STATIC PHY DECLARATION */
1096311152 /******************************************************************/
1096411153
10965−static struct bnx2x_phy phy_null = {
11154+static const struct bnx2x_phy phy_null = {
1096611155 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN,
1096711156 .addr = 0,
1096811157 .def_md_devad = 0,
@@ -10988,7 +11177,7 @@ static struct bnx2x_phy phy_null = { · 19 unmodified lines
1098811177 .phy_specific_func = (phy_specific_func_t)NULL
1098911178 };
1099011179
10991−static struct bnx2x_phy phy_serdes = {
11180+static const struct bnx2x_phy phy_serdes = {
1099211181 .type = PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT,
1099311182 .addr = 0xff,
1099411183 .def_md_devad = 0,
@@ -11023,7 +11212,7 @@ static struct bnx2x_phy phy_serdes = { · 28 unmodified lines
1102311212 .phy_specific_func = (phy_specific_func_t)NULL
1102411213 };
1102511214
11026−static struct bnx2x_phy phy_xgxs = {
11215+static const struct bnx2x_phy phy_xgxs = {
1102711216 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,
1102811217 .addr = 0xff,
1102911218 .def_md_devad = 0,
@@ -11058,12 +11247,11 @@ static struct bnx2x_phy phy_xgxs = { · 28 unmodified lines
1105811247 .set_link_led = (set_link_led_t)NULL,
1105911248 .phy_specific_func = (phy_specific_func_t)bnx2x_xgxs_specific_func
1106011249 };
11061−static struct bnx2x_phy phy_warpcore = {
11250+static const struct bnx2x_phy phy_warpcore = {
1106211251 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,
1106311252 .addr = 0xff,
1106411253 .def_md_devad = 0,
11065− .flags = (FLAGS_HW_LOCK_REQUIRED |
11066− FLAGS_TX_ERROR_CHECK),
11254+ .flags = FLAGS_TX_ERROR_CHECK,
1106711255 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
1106811256 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
1106911257 .mdio_ctrl = 0,
@@ -11097,7 +11285,7 @@ static struct bnx2x_phy phy_warpcore = { · 27 unmodified lines
1109711285 };
1109811286
1109911287
11100−static struct bnx2x_phy phy_7101 = {
11288+static const struct bnx2x_phy phy_7101 = {
1110111289 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101,
1110211290 .addr = 0xff,
1110311291 .def_md_devad = 0,
@@ -11126,11 +11314,11 @@ static struct bnx2x_phy phy_7101 = { · 22 unmodified lines
1112611314 .set_link_led = (set_link_led_t)bnx2x_7101_set_link_led,
1112711315 .phy_specific_func = (phy_specific_func_t)NULL
1112811316 };
11129−static struct bnx2x_phy phy_8073 = {
11317+static const struct bnx2x_phy phy_8073 = {
1113011318 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073,
1113111319 .addr = 0xff,
1113211320 .def_md_devad = 0,
11133− .flags = FLAGS_HW_LOCK_REQUIRED,
11321+ .flags = 0,
1113411322 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
1113511323 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
1113611324 .mdio_ctrl = 0,
@@ -11157,7 +11345,7 @@ static struct bnx2x_phy phy_8073 = { · 20 unmodified lines
1115711345 .set_link_led = (set_link_led_t)NULL,
1115811346 .phy_specific_func = (phy_specific_func_t)bnx2x_8073_specific_func
1115911347 };
11160−static struct bnx2x_phy phy_8705 = {
11348+static const struct bnx2x_phy phy_8705 = {
1116111349 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705,
1116211350 .addr = 0xff,
1116311351 .def_md_devad = 0,
@@ -11185,7 +11373,7 @@ static struct bnx2x_phy phy_8705 = { · 21 unmodified lines
1118511373 .set_link_led = (set_link_led_t)NULL,
1118611374 .phy_specific_func = (phy_specific_func_t)NULL
1118711375 };
11188−static struct bnx2x_phy phy_8706 = {
11376+static const struct bnx2x_phy phy_8706 = {
1118911377 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706,
1119011378 .addr = 0xff,
1119111379 .def_md_devad = 0,
@@ -11215,12 +11403,11 @@ static struct bnx2x_phy phy_8706 = { · 23 unmodified lines
1121511403 .phy_specific_func = (phy_specific_func_t)NULL
1121611404 };
1121711405
11218−static struct bnx2x_phy phy_8726 = {
11406+static const struct bnx2x_phy phy_8726 = {
1121911407 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726,
1122011408 .addr = 0xff,
1122111409 .def_md_devad = 0,
11222− .flags = (FLAGS_HW_LOCK_REQUIRED |
11223− FLAGS_INIT_XGXS_FIRST |
11410+ .flags = (FLAGS_INIT_XGXS_FIRST |
1122411411 FLAGS_TX_ERROR_CHECK),
1122511412 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
1122611413 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
@@ -11248,7 +11435,7 @@ static struct bnx2x_phy phy_8726 = { · 21 unmodified lines
1124811435 .phy_specific_func = (phy_specific_func_t)NULL
1124911436 };
1125011437
11251−static struct bnx2x_phy phy_8727 = {
11438+static const struct bnx2x_phy phy_8727 = {
1125211439 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727,
1125311440 .addr = 0xff,
1125411441 .def_md_devad = 0,
@@ -11278,7 +11465,7 @@ static struct bnx2x_phy phy_8727 = { · 23 unmodified lines
1127811465 .set_link_led = (set_link_led_t)bnx2x_8727_set_link_led,
1127911466 .phy_specific_func = (phy_specific_func_t)bnx2x_8727_specific_func
1128011467 };
11281−static struct bnx2x_phy phy_8481 = {
11468+static const struct bnx2x_phy phy_8481 = {
1128211469 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481,
1128311470 .addr = 0xff,
1128411471 .def_md_devad = 0,
@@ -11314,7 +11501,7 @@ static struct bnx2x_phy phy_8481 = { · 29 unmodified lines
1131411501 .phy_specific_func = (phy_specific_func_t)NULL
1131511502 };
1131611503
11317−static struct bnx2x_phy phy_84823 = {
11504+static const struct bnx2x_phy phy_84823 = {
1131811505 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823,
1131911506 .addr = 0xff,
1132011507 .def_md_devad = 0,
@@ -11351,7 +11538,7 @@ static struct bnx2x_phy phy_84823 = { · 30 unmodified lines
1135111538 .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
1135211539 };
1135311540
11354−static struct bnx2x_phy phy_84833 = {
11541+static const struct bnx2x_phy phy_84833 = {
1135511542 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833,
1135611543 .addr = 0xff,
1135711544 .def_md_devad = 0,
@@ -11386,7 +11573,41 @@ static struct bnx2x_phy phy_84833 = { · 28 unmodified lines
1138611573 .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
1138711574 };
1138811575
11389−static struct bnx2x_phy phy_54618se = {
11576+static const struct bnx2x_phy phy_84834 = {
11577+ .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834,
11578+ .addr = 0xff,
11579+ .def_md_devad = 0,
11580+ .flags = FLAGS_FAN_FAILURE_DET_REQ |
11581+ FLAGS_REARM_LATCH_SIGNAL,
11582+ .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
11583+ .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
11584+ .mdio_ctrl = 0,
11585+ .supported = (SUPPORTED_100baseT_Half |
11586+ SUPPORTED_100baseT_Full |
11587+ SUPPORTED_1000baseT_Full |
11588+ SUPPORTED_10000baseT_Full |
11589+ SUPPORTED_TP |
11590+ SUPPORTED_Autoneg |
11591+ SUPPORTED_Pause |
11592+ SUPPORTED_Asym_Pause),
11593+ .media_type = ETH_PHY_BASE_T,
11594+ .ver_addr = 0,
11595+ .req_flow_ctrl = 0,
11596+ .req_line_speed = 0,
11597+ .speed_cap_mask = 0,
11598+ .req_duplex = 0,
11599+ .rsrv = 0,
11600+ .config_init = (config_init_t)bnx2x_848x3_config_init,
11601+ .read_status = (read_status_t)bnx2x_848xx_read_status,
11602+ .link_reset = (link_reset_t)bnx2x_848x3_link_reset,
11603+ .config_loopback = (config_loopback_t)NULL,
11604+ .format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
11605+ .hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy,
11606+ .set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
11607+ .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
11608+};
11609+
11610+static const struct bnx2x_phy phy_54618se = {
1139011611 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE,
1139111612 .addr = 0xff,
1139211613 .def_md_devad = 0,
@@ -11564,9 +11785,11 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port, · 171 unmodified lines
1156411785 phy->media_type = ETH_PHY_KR;
1156511786 phy->flags |= FLAGS_WC_DUAL_MODE;
1156611787 phy->supported &= (SUPPORTED_20000baseKR2_Full |
11788+ SUPPORTED_Autoneg |
1156711789 SUPPORTED_FIBRE |
1156811790 SUPPORTED_Pause |
1156911791 SUPPORTED_Asym_Pause);
11792+ phy->flags &= ~FLAGS_TX_ERROR_CHECK;
1157011793 break;
1157111794 default:
1157211795 DP(NETIF_MSG_LINK, "Unknown WC interface type 0x%x\n",
@@ -11665,6 +11888,9 @@ static int bnx2x_populate_ext_phy(struct bnx2x *bp, · 92 unmodified lines
1166511888 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833:
1166611889 *phy = phy_84833;
1166711890 break;
11891+ case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834:
11892+ *phy = phy_84834;
11893+ break;
1166811894 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54616:
1166911895 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE:
1167011896 *phy = phy_54618se;
@@ -11721,9 +11947,10 @@ static int bnx2x_populate_ext_phy(struct bnx2x *bp, · 50 unmodified lines
1172111947 }
1172211948 phy->mdio_ctrl = bnx2x_get_emac_base(bp, mdc_mdio_access, port);
1172311949
11724− if ((phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) &&
11950+ if (((phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) ||
11951+ (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834)) &&
1172511952 (phy->ver_addr)) {
11726− /* Remove 100Mb link supported for BCM84833 when phy fw
11953+ /* Remove 100Mb link supported for BCM84833/4 when phy fw
1172711954 * version lower than or equal to 1.39
1172811955 */
1172911956 u32 raw_ver = REG_RD(bp, phy->ver_addr);
@@ -11733,12 +11960,6 @@ static int bnx2x_populate_ext_phy(struct bnx2x *bp, · 3 unmodified lines
1173311960 SUPPORTED_100baseT_Full);
1173411961 }
1173511962
11736− /* In case mdc/mdio_access of the external phy is different than the
11737− * mdc/mdio access of the XGXS, a HW lock must be taken in each access
11738− * to prevent one port interfere with another port's CL45 operations.
11739− */
11740− if (mdc_mdio_access != SHARED_HW_CFG_MDC_MDIO_ACCESS1_BOTH)
11741− phy->flags |= FLAGS_HW_LOCK_REQUIRED;
1174211963 DP(NETIF_MSG_LINK, "phy_type 0x%x port %d found in index %d\n",
1174311964 phy_type, port, phy_index);
1174411965 DP(NETIF_MSG_LINK, " addr=0x%x, mdio_ctl=0x%x\n",
@@ -11863,7 +12084,6 @@ u32 bnx2x_phy_selection(struct link_params *params) · 118 unmodified lines
1186312084 return return_cfg;
1186412085 }
1186512086
11866−
1186712087 int bnx2x_phy_probe(struct link_params *params)
1186812088 {
1186912089 u8 phy_index, actual_phy_idx;
@@ -11907,6 +12127,10 @@ int bnx2x_phy_probe(struct link_params *params) · 37 unmodified lines
1190712127 FEATURE_CONFIG_DISABLE_REMOTE_FAULT_DET)
1190812128 phy->flags &= ~FLAGS_TX_ERROR_CHECK;
1190912129
12130+ if (!(params->feature_config_flags &
12131+ FEATURE_CONFIG_MT_SUPPORT))
12132+ phy->flags |= FLAGS_MDC_MDIO_WA_G;
12133+
1191012134 sync_offset = params->shmem_base +
1191112135 offsetof(struct shmem_region,
1191212136 dev_info.port_hw_config[params->port].media_type);
@@ -11934,8 +12158,8 @@ int bnx2x_phy_probe(struct link_params *params) · 21 unmodified lines
1193412158 return 0;
1193512159 }
1193612160
11937−void bnx2x_init_bmac_loopback(struct link_params *params,
11938− struct link_vars *vars)
12161+static void bnx2x_init_bmac_loopback(struct link_params *params,
12162+ struct link_vars *vars)
1193912163 {
1194012164 struct bnx2x *bp = params->bp;
1194112165 vars->link_up = 1;
@@ -11954,8 +12178,8 @@ void bnx2x_init_bmac_loopback(struct link_params *params, · 12 unmodified lines
1195412178 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
1195512179 }
1195612180
11957−void bnx2x_init_emac_loopback(struct link_params *params,
11958− struct link_vars *vars)
12181+static void bnx2x_init_emac_loopback(struct link_params *params,
12182+ struct link_vars *vars)
1195912183 {
1196012184 struct bnx2x *bp = params->bp;
1196112185 vars->link_up = 1;
@@ -11973,8 +12197,8 @@ void bnx2x_init_emac_loopback(struct link_params *params, · 11 unmodified lines
1197312197 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
1197412198 }
1197512199
11976−void bnx2x_init_xmac_loopback(struct link_params *params,
11977− struct link_vars *vars)
12200+static void bnx2x_init_xmac_loopback(struct link_params *params,
12201+ struct link_vars *vars)
1197812202 {
1197912203 struct bnx2x *bp = params->bp;
1198012204 vars->link_up = 1;
@@ -11999,8 +12223,8 @@ void bnx2x_init_xmac_loopback(struct link_params *params, · 18 unmodified lines
1199912223 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
1200012224 }
1200112225
12002−void bnx2x_init_umac_loopback(struct link_params *params,
12003− struct link_vars *vars)
12226+static void bnx2x_init_umac_loopback(struct link_params *params,
12227+ struct link_vars *vars)
1200412228 {
1200512229 struct bnx2x *bp = params->bp;
1200612230 vars->link_up = 1;
@@ -12014,17 +12238,21 @@ void bnx2x_init_umac_loopback(struct link_params *params, · 7 unmodified lines
1201412238 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
1201512239 }
1201612240
12017−void bnx2x_init_xgxs_loopback(struct link_params *params,
12018− struct link_vars *vars)
12241+static void bnx2x_init_xgxs_loopback(struct link_params *params,
12242+ struct link_vars *vars)
1201912243 {
1202012244 struct bnx2x *bp = params->bp;
12021− vars->link_up = 1;
12022− vars->flow_ctrl = BNX2X_FLOW_CTRL_NONE;
12023− vars->duplex = DUPLEX_FULL;
12245+ struct bnx2x_phy *int_phy = &params->phy[INT_PHY];
12246+ vars->link_up = 1;
12247+ vars->flow_ctrl = BNX2X_FLOW_CTRL_NONE;
12248+ vars->duplex = DUPLEX_FULL;
1202412249 if (params->req_line_speed[0] == SPEED_1000)
12025− vars->line_speed = SPEED_1000;
12250+ vars->line_speed = SPEED_1000;
12251+ else if ((params->req_line_speed[0] == SPEED_20000) ||
12252+ (int_phy->flags & FLAGS_WC_DUAL_MODE))
12253+ vars->line_speed = SPEED_20000;
1202612254 else
12027− vars->line_speed = SPEED_10000;
12255+ vars->line_speed = SPEED_10000;
1202812256
1202912257 if (!USES_WARPCORE(bp))
1203012258 bnx2x_xgxs_deassert(params);
@@ -12044,34 +12272,30 @@ void bnx2x_init_xgxs_loopback(struct link_params *params, · 13 unmodified lines
1204412272 bnx2x_bmac_enable(params, vars, 0, 1);
1204512273 }
1204612274
12047− if (params->loopback_mode == LOOPBACK_XGXS) {
12048− /* set 10G XGXS loopback */
12049− params->phy[INT_PHY].config_loopback(
12050− &params->phy[INT_PHY],
12051− params);
12052−
12053− } else {
12054− /* set external phy loopback */
12055− u8 phy_index;
12056− for (phy_index = EXT_PHY1;
12057− phy_index < params->num_phys; phy_index++) {
12058− if (params->phy[phy_index].config_loopback)
12059− params->phy[phy_index].config_loopback(
12060− &params->phy[phy_index],
12061− params);
12062− }
12063− }
12064− REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
12275+ if (params->loopback_mode == LOOPBACK_XGXS) {
12276+ /* Set 10G XGXS loopback */
12277+ int_phy->config_loopback(int_phy, params);
12278+ } else {
12279+ /* Set external phy loopback */
12280+ u8 phy_index;
12281+ for (phy_index = EXT_PHY1;
12282+ phy_index < params->num_phys; phy_index++)
12283+ if (params->phy[phy_index].config_loopback)
12284+ params->phy[phy_index].config_loopback(
12285+ &params->phy[phy_index],
12286+ params);
12287+ }
12288+ REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
1206512289
1206612290 bnx2x_set_led(params, vars, LED_MODE_OPER, vars->line_speed);
1206712291 }
1206812292
12069−static void bnx2x_set_rx_filter(struct link_params *params, u8 en)
12293+void bnx2x_set_rx_filter(struct link_params *params, u8 en)
1207012294 {
1207112295 struct bnx2x *bp = params->bp;
1207212296 u8 val = en * 0x1F;
1207312297
12074− /* Open the gate between the NIG to the BRB */
12298+ /* Open / close the gate between the NIG and the BRB */
1207512299 if (!CHIP_IS_E1x(bp))
1207612300 val |= en * 0x20;
1207712301 REG_WR(bp, NIG_REG_LLH0_BRB1_DRV_MASK + params->port*4, val);
@@ -12345,7 +12569,7 @@ int bnx2x_link_reset(struct link_params *params, struct link_vars *vars, · 267 unmodified lines
1234512569 * Hold it as vars low
1234612570 */
1234712571 /* Clear link led */
12348− bnx2x_set_mdio_clk(bp, params->chip_id, port);
12572+ bnx2x_set_mdio_emac_per_phy(bp, params);
1234912573 bnx2x_set_led(params, vars, LED_MODE_OFF, 0);
1235012574
1235112575 if (reset_ext_phy) {
@@ -12696,7 +12920,7 @@ static int bnx2x_8727_common_init_phy(struct bnx2x *bp, · 344 unmodified lines
1269612920 /* Initiate PHY reset*/
1269712921 bnx2x_set_gpio(bp, reset_gpio, MISC_REGISTERS_GPIO_OUTPUT_LOW,
1269812922 port);
12699− usleep_range(1000, 2000);
12923+ usleep_range(1000, 2000);
1270012924 bnx2x_set_gpio(bp, reset_gpio, MISC_REGISTERS_GPIO_OUTPUT_HIGH,
1270112925 port);
1270212926
@@ -12784,7 +13008,8 @@ static int bnx2x_84833_common_init_phy(struct bnx2x *bp, · 81 unmodified lines
1278413008 }
1278513009
1278613010 static int bnx2x_84833_pre_init_phy(struct bnx2x *bp,
12787− struct bnx2x_phy *phy)
13011+ struct bnx2x_phy *phy,
13012+ u8 port)
1278813013 {
1278913014 u16 val, cnt;
1279013015 /* Wait for FW completing its initialization. */
@@ -12794,7 +13019,7 @@ static int bnx2x_84833_pre_init_phy(struct bnx2x *bp, · 3 unmodified lines
1279413019 MDIO_PMA_REG_CTRL, &val);
1279513020 if (!(val & (1<<15)))
1279613021 break;
12797− usleep_range(1000, 2000);
13022+ usleep_range(1000, 2000);
1279813023 }
1279913024 if (cnt >= 1500) {
1280013025 DP(NETIF_MSG_LINK, "84833 reset timeout\n");
@@ -12811,26 +13036,28 @@ static int bnx2x_84833_pre_init_phy(struct bnx2x *bp, · 10 unmodified lines
1281113036 MDIO_84833_TOP_CFG_XGPHY_STRAP1, val);
1281213037
1281313038 /* Save spirom version */
12814− bnx2x_save_848xx_spirom_version(phy, bp, PORT_0);
13039+ bnx2x_save_848xx_spirom_version(phy, bp, port);
1281513040 return 0;
1281613041 }
1281713042
1281813043 int bnx2x_pre_init_phy(struct bnx2x *bp,
1281913044 u32 shmem_base,
1282013045 u32 shmem2_base,
12821− u32 chip_id)
13046+ u32 chip_id,
13047+ u8 port)
1282213048 {
1282313049 int rc = 0;
1282413050 struct bnx2x_phy phy;
12825− bnx2x_set_mdio_clk(bp, chip_id, PORT_0);
1282613051 if (bnx2x_populate_phy(bp, EXT_PHY1, shmem_base, shmem2_base,
12827− PORT_0, &phy)) {
13052+ port, &phy) != 0) {
1282813053 DP(NETIF_MSG_LINK, "populate_phy failed\n");
1282913054 return -EINVAL;
1283013055 }
13056+ bnx2x_set_mdio_clk(bp, chip_id, phy.mdio_ctrl);
1283113057 switch (phy.type) {
1283213058 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833:
12833− rc = bnx2x_84833_pre_init_phy(bp, &phy);
13059+ case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834:
13060+ rc = bnx2x_84833_pre_init_phy(bp, &phy, port);
1283413061 break;
1283513062 default:
1283613063 break;
@@ -12867,6 +13094,7 @@ static int bnx2x_ext_phy_common_init(struct bnx2x *bp, u32 shmem_base_path[], · 30 unmodified lines
1286713094 phy_index, chip_id);
1286813095 break;
1286913096 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833:
13097+ case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834:
1287013098 /* GPIO3's are linked, and so both need to be toggled
1287113099 * to obtain required 2us pulse.
1287213100 */
@@ -12898,8 +13126,9 @@ int bnx2x_common_init_phy(struct bnx2x *bp, u32 shmem_base_path[], · 25 unmodified lines
1289813126 u32 phy_ver, val;
1289913127 u8 phy_index = 0;
1290013128 u32 ext_phy_type, ext_phy_config;
12901− bnx2x_set_mdio_clk(bp, chip_id, PORT_0);
12902− bnx2x_set_mdio_clk(bp, chip_id, PORT_1);
13129+
13130+ bnx2x_set_mdio_clk(bp, chip_id, GRCBASE_EMAC0);
13131+ bnx2x_set_mdio_clk(bp, chip_id, GRCBASE_EMAC1);
1290313132 DP(NETIF_MSG_LINK, "Begin common phy init\n");
1290413133 if (CHIP_IS_E3(bp)) {
1290513134 /* Enable EPIO */
@@ -12960,6 +13189,7 @@ static void bnx2x_check_over_curr(struct link_params *params, · 54 unmodified lines
1296013189 " error.\n",
1296113190 params->port);
1296213191 vars->phy_flags |= PHY_OVER_CURRENT_FLAG;
13192+ bnx2x_warpcore_power_module(params, 0);
1296313193 }
1296413194 } else
1296513195 vars->phy_flags &= ~PHY_OVER_CURRENT_FLAG;
@@ -13139,6 +13369,108 @@ static void bnx2x_sfp_tx_fault_detection(struct bnx2x_phy *phy, · 173 unmodified lines
1313913369 }
1314013370 }
1314113371 }
13372+static void bnx2x_disable_kr2(struct link_params *params,
13373+ struct link_vars *vars,
13374+ struct bnx2x_phy *phy)
13375+{
13376+ struct bnx2x *bp = params->bp;
13377+ int i;
13378+ static struct bnx2x_reg_set reg_set[] = {
13379+ /* Step 1 - Program the TX/RX alignment markers */
13380+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL5, 0x7690},
13381+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL7, 0xe647},
13382+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL6, 0xc4f0},
13383+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_TX_CTRL9, 0x7690},
13384+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL11, 0xe647},
13385+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL82_USERB1_RX_CTRL10, 0xc4f0},
13386+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_USERB0_CTRL, 0x000c},
13387+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL1, 0x6000},
13388+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CTRL3, 0x0000},
13389+ {MDIO_WC_DEVAD, MDIO_WC_REG_CL73_BAM_CODE_FIELD, 0x0002},
13390+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI1, 0x0000},
13391+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI2, 0x0af7},
13392+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_OUI3, 0x0af7},
13393+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_BAM_CODE, 0x0002},
13394+ {MDIO_WC_DEVAD, MDIO_WC_REG_ETA_CL73_LD_UD_CODE, 0x0000}
13395+ };
13396+ DP(NETIF_MSG_LINK, "Disabling 20G-KR2\n");
13397+
13398+ for (i = 0; i < sizeof(reg_set)/sizeof(struct bnx2x_reg_set); i++)
13399+ bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg,
13400+ reg_set[i].val);
13401+ vars->link_attr_sync &= ~LINK_ATTR_SYNC_KR2_ENABLE;
13402+ bnx2x_update_link_attr(params, vars->link_attr_sync);
13403+
13404+ /* Restart AN on leading lane */
13405+ bnx2x_warpcore_restart_AN_KR(phy, params);
13406+}
13407+
13408+static void bnx2x_kr2_recovery(struct link_params *params,
13409+ struct link_vars *vars,
13410+ struct bnx2x_phy *phy)
13411+{
13412+ struct bnx2x *bp = params->bp;
13413+ DP(NETIF_MSG_LINK, "KR2 recovery\n");
13414+ bnx2x_warpcore_enable_AN_KR2(phy, params, vars);
13415+ bnx2x_warpcore_restart_AN_KR(phy, params);
13416+}
13417+
13418+static void bnx2x_check_kr2_wa(struct link_params *params,
13419+ struct link_vars *vars,
13420+ struct bnx2x_phy *phy)
13421+{
13422+ struct bnx2x *bp = params->bp;
13423+ u16 base_page, next_page, not_kr2_device, lane;
13424+ int sigdet = bnx2x_warpcore_get_sigdet(phy, params);
13425+
13426+ if (!sigdet) {
13427+ if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE))
13428+ bnx2x_kr2_recovery(params, vars, phy);
13429+ return;
13430+ }
13431+
13432+ lane = bnx2x_get_warpcore_lane(phy, params);
13433+ CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
13434+ MDIO_AER_BLOCK_AER_REG, lane);
13435+ bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD,
13436+ MDIO_AN_REG_LP_AUTO_NEG, &base_page);
13437+ bnx2x_cl45_read(bp, phy, MDIO_AN_DEVAD,
13438+ MDIO_AN_REG_LP_AUTO_NEG2, &next_page);
13439+ bnx2x_set_aer_mmd(params, phy);
13440+
13441+ /* CL73 has not begun yet */
13442+ if (base_page == 0) {
13443+ if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE))
13444+ bnx2x_kr2_recovery(params, vars, phy);
13445+ return;
13446+ }
13447+
13448+ /* In case NP bit is not set in the BasePage, or it is set,
13449+ * but only KX is advertised, declare this link partner as non-KR2
13450+ * device.
13451+ */
13452+ not_kr2_device = (((base_page & 0x8000) == 0) ||
13453+ (((base_page & 0x8000) &&
13454+ ((next_page & 0xe0) == 0x2))));
13455+
13456+ /* In case KR2 is already disabled, check if we need to re-enable it */
13457+ if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {
13458+ if (!not_kr2_device) {
13459+ DP(NETIF_MSG_LINK, "BP=0x%x, NP=0x%x\n", base_page,
13460+ next_page);
13461+ bnx2x_kr2_recovery(params, vars, phy);
13462+ }
13463+ return;
13464+ }
13465+ /* KR2 is enabled, but not KR2 device */
13466+ if (not_kr2_device) {
13467+ /* Disable KR2 on both lanes */
13468+ DP(NETIF_MSG_LINK, "BP=0x%x, NP=0x%x\n", base_page, next_page);
13469+ bnx2x_disable_kr2(params, vars, phy);
13470+ return;
13471+ }
13472+}
13473+
1314213474 void bnx2x_period_func(struct link_params *params, struct link_vars *vars)
1314313475 {
1314413476 u16 phy_idx;
@@ -13156,6 +13488,9 @@ void bnx2x_period_func(struct link_params *params, struct link_vars *vars) · 11 unmodified lines
1315613488 if (CHIP_IS_E3(bp)) {
1315713489 struct bnx2x_phy *phy = &params->phy[INT_PHY];
1315813490 bnx2x_set_aer_mmd(params, phy);
13491+ if ((phy->supported & SUPPORTED_20000baseKR2_Full) &&
13492+ (phy->speed_cap_mask & SPEED_20000))
13493+ bnx2x_check_kr2_wa(params, vars, phy);
1315913494 bnx2x_check_over_curr(params, vars);
1316013495 if (vars->rx_tx_asic_rst)
1316113496 bnx2x_warpcore_config_runtime(phy, params, vars);
@@ -13176,27 +13511,7 @@ void bnx2x_period_func(struct link_params *params, struct link_vars *vars) · 14 unmodified lines
1317613511 bnx2x_update_mng(params, vars->link_status);
1317713512 }
1317813513 }
13179−
13180− }
13181−
13182−}
13183−
13184−u8 bnx2x_hw_lock_required(struct bnx2x *bp, u32 shmem_base, u32 shmem2_base)
13185−{
13186− u8 phy_index;
13187− struct bnx2x_phy phy;
13188− for (phy_index = INT_PHY; phy_index < MAX_PHYS;
13189− phy_index++) {
13190− if (bnx2x_populate_phy(bp, phy_index, shmem_base, shmem2_base,
13191− 0, &phy) != 0) {
13192− DP(NETIF_MSG_LINK, "populate phy failed\n");
13193− return 0;
13194− }
13195−
13196− if (phy.flags & FLAGS_HW_LOCK_REQUIRED)
13197− return 1;
1319813514 }
13199− return 0;
1320013515 }
1320113516
1320213517 u8 bnx2x_fan_failure_det_req(struct bnx2x *bp,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h+8−10
@@ -139,8 +139,6 @@ struct bnx2x_phy { · 138 unmodified lines
139139 u8 addr;
140140 u8 def_md_devad;
141141 u16 flags;
142− /* Require HW lock */
143−#define FLAGS_HW_LOCK_REQUIRED (1<<0)
144142 /* No Over-Current detection */
145143 #define FLAGS_NOC (1<<1)
146144 /* Fan failure detection required */
@@ -156,6 +154,7 @@ struct bnx2x_phy { · 9 unmodified lines
156154 #define FLAGS_MDC_MDIO_WA_B0 (1<<10)
157155 #define FLAGS_TX_ERROR_CHECK (1<<12)
158156 #define FLAGS_EEE (1<<13)
157+#define FLAGS_MDC_MDIO_WA_G (1<<15)
159158
160159 /* preemphasis values for the rx side */
161160 u16 rx_preemphasis[4];
@@ -267,6 +266,9 @@ struct link_params { · 105 unmodified lines
267266 #define FEATURE_CONFIG_AUTOGREEEN_ENABLED (1<<9)
268267 #define FEATURE_CONFIG_BC_SUPPORTS_SFP_TX_DISABLED (1<<10)
269268 #define FEATURE_CONFIG_DISABLE_REMOTE_FAULT_DET (1<<11)
269+#define FEATURE_CONFIG_MT_SUPPORT (1<<13)
270+#define FEATURE_CONFIG_BOOT_FROM_SAN (1<<14)
271+
270272 /* Will be populated during common init */
271273 struct bnx2x_phy phy[MAX_PHYS];
272274
@@ -347,6 +349,8 @@ struct link_vars { · 74 unmodified lines
347349 u8 rx_tx_asic_rst;
348350 u8 turn_to_run_wc_rt;
349351 u16 rsrv2;
352+ /* The same definitions as the shmem2 parameter */
353+ u32 link_attr_sync;
350354 };
351355
352356 /***********************************************************/
@@ -418,10 +422,6 @@ int bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 65 unmodified lines
418422
419423 void bnx2x_hw_reset_phy(struct link_params *params);
420424
421−/* Checks if HW lock is required for this phy/board type */
422−u8 bnx2x_hw_lock_required(struct bnx2x *bp, u32 shmem_base,
423− u32 shmem2_base);
424−
425425 /* Check swap bit and adjust PHY order */
426426 u32 bnx2x_phy_selection(struct link_params *params);
427427
@@ -432,7 +432,8 @@ int bnx2x_phy_probe(struct link_params *params); · 4 unmodified lines
432432 u8 bnx2x_fan_failure_det_req(struct bnx2x *bp, u32 shmem_base,
433433 u32 shmem2_base, u8 port);
434434
435−
435+/* Open / close the gate between the NIG and the BRB */
436+void bnx2x_set_rx_filter(struct link_params *params, u8 en);
436437
437438 /* DCBX structs */
438439
@@ -459,9 +460,6 @@ struct bnx2x_nig_brb_pfc_port_params { · 20 unmodified lines
459460 u32 rx_cos_priority_mask[DCBX_MAX_NUM_COS];
460461 u32 llfc_high_priority_classes;
461462 u32 llfc_low_priority_classes;
462− /* BRB */
463− u32 cos0_pauseable;
464− u32 cos1_pauseable;
465463 };
466464
467465
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+728−458
@@ -79,7 +79,7 @@ · 78 unmodified lines
7979 /* Time in jiffies before concluding the transmitter is hung */
8080 #define TX_TIMEOUT (5*HZ)
8181
82−static char version[] __devinitdata =
82+static char version[] =
8383 "Broadcom NetXtreme II 5771x/578xx 10/20-Gigabit Ethernet Driver "
8484 DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
8585
@@ -149,7 +149,7 @@ enum bnx2x_board_type { · 63 unmodified lines
149149 /* indexed by board_type, above */
150150 static struct {
151151 char *name;
152−} board_info[] __devinitdata = {
152+} board_info[] = {
153153 { "Broadcom NetXtreme II BCM57710 10 Gigabit PCIe [Everest]" },
154154 { "Broadcom NetXtreme II BCM57711 10 Gigabit PCIe" },
155155 { "Broadcom NetXtreme II BCM57711E 10 Gigabit PCIe" },
@@ -791,10 +791,9 @@ void bnx2x_panic_dump(struct bnx2x *bp) · 635 unmodified lines
791791
792792 /* host sb data */
793793
794−#ifdef BCM_CNIC
795794 if (IS_FCOE_FP(fp))
796795 continue;
797−#endif
796+
798797 BNX2X_ERR(" run indexes (");
799798 for (j = 0; j < HC_SB_MAX_SM; j++)
800799 pr_cont("0x%x%s",
@@ -859,7 +858,7 @@ void bnx2x_panic_dump(struct bnx2x *bp) · 58 unmodified lines
859858 #ifdef BNX2X_STOP_ON_ERROR
860859 /* Rings */
861860 /* Rx */
862− for_each_rx_queue(bp, i) {
861+ for_each_valid_rx_queue(bp, i) {
863862 struct bnx2x_fastpath *fp = &bp->fp[i];
864863
865864 start = RX_BD(le16_to_cpu(*fp->rx_cons_sb) - 10);
@@ -893,7 +892,7 @@ void bnx2x_panic_dump(struct bnx2x *bp) · 27 unmodified lines
893892 }
894893
895894 /* Tx */
896− for_each_tx_queue(bp, i) {
895+ for_each_valid_tx_queue(bp, i) {
897896 struct bnx2x_fastpath *fp = &bp->fp[i];
898897 for_each_cos_in_tx_queue(fp, cos) {
899898 struct bnx2x_fp_txdata *txdata = fp->txdata_ptr[cos];
@@ -1483,7 +1482,7 @@ static void bnx2x_igu_int_disable(struct bnx2x *bp) · 583 unmodified lines
14831482 BNX2X_ERR("BUG! proper val not read from IGU!\n");
14841483 }
14851484
1486−void bnx2x_int_disable(struct bnx2x *bp)
1485+static void bnx2x_int_disable(struct bnx2x *bp)
14871486 {
14881487 if (bp->common.int_block == INT_BLOCK_HC)
14891488 bnx2x_hc_int_disable(bp);
@@ -1504,9 +1503,8 @@ void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw) · 14 unmodified lines
15041503 if (msix) {
15051504 synchronize_irq(bp->msix_table[0].vector);
15061505 offset = 1;
1507−#ifdef BCM_CNIC
1508− offset++;
1509−#endif
1506+ if (CNIC_SUPPORT(bp))
1507+ offset++;
15101508 for_each_eth_queue(bp, i)
15111509 synchronize_irq(bp->msix_table[offset++].vector);
15121510 } else
@@ -1588,9 +1586,8 @@ static bool bnx2x_trylock_leader_lock(struct bnx2x *bp) · 75 unmodified lines
15881586 return bnx2x_trylock_hw_lock(bp, bnx2x_get_leader_lock_resource(bp));
15891587 }
15901588
1591−#ifdef BCM_CNIC
15921589 static void bnx2x_cnic_cfc_comp(struct bnx2x *bp, int cid, u8 err);
1593−#endif
1590+
15941591
15951592 void bnx2x_sp_event(struct bnx2x_fastpath *fp, union eth_rx_cqe *rr_cqe)
15961593 {
@@ -1720,7 +1717,7 @@ irqreturn_t bnx2x_interrupt(int irq, void *dev_instance) · 123 unmodified lines
17201717 for_each_eth_queue(bp, i) {
17211718 struct bnx2x_fastpath *fp = &bp->fp[i];
17221719
1723− mask = 0x2 << (fp->index + CNIC_PRESENT);
1720+ mask = 0x2 << (fp->index + CNIC_SUPPORT(bp));
17241721 if (status & mask) {
17251722 /* Handle Rx or Tx according to SB id */
17261723 prefetch(fp->rx_cons_sb);
@@ -1732,22 +1729,23 @@ irqreturn_t bnx2x_interrupt(int irq, void *dev_instance) · 5 unmodified lines
17321729 }
17331730 }
17341731
1735−#ifdef BCM_CNIC
1736− mask = 0x2;
1737− if (status & (mask | 0x1)) {
1738− struct cnic_ops *c_ops = NULL;
1732+ if (CNIC_SUPPORT(bp)) {
1733+ mask = 0x2;
1734+ if (status & (mask | 0x1)) {
1735+ struct cnic_ops *c_ops = NULL;
17391736
1740− if (likely(bp->state == BNX2X_STATE_OPEN)) {
1741− rcu_read_lock();
1742− c_ops = rcu_dereference(bp->cnic_ops);
1743− if (c_ops)
1744− c_ops->cnic_handler(bp->cnic_data, NULL);
1745− rcu_read_unlock();
1746− }
1737+ if (likely(bp->state == BNX2X_STATE_OPEN)) {
1738+ rcu_read_lock();
1739+ c_ops = rcu_dereference(bp->cnic_ops);
1740+ if (c_ops)
1741+ c_ops->cnic_handler(bp->cnic_data,
1742+ NULL);
1743+ rcu_read_unlock();
1744+ }
17471745
1748− status &= ~mask;
1746+ status &= ~mask;
1747+ }
17491748 }
1750−#endif
17511749
17521750 if (unlikely(status & 0x1)) {
17531751 queue_delayed_work(bnx2x_wq, &bp->sp_task, 0);
@@ -2034,40 +2032,39 @@ int bnx2x_set_gpio_int(struct bnx2x *bp, int gpio_num, u32 mode, u8 port) · 280 unmodified lines
20342032 return 0;
20352033 }
20362034
2037−static int bnx2x_set_spio(struct bnx2x *bp, int spio_num, u32 mode)
2035+static int bnx2x_set_spio(struct bnx2x *bp, int spio, u32 mode)
20382036 {
2039− u32 spio_mask = (1 << spio_num);
20402037 u32 spio_reg;
20412038
2042− if ((spio_num < MISC_REGISTERS_SPIO_4) ||
2043− (spio_num > MISC_REGISTERS_SPIO_7)) {
2044− BNX2X_ERR("Invalid SPIO %d\n", spio_num);
2039+ /* Only 2 SPIOs are configurable */
2040+ if ((spio != MISC_SPIO_SPIO4) && (spio != MISC_SPIO_SPIO5)) {
2041+ BNX2X_ERR("Invalid SPIO 0x%x\n", spio);
20452042 return -EINVAL;
20462043 }
20472044
20482045 bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_SPIO);
20492046 /* read SPIO and mask except the float bits */
2050− spio_reg = (REG_RD(bp, MISC_REG_SPIO) & MISC_REGISTERS_SPIO_FLOAT);
2047+ spio_reg = (REG_RD(bp, MISC_REG_SPIO) & MISC_SPIO_FLOAT);
20512048
20522049 switch (mode) {
2053− case MISC_REGISTERS_SPIO_OUTPUT_LOW:
2054− DP(NETIF_MSG_HW, "Set SPIO %d -> output low\n", spio_num);
2050+ case MISC_SPIO_OUTPUT_LOW:
2051+ DP(NETIF_MSG_HW, "Set SPIO 0x%x -> output low\n", spio);
20552052 /* clear FLOAT and set CLR */
2056− spio_reg &= ~(spio_mask << MISC_REGISTERS_SPIO_FLOAT_POS);
2057− spio_reg |= (spio_mask << MISC_REGISTERS_SPIO_CLR_POS);
2053+ spio_reg &= ~(spio << MISC_SPIO_FLOAT_POS);
2054+ spio_reg |= (spio << MISC_SPIO_CLR_POS);
20582055 break;
20592056
2060− case MISC_REGISTERS_SPIO_OUTPUT_HIGH:
2061− DP(NETIF_MSG_HW, "Set SPIO %d -> output high\n", spio_num);
2057+ case MISC_SPIO_OUTPUT_HIGH:
2058+ DP(NETIF_MSG_HW, "Set SPIO 0x%x -> output high\n", spio);
20622059 /* clear FLOAT and set SET */
2063− spio_reg &= ~(spio_mask << MISC_REGISTERS_SPIO_FLOAT_POS);
2064− spio_reg |= (spio_mask << MISC_REGISTERS_SPIO_SET_POS);
2060+ spio_reg &= ~(spio << MISC_SPIO_FLOAT_POS);
2061+ spio_reg |= (spio << MISC_SPIO_SET_POS);
20652062 break;
20662063
2067− case MISC_REGISTERS_SPIO_INPUT_HI_Z:
2068− DP(NETIF_MSG_HW, "Set SPIO %d -> input\n", spio_num);
2064+ case MISC_SPIO_INPUT_HI_Z:
2065+ DP(NETIF_MSG_HW, "Set SPIO 0x%x -> input\n", spio);
20692066 /* set FLOAT */
2070− spio_reg |= (spio_mask << MISC_REGISTERS_SPIO_FLOAT_POS);
2067+ spio_reg |= (spio << MISC_SPIO_FLOAT_POS);
20712068 break;
20722069
20732070 default:
@@ -2106,22 +2103,25 @@ void bnx2x_calc_fc_adv(struct bnx2x *bp) · 32 unmodified lines
21062103 }
21072104 }
21082105
2109−u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode)
2106+static void bnx2x_set_requested_fc(struct bnx2x *bp)
21102107 {
2111− if (!BP_NOMCP(bp)) {
2112− u8 rc;
2113− int cfx_idx = bnx2x_get_link_cfg_idx(bp);
2114− u16 req_line_speed = bp->link_params.req_line_speed[cfx_idx];
2115− /*
2116− * Initialize link parameters structure variables
2117− * It is recommended to turn off RX FC for jumbo frames
2118− * for better performance
2119− */
2120− if (CHIP_IS_E1x(bp) && (bp->dev->mtu > 5000))
2121− bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_TX;
2122− else
2123− bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_BOTH;
2108+ /* Initialize link parameters structure variables
2109+ * It is recommended to turn off RX FC for jumbo frames
2110+ * for better performance
2111+ */
2112+ if (CHIP_IS_E1x(bp) && (bp->dev->mtu > 5000))
2113+ bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_TX;
2114+ else
2115+ bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_BOTH;
2116+}
21242117
2118+int bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode)
2119+{
2120+ int rc, cfx_idx = bnx2x_get_link_cfg_idx(bp);
2121+ u16 req_line_speed = bp->link_params.req_line_speed[cfx_idx];
2122+
2123+ if (!BP_NOMCP(bp)) {
2124+ bnx2x_set_requested_fc(bp);
21252125 bnx2x_acquire_phy_lock(bp);
21262126
21272127 if (load_mode == LOAD_DIAG) {
@@ -2150,11 +2150,11 @@ u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) · 22 unmodified lines
21502150
21512151 bnx2x_calc_fc_adv(bp);
21522152
2153− if (CHIP_REV_IS_SLOW(bp) && bp->link_vars.link_up) {
2153+ if (bp->link_vars.link_up) {
21542154 bnx2x_stats_handle(bp, STATS_EVENT_LINK_UP);
21552155 bnx2x_link_report(bp);
2156− } else
2157− queue_delayed_work(bnx2x_wq, &bp->period_task, 0);
2156+ }
2157+ queue_delayed_work(bnx2x_wq, &bp->period_task, 0);
21582158 bp->link_params.req_line_speed[cfx_idx] = req_line_speed;
21592159 return rc;
21602160 }
@@ -3075,11 +3075,13 @@ static void bnx2x_drv_info_ether_stat(struct bnx2x *bp) · 914 unmodified lines
30753075
30763076 static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp)
30773077 {
3078−#ifdef BCM_CNIC
30793078 struct bnx2x_dcbx_app_params *app = &bp->dcbx_port_params.app;
30803079 struct fcoe_stats_info *fcoe_stat =
30813080 &bp->slowpath->drv_info_to_mcp.fcoe_stat;
30823081
3082+ if (!CNIC_LOADED(bp))
3083+ return;
3084+
30833085 memcpy(fcoe_stat->mac_local + MAC_LEADING_ZERO_CNT,
30843086 bp->fip_mac, ETH_ALEN);
30853087
@@ -3162,16 +3164,17 @@ static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp) · 76 unmodified lines
31623164
31633165 /* ask L5 driver to add data to the struct */
31643166 bnx2x_cnic_notify(bp, CNIC_CTL_FCOE_STATS_GET_CMD);
3165−#endif
31663167 }
31673168
31683169 static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp)
31693170 {
3170−#ifdef BCM_CNIC
31713171 struct bnx2x_dcbx_app_params *app = &bp->dcbx_port_params.app;
31723172 struct iscsi_stats_info *iscsi_stat =
31733173 &bp->slowpath->drv_info_to_mcp.iscsi_stat;
31743174
3175+ if (!CNIC_LOADED(bp))
3176+ return;
3177+
31753178 memcpy(iscsi_stat->mac_local + MAC_LEADING_ZERO_CNT,
31763179 bp->cnic_eth_dev.iscsi_mac, ETH_ALEN);
31773180
@@ -3180,7 +3183,6 @@ static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp) · 2 unmodified lines
31803183
31813184 /* ask L5 driver to add data to the struct */
31823185 bnx2x_cnic_notify(bp, CNIC_CTL_ISCSI_STATS_GET_CMD);
3183−#endif
31843186 }
31853187
31863188 /* called due to MCP event (on pmf):
@@ -3589,6 +3591,21 @@ static void bnx2x_attn_int_asserted(struct bnx2x *bp, u32 asserted) · 402 unmodified lines
35893591
35903592 /* now set back the mask */
35913593 if (asserted & ATTN_NIG_FOR_FUNC) {
3594+ /* Verify that IGU ack through BAR was written before restoring
3595+ * NIG mask. This loop should exit after 2-3 iterations max.
3596+ */
3597+ if (bp->common.int_block != INT_BLOCK_HC) {
3598+ u32 cnt = 0, igu_acked;
3599+ do {
3600+ igu_acked = REG_RD(bp,
3601+ IGU_REG_ATTENTION_ACK_BITS);
3602+ } while (((igu_acked & ATTN_NIG_FOR_FUNC) == 0) &&
3603+ (++cnt < MAX_IGU_ATTN_ACK_TO));
3604+ if (!igu_acked)
3605+ DP(NETIF_MSG_HW,
3606+ "Failed to verify IGU ack on time\n");
3607+ barrier();
3608+ }
35923609 REG_WR(bp, nig_int_mask_addr, nig_mask);
35933610 bnx2x_release_phy_lock(bp);
35943611 }
@@ -4572,7 +4589,6 @@ static void bnx2x_update_eq_prod(struct bnx2x *bp, u16 prod) · 977 unmodified lines
45724589 mmiowb(); /* keep prod updates ordered */
45734590 }
45744591
4575−#ifdef BCM_CNIC
45764592 static int bnx2x_cnic_handle_cfc_del(struct bnx2x *bp, u32 cid,
45774593 union event_ring_elem *elem)
45784594 {
@@ -4594,7 +4610,6 @@ static int bnx2x_cnic_handle_cfc_del(struct bnx2x *bp, u32 cid, · 15 unmodified lines
45944610 bnx2x_cnic_cfc_comp(bp, cid, err);
45954611 return 0;
45964612 }
4597−#endif
45984613
45994614 static void bnx2x_handle_mcast_eqe(struct bnx2x *bp)
46004615 {
@@ -4635,11 +4650,9 @@ static void bnx2x_handle_classification_eqe(struct bnx2x *bp, · 34 unmodified lines
46354650 switch (elem->message.data.eth_event.echo >> BNX2X_SWCID_SHIFT) {
46364651 case BNX2X_FILTER_MAC_PENDING:
46374652 DP(BNX2X_MSG_SP, "Got SETUP_MAC completions\n");
4638−#ifdef BCM_CNIC
4639− if (cid == BNX2X_ISCSI_ETH_CID(bp))
4653+ if (CNIC_LOADED(bp) && (cid == BNX2X_ISCSI_ETH_CID(bp)))
46404654 vlan_mac_obj = &bp->iscsi_l2_mac_obj;
46414655 else
4642−#endif
46434656 vlan_mac_obj = &bp->sp_objs[cid].mac_obj;
46444657
46454658 break;
@@ -4665,9 +4678,7 @@ static void bnx2x_handle_classification_eqe(struct bnx2x *bp, · 19 unmodified lines
46654678
46664679 }
46674680
4668−#ifdef BCM_CNIC
46694681 static void bnx2x_set_iscsi_eth_rx_mode(struct bnx2x *bp, bool start);
4670−#endif
46714682
46724683 static void bnx2x_handle_rx_mode_eqe(struct bnx2x *bp)
46734684 {
@@ -4678,14 +4689,12 @@ static void bnx2x_handle_rx_mode_eqe(struct bnx2x *bp) · 4 unmodified lines
46784689 /* Send rx_mode command again if was requested */
46794690 if (test_and_clear_bit(BNX2X_FILTER_RX_MODE_SCHED, &bp->sp_state))
46804691 bnx2x_set_storm_rx_mode(bp);
4681−#ifdef BCM_CNIC
46824692 else if (test_and_clear_bit(BNX2X_FILTER_ISCSI_ETH_START_SCHED,
46834693 &bp->sp_state))
46844694 bnx2x_set_iscsi_eth_rx_mode(bp, true);
46854695 else if (test_and_clear_bit(BNX2X_FILTER_ISCSI_ETH_STOP_SCHED,
46864696 &bp->sp_state))
46874697 bnx2x_set_iscsi_eth_rx_mode(bp, false);
4688−#endif
46894698
46904699 netif_addr_unlock_bh(bp->dev);
46914700 }
@@ -4747,7 +4756,6 @@ static void bnx2x_after_function_update(struct bnx2x *bp) · 55 unmodified lines
47474756 q);
47484757 }
47494758
4750−#ifdef BCM_CNIC
47514759 if (!NO_FCOE(bp)) {
47524760 fp = &bp->fp[FCOE_IDX(bp)];
47534761 queue_params.q_obj = &bnx2x_sp_obj(bp, fp).q_obj;
@@ -4770,22 +4778,16 @@ static void bnx2x_after_function_update(struct bnx2x *bp) · 16 unmodified lines
47704778 bnx2x_link_report(bp);
47714779 bnx2x_fw_command(bp, DRV_MSG_CODE_AFEX_VIFSET_ACK, 0);
47724780 }
4773−#else
4774− /* If no FCoE ring - ACK MCP now */
4775− bnx2x_link_report(bp);
4776− bnx2x_fw_command(bp, DRV_MSG_CODE_AFEX_VIFSET_ACK, 0);
4777−#endif /* BCM_CNIC */
47784781 }
47794782
47804783 static struct bnx2x_queue_sp_obj *bnx2x_cid_to_q_obj(
47814784 struct bnx2x *bp, u32 cid)
47824785 {
47834786 DP(BNX2X_MSG_SP, "retrieving fp from cid %d\n", cid);
4784−#ifdef BCM_CNIC
4785− if (cid == BNX2X_FCOE_ETH_CID(bp))
4787+
4788+ if (CNIC_LOADED(bp) && (cid == BNX2X_FCOE_ETH_CID(bp)))
47864789 return &bnx2x_fcoe_sp_obj(bp, q_obj);
47874790 else
4788−#endif
47894791 return &bp->sp_objs[CID_TO_FP(cid, bp)].q_obj;
47904792 }
47914793
@@ -4793,6 +4795,7 @@ static void bnx2x_eq_int(struct bnx2x *bp) · 1 unmodified line
47934795 {
47944796 u16 hw_cons, sw_cons, sw_prod;
47954797 union event_ring_elem *elem;
4798+ u8 echo;
47964799 u32 cid;
47974800 u8 opcode;
47984801 int spqe_cnt = 0;
@@ -4847,10 +4850,11 @@ static void bnx2x_eq_int(struct bnx2x *bp) · 48 unmodified lines
48474850 */
48484851 DP(BNX2X_MSG_SP,
48494852 "got delete ramrod for MULTI[%d]\n", cid);
4850−#ifdef BCM_CNIC
4851− if (!bnx2x_cnic_handle_cfc_del(bp, cid, elem))
4853+
4854+ if (CNIC_LOADED(bp) &&
4855+ !bnx2x_cnic_handle_cfc_del(bp, cid, elem))
48524856 goto next_spqe;
4853−#endif
4857+
48544858 q_obj = bnx2x_cid_to_q_obj(bp, cid);
48554859
48564860 if (q_obj->complete_cmd(bp, q_obj, BNX2X_Q_CMD_CFC_DEL))
@@ -4875,21 +4879,34 @@ static void bnx2x_eq_int(struct bnx2x *bp) · 18 unmodified lines
48754879 break;
48764880 bnx2x_dcbx_set_params(bp, BNX2X_DCBX_STATE_TX_RELEASED);
48774881 goto next_spqe;
4882+
48784883 case EVENT_RING_OPCODE_FUNCTION_UPDATE:
4879− DP(BNX2X_MSG_SP | BNX2X_MSG_MCP,
4880− "AFEX: ramrod completed FUNCTION_UPDATE\n");
4881− f_obj->complete_cmd(bp, f_obj, BNX2X_F_CMD_AFEX_UPDATE);
4884+ echo = elem->message.data.function_update_event.echo;
4885+ if (echo == SWITCH_UPDATE) {
4886+ DP(BNX2X_MSG_SP | NETIF_MSG_IFUP,
4887+ "got FUNC_SWITCH_UPDATE ramrod\n");
4888+ if (f_obj->complete_cmd(
4889+ bp, f_obj, BNX2X_F_CMD_SWITCH_UPDATE))
4890+ break;
48824891
4883− /* We will perform the Queues update from sp_rtnl task
4884− * as all Queue SP operations should run under
4885− * rtnl_lock.
4886− */
4887− smp_mb__before_clear_bit();
4888− set_bit(BNX2X_SP_RTNL_AFEX_F_UPDATE,
4889− &bp->sp_rtnl_state);
4890− smp_mb__after_clear_bit();
4892+ } else {
4893+ DP(BNX2X_MSG_SP | BNX2X_MSG_MCP,
4894+ "AFEX: ramrod completed FUNCTION_UPDATE\n");
4895+ f_obj->complete_cmd(bp, f_obj,
4896+ BNX2X_F_CMD_AFEX_UPDATE);
4897+
4898+ /* We will perform the Queues update from
4899+ * sp_rtnl task as all Queue SP operations
4900+ * should run under rtnl_lock.
4901+ */
4902+ smp_mb__before_clear_bit();
4903+ set_bit(BNX2X_SP_RTNL_AFEX_F_UPDATE,
4904+ &bp->sp_rtnl_state);
4905+ smp_mb__after_clear_bit();
4906+
4907+ schedule_delayed_work(&bp->sp_rtnl_task, 0);
4908+ }
48914909
4892− schedule_delayed_work(&bp->sp_rtnl_task, 0);
48934910 goto next_spqe;
48944911
48954912 case EVENT_RING_OPCODE_AFEX_VIF_LISTS:
@@ -4999,11 +5016,10 @@ static void bnx2x_sp_task(struct work_struct *work) · 103 unmodified lines
49995016
50005017 /* SP events: STAT_QUERY and others */
50015018 if (status & BNX2X_DEF_SB_IDX) {
5002−#ifdef BCM_CNIC
50035019 struct bnx2x_fastpath *fp = bnx2x_fcoe_fp(bp);
50045020
5005− if ((!NO_FCOE(bp)) &&
5006− (bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))) {
5021+ if (FCOE_INIT(bp) &&
5022+ (bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))) {
50075023 /*
50085024 * Prevent local bottom-halves from running as
50095025 * we are going to change the local NAPI list.
@@ -5012,7 +5028,7 @@ static void bnx2x_sp_task(struct work_struct *work) · 2 unmodified lines
50125028 napi_schedule(&bnx2x_fcoe(bp, napi));
50135029 local_bh_enable();
50145030 }
5015−#endif
5031+
50165032 /* Handle EQ completions */
50175033 bnx2x_eq_int(bp);
50185034
@@ -5050,8 +5066,7 @@ irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) · 31 unmodified lines
50505066 return IRQ_HANDLED;
50515067 #endif
50525068
5053−#ifdef BCM_CNIC
5054− {
5069+ if (CNIC_LOADED(bp)) {
50555070 struct cnic_ops *c_ops;
50565071
50575072 rcu_read_lock();
@@ -5060,7 +5075,7 @@ irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) · 2 unmodified lines
50605075 c_ops->cnic_handler(bp->cnic_data, NULL);
50615076 rcu_read_unlock();
50625077 }
5063−#endif
5078+
50645079 queue_delayed_work(bnx2x_wq, &bp->sp_task, 0);
50655080
50665081 return IRQ_HANDLED;
@@ -5498,12 +5513,10 @@ void bnx2x_set_storm_rx_mode(struct bnx2x *bp) · 431 unmodified lines
54985513 unsigned long rx_mode_flags = 0, ramrod_flags = 0;
54995514 unsigned long rx_accept_flags = 0, tx_accept_flags = 0;
55005515
5501−#ifdef BCM_CNIC
55025516 if (!NO_FCOE(bp))
55035517
55045518 /* Configure rx_mode of FCoE Queue */
55055519 __set_bit(BNX2X_RX_MODE_FCOE_ETH, &rx_mode_flags);
5506−#endif
55075520
55085521 switch (bp->rx_mode) {
55095522 case BNX2X_RX_MODE_NONE:
@@ -5624,12 +5637,12 @@ static void bnx2x_init_internal(struct bnx2x *bp, u32 load_code) · 114 unmodified lines
56245637
56255638 static inline u8 bnx2x_fp_igu_sb_id(struct bnx2x_fastpath *fp)
56265639 {
5627− return fp->bp->igu_base_sb + fp->index + CNIC_PRESENT;
5640+ return fp->bp->igu_base_sb + fp->index + CNIC_SUPPORT(fp->bp);
56285641 }
56295642
56305643 static inline u8 bnx2x_fp_fw_sb_id(struct bnx2x_fastpath *fp)
56315644 {
5632− return fp->bp->base_fw_ndsb + fp->index + CNIC_PRESENT;
5645+ return fp->bp->base_fw_ndsb + fp->index + CNIC_SUPPORT(fp->bp);
56335646 }
56345647
56355648 static u8 bnx2x_fp_cl_id(struct bnx2x_fastpath *fp)
@@ -5720,23 +5733,25 @@ static void bnx2x_init_tx_ring_one(struct bnx2x_fp_txdata *txdata) · 84 unmodified lines
57205733 txdata->tx_pkt = 0;
57215734 }
57225735
5736+static void bnx2x_init_tx_rings_cnic(struct bnx2x *bp)
5737+{
5738+ int i;
5739+
5740+ for_each_tx_queue_cnic(bp, i)
5741+ bnx2x_init_tx_ring_one(bp->fp[i].txdata_ptr[0]);
5742+}
57235743 static void bnx2x_init_tx_rings(struct bnx2x *bp)
57245744 {
57255745 int i;
57265746 u8 cos;
57275747
5728− for_each_tx_queue(bp, i)
5748+ for_each_eth_queue(bp, i)
57295749 for_each_cos_in_tx_queue(&bp->fp[i], cos)
57305750 bnx2x_init_tx_ring_one(bp->fp[i].txdata_ptr[cos]);
57315751 }
57325752
5733−void bnx2x_nic_init(struct bnx2x *bp, u32 load_code)
5753+void bnx2x_nic_init_cnic(struct bnx2x *bp)
57345754 {
5735− int i;
5736−
5737− for_each_eth_queue(bp, i)
5738− bnx2x_init_eth_fp(bp, i);
5739−#ifdef BCM_CNIC
57405755 if (!NO_FCOE(bp))
57415756 bnx2x_init_fcoe_fp(bp);
57425757
@@ -5744,8 +5759,22 @@ void bnx2x_nic_init(struct bnx2x *bp, u32 load_code) · 1 unmodified line
57445759 BNX2X_VF_ID_INVALID, false,
57455760 bnx2x_cnic_fw_sb_id(bp), bnx2x_cnic_igu_sb_id(bp));
57465761
5747−#endif
5762+ /* ensure status block indices were read */
5763+ rmb();
5764+ bnx2x_init_rx_rings_cnic(bp);
5765+ bnx2x_init_tx_rings_cnic(bp);
5766+
5767+ /* flush all */
5768+ mb();
5769+ mmiowb();
5770+}
57485771
5772+void bnx2x_nic_init(struct bnx2x *bp, u32 load_code)
5773+{
5774+ int i;
5775+
5776+ for_each_eth_queue(bp, i)
5777+ bnx2x_init_eth_fp(bp, i);
57495778 /* Initialize MOD_ABS interrupts */
57505779 bnx2x_init_mod_abs_int(bp, &bp->link_vars, bp->common.chip_id,
57515780 bp->common.shmem_base, bp->common.shmem2_base,
@@ -6031,10 +6060,9 @@ static int bnx2x_int_mem_test(struct bnx2x *bp) · 279 unmodified lines
60316060 msleep(50);
60326061 bnx2x_init_block(bp, BLOCK_BRB1, PHASE_COMMON);
60336062 bnx2x_init_block(bp, BLOCK_PRS, PHASE_COMMON);
6034−#ifndef BCM_CNIC
6035− /* set NIC mode */
6036− REG_WR(bp, PRS_REG_NIC_MODE, 1);
6037−#endif
6063+ if (!CNIC_SUPPORT(bp))
6064+ /* set NIC mode */
6065+ REG_WR(bp, PRS_REG_NIC_MODE, 1);
60386066
60396067 /* Enable inputs of parser neighbor blocks */
60406068 REG_WR(bp, TSDM_REG_ENABLE_IN1, 0x7fffffff);
@@ -6049,6 +6077,8 @@ static int bnx2x_int_mem_test(struct bnx2x *bp) · 8 unmodified lines
60496077
60506078 static void bnx2x_enable_blocks_attention(struct bnx2x *bp)
60516079 {
6080+ u32 val;
6081+
60526082 REG_WR(bp, PXP_REG_PXP_INT_MASK_0, 0);
60536083 if (!CHIP_IS_E1x(bp))
60546084 REG_WR(bp, PXP_REG_PXP_INT_MASK_1, 0x40);
@@ -6082,17 +6112,14 @@ static void bnx2x_enable_blocks_attention(struct bnx2x *bp) · 27 unmodified lines
60826112 /* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_0, 0); */
60836113 /* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_1, 0); */
60846114
6085− if (CHIP_REV_IS_FPGA(bp))
6086− REG_WR(bp, PXP2_REG_PXP2_INT_MASK_0, 0x580000);
6087− else if (!CHIP_IS_E1x(bp))
6088− REG_WR(bp, PXP2_REG_PXP2_INT_MASK_0,
6089− (PXP2_PXP2_INT_MASK_0_REG_PGL_CPL_OF
6090− | PXP2_PXP2_INT_MASK_0_REG_PGL_CPL_AFT
6091− | PXP2_PXP2_INT_MASK_0_REG_PGL_PCIE_ATTN
6092− | PXP2_PXP2_INT_MASK_0_REG_PGL_READ_BLOCKED
6093− | PXP2_PXP2_INT_MASK_0_REG_PGL_WRITE_BLOCKED));
6094− else
6095− REG_WR(bp, PXP2_REG_PXP2_INT_MASK_0, 0x480000);
6115+ val = PXP2_PXP2_INT_MASK_0_REG_PGL_CPL_AFT |
6116+ PXP2_PXP2_INT_MASK_0_REG_PGL_CPL_OF |
6117+ PXP2_PXP2_INT_MASK_0_REG_PGL_PCIE_ATTN;
6118+ if (!CHIP_IS_E1x(bp))
6119+ val |= PXP2_PXP2_INT_MASK_0_REG_PGL_READ_BLOCKED |
6120+ PXP2_PXP2_INT_MASK_0_REG_PGL_WRITE_BLOCKED;
6121+ REG_WR(bp, PXP2_REG_PXP2_INT_MASK_0, val);
6122+
60966123 REG_WR(bp, TSDM_REG_TSDM_INT_MASK_0, 0);
60976124 REG_WR(bp, TSDM_REG_TSDM_INT_MASK_1, 0);
60986125 REG_WR(bp, TCM_REG_TCM_INT_MASK, 0);
@@ -6185,18 +6212,16 @@ static void bnx2x_setup_fan_failure_detection(struct bnx2x *bp) · 86 unmodified lines
61856212 return;
61866213
61876214 /* Fan failure is indicated by SPIO 5 */
6188− bnx2x_set_spio(bp, MISC_REGISTERS_SPIO_5,
6189− MISC_REGISTERS_SPIO_INPUT_HI_Z);
6215+ bnx2x_set_spio(bp, MISC_SPIO_SPIO5, MISC_SPIO_INPUT_HI_Z);
61906216
61916217 /* set to active low mode */
61926218 val = REG_RD(bp, MISC_REG_SPIO_INT);
6193− val |= ((1 << MISC_REGISTERS_SPIO_5) <<
6194− MISC_REGISTERS_SPIO_INT_OLD_SET_POS);
6219+ val |= (MISC_SPIO_SPIO5 << MISC_SPIO_INT_OLD_SET_POS);
61956220 REG_WR(bp, MISC_REG_SPIO_INT, val);
61966221
61976222 /* enable interrupt to signal the IGU */
61986223 val = REG_RD(bp, MISC_REG_SPIO_EVENT_EN);
6199− val |= (1 << MISC_REGISTERS_SPIO_5);
6224+ val |= MISC_SPIO_SPIO5;
62006225 REG_WR(bp, MISC_REG_SPIO_EVENT_EN, val);
62016226 }
62026227
@@ -6256,6 +6281,10 @@ void bnx2x_pf_disable(struct bnx2x *bp) · 53 unmodified lines
62566281 static void bnx2x__common_init_phy(struct bnx2x *bp)
62576282 {
62586283 u32 shmem_base[2], shmem2_base[2];
6284+ /* Avoid common init in case MFW supports LFA */
6285+ if (SHMEM2_RD(bp, size) >
6286+ (u32)offsetof(struct shmem2_region, lfa_host_addr[BP_PORT(bp)]))
6287+ return;
62596288 shmem_base[0] = bp->common.shmem_base;
62606289 shmem2_base[0] = bp->common.shmem2_base;
62616290 if (!CHIP_IS_E1x(bp)) {
@@ -6522,9 +6551,8 @@ static int bnx2x_init_hw_common(struct bnx2x *bp) · 260 unmodified lines
65226551 REG_WR(bp, QM_REG_SOFT_RESET, 1);
65236552 REG_WR(bp, QM_REG_SOFT_RESET, 0);
65246553
6525−#ifdef BCM_CNIC
6526− bnx2x_init_block(bp, BLOCK_TM, PHASE_COMMON);
6527−#endif
6554+ if (CNIC_SUPPORT(bp))
6555+ bnx2x_init_block(bp, BLOCK_TM, PHASE_COMMON);
65286556
65296557 bnx2x_init_block(bp, BLOCK_DORQ, PHASE_COMMON);
65306558 REG_WR(bp, DORQ_REG_DPM_CID_OFST, BNX2X_DB_SHIFT);
@@ -6611,18 +6639,18 @@ static int bnx2x_init_hw_common(struct bnx2x *bp) · 80 unmodified lines
66116639
66126640 bnx2x_init_block(bp, BLOCK_SRC, PHASE_COMMON);
66136641
6614−#ifdef BCM_CNIC
6615− REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672);
6616− REG_WR(bp, SRC_REG_KEYSEARCH_1, 0x24b8f2cc);
6617− REG_WR(bp, SRC_REG_KEYSEARCH_2, 0x223aef9b);
6618− REG_WR(bp, SRC_REG_KEYSEARCH_3, 0x26001e3a);
6619− REG_WR(bp, SRC_REG_KEYSEARCH_4, 0x7ae91116);
6620− REG_WR(bp, SRC_REG_KEYSEARCH_5, 0x5ce5230b);
6621− REG_WR(bp, SRC_REG_KEYSEARCH_6, 0x298d8adf);
6622− REG_WR(bp, SRC_REG_KEYSEARCH_7, 0x6eb0ff09);
6623− REG_WR(bp, SRC_REG_KEYSEARCH_8, 0x1830f82f);
6624− REG_WR(bp, SRC_REG_KEYSEARCH_9, 0x01e46be7);
6625−#endif
6642+ if (CNIC_SUPPORT(bp)) {
6643+ REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672);
6644+ REG_WR(bp, SRC_REG_KEYSEARCH_1, 0x24b8f2cc);
6645+ REG_WR(bp, SRC_REG_KEYSEARCH_2, 0x223aef9b);
6646+ REG_WR(bp, SRC_REG_KEYSEARCH_3, 0x26001e3a);
6647+ REG_WR(bp, SRC_REG_KEYSEARCH_4, 0x7ae91116);
6648+ REG_WR(bp, SRC_REG_KEYSEARCH_5, 0x5ce5230b);
6649+ REG_WR(bp, SRC_REG_KEYSEARCH_6, 0x298d8adf);
6650+ REG_WR(bp, SRC_REG_KEYSEARCH_7, 0x6eb0ff09);
6651+ REG_WR(bp, SRC_REG_KEYSEARCH_8, 0x1830f82f);
6652+ REG_WR(bp, SRC_REG_KEYSEARCH_9, 0x01e46be7);
6653+ }
66266654 REG_WR(bp, SRC_REG_SOFT_RST, 0);
66276655
66286656 if (sizeof(union cdu_context) != 1024)
@@ -6786,11 +6814,11 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) · 157 unmodified lines
67866814 /* QM cid (connection) count */
67876815 bnx2x_qm_init_cid_count(bp, bp->qm_cid_count, INITOP_SET);
67886816
6789−#ifdef BCM_CNIC
6790− bnx2x_init_block(bp, BLOCK_TM, init_phase);
6791− REG_WR(bp, TM_REG_LIN0_SCAN_TIME + port*4, 20);
6792− REG_WR(bp, TM_REG_LIN0_MAX_ACTIVE_CID + port*4, 31);
6793−#endif
6817+ if (CNIC_SUPPORT(bp)) {
6818+ bnx2x_init_block(bp, BLOCK_TM, init_phase);
6819+ REG_WR(bp, TM_REG_LIN0_SCAN_TIME + port*4, 20);
6820+ REG_WR(bp, TM_REG_LIN0_MAX_ACTIVE_CID + port*4, 31);
6821+ }
67946822
67956823 bnx2x_init_block(bp, BLOCK_DORQ, init_phase);
67966824
@@ -6877,9 +6905,9 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) · 80 unmodified lines
68776905 REG_WR(bp, PBF_REG_INIT_P0 + port*4, 0);
68786906 }
68796907
6880−#ifdef BCM_CNIC
6881− bnx2x_init_block(bp, BLOCK_SRC, init_phase);
6882−#endif
6908+ if (CNIC_SUPPORT(bp))
6909+ bnx2x_init_block(bp, BLOCK_SRC, init_phase);
6910+
68836911 bnx2x_init_block(bp, BLOCK_CDU, init_phase);
68846912 bnx2x_init_block(bp, BLOCK_CFC, init_phase);
68856913
@@ -6955,7 +6983,7 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) · 69 unmodified lines
69556983
69566984 /* If SPIO5 is set to generate interrupts, enable it for this port */
69576985 val = REG_RD(bp, MISC_REG_SPIO_EVENT_EN);
6958− if (val & (1 << MISC_REGISTERS_SPIO_5)) {
6986+ if (val & MISC_SPIO_SPIO5) {
69596987 u32 reg_addr = (port ? MISC_REG_AEU_ENABLE1_FUNC_1_OUT_0 :
69606988 MISC_REG_AEU_ENABLE1_FUNC_0_OUT_0);
69616989 val = REG_RD(bp, reg_addr);
@@ -7040,6 +7068,130 @@ static void bnx2x_clear_func_ilt(struct bnx2x *bp, u32 func) · 78 unmodified lines
70407068 bnx2x_ilt_wr(bp, i, 0);
70417069 }
70427070
7071+
7072+static void bnx2x_init_searcher(struct bnx2x *bp)
7073+{
7074+ int port = BP_PORT(bp);
7075+ bnx2x_src_init_t2(bp, bp->t2, bp->t2_mapping, SRC_CONN_NUM);
7076+ /* T1 hash bits value determines the T1 number of entries */
7077+ REG_WR(bp, SRC_REG_NUMBER_HASH_BITS0 + port*4, SRC_HASH_BITS);
7078+}
7079+
7080+static inline int bnx2x_func_switch_update(struct bnx2x *bp, int suspend)
7081+{
7082+ int rc;
7083+ struct bnx2x_func_state_params func_params = {NULL};
7084+ struct bnx2x_func_switch_update_params *switch_update_params =
7085+ &func_params.params.switch_update;
7086+
7087+ /* Prepare parameters for function state transitions */
7088+ __set_bit(RAMROD_COMP_WAIT, &func_params.ramrod_flags);
7089+ __set_bit(RAMROD_RETRY, &func_params.ramrod_flags);
7090+
7091+ func_params.f_obj = &bp->func_obj;
7092+ func_params.cmd = BNX2X_F_CMD_SWITCH_UPDATE;
7093+
7094+ /* Function parameters */
7095+ switch_update_params->suspend = suspend;
7096+
7097+ rc = bnx2x_func_state_change(bp, &func_params);
7098+
7099+ return rc;
7100+}
7101+
7102+static int bnx2x_reset_nic_mode(struct bnx2x *bp)
7103+{
7104+ int rc, i, port = BP_PORT(bp);
7105+ int vlan_en = 0, mac_en[NUM_MACS];
7106+
7107+
7108+ /* Close input from network */
7109+ if (bp->mf_mode == SINGLE_FUNCTION) {
7110+ bnx2x_set_rx_filter(&bp->link_params, 0);
7111+ } else {
7112+ vlan_en = REG_RD(bp, port ? NIG_REG_LLH1_FUNC_EN :
7113+ NIG_REG_LLH0_FUNC_EN);
7114+ REG_WR(bp, port ? NIG_REG_LLH1_FUNC_EN :
7115+ NIG_REG_LLH0_FUNC_EN, 0);
7116+ for (i = 0; i < NUM_MACS; i++) {
7117+ mac_en[i] = REG_RD(bp, port ?
7118+ (NIG_REG_LLH1_FUNC_MEM_ENABLE +
7119+ 4 * i) :
7120+ (NIG_REG_LLH0_FUNC_MEM_ENABLE +
7121+ 4 * i));
7122+ REG_WR(bp, port ? (NIG_REG_LLH1_FUNC_MEM_ENABLE +
7123+ 4 * i) :
7124+ (NIG_REG_LLH0_FUNC_MEM_ENABLE + 4 * i), 0);
7125+ }
7126+ }
7127+
7128+ /* Close BMC to host */
7129+ REG_WR(bp, port ? NIG_REG_P0_TX_MNG_HOST_ENABLE :
7130+ NIG_REG_P1_TX_MNG_HOST_ENABLE, 0);
7131+
7132+ /* Suspend Tx switching to the PF. Completion of this ramrod
7133+ * further guarantees that all the packets of that PF / child
7134+ * VFs in BRB were processed by the Parser, so it is safe to
7135+ * change the NIC_MODE register.
7136+ */
7137+ rc = bnx2x_func_switch_update(bp, 1);
7138+ if (rc) {
7139+ BNX2X_ERR("Can't suspend tx-switching!\n");
7140+ return rc;
7141+ }
7142+
7143+ /* Change NIC_MODE register */
7144+ REG_WR(bp, PRS_REG_NIC_MODE, 0);
7145+
7146+ /* Open input from network */
7147+ if (bp->mf_mode == SINGLE_FUNCTION) {
7148+ bnx2x_set_rx_filter(&bp->link_params, 1);
7149+ } else {
7150+ REG_WR(bp, port ? NIG_REG_LLH1_FUNC_EN :
7151+ NIG_REG_LLH0_FUNC_EN, vlan_en);
7152+ for (i = 0; i < NUM_MACS; i++) {
7153+ REG_WR(bp, port ? (NIG_REG_LLH1_FUNC_MEM_ENABLE +
7154+ 4 * i) :
7155+ (NIG_REG_LLH0_FUNC_MEM_ENABLE + 4 * i),
7156+ mac_en[i]);
7157+ }
7158+ }
7159+
7160+ /* Enable BMC to host */
7161+ REG_WR(bp, port ? NIG_REG_P0_TX_MNG_HOST_ENABLE :
7162+ NIG_REG_P1_TX_MNG_HOST_ENABLE, 1);
7163+
7164+ /* Resume Tx switching to the PF */
7165+ rc = bnx2x_func_switch_update(bp, 0);
7166+ if (rc) {
7167+ BNX2X_ERR("Can't resume tx-switching!\n");
7168+ return rc;
7169+ }
7170+
7171+ DP(NETIF_MSG_IFUP, "NIC MODE disabled\n");
7172+ return 0;
7173+}
7174+
7175+int bnx2x_init_hw_func_cnic(struct bnx2x *bp)
7176+{
7177+ int rc;
7178+
7179+ bnx2x_ilt_init_op_cnic(bp, INITOP_SET);
7180+
7181+ if (CONFIGURE_NIC_MODE(bp)) {
7182+ /* Configrue searcher as part of function hw init */
7183+ bnx2x_init_searcher(bp);
7184+
7185+ /* Reset NIC mode */
7186+ rc = bnx2x_reset_nic_mode(bp);
7187+ if (rc)
7188+ BNX2X_ERR("Can't change NIC mode!\n");
7189+ return rc;
7190+ }
7191+
7192+ return 0;
7193+}
7194+
70437195 static int bnx2x_init_hw_func(struct bnx2x *bp)
70447196 {
70457197 int port = BP_PORT(bp);
@@ -7082,17 +7234,16 @@ static int bnx2x_init_hw_func(struct bnx2x *bp) · 36 unmodified lines
70827234 }
70837235 bnx2x_ilt_init_op(bp, INITOP_SET);
70847236
7085−#ifdef BCM_CNIC
7086− bnx2x_src_init_t2(bp, bp->t2, bp->t2_mapping, SRC_CONN_NUM);
7087−
7088− /* T1 hash bits value determines the T1 number of entries */
7089− REG_WR(bp, SRC_REG_NUMBER_HASH_BITS0 + port*4, SRC_HASH_BITS);
7090−#endif
7237+ if (!CONFIGURE_NIC_MODE(bp)) {
7238+ bnx2x_init_searcher(bp);
7239+ REG_WR(bp, PRS_REG_NIC_MODE, 0);
7240+ DP(NETIF_MSG_IFUP, "NIC MODE disabled\n");
7241+ } else {
7242+ /* Set NIC mode */
7243+ REG_WR(bp, PRS_REG_NIC_MODE, 1);
7244+ DP(NETIF_MSG_IFUP, "NIC MODE configrued\n");
70917245
7092−#ifndef BCM_CNIC
7093− /* set NIC mode */
7094− REG_WR(bp, PRS_REG_NIC_MODE, 1);
7095−#endif /* BCM_CNIC */
7246+ }
70967247
70977248 if (!CHIP_IS_E1x(bp)) {
70987249 u32 pf_conf = IGU_PF_CONF_FUNC_EN;
@@ -7343,6 +7494,20 @@ static int bnx2x_init_hw_func(struct bnx2x *bp) · 244 unmodified lines
73437494 }
73447495
73457496
7497+void bnx2x_free_mem_cnic(struct bnx2x *bp)
7498+{
7499+ bnx2x_ilt_mem_op_cnic(bp, ILT_MEMOP_FREE);
7500+
7501+ if (!CHIP_IS_E1x(bp))
7502+ BNX2X_PCI_FREE(bp->cnic_sb.e2_sb, bp->cnic_sb_mapping,
7503+ sizeof(struct host_hc_status_block_e2));
7504+ else
7505+ BNX2X_PCI_FREE(bp->cnic_sb.e1x_sb, bp->cnic_sb_mapping,
7506+ sizeof(struct host_hc_status_block_e1x));
7507+
7508+ BNX2X_PCI_FREE(bp->t2, bp->t2_mapping, SRC_T2_SZ);
7509+}
7510+
73467511 void bnx2x_free_mem(struct bnx2x *bp)
73477512 {
73487513 int i;
@@ -7367,17 +7532,6 @@ void bnx2x_free_mem(struct bnx2x *bp) · 18 unmodified lines
73677532
73687533 BNX2X_FREE(bp->ilt->lines);
73697534
7370−#ifdef BCM_CNIC
7371− if (!CHIP_IS_E1x(bp))
7372− BNX2X_PCI_FREE(bp->cnic_sb.e2_sb, bp->cnic_sb_mapping,
7373− sizeof(struct host_hc_status_block_e2));
7374− else
7375− BNX2X_PCI_FREE(bp->cnic_sb.e1x_sb, bp->cnic_sb_mapping,
7376− sizeof(struct host_hc_status_block_e1x));
7377−
7378− BNX2X_PCI_FREE(bp->t2, bp->t2_mapping, SRC_T2_SZ);
7379−#endif
7380−
73817535 BNX2X_PCI_FREE(bp->spq, bp->spq_mapping, BCM_PAGE_SIZE);
73827536
73837537 BNX2X_PCI_FREE(bp->eq_ring, bp->eq_mapping,
@@ -7445,24 +7599,44 @@ alloc_mem_err: · 61 unmodified lines
74457599 return -ENOMEM;
74467600 }
74477601
7448−
7449−int bnx2x_alloc_mem(struct bnx2x *bp)
7602+int bnx2x_alloc_mem_cnic(struct bnx2x *bp)
74507603 {
7451− int i, allocated, context_size;
7452−
7453−#ifdef BCM_CNIC
74547604 if (!CHIP_IS_E1x(bp))
74557605 /* size = the status block + ramrod buffers */
74567606 BNX2X_PCI_ALLOC(bp->cnic_sb.e2_sb, &bp->cnic_sb_mapping,
74577607 sizeof(struct host_hc_status_block_e2));
74587608 else
7459− BNX2X_PCI_ALLOC(bp->cnic_sb.e1x_sb, &bp->cnic_sb_mapping,
7460− sizeof(struct host_hc_status_block_e1x));
7609+ BNX2X_PCI_ALLOC(bp->cnic_sb.e1x_sb,
7610+ &bp->cnic_sb_mapping,
7611+ sizeof(struct
7612+ host_hc_status_block_e1x));
74617613
7462− /* allocate searcher T2 table */
7463− BNX2X_PCI_ALLOC(bp->t2, &bp->t2_mapping, SRC_T2_SZ);
7464−#endif
7614+ if (CONFIGURE_NIC_MODE(bp))
7615+ /* allocate searcher T2 table, as it wan't allocated before */
7616+ BNX2X_PCI_ALLOC(bp->t2, &bp->t2_mapping, SRC_T2_SZ);
7617+
7618+ /* write address to which L5 should insert its values */
7619+ bp->cnic_eth_dev.addr_drv_info_to_mcp =
7620+ &bp->slowpath->drv_info_to_mcp;
74657621
7622+ if (bnx2x_ilt_mem_op_cnic(bp, ILT_MEMOP_ALLOC))
7623+ goto alloc_mem_err;
7624+
7625+ return 0;
7626+
7627+alloc_mem_err:
7628+ bnx2x_free_mem_cnic(bp);
7629+ BNX2X_ERR("Can't allocate memory\n");
7630+ return -ENOMEM;
7631+}
7632+
7633+int bnx2x_alloc_mem(struct bnx2x *bp)
7634+{
7635+ int i, allocated, context_size;
7636+
7637+ if (!CONFIGURE_NIC_MODE(bp))
7638+ /* allocate searcher T2 table */
7639+ BNX2X_PCI_ALLOC(bp->t2, &bp->t2_mapping, SRC_T2_SZ);
74667640
74677641 BNX2X_PCI_ALLOC(bp->def_status_blk, &bp->def_status_blk_mapping,
74687642 sizeof(struct host_sp_status_block));
@@ -7470,11 +7644,6 @@ int bnx2x_alloc_mem(struct bnx2x *bp) · 1 unmodified line
74707644 BNX2X_PCI_ALLOC(bp->slowpath, &bp->slowpath_mapping,
74717645 sizeof(struct bnx2x_slowpath));
74727646
7473−#ifdef BCM_CNIC
7474− /* write address to which L5 should insert its values */
7475− bp->cnic_eth_dev.addr_drv_info_to_mcp = &bp->slowpath->drv_info_to_mcp;
7476−#endif
7477−
74787647 /* Allocated memory for FW statistics */
74797648 if (bnx2x_alloc_fw_stats_mem(bp))
74807649 goto alloc_mem_err;
@@ -7596,14 +7765,12 @@ int bnx2x_set_eth_mac(struct bnx2x *bp, bool set) · 115 unmodified lines
75967765 {
75977766 unsigned long ramrod_flags = 0;
75987767
7599−#ifdef BCM_CNIC
76007768 if (is_zero_ether_addr(bp->dev->dev_addr) &&
76017769 (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))) {
76027770 DP(NETIF_MSG_IFUP | NETIF_MSG_IFDOWN,
76037771 "Ignoring Zero MAC for STORAGE SD mode\n");
76047772 return 0;
76057773 }
7606−#endif
76077774
76087775 DP(NETIF_MSG_IFUP, "Adding Eth MAC\n");
76097776
@@ -7632,7 +7799,8 @@ void bnx2x_set_int_mode(struct bnx2x *bp) · 22 unmodified lines
76327799 bnx2x_enable_msi(bp);
76337800 /* falling through... */
76347801 case INT_MODE_INTx:
7635− bp->num_queues = 1 + NON_ETH_CONTEXT_USE;
7802+ bp->num_ethernet_queues = 1;
7803+ bp->num_queues = bp->num_ethernet_queues + bp->num_cnic_queues;
76367804 BNX2X_DEV_INFO("set number of queues to 1\n");
76377805 break;
76387806 default:
@@ -7644,9 +7812,10 @@ void bnx2x_set_int_mode(struct bnx2x *bp) · 5 unmodified lines
76447812 bp->flags & USING_SINGLE_MSIX_FLAG) {
76457813 /* failed to enable multiple MSI-X */
76467814 BNX2X_DEV_INFO("Failed to enable multiple MSI-X (%d), set number of queues to %d\n",
7647− bp->num_queues, 1 + NON_ETH_CONTEXT_USE);
7815+ bp->num_queues,
7816+ 1 + bp->num_cnic_queues);
76487817
7649− bp->num_queues = 1 + NON_ETH_CONTEXT_USE;
7818+ bp->num_queues = 1 + bp->num_cnic_queues;
76507819
76517820 /* Try to enable MSI */
76527821 if (!(bp->flags & USING_SINGLE_MSIX_FLAG) &&
@@ -7679,9 +7848,9 @@ void bnx2x_ilt_set_info(struct bnx2x *bp) · 26 unmodified lines
76797848 ilt_client->flags = ILT_CLIENT_SKIP_MEM;
76807849 ilt_client->start = line;
76817850 line += bnx2x_cid_ilt_lines(bp);
7682−#ifdef BCM_CNIC
7683− line += CNIC_ILT_LINES;
7684−#endif
7851+
7852+ if (CNIC_SUPPORT(bp))
7853+ line += CNIC_ILT_LINES;
76857854 ilt_client->end = line - 1;
76867855
76877856 DP(NETIF_MSG_IFUP, "ilt client[CDU]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n",
@@ -7714,49 +7883,43 @@ void bnx2x_ilt_set_info(struct bnx2x *bp) · 26 unmodified lines
77147883 ilog2(ilt_client->page_size >> 12));
77157884
77167885 }
7717− /* SRC */
7718− ilt_client = &ilt->clients[ILT_CLIENT_SRC];
7719−#ifdef BCM_CNIC
7720− ilt_client->client_num = ILT_CLIENT_SRC;
7721− ilt_client->page_size = SRC_ILT_PAGE_SZ;
7722− ilt_client->flags = 0;
7723− ilt_client->start = line;
7724− line += SRC_ILT_LINES;
7725− ilt_client->end = line - 1;
77267886
7727− DP(NETIF_MSG_IFUP,
7728− "ilt client[SRC]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n",
7729− ilt_client->start,
7730− ilt_client->end,
7731− ilt_client->page_size,
7732− ilt_client->flags,
7733− ilog2(ilt_client->page_size >> 12));
7887+ if (CNIC_SUPPORT(bp)) {
7888+ /* SRC */
7889+ ilt_client = &ilt->clients[ILT_CLIENT_SRC];
7890+ ilt_client->client_num = ILT_CLIENT_SRC;
7891+ ilt_client->page_size = SRC_ILT_PAGE_SZ;
7892+ ilt_client->flags = 0;
7893+ ilt_client->start = line;
7894+ line += SRC_ILT_LINES;
7895+ ilt_client->end = line - 1;
77347896
7735−#else
7736− ilt_client->flags = (ILT_CLIENT_SKIP_INIT | ILT_CLIENT_SKIP_MEM);
7737−#endif
7897+ DP(NETIF_MSG_IFUP,
7898+ "ilt client[SRC]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n",
7899+ ilt_client->start,
7900+ ilt_client->end,
7901+ ilt_client->page_size,
7902+ ilt_client->flags,
7903+ ilog2(ilt_client->page_size >> 12));
77387904
7739− /* TM */
7740− ilt_client = &ilt->clients[ILT_CLIENT_TM];
7741−#ifdef BCM_CNIC
7742− ilt_client->client_num = ILT_CLIENT_TM;
7743− ilt_client->page_size = TM_ILT_PAGE_SZ;
7744− ilt_client->flags = 0;
7745− ilt_client->start = line;
7746− line += TM_ILT_LINES;
7747− ilt_client->end = line - 1;
7905+ /* TM */
7906+ ilt_client = &ilt->clients[ILT_CLIENT_TM];
7907+ ilt_client->client_num = ILT_CLIENT_TM;
7908+ ilt_client->page_size = TM_ILT_PAGE_SZ;
7909+ ilt_client->flags = 0;
7910+ ilt_client->start = line;
7911+ line += TM_ILT_LINES;
7912+ ilt_client->end = line - 1;
77487913
7749− DP(NETIF_MSG_IFUP,
7750− "ilt client[TM]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n",
7751− ilt_client->start,
7752− ilt_client->end,
7753− ilt_client->page_size,
7754− ilt_client->flags,
7755− ilog2(ilt_client->page_size >> 12));
7914+ DP(NETIF_MSG_IFUP,
7915+ "ilt client[TM]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n",
7916+ ilt_client->start,
7917+ ilt_client->end,
7918+ ilt_client->page_size,
7919+ ilt_client->flags,
7920+ ilog2(ilt_client->page_size >> 12));
7921+ }
77567922
7757−#else
7758− ilt_client->flags = (ILT_CLIENT_SKIP_INIT | ILT_CLIENT_SKIP_MEM);
7759−#endif
77607923 BUG_ON(line > ILT_MAX_LINES);
77617924 }
77627925
@@ -7823,7 +7986,7 @@ static void bnx2x_pf_q_prep_init(struct bnx2x *bp, · 60 unmodified lines
78237986 }
78247987 }
78257988
7826−int bnx2x_setup_tx_only(struct bnx2x *bp, struct bnx2x_fastpath *fp,
7989+static int bnx2x_setup_tx_only(struct bnx2x *bp, struct bnx2x_fastpath *fp,
78277990 struct bnx2x_queue_state_params *q_params,
78287991 struct bnx2x_queue_setup_tx_only_params *tx_only_params,
78297992 int tx_index, bool leading)
@@ -7924,6 +8087,9 @@ int bnx2x_setup_queue(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 94 unmodified lines
79248087 /* Set the command */
79258088 q_params.cmd = BNX2X_Q_CMD_SETUP;
79268089
8090+ if (IS_FCOE_FP(fp))
8091+ bp->fcoe_init = true;
8092+
79278093 /* Change the state to SETUP */
79288094 rc = bnx2x_queue_state_change(bp, &q_params);
79298095 if (rc) {
@@ -8037,12 +8203,12 @@ static void bnx2x_reset_func(struct bnx2x *bp) · 107 unmodified lines
80378203 SB_DISABLED);
80388204 }
80398205
8040−#ifdef BCM_CNIC
8041− /* CNIC SB */
8042− REG_WR8(bp, BAR_CSTRORM_INTMEM +
8043− CSTORM_STATUS_BLOCK_DATA_STATE_OFFSET(bnx2x_cnic_fw_sb_id(bp)),
8044− SB_DISABLED);
8045−#endif
8206+ if (CNIC_LOADED(bp))
8207+ /* CNIC SB */
8208+ REG_WR8(bp, BAR_CSTRORM_INTMEM +
8209+ CSTORM_STATUS_BLOCK_DATA_STATE_OFFSET
8210+ (bnx2x_cnic_fw_sb_id(bp)), SB_DISABLED);
8211+
80468212 /* SP SB */
80478213 REG_WR8(bp, BAR_CSTRORM_INTMEM +
80488214 CSTORM_SP_STATUS_BLOCK_DATA_STATE_OFFSET(func),
@@ -8061,19 +8227,19 @@ static void bnx2x_reset_func(struct bnx2x *bp) · 12 unmodified lines
80618227 REG_WR(bp, IGU_REG_TRAILING_EDGE_LATCH, 0);
80628228 }
80638229
8064−#ifdef BCM_CNIC
8065− /* Disable Timer scan */
8066− REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 0);
8067− /*
8068− * Wait for at least 10ms and up to 2 second for the timers scan to
8069− * complete
8070− */
8071− for (i = 0; i < 200; i++) {
8072− msleep(10);
8073− if (!REG_RD(bp, TM_REG_LIN0_SCAN_ON + port*4))
8074− break;
8230+ if (CNIC_LOADED(bp)) {
8231+ /* Disable Timer scan */
8232+ REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 0);
8233+ /*
8234+ * Wait for at least 10ms and up to 2 second for the timers
8235+ * scan to complete
8236+ */
8237+ for (i = 0; i < 200; i++) {
8238+ msleep(10);
8239+ if (!REG_RD(bp, TM_REG_LIN0_SCAN_ON + port*4))
8240+ break;
8241+ }
80758242 }
8076−#endif
80778243 /* Clear ILT */
80788244 bnx2x_clear_func_ilt(bp, func);
80798245
@@ -8409,13 +8575,24 @@ void bnx2x_chip_cleanup(struct bnx2x *bp, int unload_mode, bool keep_link) · 329 unmodified lines
84098575 /* Close multi and leading connections
84108576 * Completions for ramrods are collected in a synchronous way
84118577 */
8412− for_each_queue(bp, i)
8578+ for_each_eth_queue(bp, i)
84138579 if (bnx2x_stop_queue(bp, i))
84148580 #ifdef BNX2X_STOP_ON_ERROR
84158581 return;
84168582 #else
84178583 goto unload_error;
84188584 #endif
8585+
8586+ if (CNIC_LOADED(bp)) {
8587+ for_each_cnic_queue(bp, i)
8588+ if (bnx2x_stop_queue(bp, i))
8589+#ifdef BNX2X_STOP_ON_ERROR
8590+ return;
8591+#else
8592+ goto unload_error;
8593+#endif
8594+ }
8595+
84198596 /* If SP settings didn't get completed so far - something
84208597 * very wrong has happen.
84218598 */
@@ -8437,6 +8614,8 @@ unload_error: · 15 unmodified lines
84378614 bnx2x_netif_stop(bp, 1);
84388615 /* Delete all NAPI objects */
84398616 bnx2x_del_all_napi(bp);
8617+ if (CNIC_LOADED(bp))
8618+ bnx2x_del_all_napi_cnic(bp);
84408619
84418620 /* Release IRQs */
84428621 bnx2x_free_irq(bp);
@@ -8558,7 +8737,8 @@ static void bnx2x_reset_mcp_prep(struct bnx2x *bp, u32 *magic_val) · 115 unmodified lines
85588737
85598738 /* Get shmem offset */
85608739 shmem = REG_RD(bp, MISC_REG_SHARED_MEM_ADDR);
8561− validity_offset = offsetof(struct shmem_region, validity_map[0]);
8740+ validity_offset =
8741+ offsetof(struct shmem_region, validity_map[BP_PORT(bp)]);
85628742
85638743 /* Clear validity map flags */
85648744 if (shmem > 0)
@@ -8651,7 +8831,11 @@ static void bnx2x_process_kill_chip_reset(struct bnx2x *bp, bool global) · 86 unmodified lines
86518831 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_RESET_CMN_CPU |
86528832 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_RESET_CMN_CORE;
86538833
8654− /* Don't reset the following blocks */
8834+ /* Don't reset the following blocks.
8835+ * Important: per port blocks (such as EMAC, BMAC, UMAC) can't be
8836+ * reset, as in 4 port device they might still be owned
8837+ * by the MCP (there is only one leader per path).
8838+ */
86558839 not_reset_mask1 =
86568840 MISC_REGISTERS_RESET_REG_1_RST_HC |
86578841 MISC_REGISTERS_RESET_REG_1_RST_PXPV |
@@ -8667,19 +8851,19 @@ static void bnx2x_process_kill_chip_reset(struct bnx2x *bp, bool global) · 9 unmodified lines
86678851 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_RESET_REG_HARD_CORE |
86688852 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_HARD_CORE_RST_B |
86698853 MISC_REGISTERS_RESET_REG_2_RST_ATC |
8670− MISC_REGISTERS_RESET_REG_2_PGLC;
8854+ MISC_REGISTERS_RESET_REG_2_PGLC |
8855+ MISC_REGISTERS_RESET_REG_2_RST_BMAC0 |
8856+ MISC_REGISTERS_RESET_REG_2_RST_BMAC1 |
8857+ MISC_REGISTERS_RESET_REG_2_RST_EMAC0 |
8858+ MISC_REGISTERS_RESET_REG_2_RST_EMAC1 |
8859+ MISC_REGISTERS_RESET_REG_2_UMAC0 |
8860+ MISC_REGISTERS_RESET_REG_2_UMAC1;
86718861
86728862 /*
86738863 * Keep the following blocks in reset:
86748864 * - all xxMACs are handled by the bnx2x_link code.
86758865 */
86768866 stay_reset2 =
8677− MISC_REGISTERS_RESET_REG_2_RST_BMAC0 |
8678− MISC_REGISTERS_RESET_REG_2_RST_BMAC1 |
8679− MISC_REGISTERS_RESET_REG_2_RST_EMAC0 |
8680− MISC_REGISTERS_RESET_REG_2_RST_EMAC1 |
8681− MISC_REGISTERS_RESET_REG_2_UMAC0 |
8682− MISC_REGISTERS_RESET_REG_2_UMAC1 |
86838867 MISC_REGISTERS_RESET_REG_2_XMAC |
86848868 MISC_REGISTERS_RESET_REG_2_XMAC_SOFT;
86858869
@@ -8769,6 +8953,7 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global) · 83 unmodified lines
87698953 int cnt = 1000;
87708954 u32 val = 0;
87718955 u32 sr_cnt, blk_cnt, port_is_idle_0, port_is_idle_1, pgl_exp_rom2;
8956+ u32 tags_63_32 = 0;
87728957
87738958
87748959 /* Empty the Tetris buffer, wait for 1s */
@@ -8778,10 +8963,14 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global) · 3 unmodified lines
87788963 port_is_idle_0 = REG_RD(bp, PXP2_REG_RD_PORT_IS_IDLE_0);
87798964 port_is_idle_1 = REG_RD(bp, PXP2_REG_RD_PORT_IS_IDLE_1);
87808965 pgl_exp_rom2 = REG_RD(bp, PXP2_REG_PGL_EXP_ROM2);
8966+ if (CHIP_IS_E3(bp))
8967+ tags_63_32 = REG_RD(bp, PGLUE_B_REG_TAGS_63_32);
8968+
87818969 if ((sr_cnt == 0x7e) && (blk_cnt == 0xa0) &&
87828970 ((port_is_idle_0 & 0x1) == 0x1) &&
87838971 ((port_is_idle_1 & 0x1) == 0x1) &&
8784− (pgl_exp_rom2 == 0xffffffff))
8972+ (pgl_exp_rom2 == 0xffffffff) &&
8973+ (!CHIP_IS_E3(bp) || (tags_63_32 == 0xffffffff)))
87858974 break;
87868975 usleep_range(1000, 1000);
87878976 } while (cnt-- > 0);
@@ -8838,9 +9027,6 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global) · 50 unmodified lines
88389027
88399028 /* TBD: Add resetting the NO_MCP mode DB here */
88409029
8841− /* PXP */
8842− bnx2x_pxp_prep(bp);
8843−
88449030 /* Open the gates #2, #3 and #4 */
88459031 bnx2x_set_234_gates(bp, false);
88469032
@@ -8850,7 +9036,7 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global) · 3 unmodified lines
88509036 return 0;
88519037 }
88529038
8853−int bnx2x_leader_reset(struct bnx2x *bp)
9039+static int bnx2x_leader_reset(struct bnx2x *bp)
88549040 {
88559041 int rc = 0;
88569042 bool global = bnx2x_reset_is_global(bp);
@@ -9234,7 +9420,7 @@ static inline void bnx2x_undi_int_disable(struct bnx2x *bp) · 377 unmodified lines
92349420 bnx2x_undi_int_disable_e1h(bp);
92359421 }
92369422
9237−static void __devinit bnx2x_prev_unload_close_mac(struct bnx2x *bp)
9423+static void bnx2x_prev_unload_close_mac(struct bnx2x *bp)
92389424 {
92399425 u32 val, base_addr, offset, mask, reset_reg;
92409426 bool mac_stopped = false;
@@ -9301,8 +9487,7 @@ static void __devinit bnx2x_prev_unload_close_mac(struct bnx2x *bp) · 60 unmodified lines
93019487 #define BNX2X_PREV_UNDI_BD(val) ((val) >> 16 & 0xffff)
93029488 #define BNX2X_PREV_UNDI_PROD(rcq, bd) ((bd) << 16 | (rcq))
93039489
9304−static void __devinit bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 port,
9305− u8 inc)
9490+static void bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 port, u8 inc)
93069491 {
93079492 u16 rcq, bd;
93089493 u32 tmp_reg = REG_RD(bp, BNX2X_PREV_UNDI_PROD_ADDR(port));
@@ -9317,7 +9502,7 @@ static void __devinit bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 port, · 8 unmodified lines
93179502 port, bd, rcq);
93189503 }
93199504
9320−static int __devinit bnx2x_prev_mcp_done(struct bnx2x *bp)
9505+static int bnx2x_prev_mcp_done(struct bnx2x *bp)
93219506 {
93229507 u32 rc = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE,
93239508 DRV_MSG_CODE_UNLOAD_SKIP_LINK_RESET);
@@ -9329,7 +9514,21 @@ static int __devinit bnx2x_prev_mcp_done(struct bnx2x *bp) · 5 unmodified lines
93299514 return 0;
93309515 }
93319516
9332−static bool __devinit bnx2x_prev_is_path_marked(struct bnx2x *bp)
9517+static struct bnx2x_prev_path_list *
9518+ bnx2x_prev_path_get_entry(struct bnx2x *bp)
9519+{
9520+ struct bnx2x_prev_path_list *tmp_list;
9521+
9522+ list_for_each_entry(tmp_list, &bnx2x_prev_list, list)
9523+ if (PCI_SLOT(bp->pdev->devfn) == tmp_list->slot &&
9524+ bp->pdev->bus->number == tmp_list->bus &&
9525+ BP_PATH(bp) == tmp_list->path)
9526+ return tmp_list;
9527+
9528+ return NULL;
9529+}
9530+
9531+static bool bnx2x_prev_is_path_marked(struct bnx2x *bp)
93339532 {
93349533 struct bnx2x_prev_path_list *tmp_list;
93359534 int rc = false;
@@ -9353,7 +9552,7 @@ static bool __devinit bnx2x_prev_is_path_marked(struct bnx2x *bp) · 17 unmodified lines
93539552 return rc;
93549553 }
93559554
9356−static int __devinit bnx2x_prev_mark_path(struct bnx2x *bp)
9555+static int bnx2x_prev_mark_path(struct bnx2x *bp, bool after_undi)
93579556 {
93589557 struct bnx2x_prev_path_list *tmp_list;
93599558 int rc;
@@ -9367,6 +9566,7 @@ static int __devinit bnx2x_prev_mark_path(struct bnx2x *bp) · 7 unmodified lines
93679566 tmp_list->bus = bp->pdev->bus->number;
93689567 tmp_list->slot = PCI_SLOT(bp->pdev->devfn);
93699568 tmp_list->path = BP_PATH(bp);
9569+ tmp_list->undi = after_undi ? (1 << BP_PORT(bp)) : 0;
93709570
93719571 rc = down_interruptible(&bnx2x_prev_sem);
93729572 if (rc) {
@@ -9382,7 +9582,7 @@ static int __devinit bnx2x_prev_mark_path(struct bnx2x *bp) · 9 unmodified lines
93829582 return rc;
93839583 }
93849584
9385−static int __devinit bnx2x_do_flr(struct bnx2x *bp)
9585+static int bnx2x_do_flr(struct bnx2x *bp)
93869586 {
93879587 int i;
93889588 u16 status;
@@ -9422,7 +9622,7 @@ clear: · 33 unmodified lines
94229622 return 0;
94239623 }
94249624
9425−static int __devinit bnx2x_prev_unload_uncommon(struct bnx2x *bp)
9625+static int bnx2x_prev_unload_uncommon(struct bnx2x *bp)
94269626 {
94279627 int rc;
94289628
@@ -9460,9 +9660,10 @@ static int __devinit bnx2x_prev_unload_uncommon(struct bnx2x *bp) · 31 unmodified lines
94609660 return rc;
94619661 }
94629662
9463−static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp)
9663+static int bnx2x_prev_unload_common(struct bnx2x *bp)
94649664 {
94659665 u32 reset_reg, tmp_reg = 0, rc;
9666+ bool prev_undi = false;
94669667 /* It is possible a previous function received 'common' answer,
94679668 * but hasn't loaded yet, therefore creating a scenario of
94689669 * multiple functions receiving 'common' on the same path.
@@ -9477,7 +9678,6 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp) · 8 unmodified lines
94779678 /* Reset should be performed after BRB is emptied */
94789679 if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_BRB1) {
94799680 u32 timer_count = 1000;
9480− bool prev_undi = false;
94819681
94829682 /* Close the MAC Rx to prevent BRB from filling up */
94839683 bnx2x_prev_unload_close_mac(bp);
@@ -9527,7 +9727,7 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp) · 43 unmodified lines
95279727 /* No packets are in the pipeline, path is ready for reset */
95289728 bnx2x_reset_common(bp);
95299729
9530− rc = bnx2x_prev_mark_path(bp);
9730+ rc = bnx2x_prev_mark_path(bp, prev_undi);
95319731 if (rc) {
95329732 bnx2x_prev_mcp_done(bp);
95339733 return rc;
@@ -9543,7 +9743,7 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp) · 9 unmodified lines
95439743 * to clear the interrupt which detected this from the pglueb and the was done
95449744 * bit
95459745 */
9546−static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp)
9746+static void bnx2x_prev_interrupted_dmae(struct bnx2x *bp)
95479747 {
95489748 if (!CHIP_IS_E1x(bp)) {
95499749 u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS);
@@ -9555,10 +9755,11 @@ static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp) · 5 unmodified lines
95559755 }
95569756 }
95579757
9558−static int __devinit bnx2x_prev_unload(struct bnx2x *bp)
9758+static int bnx2x_prev_unload(struct bnx2x *bp)
95599759 {
95609760 int time_counter = 10;
95619761 u32 rc, fw, hw_lock_reg, hw_lock_val;
9762+ struct bnx2x_prev_path_list *prev_list;
95629763 BNX2X_DEV_INFO("Entering Previous Unload Flow\n");
95639764
95649765 /* clear hw from errors which may have resulted from an interrupted
@@ -9617,12 +9818,18 @@ static int __devinit bnx2x_prev_unload(struct bnx2x *bp) · 52 unmodified lines
96179818 rc = -EBUSY;
96189819 }
96199820
9821+ /* Mark function if its port was used to boot from SAN */
9822+ prev_list = bnx2x_prev_path_get_entry(bp);
9823+ if (prev_list && (prev_list->undi & (1 << BP_PORT(bp))))
9824+ bp->link_params.feature_config_flags |=
9825+ FEATURE_CONFIG_BOOT_FROM_SAN;
9826+
96209827 BNX2X_DEV_INFO("Finished Previous Unload Flow [%d]\n", rc);
96219828
96229829 return rc;
96239830 }
96249831
9625−static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp)
9832+static void bnx2x_get_common_hwinfo(struct bnx2x *bp)
96269833 {
96279834 u32 val, val2, val3, val4, id, boot_mode;
96289835 u16 pmc;
@@ -9701,6 +9908,14 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) · 72 unmodified lines
97019908
97029909 bp->link_params.shmem_base = bp->common.shmem_base;
97039910 bp->link_params.shmem2_base = bp->common.shmem2_base;
9911+ if (SHMEM2_RD(bp, size) >
9912+ (u32)offsetof(struct shmem2_region, lfa_host_addr[BP_PORT(bp)]))
9913+ bp->link_params.lfa_base =
9914+ REG_RD(bp, bp->common.shmem2_base +
9915+ (u32)offsetof(struct shmem2_region,
9916+ lfa_host_addr[BP_PORT(bp)]));
9917+ else
9918+ bp->link_params.lfa_base = 0;
97049919 BNX2X_DEV_INFO("shmem offset 0x%x shmem2 offset 0x%x\n",
97059920 bp->common.shmem_base, bp->common.shmem2_base);
97069921
@@ -9748,6 +9963,11 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) · 41 unmodified lines
97489963 bp->link_params.feature_config_flags |=
97499964 (val >= REQ_BC_VER_4_SFP_TX_DISABLE_SUPPORTED) ?
97509965 FEATURE_CONFIG_BC_SUPPORTS_SFP_TX_DISABLED : 0;
9966+
9967+ bp->link_params.feature_config_flags |=
9968+ (val >= REQ_BC_VER_4_MT_SUPPORTED) ?
9969+ FEATURE_CONFIG_MT_SUPPORT : 0;
9970+
97519971 bp->flags |= (val >= REQ_BC_VER_4_PFC_STATS_SUPPORTED) ?
97529972 BC_SUPPORTS_PFC_STATS : 0;
97539973
@@ -9792,7 +10012,7 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) · 38 unmodified lines
979210012 #define IGU_FID(val) GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID)
979310013 #define IGU_VEC(val) GET_FIELD((val), IGU_REG_MAPPING_MEMORY_VECTOR)
979410014
9795−static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp)
10015+static int bnx2x_get_igu_cam_info(struct bnx2x *bp)
979610016 {
979710017 int pfid = BP_FUNC(bp);
979810018 int igu_sb_id;
@@ -9809,7 +10029,7 @@ static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp) · 10 unmodified lines
980910029 bp->igu_dsb_id = E1HVN_MAX * FP_SB_MAX_E1x +
981010030 (CHIP_MODE_IS_4_PORT(bp) ? pfid : vn);
981110031
9812− return;
10032+ return 0;
981310033 }
981410034
981510035 /* IGU in normal mode - read CAM */
@@ -9843,12 +10063,15 @@ static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp) · 27 unmodified lines
984310063 bp->igu_sb_cnt = min_t(int, bp->igu_sb_cnt, igu_sb_cnt);
984410064 #endif
984510065
9846− if (igu_sb_cnt == 0)
10066+ if (igu_sb_cnt == 0) {
984710067 BNX2X_ERR("CAM configuration error\n");
10068+ return -EINVAL;
10069+ }
10070+
10071+ return 0;
984810072 }
984910073
9850−static void __devinit bnx2x_link_settings_supported(struct bnx2x *bp,
9851− u32 switch_cfg)
10074+static void bnx2x_link_settings_supported(struct bnx2x *bp, u32 switch_cfg)
985210075 {
985310076 int cfg_size = 0, idx, port = BP_PORT(bp);
985410077
@@ -9946,7 +10169,7 @@ static void __devinit bnx2x_link_settings_supported(struct bnx2x *bp, · 91 unmodified lines
994610169 bp->port.supported[1]);
994710170 }
994810171
9949−static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp)
10172+static void bnx2x_link_settings_requested(struct bnx2x *bp)
995010173 {
995110174 u32 link_config, idx, cfg_size = 0;
995210175 bp->port.advertising[0] = 0;
@@ -10115,11 +10338,13 @@ static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp) · 162 unmodified lines
1011510338
1011610339 bp->link_params.req_flow_ctrl[idx] = (link_config &
1011710340 PORT_FEATURE_FLOW_CONTROL_MASK);
10118− if ((bp->link_params.req_flow_ctrl[idx] ==
10119− BNX2X_FLOW_CTRL_AUTO) &&
10120− !(bp->port.supported[idx] & SUPPORTED_Autoneg)) {
10121− bp->link_params.req_flow_ctrl[idx] =
10122− BNX2X_FLOW_CTRL_NONE;
10341+ if (bp->link_params.req_flow_ctrl[idx] ==
10342+ BNX2X_FLOW_CTRL_AUTO) {
10343+ if (!(bp->port.supported[idx] & SUPPORTED_Autoneg))
10344+ bp->link_params.req_flow_ctrl[idx] =
10345+ BNX2X_FLOW_CTRL_NONE;
10346+ else
10347+ bnx2x_set_requested_fc(bp);
1012310348 }
1012410349
1012510350 BNX2X_DEV_INFO("req_line_speed %d req_duplex %d req_flow_ctrl 0x%x advertising 0x%x\n",
@@ -10130,7 +10355,7 @@ static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp) · 4 unmodified lines
1013010355 }
1013110356 }
1013210357
10133−static void __devinit bnx2x_set_mac_buf(u8 *mac_buf, u32 mac_lo, u16 mac_hi)
10358+static void bnx2x_set_mac_buf(u8 *mac_buf, u32 mac_lo, u16 mac_hi)
1013410359 {
1013510360 mac_hi = cpu_to_be16(mac_hi);
1013610361 mac_lo = cpu_to_be32(mac_lo);
@@ -10138,7 +10363,7 @@ static void __devinit bnx2x_set_mac_buf(u8 *mac_buf, u32 mac_lo, u16 mac_hi) · 1 unmodified line
1013810363 memcpy(mac_buf + sizeof(mac_hi), &mac_lo, sizeof(mac_lo));
1013910364 }
1014010365
10141−static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp)
10366+static void bnx2x_get_port_hwinfo(struct bnx2x *bp)
1014210367 {
1014310368 int port = BP_PORT(bp);
1014410369 u32 config;
@@ -10199,17 +10424,6 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) · 54 unmodified lines
1019910424 bp->mdio.prtad =
1020010425 XGXS_EXT_PHY_ADDR(ext_phy_config);
1020110426
10202− /*
10203− * Check if hw lock is required to access MDC/MDIO bus to the PHY(s)
10204− * In MF mode, it is set to cover self test cases
10205− */
10206− if (IS_MF(bp))
10207− bp->port.need_hw_lock = 1;
10208− else
10209− bp->port.need_hw_lock = bnx2x_hw_lock_required(bp,
10210− bp->common.shmem_base,
10211− bp->common.shmem2_base);
10212−
1021310427 /* Configure link feature according to nvram value */
1021410428 eee_mode = (((SHMEM_RD(bp, dev_info.
1021510429 port_feature_config[port].eee_power_mode)) &
@@ -10227,12 +10441,15 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) · 11 unmodified lines
1022710441 void bnx2x_get_iscsi_info(struct bnx2x *bp)
1022810442 {
1022910443 u32 no_flags = NO_ISCSI_FLAG;
10230−#ifdef BCM_CNIC
1023110444 int port = BP_PORT(bp);
10232−
1023310445 u32 max_iscsi_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp,
1023410446 drv_lic_key[port].max_iscsi_conn);
1023510447
10448+ if (!CNIC_SUPPORT(bp)) {
10449+ bp->flags |= no_flags;
10450+ return;
10451+ }
10452+
1023610453 /* Get the number of maximum allowed iSCSI connections */
1023710454 bp->cnic_eth_dev.max_iscsi_conn =
1023810455 (max_iscsi_conn & BNX2X_MAX_ISCSI_INIT_CONN_MASK) >>
@@ -10247,13 +10464,10 @@ void bnx2x_get_iscsi_info(struct bnx2x *bp) · 8 unmodified lines
1024710464 */
1024810465 if (!bp->cnic_eth_dev.max_iscsi_conn)
1024910466 bp->flags |= no_flags;
10250−#else
10251− bp->flags |= no_flags;
10252−#endif
10467+
1025310468 }
1025410469
10255−#ifdef BCM_CNIC
10256−static void __devinit bnx2x_get_ext_wwn_info(struct bnx2x *bp, int func)
10470+static void bnx2x_get_ext_wwn_info(struct bnx2x *bp, int func)
1025710471 {
1025810472 /* Port info */
1025910473 bp->cnic_eth_dev.fcoe_wwn_port_name_hi =
@@ -10267,16 +10481,18 @@ static void __devinit bnx2x_get_ext_wwn_info(struct bnx2x *bp, int func) · 7 unmodified lines
1026710481 bp->cnic_eth_dev.fcoe_wwn_node_name_lo =
1026810482 MF_CFG_RD(bp, func_ext_config[func].fcoe_wwn_node_name_lower);
1026910483 }
10270−#endif
10271−static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp)
10484+static void bnx2x_get_fcoe_info(struct bnx2x *bp)
1027210485 {
10273−#ifdef BCM_CNIC
1027410486 int port = BP_PORT(bp);
1027510487 int func = BP_ABS_FUNC(bp);
10276−
1027710488 u32 max_fcoe_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp,
1027810489 drv_lic_key[port].max_fcoe_conn);
1027910490
10491+ if (!CNIC_SUPPORT(bp)) {
10492+ bp->flags |= NO_FCOE_FLAG;
10493+ return;
10494+ }
10495+
1028010496 /* Get the number of maximum allowed FCoE connections */
1028110497 bp->cnic_eth_dev.max_fcoe_conn =
1028210498 (max_fcoe_conn & BNX2X_MAX_FCOE_INIT_CONN_MASK) >>
@@ -10311,8 +10527,9 @@ static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp) · 28 unmodified lines
1031110527 if (BNX2X_MF_EXT_PROTOCOL_FCOE(bp) && !CHIP_IS_E1x(bp))
1031210528 bnx2x_get_ext_wwn_info(bp, func);
1031310529
10314− } else if (IS_MF_FCOE_SD(bp))
10530+ } else if (IS_MF_FCOE_SD(bp) && !CHIP_IS_E1x(bp)) {
1031510531 bnx2x_get_ext_wwn_info(bp, func);
10532+ }
1031610533
1031710534 BNX2X_DEV_INFO("max_fcoe_conn 0x%x\n", bp->cnic_eth_dev.max_fcoe_conn);
1031810535
@@ -10322,12 +10539,9 @@ static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp) · 3 unmodified lines
1032210539 */
1032310540 if (!bp->cnic_eth_dev.max_fcoe_conn)
1032410541 bp->flags |= NO_FCOE_FLAG;
10325−#else
10326− bp->flags |= NO_FCOE_FLAG;
10327−#endif
1032810542 }
1032910543
10330−static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp)
10544+static void bnx2x_get_cnic_info(struct bnx2x *bp)
1033110545 {
1033210546 /*
1033310547 * iSCSI may be dynamically disabled but reading
@@ -10338,143 +10552,162 @@ static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp) · 4 unmodified lines
1033810552 bnx2x_get_fcoe_info(bp);
1033910553 }
1034010554
10341−static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)
10555+static void bnx2x_get_cnic_mac_hwinfo(struct bnx2x *bp)
1034210556 {
1034310557 u32 val, val2;
1034410558 int func = BP_ABS_FUNC(bp);
1034510559 int port = BP_PORT(bp);
10346−#ifdef BCM_CNIC
1034710560 u8 *iscsi_mac = bp->cnic_eth_dev.iscsi_mac;
1034810561 u8 *fip_mac = bp->fip_mac;
10349−#endif
1035010562
10351− /* Zero primary MAC configuration */
10352− memset(bp->dev->dev_addr, 0, ETH_ALEN);
10353−
10354− if (BP_NOMCP(bp)) {
10355− BNX2X_ERROR("warning: random MAC workaround active\n");
10356− eth_hw_addr_random(bp->dev);
10357− } else if (IS_MF(bp)) {
10358− val2 = MF_CFG_RD(bp, func_mf_config[func].mac_upper);
10359− val = MF_CFG_RD(bp, func_mf_config[func].mac_lower);
10360− if ((val2 != FUNC_MF_CFG_UPPERMAC_DEFAULT) &&
10361− (val != FUNC_MF_CFG_LOWERMAC_DEFAULT))
10362− bnx2x_set_mac_buf(bp->dev->dev_addr, val, val2);
10363−
10364−#ifdef BCM_CNIC
10365− /*
10366− * iSCSI and FCoE NPAR MACs: if there is no either iSCSI or
10563+ if (IS_MF(bp)) {
10564+ /* iSCSI and FCoE NPAR MACs: if there is no either iSCSI or
1036710565 * FCoE MAC then the appropriate feature should be disabled.
10368− *
10369− * In non SD mode features configuration comes from
10370− * struct func_ext_config.
10566+ * In non SD mode features configuration comes from struct
10567+ * func_ext_config.
1037110568 */
10372− if (!IS_MF_SD(bp)) {
10569+ if (!IS_MF_SD(bp) && !CHIP_IS_E1x(bp)) {
1037310570 u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg);
1037410571 if (cfg & MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD) {
1037510572 val2 = MF_CFG_RD(bp, func_ext_config[func].
10376− iscsi_mac_addr_upper);
10573+ iscsi_mac_addr_upper);
1037710574 val = MF_CFG_RD(bp, func_ext_config[func].
10378− iscsi_mac_addr_lower);
10575+ iscsi_mac_addr_lower);
1037910576 bnx2x_set_mac_buf(iscsi_mac, val, val2);
10380− BNX2X_DEV_INFO("Read iSCSI MAC: %pM\n",
10381− iscsi_mac);
10382− } else
10577+ BNX2X_DEV_INFO
10578+ ("Read iSCSI MAC: %pM\n", iscsi_mac);
10579+ } else {
1038310580 bp->flags |= NO_ISCSI_OOO_FLAG | NO_ISCSI_FLAG;
10581+ }
1038410582
1038510583 if (cfg & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) {
1038610584 val2 = MF_CFG_RD(bp, func_ext_config[func].
10387− fcoe_mac_addr_upper);
10585+ fcoe_mac_addr_upper);
1038810586 val = MF_CFG_RD(bp, func_ext_config[func].
10389− fcoe_mac_addr_lower);
10587+ fcoe_mac_addr_lower);
1039010588 bnx2x_set_mac_buf(fip_mac, val, val2);
10391− BNX2X_DEV_INFO("Read FCoE L2 MAC: %pM\n",
10392− fip_mac);
10393−
10394− } else
10589+ BNX2X_DEV_INFO
10590+ ("Read FCoE L2 MAC: %pM\n", fip_mac);
10591+ } else {
1039510592 bp->flags |= NO_FCOE_FLAG;
10593+ }
1039610594
1039710595 bp->mf_ext_config = cfg;
1039810596
1039910597 } else { /* SD MODE */
10400− if (IS_MF_STORAGE_SD(bp)) {
10401− if (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp)) {
10402− /* use primary mac as iscsi mac */
10403− memcpy(iscsi_mac, bp->dev->dev_addr,
10404− ETH_ALEN);
10405−
10406− BNX2X_DEV_INFO("SD ISCSI MODE\n");
10407− BNX2X_DEV_INFO("Read iSCSI MAC: %pM\n",
10408− iscsi_mac);
10409− } else { /* FCoE */
10410− memcpy(fip_mac, bp->dev->dev_addr,
10411− ETH_ALEN);
10412− BNX2X_DEV_INFO("SD FCoE MODE\n");
10413− BNX2X_DEV_INFO("Read FIP MAC: %pM\n",
10414− fip_mac);
10415− }
10416− /* Zero primary MAC configuration */
10417− memset(bp->dev->dev_addr, 0, ETH_ALEN);
10598+ if (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp)) {
10599+ /* use primary mac as iscsi mac */
10600+ memcpy(iscsi_mac, bp->dev->dev_addr, ETH_ALEN);
10601+
10602+ BNX2X_DEV_INFO("SD ISCSI MODE\n");
10603+ BNX2X_DEV_INFO
10604+ ("Read iSCSI MAC: %pM\n", iscsi_mac);
10605+ } else if (BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)) {
10606+ /* use primary mac as fip mac */
10607+ memcpy(fip_mac, bp->dev->dev_addr, ETH_ALEN);
10608+ BNX2X_DEV_INFO("SD FCoE MODE\n");
10609+ BNX2X_DEV_INFO
10610+ ("Read FIP MAC: %pM\n", fip_mac);
1041810611 }
1041910612 }
1042010613
10614+ if (IS_MF_STORAGE_SD(bp))
10615+ /* Zero primary MAC configuration */
10616+ memset(bp->dev->dev_addr, 0, ETH_ALEN);
10617+
1042110618 if (IS_MF_FCOE_AFEX(bp))
1042210619 /* use FIP MAC as primary MAC */
1042310620 memcpy(bp->dev->dev_addr, fip_mac, ETH_ALEN);
1042410621
10425−#endif
1042610622 } else {
10427− /* in SF read MACs from port configuration */
10428− val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_upper);
10429− val = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_lower);
10430− bnx2x_set_mac_buf(bp->dev->dev_addr, val, val2);
10431−
10432−#ifdef BCM_CNIC
1043310623 val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].
10434− iscsi_mac_upper);
10624+ iscsi_mac_upper);
1043510625 val = SHMEM_RD(bp, dev_info.port_hw_config[port].
10436− iscsi_mac_lower);
10626+ iscsi_mac_lower);
1043710627 bnx2x_set_mac_buf(iscsi_mac, val, val2);
1043810628
1043910629 val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].
10440− fcoe_fip_mac_upper);
10630+ fcoe_fip_mac_upper);
1044110631 val = SHMEM_RD(bp, dev_info.port_hw_config[port].
10442− fcoe_fip_mac_lower);
10632+ fcoe_fip_mac_lower);
1044310633 bnx2x_set_mac_buf(fip_mac, val, val2);
10444−#endif
1044510634 }
1044610635
10447− memcpy(bp->link_params.mac_addr, bp->dev->dev_addr, ETH_ALEN);
10448− memcpy(bp->dev->perm_addr, bp->dev->dev_addr, ETH_ALEN);
10449−
10450−#ifdef BCM_CNIC
10451− /* Disable iSCSI if MAC configuration is
10452− * invalid.
10453− */
10636+ /* Disable iSCSI OOO if MAC configuration is invalid. */
1045410637 if (!is_valid_ether_addr(iscsi_mac)) {
10455− bp->flags |= NO_ISCSI_FLAG;
10638+ bp->flags |= NO_ISCSI_OOO_FLAG | NO_ISCSI_FLAG;
1045610639 memset(iscsi_mac, 0, ETH_ALEN);
1045710640 }
1045810641
10459− /* Disable FCoE if MAC configuration is
10460− * invalid.
10461− */
10642+ /* Disable FCoE if MAC configuration is invalid. */
1046210643 if (!is_valid_ether_addr(fip_mac)) {
1046310644 bp->flags |= NO_FCOE_FLAG;
1046410645 memset(bp->fip_mac, 0, ETH_ALEN);
1046510646 }
10466−#endif
10647+}
10648+
10649+static void bnx2x_get_mac_hwinfo(struct bnx2x *bp)
10650+{
10651+ u32 val, val2;
10652+ int func = BP_ABS_FUNC(bp);
10653+ int port = BP_PORT(bp);
10654+
10655+ /* Zero primary MAC configuration */
10656+ memset(bp->dev->dev_addr, 0, ETH_ALEN);
10657+
10658+ if (BP_NOMCP(bp)) {
10659+ BNX2X_ERROR("warning: random MAC workaround active\n");
10660+ eth_hw_addr_random(bp->dev);
10661+ } else if (IS_MF(bp)) {
10662+ val2 = MF_CFG_RD(bp, func_mf_config[func].mac_upper);
10663+ val = MF_CFG_RD(bp, func_mf_config[func].mac_lower);
10664+ if ((val2 != FUNC_MF_CFG_UPPERMAC_DEFAULT) &&
10665+ (val != FUNC_MF_CFG_LOWERMAC_DEFAULT))
10666+ bnx2x_set_mac_buf(bp->dev->dev_addr, val, val2);
10667+
10668+ if (CNIC_SUPPORT(bp))
10669+ bnx2x_get_cnic_mac_hwinfo(bp);
10670+ } else {
10671+ /* in SF read MACs from port configuration */
10672+ val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_upper);
10673+ val = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_lower);
10674+ bnx2x_set_mac_buf(bp->dev->dev_addr, val, val2);
10675+
10676+ if (CNIC_SUPPORT(bp))
10677+ bnx2x_get_cnic_mac_hwinfo(bp);
10678+ }
10679+
10680+ memcpy(bp->link_params.mac_addr, bp->dev->dev_addr, ETH_ALEN);
10681+ memcpy(bp->dev->perm_addr, bp->dev->dev_addr, ETH_ALEN);
1046710682
1046810683 if (!bnx2x_is_valid_ether_addr(bp, bp->dev->dev_addr))
1046910684 dev_err(&bp->pdev->dev,
1047010685 "bad Ethernet MAC address configuration: %pM\n"
1047110686 "change it manually before bringing up the appropriate network interface\n",
1047210687 bp->dev->dev_addr);
10688+}
1047310689
10690+static bool bnx2x_get_dropless_info(struct bnx2x *bp)
10691+{
10692+ int tmp;
10693+ u32 cfg;
1047410694
10695+ if (IS_MF(bp) && !CHIP_IS_E1x(bp)) {
10696+ /* Take function: tmp = func */
10697+ tmp = BP_ABS_FUNC(bp);
10698+ cfg = MF_CFG_RD(bp, func_ext_config[tmp].func_cfg);
10699+ cfg = !!(cfg & MACP_FUNC_CFG_PAUSE_ON_HOST_RING);
10700+ } else {
10701+ /* Take port: tmp = port */
10702+ tmp = BP_PORT(bp);
10703+ cfg = SHMEM_RD(bp,
10704+ dev_info.port_hw_config[tmp].generic_features);
10705+ cfg = !!(cfg & PORT_HW_CFG_PAUSE_ON_HOST_RING_ENABLED);
10706+ }
10707+ return cfg;
1047510708 }
1047610709
10477−static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp)
10710+static int bnx2x_get_hwinfo(struct bnx2x *bp)
1047810711 {
1047910712 int /*abs*/func = BP_ABS_FUNC(bp);
1048010713 int vn;
@@ -10516,6 +10749,8 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp) · 35 unmodified lines
1051610749 if (REG_RD(bp, IGU_REG_RESET_MEMORIES)) {
1051710750 dev_err(&bp->pdev->dev,
1051810751 "FORCING Normal Mode failed!!!\n");
10752+ bnx2x_release_hw_lock(bp,
10753+ HW_LOCK_RESOURCE_RESET);
1051910754 return -EPERM;
1052010755 }
1052110756 }
@@ -10526,9 +10761,10 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp) · 4 unmodified lines
1052610761 } else
1052710762 BNX2X_DEV_INFO("IGU Normal Mode\n");
1052810763
10529− bnx2x_get_igu_cam_info(bp);
10530−
10764+ rc = bnx2x_get_igu_cam_info(bp);
1053110765 bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_RESET);
10766+ if (rc)
10767+ return rc;
1053210768 }
1053310769
1053410770 /*
@@ -10697,7 +10933,7 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp) · 162 unmodified lines
1069710933 return rc;
1069810934 }
1069910935
10700−static void __devinit bnx2x_read_fwinfo(struct bnx2x *bp)
10936+static void bnx2x_read_fwinfo(struct bnx2x *bp)
1070110937 {
1070210938 int cnt, i, block_end, rodi;
1070310939 char vpd_start[BNX2X_VPD_LEN+1];
@@ -10782,7 +11018,7 @@ out_not_found: · 78 unmodified lines
1078211018 return;
1078311019 }
1078411020
10785−static void __devinit bnx2x_set_modes_bitmap(struct bnx2x *bp)
11021+static void bnx2x_set_modes_bitmap(struct bnx2x *bp)
1078611022 {
1078711023 u32 flags = 0;
1078811024
@@ -10832,7 +11068,7 @@ static void __devinit bnx2x_set_modes_bitmap(struct bnx2x *bp) · 43 unmodified lines
1083211068 INIT_MODE_FLAGS(bp) = flags;
1083311069 }
1083411070
10835−static int __devinit bnx2x_init_bp(struct bnx2x *bp)
11071+static int bnx2x_init_bp(struct bnx2x *bp)
1083611072 {
1083711073 int func;
1083811074 int rc;
@@ -10840,9 +11076,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) · 1 unmodified line
1084011076 mutex_init(&bp->port.phy_mutex);
1084111077 mutex_init(&bp->fw_mb_mutex);
1084211078 spin_lock_init(&bp->stats_lock);
10843−#ifdef BCM_CNIC
10844− mutex_init(&bp->cnic_mutex);
10845−#endif
11079+
1084611080
1084711081 INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task);
1084811082 INIT_DELAYED_WORK(&bp->sp_rtnl_task, bnx2x_sp_rtnl_task);
@@ -10880,10 +11114,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) · 31 unmodified lines
1088011114 dev_err(&bp->pdev->dev, "MCP disabled, must load devices in order!\n");
1088111115
1088211116 bp->disable_tpa = disable_tpa;
10883−
10884−#ifdef BCM_CNIC
1088511117 bp->disable_tpa |= IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp);
10886−#endif
1088711118
1088811119 /* Set TPA flags */
1088911120 if (bp->disable_tpa) {
@@ -10897,7 +11128,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) · 7 unmodified lines
1089711128 if (CHIP_IS_E1(bp))
1089811129 bp->dropless_fc = 0;
1089911130 else
10900− bp->dropless_fc = dropless_fc;
11131+ bp->dropless_fc = dropless_fc | bnx2x_get_dropless_info(bp);
1090111132
1090211133 bp->mrrs = mrrs;
1090311134
@@ -10914,15 +11145,20 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) · 10 unmodified lines
1091411145 bp->timer.data = (unsigned long) bp;
1091511146 bp->timer.function = bnx2x_timer;
1091611147
10917− bnx2x_dcbx_set_state(bp, true, BNX2X_DCBX_ENABLED_ON_NEG_ON);
10918− bnx2x_dcbx_init_params(bp);
11148+ if (SHMEM2_HAS(bp, dcbx_lldp_params_offset) &&
11149+ SHMEM2_HAS(bp, dcbx_lldp_dcbx_stat_offset) &&
11150+ SHMEM2_RD(bp, dcbx_lldp_params_offset) &&
11151+ SHMEM2_RD(bp, dcbx_lldp_dcbx_stat_offset)) {
11152+ bnx2x_dcbx_set_state(bp, true, BNX2X_DCBX_ENABLED_ON_NEG_ON);
11153+ bnx2x_dcbx_init_params(bp);
11154+ } else {
11155+ bnx2x_dcbx_set_state(bp, false, BNX2X_DCBX_ENABLED_OFF);
11156+ }
1091911157
10920−#ifdef BCM_CNIC
1092111158 if (CHIP_IS_E1x(bp))
1092211159 bp->cnic_base_cl_id = FP_SB_MAX_E1x;
1092311160 else
1092411161 bp->cnic_base_cl_id = FP_SB_MAX_E2;
10925−#endif
1092611162
1092711163 /* multiple tx priority */
1092811164 if (CHIP_IS_E1x(bp))
@@ -10932,6 +11168,16 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) · 3 unmodified lines
1093211168 if (CHIP_IS_E3B0(bp))
1093311169 bp->max_cos = BNX2X_MULTI_TX_COS_E3B0;
1093411170
11171+ /* We need at least one default status block for slow-path events,
11172+ * second status block for the L2 queue, and a third status block for
11173+ * CNIC if supproted.
11174+ */
11175+ if (CNIC_SUPPORT(bp))
11176+ bp->min_msix_vec_cnt = 3;
11177+ else
11178+ bp->min_msix_vec_cnt = 2;
11179+ BNX2X_DEV_INFO("bp->min_msix_vec_cnt %d", bp->min_msix_vec_cnt);
11180+
1093511181 return rc;
1093611182 }
1093711183
@@ -11168,11 +11414,9 @@ void bnx2x_set_rx_mode(struct net_device *dev) · 230 unmodified lines
1116811414 }
1116911415
1117011416 bp->rx_mode = rx_mode;
11171−#ifdef BCM_CNIC
1117211417 /* handle ISCSI SD mode */
1117311418 if (IS_MF_ISCSI_SD(bp))
1117411419 bp->rx_mode = BNX2X_RX_MODE_NONE;
11175−#endif
1117611420
1117711421 /* Schedule the rx_mode command */
1117811422 if (test_bit(BNX2X_FILTER_RX_MODE_PENDING, &bp->sp_state)) {
@@ -11284,7 +11528,7 @@ static const struct net_device_ops bnx2x_netdev_ops = { · 105 unmodified lines
1128411528 #endif
1128511529 .ndo_setup_tc = bnx2x_setup_tc,
1128611530
11287−#if defined(NETDEV_FCOE_WWNN) && defined(BCM_CNIC)
11531+#ifdef NETDEV_FCOE_WWNN
1128811532 .ndo_fcoe_get_wwn = bnx2x_fcoe_get_wwn,
1128911533 #endif
1129011534 };
@@ -11307,9 +11551,8 @@ static int bnx2x_set_coherency_mask(struct bnx2x *bp) · 16 unmodified lines
1130711551 return 0;
1130811552 }
1130911553
11310−static int __devinit bnx2x_init_dev(struct pci_dev *pdev,
11311− struct net_device *dev,
11312− unsigned long board_type)
11554+static int bnx2x_init_dev(struct pci_dev *pdev, struct net_device *dev,
11555+ unsigned long board_type)
1131311556 {
1131411557 struct bnx2x *bp;
1131511558 int rc;
@@ -11346,6 +11589,14 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev, · 30 unmodified lines
1134611589 goto err_out_disable;
1134711590 }
1134811591
11592+ pci_read_config_dword(pdev, PCICFG_REVISION_ID_OFFSET, &pci_cfg_dword);
11593+ if ((pci_cfg_dword & PCICFG_REVESION_ID_MASK) ==
11594+ PCICFG_REVESION_ID_ERROR_VAL) {
11595+ pr_err("PCI device error, probably due to fan failure, aborting\n");
11596+ rc = -ENODEV;
11597+ goto err_out_disable;
11598+ }
11599+
1134911600 if (atomic_read(&pdev->enable_cnt) == 1) {
1135011601 rc = pci_request_regions(pdev, DRV_MODULE_NAME);
1135111602 if (rc) {
@@ -11481,8 +11732,7 @@ err_out: · 129 unmodified lines
1148111732 return rc;
1148211733 }
1148311734
11484−static void __devinit bnx2x_get_pcie_width_speed(struct bnx2x *bp,
11485− int *width, int *speed)
11735+static void bnx2x_get_pcie_width_speed(struct bnx2x *bp, int *width, int *speed)
1148611736 {
1148711737 u32 val = REG_RD(bp, PCICFG_OFFSET + PCICFG_LINK_CONTROL);
1148811738
@@ -11750,9 +12000,8 @@ static int bnx2x_set_qm_cid_count(struct bnx2x *bp) · 261 unmodified lines
1175012000 {
1175112001 int cid_count = BNX2X_L2_MAX_CID(bp);
1175212002
11753−#ifdef BCM_CNIC
11754− cid_count += CNIC_CID_MAX;
11755−#endif
12003+ if (CNIC_SUPPORT(bp))
12004+ cid_count += CNIC_CID_MAX;
1175612005 return roundup(cid_count, QM_CID_ROUND);
1175712006 }
1175812007
@@ -11762,7 +12011,8 @@ static int bnx2x_set_qm_cid_count(struct bnx2x *bp) · 3 unmodified lines
1176212011 * @dev: pci device
1176312012 *
1176412013 */
11765−static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev)
12014+static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev,
12015+ int cnic_cnt)
1176612016 {
1176712017 int pos;
1176812018 u16 control;
@@ -11774,7 +12024,7 @@ static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev) · 5 unmodified lines
1177412024 * one fast path queue: one FP queue + SB for CNIC
1177512025 */
1177612026 if (!pos)
11777− return 1 + CNIC_PRESENT;
12027+ return 1 + cnic_cnt;
1177812028
1177912029 /*
1178012030 * The value in the PCI configuration space is the index of the last
@@ -11786,14 +12036,16 @@ static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev) · 5 unmodified lines
1178612036 return control & PCI_MSIX_FLAGS_QSIZE;
1178712037 }
1178812038
11789−static int __devinit bnx2x_init_one(struct pci_dev *pdev,
11790− const struct pci_device_id *ent)
12039+struct cnic_eth_dev *bnx2x_cnic_probe(struct net_device *);
12040+
12041+static int bnx2x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1179112042 {
1179212043 struct net_device *dev = NULL;
1179312044 struct bnx2x *bp;
1179412045 int pcie_width, pcie_speed;
1179512046 int rc, max_non_def_sbs;
1179612047 int rx_count, tx_count, rss_count, doorbell_size;
12048+ int cnic_cnt;
1179712049 /*
1179812050 * An estimated maximum supported CoS number according to the chip
1179912051 * version.
@@ -11837,21 +12089,22 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 37 unmodified lines
1183712089 return -ENODEV;
1183812090 }
1183912091
11840− max_non_def_sbs = bnx2x_get_num_non_def_sbs(pdev);
12092+ cnic_cnt = 1;
12093+ max_non_def_sbs = bnx2x_get_num_non_def_sbs(pdev, cnic_cnt);
1184112094
1184212095 WARN_ON(!max_non_def_sbs);
1184312096
1184412097 /* Maximum number of RSS queues: one IGU SB goes to CNIC */
11845− rss_count = max_non_def_sbs - CNIC_PRESENT;
12098+ rss_count = max_non_def_sbs - cnic_cnt;
1184612099
1184712100 /* Maximum number of netdev Rx queues: RSS + FCoE L2 */
11848− rx_count = rss_count + FCOE_PRESENT;
12101+ rx_count = rss_count + cnic_cnt;
1184912102
1185012103 /*
1185112104 * Maximum number of netdev Tx queues:
1185212105 * Maximum TSS queues * Maximum supported number of CoS + FCoE L2
1185312106 */
11854− tx_count = rss_count * max_cos_est + FCOE_PRESENT;
12107+ tx_count = rss_count * max_cos_est + cnic_cnt;
1185512108
1185612109 /* dev zeroed in init_etherdev */
1185712110 dev = alloc_etherdev_mqs(sizeof(*bp), tx_count, rx_count);
@@ -11862,6 +12115,9 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 4 unmodified lines
1186212115
1186312116 bp->igu_sb_cnt = max_non_def_sbs;
1186412117 bp->msg_enable = debug;
12118+ bp->cnic_support = cnic_cnt;
12119+ bp->cnic_probe = bnx2x_cnic_probe;
12120+
1186512121 pci_set_drvdata(pdev, dev);
1186612122
1186712123 rc = bnx2x_init_dev(pdev, dev, ent->driver_data);
@@ -11870,6 +12126,7 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 2 unmodified lines
1187012126 return rc;
1187112127 }
1187212128
12129+ BNX2X_DEV_INFO("Cnic support is %s\n", CNIC_SUPPORT(bp) ? "on" : "off");
1187312130 BNX2X_DEV_INFO("max_non_def_sbs %d\n", max_non_def_sbs);
1187412131
1187512132 BNX2X_DEV_INFO("Allocated netdev with %d tx and %d rx queues\n",
@@ -11902,10 +12159,10 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 26 unmodified lines
1190212159 /* calc qm_cid_count */
1190312160 bp->qm_cid_count = bnx2x_set_qm_cid_count(bp);
1190412161
11905−#ifdef BCM_CNIC
11906− /* disable FCOE L2 queue for E1x */
12162+ /* disable FCOE L2 queue for E1x*/
1190712163 if (CHIP_IS_E1x(bp))
1190812164 bp->flags |= NO_FCOE_FLAG;
12165+
1190912166 /* disable FCOE for 57840 device, until FW supports it */
1191012167 switch (ent->driver_data) {
1191112168 case BCM57840_O:
@@ -11915,8 +12172,6 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 3 unmodified lines
1191512172 case BCM57840_MF:
1191612173 bp->flags |= NO_FCOE_FLAG;
1191712174 }
11918−#endif
11919−
1192012175
1192112176 /* Set bp->num_queues for MSI-X mode*/
1192212177 bnx2x_set_num_queues(bp);
@@ -11932,14 +12187,13 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 9 unmodified lines
1193212187 goto init_one_exit;
1193312188 }
1193412189
11935−#ifdef BCM_CNIC
12190+
1193612191 if (!NO_FCOE(bp)) {
1193712192 /* Add storage MAC address */
1193812193 rtnl_lock();
1193912194 dev_addr_add(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);
1194012195 rtnl_unlock();
1194112196 }
11942−#endif
1194312197
1194412198 bnx2x_get_pcie_width_speed(bp, &pcie_width, &pcie_speed);
1194512199
@@ -11973,7 +12227,7 @@ init_one_exit: · 27 unmodified lines
1197312227 return rc;
1197412228 }
1197512229
11976−static void __devexit bnx2x_remove_one(struct pci_dev *pdev)
12230+static void bnx2x_remove_one(struct pci_dev *pdev)
1197712231 {
1197812232 struct net_device *dev = pci_get_drvdata(pdev);
1197912233 struct bnx2x *bp;
@@ -11984,14 +12238,12 @@ static void __devexit bnx2x_remove_one(struct pci_dev *pdev) · 4 unmodified lines
1198412238 }
1198512239 bp = netdev_priv(dev);
1198612240
11987−#ifdef BCM_CNIC
1198812241 /* Delete storage MAC address */
1198912242 if (!NO_FCOE(bp)) {
1199012243 rtnl_lock();
1199112244 dev_addr_del(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);
1199212245 rtnl_unlock();
1199312246 }
11994−#endif
1199512247
1199612248 #ifdef BCM_DCBNL
1199712249 /* Delete app tlvs from dcbnl */
@@ -12039,15 +12291,17 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) · 41 unmodified lines
1203912291
1204012292 bp->rx_mode = BNX2X_RX_MODE_NONE;
1204112293
12042−#ifdef BCM_CNIC
12043− bnx2x_cnic_notify(bp, CNIC_CTL_STOP_CMD);
12044−#endif
12294+ if (CNIC_LOADED(bp))
12295+ bnx2x_cnic_notify(bp, CNIC_CTL_STOP_CMD);
12296+
1204512297 /* Stop Tx */
1204612298 bnx2x_tx_disable(bp);
1204712299
1204812300 bnx2x_netif_stop(bp, 0);
1204912301 /* Delete all NAPI objects */
1205012302 bnx2x_del_all_napi(bp);
12303+ if (CNIC_LOADED(bp))
12304+ bnx2x_del_all_napi_cnic(bp);
1205112305
1205212306 del_timer_sync(&bp->timer);
1205312307
@@ -12188,7 +12442,7 @@ static struct pci_driver bnx2x_pci_driver = { · 134 unmodified lines
1218812442 .name = DRV_MODULE_NAME,
1218912443 .id_table = bnx2x_pci_tbl,
1219012444 .probe = bnx2x_init_one,
12191− .remove = __devexit_p(bnx2x_remove_one),
12445+ .remove = bnx2x_remove_one,
1219212446 .suspend = bnx2x_suspend,
1219312447 .resume = bnx2x_resume,
1219412448 .err_handler = &bnx2x_err_handler,
@@ -12238,7 +12492,6 @@ void bnx2x_notify_link_changed(struct bnx2x *bp) · 43 unmodified lines
1223812492 module_init(bnx2x_init);
1223912493 module_exit(bnx2x_cleanup);
1224012494
12241−#ifdef BCM_CNIC
1224212495 /**
1224312496 * bnx2x_set_iscsi_eth_mac_addr - set iSCSI MAC(s).
1224412497 *
@@ -12691,12 +12944,31 @@ static int bnx2x_register_cnic(struct net_device *dev, struct cnic_ops *ops, · 446 unmodified lines
1269112944 {
1269212945 struct bnx2x *bp = netdev_priv(dev);
1269312946 struct cnic_eth_dev *cp = &bp->cnic_eth_dev;
12947+ int rc;
12948+
12949+ DP(NETIF_MSG_IFUP, "Register_cnic called\n");
1269412950
1269512951 if (ops == NULL) {
1269612952 BNX2X_ERR("NULL ops received\n");
1269712953 return -EINVAL;
1269812954 }
1269912955
12956+ if (!CNIC_SUPPORT(bp)) {
12957+ BNX2X_ERR("Can't register CNIC when not supported\n");
12958+ return -EOPNOTSUPP;
12959+ }
12960+
12961+ if (!CNIC_LOADED(bp)) {
12962+ rc = bnx2x_load_cnic(bp);
12963+ if (rc) {
12964+ BNX2X_ERR("CNIC-related load failed\n");
12965+ return rc;
12966+ }
12967+
12968+ }
12969+
12970+ bp->cnic_enabled = true;
12971+
1270012972 bp->cnic_kwq = kzalloc(PAGE_SIZE, GFP_KERNEL);
1270112973 if (!bp->cnic_kwq)
1270212974 return -ENOMEM;
@@ -12786,7 +13058,5 @@ struct cnic_eth_dev *bnx2x_cnic_probe(struct net_device *dev) · 83 unmodified lines
1278613058 cp->starting_cid);
1278713059 return cp;
1278813060 }
12789−EXPORT_SYMBOL(bnx2x_cnic_probe);
1279013061
12791−#endif /* BCM_CNIC */
1279213062
drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h+56−3
@@ -2107,6 +2107,7 @@ · 2106 unmodified lines
21072107 #define NIG_REG_LLH1_ERROR_MASK 0x10090
21082108 /* [RW 8] event id for llh1 */
21092109 #define NIG_REG_LLH1_EVENT_ID 0x10088
2110+#define NIG_REG_LLH1_FUNC_EN 0x16104
21102111 #define NIG_REG_LLH1_FUNC_MEM 0x161c0
21112112 #define NIG_REG_LLH1_FUNC_MEM_ENABLE 0x16160
21122113 #define NIG_REG_LLH1_FUNC_MEM_SIZE 16
@@ -2302,6 +2303,15 @@ · 189 unmodified lines
23022303 * set to 0x345678021. This is a new register (with 2_) added in E3 B0 to
23032304 * accommodate the 9 input clients to ETS arbiter. */
23042305 #define NIG_REG_P0_TX_ARB_PRIORITY_CLIENT2_MSB 0x18684
2306+/* [RW 1] MCP-to-host path enable. Set this bit to enable the routing of MCP
2307+ * packets to BRB LB interface to forward the packet to the host. All
2308+ * packets from MCP are forwarded to the network when this bit is cleared -
2309+ * regardless of the configured destination in tx_mng_destination register.
2310+ * When MCP-to-host paths for both ports 0 and 1 are disabled - the arbiter
2311+ * for BRB LB interface is bypassed and PBF LB traffic is always selected to
2312+ * send to BRB LB.
2313+ */
2314+#define NIG_REG_P0_TX_MNG_HOST_ENABLE 0x182f4
23052315 #define NIG_REG_P1_HWPFC_ENABLE 0x181d0
23062316 #define NIG_REG_P1_MAC_IN_EN 0x185c0
23072317 /* [RW 1] Output enable for TX MAC interface */
@@ -2418,6 +2428,12 @@ · 110 unmodified lines
24182428 #define NIG_REG_P1_TX_ARB_PRIORITY_CLIENT2_MSB 0x186e4
24192429 /* [R 1] TX FIFO for transmitting data to MAC is empty. */
24202430 #define NIG_REG_P1_TX_MACFIFO_EMPTY 0x18594
2431+/* [RW 1] MCP-to-host path enable. Set this bit to enable the routing of MCP
2432+ * packets to BRB LB interface to forward the packet to the host. All
2433+ * packets from MCP are forwarded to the network when this bit is cleared -
2434+ * regardless of the configured destination in tx_mng_destination register.
2435+ */
2436+#define NIG_REG_P1_TX_MNG_HOST_ENABLE 0x182f8
24212437 /* [R 1] FIFO empty status of the MCP TX FIFO used for storing MCP packets
24222438 forwarded to the host. */
24232439 #define NIG_REG_P1_TX_MNG_HOST_FIFO_EMPTY 0x182b8
@@ -5482,6 +5498,7 @@ · 3058 unmodified lines
54825498 #define XMAC_CTRL_REG_RX_EN (0x1<<1)
54835499 #define XMAC_CTRL_REG_SOFT_RESET (0x1<<6)
54845500 #define XMAC_CTRL_REG_TX_EN (0x1<<0)
5501+#define XMAC_CTRL_REG_XLGMII_ALIGN_ENB (0x1<<7)
54855502 #define XMAC_PAUSE_CTRL_REG_RX_PAUSE_EN (0x1<<18)
54865503 #define XMAC_PAUSE_CTRL_REG_TX_PAUSE_EN (0x1<<17)
54875504 #define XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON (0x1<<1)
@@ -5502,11 +5519,14 @@ · 14 unmodified lines
55025519 #define XMAC_REG_PAUSE_CTRL 0x68
55035520 #define XMAC_REG_PFC_CTRL 0x70
55045521 #define XMAC_REG_PFC_CTRL_HI 0x74
5522+#define XMAC_REG_RX_LSS_CTRL 0x50
55055523 #define XMAC_REG_RX_LSS_STATUS 0x58
55065524 /* [RW 14] Maximum packet size in receive direction; exclusive of preamble &
55075525 * CRC in strip mode */
55085526 #define XMAC_REG_RX_MAX_SIZE 0x40
55095527 #define XMAC_REG_TX_CTRL 0x20
5528+#define XMAC_RX_LSS_CTRL_REG_LOCAL_FAULT_DISABLE (0x1<<0)
5529+#define XMAC_RX_LSS_CTRL_REG_REMOTE_FAULT_DISABLE (0x1<<1)
55105530 /* [RW 16] Indirect access to the XX table of the XX protection mechanism.
55115531 The fields are:[4:0] - tail pointer; 9:5] - Link List size; 14:10] -
55125532 header pointer. */
@@ -5922,6 +5942,16 @@ · 409 unmodified lines
59225942 #define MISC_REGISTERS_SPIO_OUTPUT_HIGH 1
59235943 #define MISC_REGISTERS_SPIO_OUTPUT_LOW 0
59245944 #define MISC_REGISTERS_SPIO_SET_POS 8
5945+#define MISC_SPIO_CLR_POS 16
5946+#define MISC_SPIO_FLOAT (0xffL<<24)
5947+#define MISC_SPIO_FLOAT_POS 24
5948+#define MISC_SPIO_INPUT_HI_Z 2
5949+#define MISC_SPIO_INT_OLD_SET_POS 16
5950+#define MISC_SPIO_OUTPUT_HIGH 1
5951+#define MISC_SPIO_OUTPUT_LOW 0
5952+#define MISC_SPIO_SET_POS 8
5953+#define MISC_SPIO_SPIO4 0x10
5954+#define MISC_SPIO_SPIO5 0x20
59255955 #define HW_LOCK_MAX_RESOURCE_VALUE 31
59265956 #define HW_LOCK_RESOURCE_DCBX_ADMIN_MIB 13
59275957 #define HW_LOCK_RESOURCE_DRV_FLAGS 10
@@ -6130,7 +6160,9 @@ · 202 unmodified lines
61306160 #define PCICFG_COMMAND_INT_DISABLE (1<<10)
61316161 #define PCICFG_COMMAND_RESERVED (0x1f<<11)
61326162 #define PCICFG_STATUS_OFFSET 0x06
6133−#define PCICFG_REVESION_ID_OFFSET 0x08
6163+#define PCICFG_REVISION_ID_OFFSET 0x08
6164+#define PCICFG_REVESION_ID_MASK 0xff
6165+#define PCICFG_REVESION_ID_ERROR_VAL 0xff
61346166 #define PCICFG_CACHE_LINE_SIZE 0x0c
61356167 #define PCICFG_LATENCY_TIMER 0x0d
61366168 #define PCICFG_BAR_1_LOW 0x10
@@ -6672,6 +6704,7 @@ · 535 unmodified lines
66726704 #define MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_10G_XFI 0x1B00
66736705 #define MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_20G_DXGXS 0x1E00
66746706 #define MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_10G_SFI 0x1F00
6707+#define MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_20G_KR2 0x3900
66756708
66766709
66776710 #define MDIO_REG_BANK_10G_PARALLEL_DETECT 0x8130
@@ -7046,7 +7079,8 @@ Theotherbitsarereservedandshouldbezero*/ · 368 unmodified lines
70467079 #define MDIO_WC_REG_AN_IEEE1BLK_AN_ADVERTISEMENT2 0x12
70477080 #define MDIO_WC_REG_AN_IEEE1BLK_AN_ADV2_FEC_ABILITY 0x4000
70487081 #define MDIO_WC_REG_AN_IEEE1BLK_AN_ADV2_FEC_REQ 0x8000
7049−#define MDIO_WC_REG_PMD_IEEE9BLK_TENGBASE_KR_PMD_CONTROL_REGISTER_150 0x96
7082+#define MDIO_WC_REG_PCS_STATUS2 0x0021
7083+#define MDIO_WC_REG_PMD_KR_CONTROL 0x0096
70507084 #define MDIO_WC_REG_XGXSBLK0_XGXSCONTROL 0x8000
70517085 #define MDIO_WC_REG_XGXSBLK0_MISCCONTROL1 0x800e
70527086 #define MDIO_WC_REG_XGXSBLK1_DESKEW 0x8010
@@ -7078,6 +7112,7 @@ Theotherbitsarereservedandshouldbezero*/ · 25 unmodified lines
70787112 #define MDIO_WC_REG_PAR_DET_10G_STATUS 0x8130
70797113 #define MDIO_WC_REG_PAR_DET_10G_CTRL 0x8131
70807114 #define MDIO_WC_REG_XGXS_X2_CONTROL2 0x8141
7115+#define MDIO_WC_REG_XGXS_X2_CONTROL3 0x8142
70817116 #define MDIO_WC_REG_XGXS_RX_LN_SWAP1 0x816B
70827117 #define MDIO_WC_REG_XGXS_TX_LN_SWAP1 0x8169
70837118 #define MDIO_WC_REG_GP2_STATUS_GP_2_0 0x81d0
@@ -7112,6 +7147,7 @@ Theotherbitsarereservedandshouldbezero*/ · 28 unmodified lines
71127147 #define MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET 0x0a
71137148 #define MDIO_WC_REG_TX_FIR_TAP_POST_TAP_MASK 0x7c00
71147149 #define MDIO_WC_REG_TX_FIR_TAP_ENABLE 0x8000
7150+#define MDIO_WC_REG_CL72_USERB0_CL72_TX_FIR_TAP 0x82e2
71157151 #define MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL 0x82e3
71167152 #define MDIO_WC_REG_CL72_USERB0_CL72_OS_DEF_CTRL 0x82e6
71177153 #define MDIO_WC_REG_CL72_USERB0_CL72_BR_DEF_CTRL 0x82e7
@@ -7129,9 +7165,16 @@ Theotherbitsarereservedandshouldbezero*/ · 11 unmodified lines
71297165 #define MDIO_WC_REG_DIGITAL4_MISC5 0x833e
71307166 #define MDIO_WC_REG_DIGITAL5_MISC6 0x8345
71317167 #define MDIO_WC_REG_DIGITAL5_MISC7 0x8349
7168+#define MDIO_WC_REG_DIGITAL5_LINK_STATUS 0x834d
71327169 #define MDIO_WC_REG_DIGITAL5_ACTUAL_SPEED 0x834e
71337170 #define MDIO_WC_REG_DIGITAL6_MP5_NEXTPAGECTRL 0x8350
71347171 #define MDIO_WC_REG_CL49_USERB0_CTRL 0x8368
7172+#define MDIO_WC_REG_CL73_USERB0_CTRL 0x8370
7173+#define MDIO_WC_REG_CL73_USERB0_USTAT 0x8371
7174+#define MDIO_WC_REG_CL73_BAM_CTRL1 0x8372
7175+#define MDIO_WC_REG_CL73_BAM_CTRL2 0x8373
7176+#define MDIO_WC_REG_CL73_BAM_CTRL3 0x8374
7177+#define MDIO_WC_REG_CL73_BAM_CODE_FIELD 0x837b
71357178 #define MDIO_WC_REG_EEE_COMBO_CONTROL0 0x8390
71367179 #define MDIO_WC_REG_TX66_CONTROL 0x83b0
71377180 #define MDIO_WC_REG_RX66_CONTROL 0x83c0
@@ -7145,7 +7188,17 @@ Theotherbitsarereservedandshouldbezero*/ · 7 unmodified lines
71457188 #define MDIO_WC_REG_RX66_SCW3_MASK 0x83c9
71467189 #define MDIO_WC_REG_FX100_CTRL1 0x8400
71477190 #define MDIO_WC_REG_FX100_CTRL3 0x8402
7148−
7191+#define MDIO_WC_REG_CL82_USERB1_TX_CTRL5 0x8436
7192+#define MDIO_WC_REG_CL82_USERB1_TX_CTRL6 0x8437
7193+#define MDIO_WC_REG_CL82_USERB1_TX_CTRL7 0x8438
7194+#define MDIO_WC_REG_CL82_USERB1_TX_CTRL9 0x8439
7195+#define MDIO_WC_REG_CL82_USERB1_RX_CTRL10 0x843a
7196+#define MDIO_WC_REG_CL82_USERB1_RX_CTRL11 0x843b
7197+#define MDIO_WC_REG_ETA_CL73_OUI1 0x8453
7198+#define MDIO_WC_REG_ETA_CL73_OUI2 0x8454
7199+#define MDIO_WC_REG_ETA_CL73_OUI3 0x8455
7200+#define MDIO_WC_REG_ETA_CL73_LD_BAM_CODE 0x8456
7201+#define MDIO_WC_REG_ETA_CL73_LD_UD_CODE 0x8457
71497202 #define MDIO_WC_REG_MICROBLK_CMD 0xffc2
71507203 #define MDIO_WC_REG_MICROBLK_DL_STATUS 0xffc5
71517204 #define MDIO_WC_REG_MICROBLK_CMD3 0xffcc
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c+55−4
@@ -5350,12 +5350,24 @@ static int bnx2x_func_chk_transition(struct bnx2x *bp, · 5349 unmodified lines
53505350 else if ((cmd == BNX2X_F_CMD_AFEX_VIFLISTS) &&
53515351 (!test_bit(BNX2X_F_CMD_STOP, &o->pending)))
53525352 next_state = BNX2X_F_STATE_STARTED;
5353+
5354+ /* Switch_update ramrod can be sent in either started or
5355+ * tx_stopped state, and it doesn't change the state.
5356+ */
5357+ else if ((cmd == BNX2X_F_CMD_SWITCH_UPDATE) &&
5358+ (!test_bit(BNX2X_F_CMD_STOP, &o->pending)))
5359+ next_state = BNX2X_F_STATE_STARTED;
5360+
53535361 else if (cmd == BNX2X_F_CMD_TX_STOP)
53545362 next_state = BNX2X_F_STATE_TX_STOPPED;
53555363
53565364 break;
53575365 case BNX2X_F_STATE_TX_STOPPED:
5358− if (cmd == BNX2X_F_CMD_TX_START)
5366+ if ((cmd == BNX2X_F_CMD_SWITCH_UPDATE) &&
5367+ (!test_bit(BNX2X_F_CMD_STOP, &o->pending)))
5368+ next_state = BNX2X_F_STATE_TX_STOPPED;
5369+
5370+ else if (cmd == BNX2X_F_CMD_TX_START)
53595371 next_state = BNX2X_F_STATE_STARTED;
53605372
53615373 break;
@@ -5637,6 +5649,28 @@ static inline int bnx2x_func_send_start(struct bnx2x *bp, · 275 unmodified lines
56375649 U64_LO(data_mapping), NONE_CONNECTION_TYPE);
56385650 }
56395651
5652+static inline int bnx2x_func_send_switch_update(struct bnx2x *bp,
5653+ struct bnx2x_func_state_params *params)
5654+{
5655+ struct bnx2x_func_sp_obj *o = params->f_obj;
5656+ struct function_update_data *rdata =
5657+ (struct function_update_data *)o->rdata;
5658+ dma_addr_t data_mapping = o->rdata_mapping;
5659+ struct bnx2x_func_switch_update_params *switch_update_params =
5660+ &params->params.switch_update;
5661+
5662+ memset(rdata, 0, sizeof(*rdata));
5663+
5664+ /* Fill the ramrod data with provided parameters */
5665+ rdata->tx_switch_suspend_change_flg = 1;
5666+ rdata->tx_switch_suspend = switch_update_params->suspend;
5667+ rdata->echo = SWITCH_UPDATE;
5668+
5669+ return bnx2x_sp_post(bp, RAMROD_CMD_ID_COMMON_FUNCTION_UPDATE, 0,
5670+ U64_HI(data_mapping),
5671+ U64_LO(data_mapping), NONE_CONNECTION_TYPE);
5672+}
5673+
56405674 static inline int bnx2x_func_send_afex_update(struct bnx2x *bp,
56415675 struct bnx2x_func_state_params *params)
56425676 {
@@ -5657,6 +5691,7 @@ static inline int bnx2x_func_send_afex_update(struct bnx2x *bp, · 14 unmodified lines
56575691 cpu_to_le16(afex_update_params->afex_default_vlan);
56585692 rdata->allowed_priorities_change_flg = 1;
56595693 rdata->allowed_priorities = afex_update_params->allowed_priorities;
5694+ rdata->echo = AFEX_UPDATE;
56605695
56615696 /* No need for an explicit memory barrier here as long we would
56625697 * need to ensure the ordering of writing to the SPQ element
@@ -5773,6 +5808,8 @@ static int bnx2x_func_send_cmd(struct bnx2x *bp, · 110 unmodified lines
57735808 return bnx2x_func_send_tx_stop(bp, params);
57745809 case BNX2X_F_CMD_TX_START:
57755810 return bnx2x_func_send_tx_start(bp, params);
5811+ case BNX2X_F_CMD_SWITCH_UPDATE:
5812+ return bnx2x_func_send_switch_update(bp, params);
57765813 default:
57775814 BNX2X_ERR("Unknown command: %d\n", params->cmd);
57785815 return -EINVAL;
@@ -5818,16 +5855,30 @@ int bnx2x_func_state_change(struct bnx2x *bp, · 39 unmodified lines
58185855 struct bnx2x_func_state_params *params)
58195856 {
58205857 struct bnx2x_func_sp_obj *o = params->f_obj;
5821− int rc;
5858+ int rc, cnt = 300;
58225859 enum bnx2x_func_cmd cmd = params->cmd;
58235860 unsigned long *pending = &o->pending;
58245861
58255862 mutex_lock(&o->one_pending_mutex);
58265863
58275864 /* Check that the requested transition is legal */
5828− if (o->check_transition(bp, o, params)) {
5865+ rc = o->check_transition(bp, o, params);
5866+ if ((rc == -EBUSY) &&
5867+ (test_bit(RAMROD_RETRY, &params->ramrod_flags))) {
5868+ while ((rc == -EBUSY) && (--cnt > 0)) {
5869+ mutex_unlock(&o->one_pending_mutex);
5870+ msleep(10);
5871+ mutex_lock(&o->one_pending_mutex);
5872+ rc = o->check_transition(bp, o, params);
5873+ }
5874+ if (rc == -EBUSY) {
5875+ mutex_unlock(&o->one_pending_mutex);
5876+ BNX2X_ERR("timeout waiting for previous ramrod completion\n");
5877+ return rc;
5878+ }
5879+ } else if (rc) {
58295880 mutex_unlock(&o->one_pending_mutex);
5830− return -EINVAL;
5881+ return rc;
58315882 }
58325883
58335884 /* Set "pending" bit */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h+12−0
@@ -40,6 +40,12 @@ enum { · 39 unmodified lines
4040 * pending commands list.
4141 */
4242 RAMROD_CONT,
43+ /* If there is another pending ramrod, wait until it finishes and
44+ * re-try to submit this one. This flag can be set only in sleepable
45+ * context, and should not be set from the context that completes the
46+ * ramrods as deadlock will occur.
47+ */
48+ RAMROD_RETRY,
4349 };
4450
4551 typedef enum {
@@ -1061,6 +1067,7 @@ enum bnx2x_func_cmd { · 1015 unmodified lines
10611067 BNX2X_F_CMD_AFEX_VIFLISTS,
10621068 BNX2X_F_CMD_TX_STOP,
10631069 BNX2X_F_CMD_TX_START,
1070+ BNX2X_F_CMD_SWITCH_UPDATE,
10641071 BNX2X_F_CMD_MAX,
10651072 };
10661073
@@ -1103,6 +1110,10 @@ struct bnx2x_func_start_params { · 36 unmodified lines
11031110 u8 network_cos_mode;
11041111 };
11051112
1113+struct bnx2x_func_switch_update_params {
1114+ u8 suspend;
1115+};
1116+
11061117 struct bnx2x_func_afex_update_params {
11071118 u16 vif_id;
11081119 u16 afex_default_vlan;
@@ -1136,6 +1147,7 @@ struct bnx2x_func_state_params { · 27 unmodified lines
11361147 struct bnx2x_func_hw_init_params hw_init;
11371148 struct bnx2x_func_hw_reset_params hw_reset;
11381149 struct bnx2x_func_start_params start;
1150+ struct bnx2x_func_switch_update_params switch_update;
11391151 struct bnx2x_func_afex_update_params afex_update;
11401152 struct bnx2x_func_afex_viflists_params afex_viflists;
11411153 struct bnx2x_func_tx_start_params tx_start;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c+1−0
@@ -1149,6 +1149,7 @@ static void bnx2x_drv_stats_update(struct bnx2x *bp) · 1148 unmodified lines
11491149 UPDATE_ESTAT_QSTAT(rx_err_discard_pkt);
11501150 UPDATE_ESTAT_QSTAT(rx_skb_alloc_failed);
11511151 UPDATE_ESTAT_QSTAT(hw_csum_err);
1152+ UPDATE_ESTAT_QSTAT(driver_filtered_tx_pkt);
11521153 }
11531154 }
11541155
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h+3−0
@@ -203,6 +203,7 @@ struct bnx2x_eth_stats { · 202 unmodified lines
203203 /* Recovery */
204204 u32 recoverable_error;
205205 u32 unrecoverable_error;
206+ u32 driver_filtered_tx_pkt;
206207 /* src: Clear-on-Read register; Will not survive PMF Migration */
207208 u32 eee_tx_lpi;
208209 };
@@ -264,6 +265,7 @@ struct bnx2x_eth_q_stats { · 55 unmodified lines
264265 u32 total_tpa_aggregated_frames_lo;
265266 u32 total_tpa_bytes_hi;
266267 u32 total_tpa_bytes_lo;
268+ u32 driver_filtered_tx_pkt;
267269 };
268270
269271 struct bnx2x_eth_stats_old {
@@ -315,6 +317,7 @@ struct bnx2x_eth_q_stats_old { · 45 unmodified lines
315317 u32 rx_err_discard_pkt_old;
316318 u32 rx_skb_alloc_failed_old;
317319 u32 hw_csum_err_old;
320+ u32 driver_filtered_tx_pkt_old;
318321 };
319322
320323 struct bnx2x_net_stats_old {
drivers/net/ethernet/broadcom/cnic.c+102−87
@@ -40,8 +40,10 @@ · 39 unmodified lines
4040 #include <net/ip6_checksum.h>
4141 #include <scsi/iscsi_if.h>
4242
43+#define BCM_CNIC 1
4344 #include "cnic_if.h"
4445 #include "bnx2.h"
46+#include "bnx2x/bnx2x.h"
4547 #include "bnx2x/bnx2x_reg.h"
4648 #include "bnx2x/bnx2x_fw_defs.h"
4749 #include "bnx2x/bnx2x_hsi.h"
@@ -51,10 +53,10 @@ · 3 unmodified lines
5153 #include "cnic.h"
5254 #include "cnic_defs.h"
5355
54−#define DRV_MODULE_NAME "cnic"
56+#define CNIC_MODULE_NAME "cnic"
5557
56−static char version[] __devinitdata =
57− "Broadcom NetXtreme II CNIC Driver " DRV_MODULE_NAME " v" CNIC_MODULE_VERSION " (" CNIC_MODULE_RELDATE ")\n";
58+static char version[] =
59+ "Broadcom NetXtreme II CNIC Driver " CNIC_MODULE_NAME " v" CNIC_MODULE_VERSION " (" CNIC_MODULE_RELDATE ")\n";
5860
5961 MODULE_AUTHOR("Michael Chan <mchan@broadcom.com> and John(Zongxi) "
6062 "Chen (zongxi@broadcom.com");
@@ -724,7 +726,7 @@ static void cnic_free_dma(struct cnic_dev *dev, struct cnic_dma *dma) · 663 unmodified lines
724726
725727 for (i = 0; i < dma->num_pages; i++) {
726728 if (dma->pg_arr[i]) {
727− dma_free_coherent(&dev->pcidev->dev, BCM_PAGE_SIZE,
729+ dma_free_coherent(&dev->pcidev->dev, BNX2_PAGE_SIZE,
728730 dma->pg_arr[i], dma->pg_map_arr[i]);
729731 dma->pg_arr[i] = NULL;
730732 }
@@ -783,7 +785,7 @@ static int cnic_alloc_dma(struct cnic_dev *dev, struct cnic_dma *dma, · 52 unmodified lines
783785
784786 for (i = 0; i < pages; i++) {

506 more lines aren’t shown here.

drivers/net/ethernet/broadcom/cnic.h+8−22

This diff is large: its 74 lines aren’t shown here.

drivers/net/ethernet/broadcom/cnic_if.h+2−5

This diff is large: its 19 lines aren’t shown here.

drivers/net/ethernet/broadcom/sb1250-mac.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/broadcom/tg3.c+565−161

This diff is large: its 1584 lines aren’t shown here.

drivers/net/ethernet/broadcom/tg3.h+65−3

This diff is large: its 168 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bfa_ioc.c+0−4

This diff is large: its 32 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bfi_enet.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bna.h+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bna_hw_defs.h+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bna_tx_rx.c+89−49

This diff is large: its 314 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bna_types.h+3−6

This diff is large: its 49 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bnad.c+523−420

This diff is large: its 1333 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bnad.h+41−25

This diff is large: its 112 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/bnad_ethtool.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/brocade/bna/cna.h+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/ethernet/cadence/Kconfig+2−7

This diff is large: its 33 lines aren’t shown here.

drivers/net/ethernet/cadence/at91_ether.c+261−1022

This diff is large: its 1527 lines aren’t shown here.

drivers/net/ethernet/cadence/at91_ether.h+0−112

This diff is large: its 113 lines aren’t shown here.

drivers/net/ethernet/cadence/macb.c+391−173

This diff is large: its 1000 lines aren’t shown here.

drivers/net/ethernet/cadence/macb.h+60−7

This diff is large: its 169 lines aren’t shown here.

drivers/net/ethernet/calxeda/xgmac.c+26−33

This diff is large: its 198 lines aren’t shown here.

drivers/net/ethernet/chelsio/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb/cxgb2.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb/sge.c+2−15

This diff is large: its 38 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb/subr.c+6−7

This diff is large: its 41 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb/tp.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb3/common.h+3−4

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c+6−8

This diff is large: its 56 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+12−13

This diff is large: its 102 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb4/t4_hw.c+6−8

This diff is large: its 56 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c+11−11

This diff is large: its 85 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/cisco/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/Kconfig+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/cisco/enic/enic_main.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/davicom/dm9000.c+9−9

This diff is large: its 69 lines aren’t shown here.

drivers/net/ethernet/dec/ewrk3.c+1−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/de2104x.c+8−8

This diff is large: its 65 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/de4x5.c+9−9

This diff is large: its 74 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/dmfe.c+5−6

This diff is large: its 39 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/eeprom.c+5−5

This diff is large: its 45 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/media.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/tulip_core.c+5−7

This diff is large: its 47 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/uli526x.c+6−6

This diff is large: its 40 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/winbond-840.c+4−5

This diff is large: its 37 lines aren’t shown here.

drivers/net/ethernet/dec/tulip/xircom_cb.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/dlink/dl2k.c+5−19

This diff is large: its 54 lines aren’t shown here.

drivers/net/ethernet/dlink/sundance.c+87−8

This diff is large: its 207 lines aren’t shown here.

drivers/net/ethernet/dnet.c+4−7

This diff is large: its 46 lines aren’t shown here.

drivers/net/ethernet/emulex/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/Kconfig+1−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be.h+27−24

This diff is large: its 133 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be_cmds.c+391−18

This diff is large: its 555 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be_cmds.h+148−29

This diff is large: its 233 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be_ethtool.c+49−31

This diff is large: its 110 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be_hw.h+9−11

This diff is large: its 41 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be_main.c+509−340

This diff is large: its 1321 lines aren’t shown here.

drivers/net/ethernet/emulex/benet/be_roce.c+1−4

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/ethoc.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/fealnx.c+6−6

This diff is large: its 47 lines aren’t shown here.

drivers/net/ethernet/freescale/Kconfig+9−0

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/freescale/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/freescale/fec.c+92−79

This diff is large: its 317 lines aren’t shown here.

drivers/net/ethernet/freescale/fec.h+119−0

This diff is large: its 140 lines aren’t shown here.

drivers/net/ethernet/freescale/fec_mpc52xx.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/freescale/fec_ptp.c+383−0

This diff is large: its 384 lines aren’t shown here.

drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/freescale/fs_enet/mii-bitbang.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/net/ethernet/freescale/fs_enet/mii-fec.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/freescale/gianfar.c+8−6

This diff is large: its 49 lines aren’t shown here.

drivers/net/ethernet/freescale/xgmac_mdio.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/hp/hp100.c+9−9

This diff is large: its 65 lines aren’t shown here.

drivers/net/ethernet/i825xx/ether1.c+7−13

This diff is large: its 76 lines aren’t shown here.

drivers/net/ethernet/i825xx/lasi_82596.c+4−4

This diff is large: its 31 lines aren’t shown here.

drivers/net/ethernet/i825xx/lib82596.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/i825xx/sni_82596.c+4−4

This diff is large: its 35 lines aren’t shown here.

drivers/net/ethernet/ibm/Kconfig+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/net/ethernet/ibm/ehea/ehea_main.c+8−8

This diff is large: its 52 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/core.c+12−12

This diff is large: its 83 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/mal.c+5−8

This diff is large: its 44 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/rgmii.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/tah.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/ibm/emac/zmii.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/ibm/ibmveth.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/icplus/ipg.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/intel/Kconfig+3−27

This diff is large: its 59 lines aren’t shown here.

drivers/net/ethernet/intel/e100.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/intel/e1000/e1000_hw.c+15−2

This diff is large: its 62 lines aren’t shown here.

drivers/net/ethernet/intel/e1000/e1000_main.c+6−7

This diff is large: its 55 lines aren’t shown here.

drivers/net/ethernet/intel/e1000/e1000_param.c+7−7

This diff is large: its 49 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/80003es2lan.c+23−43

This diff is large: its 220 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/82571.c+38−77

This diff is large: its 374 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/defines.h+9−18

This diff is large: its 87 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/e1000.h+5−12

This diff is large: its 52 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/ethtool.c+24−45

This diff is large: its 223 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/hw.h+2−4

This diff is large: its 20 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/ich8lan.c+81−162

This diff is large: its 801 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/mac.c+45−90

This diff is large: its 433 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/manage.c+3−6

This diff is large: its 30 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/netdev.c+132−199

This diff is large: its 1039 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/nvm.c+5−10

This diff is large: its 50 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/param.c+21−39

This diff is large: its 188 lines aren’t shown here.

drivers/net/ethernet/intel/e1000e/phy.c+47−94

This diff is large: its 458 lines aren’t shown here.

drivers/net/ethernet/intel/igb/Makefile+1−3

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_82575.c+58−19

This diff is large: its 148 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_82575.h+3−0

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_defines.h+22−0

This diff is large: its 57 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_i210.c+241−128

This diff is large: its 438 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_i210.h+17−0

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_mac.c+128−0

This diff is large: its 149 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_mac.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_nvm.c+83−16

This diff is large: its 132 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_nvm.h+16−0

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_phy.c+37−12

This diff is large: its 65 lines aren’t shown here.

drivers/net/ethernet/intel/igb/e1000_phy.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/intel/igb/igb.h+65−47

This diff is large: its 222 lines aren’t shown here.

drivers/net/ethernet/intel/igb/igb_ethtool.c+328−78

This diff is large: its 503 lines aren’t shown here.

drivers/net/ethernet/intel/igb/igb_main.c+962−612

This diff is large: its 2269 lines aren’t shown here.

drivers/net/ethernet/intel/igb/igb_ptp.c+58−44

This diff is large: its 154 lines aren’t shown here.

drivers/net/ethernet/intel/igbvf/defines.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/intel/igbvf/igbvf.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/intel/igbvf/netdev.c+32−9

This diff is large: its 115 lines aren’t shown here.

drivers/net/ethernet/intel/ixgb/ixgb_main.c+5−5

This diff is large: its 45 lines aren’t shown here.

drivers/net/ethernet/intel/ixgb/ixgb_param.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/Makefile+1−2

This diff is large: its 13 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe.h+7−8

This diff is large: its 82 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c+130−30

This diff is large: its 249 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_common.c+69−31

This diff is large: its 184 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_common.h+2−1

This diff is large: its 19 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_debugfs.c+48−67

This diff is large: its 200 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c+55−54

This diff is large: its 185 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c+4−0

This diff is large: its 11 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c+20−2

This diff is large: its 38 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+257−161

This diff is large: its 911 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_mbx.h+29−2

This diff is large: its 42 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c+65−99

This diff is large: its 313 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c+328−142

This diff is large: its 613 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h+3−9

This diff is large: its 33 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbevf/defines.h+5−2

This diff is large: its 14 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbevf/ixgbevf.h+9−7

This diff is large: its 51 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+273−130

This diff is large: its 846 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbevf/mbx.h+10−0

This diff is large: its 24 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbevf/vf.c+61−0

This diff is large: its 75 lines aren’t shown here.

drivers/net/ethernet/intel/ixgbevf/vf.h+2−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/jme.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/lantiq_etop.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/marvell/pxa168_eth.c+3−4

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/marvell/skge.c+4−5

This diff is large: its 37 lines aren’t shown here.

drivers/net/ethernet/marvell/sky2.c+17−18

This diff is large: its 120 lines aren’t shown here.

drivers/net/ethernet/mellanox/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/Kconfig+1−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/en_ethtool.c+116−39

This diff is large: its 257 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/en_main.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/en_netdev.c+16−12

This diff is large: its 82 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/en_rx.c+3−6

This diff is large: its 31 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/en_tx.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/main.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/mellanox/mlx4/mlx4_en.h+8−19

This diff is large: its 75 lines aren’t shown here.

drivers/net/ethernet/micrel/ks8695net.c+5−8

This diff is large: its 55 lines aren’t shown here.

drivers/net/ethernet/micrel/ks8842.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/micrel/ks8851.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/micrel/ks8851_mll.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/micrel/ksz884x.c+3−15

This diff is large: its 39 lines aren’t shown here.

drivers/net/ethernet/microchip/enc28j60.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/myricom/Kconfig+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/myricom/myri10ge/myri10ge.c+79−206

This diff is large: its 448 lines aren’t shown here.

drivers/net/ethernet/natsemi/ibmlana.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/natsemi/jazzsonic.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/natsemi/macsonic.c+10−11

This diff is large: its 84 lines aren’t shown here.

drivers/net/ethernet/natsemi/natsemi.c+6−7

This diff is large: its 55 lines aren’t shown here.

drivers/net/ethernet/natsemi/ns83820.c+4−4

This diff is large: its 29 lines aren’t shown here.

drivers/net/ethernet/natsemi/xtsonic.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/neterion/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/neterion/s2io.c+6−5

This diff is large: its 46 lines aren’t shown here.

drivers/net/ethernet/neterion/s2io.h+2−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/ethernet/neterion/vxge/vxge-config.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/neterion/vxge/vxge-config.h+3−3

This diff is large: its 23 lines aren’t shown here.

drivers/net/ethernet/neterion/vxge/vxge-main.c+12−15

This diff is large: its 83 lines aren’t shown here.

drivers/net/ethernet/nuvoton/w90p910_ether.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/nvidia/forcedeth.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/nxp/lpc_eth.c+2−4

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/octeon/octeon_mgmt.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/oki-semi/pch_gbe/Kconfig+1−16

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h+0−2

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c+0−14

This diff is large: its 89 lines aren’t shown here.

drivers/net/ethernet/packetengines/hamachi.c+6−6

This diff is large: its 47 lines aren’t shown here.

drivers/net/ethernet/packetengines/yellowfin.c+6−6

This diff is large: its 47 lines aren’t shown here.

drivers/net/ethernet/pasemi/pasemi_mac.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c+50−43

This diff is large: its 156 lines aren’t shown here.

drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c+5−5

This diff is large: its 39 lines aren’t shown here.

drivers/net/ethernet/qlogic/qla3xxx.c+5−19

This diff is large: its 65 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/Makefile+2−1

This diff is large: its 7 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic.h+194−327

This diff is large: its 752 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c+70−44

This diff is large: its 311 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c+38−35

This diff is large: its 239 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h+24−32

This diff is large: its 103 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c+163−586

This diff is large: its 944 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_init.c+114−738

This diff is large: its 1109 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c+1309−0

This diff is large: its 1310 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c+316−1870

This diff is large: its 2800 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c+629−0

This diff is large: its 630 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c+960−0

This diff is large: its 961 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlge/qlge_dbg.c+8−8

This diff is large: its 72 lines aren’t shown here.

drivers/net/ethernet/qlogic/qlge/qlge_main.c+6−6

This diff is large: its 40 lines aren’t shown here.

drivers/net/ethernet/rdc/r6040.c+4−5

This diff is large: its 37 lines aren’t shown here.

drivers/net/ethernet/realtek/8139cp.c+44−31

This diff is large: its 166 lines aren’t shown here.

drivers/net/ethernet/realtek/8139too.c+7−7

This diff is large: its 56 lines aren’t shown here.

drivers/net/ethernet/realtek/atp.c+2−56

This diff is large: its 86 lines aren’t shown here.

drivers/net/ethernet/realtek/atp.h+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/realtek/r8169.c+103−67

This diff is large: its 451 lines aren’t shown here.

drivers/net/ethernet/renesas/sh_eth.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/s6gmac.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/seeq/ether3.c+8−14

This diff is large: its 85 lines aren’t shown here.

drivers/net/ethernet/seeq/sgiseeq.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/sfc/Kconfig+2−8

This diff is large: its 24 lines aren’t shown here.

drivers/net/ethernet/sfc/Makefile+1−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/ethernet/sfc/efx.c+8−8

This diff is large: its 51 lines aren’t shown here.

drivers/net/ethernet/sfc/efx.h+13−0

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/sfc/ethtool.c+14−11

This diff is large: its 59 lines aren’t shown here.

drivers/net/ethernet/sfc/falcon.c+2−0

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/sfc/io.h+14−29

This diff is large: its 58 lines aren’t shown here.

drivers/net/ethernet/sfc/mcdi.c+15−8

This diff is large: its 86 lines aren’t shown here.

drivers/net/ethernet/sfc/net_driver.h+3−2

This diff is large: its 34 lines aren’t shown here.

drivers/net/ethernet/sfc/nic.c+66−15

This diff is large: its 164 lines aren’t shown here.

drivers/net/ethernet/sfc/nic.h+2−26

This diff is large: its 49 lines aren’t shown here.

drivers/net/ethernet/sfc/rx.c+1−5

This diff is large: its 30 lines aren’t shown here.

drivers/net/ethernet/sfc/selftest.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/sfc/siena.c+15−2

This diff is large: its 38 lines aren’t shown here.

drivers/net/ethernet/sfc/siena_sriov.c+3−5

This diff is large: its 29 lines aren’t shown here.

drivers/net/ethernet/sgi/ioc3-eth.c+5−6

This diff is large: its 46 lines aren’t shown here.

drivers/net/ethernet/sgi/meth.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/silan/sc92031.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/sis/sis190.c+13−14

This diff is large: its 91 lines aren’t shown here.

drivers/net/ethernet/sis/sis900.c+15−14

This diff is large: its 99 lines aren’t shown here.

drivers/net/ethernet/smsc/epic100.c+6−7

This diff is large: its 49 lines aren’t shown here.

drivers/net/ethernet/smsc/smc911x.c+5−15

This diff is large: its 62 lines aren’t shown here.

drivers/net/ethernet/smsc/smc911x.h+8−8

This diff is large: its 49 lines aren’t shown here.

drivers/net/ethernet/smsc/smc91x.c+6−16

This diff is large: its 64 lines aren’t shown here.

drivers/net/ethernet/smsc/smc91x.h+10−10

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/smsc/smsc911x.c+13−19

This diff is large: its 116 lines aren’t shown here.

drivers/net/ethernet/smsc/smsc9420.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/Kconfig+0−25

This diff is large: its 32 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/Makefile+0−1

This diff is large: its 6 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/common.h+30−9

This diff is large: its 89 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/dwmac1000.h+0−3

This diff is large: its 9 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c+6−0

This diff is large: its 18 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h+4−3

This diff is large: its 21 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/dwmac_lib.c+16−4

This diff is large: its 33 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac.h+7−7

This diff is large: its 41 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c+94−6

This diff is large: its 135 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+108−153

This diff is large: its 464 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c+4−4

This diff is large: its 29 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c+7−7

This diff is large: its 35 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac_timer.c+0−134

This diff is large: its 135 lines aren’t shown here.

drivers/net/ethernet/stmicro/stmmac/stmmac_timer.h+0−46

This diff is large: its 47 lines aren’t shown here.

drivers/net/ethernet/sun/cassini.c+6−7

This diff is large: its 55 lines aren’t shown here.

drivers/net/ethernet/sun/niu.c+56−65

This diff is large: its 431 lines aren’t shown here.

drivers/net/ethernet/sun/sunbmac.c+5−5

This diff is large: its 38 lines aren’t shown here.

drivers/net/ethernet/sun/sungem.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/ethernet/sun/sunhme.c+10−10

This diff is large: its 83 lines aren’t shown here.

drivers/net/ethernet/sun/sunqe.c+6−6

This diff is large: its 51 lines aren’t shown here.

drivers/net/ethernet/sun/sunvnet.c+7−8

This diff is large: its 63 lines aren’t shown here.

drivers/net/ethernet/tehuti/tehuti.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/ti/Kconfig+9−0

This diff is large: its 16 lines aren’t shown here.

drivers/net/ethernet/ti/Makefile+1−1

This diff is large: its 6 lines aren’t shown here.

drivers/net/ethernet/ti/cpmac.c+5−5

This diff is large: its 40 lines aren’t shown here.

drivers/net/ethernet/ti/cpsw.c+466−169

This diff is large: its 989 lines aren’t shown here.

drivers/net/ethernet/ti/cpsw_ale.c+28−3

This diff is large: its 46 lines aren’t shown here.

drivers/net/ethernet/ti/cpsw_ale.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/ethernet/ti/cpts.c+427−0

This diff is large: its 428 lines aren’t shown here.

drivers/net/ethernet/ti/cpts.h+146−0

This diff is large: its 147 lines aren’t shown here.

drivers/net/ethernet/ti/davinci_emac.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/ti/davinci_mdio.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/ti/tlan.c+5−6

This diff is large: its 39 lines aren’t shown here.

drivers/net/ethernet/toshiba/ps3_gelic_net.c+10−12

This diff is large: its 71 lines aren’t shown here.

drivers/net/ethernet/toshiba/ps3_gelic_wireless.c+5−5

This diff is large: its 45 lines aren’t shown here.

drivers/net/ethernet/toshiba/spider_net.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ethernet/toshiba/tc35815.c+9−9

This diff is large: its 72 lines aren’t shown here.

drivers/net/ethernet/via/via-rhine.c+6−7

This diff is large: its 55 lines aren’t shown here.

drivers/net/ethernet/via/via-velocity.c+16−12

This diff is large: its 98 lines aren’t shown here.

drivers/net/ethernet/wiznet/w5100.c+4−6

This diff is large: its 45 lines aren’t shown here.

drivers/net/ethernet/wiznet/w5300.c+4−6

This diff is large: its 45 lines aren’t shown here.

drivers/net/ethernet/xilinx/ll_temac_main.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/xilinx/xilinx_axienet_main.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/xilinx/xilinx_emaclite.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/ethernet/xscale/ixp4xx_eth.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/fddi/defxx.c+22−24

This diff is large: its 156 lines aren’t shown here.

drivers/net/fddi/skfp/skfddi.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/hippi/rrunner.c+5−6

This diff is large: its 46 lines aren’t shown here.

drivers/net/hyperv/rndis_filter.c+4−6

This diff is large: its 25 lines aren’t shown here.

drivers/net/ieee802154/at86rf230.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ieee802154/fakehard.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ieee802154/fakelb.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ieee802154/mrf24j40.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/irda/au1k_ir.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/irda/bfin_sir.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/irda/ep7211-sir.c+27−46

This diff is large: its 109 lines aren’t shown here.

drivers/net/irda/sh_irda.c+3−7

This diff is large: its 39 lines aren’t shown here.

drivers/net/irda/sh_sir.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/irda/smsc-ircc2.c+3−3

This diff is large: its 20 lines aren’t shown here.

drivers/net/irda/via-ircc.c+7−8

This diff is large: its 57 lines aren’t shown here.

drivers/net/irda/vlsi_ir.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/netconsole.c+6−0

This diff is large: its 20 lines aren’t shown here.

drivers/net/phy/davicom.c+6−0

This diff is large: its 25 lines aren’t shown here.

drivers/net/phy/dp83640.c+77−1

This diff is large: its 103 lines aren’t shown here.

drivers/net/phy/mdio-gpio.c+7−7

This diff is large: its 49 lines aren’t shown here.

drivers/net/phy/mdio-mux-gpio.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/phy/mdio-mux-mmioreg.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/phy/mdio-octeon.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/phy/mdio_bus.c+14−0

This diff is large: its 25 lines aren’t shown here.

drivers/net/phy/micrel.c+44−0

This diff is large: its 65 lines aren’t shown here.

drivers/net/phy/smsc.c+68−27

This diff is large: its 121 lines aren’t shown here.

drivers/net/phy/spi_ks8995.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/ppp/ppp_generic.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/tun.c+640−235

This diff is large: its 1426 lines aren’t shown here.

drivers/net/usb/Kconfig+22−0

This diff is large: its 43 lines aren’t shown here.

drivers/net/usb/Makefile+1−0

This diff is large: its 6 lines aren’t shown here.

drivers/net/usb/asix_common.c+13−104

This diff is large: its 135 lines aren’t shown here.

drivers/net/usb/asix_devices.c+16−3

This diff is large: its 47 lines aren’t shown here.

drivers/net/usb/cdc_mbim.c+412−0

This diff is large: its 413 lines aren’t shown here.

drivers/net/usb/cdc_ncm.c+293−352

This diff is large: its 958 lines aren’t shown here.

drivers/net/usb/dm9601.c+15−92

This diff is large: its 135 lines aren’t shown here.

drivers/net/usb/int51x1.c+3−49

This diff is large: its 68 lines aren’t shown here.

drivers/net/usb/mcs7830.c+6−79

This diff is large: its 100 lines aren’t shown here.

drivers/net/usb/net1080.c+30−80

This diff is large: its 178 lines aren’t shown here.

drivers/net/usb/plusb.c+4−7

This diff is large: its 18 lines aren’t shown here.

drivers/net/usb/sierra_net.c+18−29

This diff is large: its 70 lines aren’t shown here.

drivers/net/usb/smsc75xx.c+1095−311

This diff is large: its 2150 lines aren’t shown here.

drivers/net/usb/smsc95xx.c+807−281

This diff is large: its 1582 lines aren’t shown here.

drivers/net/usb/smsc95xx.h+25−0

This diff is large: its 48 lines aren’t shown here.

drivers/net/usb/usbnet.c+196−0

This diff is large: its 203 lines aren’t shown here.

drivers/net/veth.c+2−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/virtio_net.c+546−196

This diff is large: its 1288 lines aren’t shown here.

drivers/net/vmxnet3/vmxnet3_drv.c+21−21

This diff is large: its 133 lines aren’t shown here.

drivers/net/vxlan.c+257−29

This diff is large: its 435 lines aren’t shown here.

drivers/net/wan/Makefile+2−2

This diff is large: its 12 lines aren’t shown here.

drivers/net/wan/dscc4.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/wan/farsync.c+5−5

This diff is large: its 45 lines aren’t shown here.

drivers/net/wan/hd64570.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/net/wan/hd64572.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/net/wan/ixp4xx_hss.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wan/lmc/lmc_main.c+3−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/wan/pc300too.c+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/wan/pci200syn.c+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/wan/wanxl.c+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/wan/wanxlfw.S+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/adm8211.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/airo.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/at76c50x-usb.c+40−45

This diff is large: its 223 lines aren’t shown here.

drivers/net/wireless/ath/Kconfig+6−2

This diff is large: its 25 lines aren’t shown here.

drivers/net/wireless/ath/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ath/ar5523/Kconfig+8−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ar5523/Makefile+1−0

This diff is large: its 2 lines aren’t shown here.

drivers/net/wireless/ath/ar5523/ar5523.c+1798−0

This diff is large: its 1799 lines aren’t shown here.

drivers/net/wireless/ath/ar5523/ar5523.h+152−0

This diff is large: its 153 lines aren’t shown here.

drivers/net/wireless/ath/ar5523/ar5523_hw.h+431−0

This diff is large: its 432 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/ahb.c+1−14

This diff is large: its 19 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/base.c+11−20

This diff is large: its 82 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/led.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/mac80211-ops.c+4−3

This diff is large: its 21 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/pci.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/ath/ath5k/reset.c+3−3

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/Kconfig+9−0

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/cfg80211.c+264−146

This diff is large: its 747 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/cfg80211.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/core.c+21−0

This diff is large: its 49 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/core.h+67−2

This diff is large: its 146 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/debug.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/hif.c+3−9

This diff is large: its 40 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/htc_mbox.c+3−10

This diff is large: its 34 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/htc_pipe.c+6−8

This diff is large: its 28 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/init.c+78−14

This diff is large: its 187 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/main.c+46−9

This diff is large: its 111 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/recovery.c+160−0

This diff is large: its 161 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/sdio.c+7−20

This diff is large: its 57 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/txrx.c+33−14

This diff is large: its 102 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/usb.c+26−6

This diff is large: its 71 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/wmi.c+220−64

This diff is large: its 470 lines aren’t shown here.

drivers/net/wireless/ath/ath6kl/wmi.h+69−9

This diff is large: its 190 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_2p2_initvals.h+86−86

This diff is large: its 185 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_calib.c+81−0

This diff is large: its 102 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_eeprom.c+54−32

This diff is large: its 209 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_eeprom.h+3−3

This diff is large: its 17 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_hw.c+17−13

This diff is large: its 81 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_mci.c+64−7

This diff is large: its 157 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_mci.h+7−1

This diff is large: its 43 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_paprd.c+64−23

This diff is large: its 164 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_phy.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9003_phy.h+54−22

This diff is large: its 140 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9340_initvals.h+4−2

This diff is large: its 21 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9485_initvals.h+275−63

This diff is large: its 447 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ar9565_1p0_initvals.h+2−2

This diff is large: its 12 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/ath9k.h+29−15

This diff is large: its 124 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/beacon.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/btcoex.c+46−17

This diff is large: its 93 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/btcoex.h+8−0

This diff is large: its 42 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/calib.c+2−0

This diff is large: its 16 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/calib.h+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/common.h+0−8

This diff is large: its 19 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/debug.c+287−152

This diff is large: its 523 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/debug.h+32−1

This diff is large: its 54 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c+9−3

This diff is large: its 39 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/eeprom.c+27−2

This diff is large: its 37 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/eeprom.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/eeprom_4k.c+2−6

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/eeprom_9287.c+2−7

This diff is large: its 29 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/eeprom_def.c+3−7

This diff is large: its 29 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/gpio.c+113−23

This diff is large: its 203 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc.h+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc_drv_beacon.c+4−4

This diff is large: its 22 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc_drv_debug.c+4−4

This diff is large: its 21 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc_drv_gpio.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc_drv_init.c+21−4

This diff is large: its 56 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc_drv_main.c+14−30

This diff is large: its 93 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/htc_drv_txrx.c+14−14

This diff is large: its 70 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/hw.c+7−8

This diff is large: its 43 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/hw.h+8−5

This diff is large: its 78 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/init.c+61−6

This diff is large: its 123 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/link.c+27−12

This diff is large: its 98 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/main.c+38−165

This diff is large: its 306 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/mci.c+192−19

This diff is large: its 278 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/mci.h+36−0

This diff is large: its 78 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/pci.c+4−23

This diff is large: its 61 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/rc.c+31−22

This diff is large: its 91 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/rc.h+16−0

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/recv.c+5−2

This diff is large: its 21 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/reg.h+9−4

This diff is large: its 32 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/wow.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ath/ath9k/xmit.c+11−10

This diff is large: its 77 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/fw.c+0−5

This diff is large: its 12 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/mac.c+18−3

This diff is large: its 35 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/rx.c+37−16

This diff is large: its 104 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/tx.c+7−0

This diff is large: its 14 lines aren’t shown here.

drivers/net/wireless/ath/carl9170/usb.c+7−0

This diff is large: its 14 lines aren’t shown here.

drivers/net/wireless/ath/hw.c+10−10

This diff is large: its 50 lines aren’t shown here.

drivers/net/wireless/atmel_pci.c+3−3

This diff is large: its 23 lines aren’t shown here.

drivers/net/wireless/b43/dma.c+5−2

This diff is large: its 21 lines aren’t shown here.

drivers/net/wireless/b43/main.c+9−5

This diff is large: its 42 lines aren’t shown here.

drivers/net/wireless/b43/pcmcia.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/b43/pio.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/b43/sdio.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/b43/xmit.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/b43legacy/b43legacy.h+5−0

This diff is large: its 19 lines aren’t shown here.

drivers/net/wireless/b43legacy/main.c+31−6

This diff is large: its 81 lines aren’t shown here.

drivers/net/wireless/b43legacy/xmit.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/brcm80211/Kconfig+9−6

This diff is large: its 23 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/Makefile+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c+21−37

This diff is large: its 245 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c+94−88

This diff is large: its 365 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd.h+58−198

This diff is large: its 396 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h+74−24

This diff is large: its 129 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c+11−115

This diff is large: its 209 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c+166−727

This diff is large: its 1036 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c+4−5

This diff is large: its 28 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h+27−19

This diff is large: its 77 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c+206−510

This diff is large: its 1116 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h+2−13

This diff is large: its 28 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c+293−286

This diff is large: its 1700 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/fweh.c+447−0

This diff is large: its 448 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/fweh.h+215−0

This diff is large: its 216 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/fwil.c+344−0

This diff is large: its 345 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/fwil.h+39−0

This diff is large: its 40 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c+7−7

This diff is large: its 63 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/usb.c+175−229

This diff is large: its 1076 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/usb.h+5−13

This diff is large: its 25 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c+986−1966

This diff is large: its 5248 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h+103−225

This diff is large: its 472 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/Makefile+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/aiutils.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/ampdu.c+319−404

This diff is large: its 946 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/ampdu.h+26−3

This diff is large: its 38 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/antsel.c+3−1

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h+169−6

This diff is large: its 207 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/channel.c+5−5

This diff is large: its 38 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/debug.c+156−0

This diff is large: its 157 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/debug.h+75−0

This diff is large: its 76 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/dma.c+227−118

This diff is large: its 631 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/dma.h+7−4

This diff is large: its 28 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c+82−75

This diff is large: its 455 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/main.c+394−867

This diff is large: its 2475 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/main.h+2−46

This diff is large: its 114 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c+291−180

This diff is large: its 688 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/phy/phytbl_lcn.c+32−32

This diff is large: its 103 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/pub.h+3−39

This diff is large: its 64 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/stf.c+5−3

This diff is large: its 29 lines aren’t shown here.

drivers/net/wireless/brcm80211/brcmsmac/types.h+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/wireless/brcm80211/include/defs.h+8−3

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/hostap/hostap_80211_rx.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ipw2x00/ipw2100.c+3−6

This diff is large: its 30 lines aren’t shown here.

drivers/net/wireless/ipw2x00/ipw2200.c+28−24

This diff is large: its 111 lines aren’t shown here.

drivers/net/wireless/ipw2x00/libipw.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ipw2x00/libipw_geo.c+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/wireless/ipw2x00/libipw_rx.c+3−3

This diff is large: its 20 lines aren’t shown here.

drivers/net/wireless/iwlegacy/3945-mac.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/iwlegacy/3945.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/iwlegacy/4965-mac.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/iwlegacy/common.h+2−3

This diff is large: its 12 lines aren’t shown here.

drivers/net/wireless/iwlwifi/Kconfig+0−9

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/agn.h+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/calib.c+7−7

This diff is large: its 60 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/commands.h+3−4

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/debugfs.c+7−7

This diff is large: its 51 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/dev.h+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/devices.c+4−4

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/lib.c+24−25

This diff is large: its 92 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/mac80211.c+15−13

This diff is large: its 76 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/main.c+37−41

This diff is large: its 217 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/rs.c+22−22

This diff is large: its 160 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/rx.c+2−4

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/rxon.c+2−2

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/scan.c+7−6

This diff is large: its 45 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/sta.c+6−6

This diff is large: its 30 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/tx.c+30−46

This diff is large: its 164 lines aren’t shown here.

drivers/net/wireless/iwlwifi/dvm/ucode.c+7−7

This diff is large: its 49 lines aren’t shown here.

drivers/net/wireless/iwlwifi/iwl-config.h+5−5

This diff is large: its 31 lines aren’t shown here.

drivers/net/wireless/iwlwifi/iwl-devtrace.h+121−8

This diff is large: its 183 lines aren’t shown here.

drivers/net/wireless/iwlwifi/iwl-drv.c+3−3

This diff is large: its 33 lines aren’t shown here.

drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c+57−29

This diff is large: its 197 lines aren’t shown here.

drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h+19−26

This diff is large: its 79 lines aren’t shown here.

drivers/net/wireless/iwlwifi/iwl-fh.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/iwlwifi/iwl-io.c+22−22

This diff is large: its 119 lines aren’t shown here.

drivers/net/wireless/iwlwifi/iwl-io.h+6−6

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/iwlwifi/iwl-prph.h+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/iwlwifi/iwl-trans.h+43−14

This diff is large: its 160 lines aren’t shown here.

drivers/net/wireless/iwlwifi/pcie/1000.c+4−4

This diff is large: its 22 lines aren’t shown here.

drivers/net/wireless/iwlwifi/pcie/2000.c+8−8

This diff is large: its 44 lines aren’t shown here.

drivers/net/wireless/iwlwifi/pcie/5000.c+6−6

This diff is large: its 33 lines aren’t shown here.

drivers/net/wireless/iwlwifi/pcie/6000.c+14−14

This diff is large: its 77 lines aren’t shown here.

drivers/net/wireless/iwlwifi/pcie/drv.c+10−6

This diff is large: its 56 lines aren’t shown here.

drivers/net/wireless/iwlwifi/pcie/internal.h+64−53

This diff is large: its 244 lines aren’t shown here.

drivers/net/wireless/iwlwifi/pcie/rx.c+307−106

This diff is large: its 763 lines aren’t shown here.

drivers/net/wireless/iwlwifi/pcie/trans.c+95−969

This diff is large: its 1474 lines aren’t shown here.

drivers/net/wireless/iwlwifi/pcie/tx.c+997−262

This diff is large: its 1634 lines aren’t shown here.

drivers/net/wireless/libertas/cfg.c+20−13

This diff is large: its 139 lines aren’t shown here.

drivers/net/wireless/libertas/if_sdio.c+30−9

This diff is large: its 48 lines aren’t shown here.

drivers/net/wireless/libertas/if_spi.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/libertas/mesh.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/mac80211_hwsim.c+473−112

This diff is large: its 946 lines aren’t shown here.

drivers/net/wireless/mwifiex/11n_aggr.c+4−4

This diff is large: its 34 lines aren’t shown here.

drivers/net/wireless/mwifiex/11n_rxreorder.c+3−5

This diff is large: its 29 lines aren’t shown here.

drivers/net/wireless/mwifiex/Kconfig+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/mwifiex/cfg80211.c+55−34

This diff is large: its 247 lines aren’t shown here.

drivers/net/wireless/mwifiex/cmdevt.c+15−9

This diff is large: its 44 lines aren’t shown here.

drivers/net/wireless/mwifiex/debugfs.c+8−2

This diff is large: its 24 lines aren’t shown here.

drivers/net/wireless/mwifiex/fw.h+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/mwifiex/init.c+28−11

This diff is large: its 67 lines aren’t shown here.

drivers/net/wireless/mwifiex/join.c+2−4

This diff is large: its 20 lines aren’t shown here.

drivers/net/wireless/mwifiex/main.c+41−53

This diff is large: its 162 lines aren’t shown here.

drivers/net/wireless/mwifiex/main.h+8−11

This diff is large: its 91 lines aren’t shown here.

drivers/net/wireless/mwifiex/scan.c+36−19

This diff is large: its 129 lines aren’t shown here.

drivers/net/wireless/mwifiex/sdio.c+36−3

This diff is large: its 74 lines aren’t shown here.

drivers/net/wireless/mwifiex/sdio.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/mwifiex/sta_cmdresp.c+0−4

This diff is large: its 11 lines aren’t shown here.

drivers/net/wireless/mwifiex/sta_event.c+3−7

This diff is large: its 38 lines aren’t shown here.

drivers/net/wireless/mwifiex/sta_ioctl.c+32−17

This diff is large: its 135 lines aren’t shown here.

drivers/net/wireless/mwifiex/sta_rx.c+8−18

This diff is large: its 77 lines aren’t shown here.

drivers/net/wireless/mwifiex/txrx.c+25−13

This diff is large: its 81 lines aren’t shown here.

drivers/net/wireless/mwifiex/uap_cmd.c+10−1

This diff is large: its 21 lines aren’t shown here.

drivers/net/wireless/mwifiex/uap_event.c+7−0

This diff is large: its 19 lines aren’t shown here.

drivers/net/wireless/mwifiex/uap_txrx.c+5−12

This diff is large: its 54 lines aren’t shown here.

drivers/net/wireless/mwifiex/usb.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/mwifiex/util.c+3−16

This diff is large: its 53 lines aren’t shown here.

drivers/net/wireless/mwifiex/wmm.c+6−6

This diff is large: its 54 lines aren’t shown here.

drivers/net/wireless/mwifiex/wmm.h+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/mwl8k.c+50−21

This diff is large: its 200 lines aren’t shown here.

drivers/net/wireless/orinoco/cfg.c+5−6

This diff is large: its 30 lines aren’t shown here.

drivers/net/wireless/orinoco/main.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/orinoco/orinoco_nortel.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/orinoco/orinoco_pci.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/orinoco/orinoco_plx.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/orinoco/orinoco_tmd.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/orinoco/orinoco_usb.c+4−5

This diff is large: its 37 lines aren’t shown here.

drivers/net/wireless/p54/eeprom.c+3−2

This diff is large: its 12 lines aren’t shown here.

drivers/net/wireless/p54/p54pci.c+6−13

This diff is large: its 56 lines aren’t shown here.

drivers/net/wireless/p54/p54spi.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/p54/p54usb.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/p54/txrx.c+5−1

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/rndis_wlan.c+9−3

This diff is large: its 42 lines aren’t shown here.

drivers/net/wireless/rt2x00/rt2400pci.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/rt2x00/rt2500pci.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/rt2x00/rt2800.h+4−2

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/rt2x00/rt2800lib.c+150−95

This diff is large: its 396 lines aren’t shown here.

drivers/net/wireless/rt2x00/rt2800pci.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/rt2x00/rt2800usb.c+2−0

This diff is large: its 16 lines aren’t shown here.

drivers/net/wireless/rt2x00/rt2x00dev.c+23−13

This diff is large: its 85 lines aren’t shown here.

drivers/net/wireless/rt2x00/rt2x00mac.c+3−3

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/rt2x00/rt61pci.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/rtl818x/rtl8180/dev.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/rtl818x/rtl8187/dev.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/rtlwifi/Kconfig+11−0

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/rtlwifi/Makefile+3−1

This diff is large: its 17 lines aren’t shown here.

drivers/net/wireless/rtlwifi/base.c+24−0

This diff is large: its 31 lines aren’t shown here.

drivers/net/wireless/rtlwifi/base.h+2−0

This diff is large: its 7 lines aren’t shown here.

drivers/net/wireless/rtlwifi/cam.c+3−6

This diff is large: its 23 lines aren’t shown here.

drivers/net/wireless/rtlwifi/core.c+2−3

This diff is large: its 26 lines aren’t shown here.

drivers/net/wireless/rtlwifi/debug.h+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/rtlwifi/pci.c+18−6

This diff is large: its 80 lines aren’t shown here.

drivers/net/wireless/rtlwifi/pci.h+5−1

This diff is large: its 31 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rc.c+2−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c+104−123

This diff is large: its 484 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c+44−44

This diff is large: its 157 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192ce/def.h+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192ce/dm.c+12−18

This diff is large: its 70 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192ce/hw.c+70−23

This diff is large: its 224 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192ce/phy.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192ce/rf.c+8−15

This diff is large: its 60 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192ce/sw.c+3−12

This diff is large: its 31 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192ce/trx.c+20−28

This diff is large: its 135 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192cu/dm.c+12−18

This diff is large: its 70 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192cu/hw.c+7−9

This diff is large: its 50 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192cu/mac.c+10−15

This diff is large: its 51 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192cu/rf.c+8−14

This diff is large: its 58 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192cu/trx.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192de/dm.c+47−48

This diff is large: its 265 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192de/phy.c+23−42

This diff is large: its 116 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192de/rf.c+8−10

This diff is large: its 54 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192de/sw.c+2−9

This diff is large: its 25 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192de/trx.c+18−23

This diff is large: its 102 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192se/def.h+1−2

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192se/dm.c+46−51

This diff is large: its 249 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192se/hw.c+5−4

This diff is large: its 38 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192se/hw.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192se/phy.c+23−41

This diff is large: its 115 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192se/rf.c+4−7

This diff is large: its 39 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192se/sw.c+5−15

This diff is large: its 55 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8192se/trx.c+11−12

This diff is large: its 79 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/Makefile+22−0

This diff is large: its 23 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/btc.h+41−0

This diff is large: its 42 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/def.h+163−0

This diff is large: its 164 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/dm.c+920−0

This diff is large: its 921 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/dm.h+149−0

This diff is large: its 150 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/fw.c+745−0

This diff is large: its 746 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/fw.h+101−0

This diff is large: its 102 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/hal_bt_coexist.c+542−0

This diff is large: its 543 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/hal_bt_coexist.h+160−0

This diff is large: its 161 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/hal_btc.c+1786−0

This diff is large: its 1787 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/hal_btc.h+151−0

This diff is large: its 152 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/hw.c+2380−0

This diff is large: its 2381 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/hw.h+73−0

This diff is large: its 74 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/led.c+151−0

This diff is large: its 152 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/led.h+39−0

This diff is large: its 40 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/phy.c+2044−0

This diff is large: its 2045 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/phy.h+224−0

This diff is large: its 225 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/pwrseq.c+109−0

This diff is large: its 110 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/pwrseq.h+322−0

This diff is large: its 323 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/pwrseqcmd.c+129−0

This diff is large: its 130 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/pwrseqcmd.h+98−0

This diff is large: its 99 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/reg.h+2097−0

This diff is large: its 2098 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/rf.c+505−0

This diff is large: its 506 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/rf.h+43−0

This diff is large: its 44 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/sw.c+380−0

This diff is large: its 381 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/sw.h+37−0

This diff is large: its 38 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/table.c+738−0

This diff is large: its 739 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/table.h+50−0

This diff is large: its 51 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/trx.c+670−0

This diff is large: its 671 lines aren’t shown here.

drivers/net/wireless/rtlwifi/rtl8723ae/trx.h+725−0

This diff is large: its 726 lines aren’t shown here.

drivers/net/wireless/rtlwifi/stats.c+268−0

This diff is large: its 269 lines aren’t shown here.

drivers/net/wireless/rtlwifi/stats.h+46−0

This diff is large: its 47 lines aren’t shown here.

drivers/net/wireless/rtlwifi/usb.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/rtlwifi/usb.h+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/rtlwifi/wifi.h+129−32

This diff is large: its 317 lines aren’t shown here.

drivers/net/wireless/ti/wl1251/main.c+3−1

This diff is large: its 15 lines aren’t shown here.

drivers/net/wireless/ti/wl1251/rx.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/ti/wl1251/sdio.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/net/wireless/ti/wl1251/spi.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/ti/wl12xx/main.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/ti/wl18xx/main.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/ti/wlcore/cmd.c+3−1

This diff is large: its 15 lines aren’t shown here.

drivers/net/wireless/ti/wlcore/main.c+8−7

This diff is large: its 64 lines aren’t shown here.

drivers/net/wireless/ti/wlcore/sdio.c+4−4

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/ti/wlcore/spi.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/ti/wlcore/wlcore.h+2−2

This diff is large: its 11 lines aren’t shown here.

drivers/net/xen-netfront.c+5−5

This diff is large: its 38 lines aren’t shown here.

drivers/nfc/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/nfc/pn533.c+10−8

This diff is large: its 55 lines aren’t shown here.

drivers/nfc/pn544/Makefile+7−0

This diff is large: its 8 lines aren’t shown here.

drivers/nfc/pn544/i2c.c+500−0

This diff is large: its 501 lines aren’t shown here.

drivers/nfc/pn544/pn544.crenamed from drivers/nfc/pn544_hci.c+259−420

This diff is large: its 876 lines aren’t shown here.

drivers/nfc/pn544/pn544.h+32−0

This diff is large: its 33 lines aren’t shown here.

drivers/pps/Kconfig+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/ptp/Kconfig+8−11

This diff is large: its 63 lines aren’t shown here.

drivers/ptp/ptp_chardev.c+56−5

This diff is large: its 121 lines aren’t shown here.

drivers/s390/net/claw.c+0−2

This diff is large: its 11 lines aren’t shown here.

drivers/s390/net/ctcm_main.c+0−2

This diff is large: its 9 lines aren’t shown here.

drivers/s390/net/ctcm_mpc.c+0−3

This diff is large: its 17 lines aren’t shown here.

drivers/s390/net/qeth_core.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/s390/net/qeth_core_main.c+28−21

This diff is large: its 143 lines aren’t shown here.

drivers/s390/net/qeth_l2_main.c+2−2

This diff is large: its 25 lines aren’t shown here.

drivers/s390/net/qeth_l3_main.c+4−4

This diff is large: its 37 lines aren’t shown here.

drivers/ssb/b43_pci_bridge.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/ssb/driver_chipcommon.c+91−9

This diff is large: its 143 lines aren’t shown here.

drivers/ssb/driver_chipcommon_pmu.c+30−0

This diff is large: its 51 lines aren’t shown here.

drivers/ssb/driver_extif.c+22−2

This diff is large: its 33 lines aren’t shown here.

drivers/ssb/driver_mipscore.c+16−14

This diff is large: its 71 lines aren’t shown here.

drivers/ssb/embedded.c+35−0

This diff is large: its 54 lines aren’t shown here.

drivers/ssb/main.c+9−2

This diff is large: its 39 lines aren’t shown here.

drivers/ssb/ssb_private.h+31−0

This diff is large: its 44 lines aren’t shown here.

drivers/vhost/net.c+134−13

This diff is large: its 260 lines aren’t shown here.

drivers/vhost/tcm_vhost.c+5−4

This diff is large: its 43 lines aren’t shown here.

drivers/vhost/vhost.c+10−49

This diff is large: its 109 lines aren’t shown here.

drivers/vhost/vhost.h+5−9

This diff is large: its 47 lines aren’t shown here.

fs/proc/proc_sysctl.c+5−4

This diff is large: its 34 lines aren’t shown here.

include/linux/ath9k_platform.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/linux/atmdev.h+2−0

This diff is large: its 16 lines aren’t shown here.

include/linux/bcm47xx_wdt.h+19−0

This diff is large: its 20 lines aren’t shown here.

include/linux/bcma/bcma.h+6−1

This diff is large: its 29 lines aren’t shown here.

include/linux/bcma/bcma_driver_chipcommon.h+10−2

This diff is large: its 67 lines aren’t shown here.

include/linux/bcma/bcma_driver_mips.h+3−0

This diff is large: its 17 lines aren’t shown here.

include/linux/bcma/bcma_regs.h+4−1

This diff is large: its 11 lines aren’t shown here.

include/linux/etherdevice.h+20−0

This diff is large: its 27 lines aren’t shown here.

include/linux/filter.h+3−0

This diff is large: its 17 lines aren’t shown here.

include/linux/hdlc/Kbuild+0−1

This diff is large: its 2 lines aren’t shown here.

include/linux/ieee80211.h+146−42

This diff is large: its 248 lines aren’t shown here.

include/linux/if_tunnel.h+17−0

This diff is large: its 23 lines aren’t shown here.

include/linux/inetdevice.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/linux/ip.h+5−0

This diff is large: its 12 lines aren’t shown here.

include/linux/ipv6.h+23−15

This diff is large: its 58 lines aren’t shown here.

include/linux/ktime.h+19−0

This diff is large: its 26 lines aren’t shown here.

include/linux/micrel_phy.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/netdevice.h+34−10

This diff is large: its 103 lines aren’t shown here.

include/linux/netfilter_ipv6/ip6_tables.h+0−9

This diff is large: its 16 lines aren’t shown here.

include/linux/nfc/pn544.h+0−104

This diff is large: its 105 lines aren’t shown here.

include/linux/openvswitch.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/pci.h+14−0

This diff is large: its 21 lines aren’t shown here.

include/linux/platform_data/cpsw.h+4−19

This diff is large: its 42 lines aren’t shown here.

include/linux/platform_data/macb.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/platform_data/pn544.h+44−0

This diff is large: its 45 lines aren’t shown here.

include/linux/rtnetlink.h+3−0

This diff is large: its 8 lines aren’t shown here.

include/linux/skbuff.h+99−3

This diff is large: its 180 lines aren’t shown here.

include/linux/smscphy.h+5−0

This diff is large: its 17 lines aren’t shown here.

include/linux/ssb/ssb.h+2−0

This diff is large: its 16 lines aren’t shown here.

include/linux/ssb/ssb_driver_chipcommon.h+3−2

This diff is large: its 19 lines aren’t shown here.

include/linux/ssb/ssb_driver_extif.h+48−4

This diff is large: its 75 lines aren’t shown here.

include/linux/ssb/ssb_driver_mips.h+7−3

This diff is large: its 24 lines aren’t shown here.

include/linux/ssb/ssb_regs.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/stmmac.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/sysctl.h+1−2

This diff is large: its 10 lines aren’t shown here.

include/linux/tcp.h+10−0

This diff is large: its 17 lines aren’t shown here.

include/linux/timecompare.h+0−125

This diff is large: its 126 lines aren’t shown here.

include/linux/udp.h+5−0

This diff is large: its 12 lines aren’t shown here.

include/linux/usb/cdc_ncm.h+134−0

This diff is large: its 135 lines aren’t shown here.

include/linux/usb/usbnet.h+10−0

This diff is large: its 17 lines aren’t shown here.

include/net/addrconf.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/net/af_unix.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/net/bluetooth/a2mp.h+23−1

This diff is large: its 47 lines aren’t shown here.

include/net/bluetooth/amp.h+54−0

This diff is large: its 55 lines aren’t shown here.

include/net/bluetooth/bluetooth.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/net/bluetooth/hci.h+67−2

This diff is large: its 137 lines aren’t shown here.

include/net/bluetooth/hci_core.h+96−27

This diff is large: its 330 lines aren’t shown here.

include/net/bluetooth/l2cap.h+47−3

This diff is large: its 125 lines aren’t shown here.

include/net/cfg80211.h+238−68

This diff is large: its 640 lines aren’t shown here.

include/net/cls_cgroup.h+3−3

This diff is large: its 24 lines aren’t shown here.

include/net/gro_cells.h+9−5

This diff is large: its 50 lines aren’t shown here.

include/net/ieee80211_radiotap.h+24−0

This diff is large: its 45 lines aren’t shown here.

include/net/inet_hashtables.h+26−24

This diff is large: its 73 lines aren’t shown here.

include/net/inet_sock.h+5−3

This diff is large: its 30 lines aren’t shown here.

include/net/inet_timewait_sock.h+5−2

This diff is large: its 21 lines aren’t shown here.

include/net/ip6_checksum.h+35−0

This diff is large: its 47 lines aren’t shown here.

include/net/ip6_fib.h+19−1

This diff is large: its 48 lines aren’t shown here.

include/net/ip6_route.h+0−3

This diff is large: its 10 lines aren’t shown here.

include/net/ip_vs.h+143−52

This diff is large: its 299 lines aren’t shown here.

include/net/ipip.h+21−19

This diff is large: its 47 lines aren’t shown here.

include/net/ipv6.h+19−0

This diff is large: its 33 lines aren’t shown here.

include/net/mac80211.h+257−18

This diff is large: its 614 lines aren’t shown here.

include/net/ndisc.h+0−15

This diff is large: its 22 lines aren’t shown here.

include/net/net_namespace.h+16−8

This diff is large: its 47 lines aren’t shown here.

include/net/netfilter/nf_conntrack.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/netfilter/nf_nat.h+15−0

This diff is large: its 20 lines aren’t shown here.

include/net/netfilter/nf_queue.h+2−6

This diff is large: its 17 lines aren’t shown here.

include/net/netns/sctp.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/net/nfc/hci.h+20−1

This diff is large: its 63 lines aren’t shown here.

include/net/nfc/nfc.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/protocol.h+15−16

This diff is large: its 82 lines aren’t shown here.

include/net/request_sock.h+8−4

This diff is large: its 38 lines aren’t shown here.

include/net/route.h+6−3

This diff is large: its 17 lines aren’t shown here.

include/net/rtnetlink.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/sch_generic.h+7−0

This diff is large: its 14 lines aren’t shown here.

include/net/sctp/command.h+22−16

This diff is large: its 70 lines aren’t shown here.

include/net/sctp/constants.h+0−8

This diff is large: its 15 lines aren’t shown here.

include/net/sctp/sctp.h+12−0

This diff is large: its 19 lines aren’t shown here.

include/net/sctp/sm.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/net/sctp/structs.h+39−0

This diff is large: its 67 lines aren’t shown here.

include/net/sctp/ulpqueue.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/sctp/user.h+27−0

This diff is large: its 41 lines aren’t shown here.

include/net/sock.h+23−5

This diff is large: its 53 lines aren’t shown here.

include/net/tcp.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/uapi/asm-generic/socket.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/Kbuild+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/ethtool.h+7−4

This diff is large: its 28 lines aren’t shown here.

include/uapi/linux/filter.h+3−1

This diff is large: its 11 lines aren’t shown here.

include/uapi/linux/hdlc/Kbuild+1−0

This diff is large: its 3 lines aren’t shown here.

include/uapi/linux/hdlc/ioctl.hrenamed from include/linux/hdlc/ioctl.h+5−2

This diff is large: its 24 lines aren’t shown here.

include/uapi/linux/if_bridge.h+81−0

This diff is large: its 87 lines aren’t shown here.

include/uapi/linux/if_ether.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/if_link.h+22−0

This diff is large: its 36 lines aren’t shown here.

include/uapi/linux/if_packet.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/if_tun.h+7−0

This diff is large: its 32 lines aren’t shown here.

include/uapi/linux/if_tunnel.h+20−0

This diff is large: its 27 lines aren’t shown here.

include/uapi/linux/in6.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/inet_diag.h+2−1

This diff is large: its 12 lines aren’t shown here.

include/uapi/linux/ipv6.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/ipv6_route.h+3−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/netconf.h+24−0

This diff is large: its 25 lines aren’t shown here.

include/uapi/linux/netfilter/nfnetlink_conntrack.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/uapi/linux/netfilter_ipv6/ip6_tables.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/uapi/linux/nfc.h+15−0

This diff is large: its 43 lines aren’t shown here.

include/uapi/linux/nl80211.h+159−18

This diff is large: its 338 lines aren’t shown here.

include/uapi/linux/ptp_clock.h+14−0

This diff is large: its 27 lines aren’t shown here.

include/uapi/linux/rtnetlink.h+26−0

This diff is large: its 61 lines aren’t shown here.

include/uapi/linux/unix_diag.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/usb/cdc.h+23−0

This diff is large: its 58 lines aren’t shown here.

include/uapi/linux/virtio_net.h+27−0

This diff is large: its 46 lines aren’t shown here.

kernel/nsproxy.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/time/Makefile+1−1

This diff is large: its 6 lines aren’t shown here.

kernel/time/timecompare.c+0−193

This diff is large: its 194 lines aren’t shown here.

net/8021q/vlan.c+8−7

This diff is large: its 70 lines aren’t shown here.

net/8021q/vlan_dev.c+9−3

This diff is large: its 47 lines aren’t shown here.

net/atm/br2684.c+71−20

This diff is large: its 184 lines aren’t shown here.

net/atm/common.c+12−0

This diff is large: its 38 lines aren’t shown here.

net/atm/pppoatm.c+63−5

This diff is large: its 167 lines aren’t shown here.

net/batman-adv/Kconfig+11−0

This diff is large: its 25 lines aren’t shown here.

net/batman-adv/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

net/batman-adv/bat_iv_ogm.c+29−22

This diff is large: its 137 lines aren’t shown here.

net/batman-adv/bitarray.c+10−13

This diff is large: its 31 lines aren’t shown here.

net/batman-adv/bridge_loop_avoidance.c+70−61

This diff is large: its 265 lines aren’t shown here.

net/batman-adv/bridge_loop_avoidance.h+2−4

This diff is large: its 20 lines aren’t shown here.

net/batman-adv/debugfs.c+49−11

This diff is large: its 127 lines aren’t shown here.

net/batman-adv/distributed-arp-table.c+1066−0

This diff is large: its 1067 lines aren’t shown here.

net/batman-adv/distributed-arp-table.h+167−0

This diff is large: its 168 lines aren’t shown here.

net/batman-adv/gateway_client.c+4−15

This diff is large: its 35 lines aren’t shown here.

net/batman-adv/hard-interface.c+47−4

This diff is large: its 100 lines aren’t shown here.

net/batman-adv/hash.h+22−0

This diff is large: its 29 lines aren’t shown here.

net/batman-adv/icmp_socket.c+10−6

This diff is large: its 60 lines aren’t shown here.

net/batman-adv/main.c+79−10

This diff is large: its 143 lines aren’t shown here.

net/batman-adv/main.h+28−8

This diff is large: its 89 lines aren’t shown here.

net/batman-adv/originator.c+5−17

This diff is large: its 54 lines aren’t shown here.

net/batman-adv/packet.h+69−17

This diff is large: its 139 lines aren’t shown here.

net/batman-adv/routing.c+194−121

This diff is large: its 507 lines aren’t shown here.

net/batman-adv/send.c+41−2

This diff is large: its 81 lines aren’t shown here.

net/batman-adv/send.h+3−0

This diff is large: its 10 lines aren’t shown here.

net/batman-adv/soft-interface.c+85−9

This diff is large: its 202 lines aren’t shown here.

net/batman-adv/sysfs.c+8−50

This diff is large: its 93 lines aren’t shown here.

net/batman-adv/translation-table.c+314−212

This diff is large: its 960 lines aren’t shown here.

net/batman-adv/translation-table.h+5−3

This diff is large: its 22 lines aren’t shown here.

net/batman-adv/types.h+89−13

This diff is large: its 195 lines aren’t shown here.

net/batman-adv/unicast.c+125−18

This diff is large: its 187 lines aren’t shown here.

net/batman-adv/unicast.h+35−1

This diff is large: its 46 lines aren’t shown here.

net/batman-adv/vis.c+14−30

This diff is large: its 113 lines aren’t shown here.

net/bluetooth/Kconfig+1−1

This diff is large: its 13 lines aren’t shown here.

net/bluetooth/Makefile+1−1

This diff is large: its 6 lines aren’t shown here.

net/bluetooth/a2mp.c+429−30

This diff is large: its 650 lines aren’t shown here.

net/bluetooth/af_bluetooth.c+4−6

This diff is large: its 31 lines aren’t shown here.

net/bluetooth/amp.c+471−0

This diff is large: its 472 lines aren’t shown here.

net/bluetooth/bnep/core.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/bluetooth/bnep/netdev.c+0−1

This diff is large: its 8 lines aren’t shown here.

net/bluetooth/cmtp/capi.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bluetooth/cmtp/core.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bluetooth/cmtp/sock.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bluetooth/hci_conn.c+70−6

This diff is large: its 147 lines aren’t shown here.

net/bluetooth/hci_core.c+163−70

This diff is large: its 439 lines aren’t shown here.

net/bluetooth/hci_event.c+525−37

This diff is large: its 876 lines aren’t shown here.

net/bluetooth/hci_sysfs.c+5−5

This diff is large: its 38 lines aren’t shown here.

net/bluetooth/hidp/core.c+6−2

This diff is large: its 15 lines aren’t shown here.

net/bluetooth/l2cap_core.c+1284−327

This diff is large: its 2925 lines aren’t shown here.

net/bluetooth/l2cap_sock.c+63−31

This diff is large: its 315 lines aren’t shown here.

net/bluetooth/lib.c+0−14

This diff is large: its 21 lines aren’t shown here.

net/bluetooth/mgmt.c+71−34

This diff is large: its 254 lines aren’t shown here.

net/bluetooth/rfcomm/core.c+9−10

This diff is large: its 54 lines aren’t shown here.

net/bluetooth/rfcomm/sock.c+6−7

This diff is large: its 41 lines aren’t shown here.

net/bluetooth/rfcomm/tty.c+3−3

This diff is large: its 20 lines aren’t shown here.

net/bluetooth/sco.c+80−18

This diff is large: its 204 lines aren’t shown here.

net/bluetooth/smp.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bridge/Makefile+1−1

This diff is large: its 8 lines aren’t shown here.

net/bridge/br_device.c+3−1

This diff is large: its 18 lines aren’t shown here.

net/bridge/br_input.c+1−16

This diff is large: its 38 lines aren’t shown here.

net/bridge/br_ioctl.c+13−12

This diff is large: its 100 lines aren’t shown here.

net/bridge/br_mdb.c+481−0

This diff is large: its 482 lines aren’t shown here.

net/bridge/br_multicast.c+52−29

This diff is large: its 153 lines aren’t shown here.

net/bridge/br_netlink.c+154−95

This diff is large: its 302 lines aren’t shown here.

net/bridge/br_private.h+40−6

This diff is large: its 95 lines aren’t shown here.

net/bridge/br_stp.c+21−1

This diff is large: its 36 lines aren’t shown here.

net/bridge/br_stp_bpdu.c+7−0

This diff is large: its 14 lines aren’t shown here.

net/bridge/br_sysfs_br.c+9−13

This diff is large: its 72 lines aren’t shown here.

net/bridge/br_sysfs_if.c+31−16

This diff is large: its 84 lines aren’t shown here.

net/caif/caif_usb.c+7−11

This diff is large: its 28 lines aren’t shown here.

net/caif/cfctrl.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/can/gw.c+6−0

This diff is large: its 20 lines aren’t shown here.

net/core/dev.c+176−60

This diff is large: its 501 lines aren’t shown here.

net/core/ethtool.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/core/filter.c+139−0

This diff is large: its 164 lines aren’t shown here.

net/core/flow.c+1−3

This diff is large: its 13 lines aren’t shown here.

net/core/neighbour.c+15−5

This diff is large: its 56 lines aren’t shown here.

net/core/net-sysfs.c+10−7

This diff is large: its 61 lines aren’t shown here.

net/core/net_namespace.c+12−11

This diff is large: its 87 lines aren’t shown here.

net/core/netpoll.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/core/netprio_cgroup.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/core/pktgen.c+14−33

This diff is large: its 132 lines aren’t shown here.

net/core/rtnetlink.c+224−6

This diff is large: its 306 lines aren’t shown here.

net/core/scm.c+3−3

This diff is large: its 15 lines aren’t shown here.

net/core/skbuff.c+31−3

This diff is large: its 95 lines aren’t shown here.

net/core/sock.c+74−10

This diff is large: its 150 lines aren’t shown here.

net/core/sysctl_net_core.c+5−0

This diff is large: its 12 lines aren’t shown here.

net/dcb/dcbnl.c+4−4

This diff is large: its 29 lines aren’t shown here.

net/dccp/minisocks.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/decnet/dn_dev.c+6−0

This diff is large: its 20 lines aren’t shown here.

net/decnet/dn_fib.c+6−0

This diff is large: its 20 lines aren’t shown here.

net/dsa/Kconfig+8−10

This diff is large: its 35 lines aren’t shown here.

net/ieee802154/6lowpan.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/ipv4/af_inet.c+64−29

This diff is large: its 214 lines aren’t shown here.

net/ipv4/arp.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/devinet.c+192−6

This diff is large: its 267 lines aren’t shown here.

net/ipv4/fib_frontend.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/fib_semantics.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/inet_connection_sock.c+18−7

This diff is large: its 54 lines aren’t shown here.

net/ipv4/inet_diag.c+4−1

This diff is large: its 19 lines aren’t shown here.

net/ipv4/inet_hashtables.c+23−13

This diff is large: its 71 lines aren’t shown here.

net/ipv4/ip_fragment.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/ipv4/ip_gre.c+7−25

This diff is large: its 95 lines aren’t shown here.

net/ipv4/ip_options.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/ipv4/ip_output.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/ipv4/ip_sockglue.c+3−2

This diff is large: its 17 lines aren’t shown here.

net/ipv4/ip_vti.c+6−20

This diff is large: its 63 lines aren’t shown here.

net/ipv4/ipconfig.c+4−2

This diff is large: its 13 lines aren’t shown here.

net/ipv4/ipip.c+219−52

This diff is large: its 397 lines aren’t shown here.

net/ipv4/ipmr.c+121−16

This diff is large: its 343 lines aren’t shown here.

net/ipv4/netfilter/arp_tables.c+4−4

This diff is large: its 36 lines aren’t shown here.

net/ipv4/netfilter/ip_tables.c+4−4

This diff is large: its 36 lines aren’t shown here.

net/ipv4/netfilter/ipt_CLUSTERIP.c+7−2

This diff is large: its 26 lines aren’t shown here.

net/ipv4/netfilter/iptable_nat.c+5−3

This diff is large: its 22 lines aren’t shown here.

net/ipv4/protocol.c+21−0

This diff is large: its 39 lines aren’t shown here.

net/ipv4/route.c+25−2

This diff is large: its 41 lines aren’t shown here.

net/ipv4/syncookies.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/sysctl_net_ipv4.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/ipv4/tcp.c+14−11

This diff is large: its 78 lines aren’t shown here.

net/ipv4/tcp_cong.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/ipv4/tcp_input.c+26−19

This diff is large: its 74 lines aren’t shown here.

net/ipv4/tcp_ipv4.c+15−23

This diff is large: its 109 lines aren’t shown here.

net/ipv4/tcp_minisocks.c+4−4

This diff is large: its 36 lines aren’t shown here.

net/ipv4/tcp_output.c+5−0

This diff is large: its 12 lines aren’t shown here.

net/ipv4/tcp_timer.c+4−4

This diff is large: its 23 lines aren’t shown here.

net/ipv6/Makefile+4−1

This diff is large: its 20 lines aren’t shown here.

net/ipv6/addrconf.c+183−20

This diff is large: its 382 lines aren’t shown here.

net/ipv6/af_inet6.c+3−242

This diff is large: its 269 lines aren’t shown here.

net/ipv6/ah6.c+5−5

This diff is large: its 45 lines aren’t shown here.

net/ipv6/anycast.c+5−2

This diff is large: its 28 lines aren’t shown here.

net/ipv6/datagram.c+4−4

This diff is large: its 36 lines aren’t shown here.

net/ipv6/exthdrs.c+13−57

This diff is large: its 157 lines aren’t shown here.

net/ipv6/exthdrs_core.c+168−0

This diff is large: its 172 lines aren’t shown here.

net/ipv6/exthdrs_offload.c+41−0

This diff is large: its 42 lines aren’t shown here.

net/ipv6/fib6_rules.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/icmp.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/inet6_hashtables.c+19−8

This diff is large: its 62 lines aren’t shown here.

net/ipv6/ip6_fib.c+57−0

This diff is large: its 85 lines aren’t shown here.

net/ipv6/ip6_flowlabel.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/ipv6/ip6_gre.c+7−22

This diff is large: its 85 lines aren’t shown here.

net/ipv6/ip6_offload.c+282−0

This diff is large: its 283 lines aren’t shown here.

net/ipv6/ip6_offload.h+18−0

This diff is large: its 19 lines aren’t shown here.

net/ipv6/ip6_output.c+3−69

This diff is large: its 98 lines aren’t shown here.

net/ipv6/ip6_tunnel.c+244−44

This diff is large: its 439 lines aren’t shown here.

net/ipv6/ip6mr.c+132−25

This diff is large: its 352 lines aren’t shown here.

net/ipv6/ipv6_sockglue.c+5−4

This diff is large: its 37 lines aren’t shown here.

net/ipv6/mcast.c+5−2

This diff is large: its 28 lines aren’t shown here.

net/ipv6/ndisc.c+25−37

This diff is large: its 158 lines aren’t shown here.

net/ipv6/netfilter/ip6_tables.c+6−111

This diff is large: its 169 lines aren’t shown here.

net/ipv6/netfilter/ip6t_rpfilter.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/netfilter/ip6table_nat.c+5−3

This diff is large: its 22 lines aren’t shown here.

net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c+68−2

This diff is large: its 119 lines aren’t shown here.

net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/ipv6/netfilter/nf_defrag_ipv6_hooks.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/ipv6/netfilter/nf_nat_proto_icmpv6.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/output_core.c+76−0

This diff is large: its 77 lines aren’t shown here.

net/ipv6/protocol.c+25−0

This diff is large: its 37 lines aren’t shown here.

net/ipv6/raw.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/ipv6/reassembly.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/ipv6/route.c+163−47

This diff is large: its 401 lines aren’t shown here.

net/ipv6/sit.c+365−94

This diff is large: its 634 lines aren’t shown here.

net/ipv6/syncookies.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/tcp_ipv6.c+12−112

This diff is large: its 200 lines aren’t shown here.

net/ipv6/tcpv6_offload.c+95−0

This diff is large: its 96 lines aren’t shown here.

net/ipv6/udp.c+0−94

This diff is large: its 104 lines aren’t shown here.

net/ipv6/udp_offload.c+120−0

This diff is large: its 121 lines aren’t shown here.

net/ipv6/xfrm6_policy.c+3−18

This diff is large: its 49 lines aren’t shown here.

net/ipv6/xfrm6_state.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/key/af_key.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/l2tp/l2tp_netlink.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/llc/af_llc.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/mac80211/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

net/mac80211/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

net/mac80211/aes_cmac.c+18−0

This diff is large: its 29 lines aren’t shown here.

net/mac80211/agg-rx.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/mac80211/agg-tx.c+7−7

This diff is large: its 46 lines aren’t shown here.

net/mac80211/cfg.c+310−189

This diff is large: its 927 lines aren’t shown here.

net/mac80211/chan.c+295−116

This diff is large: its 464 lines aren’t shown here.

net/mac80211/debugfs.h+3−3

This diff is large: its 13 lines aren’t shown here.

net/mac80211/debugfs_key.c+20−3

This diff is large: its 58 lines aren’t shown here.

net/mac80211/debugfs_netdev.c+40−38

This diff is large: its 165 lines aren’t shown here.

net/mac80211/debugfs_sta.c+53−6

This diff is large: its 136 lines aren’t shown here.

net/mac80211/driver-ops.h+136−4

This diff is large: its 166 lines aren’t shown here.

net/mac80211/ht.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/mac80211/ibss.c+90−81

This diff is large: its 352 lines aren’t shown here.

net/mac80211/ieee80211_i.h+167−47

This diff is large: its 484 lines aren’t shown here.

net/mac80211/iface.c+106−37

This diff is large: its 258 lines aren’t shown here.

net/mac80211/key.c+8−7

This diff is large: its 50 lines aren’t shown here.

net/mac80211/key.h+6−5

This diff is large: its 33 lines aren’t shown here.

net/mac80211/main.c+109−41

This diff is large: its 307 lines aren’t shown here.

net/mac80211/mesh.c+50−32

This diff is large: its 182 lines aren’t shown here.

net/mac80211/mesh.h+2−16

This diff is large: its 39 lines aren’t shown here.

net/mac80211/mesh_plink.c+33−31

This diff is large: its 233 lines aren’t shown here.

net/mac80211/mesh_sync.c+15−90

This diff is large: its 145 lines aren’t shown here.

net/mac80211/mlme.c+565−170

This diff is large: its 1225 lines aren’t shown here.

net/mac80211/offchannel.c+13−9

This diff is large: its 67 lines aren’t shown here.

net/mac80211/pm.c+45−1

This diff is large: its 65 lines aren’t shown here.

net/mac80211/rate.c+2−3

This diff is large: its 19 lines aren’t shown here.

net/mac80211/rate.h+11−1

This diff is large: its 23 lines aren’t shown here.

net/mac80211/rc80211_minstrel.c+5−4

This diff is large: its 30 lines aren’t shown here.

net/mac80211/rc80211_minstrel_ht.c+3−5

This diff is large: its 27 lines aren’t shown here.

net/mac80211/rx.c+176−74

This diff is large: its 586 lines aren’t shown here.

net/mac80211/scan.c+37−24

This diff is large: its 169 lines aren’t shown here.

net/mac80211/sta_info.c+50−19

This diff is large: its 192 lines aren’t shown here.

net/mac80211/sta_info.h+18−13

This diff is large: its 103 lines aren’t shown here.

net/mac80211/status.c+87−82

This diff is large: its 229 lines aren’t shown here.

net/mac80211/trace.h+208−38

This diff is large: its 325 lines aren’t shown here.

net/mac80211/tx.c+174−117

This diff is large: its 755 lines aren’t shown here.

net/mac80211/util.c+250−113

This diff is large: its 678 lines aren’t shown here.

net/mac80211/vht.c+35−0

This diff is large: its 36 lines aren’t shown here.

net/mac80211/wme.c+23−17

This diff is large: its 55 lines aren’t shown here.

net/mac80211/wpa.c+4−1

This diff is large: its 19 lines aren’t shown here.

net/mac802154/tx.c+5−2

This diff is large: its 26 lines aren’t shown here.

net/mac802154/wpan.c+3−1

This diff is large: its 12 lines aren’t shown here.

net/netfilter/core.c+0−2

This diff is large: its 9 lines aren’t shown here.

net/netfilter/ipset/ip_set_core.c+161−84

This diff is large: its 605 lines aren’t shown here.

net/netfilter/ipvs/Kconfig+3−4

This diff is large: its 16 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_conn.c+6−9

This diff is large: its 46 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_core.c+228−176

This diff is large: its 817 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_ctl.c+6−2

This diff is large: its 29 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_dh.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_lblc.c+6−1

This diff is large: its 21 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_lblcr.c+5−1

This diff is large: its 20 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_nfct.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_pe_sip.c+13−5

This diff is large: its 37 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_proto.c+3−3

This diff is large: its 21 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_proto_ah_esp.c+4−5

This diff is large: its 30 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_proto_sctp.c+18−24

This diff is large: its 100 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_proto_tcp.c+17−23

This diff is large: its 96 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_proto_udp.c+18−23

This diff is large: its 95 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_sched.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_sh.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_xmit.c+46−35

This diff is large: its 284 lines aren’t shown here.

net/netfilter/nf_conntrack_acct.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/netfilter/nf_conntrack_core.c+13−18

This diff is large: its 88 lines aren’t shown here.

net/netfilter/nf_conntrack_ecache.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/netfilter/nf_conntrack_helper.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/netfilter/nf_conntrack_netlink.c+115−3

This diff is large: its 160 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_dccp.c+6−2

This diff is large: its 29 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_tcp.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nf_conntrack_standalone.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/netfilter/nf_conntrack_timestamp.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/netfilter/nf_queue.c+13−139

This diff is large: its 184 lines aren’t shown here.

net/netfilter/nfnetlink.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nfnetlink_queue_core.c+5−9

This diff is large: its 43 lines aren’t shown here.

net/netfilter/xt_HMARK.c+4−4

This diff is large: its 36 lines aren’t shown here.

net/netfilter/xt_ipvs.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/netlink/af_netlink.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/nfc/Kconfig+2−2

This diff is large: its 11 lines aren’t shown here.

net/nfc/core.c+25−8

This diff is large: its 133 lines aren’t shown here.

net/nfc/hci/command.c+12−16

This diff is large: its 72 lines aren’t shown here.

net/nfc/hci/core.c+73−17

This diff is large: its 221 lines aren’t shown here.

net/nfc/hci/llc.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/nfc/hci/llc_shdlc.c+3−4

This diff is large: its 23 lines aren’t shown here.

net/nfc/llcp/Kconfig+2−2

This diff is large: its 9 lines aren’t shown here.

net/nfc/llcp/commands.c+127−21

This diff is large: its 220 lines aren’t shown here.

net/nfc/llcp/llcp.c+219−29

This diff is large: its 440 lines aren’t shown here.

net/nfc/llcp/llcp.h+13−0

This diff is large: its 38 lines aren’t shown here.

net/nfc/llcp/sock.c+39−3

This diff is large: its 67 lines aren’t shown here.

net/nfc/nci/Kconfig+2−2

This diff is large: its 9 lines aren’t shown here.

net/nfc/nci/core.c+13−16

This diff is large: its 75 lines aren’t shown here.

net/nfc/netlink.c+155−2

This diff is large: its 192 lines aren’t shown here.

net/nfc/nfc.h+6−0

This diff is large: its 20 lines aren’t shown here.

net/nfc/rawsock.c+0−1

This diff is large: its 8 lines aren’t shown here.

net/openvswitch/actions.c+97−0

This diff is large: its 132 lines aren’t shown here.

net/openvswitch/datapath.c+25−2

This diff is large: its 71 lines aren’t shown here.

net/openvswitch/flow.c+24−4

This diff is large: its 105 lines aren’t shown here.

net/openvswitch/flow.h+5−3

This diff is large: its 34 lines aren’t shown here.

net/openvswitch/vport-netdev.c+10−4

This diff is large: its 28 lines aren’t shown here.

net/openvswitch/vport-netdev.h+3−0

This diff is large: its 16 lines aren’t shown here.

net/openvswitch/vport.c+2−3

This diff is large: its 19 lines aren’t shown here.

net/packet/af_packet.c+46−4

This diff is large: its 92 lines aren’t shown here.

net/packet/internal.h+1−0

This diff is large: its 8 lines aren’t shown here.

net/phonet/pn_netlink.c+6−0

This diff is large: its 20 lines aren’t shown here.

net/rds/ib.h+1−1

This diff is large: its 9 lines aren’t shown here.

net/rds/ib_recv.c+13−11

This diff is large: its 47 lines aren’t shown here.

net/rfkill/rfkill-gpio.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/rfkill/rfkill-regulator.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/sched/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/act_api.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/sched/cls_api.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/sched/cls_cgroup.c+24−0

This diff is large: its 45 lines aren’t shown here.

net/sched/sch_api.c+15−5

This diff is large: its 60 lines aren’t shown here.

net/sched/sch_cbq.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/sched/sch_generic.c+6−5

This diff is large: its 34 lines aren’t shown here.

net/sched/sch_htb.c+92−47

This diff is large: its 314 lines aren’t shown here.

net/sched/sch_mq.c+3−1

This diff is large: its 18 lines aren’t shown here.

net/sched/sch_mqprio.c+4−0

This diff is large: its 18 lines aren’t shown here.

net/sched/sch_qfq.c+566−264

This diff is large: its 1296 lines aren’t shown here.

net/sctp/Kconfig+13−26

This diff is large: its 55 lines aren’t shown here.

net/sctp/associola.c+12−4

This diff is large: its 57 lines aren’t shown here.

net/sctp/endpointola.c+4−1

This diff is large: its 13 lines aren’t shown here.

net/sctp/inqueue.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/sctp/ipv6.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sctp/output.c+9−5

This diff is large: its 28 lines aren’t shown here.

net/sctp/outqueue.c+10−2

This diff is large: its 44 lines aren’t shown here.

net/sctp/proc.c+18−3

This diff is large: its 69 lines aren’t shown here.

net/sctp/protocol.c+12−3

This diff is large: its 43 lines aren’t shown here.

net/sctp/sm_make_chunk.c+22−2

This diff is large: its 40 lines aren’t shown here.

net/sctp/sm_sideeffect.c+31−24

This diff is large: its 185 lines aren’t shown here.

net/sctp/sm_statefuns.c+16−4

This diff is large: its 54 lines aren’t shown here.

net/sctp/socket.c+81−7

This diff is large: its 162 lines aren’t shown here.

net/sctp/sysctl.c+59−0

This diff is large: its 80 lines aren’t shown here.

net/sctp/transport.c+15−5

This diff is large: its 50 lines aren’t shown here.

net/sctp/tsnmap.c+2−6

This diff is large: its 22 lines aren’t shown here.

net/sctp/ulpqueue.c+1−2

This diff is large: its 17 lines aren’t shown here.

net/socket.c+0−8

This diff is large: its 36 lines aren’t shown here.

net/sysctl_net.c+12−3

This diff is large: its 28 lines aren’t shown here.

net/tipc/Kconfig+1−12

This diff is large: its 26 lines aren’t shown here.

net/tipc/bcast.c+12−15

This diff is large: its 70 lines aren’t shown here.

net/tipc/bearer.c+11−99

This diff is large: its 151 lines aren’t shown here.

net/tipc/bearer.h+3−21

This diff is large: its 59 lines aren’t shown here.

net/tipc/core.c+0−5

This diff is large: its 12 lines aren’t shown here.

net/tipc/discover.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/tipc/link.c+99−133

This diff is large: its 461 lines aren’t shown here.

net/tipc/link.h+0−4

This diff is large: its 18 lines aren’t shown here.

net/tipc/name_distr.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/tipc/node.c+6−9

This diff is large: its 43 lines aren’t shown here.

net/tipc/node.h+2−4

This diff is large: its 34 lines aren’t shown here.

net/tipc/port.c+23−9

This diff is large: its 73 lines aren’t shown here.

net/tipc/port.h+4−2

This diff is large: its 20 lines aren’t shown here.

net/tipc/socket.c+246−165

This diff is large: its 625 lines aren’t shown here.

net/tipc/subscr.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/unix/diag.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/unix/sysctl_net_unix.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/wireless/Kconfig+2−3

This diff is large: its 17 lines aren’t shown here.

net/wireless/Makefile+3−1

This diff is large: its 15 lines aren’t shown here.

net/wireless/ap.c+3−1

This diff is large: its 21 lines aren’t shown here.

net/wireless/chan.c+263−50

This diff is large: its 354 lines aren’t shown here.

net/wireless/core.c+16−7

This diff is large: its 90 lines aren’t shown here.

net/wireless/core.h+16−16

This diff is large: its 87 lines aren’t shown here.

net/wireless/ethtool.c+7−8

This diff is large: its 57 lines aren’t shown here.

net/wireless/ibss.c+21−15

This diff is large: its 130 lines aren’t shown here.

net/wireless/mesh.c+24−35

This diff is large: its 158 lines aren’t shown here.

net/wireless/mlme.c+75−41

This diff is large: its 400 lines aren’t shown here.

net/wireless/nl80211.c+583−285

This diff is large: its 1721 lines aren’t shown here.

net/wireless/nl80211.h+3−5

This diff is large: its 26 lines aren’t shown here.

net/wireless/rdev-ops.h+878−0

This diff is large: its 879 lines aren’t shown here.

net/wireless/reg.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/wireless/reg.h+1−1

This diff is large: its 9 lines aren’t shown here.

net/wireless/scan.c+349−266

This diff is large: its 1026 lines aren’t shown here.

net/wireless/sme.c+18−7

This diff is large: its 91 lines aren’t shown here.

net/wireless/sysfs.c+3−2

This diff is large: its 26 lines aren’t shown here.

net/wireless/trace.c+7−0

This diff is large: its 8 lines aren’t shown here.

net/wireless/trace.h+2324−0

This diff is large: its 2325 lines aren’t shown here.

net/wireless/util.c+186−11

This diff is large: its 255 lines aren’t shown here.

net/wireless/wext-compat.c+41−35

This diff is large: its 249 lines aren’t shown here.

net/wireless/wext-sme.c+16−3

This diff is large: its 38 lines aren’t shown here.

net/xfrm/xfrm_ipcomp.c+3−5

This diff is large: its 22 lines aren’t shown here.

net/xfrm/xfrm_replay.c+6−7

This diff is large: its 20 lines aren’t shown here.

net/xfrm/xfrm_sysctl.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/xfrm/xfrm_user.c+1−1

This diff is large: its 9 lines aren’t shown here.

security/selinux/nlmsgtab.c+3−0

This diff is large: its 10 lines aren’t shown here.

tools/virtio/virtio_test.c+1−1

This diff is large: its 9 lines aren’t shown here.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t