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 @@
1What: /sys/bus/mdio_bus/devices/.../phy_id
2Date: November 2012
3KernelVersion: 3.8
4Contact: netdev@vger.kernel.org
5Description:
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 @@
1 1
2What: /sys/class/net/<iface>/batman-adv/iface_status
3Date: May 2010
4Contact: Marek Lindner <lindner_marek@yahoo.de>
5Description:
6 Indicates the status of <iface> as it is seen by batman.
7
2What: /sys/class/net/<iface>/batman-adv/mesh_iface8What: /sys/class/net/<iface>/batman-adv/mesh_iface
3Date: May 20109Date: May 2010
4Contact: Marek Lindner <lindner_marek@yahoo.de>10Contact: Marek Lindner <lindner_marek@yahoo.de>
@@ -7,8 +13,3 @@ Description: · 2 unmodified lines
7 displays the batman mesh interface this <iface>13 displays the batman mesh interface this <iface>
8 currently is associated with.14 currently is associated with.
9 15
10What: /sys/class/net/<iface>/batman-adv/iface_status
11Date: May 2010
12Contact: Marek Lindner <lindner_marek@yahoo.de>
13Description:
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
2What: /sys/class/net/<iface>/grcan/enable0
3Date: October 2012
4KernelVersion: 3.8
5Contact: Andreas Larsson <andreas@gaisler.com>
6Description:
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
14What: /sys/class/net/<iface>/grcan/enable1
15Date: October 2012
16KernelVersion: 3.8
17Contact: Andreas Larsson <andreas@gaisler.com>
18Description:
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
26What: /sys/class/net/<iface>/grcan/select
27Date: October 2012
28KernelVersion: 3.8
29Contact: Andreas Larsson <andreas@gaisler.com>
30Description:
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
6 Indicates whether the batman protocol messages of the6 Indicates whether the batman protocol messages of the
7 mesh <mesh_iface> shall be aggregated or not.7 mesh <mesh_iface> shall be aggregated or not.
8 8
9What: /sys/class/net/<mesh_iface>/mesh/ap_isolation
10Date: May 2011
11Contact: Antonio Quartulli <ordex@autistici.org>
12Description:
13 Indicates whether the data traffic going from a
14 wireless client to another wireless client will be
15 silently dropped.
16
9What: /sys/class/net/<mesh_iface>/mesh/bonding17What: /sys/class/net/<mesh_iface>/mesh/bonding
10Date: June 201018Date: June 2010
11Contact: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>19Contact: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
@@ -31,14 +39,6 @@ Description: · 19 unmodified lines
31 mesh will be fragmented or silently discarded if the39 mesh will be fragmented or silently discarded if the
32 packet size exceeds the outgoing interface MTU.40 packet size exceeds the outgoing interface MTU.
33 41
34What: /sys/class/net/<mesh_iface>/mesh/ap_isolation
35Date: May 2011
36Contact: Antonio Quartulli <ordex@autistici.org>
37Description:
38 Indicates whether the data traffic going from a
39 wireless client to another wireless client will be
40 silently dropped.
41
42What: /sys/class/net/<mesh_iface>/mesh/gw_bandwidth42What: /sys/class/net/<mesh_iface>/mesh/gw_bandwidth
43Date: October 201043Date: October 2010
44Contact: Marek Lindner <lindner_marek@yahoo.de>44Contact: Marek Lindner <lindner_marek@yahoo.de>
@@ -60,6 +60,13 @@ Description: · 15 unmodified lines
60 Defines the selection criteria this node will use60 Defines the selection criteria this node will use
61 to choose a gateway if gw_mode was set to 'client'.61 to choose a gateway if gw_mode was set to 'client'.
62 62
63What: /sys/class/net/<mesh_iface>/mesh/hop_penalty
64Date: Oct 2010
65Contact: Linus Lüssing <linus.luessing@web.de>
66Description:
67 Defines the penalty which will be applied to an
68 originator message's tq-field on every hop.
69
63What: /sys/class/net/<mesh_iface>/mesh/orig_interval70What: /sys/class/net/<mesh_iface>/mesh/orig_interval
64Date: May 201071Date: May 2010
65Contact: Marek Lindner <lindner_marek@yahoo.de>72Contact: Marek Lindner <lindner_marek@yahoo.de>
@@ -67,19 +74,12 @@ Description: · 1 unmodified line
67 Defines the interval in milliseconds in which batman74 Defines the interval in milliseconds in which batman
68 sends its protocol messages.75 sends its protocol messages.
69 76
70What: /sys/class/net/<mesh_iface>/mesh/hop_penalty77What: /sys/class/net/<mesh_iface>/mesh/routing_algo
71Date: Oct 201078Date: Dec 2011
72Contact: Linus Lüssing <linus.luessing@web.de>79Contact: Marek Lindner <lindner_marek@yahoo.de>
73Description:
74 Defines the penalty which will be applied to an
75 originator message's tq-field on every hop.
76
77What: /sys/class/net/<mesh_iface>/mesh/routing_algo
78Date: Dec 2011
79Contact: Marek Lindner <lindner_marek@yahoo.de>
80Description:80Description:
81 Defines the routing procotol this mesh instance81 Defines the routing procotol this mesh instance
82 uses to find the optimal paths through the mesh.82 uses to find the optimal paths through the mesh.
83 83
84What: /sys/class/net/<mesh_iface>/mesh/vis_mode84What: /sys/class/net/<mesh_iface>/mesh/vis_mode
85Date: May 201085Date: May 2010
Documentation/devicetree/bindings/net/can/grcan.txt+28−0
@@ -0,0 +1,28 @@
1Aeroflex Gaisler GRCAN and GRHCAN CAN controllers.
2
3The GRCAN and CRHCAN CAN controllers are available in the GRLIB VHDL IP core
4library.
5
6Note: 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
8sparc.
9
10Required 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
21Optional 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
27For further information look in the documentation for the GLIB IP core library:
28http://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
3Required 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
12Optional properties:
13- local-mac-address: 6 bytes, mac address
14
15Examples:
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
9 number9 number
10- interrupt-parent : The parent interrupt controller10- interrupt-parent : The parent interrupt controller
11- cpdma_channels : Specifies number of channels in CPDMA11- 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
16- ale_entries : Specifies No of entries ALE can hold12- 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
20- bd_ram_size : Specifies internal descriptor RAM size13- bd_ram_size : Specifies internal descriptor RAM size
21- rx_descs : Specifies number of Rx descriptors14- rx_descs : Specifies number of Rx descriptors
22- mac_control : Specifies Default MAC control register content15- mac_control : Specifies Default MAC control register content
23 for the specific platform16 for the specific platform
24- slaves : Specifies number for slaves17- slaves : Specifies number for slaves
25- slave_reg_ofs : Specifies slave register offset18- cpts_active_slave : Specifies the slave to use for time stamping
26- sliver_reg_ofs : Specifies slave sliver register offset19- cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds
20- cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds
27- phy_id : Specifies slave phy id21- phy_id : Specifies slave phy id
28- mac-address : Specifies slave MAC address22- mac-address : Specifies slave MAC address
29 23
@@ -45,30 +39,22 @@ Examples: · 15 unmodified lines
45 interrupts = <55 0x4>;39 interrupts = <55 0x4>;
46 interrupt-parent = <&intc>;40 interrupt-parent = <&intc>;
47 cpdma_channels = <8>;41 cpdma_channels = <8>;
48 host_port_no = <0>;
49 cpdma_reg_ofs = <0x800>;
50 cpdma_sram_ofs = <0xa00>;
51 ale_reg_ofs = <0xd00>;
52 ale_entries = <1024>;42 ale_entries = <1024>;
53 host_port_reg_ofs = <0x108>;
54 hw_stats_reg_ofs = <0x900>;
55 bd_ram_ofs = <0x2000>;
56 bd_ram_size = <0x2000>;43 bd_ram_size = <0x2000>;
57 no_bd_ram = <0>;44 no_bd_ram = <0>;
58 rx_descs = <64>;45 rx_descs = <64>;
59 mac_control = <0x20>;46 mac_control = <0x20>;
60 slaves = <2>;47 slaves = <2>;
48 cpts_active_slave = <0>;
49 cpts_clock_mult = <0x80000000>;
50 cpts_clock_shift = <29>;
61 cpsw_emac0: slave@0 {51 cpsw_emac0: slave@0 {
62 slave_reg_ofs = <0x208>;52 phy_id = <&davinci_mdio>, <0>;
63 sliver_reg_ofs = <0xd80>;
64 phy_id = "davinci_mdio.16:00";
65 /* Filled in by U-Boot */53 /* Filled in by U-Boot */
66 mac-address = [ 00 00 00 00 00 00 ];54 mac-address = [ 00 00 00 00 00 00 ];
67 };55 };
68 cpsw_emac1: slave@1 {56 cpsw_emac1: slave@1 {
69 slave_reg_ofs = <0x308>;57 phy_id = <&davinci_mdio>, <1>;
70 sliver_reg_ofs = <0xdc0>;
71 phy_id = "davinci_mdio.16:01";
72 /* Filled in by U-Boot */58 /* Filled in by U-Boot */
73 mac-address = [ 00 00 00 00 00 00 ];59 mac-address = [ 00 00 00 00 00 00 ];
74 };60 };
@@ -79,30 +65,22 @@ Examples: · 4 unmodified lines
79 compatible = "ti,cpsw";65 compatible = "ti,cpsw";
80 ti,hwmods = "cpgmac0";66 ti,hwmods = "cpgmac0";
81 cpdma_channels = <8>;67 cpdma_channels = <8>;
82 host_port_no = <0>;
83 cpdma_reg_ofs = <0x800>;
84 cpdma_sram_ofs = <0xa00>;
85 ale_reg_ofs = <0xd00>;
86 ale_entries = <1024>;68 ale_entries = <1024>;
87 host_port_reg_ofs = <0x108>;
88 hw_stats_reg_ofs = <0x900>;
89 bd_ram_ofs = <0x2000>;
90 bd_ram_size = <0x2000>;69 bd_ram_size = <0x2000>;
91 no_bd_ram = <0>;70 no_bd_ram = <0>;
92 rx_descs = <64>;71 rx_descs = <64>;
93 mac_control = <0x20>;72 mac_control = <0x20>;
94 slaves = <2>;73 slaves = <2>;
74 cpts_active_slave = <0>;
75 cpts_clock_mult = <0x80000000>;
76 cpts_clock_shift = <29>;
95 cpsw_emac0: slave@0 {77 cpsw_emac0: slave@0 {
96 slave_reg_ofs = <0x208>;78 phy_id = <&davinci_mdio>, <0>;
97 sliver_reg_ofs = <0xd80>;
98 phy_id = "davinci_mdio.16:00";
99 /* Filled in by U-Boot */79 /* Filled in by U-Boot */
100 mac-address = [ 00 00 00 00 00 00 ];80 mac-address = [ 00 00 00 00 00 00 ];
101 };81 };
102 cpsw_emac1: slave@1 {82 cpsw_emac1: slave@1 {
103 slave_reg_ofs = <0x308>;83 phy_id = <&davinci_mdio>, <1>;
104 sliver_reg_ofs = <0xdc0>;
105 phy_id = "davinci_mdio.16:01";
106 /* Filled in by U-Boot */84 /* Filled in by U-Boot */
107 mac-address = [ 00 00 00 00 00 00 ];85 mac-address = [ 00 00 00 00 00 00 ];
108 };86 };
Documentation/kernel-parameters.txt+18−0
@@ -905,6 +905,24 @@ bytes respectively. Such letter suffixes can also be entirely omitted. · 904 unmodified lines
905 gpt [EFI] Forces disk with valid GPT signature but905 gpt [EFI] Forces disk with valid GPT signature but
906 invalid Protective MBR to be treated as GPT.906 invalid Protective MBR to be treated as GPT.
907 907
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
908 hashdist= [KNL,NUMA] Large hashes allocated during boot926 hashdist= [KNL,NUMA] Large hashes allocated during boot
909 are distributed across NUMA nodes. Defaults on927 are distributed across NUMA nodes. Defaults on
910 for 64-bit NUMA, off otherwise.928 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
2032 - Enable messages related to route added / changed / deleted2032 - Enable messages related to route added / changed / deleted
2044 - Enable messages related to translation table operations2044 - Enable messages related to translation table operations
2058 - Enable messages related to bridge loop avoidance2058 - Enable messages related to bridge loop avoidance
20615 - enable all messages20616 - Enable messaged related to DAT, ARP snooping and parsing
20731 - Enable all messages
207 208
208The debug output can be changed at runtime using the file209The debug output can be changed at runtime using the file
209/sys/class/net/bat0/mesh/log_level. e.g.210/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
30 Maximum number of neighbor entries allowed. Increase this30 Maximum number of neighbor entries allowed. Increase this
31 when using large numbers of interfaces and when communicating31 when using large numbers of interfaces and when communicating
32 with large numbers of directly-connected peers.32 with large numbers of directly-connected peers.
33 Default: 1024
33 34
34neigh/default/unres_qlen_bytes - INTEGER35neigh/default/unres_qlen_bytes - INTEGER
35 The maximum number of bytes which may be used by packets36 The maximum number of bytes which may be used by packets
36 queued for each unresolved address by other network layers.37 queued for each unresolved address by other network layers.
37 (added in linux 3.3)38 (added in linux 3.3)
39 Seting negative value is meaningless and will retrun error.
40 Default: 65536 Bytes(64KB)
38 41
39neigh/default/unres_qlen - INTEGER42neigh/default/unres_qlen - INTEGER
40 The maximum number of packets which may be queued for each43 The maximum number of packets which may be queued for each
41 unresolved address by other network layers.44 unresolved address by other network layers.
42 (deprecated in linux 3.3) : use unres_qlen_bytes instead.45 (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
43 51
44mtu_expires - INTEGER52mtu_expires - INTEGER
45 Time, in seconds, that cached PMTU information is kept.53 Time, in seconds, that cached PMTU information is kept.
@@ -199,15 +207,16 @@ tcp_early_retrans - INTEGER · 153 unmodified lines
199 Default: 2207 Default: 2
200 208
201tcp_ecn - INTEGER209tcp_ecn - INTEGER
202 Enable Explicit Congestion Notification (ECN) in TCP. ECN is only210 Control use of Explicit Congestion Notification (ECN) by TCP.
203 used when both ends of the TCP flow support it. It is useful to211 ECN is used only when both ends of the TCP connection indicate
204 avoid losses due to congestion (when the bottleneck router supports212 support for it. This feature is useful in avoiding losses due
205 ECN).213 to congestion by allowing supporting routers to signal
214 congestion before having to drop packets.
206 Possible values are:215 Possible values are:
207 0 disable ECN216 0 Disable ECN. Neither initiate nor accept ECN.
208 1 ECN enabled217 1 Always request ECN on outgoing connection attempts.
209 2 Only server-side ECN enabled. If the other end does218 2 Enable ECN when requested by incomming connections
210 not support ECN, behavior is like with ECN disabled.219 but do not request ECN on outgoing connections.
211 Default: 2220 Default: 2
212 221
213tcp_fack - BOOLEAN222tcp_fack - BOOLEAN
@@ -215,15 +224,14 @@ tcp_fack - BOOLEAN · 1 unmodified line
215 The value is not used, if tcp_sack is not enabled.224 The value is not used, if tcp_sack is not enabled.
216 225
217tcp_fin_timeout - INTEGER226tcp_fin_timeout - INTEGER
218 Time to hold socket in state FIN-WAIT-2, if it was closed227 The length of time an orphaned (no longer referenced by any
219 by our side. Peer can be broken and never close its side,228 application) connection will remain in the FIN_WAIT_2 state
220 or even died unexpectedly. Default value is 60sec.229 before it is aborted at the local end. While a perfectly
221 Usual value used in 2.2 was 180 seconds, you may restore230 valid "receive only" state for an un-orphaned connection, an
222 it, but remember that if your machine is even underloaded WEB server,231 orphaned connection in FIN_WAIT_2 state could otherwise wait
223 you risk to overflow memory with kilotons of dead sockets,232 forever for the remote to close its end of the connection.
224 FIN-WAIT-2 sockets are less dangerous than FIN-WAIT-1,233 Cf. tcp_max_orphans
225 because they eat maximum 1.5K of memory, but they tend234 Default: 60 seconds
226 to live longer. Cf. tcp_max_orphans.
227 235
228tcp_frto - INTEGER236tcp_frto - INTEGER
229 Enables Forward RTO-Recovery (F-RTO) defined in RFC4138.237 Enables Forward RTO-Recovery (F-RTO) defined in RFC4138.
@@ -1514,6 +1522,20 @@ cookie_preserve_enable - BOOLEAN · 1284 unmodified lines
1514 1522
1515 Default: 11523 Default: 1
1516 1524
1525cookie_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
1517rcvbuf_policy - INTEGER1539rcvbuf_policy - INTEGER
1518 Determines if the receive buffer is attributed to the socket or to1540 Determines if the receive buffer is attributed to the socket or to
1519 association. SCTP supports the capability to create multiple1541 association. SCTP supports the capability to create multiple
Documentation/networking/packet_mmap.txt+222−24
@@ -3,9 +3,9 @@ · 2 unmodified lines
3--------------------------------------------------------------------------------3--------------------------------------------------------------------------------
4 4
5This file documents the mmap() facility available with the PACKET5This file documents the mmap() facility available with the PACKET
6socket interface on 2.4 and 2.6 kernels. This type of sockets is used for 6socket interface on 2.4/2.6/3.x kernels. This type of sockets is used for
7capture network traffic with utilities like tcpdump or any other that needs7i) capture network traffic with utilities like tcpdump, ii) transmit network
8raw access to network interface.8traffic, or any other that needs raw access to network interface.
9 9
10You can find the latest version of this document at:10You can find the latest version of this document at:
11 http://wiki.ipxwarzone.com/index.php5?title=Linux_packet_mmap11 http://wiki.ipxwarzone.com/index.php5?title=Linux_packet_mmap
@@ -21,19 +21,18 @@ Please send your comments to · 9 unmodified lines
21+ Why use PACKET_MMAP21+ Why use PACKET_MMAP
22--------------------------------------------------------------------------------22--------------------------------------------------------------------------------
23 23
24In Linux 2.4/2.6 if PACKET_MMAP is not enabled, the capture process is very24In Linux 2.4/2.6/3.x if PACKET_MMAP is not enabled, the capture process is very
25inefficient. It uses very limited buffers and requires one system call25inefficient. It uses very limited buffers and requires one system call to
26to capture each packet, it requires two if you want to get packet's 26capture each packet, it requires two if you want to get packet's timestamp
27timestamp (like libpcap always does).27(like libpcap always does).
28 28
29In the other hand PACKET_MMAP is very efficient. PACKET_MMAP provides a size 29In the other hand PACKET_MMAP is very efficient. PACKET_MMAP provides a size
30configurable circular buffer mapped in user space that can be used to either30configurable circular buffer mapped in user space that can be used to either
31send or receive packets. This way reading packets just needs to wait for them,31send or receive packets. This way reading packets just needs to wait for them,
32most of the time there is no need to issue a single system call. Concerning32most of the time there is no need to issue a single system call. Concerning
33transmission, multiple packets can be sent through one system call to get the33transmission, multiple packets can be sent through one system call to get the
34highest bandwidth.34highest bandwidth. By using a shared buffer between the kernel and the user
35By using a shared buffer between the kernel and the user also has the benefit35also has the benefit of minimizing packet copies.
36of minimizing packet copies.
37 36
38It's fine to use PACKET_MMAP to improve the performance of the capture and37It's fine to use PACKET_MMAP to improve the performance of the capture and
39transmission process, but it isn't everything. At least, if you are capturing38transmission 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
41device driver of your network interface card supports some sort of interrupt40device driver of your network interface card supports some sort of interrupt
42load mitigation or (even better) if it supports NAPI, also make sure it is41load mitigation or (even better) if it supports NAPI, also make sure it is
43enabled. For transmission, check the MTU (Maximum Transmission Unit) used and42enabled. For transmission, check the MTU (Maximum Transmission Unit) used and
44supported by devices of your network.43supported by devices of your network. CPU IRQ pinning of your network interface
44card can also be an advantage.
45 45
46--------------------------------------------------------------------------------46--------------------------------------------------------------------------------
47+ How to use mmap() to improve capture process47+ How to use mmap() to improve capture process
@@ -87,9 +87,7 @@ the following process: · 39 unmodified lines
87socket creation and destruction is straight forward, and is done 87socket creation and destruction is straight forward, and is done
88the same way with or without PACKET_MMAP:88the same way with or without PACKET_MMAP:
89 89
90int fd;90 int fd = socket(PF_PACKET, mode, htons(ETH_P_ALL));
91
92fd= socket(PF_PACKET, mode, htons(ETH_P_ALL))
93 91
94where mode is SOCK_RAW for the raw interface were link level92where mode is SOCK_RAW for the raw interface were link level
95information can be captured or SOCK_DGRAM for the cooked93information can be captured or SOCK_DGRAM for the cooked
@@ -163,11 +161,23 @@ As capture, each frame contains two parts: · 67 unmodified lines
163 161
164 A complete tutorial is available at: http://wiki.gnu-log.net/162 A complete tutorial is available at: http://wiki.gnu-log.net/
165 163
164By default, the user should put data at :
165 frame base + TPACKET_HDRLEN - sizeof(struct sockaddr_ll)
166
167So, whatever you choose for the socket mode (SOCK_DGRAM or SOCK_RAW),
168the beginning of the user data will be at :
169 frame base + TPACKET_ALIGN(sizeof(struct tpacket_hdr))
170
171If you wish to put user data at a custom offset from the beginning of
172the frame (for payload alignment with SOCK_RAW mode for instance) you
173can set tp_net (with SOCK_DGRAM) or tp_mac (with SOCK_RAW). In order
174to make this work it must be enabled previously with setsockopt()
175and the PACKET_TX_HAS_OFF option.
176
166--------------------------------------------------------------------------------177--------------------------------------------------------------------------------
167+ PACKET_MMAP settings178+ PACKET_MMAP settings
168--------------------------------------------------------------------------------179--------------------------------------------------------------------------------
169 180
170
171To setup PACKET_MMAP from user level code is done with a call like181To setup PACKET_MMAP from user level code is done with a call like
172 182
173 - Capture process183 - Capture process
@@ -201,7 +211,6 @@ indeed, packet_set_ring checks that the following condition is true · 27 unmodified lines
201 211
202 frames_per_block * tp_block_nr == tp_frame_nr212 frames_per_block * tp_block_nr == tp_frame_nr
203 213
204
205Lets see an example, with the following values:214Lets see an example, with the following values:
206 215
207 tp_block_size= 4096216 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
227account when choosing the frame_size. See "Mapping and use of the circular 236account when choosing the frame_size. See "Mapping and use of the circular
228buffer (ring)".237buffer (ring)".
229 238
230
231--------------------------------------------------------------------------------239--------------------------------------------------------------------------------
232+ PACKET_MMAP setting constraints240+ PACKET_MMAP setting constraints
233--------------------------------------------------------------------------------241--------------------------------------------------------------------------------
@@ -264,7 +272,6 @@ User space programs can include /usr/include/sys/user.h and · 30 unmodified lines
264The pagesize can also be determined dynamically with the getpagesize (2) 272The pagesize can also be determined dynamically with the getpagesize (2)
265system call. 273system call.
266 274
267
268 Block number limit275 Block number limit
269--------------------276--------------------
270 277
@@ -284,7 +291,6 @@ called pg_vec, its size limits the number of blocks that can be allocated. · 13 unmodified lines
284 v block #2291 v block #2
285 block #1292 block #1
286 293
287
288kmalloc allocates any number of bytes of physically contiguous memory from 294kmalloc allocates any number of bytes of physically contiguous memory from
289a pool of pre-determined sizes. This pool of memory is maintained by the slab 295a pool of pre-determined sizes. This pool of memory is maintained by the slab
290allocator which is at the end the responsible for doing the allocation and 296allocator which is at the end the responsible for doing the allocation and
@@ -299,7 +305,6 @@ pointers to blocks is · 8 unmodified lines
299 305
300 131072/4 = 32768 blocks306 131072/4 = 32768 blocks
301 307
302
303 PACKET_MMAP buffer size calculator308 PACKET_MMAP buffer size calculator
304------------------------------------309------------------------------------
305 310
@@ -340,7 +345,6 @@ and a value for <frame size> of 2048 bytes. These parameters will yield · 34 unmodified lines
340and hence the buffer will have a 262144 MiB size. So it can hold 345and hence the buffer will have a 262144 MiB size. So it can hold
341262144 MiB / 2048 bytes = 134217728 frames346262144 MiB / 2048 bytes = 134217728 frames
342 347
343
344Actually, this buffer size is not possible with an i386 architecture. 348Actually, this buffer size is not possible with an i386 architecture.
345Remember that the memory is allocated in kernel space, in the case of 349Remember that the memory is allocated in kernel space, in the case of
346an i386 kernel's memory size is limited to 1GiB.350an i386 kernel's memory size is limited to 1GiB.
@@ -372,7 +376,6 @@ the following (from include/linux/if_packet.h): · 25 unmodified lines
372 - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16.376 - Start+tp_net: Packet data, aligned to TPACKET_ALIGNMENT=16.
373 - Pad to align to TPACKET_ALIGNMENT=16377 - Pad to align to TPACKET_ALIGNMENT=16
374 */378 */
375
376 379
377 The following are conditions that are checked in packet_set_ring380 The following are conditions that are checked in packet_set_ring
378 381
@@ -413,7 +416,6 @@ and the following flags apply: · 34 unmodified lines
413 #define TP_STATUS_LOSING 4 416 #define TP_STATUS_LOSING 4
414 #define TP_STATUS_CSUMNOTREADY 8 417 #define TP_STATUS_CSUMNOTREADY 8
415 418
416
417TP_STATUS_COPY : This flag indicates that the frame (and associated419TP_STATUS_COPY : This flag indicates that the frame (and associated
418 meta information) has been truncated because it's 420 meta information) has been truncated because it's
419 larger than tp_frame_size. This packet can be 421 larger than tp_frame_size. This packet can be
@@ -462,7 +464,6 @@ packets are in the ring: · 42 unmodified lines
462It doesn't incur in a race condition to first check the status value and 464It doesn't incur in a race condition to first check the status value and
463then poll for frames.465then poll for frames.
464 466
465
466++ Transmission process467++ Transmission process
467Those defines are also used for transmission:468Those defines are also used for transmission:
468 469
@@ -493,6 +494,196 @@ The user can also use poll() to check if a buffer is available: · 24 unmodified lines
493 pfd.events = POLLOUT;494 pfd.events = POLLOUT;
494 retval = poll(&pfd, 1, timeout);495 retval = poll(&pfd, 1, timeout);
495 496
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
505where 'tpacket_version' can be TPACKET_V1 (default), TPACKET_V2, TPACKET_V3.
506
507TPACKET_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
513TPACKET_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
527TPACKET_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
543In the AF_PACKET fanout mode, packet reception can be load balanced among
544processes. This also works in combination with mmap(2) on packet sockets.
545
546Minimal 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
566static const char *device_name;
567static int fanout_type;
568static 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
576static 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
616static 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
643int 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
496-------------------------------------------------------------------------------687-------------------------------------------------------------------------------
497+ PACKET_TIMESTAMP688+ PACKET_TIMESTAMP
498-------------------------------------------------------------------------------689-------------------------------------------------------------------------------
@@ -519,6 +710,13 @@ the networking stack is used (the behavior before this setting was added). · 20 unmodified lines
519See include/linux/net_tstamp.h and Documentation/networking/timestamping710See include/linux/net_tstamp.h and Documentation/networking/timestamping
520for more information on hardware timestamps.711for more information on hardware timestamps.
521 712
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
522--------------------------------------------------------------------------------720--------------------------------------------------------------------------------
523+ THANKS721+ THANKS
524--------------------------------------------------------------------------------722--------------------------------------------------------------------------------
Documentation/networking/stmmac.txt+15−13
@@ -29,11 +29,9 @@ The kernel configuration option is STMMAC_ETH: · 28 unmodified lines
29 dma_txsize: DMA tx ring size;29 dma_txsize: DMA tx ring size;
30 buf_sz: DMA buffer size;30 buf_sz: DMA buffer size;
31 tc: control the HW FIFO threshold;31 tc: control the HW FIFO threshold;
32 tx_coe: Enable/Disable Tx Checksum Offload engine;
33 watchdog: transmit timeout (in milliseconds);32 watchdog: transmit timeout (in milliseconds);
34 flow_ctrl: Flow control ability [on/off];33 flow_ctrl: Flow control ability [on/off];
35 pause: Flow Control Pause Time;34 pause: Flow Control Pause Time;
36 tmrate: timer period (only if timer optimisation is configured).
37 35
383) Command line options363) Command line options
39Driver parameters can be also passed in command line by using:37Driver 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
60The incoming packets are stored, by the DMA, in a list of pre-allocated socket58The incoming packets are stored, by the DMA, in a list of pre-allocated socket
61buffers in order to avoid the memcpy (Zero-copy).59buffers in order to avoid the memcpy (Zero-copy).
62 60
634.3) Timer-Driver Interrupt614.3) Interrupt Mitigation
64Instead of having the device that asynchronously notifies the frame receptions,62The driver is able to mitigate the number of its DMA interrupts
65the driver configures a timer to generate an interrupt at regular intervals.63using NAPI for the reception on chips older than the 3.50.
66Based on the granularity of the timer, the frames that are received by the64New chips have an HW RX-Watchdog used for this mitigation.
67device will experience different levels of latency. Some NICs have dedicated65
68timer device to perform this task. STMMAC can use either the RTC device or the66On Tx-side, the mitigation schema is based on a SW timer that calls the
69TMU channel 2 on STLinux platforms.67tx function (stmmac_tx) to reclaim the resource after transmitting the
70The timers frequency can be passed to the driver as parameter; when change it,68frames.
71take care of both hardware capability and network stability/performance impact.69Also there is another parameter (like a threshold) used to program
72Several performance tests on STM platforms showed this optimisation allows to70the descriptors avoiding to set the interrupt on completion bit in
73spare the CPU while having the maximum throughput.71when the frame is sent (xmit).
72
73Mitigation parameters can be tuned by ethtool.
74 74
754.4) WOL754.4) WOL
76Wake up on Lan feature through Magic and Unicast frames are supported for the76Wake up on Lan feature through Magic and Unicast frames are supported for the
@@ -121,6 +121,7 @@ struct plat_stmmacenet_data { · 44 unmodified lines
121 int bugged_jumbo;121 int bugged_jumbo;
122 int pmt;122 int pmt;
123 int force_sf_dma_mode;123 int force_sf_dma_mode;
124 int riwt_off;
124 void (*fix_mac_speed)(void *priv, unsigned int speed);125 void (*fix_mac_speed)(void *priv, unsigned int speed);
125 void (*bus_setup)(void __iomem *ioaddr);126 void (*bus_setup)(void __iomem *ioaddr);
126 int (*init)(struct platform_device *pdev);127 int (*init)(struct platform_device *pdev);
@@ -156,6 +157,7 @@ Where: · 29 unmodified lines
156 o pmt: core has the embedded power module (optional).157 o pmt: core has the embedded power module (optional).
157 o force_sf_dma_mode: force DMA to use the Store and Forward mode158 o force_sf_dma_mode: force DMA to use the Store and Forward mode
158 instead of the Threshold.159 instead of the Threshold.
160 o riwt_off: force to disable the RX watchdog feature and switch to NAPI mode.
159 o fix_mac_speed: this callback is used for modifying some syscfg registers161 o fix_mac_speed: this callback is used for modifying some syscfg registers
160 (on ST SoCs) according to the link speed negotiated by the162 (on ST SoCs) according to the link speed negotiated by the
161 physical layer .163 physical layer .
MAINTAINERS+22−5
@@ -1680,10 +1680,9 @@ F: drivers/net/ethernet/broadcom/tg3.* · 1679 unmodified lines
1680 1680
1681BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER1681BROADCOM BRCM80211 IEEE802.11n WIRELESS DRIVER
1682M: Brett Rudley <brudley@broadcom.com>1682M: Brett Rudley <brudley@broadcom.com>
1683M: Roland Vossen <rvossen@broadcom.com>
1684M: Arend van Spriel <arend@broadcom.com>1683M: Arend van Spriel <arend@broadcom.com>
1685M: Franky (Zhenhui) Lin <frankyl@broadcom.com>1684M: Franky (Zhenhui) Lin <frankyl@broadcom.com>
1686M: Kan Yan <kanyan@broadcom.com>1685M: Hante Meuleman <meuleman@broadcom.com>
1687L: linux-wireless@vger.kernel.org1686L: linux-wireless@vger.kernel.org
1688L: brcm80211-dev-list@broadcom.com1687L: brcm80211-dev-list@broadcom.com
1689S: Supported1688S: Supported
@@ -3949,7 +3948,9 @@ M: Greg Rose <gregory.v.rose@intel.com> · 2259 unmodified lines
3949M: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>3948M: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
3950M: Alex Duyck <alexander.h.duyck@intel.com>3949M: Alex Duyck <alexander.h.duyck@intel.com>
3951M: John Ronciak <john.ronciak@intel.com>3950M: John Ronciak <john.ronciak@intel.com>
3951M: Tushar Dave <tushar.n.dave@intel.com>
3952L: e1000-devel@lists.sourceforge.net3952L: e1000-devel@lists.sourceforge.net
3953W: http://www.intel.com/support/feedback.htm
3953W: http://e1000.sourceforge.net/3954W: http://e1000.sourceforge.net/
3954T: git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net.git3955T: git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net.git
3955T: git git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next.git3956T: 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
4833F: drivers/scsi/megaraid.*4834F: drivers/scsi/megaraid.*
4834F: drivers/scsi/megaraid/4835F: drivers/scsi/megaraid/
4835 4836
4837MELLANOX ETHERNET DRIVER (mlx4_en)
4838M: Amir Vadai <amirv@mellanox.com>
4839L: netdev@vger.kernel.org
4840S: Supported
4841W: http://www.mellanox.com
4842Q: http://patchwork.ozlabs.org/project/netdev/list/
4843F: drivers/net/ethernet/mellanox/mlx4/en_*
4844
4836MEMORY MANAGEMENT4845MEMORY MANAGEMENT
4837L: linux-mm@kvack.org4846L: linux-mm@kvack.org
4838W: http://www.linux-mm.org4847W: http://www.linux-mm.org
@@ -5075,7 +5084,7 @@ NETWORKING [GENERAL] · 236 unmodified lines
5075M: "David S. Miller" <davem@davemloft.net>5084M: "David S. Miller" <davem@davemloft.net>
5076L: netdev@vger.kernel.org5085L: netdev@vger.kernel.org
5077W: http://www.linuxfoundation.org/en/Net5086W: http://www.linuxfoundation.org/en/Net
5078W: http://patchwork.ozlabs.org/project/netdev/list/5087Q: http://patchwork.ozlabs.org/project/netdev/list/
5079T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git5088T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
5080T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git5089T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
5081S: Maintained5090S: Maintained
@@ -5135,6 +5144,7 @@ F: drivers/net/wireless/ · 53 unmodified lines
5135NETWORKING DRIVERS5144NETWORKING DRIVERS
5136L: netdev@vger.kernel.org5145L: netdev@vger.kernel.org
5137W: http://www.linuxfoundation.org/en/Net5146W: http://www.linuxfoundation.org/en/Net
5147Q: http://patchwork.ozlabs.org/project/netdev/list/
5138T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git5148T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
5139T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git5149T: git git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
5140S: Odd Fixes5150S: Odd Fixes
@@ -5167,6 +5177,7 @@ F: net/nfc/ · 26 unmodified lines
5167F: include/linux/nfc.h5177F: include/linux/nfc.h
5168F: include/net/nfc/5178F: include/net/nfc/
5169F: drivers/nfc/5179F: drivers/nfc/
5180F: include/linux/platform_data/pn544.h
5170 5181
5171NFS, SUNRPC, AND LOCKD CLIENTS5182NFS, SUNRPC, AND LOCKD CLIENTS
5172M: Trond Myklebust <Trond.Myklebust@netapp.com>5183M: Trond Myklebust <Trond.Myklebust@netapp.com>
@@ -6442,6 +6453,7 @@ F: drivers/scsi/st* · 1269 unmodified lines
6442SCTP PROTOCOL6453SCTP PROTOCOL
6443M: Vlad Yasevich <vyasevich@gmail.com>6454M: Vlad Yasevich <vyasevich@gmail.com>
6444M: Sridhar Samudrala <sri@us.ibm.com>6455M: Sridhar Samudrala <sri@us.ibm.com>
6456M: Neil Horman <nhorman@tuxdriver.com>
6445L: linux-sctp@vger.kernel.org6457L: linux-sctp@vger.kernel.org
6446W: http://lksctp.sourceforge.net6458W: http://lksctp.sourceforge.net
6447S: Maintained6459S: Maintained
@@ -7469,8 +7481,7 @@ S: Maintained · 1021 unmodified lines
7469F: drivers/net/ethernet/dec/tulip/7481F: drivers/net/ethernet/dec/tulip/
7470 7482
7471TUN/TAP driver7483TUN/TAP driver
7472M: Maxim Krasnyansky <maxk@qualcomm.com>7484M: Maxim Krasnyansky <maxk@qti.qualcomm.com>
7473L: vtun@office.satix.net
7474W: http://vtun.sourceforge.net/tun7485W: http://vtun.sourceforge.net/tun
7475S: Maintained7486S: Maintained
7476F: Documentation/networking/tuntap.txt7487F: Documentation/networking/tuntap.txt
@@ -7592,6 +7603,12 @@ S: Maintained · 115 unmodified lines
7592F: Documentation/usb/acm.txt7603F: Documentation/usb/acm.txt
7593F: drivers/usb/class/cdc-acm.*7604F: drivers/usb/class/cdc-acm.*
7594 7605
7606USB AR5523 WIRELESS DRIVER
7607M: Pontus Fuchs <pontus.fuchs@gmail.com>
7608L: linux-wireless@vger.kernel.org
7609S: Maintained
7610F: drivers/net/wireless/ath/ar5523/
7611
7595USB ATTACHED SCSI7612USB ATTACHED SCSI
7596M: Matthew Wilcox <willy@linux.intel.com>7613M: Matthew Wilcox <willy@linux.intel.com>
7597M: Sarah Sharp <sarah.a.sharp@linux.intel.com>7614M: Sarah Sharp <sarah.a.sharp@linux.intel.com>
arch/alpha/include/asm/socket.h+1−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
47/* Socket filtering */47/* Socket filtering */
48#define SO_ATTACH_FILTER 2648#define SO_ATTACH_FILTER 26
49#define SO_DETACH_FILTER 2749#define SO_DETACH_FILTER 27
50#define SO_GET_FILTER SO_ATTACH_FILTER
50 51
51#define SO_PEERNAME 2852#define SO_PEERNAME 28
52#define SO_TIMESTAMP 2953#define SO_TIMESTAMP 29
arch/arm/boot/dts/am335x-bone.dts+8−0
@@ -128,3 +128,11 @@ · 127 unmodified lines
128 };128 };
129 };129 };
130};130};
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
236 };236 };
237 };237 };
238};238};
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
338 power = <250>;338 power = <250>;
339 ti,hwmods = "usb_otg_hs";339 ti,hwmods = "usb_otg_hs";
340 };340 };
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 };
341 };388 };
342};389};
arch/arm/boot/dts/imx6q.dtsi+3−2
@@ -596,6 +596,7 @@ · 595 unmodified lines
596 66 0x1b0b0 /* MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 */596 66 0x1b0b0 /* MX6Q_PAD_RGMII_RD2__ENET_RGMII_RD2 */
597 70 0x1b0b0 /* MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 */597 70 0x1b0b0 /* MX6Q_PAD_RGMII_RD3__ENET_RGMII_RD3 */
598 48 0x1b0b0 /* MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL */598 48 0x1b0b0 /* MX6Q_PAD_RGMII_RX_CTL__RGMII_RX_CTL */
599 1033 0x4001b0a8 /* MX6Q_PAD_GPIO_16__ENET_ANATOP_ETHERNET_REF_OUT*/
599 >;600 >;
600 };601 };
601 602
@@ -849,8 +850,8 @@ · 247 unmodified lines
849 compatible = "fsl,imx6q-fec";850 compatible = "fsl,imx6q-fec";
850 reg = <0x02188000 0x4000>;851 reg = <0x02188000 0x4000>;
851 interrupts = <0 118 0x04 0 119 0x04>;852 interrupts = <0 118 0x04 0 119 0x04>;
852 clocks = <&clks 117>, <&clks 117>;853 clocks = <&clks 117>, <&clks 117>, <&clks 177>;
853 clock-names = "ipg", "ahb";854 clock-names = "ipg", "ahb", "ptp";
854 status = "disabled";855 status = "disabled";
855 };856 };
856 857
arch/arm/configs/omap2plus_defconfig+3−0
@@ -240,3 +240,6 @@ CONFIG_CRC_ITU_T=y · 239 unmodified lines
240CONFIG_CRC7=y240CONFIG_CRC7=y
241CONFIG_LIBCRC32C=y241CONFIG_LIBCRC32C=y
242CONFIG_SOC_OMAP5=y242CONFIG_SOC_OMAP5=y
243CONFIG_TI_DAVINCI_MDIO=y
244CONFIG_TI_DAVINCI_CPDMA=y
245CONFIG_TI_CPSW=y
arch/arm/mach-at91/Kconfig+0−4
@@ -39,7 +39,6 @@ config SOC_AT91RM9200 · 38 unmodified lines
39config SOC_AT91SAM926039config SOC_AT91SAM9260
40 bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"40 bool "AT91SAM9260, AT91SAM9XE or AT91SAM9G20"
41 select HAVE_AT91_DBGU041 select HAVE_AT91_DBGU0
42 select HAVE_NET_MACB
43 select SOC_AT91SAM942 select SOC_AT91SAM9
44 help43 help
45 Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE44 Select this if you are using one of Atmel's AT91SAM9260, AT91SAM9XE
@@ -57,7 +56,6 @@ config SOC_AT91SAM9263 · 11 unmodified lines
57 bool "AT91SAM9263"56 bool "AT91SAM9263"
58 select HAVE_AT91_DBGU157 select HAVE_AT91_DBGU1
59 select HAVE_FB_ATMEL58 select HAVE_FB_ATMEL
60 select HAVE_NET_MACB
61 select SOC_AT91SAM959 select SOC_AT91SAM9
62 60
63config SOC_AT91SAM9RL61config SOC_AT91SAM9RL
@@ -70,7 +68,6 @@ config SOC_AT91SAM9G45 · 6 unmodified lines
70 bool "AT91SAM9G45 or AT91SAM9M10 families"68 bool "AT91SAM9G45 or AT91SAM9M10 families"
71 select HAVE_AT91_DBGU169 select HAVE_AT91_DBGU1
72 select HAVE_FB_ATMEL70 select HAVE_FB_ATMEL
73 select HAVE_NET_MACB
74 select SOC_AT91SAM971 select SOC_AT91SAM9
75 help72 help
76 Select this if you are using one of Atmel's AT91SAM9G45 family SoC.73 Select this if you are using one of Atmel's AT91SAM9G45 family SoC.
@@ -80,7 +77,6 @@ config SOC_AT91SAM9X5 · 3 unmodified lines
80 bool "AT91SAM9x5 family"77 bool "AT91SAM9x5 family"
81 select HAVE_AT91_DBGU078 select HAVE_AT91_DBGU0
82 select HAVE_FB_ATMEL79 select HAVE_FB_ATMEL
83 select HAVE_NET_MACB
84 select SOC_AT91SAM980 select SOC_AT91SAM9
85 help81 help
86 Select this if you are using one of Atmel's AT91SAM9x5 family SoC.82 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
53static struct macb_platform_data __initdata csb337_eth_data = {53static struct macb_platform_data __initdata csb337_eth_data = {
54 .phy_irq_pin = AT91_PIN_PC2,54 .phy_irq_pin = AT91_PIN_PC2,
55 .is_rmii = 0,55 .is_rmii = 0,
56 /* The CSB337 bootloader stores the MAC the wrong-way around */
57 .rev_eth_addr = 1,
56};58};
57 59
58static struct at91_usbh_data __initdata csb337_usbh_data = {60static 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
117 imx6q_sabrelite_cko1_setup();117 imx6q_sabrelite_cko1_setup();
118}118}
119 119
120static 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}
120static void __init imx6q_usb_init(void)131static void __init imx6q_usb_init(void)
121{132{
122 struct regmap *anatop;133 struct regmap *anatop;
@@ -153,6 +164,7 @@ static void __init imx6q_init_machine(void) · 30 unmodified lines
153 164
154 imx6q_pm_init();165 imx6q_pm_init();
155 imx6q_usb_init();166 imx6q_usb_init();
167 imx6q_1588_init();
156}168}
157 169
158static struct cpuidle_driver imx6q_cpuidle_driver = {170static 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
674 .name = "cpgmac0",674 .name = "cpgmac0",
675 .class = &am33xx_cpgmac0_hwmod_class,675 .class = &am33xx_cpgmac0_hwmod_class,
676 .clkdm_name = "cpsw_125mhz_clkdm",676 .clkdm_name = "cpsw_125mhz_clkdm",
677 .flags = (HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY),
677 .mpu_irqs = am33xx_cpgmac0_irqs,678 .mpu_irqs = am33xx_cpgmac0_irqs,
678 .main_clk = "cpsw_125mhz_gclk",679 .main_clk = "cpsw_125mhz_gclk",
679 .prcm = {680 .prcm = {
@@ -684,6 +685,20 @@ static struct omap_hwmod am33xx_cpgmac0_hwmod = { · 4 unmodified lines
684 },685 },
685};686};
686 687
688/*
689 * mdio class
690 */
691static struct omap_hwmod_class am33xx_mdio_hwmod_class = {
692 .name = "davinci_mdio",
693};
694
695static 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
687/*702/*
688 * dcan class703 * dcan class
689 */704 */
@@ -2501,6 +2516,21 @@ static struct omap_hwmod_ocp_if am33xx_l4_hs__cpgmac0 = { · 1811 unmodified lines
2501 .user = OCP_USER_MPU,2516 .user = OCP_USER_MPU,
2502};2517};
2503 2518
2519struct omap_hwmod_addr_space am33xx_mdio_addr_space[] = {
2520 {
2521 .pa_start = 0x4A101000,
2522 .pa_end = 0x4A101000 + SZ_256 - 1,
2523 },
2524 { }
2525};
2526
2527struct 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
2504static struct omap_hwmod_addr_space am33xx_elm_addr_space[] = {2534static struct omap_hwmod_addr_space am33xx_elm_addr_space[] = {
2505 {2535 {
2506 .pa_start = 0x48080000,2536 .pa_start = 0x48080000,
@@ -3371,6 +3401,7 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { · 864 unmodified lines
3371 &am33xx_l3_main__tptc2,3401 &am33xx_l3_main__tptc2,
3372 &am33xx_l3_s__usbss,3402 &am33xx_l3_s__usbss,
3373 &am33xx_l4_hs__cpgmac0,3403 &am33xx_l4_hs__cpgmac0,
3404 &am33xx_cpgmac0__mdio,
3374 NULL,3405 NULL,
3375};3406};
3376 3407
arch/arm/net/bpf_jit_32.c+24−5
@@ -16,6 +16,7 @@ · 15 unmodified lines
16#include <linux/netdevice.h>16#include <linux/netdevice.h>
17#include <linux/string.h>17#include <linux/string.h>
18#include <linux/slab.h>18#include <linux/slab.h>
19#include <linux/if_vlan.h>
19#include <asm/cacheflush.h>20#include <asm/cacheflush.h>
20#include <asm/hwcap.h>21#include <asm/hwcap.h>
21 22
@@ -168,6 +169,8 @@ static inline bool is_load_to_a(u16 inst) · 146 unmodified lines
168 case BPF_S_ANC_MARK:169 case BPF_S_ANC_MARK:
169 case BPF_S_ANC_PROTOCOL:170 case BPF_S_ANC_PROTOCOL:
170 case BPF_S_ANC_RXHASH:171 case BPF_S_ANC_RXHASH:
172 case BPF_S_ANC_VLAN_TAG:
173 case BPF_S_ANC_VLAN_TAG_PRESENT:
171 case BPF_S_ANC_QUEUE:174 case BPF_S_ANC_QUEUE:
172 return true;175 return true;
173 default:176 default:
@@ -646,6 +649,16 @@ load_ind: · 472 unmodified lines
646 update_on_xread(ctx);649 update_on_xread(ctx);
647 emit(ARM_ORR_R(r_A, r_A, r_X), ctx);650 emit(ARM_ORR_R(r_A, r_A, r_X), ctx);
648 break;651 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;
649 case BPF_S_ALU_AND_K:662 case BPF_S_ALU_AND_K:
650 /* A &= K */663 /* A &= K */
651 OP_IMM3(ARM_AND, r_A, r_A, k, ctx);664 OP_IMM3(ARM_AND, r_A, r_A, k, ctx);
@@ -762,11 +775,6 @@ b_epilogue: · 110 unmodified lines
762 update_on_xread(ctx);775 update_on_xread(ctx);
763 emit(ARM_MOV_R(r_A, r_X), ctx);776 emit(ARM_MOV_R(r_A, r_X), ctx);
764 break;777 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;
770 case BPF_S_ANC_PROTOCOL:778 case BPF_S_ANC_PROTOCOL:
771 /* A = ntohs(skb->protocol) */779 /* A = ntohs(skb->protocol) */
772 ctx->seen |= SEEN_SKB;780 ctx->seen |= SEEN_SKB;
@@ -810,6 +818,17 @@ b_epilogue: · 37 unmodified lines
810 off = offsetof(struct sk_buff, rxhash);818 off = offsetof(struct sk_buff, rxhash);
811 emit(ARM_LDR_I(r_A, r_skb, off), ctx);819 emit(ARM_LDR_I(r_A, r_skb, off), ctx);
812 break;820 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;
813 case BPF_S_ANC_QUEUE:832 case BPF_S_ANC_QUEUE:
814 ctx->seen |= SEEN_SKB;833 ctx->seen |= SEEN_SKB;
815 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff,834 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff,
arch/arm/net/bpf_jit_32.h+2−0
@@ -69,6 +69,7 @@ · 68 unmodified lines
69#define ARM_INST_CMP_I 0x0350000069#define ARM_INST_CMP_I 0x03500000
70 70
71#define ARM_INST_EOR_R 0x0020000071#define ARM_INST_EOR_R 0x00200000
72#define ARM_INST_EOR_I 0x02200000
72 73
73#define ARM_INST_LDRB_I 0x05d0000074#define ARM_INST_LDRB_I 0x05d00000
74#define ARM_INST_LDRB_R 0x07d0000075#define ARM_INST_LDRB_R 0x07d00000
@@ -135,6 +136,7 @@ · 60 unmodified lines
135#define ARM_CMP_I(rn, imm) _AL3_I(ARM_INST_CMP, 0, rn, imm)136#define ARM_CMP_I(rn, imm) _AL3_I(ARM_INST_CMP, 0, rn, imm)
136 137
137#define ARM_EOR_R(rd, rn, rm) _AL3_R(ARM_INST_EOR, rd, rn, rm)138#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)
138 140
139#define ARM_LDR_I(rt, rn, off) (ARM_INST_LDR_I | (rt) << 12 | (rn) << 16 \141#define ARM_LDR_I(rt, rn, off) (ARM_INST_LDR_I | (rt) << 12 | (rn) << 16 \
140 | (off))142 | (off))
arch/avr32/Kconfig+0−1
@@ -82,7 +82,6 @@ config PLATFORM_AT32AP · 81 unmodified lines
82 select ARCH_REQUIRE_GPIOLIB82 select ARCH_REQUIRE_GPIOLIB
83 select GENERIC_ALLOCATOR83 select GENERIC_ALLOCATOR
84 select HAVE_FB_ATMEL84 select HAVE_FB_ATMEL
85 select HAVE_NET_MACB
86 85
87#86#
88# CPU types87# CPU types
arch/avr32/include/uapi/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
40/* Socket filtering */40/* Socket filtering */
41#define SO_ATTACH_FILTER 2641#define SO_ATTACH_FILTER 26
42#define SO_DETACH_FILTER 2742#define SO_DETACH_FILTER 27
43#define SO_GET_FILTER SO_ATTACH_FILTER
43 44
44#define SO_PEERNAME 2845#define SO_PEERNAME 28
45#define SO_TIMESTAMP 2946#define SO_TIMESTAMP 29
arch/cris/include/asm/socket.h+1−0
@@ -42,6 +42,7 @@ · 41 unmodified lines
42/* Socket filtering */42/* Socket filtering */
43#define SO_ATTACH_FILTER 2643#define SO_ATTACH_FILTER 26
44#define SO_DETACH_FILTER 2744#define SO_DETACH_FILTER 27
45#define SO_GET_FILTER SO_ATTACH_FILTER
45 46
46#define SO_PEERNAME 2847#define SO_PEERNAME 28
47#define SO_TIMESTAMP 2948#define SO_TIMESTAMP 29
arch/frv/include/uapi/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
40/* Socket filtering */40/* Socket filtering */
41#define SO_ATTACH_FILTER 2641#define SO_ATTACH_FILTER 26
42#define SO_DETACH_FILTER 2742#define SO_DETACH_FILTER 27
43#define SO_GET_FILTER SO_ATTACH_FILTER
43 44
44#define SO_PEERNAME 2845#define SO_PEERNAME 28
45#define SO_TIMESTAMP 2946#define SO_TIMESTAMP 29
arch/h8300/include/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
40/* Socket filtering */40/* Socket filtering */
41#define SO_ATTACH_FILTER 2641#define SO_ATTACH_FILTER 26
42#define SO_DETACH_FILTER 2742#define SO_DETACH_FILTER 27
43#define SO_GET_FILTER SO_ATTACH_FILTER
43 44
44#define SO_PEERNAME 2845#define SO_PEERNAME 28
45#define SO_TIMESTAMP 2946#define SO_TIMESTAMP 29
arch/ia64/include/uapi/asm/socket.h+1−0
@@ -49,6 +49,7 @@ · 48 unmodified lines
49/* Socket filtering */49/* Socket filtering */
50#define SO_ATTACH_FILTER 2650#define SO_ATTACH_FILTER 26
51#define SO_DETACH_FILTER 2751#define SO_DETACH_FILTER 27
52#define SO_GET_FILTER SO_ATTACH_FILTER
52 53
53#define SO_PEERNAME 2854#define SO_PEERNAME 28
54#define SO_TIMESTAMP 2955#define SO_TIMESTAMP 29
arch/m32r/include/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
40/* Socket filtering */40/* Socket filtering */
41#define SO_ATTACH_FILTER 2641#define SO_ATTACH_FILTER 26
42#define SO_DETACH_FILTER 2742#define SO_DETACH_FILTER 27
43#define SO_GET_FILTER SO_ATTACH_FILTER
43 44
44#define SO_PEERNAME 2845#define SO_PEERNAME 28
45#define SO_TIMESTAMP 2946#define SO_TIMESTAMP 29
arch/m68k/include/uapi/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
40/* Socket filtering */40/* Socket filtering */
41#define SO_ATTACH_FILTER 2641#define SO_ATTACH_FILTER 26
42#define SO_DETACH_FILTER 2742#define SO_DETACH_FILTER 27
43#define SO_GET_FILTER SO_ATTACH_FILTER
43 44
44#define SO_PEERNAME 2845#define SO_PEERNAME 28
45#define SO_TIMESTAMP 2946#define SO_TIMESTAMP 29
arch/mips/bcm47xx/nvram.c+2−2
@@ -43,8 +43,8 @@ static void early_nvram_init(void) · 42 unmodified lines
43#ifdef CONFIG_BCM47XX_SSB43#ifdef CONFIG_BCM47XX_SSB
44 case BCM47XX_BUS_TYPE_SSB:44 case BCM47XX_BUS_TYPE_SSB:
45 mcore_ssb = &bcm47xx_bus.ssb.mipscore;45 mcore_ssb = &bcm47xx_bus.ssb.mipscore;
46 base = mcore_ssb->flash_window;46 base = mcore_ssb->pflash.window;
47 lim = mcore_ssb->flash_window_size;47 lim = mcore_ssb->pflash.window_size;
48 break;48 break;
49#endif49#endif
50#ifdef CONFIG_BCM47XX_BCMA50#ifdef CONFIG_BCM47XX_BCMA
arch/mips/bcm47xx/wgt634u.c+4−4
@@ -156,10 +156,10 @@ static int __init wgt634u_init(void) · 155 unmodified lines
156 SSB_CHIPCO_IRQ_GPIO);156 SSB_CHIPCO_IRQ_GPIO);
157 }157 }
158 158
159 wgt634u_flash_data.width = mcore->flash_buswidth;159 wgt634u_flash_data.width = mcore->pflash.buswidth;
160 wgt634u_flash_resource.start = mcore->flash_window;160 wgt634u_flash_resource.start = mcore->pflash.window;
161 wgt634u_flash_resource.end = mcore->flash_window161 wgt634u_flash_resource.end = mcore->pflash.window
162 + mcore->flash_window_size162 + mcore->pflash.window_size
163 - 1;163 - 1;
164 return platform_add_devices(wgt634u_devices,164 return platform_add_devices(wgt634u_devices,
165 ARRAY_SIZE(wgt634u_devices));165 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
63/* Socket filtering */63/* Socket filtering */
64#define SO_ATTACH_FILTER 2664#define SO_ATTACH_FILTER 26
65#define SO_DETACH_FILTER 2765#define SO_DETACH_FILTER 27
66#define SO_GET_FILTER SO_ATTACH_FILTER
66 67
67#define SO_PEERNAME 2868#define SO_PEERNAME 28
68#define SO_TIMESTAMP 2969#define SO_TIMESTAMP 29
arch/mn10300/include/uapi/asm/socket.h+1−0
@@ -40,6 +40,7 @@ · 39 unmodified lines
40/* Socket filtering */40/* Socket filtering */
41#define SO_ATTACH_FILTER 2641#define SO_ATTACH_FILTER 26
42#define SO_DETACH_FILTER 2742#define SO_DETACH_FILTER 27
43#define SO_GET_FILTER SO_ATTACH_FILTER
43 44
44#define SO_PEERNAME 2845#define SO_PEERNAME 28
45#define SO_TIMESTAMP 2946#define SO_TIMESTAMP 29
arch/parisc/include/uapi/asm/socket.h+1−0
@@ -48,6 +48,7 @@ · 47 unmodified lines
48/* Socket filtering */48/* Socket filtering */
49#define SO_ATTACH_FILTER 0x401a49#define SO_ATTACH_FILTER 0x401a
50#define SO_DETACH_FILTER 0x401b50#define SO_DETACH_FILTER 0x401b
51#define SO_GET_FILTER SO_ATTACH_FILTER
51 52
52#define SO_ACCEPTCONN 0x401c53#define SO_ACCEPTCONN 0x401c
53 54
arch/powerpc/include/asm/ppc-opcode.h+3−0
@@ -168,9 +168,12 @@ · 167 unmodified lines
168#define PPC_INST_AND 0x7c000038168#define PPC_INST_AND 0x7c000038
169#define PPC_INST_ANDDOT 0x7c000039169#define PPC_INST_ANDDOT 0x7c000039
170#define PPC_INST_OR 0x7c000378170#define PPC_INST_OR 0x7c000378
171#define PPC_INST_XOR 0x7c000278
171#define PPC_INST_ANDI 0x70000000172#define PPC_INST_ANDI 0x70000000
172#define PPC_INST_ORI 0x60000000173#define PPC_INST_ORI 0x60000000
173#define PPC_INST_ORIS 0x64000000174#define PPC_INST_ORIS 0x64000000
175#define PPC_INST_XORI 0x68000000
176#define PPC_INST_XORIS 0x6c000000
174#define PPC_INST_NEG 0x7c0000d0177#define PPC_INST_NEG 0x7c0000d0
175#define PPC_INST_BRANCH 0x48000000178#define PPC_INST_BRANCH 0x48000000
176#define PPC_INST_BRANCH_COND 0x40800000179#define PPC_INST_BRANCH_COND 0x40800000
arch/powerpc/include/uapi/asm/socket.h+1−0
@@ -47,6 +47,7 @@ · 46 unmodified lines
47/* Socket filtering */47/* Socket filtering */
48#define SO_ATTACH_FILTER 2648#define SO_ATTACH_FILTER 26
49#define SO_DETACH_FILTER 2749#define SO_DETACH_FILTER 27
50#define SO_GET_FILTER SO_ATTACH_FILTER
50 51
51#define SO_PEERNAME 2852#define SO_PEERNAME 28
52#define SO_TIMESTAMP 2953#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
134 ___PPC_RS(a) | IMM_L(i))134 ___PPC_RS(a) | IMM_L(i))
135#define PPC_ORIS(d, a, i) EMIT(PPC_INST_ORIS | ___PPC_RA(d) | \135#define PPC_ORIS(d, a, i) EMIT(PPC_INST_ORIS | ___PPC_RA(d) | \
136 ___PPC_RS(a) | IMM_L(i))136 ___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))
137#define PPC_SLW(d, a, s) EMIT(PPC_INST_SLW | ___PPC_RA(d) | \143#define PPC_SLW(d, a, s) EMIT(PPC_INST_SLW | ___PPC_RA(d) | \
138 ___PPC_RS(a) | ___PPC_RB(s))144 ___PPC_RS(a) | ___PPC_RB(s))
139#define PPC_SRW(d, a, s) EMIT(PPC_INST_SRW | ___PPC_RA(d) | \145#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
13#include <asm/cacheflush.h>13#include <asm/cacheflush.h>
14#include <linux/netdevice.h>14#include <linux/netdevice.h>
15#include <linux/filter.h>15#include <linux/filter.h>
16#include <linux/if_vlan.h>
17
16#include "bpf_jit.h"18#include "bpf_jit.h"
17 19
18#ifndef __BIG_ENDIAN20#ifndef __BIG_ENDIAN
@@ -89,6 +91,8 @@ static void bpf_jit_build_prologue(struct sk_filter *fp, u32 *image, · 70 unmodified lines
89 case BPF_S_ANC_IFINDEX:91 case BPF_S_ANC_IFINDEX:
90 case BPF_S_ANC_MARK:92 case BPF_S_ANC_MARK:
91 case BPF_S_ANC_RXHASH:93 case BPF_S_ANC_RXHASH:
94 case BPF_S_ANC_VLAN_TAG:
95 case BPF_S_ANC_VLAN_TAG_PRESENT:
92 case BPF_S_ANC_CPU:96 case BPF_S_ANC_CPU:
93 case BPF_S_ANC_QUEUE:97 case BPF_S_ANC_QUEUE:
94 case BPF_S_LD_W_ABS:98 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
232 if (K >= 65536)236 if (K >= 65536)
233 PPC_ORIS(r_A, r_A, IMM_H(K));237 PPC_ORIS(r_A, r_A, IMM_H(K));
234 break;238 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;
235 case BPF_S_ALU_LSH_X: /* A <<= X; */250 case BPF_S_ALU_LSH_X: /* A <<= X; */
236 ctx->seen |= SEEN_XREG;251 ctx->seen |= SEEN_XREG;
237 PPC_SLW(r_A, r_A, r_X);252 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
371 PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,386 PPC_LWZ_OFFS(r_A, r_skb, offsetof(struct sk_buff,
372 rxhash));387 rxhash));
373 break;388 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;
374 case BPF_S_ANC_QUEUE:399 case BPF_S_ANC_QUEUE:
375 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff,400 BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff,
376 queue_mapping) != 2);401 queue_mapping) != 2);
arch/s390/include/uapi/asm/socket.h+1−0
@@ -46,6 +46,7 @@ · 45 unmodified lines
46/* Socket filtering */46/* Socket filtering */
47#define SO_ATTACH_FILTER 2647#define SO_ATTACH_FILTER 26
48#define SO_DETACH_FILTER 2748#define SO_DETACH_FILTER 27
49#define SO_GET_FILTER SO_ATTACH_FILTER
49 50
50#define SO_PEERNAME 2851#define SO_PEERNAME 28
51#define SO_TIMESTAMP 2952#define SO_TIMESTAMP 29
arch/sparc/include/uapi/asm/socket.h+1−0
@@ -41,6 +41,7 @@ · 40 unmodified lines
41 41
42#define SO_ATTACH_FILTER 0x001a42#define SO_ATTACH_FILTER 0x001a
43#define SO_DETACH_FILTER 0x001b43#define SO_DETACH_FILTER 0x001b
44#define SO_GET_FILTER SO_ATTACH_FILTER
44 45
45#define SO_PEERNAME 0x001c46#define SO_PEERNAME 0x001c
46#define SO_TIMESTAMP 0x001d47#define SO_TIMESTAMP 0x001d
arch/sparc/net/bpf_jit_comp.c+19−0
@@ -3,6 +3,7 @@ · 2 unmodified lines
3#include <linux/netdevice.h>3#include <linux/netdevice.h>
4#include <linux/filter.h>4#include <linux/filter.h>
5#include <linux/cache.h>5#include <linux/cache.h>
6#include <linux/if_vlan.h>
6 7
7#include <asm/cacheflush.h>8#include <asm/cacheflush.h>
8#include <asm/ptrace.h>9#include <asm/ptrace.h>
@@ -312,6 +313,12 @@ do { *prog++ = BR_OPC | WDISP22(OFF); \ · 303 unmodified lines
312#define emit_addi(R1, IMM, R3) \313#define emit_addi(R1, IMM, R3) \
313 *prog++ = (ADD | IMMED | RS1(R1) | S13(IMM) | RD(R3))314 *prog++ = (ADD | IMMED | RS1(R1) | S13(IMM) | RD(R3))
314 315
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
315#define emit_alloc_stack(SZ) \322#define emit_alloc_stack(SZ) \
316 *prog++ = (SUB | IMMED | RS1(SP) | S13(SZ) | RD(SP))323 *prog++ = (SUB | IMMED | RS1(SP) | S13(SZ) | RD(SP))
317 324
@@ -415,6 +422,8 @@ void bpf_jit_compile(struct sk_filter *fp) · 97 unmodified lines
415 case BPF_S_ANC_IFINDEX:422 case BPF_S_ANC_IFINDEX:
416 case BPF_S_ANC_MARK:423 case BPF_S_ANC_MARK:
417 case BPF_S_ANC_RXHASH:424 case BPF_S_ANC_RXHASH:
425 case BPF_S_ANC_VLAN_TAG:
426 case BPF_S_ANC_VLAN_TAG_PRESENT:
418 case BPF_S_ANC_CPU:427 case BPF_S_ANC_CPU:
419 case BPF_S_ANC_QUEUE:428 case BPF_S_ANC_QUEUE:
420 case BPF_S_LD_W_ABS:429 case BPF_S_LD_W_ABS:
@@ -600,6 +609,16 @@ void bpf_jit_compile(struct sk_filter *fp) · 179 unmodified lines
600 case BPF_S_ANC_RXHASH:609 case BPF_S_ANC_RXHASH:
601 emit_skb_load32(rxhash, r_A);610 emit_skb_load32(rxhash, r_A);
602 break;611 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;
603 622
604 case BPF_S_LD_IMM:623 case BPF_S_LD_IMM:
605 emit_loadimm(K, r_A);624 emit_loadimm(K, r_A);
arch/x86/net/bpf_jit_comp.c+21−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
11#include <asm/cacheflush.h>11#include <asm/cacheflush.h>
12#include <linux/netdevice.h>12#include <linux/netdevice.h>
13#include <linux/filter.h>13#include <linux/filter.h>
14#include <linux/if_vlan.h>
14 15
15/*16/*
16 * Conventions :17 * Conventions :
@@ -212,6 +213,8 @@ void bpf_jit_compile(struct sk_filter *fp) · 195 unmodified lines
212 case BPF_S_ANC_MARK:213 case BPF_S_ANC_MARK:
213 case BPF_S_ANC_RXHASH:214 case BPF_S_ANC_RXHASH:
214 case BPF_S_ANC_CPU:215 case BPF_S_ANC_CPU:
216 case BPF_S_ANC_VLAN_TAG:
217 case BPF_S_ANC_VLAN_TAG_PRESENT:
215 case BPF_S_ANC_QUEUE:218 case BPF_S_ANC_QUEUE:
216 case BPF_S_LD_W_ABS:219 case BPF_S_LD_W_ABS:
217 case BPF_S_LD_H_ABS:220 case BPF_S_LD_H_ABS:
@@ -515,6 +518,24 @@ void bpf_jit_compile(struct sk_filter *fp) · 297 unmodified lines
515 CLEAR_A();518 CLEAR_A();
516#endif519#endif
517 break;520 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;
518 case BPF_S_LD_W_ABS:539 case BPF_S_LD_W_ABS:
519 func = CHOOSE_LOAD_FUNC(K, sk_load_word);540 func = CHOOSE_LOAD_FUNC(K, sk_load_word);
520common_load: seen |= SEEN_DATAREF;541common_load: seen |= SEEN_DATAREF;
arch/xtensa/include/uapi/asm/socket.h+1−0
@@ -52,6 +52,7 @@ · 51 unmodified lines
52 52
53#define SO_ATTACH_FILTER 2653#define SO_ATTACH_FILTER 26
54#define SO_DETACH_FILTER 2754#define SO_DETACH_FILTER 27
55#define SO_GET_FILTER SO_ATTACH_FILTER
55 56
56#define SO_PEERNAME 2857#define SO_PEERNAME 28
57#define SO_TIMESTAMP 2958#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
164static uint32_t fpga_tx(struct solos_card *);164static uint32_t fpga_tx(struct solos_card *);
165static irqreturn_t solos_irq(int irq, void *dev_id);165static irqreturn_t solos_irq(int irq, void *dev_id);
166static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);166static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
167static int list_vccs(int vci);
168static int atm_init(struct solos_card *, struct device *);167static int atm_init(struct solos_card *, struct device *);
169static void atm_remove(struct solos_card *);168static void atm_remove(struct solos_card *);
170static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);169static 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
710 dev_warn(&card->dev->dev, "Received packet for unknown VPI.VCI %d.%d on port %d\n",709 dev_warn(&card->dev->dev, "Received packet for unknown VPI.VCI %d.%d on port %d\n",
711 le16_to_cpu(header->vpi), le16_to_cpu(header->vci),710 le16_to_cpu(header->vpi), le16_to_cpu(header->vci),
712 port);711 port);
713 continue;712 dev_kfree_skb_any(skb);
713 break;
714 }714 }
715 atm_charge(vcc, skb->truesize);715 atm_charge(vcc, skb->truesize);
716 vcc->push(vcc, skb);716 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
790 return vcc;790 return vcc;
791}791}
792 792
793static 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
831static int popen(struct atm_vcc *vcc)793static int popen(struct atm_vcc *vcc)
832{794{
833 struct solos_card *card = vcc->dev->dev_data;795 struct solos_card *card = vcc->dev->dev_data;
@@ -840,7 +802,7 @@ static int popen(struct atm_vcc *vcc) · 6 unmodified lines
840 return -EINVAL;802 return -EINVAL;
841 }803 }
842 804
843 skb = alloc_skb(sizeof(*header), GFP_ATOMIC);805 skb = alloc_skb(sizeof(*header), GFP_KERNEL);
844 if (!skb) {806 if (!skb) {
845 if (net_ratelimit())807 if (net_ratelimit())
846 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in popen()\n");808 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
857 819
858 set_bit(ATM_VF_ADDR, &vcc->flags);820 set_bit(ATM_VF_ADDR, &vcc->flags);
859 set_bit(ATM_VF_READY, &vcc->flags);821 set_bit(ATM_VF_READY, &vcc->flags);
860 list_vccs(0);
861
862 822
863 return 0;823 return 0;
864}824}
@@ -866,10 +826,21 @@ static int popen(struct atm_vcc *vcc) · 1 unmodified line
866static void pclose(struct atm_vcc *vcc)826static void pclose(struct atm_vcc *vcc)
867{827{
868 struct solos_card *card = vcc->dev->dev_data;828 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;
870 struct pkt_hdr *header;831 struct pkt_hdr *header;
871 832
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);
873 if (!skb) {844 if (!skb) {
874 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in pclose()\n");845 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in pclose()\n");
875 return;846 return;
@@ -881,15 +852,22 @@ static void pclose(struct atm_vcc *vcc) · 5 unmodified lines
881 header->vci = cpu_to_le16(vcc->vci);852 header->vci = cpu_to_le16(vcc->vci);
882 header->type = cpu_to_le16(PKT_PCLOSE);853 header->type = cpu_to_le16(PKT_PCLOSE);
883 854
884 fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, NULL);855 skb_get(skb);
856 fpga_queue(card, port, skb, NULL);
885 857
886 clear_bit(ATM_VF_ADDR, &vcc->flags);858 if (!wait_event_timeout(card->param_wq, !skb_shared(skb), 5 * HZ))
887 clear_bit(ATM_VF_READY, &vcc->flags);859 dev_warn(&card->dev->dev,
860 "Timeout waiting for VCC close on port %d\n", port);
861
862 dev_kfree_skb(skb);
888 863
889 /* Hold up vcc_destroy_socket() (our caller) until solos_bh() in the864 /* Hold up vcc_destroy_socket() (our caller) until solos_bh() in the
890 tasklet has finished processing any incoming packets (and, more to865 tasklet has finished processing any incoming packets (and, more to
891 the point, using the vcc pointer). */866 the point, using the vcc pointer). */
892 tasklet_unlock_wait(&card->tlet);867 tasklet_unlock_wait(&card->tlet);
868
869 clear_bit(ATM_VF_ADDR, &vcc->flags);
870
893 return;871 return;
894}872}
895 873
@@ -967,10 +945,11 @@ static uint32_t fpga_tx(struct solos_card *card) · 71 unmodified lines
967 for (port = 0; tx_pending; tx_pending >>= 1, port++) {945 for (port = 0; tx_pending; tx_pending >>= 1, port++) {
968 if (tx_pending & 1) {946 if (tx_pending & 1) {
969 struct sk_buff *oldskb = card->tx_skb[port];947 struct sk_buff *oldskb = card->tx_skb[port];
970 if (oldskb)948 if (oldskb) {
971 pci_unmap_single(card->dev, SKB_CB(oldskb)->dma_addr,949 pci_unmap_single(card->dev, SKB_CB(oldskb)->dma_addr,
972 oldskb->len, PCI_DMA_TODEVICE);950 oldskb->len, PCI_DMA_TODEVICE);
973 951 card->tx_skb[port] = NULL;
952 }
974 spin_lock(&card->tx_queue_lock);953 spin_lock(&card->tx_queue_lock);
975 skb = skb_dequeue(&card->tx_queue[port]);954 skb = skb_dequeue(&card->tx_queue[port]);
976 if (!skb)955 if (!skb)
@@ -1011,9 +990,10 @@ static uint32_t fpga_tx(struct solos_card *card) · 34 unmodified lines
1011 if (vcc) {990 if (vcc) {
1012 atomic_inc(&vcc->stats->tx);991 atomic_inc(&vcc->stats->tx);
1013 solos_pop(vcc, oldskb);992 solos_pop(vcc, oldskb);
1014 } else993 } else {
1015 dev_kfree_skb_irq(oldskb);994 dev_kfree_skb_irq(oldskb);
1016 995 wake_up(&card->param_wq);
996 }
1017 }997 }
1018 }998 }
1019 /* For non-DMA TX, write the 'TX start' bit for all four ports simultaneously */999 /* 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
1248 card->atmdev[i]->phy_data = (void *)(unsigned long)i;1228 card->atmdev[i]->phy_data = (void *)(unsigned long)i;
1249 atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_FOUND);1229 atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_FOUND);
1250 1230
1251 skb = alloc_skb(sizeof(*header), GFP_ATOMIC);1231 skb = alloc_skb(sizeof(*header), GFP_KERNEL);
1252 if (!skb) {1232 if (!skb) {
1253 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in atm_init()\n");1233 dev_warn(&card->dev->dev, "Failed to allocate sk_buff in atm_init()\n");
1254 continue;1234 continue;
@@ -1345,6 +1325,8 @@ static struct pci_driver fpga_driver = { · 90 unmodified lines
1345 1325
1346static int __init solos_pci_init(void)1326static int __init solos_pci_init(void)
1347{1327{
1328 BUILD_BUG_ON(sizeof(struct solos_skb_cb) > sizeof(((struct sk_buff *)0)->cb));
1329
1348 printk(KERN_INFO "Solos PCI Driver Version %s\n", VERSION);1330 printk(KERN_INFO "Solos PCI Driver Version %s\n", VERSION);
1349 return pci_register_driver(&fpga_driver);1331 return pci_register_driver(&fpga_driver);
1350}1332}
drivers/bcma/bcma_private.h+4−2
@@ -48,8 +48,8 @@ void bcma_chipco_serial_init(struct bcma_drv_cc *cc); · 47 unmodified lines
48#endif /* CONFIG_BCMA_DRIVER_MIPS */48#endif /* CONFIG_BCMA_DRIVER_MIPS */
49 49
50/* driver_chipcommon_pmu.c */50/* driver_chipcommon_pmu.c */
51u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc);51u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc);
52u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc);52u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc);
53 53
54#ifdef CONFIG_BCMA_SFLASH54#ifdef CONFIG_BCMA_SFLASH
55/* driver_chipcommon_sflash.c */55/* driver_chipcommon_sflash.c */
@@ -84,6 +84,8 @@ extern void __exit bcma_host_pci_exit(void); · 28 unmodified lines
84/* driver_pci.c */84/* driver_pci.c */
85u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);85u32 bcma_pcie_read(struct bcma_drv_pci *pc, u32 address);
86 86
87extern int bcma_chipco_watchdog_register(struct bcma_drv_cc *cc);
88
87#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE89#ifdef CONFIG_BCMA_DRIVER_PCI_HOSTMODE
88bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc);90bool __devinit bcma_core_pci_is_in_hostmode(struct bcma_drv_pci *pc);
89void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc);91void __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
4 *4 *
5 * Copyright 2005, Broadcom Corporation5 * Copyright 2005, Broadcom Corporation
6 * Copyright 2006, 2007, Michael Buesch <m@bues.ch>6 * Copyright 2006, 2007, Michael Buesch <m@bues.ch>
7 * Copyright 2012, Hauke Mehrtens <hauke@hauke-m.de>
7 *8 *
8 * Licensed under the GNU/GPL. See COPYING for details.9 * Licensed under the GNU/GPL. See COPYING for details.
9 */10 */
10 11
11#include "bcma_private.h"12#include "bcma_private.h"
13#include <linux/bcm47xx_wdt.h>
12#include <linux/export.h>14#include <linux/export.h>
15#include <linux/platform_device.h>
13#include <linux/bcma/bcma.h>16#include <linux/bcma/bcma.h>
14 17
15static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset,18static 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
22 return value;25 return value;
23}26}
24 27
25void bcma_core_chipcommon_init(struct bcma_drv_cc *cc)28static u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc)
26{29{
27 u32 leddc_on = 10;30 if (cc->capabilities & BCMA_CC_CAP_PMU)
28 u32 leddc_off = 90;31 return bcma_pmu_get_alp_clock(cc);
29 32
30 if (cc->setup_done)33 return 20000000;
34}
35
36static 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
57static 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
65static 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
75static 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
91int 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
112void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc)
113{
114 if (cc->early_setup_done)
31 return;115 return;
32 116
33 if (cc->core->id.rev >= 11)117 if (cc->core->id.rev >= 11)
@@ -36,6 +120,22 @@ void bcma_core_chipcommon_init(struct bcma_drv_cc *cc) · 2 unmodified lines
36 if (cc->core->id.rev >= 35)120 if (cc->core->id.rev >= 35)
37 cc->capabilities_ext = bcma_cc_read32(cc, BCMA_CC_CAP_EXT);121 cc->capabilities_ext = bcma_cc_read32(cc, BCMA_CC_CAP_EXT);
38 122
123 if (cc->capabilities & BCMA_CC_CAP_PMU)
124 bcma_pmu_early_init(cc);
125
126 cc->early_setup_done = true;
127}
128
129void 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
39 if (cc->core->id.rev >= 20) {139 if (cc->core->id.rev >= 20) {
40 bcma_cc_write32(cc, BCMA_CC_GPIOPULLUP, 0);140 bcma_cc_write32(cc, BCMA_CC_GPIOPULLUP, 0);
41 bcma_cc_write32(cc, BCMA_CC_GPIOPULLDOWN, 0);141 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
56 ((leddc_on << BCMA_CC_GPIOTIMER_ONTIME_SHIFT) |156 ((leddc_on << BCMA_CC_GPIOTIMER_ONTIME_SHIFT) |
57 (leddc_off << BCMA_CC_GPIOTIMER_OFFTIME_SHIFT)));157 (leddc_off << BCMA_CC_GPIOTIMER_OFFTIME_SHIFT)));
58 }158 }
159 cc->ticks_per_ms = bcma_chipco_watchdog_ticks_per_ms(cc);
59 160
60 cc->setup_done = true;161 cc->setup_done = true;
61}162}
62 163
63/* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */164/* Set chip watchdog reset timer to fire in 'ticks' backplane cycles */
64void bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks)165u32 bcma_chipco_watchdog_timer_set(struct bcma_drv_cc *cc, u32 ticks)
65{166{
66 /* instant NMI */167 u32 maxt;
67 bcma_cc_write32(cc, BCMA_CC_WATCHDOG, ticks);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;
68}186}
69 187
70void bcma_chipco_irq_mask(struct bcma_drv_cc *cc, u32 mask, u32 value)188void 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
118 struct bcma_serial_port *ports = cc->serial_ports;236 struct bcma_serial_port *ports = cc->serial_ports;
119 237
120 if (ccrev >= 11 && ccrev != 15) {238 if (ccrev >= 11 && ccrev != 15) {
121 /* Fixed ALP clock */239 baud_base = bcma_chipco_get_alp_clock(cc);
122 baud_base = bcma_pmu_alp_clock(cc);
123 if (ccrev >= 21) {240 if (ccrev >= 21) {
124 /* Turn off UART clock before switching clocksource. */241 /* Turn off UART clock before switching clocksource. */
125 bcma_cc_write32(cc, BCMA_CC_CORECTL,242 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
32 }32 }
33 33
34 cc->nflash.present = true;34 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;
35 38
36 /* Prepare platform device, but don't register it yet. It's too early,39 /* Prepare platform device, but don't register it yet. It's too early,
37 * malloc (required by device_private_init) is not available yet. */40 * 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
144 }144 }
145}145}
146 146
147void bcma_pmu_init(struct bcma_drv_cc *cc)147void bcma_pmu_early_init(struct bcma_drv_cc *cc)
148{148{
149 u32 pmucap;149 u32 pmucap;
150 150
@@ -153,7 +153,10 @@ void bcma_pmu_init(struct bcma_drv_cc *cc) · 2 unmodified lines
153 153
154 bcma_debug(cc->core->bus, "Found rev %u PMU (capabilities 0x%08X)\n",154 bcma_debug(cc->core->bus, "Found rev %u PMU (capabilities 0x%08X)\n",
155 cc->pmu.rev, pmucap);155 cc->pmu.rev, pmucap);
156}
156 157
158void bcma_pmu_init(struct bcma_drv_cc *cc)
159{
157 if (cc->pmu.rev == 1)160 if (cc->pmu.rev == 1)
158 bcma_cc_mask32(cc, BCMA_CC_PMU_CTL,161 bcma_cc_mask32(cc, BCMA_CC_PMU_CTL,
159 ~BCMA_CC_PMU_CTL_NOILPONW);162 ~BCMA_CC_PMU_CTL_NOILPONW);
@@ -165,7 +168,7 @@ void bcma_pmu_init(struct bcma_drv_cc *cc) · 5 unmodified lines
165 bcma_pmu_workarounds(cc);168 bcma_pmu_workarounds(cc);
166}169}
167 170
168u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc)171u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc)
169{172{
170 struct bcma_bus *bus = cc->core->bus;173 struct bcma_bus *bus = cc->core->bus;
171 174
@@ -193,7 +196,7 @@ u32 bcma_pmu_alp_clock(struct bcma_drv_cc *cc) · 21 unmodified lines
193/* Find the output of the "m" pll divider given pll controls that start with196/* Find the output of the "m" pll divider given pll controls that start with
194 * pllreg "pll0" i.e. 12 for main 6 for phy, 0 for misc.197 * pllreg "pll0" i.e. 12 for main 6 for phy, 0 for misc.
195 */198 */
196static u32 bcma_pmu_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m)199static u32 bcma_pmu_pll_clock(struct bcma_drv_cc *cc, u32 pll0, u32 m)
197{200{
198 u32 tmp, div, ndiv, p1, p2, fc;201 u32 tmp, div, ndiv, p1, p2, fc;
199 struct bcma_bus *bus = cc->core->bus;202 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
222 ndiv = (tmp & BCMA_CC_PPL_NDIV_MASK) >> BCMA_CC_PPL_NDIV_SHIFT;225 ndiv = (tmp & BCMA_CC_PPL_NDIV_MASK) >> BCMA_CC_PPL_NDIV_SHIFT;
223 226
224 /* Do calculation in Mhz */227 /* Do calculation in Mhz */
225 fc = bcma_pmu_alp_clock(cc) / 1000000;228 fc = bcma_pmu_get_alp_clock(cc) / 1000000;
226 fc = (p1 * ndiv * fc) / p2;229 fc = (p1 * ndiv * fc) / p2;
227 230
228 /* Return clock in Hertz */231 /* Return clock in Hertz */
229 return (fc / div) * 1000000;232 return (fc / div) * 1000000;
230}233}
231 234
232static u32 bcma_pmu_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m)235static u32 bcma_pmu_pll_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m)
233{236{
234 u32 tmp, ndiv, p1div, p2div;237 u32 tmp, ndiv, p1div, p2div;
235 u32 clock;238 u32 clock;
@@ -260,7 +263,7 @@ static u32 bcma_pmu_clock_bcm4706(struct bcma_drv_cc *cc, u32 pll0, u32 m) · 24 unmodified lines
260}263}
261 264
262/* query bus clock frequency for PMU-enabled chipcommon */265/* query bus clock frequency for PMU-enabled chipcommon */
263static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc)266static u32 bcma_pmu_get_bus_clock(struct bcma_drv_cc *cc)
264{267{
265 struct bcma_bus *bus = cc->core->bus;268 struct bcma_bus *bus = cc->core->bus;
266 269
@@ -268,40 +271,42 @@ static u32 bcma_pmu_get_clockcontrol(struct bcma_drv_cc *cc) · 1 unmodified line
268 case BCMA_CHIP_ID_BCM4716:271 case BCMA_CHIP_ID_BCM4716:
269 case BCMA_CHIP_ID_BCM4748:272 case BCMA_CHIP_ID_BCM4748:
270 case BCMA_CHIP_ID_BCM47162:273 case BCMA_CHIP_ID_BCM47162:
271 return bcma_pmu_clock(cc, BCMA_CC_PMU4716_MAINPLL_PLL0,274 return bcma_pmu_pll_clock(cc, BCMA_CC_PMU4716_MAINPLL_PLL0,
272 BCMA_CC_PMU5_MAINPLL_SSB);275 BCMA_CC_PMU5_MAINPLL_SSB);
273 case BCMA_CHIP_ID_BCM5356:276 case BCMA_CHIP_ID_BCM5356:
274 return bcma_pmu_clock(cc, BCMA_CC_PMU5356_MAINPLL_PLL0,277 return bcma_pmu_pll_clock(cc, BCMA_CC_PMU5356_MAINPLL_PLL0,
275 BCMA_CC_PMU5_MAINPLL_SSB);278 BCMA_CC_PMU5_MAINPLL_SSB);
276 case BCMA_CHIP_ID_BCM5357:279 case BCMA_CHIP_ID_BCM5357:
277 case BCMA_CHIP_ID_BCM4749:280 case BCMA_CHIP_ID_BCM4749:
278 return bcma_pmu_clock(cc, BCMA_CC_PMU5357_MAINPLL_PLL0,281 return bcma_pmu_pll_clock(cc, BCMA_CC_PMU5357_MAINPLL_PLL0,
279 BCMA_CC_PMU5_MAINPLL_SSB);282 BCMA_CC_PMU5_MAINPLL_SSB);
280 case BCMA_CHIP_ID_BCM4706:283 case BCMA_CHIP_ID_BCM4706:
281 return bcma_pmu_clock_bcm4706(cc, BCMA_CC_PMU4706_MAINPLL_PLL0,284 return bcma_pmu_pll_clock_bcm4706(cc,
282 BCMA_CC_PMU5_MAINPLL_SSB);285 BCMA_CC_PMU4706_MAINPLL_PLL0,
286 BCMA_CC_PMU5_MAINPLL_SSB);
283 case BCMA_CHIP_ID_BCM53572:287 case BCMA_CHIP_ID_BCM53572:
284 return 75000000;288 return 75000000;
285 default:289 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",
287 bus->chipinfo.id, cc->pmu.rev, BCMA_CC_PMU_HT_CLOCK);291 bus->chipinfo.id, cc->pmu.rev, BCMA_CC_PMU_HT_CLOCK);
288 }292 }
289 return BCMA_CC_PMU_HT_CLOCK;293 return BCMA_CC_PMU_HT_CLOCK;
290}294}
291 295
292/* query cpu clock frequency for PMU-enabled chipcommon */296/* query cpu clock frequency for PMU-enabled chipcommon */
293u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc)297u32 bcma_pmu_get_cpu_clock(struct bcma_drv_cc *cc)
294{298{
295 struct bcma_bus *bus = cc->core->bus;299 struct bcma_bus *bus = cc->core->bus;
296 300
297 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53572)301 if (bus->chipinfo.id == BCMA_CHIP_ID_BCM53572)
298 return 300000000;302 return 300000000;
299 303
304 /* New PMUs can have different clock for bus and CPU */
300 if (cc->pmu.rev >= 5) {305 if (cc->pmu.rev >= 5) {
301 u32 pll;306 u32 pll;
302 switch (bus->chipinfo.id) {307 switch (bus->chipinfo.id) {
303 case BCMA_CHIP_ID_BCM4706:308 case BCMA_CHIP_ID_BCM4706:
304 return bcma_pmu_clock_bcm4706(cc,309 return bcma_pmu_pll_clock_bcm4706(cc,
305 BCMA_CC_PMU4706_MAINPLL_PLL0,310 BCMA_CC_PMU4706_MAINPLL_PLL0,
306 BCMA_CC_PMU5_MAINPLL_CPU);311 BCMA_CC_PMU5_MAINPLL_CPU);
307 case BCMA_CHIP_ID_BCM5356:312 case BCMA_CHIP_ID_BCM5356:
@@ -316,10 +321,11 @@ u32 bcma_pmu_get_clockcpu(struct bcma_drv_cc *cc) · 8 unmodified lines
316 break;321 break;
317 }322 }
318 323
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);
320 }325 }
321 326
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);
323}329}
324 330
325static void bcma_pmu_spuravoid_pll_write(struct bcma_drv_cc *cc, u32 offset,331static 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
12 12
13static struct resource bcma_sflash_resource = {13static struct resource bcma_sflash_resource = {
14 .name = "bcma_sflash",14 .name = "bcma_sflash",
15 .start = BCMA_SFLASH,15 .start = BCMA_SOC_FLASH2,
16 .end = 0,16 .end = 0,
17 .flags = IORESOURCE_MEM | IORESOURCE_READONLY,17 .flags = IORESOURCE_MEM | IORESOURCE_READONLY,
18};18};
@@ -31,15 +31,42 @@ struct bcma_sflash_tbl_e { · 12 unmodified lines
31};31};
32 32
33static struct bcma_sflash_tbl_e bcma_sflash_st_tbl[] = {33static 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, },
35 { 0 },41 { 0 },
36};42};
37 43
38static struct bcma_sflash_tbl_e bcma_sflash_sst_tbl[] = {44static 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, },
39 { 0 },59 { 0 },
40};60};
41 61
42static struct bcma_sflash_tbl_e bcma_sflash_at_tbl[] = {62static 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, },
43 { 0 },70 { 0 },
44};71};
45 72
@@ -84,6 +111,8 @@ int bcma_sflash_init(struct bcma_drv_cc *cc) · 38 unmodified lines
84 break;111 break;
85 }112 }
86 break;113 break;
114 case 0x13:
115 return -ENOTSUPP;
87 default:116 default:
88 for (e = bcma_sflash_st_tbl; e->name; e++) {117 for (e = bcma_sflash_st_tbl; e->name; e++) {
89 if (e->id == id)118 if (e->id == id)
@@ -116,7 +145,7 @@ int bcma_sflash_init(struct bcma_drv_cc *cc) · 26 unmodified lines
116 return -ENOTSUPP;145 return -ENOTSUPP;
117 }146 }
118 147
119 sflash->window = BCMA_SFLASH;148 sflash->window = BCMA_SOC_FLASH2;
120 sflash->blocksize = e->blocksize;149 sflash->blocksize = e->blocksize;
121 sflash->numblocks = e->numblocks;150 sflash->numblocks = e->numblocks;
122 sflash->size = sflash->blocksize * sflash->numblocks;151 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
115 bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) &115 bcma_read32(mdev, BCMA_MIPS_MIPS74K_INTMASK(0)) &
116 ~(1 << irqflag));116 ~(1 << irqflag));
117 else117 else
118 bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(irq), 0);118 bcma_write32(mdev, BCMA_MIPS_MIPS74K_INTMASK(oldirq), 0);
119 119
120 /* assign the new one */120 /* assign the new one */
121 if (irq == 0) {121 if (irq == 0) {
@@ -171,7 +171,7 @@ u32 bcma_cpu_clock(struct bcma_drv_mips *mcore) · 49 unmodified lines
171 struct bcma_bus *bus = mcore->core->bus;171 struct bcma_bus *bus = mcore->core->bus;
172 172
173 if (bus->drv_cc.capabilities & BCMA_CC_CAP_PMU)173 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);
175 175
176 bcma_err(bus, "No PMU available, need this to get the cpu clock\n");176 bcma_err(bus, "No PMU available, need this to get the cpu clock\n");
177 return 0;177 return 0;
@@ -181,47 +181,66 @@ EXPORT_SYMBOL(bcma_cpu_clock); · 3 unmodified lines
181static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)181static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
182{182{
183 struct bcma_bus *bus = mcore->core->bus;183 struct bcma_bus *bus = mcore->core->bus;
184 struct bcma_drv_cc *cc = &bus->drv_cc;
184 185
185 switch (bus->drv_cc.capabilities & BCMA_CC_CAP_FLASHT) {186 switch (cc->capabilities & BCMA_CC_CAP_FLASHT) {
186 case BCMA_CC_FLASHT_STSER:187 case BCMA_CC_FLASHT_STSER:
187 case BCMA_CC_FLASHT_ATSER:188 case BCMA_CC_FLASHT_ATSER:
188 bcma_debug(bus, "Found serial flash\n");189 bcma_debug(bus, "Found serial flash\n");
189 bcma_sflash_init(&bus->drv_cc);190 bcma_sflash_init(cc);
190 break;191 break;
191 case BCMA_CC_FLASHT_PARA:192 case BCMA_CC_FLASHT_PARA:
192 bcma_debug(bus, "Found parallel flash\n");193 bcma_debug(bus, "Found parallel flash\n");
193 bus->drv_cc.pflash.window = 0x1c000000;194 cc->pflash.present = true;
194 bus->drv_cc.pflash.window_size = 0x02000000;195 cc->pflash.window = BCMA_SOC_FLASH2;
196 cc->pflash.window_size = BCMA_SOC_FLASH2_SZ;
195 197
196 if ((bcma_read32(bus->drv_cc.core, BCMA_CC_FLASH_CFG) &198 if ((bcma_read32(cc->core, BCMA_CC_FLASH_CFG) &
197 BCMA_CC_FLASH_CFG_DS) == 0)199 BCMA_CC_FLASH_CFG_DS) == 0)
198 bus->drv_cc.pflash.buswidth = 1;200 cc->pflash.buswidth = 1;
199 else201 else
200 bus->drv_cc.pflash.buswidth = 2;202 cc->pflash.buswidth = 2;
201 break;203 break;
202 default:204 default:
203 bcma_err(bus, "Flash type not supported\n");205 bcma_err(bus, "Flash type not supported\n");
204 }206 }
205 207
206 if (bus->drv_cc.core->id.rev == 38 ||208 if (cc->core->id.rev == 38 ||
207 bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) {209 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) {
209 bcma_debug(bus, "Found NAND flash\n");211 bcma_debug(bus, "Found NAND flash\n");
210 bcma_nflash_init(&bus->drv_cc);212 bcma_nflash_init(cc);
211 }213 }
212 }214 }
213}215}
214 216
217void 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
215void bcma_core_mips_init(struct bcma_drv_mips *mcore)230void bcma_core_mips_init(struct bcma_drv_mips *mcore)
216{231{
217 struct bcma_bus *bus;232 struct bcma_bus *bus;
218 struct bcma_device *core;233 struct bcma_device *core;
219 bus = mcore->core->bus;234 bus = mcore->core->bus;
220 235
236 if (mcore->setup_done)
237 return;
238
221 bcma_info(bus, "Initializing MIPS core...\n");239 bcma_info(bus, "Initializing MIPS core...\n");
222 240
223 if (!mcore->setup_done)241 bcma_core_mips_early_init(mcore);
224 mcore->assigned_irqs = 1;242
243 mcore->assigned_irqs = 1;
225 244
226 /* Assign IRQs to all cores on the bus */245 /* Assign IRQs to all cores on the bus */
227 list_for_each_entry(core, &bus->cores, list) {246 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
256 bcma_info(bus, "IRQ reconfiguration done\n");275 bcma_info(bus, "IRQ reconfiguration done\n");
257 bcma_core_mips_dump_irq(bus);276 bcma_core_mips_dump_irq(bus);
258 277
259 if (mcore->setup_done)
260 return;
261
262 bcma_chipco_serial_init(&bus->drv_cc);
263 bcma_core_mips_flash_detect(mcore);
264 mcore->setup_done = true;278 mcore->setup_done = true;
265}279}
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
35 chipid_top != 0x5300)35 chipid_top != 0x5300)
36 return false;36 return false;
37 37
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
43 bcma_core_enable(pc->core, 0);38 bcma_core_enable(pc->core, 0);
44 39
45 return !mips_busprobe32(tmp, pc->core->io_addr);40 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
396 391
397 bcma_info(bus, "PCIEcore in host mode found\n");392 bcma_info(bus, "PCIEcore in host mode found\n");
398 393
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
399 pc_host = kzalloc(sizeof(*pc_host), GFP_KERNEL);399 pc_host = kzalloc(sizeof(*pc_host), GFP_KERNEL);
400 if (!pc_host) {400 if (!pc_host) {
401 bcma_err(bus, "can not allocate memory");401 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
452 pc_host->mem_resource.start = BCMA_SOC_PCI_MEM;452 pc_host->mem_resource.start = BCMA_SOC_PCI_MEM;
453 pc_host->mem_resource.end = BCMA_SOC_PCI_MEM +453 pc_host->mem_resource.end = BCMA_SOC_PCI_MEM +
454 BCMA_SOC_PCI_MEM_SZ - 1;454 BCMA_SOC_PCI_MEM_SZ - 1;
455 pc_host->io_resource.start = 0x100;
456 pc_host->io_resource.end = 0x47F;
455 pci_membase_1G = BCMA_SOC_PCIE_DMA_H32;457 pci_membase_1G = BCMA_SOC_PCIE_DMA_H32;
456 pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,458 pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,
457 tmp | BCMA_SOC_PCI_MEM);459 tmp | BCMA_SOC_PCI_MEM);
@@ -459,6 +461,8 @@ void __devinit bcma_core_pci_hostmode_init(struct bcma_drv_pci *pc) · 1 unmodified line
459 pc_host->mem_resource.start = BCMA_SOC_PCI1_MEM;461 pc_host->mem_resource.start = BCMA_SOC_PCI1_MEM;
460 pc_host->mem_resource.end = BCMA_SOC_PCI1_MEM +462 pc_host->mem_resource.end = BCMA_SOC_PCI1_MEM +
461 BCMA_SOC_PCI_MEM_SZ - 1;463 BCMA_SOC_PCI_MEM_SZ - 1;
464 pc_host->io_resource.start = 0x480;
465 pc_host->io_resource.end = 0x7FF;
462 pci_membase_1G = BCMA_SOC_PCIE1_DMA_H32;466 pci_membase_1G = BCMA_SOC_PCIE1_DMA_H32;
463 pc_host->host_cfg_addr = BCMA_SOC_PCI1_CFG;467 pc_host->host_cfg_addr = BCMA_SOC_PCI1_CFG;
464 pcicore_write32(pc, BCMA_CORE_PCI_SBTOPCI0,468 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
534static void bcma_core_pci_fixup_addresses(struct pci_dev *dev)538static void bcma_core_pci_fixup_addresses(struct pci_dev *dev)
535{539{
536 struct resource *res;540 struct resource *res;
537 int pos;541 int pos, err;
538 542
539 if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) {543 if (dev->bus->ops->read != bcma_core_pci_hostmode_read_config) {
540 /* This is not a device on the PCI-core bridge. */544 /* 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
547 551
548 for (pos = 0; pos < 6; pos++) {552 for (pos = 0; pos < 6; pos++) {
549 res = &dev->resource[pos];553 res = &dev->resource[pos];
550 if (res->flags & (IORESOURCE_IO | IORESOURCE_MEM))554 if (res->flags & (IORESOURCE_IO | IORESOURCE_MEM)) {
551 pci_assign_resource(dev, pos);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 }
552 }560 }
553}561}
554DECLARE_PCI_FIXUP_HEADER(PCI_ANY_ID, PCI_ANY_ID, bcma_core_pci_fixup_addresses);562DECLARE_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
238 pci_set_drvdata(dev, NULL);238 pci_set_drvdata(dev, NULL);
239}239}
240 240
241#ifdef CONFIG_PM241#ifdef CONFIG_PM_SLEEP
242static int bcma_host_pci_suspend(struct device *dev)242static int bcma_host_pci_suspend(struct device *dev)
243{243{
244 struct pci_dev *pdev = to_pci_dev(dev);244 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
261 bcma_host_pci_resume);261 bcma_host_pci_resume);
262#define BCMA_PM_OPS (&bcma_pm_ops)262#define BCMA_PM_OPS (&bcma_pm_ops)
263 263
264#else /* CONFIG_PM */264#else /* CONFIG_PM_SLEEP */
265 265
266#define BCMA_PM_OPS NULL266#define BCMA_PM_OPS NULL
267 267
268#endif /* CONFIG_PM */268#endif /* CONFIG_PM_SLEEP */
269 269
270static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {270static DEFINE_PCI_DEVICE_TABLE(bcma_pci_bridge_tbl) = {
271 { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x0576) },271 { 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
81}81}
82EXPORT_SYMBOL_GPL(bcma_find_core);82EXPORT_SYMBOL_GPL(bcma_find_core);
83 83
84static 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
84static void bcma_release_core_dev(struct device *dev)96static void bcma_release_core_dev(struct device *dev)
85{97{
86 struct bcma_device *core = container_of(dev, struct bcma_device, dev);98 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
153 }165 }
154#endif166#endif
155 167
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
156 return 0;174 return 0;
157}175}
158 176
@@ -165,6 +183,8 @@ static void bcma_unregister_cores(struct bcma_bus *bus) · 6 unmodified lines
165 if (core->dev_registered)183 if (core->dev_registered)
166 device_unregister(&core->dev);184 device_unregister(&core->dev);
167 }185 }
186 if (bus->hosttype == BCMA_HOSTTYPE_SOC)
187 platform_device_unregister(bus->drv_cc.watchdog);
168}188}
169 189
170int __devinit bcma_bus_register(struct bcma_bus *bus)190int __devinit bcma_bus_register(struct bcma_bus *bus)
@@ -183,6 +203,20 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) · 12 unmodified lines
183 return -1;203 return -1;
184 }204 }
185 205
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
186 /* Init CC core */220 /* Init CC core */
187 core = bcma_find_core(bus, bcma_cc_core_id(bus));221 core = bcma_find_core(bus, bcma_cc_core_id(bus));
188 if (core) {222 if (core) {
@@ -198,10 +232,17 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) · 9 unmodified lines
198 }232 }
199 233
200 /* Init PCIE core */234 /* 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);
202 if (core) {243 if (core) {
203 bus->drv_pci.core = core;244 bus->drv_pci[1].core = core;
204 bcma_core_pci_init(&bus->drv_pci);245 bcma_core_pci_init(&bus->drv_pci[1]);
205 }246 }
206 247
207 /* Init GBIT MAC COMMON core */248 /* Init GBIT MAC COMMON core */
@@ -211,13 +252,6 @@ int __devinit bcma_bus_register(struct bcma_bus *bus) · 3 unmodified lines
211 bcma_core_gmac_cmn_init(&bus->drv_gmac_cmn);252 bcma_core_gmac_cmn_init(&bus->drv_gmac_cmn);
212 }253 }
213 254
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
221 /* Register found cores */255 /* Register found cores */
222 bcma_register_cores(bus);256 bcma_register_cores(bus);
223 257
@@ -275,18 +309,18 @@ int __init bcma_bus_early_register(struct bcma_bus *bus, · 51 unmodified lines
275 return -1;309 return -1;
276 }310 }
277 311
278 /* Init CC core */312 /* Early init CC core */
279 core = bcma_find_core(bus, bcma_cc_core_id(bus));313 core = bcma_find_core(bus, bcma_cc_core_id(bus));
280 if (core) {314 if (core) {
281 bus->drv_cc.core = core;315 bus->drv_cc.core = core;
282 bcma_core_chipcommon_init(&bus->drv_cc);316 bcma_core_chipcommon_early_init(&bus->drv_cc);
283 }317 }
284 318
285 /* Init MIPS core */319 /* Early init MIPS core */
286 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K);320 core = bcma_find_core(bus, BCMA_CORE_MIPS_74K);
287 if (core) {321 if (core) {
288 bus->drv_mips.core = core;322 bus->drv_mips.core = core;
289 bcma_core_mips_init(&bus->drv_mips);323 bcma_core_mips_early_init(&bus->drv_mips);
290 }324 }
291 325
292 bcma_info(bus, "Early bus registered\n");326 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
595 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true);595 bcma_chipco_bcm4331_ext_pa_lines_ctl(&bus->drv_cc, true);
596 596
597 err = bcma_sprom_valid(sprom);597 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);
599 goto out;601 goto out;
602 }
600 603
601 bcma_sprom_extract_r8(bus, sprom);604 bcma_sprom_extract_r8(bus, sprom);
602 605
drivers/bluetooth/btmrvl_sdio.c+17−11
@@ -492,7 +492,7 @@ done: · 491 unmodified lines
492static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)492static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv)
493{493{
494 u16 buf_len = 0;494 u16 buf_len = 0;
495 int ret, buf_block_len, blksz;495 int ret, num_blocks, blksz;
496 struct sk_buff *skb = NULL;496 struct sk_buff *skb = NULL;
497 u32 type;497 u32 type;
498 u8 *payload = NULL;498 u8 *payload = NULL;
@@ -514,18 +514,17 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) · 15 unmodified lines
514 }514 }
515 515
516 blksz = SDIO_BLOCK_SIZE;516 blksz = SDIO_BLOCK_SIZE;
517 buf_block_len = (buf_len + blksz - 1) / blksz;517 num_blocks = DIV_ROUND_UP(buf_len, blksz);
518 518
519 if (buf_len <= SDIO_HEADER_LEN519 if (buf_len <= SDIO_HEADER_LEN
520 || (buf_block_len * blksz) > ALLOC_BUF_SIZE) {520 || (num_blocks * blksz) > ALLOC_BUF_SIZE) {
521 BT_ERR("invalid packet length: %d", buf_len);521 BT_ERR("invalid packet length: %d", buf_len);
522 ret = -EINVAL;522 ret = -EINVAL;
523 goto exit;523 goto exit;
524 }524 }
525 525
526 /* Allocate buffer */526 /* Allocate buffer */
527 skb = bt_skb_alloc(buf_block_len * blksz + BTSDIO_DMA_ALIGN,527 skb = bt_skb_alloc(num_blocks * blksz + BTSDIO_DMA_ALIGN, GFP_ATOMIC);
528 GFP_ATOMIC);
529 if (skb == NULL) {528 if (skb == NULL) {
530 BT_ERR("No free skb");529 BT_ERR("No free skb");
531 goto exit;530 goto exit;
@@ -541,7 +540,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) · 9 unmodified lines
541 payload = skb->data;540 payload = skb->data;
542 541
543 ret = sdio_readsb(card->func, payload, card->ioport,542 ret = sdio_readsb(card->func, payload, card->ioport,
544 buf_block_len * blksz);543 num_blocks * blksz);
545 if (ret < 0) {544 if (ret < 0) {
546 BT_ERR("readsb failed: %d", ret);545 BT_ERR("readsb failed: %d", ret);
547 ret = -EIO;546 ret = -EIO;
@@ -553,7 +552,16 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) · 5 unmodified lines
553 */552 */
554 553
555 buf_len = payload[0];554 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
557 type = payload[3];565 type = payload[3];
558 566
559 switch (type) {567 switch (type) {
@@ -589,8 +597,7 @@ static int btmrvl_sdio_card_to_host(struct btmrvl_private *priv) · 29 unmodified lines
589 597
590 default:598 default:
591 BT_ERR("Unknown packet type:%d", type);599 BT_ERR("Unknown packet type:%d", type);
592 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, payload,600 BT_ERR("hex: %*ph", blksz * num_blocks, payload);
593 blksz * buf_block_len);
594 601
595 kfree_skb(skb);602 kfree_skb(skb);
596 skb = NULL;603 skb = NULL;
@@ -849,8 +856,7 @@ static int btmrvl_sdio_host_to_card(struct btmrvl_private *priv, · 252 unmodified lines
849 if (ret < 0) {856 if (ret < 0) {
850 i++;857 i++;
851 BT_ERR("i=%d writesb failed: %d", i, ret);858 BT_ERR("i=%d writesb failed: %d", i, ret);
852 print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,859 BT_ERR("hex: %*ph", nb, payload);
853 payload, nb);
854 ret = -EIO;860 ret = -EIO;
855 if (i > MAX_WRITE_IOMEM_RETRY)861 if (i > MAX_WRITE_IOMEM_RETRY)
856 goto exit;862 goto exit;
drivers/bluetooth/btusb.c+1−0
@@ -96,6 +96,7 @@ static struct usb_device_id btusb_table[] = { · 95 unmodified lines
96 { USB_DEVICE(0x0c10, 0x0000) },96 { USB_DEVICE(0x0c10, 0x0000) },
97 97
98 /* Broadcom BCM20702A0 */98 /* Broadcom BCM20702A0 */
99 { USB_DEVICE(0x0b05, 0x17b5) },
99 { USB_DEVICE(0x04ca, 0x2003) },100 { USB_DEVICE(0x04ca, 0x2003) },
100 { USB_DEVICE(0x0489, 0xe042) },101 { USB_DEVICE(0x0489, 0xe042) },
101 { USB_DEVICE(0x413c, 0x8197) },102 { 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
604 return slots;604 return slots;
605}605}
606 606
607static 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
607struct dca_provider * __devinit624struct dca_provider * __devinit
608ioat3_dca_init(struct pci_dev *pdev, void __iomem *iobase)625ioat3_dca_init(struct pci_dev *pdev, void __iomem *iobase)
609{626{
@@ -674,6 +691,12 @@ ioat3_dca_init(struct pci_dev *pdev, void __iomem *iobase) · 64 unmodified lines
674 ioatdca->tag_map[i] = bit & DCA_TAG_MAP_MASK;691 ioatdca->tag_map[i] = bit & DCA_TAG_MAP_MASK;
675 }692 }
676 693
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
677 err = register_dca_provider(dca, &pdev->dev);700 err = register_dca_provider(dca, &pdev->dev);
678 if (err) {701 if (err) {
679 free_dca_provider(dca);702 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
490 (df->data[le16_to_cpu(zp->z1)])) {490 (df->data[le16_to_cpu(zp->z1)])) {
491 if (dch->debug & DEBUG_HW)491 if (dch->debug & DEBUG_HW)
492 printk(KERN_DEBUG492 printk(KERN_DEBUG
493 "empty_fifo hfcpci paket inv. len "493 "empty_fifo hfcpci packet inv. len "
494 "%d or crc %d\n",494 "%d or crc %d\n",
495 rcnt,495 rcnt,
496 df->data[le16_to_cpu(zp->z1)]);496 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
1302 &ch->is->Flags))1302 &ch->is->Flags))
1303 ch->dpath = 1;1303 ch->dpath = 1;
1304 else {1304 else {
1305 pr_info("modeisar both pathes in use\n");1305 pr_info("modeisar both paths in use\n");
1306 return -EBUSY;1306 return -EBUSY;
1307 }1307 }
1308 if (bprotocol == ISDN_P_B_HDLC)1308 if (bprotocol == ISDN_P_B_HDLC)
drivers/isdn/hisax/callc.c+1−1
@@ -35,7 +35,7 @@ static int chancount; · 34 unmodified lines
35/* experimental REJECT after ALERTING for CALLBACK to beat the 4s delay */35/* experimental REJECT after ALERTING for CALLBACK to beat the 4s delay */
36#define ALERT_REJECT 036#define ALERT_REJECT 0
37 37
38/* Value to delay the sending of the first B-channel paket after CONNECT38/* Value to delay the sending of the first B-channel packet after CONNECT
39 * here is no value given by ITU, but experience shows that 300 ms will39 * here is no value given by ITU, but experience shows that 300 ms will
40 * work on many networks, if you or your other side is behind local exchanges40 * work on many networks, if you or your other side is behind local exchanges
41 * a greater value may be recommented. If the delay is to short the first paket41 * 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
354 if ((rcnt > MAX_DFRAME_LEN + 3) || (rcnt < 4) ||354 if ((rcnt > MAX_DFRAME_LEN + 3) || (rcnt < 4) ||
355 (df->data[zp->z1])) {355 (df->data[zp->z1])) {
356 if (cs->debug & L1_DEB_WARN)356 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]);
358#ifdef ERROR_STATISTIC358#ifdef ERROR_STATISTIC
359 cs->err_rx++;359 cs->err_rx++;
360#endif360#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
270 270
271 if ((count > fifo_size) || (count < 4)) {271 if ((count > fifo_size) || (count < 4)) {
272 if (cs->debug & L1_DEB_WARN)272 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);
274 while (count) {274 while (count) {
275 count--; /* empty fifo */275 count--; /* empty fifo */
276 Read_hfc(cs, HFCSX_FIF_DRD);276 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
277 u16 timebase, u8 *buf, int len)277 u16 timebase, u8 *buf, int len)
278{278{
279 u8 *p;279 u8 *p;
280 int multi = 0;
281 u8 frame[len + 32];280 u8 frame[len + 32];
282 struct socket *socket = NULL;281 struct socket *socket = NULL;
283 282
@@ -317,9 +316,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask, · 33 unmodified lines
317 *p++ = hc->id >> 8;316 *p++ = hc->id >> 8;
318 *p++ = hc->id;317 *p++ = hc->id;
319 }318 }
320 *p++ = (multi == 1) ? 0x80 : 0x00 + channel; /* m-flag, channel */319 *p++ = 0x00 + channel; /* m-flag, channel */
321 if (multi == 1)
322 *p++ = len; /* length */
323 *p++ = timebase >> 8; /* time base */320 *p++ = timebase >> 8; /* time base */
324 *p++ = timebase;321 *p++ = timebase;
325 322
drivers/isdn/mISDN/tei.c+10−10
@@ -250,7 +250,7 @@ tei_debug(struct FsmInst *fi, char *fmt, ...) · 249 unmodified lines
250static int250static int
251get_free_id(struct manager *mgr)251get_free_id(struct manager *mgr)
252{252{
253 u64 ids = 0;253 DECLARE_BITMAP(ids, 64) = { [0 ... BITS_TO_LONGS(64) - 1] = 0 };
254 int i;254 int i;
255 struct layer2 *l2;255 struct layer2 *l2;
256 256
@@ -261,11 +261,11 @@ get_free_id(struct manager *mgr) · 4 unmodified lines
261 __func__);261 __func__);
262 return -EBUSY;262 return -EBUSY;
263 }263 }
264 test_and_set_bit(l2->ch.nr, (u_long *)&ids);264 __set_bit(l2->ch.nr, ids);
265 }265 }
266 for (i = 1; i < 64; i++)266 i = find_next_zero_bit(ids, 64, 1);
267 if (!test_bit(i, (u_long *)&ids))267 if (i < 64)
268 return i;268 return i;
269 printk(KERN_WARNING "%s: more as 63 layer2 for one device\n",269 printk(KERN_WARNING "%s: more as 63 layer2 for one device\n",
270 __func__);270 __func__);
271 return -EBUSY;271 return -EBUSY;
@@ -274,7 +274,7 @@ get_free_id(struct manager *mgr) · 2 unmodified lines
274static int274static int
275get_free_tei(struct manager *mgr)275get_free_tei(struct manager *mgr)
276{276{
277 u64 ids = 0;277 DECLARE_BITMAP(ids, 64) = { [0 ... BITS_TO_LONGS(64) - 1] = 0 };
278 int i;278 int i;
279 struct layer2 *l2;279 struct layer2 *l2;
280 280
@@ -288,11 +288,11 @@ get_free_tei(struct manager *mgr) · 7 unmodified lines
288 continue;288 continue;
289 i -= 64;289 i -= 64;
290 290
291 test_and_set_bit(i, (u_long *)&ids);291 __set_bit(i, ids);
292 }292 }
293 for (i = 0; i < 64; i++)293 i = find_first_zero_bit(ids, 64);
294 if (!test_bit(i, (u_long *)&ids))294 if (i < 64)
295 return i + 64;295 return i + 64;
296 printk(KERN_WARNING "%s: more as 63 dynamic tei for one device\n",296 printk(KERN_WARNING "%s: more as 63 dynamic tei for one device\n",
297 __func__);297 __func__);
298 return -1;298 return -1;
drivers/isdn/pcbit/layer2.c+1−1
@@ -508,7 +508,7 @@ pcbit_irq_handler(int interrupt, void *devptr) · 507 unmodified lines
508 return IRQ_NONE;508 return IRQ_NONE;
509 }509 }
510 if (dev->interrupt) {510 if (dev->interrupt) {
511 printk(KERN_DEBUG "pcbit: reentering interrupt hander\n");511 printk(KERN_DEBUG "pcbit: reentering interrupt handler\n");
512 return IRQ_HANDLED;512 return IRQ_HANDLED;
513 }513 }
514 dev->interrupt = 1;514 dev->interrupt = 1;
drivers/net/arcnet/com20020-pci.c+3−3
@@ -61,7 +61,7 @@ module_param(clockp, int, 0); · 60 unmodified lines
61module_param(clockm, int, 0);61module_param(clockm, int, 0);
62MODULE_LICENSE("GPL");62MODULE_LICENSE("GPL");
63 63
64static int __devinit com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)64static int com20020pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
65{65{
66 struct net_device *dev;66 struct net_device *dev;
67 struct arcnet_local *lp;67 struct arcnet_local *lp;
@@ -135,7 +135,7 @@ out_dev: · 67 unmodified lines
135 return err;135 return err;
136}136}
137 137
138static void __devexit com20020pci_remove(struct pci_dev *pdev)138static void com20020pci_remove(struct pci_dev *pdev)
139{139{
140 struct net_device *dev = pci_get_drvdata(pdev);140 struct net_device *dev = pci_get_drvdata(pdev);
141 unregister_netdev(dev);141 unregister_netdev(dev);
@@ -178,7 +178,7 @@ static struct pci_driver com20020pci_driver = { · 36 unmodified lines
178 .name = "com20020",178 .name = "com20020",
179 .id_table = com20020pci_id_table,179 .id_table = com20020pci_id_table,
180 .probe = com20020pci_probe,180 .probe = com20020pci_probe,
181 .remove = __devexit_p(com20020pci_remove),181 .remove = com20020pci_remove,
182};182};
183 183
184static int __init com20020pci_init(void)184static 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
84 84
85/* Forward declaration */85/* Forward declaration */
86static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]);86static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]);
87static void rlb_purge_src_ip(struct bonding *bond, struct arp_pkt *arp);
88static void rlb_src_unlink(struct bonding *bond, u32 index);
89static void rlb_src_link(struct bonding *bond, u32 ip_src_hash,
90 u32 ip_dst_hash);
87 91
88static inline u8 _simple_hash(const u8 *hash_start, int hash_size)92static inline u8 _simple_hash(const u8 *hash_start, int hash_size)
89{93{
@@ -354,6 +358,18 @@ static int rlb_arp_recv(const struct sk_buff *skb, struct bonding *bond, · 264 unmodified lines
354 if (!arp)358 if (!arp)
355 goto out;359 goto out;
356 360
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
357 if (arp->op_code == htons(ARPOP_REPLY)) {373 if (arp->op_code == htons(ARPOP_REPLY)) {
358 /* update rx hash table for this ARP */374 /* update rx hash table for this ARP */
359 rlb_update_entry_from_arp(bond, arp);375 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
432 _lock_rx_hashtbl_bh(bond);448 _lock_rx_hashtbl_bh(bond);
433 449
434 rx_hash_table = bond_info->rx_hashtbl;450 rx_hash_table = bond_info->rx_hashtbl;
435 index = bond_info->rx_hashtbl_head;451 index = bond_info->rx_hashtbl_used_head;
436 for (; index != RLB_NULL_INDEX; index = next_index) {452 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;
438 if (rx_hash_table[index].slave == slave) {454 if (rx_hash_table[index].slave == slave) {
439 struct slave *assigned_slave = rlb_next_rx_slave(bond);455 struct slave *assigned_slave = rlb_next_rx_slave(bond);
440 456
@@ -519,8 +535,9 @@ static void rlb_update_rx_clients(struct bonding *bond) · 78 unmodified lines
519 535
520 _lock_rx_hashtbl_bh(bond);536 _lock_rx_hashtbl_bh(bond);
521 537
522 hash_index = bond_info->rx_hashtbl_head;538 hash_index = bond_info->rx_hashtbl_used_head;
523 for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {539 for (; hash_index != RLB_NULL_INDEX;
540 hash_index = client_info->used_next) {
524 client_info = &(bond_info->rx_hashtbl[hash_index]);541 client_info = &(bond_info->rx_hashtbl[hash_index]);
525 if (client_info->ntt) {542 if (client_info->ntt) {
526 rlb_update_client(client_info);543 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
548 565
549 _lock_rx_hashtbl_bh(bond);566 _lock_rx_hashtbl_bh(bond);
550 567
551 hash_index = bond_info->rx_hashtbl_head;568 hash_index = bond_info->rx_hashtbl_used_head;
552 for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {569 for (; hash_index != RLB_NULL_INDEX;
570 hash_index = client_info->used_next) {
553 client_info = &(bond_info->rx_hashtbl[hash_index]);571 client_info = &(bond_info->rx_hashtbl[hash_index]);
554 572
555 if ((client_info->slave == slave) &&573 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
578 596
579 _lock_rx_hashtbl(bond);597 _lock_rx_hashtbl(bond);
580 598
581 hash_index = bond_info->rx_hashtbl_head;599 hash_index = bond_info->rx_hashtbl_used_head;
582 for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {600 for (; hash_index != RLB_NULL_INDEX;
601 hash_index = client_info->used_next) {
583 client_info = &(bond_info->rx_hashtbl[hash_index]);602 client_info = &(bond_info->rx_hashtbl[hash_index]);
584 603
585 if (!client_info->slave) {604 if (!client_info->slave) {
@@ -625,6 +644,7 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon · 39 unmodified lines
625 /* update mac address from arp */644 /* update mac address from arp */
626 memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN);645 memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN);
627 }646 }
647 memcpy(client_info->mac_src, arp->mac_src, ETH_ALEN);
628 648
629 assigned_slave = client_info->slave;649 assigned_slave = client_info->slave;
630 if (assigned_slave) {650 if (assigned_slave) {
@@ -647,6 +667,17 @@ static struct slave *rlb_choose_channel(struct sk_buff *skb, struct bonding *bon · 16 unmodified lines
647 assigned_slave = rlb_next_rx_slave(bond);667 assigned_slave = rlb_next_rx_slave(bond);
648 668
649 if (assigned_slave) {669 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
650 client_info->ip_src = arp->ip_src;681 client_info->ip_src = arp->ip_src;
651 client_info->ip_dst = arp->ip_dst;682 client_info->ip_dst = arp->ip_dst;
652 /* arp->mac_dst is broadcast for arp reqeusts.683 /* 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
654 * upon receiving an arp reply.685 * upon receiving an arp reply.
655 */686 */
656 memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN);687 memcpy(client_info->mac_dst, arp->mac_dst, ETH_ALEN);
688 memcpy(client_info->mac_src, arp->mac_src, ETH_ALEN);
657 client_info->slave = assigned_slave;689 client_info->slave = assigned_slave;
658 690
659 if (!ether_addr_equal_64bits(client_info->mac_dst, mac_bcast)) {691 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
669 }701 }
670 702
671 if (!client_info->assigned) {703 if (!client_info->assigned) {
672 u32 prev_tbl_head = bond_info->rx_hashtbl_head;704 u32 prev_tbl_head = bond_info->rx_hashtbl_used_head;
673 bond_info->rx_hashtbl_head = hash_index;705 bond_info->rx_hashtbl_used_head = hash_index;
674 client_info->next = prev_tbl_head;706 client_info->used_next = prev_tbl_head;
675 if (prev_tbl_head != RLB_NULL_INDEX) {707 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 =
677 hash_index;709 hash_index;
678 }710 }
679 client_info->assigned = 1;711 client_info->assigned = 1;
@@ -694,6 +726,12 @@ static struct slave *rlb_arp_xmit(struct sk_buff *skb, struct bonding *bond) · 14 unmodified lines
694 struct arp_pkt *arp = arp_pkt(skb);726 struct arp_pkt *arp = arp_pkt(skb);
695 struct slave *tx_slave = NULL;727 struct slave *tx_slave = NULL;
696 728
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
697 if (arp->op_code == htons(ARPOP_REPLY)) {735 if (arp->op_code == htons(ARPOP_REPLY)) {
698 /* the arp must be sent on the selected736 /* the arp must be sent on the selected
699 * rx channel737 * rx channel
@@ -740,8 +778,9 @@ static void rlb_rebalance(struct bonding *bond) · 40 unmodified lines
740 _lock_rx_hashtbl_bh(bond);778 _lock_rx_hashtbl_bh(bond);
741 779
742 ntt = 0;780 ntt = 0;
743 hash_index = bond_info->rx_hashtbl_head;781 hash_index = bond_info->rx_hashtbl_used_head;
744 for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {782 for (; hash_index != RLB_NULL_INDEX;
783 hash_index = client_info->used_next) {
745 client_info = &(bond_info->rx_hashtbl[hash_index]);784 client_info = &(bond_info->rx_hashtbl[hash_index]);
746 assigned_slave = rlb_next_rx_slave(bond);785 assigned_slave = rlb_next_rx_slave(bond);
747 if (assigned_slave && (client_info->slave != assigned_slave)) {786 if (assigned_slave && (client_info->slave != assigned_slave)) {
@@ -759,11 +798,113 @@ static void rlb_rebalance(struct bonding *bond) · 11 unmodified lines
759}798}
760 799
761/* Caller must hold rx_hashtbl lock */800/* Caller must hold rx_hashtbl lock */
801static 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}
809static 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
762static void rlb_init_table_entry(struct rlb_client_info *entry)816static void rlb_init_table_entry(struct rlb_client_info *entry)
763{817{
764 memset(entry, 0, sizeof(struct rlb_client_info));818 memset(entry, 0, sizeof(struct rlb_client_info));
765 entry->next = RLB_NULL_INDEX;819 rlb_init_table_entry_dst(entry);
766 entry->prev = RLB_NULL_INDEX;820 rlb_init_table_entry_src(entry);
821}
822
823static 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 */
838static 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
861static 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 */
875static 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 */
890static 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);
767}908}
768 909
769static int rlb_initialize(struct bonding *bond)910static int rlb_initialize(struct bonding *bond)
@@ -781,7 +922,7 @@ static int rlb_initialize(struct bonding *bond) · 11 unmodified lines
781 922
782 bond_info->rx_hashtbl = new_hashtbl;923 bond_info->rx_hashtbl = new_hashtbl;
783 924
784 bond_info->rx_hashtbl_head = RLB_NULL_INDEX;925 bond_info->rx_hashtbl_used_head = RLB_NULL_INDEX;
785 926
786 for (i = 0; i < RLB_HASH_TABLE_SIZE; i++) {927 for (i = 0; i < RLB_HASH_TABLE_SIZE; i++) {
787 rlb_init_table_entry(bond_info->rx_hashtbl + i);928 rlb_init_table_entry(bond_info->rx_hashtbl + i);
@@ -803,7 +944,7 @@ static void rlb_deinitialize(struct bonding *bond) · 15 unmodified lines
803 944
804 kfree(bond_info->rx_hashtbl);945 kfree(bond_info->rx_hashtbl);
805 bond_info->rx_hashtbl = NULL;946 bond_info->rx_hashtbl = NULL;
806 bond_info->rx_hashtbl_head = RLB_NULL_INDEX;947 bond_info->rx_hashtbl_used_head = RLB_NULL_INDEX;
807 948
808 _unlock_rx_hashtbl_bh(bond);949 _unlock_rx_hashtbl_bh(bond);
809}950}
@@ -815,25 +956,13 @@ static void rlb_clear_vlan(struct bonding *bond, unsigned short vlan_id) · 5 unmodified lines
815 956
816 _lock_rx_hashtbl_bh(bond);957 _lock_rx_hashtbl_bh(bond);
817 958
818 curr_index = bond_info->rx_hashtbl_head;959 curr_index = bond_info->rx_hashtbl_used_head;
819 while (curr_index != RLB_NULL_INDEX) {960 while (curr_index != RLB_NULL_INDEX) {
820 struct rlb_client_info *curr = &(bond_info->rx_hashtbl[curr_index]);961 struct rlb_client_info *curr = &(bond_info->rx_hashtbl[curr_index]);
821 u32 next_index = bond_info->rx_hashtbl[curr_index].next;962 u32 next_index = bond_info->rx_hashtbl[curr_index].used_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 }
834 963
835 rlb_init_table_entry(curr);964 if (curr->tag && (curr->vlan_id == vlan_id))
836 }965 rlb_delete_table_entry(bond, curr_index);
837 966
838 curr_index = next_index;967 curr_index = next_index;
839 }968 }
drivers/net/bonding/bond_alb.h+24−4
@@ -94,15 +94,35 @@ struct tlb_client_info { · 93 unmodified lines
94 94
95/* -------------------------------------------------------------------------95/* -------------------------------------------------------------------------
96 * struct rlb_client_info contains all info related to a specific rx client96 * struct rlb_client_info contains all info related to a specific rx client
97 * connection. This is the Clients Hash Table entry struct97 * 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).
98 * -------------------------------------------------------------------------109 * -------------------------------------------------------------------------
99 */110 */
100struct rlb_client_info {111struct rlb_client_info {
101 __be32 ip_src; /* the server IP address */112 __be32 ip_src; /* the server IP address */
102 __be32 ip_dst; /* the client IP address */113 __be32 ip_dst; /* the client IP address */
114 u8 mac_src[ETH_ALEN]; /* the server MAC address */
103 u8 mac_dst[ETH_ALEN]; /* the client MAC address */115 u8 mac_dst[ETH_ALEN]; /* the client MAC address */
104 u32 next; /* The next Hash table entry index */116
105 u32 prev; /* The previous Hash table entry index */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
106 u8 assigned; /* checking whether this entry is assigned */126 u8 assigned; /* checking whether this entry is assigned */
107 u8 ntt; /* flag - need to transmit client info */127 u8 ntt; /* flag - need to transmit client info */
108 struct slave *slave; /* the slave assigned to this client */128 struct slave *slave; /* the slave assigned to this client */
@@ -131,7 +151,7 @@ struct alb_bond_info { · 22 unmodified lines
131 int rlb_enabled;151 int rlb_enabled;
132 struct rlb_client_info *rx_hashtbl; /* Receive hash table */152 struct rlb_client_info *rx_hashtbl; /* Receive hash table */
133 spinlock_t rx_hashtbl_lock;153 spinlock_t rx_hashtbl_lock;
134 u32 rx_hashtbl_head;154 u32 rx_hashtbl_used_head;
135 u8 rx_ntt; /* flag - need to transmit155 u8 rx_ntt; /* flag - need to transmit
136 * to all rx clients156 * to all rx clients
137 */157 */
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
31 31
32 spin_lock_bh(&(BOND_ALB_INFO(bond).rx_hashtbl_lock));32 spin_lock_bh(&(BOND_ALB_INFO(bond).rx_hashtbl_lock));
33 33
34 hash_index = bond_info->rx_hashtbl_head;34 hash_index = bond_info->rx_hashtbl_used_head;
35 for (; hash_index != RLB_NULL_INDEX; hash_index = client_info->next) {35 for (; hash_index != RLB_NULL_INDEX;
36 hash_index = client_info->used_next) {
36 client_info = &(bond_info->rx_hashtbl[hash_index]);37 client_info = &(bond_info->rx_hashtbl[hash_index]);
37 seq_printf(m, "%-15pI4 %-15pI4 %-17pM %s\n",38 seq_printf(m, "%-15pI4 %-15pI4 %-17pM %s\n",
38 &client_info->ip_src,39 &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
615 return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;615 return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
616 616
617 /* Try to get link status using Ethtool first. */617 /* Try to get link status using Ethtool first. */
618 if (slave_dev->ethtool_ops) {618 if (slave_dev->ethtool_ops->get_link)
619 if (slave_dev->ethtool_ops->get_link) {619 return slave_dev->ethtool_ops->get_link(slave_dev) ?
620 u32 link;620 BMSR_LSTATUS : 0;
621
622 link = slave_dev->ethtool_ops->get_link(slave_dev);
623
624 return link ? BMSR_LSTATUS : 0;
625 }
626 }
627 621
628 /* Ethtool can't be used, fallback to MII ioctls. */622 /* Ethtool can't be used, fallback to MII ioctls. */
629 ioctl = slave_ops->ndo_do_ioctl;623 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
1510 int link_reporting;1504 int link_reporting;
1511 int res = 0;1505 int res = 0;
1512 1506
1513 if (!bond->params.use_carrier && slave_dev->ethtool_ops == NULL &&1507 if (!bond->params.use_carrier &&
1514 slave_ops->ndo_do_ioctl == NULL) {1508 slave_dev->ethtool_ops->get_link == NULL &&
1509 slave_ops->ndo_do_ioctl == NULL) {
1515 pr_warning("%s: Warning: no link monitoring support for %s\n",1510 pr_warning("%s: Warning: no link monitoring support for %s\n",
1516 bond_dev->name, slave_dev->name);1511 bond_dev->name, slave_dev->name);
1517 }1512 }
@@ -1838,7 +1833,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) · 320 unmodified lines
1838 * anyway (it holds no special properties of the bond device),1833 * anyway (it holds no special properties of the bond device),
1839 * so we can change it without calling change_active_interface()1834 * so we can change it without calling change_active_interface()
1840 */1835 */
1841 if (!bond->curr_active_slave)1836 if (!bond->curr_active_slave && new_slave->link == BOND_LINK_UP)
1842 bond->curr_active_slave = new_slave;1837 bond->curr_active_slave = new_slave;
1843 1838
1844 break;1839 break;
drivers/net/bonding/bonding.h+13−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
22#include <linux/in6.h>22#include <linux/in6.h>
23#include <linux/netpoll.h>23#include <linux/netpoll.h>
24#include <linux/inetdevice.h>24#include <linux/inetdevice.h>
25#include <linux/etherdevice.h>
25#include "bond_3ad.h"26#include "bond_3ad.h"
26#include "bond_alb.h"27#include "bond_alb.h"
27 28
@@ -450,6 +451,18 @@ static inline void bond_destroy_proc_dir(struct bond_net *bn) · 422 unmodified lines
450}451}
451#endif452#endif
452 453
454static 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}
453 466
454/* exported from bond_main.c */467/* exported from bond_main.c */
455extern int bond_net_id;468extern int bond_net_id;
drivers/net/can/Kconfig+9−0
@@ -110,6 +110,15 @@ config PCH_CAN · 109 unmodified lines
110 is an IOH for x86 embedded processor (Intel Atom E6xx series).110 is an IOH for x86 embedded processor (Intel Atom E6xx series).
111 This driver can access CAN bus.111 This driver can access CAN bus.
112 112
113config 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
113source "drivers/net/can/mscan/Kconfig"122source "drivers/net/can/mscan/Kconfig"
114 123
115source "drivers/net/can/sja1000/Kconfig"124source "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
22obj-$(CONFIG_CAN_JANZ_ICAN3) += janz-ican3.o22obj-$(CONFIG_CAN_JANZ_ICAN3) += janz-ican3.o
23obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o23obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o
24obj-$(CONFIG_PCH_CAN) += pch_can.o24obj-$(CONFIG_PCH_CAN) += pch_can.o
25obj-$(CONFIG_CAN_GRCAN) += grcan.o
25 26
26ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG27ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG
drivers/net/can/at91_can.c+5−4
@@ -154,7 +154,7 @@ struct at91_priv { · 153 unmodified lines
154 canid_t mb0_id;154 canid_t mb0_id;
155};155};
156 156
157static const struct at91_devtype_data at91_devtype_data[] __devinitconst = {157static const struct at91_devtype_data at91_devtype_data[] = {
158 [AT91_DEVTYPE_SAM9263] = {158 [AT91_DEVTYPE_SAM9263] = {
159 .rx_first = 1,159 .rx_first = 1,
160 .rx_split = 8,160 .rx_split = 8,
@@ -1241,7 +1241,7 @@ static struct attribute_group at91_sysfs_attr_group = { · 1080 unmodified lines
1241 .attrs = at91_sysfs_attrs,1241 .attrs = at91_sysfs_attrs,
1242};1242};
1243 1243
1244static int __devinit at91_can_probe(struct platform_device *pdev)1244static int at91_can_probe(struct platform_device *pdev)
1245{1245{
1246 const struct at91_devtype_data *devtype_data;1246 const struct at91_devtype_data *devtype_data;
1247 enum at91_devtype devtype;1247 enum at91_devtype devtype;
@@ -1338,7 +1338,7 @@ static int __devinit at91_can_probe(struct platform_device *pdev) · 90 unmodified lines
1338 return err;1338 return err;
1339}1339}
1340 1340
1341static int __devexit at91_can_remove(struct platform_device *pdev)1341static int at91_can_remove(struct platform_device *pdev)
1342{1342{
1343 struct net_device *dev = platform_get_drvdata(pdev);1343 struct net_device *dev = platform_get_drvdata(pdev);
1344 struct at91_priv *priv = netdev_priv(dev);1344 struct at91_priv *priv = netdev_priv(dev);
@@ -1371,10 +1371,11 @@ static const struct platform_device_id at91_can_id_table[] = { · 26 unmodified lines
1371 /* sentinel */1371 /* sentinel */
1372 }1372 }
1373};1373};
1374MODULE_DEVICE_TABLE(platform, at91_can_id_table);
1374 1375
1375static struct platform_driver at91_can_driver = {1376static struct platform_driver at91_can_driver = {
1376 .probe = at91_can_probe,1377 .probe = at91_can_probe,
1377 .remove = __devexit_p(at91_can_remove),1378 .remove = at91_can_remove,
1378 .driver = {1379 .driver = {
1379 .name = KBUILD_MODNAME,1380 .name = KBUILD_MODNAME,
1380 .owner = THIS_MODULE,1381 .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
531 .ndo_start_xmit = bfin_can_start_xmit,531 .ndo_start_xmit = bfin_can_start_xmit,
532};532};
533 533
534static int __devinit bfin_can_probe(struct platform_device *pdev)534static int bfin_can_probe(struct platform_device *pdev)
535{535{
536 int err;536 int err;
537 struct net_device *dev;537 struct net_device *dev;
@@ -611,7 +611,7 @@ exit: · 73 unmodified lines
611 return err;611 return err;
612}612}
613 613
614static int __devexit bfin_can_remove(struct platform_device *pdev)614static int bfin_can_remove(struct platform_device *pdev)
615{615{
616 struct net_device *dev = dev_get_drvdata(&pdev->dev);616 struct net_device *dev = dev_get_drvdata(&pdev->dev);
617 struct bfin_can_priv *priv = netdev_priv(dev);617 struct bfin_can_priv *priv = netdev_priv(dev);
@@ -677,7 +677,7 @@ static int bfin_can_resume(struct platform_device *pdev) · 59 unmodified lines
677 677
678static struct platform_driver bfin_can_driver = {678static struct platform_driver bfin_can_driver = {
679 .probe = bfin_can_probe,679 .probe = bfin_can_probe,
680 .remove = __devexit_p(bfin_can_remove),680 .remove = bfin_can_remove,
681 .suspend = bfin_can_suspend,681 .suspend = bfin_can_suspend,
682 .resume = bfin_can_resume,682 .resume = bfin_can_resume,
683 .driver = {683 .driver = {
@@ -691,3 +691,4 @@ module_platform_driver(bfin_can_driver); · 7 unmodified lines
691MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");691MODULE_AUTHOR("Barry Song <21cnbao@gmail.com>");
692MODULE_LICENSE("GPL");692MODULE_LICENSE("GPL");
693MODULE_DESCRIPTION("Blackfin on-chip CAN netdevice driver");693MODULE_DESCRIPTION("Blackfin on-chip CAN netdevice driver");
694MODULE_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
233 pm_runtime_put_sync(priv->device);233 pm_runtime_put_sync(priv->device);
234}234}
235 235
236static 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
236static inline int get_tx_next_msg_obj(const struct c_can_priv *priv)242static inline int get_tx_next_msg_obj(const struct c_can_priv *priv)
237{243{
238 return (priv->tx_next & C_CAN_NEXT_MSG_OBJ_MASK) +244 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
1090 struct c_can_priv *priv = netdev_priv(dev);1096 struct c_can_priv *priv = netdev_priv(dev);
1091 1097
1092 c_can_pm_runtime_get_sync(priv);1098 c_can_pm_runtime_get_sync(priv);
1099 c_can_reset_ram(priv, true);
1093 1100
1094 /* open the can device */1101 /* open the can device */
1095 err = open_candev(dev);1102 err = open_candev(dev);
@@ -1118,6 +1125,7 @@ static int c_can_open(struct net_device *dev) · 22 unmodified lines
1118exit_irq_fail:1125exit_irq_fail:
1119 close_candev(dev);1126 close_candev(dev);
1120exit_open_fail:1127exit_open_fail:
1128 c_can_reset_ram(priv, false);
1121 c_can_pm_runtime_put_sync(priv);1129 c_can_pm_runtime_put_sync(priv);
1122 return err;1130 return err;
1123}1131}
@@ -1131,6 +1139,8 @@ static int c_can_close(struct net_device *dev) · 7 unmodified lines
1131 c_can_stop(dev);1139 c_can_stop(dev);
1132 free_irq(dev->irq, dev);1140 free_irq(dev->irq, dev);
1133 close_candev(dev);1141 close_candev(dev);
1142
1143 c_can_reset_ram(priv, false);
1134 c_can_pm_runtime_put_sync(priv);1144 c_can_pm_runtime_put_sync(priv);
1135 1145
1136 return 0;1146 return 0;
@@ -1188,6 +1198,7 @@ int c_can_power_down(struct net_device *dev) · 51 unmodified lines
1188 1198
1189 c_can_stop(dev);1199 c_can_stop(dev);
1190 1200
1201 c_can_reset_ram(priv, false);
1191 c_can_pm_runtime_put_sync(priv);1202 c_can_pm_runtime_put_sync(priv);
1192 1203
1193 return 0;1204 return 0;
@@ -1206,6 +1217,7 @@ int c_can_power_up(struct net_device *dev) · 12 unmodified lines
1206 WARN_ON(priv->type != BOSCH_D_CAN);1217 WARN_ON(priv->type != BOSCH_D_CAN);
1207 1218
1208 c_can_pm_runtime_get_sync(priv);1219 c_can_pm_runtime_get_sync(priv);
1220 c_can_reset_ram(priv, true);
1209 1221
1210 /* Clear PDR and INIT bits */1222 /* Clear PDR and INIT bits */
1211 val = priv->read_reg(priv, C_CAN_CTRL_EX_REG);1223 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
169 void *priv; /* for board-specific data */169 void *priv; /* for board-specific data */
170 u16 irqstatus;170 u16 irqstatus;
171 enum c_can_dev_id type;171 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);
172};175};
173 176
174struct net_device *alloc_c_can_dev(void);177struct 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
63 writew(val, priv->base + 2 * priv->regs[index]);63 writew(val, priv->base + 2 * priv->regs[index]);
64}64}
65 65
66static int __devinit c_can_pci_probe(struct pci_dev *pdev,66static int c_can_pci_probe(struct pci_dev *pdev,
67 const struct pci_device_id *ent)67 const struct pci_device_id *ent)
68{68{
69 struct c_can_pci_data *c_can_pci_data = (void *)ent->driver_data;69 struct c_can_pci_data *c_can_pci_data = (void *)ent->driver_data;
70 struct c_can_priv *priv;70 struct c_can_priv *priv;
@@ -174,7 +174,7 @@ out: · 103 unmodified lines
174 return ret;174 return ret;
175}175}
176 176
177static void __devexit c_can_pci_remove(struct pci_dev *pdev)177static void c_can_pci_remove(struct pci_dev *pdev)
178{178{
179 struct net_device *dev = pci_get_drvdata(pdev);179 struct net_device *dev = pci_get_drvdata(pdev);
180 struct c_can_priv *priv = netdev_priv(dev);180 struct c_can_priv *priv = netdev_priv(dev);
@@ -210,7 +210,7 @@ static struct pci_driver c_can_pci_driver = { · 29 unmodified lines
210 .name = KBUILD_MODNAME,210 .name = KBUILD_MODNAME,
211 .id_table = c_can_pci_tbl,211 .id_table = c_can_pci_tbl,
212 .probe = c_can_pci_probe,212 .probe = c_can_pci_probe,
213 .remove = __devexit_p(c_can_pci_remove),213 .remove = c_can_pci_remove,
214};214};
215 215
216module_pci_driver(c_can_pci_driver);216module_pci_driver(c_can_pci_driver);
drivers/net/can/c_can/c_can_platform.c+32−4
@@ -38,6 +38,8 @@ · 37 unmodified lines
38 38
39#include "c_can.h"39#include "c_can.h"
40 40
41#define CAN_RAMINIT_START_MASK(i) (1 << (i))
42
41/*43/*
42 * 16-bit c_can registers can be arranged differently in the memory44 * 16-bit c_can registers can be arranged differently in the memory
43 * architecture of different implementations. For example: 16-bit45 * 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
68 writew(val, priv->base + 2 * priv->regs[index]);70 writew(val, priv->base + 2 * priv->regs[index]);
69}71}
70 72
73static 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
71static struct platform_device_id c_can_id_table[] = {85static struct platform_device_id c_can_id_table[] = {
72 [BOSCH_C_CAN_PLATFORM] = {86 [BOSCH_C_CAN_PLATFORM] = {
73 .name = KBUILD_MODNAME,87 .name = KBUILD_MODNAME,
@@ -83,14 +97,16 @@ static struct platform_device_id c_can_id_table[] = { · 9 unmodified lines
83 }, {97 }, {
84 }98 }
85};99};
100MODULE_DEVICE_TABLE(platform, c_can_id_table);
86 101
87static const struct of_device_id c_can_of_table[] = {102static const struct of_device_id c_can_of_table[] = {
88 { .compatible = "bosch,c_can", .data = &c_can_id_table[BOSCH_C_CAN] },103 { .compatible = "bosch,c_can", .data = &c_can_id_table[BOSCH_C_CAN] },
89 { .compatible = "bosch,d_can", .data = &c_can_id_table[BOSCH_D_CAN] },104 { .compatible = "bosch,d_can", .data = &c_can_id_table[BOSCH_D_CAN] },
90 { /* sentinel */ },105 { /* sentinel */ },
91};106};
107MODULE_DEVICE_TABLE(of, c_can_of_table);
92 108
93static int __devinit c_can_plat_probe(struct platform_device *pdev)109static int c_can_plat_probe(struct platform_device *pdev)
94{110{
95 int ret;111 int ret;
96 void __iomem *addr;112 void __iomem *addr;
@@ -99,7 +115,7 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev) · 2 unmodified lines
99 const struct of_device_id *match;115 const struct of_device_id *match;
100 const struct platform_device_id *id;116 const struct platform_device_id *id;
101 struct pinctrl *pinctrl;117 struct pinctrl *pinctrl;
102 struct resource *mem;118 struct resource *mem, *res;
103 int irq;119 int irq;
104 struct clk *clk;120 struct clk *clk;
105 121
@@ -178,6 +194,18 @@ static int __devinit c_can_plat_probe(struct platform_device *pdev) · 72 unmodified lines
178 priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;194 priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
179 priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;195 priv->read_reg = c_can_plat_read_reg_aligned_to_16bit;
180 priv->write_reg = c_can_plat_write_reg_aligned_to_16bit;196 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;
181 break;209 break;
182 default:210 default:
183 ret = -EINVAL;211 ret = -EINVAL;
@@ -220,7 +248,7 @@ exit: · 36 unmodified lines
220 return ret;248 return ret;
221}249}
222 250
223static int __devexit c_can_plat_remove(struct platform_device *pdev)251static int c_can_plat_remove(struct platform_device *pdev)
224{252{
225 struct net_device *dev = platform_get_drvdata(pdev);253 struct net_device *dev = platform_get_drvdata(pdev);
226 struct c_can_priv *priv = netdev_priv(dev);254 struct c_can_priv *priv = netdev_priv(dev);
@@ -306,7 +334,7 @@ static struct platform_driver c_can_plat_driver = { · 79 unmodified lines
306 .of_match_table = of_match_ptr(c_can_of_table),334 .of_match_table = of_match_ptr(c_can_of_table),
307 },335 },
308 .probe = c_can_plat_probe,336 .probe = c_can_plat_probe,
309 .remove = __devexit_p(c_can_plat_remove),337 .remove = c_can_plat_remove,
310 .suspend = c_can_suspend,338 .suspend = c_can_suspend,
311 .resume = c_can_resume,339 .resume = c_can_resume,
312 .id_table = c_can_id_table,340 .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
75 75
76static unsigned long port[MAXDEV];76static unsigned long port[MAXDEV];
77static unsigned long mem[MAXDEV];77static unsigned long mem[MAXDEV];
78static int __devinitdata irq[MAXDEV];78static int irq[MAXDEV];
79static int __devinitdata clk[MAXDEV];79static int clk[MAXDEV];
80static u8 __devinitdata cir[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};80static u8 cir[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
81static u8 __devinitdata cor[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};81static u8 cor[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
82static u8 __devinitdata bcr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};82static u8 bcr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
83static int __devinitdata indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};83static int indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};
84 84
85module_param_array(port, ulong, NULL, S_IRUGO);85module_param_array(port, ulong, NULL, S_IRUGO);
86MODULE_PARM_DESC(port, "I/O port number");86MODULE_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
166 spin_unlock_irqrestore(&cc770_isa_port_lock, flags);166 spin_unlock_irqrestore(&cc770_isa_port_lock, flags);
167}167}
168 168
169static int __devinit cc770_isa_probe(struct platform_device *pdev)169static int cc770_isa_probe(struct platform_device *pdev)
170{170{
171 struct net_device *dev;171 struct net_device *dev;
172 struct cc770_priv *priv;172 struct cc770_priv *priv;
@@ -291,7 +291,7 @@ static int __devinit cc770_isa_probe(struct platform_device *pdev) · 118 unmodified lines
291 return err;291 return err;
292}292}
293 293
294static int __devexit cc770_isa_remove(struct platform_device *pdev)294static int cc770_isa_remove(struct platform_device *pdev)
295{295{
296 struct net_device *dev = dev_get_drvdata(&pdev->dev);296 struct net_device *dev = dev_get_drvdata(&pdev->dev);
297 struct cc770_priv *priv = netdev_priv(dev);297 struct cc770_priv *priv = netdev_priv(dev);
@@ -316,7 +316,7 @@ static int __devexit cc770_isa_remove(struct platform_device *pdev) · 18 unmodified lines
316 316
317static struct platform_driver cc770_isa_driver = {317static struct platform_driver cc770_isa_driver = {
318 .probe = cc770_isa_probe,318 .probe = cc770_isa_probe,
319 .remove = __devexit_p(cc770_isa_remove),319 .remove = cc770_isa_remove,
320 .driver = {320 .driver = {
321 .name = KBUILD_MODNAME,321 .name = KBUILD_MODNAME,
322 .owner = THIS_MODULE,322 .owner = THIS_MODULE,
drivers/net/can/cc770/cc770_platform.c+10−8
@@ -60,6 +60,7 @@ · 59 unmodified lines
60MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");60MODULE_AUTHOR("Wolfgang Grandegger <wg@grandegger.com>");
61MODULE_DESCRIPTION("Socket-CAN driver for CC770 on the platform bus");61MODULE_DESCRIPTION("Socket-CAN driver for CC770 on the platform bus");
62MODULE_LICENSE("GPL v2");62MODULE_LICENSE("GPL v2");
63MODULE_ALIAS("platform:" DRV_NAME);
63 64
64#define CC770_PLATFORM_CAN_CLOCK 1600000065#define CC770_PLATFORM_CAN_CLOCK 16000000
65 66
@@ -74,8 +75,8 @@ static void cc770_platform_write_reg(const struct cc770_priv *priv, int reg, · 8 unmodified lines
74 iowrite8(val, priv->reg_base + reg);75 iowrite8(val, priv->reg_base + reg);
75}76}
76 77
77static int __devinit cc770_get_of_node_data(struct platform_device *pdev,78static int cc770_get_of_node_data(struct platform_device *pdev,
78 struct cc770_priv *priv)79 struct cc770_priv *priv)
79{80{
80 struct device_node *np = pdev->dev.of_node;81 struct device_node *np = pdev->dev.of_node;
81 const u32 *prop;82 const u32 *prop;
@@ -147,8 +148,8 @@ static int __devinit cc770_get_of_node_data(struct platform_device *pdev, · 65 unmodified lines
147 return 0;148 return 0;
148}149}
149 150
150static int __devinit cc770_get_platform_data(struct platform_device *pdev,151static int cc770_get_platform_data(struct platform_device *pdev,
151 struct cc770_priv *priv)152 struct cc770_priv *priv)
152{153{
153 154
154 struct cc770_platform_data *pdata = pdev->dev.platform_data;155 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
163 return 0;164 return 0;
164}165}
165 166
166static int __devinit cc770_platform_probe(struct platform_device *pdev)167static int cc770_platform_probe(struct platform_device *pdev)
167{168{
168 struct net_device *dev;169 struct net_device *dev;
169 struct cc770_priv *priv;170 struct cc770_priv *priv;
@@ -237,7 +238,7 @@ exit_release_mem: · 67 unmodified lines
237 return err;238 return err;
238}239}
239 240
240static int __devexit cc770_platform_remove(struct platform_device *pdev)241static int cc770_platform_remove(struct platform_device *pdev)
241{242{
242 struct net_device *dev = dev_get_drvdata(&pdev->dev);243 struct net_device *dev = dev_get_drvdata(&pdev->dev);
243 struct cc770_priv *priv = netdev_priv(dev);244 struct cc770_priv *priv = netdev_priv(dev);
@@ -253,11 +254,12 @@ static int __devexit cc770_platform_remove(struct platform_device *pdev) · 9 unmodified lines
253 return 0;254 return 0;
254}255}
255 256
256static struct of_device_id __devinitdata cc770_platform_table[] = {257static struct of_device_id cc770_platform_table[] = {
257 {.compatible = "bosch,cc770"}, /* CC770 from Bosch */258 {.compatible = "bosch,cc770"}, /* CC770 from Bosch */
258 {.compatible = "intc,82527"}, /* AN82527 from Intel CP */259 {.compatible = "intc,82527"}, /* AN82527 from Intel CP */
259 {},260 {},
260};261};
262MODULE_DEVICE_TABLE(of, cc770_platform_table);
261 263
262static struct platform_driver cc770_platform_driver = {264static struct platform_driver cc770_platform_driver = {
263 .driver = {265 .driver = {
@@ -266,7 +268,7 @@ static struct platform_driver cc770_platform_driver = { · 2 unmodified lines
266 .of_match_table = cc770_platform_table,268 .of_match_table = cc770_platform_table,
267 },269 },
268 .probe = cc770_platform_probe,270 .probe = cc770_platform_probe,
269 .remove = __devexit_p(cc770_platform_remove),271 .remove = cc770_platform_remove,
270};272};
271 273
272module_platform_driver(cc770_platform_driver);274module_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
609{609{
610 struct can_priv *priv = netdev_priv(dev);610 struct can_priv *priv = netdev_priv(dev);
611 611
612 if (del_timer_sync(&priv->restart_timer))612 del_timer_sync(&priv->restart_timer);
613 dev_put(dev);
614 can_flush_echo_skb(dev);613 can_flush_echo_skb(dev);
615}614}
616EXPORT_SYMBOL_GPL(close_candev);615EXPORT_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
922 .ndo_start_xmit = flexcan_start_xmit,922 .ndo_start_xmit = flexcan_start_xmit,
923};923};
924 924
925static int __devinit register_flexcandev(struct net_device *dev)925static int register_flexcandev(struct net_device *dev)
926{926{
927 struct flexcan_priv *priv = netdev_priv(dev);927 struct flexcan_priv *priv = netdev_priv(dev);
928 struct flexcan_regs __iomem *regs = priv->base;928 struct flexcan_regs __iomem *regs = priv->base;
@@ -968,7 +968,7 @@ static int __devinit register_flexcandev(struct net_device *dev) · 39 unmodified lines
968 return err;968 return err;
969}969}
970 970
971static void __devexit unregister_flexcandev(struct net_device *dev)971static void unregister_flexcandev(struct net_device *dev)
972{972{
973 unregister_candev(dev);973 unregister_candev(dev);
974}974}
@@ -979,13 +979,15 @@ static const struct of_device_id flexcan_of_match[] = { · 4 unmodified lines
979 { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, },979 { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, },
980 { /* sentinel */ },980 { /* sentinel */ },
981};981};
982MODULE_DEVICE_TABLE(of, flexcan_of_match);
982 983
983static const struct platform_device_id flexcan_id_table[] = {984static const struct platform_device_id flexcan_id_table[] = {
984 { .name = "flexcan", .driver_data = (kernel_ulong_t)&fsl_p1010_devtype_data, },985 { .name = "flexcan", .driver_data = (kernel_ulong_t)&fsl_p1010_devtype_data, },
985 { /* sentinel */ },986 { /* sentinel */ },
986};987};
988MODULE_DEVICE_TABLE(platform, flexcan_id_table);
987 989
988static int __devinit flexcan_probe(struct platform_device *pdev)990static int flexcan_probe(struct platform_device *pdev)
989{991{
990 const struct of_device_id *of_id;992 const struct of_device_id *of_id;
991 const struct flexcan_devtype_data *devtype_data;993 const struct flexcan_devtype_data *devtype_data;
@@ -1107,7 +1109,7 @@ static int __devinit flexcan_probe(struct platform_device *pdev) · 115 unmodified lines
1107 return err;1109 return err;
1108}1110}
1109 1111
1110static int __devexit flexcan_remove(struct platform_device *pdev)1112static int flexcan_remove(struct platform_device *pdev)
1111{1113{
1112 struct net_device *dev = platform_get_drvdata(pdev);1114 struct net_device *dev = platform_get_drvdata(pdev);
1113 struct flexcan_priv *priv = netdev_priv(dev);1115 struct flexcan_priv *priv = netdev_priv(dev);
@@ -1168,7 +1170,7 @@ static struct platform_driver flexcan_driver = { · 54 unmodified lines
1168 .of_match_table = flexcan_of_match,1170 .of_match_table = flexcan_of_match,
1169 },1171 },
1170 .probe = flexcan_probe,1172 .probe = flexcan_probe,
1171 .remove = __devexit_p(flexcan_remove),1173 .remove = flexcan_remove,
1172 .suspend = flexcan_suspend,1174 .suspend = flexcan_suspend,
1173 .resume = flexcan_resume,1175 .resume = flexcan_resume,
1174 .id_table = flexcan_id_table,1176 .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
51struct 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
220struct grcan_dma_buffer {
221 size_t size;
222 void *buf;
223 dma_addr_t handle;
224};
225
226struct 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 */
235struct 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 */
255struct 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)
325static inline u32 grcan_read_reg(u32 __iomem *reg)
326{
327 return ioread32be(reg);
328}
329
330static inline void grcan_write_reg(u32 __iomem *reg, u32 val)
331{
332 iowrite32be(val, reg);
333}
334#else
335static inline u32 grcan_read_reg(u32 __iomem *reg)
336{
337 return ioread32(reg);
338}
339
340static inline void grcan_write_reg(u32 __iomem *reg, u32 val)
341{
342 iowrite32(val, reg);
343}
344#endif
345
346static inline void grcan_clear_bits(u32 __iomem *reg, u32 mask)
347{
348 grcan_write_reg(reg, grcan_read_reg(reg) & ~mask);
349}
350
351static inline void grcan_set_bits(u32 __iomem *reg, u32 mask)
352{
353 grcan_write_reg(reg, grcan_read_reg(reg) | mask);
354}
355
356static inline u32 grcan_read_bits(u32 __iomem *reg, u32 mask)
357{
358 return grcan_read_reg(reg) & mask;
359}
360
361static 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 */
369static 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) */
380static 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 */
386static 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 */
395static struct grcan_device_config grcan_module_config =
396 GRCAN_DEFAULT_DEVICE_CONFIG;
397
398static 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
410static 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
453static 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
465static int grcan_poll(struct napi_struct *napi, int budget);
466
467/* Reset device, but keep configuration information */
468static 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 */
485static 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 */
504static 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
540static 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
579static 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
768static 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 */
813static 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 */
887static 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 */
896static 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 */
904static 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
929static 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
939static 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 */
981static 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
1023static 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
1048static 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
1101exit_close_candev:
1102 close_candev(dev);
1103exit_free_txdlc:
1104 kfree(priv->txdlc);
1105exit_free_echo_skb:
1106 kfree(priv->echo_skb);
1107exit_free_dma_buffers:
1108 grcan_free_dma_buffers(dev);
1109 return err;
1110}
1111
1112static 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
1144static 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
1170static 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
1242static 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 */
1286static 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 */
1354static 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 */
1527GRCAN_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
1532GRCAN_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
1537GRCAN_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 */
1544GRCAN_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");
1548GRCAN_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 */
1556static 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
1565static 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
1573static 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
1580static 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
1586static 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;
1657exit_free_candev:
1658 free_candev(dev);
1659 return err;
1660}
1661
1662static 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
1708exit_dispose_irq:
1709 irq_dispose_mapping(irq);
1710exit_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
1717static 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
1732static 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
1740MODULE_DEVICE_TABLE(of, grcan_match);
1741
1742static 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
1752module_platform_driver(grcan_driver);
1753
1754MODULE_AUTHOR("Aeroflex Gaisler AB.");
1755MODULE_DESCRIPTION("Socket CAN driver for Aeroflex Gaisler GRCAN");
1756MODULE_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
365 * ICAN3 "new-style" Host Interface Setup365 * ICAN3 "new-style" Host Interface Setup
366 */366 */
367 367
368static void __devinit ican3_init_new_host_interface(struct ican3_dev *mod)368static void ican3_init_new_host_interface(struct ican3_dev *mod)
369{369{
370 struct ican3_new_desc desc;370 struct ican3_new_desc desc;
371 unsigned long flags;371 unsigned long flags;
@@ -444,7 +444,7 @@ static void __devinit ican3_init_new_host_interface(struct ican3_dev *mod) · 72 unmodified lines
444 * ICAN3 Fast Host Interface Setup444 * ICAN3 Fast Host Interface Setup
445 */445 */
446 446
447static void __devinit ican3_init_fast_host_interface(struct ican3_dev *mod)447static void ican3_init_fast_host_interface(struct ican3_dev *mod)
448{448{
449 struct ican3_fast_desc desc;449 struct ican3_fast_desc desc;
450 unsigned long flags;450 unsigned long flags;
@@ -631,7 +631,7 @@ static int ican3_recv_msg(struct ican3_dev *mod, struct ican3_msg *msg) · 180 unmodified lines
631 * Quick Pre-constructed Messages631 * Quick Pre-constructed Messages
632 */632 */
633 633
634static int __devinit ican3_msg_connect(struct ican3_dev *mod)634static int ican3_msg_connect(struct ican3_dev *mod)
635{635{
636 struct ican3_msg msg;636 struct ican3_msg msg;
637 637
@@ -642,7 +642,7 @@ static int __devinit ican3_msg_connect(struct ican3_dev *mod) · 4 unmodified lines
642 return ican3_send_msg(mod, &msg);642 return ican3_send_msg(mod, &msg);
643}643}
644 644
645static int __devexit ican3_msg_disconnect(struct ican3_dev *mod)645static int ican3_msg_disconnect(struct ican3_dev *mod)
646{646{
647 struct ican3_msg msg;647 struct ican3_msg msg;
648 648
@@ -653,7 +653,7 @@ static int __devexit ican3_msg_disconnect(struct ican3_dev *mod) · 4 unmodified lines
653 return ican3_send_msg(mod, &msg);653 return ican3_send_msg(mod, &msg);
654}654}
655 655
656static int __devinit ican3_msg_newhostif(struct ican3_dev *mod)656static int ican3_msg_newhostif(struct ican3_dev *mod)
657{657{
658 struct ican3_msg msg;658 struct ican3_msg msg;
659 int ret;659 int ret;
@@ -674,7 +674,7 @@ static int __devinit ican3_msg_newhostif(struct ican3_dev *mod) · 14 unmodified lines
674 return 0;674 return 0;
675}675}
676 676
677static int __devinit ican3_msg_fasthostif(struct ican3_dev *mod)677static int ican3_msg_fasthostif(struct ican3_dev *mod)
678{678{
679 struct ican3_msg msg;679 struct ican3_msg msg;
680 unsigned int addr;680 unsigned int addr;
@@ -707,7 +707,7 @@ static int __devinit ican3_msg_fasthostif(struct ican3_dev *mod) · 26 unmodified lines
707 * Setup the CAN filter to either accept or reject all707 * Setup the CAN filter to either accept or reject all
708 * messages from the CAN bus.708 * messages from the CAN bus.
709 */709 */
710static int __devinit ican3_set_id_filter(struct ican3_dev *mod, bool accept)710static int ican3_set_id_filter(struct ican3_dev *mod, bool accept)
711{711{
712 struct ican3_msg msg;712 struct ican3_msg msg;
713 int ret;713 int ret;
@@ -1421,7 +1421,7 @@ static int ican3_reset_module(struct ican3_dev *mod) · 707 unmodified lines
1421 return -ETIMEDOUT;1421 return -ETIMEDOUT;
1422}1422}
1423 1423
1424static void __devexit ican3_shutdown_module(struct ican3_dev *mod)1424static void ican3_shutdown_module(struct ican3_dev *mod)
1425{1425{
1426 ican3_msg_disconnect(mod);1426 ican3_msg_disconnect(mod);
1427 ican3_reset_module(mod);1427 ican3_reset_module(mod);
@@ -1430,7 +1430,7 @@ static void __devexit ican3_shutdown_module(struct ican3_dev *mod) · 2 unmodified lines
1430/*1430/*
1431 * Startup an ICAN module, bringing it into fast mode1431 * Startup an ICAN module, bringing it into fast mode
1432 */1432 */
1433static int __devinit ican3_startup_module(struct ican3_dev *mod)1433static int ican3_startup_module(struct ican3_dev *mod)
1434{1434{
1435 int ret;1435 int ret;
1436 1436
@@ -1692,7 +1692,7 @@ static int ican3_get_berr_counter(const struct net_device *ndev, · 255 unmodified lines
1692 return ret;1692 return ret;
1693 1693
1694 ret = wait_for_completion_timeout(&mod->buserror_comp, HZ);1694 ret = wait_for_completion_timeout(&mod->buserror_comp, HZ);
1695 if (ret <= 0) {1695 if (ret == 0) {
1696 dev_info(mod->dev, "%s timed out\n", __func__);1696 dev_info(mod->dev, "%s timed out\n", __func__);
1697 return -ETIMEDOUT;1697 return -ETIMEDOUT;
1698 }1698 }
@@ -1718,7 +1718,7 @@ static ssize_t ican3_sysfs_show_term(struct device *dev, · 19 unmodified lines
1718 return ret;1718 return ret;
1719 1719
1720 ret = wait_for_completion_timeout(&mod->termination_comp, HZ);1720 ret = wait_for_completion_timeout(&mod->termination_comp, HZ);
1721 if (ret <= 0) {1721 if (ret == 0) {
1722 dev_info(mod->dev, "%s timed out\n", __func__);1722 dev_info(mod->dev, "%s timed out\n", __func__);
1723 return -ETIMEDOUT;1723 return -ETIMEDOUT;
1724 }1724 }
@@ -1760,7 +1760,7 @@ static struct attribute_group ican3_sysfs_attr_group = { · 35 unmodified lines
1760 * PCI Subsystem1760 * PCI Subsystem
1761 */1761 */
1762 1762
1763static int __devinit ican3_probe(struct platform_device *pdev)1763static int ican3_probe(struct platform_device *pdev)
1764{1764{
1765 struct janz_platform_data *pdata;1765 struct janz_platform_data *pdata;
1766 struct net_device *ndev;1766 struct net_device *ndev;
@@ -1898,7 +1898,7 @@ out_return: · 131 unmodified lines
1898 return ret;1898 return ret;
1899}1899}
1900 1900
1901static int __devexit ican3_remove(struct platform_device *pdev)1901static int ican3_remove(struct platform_device *pdev)
1902{1902{
1903 struct net_device *ndev = platform_get_drvdata(pdev);1903 struct net_device *ndev = platform_get_drvdata(pdev);
1904 struct ican3_dev *mod = netdev_priv(ndev);1904 struct ican3_dev *mod = netdev_priv(ndev);
@@ -1927,7 +1927,7 @@ static struct platform_driver ican3_driver = { · 22 unmodified lines
1927 .owner = THIS_MODULE,1927 .owner = THIS_MODULE,
1928 },1928 },
1929 .probe = ican3_probe,1929 .probe = ican3_probe,
1930 .remove = __devexit_p(ican3_remove),1930 .remove = ican3_remove,
1931};1931};
1932 1932
1933module_platform_driver(ican3_driver);1933module_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
981 .ndo_start_xmit = mcp251x_hard_start_xmit,981 .ndo_start_xmit = mcp251x_hard_start_xmit,
982};982};
983 983
984static int __devinit mcp251x_can_probe(struct spi_device *spi)984static int mcp251x_can_probe(struct spi_device *spi)
985{985{
986 struct net_device *net;986 struct net_device *net;
987 struct mcp251x_priv *priv;987 struct mcp251x_priv *priv;
@@ -1100,7 +1100,7 @@ error_out: · 112 unmodified lines
1100 return ret;1100 return ret;
1101}1101}
1102 1102
1103static int __devexit mcp251x_can_remove(struct spi_device *spi)1103static int mcp251x_can_remove(struct spi_device *spi)
1104{1104{
1105 struct mcp251x_platform_data *pdata = spi->dev.platform_data;1105 struct mcp251x_platform_data *pdata = spi->dev.platform_data;
1106 struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);1106 struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
@@ -1198,7 +1198,7 @@ static struct spi_driver mcp251x_can_driver = { · 91 unmodified lines
1198 1198
1199 .id_table = mcp251x_id_table,1199 .id_table = mcp251x_id_table,
1200 .probe = mcp251x_can_probe,1200 .probe = mcp251x_can_probe,
1201 .remove = __devexit_p(mcp251x_can_remove),1201 .remove = mcp251x_can_remove,
1202 .suspend = mcp251x_can_suspend,1202 .suspend = mcp251x_can_suspend,
1203 .resume = mcp251x_can_resume,1203 .resume = mcp251x_can_resume,
1204};1204};
drivers/net/can/mscan/mpc5xxx_can.c+17−20
@@ -43,14 +43,13 @@ struct mpc5xxx_can_data { · 42 unmodified lines
43};43};
44 44
45#ifdef CONFIG_PPC_MPC52xx45#ifdef CONFIG_PPC_MPC52xx
46static struct of_device_id __devinitdata mpc52xx_cdm_ids[] = {46static struct of_device_id mpc52xx_cdm_ids[] = {
47 { .compatible = "fsl,mpc5200-cdm", },47 { .compatible = "fsl,mpc5200-cdm", },
48 {}48 {}
49};49};
50 50
51static u32 __devinit mpc52xx_can_get_clock(struct platform_device *ofdev,51static u32 mpc52xx_can_get_clock(struct platform_device *ofdev,
52 const char *clock_name,52 const char *clock_name, int *mscan_clksrc)
53 int *mscan_clksrc)
54{53{
55 unsigned int pvr;54 unsigned int pvr;
56 struct mpc52xx_cdm __iomem *cdm;55 struct mpc52xx_cdm __iomem *cdm;
@@ -101,9 +100,8 @@ static u32 __devinit mpc52xx_can_get_clock(struct platform_device *ofdev, · 44 unmodified lines
101 return freq;100 return freq;
102}101}
103#else /* !CONFIG_PPC_MPC52xx */102#else /* !CONFIG_PPC_MPC52xx */
104static u32 __devinit mpc52xx_can_get_clock(struct platform_device *ofdev,103static u32 mpc52xx_can_get_clock(struct platform_device *ofdev,
105 const char *clock_name,104 const char *clock_name, int *mscan_clksrc)
106 int *mscan_clksrc)
107{105{
108 return 0;106 return 0;
109}107}
@@ -124,14 +122,13 @@ struct mpc512x_clockctl { · 14 unmodified lines
124 u32 mccr[4]; /* MSCAN Clk Ctrl Reg 1-3 */122 u32 mccr[4]; /* MSCAN Clk Ctrl Reg 1-3 */
125};123};
126 124
127static struct of_device_id __devinitdata mpc512x_clock_ids[] = {125static struct of_device_id mpc512x_clock_ids[] = {
128 { .compatible = "fsl,mpc5121-clock", },126 { .compatible = "fsl,mpc5121-clock", },
129 {}127 {}
130};128};
131 129
132static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,130static u32 mpc512x_can_get_clock(struct platform_device *ofdev,
133 const char *clock_name,131 const char *clock_name, int *mscan_clksrc)
134 int *mscan_clksrc)
135{132{
136 struct mpc512x_clockctl __iomem *clockctl;133 struct mpc512x_clockctl __iomem *clockctl;
137 struct device_node *np_clock;134 struct device_node *np_clock;
@@ -239,16 +236,15 @@ exit_put: · 101 unmodified lines
239 return freq;236 return freq;
240}237}
241#else /* !CONFIG_PPC_MPC512x */238#else /* !CONFIG_PPC_MPC512x */
242static u32 __devinit mpc512x_can_get_clock(struct platform_device *ofdev,239static u32 mpc512x_can_get_clock(struct platform_device *ofdev,
243 const char *clock_name,240 const char *clock_name, int *mscan_clksrc)
244 int *mscan_clksrc)
245{241{
246 return 0;242 return 0;
247}243}
248#endif /* CONFIG_PPC_MPC512x */244#endif /* CONFIG_PPC_MPC512x */
249 245
250static const struct of_device_id mpc5xxx_can_table[];246static const struct of_device_id mpc5xxx_can_table[];
251static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)247static int mpc5xxx_can_probe(struct platform_device *ofdev)
252{248{
253 const struct of_device_id *match;249 const struct of_device_id *match;
254 const struct mpc5xxx_can_data *data;250 const struct mpc5xxx_can_data *data;
@@ -323,7 +319,7 @@ exit_unmap_mem: · 68 unmodified lines
323 return err;319 return err;
324}320}
325 321
326static int __devexit mpc5xxx_can_remove(struct platform_device *ofdev)322static int mpc5xxx_can_remove(struct platform_device *ofdev)
327{323{
328 struct net_device *dev = dev_get_drvdata(&ofdev->dev);324 struct net_device *dev = dev_get_drvdata(&ofdev->dev);
329 struct mscan_priv *priv = netdev_priv(dev);325 struct mscan_priv *priv = netdev_priv(dev);
@@ -380,22 +376,23 @@ static int mpc5xxx_can_resume(struct platform_device *ofdev) · 50 unmodified lines
380}376}
381#endif377#endif
382 378
383static const struct mpc5xxx_can_data __devinitconst mpc5200_can_data = {379static const struct mpc5xxx_can_data mpc5200_can_data = {
384 .type = MSCAN_TYPE_MPC5200,380 .type = MSCAN_TYPE_MPC5200,
385 .get_clock = mpc52xx_can_get_clock,381 .get_clock = mpc52xx_can_get_clock,
386};382};
387 383
388static const struct mpc5xxx_can_data __devinitconst mpc5121_can_data = {384static const struct mpc5xxx_can_data mpc5121_can_data = {
389 .type = MSCAN_TYPE_MPC5121,385 .type = MSCAN_TYPE_MPC5121,
390 .get_clock = mpc512x_can_get_clock,386 .get_clock = mpc512x_can_get_clock,
391};387};
392 388
393static const struct of_device_id __devinitconst mpc5xxx_can_table[] = {389static const struct of_device_id mpc5xxx_can_table[] = {
394 { .compatible = "fsl,mpc5200-mscan", .data = &mpc5200_can_data, },390 { .compatible = "fsl,mpc5200-mscan", .data = &mpc5200_can_data, },
395 /* Note that only MPC5121 Rev. 2 (and later) is supported */391 /* Note that only MPC5121 Rev. 2 (and later) is supported */
396 { .compatible = "fsl,mpc5121-mscan", .data = &mpc5121_can_data, },392 { .compatible = "fsl,mpc5121-mscan", .data = &mpc5121_can_data, },
397 {},393 {},
398};394};
395MODULE_DEVICE_TABLE(of, mpc5xxx_can_table);
399 396
400static struct platform_driver mpc5xxx_can_driver = {397static struct platform_driver mpc5xxx_can_driver = {
401 .driver = {398 .driver = {
@@ -404,7 +401,7 @@ static struct platform_driver mpc5xxx_can_driver = { · 2 unmodified lines
404 .of_match_table = mpc5xxx_can_table,401 .of_match_table = mpc5xxx_can_table,
405 },402 },
406 .probe = mpc5xxx_can_probe,403 .probe = mpc5xxx_can_probe,
407 .remove = __devexit_p(mpc5xxx_can_remove),404 .remove = mpc5xxx_can_remove,
408#ifdef CONFIG_PM405#ifdef CONFIG_PM
409 .suspend = mpc5xxx_can_suspend,406 .suspend = mpc5xxx_can_suspend,
410 .resume = mpc5xxx_can_resume,407 .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
517 517
518static int mscan_do_set_mode(struct net_device *dev, enum can_mode mode)518static int mscan_do_set_mode(struct net_device *dev, enum can_mode mode)
519{519{
520 struct mscan_priv *priv = netdev_priv(dev);
521 int ret = 0;520 int ret = 0;
522 521
523 if (!priv->open_time)
524 return -EINVAL;
525
526 switch (mode) {522 switch (mode) {
527 case CAN_MODE_START:523 case CAN_MODE_START:
528 ret = mscan_restart(dev);524 ret = mscan_restart(dev);
@@ -590,8 +586,6 @@ static int mscan_open(struct net_device *dev) · 61 unmodified lines
590 goto exit_napi_disable;586 goto exit_napi_disable;
591 }587 }
592 588
593 priv->open_time = jiffies;
594
595 if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)589 if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
596 setbits8(&regs->canctl1, MSCAN_LISTEN);590 setbits8(&regs->canctl1, MSCAN_LISTEN);
597 else591 else
@@ -606,7 +600,6 @@ static int mscan_open(struct net_device *dev) · 8 unmodified lines
606 return 0;600 return 0;
607 601
608exit_free_irq:602exit_free_irq:
609 priv->open_time = 0;
610 free_irq(dev->irq, dev);603 free_irq(dev->irq, dev);
611exit_napi_disable:604exit_napi_disable:
612 napi_disable(&priv->napi);605 napi_disable(&priv->napi);
@@ -627,7 +620,6 @@ static int mscan_close(struct net_device *dev) · 14 unmodified lines
627 mscan_set_mode(dev, MSCAN_INIT_MODE);620 mscan_set_mode(dev, MSCAN_INIT_MODE);
628 close_candev(dev);621 close_candev(dev);
629 free_irq(dev->irq, dev);622 free_irq(dev->irq, dev);
630 priv->open_time = 0;
631 623
632 return 0;624 return 0;
633}625}
drivers/net/can/mscan/mscan.h+0−1
@@ -281,7 +281,6 @@ struct tx_queue_entry { · 280 unmodified lines
281struct mscan_priv {281struct mscan_priv {
282 struct can_priv can; /* must be the first member */282 struct can_priv can; /* must be the first member */
283 unsigned int type; /* MSCAN type variants */283 unsigned int type; /* MSCAN type variants */
284 long open_time;
285 unsigned long flags;284 unsigned long flags;
286 void __iomem *reg_base; /* ioremap'ed address to registers */285 void __iomem *reg_base; /* ioremap'ed address to registers */
287 u8 shadow_statflg;286 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
954 .ndo_start_xmit = pch_xmit,954 .ndo_start_xmit = pch_xmit,
955};955};
956 956
957static void __devexit pch_can_remove(struct pci_dev *pdev)957static void pch_can_remove(struct pci_dev *pdev)
958{958{
959 struct net_device *ndev = pci_get_drvdata(pdev);959 struct net_device *ndev = pci_get_drvdata(pdev);
960 struct pch_can_priv *priv = netdev_priv(ndev);960 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
1178 return 0;1178 return 0;
1179}1179}
1180 1180
1181static int __devinit pch_can_probe(struct pci_dev *pdev,1181static int pch_can_probe(struct pci_dev *pdev,
1182 const struct pci_device_id *id)1182 const struct pci_device_id *id)
1183{1183{
1184 struct net_device *ndev;1184 struct net_device *ndev;
@@ -1269,7 +1269,7 @@ static struct pci_driver pch_can_pci_driver = { · 84 unmodified lines
1269 .name = "pch_can",1269 .name = "pch_can",
1270 .id_table = pch_pci_tbl,1270 .id_table = pch_pci_tbl,
1271 .probe = pch_can_probe,1271 .probe = pch_can_probe,
1272 .remove = __devexit_p(pch_can_remove),1272 .remove = pch_can_remove,
1273 .suspend = pch_can_suspend,1273 .suspend = pch_can_suspend,
1274 .resume = pch_can_resume,1274 .resume = pch_can_resume,
1275};1275};
drivers/net/can/sja1000/Kconfig+2−1
@@ -21,7 +21,7 @@ config CAN_SJA1000_PLATFORM · 20 unmodified lines
21 21
22config CAN_SJA1000_OF_PLATFORM22config CAN_SJA1000_OF_PLATFORM
23 tristate "Generic OF Platform Bus based SJA1000 driver"23 tristate "Generic OF Platform Bus based SJA1000 driver"
24 depends on PPC_OF24 depends on OF
25 ---help---25 ---help---
26 This driver adds support for the SJA1000 chips connected to26 This driver adds support for the SJA1000 chips connected to
27 the OpenFirmware "platform bus" found on embedded systems with27 the OpenFirmware "platform bus" found on embedded systems with
@@ -93,6 +93,7 @@ config CAN_PLX_PCI · 65 unmodified lines
93 - Marathon CAN-bus-PCI card (http://www.marathon.ru/)93 - Marathon CAN-bus-PCI card (http://www.marathon.ru/)
94 - TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)94 - TEWS TECHNOLOGIES TPMC810 card (http://www.tews.com/)
95 - IXXAT Automation PC-I 04/PCI card (http://www.ixxat.com/)95 - 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)
96 97
97config CAN_TSCAN198config CAN_TSCAN1
98 tristate "TS-CAN1 PC104 boards"99 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
220 * Probe PCI device for EMS CAN signature and register each available220 * Probe PCI device for EMS CAN signature and register each available
221 * CAN channel to SJA1000 Socket-CAN subsystem.221 * CAN channel to SJA1000 Socket-CAN subsystem.
222 */222 */
223static int __devinit ems_pci_add_card(struct pci_dev *pdev,223static int ems_pci_add_card(struct pci_dev *pdev,
224 const struct pci_device_id *ent)224 const struct pci_device_id *ent)
225{225{
226 struct sja1000_priv *priv;226 struct sja1000_priv *priv;
227 struct net_device *dev;227 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
166 * Probe PCI device for EMS CAN signature and register each available166 * Probe PCI device for EMS CAN signature and register each available
167 * CAN channel to SJA1000 Socket-CAN subsystem.167 * CAN channel to SJA1000 Socket-CAN subsystem.
168 */168 */
169static int __devinit ems_pcmcia_add_card(struct pcmcia_device *pdev,169static int ems_pcmcia_add_card(struct pcmcia_device *pdev, unsigned long base)
170 unsigned long base)
171{170{
172 struct sja1000_priv *priv;171 struct sja1000_priv *priv;
173 struct net_device *dev;172 struct net_device *dev;
@@ -256,7 +255,7 @@ failure_cleanup: · 82 unmodified lines
256/*255/*
257 * Setup PCMCIA socket and probe for EMS CPC-CARD256 * Setup PCMCIA socket and probe for EMS CPC-CARD
258 */257 */
259static int __devinit ems_pcmcia_probe(struct pcmcia_device *dev)258static int ems_pcmcia_probe(struct pcmcia_device *dev)
260{259{
261 int csval;260 int csval;
262 261
drivers/net/can/sja1000/kvaser_pci.c+4−4
@@ -290,8 +290,8 @@ failure: · 289 unmodified lines
290 return err;290 return err;
291}291}
292 292
293static int __devinit kvaser_pci_init_one(struct pci_dev *pdev,293static int kvaser_pci_init_one(struct pci_dev *pdev,
294 const struct pci_device_id *ent)294 const struct pci_device_id *ent)
295{295{
296 int err;296 int err;
297 struct net_device *master_dev = NULL;297 struct net_device *master_dev = NULL;
@@ -379,7 +379,7 @@ failure: · 81 unmodified lines
379 379
380}380}
381 381
382static void __devexit kvaser_pci_remove_one(struct pci_dev *pdev)382static void kvaser_pci_remove_one(struct pci_dev *pdev)
383{383{
384 struct net_device *dev = pci_get_drvdata(pdev);384 struct net_device *dev = pci_get_drvdata(pdev);
385 385
@@ -394,7 +394,7 @@ static struct pci_driver kvaser_pci_driver = { · 8 unmodified lines
394 .name = DRV_NAME,394 .name = DRV_NAME,
395 .id_table = kvaser_pci_tbl,395 .id_table = kvaser_pci_tbl,
396 .probe = kvaser_pci_init_one,396 .probe = kvaser_pci_init_one,
397 .remove = __devexit_p(kvaser_pci_remove_one),397 .remove = kvaser_pci_remove_one,
398};398};
399 399
400module_pci_driver(kvaser_pci_driver);400module_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
551 writew(chan->icr_mask, chan->cfg_base + PITA_ICR);551 writew(chan->icr_mask, chan->cfg_base + PITA_ICR);
552}552}
553 553
554static int __devinit peak_pci_probe(struct pci_dev *pdev,554static int peak_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
555 const struct pci_device_id *ent)
556{555{
557 struct sja1000_priv *priv;556 struct sja1000_priv *priv;
558 struct peak_pci_chan *chan;557 struct peak_pci_chan *chan;
@@ -717,7 +716,7 @@ failure_disable_pci: · 158 unmodified lines
717 return err;716 return err;
718}717}
719 718
720static void __devexit peak_pci_remove(struct pci_dev *pdev)719static void peak_pci_remove(struct pci_dev *pdev)
721{720{
722 struct net_device *dev = pci_get_drvdata(pdev); /* Last device */721 struct net_device *dev = pci_get_drvdata(pdev); /* Last device */
723 struct sja1000_priv *priv = netdev_priv(dev);722 struct sja1000_priv *priv = netdev_priv(dev);
@@ -757,7 +756,7 @@ static struct pci_driver peak_pci_driver = { · 33 unmodified lines
757 .name = DRV_NAME,756 .name = DRV_NAME,
758 .id_table = peak_pci_tbl,757 .id_table = peak_pci_tbl,
759 .probe = peak_pci_probe,758 .probe = peak_pci_probe,
760 .remove = __devexit_p(peak_pci_remove),759 .remove = peak_pci_remove,
761};760};
762 761
763module_pci_driver(peak_pci_driver);762module_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
632/*632/*
633 * setup PCMCIA socket and probe for PEAK-System PC-CARD633 * setup PCMCIA socket and probe for PEAK-System PC-CARD
634 */634 */
635static int __devinit pcan_probe(struct pcmcia_device *pdev)635static int pcan_probe(struct pcmcia_device *pdev)
636{636{
637 struct pcan_pccard *card;637 struct pcan_pccard *card;
638 int err;638 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
44 "esd CAN-PCI/CPCI/PCI104/200, "44 "esd CAN-PCI/CPCI/PCI104/200, "
45 "esd CAN-PCI/PMC/266, "45 "esd CAN-PCI/PMC/266, "
46 "esd CAN-PCIe/2000, "46 "esd CAN-PCIe/2000, "
47 "Connect Tech Inc. CANpro/104-Plus Opto (CRG001), "
47 "IXXAT PC-I 04/PCI")48 "IXXAT PC-I 04/PCI")
48MODULE_LICENSE("GPL v2");49MODULE_LICENSE("GPL v2");
49 50
@@ -131,6 +132,9 @@ struct plx_pci_card { · 81 unmodified lines
131#define TEWS_PCI_VENDOR_ID 0x1498132#define TEWS_PCI_VENDOR_ID 0x1498
132#define TEWS_PCI_DEVICE_ID_TMPC810 0x032A133#define TEWS_PCI_DEVICE_ID_TMPC810 0x032A
133 134
135#define CTI_PCI_VENDOR_ID 0x12c4
136#define CTI_PCI_DEVICE_ID_CRG001 0x0900
137
134static void plx_pci_reset_common(struct pci_dev *pdev);138static void plx_pci_reset_common(struct pci_dev *pdev);
135static void plx_pci_reset_marathon(struct pci_dev *pdev);139static void plx_pci_reset_marathon(struct pci_dev *pdev);
136static void plx9056_pci_reset_common(struct pci_dev *pdev);140static void plx9056_pci_reset_common(struct pci_dev *pdev);
@@ -158,7 +162,7 @@ struct plx_pci_card_info { · 21 unmodified lines
158 void (*reset_func)(struct pci_dev *pdev);162 void (*reset_func)(struct pci_dev *pdev);
159};163};
160 164
161static struct plx_pci_card_info plx_pci_card_info_adlink __devinitdata = {165static struct plx_pci_card_info plx_pci_card_info_adlink = {
162 "Adlink PCI-7841/cPCI-7841", 2,166 "Adlink PCI-7841/cPCI-7841", 2,
163 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,167 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
164 {1, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x80, 0x80} },168 {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
166 /* based on PLX9052 */170 /* based on PLX9052 */
167};171};
168 172
169static struct plx_pci_card_info plx_pci_card_info_adlink_se __devinitdata = {173static struct plx_pci_card_info plx_pci_card_info_adlink_se = {
170 "Adlink PCI-7841/cPCI-7841 SE", 2,174 "Adlink PCI-7841/cPCI-7841 SE", 2,
171 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,175 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
172 {0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x80, 0x80} },176 {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
174 /* based on PLX9052 */178 /* based on PLX9052 */
175};179};
176 180
177static struct plx_pci_card_info plx_pci_card_info_esd200 __devinitdata = {181static struct plx_pci_card_info plx_pci_card_info_esd200 = {
178 "esd CAN-PCI/CPCI/PCI104/200", 2,182 "esd CAN-PCI/CPCI/PCI104/200", 2,
179 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,183 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
180 {0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },184 {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
182 /* based on PLX9030/9050 */186 /* based on PLX9030/9050 */
183};187};
184 188
185static struct plx_pci_card_info plx_pci_card_info_esd266 __devinitdata = {189static struct plx_pci_card_info plx_pci_card_info_esd266 = {
186 "esd CAN-PCI/PMC/266", 2,190 "esd CAN-PCI/PMC/266", 2,
187 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,191 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
188 {0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },192 {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
190 /* based on PLX9056 */194 /* based on PLX9056 */
191};195};
192 196
193static struct plx_pci_card_info plx_pci_card_info_esd2000 __devinitdata = {197static struct plx_pci_card_info plx_pci_card_info_esd2000 = {
194 "esd CAN-PCIe/2000", 2,198 "esd CAN-PCIe/2000", 2,
195 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,199 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
196 {0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x100, 0x80} },200 {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
198 /* based on PEX8311 */202 /* based on PEX8311 */
199};203};
200 204
201static struct plx_pci_card_info plx_pci_card_info_ixxat __devinitdata = {205static struct plx_pci_card_info plx_pci_card_info_ixxat = {
202 "IXXAT PC-I 04/PCI", 2,206 "IXXAT PC-I 04/PCI", 2,
203 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,207 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
204 {0, 0x00, 0x00}, { {2, 0x00, 0x80}, {2, 0x200, 0x80} },208 {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
206 /* based on PLX9050 */210 /* based on PLX9050 */
207};211};
208 212
209static struct plx_pci_card_info plx_pci_card_info_marathon __devinitdata = {213static struct plx_pci_card_info plx_pci_card_info_marathon = {
210 "Marathon CAN-bus-PCI", 2,214 "Marathon CAN-bus-PCI", 2,
211 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,215 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
212 {0, 0x00, 0x00}, { {2, 0x00, 0x00}, {4, 0x00, 0x00} },216 {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
214 /* based on PLX9052 */218 /* based on PLX9052 */
215};219};
216 220
217static struct plx_pci_card_info plx_pci_card_info_tews __devinitdata = {221static struct plx_pci_card_info plx_pci_card_info_tews = {
218 "TEWS TECHNOLOGIES TPMC810", 2,222 "TEWS TECHNOLOGIES TPMC810", 2,
219 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,223 PLX_PCI_CAN_CLOCK, PLX_PCI_OCR, PLX_PCI_CDR,
220 {0, 0x00, 0x00}, { {2, 0x000, 0x80}, {2, 0x100, 0x80} },224 {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
222 /* based on PLX9030 */226 /* based on PLX9030 */
223};227};
224 228
229static 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
225static DEFINE_PCI_DEVICE_TABLE(plx_pci_tbl) = {237static DEFINE_PCI_DEVICE_TABLE(plx_pci_tbl) = {
226 {238 {
227 /* Adlink PCI-7841/cPCI-7841 */239 /* Adlink PCI-7841/cPCI-7841 */
@@ -300,6 +312,13 @@ static DEFINE_PCI_DEVICE_TABLE(plx_pci_tbl) = { · 72 unmodified lines
300 0, 0,312 0, 0,
301 (kernel_ulong_t)&plx_pci_card_info_tews313 (kernel_ulong_t)&plx_pci_card_info_tews
302 },314 },
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 },
303 { 0,}322 { 0,}
304};323};
305MODULE_DEVICE_TABLE(pci, plx_pci_tbl);324MODULE_DEVICE_TABLE(pci, plx_pci_tbl);
@@ -465,8 +484,8 @@ static void plx_pci_del_card(struct pci_dev *pdev) · 159 unmodified lines
465 * Probe PLX90xx based device for the SJA1000 chips and register each484 * Probe PLX90xx based device for the SJA1000 chips and register each
466 * available CAN channel to SJA1000 Socket-CAN subsystem.485 * available CAN channel to SJA1000 Socket-CAN subsystem.
467 */486 */
468static int __devinit plx_pci_add_card(struct pci_dev *pdev,487static int plx_pci_add_card(struct pci_dev *pdev,
469 const struct pci_device_id *ent)488 const struct pci_device_id *ent)
470{489{
471 struct sja1000_priv *priv;490 struct sja1000_priv *priv;
472 struct net_device *dev;491 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
188 188
189static int sja1000_set_mode(struct net_device *dev, enum can_mode mode)189static int sja1000_set_mode(struct net_device *dev, enum can_mode mode)
190{190{
191 struct sja1000_priv *priv = netdev_priv(dev);
192
193 if (!priv->open_time)
194 return -EINVAL;
195
196 switch (mode) {191 switch (mode) {
197 case CAN_MODE_START:192 case CAN_MODE_START:
198 sja1000_start(dev);193 sja1000_start(dev);
@@ -579,7 +574,6 @@ static int sja1000_open(struct net_device *dev) · 380 unmodified lines
579 574
580 /* init and start chi */575 /* init and start chi */
581 sja1000_start(dev);576 sja1000_start(dev);
582 priv->open_time = jiffies;
583 577
584 netif_start_queue(dev);578 netif_start_queue(dev);
585 579
@@ -598,8 +592,6 @@ static int sja1000_close(struct net_device *dev) · 12 unmodified lines
598 592
599 close_candev(dev);593 close_candev(dev);
600 594
601 priv->open_time = 0;
602
603 return 0;595 return 0;
604}596}
605 597
drivers/net/can/sja1000/sja1000.h+0−1
@@ -152,7 +152,6 @@ · 151 unmodified lines
152 */152 */
153struct sja1000_priv {153struct sja1000_priv {
154 struct can_priv can; /* must be the first member */154 struct can_priv can; /* must be the first member */
155 int open_time;
156 struct sk_buff *echo_skb;155 struct sk_buff *echo_skb;
157 156
158 /* the lower-layer is responsible for appropriate locking */157 /* 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
42 42
43static unsigned long port[MAXDEV];43static unsigned long port[MAXDEV];
44static unsigned long mem[MAXDEV];44static unsigned long mem[MAXDEV];
45static int __devinitdata irq[MAXDEV];45static int irq[MAXDEV];
46static int __devinitdata clk[MAXDEV];46static int clk[MAXDEV];
47static unsigned char __devinitdata cdr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};47static unsigned char cdr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
48static unsigned char __devinitdata ocr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};48static unsigned char ocr[MAXDEV] = {[0 ... (MAXDEV - 1)] = 0xff};
49static int __devinitdata indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};49static int indirect[MAXDEV] = {[0 ... (MAXDEV - 1)] = -1};
50 50
51module_param_array(port, ulong, NULL, S_IRUGO);51module_param_array(port, ulong, NULL, S_IRUGO);
52MODULE_PARM_DESC(port, "I/O port number");52MODULE_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
117 outb(val, base + 1);117 outb(val, base + 1);
118}118}
119 119
120static int __devinit sja1000_isa_probe(struct platform_device *pdev)120static int sja1000_isa_probe(struct platform_device *pdev)
121{121{
122 struct net_device *dev;122 struct net_device *dev;
123 struct sja1000_priv *priv;123 struct sja1000_priv *priv;
@@ -223,7 +223,7 @@ static int __devinit sja1000_isa_probe(struct platform_device *pdev) · 99 unmodified lines
223 return err;223 return err;
224}224}
225 225
226static int __devexit sja1000_isa_remove(struct platform_device *pdev)226static int sja1000_isa_remove(struct platform_device *pdev)
227{227{
228 struct net_device *dev = dev_get_drvdata(&pdev->dev);228 struct net_device *dev = dev_get_drvdata(&pdev->dev);
229 struct sja1000_priv *priv = netdev_priv(dev);229 struct sja1000_priv *priv = netdev_priv(dev);
@@ -248,7 +248,7 @@ static int __devexit sja1000_isa_remove(struct platform_device *pdev) · 18 unmodified lines
248 248
249static struct platform_driver sja1000_isa_driver = {249static struct platform_driver sja1000_isa_driver = {
250 .probe = sja1000_isa_probe,250 .probe = sja1000_isa_probe,
251 .remove = __devexit_p(sja1000_isa_remove),251 .remove = sja1000_isa_remove,
252 .driver = {252 .driver = {
253 .name = DRV_NAME,253 .name = DRV_NAME,
254 .owner = THIS_MODULE,254 .owner = THIS_MODULE,
drivers/net/can/sja1000/sja1000_of_platform.c+8−6
@@ -42,6 +42,8 @@ · 41 unmodified lines
42#include <linux/can/dev.h>42#include <linux/can/dev.h>
43 43
44#include <linux/of_platform.h>44#include <linux/of_platform.h>
45#include <linux/of_address.h>
46#include <linux/of_irq.h>
45#include <asm/prom.h>47#include <asm/prom.h>
46 48
47#include "sja1000.h"49#include "sja1000.h"
@@ -59,16 +61,16 @@ MODULE_LICENSE("GPL v2"); · 11 unmodified lines
59 61
60static u8 sja1000_ofp_read_reg(const struct sja1000_priv *priv, int reg)62static u8 sja1000_ofp_read_reg(const struct sja1000_priv *priv, int reg)
61{63{
62 return in_8(priv->reg_base + reg);64 return ioread8(priv->reg_base + reg);
63}65}
64 66
65static void sja1000_ofp_write_reg(const struct sja1000_priv *priv,67static void sja1000_ofp_write_reg(const struct sja1000_priv *priv,
66 int reg, u8 val)68 int reg, u8 val)
67{69{
68 out_8(priv->reg_base + reg, val);70 iowrite8(val, priv->reg_base + reg);
69}71}
70 72
71static int __devexit sja1000_ofp_remove(struct platform_device *ofdev)73static int sja1000_ofp_remove(struct platform_device *ofdev)
72{74{
73 struct net_device *dev = dev_get_drvdata(&ofdev->dev);75 struct net_device *dev = dev_get_drvdata(&ofdev->dev);
74 struct sja1000_priv *priv = netdev_priv(dev);76 struct sja1000_priv *priv = netdev_priv(dev);
@@ -88,7 +90,7 @@ static int __devexit sja1000_ofp_remove(struct platform_device *ofdev) · 13 unmodified lines
88 return 0;90 return 0;
89}91}
90 92
91static int __devinit sja1000_ofp_probe(struct platform_device *ofdev)93static int sja1000_ofp_probe(struct platform_device *ofdev)
92{94{
93 struct device_node *np = ofdev->dev.of_node;95 struct device_node *np = ofdev->dev.of_node;
94 struct net_device *dev;96 struct net_device *dev;
@@ -204,7 +206,7 @@ exit_release_mem: · 109 unmodified lines
204 return err;206 return err;
205}207}
206 208
207static struct of_device_id __devinitdata sja1000_ofp_table[] = {209static struct of_device_id sja1000_ofp_table[] = {
208 {.compatible = "nxp,sja1000"},210 {.compatible = "nxp,sja1000"},
209 {},211 {},
210};212};
@@ -217,7 +219,7 @@ static struct platform_driver sja1000_ofp_driver = { · 6 unmodified lines
217 .of_match_table = sja1000_ofp_table,219 .of_match_table = sja1000_ofp_table,
218 },220 },
219 .probe = sja1000_ofp_probe,221 .probe = sja1000_ofp_probe,
220 .remove = __devexit_p(sja1000_ofp_remove),222 .remove = sja1000_ofp_remove,
221};223};
222 224
223module_platform_driver(sja1000_ofp_driver);225module_platform_driver(sja1000_ofp_driver);
drivers/net/can/sja1000/sja1000_platform.c+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
34 34
35MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");35MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
36MODULE_DESCRIPTION("Socket-CAN driver for SJA1000 on the platform bus");36MODULE_DESCRIPTION("Socket-CAN driver for SJA1000 on the platform bus");
37MODULE_ALIAS("platform:" DRV_NAME);
37MODULE_LICENSE("GPL v2");38MODULE_LICENSE("GPL v2");
38 39
39static u8 sp_read_reg8(const struct sja1000_priv *priv, int reg)40static 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
71#define TSCAN1_SJA1000_XTAL 1600000071#define TSCAN1_SJA1000_XTAL 16000000
72 72
73/* SJA1000 IO base addresses */73/* SJA1000 IO base addresses */
74static const unsigned short tscan1_sja1000_addresses[] __devinitconst = {74static const unsigned short tscan1_sja1000_addresses[] = {
75 0x100, 0x120, 0x180, 0x1a0, 0x200, 0x240, 0x280, 0x32075 0x100, 0x120, 0x180, 0x1a0, 0x200, 0x240, 0x280, 0x320
76};76};
77 77
@@ -88,7 +88,7 @@ static void tscan1_write(const struct sja1000_priv *priv, int reg, u8 val) · 10 unmodified lines
88}88}
89 89
90/* Probe for a TS-CAN1 board with JP2:JP1 jumper setting ID */90/* Probe for a TS-CAN1 board with JP2:JP1 jumper setting ID */
91static int __devinit tscan1_probe(struct device *dev, unsigned id)91static int tscan1_probe(struct device *dev, unsigned id)
92{92{
93 struct net_device *netdev;93 struct net_device *netdev;
94 struct sja1000_priv *priv;94 struct sja1000_priv *priv;
@@ -171,7 +171,7 @@ static int __devinit tscan1_probe(struct device *dev, unsigned id) · 76 unmodified lines
171 return -ENXIO;171 return -ENXIO;
172}172}
173 173
174static int __devexit tscan1_remove(struct device *dev, unsigned id /*unused*/)174static int tscan1_remove(struct device *dev, unsigned id /*unused*/)
175{175{
176 struct net_device *netdev;176 struct net_device *netdev;
177 struct sja1000_priv *priv;177 struct sja1000_priv *priv;
@@ -197,7 +197,7 @@ static int __devexit tscan1_remove(struct device *dev, unsigned id /*unused*/) · 19 unmodified lines
197 197
198static struct isa_driver tscan1_isa_driver = {198static struct isa_driver tscan1_isa_driver = {
199 .probe = tscan1_probe,199 .probe = tscan1_probe,
200 .remove = __devexit_p(tscan1_remove),200 .remove = tscan1_remove,
201 .driver = {201 .driver = {
202 .name = "tscan1",202 .name = "tscan1",
203 },203 },
drivers/net/can/softing/softing_cs.c+5−6
@@ -159,7 +159,7 @@ MODULE_FIRMWARE(fw_dir "bcard2.bin"); · 158 unmodified lines
159MODULE_FIRMWARE(fw_dir "ldcard2.bin");159MODULE_FIRMWARE(fw_dir "ldcard2.bin");
160MODULE_FIRMWARE(fw_dir "cancrd2.bin");160MODULE_FIRMWARE(fw_dir "cancrd2.bin");
161 161
162static __devinit const struct softing_platform_data162static const struct softing_platform_data
163*softingcs_find_platform_data(unsigned int manf, unsigned int prod)163*softingcs_find_platform_data(unsigned int manf, unsigned int prod)
164{164{
165 const struct softing_platform_data *lp;165 const struct softing_platform_data *lp;
@@ -193,8 +193,7 @@ static int softingcs_enable_irq(struct platform_device *pdev, int v) · 27 unmodified lines
193/*193/*
194 * pcmcia check194 * pcmcia check
195 */195 */
196static __devinit int softingcs_probe_config(struct pcmcia_device *pcmcia,196static int softingcs_probe_config(struct pcmcia_device *pcmcia, void *priv_data)
197 void *priv_data)
198{197{
199 struct softing_platform_data *pdat = priv_data;198 struct softing_platform_data *pdat = priv_data;
200 struct resource *pres;199 struct resource *pres;
@@ -215,7 +214,7 @@ static __devinit int softingcs_probe_config(struct pcmcia_device *pcmcia, · 14 unmodified lines
215 return pcmcia_request_window(pcmcia, pres, memspeed);214 return pcmcia_request_window(pcmcia, pres, memspeed);
216}215}
217 216
218static __devexit void softingcs_remove(struct pcmcia_device *pcmcia)217static void softingcs_remove(struct pcmcia_device *pcmcia)
219{218{
220 struct platform_device *pdev = pcmcia->priv;219 struct platform_device *pdev = pcmcia->priv;
221 220
@@ -235,7 +234,7 @@ static void softingcs_pdev_release(struct device *dev) · 13 unmodified lines
235 kfree(pdev);234 kfree(pdev);
236}235}
237 236
238static __devinit int softingcs_probe(struct pcmcia_device *pcmcia)237static int softingcs_probe(struct pcmcia_device *pcmcia)
239{238{
240 int ret;239 int ret;
241 struct platform_device *pdev;240 struct platform_device *pdev;
@@ -338,7 +337,7 @@ static struct pcmcia_driver softingcs_driver = { · 96 unmodified lines
338 .name = "softingcs",337 .name = "softingcs",
339 .id_table = softingcs_ids,338 .id_table = softingcs_ids,
340 .probe = softingcs_probe,339 .probe = softingcs_probe,
341 .remove = __devexit_p(softingcs_remove),340 .remove = softingcs_remove,
342};341};
343 342
344static int __init softingcs_start(void)343static 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
478 mutex_unlock(&card->fw.lock);478 mutex_unlock(&card->fw.lock);
479}479}
480 480
481static __devinit int softing_card_boot(struct softing *card)481static int softing_card_boot(struct softing *card)
482{482{
483 int ret, j;483 int ret, j;
484 static const uint8_t stream[] = {484 static const uint8_t stream[] = {
@@ -645,8 +645,8 @@ static const struct can_bittiming_const softing_btr_const = { · 160 unmodified lines
645};645};
646 646
647 647
648static __devinit struct net_device *softing_netdev_create(struct softing *card,648static struct net_device *softing_netdev_create(struct softing *card,
649 uint16_t chip_id)649 uint16_t chip_id)
650{650{
651 struct net_device *netdev;651 struct net_device *netdev;
652 struct softing_priv *priv;652 struct softing_priv *priv;
@@ -676,7 +676,7 @@ static __devinit struct net_device *softing_netdev_create(struct softing *card, · 23 unmodified lines
676 return netdev;676 return netdev;
677}677}
678 678
679static __devinit int softing_netdev_register(struct net_device *netdev)679static int softing_netdev_register(struct net_device *netdev)
680{680{
681 int ret;681 int ret;
682 682
@@ -745,7 +745,7 @@ static const struct attribute_group softing_pdev_group = { · 62 unmodified lines
745/*745/*
746 * platform driver746 * platform driver
747 */747 */
748static __devexit int softing_pdev_remove(struct platform_device *pdev)748static int softing_pdev_remove(struct platform_device *pdev)
749{749{
750 struct softing *card = platform_get_drvdata(pdev);750 struct softing *card = platform_get_drvdata(pdev);
751 int j;751 int j;
@@ -766,7 +766,7 @@ static __devexit int softing_pdev_remove(struct platform_device *pdev) · 14 unmodified lines
766 return 0;766 return 0;
767}767}
768 768
769static __devinit int softing_pdev_probe(struct platform_device *pdev)769static int softing_pdev_probe(struct platform_device *pdev)
770{770{
771 const struct softing_platform_data *pdat = pdev->dev.platform_data;771 const struct softing_platform_data *pdat = pdev->dev.platform_data;
772 struct softing *card;772 struct softing *card;
@@ -871,7 +871,7 @@ static struct platform_driver softing_driver = { · 98 unmodified lines
871 .owner = THIS_MODULE,871 .owner = THIS_MODULE,
872 },872 },
873 .probe = softing_pdev_probe,873 .probe = softing_pdev_probe,
874 .remove = __devexit_p(softing_pdev_remove),874 .remove = softing_pdev_remove,
875};875};
876 876
877module_platform_driver(softing_driver);877module_platform_driver(softing_driver);
drivers/net/can/ti_hecc.c+3−2
@@ -978,7 +978,7 @@ probe_exit: · 977 unmodified lines
978 return err;978 return err;
979}979}
980 980
981static int __devexit ti_hecc_remove(struct platform_device *pdev)981static int ti_hecc_remove(struct platform_device *pdev)
982{982{
983 struct resource *res;983 struct resource *res;
984 struct net_device *ndev = platform_get_drvdata(pdev);984 struct net_device *ndev = platform_get_drvdata(pdev);
@@ -1045,7 +1045,7 @@ static struct platform_driver ti_hecc_driver = { · 60 unmodified lines
1045 .owner = THIS_MODULE,1045 .owner = THIS_MODULE,
1046 },1046 },
1047 .probe = ti_hecc_probe,1047 .probe = ti_hecc_probe,
1048 .remove = __devexit_p(ti_hecc_remove),1048 .remove = ti_hecc_remove,
1049 .suspend = ti_hecc_suspend,1049 .suspend = ti_hecc_suspend,
1050 .resume = ti_hecc_resume,1050 .resume = ti_hecc_resume,
1051};1051};
@@ -1055,3 +1055,4 @@ module_platform_driver(ti_hecc_driver); · 3 unmodified lines
1055MODULE_AUTHOR("Anant Gole <anantgole@ti.com>");1055MODULE_AUTHOR("Anant Gole <anantgole@ti.com>");
1056MODULE_LICENSE("GPL v2");1056MODULE_LICENSE("GPL v2");
1057MODULE_DESCRIPTION(DRV_DESC);1057MODULE_DESCRIPTION(DRV_DESC);
1058MODULE_ALIAS("platform:" DRV_NAME);
drivers/net/can/usb/Kconfig+29−0
@@ -13,6 +13,35 @@ config CAN_ESD_USB2 · 12 unmodified lines
13 This driver supports the CAN-USB/2 interface13 This driver supports the CAN-USB/2 interface
14 from esd electronic system design gmbh (http://www.esd.eu).14 from esd electronic system design gmbh (http://www.esd.eu).
15 15
16config 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
16config CAN_PEAK_USB45config CAN_PEAK_USB
17 tristate "PEAK PCAN-USB/USB Pro interfaces"46 tristate "PEAK PCAN-USB/USB Pro interfaces"
18 ---help---47 ---help---
drivers/net/can/usb/Makefile+1−0
@@ -4,6 +4,7 @@ · 3 unmodified lines
4 4
5obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o5obj-$(CONFIG_CAN_EMS_USB) += ems_usb.o
6obj-$(CONFIG_CAN_ESD_USB2) += esd_usb2.o6obj-$(CONFIG_CAN_ESD_USB2) += esd_usb2.o
7obj-$(CONFIG_CAN_KVASER_USB) += kvaser_usb.o
7obj-$(CONFIG_CAN_PEAK_USB) += peak_usb/8obj-$(CONFIG_CAN_PEAK_USB) += peak_usb/
8 9
9ccflags-$(CONFIG_CAN_DEBUG_DEVICES) := -DDEBUG10ccflags-$(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
245 245
246struct ems_usb {246struct ems_usb {
247 struct can_priv can; /* must be the first member */247 struct can_priv can; /* must be the first member */
248 int open_time;
249 248
250 struct sk_buff *echo_skb[MAX_TX_URBS];249 struct sk_buff *echo_skb[MAX_TX_URBS];
251 250
@@ -728,7 +727,6 @@ static int ems_usb_open(struct net_device *netdev) · 476 unmodified lines
728 return err;727 return err;
729 }728 }
730 729
731 dev->open_time = jiffies;
732 730
733 netif_start_queue(netdev);731 netif_start_queue(netdev);
734 732
@@ -878,8 +876,6 @@ static int ems_usb_close(struct net_device *netdev) · 143 unmodified lines
878 876
879 close_candev(netdev);877 close_candev(netdev);
880 878
881 dev->open_time = 0;
882
883 return 0;879 return 0;
884}880}
885 881
@@ -905,9 +901,6 @@ static int ems_usb_set_mode(struct net_device *netdev, enum can_mode mode) · 19 unmodified lines
905{901{
906 struct ems_usb *dev = netdev_priv(netdev);902 struct ems_usb *dev = netdev_priv(netdev);
907 903
908 if (!dev->open_time)
909 return -EINVAL;
910
911 switch (mode) {904 switch (mode) {
912 case CAN_MODE_START:905 case CAN_MODE_START:
913 if (ems_usb_write_mode(dev, SJA1000_MOD_NORMAL))906 if (ems_usb_write_mode(dev, SJA1000_MOD_NORMAL))
drivers/net/can/usb/esd_usb2.c+29−16
@@ -1,7 +1,7 @@
1/*1/*
2 * CAN driver for esd CAN-USB/22 * CAN driver for esd CAN-USB/2 and CAN-USB/Micro
3 *3 *
4 * Copyright (C) 2010 Matthias Fuchs <matthias.fuchs@esd.eu>, esd gmbh4 * Copyright (C) 2010-2012 Matthias Fuchs <matthias.fuchs@esd.eu>, esd gmbh
5 *5 *
6 * This program is free software; you can redistribute it and/or modify it6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published7 * under the terms of the GNU General Public License as published
@@ -28,14 +28,16 @@ · 20 unmodified lines
28#include <linux/can/error.h>28#include <linux/can/error.h>
29 29
30MODULE_AUTHOR("Matthias Fuchs <matthias.fuchs@esd.eu>");30MODULE_AUTHOR("Matthias Fuchs <matthias.fuchs@esd.eu>");
31MODULE_DESCRIPTION("CAN driver for esd CAN-USB/2 interfaces");31MODULE_DESCRIPTION("CAN driver for esd CAN-USB/2 and CAN-USB/Micro interfaces");
32MODULE_LICENSE("GPL v2");32MODULE_LICENSE("GPL v2");
33 33
34/* Define these values to match your devices */34/* Define these values to match your devices */
35#define USB_ESDGMBH_VENDOR_ID 0x0ab435#define USB_ESDGMBH_VENDOR_ID 0x0ab4
36#define USB_CANUSB2_PRODUCT_ID 0x001036#define USB_CANUSB2_PRODUCT_ID 0x0010
37#define USB_CANUSBM_PRODUCT_ID 0x0011
37 38
38#define ESD_USB2_CAN_CLOCK 6000000039#define ESD_USB2_CAN_CLOCK 60000000
40#define ESD_USBM_CAN_CLOCK 36000000
39#define ESD_USB2_MAX_NETS 241#define ESD_USB2_MAX_NETS 2
40 42
41/* USB2 commands */43/* USB2 commands */
@@ -69,6 +71,7 @@ MODULE_LICENSE("GPL v2"); · 27 unmodified lines
69#define ESD_USB2_TSEG2_SHIFT 2071#define ESD_USB2_TSEG2_SHIFT 20
70#define ESD_USB2_SJW_MAX 472#define ESD_USB2_SJW_MAX 4
71#define ESD_USB2_SJW_SHIFT 1473#define ESD_USB2_SJW_SHIFT 14
74#define ESD_USBM_SJW_SHIFT 24
72#define ESD_USB2_BRP_MIN 175#define ESD_USB2_BRP_MIN 1
73#define ESD_USB2_BRP_MAX 102476#define ESD_USB2_BRP_MAX 1024
74#define ESD_USB2_BRP_INC 177#define ESD_USB2_BRP_INC 1
@@ -183,6 +186,7 @@ struct __attribute__ ((packed)) esd_usb2_msg { · 108 unmodified lines
183 186
184static struct usb_device_id esd_usb2_table[] = {187static struct usb_device_id esd_usb2_table[] = {
185 {USB_DEVICE(USB_ESDGMBH_VENDOR_ID, USB_CANUSB2_PRODUCT_ID)},188 {USB_DEVICE(USB_ESDGMBH_VENDOR_ID, USB_CANUSB2_PRODUCT_ID)},
189 {USB_DEVICE(USB_ESDGMBH_VENDOR_ID, USB_CANUSBM_PRODUCT_ID)},
186 {}190 {}
187};191};
188MODULE_DEVICE_TABLE(usb, esd_usb2_table);192MODULE_DEVICE_TABLE(usb, esd_usb2_table);
@@ -213,7 +217,6 @@ struct esd_usb2_net_priv { · 24 unmodified lines
213 struct usb_anchor tx_submitted;217 struct usb_anchor tx_submitted;
214 struct esd_tx_urb_context tx_contexts[MAX_TX_URBS];218 struct esd_tx_urb_context tx_contexts[MAX_TX_URBS];
215 219
216 int open_time;
217 struct esd_usb2 *usb2;220 struct esd_usb2 *usb2;
218 struct net_device *netdev;221 struct net_device *netdev;
219 int index;222 int index;
@@ -691,8 +694,6 @@ static int esd_usb2_open(struct net_device *netdev) · 471 unmodified lines
691 return err;694 return err;
692 }695 }
693 696
694 priv->open_time = jiffies;
695
696 netif_start_queue(netdev);697 netif_start_queue(netdev);
697 698
698 return 0;699 return 0;
@@ -860,8 +861,6 @@ static int esd_usb2_close(struct net_device *netdev) · 161 unmodified lines
860 861
861 close_candev(netdev);862 close_candev(netdev);
862 863
863 priv->open_time = 0;
864
865 return 0;864 return 0;
866}865}
867 866
@@ -889,11 +888,22 @@ static int esd_usb2_set_bittiming(struct net_device *netdev) · 21 unmodified lines
889 struct can_bittiming *bt = &priv->can.bittiming;888 struct can_bittiming *bt = &priv->can.bittiming;
890 struct esd_usb2_msg msg;889 struct esd_usb2_msg msg;
891 u32 canbtr;890 u32 canbtr;
891 int sjw_shift;
892 892
893 canbtr = ESD_USB2_UBR;893 canbtr = ESD_USB2_UBR;
894 if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
895 canbtr |= ESD_USB2_LOM;
896
894 canbtr |= (bt->brp - 1) & (ESD_USB2_BRP_MAX - 1);897 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
895 canbtr |= ((bt->sjw - 1) & (ESD_USB2_SJW_MAX - 1))905 canbtr |= ((bt->sjw - 1) & (ESD_USB2_SJW_MAX - 1))
896 << ESD_USB2_SJW_SHIFT;906 << sjw_shift;
897 canbtr |= ((bt->prop_seg + bt->phase_seg1 - 1)907 canbtr |= ((bt->prop_seg + bt->phase_seg1 - 1)
898 & (ESD_USB2_TSEG1_MAX - 1))908 & (ESD_USB2_TSEG1_MAX - 1))
899 << ESD_USB2_TSEG1_SHIFT;909 << ESD_USB2_TSEG1_SHIFT;
@@ -926,11 +936,6 @@ static int esd_usb2_get_berr_counter(const struct net_device *netdev, · 26 unmodified lines
926 936
927static int esd_usb2_set_mode(struct net_device *netdev, enum can_mode mode)937static int esd_usb2_set_mode(struct net_device *netdev, enum can_mode mode)
928{938{
929 struct esd_usb2_net_priv *priv = netdev_priv(netdev);
930
931 if (!priv->open_time)
932 return -EINVAL;
933
934 switch (mode) {939 switch (mode) {
935 case CAN_MODE_START:940 case CAN_MODE_START:
936 netif_wake_queue(netdev);941 netif_wake_queue(netdev);
@@ -971,12 +976,20 @@ static int esd_usb2_probe_one_net(struct usb_interface *intf, int index) · 34 unmodified lines
971 priv->index = index;976 priv->index = index;
972 977
973 priv->can.state = CAN_STATE_STOPPED;978 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
975 priv->can.bittiming_const = &esd_usb2_bittiming_const;989 priv->can.bittiming_const = &esd_usb2_bittiming_const;
976 priv->can.do_set_bittiming = esd_usb2_set_bittiming;990 priv->can.do_set_bittiming = esd_usb2_set_bittiming;
977 priv->can.do_set_mode = esd_usb2_set_mode;991 priv->can.do_set_mode = esd_usb2_set_mode;
978 priv->can.do_get_berr_counter = esd_usb2_get_berr_counter;992 priv->can.do_get_berr_counter = esd_usb2_get_berr_counter;
979 priv->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES;
980 993
981 netdev->flags |= IFF_ECHO; /* we support local echo */994 netdev->flags |= IFF_ECHO; /* we support local echo */
982 995
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
139struct kvaser_msg_simple {
140 u8 tid;
141 u8 channel;
142} __packed;
143
144struct 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
157struct kvaser_msg_cardinfo2 {
158 u8 tid;
159 u8 channel;
160 u8 pcb_id[24];
161 __le32 oem_unlock_code;
162} __packed;
163
164struct 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
173struct 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
183struct kvaser_msg_tx_can {
184 u8 channel;
185 u8 tid;
186 u8 msg[14];
187 u8 padding;
188 u8 flags;
189} __packed;
190
191struct kvaser_msg_rx_can {
192 u8 channel;
193 u8 flag;
194 __le16 time[3];
195 u8 msg[14];
196} __packed;
197
198struct 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
208struct kvaser_msg_tx_acknowledge {
209 u8 channel;
210 u8 tid;
211 __le16 time[3];
212 u8 flags;
213 u8 time_offset;
214} __packed;
215
216struct 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
228struct kvaser_msg_ctrl_mode {
229 u8 tid;
230 u8 channel;
231 u8 ctrl_mode;
232 u8 padding[3];
233} __packed;
234
235struct kvaser_msg_flush_queue {
236 u8 tid;
237 u8 channel;
238 u8 flags;
239 u8 padding[3];
240} __packed;
241
242struct 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
252struct 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
272struct kvaser_usb_tx_urb_context {
273 struct kvaser_usb_net_priv *priv;
274 u32 echo_index;
275 int dlc;
276};
277
278struct 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
293struct 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
309static 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};
359MODULE_DEVICE_TABLE(usb, kvaser_usb_table);
360
361static 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
373static 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
415end:
416 kfree(buf);
417
418 return err;
419}
420
421static 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
442static 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
460static 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
478static 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
535static 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
546static 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
595static 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
606static 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
767static 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
803static 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
861static 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
884static 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
901static 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
939static 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
974resubmit_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
997static 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
1066static 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
1091static 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
1109static 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
1137error:
1138 close_candev(netdev);
1139 return err;
1140}
1141
1142static 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
1161static 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
1179static 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
1199static 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
1224static 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
1245static 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
1357releasebuf:
1358 kfree(buf);
1359nobufmem:
1360 usb_free_urb(urb);
1361nourbmem:
1362 dev_kfree_skb(skb);
1363 return ret;
1364}
1365
1366static 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
1372static 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
1384static 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
1416static 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
1435static 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
1445static 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
1466static 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
1527static 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
1548static 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
1604static 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
1616static 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
1623module_usb_driver(kvaser_usb_driver);
1624
1625MODULE_AUTHOR("Olivier Sobrie <olivier@sobrie.be>");
1626MODULE_DESCRIPTION("CAN driver for Kvaser CAN/USB devices");
1627MODULE_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
520 return err;520 return err;
521 }521 }
522 522
523 dev->open_time = jiffies;
524 netif_start_queue(netdev);523 netif_start_queue(netdev);
525 524
526 return 0;525 return 0;
@@ -576,7 +575,6 @@ static int peak_usb_ndo_stop(struct net_device *netdev) · 49 unmodified lines
576 575
577 close_candev(netdev);576 close_candev(netdev);
578 577
579 dev->open_time = 0;
580 dev->can.state = CAN_STATE_STOPPED;578 dev->can.state = CAN_STATE_STOPPED;
581 579
582 /* can set bus off now */580 /* 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
661 struct peak_usb_device *dev = netdev_priv(netdev);659 struct peak_usb_device *dev = netdev_priv(netdev);
662 int err = 0;660 int err = 0;
663 661
664 if (!dev->open_time)
665 return -EINVAL;
666
667 switch (mode) {662 switch (mode) {
668 case CAN_MODE_START:663 case CAN_MODE_START:
669 err = peak_usb_restart(dev);664 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
104 struct can_priv can;104 struct can_priv can;
105 struct peak_usb_adapter *adapter;105 struct peak_usb_adapter *adapter;
106 unsigned int ctrl_idx;106 unsigned int ctrl_idx;
107 int open_time;
108 u32 state;107 u32 state;
109 108
110 struct sk_buff *echo_skb[PCAN_USB_MAX_TX_URBS];109 struct sk_buff *echo_skb[PCAN_USB_MAX_TX_URBS];
drivers/net/dsa/Kconfig+4−1
@@ -1,5 +1,5 @@
1menu "Distributed Switch Architecture drivers"1menu "Distributed Switch Architecture drivers"
2 depends on NET_DSA2 depends on HAVE_NET_DSA
3 3
4config NET_DSA_MV88E6XXX4config NET_DSA_MV88E6XXX
5 tristate5 tristate
@@ -7,6 +7,7 @@ config NET_DSA_MV88E6XXX · 1 unmodified line
7 7
8config NET_DSA_MV88E60608config NET_DSA_MV88E6060
9 tristate "Marvell 88E6060 ethernet switch chip support"9 tristate "Marvell 88E6060 ethernet switch chip support"
10 select NET_DSA
10 select NET_DSA_TAG_TRAILER11 select NET_DSA_TAG_TRAILER
11 ---help---12 ---help---
12 This enables support for the Marvell 88E6060 ethernet switch13 This enables support for the Marvell 88E6060 ethernet switch
@@ -18,6 +19,7 @@ config NET_DSA_MV88E6XXX_NEED_PPU · 5 unmodified lines
18 19
19config NET_DSA_MV88E613120config NET_DSA_MV88E6131
20 tristate "Marvell 88E6085/6095/6095F/6131 ethernet switch chip support"21 tristate "Marvell 88E6085/6095/6095F/6131 ethernet switch chip support"
22 select NET_DSA
21 select NET_DSA_MV88E6XXX23 select NET_DSA_MV88E6XXX
22 select NET_DSA_MV88E6XXX_NEED_PPU24 select NET_DSA_MV88E6XXX_NEED_PPU
23 select NET_DSA_TAG_DSA25 select NET_DSA_TAG_DSA
@@ -27,6 +29,7 @@ config NET_DSA_MV88E6131 · 3 unmodified lines
27 29
28config NET_DSA_MV88E6123_61_6530config NET_DSA_MV88E6123_61_65
29 tristate "Marvell 88E6123/6161/6165 ethernet switch chip support"31 tristate "Marvell 88E6123/6161/6165 ethernet switch chip support"
32 select NET_DSA
30 select NET_DSA_MV88E6XXX33 select NET_DSA_MV88E6XXX
31 select NET_DSA_TAG_EDSA34 select NET_DSA_TAG_EDSA
32 ---help---35 ---help---
drivers/net/ethernet/3com/3c509.c+13−16
@@ -92,7 +92,7 @@ · 91 unmodified lines
92#include <asm/io.h>92#include <asm/io.h>
93#include <asm/irq.h>93#include <asm/irq.h>
94 94
95static char version[] __devinitdata = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n";95static char version[] = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n";
96 96
97#ifdef EL3_DEBUG97#ifdef EL3_DEBUG
98static int el3_debug = EL3_DEBUG;98static int el3_debug = EL3_DEBUG;
@@ -184,7 +184,7 @@ static int max_interrupt_work = 10; · 85 unmodified lines
184static int nopnp;184static int nopnp;
185#endif185#endif
186 186
187static int __devinit el3_common_init(struct net_device *dev);187static int el3_common_init(struct net_device *dev);
188static void el3_common_remove(struct net_device *dev);188static void el3_common_remove(struct net_device *dev);
189static ushort id_read_eeprom(int index);189static ushort id_read_eeprom(int index);
190static ushort read_eeprom(int ioaddr, int index);190static ushort read_eeprom(int ioaddr, int index);
@@ -270,9 +270,8 @@ static int el3_isa_id_sequence(__be16 *phys_addr) · 79 unmodified lines
270 270
271}271}
272 272
273static void __devinit el3_dev_fill(struct net_device *dev, __be16 *phys_addr,273static void el3_dev_fill(struct net_device *dev, __be16 *phys_addr, int ioaddr,
274 int ioaddr, int irq, int if_port,274 int irq, int if_port, enum el3_cardtype type)
275 enum el3_cardtype type)
276{275{
277 struct el3_private *lp = netdev_priv(dev);276 struct el3_private *lp = netdev_priv(dev);
278 277
@@ -283,8 +282,7 @@ static void __devinit el3_dev_fill(struct net_device *dev, __be16 *phys_addr, · 4 unmodified lines
283 lp->type = type;282 lp->type = type;
284}283}
285 284
286static int __devinit el3_isa_match(struct device *pdev,285static int el3_isa_match(struct device *pdev, unsigned int ndev)
287 unsigned int ndev)
288{286{
289 struct net_device *dev;287 struct net_device *dev;
290 int ioaddr, isa_irq, if_port, err;288 int ioaddr, isa_irq, if_port, err;
@@ -341,7 +339,7 @@ static int __devinit el3_isa_match(struct device *pdev, · 50 unmodified lines
341 return 1;339 return 1;
342}340}
343 341
344static int __devexit el3_isa_remove(struct device *pdev,342static int el3_isa_remove(struct device *pdev,
345 unsigned int ndev)343 unsigned int ndev)
346{344{
347 el3_device_remove(pdev);345 el3_device_remove(pdev);
@@ -382,7 +380,7 @@ static int el3_isa_resume(struct device *dev, unsigned int n) · 34 unmodified lines
382 380
383static struct isa_driver el3_isa_driver = {381static struct isa_driver el3_isa_driver = {
384 .match = el3_isa_match,382 .match = el3_isa_match,
385 .remove = __devexit_p(el3_isa_remove),383 .remove = el3_isa_remove,
386#ifdef CONFIG_PM384#ifdef CONFIG_PM
387 .suspend = el3_isa_suspend,385 .suspend = el3_isa_suspend,
388 .resume = el3_isa_resume,386 .resume = el3_isa_resume,
@@ -406,8 +404,7 @@ static struct pnp_device_id el3_pnp_ids[] = { · 17 unmodified lines
406};404};
407MODULE_DEVICE_TABLE(pnp, el3_pnp_ids);405MODULE_DEVICE_TABLE(pnp, el3_pnp_ids);
408 406
409static int __devinit el3_pnp_probe(struct pnp_dev *pdev,407static int el3_pnp_probe(struct pnp_dev *pdev, const struct pnp_device_id *id)
410 const struct pnp_device_id *id)
411{408{
412 short i;409 short i;
413 int ioaddr, irq, if_port;410 int ioaddr, irq, if_port;
@@ -445,7 +442,7 @@ static int __devinit el3_pnp_probe(struct pnp_dev *pdev, · 31 unmodified lines
445 return 0;442 return 0;
446}443}
447 444
448static void __devexit el3_pnp_remove(struct pnp_dev *pdev)445static void el3_pnp_remove(struct pnp_dev *pdev)
449{446{
450 el3_common_remove(pnp_get_drvdata(pdev));447 el3_common_remove(pnp_get_drvdata(pdev));
451 pnp_set_drvdata(pdev, NULL);448 pnp_set_drvdata(pdev, NULL);
@@ -467,7 +464,7 @@ static struct pnp_driver el3_pnp_driver = { · 15 unmodified lines
467 .name = "3c509",464 .name = "3c509",
468 .id_table = el3_pnp_ids,465 .id_table = el3_pnp_ids,
469 .probe = el3_pnp_probe,466 .probe = el3_pnp_probe,
470 .remove = __devexit_p(el3_pnp_remove),467 .remove = el3_pnp_remove,
471#ifdef CONFIG_PM468#ifdef CONFIG_PM
472 .suspend = el3_pnp_suspend,469 .suspend = el3_pnp_suspend,
473 .resume = el3_pnp_resume,470 .resume = el3_pnp_resume,
@@ -496,7 +493,7 @@ static struct eisa_driver el3_eisa_driver = { · 22 unmodified lines
496 .driver = {493 .driver = {
497 .name = "3c579",494 .name = "3c579",
498 .probe = el3_eisa_probe,495 .probe = el3_eisa_probe,
499 .remove = __devexit_p (el3_device_remove),496 .remove = el3_device_remove,
500 .suspend = el3_suspend,497 .suspend = el3_suspend,
501 .resume = el3_resume,498 .resume = el3_resume,
502 }499 }
@@ -519,7 +516,7 @@ static const struct net_device_ops netdev_ops = { · 16 unmodified lines
519#endif516#endif
520};517};
521 518
522static int __devinit el3_common_init(struct net_device *dev)519static int el3_common_init(struct net_device *dev)
523{520{
524 struct el3_private *lp = netdev_priv(dev);521 struct el3_private *lp = netdev_priv(dev);
525 int err;522 int err;
@@ -618,7 +615,7 @@ static int __init el3_eisa_probe (struct device *device) · 92 unmodified lines
618/* This remove works for all device types.615/* This remove works for all device types.
619 *616 *
620 * The net dev must be stored in the driver data field */617 * The net dev must be stored in the driver data field */
621static int __devexit el3_device_remove (struct device *device)618static int el3_device_remove(struct device *device)
622{619{
623 struct net_device *dev;620 struct net_device *dev;
624 621
drivers/net/ethernet/3com/3c59x.c+10−11
@@ -102,7 +102,7 @@ static int vortex_debug = 1; · 101 unmodified lines
102#include <linux/delay.h>102#include <linux/delay.h>
103 103
104 104
105static const char version[] __devinitconst =105static const char version[] =
106 DRV_NAME ": Donald Becker and others.\n";106 DRV_NAME ": Donald Becker and others.\n";
107 107
108MODULE_AUTHOR("Donald Becker <becker@scyld.com>");108MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
@@ -277,7 +277,7 @@ static struct vortex_chip_info { · 168 unmodified lines
277 int flags;277 int flags;
278 int drv_flags;278 int drv_flags;
279 int io_size;279 int io_size;
280} vortex_info_tbl[] __devinitdata = {280} vortex_info_tbl[] = {
281 {"3c590 Vortex 10Mbps",281 {"3c590 Vortex 10Mbps",
282 PCI_USES_MASTER, IS_VORTEX, 32, },282 PCI_USES_MASTER, IS_VORTEX, 32, },
283 {"3c592 EISA 10Mbps Demon/Vortex", /* AKPM: from Don's 3c59x_cb.c 0.49H */283 {"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
931 return 0;931 return 0;
932}932}
933 933
934static int __devexit vortex_eisa_remove(struct device *device)934static int vortex_eisa_remove(struct device *device)
935{935{
936 struct eisa_device *edev;936 struct eisa_device *edev;
937 struct net_device *dev;937 struct net_device *dev;
@@ -962,7 +962,7 @@ static struct eisa_driver vortex_eisa_driver = { · 24 unmodified lines
962 .driver = {962 .driver = {
963 .name = "3c59x",963 .name = "3c59x",
964 .probe = vortex_eisa_probe,964 .probe = vortex_eisa_probe,
965 .remove = __devexit_p(vortex_eisa_remove)965 .remove = vortex_eisa_remove
966 }966 }
967};967};
968 968
@@ -1000,8 +1000,8 @@ static int __init vortex_eisa_init(void) · 31 unmodified lines
1000}1000}
1001 1001
1002/* returns count (>= 0), or negative on error */1002/* returns count (>= 0), or negative on error */
1003static int __devinit vortex_init_one(struct pci_dev *pdev,1003static int vortex_init_one(struct pci_dev *pdev,
1004 const struct pci_device_id *ent)1004 const struct pci_device_id *ent)
1005{1005{
1006 int rc, unit, pci_bar;1006 int rc, unit, pci_bar;
1007 struct vortex_chip_info *vci;1007 struct vortex_chip_info *vci;
@@ -1088,9 +1088,8 @@ static const struct net_device_ops vortex_netdev_ops = { · 80 unmodified lines
1088 *1088 *
1089 * NOTE: pdev can be NULL, for the case of a Compaq device1089 * NOTE: pdev can be NULL, for the case of a Compaq device
1090 */1090 */
1091static int __devinit vortex_probe1(struct device *gendev,1091static int vortex_probe1(struct device *gendev, void __iomem *ioaddr, int irq,
1092 void __iomem *ioaddr, int irq,1092 int chip_idx, int card_idx)
1093 int chip_idx, int card_idx)
1094{1093{
1095 struct vortex_private *vp;1094 struct vortex_private *vp;
1096 int option;1095 int option;
@@ -3222,7 +3221,7 @@ static void acpi_set_WOL(struct net_device *dev) · 2125 unmodified lines
3222}3221}
3223 3222
3224 3223
3225static void __devexit vortex_remove_one(struct pci_dev *pdev)3224static void vortex_remove_one(struct pci_dev *pdev)
3226{3225{
3227 struct net_device *dev = pci_get_drvdata(pdev);3226 struct net_device *dev = pci_get_drvdata(pdev);
3228 struct vortex_private *vp;3227 struct vortex_private *vp;
@@ -3265,7 +3264,7 @@ static void __devexit vortex_remove_one(struct pci_dev *pdev) · 36 unmodified lines
3265static struct pci_driver vortex_driver = {3264static struct pci_driver vortex_driver = {
3266 .name = "3c59x",3265 .name = "3c59x",
3267 .probe = vortex_init_one,3266 .probe = vortex_init_one,
3268 .remove = __devexit_p(vortex_remove_one),3267 .remove = vortex_remove_one,
3269 .id_table = vortex_pci_tbl,3268 .id_table = vortex_pci_tbl,
3270 .driver.pm = VORTEX_PM_OPS,3269 .driver.pm = VORTEX_PM_OPS,
3271};3270};
drivers/net/ethernet/3com/Kconfig+1−1
@@ -80,7 +80,7 @@ config PCMCIA_3C589 · 79 unmodified lines
80 80
81config VORTEX81config VORTEX
82 tristate "3c590/3c900 series (592/595/597) \"Vortex/Boomerang\" support"82 tristate "3c590/3c900 series (592/595/597) \"Vortex/Boomerang\" support"
83 depends on (PCI || EISA)83 depends on (PCI || EISA) && HAS_IOPORT
84 select NET_CORE84 select NET_CORE
85 select MII85 select MII
86 ---help---86 ---help---
drivers/net/ethernet/3com/typhoon.c+5−5
@@ -168,7 +168,7 @@ enum typhoon_cards { · 167 unmodified lines
168};168};
169 169
170/* directly indexed by enum typhoon_cards, above */170/* directly indexed by enum typhoon_cards, above */
171static struct typhoon_card_info typhoon_card_info[] __devinitdata = {171static struct typhoon_card_info typhoon_card_info[] = {
172 { "3Com Typhoon (3C990-TX)",172 { "3Com Typhoon (3C990-TX)",
173 TYPHOON_CRYPTO_NONE},173 TYPHOON_CRYPTO_NONE},
174 { "3Com Typhoon (3CR990-TX-95)",174 { "3Com Typhoon (3CR990-TX-95)",
@@ -2200,7 +2200,7 @@ need_resume: · 2025 unmodified lines
2200}2200}
2201#endif2201#endif
2202 2202
2203static int __devinit2203static int
2204typhoon_test_mmio(struct pci_dev *pdev)2204typhoon_test_mmio(struct pci_dev *pdev)
2205{2205{
2206 void __iomem *ioaddr = pci_iomap(pdev, 1, 128);2206 void __iomem *ioaddr = pci_iomap(pdev, 1, 128);
@@ -2258,7 +2258,7 @@ static const struct net_device_ops typhoon_netdev_ops = { · 51 unmodified lines
2258 .ndo_change_mtu = eth_change_mtu,2258 .ndo_change_mtu = eth_change_mtu,
2259};2259};
2260 2260
2261static int __devinit2261static int
2262typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)2262typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
2263{2263{
2264 struct net_device *dev;2264 struct net_device *dev;
@@ -2509,7 +2509,7 @@ error_out: · 244 unmodified lines
2509 return err;2509 return err;
2510}2510}
2511 2511
2512static void __devexit2512static void
2513typhoon_remove_one(struct pci_dev *pdev)2513typhoon_remove_one(struct pci_dev *pdev)
2514{2514{
2515 struct net_device *dev = pci_get_drvdata(pdev);2515 struct net_device *dev = pci_get_drvdata(pdev);
@@ -2533,7 +2533,7 @@ static struct pci_driver typhoon_driver = { · 17 unmodified lines
2533 .name = KBUILD_MODNAME,2533 .name = KBUILD_MODNAME,
2534 .id_table = typhoon_pci_tbl,2534 .id_table = typhoon_pci_tbl,
2535 .probe = typhoon_init_one,2535 .probe = typhoon_init_one,
2536 .remove = __devexit_p(typhoon_remove_one),2536 .remove = typhoon_remove_one,
2537#ifdef CONFIG_PM2537#ifdef CONFIG_PM
2538 .suspend = typhoon_suspend,2538 .suspend = typhoon_suspend,
2539 .resume = typhoon_resume,2539 .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
191 ei_outb(E8390_RREAD+E8390_START, nic_base + NE_CMD);191 ei_outb(E8390_RREAD+E8390_START, nic_base + NE_CMD);
192 192
193 if (ei_local->word16)193 if (ei_local->word16)
194 readsw(nic_base + NE_DATAPORT, hdr,194 ioread16_rep(nic_base + NE_DATAPORT, hdr,
195 sizeof(struct e8390_pkt_hdr) >> 1);195 sizeof(struct e8390_pkt_hdr) >> 1);
196 else196 else
197 readsb(nic_base + NE_DATAPORT, hdr,197 ioread8_rep(nic_base + NE_DATAPORT, hdr,
198 sizeof(struct e8390_pkt_hdr));198 sizeof(struct e8390_pkt_hdr));
199 199
200 ei_outb(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */200 ei_outb(ENISR_RDC, nic_base + EN0_ISR); /* Ack intr. */
201 ei_local->dmaing &= ~0x01;201 ei_local->dmaing &= ~0x01;
@@ -237,12 +237,12 @@ static void ax_block_input(struct net_device *dev, int count, · 35 unmodified lines
237 ei_outb(E8390_RREAD+E8390_START, nic_base + NE_CMD);237 ei_outb(E8390_RREAD+E8390_START, nic_base + NE_CMD);
238 238
239 if (ei_local->word16) {239 if (ei_local->word16) {
240 readsw(nic_base + NE_DATAPORT, buf, count >> 1);240 ioread16_rep(nic_base + NE_DATAPORT, buf, count >> 1);
241 if (count & 0x01)241 if (count & 0x01)
242 buf[count-1] = ei_inb(nic_base + NE_DATAPORT);242 buf[count-1] = ei_inb(nic_base + NE_DATAPORT);
243 243
244 } else {244 } else {
245 readsb(nic_base + NE_DATAPORT, buf, count);245 ioread8_rep(nic_base + NE_DATAPORT, buf, count);
246 }246 }
247 247
248 ei_local->dmaing &= ~1;248 ei_local->dmaing &= ~1;
@@ -286,9 +286,9 @@ static void ax_block_output(struct net_device *dev, int count, · 37 unmodified lines
286 286
287 ei_outb(E8390_RWRITE+E8390_START, nic_base + NE_CMD);287 ei_outb(E8390_RWRITE+E8390_START, nic_base + NE_CMD);
288 if (ei_local->word16)288 if (ei_local->word16)
289 writesw(nic_base + NE_DATAPORT, buf, count >> 1);289 iowrite16_rep(nic_base + NE_DATAPORT, buf, count >> 1);
290 else290 else
291 writesb(nic_base + NE_DATAPORT, buf, count);291 iowrite8_rep(nic_base + NE_DATAPORT, buf, count);
292 292
293 dma_start = jiffies;293 dma_start = jiffies;
294 294
drivers/net/ethernet/8390/etherh.c+4−10
@@ -463,12 +463,6 @@ etherh_open(struct net_device *dev) · 462 unmodified lines
463{463{
464 struct ei_device *ei_local = netdev_priv(dev);464 struct ei_device *ei_local = netdev_priv(dev);
465 465
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
472 if (request_irq(dev->irq, __ei_interrupt, 0, dev->name, dev))466 if (request_irq(dev->irq, __ei_interrupt, 0, dev->name, dev))
473 return -EAGAIN;467 return -EAGAIN;
474 468
@@ -527,7 +521,7 @@ static void __init etherh_banner(void) · 52 unmodified lines
527 * Read the ethernet address string from the on board rom.521 * Read the ethernet address string from the on board rom.
528 * This is an ascii string...522 * This is an ascii string...
529 */523 */
530static int __devinit etherh_addr(char *addr, struct expansion_card *ec)524static int etherh_addr(char *addr, struct expansion_card *ec)
531{525{
532 struct in_chunk_dir cd;526 struct in_chunk_dir cd;
533 char *s;527 char *s;
@@ -657,7 +651,7 @@ static const struct net_device_ops etherh_netdev_ops = { · 123 unmodified lines
657static u32 etherh_regoffsets[16];651static u32 etherh_regoffsets[16];
658static u32 etherm_regoffsets[16];652static u32 etherm_regoffsets[16];
659 653
660static int __devinit654static int
661etherh_probe(struct expansion_card *ec, const struct ecard_id *id)655etherh_probe(struct expansion_card *ec, const struct ecard_id *id)
662{656{
663 const struct etherh_data *data = id->data;657 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
775 return ret;769 return ret;
776}770}
777 771
778static void __devexit etherh_remove(struct expansion_card *ec)772static void etherh_remove(struct expansion_card *ec)
779{773{
780 struct net_device *dev = ecard_get_drvdata(ec);774 struct net_device *dev = ecard_get_drvdata(ec);
781 775
@@ -839,7 +833,7 @@ static const struct ecard_id etherh_ids[] = { · 57 unmodified lines
839 833
840static struct ecard_driver etherh_driver = {834static struct ecard_driver etherh_driver = {
841 .probe = etherh_probe,835 .probe = etherh_probe,
842 .remove = __devexit_p(etherh_remove),836 .remove = etherh_remove,
843 .id_table = etherh_ids,837 .id_table = etherh_ids,
844 .drv = {838 .drv = {
845 .name = DRV_NAME,839 .name = DRV_NAME,
drivers/net/ethernet/8390/hydra.c+9−9
@@ -53,9 +53,9 @@ static const char version[] = · 52 unmodified lines
53#define WORDSWAP(a) ((((a)>>8)&0xff) | ((a)<<8))53#define WORDSWAP(a) ((((a)>>8)&0xff) | ((a)<<8))
54 54
55 55
56static int __devinit hydra_init_one(struct zorro_dev *z,56static int hydra_init_one(struct zorro_dev *z,
57 const struct zorro_device_id *ent);57 const struct zorro_device_id *ent);
58static int __devinit hydra_init(struct zorro_dev *z);58static int hydra_init(struct zorro_dev *z);
59static int hydra_open(struct net_device *dev);59static int hydra_open(struct net_device *dev);
60static int hydra_close(struct net_device *dev);60static int hydra_close(struct net_device *dev);
61static void hydra_reset_8390(struct net_device *dev);61static 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
65 struct sk_buff *skb, int ring_offset);65 struct sk_buff *skb, int ring_offset);
66static void hydra_block_output(struct net_device *dev, int count,66static void hydra_block_output(struct net_device *dev, int count,
67 const unsigned char *buf, int start_page);67 const unsigned char *buf, int start_page);
68static void __devexit hydra_remove_one(struct zorro_dev *z);68static void hydra_remove_one(struct zorro_dev *z);
69 69
70static struct zorro_device_id hydra_zorro_tbl[] __devinitdata = {70static struct zorro_device_id hydra_zorro_tbl[] = {
71 { ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET },71 { ZORRO_PROD_HYDRA_SYSTEMS_AMIGANET },
72 { 0 }72 { 0 }
73};73};
@@ -77,11 +77,11 @@ static struct zorro_driver hydra_driver = { · 3 unmodified lines
77 .name = "hydra",77 .name = "hydra",
78 .id_table = hydra_zorro_tbl,78 .id_table = hydra_zorro_tbl,
79 .probe = hydra_init_one,79 .probe = hydra_init_one,
80 .remove = __devexit_p(hydra_remove_one),80 .remove = hydra_remove_one,
81};81};
82 82
83static int __devinit hydra_init_one(struct zorro_dev *z,83static int hydra_init_one(struct zorro_dev *z,
84 const struct zorro_device_id *ent)84 const struct zorro_device_id *ent)
85{85{
86 int err;86 int err;
87 87
@@ -110,7 +110,7 @@ static const struct net_device_ops hydra_netdev_ops = { · 22 unmodified lines
110#endif110#endif
111};111};
112 112
113static int __devinit hydra_init(struct zorro_dev *z)113static int hydra_init(struct zorro_dev *z)
114{114{
115 struct net_device *dev;115 struct net_device *dev;
116 unsigned long board = ZTWO_VADDR(z->resource.start);116 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
247 z_memcpy_toio(mem_base+((start_page - NESM_START_PG)<<8), buf, count);247 z_memcpy_toio(mem_base+((start_page - NESM_START_PG)<<8), buf, count);
248}248}
249 249
250static void __devexit hydra_remove_one(struct zorro_dev *z)250static void hydra_remove_one(struct zorro_dev *z)
251{251{
252 struct net_device *dev = zorro_get_drvdata(z);252 struct net_device *dev = zorro_get_drvdata(z);
253 253
drivers/net/ethernet/8390/ne2k-pci.c+6−6
@@ -61,7 +61,7 @@ static int options[MAX_UNITS]; · 60 unmodified lines
61#include "8390.h"61#include "8390.h"
62 62
63/* These identify the driver base version and may not be removed. */63/* These identify the driver base version and may not be removed. */
64static const char version[] __devinitconst =64static const char version[] =
65 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE65 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE
66 " D. Becker/P. Gortmaker\n";66 " D. Becker/P. Gortmaker\n";
67 67
@@ -119,7 +119,7 @@ enum ne2k_pci_chipsets { · 51 unmodified lines
119static struct {119static struct {
120 char *name;120 char *name;
121 int flags;121 int flags;
122} pci_clone_list[] __devinitdata = {122} pci_clone_list[] = {
123 {"RealTek RTL-8029", REALTEK_FDX},123 {"RealTek RTL-8029", REALTEK_FDX},
124 {"Winbond 89C940", 0},124 {"Winbond 89C940", 0},
125 {"Compex RL2000", 0},125 {"Compex RL2000", 0},
@@ -215,8 +215,8 @@ static const struct net_device_ops ne2k_netdev_ops = { · 89 unmodified lines
215#endif215#endif
216};216};
217 217
218static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,218static int ne2k_pci_init_one(struct pci_dev *pdev,
219 const struct pci_device_id *ent)219 const struct pci_device_id *ent)
220{220{
221 struct net_device *dev;221 struct net_device *dev;
222 int i;222 int i;
@@ -647,7 +647,7 @@ static const struct ethtool_ops ne2k_pci_ethtool_ops = { · 424 unmodified lines
647 .get_drvinfo = ne2k_pci_get_drvinfo,647 .get_drvinfo = ne2k_pci_get_drvinfo,
648};648};
649 649
650static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev)650static void ne2k_pci_remove_one(struct pci_dev *pdev)
651{651{
652 struct net_device *dev = pci_get_drvdata(pdev);652 struct net_device *dev = pci_get_drvdata(pdev);
653 653
@@ -696,7 +696,7 @@ static int ne2k_pci_resume (struct pci_dev *pdev) · 42 unmodified lines
696static struct pci_driver ne2k_driver = {696static struct pci_driver ne2k_driver = {
697 .name = DRV_NAME,697 .name = DRV_NAME,
698 .probe = ne2k_pci_init_one,698 .probe = ne2k_pci_init_one,
699 .remove = __devexit_p(ne2k_pci_remove_one),699 .remove = ne2k_pci_remove_one,
700 .id_table = ne2k_pci_tbl,700 .id_table = ne2k_pci_tbl,
701#ifdef CONFIG_PM701#ifdef CONFIG_PM
702 .suspend = ne2k_pci_suspend,702 .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
222 return retval;222 return retval;
223}223}
224 224
225static int __devexit ne3210_eisa_remove (struct device *device)225static int ne3210_eisa_remove(struct device *device)
226{226{
227 struct net_device *dev = dev_get_drvdata(device);227 struct net_device *dev = dev_get_drvdata(device);
228 unsigned long ioaddr = to_eisa_device (device)->base_addr;228 unsigned long ioaddr = to_eisa_device (device)->base_addr;
@@ -324,7 +324,7 @@ static struct eisa_driver ne3210_eisa_driver = { · 95 unmodified lines
324 .driver = {324 .driver = {
325 .name = "ne3210",325 .name = "ne3210",
326 .probe = ne3210_eisa_probe,326 .probe = ne3210_eisa_probe,
327 .remove = __devexit_p (ne3210_eisa_remove),327 .remove = ne3210_eisa_remove,
328 },328 },
329};329};
330 330
drivers/net/ethernet/8390/zorro8390.c+8−9
@@ -75,7 +75,7 @@ static struct card_info { · 74 unmodified lines
75 zorro_id id;75 zorro_id id;
76 const char *name;76 const char *name;
77 unsigned int offset;77 unsigned int offset;
78} cards[] __devinitdata = {78} cards[] = {
79 { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2, "Ariadne II", 0x0600 },79 { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2, "Ariadne II", 0x0600 },
80 { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, "X-Surf", 0x8600 },80 { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, "X-Surf", 0x8600 },
81};81};
@@ -254,7 +254,7 @@ static int zorro8390_close(struct net_device *dev) · 172 unmodified lines
254 return 0;254 return 0;
255}255}
256 256
257static void __devexit zorro8390_remove_one(struct zorro_dev *z)257static void zorro8390_remove_one(struct zorro_dev *z)
258{258{
259 struct net_device *dev = zorro_get_drvdata(z);259 struct net_device *dev = zorro_get_drvdata(z);
260 260
@@ -264,7 +264,7 @@ static void __devexit zorro8390_remove_one(struct zorro_dev *z) · 3 unmodified lines
264 free_netdev(dev);264 free_netdev(dev);
265}265}
266 266
267static struct zorro_device_id zorro8390_zorro_tbl[] __devinitdata = {267static struct zorro_device_id zorro8390_zorro_tbl[] = {
268 { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2, },268 { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE2, },
269 { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, },269 { ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF, },
270 { 0 }270 { 0 }
@@ -286,9 +286,8 @@ static const struct net_device_ops zorro8390_netdev_ops = { · 15 unmodified lines
286#endif286#endif
287};287};
288 288
289static int __devinit zorro8390_init(struct net_device *dev,289static int zorro8390_init(struct net_device *dev, unsigned long board,
290 unsigned long board, const char *name,290 const char *name, unsigned long ioaddr)
291 unsigned long ioaddr)
292{291{
293 int i;292 int i;
294 int err;293 int err;
@@ -396,8 +395,8 @@ static int __devinit zorro8390_init(struct net_device *dev, · 101 unmodified lines
396 return 0;395 return 0;
397}396}
398 397
399static int __devinit zorro8390_init_one(struct zorro_dev *z,398static int zorro8390_init_one(struct zorro_dev *z,
400 const struct zorro_device_id *ent)399 const struct zorro_device_id *ent)
401{400{
402 struct net_device *dev;401 struct net_device *dev;
403 unsigned long board, ioaddr;402 unsigned long board, ioaddr;
@@ -432,7 +431,7 @@ static struct zorro_driver zorro8390_driver = { · 28 unmodified lines
432 .name = "zorro8390",431 .name = "zorro8390",
433 .id_table = zorro8390_zorro_tbl,432 .id_table = zorro8390_zorro_tbl,
434 .probe = zorro8390_init_one,433 .probe = zorro8390_init_one,
435 .remove = __devexit_p(zorro8390_remove_one),434 .remove = zorro8390_remove_one,
436};435};
437 436
438static int __init zorro8390_init_module(void)437static 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
166#define FIRMWARE_TX "adaptec/starfire_tx.bin"166#define FIRMWARE_TX "adaptec/starfire_tx.bin"
167 167
168/* These identify the driver base version and may not be removed. */168/* These identify the driver base version and may not be removed. */
169static const char version[] __devinitconst =169static const char version[] =
170KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n"170KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n"
171" (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";171" (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";
172 172
@@ -295,7 +295,7 @@ MODULE_DEVICE_TABLE(pci, starfire_pci_tbl); · 122 unmodified lines
295static const struct chip_info {295static const struct chip_info {
296 const char *name;296 const char *name;
297 int drv_flags;297 int drv_flags;
298} netdrv_tbl[] __devinitconst = {298} netdrv_tbl[] = {
299 { "Adaptec Starfire 6915", CanHaveMII },299 { "Adaptec Starfire 6915", CanHaveMII },
300};300};
301 301
@@ -641,8 +641,8 @@ static const struct net_device_ops netdev_ops = { · 339 unmodified lines
641#endif641#endif
642};642};
643 643
644static int __devinit starfire_init_one(struct pci_dev *pdev,644static int starfire_init_one(struct pci_dev *pdev,
645 const struct pci_device_id *ent)645 const struct pci_device_id *ent)
646{646{
647 struct device *d = &pdev->dev;647 struct device *d = &pdev->dev;
648 struct netdev_private *np;648 struct netdev_private *np;
@@ -1990,7 +1990,7 @@ static int starfire_resume(struct pci_dev *pdev) · 1341 unmodified lines
1990#endif /* CONFIG_PM */1990#endif /* CONFIG_PM */
1991 1991
1992 1992
1993static void __devexit starfire_remove_one (struct pci_dev *pdev)1993static void starfire_remove_one(struct pci_dev *pdev)
1994{1994{
1995 struct net_device *dev = pci_get_drvdata(pdev);1995 struct net_device *dev = pci_get_drvdata(pdev);
1996 struct netdev_private *np = netdev_priv(dev);1996 struct netdev_private *np = netdev_priv(dev);
@@ -2018,7 +2018,7 @@ static void __devexit starfire_remove_one (struct pci_dev *pdev) · 21 unmodified lines
2018static struct pci_driver starfire_driver = {2018static struct pci_driver starfire_driver = {
2019 .name = DRV_NAME,2019 .name = DRV_NAME,
2020 .probe = starfire_init_one,2020 .probe = starfire_init_one,
2021 .remove = __devexit_p(starfire_remove_one),2021 .remove = starfire_remove_one,
2022#ifdef CONFIG_PM2022#ifdef CONFIG_PM
2023 .suspend = starfire_suspend,2023 .suspend = starfire_suspend,
2024 .resume = starfire_resume,2024 .resume = starfire_resume,
drivers/net/ethernet/adi/Kconfig+1−1
@@ -61,7 +61,7 @@ config BFIN_RX_DESC_NUM · 60 unmodified lines
61 61
62config BFIN_MAC_USE_HWSTAMP62config BFIN_MAC_USE_HWSTAMP
63 bool "Use IEEE 1588 hwstamp"63 bool "Use IEEE 1588 hwstamp"
64 depends on BFIN_MAC && BF51864 select PTP_1588_CLOCK
65 default y65 default y
66 ---help---66 ---help---
67 To support the IEEE 1588 Precision Time Protocol (PTP), select y here67 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
548 return 0;548 return 0;
549}549}
550 550
551#ifdef CONFIG_BFIN_MAC_USE_HWSTAMP
551static int bfin_mac_ethtool_get_ts_info(struct net_device *dev,552static int bfin_mac_ethtool_get_ts_info(struct net_device *dev,
552 struct ethtool_ts_info *info)553 struct ethtool_ts_info *info)
553{554{
555 struct bfin_mac_local *lp = netdev_priv(dev);
556
554 info->so_timestamping =557 info->so_timestamping =
555 SOF_TIMESTAMPING_TX_HARDWARE |558 SOF_TIMESTAMPING_TX_HARDWARE |
556 SOF_TIMESTAMPING_RX_HARDWARE |559 SOF_TIMESTAMPING_RX_HARDWARE |
557 SOF_TIMESTAMPING_SYS_HARDWARE;560 SOF_TIMESTAMPING_RAW_HARDWARE;
558 info->phc_index = -1;561 info->phc_index = lp->phc_index;
559 info->tx_types =562 info->tx_types =
560 (1 << HWTSTAMP_TX_OFF) |563 (1 << HWTSTAMP_TX_OFF) |
561 (1 << HWTSTAMP_TX_ON);564 (1 << HWTSTAMP_TX_ON);
@@ -566,6 +569,7 @@ static int bfin_mac_ethtool_get_ts_info(struct net_device *dev, · 4 unmodified lines
566 (1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT);569 (1 << HWTSTAMP_FILTER_PTP_V2_L4_EVENT);
567 return 0;570 return 0;
568}571}
572#endif
569 573
570static const struct ethtool_ops bfin_mac_ethtool_ops = {574static const struct ethtool_ops bfin_mac_ethtool_ops = {
571 .get_settings = bfin_mac_ethtool_getsettings,575 .get_settings = bfin_mac_ethtool_getsettings,
@@ -574,7 +578,9 @@ static const struct ethtool_ops bfin_mac_ethtool_ops = { · 2 unmodified lines
574 .get_drvinfo = bfin_mac_ethtool_getdrvinfo,578 .get_drvinfo = bfin_mac_ethtool_getdrvinfo,
575 .get_wol = bfin_mac_ethtool_getwol,579 .get_wol = bfin_mac_ethtool_getwol,
576 .set_wol = bfin_mac_ethtool_setwol,580 .set_wol = bfin_mac_ethtool_setwol,
581#ifdef CONFIG_BFIN_MAC_USE_HWSTAMP
577 .get_ts_info = bfin_mac_ethtool_get_ts_info,582 .get_ts_info = bfin_mac_ethtool_get_ts_info,
583#endif
578};584};
579 585
580/**************************************************************************/586/**************************************************************************/
@@ -649,6 +655,20 @@ static int bfin_mac_set_mac_address(struct net_device *dev, void *p) · 68 unmodified lines
649#ifdef CONFIG_BFIN_MAC_USE_HWSTAMP655#ifdef CONFIG_BFIN_MAC_USE_HWSTAMP
650#define bfin_mac_hwtstamp_is_none(cfg) ((cfg) == HWTSTAMP_FILTER_NONE)656#define bfin_mac_hwtstamp_is_none(cfg) ((cfg) == HWTSTAMP_FILTER_NONE)
651 657
658static 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
652static int bfin_mac_hwtstamp_ioctl(struct net_device *netdev,672static int bfin_mac_hwtstamp_ioctl(struct net_device *netdev,
653 struct ifreq *ifr, int cmd)673 struct ifreq *ifr, int cmd)
654{674{
@@ -798,19 +818,7 @@ static int bfin_mac_hwtstamp_ioctl(struct net_device *netdev, · 143 unmodified lines
798 bfin_read_EMAC_PTP_TXSNAPLO();818 bfin_read_EMAC_PTP_TXSNAPLO();
799 bfin_read_EMAC_PTP_TXSNAPHI();819 bfin_read_EMAC_PTP_TXSNAPHI();
800 820
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
807 SSYNC();821 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);
814 }822 }
815 823
816 lp->stamp_cfg = config;824 lp->stamp_cfg = config;
@@ -818,15 +826,6 @@ static int bfin_mac_hwtstamp_ioctl(struct net_device *netdev, · 1 unmodified line
818 -EFAULT : 0;826 -EFAULT : 0;
819}827}
820 828
821static 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
830static void bfin_tx_hwtstamp(struct net_device *netdev, struct sk_buff *skb)829static void bfin_tx_hwtstamp(struct net_device *netdev, struct sk_buff *skb)
831{830{
832 struct bfin_mac_local *lp = netdev_priv(netdev);831 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
857 regval = bfin_read_EMAC_PTP_TXSNAPLO();856 regval = bfin_read_EMAC_PTP_TXSNAPLO();
858 regval |= (u64)bfin_read_EMAC_PTP_TXSNAPHI() << 32;857 regval |= (u64)bfin_read_EMAC_PTP_TXSNAPHI() << 32;
859 memset(&shhwtstamps, 0, sizeof(shhwtstamps));858 memset(&shhwtstamps, 0, sizeof(shhwtstamps));
860 ns = timecounter_cyc2time(&lp->clock,859 ns = regval << lp->shift;
861 regval);
862 timecompare_update(&lp->compare, ns);
863 shhwtstamps.hwtstamp = ns_to_ktime(ns);860 shhwtstamps.hwtstamp = ns_to_ktime(ns);
864 shhwtstamps.syststamp =
865 timecompare_transform(&lp->compare, ns);
866 skb_tstamp_tx(skb, &shhwtstamps);861 skb_tstamp_tx(skb, &shhwtstamps);
867
868 bfin_dump_hwtamp("TX", &shhwtstamps.hwtstamp, &shhwtstamps.syststamp, &lp->compare);
869 }862 }
870 }863 }
871}864}
@@ -888,55 +881,184 @@ static void bfin_rx_hwtstamp(struct net_device *netdev, struct sk_buff *skb) · 16 unmodified lines
888 881
889 regval = bfin_read_EMAC_PTP_RXSNAPLO();882 regval = bfin_read_EMAC_PTP_RXSNAPLO();
890 regval |= (u64)bfin_read_EMAC_PTP_RXSNAPHI() << 32;883 regval |= (u64)bfin_read_EMAC_PTP_RXSNAPHI() << 32;
891 ns = timecounter_cyc2time(&lp->clock, regval);884 ns = regval << lp->shift;
892 timecompare_update(&lp->compare, ns);
893 memset(shhwtstamps, 0, sizeof(*shhwtstamps));885 memset(shhwtstamps, 0, sizeof(*shhwtstamps));
894 shhwtstamps->hwtstamp = ns_to_ktime(ns);886 shhwtstamps->hwtstamp = ns_to_ktime(ns);
895 shhwtstamps->syststamp = timecompare_transform(&lp->compare, ns);887}
888
889static 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;
896 906
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;
898}910}
899 911
900/*912static u64 bfin_ptp_time_read(struct bfin_mac_local *lp)
901 * bfin_read_clock - read raw cycle counter (to be used by time counter)
902 */
903static cycle_t bfin_read_clock(const struct cyclecounter *tc)
904{913{
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();
906 919
907 stamp = bfin_read_EMAC_PTP_TIMELO();920 ns = ((u64) hi) << 32;
908 stamp |= (u64)bfin_read_EMAC_PTP_TIMEHI() << 32ULL;921 ns |= lo;
922 ns <<= lp->shift;
909 923
910 return stamp;924 return ns;
911}925}
912 926
913#define PTP_CLK 25000000927static void bfin_ptp_time_write(struct bfin_mac_local *lp, u64 ns)
928{
929 u32 hi, lo;
914 930
915static 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
941static 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
965static 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
983static 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
1002static 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
1022static int bfin_ptp_enable(struct ptp_clock_info *ptp,
1023 struct ptp_clock_request *rq, int on)
1024{
1025 return -EOPNOTSUPP;
1026}
1027
1028static 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
1043static int bfin_phc_init(struct net_device *netdev, struct device *dev)
916{1044{
917 struct bfin_mac_local *lp = netdev_priv(netdev);1045 struct bfin_mac_local *lp = netdev_priv(netdev);
918 u64 append;
919 1046
920 /* Initialize hardware timer */1047 lp->caps = bfin_ptp_caps;
921 append = PTP_CLK * (1ULL << 32);1048 lp->caps.max_adj = lp->max_ppb;
922 do_div(append, get_sclk());1049 lp->clock = ptp_clock_register(&lp->caps, dev);
923 bfin_write_EMAC_PTP_ADDEND((u32)append);1050 if (IS_ERR(lp->clock))
924 1051 return PTR_ERR(lp->clock);
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;
936 1052
937 /* Initialize hwstamp config */1053 lp->phc_index = ptp_clock_index(lp->clock);
938 lp->stamp_cfg.rx_filter = HWTSTAMP_FILTER_NONE;1054 spin_lock_init(&lp->phc_lock);
939 lp->stamp_cfg.tx_type = HWTSTAMP_TX_OFF;1055
1056 return 0;
1057}
1058
1059static void bfin_phc_release(struct bfin_mac_local *lp)
1060{
1061 ptp_clock_unregister(lp->clock);
940}1062}
941 1063
942#else1064#else
@@ -945,6 +1067,8 @@ static void bfin_mac_hwtstamp_init(struct net_device *netdev) · 2 unmodified lines
945# define bfin_mac_hwtstamp_ioctl(dev, ifr, cmd) (-EOPNOTSUPP)1067# define bfin_mac_hwtstamp_ioctl(dev, ifr, cmd) (-EOPNOTSUPP)
946# define bfin_rx_hwtstamp(dev, skb)1068# define bfin_rx_hwtstamp(dev, skb)
947# define bfin_tx_hwtstamp(dev, skb)1069# define bfin_tx_hwtstamp(dev, skb)
1070# define bfin_phc_init(netdev, dev) 0
1071# define bfin_phc_release(lp)
948#endif1072#endif
949 1073
950static inline void _tx_reclaim_skb(void)1074static inline void _tx_reclaim_skb(void)
@@ -1479,7 +1603,7 @@ static const struct net_device_ops bfin_mac_netdev_ops = { · 528 unmodified lines
1479#endif1603#endif
1480};1604};
1481 1605
1482static int __devinit bfin_mac_probe(struct platform_device *pdev)1606static int bfin_mac_probe(struct platform_device *pdev)
1483{1607{
1484 struct net_device *ndev;1608 struct net_device *ndev;
1485 struct bfin_mac_local *lp;1609 struct bfin_mac_local *lp;
@@ -1579,12 +1703,17 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev) · 93 unmodified lines
1579 }1703 }
1580 1704
1581 bfin_mac_hwtstamp_init(ndev);1705 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 }
1582 1710
1583 /* now, print out the card info, in a short format.. */1711 /* now, print out the card info, in a short format.. */
1584 netdev_info(ndev, "%s, Version %s\n", DRV_DESC, DRV_VERSION);1712 netdev_info(ndev, "%s, Version %s\n", DRV_DESC, DRV_VERSION);
1585 1713
1586 return 0;1714 return 0;
1587 1715
1716out_err_phc:
1588out_err_reg_ndev:1717out_err_reg_ndev:
1589 free_irq(IRQ_MAC_RX, ndev);1718 free_irq(IRQ_MAC_RX, ndev);
1590out_err_request_irq:1719out_err_request_irq:
@@ -1598,11 +1727,13 @@ out_err_probe_mac: · 7 unmodified lines
1598 return rc;1727 return rc;
1599}1728}
1600 1729
1601static int __devexit bfin_mac_remove(struct platform_device *pdev)1730static int bfin_mac_remove(struct platform_device *pdev)
1602{1731{
1603 struct net_device *ndev = platform_get_drvdata(pdev);1732 struct net_device *ndev = platform_get_drvdata(pdev);
1604 struct bfin_mac_local *lp = netdev_priv(ndev);1733 struct bfin_mac_local *lp = netdev_priv(ndev);
1605 1734
1735 bfin_phc_release(lp);
1736
1606 platform_set_drvdata(pdev, NULL);1737 platform_set_drvdata(pdev, NULL);
1607 1738
1608 lp->mii_bus->priv = NULL;1739 lp->mii_bus->priv = NULL;
@@ -1655,7 +1786,7 @@ static int bfin_mac_resume(struct platform_device *pdev) · 46 unmodified lines
1655#define bfin_mac_resume NULL1786#define bfin_mac_resume NULL
1656#endif /* CONFIG_PM */1787#endif /* CONFIG_PM */
1657 1788
1658static int __devinit bfin_mii_bus_probe(struct platform_device *pdev)1789static int bfin_mii_bus_probe(struct platform_device *pdev)
1659{1790{
1660 struct mii_bus *miibus;1791 struct mii_bus *miibus;
1661 struct bfin_mii_bus_platform_data *mii_bus_pd;1792 struct bfin_mii_bus_platform_data *mii_bus_pd;
@@ -1733,7 +1864,7 @@ out_err_alloc: · 71 unmodified lines
1733 return rc;1864 return rc;
1734}1865}
1735 1866
1736static int __devexit bfin_mii_bus_remove(struct platform_device *pdev)1867static int bfin_mii_bus_remove(struct platform_device *pdev)
1737{1868{
1738 struct mii_bus *miibus = platform_get_drvdata(pdev);1869 struct mii_bus *miibus = platform_get_drvdata(pdev);
1739 struct bfin_mii_bus_platform_data *mii_bus_pd =1870 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
1750 1881
1751static struct platform_driver bfin_mii_bus_driver = {1882static struct platform_driver bfin_mii_bus_driver = {
1752 .probe = bfin_mii_bus_probe,1883 .probe = bfin_mii_bus_probe,
1753 .remove = __devexit_p(bfin_mii_bus_remove),1884 .remove = bfin_mii_bus_remove,
1754 .driver = {1885 .driver = {
1755 .name = "bfin_mii_bus",1886 .name = "bfin_mii_bus",
1756 .owner = THIS_MODULE,1887 .owner = THIS_MODULE,
@@ -1759,7 +1890,7 @@ static struct platform_driver bfin_mii_bus_driver = { · 2 unmodified lines
1759 1890
1760static struct platform_driver bfin_mac_driver = {1891static struct platform_driver bfin_mac_driver = {
1761 .probe = bfin_mac_probe,1892 .probe = bfin_mac_probe,
1762 .remove = __devexit_p(bfin_mac_remove),1893 .remove = bfin_mac_remove,
1763 .resume = bfin_mac_resume,1894 .resume = bfin_mac_resume,
1764 .suspend = bfin_mac_suspend,1895 .suspend = bfin_mac_suspend,
1765 .driver = {1896 .driver = {
drivers/net/ethernet/adi/bfin_mac.h+8−5
@@ -11,8 +11,7 @@ · 10 unmodified lines
11#define _BFIN_MAC_H_11#define _BFIN_MAC_H_
12 12
13#include <linux/net_tstamp.h>13#include <linux/net_tstamp.h>
14#include <linux/clocksource.h>14#include <linux/ptp_clock_kernel.h>
15#include <linux/timecompare.h>
16#include <linux/timer.h>15#include <linux/timer.h>
17#include <linux/etherdevice.h>16#include <linux/etherdevice.h>
18#include <linux/bfin_mac.h>17#include <linux/bfin_mac.h>
@@ -94,10 +93,14 @@ struct bfin_mac_local { · 75 unmodified lines
94 struct mii_bus *mii_bus;93 struct mii_bus *mii_bus;
95 94
96#if defined(CONFIG_BFIN_MAC_USE_HWSTAMP)95#if defined(CONFIG_BFIN_MAC_USE_HWSTAMP)
97 struct cyclecounter cycles;96 u32 addend;
98 struct timecounter clock;97 unsigned int shift;
99 struct timecompare compare;98 s32 max_ppb;
100 struct hwtstamp_config stamp_cfg;99 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 */
101#endif104#endif
102};105};
103 106
drivers/net/ethernet/aeroflex/greth.c+3−3
@@ -1376,7 +1376,7 @@ error: · 1375 unmodified lines
1376}1376}
1377 1377
1378/* Initialize the GRETH MAC */1378/* Initialize the GRETH MAC */
1379static int __devinit greth_of_probe(struct platform_device *ofdev)1379static int greth_of_probe(struct platform_device *ofdev)
1380{1380{
1381 struct net_device *dev;1381 struct net_device *dev;
1382 struct greth_private *greth;1382 struct greth_private *greth;
@@ -1576,7 +1576,7 @@ error1: · 193 unmodified lines
1576 return err;1576 return err;
1577}1577}
1578 1578
1579static int __devexit greth_of_remove(struct platform_device *of_dev)1579static int greth_of_remove(struct platform_device *of_dev)
1580{1580{
1581 struct net_device *ndev = dev_get_drvdata(&of_dev->dev);1581 struct net_device *ndev = dev_get_drvdata(&of_dev->dev);
1582 struct greth_private *greth = netdev_priv(ndev);1582 struct greth_private *greth = netdev_priv(ndev);
@@ -1619,7 +1619,7 @@ static struct platform_driver greth_of_driver = { · 36 unmodified lines
1619 .of_match_table = greth_of_match,1619 .of_match_table = greth_of_match,
1620 },1620 },
1621 .probe = greth_of_probe,1621 .probe = greth_of_probe,
1622 .remove = __devexit_p(greth_of_remove),1622 .remove = greth_of_remove,
1623};1623};
1624 1624
1625module_platform_driver(greth_of_driver);1625module_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
426MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/GA620 ratio of NIC memory used for TX/RX descriptors (range 0-63)");426MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/GA620 ratio of NIC memory used for TX/RX descriptors (range 0-63)");
427 427
428 428
429static const char version[] __devinitconst =429static const char version[] =
430 "acenic.c: v0.92 08/05/2002 Jes Sorensen, linux-acenic@SunSITE.dk\n"430 "acenic.c: v0.92 08/05/2002 Jes Sorensen, linux-acenic@SunSITE.dk\n"
431 " http://home.cern.ch/~jes/gige/acenic.html\n";431 " http://home.cern.ch/~jes/gige/acenic.html\n";
432 432
@@ -454,8 +454,8 @@ static const struct net_device_ops ace_netdev_ops = { · 21 unmodified lines
454 .ndo_change_mtu = ace_change_mtu,454 .ndo_change_mtu = ace_change_mtu,
455};455};
456 456
457static int __devinit acenic_probe_one(struct pci_dev *pdev,457static int acenic_probe_one(struct pci_dev *pdev,
458 const struct pci_device_id *id)458 const struct pci_device_id *id)
459{459{
460 struct net_device *dev;460 struct net_device *dev;
461 struct ace_private *ap;461 struct ace_private *ap;
@@ -603,7 +603,7 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev, · 141 unmodified lines
603 return -ENODEV;603 return -ENODEV;
604}604}
605 605
606static void __devexit acenic_remove_one(struct pci_dev *pdev)606static void acenic_remove_one(struct pci_dev *pdev)
607{607{
608 struct net_device *dev = pci_get_drvdata(pdev);608 struct net_device *dev = pci_get_drvdata(pdev);
609 struct ace_private *ap = netdev_priv(dev);609 struct ace_private *ap = netdev_priv(dev);
@@ -699,7 +699,7 @@ static struct pci_driver acenic_pci_driver = { · 89 unmodified lines
699 .name = "acenic",699 .name = "acenic",
700 .id_table = acenic_pci_tbl,700 .id_table = acenic_pci_tbl,
701 .probe = acenic_probe_one,701 .probe = acenic_probe_one,
702 .remove = __devexit_p(acenic_remove_one),702 .remove = acenic_remove_one,
703};703};
704 704
705static int __init acenic_init(void)705static 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
871}871}
872 872
873 873
874static int __devinit ace_init(struct net_device *dev)874static int ace_init(struct net_device *dev)
875{875{
876 struct ace_private *ap;876 struct ace_private *ap;
877 struct ace_regs __iomem *regs;877 struct ace_regs __iomem *regs;
@@ -2824,8 +2824,8 @@ static struct net_device_stats *ace_get_stats(struct net_device *dev) · 1946 unmodified lines
2824}2824}
2825 2825
2826 2826
2827static void __devinit ace_copy(struct ace_regs __iomem *regs, const __be32 *src,2827static void ace_copy(struct ace_regs __iomem *regs, const __be32 *src,
2828 u32 dest, int size)2828 u32 dest, int size)
2829{2829{
2830 void __iomem *tdest;2830 void __iomem *tdest;
2831 short tsize, i;2831 short tsize, i;
@@ -2851,7 +2851,7 @@ static void __devinit ace_copy(struct ace_regs __iomem *regs, const __be32 *src, · 19 unmodified lines
2851}2851}
2852 2852
2853 2853
2854static void __devinit ace_clear(struct ace_regs __iomem *regs, u32 dest, int size)2854static void ace_clear(struct ace_regs __iomem *regs, u32 dest, int size)
2855{2855{
2856 void __iomem *tdest;2856 void __iomem *tdest;
2857 short tsize = 0, i;2857 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
2882 * This operation requires the NIC to be halted and is performed with2882 * This operation requires the NIC to be halted and is performed with
2883 * interrupts disabled and with the spinlock hold.2883 * interrupts disabled and with the spinlock hold.
2884 */2884 */
2885static int __devinit ace_load_firmware(struct net_device *dev)2885static int ace_load_firmware(struct net_device *dev)
2886{2886{
2887 const struct firmware *fw;2887 const struct firmware *fw;
2888 const char *fw_name = "acenic/tg2.bin";2888 const char *fw_name = "acenic/tg2.bin";
@@ -2962,7 +2962,7 @@ static int __devinit ace_load_firmware(struct net_device *dev) · 73 unmodified lines
2962 * Thanks to Stevarino Webinski for helping tracking down the bugs in the2962 * Thanks to Stevarino Webinski for helping tracking down the bugs in the
2963 * code i2c readout code by beta testing all my hacks.2963 * code i2c readout code by beta testing all my hacks.
2964 */2964 */
2965static void __devinit eeprom_start(struct ace_regs __iomem *regs)2965static void eeprom_start(struct ace_regs __iomem *regs)
2966{2966{
2967 u32 local;2967 u32 local;
2968 2968
@@ -2991,7 +2991,7 @@ static void __devinit eeprom_start(struct ace_regs __iomem *regs) · 22 unmodified lines
2991}2991}
2992 2992
2993 2993
2994static void __devinit eeprom_prep(struct ace_regs __iomem *regs, u8 magic)2994static void eeprom_prep(struct ace_regs __iomem *regs, u8 magic)
2995{2995{
2996 short i;2996 short i;
2997 u32 local;2997 u32 local;
@@ -3028,7 +3028,7 @@ static void __devinit eeprom_prep(struct ace_regs __iomem *regs, u8 magic) · 30 unmodified lines
3028}3028}
3029 3029
3030 3030
3031static int __devinit eeprom_check_ack(struct ace_regs __iomem *regs)3031static int eeprom_check_ack(struct ace_regs __iomem *regs)
3032{3032{
3033 int state;3033 int state;
3034 u32 local;3034 u32 local;
@@ -3056,7 +3056,7 @@ static int __devinit eeprom_check_ack(struct ace_regs __iomem *regs) · 21 unmodified lines
3056}3056}
3057 3057
3058 3058
3059static void __devinit eeprom_stop(struct ace_regs __iomem *regs)3059static void eeprom_stop(struct ace_regs __iomem *regs)
3060{3060{
3061 u32 local;3061 u32 local;
3062 3062
@@ -3091,8 +3091,7 @@ static void __devinit eeprom_stop(struct ace_regs __iomem *regs) · 28 unmodified lines
3091/*3091/*
3092 * Read a whole byte from the EEPROM.3092 * Read a whole byte from the EEPROM.
3093 */3093 */
3094static int __devinit read_eeprom_byte(struct net_device *dev,3094static int read_eeprom_byte(struct net_device *dev, unsigned long offset)
3095 unsigned long offset)
3096{3095{
3097 struct ace_private *ap = netdev_priv(dev);3096 struct ace_private *ap = netdev_priv(dev);
3098 struct ace_regs __iomem *regs = ap->regs;3097 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
639 netif_wake_queue(dev);639 netif_wake_queue(dev);
640}640}
641 641
642static int __devinit a2065_init_one(struct zorro_dev *z,642static int a2065_init_one(struct zorro_dev *z,
643 const struct zorro_device_id *ent);643 const struct zorro_device_id *ent);
644static void __devexit a2065_remove_one(struct zorro_dev *z);644static void a2065_remove_one(struct zorro_dev *z);
645 645
646 646
647static struct zorro_device_id a2065_zorro_tbl[] __devinitdata = {647static struct zorro_device_id a2065_zorro_tbl[] = {
648 { ZORRO_PROD_CBM_A2065_1 },648 { ZORRO_PROD_CBM_A2065_1 },
649 { ZORRO_PROD_CBM_A2065_2 },649 { ZORRO_PROD_CBM_A2065_2 },
650 { ZORRO_PROD_AMERISTAR_A2065 },650 { ZORRO_PROD_AMERISTAR_A2065 },
@@ -656,7 +656,7 @@ static struct zorro_driver a2065_driver = { · 5 unmodified lines
656 .name = "a2065",656 .name = "a2065",
657 .id_table = a2065_zorro_tbl,657 .id_table = a2065_zorro_tbl,
658 .probe = a2065_init_one,658 .probe = a2065_init_one,
659 .remove = __devexit_p(a2065_remove_one),659 .remove = a2065_remove_one,
660};660};
661 661
662static const struct net_device_ops lance_netdev_ops = {662static const struct net_device_ops lance_netdev_ops = {
@@ -670,8 +670,8 @@ static const struct net_device_ops lance_netdev_ops = { · 7 unmodified lines
670 .ndo_set_mac_address = eth_mac_addr,670 .ndo_set_mac_address = eth_mac_addr,
671};671};
672 672
673static int __devinit a2065_init_one(struct zorro_dev *z,673static int a2065_init_one(struct zorro_dev *z,
674 const struct zorro_device_id *ent)674 const struct zorro_device_id *ent)
675{675{
676 struct net_device *dev;676 struct net_device *dev;
677 struct lance_private *priv;677 struct lance_private *priv;
@@ -754,7 +754,7 @@ static int __devinit a2065_init_one(struct zorro_dev *z, · 76 unmodified lines
754}754}
755 755
756 756
757static void __devexit a2065_remove_one(struct zorro_dev *z)757static void a2065_remove_one(struct zorro_dev *z)
758{758{
759 struct net_device *dev = zorro_get_drvdata(z);759 struct net_device *dev = zorro_get_drvdata(z);
760 760
drivers/net/ethernet/amd/am79c961a.c+1−1
@@ -671,7 +671,7 @@ static const struct net_device_ops am79c961_netdev_ops = { · 670 unmodified lines
671#endif671#endif
672};672};
673 673
674static int __devinit am79c961_probe(struct platform_device *pdev)674static int am79c961_probe(struct platform_device *pdev)
675{675{
676 struct resource *res;676 struct resource *res;
677 struct net_device *dev;677 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
1702}1702}
1703 1703
1704 1704
1705static void __devexit amd8111e_remove_one(struct pci_dev *pdev)1705static void amd8111e_remove_one(struct pci_dev *pdev)
1706{1706{
1707 struct net_device *dev = pci_get_drvdata(pdev);1707 struct net_device *dev = pci_get_drvdata(pdev);
1708 if (dev) {1708 if (dev) {
@@ -1774,7 +1774,7 @@ static void amd8111e_config_ipg(struct net_device* dev) · 65 unmodified lines
1774 1774
1775}1775}
1776 1776
1777static void __devinit amd8111e_probe_ext_phy(struct net_device* dev)1777static void amd8111e_probe_ext_phy(struct net_device *dev)
1778{1778{
1779 struct amd8111e_priv *lp = netdev_priv(dev);1779 struct amd8111e_priv *lp = netdev_priv(dev);
1780 int i;1780 int i;
@@ -1810,7 +1810,7 @@ static const struct net_device_ops amd8111e_netdev_ops = { · 29 unmodified lines
1810#endif1810#endif
1811};1811};
1812 1812
1813static int __devinit amd8111e_probe_one(struct pci_dev *pdev,1813static int amd8111e_probe_one(struct pci_dev *pdev,
1814 const struct pci_device_id *ent)1814 const struct pci_device_id *ent)
1815{1815{
1816 int err,i,pm_cap;1816 int err,i,pm_cap;
@@ -1976,7 +1976,7 @@ static struct pci_driver amd8111e_driver = { · 159 unmodified lines
1976 .name = MODULE_NAME,1976 .name = MODULE_NAME,
1977 .id_table = amd8111e_pci_tbl,1977 .id_table = amd8111e_pci_tbl,
1978 .probe = amd8111e_probe_one,1978 .probe = amd8111e_probe_one,
1979 .remove = __devexit_p(amd8111e_remove_one),1979 .remove = amd8111e_remove_one,
1980 .suspend = amd8111e_suspend,1980 .suspend = amd8111e_suspend,
1981 .resume = amd8111e_resume1981 .resume = amd8111e_resume
1982};1982};
drivers/net/ethernet/amd/ariadne.c+5−5
@@ -682,7 +682,7 @@ static void set_multicast_list(struct net_device *dev) · 681 unmodified lines
682}682}
683 683
684 684
685static void __devexit ariadne_remove_one(struct zorro_dev *z)685static void ariadne_remove_one(struct zorro_dev *z)
686{686{
687 struct net_device *dev = zorro_get_drvdata(z);687 struct net_device *dev = zorro_get_drvdata(z);
688 688
@@ -692,7 +692,7 @@ static void __devexit ariadne_remove_one(struct zorro_dev *z) · 3 unmodified lines
692 free_netdev(dev);692 free_netdev(dev);
693}693}
694 694
695static struct zorro_device_id ariadne_zorro_tbl[] __devinitdata = {695static struct zorro_device_id ariadne_zorro_tbl[] = {
696 { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE },696 { ZORRO_PROD_VILLAGE_TRONIC_ARIADNE },
697 { 0 }697 { 0 }
698};698};
@@ -710,8 +710,8 @@ static const struct net_device_ops ariadne_netdev_ops = { · 11 unmodified lines
710 .ndo_set_mac_address = eth_mac_addr,710 .ndo_set_mac_address = eth_mac_addr,
711};711};
712 712
713static int __devinit ariadne_init_one(struct zorro_dev *z,713static int ariadne_init_one(struct zorro_dev *z,
714 const struct zorro_device_id *ent)714 const struct zorro_device_id *ent)
715{715{
716 unsigned long board = z->resource.start;716 unsigned long board = z->resource.start;
717 unsigned long base_addr = board + ARIADNE_LANCE;717 unsigned long base_addr = board + ARIADNE_LANCE;
@@ -774,7 +774,7 @@ static struct zorro_driver ariadne_driver = { · 56 unmodified lines
774 .name = "ariadne",774 .name = "ariadne",
775 .id_table = ariadne_zorro_tbl,775 .id_table = ariadne_zorro_tbl,
776 .probe = ariadne_init_one,776 .probe = ariadne_init_one,
777 .remove = __devexit_p(ariadne_remove_one),777 .remove = ariadne_remove_one,
778};778};
779 779
780static int __init ariadne_init_module(void)780static 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
1016 .ndo_change_mtu = eth_change_mtu,1016 .ndo_change_mtu = eth_change_mtu,
1017};1017};
1018 1018
1019static int __devinit au1000_probe(struct platform_device *pdev)1019static int au1000_probe(struct platform_device *pdev)
1020{1020{
1021 static unsigned version_printed;1021 static unsigned version_printed;
1022 struct au1000_private *aup = NULL;1022 struct au1000_private *aup = NULL;
@@ -1295,7 +1295,7 @@ out: · 272 unmodified lines
1295 return err;1295 return err;
1296}1296}
1297 1297
1298static int __devexit au1000_remove(struct platform_device *pdev)1298static int au1000_remove(struct platform_device *pdev)
1299{1299{
1300 struct net_device *dev = platform_get_drvdata(pdev);1300 struct net_device *dev = platform_get_drvdata(pdev);
1301 struct au1000_private *aup = netdev_priv(dev);1301 struct au1000_private *aup = netdev_priv(dev);
@@ -1340,7 +1340,7 @@ static int __devexit au1000_remove(struct platform_device *pdev) · 38 unmodified lines
1340 1340
1341static struct platform_driver au1000_eth_driver = {1341static struct platform_driver au1000_eth_driver = {
1342 .probe = au1000_probe,1342 .probe = au1000_probe,
1343 .remove = __devexit_p(au1000_remove),1343 .remove = au1000_remove,
1344 .driver = {1344 .driver = {
1345 .name = "au1000-eth",1345 .name = "au1000-eth",
1346 .owner = THIS_MODULE,1346 .owner = THIS_MODULE,
drivers/net/ethernet/amd/declance.c+4−4
@@ -72,7 +72,7 @@ · 71 unmodified lines
72#include <asm/dec/machtype.h>72#include <asm/dec/machtype.h>
73#include <asm/dec/system.h>73#include <asm/dec/system.h>
74 74
75static char version[] __devinitdata =75static char version[] =
76"declance.c: v0.011 by Linux MIPS DECstation task force\n";76"declance.c: v0.011 by Linux MIPS DECstation task force\n";
77 77
78MODULE_AUTHOR("Linux MIPS DECstation task force");78MODULE_AUTHOR("Linux MIPS DECstation task force");
@@ -1020,7 +1020,7 @@ static const struct net_device_ops lance_netdev_ops = { · 941 unmodified lines
1020 .ndo_set_mac_address = eth_mac_addr,1020 .ndo_set_mac_address = eth_mac_addr,
1021};1021};
1022 1022
1023static int __devinit dec_lance_probe(struct device *bdev, const int type)1023static int dec_lance_probe(struct device *bdev, const int type)
1024{1024{
1025 static unsigned version_printed;1025 static unsigned version_printed;
1026 static const char fmt[] = "declance%d";1026 static const char fmt[] = "declance%d";
@@ -1322,7 +1322,7 @@ static void __exit dec_lance_platform_remove(void) · 295 unmodified lines
1322}1322}
1323 1323
1324#ifdef CONFIG_TC1324#ifdef CONFIG_TC
1325static int __devinit dec_lance_tc_probe(struct device *dev);1325static int dec_lance_tc_probe(struct device *dev);
1326static int __exit dec_lance_tc_remove(struct device *dev);1326static int __exit dec_lance_tc_remove(struct device *dev);
1327 1327
1328static const struct tc_device_id dec_lance_tc_table[] = {1328static const struct tc_device_id dec_lance_tc_table[] = {
@@ -1341,7 +1341,7 @@ static struct tc_driver dec_lance_tc_driver = { · 12 unmodified lines
1341 },1341 },
1342};1342};
1343 1343
1344static int __devinit dec_lance_tc_probe(struct device *dev)1344static int dec_lance_tc_probe(struct device *dev)
1345{1345{
1346 int status = dec_lance_probe(dev, PMAD_LANCE);1346 int status = dec_lance_probe(dev, PMAD_LANCE);
1347 if (!status)1347 if (!status)
drivers/net/ethernet/amd/depca.c+5−5
@@ -338,21 +338,21 @@ static struct eisa_driver depca_eisa_driver = { · 337 unmodified lines
338 .driver = {338 .driver = {
339 .name = depca_string,339 .name = depca_string,
340 .probe = depca_eisa_probe,340 .probe = depca_eisa_probe,
341 .remove = __devexit_p (depca_device_remove)341 .remove = depca_device_remove
342 }342 }
343};343};
344#endif344#endif
345 345
346static int depca_isa_probe (struct platform_device *);346static int depca_isa_probe (struct platform_device *);
347 347
348static int __devexit depca_isa_remove(struct platform_device *pdev)348static int depca_isa_remove(struct platform_device *pdev)
349{349{
350 return depca_device_remove(&pdev->dev);350 return depca_device_remove(&pdev->dev);
351}351}
352 352
353static struct platform_driver depca_isa_driver = {353static struct platform_driver depca_isa_driver = {
354 .probe = depca_isa_probe,354 .probe = depca_isa_probe,
355 .remove = __devexit_p(depca_isa_remove),355 .remove = depca_isa_remove,
356 .driver = {356 .driver = {
357 .name = depca_string,357 .name = depca_string,
358 },358 },
@@ -1320,7 +1320,7 @@ static enum depca_type __init depca_shmem_probe (ulong *mem_start) · 961 unmodified lines
1320 return adapter;1320 return adapter;
1321}1321}
1322 1322
1323static int __devinit depca_isa_probe (struct platform_device *device)1323static int depca_isa_probe(struct platform_device *device)
1324{1324{
1325 struct net_device *dev;1325 struct net_device *dev;
1326 struct depca_private *lp;1326 struct depca_private *lp;
@@ -1412,7 +1412,7 @@ static int __init depca_eisa_probe (struct device *device) · 85 unmodified lines
1412}1412}
1413#endif1413#endif
1414 1414
1415static int __devexit depca_device_remove (struct device *device)1415static int depca_device_remove(struct device *device)
1416{1416{
1417 struct net_device *dev;1417 struct net_device *dev;
1418 struct depca_private *lp;1418 struct depca_private *lp;
drivers/net/ethernet/amd/hplance.c+7−10
@@ -46,11 +46,9 @@ struct hplance_private { · 45 unmodified lines
46 * plus board-specific init, open and close actions.46 * plus board-specific init, open and close actions.
47 * Oh, and we need to tell the generic code how to read and write LANCE registers...47 * Oh, and we need to tell the generic code how to read and write LANCE registers...
48 */48 */
49static int __devinit hplance_init_one(struct dio_dev *d,49static int hplance_init_one(struct dio_dev *d, const struct dio_device_id *ent);
50 const struct dio_device_id *ent);50static void hplance_init(struct net_device *dev, struct dio_dev *d);
51static void __devinit hplance_init(struct net_device *dev,51static void hplance_remove_one(struct dio_dev *d);
52 struct dio_dev *d);
53static void __devexit hplance_remove_one(struct dio_dev *d);
54static void hplance_writerap(void *priv, unsigned short value);52static void hplance_writerap(void *priv, unsigned short value);
55static void hplance_writerdp(void *priv, unsigned short value);53static void hplance_writerdp(void *priv, unsigned short value);
56static unsigned short hplance_readrdp(void *priv);54static unsigned short hplance_readrdp(void *priv);
@@ -66,7 +64,7 @@ static struct dio_driver hplance_driver = { · 9 unmodified lines
66 .name = "hplance",64 .name = "hplance",
67 .id_table = hplance_dio_tbl,65 .id_table = hplance_dio_tbl,
68 .probe = hplance_init_one,66 .probe = hplance_init_one,
69 .remove = __devexit_p(hplance_remove_one),67 .remove = hplance_remove_one,
70};68};
71 69
72static const struct net_device_ops hplance_netdev_ops = {70static const struct net_device_ops hplance_netdev_ops = {
@@ -83,8 +81,7 @@ static const struct net_device_ops hplance_netdev_ops = { · 10 unmodified lines
83};81};
84 82
85/* Find all the HP Lance boards and initialise them... */83/* Find all the HP Lance boards and initialise them... */
86static int __devinit hplance_init_one(struct dio_dev *d,84static int hplance_init_one(struct dio_dev *d, const struct dio_device_id *ent)
87 const struct dio_device_id *ent)
88{85{
89 struct net_device *dev;86 struct net_device *dev;
90 int err = -ENOMEM;87 int err = -ENOMEM;
@@ -118,7 +115,7 @@ static int __devinit hplance_init_one(struct dio_dev *d, · 27 unmodified lines
118 return err;115 return err;
119}116}
120 117
121static void __devexit hplance_remove_one(struct dio_dev *d)118static void hplance_remove_one(struct dio_dev *d)
122{119{
123 struct net_device *dev = dio_get_drvdata(d);120 struct net_device *dev = dio_get_drvdata(d);
124 121
@@ -128,7 +125,7 @@ static void __devexit hplance_remove_one(struct dio_dev *d) · 3 unmodified lines
128}125}
129 126
130/* Initialise a single lance board at the given DIO device */127/* Initialise a single lance board at the given DIO device */
131static void __devinit hplance_init(struct net_device *dev, struct dio_dev *d)128static void hplance_init(struct net_device *dev, struct dio_dev *d)
132{129{
133 unsigned long va = (d->resource.start + DIO_VIRADDRBASE);130 unsigned long va = (d->resource.start + DIO_VIRADDRBASE);
134 struct hplance_private *lp;131 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
1443/* only probes for non-PCI devices, the rest are handled by1443/* only probes for non-PCI devices, the rest are handled by
1444 * pci_register_driver via pcnet32_probe_pci */1444 * pci_register_driver via pcnet32_probe_pci */
1445 1445
1446static void __devinit pcnet32_probe_vlbus(unsigned int *pcnet32_portlist)1446static void pcnet32_probe_vlbus(unsigned int *pcnet32_portlist)
1447{1447{
1448 unsigned int *port, ioaddr;1448 unsigned int *port, ioaddr;
1449 1449
@@ -1462,7 +1462,7 @@ static void __devinit pcnet32_probe_vlbus(unsigned int *pcnet32_portlist) · 12 unmodified lines
1462 }1462 }
1463}1463}
1464 1464
1465static int __devinit1465static int
1466pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)1466pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
1467{1467{
1468 unsigned long ioaddr;1468 unsigned long ioaddr;
@@ -1521,7 +1521,7 @@ static const struct net_device_ops pcnet32_netdev_ops = { · 52 unmodified lines
1521 * Called from both pcnet32_probe_vlbus and pcnet_probe_pci.1521 * Called from both pcnet32_probe_vlbus and pcnet_probe_pci.
1522 * pdev will be NULL when called from pcnet32_probe_vlbus.1522 * pdev will be NULL when called from pcnet32_probe_vlbus.
1523 */1523 */
1524static int __devinit1524static int
1525pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)1525pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1526{1526{
1527 struct pcnet32_private *lp;1527 struct pcnet32_private *lp;
@@ -2823,7 +2823,7 @@ static int pcnet32_pm_resume(struct pci_dev *pdev) · 1295 unmodified lines
2823 return 0;2823 return 0;
2824}2824}
2825 2825
2826static void __devexit pcnet32_remove_one(struct pci_dev *pdev)2826static void pcnet32_remove_one(struct pci_dev *pdev)
2827{2827{
2828 struct net_device *dev = pci_get_drvdata(pdev);2828 struct net_device *dev = pci_get_drvdata(pdev);
2829 2829
@@ -2844,7 +2844,7 @@ static void __devexit pcnet32_remove_one(struct pci_dev *pdev) · 14 unmodified lines
2844static struct pci_driver pcnet32_driver = {2844static struct pci_driver pcnet32_driver = {
2845 .name = DRV_NAME,2845 .name = DRV_NAME,
2846 .probe = pcnet32_probe_pci,2846 .probe = pcnet32_probe_pci,
2847 .remove = __devexit_p(pcnet32_remove_one),2847 .remove = pcnet32_remove_one,
2848 .id_table = pcnet32_pci_tbl,2848 .id_table = pcnet32_pci_tbl,
2849 .suspend = pcnet32_pm_suspend,2849 .suspend = pcnet32_pm_suspend,
2850 .resume = pcnet32_pm_resume,2850 .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
1304 .ndo_validate_addr = eth_validate_addr,1304 .ndo_validate_addr = eth_validate_addr,
1305};1305};
1306 1306
1307static int __devinit sparc_lance_probe_one(struct platform_device *op,1307static int sparc_lance_probe_one(struct platform_device *op,
1308 struct platform_device *ledma,1308 struct platform_device *ledma,
1309 struct platform_device *lebuffer)1309 struct platform_device *lebuffer)
1310{1310{
1311 struct device_node *dp = op->dev.of_node;1311 struct device_node *dp = op->dev.of_node;
1312 static unsigned version_printed;1312 static unsigned version_printed;
@@ -1488,7 +1488,7 @@ fail: · 175 unmodified lines
1488 return -ENODEV;1488 return -ENODEV;
1489}1489}
1490 1490
1491static int __devinit sunlance_sbus_probe(struct platform_device *op)1491static int sunlance_sbus_probe(struct platform_device *op)
1492{1492{
1493 struct platform_device *parent = to_platform_device(op->dev.parent);1493 struct platform_device *parent = to_platform_device(op->dev.parent);
1494 struct device_node *parent_dp = parent->dev.of_node;1494 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
1504 return err;1504 return err;
1505}1505}
1506 1506
1507static int __devexit sunlance_sbus_remove(struct platform_device *op)1507static int sunlance_sbus_remove(struct platform_device *op)
1508{1508{
1509 struct lance_private *lp = dev_get_drvdata(&op->dev);1509 struct lance_private *lp = dev_get_drvdata(&op->dev);
1510 struct net_device *net_dev = lp->dev;1510 struct net_device *net_dev = lp->dev;
@@ -1536,7 +1536,7 @@ static struct platform_driver sunlance_sbus_driver = { · 25 unmodified lines
1536 .of_match_table = sunlance_sbus_match,1536 .of_match_table = sunlance_sbus_match,
1537 },1537 },
1538 .probe = sunlance_sbus_probe,1538 .probe = sunlance_sbus_probe,
1539 .remove = __devexit_p(sunlance_sbus_remove),1539 .remove = sunlance_sbus_remove,
1540};1540};
1541 1541
1542module_platform_driver(sunlance_sbus_driver);1542module_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
1244 .ndo_validate_addr = eth_validate_addr,1244 .ndo_validate_addr = eth_validate_addr,
1245};1245};
1246 1246
1247static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_id *match)1247static int bmac_probe(struct macio_dev *mdev, const struct of_device_id *match)
1248{1248{
1249 int j, rev, ret;1249 int j, rev, ret;
1250 struct bmac_data *bp;1250 struct bmac_data *bp;
@@ -1602,7 +1602,7 @@ bmac_proc_info(char *buffer, char **start, off_t offset, int length) · 351 unmodified lines
1602}1602}
1603#endif1603#endif
1604 1604
1605static int __devexit bmac_remove(struct macio_dev *mdev)1605static int bmac_remove(struct macio_dev *mdev)
1606{1606{
1607 struct net_device *dev = macio_get_drvdata(mdev);1607 struct net_device *dev = macio_get_drvdata(mdev);
1608 struct bmac_data *bp = netdev_priv(dev);1608 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
106 .ndo_validate_addr = eth_validate_addr,106 .ndo_validate_addr = eth_validate_addr,
107};107};
108 108
109static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_id *match)109static int mace_probe(struct macio_dev *mdev, const struct of_device_id *match)
110{110{
111 struct device_node *mace = macio_get_of_node(mdev);111 struct device_node *mace = macio_get_of_node(mdev);
112 struct net_device *dev;112 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
271 return rc;271 return rc;
272}272}
273 273
274static int __devexit mace_remove(struct macio_dev *mdev)274static int mace_remove(struct macio_dev *mdev)
275{275{
276 struct net_device *dev = macio_get_drvdata(mdev);276 struct net_device *dev = macio_get_drvdata(mdev);
277 struct mace_data *mp;277 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
195 * model of Macintrash has a MACE (AV macintoshes)195 * model of Macintrash has a MACE (AV macintoshes)
196 */196 */
197 197
198static int __devinit mace_probe(struct platform_device *pdev)198static int mace_probe(struct platform_device *pdev)
199{199{
200 int j;200 int j;
201 struct mace_data *mp;201 struct mace_data *mp;
@@ -746,7 +746,7 @@ MODULE_LICENSE("GPL"); · 544 unmodified lines
746MODULE_DESCRIPTION("Macintosh MACE ethernet driver");746MODULE_DESCRIPTION("Macintosh MACE ethernet driver");
747MODULE_ALIAS("platform:macmace");747MODULE_ALIAS("platform:macmace");
748 748
749static int __devexit mac_mace_device_remove (struct platform_device *pdev)749static int mac_mace_device_remove(struct platform_device *pdev)
750{750{
751 struct net_device *dev = platform_get_drvdata(pdev);751 struct net_device *dev = platform_get_drvdata(pdev);
752 struct mace_data *mp = netdev_priv(dev);752 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
768 768
769static struct platform_driver mac_mace_driver = {769static struct platform_driver mac_mace_driver = {
770 .probe = mace_probe,770 .probe = mace_probe,
771 .remove = __devexit_p(mac_mace_device_remove),771 .remove = mac_mace_device_remove,
772 .driver = {772 .driver = {
773 .name = mac_mace_string,773 .name = mac_mace_string,
774 .owner = THIS_MODULE,774 .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
643 * @adapter: board private structure to initialize643 * @adapter: board private structure to initialize
644 *644 *
645 */645 */
646static int __devinit atl1c_alloc_queues(struct atl1c_adapter *adapter)646static int atl1c_alloc_queues(struct atl1c_adapter *adapter)
647{647{
648 return 0;648 return 0;
649}649}
@@ -702,7 +702,7 @@ struct atl1c_platform_patch { · 52 unmodified lines
702 u32 patch_flag;702 u32 patch_flag;
703#define ATL1C_LINK_PATCH 0x1703#define ATL1C_LINK_PATCH 0x1
704};704};
705static const struct atl1c_platform_patch plats[] __devinitconst = {705static const struct atl1c_platform_patch plats[] = {
706{0x2060, 0xC1, 0x1019, 0x8152, 0x1},706{0x2060, 0xC1, 0x1019, 0x8152, 0x1},
707{0x2060, 0xC1, 0x1019, 0x2060, 0x1},707{0x2060, 0xC1, 0x1019, 0x2060, 0x1},
708{0x2060, 0xC1, 0x1019, 0xE000, 0x1},708{0x2060, 0xC1, 0x1019, 0xE000, 0x1},
@@ -725,7 +725,7 @@ static const struct atl1c_platform_patch plats[] __devinitconst = { · 16 unmodified lines
725{0},725{0},
726};726};
727 727
728static void __devinit atl1c_patch_assign(struct atl1c_hw *hw)728static void atl1c_patch_assign(struct atl1c_hw *hw)
729{729{
730 struct pci_dev *pdev = hw->adapter->pdev;730 struct pci_dev *pdev = hw->adapter->pdev;
731 u32 misc_ctrl;731 u32 misc_ctrl;
@@ -764,7 +764,7 @@ static void __devinit atl1c_patch_assign(struct atl1c_hw *hw) · 32 unmodified lines
764 * Fields are initialized based on PCI device information and764 * Fields are initialized based on PCI device information and
765 * OS network device settings (MTU size).765 * OS network device settings (MTU size).
766 */766 */
767static int __devinit atl1c_sw_init(struct atl1c_adapter *adapter)767static int atl1c_sw_init(struct atl1c_adapter *adapter)
768{768{
769 struct atl1c_hw *hw = &adapter->hw;769 struct atl1c_hw *hw = &adapter->hw;
770 struct pci_dev *pdev = adapter->pdev;770 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
2442 * The OS initialization, configuring of the adapter private structure,2442 * The OS initialization, configuring of the adapter private structure,
2443 * and a hardware reset occur.2443 * and a hardware reset occur.
2444 */2444 */
2445static int __devinit atl1c_probe(struct pci_dev *pdev,2445static int atl1c_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2446 const struct pci_device_id *ent)
2447{2446{
2448 struct net_device *netdev;2447 struct net_device *netdev;
2449 struct atl1c_adapter *adapter;2448 struct atl1c_adapter *adapter;
@@ -2587,7 +2586,7 @@ err_dma: · 137 unmodified lines
2587 * Hot-Plug event, or because the driver is going to be removed from2586 * Hot-Plug event, or because the driver is going to be removed from
2588 * memory.2587 * memory.
2589 */2588 */
2590static void __devexit atl1c_remove(struct pci_dev *pdev)2589static void atl1c_remove(struct pci_dev *pdev)
2591{2590{
2592 struct net_device *netdev = pci_get_drvdata(pdev);2591 struct net_device *netdev = pci_get_drvdata(pdev);
2593 struct atl1c_adapter *adapter = netdev_priv(netdev);2592 struct atl1c_adapter *adapter = netdev_priv(netdev);
@@ -2697,7 +2696,7 @@ static struct pci_driver atl1c_driver = { · 103 unmodified lines
2697 .name = atl1c_driver_name,2696 .name = atl1c_driver_name,
2698 .id_table = atl1c_pci_tbl,2697 .id_table = atl1c_pci_tbl,
2699 .probe = atl1c_probe,2698 .probe = atl1c_probe,
2700 .remove = __devexit_p(atl1c_remove),2699 .remove = atl1c_remove,
2701 .shutdown = atl1c_shutdown,2700 .shutdown = atl1c_shutdown,
2702 .err_handler = &atl1c_err_handler,2701 .err_handler = &atl1c_err_handler,
2703 .driver.pm = &atl1c_pm_ops,2702 .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
534 * @adapter: board private structure to initialize534 * @adapter: board private structure to initialize
535 *535 *
536 */536 */
537static int __devinit atl1e_alloc_queues(struct atl1e_adapter *adapter)537static int atl1e_alloc_queues(struct atl1e_adapter *adapter)
538{538{
539 return 0;539 return 0;
540}540}
@@ -547,7 +547,7 @@ static int __devinit atl1e_alloc_queues(struct atl1e_adapter *adapter) · 6 unmodified lines
547 * Fields are initialized based on PCI device information and547 * Fields are initialized based on PCI device information and
548 * OS network device settings (MTU size).548 * OS network device settings (MTU size).
549 */549 */
550static int __devinit atl1e_sw_init(struct atl1e_adapter *adapter)550static int atl1e_sw_init(struct atl1e_adapter *adapter)
551{551{
552 struct atl1e_hw *hw = &adapter->hw;552 struct atl1e_hw *hw = &adapter->hw;
553 struct pci_dev *pdev = adapter->pdev;553 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
2235 * The OS initialization, configuring of the adapter private structure,2235 * The OS initialization, configuring of the adapter private structure,
2236 * and a hardware reset occur.2236 * and a hardware reset occur.
2237 */2237 */
2238static int __devinit atl1e_probe(struct pci_dev *pdev,2238static int atl1e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2239 const struct pci_device_id *ent)
2240{2239{
2241 struct net_device *netdev;2240 struct net_device *netdev;
2242 struct atl1e_adapter *adapter = NULL;2241 struct atl1e_adapter *adapter = NULL;
@@ -2387,7 +2386,7 @@ err_dma: · 144 unmodified lines
2387 * Hot-Plug event, or because the driver is going to be removed from2386 * Hot-Plug event, or because the driver is going to be removed from
2388 * memory.2387 * memory.
2389 */2388 */
2390static void __devexit atl1e_remove(struct pci_dev *pdev)2389static void atl1e_remove(struct pci_dev *pdev)
2391{2390{
2392 struct net_device *netdev = pci_get_drvdata(pdev);2391 struct net_device *netdev = pci_get_drvdata(pdev);
2393 struct atl1e_adapter *adapter = netdev_priv(netdev);2392 struct atl1e_adapter *adapter = netdev_priv(netdev);
@@ -2499,7 +2498,7 @@ static struct pci_driver atl1e_driver = { · 105 unmodified lines
2499 .name = atl1e_driver_name,2498 .name = atl1e_driver_name,
2500 .id_table = atl1e_pci_tbl,2499 .id_table = atl1e_pci_tbl,
2501 .probe = atl1e_probe,2500 .probe = atl1e_probe,
2502 .remove = __devexit_p(atl1e_remove),2501 .remove = atl1e_remove,
2503 /* Power Management Hooks */2502 /* Power Management Hooks */
2504#ifdef CONFIG_PM2503#ifdef CONFIG_PM
2505 .suspend = atl1e_suspend,2504 .suspend = atl1e_suspend,
drivers/net/ethernet/atheros/atl1e/atl1e_param.c+4−3
@@ -40,7 +40,7 @@ · 39 unmodified lines
40#define ATL1E_PARAM_INIT { [0 ... ATL1E_MAX_NIC] = OPTION_UNSET }40#define ATL1E_PARAM_INIT { [0 ... ATL1E_MAX_NIC] = OPTION_UNSET }
41 41
42#define ATL1E_PARAM(x, desc) \42#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; \
44 static unsigned int num_##x; \44 static unsigned int num_##x; \
45 module_param_array_named(x, x, int, &num_##x, 0); \45 module_param_array_named(x, x, int, &num_##x, 0); \
46 MODULE_PARM_DESC(x, desc);46 MODULE_PARM_DESC(x, desc);
@@ -116,7 +116,8 @@ struct atl1e_option { · 69 unmodified lines
116 } arg;116 } arg;
117};117};
118 118
119static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, struct atl1e_adapter *adapter)119static int atl1e_validate_option(int *value, struct atl1e_option *opt,
120 struct atl1e_adapter *adapter)
120{121{
121 if (*value == OPTION_UNSET) {122 if (*value == OPTION_UNSET) {
122 *value = opt->def;123 *value = opt->def;
@@ -177,7 +178,7 @@ static int __devinit atl1e_validate_option(int *value, struct atl1e_option *opt, · 54 unmodified lines
177 * value exists, a default value is used. The final value is stored178 * value exists, a default value is used. The final value is stored
178 * in a variable in the adapter structure.179 * in a variable in the adapter structure.
179 */180 */
180void __devinit atl1e_check_options(struct atl1e_adapter *adapter)181void atl1e_check_options(struct atl1e_adapter *adapter)
181{182{
182 int bd = adapter->bd_number;183 int bd = adapter->bd_number;
183 184
drivers/net/ethernet/atheros/atlx/atl1.c+8−9
@@ -113,7 +113,7 @@ static const struct ethtool_ops atl1_ethtool_ops; · 112 unmodified lines
113 *113 *
114 * Default Value: 100 (200us)114 * Default Value: 100 (200us)
115 */115 */
116static int __devinitdata int_mod_timer[ATL1_MAX_NIC+1] = ATL1_PARAM_INIT;116static int int_mod_timer[ATL1_MAX_NIC+1] = ATL1_PARAM_INIT;
117static unsigned int num_int_mod_timer;117static unsigned int num_int_mod_timer;
118module_param_array_named(int_mod_timer, int_mod_timer, int,118module_param_array_named(int_mod_timer, int_mod_timer, int,
119 &num_int_mod_timer, 0);119 &num_int_mod_timer, 0);
@@ -143,8 +143,8 @@ struct atl1_option { · 23 unmodified lines
143 } arg;143 } arg;
144};144};
145 145
146static int __devinit atl1_validate_option(int *value, struct atl1_option *opt,146static int atl1_validate_option(int *value, struct atl1_option *opt,
147 struct pci_dev *pdev)147 struct pci_dev *pdev)
148{148{
149 if (*value == OPTION_UNSET) {149 if (*value == OPTION_UNSET) {
150 *value = opt->def;150 *value = opt->def;
@@ -204,7 +204,7 @@ static int __devinit atl1_validate_option(int *value, struct atl1_option *opt, · 53 unmodified lines
204 * value exists, a default value is used. The final value is stored204 * value exists, a default value is used. The final value is stored
205 * in a variable in the adapter structure.205 * in a variable in the adapter structure.
206 */206 */
207static void __devinit atl1_check_options(struct atl1_adapter *adapter)207static void atl1_check_options(struct atl1_adapter *adapter)
208{208{
209 struct pci_dev *pdev = adapter->pdev;209 struct pci_dev *pdev = adapter->pdev;
210 int bd = adapter->bd_number;210 int bd = adapter->bd_number;
@@ -945,7 +945,7 @@ static void atl1_set_mac_addr(struct atl1_hw *hw) · 734 unmodified lines
945 * Fields are initialized based on PCI device information and945 * Fields are initialized based on PCI device information and
946 * OS network device settings (MTU size).946 * OS network device settings (MTU size).
947 */947 */
948static int __devinit atl1_sw_init(struct atl1_adapter *adapter)948static int atl1_sw_init(struct atl1_adapter *adapter)
949{949{
950 struct atl1_hw *hw = &adapter->hw;950 struct atl1_hw *hw = &adapter->hw;
951 struct net_device *netdev = adapter->netdev;951 struct net_device *netdev = adapter->netdev;
@@ -2934,8 +2934,7 @@ static const struct net_device_ops atl1_netdev_ops = { · 1982 unmodified lines
2934 * The OS initialization, configuring of the adapter private structure,2934 * The OS initialization, configuring of the adapter private structure,
2935 * and a hardware reset occur.2935 * and a hardware reset occur.
2936 */2936 */
2937static int __devinit atl1_probe(struct pci_dev *pdev,2937static int atl1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
2938 const struct pci_device_id *ent)
2939{2938{
2940 struct net_device *netdev;2939 struct net_device *netdev;
2941 struct atl1_adapter *adapter;2940 struct atl1_adapter *adapter;
@@ -3113,7 +3112,7 @@ err_request_regions: · 171 unmodified lines
3113 * Hot-Plug event, or because the driver is going to be removed from3112 * Hot-Plug event, or because the driver is going to be removed from
3114 * memory.3113 * memory.
3115 */3114 */
3116static void __devexit atl1_remove(struct pci_dev *pdev)3115static void atl1_remove(struct pci_dev *pdev)
3117{3116{
3118 struct net_device *netdev = pci_get_drvdata(pdev);3117 struct net_device *netdev = pci_get_drvdata(pdev);
3119 struct atl1_adapter *adapter;3118 struct atl1_adapter *adapter;
@@ -3146,7 +3145,7 @@ static struct pci_driver atl1_driver = { · 26 unmodified lines
3146 .name = ATLX_DRIVER_NAME,3145 .name = ATLX_DRIVER_NAME,
3147 .id_table = atl1_pci_tbl,3146 .id_table = atl1_pci_tbl,
3148 .probe = atl1_probe,3147 .probe = atl1_probe,
3149 .remove = __devexit_p(atl1_remove),3148 .remove = atl1_remove,
3150 .shutdown = atl1_shutdown,3149 .shutdown = atl1_shutdown,
3151 .driver.pm = ATL1_PM_OPS,3150 .driver.pm = ATL1_PM_OPS,
3152};3151};
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
83 * Fields are initialized based on PCI device information and83 * Fields are initialized based on PCI device information and
84 * OS network device settings (MTU size).84 * OS network device settings (MTU size).
85 */85 */
86static int __devinit atl2_sw_init(struct atl2_adapter *adapter)86static int atl2_sw_init(struct atl2_adapter *adapter)
87{87{
88 struct atl2_hw *hw = &adapter->hw;88 struct atl2_hw *hw = &adapter->hw;
89 struct pci_dev *pdev = adapter->pdev;89 struct pci_dev *pdev = adapter->pdev;
@@ -1338,8 +1338,7 @@ static const struct net_device_ops atl2_netdev_ops = { · 1248 unmodified lines
1338 * The OS initialization, configuring of the adapter private structure,1338 * The OS initialization, configuring of the adapter private structure,
1339 * and a hardware reset occur.1339 * and a hardware reset occur.
1340 */1340 */
1341static int __devinit atl2_probe(struct pci_dev *pdev,1341static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1342 const struct pci_device_id *ent)
1343{1342{
1344 struct net_device *netdev;1343 struct net_device *netdev;
1345 struct atl2_adapter *adapter;1344 struct atl2_adapter *adapter;
@@ -1498,7 +1497,7 @@ err_dma: · 152 unmodified lines
1498 */1497 */
1499/* FIXME: write the original MAC address back in case it was changed from a1498/* FIXME: write the original MAC address back in case it was changed from a
1500 * BIOS-set value, as in atl1 -- CHS */1499 * BIOS-set value, as in atl1 -- CHS */
1501static void __devexit atl2_remove(struct pci_dev *pdev)1500static void atl2_remove(struct pci_dev *pdev)
1502{1501{
1503 struct net_device *netdev = pci_get_drvdata(pdev);1502 struct net_device *netdev = pci_get_drvdata(pdev);
1504 struct atl2_adapter *adapter = netdev_priv(netdev);1503 struct atl2_adapter *adapter = netdev_priv(netdev);
@@ -1705,7 +1704,7 @@ static struct pci_driver atl2_driver = { · 200 unmodified lines
1705 .name = atl2_driver_name,1704 .name = atl2_driver_name,
1706 .id_table = atl2_pci_tbl,1705 .id_table = atl2_pci_tbl,
1707 .probe = atl2_probe,1706 .probe = atl2_probe,
1708 .remove = __devexit_p(atl2_remove),1707 .remove = atl2_remove,
1709 /* Power Management Hooks */1708 /* Power Management Hooks */
1710 .suspend = atl2_suspend,1709 .suspend = atl2_suspend,
1711#ifdef CONFIG_PM1710#ifdef CONFIG_PM
@@ -2845,12 +2844,12 @@ static void atl2_force_ps(struct atl2_hw *hw) · 1133 unmodified lines
2845 */2844 */
2846 2845
2847#define ATL2_PARAM(X, desc) \2846#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; \
2849 MODULE_PARM(X, "1-" __MODULE_STRING(ATL2_MAX_NIC) "i"); \2848 MODULE_PARM(X, "1-" __MODULE_STRING(ATL2_MAX_NIC) "i"); \
2850 MODULE_PARM_DESC(X, desc);2849 MODULE_PARM_DESC(X, desc);
2851#else2850#else
2852#define ATL2_PARAM(X, desc) \2851#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; \
2854 static unsigned int num_##X; \2853 static unsigned int num_##X; \
2855 module_param_array_named(X, X, int, &num_##X, 0); \2854 module_param_array_named(X, X, int, &num_##X, 0); \
2856 MODULE_PARM_DESC(X, desc);2855 MODULE_PARM_DESC(X, desc);
@@ -2934,7 +2933,7 @@ struct atl2_option { · 77 unmodified lines
2934 } arg;2933 } arg;
2935};2934};
2936 2935
2937static int __devinit atl2_validate_option(int *value, struct atl2_option *opt)2936static int atl2_validate_option(int *value, struct atl2_option *opt)
2938{2937{
2939 int i;2938 int i;
2940 struct atl2_opt_list *ent;2939 struct atl2_opt_list *ent;
@@ -2992,7 +2991,7 @@ static int __devinit atl2_validate_option(int *value, struct atl2_option *opt) · 51 unmodified lines
2992 * value exists, a default value is used. The final value is stored2991 * value exists, a default value is used. The final value is stored
2993 * in a variable in the adapter structure.2992 * in a variable in the adapter structure.
2994 */2993 */
2995static void __devinit atl2_check_options(struct atl2_adapter *adapter)2994static void atl2_check_options(struct atl2_adapter *adapter)
2996{2995{
2997 int val;2996 int val;
2998 struct atl2_option opt;2997 struct atl2_option opt;
drivers/net/ethernet/broadcom/Kconfig+1−0
@@ -102,6 +102,7 @@ config TIGON3 · 101 unmodified lines
102 depends on PCI102 depends on PCI
103 select PHYLIB103 select PHYLIB
104 select HWMON104 select HWMON
105 select PTP_1588_CLOCK
105 ---help---106 ---help---
106 This driver supports Broadcom Tigon3 based gigabit Ethernet cards.107 This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
107 108
drivers/net/ethernet/broadcom/b44.c+5−5
@@ -2083,7 +2083,7 @@ out: · 2082 unmodified lines
2083 return err;2083 return err;
2084}2084}
2085 2085
2086static int __devinit b44_get_invariants(struct b44 *bp)2086static int b44_get_invariants(struct b44 *bp)
2087{2087{
2088 struct ssb_device *sdev = bp->sdev;2088 struct ssb_device *sdev = bp->sdev;
2089 int err = 0;2089 int err = 0;
@@ -2141,8 +2141,8 @@ static const struct net_device_ops b44_netdev_ops = { · 51 unmodified lines
2141#endif2141#endif
2142};2142};
2143 2143
2144static int __devinit b44_init_one(struct ssb_device *sdev,2144static int b44_init_one(struct ssb_device *sdev,
2145 const struct ssb_device_id *ent)2145 const struct ssb_device_id *ent)
2146{2146{
2147 struct net_device *dev;2147 struct net_device *dev;
2148 struct b44 *bp;2148 struct b44 *bp;
@@ -2249,7 +2249,7 @@ out: · 100 unmodified lines
2249 return err;2249 return err;
2250}2250}
2251 2251
2252static void __devexit b44_remove_one(struct ssb_device *sdev)2252static void b44_remove_one(struct ssb_device *sdev)
2253{2253{
2254 struct net_device *dev = ssb_get_drvdata(sdev);2254 struct net_device *dev = ssb_get_drvdata(sdev);
2255 2255
@@ -2340,7 +2340,7 @@ static struct ssb_driver b44_ssb_driver = { · 84 unmodified lines
2340 .name = DRV_MODULE_NAME,2340 .name = DRV_MODULE_NAME,
2341 .id_table = b44_ssb_tbl,2341 .id_table = b44_ssb_tbl,
2342 .probe = b44_init_one,2342 .probe = b44_init_one,
2343 .remove = __devexit_p(b44_remove_one),2343 .remove = b44_remove_one,
2344 .suspend = b44_suspend,2344 .suspend = b44_suspend,
2345 .resume = b44_resume,2345 .resume = b44_resume,
2346};2346};
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
1612/*1612/*
1613 * allocate netdevice, request register memory and register device.1613 * allocate netdevice, request register memory and register device.
1614 */1614 */
1615static int __devinit bcm_enet_probe(struct platform_device *pdev)1615static int bcm_enet_probe(struct platform_device *pdev)
1616{1616{
1617 struct bcm_enet_priv *priv;1617 struct bcm_enet_priv *priv;
1618 struct net_device *dev;1618 struct net_device *dev;
@@ -1830,7 +1830,7 @@ out: · 211 unmodified lines
1830/*1830/*
1831 * exit func, stops hardware and unregisters netdevice1831 * exit func, stops hardware and unregisters netdevice
1832 */1832 */
1833static int __devexit bcm_enet_remove(struct platform_device *pdev)1833static int bcm_enet_remove(struct platform_device *pdev)
1834{1834{
1835 struct bcm_enet_priv *priv;1835 struct bcm_enet_priv *priv;
1836 struct net_device *dev;1836 struct net_device *dev;
@@ -1877,7 +1877,7 @@ static int __devexit bcm_enet_remove(struct platform_device *pdev) · 40 unmodified lines
1877 1877
1878struct platform_driver bcm63xx_enet_driver = {1878struct platform_driver bcm63xx_enet_driver = {
1879 .probe = bcm_enet_probe,1879 .probe = bcm_enet_probe,
1880 .remove = __devexit_p(bcm_enet_remove),1880 .remove = bcm_enet_remove,
1881 .driver = {1881 .driver = {
1882 .name = "bcm63xx_enet",1882 .name = "bcm63xx_enet",
1883 .owner = THIS_MODULE,1883 .owner = THIS_MODULE,
@@ -1887,7 +1887,7 @@ struct platform_driver bcm63xx_enet_driver = { · 3 unmodified lines
1887/*1887/*
1888 * reserve & remap memory space shared between all macs1888 * reserve & remap memory space shared between all macs
1889 */1889 */
1890static int __devinit bcm_enet_shared_probe(struct platform_device *pdev)1890static int bcm_enet_shared_probe(struct platform_device *pdev)
1891{1891{
1892 struct resource *res;1892 struct resource *res;
1893 unsigned int iomem_size;1893 unsigned int iomem_size;
@@ -1908,7 +1908,7 @@ static int __devinit bcm_enet_shared_probe(struct platform_device *pdev) · 14 unmodified lines
1908 return 0;1908 return 0;
1909}1909}
1910 1910
1911static int __devexit bcm_enet_shared_remove(struct platform_device *pdev)1911static int bcm_enet_shared_remove(struct platform_device *pdev)
1912{1912{
1913 struct resource *res;1913 struct resource *res;
1914 1914
@@ -1924,7 +1924,7 @@ static int __devexit bcm_enet_shared_remove(struct platform_device *pdev) · 9 unmodified lines
1924 */1924 */
1925struct platform_driver bcm63xx_enet_shared_driver = {1925struct platform_driver bcm63xx_enet_shared_driver = {
1926 .probe = bcm_enet_shared_probe,1926 .probe = bcm_enet_shared_probe,
1927 .remove = __devexit_p(bcm_enet_shared_remove),1927 .remove = bcm_enet_shared_remove,
1928 .driver = {1928 .driver = {
1929 .name = "bcm63xx_enet_shared",1929 .name = "bcm63xx_enet_shared",
1930 .owner = THIS_MODULE,1930 .owner = THIS_MODULE,
drivers/net/ethernet/broadcom/bnx2.c+515−507
@@ -71,7 +71,7 @@ · 70 unmodified lines
71/* Time in jiffies before concluding the transmitter is hung. */71/* Time in jiffies before concluding the transmitter is hung. */
72#define TX_TIMEOUT (5*HZ)72#define TX_TIMEOUT (5*HZ)
73 73
74static char version[] __devinitdata =74static char version[] =
75 "Broadcom NetXtreme II Gigabit Ethernet Driver " DRV_MODULE_NAME " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";75 "Broadcom NetXtreme II Gigabit Ethernet Driver " DRV_MODULE_NAME " v" DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
76 76
77MODULE_AUTHOR("Michael Chan <mchan@broadcom.com>");77MODULE_AUTHOR("Michael Chan <mchan@broadcom.com>");
@@ -106,7 +106,7 @@ typedef enum { · 28 unmodified lines
106/* indexed by board_t, above */106/* indexed by board_t, above */
107static struct {107static struct {
108 char *name;108 char *name;
109} board_info[] __devinitdata = {109} board_info[] = {
110 { "Broadcom NetXtreme II BCM5706 1000Base-T" },110 { "Broadcom NetXtreme II BCM5706 1000Base-T" },
111 { "HP NC370T Multifunction Gigabit Server Adapter" },111 { "HP NC370T Multifunction Gigabit Server Adapter" },
112 { "HP NC370i Multifunction Gigabit Server Adapter" },112 { "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
260 * needs to be skipped.260 * needs to be skipped.
261 */261 */
262 diff = txr->tx_prod - txr->tx_cons;262 diff = txr->tx_prod - txr->tx_cons;
263 if (unlikely(diff >= TX_DESC_CNT)) {263 if (unlikely(diff >= BNX2_TX_DESC_CNT)) {
264 diff &= 0xffff;264 diff &= 0xffff;
265 if (diff == TX_DESC_CNT)265 if (diff == BNX2_TX_DESC_CNT)
266 diff = MAX_TX_DESC_CNT;266 diff = BNX2_MAX_TX_DESC_CNT;
267 }267 }
268 return bp->tx_ring_size - diff;268 return bp->tx_ring_size - diff;
269}269}
@@ -274,8 +274,8 @@ bnx2_reg_rd_ind(struct bnx2 *bp, u32 offset) · 4 unmodified lines
274 u32 val;274 u32 val;
275 275
276 spin_lock_bh(&bp->indirect_lock);276 spin_lock_bh(&bp->indirect_lock);
277 REG_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);277 BNX2_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);
278 val = REG_RD(bp, BNX2_PCICFG_REG_WINDOW);278 val = BNX2_RD(bp, BNX2_PCICFG_REG_WINDOW);
279 spin_unlock_bh(&bp->indirect_lock);279 spin_unlock_bh(&bp->indirect_lock);
280 return val;280 return val;
281}281}
@@ -284,8 +284,8 @@ static void · 2 unmodified lines
284bnx2_reg_wr_ind(struct bnx2 *bp, u32 offset, u32 val)284bnx2_reg_wr_ind(struct bnx2 *bp, u32 offset, u32 val)
285{285{
286 spin_lock_bh(&bp->indirect_lock);286 spin_lock_bh(&bp->indirect_lock);
287 REG_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);287 BNX2_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, offset);
288 REG_WR(bp, BNX2_PCICFG_REG_WINDOW, val);288 BNX2_WR(bp, BNX2_PCICFG_REG_WINDOW, val);
289 spin_unlock_bh(&bp->indirect_lock);289 spin_unlock_bh(&bp->indirect_lock);
290}290}
291 291
@@ -306,21 +306,21 @@ bnx2_ctx_wr(struct bnx2 *bp, u32 cid_addr, u32 offset, u32 val) · 14 unmodified lines
306{306{
307 offset += cid_addr;307 offset += cid_addr;
308 spin_lock_bh(&bp->indirect_lock);308 spin_lock_bh(&bp->indirect_lock);
309 if (CHIP_NUM(bp) == CHIP_NUM_5709) {309 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
310 int i;310 int i;
311 311
312 REG_WR(bp, BNX2_CTX_CTX_DATA, val);312 BNX2_WR(bp, BNX2_CTX_CTX_DATA, val);
313 REG_WR(bp, BNX2_CTX_CTX_CTRL,313 BNX2_WR(bp, BNX2_CTX_CTX_CTRL,
314 offset | BNX2_CTX_CTX_CTRL_WRITE_REQ);314 offset | BNX2_CTX_CTX_CTRL_WRITE_REQ);
315 for (i = 0; i < 5; i++) {315 for (i = 0; i < 5; i++) {
316 val = REG_RD(bp, BNX2_CTX_CTX_CTRL);316 val = BNX2_RD(bp, BNX2_CTX_CTX_CTRL);
317 if ((val & BNX2_CTX_CTX_CTRL_WRITE_REQ) == 0)317 if ((val & BNX2_CTX_CTX_CTRL_WRITE_REQ) == 0)
318 break;318 break;
319 udelay(5);319 udelay(5);
320 }320 }
321 } else {321 } else {
322 REG_WR(bp, BNX2_CTX_DATA_ADR, offset);322 BNX2_WR(bp, BNX2_CTX_DATA_ADR, offset);
323 REG_WR(bp, BNX2_CTX_DATA, val);323 BNX2_WR(bp, BNX2_CTX_DATA, val);
324 }324 }
325 spin_unlock_bh(&bp->indirect_lock);325 spin_unlock_bh(&bp->indirect_lock);
326}326}
@@ -434,7 +434,6 @@ struct cnic_eth_dev *bnx2_cnic_probe(struct net_device *dev) · 107 unmodified lines
434 434
435 return cp;435 return cp;
436}436}
437EXPORT_SYMBOL(bnx2_cnic_probe);
438 437
439static void438static void
440bnx2_cnic_stop(struct bnx2 *bp)439bnx2_cnic_stop(struct bnx2 *bp)
@@ -494,11 +493,11 @@ bnx2_read_phy(struct bnx2 *bp, u32 reg, u32 *val) · 53 unmodified lines
494 int i, ret;493 int i, ret;
495 494
496 if (bp->phy_flags & BNX2_PHY_FLAG_INT_MODE_AUTO_POLLING) {495 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);
498 val1 &= ~BNX2_EMAC_MDIO_MODE_AUTO_POLL;497 val1 &= ~BNX2_EMAC_MDIO_MODE_AUTO_POLL;
499 498
500 REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);499 BNX2_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
501 REG_RD(bp, BNX2_EMAC_MDIO_MODE);500 BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
502 501
503 udelay(40);502 udelay(40);
504 }503 }
@@ -506,16 +505,16 @@ bnx2_read_phy(struct bnx2 *bp, u32 reg, u32 *val) · 1 unmodified line
506 val1 = (bp->phy_addr << 21) | (reg << 16) |505 val1 = (bp->phy_addr << 21) | (reg << 16) |
507 BNX2_EMAC_MDIO_COMM_COMMAND_READ | BNX2_EMAC_MDIO_COMM_DISEXT |506 BNX2_EMAC_MDIO_COMM_COMMAND_READ | BNX2_EMAC_MDIO_COMM_DISEXT |
508 BNX2_EMAC_MDIO_COMM_START_BUSY;507 BNX2_EMAC_MDIO_COMM_START_BUSY;
509 REG_WR(bp, BNX2_EMAC_MDIO_COMM, val1);508 BNX2_WR(bp, BNX2_EMAC_MDIO_COMM, val1);
510 509
511 for (i = 0; i < 50; i++) {510 for (i = 0; i < 50; i++) {
512 udelay(10);511 udelay(10);
513 512
514 val1 = REG_RD(bp, BNX2_EMAC_MDIO_COMM);513 val1 = BNX2_RD(bp, BNX2_EMAC_MDIO_COMM);
515 if (!(val1 & BNX2_EMAC_MDIO_COMM_START_BUSY)) {514 if (!(val1 & BNX2_EMAC_MDIO_COMM_START_BUSY)) {
516 udelay(5);515 udelay(5);
517 516
518 val1 = REG_RD(bp, BNX2_EMAC_MDIO_COMM);517 val1 = BNX2_RD(bp, BNX2_EMAC_MDIO_COMM);
519 val1 &= BNX2_EMAC_MDIO_COMM_DATA;518 val1 &= BNX2_EMAC_MDIO_COMM_DATA;
520 519
521 break;520 break;
@@ -532,11 +531,11 @@ bnx2_read_phy(struct bnx2 *bp, u32 reg, u32 *val) · 10 unmodified lines
532 }531 }
533 532
534 if (bp->phy_flags & BNX2_PHY_FLAG_INT_MODE_AUTO_POLLING) {533 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);
536 val1 |= BNX2_EMAC_MDIO_MODE_AUTO_POLL;535 val1 |= BNX2_EMAC_MDIO_MODE_AUTO_POLL;
537 536
538 REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);537 BNX2_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
539 REG_RD(bp, BNX2_EMAC_MDIO_MODE);538 BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
540 539
541 udelay(40);540 udelay(40);
542 }541 }
@@ -551,11 +550,11 @@ bnx2_write_phy(struct bnx2 *bp, u32 reg, u32 val) · 8 unmodified lines
551 int i, ret;550 int i, ret;
552 551
553 if (bp->phy_flags & BNX2_PHY_FLAG_INT_MODE_AUTO_POLLING) {552 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);
555 val1 &= ~BNX2_EMAC_MDIO_MODE_AUTO_POLL;554 val1 &= ~BNX2_EMAC_MDIO_MODE_AUTO_POLL;
556 555
557 REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);556 BNX2_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
558 REG_RD(bp, BNX2_EMAC_MDIO_MODE);557 BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
559 558
560 udelay(40);559 udelay(40);
561 }560 }
@@ -563,12 +562,12 @@ bnx2_write_phy(struct bnx2 *bp, u32 reg, u32 val) · 1 unmodified line
563 val1 = (bp->phy_addr << 21) | (reg << 16) | val |562 val1 = (bp->phy_addr << 21) | (reg << 16) | val |
564 BNX2_EMAC_MDIO_COMM_COMMAND_WRITE |563 BNX2_EMAC_MDIO_COMM_COMMAND_WRITE |
565 BNX2_EMAC_MDIO_COMM_START_BUSY | BNX2_EMAC_MDIO_COMM_DISEXT;564 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);
567 566
568 for (i = 0; i < 50; i++) {567 for (i = 0; i < 50; i++) {
569 udelay(10);568 udelay(10);
570 569
571 val1 = REG_RD(bp, BNX2_EMAC_MDIO_COMM);570 val1 = BNX2_RD(bp, BNX2_EMAC_MDIO_COMM);
572 if (!(val1 & BNX2_EMAC_MDIO_COMM_START_BUSY)) {571 if (!(val1 & BNX2_EMAC_MDIO_COMM_START_BUSY)) {
573 udelay(5);572 udelay(5);
574 break;573 break;
@@ -581,11 +580,11 @@ bnx2_write_phy(struct bnx2 *bp, u32 reg, u32 val) · 6 unmodified lines
581 ret = 0;580 ret = 0;
582 581
583 if (bp->phy_flags & BNX2_PHY_FLAG_INT_MODE_AUTO_POLLING) {582 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);
585 val1 |= BNX2_EMAC_MDIO_MODE_AUTO_POLL;584 val1 |= BNX2_EMAC_MDIO_MODE_AUTO_POLL;
586 585
587 REG_WR(bp, BNX2_EMAC_MDIO_MODE, val1);586 BNX2_WR(bp, BNX2_EMAC_MDIO_MODE, val1);
588 REG_RD(bp, BNX2_EMAC_MDIO_MODE);587 BNX2_RD(bp, BNX2_EMAC_MDIO_MODE);
589 588
590 udelay(40);589 udelay(40);
591 }590 }
@@ -601,10 +600,10 @@ bnx2_disable_int(struct bnx2 *bp) · 9 unmodified lines
601 600
602 for (i = 0; i < bp->irq_nvecs; i++) {601 for (i = 0; i < bp->irq_nvecs; i++) {
603 bnapi = &bp->bnx2_napi[i];602 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 |
605 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);604 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
606 }605 }
607 REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD);606 BNX2_RD(bp, BNX2_PCICFG_INT_ACK_CMD);
608}607}
609 608
610static void609static void
@@ -616,16 +615,16 @@ bnx2_enable_int(struct bnx2 *bp) · 5 unmodified lines
616 for (i = 0; i < bp->irq_nvecs; i++) {615 for (i = 0; i < bp->irq_nvecs; i++) {
617 bnapi = &bp->bnx2_napi[i];616 bnapi = &bp->bnx2_napi[i];
618 617
619 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |618 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
620 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |619 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
621 BNX2_PCICFG_INT_ACK_CMD_MASK_INT |620 BNX2_PCICFG_INT_ACK_CMD_MASK_INT |
622 bnapi->last_status_idx);621 bnapi->last_status_idx);
623 622
624 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |623 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
625 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |624 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
626 bnapi->last_status_idx);625 bnapi->last_status_idx);
627 }626 }
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);
629}628}
630 629
631static void630static void
@@ -824,7 +823,7 @@ bnx2_free_mem(struct bnx2 *bp) · 192 unmodified lines
824 823
825 for (i = 0; i < bp->ctx_pages; i++) {824 for (i = 0; i < bp->ctx_pages; i++) {
826 if (bp->ctx_blk[i]) {825 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,
828 bp->ctx_blk[i],827 bp->ctx_blk[i],
829 bp->ctx_blk_mapping[i]);828 bp->ctx_blk_mapping[i]);
830 bp->ctx_blk[i] = NULL;829 bp->ctx_blk[i] = NULL;
@@ -887,13 +886,13 @@ bnx2_alloc_mem(struct bnx2 *bp) · 56 unmodified lines
887 886
888 bp->stats_blk_mapping = bp->status_blk_mapping + status_blk_size;887 bp->stats_blk_mapping = bp->status_blk_mapping + status_blk_size;
889 888
890 if (CHIP_NUM(bp) == CHIP_NUM_5709) {889 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
891 bp->ctx_pages = 0x2000 / BCM_PAGE_SIZE;890 bp->ctx_pages = 0x2000 / BNX2_PAGE_SIZE;
892 if (bp->ctx_pages == 0)891 if (bp->ctx_pages == 0)
893 bp->ctx_pages = 1;892 bp->ctx_pages = 1;
894 for (i = 0; i < bp->ctx_pages; i++) {893 for (i = 0; i < bp->ctx_pages; i++) {
895 bp->ctx_blk[i] = dma_alloc_coherent(&bp->pdev->dev,894 bp->ctx_blk[i] = dma_alloc_coherent(&bp->pdev->dev,
896 BCM_PAGE_SIZE,895 BNX2_PAGE_SIZE,
897 &bp->ctx_blk_mapping[i],896 &bp->ctx_blk_mapping[i],
898 GFP_KERNEL);897 GFP_KERNEL);
899 if (bp->ctx_blk[i] == NULL)898 if (bp->ctx_blk[i] == NULL)
@@ -1034,7 +1033,7 @@ bnx2_resolve_flow_ctrl(struct bnx2 *bp) · 134 unmodified lines
1034 }1033 }
1035 1034
1036 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&1035 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&
1037 (CHIP_NUM(bp) == CHIP_NUM_5708)) {1036 (BNX2_CHIP(bp) == BNX2_CHIP_5708)) {
1038 u32 val;1037 u32 val;
1039 1038
1040 bnx2_read_phy(bp, BCM5708S_1000X_STAT1, &val);1039 bnx2_read_phy(bp, BCM5708S_1000X_STAT1, &val);
@@ -1294,14 +1293,14 @@ bnx2_set_mac_link(struct bnx2 *bp) · 253 unmodified lines
1294{1293{
1295 u32 val;1294 u32 val;
1296 1295
1297 REG_WR(bp, BNX2_EMAC_TX_LENGTHS, 0x2620);1296 BNX2_WR(bp, BNX2_EMAC_TX_LENGTHS, 0x2620);
1298 if (bp->link_up && (bp->line_speed == SPEED_1000) &&1297 if (bp->link_up && (bp->line_speed == SPEED_1000) &&
1299 (bp->duplex == DUPLEX_HALF)) {1298 (bp->duplex == DUPLEX_HALF)) {
1300 REG_WR(bp, BNX2_EMAC_TX_LENGTHS, 0x26ff);1299 BNX2_WR(bp, BNX2_EMAC_TX_LENGTHS, 0x26ff);
1301 }1300 }
1302 1301
1303 /* Configure the EMAC mode register. */1302 /* Configure the EMAC mode register. */
1304 val = REG_RD(bp, BNX2_EMAC_MODE);1303 val = BNX2_RD(bp, BNX2_EMAC_MODE);
1305 1304
1306 val &= ~(BNX2_EMAC_MODE_PORT | BNX2_EMAC_MODE_HALF_DUPLEX |1305 val &= ~(BNX2_EMAC_MODE_PORT | BNX2_EMAC_MODE_HALF_DUPLEX |
1307 BNX2_EMAC_MODE_MAC_LOOP | BNX2_EMAC_MODE_FORCE_LINK |1306 BNX2_EMAC_MODE_MAC_LOOP | BNX2_EMAC_MODE_FORCE_LINK |
@@ -1310,7 +1309,7 @@ bnx2_set_mac_link(struct bnx2 *bp) · 2 unmodified lines
1310 if (bp->link_up) {1309 if (bp->link_up) {
1311 switch (bp->line_speed) {1310 switch (bp->line_speed) {
1312 case SPEED_10:1311 case SPEED_10:
1313 if (CHIP_NUM(bp) != CHIP_NUM_5706) {1312 if (BNX2_CHIP(bp) != BNX2_CHIP_5706) {
1314 val |= BNX2_EMAC_MODE_PORT_MII_10M;1313 val |= BNX2_EMAC_MODE_PORT_MII_10M;
1315 break;1314 break;
1316 }1315 }
@@ -1333,25 +1332,25 @@ bnx2_set_mac_link(struct bnx2 *bp) · 16 unmodified lines
1333 /* Set the MAC to operate in the appropriate duplex mode. */1332 /* Set the MAC to operate in the appropriate duplex mode. */
1334 if (bp->duplex == DUPLEX_HALF)1333 if (bp->duplex == DUPLEX_HALF)
1335 val |= BNX2_EMAC_MODE_HALF_DUPLEX;1334 val |= BNX2_EMAC_MODE_HALF_DUPLEX;
1336 REG_WR(bp, BNX2_EMAC_MODE, val);1335 BNX2_WR(bp, BNX2_EMAC_MODE, val);
1337 1336
1338 /* Enable/disable rx PAUSE. */1337 /* Enable/disable rx PAUSE. */
1339 bp->rx_mode &= ~BNX2_EMAC_RX_MODE_FLOW_EN;1338 bp->rx_mode &= ~BNX2_EMAC_RX_MODE_FLOW_EN;
1340 1339
1341 if (bp->flow_ctrl & FLOW_CTRL_RX)1340 if (bp->flow_ctrl & FLOW_CTRL_RX)
1342 bp->rx_mode |= BNX2_EMAC_RX_MODE_FLOW_EN;1341 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);
1344 1343
1345 /* Enable/disable tx PAUSE. */1344 /* Enable/disable tx PAUSE. */
1346 val = REG_RD(bp, BNX2_EMAC_TX_MODE);1345 val = BNX2_RD(bp, BNX2_EMAC_TX_MODE);
1347 val &= ~BNX2_EMAC_TX_MODE_FLOW_EN;1346 val &= ~BNX2_EMAC_TX_MODE_FLOW_EN;
1348 1347
1349 if (bp->flow_ctrl & FLOW_CTRL_TX)1348 if (bp->flow_ctrl & FLOW_CTRL_TX)
1350 val |= BNX2_EMAC_TX_MODE_FLOW_EN;1349 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);
1352 1351
1353 /* Acknowledge the interrupt. */1352 /* 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);
1355 1354
1356 bnx2_init_all_rx_contexts(bp);1355 bnx2_init_all_rx_contexts(bp);
1357}1356}
@@ -1360,7 +1359,7 @@ static void · 2 unmodified lines
1360bnx2_enable_bmsr1(struct bnx2 *bp)1359bnx2_enable_bmsr1(struct bnx2 *bp)
1361{1360{
1362 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&1361 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&
1363 (CHIP_NUM(bp) == CHIP_NUM_5709))1362 (BNX2_CHIP(bp) == BNX2_CHIP_5709))
1364 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,1363 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
1365 MII_BNX2_BLK_ADDR_GP_STATUS);1364 MII_BNX2_BLK_ADDR_GP_STATUS);
1366}1365}
@@ -1369,7 +1368,7 @@ static void · 2 unmodified lines
1369bnx2_disable_bmsr1(struct bnx2 *bp)1368bnx2_disable_bmsr1(struct bnx2 *bp)
1370{1369{
1371 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&1370 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&
1372 (CHIP_NUM(bp) == CHIP_NUM_5709))1371 (BNX2_CHIP(bp) == BNX2_CHIP_5709))
1373 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,1372 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
1374 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);1373 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
1375}1374}
@@ -1386,7 +1385,7 @@ bnx2_test_and_enable_2g5(struct bnx2 *bp) · 10 unmodified lines
1386 if (bp->autoneg & AUTONEG_SPEED)1385 if (bp->autoneg & AUTONEG_SPEED)
1387 bp->advertising |= ADVERTISED_2500baseX_Full;1386 bp->advertising |= ADVERTISED_2500baseX_Full;
1388 1387
1389 if (CHIP_NUM(bp) == CHIP_NUM_5709)1388 if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
1390 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR, MII_BNX2_BLK_ADDR_OVER1G);1389 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR, MII_BNX2_BLK_ADDR_OVER1G);
1391 1390
1392 bnx2_read_phy(bp, bp->mii_up1, &up1);1391 bnx2_read_phy(bp, bp->mii_up1, &up1);
@@ -1396,7 +1395,7 @@ bnx2_test_and_enable_2g5(struct bnx2 *bp) · 3 unmodified lines
1396 ret = 0;1395 ret = 0;
1397 }1396 }
1398 1397
1399 if (CHIP_NUM(bp) == CHIP_NUM_5709)1398 if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
1400 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,1399 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
1401 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);1400 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
1402 1401
@@ -1412,7 +1411,7 @@ bnx2_test_and_disable_2g5(struct bnx2 *bp) · 9 unmodified lines
1412 if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE))1411 if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE))
1413 return 0;1412 return 0;
1414 1413
1415 if (CHIP_NUM(bp) == CHIP_NUM_5709)1414 if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
1416 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR, MII_BNX2_BLK_ADDR_OVER1G);1415 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR, MII_BNX2_BLK_ADDR_OVER1G);
1417 1416
1418 bnx2_read_phy(bp, bp->mii_up1, &up1);1417 bnx2_read_phy(bp, bp->mii_up1, &up1);
@@ -1422,7 +1421,7 @@ bnx2_test_and_disable_2g5(struct bnx2 *bp) · 3 unmodified lines
1422 ret = 1;1421 ret = 1;
1423 }1422 }
1424 1423
1425 if (CHIP_NUM(bp) == CHIP_NUM_5709)1424 if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
1426 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,1425 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
1427 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);1426 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
1428 1427
@@ -1438,7 +1437,7 @@ bnx2_enable_forced_2g5(struct bnx2 *bp) · 9 unmodified lines
1438 if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE))1437 if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE))
1439 return;1438 return;
1440 1439
1441 if (CHIP_NUM(bp) == CHIP_NUM_5709) {1440 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
1442 u32 val;1441 u32 val;
1443 1442
1444 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,1443 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
@@ -1454,7 +1453,7 @@ bnx2_enable_forced_2g5(struct bnx2 *bp) · 9 unmodified lines
1454 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);1453 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
1455 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);1454 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
1456 1455
1457 } else if (CHIP_NUM(bp) == CHIP_NUM_5708) {1456 } else if (BNX2_CHIP(bp) == BNX2_CHIP_5708) {
1458 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);1457 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
1459 if (!err)1458 if (!err)
1460 bmcr |= BCM5708S_BMCR_FORCE_2500;1459 bmcr |= BCM5708S_BMCR_FORCE_2500;
@@ -1482,7 +1481,7 @@ bnx2_disable_forced_2g5(struct bnx2 *bp) · 21 unmodified lines
1482 if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE))1481 if (!(bp->phy_flags & BNX2_PHY_FLAG_2_5G_CAPABLE))
1483 return;1482 return;
1484 1483
1485 if (CHIP_NUM(bp) == CHIP_NUM_5709) {1484 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
1486 u32 val;1485 u32 val;
1487 1486
1488 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,1487 bnx2_write_phy(bp, MII_BNX2_BLK_ADDR,
@@ -1496,7 +1495,7 @@ bnx2_disable_forced_2g5(struct bnx2 *bp) · 7 unmodified lines
1496 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);1495 MII_BNX2_BLK_ADDR_COMBO_IEEEB0);
1497 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);1496 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
1498 1497
1499 } else if (CHIP_NUM(bp) == CHIP_NUM_5708) {1498 } else if (BNX2_CHIP(bp) == BNX2_CHIP_5708) {
1500 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);1499 err = bnx2_read_phy(bp, bp->mii_bmcr, &bmcr);
1501 if (!err)1500 if (!err)
1502 bmcr &= ~BCM5708S_BMCR_FORCE_2500;1501 bmcr &= ~BCM5708S_BMCR_FORCE_2500;
@@ -1547,14 +1546,14 @@ bnx2_set_link(struct bnx2 *bp) · 44 unmodified lines
1547 bnx2_disable_bmsr1(bp);1546 bnx2_disable_bmsr1(bp);
1548 1547
1549 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&1548 if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) &&
1550 (CHIP_NUM(bp) == CHIP_NUM_5706)) {1549 (BNX2_CHIP(bp) == BNX2_CHIP_5706)) {
1551 u32 val, an_dbg;1550 u32 val, an_dbg;
1552 1551
1553 if (bp->phy_flags & BNX2_PHY_FLAG_FORCED_DOWN) {1552 if (bp->phy_flags & BNX2_PHY_FLAG_FORCED_DOWN) {
1554 bnx2_5706s_force_link_dn(bp, 0);1553 bnx2_5706s_force_link_dn(bp, 0);
1555 bp->phy_flags &= ~BNX2_PHY_FLAG_FORCED_DOWN;1554 bp->phy_flags &= ~BNX2_PHY_FLAG_FORCED_DOWN;
1556 }1555 }
1557 val = REG_RD(bp, BNX2_EMAC_STATUS);1556 val = BNX2_RD(bp, BNX2_EMAC_STATUS);
1558 1557
1559 bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_AN_DBG);1558 bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_AN_DBG);
1560 bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &an_dbg);1559 bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &an_dbg);
@@ -1571,11 +1570,11 @@ bnx2_set_link(struct bnx2 *bp) · 10 unmodified lines
1571 bp->link_up = 1;1570 bp->link_up = 1;
1572 1571
1573 if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {1572 if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {
1574 if (CHIP_NUM(bp) == CHIP_NUM_5706)1573 if (BNX2_CHIP(bp) == BNX2_CHIP_5706)
1575 bnx2_5706s_linkup(bp);1574 bnx2_5706s_linkup(bp);
1576 else if (CHIP_NUM(bp) == CHIP_NUM_5708)1575 else if (BNX2_CHIP(bp) == BNX2_CHIP_5708)
1577 bnx2_5708s_linkup(bp);1576 bnx2_5708s_linkup(bp);
1578 else if (CHIP_NUM(bp) == CHIP_NUM_5709)1577 else if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
1579 bnx2_5709s_linkup(bp);1578 bnx2_5709s_linkup(bp);
1580 }1579 }
1581 else {1580 else {
@@ -1757,7 +1756,7 @@ __acquires(&bp->phy_lock) · 175 unmodified lines
1757 new_bmcr = bmcr & ~BMCR_ANENABLE;1756 new_bmcr = bmcr & ~BMCR_ANENABLE;
1758 new_bmcr |= BMCR_SPEED1000;1757 new_bmcr |= BMCR_SPEED1000;
1759 1758
1760 if (CHIP_NUM(bp) == CHIP_NUM_5709) {1759 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
1761 if (bp->req_line_speed == SPEED_2500)1760 if (bp->req_line_speed == SPEED_2500)
1762 bnx2_enable_forced_2g5(bp);1761 bnx2_enable_forced_2g5(bp);
1763 else if (bp->req_line_speed == SPEED_1000) {1762 else if (bp->req_line_speed == SPEED_1000) {
@@ -1765,7 +1764,7 @@ __acquires(&bp->phy_lock) · 1 unmodified line
1765 new_bmcr &= ~0x2000;1764 new_bmcr &= ~0x2000;
1766 }1765 }
1767 1766
1768 } else if (CHIP_NUM(bp) == CHIP_NUM_5708) {1767 } else if (BNX2_CHIP(bp) == BNX2_CHIP_5708) {
1769 if (bp->req_line_speed == SPEED_2500)1768 if (bp->req_line_speed == SPEED_2500)
1770 new_bmcr |= BCM5708S_BMCR_FORCE_2500;1769 new_bmcr |= BCM5708S_BMCR_FORCE_2500;
1771 else1770 else
@@ -1942,8 +1941,8 @@ bnx2_send_heart_beat(struct bnx2 *bp) · 170 unmodified lines
1942 spin_lock(&bp->indirect_lock);1941 spin_lock(&bp->indirect_lock);
1943 msg = (u32) (++bp->fw_drv_pulse_wr_seq & BNX2_DRV_PULSE_SEQ_MASK);1942 msg = (u32) (++bp->fw_drv_pulse_wr_seq & BNX2_DRV_PULSE_SEQ_MASK);
1944 addr = bp->shmem_base + BNX2_DRV_PULSE_MB;1943 addr = bp->shmem_base + BNX2_DRV_PULSE_MB;
1945 REG_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, addr);1944 BNX2_WR(bp, BNX2_PCICFG_REG_WINDOW_ADDRESS, addr);
1946 REG_WR(bp, BNX2_PCICFG_REG_WINDOW, msg);1945 BNX2_WR(bp, BNX2_PCICFG_REG_WINDOW, msg);
1947 spin_unlock(&bp->indirect_lock);1946 spin_unlock(&bp->indirect_lock);
1948}1947}
1949 1948
@@ -2230,9 +2229,9 @@ bnx2_init_5708s_phy(struct bnx2 *bp, int reset_phy) · 280 unmodified lines
2230 bnx2_write_phy(bp, BCM5708S_UP1, val);2229 bnx2_write_phy(bp, BCM5708S_UP1, val);
2231 }2230 }
2232 2231
2233 if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||2232 if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_A0) ||
2234 (CHIP_ID(bp) == CHIP_ID_5708_B0) ||2233 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_B0) ||
2235 (CHIP_ID(bp) == CHIP_ID_5708_B1)) {2234 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_B1)) {
2236 /* increase tx signal amplitude */2235 /* increase tx signal amplitude */
2237 bnx2_write_phy(bp, BCM5708S_BLK_ADDR,2236 bnx2_write_phy(bp, BCM5708S_BLK_ADDR,
2238 BCM5708S_BLK_ADDR_TX_MISC);2237 BCM5708S_BLK_ADDR_TX_MISC);
@@ -2268,8 +2267,8 @@ bnx2_init_5706s_phy(struct bnx2 *bp, int reset_phy) · 29 unmodified lines
2268 2267
2269 bp->phy_flags &= ~BNX2_PHY_FLAG_PARALLEL_DETECT;2268 bp->phy_flags &= ~BNX2_PHY_FLAG_PARALLEL_DETECT;
2270 2269
2271 if (CHIP_NUM(bp) == CHIP_NUM_5706)2270 if (BNX2_CHIP(bp) == BNX2_CHIP_5706)
2272 REG_WR(bp, BNX2_MISC_GP_HW_CTL0, 0x300);2271 BNX2_WR(bp, BNX2_MISC_GP_HW_CTL0, 0x300);
2273 2272
2274 if (bp->dev->mtu > 1500) {2273 if (bp->dev->mtu > 1500) {
2275 u32 val;2274 u32 val;
@@ -2368,7 +2367,7 @@ __acquires(&bp->phy_lock) · 92 unmodified lines
2368 bp->mii_adv = MII_ADVERTISE;2367 bp->mii_adv = MII_ADVERTISE;
2369 bp->mii_lpa = MII_LPA;2368 bp->mii_lpa = MII_LPA;
2370 2369
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);
2372 2371
2373 if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP)2372 if (bp->phy_flags & BNX2_PHY_FLAG_REMOTE_PHY_CAP)
2374 goto setup_phy;2373 goto setup_phy;
@@ -2379,11 +2378,11 @@ __acquires(&bp->phy_lock) · 4 unmodified lines
2379 bp->phy_id |= val & 0xffff;2378 bp->phy_id |= val & 0xffff;
2380 2379
2381 if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {2380 if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {
2382 if (CHIP_NUM(bp) == CHIP_NUM_5706)2381 if (BNX2_CHIP(bp) == BNX2_CHIP_5706)
2383 rc = bnx2_init_5706s_phy(bp, reset_phy);2382 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)
2385 rc = bnx2_init_5708s_phy(bp, reset_phy);2384 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)
2387 rc = bnx2_init_5709s_phy(bp, reset_phy);2386 rc = bnx2_init_5709s_phy(bp, reset_phy);
2388 }2387 }
2389 else {2388 else {
@@ -2402,10 +2401,10 @@ bnx2_set_mac_loopback(struct bnx2 *bp) · 12 unmodified lines
2402{2401{
2403 u32 mac_mode;2402 u32 mac_mode;
2404 2403
2405 mac_mode = REG_RD(bp, BNX2_EMAC_MODE);2404 mac_mode = BNX2_RD(bp, BNX2_EMAC_MODE);
2406 mac_mode &= ~BNX2_EMAC_MODE_PORT;2405 mac_mode &= ~BNX2_EMAC_MODE_PORT;
2407 mac_mode |= BNX2_EMAC_MODE_MAC_LOOP | BNX2_EMAC_MODE_FORCE_LINK;2406 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);
2409 bp->link_up = 1;2408 bp->link_up = 1;
2410 return 0;2409 return 0;
2411}2410}
@@ -2431,13 +2430,13 @@ bnx2_set_phy_loopback(struct bnx2 *bp) · 19 unmodified lines
2431 msleep(100);2430 msleep(100);
2432 }2431 }
2433 2432
2434 mac_mode = REG_RD(bp, BNX2_EMAC_MODE);2433 mac_mode = BNX2_RD(bp, BNX2_EMAC_MODE);
2435 mac_mode &= ~(BNX2_EMAC_MODE_PORT | BNX2_EMAC_MODE_HALF_DUPLEX |2434 mac_mode &= ~(BNX2_EMAC_MODE_PORT | BNX2_EMAC_MODE_HALF_DUPLEX |
2436 BNX2_EMAC_MODE_MAC_LOOP | BNX2_EMAC_MODE_FORCE_LINK |2435 BNX2_EMAC_MODE_MAC_LOOP | BNX2_EMAC_MODE_FORCE_LINK |
2437 BNX2_EMAC_MODE_25G_MODE);2436 BNX2_EMAC_MODE_25G_MODE);
2438 2437
2439 mac_mode |= BNX2_EMAC_MODE_PORT_GMII;2438 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);
2441 bp->link_up = 1;2440 bp->link_up = 1;
2442 return 0;2441 return 0;
2443}2442}
@@ -2449,7 +2448,7 @@ bnx2_dump_mcp_state(struct bnx2 *bp) · 5 unmodified lines
2449 u32 mcp_p0, mcp_p1;2448 u32 mcp_p0, mcp_p1;
2450 2449
2451 netdev_err(dev, "<--- start MCP states dump --->\n");2450 netdev_err(dev, "<--- start MCP states dump --->\n");
2452 if (CHIP_NUM(bp) == CHIP_NUM_5709) {2451 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
2453 mcp_p0 = BNX2_MCP_STATE_P0;2452 mcp_p0 = BNX2_MCP_STATE_P0;
2454 mcp_p1 = BNX2_MCP_STATE_P1;2453 mcp_p1 = BNX2_MCP_STATE_P1;
2455 } else {2454 } else {
@@ -2538,10 +2537,10 @@ bnx2_init_5709_context(struct bnx2 *bp) · 82 unmodified lines
2538 u32 val;2537 u32 val;
2539 2538
2540 val = BNX2_CTX_COMMAND_ENABLED | BNX2_CTX_COMMAND_MEM_INIT | (1 << 12);2539 val = BNX2_CTX_COMMAND_ENABLED | BNX2_CTX_COMMAND_MEM_INIT | (1 << 12);
2541 val |= (BCM_PAGE_BITS - 8) << 16;2540 val |= (BNX2_PAGE_BITS - 8) << 16;
2542 REG_WR(bp, BNX2_CTX_COMMAND, val);2541 BNX2_WR(bp, BNX2_CTX_COMMAND, val);
2543 for (i = 0; i < 10; i++) {2542 for (i = 0; i < 10; i++) {
2544 val = REG_RD(bp, BNX2_CTX_COMMAND);2543 val = BNX2_RD(bp, BNX2_CTX_COMMAND);
2545 if (!(val & BNX2_CTX_COMMAND_MEM_INIT))2544 if (!(val & BNX2_CTX_COMMAND_MEM_INIT))
2546 break;2545 break;
2547 udelay(2);2546 udelay(2);
@@ -2553,20 +2552,20 @@ bnx2_init_5709_context(struct bnx2 *bp) · 5 unmodified lines
2553 int j;2552 int j;
2554 2553
2555 if (bp->ctx_blk[i])2554 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);
2557 else2556 else
2558 return -ENOMEM;2557 return -ENOMEM;
2559 2558
2560 REG_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA0,2559 BNX2_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA0,
2561 (bp->ctx_blk_mapping[i] & 0xffffffff) |2560 (bp->ctx_blk_mapping[i] & 0xffffffff) |
2562 BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID);2561 BNX2_CTX_HOST_PAGE_TBL_DATA0_VALID);
2563 REG_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA1,2562 BNX2_WR(bp, BNX2_CTX_HOST_PAGE_TBL_DATA1,
2564 (u64) bp->ctx_blk_mapping[i] >> 32);2563 (u64) bp->ctx_blk_mapping[i] >> 32);
2565 REG_WR(bp, BNX2_CTX_HOST_PAGE_TBL_CTRL, i |2564 BNX2_WR(bp, BNX2_CTX_HOST_PAGE_TBL_CTRL, i |
2566 BNX2_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ);2565 BNX2_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ);
2567 for (j = 0; j < 10; j++) {2566 for (j = 0; j < 10; j++) {
2568 2567
2569 val = REG_RD(bp, BNX2_CTX_HOST_PAGE_TBL_CTRL);2568 val = BNX2_RD(bp, BNX2_CTX_HOST_PAGE_TBL_CTRL);
2570 if (!(val & BNX2_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ))2569 if (!(val & BNX2_CTX_HOST_PAGE_TBL_CTRL_WRITE_REQ))
2571 break;2570 break;
2572 udelay(5);2571 udelay(5);
@@ -2591,7 +2590,7 @@ bnx2_init_context(struct bnx2 *bp) · 18 unmodified lines
2591 2590
2592 vcid--;2591 vcid--;
2593 2592
2594 if (CHIP_ID(bp) == CHIP_ID_5706_A0) {2593 if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) {
2595 u32 new_vcid;2594 u32 new_vcid;
2596 2595
2597 vcid_addr = GET_PCID_ADDR(vcid);2596 vcid_addr = GET_PCID_ADDR(vcid);
@@ -2612,8 +2611,8 @@ bnx2_init_context(struct bnx2 *bp) · 14 unmodified lines
2612 vcid_addr += (i << PHY_CTX_SHIFT);2611 vcid_addr += (i << PHY_CTX_SHIFT);
2613 pcid_addr += (i << PHY_CTX_SHIFT);2612 pcid_addr += (i << PHY_CTX_SHIFT);
2614 2613
2615 REG_WR(bp, BNX2_CTX_VIRT_ADDR, vcid_addr);2614 BNX2_WR(bp, BNX2_CTX_VIRT_ADDR, vcid_addr);
2616 REG_WR(bp, BNX2_CTX_PAGE_TBL, pcid_addr);2615 BNX2_WR(bp, BNX2_CTX_PAGE_TBL, pcid_addr);
2617 2616
2618 /* Zero out the context. */2617 /* Zero out the context. */
2619 for (offset = 0; offset < PHY_CTX_SIZE; offset += 4)2618 for (offset = 0; offset < PHY_CTX_SIZE; offset += 4)
@@ -2633,7 +2632,7 @@ bnx2_alloc_bad_rbuf(struct bnx2 *bp) · 13 unmodified lines
2633 if (good_mbuf == NULL)2632 if (good_mbuf == NULL)
2634 return -ENOMEM;2633 return -ENOMEM;
2635 2634
2636 REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,2635 BNX2_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
2637 BNX2_MISC_ENABLE_SET_BITS_RX_MBUF_ENABLE);2636 BNX2_MISC_ENABLE_SET_BITS_RX_MBUF_ENABLE);
2638 2637
2639 good_mbuf_cnt = 0;2638 good_mbuf_cnt = 0;
@@ -2678,21 +2677,21 @@ bnx2_set_mac_addr(struct bnx2 *bp, u8 *mac_addr, u32 pos) · 38 unmodified lines
2678 2677
2679 val = (mac_addr[0] << 8) | mac_addr[1];2678 val = (mac_addr[0] << 8) | mac_addr[1];
2680 2679
2681 REG_WR(bp, BNX2_EMAC_MAC_MATCH0 + (pos * 8), val);2680 BNX2_WR(bp, BNX2_EMAC_MAC_MATCH0 + (pos * 8), val);
2682 2681
2683 val = (mac_addr[2] << 24) | (mac_addr[3] << 16) |2682 val = (mac_addr[2] << 24) | (mac_addr[3] << 16) |
2684 (mac_addr[4] << 8) | mac_addr[5];2683 (mac_addr[4] << 8) | mac_addr[5];
2685 2684
2686 REG_WR(bp, BNX2_EMAC_MAC_MATCH1 + (pos * 8), val);2685 BNX2_WR(bp, BNX2_EMAC_MAC_MATCH1 + (pos * 8), val);
2687}2686}
2688 2687
2689static inline int2688static inline int
2690bnx2_alloc_rx_page(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index, gfp_t gfp)2689bnx2_alloc_rx_page(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index, gfp_t gfp)
2691{2690{
2692 dma_addr_t mapping;2691 dma_addr_t mapping;
2693 struct sw_pg *rx_pg = &rxr->rx_pg_ring[index];2692 struct bnx2_sw_pg *rx_pg = &rxr->rx_pg_ring[index];
2694 struct rx_bd *rxbd =2693 struct bnx2_rx_bd *rxbd =
2695 &rxr->rx_pg_desc_ring[RX_RING(index)][RX_IDX(index)];2694 &rxr->rx_pg_desc_ring[BNX2_RX_RING(index)][BNX2_RX_IDX(index)];
2696 struct page *page = alloc_page(gfp);2695 struct page *page = alloc_page(gfp);
2697 2696
2698 if (!page)2697 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
2714static void2713static void
2715bnx2_free_rx_page(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index)2714bnx2_free_rx_page(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index)
2716{2715{
2717 struct sw_pg *rx_pg = &rxr->rx_pg_ring[index];2716 struct bnx2_sw_pg *rx_pg = &rxr->rx_pg_ring[index];
2718 struct page *page = rx_pg->page;2717 struct page *page = rx_pg->page;
2719 2718
2720 if (!page)2719 if (!page)
@@ -2731,9 +2730,10 @@ static inline int · 10 unmodified lines
2731bnx2_alloc_rx_data(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index, gfp_t gfp)2730bnx2_alloc_rx_data(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr, u16 index, gfp_t gfp)
2732{2731{
2733 u8 *data;2732 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];
2735 dma_addr_t mapping;2734 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)];
2737 2737
2738 data = kmalloc(bp->rx_buf_size, gfp);2738 data = kmalloc(bp->rx_buf_size, gfp);
2739 if (!data)2739 if (!data)
@@ -2770,9 +2770,9 @@ bnx2_phy_event_is_set(struct bnx2 *bp, struct bnx2_napi *bnapi, u32 event) · 30 unmodified lines
2770 old_link_state = sblk->status_attn_bits_ack & event;2770 old_link_state = sblk->status_attn_bits_ack & event;
2771 if (new_link_state != old_link_state) {2771 if (new_link_state != old_link_state) {
2772 if (new_link_state)2772 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);
2774 else2774 else
2775 REG_WR(bp, BNX2_PCICFG_STATUS_BIT_CLEAR_CMD, event);2775 BNX2_WR(bp, BNX2_PCICFG_STATUS_BIT_CLEAR_CMD, event);
2776 } else2776 } else
2777 is_set = 0;2777 is_set = 0;
2778 2778
@@ -2802,7 +2802,7 @@ bnx2_get_hw_tx_cons(struct bnx2_napi *bnapi) · 23 unmodified lines
2802 barrier();2802 barrier();
2803 cons = *bnapi->hw_tx_cons_ptr;2803 cons = *bnapi->hw_tx_cons_ptr;
2804 barrier();2804 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))
2806 cons++;2806 cons++;
2807 return cons;2807 return cons;
2808}2808}
@@ -2823,11 +2823,11 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 14 unmodified lines
2823 sw_cons = txr->tx_cons;2823 sw_cons = txr->tx_cons;
2824 2824
2825 while (sw_cons != hw_cons) {2825 while (sw_cons != hw_cons) {
2826 struct sw_tx_bd *tx_buf;2826 struct bnx2_sw_tx_bd *tx_buf;
2827 struct sk_buff *skb;2827 struct sk_buff *skb;
2828 int i, last;2828 int i, last;
2829 2829
2830 sw_ring_cons = TX_RING_IDX(sw_cons);2830 sw_ring_cons = BNX2_TX_RING_IDX(sw_cons);
2831 2831
2832 tx_buf = &txr->tx_buf_ring[sw_ring_cons];2832 tx_buf = &txr->tx_buf_ring[sw_ring_cons];
2833 skb = tx_buf->skb;2833 skb = tx_buf->skb;
@@ -2841,7 +2841,7 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 7 unmodified lines
2841 2841
2842 last_idx = sw_cons + tx_buf->nr_frags + 1;2842 last_idx = sw_cons + tx_buf->nr_frags + 1;
2843 last_ring_idx = sw_ring_cons + tx_buf->nr_frags + 1;2843 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)) {
2845 last_idx++;2845 last_idx++;
2846 }2846 }
2847 if (((s16) ((s16) last_idx - (s16) hw_cons)) > 0) {2847 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
2856 last = tx_buf->nr_frags;2856 last = tx_buf->nr_frags;
2857 2857
2858 for (i = 0; i < last; i++) {2858 for (i = 0; i < last; i++) {
2859 sw_cons = NEXT_TX_BD(sw_cons);2859 struct bnx2_sw_tx_bd *tx_buf;
2860 2860
2861 sw_cons = BNX2_NEXT_TX_BD(sw_cons);
2862
2863 tx_buf = &txr->tx_buf_ring[BNX2_TX_RING_IDX(sw_cons)];
2861 dma_unmap_page(&bp->pdev->dev,2864 dma_unmap_page(&bp->pdev->dev,
2862 dma_unmap_addr(2865 dma_unmap_addr(tx_buf, mapping),
2863 &txr->tx_buf_ring[TX_RING_IDX(sw_cons)],
2864 mapping),
2865 skb_frag_size(&skb_shinfo(skb)->frags[i]),2866 skb_frag_size(&skb_shinfo(skb)->frags[i]),
2866 PCI_DMA_TODEVICE);2867 PCI_DMA_TODEVICE);
2867 }2868 }
2868 2869
2869 sw_cons = NEXT_TX_BD(sw_cons);2870 sw_cons = BNX2_NEXT_TX_BD(sw_cons);
2870 2871
2871 tx_bytes += skb->len;2872 tx_bytes += skb->len;
2872 dev_kfree_skb(skb);2873 dev_kfree_skb(skb);
@@ -2905,8 +2906,8 @@ static void · 32 unmodified lines
2905bnx2_reuse_rx_skb_pages(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr,2906bnx2_reuse_rx_skb_pages(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr,
2906 struct sk_buff *skb, int count)2907 struct sk_buff *skb, int count)
2907{2908{
2908 struct sw_pg *cons_rx_pg, *prod_rx_pg;2909 struct bnx2_sw_pg *cons_rx_pg, *prod_rx_pg;
2909 struct rx_bd *cons_bd, *prod_bd;2910 struct bnx2_rx_bd *cons_bd, *prod_bd;
2910 int i;2911 int i;
2911 u16 hw_prod, prod;2912 u16 hw_prod, prod;
2912 u16 cons = rxr->rx_pg_cons;2913 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
2933 hw_prod = rxr->rx_pg_prod;2934 hw_prod = rxr->rx_pg_prod;
2934 2935
2935 for (i = 0; i < count; i++) {2936 for (i = 0; i < count; i++) {
2936 prod = RX_PG_RING_IDX(hw_prod);2937 prod = BNX2_RX_PG_RING_IDX(hw_prod);
2937 2938
2938 prod_rx_pg = &rxr->rx_pg_ring[prod];2939 prod_rx_pg = &rxr->rx_pg_ring[prod];
2939 cons_rx_pg = &rxr->rx_pg_ring[cons];2940 cons_rx_pg = &rxr->rx_pg_ring[cons];
2940 cons_bd = &rxr->rx_pg_desc_ring[RX_RING(cons)][RX_IDX(cons)];2941 cons_bd = &rxr->rx_pg_desc_ring[BNX2_RX_RING(cons)]
2941 prod_bd = &rxr->rx_pg_desc_ring[RX_RING(prod)][RX_IDX(prod)];2942 [BNX2_RX_IDX(cons)];
2943 prod_bd = &rxr->rx_pg_desc_ring[BNX2_RX_RING(prod)]
2944 [BNX2_RX_IDX(prod)];
2942 2945
2943 if (prod != cons) {2946 if (prod != cons) {
2944 prod_rx_pg->page = cons_rx_pg->page;2947 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
2950 prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo;2953 prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo;
2951 2954
2952 }2955 }
2953 cons = RX_PG_RING_IDX(NEXT_RX_BD(cons));2956 cons = BNX2_RX_PG_RING_IDX(BNX2_NEXT_RX_BD(cons));
2954 hw_prod = NEXT_RX_BD(hw_prod);2957 hw_prod = BNX2_NEXT_RX_BD(hw_prod);
2955 }2958 }
2956 rxr->rx_pg_prod = hw_prod;2959 rxr->rx_pg_prod = hw_prod;
2957 rxr->rx_pg_cons = cons;2960 rxr->rx_pg_cons = cons;
@@ -2961,8 +2964,8 @@ static inline void · 3 unmodified lines
2961bnx2_reuse_rx_data(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr,2964bnx2_reuse_rx_data(struct bnx2 *bp, struct bnx2_rx_ring_info *rxr,
2962 u8 *data, u16 cons, u16 prod)2965 u8 *data, u16 cons, u16 prod)
2963{2966{
2964 struct sw_bd *cons_rx_buf, *prod_rx_buf;2967 struct bnx2_sw_bd *cons_rx_buf, *prod_rx_buf;
2965 struct rx_bd *cons_bd, *prod_bd;2968 struct bnx2_rx_bd *cons_bd, *prod_bd;
2966 2969
2967 cons_rx_buf = &rxr->rx_buf_ring[cons];2970 cons_rx_buf = &rxr->rx_buf_ring[cons];
2968 prod_rx_buf = &rxr->rx_buf_ring[prod];2971 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
2981 dma_unmap_addr_set(prod_rx_buf, mapping,2984 dma_unmap_addr_set(prod_rx_buf, mapping,
2982 dma_unmap_addr(cons_rx_buf, mapping));2985 dma_unmap_addr(cons_rx_buf, mapping));
2983 2986
2984 cons_bd = &rxr->rx_desc_ring[RX_RING(cons)][RX_IDX(cons)];2987 cons_bd = &rxr->rx_desc_ring[BNX2_RX_RING(cons)][BNX2_RX_IDX(cons)];
2985 prod_bd = &rxr->rx_desc_ring[RX_RING(prod)][RX_IDX(prod)];2988 prod_bd = &rxr->rx_desc_ring[BNX2_RX_RING(prod)][BNX2_RX_IDX(prod)];
2986 prod_bd->rx_bd_haddr_hi = cons_bd->rx_bd_haddr_hi;2989 prod_bd->rx_bd_haddr_hi = cons_bd->rx_bd_haddr_hi;
2987 prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo;2990 prod_bd->rx_bd_haddr_lo = cons_bd->rx_bd_haddr_lo;
2988}2991}
@@ -3022,7 +3025,7 @@ error: · 33 unmodified lines
3022 return skb;3025 return skb;
3023 } else {3026 } else {
3024 unsigned int i, frag_len, frag_size, pages;3027 unsigned int i, frag_len, frag_size, pages;
3025 struct sw_pg *rx_pg;3028 struct bnx2_sw_pg *rx_pg;
3026 u16 pg_cons = rxr->rx_pg_cons;3029 u16 pg_cons = rxr->rx_pg_cons;
3027 u16 pg_prod = rxr->rx_pg_prod;3030 u16 pg_prod = rxr->rx_pg_prod;
3028 3031
@@ -3065,7 +3068,7 @@ error: · 36 unmodified lines
3065 rx_pg->page = NULL;3068 rx_pg->page = NULL;
3066 3069
3067 err = bnx2_alloc_rx_page(bp, rxr,3070 err = bnx2_alloc_rx_page(bp, rxr,
3068 RX_PG_RING_IDX(pg_prod),3071 BNX2_RX_PG_RING_IDX(pg_prod),
3069 GFP_ATOMIC);3072 GFP_ATOMIC);
3070 if (unlikely(err)) {3073 if (unlikely(err)) {
3071 rxr->rx_pg_cons = pg_cons;3074 rxr->rx_pg_cons = pg_cons;
@@ -3083,8 +3086,8 @@ error: · 11 unmodified lines
3083 skb->truesize += PAGE_SIZE;3086 skb->truesize += PAGE_SIZE;
3084 skb->len += frag_len;3087 skb->len += frag_len;
3085 3088
3086 pg_prod = NEXT_RX_BD(pg_prod);3089 pg_prod = BNX2_NEXT_RX_BD(pg_prod);
3087 pg_cons = RX_PG_RING_IDX(NEXT_RX_BD(pg_cons));3090 pg_cons = BNX2_RX_PG_RING_IDX(BNX2_NEXT_RX_BD(pg_cons));
3088 }3091 }
3089 rxr->rx_pg_prod = pg_prod;3092 rxr->rx_pg_prod = pg_prod;
3090 rxr->rx_pg_cons = pg_cons;3093 rxr->rx_pg_cons = pg_cons;
@@ -3101,7 +3104,7 @@ bnx2_get_hw_rx_cons(struct bnx2_napi *bnapi) · 10 unmodified lines
3101 barrier();3104 barrier();
3102 cons = *bnapi->hw_rx_cons_ptr;3105 cons = *bnapi->hw_rx_cons_ptr;
3103 barrier();3106 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))
3105 cons++;3108 cons++;
3106 return cons;3109 return cons;
3107}3110}
@@ -3125,13 +3128,14 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 17 unmodified lines
3125 while (sw_cons != hw_cons) {3128 while (sw_cons != hw_cons) {
3126 unsigned int len, hdr_len;3129 unsigned int len, hdr_len;
3127 u32 status;3130 u32 status;
3128 struct sw_bd *rx_buf, *next_rx_buf;3131 struct bnx2_sw_bd *rx_buf, *next_rx_buf;
3129 struct sk_buff *skb;3132 struct sk_buff *skb;
3130 dma_addr_t dma_addr;3133 dma_addr_t dma_addr;
3131 u8 *data;3134 u8 *data;
3135 u16 next_ring_idx;
3132 3136
3133 sw_ring_cons = RX_RING_IDX(sw_cons);3137 sw_ring_cons = BNX2_RX_RING_IDX(sw_cons);
3134 sw_ring_prod = RX_RING_IDX(sw_prod);3138 sw_ring_prod = BNX2_RX_RING_IDX(sw_prod);
3135 3139
3136 rx_buf = &rxr->rx_buf_ring[sw_ring_cons];3140 rx_buf = &rxr->rx_buf_ring[sw_ring_cons];
3137 data = rx_buf->data;3141 data = rx_buf->data;
@@ -3146,8 +3150,8 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 8 unmodified lines
3146 BNX2_RX_OFFSET + BNX2_RX_COPY_THRESH,3150 BNX2_RX_OFFSET + BNX2_RX_COPY_THRESH,
3147 PCI_DMA_FROMDEVICE);3151 PCI_DMA_FROMDEVICE);
3148 3152
3149 next_rx_buf =3153 next_ring_idx = BNX2_RX_RING_IDX(BNX2_NEXT_RX_BD(sw_cons));
3150 &rxr->rx_buf_ring[RX_RING_IDX(NEXT_RX_BD(sw_cons))];3154 next_rx_buf = &rxr->rx_buf_ring[next_ring_idx];
3151 prefetch(get_l2_fhdr(next_rx_buf->data));3155 prefetch(get_l2_fhdr(next_rx_buf->data));
3152 3156
3153 len = rx_hdr->l2_fhdr_pkt_len;3157 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
3239 rx_pkt++;3243 rx_pkt++;
3240 3244
3241next_rx:3245next_rx:
3242 sw_cons = NEXT_RX_BD(sw_cons);3246 sw_cons = BNX2_NEXT_RX_BD(sw_cons);
3243 sw_prod = NEXT_RX_BD(sw_prod);3247 sw_prod = BNX2_NEXT_RX_BD(sw_prod);
3244 3248
3245 if ((rx_pkt == budget))3249 if ((rx_pkt == budget))
3246 break;3250 break;
@@ -3255,11 +3259,11 @@ next_rx: · 8 unmodified lines
3255 rxr->rx_prod = sw_prod;3259 rxr->rx_prod = sw_prod;
3256 3260
3257 if (pg_ring_used)3261 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);
3259 3263
3260 REG_WR16(bp, rxr->rx_bidx_addr, sw_prod);3264 BNX2_WR16(bp, rxr->rx_bidx_addr, sw_prod);
3261 3265
3262 REG_WR(bp, rxr->rx_bseq_addr, rxr->rx_prod_bseq);3266 BNX2_WR(bp, rxr->rx_bseq_addr, rxr->rx_prod_bseq);
3263 3267
3264 mmiowb();3268 mmiowb();
3265 3269
@@ -3277,7 +3281,7 @@ bnx2_msi(int irq, void *dev_instance) · 11 unmodified lines
3277 struct bnx2 *bp = bnapi->bp;3281 struct bnx2 *bp = bnapi->bp;
3278 3282
3279 prefetch(bnapi->status_blk.msi);3283 prefetch(bnapi->status_blk.msi);
3280 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,3284 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3281 BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |3285 BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |
3282 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);3286 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
3283 3287
@@ -3321,18 +3325,18 @@ bnx2_interrupt(int irq, void *dev_instance) · 37 unmodified lines
3321 * the status block write.3325 * the status block write.
3322 */3326 */
3323 if ((sblk->status_idx == bnapi->last_status_idx) &&3327 if ((sblk->status_idx == bnapi->last_status_idx) &&
3324 (REG_RD(bp, BNX2_PCICFG_MISC_STATUS) &3328 (BNX2_RD(bp, BNX2_PCICFG_MISC_STATUS) &
3325 BNX2_PCICFG_MISC_STATUS_INTA_VALUE))3329 BNX2_PCICFG_MISC_STATUS_INTA_VALUE))
3326 return IRQ_NONE;3330 return IRQ_NONE;
3327 3331
3328 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,3332 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3329 BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |3333 BNX2_PCICFG_INT_ACK_CMD_USE_INT_HC_PARAM |
3330 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);3334 BNX2_PCICFG_INT_ACK_CMD_MASK_INT);
3331 3335
3332 /* Read back to deassert IRQ immediately to avoid too many3336 /* Read back to deassert IRQ immediately to avoid too many
3333 * spurious interrupts.3337 * spurious interrupts.
3334 */3338 */
3335 REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD);3339 BNX2_RD(bp, BNX2_PCICFG_INT_ACK_CMD);
3336 3340
3337 /* Return here if interrupt is shared and is disabled. */3341 /* Return here if interrupt is shared and is disabled. */
3338 if (unlikely(atomic_read(&bp->intr_sem) != 0))3342 if (unlikely(atomic_read(&bp->intr_sem) != 0))
@@ -3388,14 +3392,14 @@ bnx2_chk_missed_msi(struct bnx2 *bp) · 49 unmodified lines
3388 u32 msi_ctrl;3392 u32 msi_ctrl;
3389 3393
3390 if (bnx2_has_work(bnapi)) {3394 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);
3392 if (!(msi_ctrl & BNX2_PCICFG_MSI_CONTROL_ENABLE))3396 if (!(msi_ctrl & BNX2_PCICFG_MSI_CONTROL_ENABLE))
3393 return;3397 return;
3394 3398
3395 if (bnapi->last_status_idx == bp->idle_chk_status_idx) {3399 if (bnapi->last_status_idx == bp->idle_chk_status_idx) {
3396 REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl &3400 BNX2_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl &
3397 ~BNX2_PCICFG_MSI_CONTROL_ENABLE);3401 ~BNX2_PCICFG_MSI_CONTROL_ENABLE);
3398 REG_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl);3402 BNX2_WR(bp, BNX2_PCICFG_MSI_CONTROL, msi_ctrl);
3399 bnx2_msi(bp->irq_tbl[0].vector, bnapi);3403 bnx2_msi(bp->irq_tbl[0].vector, bnapi);
3400 }3404 }
3401 }3405 }
@@ -3434,9 +3438,9 @@ static void bnx2_poll_link(struct bnx2 *bp, struct bnx2_napi *bnapi) · 32 unmodified lines
3434 /* This is needed to take care of transient status3438 /* This is needed to take care of transient status
3435 * during link changes.3439 * during link changes.
3436 */3440 */
3437 REG_WR(bp, BNX2_HC_COMMAND,3441 BNX2_WR(bp, BNX2_HC_COMMAND,
3438 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);3442 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
3439 REG_RD(bp, BNX2_HC_COMMAND);3443 BNX2_RD(bp, BNX2_HC_COMMAND);
3440 }3444 }
3441}3445}
3442 3446
@@ -3473,9 +3477,9 @@ static int bnx2_poll_msix(struct napi_struct *napi, int budget) · 30 unmodified lines
3473 if (likely(!bnx2_has_fast_work(bnapi))) {3477 if (likely(!bnx2_has_fast_work(bnapi))) {
3474 3478
3475 napi_complete(napi);3479 napi_complete(napi);
3476 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |3480 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD, bnapi->int_num |
3477 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |3481 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3478 bnapi->last_status_idx);3482 bnapi->last_status_idx);
3479 break;3483 break;
3480 }3484 }
3481 }3485 }
@@ -3511,19 +3515,19 @@ static int bnx2_poll(struct napi_struct *napi, int budget) · 29 unmodified lines
3511 if (likely(!bnx2_has_work(bnapi))) {3515 if (likely(!bnx2_has_work(bnapi))) {
3512 napi_complete(napi);3516 napi_complete(napi);
3513 if (likely(bp->flags & BNX2_FLAG_USING_MSI_OR_MSIX)) {3517 if (likely(bp->flags & BNX2_FLAG_USING_MSI_OR_MSIX)) {
3514 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,3518 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3515 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |3519 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3516 bnapi->last_status_idx);3520 bnapi->last_status_idx);
3517 break;3521 break;
3518 }3522 }
3519 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,3523 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3520 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |3524 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3521 BNX2_PCICFG_INT_ACK_CMD_MASK_INT |3525 BNX2_PCICFG_INT_ACK_CMD_MASK_INT |
3522 bnapi->last_status_idx);3526 bnapi->last_status_idx);
3523 3527
3524 REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD,3528 BNX2_WR(bp, BNX2_PCICFG_INT_ACK_CMD,
3525 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |3529 BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID |
3526 bnapi->last_status_idx);3530 bnapi->last_status_idx);
3527 break;3531 break;
3528 }3532 }
3529 }3533 }
@@ -3561,8 +3565,8 @@ bnx2_set_rx_mode(struct net_device *dev) · 31 unmodified lines
3561 }3565 }
3562 else if (dev->flags & IFF_ALLMULTI) {3566 else if (dev->flags & IFF_ALLMULTI) {
3563 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {3567 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {
3564 REG_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),3568 BNX2_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
3565 0xffffffff);3569 0xffffffff);
3566 }3570 }
3567 sort_mode |= BNX2_RPM_SORT_USER0_MC_EN;3571 sort_mode |= BNX2_RPM_SORT_USER0_MC_EN;
3568 }3572 }
@@ -3584,8 +3588,8 @@ bnx2_set_rx_mode(struct net_device *dev) · 15 unmodified lines
3584 }3588 }
3585 3589
3586 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {3590 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {
3587 REG_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),3591 BNX2_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
3588 mc_filter[i]);3592 mc_filter[i]);
3589 }3593 }
3590 3594
3591 sort_mode |= BNX2_RPM_SORT_USER0_MC_HSH_EN;3595 sort_mode |= BNX2_RPM_SORT_USER0_MC_HSH_EN;
@@ -3610,12 +3614,12 @@ bnx2_set_rx_mode(struct net_device *dev) · 18 unmodified lines
3610 3614
3611 if (rx_mode != bp->rx_mode) {3615 if (rx_mode != bp->rx_mode) {
3612 bp->rx_mode = rx_mode;3616 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);
3614 }3618 }
3615 3619
3616 REG_WR(bp, BNX2_RPM_SORT_USER0, 0x0);3620 BNX2_WR(bp, BNX2_RPM_SORT_USER0, 0x0);
3617 REG_WR(bp, BNX2_RPM_SORT_USER0, sort_mode);3621 BNX2_WR(bp, BNX2_RPM_SORT_USER0, sort_mode);
3618 REG_WR(bp, BNX2_RPM_SORT_USER0, sort_mode | BNX2_RPM_SORT_USER0_ENA);3622 BNX2_WR(bp, BNX2_RPM_SORT_USER0, sort_mode | BNX2_RPM_SORT_USER0_ENA);
3619 3623
3620 spin_unlock_bh(&bp->phy_lock);3624 spin_unlock_bh(&bp->phy_lock);
3621}3625}
@@ -3663,10 +3667,10 @@ static int bnx2_request_uncached_firmware(struct bnx2 *bp) · 41 unmodified lines
3663 const struct bnx2_rv2p_fw_file *rv2p_fw;3667 const struct bnx2_rv2p_fw_file *rv2p_fw;
3664 int rc;3668 int rc;
3665 3669
3666 if (CHIP_NUM(bp) == CHIP_NUM_5709) {3670 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
3667 mips_fw_file = FW_MIPS_FILE_09;3671 mips_fw_file = FW_MIPS_FILE_09;
3668 if ((CHIP_ID(bp) == CHIP_ID_5709_A0) ||3672 if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5709_A0) ||
3669 (CHIP_ID(bp) == CHIP_ID_5709_A1))3673 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5709_A1))
3670 rv2p_fw_file = FW_RV2P_FILE_09_Ax;3674 rv2p_fw_file = FW_RV2P_FILE_09_Ax;
3671 else3675 else
3672 rv2p_fw_file = FW_RV2P_FILE_09;3676 rv2p_fw_file = FW_RV2P_FILE_09;
@@ -3756,13 +3760,13 @@ load_rv2p_fw(struct bnx2 *bp, u32 rv2p_proc, · 83 unmodified lines
3756 }3760 }
3757 3761
3758 for (i = 0; i < rv2p_code_len; i += 8) {3762 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));
3760 rv2p_code++;3764 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));
3762 rv2p_code++;3766 rv2p_code++;
3763 3767
3764 val = (i / 8) | cmd;3768 val = (i / 8) | cmd;
3765 REG_WR(bp, addr, val);3769 BNX2_WR(bp, addr, val);
3766 }3770 }
3767 3771
3768 rv2p_code = (__be32 *)(bp->rv2p_firmware->data + file_offset);3772 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
3772 loc = be32_to_cpu(fw_entry->fixup[i]);3776 loc = be32_to_cpu(fw_entry->fixup[i]);
3773 if (loc && ((loc * 4) < rv2p_code_len)) {3777 if (loc && ((loc * 4) < rv2p_code_len)) {
3774 code = be32_to_cpu(*(rv2p_code + loc - 1));3778 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);
3776 code = be32_to_cpu(*(rv2p_code + loc));3780 code = be32_to_cpu(*(rv2p_code + loc));
3777 code = rv2p_fw_fixup(rv2p_proc, i, loc, code);3781 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);
3779 3783
3780 val = (loc / 2) | cmd;3784 val = (loc / 2) | cmd;
3781 REG_WR(bp, addr, val);3785 BNX2_WR(bp, addr, val);
3782 }3786 }
3783 }3787 }
3784 3788
3785 /* Reset the processor, un-stall is done later. */3789 /* Reset the processor, un-stall is done later. */
3786 if (rv2p_proc == RV2P_PROC1) {3790 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);
3788 }3792 }
3789 else {3793 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);
3791 }3795 }
3792 3796
3793 return 0;3797 return 0;
@@ -3924,14 +3928,14 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state) · 130 unmodified lines
3924 /* delay required during transition out of D3hot */3928 /* delay required during transition out of D3hot */
3925 msleep(20);3929 msleep(20);
3926 3930
3927 val = REG_RD(bp, BNX2_EMAC_MODE);3931 val = BNX2_RD(bp, BNX2_EMAC_MODE);
3928 val |= BNX2_EMAC_MODE_MPKT_RCVD | BNX2_EMAC_MODE_ACPI_RCVD;3932 val |= BNX2_EMAC_MODE_MPKT_RCVD | BNX2_EMAC_MODE_ACPI_RCVD;
3929 val &= ~BNX2_EMAC_MODE_MPKT;3933 val &= ~BNX2_EMAC_MODE_MPKT;
3930 REG_WR(bp, BNX2_EMAC_MODE, val);3934 BNX2_WR(bp, BNX2_EMAC_MODE, val);
3931 3935
3932 val = REG_RD(bp, BNX2_RPM_CONFIG);3936 val = BNX2_RD(bp, BNX2_RPM_CONFIG);
3933 val &= ~BNX2_RPM_CONFIG_ACPI_ENA;3937 val &= ~BNX2_RPM_CONFIG_ACPI_ENA;
3934 REG_WR(bp, BNX2_RPM_CONFIG, val);3938 BNX2_WR(bp, BNX2_RPM_CONFIG, val);
3935 break;3939 break;
3936 }3940 }
3937 case PCI_D3hot: {3941 case PCI_D3hot: {
@@ -3963,7 +3967,7 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state) · 25 unmodified lines
3963 3967
3964 bnx2_set_mac_addr(bp, bp->dev->dev_addr, 0);3968 bnx2_set_mac_addr(bp, bp->dev->dev_addr, 0);
3965 3969
3966 val = REG_RD(bp, BNX2_EMAC_MODE);3970 val = BNX2_RD(bp, BNX2_EMAC_MODE);
3967 3971
3968 /* Enable port mode. */3972 /* Enable port mode. */
3969 val &= ~BNX2_EMAC_MODE_PORT;3973 val &= ~BNX2_EMAC_MODE_PORT;
@@ -3978,32 +3982,32 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state) · 8 unmodified lines
3978 val |= BNX2_EMAC_MODE_25G_MODE;3982 val |= BNX2_EMAC_MODE_25G_MODE;
3979 }3983 }
3980 3984
3981 REG_WR(bp, BNX2_EMAC_MODE, val);3985 BNX2_WR(bp, BNX2_EMAC_MODE, val);
3982 3986
3983 /* receive all multicast */3987 /* receive all multicast */
3984 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {3988 for (i = 0; i < NUM_MC_HASH_REGISTERS; i++) {
3985 REG_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),3989 BNX2_WR(bp, BNX2_EMAC_MULTICAST_HASH0 + (i * 4),
3986 0xffffffff);3990 0xffffffff);
3987 }3991 }
3988 REG_WR(bp, BNX2_EMAC_RX_MODE,3992 BNX2_WR(bp, BNX2_EMAC_RX_MODE,
3989 BNX2_EMAC_RX_MODE_SORT_MODE);3993 BNX2_EMAC_RX_MODE_SORT_MODE);
3990 3994
3991 val = 1 | BNX2_RPM_SORT_USER0_BC_EN |3995 val = 1 | BNX2_RPM_SORT_USER0_BC_EN |
3992 BNX2_RPM_SORT_USER0_MC_EN;3996 BNX2_RPM_SORT_USER0_MC_EN;
3993 REG_WR(bp, BNX2_RPM_SORT_USER0, 0x0);3997 BNX2_WR(bp, BNX2_RPM_SORT_USER0, 0x0);
3994 REG_WR(bp, BNX2_RPM_SORT_USER0, val);3998 BNX2_WR(bp, BNX2_RPM_SORT_USER0, val);
3995 REG_WR(bp, BNX2_RPM_SORT_USER0, val |3999 BNX2_WR(bp, BNX2_RPM_SORT_USER0, val |
3996 BNX2_RPM_SORT_USER0_ENA);4000 BNX2_RPM_SORT_USER0_ENA);
3997 4001
3998 /* Need to enable EMAC and RPM for WOL. */4002 /* Need to enable EMAC and RPM for WOL. */
3999 REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,4003 BNX2_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
4000 BNX2_MISC_ENABLE_SET_BITS_RX_PARSER_MAC_ENABLE |4004 BNX2_MISC_ENABLE_SET_BITS_RX_PARSER_MAC_ENABLE |
4001 BNX2_MISC_ENABLE_SET_BITS_TX_HEADER_Q_ENABLE |4005 BNX2_MISC_ENABLE_SET_BITS_TX_HEADER_Q_ENABLE |
4002 BNX2_MISC_ENABLE_SET_BITS_EMAC_ENABLE);4006 BNX2_MISC_ENABLE_SET_BITS_EMAC_ENABLE);
4003 4007
4004 val = REG_RD(bp, BNX2_RPM_CONFIG);4008 val = BNX2_RD(bp, BNX2_RPM_CONFIG);
4005 val &= ~BNX2_RPM_CONFIG_ACPI_ENA;4009 val &= ~BNX2_RPM_CONFIG_ACPI_ENA;
4006 REG_WR(bp, BNX2_RPM_CONFIG, val);4010 BNX2_WR(bp, BNX2_RPM_CONFIG, val);
4007 4011
4008 wol_msg = BNX2_DRV_MSG_CODE_SUSPEND_WOL;4012 wol_msg = BNX2_DRV_MSG_CODE_SUSPEND_WOL;
4009 }4013 }
@@ -4016,8 +4020,8 @@ bnx2_set_power_state(struct bnx2 *bp, pci_power_t state) · 6 unmodified lines
4016 1, 0);4020 1, 0);
4017 4021
4018 pmcsr &= ~PCI_PM_CTRL_STATE_MASK;4022 pmcsr &= ~PCI_PM_CTRL_STATE_MASK;
4019 if ((CHIP_ID(bp) == CHIP_ID_5706_A0) ||4023 if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) ||
4020 (CHIP_ID(bp) == CHIP_ID_5706_A1)) {4024 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1)) {
4021 4025
4022 if (bp->wol)4026 if (bp->wol)
4023 pmcsr |= 3;4027 pmcsr |= 3;
@@ -4050,9 +4054,9 @@ bnx2_acquire_nvram_lock(struct bnx2 *bp) · 26 unmodified lines
4050 int j;4054 int j;
4051 4055
4052 /* Request access to the flash interface. */4056 /* 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);
4054 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {4058 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);
4056 if (val & BNX2_NVM_SW_ARB_ARB_ARB2)4060 if (val & BNX2_NVM_SW_ARB_ARB_ARB2)
4057 break;4061 break;
4058 4062
@@ -4072,10 +4076,10 @@ bnx2_release_nvram_lock(struct bnx2 *bp) · 13 unmodified lines
4072 u32 val;4076 u32 val;
4073 4077
4074 /* Relinquish nvram interface. */4078 /* 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);
4076 4080
4077 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {4081 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);
4079 if (!(val & BNX2_NVM_SW_ARB_ARB_ARB2))4083 if (!(val & BNX2_NVM_SW_ARB_ARB_ARB2))
4080 break;4084 break;
4081 4085
@@ -4094,20 +4098,20 @@ bnx2_enable_nvram_write(struct bnx2 *bp) · 12 unmodified lines
4094{4098{
4095 u32 val;4099 u32 val;
4096 4100
4097 val = REG_RD(bp, BNX2_MISC_CFG);4101 val = BNX2_RD(bp, BNX2_MISC_CFG);
4098 REG_WR(bp, BNX2_MISC_CFG, val | BNX2_MISC_CFG_NVM_WR_EN_PCI);4102 BNX2_WR(bp, BNX2_MISC_CFG, val | BNX2_MISC_CFG_NVM_WR_EN_PCI);
4099 4103
4100 if (bp->flash_info->flags & BNX2_NV_WREN) {4104 if (bp->flash_info->flags & BNX2_NV_WREN) {
4101 int j;4105 int j;
4102 4106
4103 REG_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);4107 BNX2_WR(bp, BNX2_NVM_COMMAND, BNX2_NVM_COMMAND_DONE);
4104 REG_WR(bp, BNX2_NVM_COMMAND,4108 BNX2_WR(bp, BNX2_NVM_COMMAND,
4105 BNX2_NVM_COMMAND_WREN | BNX2_NVM_COMMAND_DOIT);4109 BNX2_NVM_COMMAND_WREN | BNX2_NVM_COMMAND_DOIT);
4106 4110
4107 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {4111 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
4108 udelay(5);4112 udelay(5);
4109 4113
4110 val = REG_RD(bp, BNX2_NVM_COMMAND);4114 val = BNX2_RD(bp, BNX2_NVM_COMMAND);
4111 if (val & BNX2_NVM_COMMAND_DONE)4115 if (val & BNX2_NVM_COMMAND_DONE)
4112 break;4116 break;
4113 }4117 }
@@ -4123,8 +4127,8 @@ bnx2_disable_nvram_write(struct bnx2 *bp) · 9 unmodified lines
4123{4127{
4124 u32 val;4128 u32 val;
4125 4129
4126 val = REG_RD(bp, BNX2_MISC_CFG);4130 val = BNX2_RD(bp, BNX2_MISC_CFG);
4127 REG_WR(bp, BNX2_MISC_CFG, val & ~BNX2_MISC_CFG_NVM_WR_EN);4131 BNX2_WR(bp, BNX2_MISC_CFG, val & ~BNX2_MISC_CFG_NVM_WR_EN);
4128}4132}
4129 4133
4130 4134
@@ -4133,10 +4137,10 @@ bnx2_enable_nvram_access(struct bnx2 *bp) · 2 unmodified lines
4133{4137{
4134 u32 val;4138 u32 val;
4135 4139
4136 val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE);4140 val = BNX2_RD(bp, BNX2_NVM_ACCESS_ENABLE);
4137 /* Enable both bits, even on read. */4141 /* Enable both bits, even on read. */
4138 REG_WR(bp, BNX2_NVM_ACCESS_ENABLE,4142 BNX2_WR(bp, BNX2_NVM_ACCESS_ENABLE,
4139 val | BNX2_NVM_ACCESS_ENABLE_EN | BNX2_NVM_ACCESS_ENABLE_WR_EN);4143 val | BNX2_NVM_ACCESS_ENABLE_EN | BNX2_NVM_ACCESS_ENABLE_WR_EN);
4140}4144}
4141 4145
4142static void4146static void
@@ -4144,9 +4148,9 @@ bnx2_disable_nvram_access(struct bnx2 *bp) · 1 unmodified line
4144{4148{
4145 u32 val;4149 u32 val;
4146 4150
4147 val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE);4151 val = BNX2_RD(bp, BNX2_NVM_ACCESS_ENABLE);
4148 /* Disable both bits, even after read. */4152 /* Disable both bits, even after read. */
4149 REG_WR(bp, BNX2_NVM_ACCESS_ENABLE,4153 BNX2_WR(bp, BNX2_NVM_ACCESS_ENABLE,
4150 val & ~(BNX2_NVM_ACCESS_ENABLE_EN |4154 val & ~(BNX2_NVM_ACCESS_ENABLE_EN |
4151 BNX2_NVM_ACCESS_ENABLE_WR_EN));4155 BNX2_NVM_ACCESS_ENABLE_WR_EN));
4152}4156}
@@ -4166,13 +4170,13 @@ bnx2_nvram_erase_page(struct bnx2 *bp, u32 offset) · 13 unmodified lines
4166 BNX2_NVM_COMMAND_DOIT;4170 BNX2_NVM_COMMAND_DOIT;
4167 4171
4168 /* Need to clear DONE bit separately. */4172 /* 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);
4170 4174
4171 /* Address of the NVRAM to read from. */4175 /* 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);
4173 4177
4174 /* Issue an erase command. */4178 /* Issue an erase command. */
4175 REG_WR(bp, BNX2_NVM_COMMAND, cmd);4179 BNX2_WR(bp, BNX2_NVM_COMMAND, cmd);
4176 4180
4177 /* Wait for completion. */4181 /* Wait for completion. */
4178 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {4182 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
@@ -4180,7 +4184,7 @@ bnx2_nvram_erase_page(struct bnx2 *bp, u32 offset) · 1 unmodified line
4180 4184
4181 udelay(5);4185 udelay(5);
4182 4186
4183 val = REG_RD(bp, BNX2_NVM_COMMAND);4187 val = BNX2_RD(bp, BNX2_NVM_COMMAND);
4184 if (val & BNX2_NVM_COMMAND_DONE)4188 if (val & BNX2_NVM_COMMAND_DONE)
4185 break;4189 break;
4186 }4190 }
@@ -4208,13 +4212,13 @@ bnx2_nvram_read_dword(struct bnx2 *bp, u32 offset, u8 *ret_val, u32 cmd_flags) · 21 unmodified lines
4208 }4212 }
4209 4213
4210 /* Need to clear DONE bit separately. */4214 /* 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);
4212 4216
4213 /* Address of the NVRAM to read from. */4217 /* 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);
4215 4219
4216 /* Issue a read command. */4220 /* Issue a read command. */
4217 REG_WR(bp, BNX2_NVM_COMMAND, cmd);4221 BNX2_WR(bp, BNX2_NVM_COMMAND, cmd);
4218 4222
4219 /* Wait for completion. */4223 /* Wait for completion. */
4220 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {4224 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
4222 4226
4223 udelay(5);4227 udelay(5);
4224 4228
4225 val = REG_RD(bp, BNX2_NVM_COMMAND);4229 val = BNX2_RD(bp, BNX2_NVM_COMMAND);
4226 if (val & BNX2_NVM_COMMAND_DONE) {4230 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));
4228 memcpy(ret_val, &v, 4);4232 memcpy(ret_val, &v, 4);
4229 break;4233 break;
4230 }4234 }
@@ -4254,24 +4258,24 @@ bnx2_nvram_write_dword(struct bnx2 *bp, u32 offset, u8 *val, u32 cmd_flags) · 23 unmodified lines
4254 }4258 }
4255 4259
4256 /* Need to clear DONE bit separately. */4260 /* 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);
4258 4262
4259 memcpy(&val32, val, 4);4263 memcpy(&val32, val, 4);
4260 4264
4261 /* Write the data. */4265 /* 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));
4263 4267
4264 /* Address of the NVRAM to write to. */4268 /* 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);
4266 4270
4267 /* Issue the write command. */4271 /* Issue the write command. */
4268 REG_WR(bp, BNX2_NVM_COMMAND, cmd);4272 BNX2_WR(bp, BNX2_NVM_COMMAND, cmd);
4269 4273
4270 /* Wait for completion. */4274 /* Wait for completion. */
4271 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {4275 for (j = 0; j < NVRAM_TIMEOUT_COUNT; j++) {
4272 udelay(5);4276 udelay(5);
4273 4277
4274 if (REG_RD(bp, BNX2_NVM_COMMAND) & BNX2_NVM_COMMAND_DONE)4278 if (BNX2_RD(bp, BNX2_NVM_COMMAND) & BNX2_NVM_COMMAND_DONE)
4275 break;4279 break;
4276 }4280 }
4277 if (j >= NVRAM_TIMEOUT_COUNT)4281 if (j >= NVRAM_TIMEOUT_COUNT)
@@ -4287,13 +4291,13 @@ bnx2_init_nvram(struct bnx2 *bp) · 9 unmodified lines
4287 int j, entry_count, rc = 0;4291 int j, entry_count, rc = 0;
4288 const struct flash_spec *flash;4292 const struct flash_spec *flash;
4289 4293
4290 if (CHIP_NUM(bp) == CHIP_NUM_5709) {4294 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
4291 bp->flash_info = &flash_5709;4295 bp->flash_info = &flash_5709;
4292 goto get_flash_size;4296 goto get_flash_size;
4293 }4297 }
4294 4298
4295 /* Determine the selected interface. */4299 /* Determine the selected interface. */
4296 val = REG_RD(bp, BNX2_NVM_CFG1);4300 val = BNX2_RD(bp, BNX2_NVM_CFG1);
4297 4301
4298 entry_count = ARRAY_SIZE(flash_table);4302 entry_count = ARRAY_SIZE(flash_table);
4299 4303
@@ -4332,10 +4336,10 @@ bnx2_init_nvram(struct bnx2 *bp) · 32 unmodified lines
4332 bnx2_enable_nvram_access(bp);4336 bnx2_enable_nvram_access(bp);
4333 4337
4334 /* Reconfigure the flash interface */4338 /* Reconfigure the flash interface */
4335 REG_WR(bp, BNX2_NVM_CFG1, flash->config1);4339 BNX2_WR(bp, BNX2_NVM_CFG1, flash->config1);
4336 REG_WR(bp, BNX2_NVM_CFG2, flash->config2);4340 BNX2_WR(bp, BNX2_NVM_CFG2, flash->config2);
4337 REG_WR(bp, BNX2_NVM_CFG3, flash->config3);4341 BNX2_WR(bp, BNX2_NVM_CFG3, flash->config3);
4338 REG_WR(bp, BNX2_NVM_WRITE1, flash->write1);4342 BNX2_WR(bp, BNX2_NVM_WRITE1, flash->write1);
4339 4343
4340 /* Disable access to flash interface */4344 /* Disable access to flash interface */
4341 bnx2_disable_nvram_access(bp);4345 bnx2_disable_nvram_access(bp);
@@ -4696,10 +4700,10 @@ bnx2_init_fw_cap(struct bnx2 *bp) · 354 unmodified lines
4696static void4700static void
4697bnx2_setup_msix_tbl(struct bnx2 *bp)4701bnx2_setup_msix_tbl(struct bnx2 *bp)
4698{4702{
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);
4700 4704
4701 REG_WR(bp, BNX2_PCI_GRC_WINDOW2_ADDR, BNX2_MSIX_TABLE_ADDR);4705 BNX2_WR(bp, BNX2_PCI_GRC_WINDOW2_ADDR, BNX2_MSIX_TABLE_ADDR);
4702 REG_WR(bp, BNX2_PCI_GRC_WINDOW3_ADDR, BNX2_MSIX_PBA_ADDR);4706 BNX2_WR(bp, BNX2_PCI_GRC_WINDOW3_ADDR, BNX2_MSIX_PBA_ADDR);
4703}4707}
4704 4708
4705static int4709static int
@@ -4711,24 +4715,24 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 5 unmodified lines
4711 4715
4712 /* Wait for the current PCI transaction to complete before4716 /* Wait for the current PCI transaction to complete before
4713 * issuing a reset. */4717 * issuing a reset. */
4714 if ((CHIP_NUM(bp) == CHIP_NUM_5706) ||4718 if ((BNX2_CHIP(bp) == BNX2_CHIP_5706) ||
4715 (CHIP_NUM(bp) == CHIP_NUM_5708)) {4719 (BNX2_CHIP(bp) == BNX2_CHIP_5708)) {
4716 REG_WR(bp, BNX2_MISC_ENABLE_CLR_BITS,4720 BNX2_WR(bp, BNX2_MISC_ENABLE_CLR_BITS,
4717 BNX2_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE |4721 BNX2_MISC_ENABLE_CLR_BITS_TX_DMA_ENABLE |
4718 BNX2_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE |4722 BNX2_MISC_ENABLE_CLR_BITS_DMA_ENGINE_ENABLE |
4719 BNX2_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE |4723 BNX2_MISC_ENABLE_CLR_BITS_RX_DMA_ENABLE |
4720 BNX2_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE);4724 BNX2_MISC_ENABLE_CLR_BITS_HOST_COALESCE_ENABLE);
4721 val = REG_RD(bp, BNX2_MISC_ENABLE_CLR_BITS);4725 val = BNX2_RD(bp, BNX2_MISC_ENABLE_CLR_BITS);
4722 udelay(5);4726 udelay(5);
4723 } else { /* 5709 */4727 } else { /* 5709 */
4724 val = REG_RD(bp, BNX2_MISC_NEW_CORE_CTL);4728 val = BNX2_RD(bp, BNX2_MISC_NEW_CORE_CTL);
4725 val &= ~BNX2_MISC_NEW_CORE_CTL_DMA_ENABLE;4729 val &= ~BNX2_MISC_NEW_CORE_CTL_DMA_ENABLE;
4726 REG_WR(bp, BNX2_MISC_NEW_CORE_CTL, val);4730 BNX2_WR(bp, BNX2_MISC_NEW_CORE_CTL, val);
4727 val = REG_RD(bp, BNX2_MISC_NEW_CORE_CTL);4731 val = BNX2_RD(bp, BNX2_MISC_NEW_CORE_CTL);
4728 4732
4729 for (i = 0; i < 100; i++) {4733 for (i = 0; i < 100; i++) {
4730 msleep(1);4734 msleep(1);
4731 val = REG_RD(bp, BNX2_PCICFG_DEVICE_CONTROL);4735 val = BNX2_RD(bp, BNX2_PCICFG_DEVICE_CONTROL);
4732 if (!(val & BNX2_PCICFG_DEVICE_STATUS_NO_PEND))4736 if (!(val & BNX2_PCICFG_DEVICE_STATUS_NO_PEND))
4733 break;4737 break;
4734 }4738 }
@@ -4744,17 +4748,17 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 9 unmodified lines
4744 4748
4745 /* Do a dummy read to force the chip to complete all current transaction4749 /* Do a dummy read to force the chip to complete all current transaction
4746 * before we issue a reset. */4750 * before we issue a reset. */
4747 val = REG_RD(bp, BNX2_MISC_ID);4751 val = BNX2_RD(bp, BNX2_MISC_ID);
4748 4752
4749 if (CHIP_NUM(bp) == CHIP_NUM_5709) {4753 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
4750 REG_WR(bp, BNX2_MISC_COMMAND, BNX2_MISC_COMMAND_SW_RESET);4754 BNX2_WR(bp, BNX2_MISC_COMMAND, BNX2_MISC_COMMAND_SW_RESET);
4751 REG_RD(bp, BNX2_MISC_COMMAND);4755 BNX2_RD(bp, BNX2_MISC_COMMAND);
4752 udelay(5);4756 udelay(5);
4753 4757
4754 val = BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |4758 val = BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |
4755 BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP;4759 BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP;
4756 4760
4757 REG_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);4761 BNX2_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);
4758 4762
4759 } else {4763 } else {
4760 val = BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ |4764 val = BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ |
@@ -4762,19 +4766,19 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 1 unmodified line
4762 BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP;4766 BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP;
4763 4767
4764 /* Chip reset. */4768 /* Chip reset. */
4765 REG_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);4769 BNX2_WR(bp, BNX2_PCICFG_MISC_CONFIG, val);
4766 4770
4767 /* Reading back any register after chip reset will hang the4771 /* Reading back any register after chip reset will hang the
4768 * bus on 5706 A0 and A1. The msleep below provides plenty4772 * bus on 5706 A0 and A1. The msleep below provides plenty
4769 * of margin for write posting.4773 * of margin for write posting.
4770 */4774 */
4771 if ((CHIP_ID(bp) == CHIP_ID_5706_A0) ||4775 if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) ||
4772 (CHIP_ID(bp) == CHIP_ID_5706_A1))4776 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1))
4773 msleep(20);4777 msleep(20);
4774 4778
4775 /* Reset takes approximate 30 usec */4779 /* Reset takes approximate 30 usec */
4776 for (i = 0; i < 10; i++) {4780 for (i = 0; i < 10; i++) {
4777 val = REG_RD(bp, BNX2_PCICFG_MISC_CONFIG);4781 val = BNX2_RD(bp, BNX2_PCICFG_MISC_CONFIG);
4778 if ((val & (BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ |4782 if ((val & (BNX2_PCICFG_MISC_CONFIG_CORE_RST_REQ |
4779 BNX2_PCICFG_MISC_CONFIG_CORE_RST_BSY)) == 0)4783 BNX2_PCICFG_MISC_CONFIG_CORE_RST_BSY)) == 0)
4780 break;4784 break;
@@ -4789,7 +4793,7 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 8 unmodified lines
4789 }4793 }
4790 4794
4791 /* Make sure byte swapping is properly configured. */4795 /* 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);
4793 if (val != 0x01020304) {4797 if (val != 0x01020304) {
4794 pr_err("Chip not in correct endian mode\n");4798 pr_err("Chip not in correct endian mode\n");
4795 return -ENODEV;4799 return -ENODEV;
@@ -4808,10 +4812,10 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 12 unmodified lines
4808 bnx2_set_default_remote_link(bp);4812 bnx2_set_default_remote_link(bp);
4809 spin_unlock_bh(&bp->phy_lock);4813 spin_unlock_bh(&bp->phy_lock);
4810 4814
4811 if (CHIP_ID(bp) == CHIP_ID_5706_A0) {4815 if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) {
4812 /* Adjust the voltage regular to two steps lower. The default4816 /* Adjust the voltage regular to two steps lower. The default
4813 * of this register is 0x0000000e. */4817 * of this register is 0x0000000e. */
4814 REG_WR(bp, BNX2_MISC_VREG_CONTROL, 0x000000fa);4818 BNX2_WR(bp, BNX2_MISC_VREG_CONTROL, 0x000000fa);
4815 4819
4816 /* Remove bad rbuf memory from the free pool. */4820 /* Remove bad rbuf memory from the free pool. */
4817 rc = bnx2_alloc_bad_rbuf(bp);4821 rc = bnx2_alloc_bad_rbuf(bp);
@@ -4820,7 +4824,7 @@ bnx2_reset_chip(struct bnx2 *bp, u32 reset_code) · 2 unmodified lines
4820 if (bp->flags & BNX2_FLAG_USING_MSIX) {4824 if (bp->flags & BNX2_FLAG_USING_MSIX) {
4821 bnx2_setup_msix_tbl(bp);4825 bnx2_setup_msix_tbl(bp);
4822 /* Prevent MSIX table reads and write from timing out */4826 /* 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,
4824 BNX2_MISC_ECO_HW_CTL_LARGE_GRC_TMOUT_EN);4828 BNX2_MISC_ECO_HW_CTL_LARGE_GRC_TMOUT_EN);
4825 }4829 }
4826 4830
@@ -4834,7 +4838,7 @@ bnx2_init_chip(struct bnx2 *bp) · 7 unmodified lines
4834 int rc, i;4838 int rc, i;
4835 4839
4836 /* Make sure the interrupt is not active. */4840 /* 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);
4838 4842
4839 val = BNX2_DMA_CONFIG_DATA_BYTE_SWAP |4843 val = BNX2_DMA_CONFIG_DATA_BYTE_SWAP |
4840 BNX2_DMA_CONFIG_DATA_WORD_SWAP |4844 BNX2_DMA_CONFIG_DATA_WORD_SWAP |
@@ -4850,16 +4854,17 @@ bnx2_init_chip(struct bnx2 *bp) · 9 unmodified lines
4850 if ((bp->flags & BNX2_FLAG_PCIX) && (bp->bus_speed_mhz == 133))4854 if ((bp->flags & BNX2_FLAG_PCIX) && (bp->bus_speed_mhz == 133))
4851 val |= (1 << 23);4855 val |= (1 << 23);
4852 4856
4853 if ((CHIP_NUM(bp) == CHIP_NUM_5706) &&4857 if ((BNX2_CHIP(bp) == BNX2_CHIP_5706) &&
4854 (CHIP_ID(bp) != CHIP_ID_5706_A0) && !(bp->flags & BNX2_FLAG_PCIX))4858 (BNX2_CHIP_ID(bp) != BNX2_CHIP_ID_5706_A0) &&
4859 !(bp->flags & BNX2_FLAG_PCIX))
4855 val |= BNX2_DMA_CONFIG_CNTL_PING_PONG_DMA;4860 val |= BNX2_DMA_CONFIG_CNTL_PING_PONG_DMA;
4856 4861
4857 REG_WR(bp, BNX2_DMA_CONFIG, val);4862 BNX2_WR(bp, BNX2_DMA_CONFIG, val);
4858 4863
4859 if (CHIP_ID(bp) == CHIP_ID_5706_A0) {4864 if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) {
4860 val = REG_RD(bp, BNX2_TDMA_CONFIG);4865 val = BNX2_RD(bp, BNX2_TDMA_CONFIG);
4861 val |= BNX2_TDMA_CONFIG_ONE_DMA;4866 val |= BNX2_TDMA_CONFIG_ONE_DMA;
4862 REG_WR(bp, BNX2_TDMA_CONFIG, val);4867 BNX2_WR(bp, BNX2_TDMA_CONFIG, val);
4863 }4868 }
4864 4869
4865 if (bp->flags & BNX2_FLAG_PCIX) {4870 if (bp->flags & BNX2_FLAG_PCIX) {
@@ -4871,14 +4876,14 @@ bnx2_init_chip(struct bnx2 *bp) · 5 unmodified lines
4871 val16 & ~PCI_X_CMD_ERO);4876 val16 & ~PCI_X_CMD_ERO);
4872 }4877 }
4873 4878
4874 REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS,4879 BNX2_WR(bp, BNX2_MISC_ENABLE_SET_BITS,
4875 BNX2_MISC_ENABLE_SET_BITS_HOST_COALESCE_ENABLE |4880 BNX2_MISC_ENABLE_SET_BITS_HOST_COALESCE_ENABLE |
4876 BNX2_MISC_ENABLE_STATUS_BITS_RX_V2P_ENABLE |4881 BNX2_MISC_ENABLE_STATUS_BITS_RX_V2P_ENABLE |
4877 BNX2_MISC_ENABLE_STATUS_BITS_CONTEXT_ENABLE);4882 BNX2_MISC_ENABLE_STATUS_BITS_CONTEXT_ENABLE);
4878 4883
4879 /* Initialize context mapping and zero out the quick contexts. The4884 /* Initialize context mapping and zero out the quick contexts. The
4880 * context block must have already been enabled. */4885 * context block must have already been enabled. */
4881 if (CHIP_NUM(bp) == CHIP_NUM_5709) {4886 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
4882 rc = bnx2_init_5709_context(bp);4887 rc = bnx2_init_5709_context(bp);
4883 if (rc)4888 if (rc)
4884 return rc;4889 return rc;
@@ -4892,29 +4897,29 @@ bnx2_init_chip(struct bnx2 *bp) · 7 unmodified lines
4892 4897
4893 bnx2_set_mac_addr(bp, bp->dev->dev_addr, 0);4898 bnx2_set_mac_addr(bp, bp->dev->dev_addr, 0);
4894 4899
4895 val = REG_RD(bp, BNX2_MQ_CONFIG);4900 val = BNX2_RD(bp, BNX2_MQ_CONFIG);
4896 val &= ~BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE;4901 val &= ~BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE;
4897 val |= BNX2_MQ_CONFIG_KNL_BYP_BLK_SIZE_256;4902 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) {
4899 val |= BNX2_MQ_CONFIG_BIN_MQ_MODE;4904 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)
4901 val |= BNX2_MQ_CONFIG_HALT_DIS;4906 val |= BNX2_MQ_CONFIG_HALT_DIS;
4902 }4907 }
4903 4908
4904 REG_WR(bp, BNX2_MQ_CONFIG, val);4909 BNX2_WR(bp, BNX2_MQ_CONFIG, val);
4905 4910
4906 val = 0x10000 + (MAX_CID_CNT * MB_KERNEL_CTX_SIZE);4911 val = 0x10000 + (MAX_CID_CNT * MB_KERNEL_CTX_SIZE);
4907 REG_WR(bp, BNX2_MQ_KNL_BYP_WIND_START, val);4912 BNX2_WR(bp, BNX2_MQ_KNL_BYP_WIND_START, val);
4908 REG_WR(bp, BNX2_MQ_KNL_WIND_END, val);4913 BNX2_WR(bp, BNX2_MQ_KNL_WIND_END, val);
4909 4914
4910 val = (BCM_PAGE_BITS - 8) << 24;4915 val = (BNX2_PAGE_BITS - 8) << 24;
4911 REG_WR(bp, BNX2_RV2P_CONFIG, val);4916 BNX2_WR(bp, BNX2_RV2P_CONFIG, val);
4912 4917
4913 /* Configure page size. */4918 /* Configure page size. */
4914 val = REG_RD(bp, BNX2_TBDR_CONFIG);4919 val = BNX2_RD(bp, BNX2_TBDR_CONFIG);
4915 val &= ~BNX2_TBDR_CONFIG_PAGE_SIZE;4920 val &= ~BNX2_TBDR_CONFIG_PAGE_SIZE;
4916 val |= (BCM_PAGE_BITS - 8) << 24 | 0x40;4921 val |= (BNX2_PAGE_BITS - 8) << 24 | 0x40;
4917 REG_WR(bp, BNX2_TBDR_CONFIG, val);4922 BNX2_WR(bp, BNX2_TBDR_CONFIG, val);
4918 4923
4919 val = bp->mac_addr[0] +4924 val = bp->mac_addr[0] +
4920 (bp->mac_addr[1] << 8) +4925 (bp->mac_addr[1] << 8) +
@@ -4922,14 +4927,14 @@ bnx2_init_chip(struct bnx2 *bp) · 1 unmodified line
4922 bp->mac_addr[3] +4927 bp->mac_addr[3] +
4923 (bp->mac_addr[4] << 8) +4928 (bp->mac_addr[4] << 8) +
4924 (bp->mac_addr[5] << 16);4929 (bp->mac_addr[5] << 16);
4925 REG_WR(bp, BNX2_EMAC_BACKOFF_SEED, val);4930 BNX2_WR(bp, BNX2_EMAC_BACKOFF_SEED, val);
4926 4931
4927 /* Program the MTU. Also include 4 bytes for CRC32. */4932 /* Program the MTU. Also include 4 bytes for CRC32. */
4928 mtu = bp->dev->mtu;4933 mtu = bp->dev->mtu;
4929 val = mtu + ETH_HLEN + ETH_FCS_LEN;4934 val = mtu + ETH_HLEN + ETH_FCS_LEN;
4930 if (val > (MAX_ETHERNET_PACKET_SIZE + 4))4935 if (val > (MAX_ETHERNET_PACKET_SIZE + 4))
4931 val |= BNX2_EMAC_RX_MTU_SIZE_JUMBO_ENA;4936 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);
4933 4938
4934 if (mtu < 1500)4939 if (mtu < 1500)
4935 mtu = 1500;4940 mtu = 1500;
@@ -4947,43 +4952,43 @@ bnx2_init_chip(struct bnx2 *bp) · 11 unmodified lines
4947 bp->rx_mode = BNX2_EMAC_RX_MODE_SORT_MODE;4952 bp->rx_mode = BNX2_EMAC_RX_MODE_SORT_MODE;
4948 4953
4949 /* Set up how to generate a link change interrupt. */4954 /* 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);
4951 4956
4952 REG_WR(bp, BNX2_HC_STATUS_ADDR_L,4957 BNX2_WR(bp, BNX2_HC_STATUS_ADDR_L,
4953 (u64) bp->status_blk_mapping & 0xffffffff);4958 (u64) bp->status_blk_mapping & 0xffffffff);
4954 REG_WR(bp, BNX2_HC_STATUS_ADDR_H, (u64) bp->status_blk_mapping >> 32);4959 BNX2_WR(bp, BNX2_HC_STATUS_ADDR_H, (u64) bp->status_blk_mapping >> 32);
4955 4960
4956 REG_WR(bp, BNX2_HC_STATISTICS_ADDR_L,4961 BNX2_WR(bp, BNX2_HC_STATISTICS_ADDR_L,
4957 (u64) bp->stats_blk_mapping & 0xffffffff);4962 (u64) bp->stats_blk_mapping & 0xffffffff);
4958 REG_WR(bp, BNX2_HC_STATISTICS_ADDR_H,4963 BNX2_WR(bp, BNX2_HC_STATISTICS_ADDR_H,
4959 (u64) bp->stats_blk_mapping >> 32);4964 (u64) bp->stats_blk_mapping >> 32);
4960 4965
4961 REG_WR(bp, BNX2_HC_TX_QUICK_CONS_TRIP,4966 BNX2_WR(bp, BNX2_HC_TX_QUICK_CONS_TRIP,
4962 (bp->tx_quick_cons_trip_int << 16) | bp->tx_quick_cons_trip);4967 (bp->tx_quick_cons_trip_int << 16) | bp->tx_quick_cons_trip);
4963 4968
4964 REG_WR(bp, BNX2_HC_RX_QUICK_CONS_TRIP,4969 BNX2_WR(bp, BNX2_HC_RX_QUICK_CONS_TRIP,
4965 (bp->rx_quick_cons_trip_int << 16) | bp->rx_quick_cons_trip);4970 (bp->rx_quick_cons_trip_int << 16) | bp->rx_quick_cons_trip);
4966 4971
4967 REG_WR(bp, BNX2_HC_COMP_PROD_TRIP,4972 BNX2_WR(bp, BNX2_HC_COMP_PROD_TRIP,
4968 (bp->comp_prod_trip_int << 16) | bp->comp_prod_trip);4973 (bp->comp_prod_trip_int << 16) | bp->comp_prod_trip);
4969 4974
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);
4971 4976
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);
4973 4978
4974 REG_WR(bp, BNX2_HC_COM_TICKS,4979 BNX2_WR(bp, BNX2_HC_COM_TICKS,
4975 (bp->com_ticks_int << 16) | bp->com_ticks);4980 (bp->com_ticks_int << 16) | bp->com_ticks);
4976 4981
4977 REG_WR(bp, BNX2_HC_CMD_TICKS,4982 BNX2_WR(bp, BNX2_HC_CMD_TICKS,
4978 (bp->cmd_ticks_int << 16) | bp->cmd_ticks);4983 (bp->cmd_ticks_int << 16) | bp->cmd_ticks);
4979 4984
4980 if (bp->flags & BNX2_FLAG_BROKEN_STATS)4985 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);
4982 else4987 else
4983 REG_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks);4988 BNX2_WR(bp, BNX2_HC_STATS_TICKS, bp->stats_ticks);
4984 REG_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */4989 BNX2_WR(bp, BNX2_HC_STAT_COLLECT_TICKS, 0xbb8); /* 3ms */
4985 4990
4986 if (CHIP_ID(bp) == CHIP_ID_5706_A1)4991 if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1)
4987 val = BNX2_HC_CONFIG_COLLECT_STATS;4992 val = BNX2_HC_CONFIG_COLLECT_STATS;
4988 else {4993 else {
4989 val = BNX2_HC_CONFIG_RX_TMR_MODE | BNX2_HC_CONFIG_TX_TMR_MODE |4994 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
4991 }4996 }
4992 4997
4993 if (bp->flags & BNX2_FLAG_USING_MSIX) {4998 if (bp->flags & BNX2_FLAG_USING_MSIX) {
4994 REG_WR(bp, BNX2_HC_MSIX_BIT_VECTOR,4999 BNX2_WR(bp, BNX2_HC_MSIX_BIT_VECTOR,
4995 BNX2_HC_MSIX_BIT_VECTOR_VAL);5000 BNX2_HC_MSIX_BIT_VECTOR_VAL);
4996 5001
4997 val |= BNX2_HC_CONFIG_SB_ADDR_INC_128B;5002 val |= BNX2_HC_CONFIG_SB_ADDR_INC_128B;
4998 }5003 }
@@ -5000,7 +5005,7 @@ bnx2_init_chip(struct bnx2 *bp) · 1 unmodified line
5000 if (bp->flags & BNX2_FLAG_ONE_SHOT_MSI)5005 if (bp->flags & BNX2_FLAG_ONE_SHOT_MSI)
5001 val |= BNX2_HC_CONFIG_ONE_SHOT | BNX2_HC_CONFIG_USE_INT_PARAM;5006 val |= BNX2_HC_CONFIG_ONE_SHOT | BNX2_HC_CONFIG_USE_INT_PARAM;
5002 5007
5003 REG_WR(bp, BNX2_HC_CONFIG, val);5008 BNX2_WR(bp, BNX2_HC_CONFIG, val);
5004 5009
5005 if (bp->rx_ticks < 25)5010 if (bp->rx_ticks < 25)
5006 bnx2_reg_wr_ind(bp, BNX2_FW_RX_LOW_LATENCY, 1);5011 bnx2_reg_wr_ind(bp, BNX2_FW_RX_LOW_LATENCY, 1);
@@ -5011,48 +5016,48 @@ bnx2_init_chip(struct bnx2 *bp) · 4 unmodified lines
5011 u32 base = ((i - 1) * BNX2_HC_SB_CONFIG_SIZE) +5016 u32 base = ((i - 1) * BNX2_HC_SB_CONFIG_SIZE) +
5012 BNX2_HC_SB_CONFIG_1;5017 BNX2_HC_SB_CONFIG_1;
5013 5018
5014 REG_WR(bp, base,5019 BNX2_WR(bp, base,
5015 BNX2_HC_SB_CONFIG_1_TX_TMR_MODE |5020 BNX2_HC_SB_CONFIG_1_TX_TMR_MODE |
5016 BNX2_HC_SB_CONFIG_1_RX_TMR_MODE |5021 BNX2_HC_SB_CONFIG_1_RX_TMR_MODE |
5017 BNX2_HC_SB_CONFIG_1_ONE_SHOT);5022 BNX2_HC_SB_CONFIG_1_ONE_SHOT);
5018 5023
5019 REG_WR(bp, base + BNX2_HC_TX_QUICK_CONS_TRIP_OFF,5024 BNX2_WR(bp, base + BNX2_HC_TX_QUICK_CONS_TRIP_OFF,
5020 (bp->tx_quick_cons_trip_int << 16) |5025 (bp->tx_quick_cons_trip_int << 16) |
5021 bp->tx_quick_cons_trip);5026 bp->tx_quick_cons_trip);
5022 5027
5023 REG_WR(bp, base + BNX2_HC_TX_TICKS_OFF,5028 BNX2_WR(bp, base + BNX2_HC_TX_TICKS_OFF,
5024 (bp->tx_ticks_int << 16) | bp->tx_ticks);5029 (bp->tx_ticks_int << 16) | bp->tx_ticks);
5025 5030
5026 REG_WR(bp, base + BNX2_HC_RX_QUICK_CONS_TRIP_OFF,5031 BNX2_WR(bp, base + BNX2_HC_RX_QUICK_CONS_TRIP_OFF,
5027 (bp->rx_quick_cons_trip_int << 16) |5032 (bp->rx_quick_cons_trip_int << 16) |
5028 bp->rx_quick_cons_trip);5033 bp->rx_quick_cons_trip);
5029 5034
5030 REG_WR(bp, base + BNX2_HC_RX_TICKS_OFF,5035 BNX2_WR(bp, base + BNX2_HC_RX_TICKS_OFF,
5031 (bp->rx_ticks_int << 16) | bp->rx_ticks);5036 (bp->rx_ticks_int << 16) | bp->rx_ticks);
5032 }5037 }
5033 5038
5034 /* Clear internal stats counters. */5039 /* 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);
5036 5041
5037 REG_WR(bp, BNX2_HC_ATTN_BITS_ENABLE, STATUS_ATTN_EVENTS);5042 BNX2_WR(bp, BNX2_HC_ATTN_BITS_ENABLE, STATUS_ATTN_EVENTS);
5038 5043
5039 /* Initialize the receive filter. */5044 /* Initialize the receive filter. */
5040 bnx2_set_rx_mode(bp->dev);5045 bnx2_set_rx_mode(bp->dev);
5041 5046
5042 if (CHIP_NUM(bp) == CHIP_NUM_5709) {5047 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
5043 val = REG_RD(bp, BNX2_MISC_NEW_CORE_CTL);5048 val = BNX2_RD(bp, BNX2_MISC_NEW_CORE_CTL);
5044 val |= BNX2_MISC_NEW_CORE_CTL_DMA_ENABLE;5049 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);
5046 }5051 }
5047 rc = bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT2 | BNX2_DRV_MSG_CODE_RESET,5052 rc = bnx2_fw_sync(bp, BNX2_DRV_MSG_DATA_WAIT2 | BNX2_DRV_MSG_CODE_RESET,
5048 1, 0);5053 1, 0);
5049 5054
5050 REG_WR(bp, BNX2_MISC_ENABLE_SET_BITS, BNX2_MISC_ENABLE_DEFAULT);5055 BNX2_WR(bp, BNX2_MISC_ENABLE_SET_BITS, BNX2_MISC_ENABLE_DEFAULT);
5051 REG_RD(bp, BNX2_MISC_ENABLE_SET_BITS);5056 BNX2_RD(bp, BNX2_MISC_ENABLE_SET_BITS);
5052 5057
5053 udelay(20);5058 udelay(20);
5054 5059
5055 bp->hc_cmd = REG_RD(bp, BNX2_HC_COMMAND);5060 bp->hc_cmd = BNX2_RD(bp, BNX2_HC_COMMAND);
5056 5061
5057 return rc;5062 return rc;
5058}5063}
@@ -5086,7 +5091,7 @@ bnx2_init_tx_context(struct bnx2 *bp, u32 cid, struct bnx2_tx_ring_info *txr) · 27 unmodified lines
5086 u32 val, offset0, offset1, offset2, offset3;5091 u32 val, offset0, offset1, offset2, offset3;
5087 u32 cid_addr = GET_CID_ADDR(cid);5092 u32 cid_addr = GET_CID_ADDR(cid);
5088 5093
5089 if (CHIP_NUM(bp) == CHIP_NUM_5709) {5094 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
5090 offset0 = BNX2_L2CTX_TYPE_XI;5095 offset0 = BNX2_L2CTX_TYPE_XI;
5091 offset1 = BNX2_L2CTX_CMD_TYPE_XI;5096 offset1 = BNX2_L2CTX_CMD_TYPE_XI;
5092 offset2 = BNX2_L2CTX_TBDR_BHADDR_HI_XI;5097 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
5113static void5118static void
5114bnx2_init_tx_ring(struct bnx2 *bp, int ring_num)5119bnx2_init_tx_ring(struct bnx2 *bp, int ring_num)
5115{5120{
5116 struct tx_bd *txbd;5121 struct bnx2_tx_bd *txbd;
5117 u32 cid = TX_CID;5122 u32 cid = TX_CID;
5118 struct bnx2_napi *bnapi;5123 struct bnx2_napi *bnapi;
5119 struct bnx2_tx_ring_info *txr;5124 struct bnx2_tx_ring_info *txr;
@@ -5128,7 +5133,7 @@ bnx2_init_tx_ring(struct bnx2 *bp, int ring_num) · 8 unmodified lines
5128 5133
5129 bp->tx_wake_thresh = bp->tx_ring_size / 2;5134 bp->tx_wake_thresh = bp->tx_ring_size / 2;
5130 5135
5131 txbd = &txr->tx_desc_ring[MAX_TX_DESC_CNT];5136 txbd = &txr->tx_desc_ring[BNX2_MAX_TX_DESC_CNT];
5132 5137
5133 txbd->tx_bd_haddr_hi = (u64) txr->tx_desc_mapping >> 32;5138 txbd->tx_bd_haddr_hi = (u64) txr->tx_desc_mapping >> 32;
5134 txbd->tx_bd_haddr_lo = (u64) txr->tx_desc_mapping & 0xffffffff;5139 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
5143}5148}
5144 5149
5145static void5150static void
5146bnx2_init_rxbd_rings(struct rx_bd *rx_ring[], dma_addr_t dma[], u32 buf_size,5151bnx2_init_rxbd_rings(struct bnx2_rx_bd *rx_ring[], dma_addr_t dma[],
5147 int num_rings)5152 u32 buf_size, int num_rings)
5148{5153{
5149 int i;5154 int i;
5150 struct rx_bd *rxbd;5155 struct bnx2_rx_bd *rxbd;
5151 5156
5152 for (i = 0; i < num_rings; i++) {5157 for (i = 0; i < num_rings; i++) {
5153 int j;5158 int j;
5154 5159
5155 rxbd = &rx_ring[i][0];5160 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++) {
5157 rxbd->rx_bd_len = buf_size;5162 rxbd->rx_bd_len = buf_size;
5158 rxbd->rx_bd_flags = RX_BD_FLAGS_START | RX_BD_FLAGS_END;5163 rxbd->rx_bd_flags = RX_BD_FLAGS_START | RX_BD_FLAGS_END;
5159 }5164 }
@@ -5187,9 +5192,9 @@ bnx2_init_rx_ring(struct bnx2 *bp, int ring_num) · 27 unmodified lines
5187 5192
5188 bnx2_init_rx_context(bp, cid);5193 bnx2_init_rx_context(bp, cid);
5189 5194
5190 if (CHIP_NUM(bp) == CHIP_NUM_5709) {5195 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
5191 val = REG_RD(bp, BNX2_MQ_MAP_L2_5);5196 val = BNX2_RD(bp, BNX2_MQ_MAP_L2_5);
5192 REG_WR(bp, BNX2_MQ_MAP_L2_5, val | BNX2_MQ_MAP_L2_5_ARM);5197 BNX2_WR(bp, BNX2_MQ_MAP_L2_5, val | BNX2_MQ_MAP_L2_5_ARM);
5193 }5198 }
5194 5199
5195 bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_PG_BUF_SIZE, 0);5200 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
5208 val = (u64) rxr->rx_pg_desc_mapping[0] & 0xffffffff;5213 val = (u64) rxr->rx_pg_desc_mapping[0] & 0xffffffff;
5209 bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_NX_PG_BDHADDR_LO, val);5214 bnx2_ctx_wr(bp, rx_cid_addr, BNX2_L2CTX_NX_PG_BDHADDR_LO, val);
5210 5215
5211 if (CHIP_NUM(bp) == CHIP_NUM_5709)5216 if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
5212 REG_WR(bp, BNX2_MQ_MAP_L2_3, BNX2_MQ_MAP_L2_3_DEFAULT);5217 BNX2_WR(bp, BNX2_MQ_MAP_L2_3, BNX2_MQ_MAP_L2_3_DEFAULT);
5213 }5218 }
5214 5219
5215 val = (u64) rxr->rx_desc_mapping[0] >> 32;5220 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
5225 ring_num, i, bp->rx_pg_ring_size);5230 ring_num, i, bp->rx_pg_ring_size);
5226 break;5231 break;
5227 }5232 }
5228 prod = NEXT_RX_BD(prod);5233 prod = BNX2_NEXT_RX_BD(prod);
5229 ring_prod = RX_PG_RING_IDX(prod);5234 ring_prod = BNX2_RX_PG_RING_IDX(prod);
5230 }5235 }
5231 rxr->rx_pg_prod = prod;5236 rxr->rx_pg_prod = prod;
5232 5237
@@ -5237,8 +5242,8 @@ bnx2_init_rx_ring(struct bnx2 *bp, int ring_num) · 4 unmodified lines
5237 ring_num, i, bp->rx_ring_size);5242 ring_num, i, bp->rx_ring_size);
5238 break;5243 break;
5239 }5244 }
5240 prod = NEXT_RX_BD(prod);5245 prod = BNX2_NEXT_RX_BD(prod);
5241 ring_prod = RX_RING_IDX(prod);5246 ring_prod = BNX2_RX_RING_IDX(prod);
5242 }5247 }
5243 rxr->rx_prod = prod;5248 rxr->rx_prod = prod;
5244 5249
@@ -5246,10 +5251,10 @@ bnx2_init_rx_ring(struct bnx2 *bp, int ring_num) · 1 unmodified line
5246 rxr->rx_bseq_addr = MB_GET_CID_ADDR(cid) + BNX2_L2CTX_HOST_BSEQ;5251 rxr->rx_bseq_addr = MB_GET_CID_ADDR(cid) + BNX2_L2CTX_HOST_BSEQ;
5247 rxr->rx_pg_bidx_addr = MB_GET_CID_ADDR(cid) + BNX2_L2CTX_HOST_PG_BDIDX;5252 rxr->rx_pg_bidx_addr = MB_GET_CID_ADDR(cid) + BNX2_L2CTX_HOST_PG_BDIDX;
5248 5253
5249 REG_WR16(bp, rxr->rx_pg_bidx_addr, rxr->rx_pg_prod);5254 BNX2_WR16(bp, rxr->rx_pg_bidx_addr, rxr->rx_pg_prod);
5250 REG_WR16(bp, rxr->rx_bidx_addr, prod);5255 BNX2_WR16(bp, rxr->rx_bidx_addr, prod);
5251 5256
5252 REG_WR(bp, rxr->rx_bseq_addr, rxr->rx_prod_bseq);5257 BNX2_WR(bp, rxr->rx_bseq_addr, rxr->rx_prod_bseq);
5253}5258}
5254 5259
5255static void5260static void
@@ -5260,15 +5265,15 @@ bnx2_init_all_rings(struct bnx2 *bp) · 4 unmodified lines
5260 5265
5261 bnx2_clear_ring_states(bp);5266 bnx2_clear_ring_states(bp);
5262 5267
5263 REG_WR(bp, BNX2_TSCH_TSS_CFG, 0);5268 BNX2_WR(bp, BNX2_TSCH_TSS_CFG, 0);
5264 for (i = 0; i < bp->num_tx_rings; i++)5269 for (i = 0; i < bp->num_tx_rings; i++)
5265 bnx2_init_tx_ring(bp, i);5270 bnx2_init_tx_ring(bp, i);
5266 5271
5267 if (bp->num_tx_rings > 1)5272 if (bp->num_tx_rings > 1)
5268 REG_WR(bp, BNX2_TSCH_TSS_CFG, ((bp->num_tx_rings - 1) << 24) |5273 BNX2_WR(bp, BNX2_TSCH_TSS_CFG, ((bp->num_tx_rings - 1) << 24) |
5269 (TX_TSS_CID << 7));5274 (TX_TSS_CID << 7));
5270 5275
5271 REG_WR(bp, BNX2_RLUP_RSS_CONFIG, 0);5276 BNX2_WR(bp, BNX2_RLUP_RSS_CONFIG, 0);
5272 bnx2_reg_wr_ind(bp, BNX2_RXP_SCRATCH_RSS_TBL_SZ, 0);5277 bnx2_reg_wr_ind(bp, BNX2_RXP_SCRATCH_RSS_TBL_SZ, 0);
5273 5278
5274 for (i = 0; i < bp->num_rx_rings; i++)5279 for (i = 0; i < bp->num_rx_rings; i++)
@@ -5282,8 +5287,8 @@ bnx2_init_all_rings(struct bnx2 *bp) · 7 unmodified lines
5282 5287
5283 tbl_32 |= (i % (bp->num_rx_rings - 1)) << shift;5288 tbl_32 |= (i % (bp->num_rx_rings - 1)) << shift;
5284 if ((i % 8) == 7) {5289 if ((i % 8) == 7) {
5285 REG_WR(bp, BNX2_RLUP_RSS_DATA, tbl_32);5290 BNX2_WR(bp, BNX2_RLUP_RSS_DATA, tbl_32);
5286 REG_WR(bp, BNX2_RLUP_RSS_COMMAND, (i >> 3) |5291 BNX2_WR(bp, BNX2_RLUP_RSS_COMMAND, (i >> 3) |
5287 BNX2_RLUP_RSS_COMMAND_RSS_WRITE_MASK |5292 BNX2_RLUP_RSS_COMMAND_RSS_WRITE_MASK |
5288 BNX2_RLUP_RSS_COMMAND_WRITE |5293 BNX2_RLUP_RSS_COMMAND_WRITE |
5289 BNX2_RLUP_RSS_COMMAND_HASH_MASK);5294 BNX2_RLUP_RSS_COMMAND_HASH_MASK);
@@ -5294,7 +5299,7 @@ bnx2_init_all_rings(struct bnx2 *bp) · 4 unmodified lines
5294 val = BNX2_RLUP_RSS_CONFIG_IPV4_RSS_TYPE_ALL_XI |5299 val = BNX2_RLUP_RSS_CONFIG_IPV4_RSS_TYPE_ALL_XI |
5295 BNX2_RLUP_RSS_CONFIG_IPV6_RSS_TYPE_ALL_XI;5300 BNX2_RLUP_RSS_CONFIG_IPV6_RSS_TYPE_ALL_XI;
5296 5301
5297 REG_WR(bp, BNX2_RLUP_RSS_CONFIG, val);5302 BNX2_WR(bp, BNX2_RLUP_RSS_CONFIG, val);
5298 5303
5299 }5304 }
5300}5305}
@@ -5303,8 +5308,8 @@ static u32 bnx2_find_max_ring(u32 ring_size, u32 max_size) · 2 unmodified lines
5303{5308{
5304 u32 max, num_rings = 1;5309 u32 max, num_rings = 1;
5305 5310
5306 while (ring_size > MAX_RX_DESC_CNT) {5311 while (ring_size > BNX2_MAX_RX_DESC_CNT) {
5307 ring_size -= MAX_RX_DESC_CNT;5312 ring_size -= BNX2_MAX_RX_DESC_CNT;
5308 num_rings++;5313 num_rings++;
5309 }5314 }
5310 /* round to next power of 2 */5315 /* round to next power of 2 */
@@ -5337,13 +5342,14 @@ bnx2_set_rx_ring_size(struct bnx2 *bp, u32 size) · 26 unmodified lines
5337 int pages = PAGE_ALIGN(bp->dev->mtu - 40) >> PAGE_SHIFT;5342 int pages = PAGE_ALIGN(bp->dev->mtu - 40) >> PAGE_SHIFT;
5338 5343
5339 jumbo_size = size * pages;5344 jumbo_size = size * pages;
5340 if (jumbo_size > MAX_TOTAL_RX_PG_DESC_CNT)5345 if (jumbo_size > BNX2_MAX_TOTAL_RX_PG_DESC_CNT)
5341 jumbo_size = MAX_TOTAL_RX_PG_DESC_CNT;5346 jumbo_size = BNX2_MAX_TOTAL_RX_PG_DESC_CNT;
5342 5347
5343 bp->rx_pg_ring_size = jumbo_size;5348 bp->rx_pg_ring_size = jumbo_size;
5344 bp->rx_max_pg_ring = bnx2_find_max_ring(jumbo_size,5349 bp->rx_max_pg_ring = bnx2_find_max_ring(jumbo_size,
5345 MAX_RX_PG_RINGS);5350 BNX2_MAX_RX_PG_RINGS);
5346 bp->rx_max_pg_ring_idx = (bp->rx_max_pg_ring * RX_DESC_CNT) - 1;5351 bp->rx_max_pg_ring_idx =
5352 (bp->rx_max_pg_ring * BNX2_RX_DESC_CNT) - 1;
5347 rx_size = BNX2_RX_COPY_THRESH + BNX2_RX_OFFSET;5353 rx_size = BNX2_RX_COPY_THRESH + BNX2_RX_OFFSET;
5348 bp->rx_copy_thresh = 0;5354 bp->rx_copy_thresh = 0;
5349 }5355 }
@@ -5354,8 +5360,8 @@ bnx2_set_rx_ring_size(struct bnx2 *bp, u32 size) · 4 unmodified lines
5354 NET_SKB_PAD + SKB_DATA_ALIGN(sizeof(struct skb_shared_info));5360 NET_SKB_PAD + SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
5355 bp->rx_jumbo_thresh = rx_size - BNX2_RX_OFFSET;5361 bp->rx_jumbo_thresh = rx_size - BNX2_RX_OFFSET;
5356 bp->rx_ring_size = size;5362 bp->rx_ring_size = size;
5357 bp->rx_max_ring = bnx2_find_max_ring(size, MAX_RX_RINGS);5363 bp->rx_max_ring = bnx2_find_max_ring(size, BNX2_MAX_RX_RINGS);
5358 bp->rx_max_ring_idx = (bp->rx_max_ring * RX_DESC_CNT) - 1;5364 bp->rx_max_ring_idx = (bp->rx_max_ring * BNX2_RX_DESC_CNT) - 1;
5359}5365}
5360 5366
5361static void5367static void
@@ -5371,13 +5377,13 @@ bnx2_free_tx_skbs(struct bnx2 *bp) · 9 unmodified lines
5371 if (txr->tx_buf_ring == NULL)5377 if (txr->tx_buf_ring == NULL)
5372 continue;5378 continue;
5373 5379
5374 for (j = 0; j < TX_DESC_CNT; ) {5380 for (j = 0; j < BNX2_TX_DESC_CNT; ) {
5375 struct sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];5381 struct bnx2_sw_tx_bd *tx_buf = &txr->tx_buf_ring[j];
5376 struct sk_buff *skb = tx_buf->skb;5382 struct sk_buff *skb = tx_buf->skb;
5377 int k, last;5383 int k, last;
5378 5384
5379 if (skb == NULL) {5385 if (skb == NULL) {
5380 j = NEXT_TX_BD(j);5386 j = BNX2_NEXT_TX_BD(j);
5381 continue;5387 continue;
5382 }5388 }
5383 5389
@@ -5389,9 +5395,9 @@ bnx2_free_tx_skbs(struct bnx2 *bp) · 5 unmodified lines
5389 tx_buf->skb = NULL;5395 tx_buf->skb = NULL;
5390 5396
5391 last = tx_buf->nr_frags;5397 last = tx_buf->nr_frags;
5392 j = NEXT_TX_BD(j);5398 j = BNX2_NEXT_TX_BD(j);
5393 for (k = 0; k < last; k++, j = NEXT_TX_BD(j)) {5399 for (k = 0; k < last; k++, j = BNX2_NEXT_TX_BD(j)) {
5394 tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)];5400 tx_buf = &txr->tx_buf_ring[BNX2_TX_RING_IDX(j)];
5395 dma_unmap_page(&bp->pdev->dev,5401 dma_unmap_page(&bp->pdev->dev,
5396 dma_unmap_addr(tx_buf, mapping),5402 dma_unmap_addr(tx_buf, mapping),
5397 skb_frag_size(&skb_shinfo(skb)->frags[k]),5403 skb_frag_size(&skb_shinfo(skb)->frags[k]),
@@ -5417,7 +5423,7 @@ bnx2_free_rx_skbs(struct bnx2 *bp) · 19 unmodified lines
5417 return;5423 return;
5418 5424
5419 for (j = 0; j < bp->rx_max_ring_idx; j++) {5425 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];
5421 u8 *data = rx_buf->data;5427 u8 *data = rx_buf->data;
5422 5428
5423 if (data == NULL)5429 if (data == NULL)
@@ -5615,7 +5621,7 @@ bnx2_test_registers(struct bnx2 *bp) · 191 unmodified lines
5615 5621
5616 ret = 0;5622 ret = 0;
5617 is_5709 = 0;5623 is_5709 = 0;
5618 if (CHIP_NUM(bp) == CHIP_NUM_5709)5624 if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
5619 is_5709 = 1;5625 is_5709 = 1;
5620 5626
5621 for (i = 0; reg_tbl[i].offset != 0xffff; i++) {5627 for (i = 0; reg_tbl[i].offset != 0xffff; i++) {
@@ -5714,7 +5720,7 @@ bnx2_test_memory(struct bnx2 *bp) · 92 unmodified lines
5714 };5720 };
5715 struct mem_entry *mem_tbl;5721 struct mem_entry *mem_tbl;
5716 5722
5717 if (CHIP_NUM(bp) == CHIP_NUM_5709)5723 if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
5718 mem_tbl = mem_tbl_5709;5724 mem_tbl = mem_tbl_5709;
5719 else5725 else
5720 mem_tbl = mem_tbl_5706;5726 mem_tbl = mem_tbl_5706;
@@ -5741,8 +5747,8 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode) · 20 unmodified lines
5741 unsigned char *packet;5747 unsigned char *packet;
5742 u16 rx_start_idx, rx_idx;5748 u16 rx_start_idx, rx_idx;
5743 dma_addr_t map;5749 dma_addr_t map;
5744 struct tx_bd *txbd;5750 struct bnx2_tx_bd *txbd;
5745 struct sw_bd *rx_buf;5751 struct bnx2_sw_bd *rx_buf;
5746 struct l2_fhdr *rx_hdr;5752 struct l2_fhdr *rx_hdr;
5747 int ret = -ENODEV;5753 int ret = -ENODEV;
5748 struct bnx2_napi *bnapi = &bp->bnx2_napi[0], *tx_napi;5754 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
5784 return -EIO;5790 return -EIO;
5785 }5791 }
5786 5792
5787 REG_WR(bp, BNX2_HC_COMMAND,5793 BNX2_WR(bp, BNX2_HC_COMMAND,
5788 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);5794 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
5789 5795
5790 REG_RD(bp, BNX2_HC_COMMAND);5796 BNX2_RD(bp, BNX2_HC_COMMAND);
5791 5797
5792 udelay(5);5798 udelay(5);
5793 rx_start_idx = bnx2_get_hw_rx_cons(bnapi);5799 rx_start_idx = bnx2_get_hw_rx_cons(bnapi);
5794 5800
5795 num_pkts = 0;5801 num_pkts = 0;
5796 5802
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)];
5798 5804
5799 txbd->tx_bd_haddr_hi = (u64) map >> 32;5805 txbd->tx_bd_haddr_hi = (u64) map >> 32;
5800 txbd->tx_bd_haddr_lo = (u64) map & 0xffffffff;5806 txbd->tx_bd_haddr_lo = (u64) map & 0xffffffff;
@@ -5802,18 +5808,18 @@ bnx2_run_loopback(struct bnx2 *bp, int loopback_mode) · 1 unmodified line
5802 txbd->tx_bd_vlan_tag_flags = TX_BD_FLAGS_START | TX_BD_FLAGS_END;5808 txbd->tx_bd_vlan_tag_flags = TX_BD_FLAGS_START | TX_BD_FLAGS_END;
5803 5809
5804 num_pkts++;5810 num_pkts++;
5805 txr->tx_prod = NEXT_TX_BD(txr->tx_prod);5811 txr->tx_prod = BNX2_NEXT_TX_BD(txr->tx_prod);
5806 txr->tx_prod_bseq += pkt_size;5812 txr->tx_prod_bseq += pkt_size;
5807 5813
5808 REG_WR16(bp, txr->tx_bidx_addr, txr->tx_prod);5814 BNX2_WR16(bp, txr->tx_bidx_addr, txr->tx_prod);
5809 REG_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq);5815 BNX2_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq);
5810 5816
5811 udelay(100);5817 udelay(100);
5812 5818
5813 REG_WR(bp, BNX2_HC_COMMAND,5819 BNX2_WR(bp, BNX2_HC_COMMAND,
5814 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);5820 bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW_WO_INT);
5815 5821
5816 REG_RD(bp, BNX2_HC_COMMAND);5822 BNX2_RD(bp, BNX2_HC_COMMAND);
5817 5823
5818 udelay(5);5824 udelay(5);
5819 5825
@@ -5962,14 +5968,14 @@ bnx2_test_intr(struct bnx2 *bp) · 142 unmodified lines
5962 if (!netif_running(bp->dev))5968 if (!netif_running(bp->dev))
5963 return -ENODEV;5969 return -ENODEV;
5964 5970
5965 status_idx = REG_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff;5971 status_idx = BNX2_RD(bp, BNX2_PCICFG_INT_ACK_CMD) & 0xffff;
5966 5972
5967 /* This register is not touched during run-time. */5973 /* This register is not touched during run-time. */
5968 REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW);5974 BNX2_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd | BNX2_HC_COMMAND_COAL_NOW);
5969 REG_RD(bp, BNX2_HC_COMMAND);5975 BNX2_RD(bp, BNX2_HC_COMMAND);
5970 5976
5971 for (i = 0; i < 10; i++) {5977 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) !=
5973 status_idx) {5979 status_idx) {
5974 5980
5975 break;5981 break;
@@ -6132,11 +6138,11 @@ bnx2_timer(unsigned long data) · 156 unmodified lines
6132 6138
6133 /* workaround occasional corrupted counters */6139 /* workaround occasional corrupted counters */
6134 if ((bp->flags & BNX2_FLAG_BROKEN_STATS) && bp->stats_ticks)6140 if ((bp->flags & BNX2_FLAG_BROKEN_STATS) && bp->stats_ticks)
6135 REG_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd |6141 BNX2_WR(bp, BNX2_HC_COMMAND, bp->hc_cmd |
6136 BNX2_HC_COMMAND_STATS_NOW);6142 BNX2_HC_COMMAND_STATS_NOW);
6137 6143
6138 if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {6144 if (bp->phy_flags & BNX2_PHY_FLAG_SERDES) {
6139 if (CHIP_NUM(bp) == CHIP_NUM_5706)6145 if (BNX2_CHIP(bp) == BNX2_CHIP_5706)
6140 bnx2_5706_serdes_timer(bp);6146 bnx2_5706_serdes_timer(bp);
6141 else6147 else
6142 bnx2_5708_serdes_timer(bp);6148 bnx2_5708_serdes_timer(bp);
@@ -6205,13 +6211,13 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs) · 62 unmodified lines
6205 const int len = sizeof(bp->irq_tbl[0].name);6211 const int len = sizeof(bp->irq_tbl[0].name);
6206 6212
6207 bnx2_setup_msix_tbl(bp);6213 bnx2_setup_msix_tbl(bp);
6208 REG_WR(bp, BNX2_PCI_MSIX_CONTROL, BNX2_MAX_MSIX_HW_VEC - 1);6214 BNX2_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);6215 BNX2_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);6216 BNX2_WR(bp, BNX2_PCI_MSIX_PBA_OFF_BIT, BNX2_PCI_GRC_WINDOW3_BASE);
6211 6217
6212 /* Need to flush the previous three writes to ensure MSI-X6218 /* Need to flush the previous three writes to ensure MSI-X
6213 * is setup properly */6219 * is setup properly */
6214 REG_RD(bp, BNX2_PCI_MSIX_CONTROL);6220 BNX2_RD(bp, BNX2_PCI_MSIX_CONTROL);
6215 6221
6216 for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {6222 for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
6217 msix_ent[i].entry = i;6223 msix_ent[i].entry = i;
@@ -6274,7 +6280,7 @@ bnx2_setup_int_mode(struct bnx2 *bp, int dis_msi) · 56 unmodified lines
6274 !(bp->flags & BNX2_FLAG_USING_MSIX)) {6280 !(bp->flags & BNX2_FLAG_USING_MSIX)) {
6275 if (pci_enable_msi(bp->pdev) == 0) {6281 if (pci_enable_msi(bp->pdev) == 0) {
6276 bp->flags |= BNX2_FLAG_USING_MSI;6282 bp->flags |= BNX2_FLAG_USING_MSI;
6277 if (CHIP_NUM(bp) == CHIP_NUM_5709) {6283 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
6278 bp->flags |= BNX2_FLAG_ONE_SHOT_MSI;6284 bp->flags |= BNX2_FLAG_ONE_SHOT_MSI;
6279 bp->irq_tbl[0].handler = bnx2_msi_1shot;6285 bp->irq_tbl[0].handler = bnx2_msi_1shot;
6280 } else6286 } else
@@ -6464,22 +6470,22 @@ bnx2_dump_ftq(struct bnx2 *bp) · 183 unmodified lines
6464 netdev_err(dev, "<--- end FTQ dump --->\n");6470 netdev_err(dev, "<--- end FTQ dump --->\n");
6465 netdev_err(dev, "<--- start TBDC dump --->\n");6471 netdev_err(dev, "<--- start TBDC dump --->\n");
6466 netdev_err(dev, "TBDC free cnt: %ld\n",6472 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);
6468 netdev_err(dev, "LINE CID BIDX CMD VALIDS\n");6474 netdev_err(dev, "LINE CID BIDX CMD VALIDS\n");
6469 for (i = 0; i < 0x20; i++) {6475 for (i = 0; i < 0x20; i++) {
6470 int j = 0;6476 int j = 0;
6471 6477
6472 REG_WR(bp, BNX2_TBDC_BD_ADDR, i);6478 BNX2_WR(bp, BNX2_TBDC_BD_ADDR, i);
6473 REG_WR(bp, BNX2_TBDC_CAM_OPCODE,6479 BNX2_WR(bp, BNX2_TBDC_CAM_OPCODE,
6474 BNX2_TBDC_CAM_OPCODE_OPCODE_CAM_READ);6480 BNX2_TBDC_CAM_OPCODE_OPCODE_CAM_READ);
6475 REG_WR(bp, BNX2_TBDC_COMMAND, BNX2_TBDC_COMMAND_CMD_REG_ARB);6481 BNX2_WR(bp, BNX2_TBDC_COMMAND, BNX2_TBDC_COMMAND_CMD_REG_ARB);
6476 while ((REG_RD(bp, BNX2_TBDC_COMMAND) &6482 while ((BNX2_RD(bp, BNX2_TBDC_COMMAND) &
6477 BNX2_TBDC_COMMAND_CMD_REG_ARB) && j < 100)6483 BNX2_TBDC_COMMAND_CMD_REG_ARB) && j < 100)
6478 j++;6484 j++;
6479 6485
6480 cid = REG_RD(bp, BNX2_TBDC_CID);6486 cid = BNX2_RD(bp, BNX2_TBDC_CID);
6481 bdidx = REG_RD(bp, BNX2_TBDC_BIDX);6487 bdidx = BNX2_RD(bp, BNX2_TBDC_BIDX);
6482 valid = REG_RD(bp, BNX2_TBDC_CAM_OPCODE);6488 valid = BNX2_RD(bp, BNX2_TBDC_CAM_OPCODE);
6483 netdev_err(dev, "%02x %06x %04lx %02x [%x]\n",6489 netdev_err(dev, "%02x %06x %04lx %02x [%x]\n",
6484 i, cid, bdidx & BNX2_TBDC_BDIDX_BDIDX,6490 i, cid, bdidx & BNX2_TBDC_BDIDX_BDIDX,
6485 bdidx >> 24, (valid >> 8) & 0x0ff);6491 bdidx >> 24, (valid >> 8) & 0x0ff);
@@ -6500,15 +6506,15 @@ bnx2_dump_state(struct bnx2 *bp) · 14 unmodified lines
6500 pci_read_config_dword(bp->pdev, BNX2_PCICFG_MISC_CONFIG, &val2);6506 pci_read_config_dword(bp->pdev, BNX2_PCICFG_MISC_CONFIG, &val2);
6501 netdev_err(dev, "DEBUG: PCI_PM[%08x] PCI_MISC_CFG[%08x]\n", val1, val2);6507 netdev_err(dev, "DEBUG: PCI_PM[%08x] PCI_MISC_CFG[%08x]\n", val1, val2);
6502 netdev_err(dev, "DEBUG: EMAC_TX_STATUS[%08x] EMAC_RX_STATUS[%08x]\n",6508 netdev_err(dev, "DEBUG: EMAC_TX_STATUS[%08x] EMAC_RX_STATUS[%08x]\n",
6503 REG_RD(bp, BNX2_EMAC_TX_STATUS),6509 BNX2_RD(bp, BNX2_EMAC_TX_STATUS),
6504 REG_RD(bp, BNX2_EMAC_RX_STATUS));6510 BNX2_RD(bp, BNX2_EMAC_RX_STATUS));
6505 netdev_err(dev, "DEBUG: RPM_MGMT_PKT_CTRL[%08x]\n",6511 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));
6507 netdev_err(dev, "DEBUG: HC_STATS_INTERRUPT_STATUS[%08x]\n",6513 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));
6509 if (bp->flags & BNX2_FLAG_USING_MSIX)6515 if (bp->flags & BNX2_FLAG_USING_MSIX)
6510 netdev_err(dev, "DEBUG: PBA[%08x]\n",6516 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));
6512}6518}
6513 6519
6514static void6520static void
@@ -6533,8 +6539,8 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) · 18 unmodified lines
6533{6539{
6534 struct bnx2 *bp = netdev_priv(dev);6540 struct bnx2 *bp = netdev_priv(dev);
6535 dma_addr_t mapping;6541 dma_addr_t mapping;
6536 struct tx_bd *txbd;6542 struct bnx2_tx_bd *txbd;
6537 struct sw_tx_bd *tx_buf;6543 struct bnx2_sw_tx_bd *tx_buf;
6538 u32 len, vlan_tag_flags, last_frag, mss;6544 u32 len, vlan_tag_flags, last_frag, mss;
6539 u16 prod, ring_prod;6545 u16 prod, ring_prod;
6540 int i;6546 int i;
@@ -6557,7 +6563,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) · 16 unmodified lines
6557 }6563 }
6558 len = skb_headlen(skb);6564 len = skb_headlen(skb);
6559 prod = txr->tx_prod;6565 prod = txr->tx_prod;
6560 ring_prod = TX_RING_IDX(prod);6566 ring_prod = BNX2_TX_RING_IDX(prod);
6561 6567
6562 vlan_tag_flags = 0;6568 vlan_tag_flags = 0;
6563 if (skb->ip_summed == CHECKSUM_PARTIAL) {6569 if (skb->ip_summed == CHECKSUM_PARTIAL) {
@@ -6627,8 +6633,8 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) · 63 unmodified lines
6627 for (i = 0; i < last_frag; i++) {6633 for (i = 0; i < last_frag; i++) {
6628 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];6634 const skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
6629 6635
6630 prod = NEXT_TX_BD(prod);6636 prod = BNX2_NEXT_TX_BD(prod);
6631 ring_prod = TX_RING_IDX(prod);6637 ring_prod = BNX2_TX_RING_IDX(prod);
6632 txbd = &txr->tx_desc_ring[ring_prod];6638 txbd = &txr->tx_desc_ring[ring_prod];
6633 6639
6634 len = skb_frag_size(frag);6640 len = skb_frag_size(frag);
@@ -6652,11 +6658,11 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) · 17 unmodified lines
6652 6658
6653 netdev_tx_sent_queue(txq, skb->len);6659 netdev_tx_sent_queue(txq, skb->len);
6654 6660
6655 prod = NEXT_TX_BD(prod);6661 prod = BNX2_NEXT_TX_BD(prod);
6656 txr->tx_prod_bseq += skb->len;6662 txr->tx_prod_bseq += skb->len;
6657 6663
6658 REG_WR16(bp, txr->tx_bidx_addr, prod);6664 BNX2_WR16(bp, txr->tx_bidx_addr, prod);
6659 REG_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq);6665 BNX2_WR(bp, txr->tx_bseq_addr, txr->tx_prod_bseq);
6660 6666
6661 mmiowb();6667 mmiowb();
6662 6668
@@ -6682,7 +6688,7 @@ dma_error: · 19 unmodified lines
6682 6688
6683 /* start back at beginning and unmap skb */6689 /* start back at beginning and unmap skb */
6684 prod = txr->tx_prod;6690 prod = txr->tx_prod;
6685 ring_prod = TX_RING_IDX(prod);6691 ring_prod = BNX2_TX_RING_IDX(prod);
6686 tx_buf = &txr->tx_buf_ring[ring_prod];6692 tx_buf = &txr->tx_buf_ring[ring_prod];
6687 tx_buf->skb = NULL;6693 tx_buf->skb = NULL;
6688 dma_unmap_single(&bp->pdev->dev, dma_unmap_addr(tx_buf, mapping),6694 dma_unmap_single(&bp->pdev->dev, dma_unmap_addr(tx_buf, mapping),
@@ -6690,8 +6696,8 @@ dma_error: · 1 unmodified line
6690 6696
6691 /* unmap remaining mapped pages */6697 /* unmap remaining mapped pages */
6692 for (i = 0; i < last_frag; i++) {6698 for (i = 0; i < last_frag; i++) {
6693 prod = NEXT_TX_BD(prod);6699 prod = BNX2_NEXT_TX_BD(prod);
6694 ring_prod = TX_RING_IDX(prod);6700 ring_prod = BNX2_TX_RING_IDX(prod);
6695 tx_buf = &txr->tx_buf_ring[ring_prod];6701 tx_buf = &txr->tx_buf_ring[ring_prod];
6696 dma_unmap_page(&bp->pdev->dev, dma_unmap_addr(tx_buf, mapping),6702 dma_unmap_page(&bp->pdev->dev, dma_unmap_addr(tx_buf, mapping),
6697 skb_frag_size(&skb_shinfo(skb)->frags[i]),6703 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
6810 GET_32BIT_NET_STATS(stat_Dot3StatsExcessiveCollisions) +6816 GET_32BIT_NET_STATS(stat_Dot3StatsExcessiveCollisions) +
6811 GET_32BIT_NET_STATS(stat_Dot3StatsLateCollisions);6817 GET_32BIT_NET_STATS(stat_Dot3StatsLateCollisions);
6812 6818
6813 if ((CHIP_NUM(bp) == CHIP_NUM_5706) ||6819 if ((BNX2_CHIP(bp) == BNX2_CHIP_5706) ||
6814 (CHIP_ID(bp) == CHIP_ID_5708_A0))6820 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_A0))
6815 net_stats->tx_carrier_errors = 0;6821 net_stats->tx_carrier_errors = 0;
6816 else {6822 else {
6817 net_stats->tx_carrier_errors =6823 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
7030 offset = reg_boundaries[0];7036 offset = reg_boundaries[0];
7031 p += offset;7037 p += offset;
7032 while (offset < BNX2_REGDUMP_LEN) {7038 while (offset < BNX2_REGDUMP_LEN) {
7033 *p++ = REG_RD(bp, offset);7039 *p++ = BNX2_RD(bp, offset);
7034 offset += 4;7040 offset += 4;
7035 if (offset == reg_boundaries[i + 1]) {7041 if (offset == reg_boundaries[i + 1]) {
7036 offset = reg_boundaries[i + 2];7042 offset = reg_boundaries[i + 2];
@@ -7254,13 +7260,13 @@ bnx2_get_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) · 217 unmodified lines
7254{7260{
7255 struct bnx2 *bp = netdev_priv(dev);7261 struct bnx2 *bp = netdev_priv(dev);
7256 7262
7257 ering->rx_max_pending = MAX_TOTAL_RX_DESC_CNT;7263 ering->rx_max_pending = BNX2_MAX_TOTAL_RX_DESC_CNT;
7258 ering->rx_jumbo_max_pending = MAX_TOTAL_RX_PG_DESC_CNT;7264 ering->rx_jumbo_max_pending = BNX2_MAX_TOTAL_RX_PG_DESC_CNT;
7259 7265
7260 ering->rx_pending = bp->rx_ring_size;7266 ering->rx_pending = bp->rx_ring_size;
7261 ering->rx_jumbo_pending = bp->rx_pg_ring_size;7267 ering->rx_jumbo_pending = bp->rx_pg_ring_size;
7262 7268
7263 ering->tx_max_pending = MAX_TX_DESC_CNT;7269 ering->tx_max_pending = BNX2_MAX_TX_DESC_CNT;
7264 ering->tx_pending = bp->tx_ring_size;7270 ering->tx_pending = bp->tx_ring_size;
7265}7271}
7266 7272
@@ -7326,8 +7332,8 @@ bnx2_set_ringparam(struct net_device *dev, struct ethtool_ringparam *ering) · 59 unmodified lines
7326 struct bnx2 *bp = netdev_priv(dev);7332 struct bnx2 *bp = netdev_priv(dev);
7327 int rc;7333 int rc;
7328 7334
7329 if ((ering->rx_pending > MAX_TOTAL_RX_DESC_CNT) ||7335 if ((ering->rx_pending > BNX2_MAX_TOTAL_RX_DESC_CNT) ||
7330 (ering->tx_pending > MAX_TX_DESC_CNT) ||7336 (ering->tx_pending > BNX2_MAX_TX_DESC_CNT) ||
7331 (ering->tx_pending <= MAX_SKB_FRAGS)) {7337 (ering->tx_pending <= MAX_SKB_FRAGS)) {
7332 7338
7333 return -EINVAL;7339 return -EINVAL;
@@ -7614,10 +7620,10 @@ bnx2_get_ethtool_stats(struct net_device *dev, · 280 unmodified lines
7614 return;7620 return;
7615 }7621 }
7616 7622
7617 if ((CHIP_ID(bp) == CHIP_ID_5706_A0) ||7623 if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) ||
7618 (CHIP_ID(bp) == CHIP_ID_5706_A1) ||7624 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1) ||
7619 (CHIP_ID(bp) == CHIP_ID_5706_A2) ||7625 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A2) ||
7620 (CHIP_ID(bp) == CHIP_ID_5708_A0))7626 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_A0))
7621 stats_len_arr = bnx2_5706_stats_len_arr;7627 stats_len_arr = bnx2_5706_stats_len_arr;
7622 else7628 else
7623 stats_len_arr = bnx2_5708_stats_len_arr;7629 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
7655 case ETHTOOL_ID_ACTIVE:7661 case ETHTOOL_ID_ACTIVE:
7656 bnx2_set_power_state(bp, PCI_D0);7662 bnx2_set_power_state(bp, PCI_D0);
7657 7663
7658 bp->leds_save = REG_RD(bp, BNX2_MISC_CFG);7664 bp->leds_save = BNX2_RD(bp, BNX2_MISC_CFG);
7659 REG_WR(bp, BNX2_MISC_CFG, BNX2_MISC_CFG_LEDMODE_MAC);7665 BNX2_WR(bp, BNX2_MISC_CFG, BNX2_MISC_CFG_LEDMODE_MAC);
7660 return 1; /* cycle on/off once per second */7666 return 1; /* cycle on/off once per second */
7661 7667
7662 case ETHTOOL_ID_ON:7668 case ETHTOOL_ID_ON:
7663 REG_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE |7669 BNX2_WR(bp, BNX2_EMAC_LED, BNX2_EMAC_LED_OVERRIDE |
7664 BNX2_EMAC_LED_1000MB_OVERRIDE |7670 BNX2_EMAC_LED_1000MB_OVERRIDE |
7665 BNX2_EMAC_LED_100MB_OVERRIDE |7671 BNX2_EMAC_LED_100MB_OVERRIDE |
7666 BNX2_EMAC_LED_10MB_OVERRIDE |7672 BNX2_EMAC_LED_10MB_OVERRIDE |
7667 BNX2_EMAC_LED_TRAFFIC_OVERRIDE |7673 BNX2_EMAC_LED_TRAFFIC_OVERRIDE |
7668 BNX2_EMAC_LED_TRAFFIC);7674 BNX2_EMAC_LED_TRAFFIC);
7669 break;7675 break;
7670 7676
7671 case ETHTOOL_ID_OFF:7677 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);
7673 break;7679 break;
7674 7680
7675 case ETHTOOL_ID_INACTIVE:7681 case ETHTOOL_ID_INACTIVE:
7676 REG_WR(bp, BNX2_EMAC_LED, 0);7682 BNX2_WR(bp, BNX2_EMAC_LED, 0);
7677 REG_WR(bp, BNX2_MISC_CFG, bp->leds_save);7683 BNX2_WR(bp, BNX2_MISC_CFG, bp->leds_save);
7678 7684
7679 if (!netif_running(dev))7685 if (!netif_running(dev))
7680 bnx2_set_power_state(bp, PCI_D3hot);7686 bnx2_set_power_state(bp, PCI_D3hot);
@@ -7896,10 +7902,10 @@ poll_bnx2(struct net_device *dev) · 215 unmodified lines
7896}7902}
7897#endif7903#endif
7898 7904
7899static void __devinit7905static void
7900bnx2_get_5709_media(struct bnx2 *bp)7906bnx2_get_5709_media(struct bnx2 *bp)
7901{7907{
7902 u32 val = REG_RD(bp, BNX2_MISC_DUAL_MEDIA_CTRL);7908 u32 val = BNX2_RD(bp, BNX2_MISC_DUAL_MEDIA_CTRL);
7903 u32 bond_id = val & BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID;7909 u32 bond_id = val & BNX2_MISC_DUAL_MEDIA_CTRL_BOND_ID;
7904 u32 strap;7910 u32 strap;
7905 7911
@@ -7934,18 +7940,18 @@ bnx2_get_5709_media(struct bnx2 *bp) · 28 unmodified lines
7934 }7940 }
7935}7941}
7936 7942
7937static void __devinit7943static void
7938bnx2_get_pci_speed(struct bnx2 *bp)7944bnx2_get_pci_speed(struct bnx2 *bp)
7939{7945{
7940 u32 reg;7946 u32 reg;
7941 7947
7942 reg = REG_RD(bp, BNX2_PCICFG_MISC_STATUS);7948 reg = BNX2_RD(bp, BNX2_PCICFG_MISC_STATUS);
7943 if (reg & BNX2_PCICFG_MISC_STATUS_PCIX_DET) {7949 if (reg & BNX2_PCICFG_MISC_STATUS_PCIX_DET) {
7944 u32 clkreg;7950 u32 clkreg;
7945 7951
7946 bp->flags |= BNX2_FLAG_PCIX;7952 bp->flags |= BNX2_FLAG_PCIX;
7947 7953
7948 clkreg = REG_RD(bp, BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS);7954 clkreg = BNX2_RD(bp, BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS);
7949 7955
7950 clkreg &= BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET;7956 clkreg &= BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET;
7951 switch (clkreg) {7957 switch (clkreg) {
@@ -7986,7 +7992,7 @@ bnx2_get_pci_speed(struct bnx2 *bp) · 34 unmodified lines
7986 7992
7987}7993}
7988 7994
7989static void __devinit7995static void
7990bnx2_read_vpd_fw_ver(struct bnx2 *bp)7996bnx2_read_vpd_fw_ver(struct bnx2 *bp)
7991{7997{
7992 int rc, i, j;7998 int rc, i, j;
@@ -8054,7 +8060,7 @@ vpd_done: · 61 unmodified lines
8054 kfree(data);8060 kfree(data);
8055}8061}
8056 8062
8057static int __devinit8063static int
8058bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)8064bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
8059{8065{
8060 struct bnx2 *bp;8066 struct bnx2 *bp;
@@ -8131,20 +8137,20 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 70 unmodified lines
8131 * Rely on CPU to do target byte swapping on big endian systems8137 * Rely on CPU to do target byte swapping on big endian systems
8132 * The chip's target access swapping will not swap all accesses8138 * The chip's target access swapping will not swap all accesses
8133 */8139 */
8134 REG_WR(bp, BNX2_PCICFG_MISC_CONFIG,8140 BNX2_WR(bp, BNX2_PCICFG_MISC_CONFIG,
8135 BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |8141 BNX2_PCICFG_MISC_CONFIG_REG_WINDOW_ENA |
8136 BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP);8142 BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP);
8137 8143
8138 bp->chip_id = REG_RD(bp, BNX2_MISC_ID);8144 bp->chip_id = BNX2_RD(bp, BNX2_MISC_ID);
8139 8145
8140 if (CHIP_NUM(bp) == CHIP_NUM_5709) {8146 if (BNX2_CHIP(bp) == BNX2_CHIP_5709) {
8141 if (!pci_is_pcie(pdev)) {8147 if (!pci_is_pcie(pdev)) {
8142 dev_err(&pdev->dev, "Not PCIE, aborting\n");8148 dev_err(&pdev->dev, "Not PCIE, aborting\n");
8143 rc = -EIO;8149 rc = -EIO;
8144 goto err_out_unmap;8150 goto err_out_unmap;
8145 }8151 }
8146 bp->flags |= BNX2_FLAG_PCIE;8152 bp->flags |= BNX2_FLAG_PCIE;
8147 if (CHIP_REV(bp) == CHIP_REV_Ax)8153 if (BNX2_CHIP_REV(bp) == BNX2_CHIP_REV_Ax)
8148 bp->flags |= BNX2_FLAG_JUMBO_BROKEN;8154 bp->flags |= BNX2_FLAG_JUMBO_BROKEN;
8149 8155
8150 /* AER (Advanced Error Reporting) hooks */8156 /* AER (Advanced Error Reporting) hooks */
@@ -8163,18 +8169,20 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 12 unmodified lines
8163 bp->flags |= BNX2_FLAG_BROKEN_STATS;8169 bp->flags |= BNX2_FLAG_BROKEN_STATS;
8164 }8170 }
8165 8171
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) {
8167 if (pci_find_capability(pdev, PCI_CAP_ID_MSIX))8174 if (pci_find_capability(pdev, PCI_CAP_ID_MSIX))
8168 bp->flags |= BNX2_FLAG_MSIX_CAP;8175 bp->flags |= BNX2_FLAG_MSIX_CAP;
8169 }8176 }
8170 8177
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) {
8172 if (pci_find_capability(pdev, PCI_CAP_ID_MSI))8180 if (pci_find_capability(pdev, PCI_CAP_ID_MSI))
8173 bp->flags |= BNX2_FLAG_MSI_CAP;8181 bp->flags |= BNX2_FLAG_MSI_CAP;
8174 }8182 }
8175 8183
8176 /* 5708 cannot support DMA addresses > 40-bit. */8184 /* 5708 cannot support DMA addresses > 40-bit. */
8177 if (CHIP_NUM(bp) == CHIP_NUM_5708)8185 if (BNX2_CHIP(bp) == BNX2_CHIP_5708)
8178 persist_dma_mask = dma_mask = DMA_BIT_MASK(40);8186 persist_dma_mask = dma_mask = DMA_BIT_MASK(40);
8179 else8187 else
8180 persist_dma_mask = dma_mask = DMA_BIT_MASK(64);8188 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
8197 bnx2_get_pci_speed(bp);8205 bnx2_get_pci_speed(bp);
8198 8206
8199 /* 5706A0 may falsely detect SERR and PERR. */8207 /* 5706A0 may falsely detect SERR and PERR. */
8200 if (CHIP_ID(bp) == CHIP_ID_5706_A0) {8208 if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) {
8201 reg = REG_RD(bp, PCI_COMMAND);8209 reg = BNX2_RD(bp, PCI_COMMAND);
8202 reg &= ~(PCI_COMMAND_SERR | PCI_COMMAND_PARITY);8210 reg &= ~(PCI_COMMAND_SERR | PCI_COMMAND_PARITY);
8203 REG_WR(bp, PCI_COMMAND, reg);8211 BNX2_WR(bp, PCI_COMMAND, reg);
8204 }8212 } else if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A1) &&
8205 else if ((CHIP_ID(bp) == CHIP_ID_5706_A1) &&
8206 !(bp->flags & BNX2_FLAG_PCIX)) {8213 !(bp->flags & BNX2_FLAG_PCIX)) {
8207 8214
8208 dev_err(&pdev->dev,8215 dev_err(&pdev->dev,
@@ -8299,7 +8306,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 90 unmodified lines
8299 bp->mac_addr[4] = (u8) (reg >> 8);8306 bp->mac_addr[4] = (u8) (reg >> 8);
8300 bp->mac_addr[5] = (u8) reg;8307 bp->mac_addr[5] = (u8) reg;
8301 8308
8302 bp->tx_ring_size = MAX_TX_DESC_CNT;8309 bp->tx_ring_size = BNX2_MAX_TX_DESC_CNT;
8303 bnx2_set_rx_ring_size(bp, 255);8310 bnx2_set_rx_ring_size(bp, 255);
8304 8311
8305 bp->tx_quick_cons_trip_int = 2;8312 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
8319 bp->phy_addr = 1;8326 bp->phy_addr = 1;
8320 8327
8321 /* Disable WOL support if we are running on a SERDES chip. */8328 /* 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)
8323 bnx2_get_5709_media(bp);8330 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)
8325 bp->phy_flags |= BNX2_PHY_FLAG_SERDES;8332 bp->phy_flags |= BNX2_PHY_FLAG_SERDES;
8326 8333
8327 bp->phy_port = PORT_TP;8334 bp->phy_port = PORT_TP;
@@ -8332,7 +8339,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 4 unmodified lines
8332 bp->flags |= BNX2_FLAG_NO_WOL;8339 bp->flags |= BNX2_FLAG_NO_WOL;
8333 bp->wol = 0;8340 bp->wol = 0;
8334 }8341 }
8335 if (CHIP_NUM(bp) == CHIP_NUM_5706) {8342 if (BNX2_CHIP(bp) == BNX2_CHIP_5706) {
8336 /* Don't do parallel detect on this board because of8343 /* Don't do parallel detect on this board because of
8337 * some board problems. The link will not go down8344 * some board problems. The link will not go down
8338 * if we do parallel detect.8345 * if we do parallel detect.
@@ -8345,25 +8352,25 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) · 6 unmodified lines
8345 if (reg & BNX2_SHARED_HW_CFG_PHY_2_5G)8352 if (reg & BNX2_SHARED_HW_CFG_PHY_2_5G)
8346 bp->phy_flags |= BNX2_PHY_FLAG_2_5G_CAPABLE;8353 bp->phy_flags |= BNX2_PHY_FLAG_2_5G_CAPABLE;
8347 }8354 }
8348 } else if (CHIP_NUM(bp) == CHIP_NUM_5706 ||8355 } else if (BNX2_CHIP(bp) == BNX2_CHIP_5706 ||
8349 CHIP_NUM(bp) == CHIP_NUM_5708)8356 BNX2_CHIP(bp) == BNX2_CHIP_5708)
8350 bp->phy_flags |= BNX2_PHY_FLAG_CRC_FIX;8357 bp->phy_flags |= BNX2_PHY_FLAG_CRC_FIX;
8351 else if (CHIP_NUM(bp) == CHIP_NUM_5709 &&8358 else if (BNX2_CHIP(bp) == BNX2_CHIP_5709 &&
8352 (CHIP_REV(bp) == CHIP_REV_Ax ||8359 (BNX2_CHIP_REV(bp) == BNX2_CHIP_REV_Ax ||
8353 CHIP_REV(bp) == CHIP_REV_Bx))8360 BNX2_CHIP_REV(bp) == BNX2_CHIP_REV_Bx))
8354 bp->phy_flags |= BNX2_PHY_FLAG_DIS_EARLY_DAC;8361 bp->phy_flags |= BNX2_PHY_FLAG_DIS_EARLY_DAC;
8355 8362
8356 bnx2_init_fw_cap(bp);8363 bnx2_init_fw_cap(bp);
8357 8364
8358 if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||8365 if ((BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_A0) ||
8359 (CHIP_ID(bp) == CHIP_ID_5708_B0) ||8366 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_B0) ||
8360 (CHIP_ID(bp) == CHIP_ID_5708_B1) ||8367 (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5708_B1) ||
8361 !(REG_RD(bp, BNX2_PCI_CONFIG_3) & BNX2_PCI_CONFIG_3_VAUX_PRESET)) {8368 !(BNX2_RD(bp, BNX2_PCI_CONFIG_3) & BNX2_PCI_CONFIG_3_VAUX_PRESET)) {
8362 bp->flags |= BNX2_FLAG_NO_WOL;8369 bp->flags |= BNX2_FLAG_NO_WOL;
8363 bp->wol = 0;8370 bp->wol = 0;
8364 }8371 }
8365 8372
8366 if (CHIP_ID(bp) == CHIP_ID_5706_A0) {8373 if (BNX2_CHIP_ID(bp) == BNX2_CHIP_ID_5706_A0) {
8367 bp->tx_quick_cons_trip_int =8374 bp->tx_quick_cons_trip_int =
8368 bp->tx_quick_cons_trip;8375 bp->tx_quick_cons_trip;
8369 bp->tx_ticks_int = bp->tx_ticks;8376 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
8385 * AMD believes this incompatibility is unique to the 5706, and8392 * AMD believes this incompatibility is unique to the 5706, and
8386 * prefers to locally disable MSI rather than globally disabling it.8393 * prefers to locally disable MSI rather than globally disabling it.
8387 */8394 */
8388 if (CHIP_NUM(bp) == CHIP_NUM_5706 && disable_msi == 0) {8395 if (BNX2_CHIP(bp) == BNX2_CHIP_5706 && disable_msi == 0) {
8389 struct pci_dev *amd_8132 = NULL;8396 struct pci_dev *amd_8132 = NULL;
8390 8397
8391 while ((amd_8132 = pci_get_device(PCI_VENDOR_ID_AMD,8398 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
8414 bp->cnic_eth_dev.max_iscsi_conn =8421 bp->cnic_eth_dev.max_iscsi_conn =
8415 (bnx2_shmem_rd(bp, BNX2_ISCSI_MAX_CONN) &8422 (bnx2_shmem_rd(bp, BNX2_ISCSI_MAX_CONN) &
8416 BNX2_ISCSI_MAX_CONN_MASK) >> BNX2_ISCSI_MAX_CONN_SHIFT;8423 BNX2_ISCSI_MAX_CONN_MASK) >> BNX2_ISCSI_MAX_CONN_SHIFT;
8424 bp->cnic_probe = bnx2_cnic_probe;
8417#endif8425#endif
8418 pci_save_state(pdev);8426 pci_save_state(pdev);
8419 8427
@@ -8439,7 +8447,7 @@ err_out: · 19 unmodified lines
8439 return rc;8447 return rc;
8440}8448}
8441 8449
8442static char * __devinit8450static char *
8443bnx2_bus_string(struct bnx2 *bp, char *str)8451bnx2_bus_string(struct bnx2 *bp, char *str)
8444{8452{
8445 char *s = str;8453 char *s = str;
@@ -8505,7 +8513,7 @@ static const struct net_device_ops bnx2_netdev_ops = { · 59 unmodified lines
8505#endif8513#endif
8506};8514};
8507 8515
8508static int __devinit8516static int
8509bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)8517bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
8510{8518{
8511 static int version_printed = 0;8519 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
8541 NETIF_F_TSO | NETIF_F_TSO_ECN |8549 NETIF_F_TSO | NETIF_F_TSO_ECN |
8542 NETIF_F_RXHASH | NETIF_F_RXCSUM;8550 NETIF_F_RXHASH | NETIF_F_RXCSUM;
8543 8551
8544 if (CHIP_NUM(bp) == CHIP_NUM_5709)8552 if (BNX2_CHIP(bp) == BNX2_CHIP_5709)
8545 dev->hw_features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;8553 dev->hw_features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
8546 8554
8547 dev->vlan_features = dev->hw_features;8555 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
8556 8564
8557 netdev_info(dev, "%s (%c%d) %s found at mem %lx, IRQ %d, "8565 netdev_info(dev, "%s (%c%d) %s found at mem %lx, IRQ %d, "
8558 "node addr %pM\n", board_info[ent->driver_data].name,8566 "node addr %pM\n", board_info[ent->driver_data].name,
8559 ((CHIP_ID(bp) & 0xf000) >> 12) + 'A',8567 ((BNX2_CHIP_ID(bp) & 0xf000) >> 12) + 'A',
8560 ((CHIP_ID(bp) & 0x0ff0) >> 4),8568 ((BNX2_CHIP_ID(bp) & 0x0ff0) >> 4),
8561 bnx2_bus_string(bp, str), (long)pci_resource_start(pdev, 0),8569 bnx2_bus_string(bp, str), (long)pci_resource_start(pdev, 0),
8562 pdev->irq, dev->dev_addr);8570 pdev->irq, dev->dev_addr);
8563 8571
@@ -8573,7 +8581,7 @@ err_free: · 9 unmodified lines
8573 return rc;8581 return rc;
8574}8582}
8575 8583
8576static void __devexit8584static void
8577bnx2_remove_one(struct pci_dev *pdev)8585bnx2_remove_one(struct pci_dev *pdev)
8578{8586{
8579 struct net_device *dev = pci_get_drvdata(pdev);8587 struct net_device *dev = pci_get_drvdata(pdev);
@@ -8752,7 +8760,7 @@ static struct pci_driver bnx2_pci_driver = { · 172 unmodified lines
8752 .name = DRV_MODULE_NAME,8760 .name = DRV_MODULE_NAME,
8753 .id_table = bnx2_pci_tbl,8761 .id_table = bnx2_pci_tbl,
8754 .probe = bnx2_init_one,8762 .probe = bnx2_init_one,
8755 .remove = __devexit_p(bnx2_remove_one),8763 .remove = bnx2_remove_one,
8756 .suspend = bnx2_suspend,8764 .suspend = bnx2_suspend,
8757 .resume = bnx2_resume,8765 .resume = bnx2_resume,
8758 .err_handler = &bnx2_err_handler,8766 .err_handler = &bnx2_err_handler,
drivers/net/ethernet/broadcom/bnx2.h+67−67
@@ -20,7 +20,7 @@ · 19 unmodified lines
20/*20/*
21 * tx_bd definition21 * tx_bd definition
22 */22 */
23struct tx_bd {23struct bnx2_tx_bd {
24 u32 tx_bd_haddr_hi;24 u32 tx_bd_haddr_hi;
25 u32 tx_bd_haddr_lo;25 u32 tx_bd_haddr_lo;
26 u32 tx_bd_mss_nbytes;26 u32 tx_bd_mss_nbytes;
@@ -48,7 +48,7 @@ struct tx_bd { · 21 unmodified lines
48/*48/*
49 * rx_bd definition49 * rx_bd definition
50 */50 */
51struct rx_bd {51struct bnx2_rx_bd {
52 u32 rx_bd_haddr_hi;52 u32 rx_bd_haddr_hi;
53 u32 rx_bd_haddr_lo;53 u32 rx_bd_haddr_lo;
54 u32 rx_bd_len;54 u32 rx_bd_len;
@@ -6538,37 +6538,38 @@ struct l2_fhdr { · 6483 unmodified lines
6538 6538
6539/* Use CPU native page size up to 16K for the ring sizes. */6539/* Use CPU native page size up to 16K for the ring sizes. */
6540#if (PAGE_SHIFT > 14)6540#if (PAGE_SHIFT > 14)
6541#define BCM_PAGE_BITS 146541#define BNX2_PAGE_BITS 14
6542#else6542#else
6543#define BCM_PAGE_BITS PAGE_SHIFT6543#define BNX2_PAGE_BITS PAGE_SHIFT
6544#endif6544#endif
6545#define BCM_PAGE_SIZE (1 << BCM_PAGE_BITS)6545#define BNX2_PAGE_SIZE (1 << BNX2_PAGE_BITS)
6546 6546
6547#define TX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct tx_bd))6547#define BNX2_TX_DESC_CNT (BNX2_PAGE_SIZE / sizeof(struct bnx2_tx_bd))
6548#define MAX_TX_DESC_CNT (TX_DESC_CNT - 1)6548#define BNX2_MAX_TX_DESC_CNT (BNX2_TX_DESC_CNT - 1)
6549 6549
6550#define MAX_RX_RINGS 86550#define BNX2_MAX_RX_RINGS 8
6551#define MAX_RX_PG_RINGS 326551#define BNX2_MAX_RX_PG_RINGS 32
6552#define RX_DESC_CNT (BCM_PAGE_SIZE / sizeof(struct rx_bd))6552#define BNX2_RX_DESC_CNT (BNX2_PAGE_SIZE / sizeof(struct bnx2_rx_bd))
6553#define MAX_RX_DESC_CNT (RX_DESC_CNT - 1)6553#define BNX2_MAX_RX_DESC_CNT (BNX2_RX_DESC_CNT - 1)
6554#define MAX_TOTAL_RX_DESC_CNT (MAX_RX_DESC_CNT * MAX_RX_RINGS)6554#define BNX2_MAX_TOTAL_RX_DESC_CNT (BNX2_MAX_RX_DESC_CNT * BNX2_MAX_RX_RINGS)
6555#define MAX_TOTAL_RX_PG_DESC_CNT (MAX_RX_DESC_CNT * MAX_RX_PG_RINGS)6555#define BNX2_MAX_TOTAL_RX_PG_DESC_CNT \
6556 (BNX2_MAX_RX_DESC_CNT * BNX2_MAX_RX_PG_RINGS)
6556 6557
6557#define NEXT_TX_BD(x) (((x) & (MAX_TX_DESC_CNT - 1)) == \6558#define BNX2_NEXT_TX_BD(x) (((x) & (BNX2_MAX_TX_DESC_CNT - 1)) == \
6558 (MAX_TX_DESC_CNT - 1)) ? \6559 (BNX2_MAX_TX_DESC_CNT - 1)) ? \
6559 (x) + 2 : (x) + 16560 (x) + 2 : (x) + 1
6560 6561
6561#define TX_RING_IDX(x) ((x) & MAX_TX_DESC_CNT)6562#define BNX2_TX_RING_IDX(x) ((x) & BNX2_MAX_TX_DESC_CNT)
6562 6563
6563#define NEXT_RX_BD(x) (((x) & (MAX_RX_DESC_CNT - 1)) == \6564#define BNX2_NEXT_RX_BD(x) (((x) & (BNX2_MAX_RX_DESC_CNT - 1)) == \
6564 (MAX_RX_DESC_CNT - 1)) ? \6565 (BNX2_MAX_RX_DESC_CNT - 1)) ? \
6565 (x) + 2 : (x) + 16566 (x) + 2 : (x) + 1
6566 6567
6567#define RX_RING_IDX(x) ((x) & bp->rx_max_ring_idx)6568#define BNX2_RX_RING_IDX(x) ((x) & bp->rx_max_ring_idx)
6568#define RX_PG_RING_IDX(x) ((x) & bp->rx_max_pg_ring_idx)6569#define BNX2_RX_PG_RING_IDX(x) ((x) & bp->rx_max_pg_ring_idx)
6569 6570
6570#define RX_RING(x) (((x) & ~MAX_RX_DESC_CNT) >> (BCM_PAGE_BITS - 4))6571#define BNX2_RX_RING(x) (((x) & ~BNX2_MAX_RX_DESC_CNT) >> (BNX2_PAGE_BITS - 4))
6571#define RX_IDX(x) ((x) & MAX_RX_DESC_CNT)6572#define BNX2_RX_IDX(x) ((x) & BNX2_MAX_RX_DESC_CNT)
6572 6573
6573/* Context size. */6574/* Context size. */
6574#define CTX_SHIFT 76575#define CTX_SHIFT 7
@@ -6609,7 +6610,7 @@ struct l2_fhdr { · 34 unmodified lines
6609 * RX ring buffer contains pointer to kmalloc() data only,6610 * RX ring buffer contains pointer to kmalloc() data only,
6610 * skb are built only after Hardware filled the frame.6611 * skb are built only after Hardware filled the frame.
6611 */6612 */
6612struct sw_bd {6613struct bnx2_sw_bd {
6613 u8 *data;6614 u8 *data;
6614 DEFINE_DMA_UNMAP_ADDR(mapping);6615 DEFINE_DMA_UNMAP_ADDR(mapping);
6615};6616};
@@ -6623,23 +6624,23 @@ static inline struct l2_fhdr *get_l2_fhdr(u8 *data) · 7 unmodified lines
6623}6624}
6624 6625
6625 6626
6626struct sw_pg {6627struct bnx2_sw_pg {
6627 struct page *page;6628 struct page *page;
6628 DEFINE_DMA_UNMAP_ADDR(mapping);6629 DEFINE_DMA_UNMAP_ADDR(mapping);
6629};6630};
6630 6631
6631struct sw_tx_bd {6632struct bnx2_sw_tx_bd {
6632 struct sk_buff *skb;6633 struct sk_buff *skb;
6633 DEFINE_DMA_UNMAP_ADDR(mapping);6634 DEFINE_DMA_UNMAP_ADDR(mapping);
6634 unsigned short is_gso;6635 unsigned short is_gso;
6635 unsigned short nr_frags;6636 unsigned short nr_frags;
6636};6637};
6637 6638
6638#define SW_RXBD_RING_SIZE (sizeof(struct sw_bd) * RX_DESC_CNT)6639#define SW_RXBD_RING_SIZE (sizeof(struct bnx2_sw_bd) * BNX2_RX_DESC_CNT)
6639#define SW_RXPG_RING_SIZE (sizeof(struct sw_pg) * RX_DESC_CNT)6640#define SW_RXPG_RING_SIZE (sizeof(struct bnx2_sw_pg) * BNX2_RX_DESC_CNT)
6640#define RXBD_RING_SIZE (sizeof(struct rx_bd) * RX_DESC_CNT)6641#define RXBD_RING_SIZE (sizeof(struct bnx2_rx_bd) * BNX2_RX_DESC_CNT)
6641#define SW_TXBD_RING_SIZE (sizeof(struct sw_tx_bd) * TX_DESC_CNT)6642#define SW_TXBD_RING_SIZE (sizeof(struct bnx2_sw_tx_bd) * BNX2_TX_DESC_CNT)
6642#define TXBD_RING_SIZE (sizeof(struct tx_bd) * TX_DESC_CNT)6643#define TXBD_RING_SIZE (sizeof(struct bnx2_tx_bd) * BNX2_TX_DESC_CNT)
6643 6644
6644/* Buffered flash (Atmel: AT45DB011B) specific information */6645/* Buffered flash (Atmel: AT45DB011B) specific information */
6645#define SEEPROM_PAGE_BITS 26646#define SEEPROM_PAGE_BITS 2
@@ -6720,8 +6721,8 @@ struct bnx2_tx_ring_info { · 74 unmodified lines
6720 u32 tx_bidx_addr;6721 u32 tx_bidx_addr;
6721 u32 tx_bseq_addr;6722 u32 tx_bseq_addr;
6722 6723
6723 struct tx_bd *tx_desc_ring;6724 struct bnx2_tx_bd *tx_desc_ring;
6724 struct sw_tx_bd *tx_buf_ring;6725 struct bnx2_sw_tx_bd *tx_buf_ring;
6725 6726
6726 u16 tx_cons;6727 u16 tx_cons;
6727 u16 hw_tx_cons;6728 u16 hw_tx_cons;
@@ -6741,13 +6742,13 @@ struct bnx2_rx_ring_info { · 13 unmodified lines
6741 u16 rx_pg_prod;6742 u16 rx_pg_prod;
6742 u16 rx_pg_cons;6743 u16 rx_pg_cons;
6743 6744
6744 struct sw_bd *rx_buf_ring;6745 struct bnx2_sw_bd *rx_buf_ring;
6745 struct rx_bd *rx_desc_ring[MAX_RX_RINGS];6746 struct bnx2_rx_bd *rx_desc_ring[BNX2_MAX_RX_RINGS];
6746 struct sw_pg *rx_pg_ring;6747 struct bnx2_sw_pg *rx_pg_ring;
6747 struct rx_bd *rx_pg_desc_ring[MAX_RX_PG_RINGS];6748 struct bnx2_rx_bd *rx_pg_desc_ring[BNX2_MAX_RX_PG_RINGS];
6748 6749
6749 dma_addr_t rx_desc_mapping[MAX_RX_RINGS];6750 dma_addr_t rx_desc_mapping[BNX2_MAX_RX_RINGS];
6750 dma_addr_t rx_pg_desc_mapping[MAX_RX_PG_RINGS];6751 dma_addr_t rx_pg_desc_mapping[BNX2_MAX_RX_PG_RINGS];
6751};6752};
6752 6753
6753struct bnx2_napi {6754struct bnx2_napi {
@@ -6853,33 +6854,31 @@ struct bnx2 { · 99 unmodified lines
6853 6854
6854 u32 chip_id;6855 u32 chip_id;
6855 /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */6856 /* 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 BNX2_CHIP(bp) (((bp)->chip_id) & 0xffff0000)
6857#define CHIP_NUM_5706 0x570600006858#define BNX2_CHIP_5706 0x57060000
6858#define CHIP_NUM_5708 0x570800006859#define BNX2_CHIP_5708 0x57080000
6859#define CHIP_NUM_5709 0x570900006860#define BNX2_CHIP_5709 0x57090000
6860 6861
6861#define CHIP_REV(bp) (((bp)->chip_id) & 0x0000f000)6862#define BNX2_CHIP_REV(bp) (((bp)->chip_id) & 0x0000f000)
6862#define CHIP_REV_Ax 0x000000006863#define BNX2_CHIP_REV_Ax 0x00000000
6863#define CHIP_REV_Bx 0x000010006864#define BNX2_CHIP_REV_Bx 0x00001000
6864#define CHIP_REV_Cx 0x000020006865#define BNX2_CHIP_REV_Cx 0x00002000
6865 6866
6866#define CHIP_METAL(bp) (((bp)->chip_id) & 0x00000ff0)6867#define BNX2_CHIP_METAL(bp) (((bp)->chip_id) & 0x00000ff0)
6867#define CHIP_BONDING(bp) (((bp)->chip_id) & 0x0000000f)6868#define BNX2_CHIP_BOND(bp) (((bp)->chip_id) & 0x0000000f)
6868 6869
6869#define CHIP_ID(bp) (((bp)->chip_id) & 0xfffffff0)6870#define BNX2_CHIP_ID(bp) (((bp)->chip_id) & 0xfffffff0)
6870#define CHIP_ID_5706_A0 0x570600006871#define BNX2_CHIP_ID_5706_A0 0x57060000
6871#define CHIP_ID_5706_A1 0x570600106872#define BNX2_CHIP_ID_5706_A1 0x57060010
6872#define CHIP_ID_5706_A2 0x570600206873#define BNX2_CHIP_ID_5706_A2 0x57060020
6873#define CHIP_ID_5708_A0 0x570800006874#define BNX2_CHIP_ID_5708_A0 0x57080000
6874#define CHIP_ID_5708_B0 0x570810006875#define BNX2_CHIP_ID_5708_B0 0x57081000
6875#define CHIP_ID_5708_B1 0x570810106876#define BNX2_CHIP_ID_5708_B1 0x57081010
6876#define CHIP_ID_5709_A0 0x570900006877#define BNX2_CHIP_ID_5709_A0 0x57090000
6877#define CHIP_ID_5709_A1 0x570900106878#define BNX2_CHIP_ID_5709_A1 0x57090010
6878
6879#define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf)
6880 6879
6881/* A serdes chip will have the first bit of the bond id set. */6880/* A serdes chip will have the first bit of the bond id set. */
6882#define CHIP_BOND_ID_SERDES_BIT 0x016881#define BNX2_CHIP_BOND_SERDES_BIT 0x01
6883 6882
6884 u32 phy_addr;6883 u32 phy_addr;
6885 u32 phy_id;6884 u32 phy_id;
@@ -6985,19 +6984,20 @@ struct bnx2 { · 99 unmodified lines
6985#ifdef BCM_CNIC6984#ifdef BCM_CNIC
6986 struct mutex cnic_lock;6985 struct mutex cnic_lock;
6987 struct cnic_eth_dev cnic_eth_dev;6986 struct cnic_eth_dev cnic_eth_dev;
6987 struct cnic_eth_dev *(*cnic_probe)(struct net_device *);
6988#endif6988#endif
6989 6989
6990 const struct firmware *mips_firmware;6990 const struct firmware *mips_firmware;
6991 const struct firmware *rv2p_firmware;6991 const struct firmware *rv2p_firmware;
6992};6992};
6993 6993
6994#define REG_RD(bp, offset) \6994#define BNX2_RD(bp, offset) \
6995 readl(bp->regview + offset)6995 readl(bp->regview + offset)
6996 6996
6997#define REG_WR(bp, offset, val) \6997#define BNX2_WR(bp, offset, val) \
6998 writel(val, bp->regview + offset)6998 writel(val, bp->regview + offset)
6999 6999
7000#define REG_WR16(bp, offset, val) \7000#define BNX2_WR16(bp, offset, val) \
7001 writew(val, bp->regview + offset)7001 writew(val, bp->regview + offset)
7002 7002
7003struct cpu_reg {7003struct cpu_reg {
@@ -7052,7 +7052,7 @@ struct bnx2_rv2p_fw_file { · 48 unmodified lines
7052 7052
7053#define RV2P_P1_FIXUP_PAGE_SIZE_IDX 07053#define RV2P_P1_FIXUP_PAGE_SIZE_IDX 0
7054#define RV2P_BD_PAGE_SIZE_MSK 0xffff7054#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)
7056 7056
7057#define RV2P_PROC1 07057#define RV2P_PROC1 0
7058#define RV2P_PROC2 17058#define RV2P_PROC2 1
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+88−53
@@ -34,25 +34,16 @@ · 33 unmodified lines
34 34
35#include "bnx2x_hsi.h"35#include "bnx2x_hsi.h"
36 36
37#if defined(CONFIG_CNIC) || defined(CONFIG_CNIC_MODULE)
38#define BCM_CNIC 1
39#include "../cnic_if.h"37#include "../cnic_if.h"
40#endif
41 38
42#ifdef BCM_CNIC39
43#define BNX2X_MIN_MSIX_VEC_CNT 340#define BNX2X_MIN_MSIX_VEC_CNT(bp) ((bp)->min_msix_vec_cnt)
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
49 41
50#include <linux/mdio.h>42#include <linux/mdio.h>
51 43
52#include "bnx2x_reg.h"44#include "bnx2x_reg.h"
53#include "bnx2x_fw_defs.h"45#include "bnx2x_fw_defs.h"
54#include "bnx2x_mfw_req.h"46#include "bnx2x_mfw_req.h"
55#include "bnx2x_hsi.h"
56#include "bnx2x_link.h"47#include "bnx2x_link.h"
57#include "bnx2x_sp.h"48#include "bnx2x_sp.h"
58#include "bnx2x_dcb.h"49#include "bnx2x_dcb.h"
@@ -256,15 +247,10 @@ enum { · 197 unmodified lines
256 /* FCoE L2 */247 /* FCoE L2 */
257#define BNX2X_FCOE_ETH_CID(bp) (BNX2X_CNIC_START_ETH_CID(bp) + 1)248#define BNX2X_FCOE_ETH_CID(bp) (BNX2X_CNIC_START_ETH_CID(bp) + 1)
258 249
259/** Additional rings budgeting */250#define CNIC_SUPPORT(bp) ((bp)->cnic_support)
260#ifdef BCM_CNIC251#define CNIC_ENABLED(bp) ((bp)->cnic_enabled)
261#define CNIC_PRESENT 1252#define CNIC_LOADED(bp) ((bp)->cnic_loaded)
262#define FCOE_PRESENT 1253#define FCOE_INIT(bp) ((bp)->fcoe_init)
263#else
264#define CNIC_PRESENT 0
265#define FCOE_PRESENT 0
266#endif /* BCM_CNIC */
267#define NON_ETH_CONTEXT_USE (FCOE_PRESENT)
268 254
269#define AEU_IN_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR \255#define AEU_IN_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR \
270 AEU_INPUTS_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR256 AEU_INPUTS_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR
@@ -297,9 +283,7 @@ enum { · 26 unmodified lines
297 OOO_TXQ_IDX_OFFSET,283 OOO_TXQ_IDX_OFFSET,
298};284};
299#define MAX_ETH_TXQ_IDX(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) * (bp)->max_cos)285#define MAX_ETH_TXQ_IDX(bp) (BNX2X_NUM_NON_CNIC_QUEUES(bp) * (bp)->max_cos)
300#ifdef BCM_CNIC
301#define FCOE_TXQ_IDX(bp) (MAX_ETH_TXQ_IDX(bp) + FCOE_TXQ_IDX_OFFSET)286#define FCOE_TXQ_IDX(bp) (MAX_ETH_TXQ_IDX(bp) + FCOE_TXQ_IDX_OFFSET)
302#endif
303 287
304/* fast path */288/* fast path */
305/*289/*
@@ -505,7 +489,7 @@ struct bnx2x_fastpath { · 199 unmodified lines
505 u32 ustorm_rx_prods_offset;489 u32 ustorm_rx_prods_offset;
506 490
507 u32 rx_buf_size;491 u32 rx_buf_size;
508 492 u32 rx_frag_size; /* 0 if kmalloced(), or rx_buf_size + NET_SKB_PAD */
509 dma_addr_t status_blk_mapping;493 dma_addr_t status_blk_mapping;
510 494
511 enum bnx2x_tpa_mode_t mode;495 enum bnx2x_tpa_mode_t mode;
@@ -585,15 +569,9 @@ struct bnx2x_fastpath { · 73 unmodified lines
585 ->var)569 ->var)
586 570
587 571
588#define IS_ETH_FP(fp) (fp->index < \572#define IS_ETH_FP(fp) ((fp)->index < BNX2X_NUM_ETH_QUEUES((fp)->bp))
589 BNX2X_NUM_ETH_QUEUES(fp->bp))573#define IS_FCOE_FP(fp) ((fp)->index == FCOE_IDX((fp)->bp))
590#ifdef BCM_CNIC574#define IS_FCOE_IDX(idx) ((idx) == FCOE_IDX(bp))
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
597 575
598 576
599/* MC hsi */577/* MC hsi */
@@ -886,6 +864,18 @@ struct bnx2x_common { · 286 unmodified lines
886 (CHIP_REV(bp) == CHIP_REV_Bx))864 (CHIP_REV(bp) == CHIP_REV_Bx))
887#define CHIP_IS_E3A0(bp) (CHIP_IS_E3(bp) && \865#define CHIP_IS_E3A0(bp) (CHIP_IS_E3(bp) && \
888 (CHIP_REV(bp) == CHIP_REV_Ax))866 (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))
889 879
890 int flash_size;880 int flash_size;
891#define BNX2X_NVRAM_1MB_SIZE 0x20000 /* 1M bit in bytes */881#define BNX2X_NVRAM_1MB_SIZE 0x20000 /* 1M bit in bytes */
@@ -925,6 +915,7 @@ struct bnx2x_common { · 33 unmodified lines
925#define BNX2X_IGU_STAS_MSG_VF_CNT 64915#define BNX2X_IGU_STAS_MSG_VF_CNT 64
926#define BNX2X_IGU_STAS_MSG_PF_CNT 4916#define BNX2X_IGU_STAS_MSG_PF_CNT 4
927 917
918#define MAX_IGU_ATTN_ACK_TO 100
928/* end of common */919/* end of common */
929 920
930/* port */921/* port */
@@ -946,7 +937,6 @@ struct bnx2x_port { · 15 unmodified lines
946 937
947 /* used to synchronize phy accesses */938 /* used to synchronize phy accesses */
948 struct mutex phy_mutex;939 struct mutex phy_mutex;
949 int need_hw_lock;
950 940
951 u32 port_stx;941 u32 port_stx;
952 942
@@ -1003,18 +993,15 @@ union cdu_context { · 50 unmodified lines
1003#define CDU_ILT_PAGE_SZ (8192 << CDU_ILT_PAGE_SZ_HW) /* 32K */993#define CDU_ILT_PAGE_SZ (8192 << CDU_ILT_PAGE_SZ_HW) /* 32K */
1004#define ILT_PAGE_CIDS (CDU_ILT_PAGE_SZ / sizeof(union cdu_context))994#define ILT_PAGE_CIDS (CDU_ILT_PAGE_SZ / sizeof(union cdu_context))
1005 995
1006#ifdef BCM_CNIC
1007#define CNIC_ISCSI_CID_MAX 256996#define CNIC_ISCSI_CID_MAX 256
1008#define CNIC_FCOE_CID_MAX 2048997#define CNIC_FCOE_CID_MAX 2048
1009#define CNIC_CID_MAX (CNIC_ISCSI_CID_MAX + CNIC_FCOE_CID_MAX)998#define CNIC_CID_MAX (CNIC_ISCSI_CID_MAX + CNIC_FCOE_CID_MAX)
1010#define CNIC_ILT_LINES DIV_ROUND_UP(CNIC_CID_MAX, ILT_PAGE_CIDS)999#define CNIC_ILT_LINES DIV_ROUND_UP(CNIC_CID_MAX, ILT_PAGE_CIDS)
1011#endif
1012 1000
1013#define QM_ILT_PAGE_SZ_HW 01001#define QM_ILT_PAGE_SZ_HW 0
1014#define QM_ILT_PAGE_SZ (4096 << QM_ILT_PAGE_SZ_HW) /* 4K */1002#define QM_ILT_PAGE_SZ (4096 << QM_ILT_PAGE_SZ_HW) /* 4K */
1015#define QM_CID_ROUND 10241003#define QM_CID_ROUND 1024
1016 1004
1017#ifdef BCM_CNIC
1018/* TM (timers) host DB constants */1005/* TM (timers) host DB constants */
1019#define TM_ILT_PAGE_SZ_HW 01006#define TM_ILT_PAGE_SZ_HW 0
1020#define TM_ILT_PAGE_SZ (4096 << TM_ILT_PAGE_SZ_HW) /* 4K */1007#define TM_ILT_PAGE_SZ (4096 << TM_ILT_PAGE_SZ_HW) /* 4K */
@@ -1032,8 +1019,6 @@ union cdu_context { · 11 unmodified lines
1032#define SRC_T2_SZ SRC_ILT_SZ1019#define SRC_T2_SZ SRC_ILT_SZ
1033#define SRC_ILT_LINES DIV_ROUND_UP(SRC_ILT_SZ, SRC_ILT_PAGE_SZ)1020#define SRC_ILT_LINES DIV_ROUND_UP(SRC_ILT_SZ, SRC_ILT_PAGE_SZ)
1034 1021
1035#endif
1036
1037#define MAX_DMAE_C 81022#define MAX_DMAE_C 8
1038 1023
1039/* DMA memory not used in fastpath */1024/* DMA memory not used in fastpath */
@@ -1201,6 +1186,7 @@ struct bnx2x_prev_path_list { · 161 unmodified lines
1201 u8 slot;1186 u8 slot;
1202 u8 path;1187 u8 path;
1203 struct list_head list;1188 struct list_head list;
1189 u8 undi;
1204};1190};
1205 1191
1206struct bnx2x_sp_objs {1192struct bnx2x_sp_objs {
@@ -1227,7 +1213,6 @@ struct bnx2x { · 20 unmodified lines
1227 struct bnx2x_sp_objs *sp_objs;1213 struct bnx2x_sp_objs *sp_objs;
1228 struct bnx2x_fp_stats *fp_stats;1214 struct bnx2x_fp_stats *fp_stats;
1229 struct bnx2x_fp_txdata *bnx2x_txq;1215 struct bnx2x_fp_txdata *bnx2x_txq;
1230 int bnx2x_txq_size;
1231 void __iomem *regview;1216 void __iomem *regview;
1232 void __iomem *doorbells;1217 void __iomem *doorbells;
1233 u16 db_size;1218 u16 db_size;
@@ -1350,6 +1335,16 @@ struct bnx2x { · 116 unmodified lines
1350#define NO_ISCSI_OOO(bp) ((bp)->flags & NO_ISCSI_OOO_FLAG)1335#define NO_ISCSI_OOO(bp) ((bp)->flags & NO_ISCSI_OOO_FLAG)
1351#define NO_FCOE(bp) ((bp)->flags & NO_FCOE_FLAG)1336#define NO_FCOE(bp) ((bp)->flags & NO_FCOE_FLAG)
1352 1337
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
1353 int pm_cap;1348 int pm_cap;
1354 int mrrs;1349 int mrrs;
1355 1350
@@ -1420,6 +1415,8 @@ struct bnx2x { · 64 unmodified lines
1420#define BNX2X_MAX_COS 31415#define BNX2X_MAX_COS 3
1421#define BNX2X_MAX_TX_COS 21416#define BNX2X_MAX_TX_COS 2
1422 int num_queues;1417 int num_queues;
1418 uint num_ethernet_queues;
1419 uint num_cnic_queues;
1423 int num_napi_queues;1420 int num_napi_queues;
1424 int disable_tpa;1421 int disable_tpa;
1425 1422
@@ -1433,6 +1430,7 @@ struct bnx2x { · 7 unmodified lines
1433 u8 igu_dsb_id;1430 u8 igu_dsb_id;
1434 u8 igu_base_sb;1431 u8 igu_base_sb;
1435 u8 igu_sb_cnt;1432 u8 igu_sb_cnt;
1433 u8 min_msix_vec_cnt;
1436 1434
1437 dma_addr_t def_status_blk_mapping;1435 dma_addr_t def_status_blk_mapping;
1438 1436
@@ -1478,26 +1476,23 @@ struct bnx2x { · 39 unmodified lines
1478 * Maximum supported number of RSS queues: number of IGU SBs minus one that goes1476 * Maximum supported number of RSS queues: number of IGU SBs minus one that goes
1479 * to CNIC.1477 * to CNIC.
1480 */1478 */
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))
1482 1480
1483/*1481/*
1484 * Maximum CID count that might be required by the bnx2x:1482 * Maximum CID count that might be required by the bnx2x:
1485 * Max RSS * Max_Tx_Multi_Cos + FCoE + iSCSI1483 * Max RSS * Max_Tx_Multi_Cos + FCoE + iSCSI
1486 */1484 */
1487#define BNX2X_L2_CID_COUNT(bp) (BNX2X_NUM_ETH_QUEUES(bp) * BNX2X_MULTI_TX_COS \1485#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))
1489#define BNX2X_L2_MAX_CID(bp) (BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS \1487#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))
1491#define L2_ILT_LINES(bp) (DIV_ROUND_UP(BNX2X_L2_CID_COUNT(bp),\1489#define L2_ILT_LINES(bp) (DIV_ROUND_UP(BNX2X_L2_CID_COUNT(bp),\
1492 ILT_PAGE_CIDS))1490 ILT_PAGE_CIDS))
1493 1491
1494 int qm_cid_count;1492 int qm_cid_count;
1495 1493
1496 int dropless_fc;1494 bool dropless_fc;
1497 1495
1498#ifdef BCM_CNIC
1499 u32 cnic_flags;
1500#define BNX2X_CNIC_FLAG_MAC_SET 1
1501 void *t2;1496 void *t2;
1502 dma_addr_t t2_mapping;1497 dma_addr_t t2_mapping;
1503 struct cnic_ops __rcu *cnic_ops;1498 struct cnic_ops __rcu *cnic_ops;
@@ -1518,7 +1513,6 @@ struct bnx2x { · 14 unmodified lines
1518 1513
1519 /* Start index of the "special" (CNIC related) L2 cleints */1514 /* Start index of the "special" (CNIC related) L2 cleints */
1520 u8 cnic_base_cl_id;1515 u8 cnic_base_cl_id;
1521#endif
1522 1516
1523 int dmae_ready;1517 int dmae_ready;
1524 /* used to synchronize dmae accesses */1518 /* used to synchronize dmae accesses */
@@ -1647,9 +1641,9 @@ struct bnx2x { · 122 unmodified lines
1647/* Tx queues may be less or equal to Rx queues */1641/* Tx queues may be less or equal to Rx queues */
1648extern int num_queues;1642extern int num_queues;
1649#define BNX2X_NUM_QUEUES(bp) (bp->num_queues)1643#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)
1651#define BNX2X_NUM_NON_CNIC_QUEUES(bp) (BNX2X_NUM_QUEUES(bp) - \1645#define BNX2X_NUM_NON_CNIC_QUEUES(bp) (BNX2X_NUM_QUEUES(bp) - \
1652 NON_ETH_CONTEXT_USE)1646 (bp)->num_cnic_queues)
1653#define BNX2X_NUM_RX_QUEUES(bp) BNX2X_NUM_QUEUES(bp)1647#define BNX2X_NUM_RX_QUEUES(bp) BNX2X_NUM_QUEUES(bp)
1654 1648
1655#define is_multi(bp) (BNX2X_NUM_QUEUES(bp) > 1)1649#define is_multi(bp) (BNX2X_NUM_QUEUES(bp) > 1)
@@ -1689,6 +1683,13 @@ struct bnx2x_func_init_params { · 33 unmodified lines
1689 u16 spq_prod; /* valid iff FUNC_FLG_SPQ */1683 u16 spq_prod; /* valid iff FUNC_FLG_SPQ */
1690};1684};
1691 1685
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
1692#define for_each_eth_queue(bp, var) \1693#define for_each_eth_queue(bp, var) \
1693 for ((var) = 0; (var) < BNX2X_NUM_ETH_QUEUES(bp); (var)++)1694 for ((var) = 0; (var) < BNX2X_NUM_ETH_QUEUES(bp); (var)++)
1694 1695
@@ -1702,6 +1703,22 @@ struct bnx2x_func_init_params { · 7 unmodified lines
1702 else1703 else
1703 1704
1704/* Skip forwarding FP */1705/* 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
1705#define for_each_rx_queue(bp, var) \1722#define for_each_rx_queue(bp, var) \
1706 for ((var) = 0; (var) < BNX2X_NUM_QUEUES(bp); (var)++) \1723 for ((var) = 0; (var) < BNX2X_NUM_QUEUES(bp); (var)++) \
1707 if (skip_rx_queue(bp, var)) \1724 if (skip_rx_queue(bp, var)) \
@@ -1709,6 +1726,22 @@ struct bnx2x_func_init_params { · 1 unmodified line
1709 else1726 else
1710 1727
1711/* Skip OOO FP */1728/* 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
1712#define for_each_tx_queue(bp, var) \1745#define for_each_tx_queue(bp, var) \
1713 for ((var) = 0; (var) < BNX2X_NUM_QUEUES(bp); (var)++) \1746 for ((var) = 0; (var) < BNX2X_NUM_QUEUES(bp); (var)++) \
1714 if (skip_tx_queue(bp, var)) \1747 if (skip_tx_queue(bp, var)) \
@@ -2179,7 +2212,6 @@ void bnx2x_notify_link_changed(struct bnx2x *bp); · 464 unmodified lines
2179#define BNX2X_MF_SD_PROTOCOL(bp) \2212#define BNX2X_MF_SD_PROTOCOL(bp) \
2180 ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK)2213 ((bp)->mf_config[BP_VN(bp)] & FUNC_MF_CFG_PROTOCOL_MASK)
2181 2214
2182#ifdef BCM_CNIC
2183#define BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) \2215#define BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) \
2184 (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_ISCSI)2216 (BNX2X_MF_SD_PROTOCOL(bp) == FUNC_MF_CFG_PROTOCOL_ISCSI)
2185 2217
@@ -2196,9 +2228,12 @@ void bnx2x_notify_link_changed(struct bnx2x *bp); · 10 unmodified lines
2196#define IS_MF_STORAGE_SD(bp) (IS_MF_SD(bp) && \2228#define IS_MF_STORAGE_SD(bp) (IS_MF_SD(bp) && \
2197 (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \2229 (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp) || \
2198 BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)))2230 BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)))
2199#else
2200#define IS_MF_FCOE_AFEX(bp) false
2201#endif
2202 2231
2232enum {
2233 SWITCH_UPDATE,
2234 AFEX_UPDATE,
2235};
2236
2237#define NUM_MACS 8
2203 2238
2204#endif /* bnx2x.h */2239#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
552 return 0;552 return 0;
553}553}
554 554
555static 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
563static 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
555static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,572static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp,
556 struct bnx2x_agg_info *tpa_info,573 struct bnx2x_agg_info *tpa_info,
557 u16 pages,574 u16 pages,
@@ -574,15 +591,14 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 16 unmodified lines
574 goto drop;591 goto drop;
575 592
576 /* Try to allocate the new data */593 /* Try to allocate the new data */
577 new_data = kmalloc(fp->rx_buf_size + NET_SKB_PAD, GFP_ATOMIC);594 new_data = bnx2x_frag_alloc(fp);
578
579 /* Unmap skb in the pool anyway, as we are going to change595 /* Unmap skb in the pool anyway, as we are going to change
580 pool entry status to BNX2X_TPA_STOP even if new skb allocation596 pool entry status to BNX2X_TPA_STOP even if new skb allocation
581 fails. */597 fails. */
582 dma_unmap_single(&bp->pdev->dev, dma_unmap_addr(rx_buf, mapping),598 dma_unmap_single(&bp->pdev->dev, dma_unmap_addr(rx_buf, mapping),
583 fp->rx_buf_size, DMA_FROM_DEVICE);599 fp->rx_buf_size, DMA_FROM_DEVICE);
584 if (likely(new_data))600 if (likely(new_data))
585 skb = build_skb(data, 0);601 skb = build_skb(data, fp->rx_frag_size);
586 602
587 if (likely(skb)) {603 if (likely(skb)) {
588#ifdef BNX2X_STOP_ON_ERROR604#ifdef BNX2X_STOP_ON_ERROR
@@ -619,7 +635,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 30 unmodified lines
619 635
620 return;636 return;
621 }637 }
622 kfree(new_data);638 bnx2x_frag_free(fp, new_data);
623drop:639drop:
624 /* drop the packet and keep the buffer in the bin */640 /* drop the packet and keep the buffer in the bin */
625 DP(NETIF_MSG_RX_STATUS,641 DP(NETIF_MSG_RX_STATUS,
@@ -635,7 +651,7 @@ static int bnx2x_alloc_rx_data(struct bnx2x *bp, · 9 unmodified lines
635 struct eth_rx_bd *rx_bd = &fp->rx_desc_ring[index];651 struct eth_rx_bd *rx_bd = &fp->rx_desc_ring[index];
636 dma_addr_t mapping;652 dma_addr_t mapping;
637 653
638 data = kmalloc(fp->rx_buf_size + NET_SKB_PAD, GFP_ATOMIC);654 data = bnx2x_frag_alloc(fp);
639 if (unlikely(data == NULL))655 if (unlikely(data == NULL))
640 return -ENOMEM;656 return -ENOMEM;
641 657
@@ -643,7 +659,7 @@ static int bnx2x_alloc_rx_data(struct bnx2x *bp, · 1 unmodified line
643 fp->rx_buf_size,659 fp->rx_buf_size,
644 DMA_FROM_DEVICE);660 DMA_FROM_DEVICE);
645 if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {661 if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) {
646 kfree(data);662 bnx2x_frag_free(fp, data);
647 BNX2X_ERR("Can't map rx data\n");663 BNX2X_ERR("Can't map rx data\n");
648 return -ENOMEM;664 return -ENOMEM;
649 }665 }
@@ -845,9 +861,9 @@ int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) · 195 unmodified lines
845 dma_unmap_addr(rx_buf, mapping),861 dma_unmap_addr(rx_buf, mapping),
846 fp->rx_buf_size,862 fp->rx_buf_size,
847 DMA_FROM_DEVICE);863 DMA_FROM_DEVICE);
848 skb = build_skb(data, 0);864 skb = build_skb(data, fp->rx_frag_size);
849 if (unlikely(!skb)) {865 if (unlikely(!skb)) {
850 kfree(data);866 bnx2x_frag_free(fp, data);
851 bnx2x_fp_qstats(bp, fp)->867 bnx2x_fp_qstats(bp, fp)->
852 rx_skb_alloc_failed++;868 rx_skb_alloc_failed++;
853 goto next_rx;869 goto next_rx;
@@ -948,14 +964,12 @@ void bnx2x_acquire_phy_lock(struct bnx2x *bp) · 94 unmodified lines
948{964{
949 mutex_lock(&bp->port.phy_mutex);965 mutex_lock(&bp->port.phy_mutex);
950 966
951 if (bp->port.need_hw_lock)967 bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_MDIO);
952 bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_MDIO);
953}968}
954 969
955void bnx2x_release_phy_lock(struct bnx2x *bp)970void bnx2x_release_phy_lock(struct bnx2x *bp)
956{971{
957 if (bp->port.need_hw_lock)972 bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_MDIO);
958 bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_MDIO);
959 973
960 mutex_unlock(&bp->port.phy_mutex);974 mutex_unlock(&bp->port.phy_mutex);
961}975}
@@ -1147,11 +1161,30 @@ static void bnx2x_free_tpa_pool(struct bnx2x *bp, · 185 unmodified lines
1147 dma_unmap_single(&bp->pdev->dev,1161 dma_unmap_single(&bp->pdev->dev,
1148 dma_unmap_addr(first_buf, mapping),1162 dma_unmap_addr(first_buf, mapping),
1149 fp->rx_buf_size, DMA_FROM_DEVICE);1163 fp->rx_buf_size, DMA_FROM_DEVICE);
1150 kfree(data);1164 bnx2x_frag_free(fp, data);
1151 first_buf->data = NULL;1165 first_buf->data = NULL;
1152 }1166 }
1153}1167}
1154 1168
1169void 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
1155void bnx2x_init_rx_rings(struct bnx2x *bp)1188void bnx2x_init_rx_rings(struct bnx2x *bp)
1156{1189{
1157 int func = BP_FUNC(bp);1190 int func = BP_FUNC(bp);
@@ -1159,7 +1192,7 @@ void bnx2x_init_rx_rings(struct bnx2x *bp) · 1 unmodified line
1159 int i, j;1192 int i, j;
1160 1193
1161 /* Allocate TPA resources */1194 /* Allocate TPA resources */
1162 for_each_rx_queue(bp, j) {1195 for_each_eth_queue(bp, j) {
1163 struct bnx2x_fastpath *fp = &bp->fp[j];1196 struct bnx2x_fastpath *fp = &bp->fp[j];
1164 1197
1165 DP(NETIF_MSG_IFUP,1198 DP(NETIF_MSG_IFUP,
@@ -1173,8 +1206,7 @@ void bnx2x_init_rx_rings(struct bnx2x *bp) · 7 unmodified lines
1173 struct sw_rx_bd *first_buf =1206 struct sw_rx_bd *first_buf =
1174 &tpa_info->first_buf;1207 &tpa_info->first_buf;
1175 1208
1176 first_buf->data = kmalloc(fp->rx_buf_size + NET_SKB_PAD,1209 first_buf->data = bnx2x_frag_alloc(fp);
1177 GFP_ATOMIC);
1178 if (!first_buf->data) {1210 if (!first_buf->data) {
1179 BNX2X_ERR("Failed to allocate TPA skb pool for queue[%d] - disabling TPA on this queue!\n",1211 BNX2X_ERR("Failed to allocate TPA skb pool for queue[%d] - disabling TPA on this queue!\n",
1180 j);1212 j);
@@ -1217,7 +1249,7 @@ void bnx2x_init_rx_rings(struct bnx2x *bp) · 36 unmodified lines
1217 }1249 }
1218 }1250 }
1219 1251
1220 for_each_rx_queue(bp, j) {1252 for_each_eth_queue(bp, j) {
1221 struct bnx2x_fastpath *fp = &bp->fp[j];1253 struct bnx2x_fastpath *fp = &bp->fp[j];
1222 1254
1223 fp->rx_bd_cons = 0;1255 fp->rx_bd_cons = 0;
@@ -1244,29 +1276,45 @@ void bnx2x_init_rx_rings(struct bnx2x *bp) · 20 unmodified lines
1244 }1276 }
1245}1277}
1246 1278
1247static void bnx2x_free_tx_skbs(struct bnx2x *bp)1279static void bnx2x_free_tx_skbs_queue(struct bnx2x_fastpath *fp)
1248{1280{
1249 int i;
1250 u8 cos;1281 u8 cos;
1282 struct bnx2x *bp = fp->bp;
1251 1283
1252 for_each_tx_queue(bp, i) {1284 for_each_cos_in_tx_queue(fp, cos) {
1253 struct bnx2x_fastpath *fp = &bp->fp[i];1285 struct bnx2x_fp_txdata *txdata = fp->txdata_ptr[cos];
1254 for_each_cos_in_tx_queue(fp, cos) {1286 unsigned pkts_compl = 0, bytes_compl = 0;
1255 struct bnx2x_fp_txdata *txdata = fp->txdata_ptr[cos];
1256 unsigned pkts_compl = 0, bytes_compl = 0;
1257 1287
1258 u16 sw_prod = txdata->tx_pkt_prod;1288 u16 sw_prod = txdata->tx_pkt_prod;
1259 u16 sw_cons = txdata->tx_pkt_cons;1289 u16 sw_cons = txdata->tx_pkt_cons;
1260 1290
1261 while (sw_cons != sw_prod) {1291 while (sw_cons != sw_prod) {
1262 bnx2x_free_tx_pkt(bp, txdata, TX_BD(sw_cons),1292 bnx2x_free_tx_pkt(bp, txdata, TX_BD(sw_cons),
1263 &pkts_compl, &bytes_compl);1293 &pkts_compl, &bytes_compl);
1264 sw_cons++;1294 sw_cons++;
1265 }
1266 netdev_tx_reset_queue(
1267 netdev_get_tx_queue(bp->dev,
1268 txdata->txq_index));
1269 }1295 }
1296
1297 netdev_tx_reset_queue(
1298 netdev_get_tx_queue(bp->dev,
1299 txdata->txq_index));
1300 }
1301}
1302
1303static 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
1312static 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]);
1270 }1318 }
1271}1319}
1272 1320
@@ -1290,7 +1338,16 @@ static void bnx2x_free_rx_bds(struct bnx2x_fastpath *fp) · 17 unmodified lines
1290 fp->rx_buf_size, DMA_FROM_DEVICE);1338 fp->rx_buf_size, DMA_FROM_DEVICE);
1291 1339
1292 rx_buf->data = NULL;1340 rx_buf->data = NULL;
1293 kfree(data);1341 bnx2x_frag_free(fp, data);
1342 }
1343}
1344
1345static 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]);
1294 }1351 }
1295}1352}
1296 1353
@@ -1298,7 +1355,7 @@ static void bnx2x_free_rx_skbs(struct bnx2x *bp) · 1 unmodified line
1298{1355{
1299 int j;1356 int j;
1300 1357
1301 for_each_rx_queue(bp, j) {1358 for_each_eth_queue(bp, j) {
1302 struct bnx2x_fastpath *fp = &bp->fp[j];1359 struct bnx2x_fastpath *fp = &bp->fp[j];
1303 1360
1304 bnx2x_free_rx_bds(fp);1361 bnx2x_free_rx_bds(fp);
@@ -1308,6 +1365,12 @@ static void bnx2x_free_rx_skbs(struct bnx2x *bp) · 3 unmodified lines
1308 }1365 }
1309}1366}
1310 1367
1368void bnx2x_free_skbs_cnic(struct bnx2x *bp)
1369{
1370 bnx2x_free_tx_skbs_cnic(bp);
1371 bnx2x_free_rx_skbs_cnic(bp);
1372}
1373
1311void bnx2x_free_skbs(struct bnx2x *bp)1374void bnx2x_free_skbs(struct bnx2x *bp)
1312{1375{
1313 bnx2x_free_tx_skbs(bp);1376 bnx2x_free_tx_skbs(bp);
@@ -1347,11 +1410,12 @@ static void bnx2x_free_msix_irqs(struct bnx2x *bp, int nvecs) · 33 unmodified lines
1347 DP(NETIF_MSG_IFDOWN, "released sp irq (%d)\n",1410 DP(NETIF_MSG_IFDOWN, "released sp irq (%d)\n",
1348 bp->msix_table[offset].vector);1411 bp->msix_table[offset].vector);
1349 offset++;1412 offset++;
1350#ifdef BCM_CNIC1413
1351 if (nvecs == offset)1414 if (CNIC_SUPPORT(bp)) {
1352 return;1415 if (nvecs == offset)
1353 offset++;1416 return;
1354#endif1417 offset++;
1418 }
1355 1419
1356 for_each_eth_queue(bp, i) {1420 for_each_eth_queue(bp, i) {
1357 if (nvecs == offset)1421 if (nvecs == offset)
@@ -1368,7 +1432,7 @@ void bnx2x_free_irq(struct bnx2x *bp) · 10 unmodified lines
1368 if (bp->flags & USING_MSIX_FLAG &&1432 if (bp->flags & USING_MSIX_FLAG &&
1369 !(bp->flags & USING_SINGLE_MSIX_FLAG))1433 !(bp->flags & USING_SINGLE_MSIX_FLAG))
1370 bnx2x_free_msix_irqs(bp, BNX2X_NUM_ETH_QUEUES(bp) +1434 bnx2x_free_msix_irqs(bp, BNX2X_NUM_ETH_QUEUES(bp) +
1371 CNIC_PRESENT + 1);1435 CNIC_SUPPORT(bp) + 1);
1372 else1436 else
1373 free_irq(bp->dev->irq, bp->dev);1437 free_irq(bp->dev->irq, bp->dev);
1374}1438}
@@ -1382,12 +1446,14 @@ int bnx2x_enable_msix(struct bnx2x *bp) · 7 unmodified lines
1382 bp->msix_table[0].entry);1446 bp->msix_table[0].entry);
1383 msix_vec++;1447 msix_vec++;
1384 1448
1385#ifdef BCM_CNIC1449 /* Cnic requires an msix vector for itself */
1386 bp->msix_table[msix_vec].entry = msix_vec;1450 if (CNIC_SUPPORT(bp)) {
1387 BNX2X_DEV_INFO("msix_table[%d].entry = %d (CNIC)\n",1451 bp->msix_table[msix_vec].entry = msix_vec;
1388 bp->msix_table[msix_vec].entry, bp->msix_table[msix_vec].entry);1452 BNX2X_DEV_INFO("msix_table[%d].entry = %d (CNIC)\n",
1389 msix_vec++;1453 msix_vec, bp->msix_table[msix_vec].entry);
1390#endif1454 msix_vec++;
1455 }
1456
1391 /* We need separate vectors for ETH queues only (not FCoE) */1457 /* We need separate vectors for ETH queues only (not FCoE) */
1392 for_each_eth_queue(bp, i) {1458 for_each_eth_queue(bp, i) {
1393 bp->msix_table[msix_vec].entry = msix_vec;1459 bp->msix_table[msix_vec].entry = msix_vec;
@@ -1396,7 +1462,7 @@ int bnx2x_enable_msix(struct bnx2x *bp) · 2 unmodified lines
1396 msix_vec++;1462 msix_vec++;
1397 }1463 }
1398 1464
1399 req_cnt = BNX2X_NUM_ETH_QUEUES(bp) + CNIC_PRESENT + 1;1465 req_cnt = BNX2X_NUM_ETH_QUEUES(bp) + CNIC_SUPPORT(bp) + 1;
1400 1466
1401 rc = pci_enable_msix(bp->pdev, &bp->msix_table[0], req_cnt);1467 rc = pci_enable_msix(bp->pdev, &bp->msix_table[0], req_cnt);
1402 1468
@@ -1404,7 +1470,7 @@ int bnx2x_enable_msix(struct bnx2x *bp) · 1 unmodified line
1404 * reconfigure number of tx/rx queues according to available1470 * reconfigure number of tx/rx queues according to available
1405 * MSI-X vectors1471 * MSI-X vectors
1406 */1472 */
1407 if (rc >= BNX2X_MIN_MSIX_VEC_CNT) {1473 if (rc >= BNX2X_MIN_MSIX_VEC_CNT(bp)) {
1408 /* how less vectors we will have? */1474 /* how less vectors we will have? */
1409 int diff = req_cnt - rc;1475 int diff = req_cnt - rc;
1410 1476
@@ -1419,7 +1485,8 @@ int bnx2x_enable_msix(struct bnx2x *bp) · 8 unmodified lines
1419 /*1485 /*
1420 * decrease number of queues by number of unallocated entries1486 * decrease number of queues by number of unallocated entries
1421 */1487 */
1422 bp->num_queues -= diff;1488 bp->num_ethernet_queues -= diff;
1489 bp->num_queues = bp->num_ethernet_queues + bp->num_cnic_queues;
1423 1490
1424 BNX2X_DEV_INFO("New queue configuration set: %d\n",1491 BNX2X_DEV_INFO("New queue configuration set: %d\n",
1425 bp->num_queues);1492 bp->num_queues);
@@ -1435,6 +1502,9 @@ int bnx2x_enable_msix(struct bnx2x *bp) · 9 unmodified lines
1435 BNX2X_DEV_INFO("Using single MSI-X vector\n");1502 BNX2X_DEV_INFO("Using single MSI-X vector\n");
1436 bp->flags |= USING_SINGLE_MSIX_FLAG;1503 bp->flags |= USING_SINGLE_MSIX_FLAG;
1437 1504
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;
1438 } else if (rc < 0) {1508 } else if (rc < 0) {
1439 BNX2X_DEV_INFO("MSI-X is not attainable rc %d\n", rc);1509 BNX2X_DEV_INFO("MSI-X is not attainable rc %d\n", rc);
1440 goto no_msix;1510 goto no_msix;
@@ -1464,9 +1534,9 @@ static int bnx2x_req_msix_irqs(struct bnx2x *bp) · 23 unmodified lines
1464 return -EBUSY;1534 return -EBUSY;
1465 }1535 }
1466 1536
1467#ifdef BCM_CNIC1537 if (CNIC_SUPPORT(bp))
1468 offset++;1538 offset++;
1469#endif1539
1470 for_each_eth_queue(bp, i) {1540 for_each_eth_queue(bp, i) {
1471 struct bnx2x_fastpath *fp = &bp->fp[i];1541 struct bnx2x_fastpath *fp = &bp->fp[i];
1472 snprintf(fp->name, sizeof(fp->name), "%s-fp-%d",1542 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
1485 }1555 }
1486 1556
1487 i = BNX2X_NUM_ETH_QUEUES(bp);1557 i = BNX2X_NUM_ETH_QUEUES(bp);
1488 offset = 1 + CNIC_PRESENT;1558 offset = 1 + CNIC_SUPPORT(bp);
1489 netdev_info(bp->dev, "using MSI-X IRQs: sp %d fp[%d] %d ... fp[%d] %d\n",1559 netdev_info(bp->dev, "using MSI-X IRQs: sp %d fp[%d] %d ... fp[%d] %d\n",
1490 bp->msix_table[0].vector,1560 bp->msix_table[0].vector,
1491 0, bp->msix_table[offset].vector,1561 0, bp->msix_table[offset].vector,
@@ -1556,19 +1626,35 @@ static int bnx2x_setup_irqs(struct bnx2x *bp) · 64 unmodified lines
1556 return 0;1626 return 0;
1557}1627}
1558 1628
1629static 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
1559static void bnx2x_napi_enable(struct bnx2x *bp)1637static void bnx2x_napi_enable(struct bnx2x *bp)
1560{1638{
1561 int i;1639 int i;
1562 1640
1563 for_each_rx_queue(bp, i)1641 for_each_eth_queue(bp, i)
1564 napi_enable(&bnx2x_fp(bp, i, napi));1642 napi_enable(&bnx2x_fp(bp, i, napi));
1565}1643}
1566 1644
1645static 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
1567static void bnx2x_napi_disable(struct bnx2x *bp)1653static void bnx2x_napi_disable(struct bnx2x *bp)
1568{1654{
1569 int i;1655 int i;
1570 1656
1571 for_each_rx_queue(bp, i)1657 for_each_eth_queue(bp, i)
1572 napi_disable(&bnx2x_fp(bp, i, napi));1658 napi_disable(&bnx2x_fp(bp, i, napi));
1573}1659}
1574 1660
@@ -1576,6 +1662,8 @@ void bnx2x_netif_start(struct bnx2x *bp) · 1 unmodified line
1576{1662{
1577 if (netif_running(bp->dev)) {1663 if (netif_running(bp->dev)) {
1578 bnx2x_napi_enable(bp);1664 bnx2x_napi_enable(bp);
1665 if (CNIC_LOADED(bp))
1666 bnx2x_napi_enable_cnic(bp);
1579 bnx2x_int_enable(bp);1667 bnx2x_int_enable(bp);
1580 if (bp->state == BNX2X_STATE_OPEN)1668 if (bp->state == BNX2X_STATE_OPEN)
1581 netif_tx_wake_all_queues(bp->dev);1669 netif_tx_wake_all_queues(bp->dev);
@@ -1586,14 +1674,15 @@ void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw) · 4 unmodified lines
1586{1674{
1587 bnx2x_int_disable_sync(bp, disable_hw);1675 bnx2x_int_disable_sync(bp, disable_hw);
1588 bnx2x_napi_disable(bp);1676 bnx2x_napi_disable(bp);
1677 if (CNIC_LOADED(bp))
1678 bnx2x_napi_disable_cnic(bp);
1589}1679}
1590 1680
1591u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb)1681u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb)
1592{1682{
1593 struct bnx2x *bp = netdev_priv(dev);1683 struct bnx2x *bp = netdev_priv(dev);
1594 1684
1595#ifdef BCM_CNIC1685 if (CNIC_LOADED(bp) && !NO_FCOE(bp)) {
1596 if (!NO_FCOE(bp)) {
1597 struct ethhdr *hdr = (struct ethhdr *)skb->data;1686 struct ethhdr *hdr = (struct ethhdr *)skb->data;
1598 u16 ether_type = ntohs(hdr->h_proto);1687 u16 ether_type = ntohs(hdr->h_proto);
1599 1688
@@ -1609,7 +1698,7 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) · 9 unmodified lines
1609 if ((ether_type == ETH_P_FCOE) || (ether_type == ETH_P_FIP))1698 if ((ether_type == ETH_P_FCOE) || (ether_type == ETH_P_FIP))
1610 return bnx2x_fcoe_tx(bp, txq_index);1699 return bnx2x_fcoe_tx(bp, txq_index);
1611 }1700 }
1612#endif1701
1613 /* select a non-FCoE queue */1702 /* select a non-FCoE queue */
1614 return __skb_tx_hash(dev, skb, BNX2X_NUM_ETH_QUEUES(bp));1703 return __skb_tx_hash(dev, skb, BNX2X_NUM_ETH_QUEUES(bp));
1615}1704}
@@ -1618,15 +1707,15 @@ u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb) · 2 unmodified lines
1618void bnx2x_set_num_queues(struct bnx2x *bp)1707void bnx2x_set_num_queues(struct bnx2x *bp)
1619{1708{
1620 /* RSS queues */1709 /* RSS queues */
1621 bp->num_queues = bnx2x_calc_num_queues(bp);1710 bp->num_ethernet_queues = bnx2x_calc_num_queues(bp);
1622 1711
1623#ifdef BCM_CNIC
1624 /* override in STORAGE SD modes */1712 /* override in STORAGE SD modes */
1625 if (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))1713 if (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))
1626 bp->num_queues = 1;1714 bp->num_ethernet_queues = 1;
1627#endif1715
1628 /* Add special queues */1716 /* 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;
1630 1719
1631 BNX2X_DEV_INFO("set number of queues to %d\n", bp->num_queues);1720 BNX2X_DEV_INFO("set number of queues to %d\n", bp->num_queues);
1632}1721}
@@ -1653,20 +1742,18 @@ void bnx2x_set_num_queues(struct bnx2x *bp) · 20 unmodified lines
1653 * bnx2x_setup_tc() takes care of the proper TC mappings so that __skb_tx_hash()1742 * bnx2x_setup_tc() takes care of the proper TC mappings so that __skb_tx_hash()
1654 * will return a proper Tx index if TC is enabled (netdev->num_tc > 0).1743 * will return a proper Tx index if TC is enabled (netdev->num_tc > 0).
1655 */1744 */
1656static int bnx2x_set_real_num_queues(struct bnx2x *bp)1745static int bnx2x_set_real_num_queues(struct bnx2x *bp, int include_cnic)
1657{1746{
1658 int rc, tx, rx;1747 int rc, tx, rx;
1659 1748
1660 tx = BNX2X_NUM_ETH_QUEUES(bp) * bp->max_cos;1749 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);
1662 1751
1663/* account for fcoe queue */1752/* account for fcoe queue */
1664#ifdef BCM_CNIC1753 if (include_cnic && !NO_FCOE(bp)) {
1665 if (!NO_FCOE(bp)) {1754 rx++;
1666 rx += FCOE_PRESENT;1755 tx++;
1667 tx += FCOE_PRESENT;
1668 }1756 }
1669#endif
1670 1757
1671 rc = netif_set_real_num_tx_queues(bp->dev, tx);1758 rc = netif_set_real_num_tx_queues(bp->dev, tx);
1672 if (rc) {1759 if (rc) {
@@ -1710,6 +1797,10 @@ static void bnx2x_set_rx_buf_size(struct bnx2x *bp) · 37 unmodified lines
1710 mtu +1797 mtu +
1711 BNX2X_FW_RX_ALIGN_END;1798 BNX2X_FW_RX_ALIGN_END;
1712 /* Note : rx_buf_size doesnt take into account NET_SKB_PAD */1799 /* 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;
1713 }1804 }
1714}1805}
1715 1806
@@ -1859,14 +1950,26 @@ static void bnx2x_squeeze_objects(struct bnx2x *bp) · 143 unmodified lines
1859 (bp)->state = BNX2X_STATE_ERROR; \1950 (bp)->state = BNX2X_STATE_ERROR; \
1860 goto label; \1951 goto label; \
1861 } while (0)1952 } while (0)
1862#else1953
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*/
1863#define LOAD_ERROR_EXIT(bp, label) \1960#define LOAD_ERROR_EXIT(bp, label) \
1864 do { \1961 do { \
1865 (bp)->state = BNX2X_STATE_ERROR; \1962 (bp)->state = BNX2X_STATE_ERROR; \
1866 (bp)->panic = 1; \1963 (bp)->panic = 1; \
1867 return -EBUSY; \1964 return -EBUSY; \
1868 } while (0)1965 } while (0)
1869#endif1966#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*/
1870 1973
1871bool bnx2x_test_firmware_version(struct bnx2x *bp, bool is_err)1974bool bnx2x_test_firmware_version(struct bnx2x *bp, bool is_err)
1872{1975{
@@ -1959,10 +2062,8 @@ static void bnx2x_bz_fp(struct bnx2x *bp, int index) · 86 unmodified lines
1959 fp->max_cos = 1;2062 fp->max_cos = 1;
1960 2063
1961 /* Init txdata pointers */2064 /* Init txdata pointers */
1962#ifdef BCM_CNIC
1963 if (IS_FCOE_FP(fp))2065 if (IS_FCOE_FP(fp))
1964 fp->txdata_ptr[0] = &bp->bnx2x_txq[FCOE_TXQ_IDX(bp)];2066 fp->txdata_ptr[0] = &bp->bnx2x_txq[FCOE_TXQ_IDX(bp)];
1965#endif
1966 if (IS_ETH_FP(fp))2067 if (IS_ETH_FP(fp))
1967 for_each_cos_in_tx_queue(fp, cos)2068 for_each_cos_in_tx_queue(fp, cos)
1968 fp->txdata_ptr[cos] = &bp->bnx2x_txq[cos *2069 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
1980 else if (bp->flags & GRO_ENABLE_FLAG)2081 else if (bp->flags & GRO_ENABLE_FLAG)
1981 fp->mode = TPA_MODE_GRO;2082 fp->mode = TPA_MODE_GRO;
1982 2083
1983#ifdef BCM_CNIC
1984 /* We don't want TPA on an FCoE L2 ring */2084 /* We don't want TPA on an FCoE L2 ring */
1985 if (IS_FCOE_FP(fp))2085 if (IS_FCOE_FP(fp))
1986 fp->disable_tpa = 1;2086 fp->disable_tpa = 1;
1987#endif2087}
2088
2089int 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
2157load_error_cnic2:
2158 /* Disable Timer scan */
2159 REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 0);
2160
2161load_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");
2167load_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 */
1988}2173}
1989 2174
1990 2175
@@ -1995,6 +2180,10 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 4 unmodified lines
1995 u32 load_code;2180 u32 load_code;
1996 int i, rc;2181 int i, rc;
1997 2182
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
1998#ifdef BNX2X_STOP_ON_ERROR2187#ifdef BNX2X_STOP_ON_ERROR
1999 if (unlikely(bp->panic)) {2188 if (unlikely(bp->panic)) {
2000 BNX2X_ERR("Can't load NIC when there is panic\n");2189 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
2022 DP(NETIF_MSG_IFUP, "num queues: %d", bp->num_queues);2211 DP(NETIF_MSG_IFUP, "num queues: %d", bp->num_queues);
2023 for_each_queue(bp, i)2212 for_each_queue(bp, i)
2024 bnx2x_bz_fp(bp, i);2213 bnx2x_bz_fp(bp, i);
2025 memset(bp->bnx2x_txq, 0, bp->bnx2x_txq_size *2214 memset(bp->bnx2x_txq, 0, (BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS +
2026 sizeof(struct bnx2x_fp_txdata));2215 bp->num_cnic_queues) *
2216 sizeof(struct bnx2x_fp_txdata));
2027 2217
2218 bp->fcoe_init = false;
2028 2219
2029 /* Set the receive queues buffer size */2220 /* Set the receive queues buffer size */
2030 bnx2x_set_rx_buf_size(bp);2221 bnx2x_set_rx_buf_size(bp);
@@ -2034,9 +2225,9 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 3 unmodified lines
2034 2225
2035 /* As long as bnx2x_alloc_mem() may possibly update2226 /* As long as bnx2x_alloc_mem() may possibly update
2036 * bp->num_queues, bnx2x_set_real_num_queues() should always2227 * 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.
2038 */2229 */
2039 rc = bnx2x_set_real_num_queues(bp);2230 rc = bnx2x_set_real_num_queues(bp, 0);
2040 if (rc) {2231 if (rc) {
2041 BNX2X_ERR("Unable to set real_num_queues\n");2232 BNX2X_ERR("Unable to set real_num_queues\n");
2042 LOAD_ERROR_EXIT(bp, load_error0);2233 LOAD_ERROR_EXIT(bp, load_error0);
@@ -2050,6 +2241,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 7 unmodified lines
2050 2241
2051 /* Add all NAPI objects */2242 /* Add all NAPI objects */
2052 bnx2x_add_all_napi(bp);2243 bnx2x_add_all_napi(bp);
2244 DP(NETIF_MSG_IFUP, "napi added\n");
2053 bnx2x_napi_enable(bp);2245 bnx2x_napi_enable(bp);
2054 2246
2055 /* set pf load just before approaching the MCP */2247 /* 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
2073 DRV_PULSE_SEQ_MASK);2265 DRV_PULSE_SEQ_MASK);
2074 BNX2X_DEV_INFO("drv_pulse 0x%x\n", bp->fw_drv_pulse_wr_seq);2266 BNX2X_DEV_INFO("drv_pulse 0x%x\n", bp->fw_drv_pulse_wr_seq);
2075 2267
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);
2077 if (!load_code) {2270 if (!load_code) {
2078 BNX2X_ERR("MCP response failure, aborting\n");2271 BNX2X_ERR("MCP response failure, aborting\n");
2079 rc = -EBUSY;2272 rc = -EBUSY;
@@ -2191,23 +2384,18 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 111 unmodified lines
2191 LOAD_ERROR_EXIT(bp, load_error3);2384 LOAD_ERROR_EXIT(bp, load_error3);
2192 }2385 }
2193 2386
2194#ifdef BCM_CNIC2387 for_each_nondefault_eth_queue(bp, i) {
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) {
2200 rc = bnx2x_setup_queue(bp, &bp->fp[i], 0);2388 rc = bnx2x_setup_queue(bp, &bp->fp[i], 0);
2201 if (rc) {2389 if (rc) {
2202 BNX2X_ERR("Queue setup failed\n");2390 BNX2X_ERR("Queue setup failed\n");
2203 LOAD_ERROR_EXIT(bp, load_error4);2391 LOAD_ERROR_EXIT(bp, load_error3);
2204 }2392 }
2205 }2393 }
2206 2394
2207 rc = bnx2x_init_rss_pf(bp);2395 rc = bnx2x_init_rss_pf(bp);
2208 if (rc) {2396 if (rc) {
2209 BNX2X_ERR("PF RSS init failed\n");2397 BNX2X_ERR("PF RSS init failed\n");
2210 LOAD_ERROR_EXIT(bp, load_error4);2398 LOAD_ERROR_EXIT(bp, load_error3);
2211 }2399 }
2212 2400
2213 /* Now when Clients are configured we are ready to work */2401 /* 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
2217 rc = bnx2x_set_eth_mac(bp, true);2405 rc = bnx2x_set_eth_mac(bp, true);
2218 if (rc) {2406 if (rc) {
2219 BNX2X_ERR("Setting Ethernet MAC failed\n");2407 BNX2X_ERR("Setting Ethernet MAC failed\n");
2220 LOAD_ERROR_EXIT(bp, load_error4);2408 LOAD_ERROR_EXIT(bp, load_error3);
2221 }2409 }
2222 2410
2223 if (bp->pending_max) {2411 if (bp->pending_max) {
@@ -2227,6 +2415,7 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 3 unmodified lines
2227 2415
2228 if (bp->port.pmf)2416 if (bp->port.pmf)
2229 bnx2x_initial_phy_init(bp, load_mode);2417 bnx2x_initial_phy_init(bp, load_mode);
2418 bp->link_params.feature_config_flags &= ~FEATURE_CONFIG_BOOT_FROM_SAN;
2230 2419
2231 /* Start fast path */2420 /* Start fast path */
2232 2421
@@ -2257,21 +2446,15 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 24 unmodified lines
2257 }2446 }
2258 2447
2259 if (bp->port.pmf)2448 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);
2261 else2450 else
2262 bnx2x__link_status_update(bp);2451 bnx2x__link_status_update(bp);
2263 2452
2264 /* start the timer */2453 /* start the timer */
2265 mod_timer(&bp->timer, jiffies + bp->current_interval);2454 mod_timer(&bp->timer, jiffies + bp->current_interval);
2266 2455
2267#ifdef BCM_CNIC2456 if (CNIC_ENABLED(bp))
2268 /* re-read iscsi info */2457 bnx2x_load_cnic(bp);
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
2275 2458
2276 /* mark driver is loaded in shmem2 */2459 /* mark driver is loaded in shmem2 */
2277 if (SHMEM2_HAS(bp, drv_capabilities_flag)) {2460 if (SHMEM2_HAS(bp, drv_capabilities_flag)) {
@@ -2293,14 +2476,11 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 15 unmodified lines
2293 if (bp->port.pmf && (bp->state != BNX2X_STATE_DIAG))2476 if (bp->port.pmf && (bp->state != BNX2X_STATE_DIAG))
2294 bnx2x_dcbx_init(bp, false);2477 bnx2x_dcbx_init(bp, false);
2295 2478
2479 DP(NETIF_MSG_IFUP, "Ending successfully NIC load\n");
2480
2296 return 0;2481 return 0;
2297 2482
2298#ifndef BNX2X_STOP_ON_ERROR2483#ifndef BNX2X_STOP_ON_ERROR
2299load_error4:
2300#ifdef BCM_CNIC
2301 /* Disable Timer scan */
2302 REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 0);
2303#endif
2304load_error3:2484load_error3:
2305 bnx2x_int_disable_sync(bp, 1);2485 bnx2x_int_disable_sync(bp, 1);
2306 2486
@@ -2338,6 +2518,8 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) · 31 unmodified lines
2338 int i;2518 int i;
2339 bool global = false;2519 bool global = false;
2340 2520
2521 DP(NETIF_MSG_IFUP, "Starting NIC unload\n");
2522
2341 /* mark driver is unloaded in shmem2 */2523 /* mark driver is unloaded in shmem2 */
2342 if (SHMEM2_HAS(bp, drv_capabilities_flag)) {2524 if (SHMEM2_HAS(bp, drv_capabilities_flag)) {
2343 u32 val;2525 u32 val;
@@ -2373,14 +2555,13 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) · 29 unmodified lines
2373 bp->state = BNX2X_STATE_CLOSING_WAIT4_HALT;2555 bp->state = BNX2X_STATE_CLOSING_WAIT4_HALT;
2374 smp_mb();2556 smp_mb();
2375 2557
2558 if (CNIC_LOADED(bp))
2559 bnx2x_cnic_notify(bp, CNIC_CTL_STOP_CMD);
2560
2376 /* Stop Tx */2561 /* Stop Tx */
2377 bnx2x_tx_disable(bp);2562 bnx2x_tx_disable(bp);
2378 netdev_reset_tc(bp->dev);2563 netdev_reset_tc(bp->dev);
2379 2564
2380#ifdef BCM_CNIC
2381 bnx2x_cnic_notify(bp, CNIC_CTL_STOP_CMD);
2382#endif
2383
2384 bp->rx_mode = BNX2X_RX_MODE_NONE;2565 bp->rx_mode = BNX2X_RX_MODE_NONE;
2385 2566
2386 del_timer_sync(&bp->timer);2567 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
2414 bnx2x_netif_stop(bp, 1);2595 bnx2x_netif_stop(bp, 1);
2415 /* Delete all NAPI objects */2596 /* Delete all NAPI objects */
2416 bnx2x_del_all_napi(bp);2597 bnx2x_del_all_napi(bp);
2417 2598 if (CNIC_LOADED(bp))
2599 bnx2x_del_all_napi_cnic(bp);
2418 /* Release IRQs */2600 /* Release IRQs */
2419 bnx2x_free_irq(bp);2601 bnx2x_free_irq(bp);
2420 2602
@@ -2435,12 +2617,19 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) · 14 unmodified lines
2435 2617
2436 /* Free SKBs, SGEs, TPA pool and driver internals */2618 /* Free SKBs, SGEs, TPA pool and driver internals */
2437 bnx2x_free_skbs(bp);2619 bnx2x_free_skbs(bp);
2620 if (CNIC_LOADED(bp))
2621 bnx2x_free_skbs_cnic(bp);
2438 for_each_rx_queue(bp, i)2622 for_each_rx_queue(bp, i)
2439 bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE);2623 bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE);
2440 2624
2625 if (CNIC_LOADED(bp)) {
2626 bnx2x_free_fp_mem_cnic(bp);
2627 bnx2x_free_mem_cnic(bp);
2628 }
2441 bnx2x_free_mem(bp);2629 bnx2x_free_mem(bp);
2442 2630
2443 bp->state = BNX2X_STATE_CLOSED;2631 bp->state = BNX2X_STATE_CLOSED;
2632 bp->cnic_loaded = false;
2444 2633
2445 /* Check if there are pending parity attentions. If there are - set2634 /* Check if there are pending parity attentions. If there are - set
2446 * RECOVERY_IN_PROGRESS.2635 * RECOVERY_IN_PROGRESS.
@@ -2460,6 +2649,8 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) · 13 unmodified lines
2460 if (!bnx2x_clear_pf_load(bp) && bnx2x_reset_is_done(bp, BP_PATH(bp)))2649 if (!bnx2x_clear_pf_load(bp) && bnx2x_reset_is_done(bp, BP_PATH(bp)))
2461 bnx2x_disable_close_the_gate(bp);2650 bnx2x_disable_close_the_gate(bp);
2462 2651
2652 DP(NETIF_MSG_IFUP, "Ending NIC unload\n");
2653
2463 return 0;2654 return 0;
2464}2655}
2465 2656
@@ -2550,7 +2741,7 @@ int bnx2x_poll(struct napi_struct *napi, int budget) · 84 unmodified lines
2550 2741
2551 /* Fall out from the NAPI loop if needed */2742 /* Fall out from the NAPI loop if needed */
2552 if (!(bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))) {2743 if (!(bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))) {
2553#ifdef BCM_CNIC2744
2554 /* No need to update SB for FCoE L2 ring as long as2745 /* No need to update SB for FCoE L2 ring as long as
2555 * it's connected to the default SB and the SB2746 * it's connected to the default SB and the SB
2556 * has been updated when NAPI was scheduled.2747 * has been updated when NAPI was scheduled.
@@ -2559,8 +2750,6 @@ int bnx2x_poll(struct napi_struct *napi, int budget) · 2 unmodified lines
2559 napi_complete(napi);2750 napi_complete(napi);
2560 break;2751 break;
2561 }2752 }
2562#endif
2563
2564 bnx2x_update_fpsb_idx(fp);2753 bnx2x_update_fpsb_idx(fp);
2565 /* bnx2x_has_rx_work() reads the status block,2754 /* bnx2x_has_rx_work() reads the status block,
2566 * thus we need to ensure that status block indices2755 * 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
2940 txq_index = skb_get_queue_mapping(skb);3129 txq_index = skb_get_queue_mapping(skb);
2941 txq = netdev_get_tx_queue(dev, txq_index);3130 txq = netdev_get_tx_queue(dev, txq_index);
2942 3131
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));
2944 3133
2945 txdata = &bp->bnx2x_txq[txq_index];3134 txdata = &bp->bnx2x_txq[txq_index];
2946 3135
@@ -2958,11 +3147,16 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 11 unmodified lines
2958 BDS_PER_TX_PKT +3147 BDS_PER_TX_PKT +
2959 NEXT_CNT_PER_TX_PKT(MAX_BDS_PER_TX_PKT))) {3148 NEXT_CNT_PER_TX_PKT(MAX_BDS_PER_TX_PKT))) {
2960 /* Handle special storage cases separately */3149 /* Handle special storage cases separately */
2961 if (txdata->tx_ring_size != 0) {3150 if (txdata->tx_ring_size == 0) {
2962 BNX2X_ERR("BUG! Tx ring full when queue awake!\n");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 }
2963 bnx2x_fp_qstats(bp, txdata->parent_fp)->driver_xoff++;3157 bnx2x_fp_qstats(bp, txdata->parent_fp)->driver_xoff++;
2964 netif_tx_stop_queue(txq);3158 netif_tx_stop_queue(txq);
2965 }3159 BNX2X_ERR("BUG! Tx ring full when queue awake!\n");
2966 3160
2967 return NETDEV_TX_BUSY;3161 return NETDEV_TX_BUSY;
2968 }3162 }
@@ -3339,13 +3533,11 @@ int bnx2x_change_mac_addr(struct net_device *dev, void *p) · 370 unmodified lines
3339 return -EINVAL;3533 return -EINVAL;
3340 }3534 }
3341 3535
3342#ifdef BCM_CNIC
3343 if ((IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp)) &&3536 if ((IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp)) &&
3344 !is_zero_ether_addr(addr->sa_data)) {3537 !is_zero_ether_addr(addr->sa_data)) {
3345 BNX2X_ERR("Can't configure non-zero address on iSCSI or FCoE functions in MF-SD mode\n");3538 BNX2X_ERR("Can't configure non-zero address on iSCSI or FCoE functions in MF-SD mode\n");
3346 return -EINVAL;3539 return -EINVAL;
3347 }3540 }
3348#endif
3349 3541
3350 if (netif_running(dev)) {3542 if (netif_running(dev)) {
3351 rc = bnx2x_set_eth_mac(bp, false);3543 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
3369 u8 cos;3561 u8 cos;
3370 3562
3371 /* Common */3563 /* Common */
3372#ifdef BCM_CNIC3564
3373 if (IS_FCOE_IDX(fp_index)) {3565 if (IS_FCOE_IDX(fp_index)) {
3374 memset(sb, 0, sizeof(union host_hc_status_block));3566 memset(sb, 0, sizeof(union host_hc_status_block));
3375 fp->status_blk_mapping = 0;3567 fp->status_blk_mapping = 0;
3376
3377 } else {3568 } else {
3378#endif
3379 /* status blocks */3569 /* status blocks */
3380 if (!CHIP_IS_E1x(bp))3570 if (!CHIP_IS_E1x(bp))
3381 BNX2X_PCI_FREE(sb->e2_sb,3571 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
3387 bnx2x_fp(bp, fp_index,3577 bnx2x_fp(bp, fp_index,
3388 status_blk_mapping),3578 status_blk_mapping),
3389 sizeof(struct host_hc_status_block_e1x));3579 sizeof(struct host_hc_status_block_e1x));
3390#ifdef BCM_CNIC
3391 }3580 }
3392#endif3581
3393 /* Rx */3582 /* Rx */
3394 if (!skip_rx_queue(bp, fp_index)) {3583 if (!skip_rx_queue(bp, fp_index)) {
3395 bnx2x_free_rx_bds(fp);3584 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
3431 /* end of fastpath */3620 /* end of fastpath */
3432}3621}
3433 3622
3623void 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
3434void bnx2x_free_fp_mem(struct bnx2x *bp)3630void bnx2x_free_fp_mem(struct bnx2x *bp)
3435{3631{
3436 int i;3632 int i;
3437 for_each_queue(bp, i)3633 for_each_eth_queue(bp, i)
3438 bnx2x_free_fp_mem_at(bp, i);3634 bnx2x_free_fp_mem_at(bp, i);
3439}3635}
3440 3636
@@ -3519,14 +3715,11 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) · 78 unmodified lines
3519 u8 cos;3715 u8 cos;
3520 int rx_ring_size = 0;3716 int rx_ring_size = 0;
3521 3717
3522#ifdef BCM_CNIC
3523 if (!bp->rx_ring_size &&3718 if (!bp->rx_ring_size &&
3524 (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))) {3719 (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))) {
3525 rx_ring_size = MIN_RX_SIZE_NONTPA;3720 rx_ring_size = MIN_RX_SIZE_NONTPA;
3526 bp->rx_ring_size = rx_ring_size;3721 bp->rx_ring_size = rx_ring_size;
3527 } else3722 } else if (!bp->rx_ring_size) {
3528#endif
3529 if (!bp->rx_ring_size) {
3530 rx_ring_size = MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp);3723 rx_ring_size = MAX_RX_AVAIL/BNX2X_NUM_RX_QUEUES(bp);
3531 3724
3532 if (CHIP_IS_E3(bp)) {3725 if (CHIP_IS_E3(bp)) {
@@ -3550,9 +3743,8 @@ static int bnx2x_alloc_fp_mem_at(struct bnx2x *bp, int index) · 17 unmodified lines
3550 3743
3551 /* Common */3744 /* Common */
3552 sb = &bnx2x_fp(bp, index, status_blk);3745 sb = &bnx2x_fp(bp, index, status_blk);
3553#ifdef BCM_CNIC3746
3554 if (!IS_FCOE_IDX(index)) {3747 if (!IS_FCOE_IDX(index)) {
3555#endif
3556 /* status blocks */3748 /* status blocks */
3557 if (!CHIP_IS_E1x(bp))3749 if (!CHIP_IS_E1x(bp))
3558 BNX2X_PCI_ALLOC(sb->e2_sb,3750 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
3562 BNX2X_PCI_ALLOC(sb->e1x_sb,3754 BNX2X_PCI_ALLOC(sb->e1x_sb,
3563 &bnx2x_fp(bp, index, status_blk_mapping),3755 &bnx2x_fp(bp, index, status_blk_mapping),
3564 sizeof(struct host_hc_status_block_e1x));3756 sizeof(struct host_hc_status_block_e1x));
3565#ifdef BCM_CNIC
3566 }3757 }
3567#endif
3568 3758
3569 /* FCoE Queue uses Default SB and doesn't ACK the SB, thus no need to3759 /* FCoE Queue uses Default SB and doesn't ACK the SB, thus no need to
3570 * set shortcuts for it.3760 * set shortcuts for it.
@@ -3641,31 +3831,31 @@ alloc_mem_err: · 70 unmodified lines
3641 return 0;3831 return 0;
3642}3832}
3643 3833
3834int 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
3644int bnx2x_alloc_fp_mem(struct bnx2x *bp)3847int bnx2x_alloc_fp_mem(struct bnx2x *bp)
3645{3848{
3646 int i;3849 int i;
3647 3850
3648 /**3851 /* 1. Allocate FP for leading - fatal if error
3649 * 1. Allocate FP for leading - fatal if error3852 * 2. Allocate RSS - fix number of queues 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
3653 */3853 */
3654 3854
3655 /* leading */3855 /* leading */
3656 if (bnx2x_alloc_fp_mem_at(bp, 0))3856 if (bnx2x_alloc_fp_mem_at(bp, 0))
3657 return -ENOMEM;3857 return -ENOMEM;
3658 3858
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
3669 /* RSS */3859 /* RSS */
3670 for_each_nondefault_eth_queue(bp, i)3860 for_each_nondefault_eth_queue(bp, i)
3671 if (bnx2x_alloc_fp_mem_at(bp, i))3861 if (bnx2x_alloc_fp_mem_at(bp, i))
@@ -3676,17 +3866,17 @@ int bnx2x_alloc_fp_mem(struct bnx2x *bp) · 4 unmodified lines
3676 int delta = BNX2X_NUM_ETH_QUEUES(bp) - i;3866 int delta = BNX2X_NUM_ETH_QUEUES(bp) - i;
3677 3867
3678 WARN_ON(delta < 0);3868 WARN_ON(delta < 0);
3679#ifdef BCM_CNIC3869 if (CNIC_SUPPORT(bp))
3680 /**3870 /* move non eth FPs next to last eth FP
3681 * move non eth FPs next to last eth FP3871 * must be done in that order
3682 * must be done in that order3872 * FCOE_IDX < FWD_IDX < OOO_IDX
3683 * FCOE_IDX < FWD_IDX < OOO_IDX3873 */
3684 */
3685 3874
3686 /* move FCoE fp even NO_FCOE_FLAG is on */3875 /* move FCoE fp even NO_FCOE_FLAG is on */
3687 bnx2x_move_fp(bp, FCOE_IDX(bp), FCOE_IDX(bp) - delta);3876 bnx2x_move_fp(bp, FCOE_IDX(bp), FCOE_IDX(bp) - delta);
3688#endif3877 bp->num_ethernet_queues -= delta;
3689 bp->num_queues -= delta;3878 bp->num_queues = bp->num_ethernet_queues +
3879 bp->num_cnic_queues;
3690 BNX2X_ERR("Adjusted num of queues from %d to %d\n",3880 BNX2X_ERR("Adjusted num of queues from %d to %d\n",
3691 bp->num_queues + delta, bp->num_queues);3881 bp->num_queues + delta, bp->num_queues);
3692 }3882 }
@@ -3705,13 +3895,13 @@ void bnx2x_free_mem_bp(struct bnx2x *bp) · 12 unmodified lines
3705 kfree(bp->ilt);3895 kfree(bp->ilt);
3706}3896}
3707 3897
3708int __devinit bnx2x_alloc_mem_bp(struct bnx2x *bp)3898int bnx2x_alloc_mem_bp(struct bnx2x *bp)
3709{3899{
3710 struct bnx2x_fastpath *fp;3900 struct bnx2x_fastpath *fp;
3711 struct msix_entry *tbl;3901 struct msix_entry *tbl;
3712 struct bnx2x_ilt *ilt;3902 struct bnx2x_ilt *ilt;
3713 int msix_table_size = 0;3903 int msix_table_size = 0;
3714 int fp_array_size;3904 int fp_array_size, txq_array_size;
3715 int i;3905 int i;
3716 3906
3717 /*3907 /*
@@ -3721,7 +3911,7 @@ int __devinit bnx2x_alloc_mem_bp(struct bnx2x *bp) · 3 unmodified lines
3721 msix_table_size = bp->igu_sb_cnt + 1;3911 msix_table_size = bp->igu_sb_cnt + 1;
3722 3912
3723 /* fp array: RSS plus CNIC related L2 queues */3913 /* 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);
3725 BNX2X_DEV_INFO("fp_array_size %d", fp_array_size);3915 BNX2X_DEV_INFO("fp_array_size %d", fp_array_size);
3726 3916
3727 fp = kcalloc(fp_array_size, sizeof(*fp), GFP_KERNEL);3917 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
3750 goto alloc_err;3940 goto alloc_err;
3751 3941
3752 /* Allocate memory for the transmission queues array */3942 /* Allocate memory for the transmission queues array */
3753 bp->bnx2x_txq_size = BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS;3943 txq_array_size =
3754#ifdef BCM_CNIC3944 BNX2X_MAX_RSS_COUNT(bp) * BNX2X_MULTI_TX_COS + CNIC_SUPPORT(bp);
3755 bp->bnx2x_txq_size++;3945 BNX2X_DEV_INFO("txq_array_size %d", txq_array_size);
3756#endif3946
3757 bp->bnx2x_txq = kcalloc(bp->bnx2x_txq_size,3947 bp->bnx2x_txq = kcalloc(txq_array_size, sizeof(struct bnx2x_fp_txdata),
3758 sizeof(struct bnx2x_fp_txdata), GFP_KERNEL);3948 GFP_KERNEL);
3759 if (!bp->bnx2x_txq)3949 if (!bp->bnx2x_txq)
3760 goto alloc_err;3950 goto alloc_err;
3761 3951
@@ -3838,7 +4028,7 @@ int bnx2x_get_link_cfg_idx(struct bnx2x *bp) · 76 unmodified lines
3838 return LINK_CONFIG_IDX(sel_phy_idx);4028 return LINK_CONFIG_IDX(sel_phy_idx);
3839}4029}
3840 4030
3841#if defined(NETDEV_FCOE_WWNN) && defined(BCM_CNIC)4031#ifdef NETDEV_FCOE_WWNN
3842int bnx2x_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)4032int bnx2x_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)
3843{4033{
3844 struct bnx2x *bp = netdev_priv(dev);4034 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
144 * @bp: driver handle144 * @bp: driver handle
145 * @load_mode: current mode145 * @load_mode: current mode
146 */146 */
147u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode);147int bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode);
148 148
149/**149/**
150 * bnx2x_link_set - configure hw according to link parameters structure.150 * 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
238 * @dev_instance: private instance238 * @dev_instance: private instance
239 */239 */
240irqreturn_t bnx2x_interrupt(int irq, void *dev_instance);240irqreturn_t bnx2x_interrupt(int irq, void *dev_instance);
241#ifdef BCM_CNIC
242 241
243/**242/**
244 * bnx2x_cnic_notify - send command to cnic driver243 * bnx2x_cnic_notify - send command to cnic driver
@@ -262,8 +261,6 @@ void bnx2x_setup_cnic_irq_info(struct bnx2x *bp); · 17 unmodified lines
262 */261 */
263void bnx2x_setup_cnic_info(struct bnx2x *bp);262void bnx2x_setup_cnic_info(struct bnx2x *bp);
264 263
265#endif
266
267/**264/**
268 * bnx2x_int_enable - enable HW interrupts.265 * bnx2x_int_enable - enable HW interrupts.
269 *266 *
@@ -283,7 +280,7 @@ void bnx2x_int_enable(struct bnx2x *bp); · 13 unmodified lines
283void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw);280void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw);
284 281
285/**282/**
286 * bnx2x_nic_init - init driver internals.283 * bnx2x_nic_init_cnic - init driver internals for cnic.
287 *284 *
288 * @bp: driver handle285 * @bp: driver handle
289 * @load_code: COMMON, PORT or FUNCTION286 * @load_code: COMMON, PORT or FUNCTION
@@ -293,8 +290,25 @@ void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw); · 3 unmodified lines
293 * - status blocks290 * - status blocks
294 * - etc.291 * - etc.
295 */292 */
296void bnx2x_nic_init(struct bnx2x *bp, u32 load_code);293void bnx2x_nic_init_cnic(struct bnx2x *bp);
297 294
295/**
296 * bnx2x_nic_init - init driver internals.
297 *
298 * @bp: driver handle
299 *
300 * Initializes:
301 * - rings
302 * - status blocks
303 * - etc.
304 */
305void 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 */
311int bnx2x_alloc_mem_cnic(struct bnx2x *bp);
298/**312/**
299 * bnx2x_alloc_mem - allocate driver's memory.313 * bnx2x_alloc_mem - allocate driver's memory.
300 *314 *
@@ -302,6 +316,12 @@ void bnx2x_nic_init(struct bnx2x *bp, u32 load_code); · 1 unmodified line
302 */316 */
303int bnx2x_alloc_mem(struct bnx2x *bp);317int bnx2x_alloc_mem(struct bnx2x *bp);
304 318
319/**
320 * bnx2x_free_mem_cnic - release driver's memory for cnic.
321 *
322 * @bp: driver handle
323 */
324void bnx2x_free_mem_cnic(struct bnx2x *bp);
305/**325/**
306 * bnx2x_free_mem - release driver's memory.326 * bnx2x_free_mem - release driver's memory.
307 *327 *
@@ -407,6 +427,7 @@ bool bnx2x_reset_is_done(struct bnx2x *bp, int engine); · 99 unmodified lines
407void bnx2x_set_reset_in_progress(struct bnx2x *bp);427void bnx2x_set_reset_in_progress(struct bnx2x *bp);
408void bnx2x_set_reset_global(struct bnx2x *bp);428void bnx2x_set_reset_global(struct bnx2x *bp);
409void bnx2x_disable_close_the_gate(struct bnx2x *bp);429void bnx2x_disable_close_the_gate(struct bnx2x *bp);
430int bnx2x_init_hw_func_cnic(struct bnx2x *bp);
410 431
411/**432/**
412 * bnx2x_sp_event - handle ramrods completion.433 * 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
423 */444 */
424void bnx2x_ilt_set_info(struct bnx2x *bp);445void bnx2x_ilt_set_info(struct bnx2x *bp);
425 446
447/**
448 * bnx2x_ilt_set_cnic_info - prepare ILT configurations for SRC
449 * and TM.
450 *
451 * @bp: driver handle
452 */
453void bnx2x_ilt_set_info_cnic(struct bnx2x *bp);
454
426/**455/**
427 * bnx2x_dcbx_init - initialize dcbx protocol.456 * bnx2x_dcbx_init - initialize dcbx protocol.
428 *457 *
@@ -491,12 +520,17 @@ int bnx2x_resume(struct pci_dev *pdev); · 62 unmodified lines
491/* Release IRQ vectors */520/* Release IRQ vectors */
492void bnx2x_free_irq(struct bnx2x *bp);521void bnx2x_free_irq(struct bnx2x *bp);
493 522
523void bnx2x_free_fp_mem_cnic(struct bnx2x *bp);
494void bnx2x_free_fp_mem(struct bnx2x *bp);524void bnx2x_free_fp_mem(struct bnx2x *bp);
525int bnx2x_alloc_fp_mem_cnic(struct bnx2x *bp);
495int bnx2x_alloc_fp_mem(struct bnx2x *bp);526int bnx2x_alloc_fp_mem(struct bnx2x *bp);
496void bnx2x_init_rx_rings(struct bnx2x *bp);527void bnx2x_init_rx_rings(struct bnx2x *bp);
528void bnx2x_init_rx_rings_cnic(struct bnx2x *bp);
529void bnx2x_free_skbs_cnic(struct bnx2x *bp);
497void bnx2x_free_skbs(struct bnx2x *bp);530void bnx2x_free_skbs(struct bnx2x *bp);
498void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw);531void bnx2x_netif_stop(struct bnx2x *bp, int disable_hw);
499void bnx2x_netif_start(struct bnx2x *bp);532void bnx2x_netif_start(struct bnx2x *bp);
533int bnx2x_load_cnic(struct bnx2x *bp);
500 534
501/**535/**
502 * bnx2x_enable_msix - set msix configuration.536 * bnx2x_enable_msix - set msix configuration.
@@ -529,7 +563,7 @@ int bnx2x_poll(struct napi_struct *napi, int budget); · 26 unmodified lines
529 *563 *
530 * @bp: driver handle564 * @bp: driver handle
531 */565 */
532int __devinit bnx2x_alloc_mem_bp(struct bnx2x *bp);566int bnx2x_alloc_mem_bp(struct bnx2x *bp);
533 567
534/**568/**
535 * bnx2x_free_mem_bp - release memories outsize main driver structure569 * 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
547 */581 */
548int bnx2x_change_mtu(struct net_device *dev, int new_mtu);582int bnx2x_change_mtu(struct net_device *dev, int new_mtu);
549 583
550#if defined(NETDEV_FCOE_WWNN) && defined(BCM_CNIC)584#ifdef NETDEV_FCOE_WWNN
551/**585/**
552 * bnx2x_fcoe_get_wwn - return the requested WWN value for this port586 * bnx2x_fcoe_get_wwn - return the requested WWN value for this port
553 *587 *
@@ -793,23 +827,39 @@ static inline void bnx2x_free_rx_sge(struct bnx2x *bp, · 239 unmodified lines
793 sge->addr_lo = 0;827 sge->addr_lo = 0;
794}828}
795 829
796static inline void bnx2x_add_all_napi(struct bnx2x *bp)830static inline void bnx2x_add_all_napi_cnic(struct bnx2x *bp)
797{831{
798 int i;832 int i;
799 833
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
840static inline void bnx2x_add_all_napi(struct bnx2x *bp)
841{
842 int i;
801 843
802 /* Add NAPI objects */844 /* Add NAPI objects */
803 for_each_rx_queue(bp, i)845 for_each_eth_queue(bp, i)
804 netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi),846 netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi),
805 bnx2x_poll, BNX2X_NAPI_WEIGHT);847 bnx2x_poll, BNX2X_NAPI_WEIGHT);
806}848}
807 849
850static 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
808static inline void bnx2x_del_all_napi(struct bnx2x *bp)858static inline void bnx2x_del_all_napi(struct bnx2x *bp)
809{859{
810 int i;860 int i;
811 861
812 for_each_rx_queue(bp, i)862 for_each_eth_queue(bp, i)
813 netif_napi_del(&bnx2x_fp(bp, i, napi));863 netif_napi_del(&bnx2x_fp(bp, i, napi));
814}864}
815 865
@@ -979,11 +1029,9 @@ static inline u8 bnx2x_stats_id(struct bnx2x_fastpath *fp) · 163 unmodified lines
979{1029{
980 struct bnx2x *bp = fp->bp;1030 struct bnx2x *bp = fp->bp;
981 if (!CHIP_IS_E1x(bp)) {1031 if (!CHIP_IS_E1x(bp)) {
982#ifdef BCM_CNIC
983 /* there are special statistics counters for FCoE 136..140 */1032 /* there are special statistics counters for FCoE 136..140 */
984 if (IS_FCOE_FP(fp))1033 if (IS_FCOE_FP(fp))
985 return bp->cnic_base_cl_id + (bp->pf_num >> 1);1034 return bp->cnic_base_cl_id + (bp->pf_num >> 1);
986#endif
987 return fp->cl_id;1035 return fp->cl_id;
988 }1036 }
989 return fp->cl_id + BP_PORT(bp) * FP_SB_MAX_E1x;1037 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
1102 txdata->cid, txdata->txq_index);1150 txdata->cid, txdata->txq_index);
1103}1151}
1104 1152
1105#ifdef BCM_CNIC
1106static inline u8 bnx2x_cnic_eth_cl_id(struct bnx2x *bp, u8 cl_idx)1153static inline u8 bnx2x_cnic_eth_cl_id(struct bnx2x *bp, u8 cl_idx)
1107{1154{
1108 return bp->cnic_base_cl_id + cl_idx +1155 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
1162 fp->index, bp, fp->status_blk.e2_sb, fp->cl_id, fp->fw_sb_id,1209 fp->index, bp, fp->status_blk.e2_sb, fp->cl_id, fp->fw_sb_id,
1163 fp->igu_sb_id);1210 fp->igu_sb_id);
1164}1211}
1165#endif
1166 1212
1167static inline int bnx2x_clean_tx_queue(struct bnx2x *bp,1213static inline int bnx2x_clean_tx_queue(struct bnx2x *bp,
1168 struct bnx2x_fp_txdata *txdata)1214 struct bnx2x_fp_txdata *txdata)
@@ -1280,7 +1326,7 @@ static inline bool bnx2x_mtu_allows_gro(int mtu) · 111 unmodified lines
1280 */1326 */
1281 return mtu <= SGE_PAGE_SIZE && (U_ETH_SGL_SIZE * fpp) <= MAX_SKB_FRAGS;1327 return mtu <= SGE_PAGE_SIZE && (U_ETH_SGL_SIZE * fpp) <= MAX_SKB_FRAGS;
1282}1328}
1283#ifdef BCM_CNIC1329
1284/**1330/**
1285 * bnx2x_get_iscsi_info - update iSCSI params according to licensing info.1331 * bnx2x_get_iscsi_info - update iSCSI params according to licensing info.
1286 *1332 *
@@ -1288,7 +1334,6 @@ static inline bool bnx2x_mtu_allows_gro(int mtu) · 1 unmodified line
1288 *1334 *
1289 */1335 */
1290void bnx2x_get_iscsi_info(struct bnx2x *bp);1336void bnx2x_get_iscsi_info(struct bnx2x *bp);
1291#endif
1292 1337
1293/**1338/**
1294 * bnx2x_link_sync_notify - send notification to other functions.1339 * 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
1340 1385
1341static inline bool bnx2x_is_valid_ether_addr(struct bnx2x *bp, u8 *addr)1386static inline bool bnx2x_is_valid_ether_addr(struct bnx2x *bp, u8 *addr)
1342{1387{
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))))
1344 return true;1391 return true;
1345#ifdef BCM_CNIC1392
1346 if (is_zero_ether_addr(addr) &&
1347 (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp)))
1348 return true;
1349#endif
1350 return false;1393 return false;
1351}1394}
1352 1395
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
413 413
414static void bnx2x_pfc_set_pfc(struct bnx2x *bp)414static void bnx2x_pfc_set_pfc(struct bnx2x *bp)
415{415{
416 int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
417 GET_FLAGS(SHMEM2_RD(bp, drv_flags),
418 1 << DRV_FLAGS_DCB_MFW_CONFIGURED);
416 if (bp->dcbx_port_params.pfc.enabled &&419 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))
418 /*421 /*
419 * 1. Fills up common PFC structures if required422 * 1. Fills up common PFC structures if required
420 * 2. Configure NIG, MAC and BRB via the elink423 * 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
552 555
553static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp)556static void bnx2x_dcbx_update_ets_params(struct bnx2x *bp)
554{557{
558 int mfw_configured = SHMEM2_HAS(bp, drv_flags) &&
559 GET_FLAGS(SHMEM2_RD(bp, drv_flags),
560 1 << DRV_FLAGS_DCB_MFW_CONFIGURED);
555 bnx2x_ets_disabled(&bp->link_params, &bp->link_vars);561 bnx2x_ets_disabled(&bp->link_params, &bp->link_vars);
556 562
557 if (!bp->dcbx_port_params.ets.enabled ||563 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))
559 return;565 return;
560 566
561 if (CHIP_IS_E3B0(bp))567 if (CHIP_IS_E3B0(bp))
@@ -1802,11 +1808,14 @@ static void bnx2x_dcbx_fw_struct(struct bnx2x *bp, · 1240 unmodified lines
1802 u8 cos = 0, pri = 0;1808 u8 cos = 0, pri = 0;
1803 struct priority_cos *tt2cos;1809 struct priority_cos *tt2cos;
1804 u32 *ttp = bp->dcbx_port_params.app.traffic_type_priority;1810 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);
1805 1814
1806 memset(pfc_fw_cfg, 0, sizeof(*pfc_fw_cfg));1815 memset(pfc_fw_cfg, 0, sizeof(*pfc_fw_cfg));
1807 1816
1808 /* to disable DCB - the structure must be zeroed */1817 /* 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)
1810 return;1819 return;
1811 1820
1812 /*shortcut*/1821 /*shortcut*/
@@ -1895,6 +1904,11 @@ static u8 bnx2x_dcbnl_set_state(struct net_device *netdev, u8 state) · 82 unmodified lines
1895 struct bnx2x *bp = netdev_priv(netdev);1904 struct bnx2x *bp = netdev_priv(netdev);
1896 DP(BNX2X_MSG_DCB, "state = %s\n", state ? "on" : "off");1905 DP(BNX2X_MSG_DCB, "state = %s\n", state ? "on" : "off");
1897 1906
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 }
1898 bnx2x_dcbx_set_state(bp, (state ? true : false), bp->dcbx_enabled);1912 bnx2x_dcbx_set_state(bp, (state ? true : false), bp->dcbx_enabled);
1899 return 0;1913 return 0;
1900}1914}
@@ -1908,10 +1922,10 @@ static void bnx2x_dcbnl_get_perm_hw_addr(struct net_device *netdev, · 7 unmodified lines
1908 /* first the HW mac address */1922 /* first the HW mac address */
1909 memcpy(perm_addr, netdev->dev_addr, netdev->addr_len);1923 memcpy(perm_addr, netdev->dev_addr, netdev->addr_len);
1910 1924
1911#ifdef BCM_CNIC1925 if (CNIC_LOADED(bp))
1912 /* second SAN address */1926 /* second SAN address */
1913 memcpy(perm_addr+netdev->addr_len, bp->fip_mac, netdev->addr_len);1927 memcpy(perm_addr+netdev->addr_len, bp->fip_mac,
1914#endif1928 netdev->addr_len);
1915}1929}
1916 1930
1917static void bnx2x_dcbnl_set_pg_tccfg_tx(struct net_device *netdev, int prio,1931static 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
2038 if (!bnx2x_dcbnl_set_valid(bp) || prio >= MAX_PFC_PRIORITIES)2052 if (!bnx2x_dcbnl_set_valid(bp) || prio >= MAX_PFC_PRIORITIES)
2039 return;2053 return;
2040 2054
2041 bp->dcbx_config_params.admin_pfc_bitmap |= ((setting ? 1 : 0) << prio);
2042 2055
2043 if (setting)2056 if (setting) {
2057 bp->dcbx_config_params.admin_pfc_bitmap |= (1 << prio);
2044 bp->dcbx_config_params.admin_pfc_tx_enable = 1;2058 bp->dcbx_config_params.admin_pfc_tx_enable = 1;
2059 } else {
2060 bp->dcbx_config_params.admin_pfc_bitmap &= ~(1 << prio);
2061 }
2045}2062}
2046 2063
2047static void bnx2x_dcbnl_get_pfc_cfg(struct net_device *netdev, int prio,2064static 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
2073 "Handling parity error recovery. Try again later\n");2090 "Handling parity error recovery. Try again later\n");
2074 return 1;2091 return 1;
2075 }2092 }
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);
2077 bnx2x_dcbx_init(bp, true);2097 bnx2x_dcbx_init(bp, true);
2098 }
2078 DP(BNX2X_MSG_DCB, "set_dcbx_params done (%d)\n", rc);2099 DP(BNX2X_MSG_DCB, "set_dcbx_params done (%d)\n", rc);
2079 if (rc)2100 if (rc)
2080 return 1;2101 return 1;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c+18−11
@@ -62,7 +62,9 @@ static const struct { · 61 unmodified lines
62 8, "[%s]: tpa_aggregations" },62 8, "[%s]: tpa_aggregations" },
63 { Q_STATS_OFFSET32(total_tpa_aggregated_frames_hi),63 { Q_STATS_OFFSET32(total_tpa_aggregated_frames_hi),
64 8, "[%s]: tpa_aggregated_frames"},64 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" }
66};68};
67 69
68#define BNX2X_NUM_Q_STATS ARRAY_SIZE(bnx2x_q_stats_arr)70#define BNX2X_NUM_Q_STATS ARRAY_SIZE(bnx2x_q_stats_arr)
@@ -177,6 +179,8 @@ static const struct { · 108 unmodified lines
177 4, STATS_FLAGS_FUNC, "recoverable_errors" },179 4, STATS_FLAGS_FUNC, "recoverable_errors" },
178 { STATS_OFFSET32(unrecoverable_error),180 { STATS_OFFSET32(unrecoverable_error),
179 4, STATS_FLAGS_FUNC, "unrecoverable_errors" },181 4, STATS_FLAGS_FUNC, "unrecoverable_errors" },
182 { STATS_OFFSET32(driver_filtered_tx_pkt),
183 4, STATS_FLAGS_FUNC, "driver_filtered_tx_pkt" },
180 { STATS_OFFSET32(eee_tx_lpi),184 { STATS_OFFSET32(eee_tx_lpi),
181 4, STATS_FLAGS_PORT, "Tx LPI entry count"}185 4, STATS_FLAGS_PORT, "Tx LPI entry count"}
182};186};
@@ -227,18 +231,14 @@ static int bnx2x_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) · 44 unmodified lines
227 cmd->advertising &= ~(ADVERTISED_10000baseT_Full);231 cmd->advertising &= ~(ADVERTISED_10000baseT_Full);
228 }232 }
229 233
230 if ((bp->state == BNX2X_STATE_OPEN) && (bp->link_vars.link_up)) {234 if ((bp->state == BNX2X_STATE_OPEN) && bp->link_vars.link_up &&
231 if (!(bp->flags & MF_FUNC_DIS)) {235 !(bp->flags & MF_FUNC_DIS)) {
232 ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed);
233 cmd->duplex = bp->link_vars.duplex;236 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 }
239 237
240 if (IS_MF(bp) && !BP_NOMCP(bp))238 if (IS_MF(bp) && !BP_NOMCP(bp))
241 ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp));239 ethtool_cmd_speed_set(cmd, bnx2x_get_mf_speed(bp));
240 else
241 ethtool_cmd_speed_set(cmd, bp->link_vars.line_speed);
242 } else {242 } else {
243 cmd->duplex = DUPLEX_UNKNOWN;243 cmd->duplex = DUPLEX_UNKNOWN;
244 ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN);244 ethtool_cmd_speed_set(cmd, SPEED_UNKNOWN);
@@ -2660,20 +2660,25 @@ static int bnx2x_set_phys_id(struct net_device *dev, · 2415 unmodified lines
2660 return 1; /* cycle on/off once per second */2660 return 1; /* cycle on/off once per second */
2661 2661
2662 case ETHTOOL_ID_ON:2662 case ETHTOOL_ID_ON:
2663 bnx2x_acquire_phy_lock(bp);
2663 bnx2x_set_led(&bp->link_params, &bp->link_vars,2664 bnx2x_set_led(&bp->link_params, &bp->link_vars,
2664 LED_MODE_ON, SPEED_1000);2665 LED_MODE_ON, SPEED_1000);
2666 bnx2x_release_phy_lock(bp);
2665 break;2667 break;
2666 2668
2667 case ETHTOOL_ID_OFF:2669 case ETHTOOL_ID_OFF:
2670 bnx2x_acquire_phy_lock(bp);
2668 bnx2x_set_led(&bp->link_params, &bp->link_vars,2671 bnx2x_set_led(&bp->link_params, &bp->link_vars,
2669 LED_MODE_FRONT_PANEL_OFF, 0);2672 LED_MODE_FRONT_PANEL_OFF, 0);
2670 2673 bnx2x_release_phy_lock(bp);
2671 break;2674 break;
2672 2675
2673 case ETHTOOL_ID_INACTIVE:2676 case ETHTOOL_ID_INACTIVE:
2677 bnx2x_acquire_phy_lock(bp);
2674 bnx2x_set_led(&bp->link_params, &bp->link_vars,2678 bnx2x_set_led(&bp->link_params, &bp->link_vars,
2675 LED_MODE_OPER,2679 LED_MODE_OPER,
2676 bp->link_vars.line_speed);2680 bp->link_vars.line_speed);
2681 bnx2x_release_phy_lock(bp);
2677 }2682 }
2678 2683
2679 return 0;2684 return 0;
@@ -2901,7 +2906,9 @@ static void bnx2x_get_channels(struct net_device *dev, · 221 unmodified lines
2901static void bnx2x_change_num_queues(struct bnx2x *bp, int num_rss)2906static void bnx2x_change_num_queues(struct bnx2x *bp, int num_rss)
2902{2907{
2903 bnx2x_disable_msi(bp);2908 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);
2905 bnx2x_set_int_mode(bp);2912 bnx2x_set_int_mode(bp);
2906}2913}
2907 2914
drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h+5−0
@@ -23,6 +23,11 @@ · 22 unmodified lines
23 (IRO[159].base + ((funcId) * IRO[159].m1))23 (IRO[159].base + ((funcId) * IRO[159].m1))
24#define CSTORM_FUNC_EN_OFFSET(funcId) \24#define CSTORM_FUNC_EN_OFFSET(funcId) \
25 (IRO[149].base + ((funcId) * IRO[149].m1))25 (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))
26#define CSTORM_IGU_MODE_OFFSET (IRO[157].base)31#define CSTORM_IGU_MODE_OFFSET (IRO[157].base)
27#define CSTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \32#define CSTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \
28 (IRO[316].base + ((pfId) * IRO[316].m1))33 (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
500 u32 e3_cmn_pin_cfg1; /* 0x170 */500 u32 e3_cmn_pin_cfg1; /* 0x170 */
501 #define PORT_HW_CFG_E3_OVER_CURRENT_MASK 0x000000FF501 #define PORT_HW_CFG_E3_OVER_CURRENT_MASK 0x000000FF
502 #define PORT_HW_CFG_E3_OVER_CURRENT_SHIFT 0502 #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 */
504 512
505 u32 aeu_int_mask; /* 0x190 */513 u32 aeu_int_mask; /* 0x190 */
506 514
@@ -695,6 +703,7 @@ struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */ · 188 unmodified lines
695 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54618SE 0x00000e00703 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54618SE 0x00000e00
696 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8722 0x00000f00704 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM8722 0x00000f00
697 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54616 0x00001000705 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM54616 0x00001000
706 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_BCM84834 0x00001100
698 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_FAILURE 0x0000fd00707 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_FAILURE 0x0000fd00
699 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_NOT_CONN 0x0000ff00708 #define PORT_HW_CFG_XGXS_EXT_PHY2_TYPE_NOT_CONN 0x0000ff00
700 709
@@ -751,6 +760,7 @@ struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */ · 50 unmodified lines
751 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE 0x00000e00760 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE 0x00000e00
752 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8722 0x00000f00761 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8722 0x00000f00
753 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54616 0x00001000762 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54616 0x00001000
763 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834 0x00001100
754 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT_WC 0x0000fc00764 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT_WC 0x0000fc00
755 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE 0x0000fd00765 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE 0x0000fd00
756 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN 0x0000ff00766 #define PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN 0x0000ff00
@@ -1246,6 +1256,7 @@ struct drv_func_mb { · 489 unmodified lines
1246 #define DRV_MSG_CODE_VRFY_AFEX_SUPPORTED 0xa20000001256 #define DRV_MSG_CODE_VRFY_AFEX_SUPPORTED 0xa2000000
1247 #define REQ_BC_VER_4_VRFY_AFEX_SUPPORTED 0x000700021257 #define REQ_BC_VER_4_VRFY_AFEX_SUPPORTED 0x00070002
1248 #define REQ_BC_VER_4_SFP_TX_DISABLE_SUPPORTED 0x000700141258 #define REQ_BC_VER_4_SFP_TX_DISABLE_SUPPORTED 0x00070014
1259 #define REQ_BC_VER_4_MT_SUPPORTED 0x00070201
1249 #define REQ_BC_VER_4_PFC_STATS_SUPPORTED 0x000702011260 #define REQ_BC_VER_4_PFC_STATS_SUPPORTED 0x00070201
1250 #define REQ_BC_VER_4_FCOE_FEATURES 0x000702091261 #define REQ_BC_VER_4_FCOE_FEATURES 0x00070209
1251 1262
@@ -1515,12 +1526,13 @@ enum mf_cfg_afex_vlan_mode { · 263 unmodified lines
1515/* This structure is not applicable and should not be accessed on 57711 */1526/* This structure is not applicable and should not be accessed on 57711 */
1516struct func_ext_cfg {1527struct func_ext_cfg {
1517 u32 func_cfg;1528 u32 func_cfg;
1518 #define MACP_FUNC_CFG_FLAGS_MASK 0x000000FF1529 #define MACP_FUNC_CFG_FLAGS_MASK 0x0000007F
1519 #define MACP_FUNC_CFG_FLAGS_SHIFT 01530 #define MACP_FUNC_CFG_FLAGS_SHIFT 0
1520 #define MACP_FUNC_CFG_FLAGS_ENABLED 0x000000011531 #define MACP_FUNC_CFG_FLAGS_ENABLED 0x00000001
1521 #define MACP_FUNC_CFG_FLAGS_ETHERNET 0x000000021532 #define MACP_FUNC_CFG_FLAGS_ETHERNET 0x00000002
1522 #define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x000000041533 #define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x00000004
1523 #define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x000000081534 #define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x00000008
1535 #define MACP_FUNC_CFG_PAUSE_ON_HOST_RING 0x00000080
1524 1536
1525 u32 iscsi_mac_addr_upper;1537 u32 iscsi_mac_addr_upper;
1526 u32 iscsi_mac_addr_lower;1538 u32 iscsi_mac_addr_lower;
@@ -2085,8 +2097,13 @@ struct shmem2_region { · 558 unmodified lines
2085 2097
2086 /* generic flags controlled by the driver */2098 /* generic flags controlled by the driver */
2087 u32 drv_flags;2099 u32 drv_flags;
2088 #define DRV_FLAGS_DCB_CONFIGURED 0x12100 #define DRV_FLAGS_DCB_CONFIGURED 0x0
2101 #define DRV_FLAGS_DCB_CONFIGURATION_ABORTED 0x1
2102 #define DRV_FLAGS_DCB_MFW_CONFIGURED 0x2
2089 2103
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))
2090 /* pointer to extended dev_info shared data copied from nvm image */2107 /* pointer to extended dev_info shared data copied from nvm image */
2091 u32 extended_dev_info_shared_addr;2108 u32 extended_dev_info_shared_addr;
2092 u32 ncsi_oem_data_addr;2109 u32 ncsi_oem_data_addr;
@@ -2159,6 +2176,16 @@ struct shmem2_region { · 66 unmodified lines
2159 #define SHMEM_EEE_TIME_OUTPUT_BIT 0x800000002176 #define SHMEM_EEE_TIME_OUTPUT_BIT 0x80000000
2160 2177
2161 u32 sizeof_port_stats;2178 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)
2162};2189};
2163 2190
2164 2191
@@ -4845,9 +4872,17 @@ struct vif_list_event_data { · 2680 unmodified lines
4845 __le32 reserved2;4872 __le32 reserved2;
4846};4873};
4847 4874
4848/*4875/* function update event data */
4849 * union for all event ring message types4876struct function_update_event_data {
4850 */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 */
4851union event_data {4886union event_data {
4852 struct vf_pf_event_data vf_pf_event;4887 struct vf_pf_event_data vf_pf_event;
4853 struct eth_event_data eth_event;4888 struct eth_event_data eth_event;
@@ -4855,6 +4890,7 @@ union event_data { · 1 unmodified line
4855 struct vf_flr_event_data vf_flr_event;4890 struct vf_flr_event_data vf_flr_event;
4856 struct malicious_vf_event_data malicious_vf_event;4891 struct malicious_vf_event_data malicious_vf_event;
4857 struct vif_list_event_data vif_list_event;4892 struct vif_list_event_data vif_list_event;
4893 struct function_update_event_data function_update_event;
4858};4894};
4859 4895
4860 4896
@@ -4984,8 +5020,10 @@ struct function_update_data { · 123 unmodified lines
4984 u8 allowed_priorities;5020 u8 allowed_priorities;
4985 u8 network_cos_mode;5021 u8 network_cos_mode;
4986 u8 lb_mode_en;5022 u8 lb_mode_en;
4987 u8 reserved0;5023 u8 tx_switch_suspend_change_flg;
4988 __le32 reserved1;5024 u8 tx_switch_suspend;
5025 u8 echo;
5026 __le16 reserved1;
4989};5027};
4990 5028
4991 5029
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
648 return rc;648 return rc;
649}649}
650 650
651static 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
651static int bnx2x_ilt_mem_op(struct bnx2x *bp, u8 memop)663static int bnx2x_ilt_mem_op(struct bnx2x *bp, u8 memop)
652{664{
653 int rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_CDU, memop);665 int rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_CDU, memop);
654 if (!rc)666 if (!rc)
655 rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_QM, memop);667 rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_QM, memop);
656 if (!rc)668 if (!rc && CNIC_SUPPORT(bp) && !CONFIGURE_NIC_MODE(bp))
657 rc = bnx2x_ilt_client_mem_op(bp, ILT_CLIENT_SRC, memop);669 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);
660 670
661 return rc;671 return rc;
662}672}
@@ -781,12 +791,19 @@ static void bnx2x_ilt_client_id_init_op(struct bnx2x *bp, · 118 unmodified lines
781 bnx2x_ilt_client_init_op(bp, ilt_cli, initop);791 bnx2x_ilt_client_init_op(bp, ilt_cli, initop);
782}792}
783 793
794static 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
784static void bnx2x_ilt_init_op(struct bnx2x *bp, u8 initop)801static void bnx2x_ilt_init_op(struct bnx2x *bp, u8 initop)
785{802{
786 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_CDU, initop);803 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_CDU, initop);
787 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_QM, initop);804 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_QM, initop);
788 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_SRC, initop);805 if (CNIC_SUPPORT(bp) && !CONFIGURE_NIC_MODE(bp))
789 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_TM, initop);806 bnx2x_ilt_client_id_init_op(bp, ILT_CLIENT_SRC, initop);
790}807}
791 808
792static void bnx2x_ilt_init_client_psz(struct bnx2x *bp, int cli_num,809static 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
890/****************************************************************************907/****************************************************************************
891* SRC initializations908* SRC initializations
892****************************************************************************/909****************************************************************************/
893#ifdef BCM_CNIC
894/* called during init func stage */910/* called during init func stage */
895static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2,911static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2,
896 dma_addr_t t2_mapping, int src_cid_count)912 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
915 U64_HI((u64)t2_mapping +931 U64_HI((u64)t2_mapping +
916 (src_cid_count-1) * sizeof(struct src_ent)));932 (src_cid_count-1) * sizeof(struct src_ent)));
917}933}
918#endif
919#endif /* BNX2X_INIT_OPS_H */934#endif /* BNX2X_INIT_OPS_H */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c+653−338
@@ -121,6 +121,7 @@ · 120 unmodified lines
121#define GP_STATUS_10G_XFI MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_10G_XFI121#define GP_STATUS_10G_XFI MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_10G_XFI
122#define GP_STATUS_20G_DXGXS MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_20G_DXGXS122#define GP_STATUS_20G_DXGXS MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_20G_DXGXS
123#define GP_STATUS_10G_SFI MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_10G_SFI123#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
124#define LINK_10THD LINK_STATUS_SPEED_AND_DUPLEX_10THD125#define LINK_10THD LINK_STATUS_SPEED_AND_DUPLEX_10THD
125#define LINK_10TFD LINK_STATUS_SPEED_AND_DUPLEX_10TFD126#define LINK_10TFD LINK_STATUS_SPEED_AND_DUPLEX_10TFD
126#define LINK_100TXHD LINK_STATUS_SPEED_AND_DUPLEX_100TXHD127#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
253 if (!(link_status & LINK_STATUS_LINK_UP))254 if (!(link_status & LINK_STATUS_LINK_UP))
254 return LFA_LINK_DOWN;255 return LFA_LINK_DOWN;
255 256
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
256 /* Verify that loopback mode is not set */263 /* Verify that loopback mode is not set */
257 if (params->loopback_mode)264 if (params->loopback_mode)
258 return LFA_LOOPBACK_ENABLED;265 return LFA_LOOPBACK_ENABLED;
@@ -1440,30 +1447,47 @@ void bnx2x_pfc_statistic(struct link_params *params, struct link_vars *vars, · 1181 unmodified lines
1440/******************************************************************/1447/******************************************************************/
1441/* MAC/PBF section */1448/* MAC/PBF section */
1442/******************************************************************/1449/******************************************************************/
1443static void bnx2x_set_mdio_clk(struct bnx2x *bp, u32 chip_id, u8 port)1450static void bnx2x_set_mdio_clk(struct bnx2x *bp, u32 chip_id,
1451 u32 emac_base)
1444{1452{
1445 u32 mode, emac_base;1453 u32 new_mode, cur_mode;
1454 u32 clc_cnt;
1446 /* Set clause 45 mode, slow down the MDIO clock to 2.5MHz1455 /* Set clause 45 mode, slow down the MDIO clock to 2.5MHz
1447 * (a value of 49==0x31) and make sure that the AUTO poll is off1456 * (a value of 49==0x31) and make sure that the AUTO poll is off
1448 */1457 */
1458 cur_mode = REG_RD(bp, emac_base + EMAC_REG_EMAC_MDIO_MODE);
1449 1459
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);
1457 if (USES_WARPCORE(bp))1460 if (USES_WARPCORE(bp))
1458 mode |= (74L << EMAC_MDIO_MODE_CLOCK_CNT_BITSHIFT);1461 clc_cnt = 74L << EMAC_MDIO_MODE_CLOCK_CNT_BITSHIFT;
1459 else1462 else
1460 mode |= (49L << EMAC_MDIO_MODE_CLOCK_CNT_BITSHIFT);1463 clc_cnt = 49L << EMAC_MDIO_MODE_CLOCK_CNT_BITSHIFT;
1461 1464
1462 mode |= (EMAC_MDIO_MODE_CLAUSE_45);1465 if (((cur_mode & EMAC_MDIO_MODE_CLOCK_CNT) == clc_cnt) &&
1463 REG_WR(bp, emac_base + EMAC_REG_EMAC_MDIO_MODE, mode);1466 (cur_mode & (EMAC_MDIO_MODE_CLAUSE_45)))
1467 return;
1464 1468
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);
1465 udelay(40);1477 udelay(40);
1466}1478}
1479
1480static 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
1467static u8 bnx2x_is_4_port_mode(struct bnx2x *bp)1491static u8 bnx2x_is_4_port_mode(struct bnx2x *bp)
1468{1492{
1469 u32 port4mode_ovwr_val;1493 u32 port4mode_ovwr_val;
@@ -1508,7 +1532,8 @@ static void bnx2x_emac_init(struct link_params *params, · 38 unmodified lines
1508 }1532 }
1509 timeout--;1533 timeout--;
1510 } while (val & EMAC_MODE_RESET);1534 } 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);
1512 /* Set mac address */1537 /* Set mac address */
1513 val = ((params->mac_addr[0] << 8) |1538 val = ((params->mac_addr[0] << 8) |
1514 params->mac_addr[1]);1539 params->mac_addr[1]);
@@ -1664,7 +1689,10 @@ static void bnx2x_xmac_init(struct link_params *params, u32 max_speed) · 149 unmodified lines
1664 * ports of the path1689 * ports of the path
1665 */1690 */
1666 1691
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 &&
1668 (REG_RD(bp, MISC_REG_RESET_REG_2) &1696 (REG_RD(bp, MISC_REG_RESET_REG_2) &
1669 MISC_REGISTERS_RESET_REG_2_XMAC)) {1697 MISC_REGISTERS_RESET_REG_2_XMAC)) {
1670 DP(NETIF_MSG_LINK,1698 DP(NETIF_MSG_LINK,
@@ -1760,6 +1788,18 @@ static int bnx2x_xmac_enable(struct link_params *params, · 89 unmodified lines
1760 */1788 */
1761 REG_WR(bp, NIG_REG_EGRESS_EMAC0_PORT + params->port*4, 0);1789 REG_WR(bp, NIG_REG_EGRESS_EMAC0_PORT + params->port*4, 0);
1762 1790
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 }
1763 /* Set Max packet size */1803 /* Set Max packet size */
1764 REG_WR(bp, xmac_base + XMAC_REG_RX_MAX_SIZE, 0x2710);1804 REG_WR(bp, xmac_base + XMAC_REG_RX_MAX_SIZE, 0x2710);
1765 1805
@@ -1780,6 +1820,12 @@ static int bnx2x_xmac_enable(struct link_params *params, · 14 unmodified lines
1780 /* Enable TX and RX */1820 /* Enable TX and RX */
1781 val = XMAC_CTRL_REG_TX_EN | XMAC_CTRL_REG_RX_EN;1821 val = XMAC_CTRL_REG_TX_EN | XMAC_CTRL_REG_RX_EN;
1782 1822
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
1783 /* Check loopback mode */1829 /* Check loopback mode */
1784 if (lb)1830 if (lb)
1785 val |= XMAC_CTRL_REG_LINE_LOCAL_LPBK;1831 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
2096 port_mb[params->port].link_status), link_status);2142 port_mb[params->port].link_status), link_status);
2097}2143}
2098 2144
2145static 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
2099static void bnx2x_update_pfc_nig(struct link_params *params,2155static void bnx2x_update_pfc_nig(struct link_params *params,
2100 struct link_vars *vars,2156 struct link_vars *vars,
2101 struct bnx2x_nig_brb_pfc_port_params *nig_params)2157 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
2126 if (CHIP_IS_E3(bp))2182 if (CHIP_IS_E3(bp))
2127 ppp_enable = 0;2183 ppp_enable = 0;
2128 else2184 else
2129 ppp_enable = 1;2185 ppp_enable = 1;
2130 xcm_mask &= ~(port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN :2186 xcm_mask &= ~(port ? NIG_LLH1_XCM_MASK_REG_LLH1_XCM_MASK_BCN :
2131 NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN);2187 NIG_LLH0_XCM_MASK_REG_LLH0_XCM_MASK_BCN);
2132 xcm_out_en = 0;2188 xcm_out_en = 0;
@@ -2247,7 +2303,6 @@ int bnx2x_update_pfc(struct link_params *params, · 114 unmodified lines
2247 return bnx2x_status;2303 return bnx2x_status;
2248}2304}
2249 2305
2250
2251static int bnx2x_bmac1_enable(struct link_params *params,2306static int bnx2x_bmac1_enable(struct link_params *params,
2252 struct link_vars *vars,2307 struct link_vars *vars,
2253 u8 is_lb)2308 u8 is_lb)
@@ -2651,6 +2706,13 @@ static int bnx2x_cl45_read(struct bnx2x *bp, struct bnx2x_phy *phy, · 397 unmodified lines
2651 u32 val;2706 u32 val;
2652 u16 i;2707 u16 i;
2653 int rc = 0;2708 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
2654 if (phy->flags & FLAGS_MDC_MDIO_WA_B0)2716 if (phy->flags & FLAGS_MDC_MDIO_WA_B0)
2655 bnx2x_bits_en(bp, phy->mdio_ctrl + EMAC_REG_EMAC_MDIO_STATUS,2717 bnx2x_bits_en(bp, phy->mdio_ctrl + EMAC_REG_EMAC_MDIO_STATUS,
2656 EMAC_MDIO_STATUS_10MB);2718 EMAC_MDIO_STATUS_10MB);
@@ -2719,6 +2781,13 @@ static int bnx2x_cl45_write(struct bnx2x *bp, struct bnx2x_phy *phy, · 62 unmodified lines
2719 u32 tmp;2781 u32 tmp;
2720 u8 i;2782 u8 i;
2721 int rc = 0;2783 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
2722 if (phy->flags & FLAGS_MDC_MDIO_WA_B0)2791 if (phy->flags & FLAGS_MDC_MDIO_WA_B0)
2723 bnx2x_bits_en(bp, phy->mdio_ctrl + EMAC_REG_EMAC_MDIO_STATUS,2792 bnx2x_bits_en(bp, phy->mdio_ctrl + EMAC_REG_EMAC_MDIO_STATUS,
2724 EMAC_MDIO_STATUS_10MB);2793 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
3147 bnx2x_cl45_write(bp, phy, devad, reg, val | or_val);3216 bnx2x_cl45_write(bp, phy, devad, reg, val | or_val);
3148}3217}
3149 3218
3219static 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
3150int bnx2x_phy_read(struct link_params *params, u8 phy_addr,3228int bnx2x_phy_read(struct link_params *params, u8 phy_addr,
3151 u8 devad, u16 reg, u16 *ret_val)3229 u8 devad, u16 reg, u16 *ret_val)
3152{3230{
@@ -3551,6 +3629,44 @@ static u8 bnx2x_ext_phy_resolve_fc(struct bnx2x_phy *phy, · 398 unmodified lines
3551 * init configuration, and set/clear SGMII flag. Internal3629 * init configuration, and set/clear SGMII flag. Internal
3552 * phy init is done purely in phy_init stage.3630 * phy init is done purely in phy_init stage.
3553 */3631 */
3632static 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}
3554 3670
3555static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy,3671static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy,
3556 struct link_params *params)3672 struct link_params *params)
@@ -3564,6 +3680,21 @@ static void bnx2x_warpcore_set_lpi_passthrough(struct bnx2x_phy *phy, · 7 unmodified lines
3564 MDIO_WC_REG_DIGITAL4_MISC5, 0xc000);3680 MDIO_WC_REG_DIGITAL4_MISC5, 0xc000);
3565}3681}
3566 3682
3683static 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
3567static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,3698static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
3568 struct link_params *params,3699 struct link_params *params,
3569 struct link_vars *vars) {3700 struct link_vars *vars) {
@@ -3576,7 +3707,9 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 6 unmodified lines
3576 {MDIO_WC_DEVAD, MDIO_WC_REG_RX66_CONTROL, 0x7415},3707 {MDIO_WC_DEVAD, MDIO_WC_REG_RX66_CONTROL, 0x7415},
3577 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_MISC2, 0x6190},3708 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_MISC2, 0x6190},
3578 /* Disable Autoneg: re-enable it after adv is done. */3709 /* 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},
3580 };3713 };
3581 DP(NETIF_MSG_LINK, "Enable Auto Negotiation for KR\n");3714 DP(NETIF_MSG_LINK, "Enable Auto Negotiation for KR\n");
3582 /* Set to default registers that may be overriden by 10G force */3715 /* 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
3585 reg_set[i].val);3718 reg_set[i].val);
3586 3719
3587 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,3720 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3588 MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, &cl72_ctrl);3721 MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, &cl72_ctrl);
3589 cl72_ctrl &= 0xf8ff;3722 cl72_ctrl &= 0x08ff;
3590 cl72_ctrl |= 0x3800;3723 cl72_ctrl |= 0x3800;
3591 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,3724 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);
3593 3726
3594 /* Check adding advertisement for 1G KX */3727 /* Check adding advertisement for 1G KX */
3595 if (((vars->line_speed == SPEED_AUTO_NEG) &&3728 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
3624 ((0x02 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) |3757 ((0x02 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) |
3625 (0x06 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) |3758 (0x06 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) |
3626 (0x09 << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET)));3759 (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)));
3627 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,3770 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3628 MDIO_WC_REG_CL72_USERB0_CL72_OS_DEF_CTRL,3771 MDIO_WC_REG_CL72_USERB0_CL72_OS_DEF_CTRL,
3629 0x03f0);3772 0x03f0);
@@ -3670,10 +3813,26 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 40 unmodified lines
3670 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,3813 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3671 MDIO_WC_REG_DIGITAL3_UP1, 0x1f);3814 MDIO_WC_REG_DIGITAL3_UP1, 0x1f);
3672 3815
3673 /* Enable Autoneg */3816 if (((phy->req_line_speed == SPEED_AUTO_NEG) &&
3674 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD,3817 (phy->speed_cap_mask & PORT_HW_CFG_SPEED_CAPABILITY_D0_20G)) ||
3675 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x1200);3818 (phy->req_line_speed == SPEED_20000)) {
3676 3819
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);
3677}3836}
3678 3837
3679static void bnx2x_warpcore_set_10G_KR(struct bnx2x_phy *phy,3838static 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
3692 {MDIO_WC_DEVAD, MDIO_WC_REG_DIGITAL3_UP1, 0x1},3851 {MDIO_WC_DEVAD, MDIO_WC_REG_DIGITAL3_UP1, 0x1},
3693 {MDIO_WC_DEVAD, MDIO_WC_REG_DIGITAL5_MISC7, 0xa},3852 {MDIO_WC_DEVAD, MDIO_WC_REG_DIGITAL5_MISC7, 0xa},
3694 /* Leave cl72 training enable, needed for KR */3853 /* Leave cl72 training enable, needed for KR */
3695 {MDIO_PMA_DEVAD,3854 {MDIO_PMA_DEVAD, MDIO_WC_REG_PMD_KR_CONTROL, 0x2}
3696 MDIO_WC_REG_PMD_IEEE9BLK_TENGBASE_KR_PMD_CONTROL_REGISTER_150,
3697 0x2}
3698 };3855 };
3699 3856
3700 for (i = 0; i < sizeof(reg_set)/sizeof(struct bnx2x_reg_set); i++)3857 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
3764 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_CTRL, 0);3921 bnx2x_cl45_write(bp, phy, MDIO_AN_DEVAD, MDIO_AN_REG_CTRL, 0);
3765 3922
3766 /* Disable 100FX Enable and Auto-Detect */3923 /* Disable 100FX Enable and Auto-Detect */
3767 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,3924 bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
3768 MDIO_WC_REG_FX100_CTRL1, &val);3925 MDIO_WC_REG_FX100_CTRL1, 0xFFFA);
3769 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3770 MDIO_WC_REG_FX100_CTRL1, (val & 0xFFFA));
3771 3926
3772 /* Disable 100FX Idle detect */3927 /* Disable 100FX Idle detect */
3773 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,3928 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
3774 MDIO_WC_REG_FX100_CTRL3, 0x0080);3929 MDIO_WC_REG_FX100_CTRL3, 0x0080);
3775 3930
3776 /* Set Block address to Remote PHY & Clear forced_speed[5] */3931 /* Set Block address to Remote PHY & Clear forced_speed[5] */
3777 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,3932 bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
3778 MDIO_WC_REG_DIGITAL4_MISC3, &val);3933 MDIO_WC_REG_DIGITAL4_MISC3, 0xFF7F);
3779 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3780 MDIO_WC_REG_DIGITAL4_MISC3, (val & 0xFF7F));
3781 3934
3782 /* Turn off auto-detect & fiber mode */3935 /* Turn off auto-detect & fiber mode */
3783 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,3936 bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
3784 MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1, &val);3937 MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1,
3785 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,3938 0xFFEE);
3786 MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1,
3787 (val & 0xFFEE));
3788 3939
3789 /* Set filter_force_link, disable_false_link and parallel_detect */3940 /* Set filter_force_link, disable_false_link and parallel_detect */
3790 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,3941 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
3846 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x100);3997 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x100);
3847 3998
3848 /* Release tx_fifo_reset */3999 /* 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
4008static 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 */
3849 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,4028 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);
3851 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,4032 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));
3853 4041
3854 /* Release rxSeqStart */
3855 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,4042 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);
3857 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,4046 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3858 MDIO_WC_REG_DSC2B0_DSC_MISC_CTRL0, (val & 0x7FFF));4047 MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL, val);
3859}4048 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4049 MDIO_WC_REG_CL72_USERB0_CL72_TX_FIR_TAP, 0x835A);
3860 4050
3861static void bnx2x_warpcore_set_20G_KR2(struct bnx2x *bp,4051 /* Enable sequencer (over lane 0) */
3862 struct bnx2x_phy *phy)4052 CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
3863{4053 MDIO_AER_BLOCK_AER_REG, 0);
3864 DP(NETIF_MSG_LINK, "KR2 still not supported !!!\n");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);
3865}4059}
3866 4060
3867static void bnx2x_warpcore_set_20G_DXGXS(struct bnx2x *bp,4061static 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
3931 u16 val16, digctrl_kx1, digctrl_kx2;4125 u16 val16, digctrl_kx1, digctrl_kx2;
3932 4126
3933 /* Clear XFI clock comp in non-10G single lane mode. */4127 /* Clear XFI clock comp in non-10G single lane mode. */
3934 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,4128 bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
3935 MDIO_WC_REG_RX66_CONTROL, &val16);4129 MDIO_WC_REG_RX66_CONTROL, ~(3<<13));
3936 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3937 MDIO_WC_REG_RX66_CONTROL, val16 & ~(3<<13));
3938 4130
3939 bnx2x_warpcore_set_lpi_passthrough(phy, params);4131 bnx2x_warpcore_set_lpi_passthrough(phy, params);
3940 4132
3941 if (always_autoneg || phy->req_line_speed == SPEED_AUTO_NEG) {4133 if (always_autoneg || phy->req_line_speed == SPEED_AUTO_NEG) {
3942 /* SGMII Autoneg */4134 /* SGMII Autoneg */
3943 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,4135 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
3944 MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16);4136 MDIO_WC_REG_COMBO_IEEE0_MIICTRL,
3945 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,4137 0x1000);
3946 MDIO_WC_REG_COMBO_IEEE0_MIICTRL,
3947 val16 | 0x1000);
3948 DP(NETIF_MSG_LINK, "set SGMII AUTONEG\n");4138 DP(NETIF_MSG_LINK, "set SGMII AUTONEG\n");
3949 } else {4139 } else {
3950 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,4140 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
4086 if ((cfg_pin < PIN_CFG_GPIO0_P0) ||4276 if ((cfg_pin < PIN_CFG_GPIO0_P0) ||
4087 (cfg_pin > PIN_CFG_GPIO3_P1)) {4277 (cfg_pin > PIN_CFG_GPIO3_P1)) {
4088 DP(NETIF_MSG_LINK,4278 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",
4090 cfg_pin);4280 cfg_pin);
4091 return -EINVAL;4281 return -EINVAL;
4092 }4282 }
@@ -4097,7 +4287,7 @@ static int bnx2x_get_mod_abs_int_cfg(struct bnx2x *bp, · 4 unmodified lines
4097 *gpio_num = MISC_REGISTERS_GPIO_3;4287 *gpio_num = MISC_REGISTERS_GPIO_3;
4098 *gpio_port = port;4288 *gpio_port = port;
4099 }4289 }
4100 DP(NETIF_MSG_LINK, "MOD_ABS int GPIO%d_P%d\n", *gpio_num, *gpio_port);4290
4101 return 0;4291 return 0;
4102}4292}
4103 4293
@@ -4120,7 +4310,7 @@ static int bnx2x_is_sfp_module_plugged(struct bnx2x_phy *phy, · 16 unmodified lines
4120 return 0;4310 return 0;
4121}4311}
4122static int bnx2x_warpcore_get_sigdet(struct bnx2x_phy *phy,4312static int bnx2x_warpcore_get_sigdet(struct bnx2x_phy *phy,
4123 struct link_params *params)4313 struct link_params *params)
4124{4314{
4125 u16 gp2_status_reg0, lane;4315 u16 gp2_status_reg0, lane;
4126 struct bnx2x *bp = params->bp;4316 struct bnx2x *bp = params->bp;
@@ -4134,8 +4324,8 @@ static int bnx2x_warpcore_get_sigdet(struct bnx2x_phy *phy, · 7 unmodified lines
4134}4324}
4135 4325
4136static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy,4326static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy,
4137 struct link_params *params,4327 struct link_params *params,
4138 struct link_vars *vars)4328 struct link_vars *vars)
4139{4329{
4140 struct bnx2x *bp = params->bp;4330 struct bnx2x *bp = params->bp;
4141 u32 serdes_net_if;4331 u32 serdes_net_if;
@@ -4163,7 +4353,7 @@ static void bnx2x_warpcore_config_runtime(struct bnx2x_phy *phy, · 21 unmodified lines
4163 case PORT_HW_CFG_NET_SERDES_IF_KR:4353 case PORT_HW_CFG_NET_SERDES_IF_KR:
4164 /* Do we get link yet? */4354 /* Do we get link yet? */
4165 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD, 0x81d1,4355 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD, 0x81d1,
4166 &gp_status1);4356 &gp_status1);
4167 lnkup = (gp_status1 >> (8+lane)) & 0x1;/* 1G */4357 lnkup = (gp_status1 >> (8+lane)) & 0x1;/* 1G */
4168 /*10G KR*/4358 /*10G KR*/
4169 lnkup_kr = (gp_status1 >> (12+lane)) & 0x1;4359 lnkup_kr = (gp_status1 >> (12+lane)) & 0x1;
@@ -4215,6 +4405,27 @@ static void bnx2x_warpcore_config_sfi(struct bnx2x_phy *phy, · 45 unmodified lines
4215 }4405 }
4216}4406}
4217 4407
4408static 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
4218static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy,4429static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy,
4219 struct link_params *params,4430 struct link_params *params,
4220 struct link_vars *vars)4431 struct link_vars *vars)
@@ -4275,9 +4486,14 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, · 54 unmodified lines
4275 break;4486 break;
4276 4487
4277 case PORT_HW_CFG_NET_SERDES_IF_SFI:4488 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 */
4279 if (bnx2x_is_sfp_module_plugged(phy, params))4493 if (bnx2x_is_sfp_module_plugged(phy, params))
4280 bnx2x_sfp_module_detection(phy, params);4494 bnx2x_sfp_module_detection(phy, params);
4495 else
4496 bnx2x_sfp_e3_set_transmitter(params, phy, 1);
4281 4497
4282 bnx2x_warpcore_config_sfi(phy, params);4498 bnx2x_warpcore_config_sfi(phy, params);
4283 break;4499 break;
@@ -4293,16 +4509,14 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, · 9 unmodified lines
4293 4509
4294 bnx2x_sfp_module_detection(phy, params);4510 bnx2x_sfp_module_detection(phy, params);
4295 break;4511 break;
4296
4297 case PORT_HW_CFG_NET_SERDES_IF_KR2:4512 case PORT_HW_CFG_NET_SERDES_IF_KR2:
4298 if (vars->line_speed != SPEED_20000) {4513 if (!params->loopback_mode) {
4299 DP(NETIF_MSG_LINK, "Speed not supported yet\n");4514 bnx2x_warpcore_enable_AN_KR(phy, params, vars);
4300 return;4515 } else {
4516 DP(NETIF_MSG_LINK, "Setting KR 20G-Force\n");
4517 bnx2x_warpcore_set_20G_force_KR2(phy, params);
4301 }4518 }
4302 DP(NETIF_MSG_LINK, "Setting 20G KR2\n");
4303 bnx2x_warpcore_set_20G_KR2(bp, phy);
4304 break;4519 break;
4305
4306 default:4520 default:
4307 DP(NETIF_MSG_LINK,4521 DP(NETIF_MSG_LINK,
4308 "Unsupported Serdes Net Interface 0x%x\n",4522 "Unsupported Serdes Net Interface 0x%x\n",
@@ -4316,68 +4530,35 @@ static void bnx2x_warpcore_config_init(struct bnx2x_phy *phy, · 7 unmodified lines
4316 DP(NETIF_MSG_LINK, "Exit config init\n");4530 DP(NETIF_MSG_LINK, "Exit config init\n");
4317}4531}
4318 4532
4319static 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
4340static void bnx2x_warpcore_link_reset(struct bnx2x_phy *phy,4533static void bnx2x_warpcore_link_reset(struct bnx2x_phy *phy,
4341 struct link_params *params)4534 struct link_params *params)
4342{4535{
4343 struct bnx2x *bp = params->bp;4536 struct bnx2x *bp = params->bp;
4344 u16 val16, lane;4537 u16 val16, lane;
4345 bnx2x_sfp_e3_set_transmitter(params, phy, 0);4538 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);
4347 bnx2x_set_aer_mmd(params, phy);4540 bnx2x_set_aer_mmd(params, phy);
4348 /* Global register */4541 /* Global register */
4349 bnx2x_warpcore_reset_lane(bp, phy, 1);4542 bnx2x_warpcore_reset_lane(bp, phy, 1);
4350 4543
4351 /* Clear loopback settings (if any) */4544 /* Clear loopback settings (if any) */
4352 /* 10G & 20G */4545 /* 10G & 20G */
4353 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,4546 bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4354 MDIO_WC_REG_COMBO_IEEE0_MIICTRL, &val16);4547 MDIO_WC_REG_COMBO_IEEE0_MIICTRL, 0xBFFF);
4355 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4356 MDIO_WC_REG_COMBO_IEEE0_MIICTRL, val16 &
4357 0xBFFF);
4358 4548
4359 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,4549 bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4360 MDIO_WC_REG_IEEE0BLK_MIICNTL, &val16);4550 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0xfffe);
4361 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4362 MDIO_WC_REG_IEEE0BLK_MIICNTL, val16 & 0xfffe);
4363 4551
4364 /* Update those 1-copy registers */4552 /* Update those 1-copy registers */
4365 CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,4553 CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,
4366 MDIO_AER_BLOCK_AER_REG, 0);4554 MDIO_AER_BLOCK_AER_REG, 0);
4367 /* Enable 1G MDIO (1-copy) */4555 /* Enable 1G MDIO (1-copy) */
4368 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,4556 bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4369 MDIO_WC_REG_XGXSBLK0_XGXSCONTROL,4557 MDIO_WC_REG_XGXSBLK0_XGXSCONTROL,
4370 &val16);4558 ~0x10);
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);
4380 4559
4560 bnx2x_cl45_read_and_write(bp, phy, MDIO_WC_DEVAD,
4561 MDIO_WC_REG_XGXSBLK1_LANECTRL2, 0xff00);
4381 lane = bnx2x_get_warpcore_lane(phy, params);4562 lane = bnx2x_get_warpcore_lane(phy, params);
4382 /* Disable CL36 PCS Tx */4563 /* Disable CL36 PCS Tx */
4383 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,4564 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
4413 DP(NETIF_MSG_LINK, "Setting Warpcore loopback type %x, speed %d\n",4594 DP(NETIF_MSG_LINK, "Setting Warpcore loopback type %x, speed %d\n",
4414 params->loopback_mode, phy->req_line_speed);4595 params->loopback_mode, phy->req_line_speed);
4415 4596
4416 if (phy->req_line_speed < SPEED_10000) {4597 if (phy->req_line_speed < SPEED_10000 ||
4417 /* 10/100/1000 */4598 phy->supported & SUPPORTED_20000baseKR2_Full) {
4599 /* 10/100/1000/20G-KR2 */
4418 4600
4419 /* Update those 1-copy registers */4601 /* Update those 1-copy registers */
4420 CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK,4602 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
4427 lane = bnx2x_get_warpcore_lane(phy, params);4609 lane = bnx2x_get_warpcore_lane(phy, params);
4428 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,4610 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
4429 MDIO_WC_REG_XGXSBLK1_LANECTRL2, &val16);4611 MDIO_WC_REG_XGXSBLK1_LANECTRL2, &val16);
4612 val16 |= (1<<lane);
4613 if (phy->flags & FLAGS_WC_DUAL_MODE)
4614 val16 |= (2<<lane);
4430 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,4615 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4431 MDIO_WC_REG_XGXSBLK1_LANECTRL2,4616 MDIO_WC_REG_XGXSBLK1_LANECTRL2,
4432 val16 | (1<<lane));4617 val16);
4433 4618
4434 /* Switch back to 4-copy registers */4619 /* Switch back to 4-copy registers */
4435 bnx2x_set_aer_mmd(params, phy);4620 bnx2x_set_aer_mmd(params, phy);
4436 } else {4621 } else {
4437 /* 10G & 20G */4622 /* 10G / 20G-DXGXS */
4438 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,4623 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
4439 MDIO_WC_REG_COMBO_IEEE0_MIICTRL,4624 MDIO_WC_REG_COMBO_IEEE0_MIICTRL,
4440 0x4000);4625 0x4000);
4441
4442 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,4626 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
4443 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x1);4627 MDIO_WC_REG_IEEE0BLK_MIICNTL, 0x1);
4444 }4628 }
@@ -4603,6 +4787,10 @@ void bnx2x_link_status_update(struct link_params *params, · 158 unmodified lines
4603 params->feature_config_flags &=4787 params->feature_config_flags &=
4604 ~FEATURE_CONFIG_PFC_ENABLED;4788 ~FEATURE_CONFIG_PFC_ENABLED;
4605 4789
4790 if (SHMEM2_HAS(bp, link_attr_sync))
4791 vars->link_attr_sync = SHMEM2_RD(bp,
4792 link_attr_sync[params->port]);
4793
4606 DP(NETIF_MSG_LINK, "link_status 0x%x phy_link_up %x int_mask 0x%x\n",4794 DP(NETIF_MSG_LINK, "link_status 0x%x phy_link_up %x int_mask 0x%x\n",
4607 vars->link_status, vars->phy_link_up, vars->aeu_int_mask);4795 vars->link_status, vars->phy_link_up, vars->aeu_int_mask);
4608 DP(NETIF_MSG_LINK, "line_speed %x duplex %x flow_ctrl 0x%x\n",4796 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
5332 vars->link_status |= LINK_10GTFD;5520 vars->link_status |= LINK_10GTFD;
5333 break;5521 break;
5334 case GP_STATUS_20G_DXGXS:5522 case GP_STATUS_20G_DXGXS:
5523 case GP_STATUS_20G_KR2:
5335 vars->line_speed = SPEED_20000;5524 vars->line_speed = SPEED_20000;
5336 vars->link_status |= LINK_20GTFD;5525 vars->link_status |= LINK_20GTFD;
5337 break;5526 break;
@@ -5439,7 +5628,15 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, · 101 unmodified lines
5439 int rc = 0;5628 int rc = 0;
5440 lane = bnx2x_get_warpcore_lane(phy, params);5629 lane = bnx2x_get_warpcore_lane(phy, params);
5441 /* Read gp_status */5630 /* 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)) {
5443 u16 temp_link_up;5640 u16 temp_link_up;
5444 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,5641 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
5445 1, &temp_link_up);5642 1, &temp_link_up);
@@ -5452,12 +5649,22 @@ static int bnx2x_warpcore_read_status(struct bnx2x_phy *phy, · 6 unmodified lines
5452 bnx2x_ext_phy_resolve_fc(phy, params, vars);5649 bnx2x_ext_phy_resolve_fc(phy, params, vars);
5453 } else {5650 } else {
5454 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,5651 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);
5456 DP(NETIF_MSG_LINK, "0x81d1 = 0x%x\n", gp_status1);5654 DP(NETIF_MSG_LINK, "0x81d1 = 0x%x\n", gp_status1);
5457 /* Check for either KR or generic link up. */5655 /* Check for either KR, 1G, or AN up. */
5458 gp_status1 = ((gp_status1 >> 8) & 0xf) |5656 link_up = ((gp_status1 >> 8) |
5459 ((gp_status1 >> 12) & 0xf);5657 (gp_status1 >> 12) |
5460 link_up = gp_status1 & (1 << lane);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 }
5461 if (link_up && SINGLE_MEDIA_DIRECT(params)) {5668 if (link_up && SINGLE_MEDIA_DIRECT(params)) {
5462 u16 pd, gp_status4;5669 u16 pd, gp_status4;
5463 if (phy->req_line_speed == SPEED_AUTO_NEG) {5670 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
5522 if ((lane & 1) == 0)5729 if ((lane & 1) == 0)
5523 gp_speed <<= 8;5730 gp_speed <<= 8;
5524 gp_speed &= 0x3f00;5731 gp_speed &= 0x3f00;
5525 5732 link_up = !!link_up;
5526 5733
5527 rc = bnx2x_get_link_speed_duplex(phy, params, vars, link_up, gp_speed,5734 rc = bnx2x_get_link_speed_duplex(phy, params, vars, link_up, gp_speed,
5528 duplex);5735 duplex);
@@ -6683,7 +6890,7 @@ int bnx2x_link_update(struct link_params *params, struct link_vars *vars) · 1154 unmodified lines
6683 } else if (prev_line_speed != vars->line_speed) {6890 } else if (prev_line_speed != vars->line_speed) {
6684 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4,6891 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4,
6685 0);6892 0);
6686 usleep_range(1000, 2000);6893 usleep_range(1000, 2000);
6687 }6894 }
6688 }6895 }
6689 6896
@@ -6753,7 +6960,7 @@ void bnx2x_ext_phy_hw_reset(struct bnx2x *bp, u8 port) · 63 unmodified lines
6753{6960{
6754 bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_1,6961 bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_1,
6755 MISC_REGISTERS_GPIO_OUTPUT_LOW, port);6962 MISC_REGISTERS_GPIO_OUTPUT_LOW, port);
6756 usleep_range(1000, 2000);6963 usleep_range(1000, 2000);
6757 bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_1,6964 bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_1,
6758 MISC_REGISTERS_GPIO_OUTPUT_HIGH, port);6965 MISC_REGISTERS_GPIO_OUTPUT_HIGH, port);
6759}6966}
@@ -6894,7 +7101,7 @@ static int bnx2x_8073_8727_external_rom_boot(struct bnx2x *bp, · 134 unmodified lines
6894 MDIO_PMA_DEVAD,7101 MDIO_PMA_DEVAD,
6895 MDIO_PMA_REG_M8051_MSGOUT_REG, &fw_msgout);7102 MDIO_PMA_REG_M8051_MSGOUT_REG, &fw_msgout);
6896 7103
6897 usleep_range(1000, 2000);7104 usleep_range(1000, 2000);
6898 } while (fw_ver1 == 0 || fw_ver1 == 0x4321 ||7105 } while (fw_ver1 == 0 || fw_ver1 == 0x4321 ||
6899 ((fw_msgout & 0xff) != 0x03 && (phy->type ==7106 ((fw_msgout & 0xff) != 0x03 && (phy->type ==
6900 PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073)));7107 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
7604 if ((val & MDIO_PMA_REG_SFP_TWO_WIRE_CTRL_STATUS_MASK) ==7811 if ((val & MDIO_PMA_REG_SFP_TWO_WIRE_CTRL_STATUS_MASK) ==
7605 MDIO_PMA_REG_SFP_TWO_WIRE_STATUS_IDLE)7812 MDIO_PMA_REG_SFP_TWO_WIRE_STATUS_IDLE)
7606 return 0;7813 return 0;
7607 usleep_range(1000, 2000);7814 usleep_range(1000, 2000);
7608 }7815 }
7609 return -EINVAL;7816 return -EINVAL;
7610}7817}
7611 7818
7612static void bnx2x_warpcore_power_module(struct link_params *params,7819static void bnx2x_warpcore_power_module(struct link_params *params,
7613 struct bnx2x_phy *phy,
7614 u8 power)7820 u8 power)
7615{7821{
7616 u32 pin_cfg;7822 u32 pin_cfg;
@@ -7652,10 +7858,10 @@ static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 35 unmodified lines
7652 addr32 = addr & (~0x3);7858 addr32 = addr & (~0x3);
7653 do {7859 do {
7654 if ((!is_init) && (cnt == I2C_WA_PWR_ITER)) {7860 if ((!is_init) && (cnt == I2C_WA_PWR_ITER)) {
7655 bnx2x_warpcore_power_module(params, phy, 0);7861 bnx2x_warpcore_power_module(params, 0);
7656 /* Note that 100us are not enough here */7862 /* Note that 100us are not enough here */
7657 usleep_range(1000, 2000);7863 usleep_range(1000, 2000);
7658 bnx2x_warpcore_power_module(params, phy, 1);7864 bnx2x_warpcore_power_module(params, 1);
7659 }7865 }
7660 rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt,7866 rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt,
7661 data_array);7867 data_array);
@@ -7715,7 +7921,7 @@ static int bnx2x_8727_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 53 unmodified lines
7715 /* Wait appropriate time for two-wire command to finish before7921 /* Wait appropriate time for two-wire command to finish before
7716 * polling the status register7922 * polling the status register
7717 */7923 */
7718 usleep_range(1000, 2000);7924 usleep_range(1000, 2000);
7719 7925
7720 /* Wait up to 500us for command complete status */7926 /* Wait up to 500us for command complete status */
7721 for (i = 0; i < 100; i++) {7927 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
7751 if ((val & MDIO_PMA_REG_SFP_TWO_WIRE_CTRL_STATUS_MASK) ==7957 if ((val & MDIO_PMA_REG_SFP_TWO_WIRE_CTRL_STATUS_MASK) ==
7752 MDIO_PMA_REG_SFP_TWO_WIRE_STATUS_IDLE)7958 MDIO_PMA_REG_SFP_TWO_WIRE_STATUS_IDLE)
7753 return 0;7959 return 0;
7754 usleep_range(1000, 2000);7960 usleep_range(1000, 2000);
7755 }7961 }
7756 7962
7757 return -EINVAL;7963 return -EINVAL;
@@ -7786,9 +7992,8 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, · 28 unmodified lines
7786{7992{
7787 struct bnx2x *bp = params->bp;7993 struct bnx2x *bp = params->bp;
7788 u32 sync_offset = 0, phy_idx, media_types;7994 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;
7790 *edc_mode = EDC_MODE_LIMITING;7996 *edc_mode = EDC_MODE_LIMITING;
7791
7792 phy->media_type = ETH_PHY_UNSPECIFIED;7997 phy->media_type = ETH_PHY_UNSPECIFIED;
7793 /* First check for copper cable */7998 /* First check for copper cable */
7794 if (bnx2x_read_sfp_module_eeprom(phy,7999 if (bnx2x_read_sfp_module_eeprom(phy,
@@ -7843,8 +8048,15 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, · 48 unmodified lines
7843 SFP_EEPROM_COMP_CODE_LR_MASK |8048 SFP_EEPROM_COMP_CODE_LR_MASK |
7844 SFP_EEPROM_COMP_CODE_LRM_MASK)) == 0) {8049 SFP_EEPROM_COMP_CODE_LRM_MASK)) == 0) {
7845 DP(NETIF_MSG_LINK, "1G Optic module detected\n");8050 DP(NETIF_MSG_LINK, "1G Optic module detected\n");
8051 gport = params->port;
7846 phy->media_type = ETH_PHY_SFP_1G_FIBER;8052 phy->media_type = ETH_PHY_SFP_1G_FIBER;
7847 phy->req_line_speed = SPEED_1000;8053 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);
7848 } else {8060 } else {
7849 int idx, cfg_idx = 0;8061 int idx, cfg_idx = 0;
7850 DP(NETIF_MSG_LINK, "10G Optic module detected\n");8062 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
8241 struct link_params *params)8453 struct link_params *params)
8242{8454{
8243 struct bnx2x *bp = params->bp;8455 struct bnx2x *bp = params->bp;
8244 bnx2x_warpcore_power_module(params, phy, 0);8456 bnx2x_warpcore_power_module(params, 0);
8245 /* Put Warpcore in low power mode */8457 /* Put Warpcore in low power mode */
8246 REG_WR(bp, MISC_REG_WC0_RESET, 0x0c0e);8458 REG_WR(bp, MISC_REG_WC0_RESET, 0x0c0e);
8247 8459
@@ -8264,7 +8476,7 @@ static void bnx2x_power_sfp_module(struct link_params *params, · 16 unmodified lines
8264 bnx2x_8727_power_module(params->bp, phy, power);8476 bnx2x_8727_power_module(params->bp, phy, power);
8265 break;8477 break;
8266 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT:8478 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT:
8267 bnx2x_warpcore_power_module(params, phy, power);8479 bnx2x_warpcore_power_module(params, power);
8268 break;8480 break;
8269 default:8481 default:
8270 break;8482 break;
@@ -8337,7 +8549,8 @@ int bnx2x_sfp_module_detection(struct bnx2x_phy *phy, · 66 unmodified lines
8337 u32 val = REG_RD(bp, params->shmem_base +8549 u32 val = REG_RD(bp, params->shmem_base +
8338 offsetof(struct shmem_region, dev_info.8550 offsetof(struct shmem_region, dev_info.
8339 port_feature_config[params->port].config));8551 port_feature_config[params->port].config));
8340 8552 /* Enabled transmitter by default */
8553 bnx2x_sfp_set_transmitter(params, phy, 1);
8341 DP(NETIF_MSG_LINK, "SFP+ module plugged in/out detected on port %d\n",8554 DP(NETIF_MSG_LINK, "SFP+ module plugged in/out detected on port %d\n",
8342 params->port);8555 params->port);
8343 /* Power up module */8556 /* Power up module */
@@ -8370,14 +8583,12 @@ int bnx2x_sfp_module_detection(struct bnx2x_phy *phy, · 26 unmodified lines
8370 */8583 */
8371 bnx2x_set_limiting_mode(params, phy, edc_mode);8584 bnx2x_set_limiting_mode(params, phy, edc_mode);
8372 8585
8373 /* Enable transmit for this module if the module is approved, or8586 /* Disable transmit for this module if the module is not approved, and
8374 * if unapproved modules should also enable the Tx laser8587 * laser needs to be disabled.
8375 */8588 */
8376 if (rc == 0 ||8589 if ((rc) &&
8377 (val & PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK) !=8590 ((val & PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK) ==
8378 PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER)8591 PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER))
8379 bnx2x_sfp_set_transmitter(params, phy, 1);
8380 else
8381 bnx2x_sfp_set_transmitter(params, phy, 0);8592 bnx2x_sfp_set_transmitter(params, phy, 0);
8382 8593
8383 return rc;8594 return rc;
@@ -8389,11 +8600,13 @@ void bnx2x_handle_module_detect_int(struct link_params *params) · 5 unmodified lines
8389 struct bnx2x_phy *phy;8600 struct bnx2x_phy *phy;
8390 u32 gpio_val;8601 u32 gpio_val;
8391 u8 gpio_num, gpio_port;8602 u8 gpio_num, gpio_port;
8392 if (CHIP_IS_E3(bp))8603 if (CHIP_IS_E3(bp)) {
8393 phy = &params->phy[INT_PHY];8604 phy = &params->phy[INT_PHY];
8394 else8605 /* Always enable TX laser,will be disabled in case of fault */
8606 bnx2x_sfp_set_transmitter(params, phy, 1);
8607 } else {
8395 phy = &params->phy[EXT_PHY1];8608 phy = &params->phy[EXT_PHY1];
8396 8609 }
8397 if (bnx2x_get_mod_abs_int_cfg(bp, params->chip_id, params->shmem_base,8610 if (bnx2x_get_mod_abs_int_cfg(bp, params->chip_id, params->shmem_base,
8398 params->port, &gpio_num, &gpio_port) ==8611 params->port, &gpio_num, &gpio_port) ==
8399 -EINVAL) {8612 -EINVAL) {
@@ -8409,7 +8622,7 @@ void bnx2x_handle_module_detect_int(struct link_params *params) · 9 unmodified lines
8409 8622
8410 /* Call the handling function in case module is detected */8623 /* Call the handling function in case module is detected */
8411 if (gpio_val == 0) {8624 if (gpio_val == 0) {
8412 bnx2x_set_mdio_clk(bp, params->chip_id, params->port);8625 bnx2x_set_mdio_emac_per_phy(bp, params);
8413 bnx2x_set_aer_mmd(params, phy);8626 bnx2x_set_aer_mmd(params, phy);
8414 8627
8415 bnx2x_power_sfp_module(params, phy, 1);8628 bnx2x_power_sfp_module(params, phy, 1);
@@ -8438,10 +8651,6 @@ void bnx2x_handle_module_detect_int(struct link_params *params) · 22 unmodified lines
8438 DP(NETIF_MSG_LINK, "SFP+ module is not initialized\n");8651 DP(NETIF_MSG_LINK, "SFP+ module is not initialized\n");
8439 }8652 }
8440 } else {8653 } 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));
8445 bnx2x_set_gpio_int(bp, gpio_num,8654 bnx2x_set_gpio_int(bp, gpio_num,
8446 MISC_REGISTERS_GPIO_INT_OUTPUT_SET,8655 MISC_REGISTERS_GPIO_INT_OUTPUT_SET,
8447 gpio_port);8656 gpio_port);
@@ -8449,10 +8658,6 @@ void bnx2x_handle_module_detect_int(struct link_params *params) · 1 unmodified line
8449 * Disable transmit for this module8658 * Disable transmit for this module
8450 */8659 */
8451 phy->media_type = ETH_PHY_NOT_PRESENT;8660 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);
8456 }8661 }
8457}8662}
8458 8663
@@ -9192,6 +9397,7 @@ static u8 bnx2x_8727_read_status(struct bnx2x_phy *phy, · 733 unmodified lines
9192 bnx2x_cl45_read(bp, phy,9397 bnx2x_cl45_read(bp, phy,
9193 MDIO_PMA_DEVAD,9398 MDIO_PMA_DEVAD,
9194 MDIO_PMA_LASI_RXSTAT, &rx_alarm_status);9399 MDIO_PMA_LASI_RXSTAT, &rx_alarm_status);
9400 bnx2x_8727_power_module(params->bp, phy, 0);
9195 return 0;9401 return 0;
9196 }9402 }
9197 } /* Over current check */9403 } /* Over current check */
@@ -9296,20 +9502,28 @@ static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy, · 98 unmodified lines
9296 struct bnx2x *bp,9502 struct bnx2x *bp,
9297 u8 port)9503 u8 port)
9298{9504{
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;
9300 9514
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)) {
9302 bnx2x_cl45_read(bp, phy, MDIO_CTL_DEVAD, 0x400f, &fw_ver1);9517 bnx2x_cl45_read(bp, phy, MDIO_CTL_DEVAD, 0x400f, &fw_ver1);
9303 bnx2x_save_spirom_version(bp, port, fw_ver1 & 0xfff,9518 bnx2x_save_spirom_version(bp, port, fw_ver1 & 0xfff,
9304 phy->ver_addr);9519 phy->ver_addr);
9305 } else {9520 } else {
9306 /* For 32-bit registers in 848xx, access via MDIO2ARM i/f. */9521 /* For 32-bit registers in 848xx, access via MDIO2ARM i/f. */
9307 /* (1) set reg 0xc200_0014(SPI_BRIDGE_CTRL_2) to 0x03000000 */9522 /* (1) set reg 0xc200_0014(SPI_BRIDGE_CTRL_2) to 0x03000000 */
9308 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA819, 0x0014);9523 for (i = 0; i < sizeof(reg_set)/sizeof(struct bnx2x_reg_set);
9309 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81A, 0xc200);9524 i++)
9310 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81B, 0x0000);9525 bnx2x_cl45_write(bp, phy, reg_set[i].devad,
9311 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA81C, 0x0300);9526 reg_set[i].reg, reg_set[i].val);
9312 bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, 0xA817, 0x0009);
9313 9527
9314 for (cnt = 0; cnt < 100; cnt++) {9528 for (cnt = 0; cnt < 100; cnt++) {
9315 bnx2x_cl45_read(bp, phy, MDIO_PMA_DEVAD, 0xA818, &val);9529 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
9357static void bnx2x_848xx_set_led(struct bnx2x *bp,9571static void bnx2x_848xx_set_led(struct bnx2x *bp,
9358 struct bnx2x_phy *phy)9572 struct bnx2x_phy *phy)
9359{9573{
9360 u16 val, offset;9574 u16 val, offset, i;
9361 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 };
9362 /* PHYC_CTL_LED_CTL */9584 /* PHYC_CTL_LED_CTL */
9363 bnx2x_cl45_read(bp, phy,9585 bnx2x_cl45_read(bp, phy,
9364 MDIO_PMA_DEVAD,9586 MDIO_PMA_DEVAD,
@@ -9370,49 +9592,20 @@ static void bnx2x_848xx_set_led(struct bnx2x *bp, · 5 unmodified lines
9370 MDIO_PMA_DEVAD,9592 MDIO_PMA_DEVAD,
9371 MDIO_PMA_REG_8481_LINK_SIGNAL, val);9593 MDIO_PMA_REG_8481_LINK_SIGNAL, val);
9372 9594
9373 bnx2x_cl45_write(bp, phy,9595 for (i = 0; i < sizeof(reg_set)/sizeof(struct bnx2x_reg_set); i++)
9374 MDIO_PMA_DEVAD,9596 bnx2x_cl45_write(bp, phy, reg_set[i].devad, reg_set[i].reg,
9375 MDIO_PMA_REG_8481_LED1_MASK,9597 reg_set[i].val);
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);
9400 9598
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))
9402 offset = MDIO_PMA_REG_84833_CTL_LED_CTL_1;9601 offset = MDIO_PMA_REG_84833_CTL_LED_CTL_1;
9403 else9602 else
9404 offset = MDIO_PMA_REG_84823_CTL_LED_CTL_1;9603 offset = MDIO_PMA_REG_84823_CTL_LED_CTL_1;
9405 9604
9406 bnx2x_cl45_read(bp, phy,9605 /* stretch_en for LED3*/
9407 MDIO_PMA_DEVAD, offset, &val);9606 bnx2x_cl45_read_or_write(bp, phy,
9408 val |= MDIO_PMA_REG_84823_LED3_STRETCH_EN; /* stretch_en for LED3*/9607 MDIO_PMA_DEVAD, offset,
9409 bnx2x_cl45_write(bp, phy,9608 MDIO_PMA_REG_84823_LED3_STRETCH_EN);
9410 MDIO_PMA_DEVAD, offset, val);
9411
9412 /* 'Interrupt Mask' */
9413 bnx2x_cl45_write(bp, phy,
9414 MDIO_AN_DEVAD,
9415 0xFFFB, 0xFFFD);
9416}9609}
9417 9610
9418static void bnx2x_848xx_specific_func(struct bnx2x_phy *phy,9611static 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
9422 struct bnx2x *bp = params->bp;9615 struct bnx2x *bp = params->bp;
9423 switch (action) {9616 switch (action) {
9424 case PHY_INIT:9617 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)) {
9426 /* Save spirom version */9620 /* Save spirom version */
9427 bnx2x_save_848xx_spirom_version(phy, bp, params->port);9621 bnx2x_save_848xx_spirom_version(phy, bp, params->port);
9428 }9622 }
@@ -9443,7 +9637,7 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, · 14 unmodified lines
9443 struct link_vars *vars)9637 struct link_vars *vars)
9444{9638{
9445 struct bnx2x *bp = params->bp;9639 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;
9447 9641
9448 bnx2x_848xx_specific_func(phy, params, PHY_INIT);9642 bnx2x_848xx_specific_func(phy, params, PHY_INIT);
9449 bnx2x_cl45_write(bp, phy,9643 bnx2x_cl45_write(bp, phy,
@@ -9542,11 +9736,12 @@ static int bnx2x_848xx_cmn_config_init(struct bnx2x_phy *phy, · 92 unmodified lines
9542 if (phy->req_duplex == DUPLEX_FULL)9736 if (phy->req_duplex == DUPLEX_FULL)
9543 autoneg_val |= (1<<8);9737 autoneg_val |= (1<<8);
9544 9738
9545 /* Always write this if this is not 84833.9739 /* Always write this if this is not 84833/4.
9546 * For 84833, write it only when it's a forced speed.9740 * For 84833/4, write it only when it's a forced speed.
9547 */9741 */
9548 if ((phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) ||9742 if (((phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) &&
9549 ((autoneg_val & (1<<12)) == 0))9743 (phy->type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834)) ||
9744 ((autoneg_val & (1<<12)) == 0))
9550 bnx2x_cl45_write(bp, phy,9745 bnx2x_cl45_write(bp, phy,
9551 MDIO_AN_DEVAD,9746 MDIO_AN_DEVAD,
9552 MDIO_AN_REG_8481_LEGACY_MII_CTRL, autoneg_val);9747 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
9558 DP(NETIF_MSG_LINK, "Advertising 10G\n");9753 DP(NETIF_MSG_LINK, "Advertising 10G\n");
9559 /* Restart autoneg for 10G*/9754 /* Restart autoneg for 10G*/
9560 9755
9561 bnx2x_cl45_read(bp, phy,9756 bnx2x_cl45_read_or_write(
9562 MDIO_AN_DEVAD,9757 bp, phy,
9563 MDIO_AN_REG_8481_10GBASE_T_AN_CTRL,9758 MDIO_AN_DEVAD,
9564 &an_10g_val);9759 MDIO_AN_REG_8481_10GBASE_T_AN_CTRL,
9565 bnx2x_cl45_write(bp, phy,9760 0x1000);
9566 MDIO_AN_DEVAD,
9567 MDIO_AN_REG_8481_10GBASE_T_AN_CTRL,
9568 an_10g_val | 0x1000);
9569 bnx2x_cl45_write(bp, phy,9761 bnx2x_cl45_write(bp, phy,
9570 MDIO_AN_DEVAD, MDIO_AN_REG_CTRL,9762 MDIO_AN_DEVAD, MDIO_AN_REG_CTRL,
9571 0x3200);9763 0x3200);
@@ -9598,9 +9790,8 @@ static int bnx2x_8481_config_init(struct bnx2x_phy *phy, · 26 unmodified lines
9598#define PHY84833_CMDHDLR_WAIT 3009790#define PHY84833_CMDHDLR_WAIT 300
9599#define PHY84833_CMDHDLR_MAX_ARGS 59791#define PHY84833_CMDHDLR_MAX_ARGS 5
9600static int bnx2x_84833_cmd_hdlr(struct bnx2x_phy *phy,9792static int bnx2x_84833_cmd_hdlr(struct bnx2x_phy *phy,
9601 struct link_params *params,9793 struct link_params *params, u16 fw_cmd,
9602 u16 fw_cmd,9794 u16 cmd_args[], int argc)
9603 u16 cmd_args[], int argc)
9604{9795{
9605 int idx;9796 int idx;
9606 u16 val;9797 u16 val;
@@ -9614,7 +9805,7 @@ static int bnx2x_84833_cmd_hdlr(struct bnx2x_phy *phy, · 7 unmodified lines
9614 MDIO_84833_CMD_HDLR_STATUS, &val);9805 MDIO_84833_CMD_HDLR_STATUS, &val);
9615 if (val == PHY84833_STATUS_CMD_OPEN_FOR_CMDS)9806 if (val == PHY84833_STATUS_CMD_OPEN_FOR_CMDS)
9616 break;9807 break;
9617 usleep_range(1000, 2000);9808 usleep_range(1000, 2000);
9618 }9809 }
9619 if (idx >= PHY84833_CMDHDLR_WAIT) {9810 if (idx >= PHY84833_CMDHDLR_WAIT) {
9620 DP(NETIF_MSG_LINK, "FW cmd: FW not ready.\n");9811 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
9635 if ((val == PHY84833_STATUS_CMD_COMPLETE_PASS) ||9826 if ((val == PHY84833_STATUS_CMD_COMPLETE_PASS) ||
9636 (val == PHY84833_STATUS_CMD_COMPLETE_ERROR))9827 (val == PHY84833_STATUS_CMD_COMPLETE_ERROR))
9637 break;9828 break;
9638 usleep_range(1000, 2000);9829 usleep_range(1000, 2000);
9639 }9830 }
9640 if ((idx >= PHY84833_CMDHDLR_WAIT) ||9831 if ((idx >= PHY84833_CMDHDLR_WAIT) ||
9641 (val == PHY84833_STATUS_CMD_COMPLETE_ERROR)) {9832 (val == PHY84833_STATUS_CMD_COMPLETE_ERROR)) {
@@ -9654,7 +9845,6 @@ static int bnx2x_84833_cmd_hdlr(struct bnx2x_phy *phy, · 12 unmodified lines
9654 return 0;9845 return 0;
9655}9846}
9656 9847
9657
9658static int bnx2x_84833_pair_swap_cfg(struct bnx2x_phy *phy,9848static int bnx2x_84833_pair_swap_cfg(struct bnx2x_phy *phy,
9659 struct link_params *params,9849 struct link_params *params,
9660 struct link_vars *vars)9850 struct link_vars *vars)
@@ -9802,11 +9992,11 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 141 unmodified lines
9802 struct bnx2x *bp = params->bp;9992 struct bnx2x *bp = params->bp;
9803 u8 port, initialize = 1;9993 u8 port, initialize = 1;
9804 u16 val;9994 u16 val;
9805 u32 actual_phy_selection, cms_enable;9995 u32 actual_phy_selection;
9806 u16 cmd_args[PHY84833_CMDHDLR_MAX_ARGS];9996 u16 cmd_args[PHY84833_CMDHDLR_MAX_ARGS];
9807 int rc = 0;9997 int rc = 0;
9808 9998
9809 usleep_range(1000, 2000);9999 usleep_range(1000, 2000);
9810 10000
9811 if (!(CHIP_IS_E1x(bp)))10001 if (!(CHIP_IS_E1x(bp)))
9812 port = BP_PATH(bp);10002 port = BP_PATH(bp);
@@ -9828,7 +10018,8 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 15 unmodified lines
9828 10018
9829 /* Wait for GPHY to come out of reset */10019 /* Wait for GPHY to come out of reset */
9830 msleep(50);10020 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)) {
9832 /* BCM84823 requires that XGXS links up first @ 10G for normal10023 /* BCM84823 requires that XGXS links up first @ 10G for normal
9833 * behavior.10024 * behavior.
9834 */10025 */
@@ -9884,7 +10075,8 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 49 unmodified lines
9884 DP(NETIF_MSG_LINK, "Multi_phy config = 0x%x, Media control = 0x%x\n",10075 DP(NETIF_MSG_LINK, "Multi_phy config = 0x%x, Media control = 0x%x\n",
9885 params->multi_phy_config, val);10076 params->multi_phy_config, val);
9886 10077
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)) {
9888 bnx2x_84833_pair_swap_cfg(phy, params, vars);10080 bnx2x_84833_pair_swap_cfg(phy, params, vars);
9889 10081
9890 /* Keep AutogrEEEn disabled. */10082 /* Keep AutogrEEEn disabled. */
@@ -9904,7 +10096,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 13 unmodified lines
9904 bnx2x_save_848xx_spirom_version(phy, bp, params->port);10096 bnx2x_save_848xx_spirom_version(phy, bp, params->port);
9905 /* 84833 PHY has a better feature and doesn't need to support this. */10097 /* 84833 PHY has a better feature and doesn't need to support this. */
9906 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823) {10098 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 +
9908 offsetof(struct shmem_region,10100 offsetof(struct shmem_region,
9909 dev_info.port_hw_config[params->port].default_cfg)) &10101 dev_info.port_hw_config[params->port].default_cfg)) &
9910 PORT_HW_CFG_ENABLE_CMS_MASK;10102 PORT_HW_CFG_ENABLE_CMS_MASK;
@@ -9933,7 +10125,7 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 22 unmodified lines
9933 return rc;10125 return rc;
9934 }10126 }
9935 10127
9936 if ((params->req_duplex[actual_phy_selection] == DUPLEX_FULL) &&10128 if ((phy->req_duplex == DUPLEX_FULL) &&
9937 (params->eee_mode & EEE_MODE_ADV_LPI) &&10129 (params->eee_mode & EEE_MODE_ADV_LPI) &&
9938 (bnx2x_eee_calc_timer(params) ||10130 (bnx2x_eee_calc_timer(params) ||
9939 !(params->eee_mode & EEE_MODE_ENABLE_LPI)))10131 !(params->eee_mode & EEE_MODE_ENABLE_LPI)))
@@ -9948,15 +10140,13 @@ static int bnx2x_848x3_config_init(struct bnx2x_phy *phy, · 8 unmodified lines
9948 vars->eee_status &= ~SHMEM_EEE_SUPPORTED_MASK;10140 vars->eee_status &= ~SHMEM_EEE_SUPPORTED_MASK;
9949 }10141 }
9950 10142
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)) {
9952 /* Bring PHY out of super isolate mode as the final step. */10145 /* Bring PHY out of super isolate mode as the final step. */
9953 bnx2x_cl45_read(bp, phy,10146 bnx2x_cl45_read_and_write(bp, phy,
9954 MDIO_CTL_DEVAD,10147 MDIO_CTL_DEVAD,
9955 MDIO_84833_TOP_CFG_XGPHY_STRAP1, &val);10148 MDIO_84833_TOP_CFG_XGPHY_STRAP1,
9956 val &= ~MDIO_84833_SUPER_ISOLATE;10149 (u16)~MDIO_84833_SUPER_ISOLATE);
9957 bnx2x_cl45_write(bp, phy,
9958 MDIO_CTL_DEVAD,
9959 MDIO_84833_TOP_CFG_XGPHY_STRAP1, val);
9960 }10150 }
9961 return rc;10151 return rc;
9962}10152}
@@ -10090,7 +10280,6 @@ static u8 bnx2x_848xx_read_status(struct bnx2x_phy *phy, · 127 unmodified lines
10090 return link_up;10280 return link_up;
10091}10281}
10092 10282
10093
10094static int bnx2x_848xx_format_ver(u32 raw_ver, u8 *str, u16 *len)10283static int bnx2x_848xx_format_ver(u32 raw_ver, u8 *str, u16 *len)
10095{10284{
10096 int status = 0;10285 int status = 0;
@@ -10962,7 +11151,7 @@ static void bnx2x_7101_set_link_led(struct bnx2x_phy *phy, · 865 unmodified lines
10962/* STATIC PHY DECLARATION */11151/* STATIC PHY DECLARATION */
10963/******************************************************************/11152/******************************************************************/
10964 11153
10965static struct bnx2x_phy phy_null = {11154static const struct bnx2x_phy phy_null = {
10966 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN,11155 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN,
10967 .addr = 0,11156 .addr = 0,
10968 .def_md_devad = 0,11157 .def_md_devad = 0,
@@ -10988,7 +11177,7 @@ static struct bnx2x_phy phy_null = { · 19 unmodified lines
10988 .phy_specific_func = (phy_specific_func_t)NULL11177 .phy_specific_func = (phy_specific_func_t)NULL
10989};11178};
10990 11179
10991static struct bnx2x_phy phy_serdes = {11180static const struct bnx2x_phy phy_serdes = {
10992 .type = PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT,11181 .type = PORT_HW_CFG_SERDES_EXT_PHY_TYPE_DIRECT,
10993 .addr = 0xff,11182 .addr = 0xff,
10994 .def_md_devad = 0,11183 .def_md_devad = 0,
@@ -11023,7 +11212,7 @@ static struct bnx2x_phy phy_serdes = { · 28 unmodified lines
11023 .phy_specific_func = (phy_specific_func_t)NULL11212 .phy_specific_func = (phy_specific_func_t)NULL
11024};11213};
11025 11214
11026static struct bnx2x_phy phy_xgxs = {11215static const struct bnx2x_phy phy_xgxs = {
11027 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,11216 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,
11028 .addr = 0xff,11217 .addr = 0xff,
11029 .def_md_devad = 0,11218 .def_md_devad = 0,
@@ -11058,12 +11247,11 @@ static struct bnx2x_phy phy_xgxs = { · 28 unmodified lines
11058 .set_link_led = (set_link_led_t)NULL,11247 .set_link_led = (set_link_led_t)NULL,
11059 .phy_specific_func = (phy_specific_func_t)bnx2x_xgxs_specific_func11248 .phy_specific_func = (phy_specific_func_t)bnx2x_xgxs_specific_func
11060};11249};
11061static struct bnx2x_phy phy_warpcore = {11250static const struct bnx2x_phy phy_warpcore = {
11062 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,11251 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,
11063 .addr = 0xff,11252 .addr = 0xff,
11064 .def_md_devad = 0,11253 .def_md_devad = 0,
11065 .flags = (FLAGS_HW_LOCK_REQUIRED |11254 .flags = FLAGS_TX_ERROR_CHECK,
11066 FLAGS_TX_ERROR_CHECK),
11067 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},11255 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
11068 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},11256 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
11069 .mdio_ctrl = 0,11257 .mdio_ctrl = 0,
@@ -11097,7 +11285,7 @@ static struct bnx2x_phy phy_warpcore = { · 27 unmodified lines
11097};11285};
11098 11286
11099 11287
11100static struct bnx2x_phy phy_7101 = {11288static const struct bnx2x_phy phy_7101 = {
11101 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101,11289 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101,
11102 .addr = 0xff,11290 .addr = 0xff,
11103 .def_md_devad = 0,11291 .def_md_devad = 0,
@@ -11126,11 +11314,11 @@ static struct bnx2x_phy phy_7101 = { · 22 unmodified lines
11126 .set_link_led = (set_link_led_t)bnx2x_7101_set_link_led,11314 .set_link_led = (set_link_led_t)bnx2x_7101_set_link_led,
11127 .phy_specific_func = (phy_specific_func_t)NULL11315 .phy_specific_func = (phy_specific_func_t)NULL
11128};11316};
11129static struct bnx2x_phy phy_8073 = {11317static const struct bnx2x_phy phy_8073 = {
11130 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073,11318 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073,
11131 .addr = 0xff,11319 .addr = 0xff,
11132 .def_md_devad = 0,11320 .def_md_devad = 0,
11133 .flags = FLAGS_HW_LOCK_REQUIRED,11321 .flags = 0,
11134 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},11322 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
11135 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},11323 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
11136 .mdio_ctrl = 0,11324 .mdio_ctrl = 0,
@@ -11157,7 +11345,7 @@ static struct bnx2x_phy phy_8073 = { · 20 unmodified lines
11157 .set_link_led = (set_link_led_t)NULL,11345 .set_link_led = (set_link_led_t)NULL,
11158 .phy_specific_func = (phy_specific_func_t)bnx2x_8073_specific_func11346 .phy_specific_func = (phy_specific_func_t)bnx2x_8073_specific_func
11159};11347};
11160static struct bnx2x_phy phy_8705 = {11348static const struct bnx2x_phy phy_8705 = {
11161 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705,11349 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705,
11162 .addr = 0xff,11350 .addr = 0xff,
11163 .def_md_devad = 0,11351 .def_md_devad = 0,
@@ -11185,7 +11373,7 @@ static struct bnx2x_phy phy_8705 = { · 21 unmodified lines
11185 .set_link_led = (set_link_led_t)NULL,11373 .set_link_led = (set_link_led_t)NULL,
11186 .phy_specific_func = (phy_specific_func_t)NULL11374 .phy_specific_func = (phy_specific_func_t)NULL
11187};11375};
11188static struct bnx2x_phy phy_8706 = {11376static const struct bnx2x_phy phy_8706 = {
11189 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706,11377 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706,
11190 .addr = 0xff,11378 .addr = 0xff,
11191 .def_md_devad = 0,11379 .def_md_devad = 0,
@@ -11215,12 +11403,11 @@ static struct bnx2x_phy phy_8706 = { · 23 unmodified lines
11215 .phy_specific_func = (phy_specific_func_t)NULL11403 .phy_specific_func = (phy_specific_func_t)NULL
11216};11404};
11217 11405
11218static struct bnx2x_phy phy_8726 = {11406static const struct bnx2x_phy phy_8726 = {
11219 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726,11407 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726,
11220 .addr = 0xff,11408 .addr = 0xff,
11221 .def_md_devad = 0,11409 .def_md_devad = 0,
11222 .flags = (FLAGS_HW_LOCK_REQUIRED |11410 .flags = (FLAGS_INIT_XGXS_FIRST |
11223 FLAGS_INIT_XGXS_FIRST |
11224 FLAGS_TX_ERROR_CHECK),11411 FLAGS_TX_ERROR_CHECK),
11225 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},11412 .rx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
11226 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},11413 .tx_preemphasis = {0xffff, 0xffff, 0xffff, 0xffff},
@@ -11248,7 +11435,7 @@ static struct bnx2x_phy phy_8726 = { · 21 unmodified lines
11248 .phy_specific_func = (phy_specific_func_t)NULL11435 .phy_specific_func = (phy_specific_func_t)NULL
11249};11436};
11250 11437
11251static struct bnx2x_phy phy_8727 = {11438static const struct bnx2x_phy phy_8727 = {
11252 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727,11439 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727,
11253 .addr = 0xff,11440 .addr = 0xff,
11254 .def_md_devad = 0,11441 .def_md_devad = 0,
@@ -11278,7 +11465,7 @@ static struct bnx2x_phy phy_8727 = { · 23 unmodified lines
11278 .set_link_led = (set_link_led_t)bnx2x_8727_set_link_led,11465 .set_link_led = (set_link_led_t)bnx2x_8727_set_link_led,
11279 .phy_specific_func = (phy_specific_func_t)bnx2x_8727_specific_func11466 .phy_specific_func = (phy_specific_func_t)bnx2x_8727_specific_func
11280};11467};
11281static struct bnx2x_phy phy_8481 = {11468static const struct bnx2x_phy phy_8481 = {
11282 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481,11469 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481,
11283 .addr = 0xff,11470 .addr = 0xff,
11284 .def_md_devad = 0,11471 .def_md_devad = 0,
@@ -11314,7 +11501,7 @@ static struct bnx2x_phy phy_8481 = { · 29 unmodified lines
11314 .phy_specific_func = (phy_specific_func_t)NULL11501 .phy_specific_func = (phy_specific_func_t)NULL
11315};11502};
11316 11503
11317static struct bnx2x_phy phy_84823 = {11504static const struct bnx2x_phy phy_84823 = {
11318 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823,11505 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84823,
11319 .addr = 0xff,11506 .addr = 0xff,
11320 .def_md_devad = 0,11507 .def_md_devad = 0,
@@ -11351,7 +11538,7 @@ static struct bnx2x_phy phy_84823 = { · 30 unmodified lines
11351 .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func11538 .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
11352};11539};
11353 11540
11354static struct bnx2x_phy phy_84833 = {11541static const struct bnx2x_phy phy_84833 = {
11355 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833,11542 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833,
11356 .addr = 0xff,11543 .addr = 0xff,
11357 .def_md_devad = 0,11544 .def_md_devad = 0,
@@ -11386,7 +11573,41 @@ static struct bnx2x_phy phy_84833 = { · 28 unmodified lines
11386 .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func11573 .phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
11387};11574};
11388 11575
11389static struct bnx2x_phy phy_54618se = {11576static 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
11610static const struct bnx2x_phy phy_54618se = {
11390 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE,11611 .type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE,
11391 .addr = 0xff,11612 .addr = 0xff,
11392 .def_md_devad = 0,11613 .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
11564 phy->media_type = ETH_PHY_KR;11785 phy->media_type = ETH_PHY_KR;
11565 phy->flags |= FLAGS_WC_DUAL_MODE;11786 phy->flags |= FLAGS_WC_DUAL_MODE;
11566 phy->supported &= (SUPPORTED_20000baseKR2_Full |11787 phy->supported &= (SUPPORTED_20000baseKR2_Full |
11788 SUPPORTED_Autoneg |
11567 SUPPORTED_FIBRE |11789 SUPPORTED_FIBRE |
11568 SUPPORTED_Pause |11790 SUPPORTED_Pause |
11569 SUPPORTED_Asym_Pause);11791 SUPPORTED_Asym_Pause);
11792 phy->flags &= ~FLAGS_TX_ERROR_CHECK;
11570 break;11793 break;
11571 default:11794 default:
11572 DP(NETIF_MSG_LINK, "Unknown WC interface type 0x%x\n",11795 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
11665 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833:11888 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833:
11666 *phy = phy_84833;11889 *phy = phy_84833;
11667 break;11890 break;
11891 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834:
11892 *phy = phy_84834;
11893 break;
11668 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54616:11894 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54616:
11669 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE:11895 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM54618SE:
11670 *phy = phy_54618se;11896 *phy = phy_54618se;
@@ -11721,9 +11947,10 @@ static int bnx2x_populate_ext_phy(struct bnx2x *bp, · 50 unmodified lines
11721 }11947 }
11722 phy->mdio_ctrl = bnx2x_get_emac_base(bp, mdc_mdio_access, port);11948 phy->mdio_ctrl = bnx2x_get_emac_base(bp, mdc_mdio_access, port);
11723 11949
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)) &&
11725 (phy->ver_addr)) {11952 (phy->ver_addr)) {
11726 /* Remove 100Mb link supported for BCM84833 when phy fw11953 /* Remove 100Mb link supported for BCM84833/4 when phy fw
11727 * version lower than or equal to 1.3911954 * version lower than or equal to 1.39
11728 */11955 */
11729 u32 raw_ver = REG_RD(bp, phy->ver_addr);11956 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
11733 SUPPORTED_100baseT_Full);11960 SUPPORTED_100baseT_Full);
11734 }11961 }
11735 11962
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;
11742 DP(NETIF_MSG_LINK, "phy_type 0x%x port %d found in index %d\n",11963 DP(NETIF_MSG_LINK, "phy_type 0x%x port %d found in index %d\n",
11743 phy_type, port, phy_index);11964 phy_type, port, phy_index);
11744 DP(NETIF_MSG_LINK, " addr=0x%x, mdio_ctl=0x%x\n",11965 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
11863 return return_cfg;12084 return return_cfg;
11864}12085}
11865 12086
11866
11867int bnx2x_phy_probe(struct link_params *params)12087int bnx2x_phy_probe(struct link_params *params)
11868{12088{
11869 u8 phy_index, actual_phy_idx;12089 u8 phy_index, actual_phy_idx;
@@ -11907,6 +12127,10 @@ int bnx2x_phy_probe(struct link_params *params) · 37 unmodified lines
11907 FEATURE_CONFIG_DISABLE_REMOTE_FAULT_DET)12127 FEATURE_CONFIG_DISABLE_REMOTE_FAULT_DET)
11908 phy->flags &= ~FLAGS_TX_ERROR_CHECK;12128 phy->flags &= ~FLAGS_TX_ERROR_CHECK;
11909 12129
12130 if (!(params->feature_config_flags &
12131 FEATURE_CONFIG_MT_SUPPORT))
12132 phy->flags |= FLAGS_MDC_MDIO_WA_G;
12133
11910 sync_offset = params->shmem_base +12134 sync_offset = params->shmem_base +
11911 offsetof(struct shmem_region,12135 offsetof(struct shmem_region,
11912 dev_info.port_hw_config[params->port].media_type);12136 dev_info.port_hw_config[params->port].media_type);
@@ -11934,8 +12158,8 @@ int bnx2x_phy_probe(struct link_params *params) · 21 unmodified lines
11934 return 0;12158 return 0;
11935}12159}
11936 12160
11937void bnx2x_init_bmac_loopback(struct link_params *params,12161static void bnx2x_init_bmac_loopback(struct link_params *params,
11938 struct link_vars *vars)12162 struct link_vars *vars)
11939{12163{
11940 struct bnx2x *bp = params->bp;12164 struct bnx2x *bp = params->bp;
11941 vars->link_up = 1;12165 vars->link_up = 1;
@@ -11954,8 +12178,8 @@ void bnx2x_init_bmac_loopback(struct link_params *params, · 12 unmodified lines
11954 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);12178 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
11955}12179}
11956 12180
11957void bnx2x_init_emac_loopback(struct link_params *params,12181static void bnx2x_init_emac_loopback(struct link_params *params,
11958 struct link_vars *vars)12182 struct link_vars *vars)
11959{12183{
11960 struct bnx2x *bp = params->bp;12184 struct bnx2x *bp = params->bp;
11961 vars->link_up = 1;12185 vars->link_up = 1;
@@ -11973,8 +12197,8 @@ void bnx2x_init_emac_loopback(struct link_params *params, · 11 unmodified lines
11973 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);12197 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
11974}12198}
11975 12199
11976void bnx2x_init_xmac_loopback(struct link_params *params,12200static void bnx2x_init_xmac_loopback(struct link_params *params,
11977 struct link_vars *vars)12201 struct link_vars *vars)
11978{12202{
11979 struct bnx2x *bp = params->bp;12203 struct bnx2x *bp = params->bp;
11980 vars->link_up = 1;12204 vars->link_up = 1;
@@ -11999,8 +12223,8 @@ void bnx2x_init_xmac_loopback(struct link_params *params, · 18 unmodified lines
11999 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);12223 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
12000}12224}
12001 12225
12002void bnx2x_init_umac_loopback(struct link_params *params,12226static void bnx2x_init_umac_loopback(struct link_params *params,
12003 struct link_vars *vars)12227 struct link_vars *vars)
12004{12228{
12005 struct bnx2x *bp = params->bp;12229 struct bnx2x *bp = params->bp;
12006 vars->link_up = 1;12230 vars->link_up = 1;
@@ -12014,17 +12238,21 @@ void bnx2x_init_umac_loopback(struct link_params *params, · 7 unmodified lines
12014 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);12238 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
12015}12239}
12016 12240
12017void bnx2x_init_xgxs_loopback(struct link_params *params,12241static void bnx2x_init_xgxs_loopback(struct link_params *params,
12018 struct link_vars *vars)12242 struct link_vars *vars)
12019{12243{
12020 struct bnx2x *bp = params->bp;12244 struct bnx2x *bp = params->bp;
12021 vars->link_up = 1;12245 struct bnx2x_phy *int_phy = &params->phy[INT_PHY];
12022 vars->flow_ctrl = BNX2X_FLOW_CTRL_NONE;12246 vars->link_up = 1;
12023 vars->duplex = DUPLEX_FULL;12247 vars->flow_ctrl = BNX2X_FLOW_CTRL_NONE;
12248 vars->duplex = DUPLEX_FULL;
12024 if (params->req_line_speed[0] == SPEED_1000)12249 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;
12026 else12254 else
12027 vars->line_speed = SPEED_10000;12255 vars->line_speed = SPEED_10000;
12028 12256
12029 if (!USES_WARPCORE(bp))12257 if (!USES_WARPCORE(bp))
12030 bnx2x_xgxs_deassert(params);12258 bnx2x_xgxs_deassert(params);
@@ -12044,34 +12272,30 @@ void bnx2x_init_xgxs_loopback(struct link_params *params, · 13 unmodified lines
12044 bnx2x_bmac_enable(params, vars, 0, 1);12272 bnx2x_bmac_enable(params, vars, 0, 1);
12045 }12273 }
12046 12274
12047 if (params->loopback_mode == LOOPBACK_XGXS) {12275 if (params->loopback_mode == LOOPBACK_XGXS) {
12048 /* set 10G XGXS loopback */12276 /* Set 10G XGXS loopback */
12049 params->phy[INT_PHY].config_loopback(12277 int_phy->config_loopback(int_phy, params);
12050 &params->phy[INT_PHY],12278 } else {
12051 params);12279 /* Set external phy loopback */
12052 12280 u8 phy_index;
12053 } else {12281 for (phy_index = EXT_PHY1;
12054 /* set external phy loopback */12282 phy_index < params->num_phys; phy_index++)
12055 u8 phy_index;12283 if (params->phy[phy_index].config_loopback)
12056 for (phy_index = EXT_PHY1;12284 params->phy[phy_index].config_loopback(
12057 phy_index < params->num_phys; phy_index++) {12285 &params->phy[phy_index],
12058 if (params->phy[phy_index].config_loopback)12286 params);
12059 params->phy[phy_index].config_loopback(12287 }
12060 &params->phy[phy_index],12288 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
12061 params);
12062 }
12063 }
12064 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
12065 12289
12066 bnx2x_set_led(params, vars, LED_MODE_OPER, vars->line_speed);12290 bnx2x_set_led(params, vars, LED_MODE_OPER, vars->line_speed);
12067}12291}
12068 12292
12069static void bnx2x_set_rx_filter(struct link_params *params, u8 en)12293void bnx2x_set_rx_filter(struct link_params *params, u8 en)
12070{12294{
12071 struct bnx2x *bp = params->bp;12295 struct bnx2x *bp = params->bp;
12072 u8 val = en * 0x1F;12296 u8 val = en * 0x1F;
12073 12297
12074 /* Open the gate between the NIG to the BRB */12298 /* Open / close the gate between the NIG and the BRB */
12075 if (!CHIP_IS_E1x(bp))12299 if (!CHIP_IS_E1x(bp))
12076 val |= en * 0x20;12300 val |= en * 0x20;
12077 REG_WR(bp, NIG_REG_LLH0_BRB1_DRV_MASK + params->port*4, val);12301 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
12345 * Hold it as vars low12569 * Hold it as vars low
12346 */12570 */
12347 /* Clear link led */12571 /* Clear link led */
12348 bnx2x_set_mdio_clk(bp, params->chip_id, port);12572 bnx2x_set_mdio_emac_per_phy(bp, params);
12349 bnx2x_set_led(params, vars, LED_MODE_OFF, 0);12573 bnx2x_set_led(params, vars, LED_MODE_OFF, 0);
12350 12574
12351 if (reset_ext_phy) {12575 if (reset_ext_phy) {
@@ -12696,7 +12920,7 @@ static int bnx2x_8727_common_init_phy(struct bnx2x *bp, · 344 unmodified lines
12696 /* Initiate PHY reset*/12920 /* Initiate PHY reset*/
12697 bnx2x_set_gpio(bp, reset_gpio, MISC_REGISTERS_GPIO_OUTPUT_LOW,12921 bnx2x_set_gpio(bp, reset_gpio, MISC_REGISTERS_GPIO_OUTPUT_LOW,
12698 port);12922 port);
12699 usleep_range(1000, 2000);12923 usleep_range(1000, 2000);
12700 bnx2x_set_gpio(bp, reset_gpio, MISC_REGISTERS_GPIO_OUTPUT_HIGH,12924 bnx2x_set_gpio(bp, reset_gpio, MISC_REGISTERS_GPIO_OUTPUT_HIGH,
12701 port);12925 port);
12702 12926
@@ -12784,7 +13008,8 @@ static int bnx2x_84833_common_init_phy(struct bnx2x *bp, · 81 unmodified lines
12784}13008}
12785 13009
12786static int bnx2x_84833_pre_init_phy(struct bnx2x *bp,13010static int bnx2x_84833_pre_init_phy(struct bnx2x *bp,
12787 struct bnx2x_phy *phy)13011 struct bnx2x_phy *phy,
13012 u8 port)
12788{13013{
12789 u16 val, cnt;13014 u16 val, cnt;
12790 /* Wait for FW completing its initialization. */13015 /* Wait for FW completing its initialization. */
@@ -12794,7 +13019,7 @@ static int bnx2x_84833_pre_init_phy(struct bnx2x *bp, · 3 unmodified lines
12794 MDIO_PMA_REG_CTRL, &val);13019 MDIO_PMA_REG_CTRL, &val);
12795 if (!(val & (1<<15)))13020 if (!(val & (1<<15)))
12796 break;13021 break;
12797 usleep_range(1000, 2000);13022 usleep_range(1000, 2000);
12798 }13023 }
12799 if (cnt >= 1500) {13024 if (cnt >= 1500) {
12800 DP(NETIF_MSG_LINK, "84833 reset timeout\n");13025 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
12811 MDIO_84833_TOP_CFG_XGPHY_STRAP1, val);13036 MDIO_84833_TOP_CFG_XGPHY_STRAP1, val);
12812 13037
12813 /* Save spirom version */13038 /* Save spirom version */
12814 bnx2x_save_848xx_spirom_version(phy, bp, PORT_0);13039 bnx2x_save_848xx_spirom_version(phy, bp, port);
12815 return 0;13040 return 0;
12816}13041}
12817 13042
12818int bnx2x_pre_init_phy(struct bnx2x *bp,13043int bnx2x_pre_init_phy(struct bnx2x *bp,
12819 u32 shmem_base,13044 u32 shmem_base,
12820 u32 shmem2_base,13045 u32 shmem2_base,
12821 u32 chip_id)13046 u32 chip_id,
13047 u8 port)
12822{13048{
12823 int rc = 0;13049 int rc = 0;
12824 struct bnx2x_phy phy;13050 struct bnx2x_phy phy;
12825 bnx2x_set_mdio_clk(bp, chip_id, PORT_0);
12826 if (bnx2x_populate_phy(bp, EXT_PHY1, shmem_base, shmem2_base,13051 if (bnx2x_populate_phy(bp, EXT_PHY1, shmem_base, shmem2_base,
12827 PORT_0, &phy)) {13052 port, &phy) != 0) {
12828 DP(NETIF_MSG_LINK, "populate_phy failed\n");13053 DP(NETIF_MSG_LINK, "populate_phy failed\n");
12829 return -EINVAL;13054 return -EINVAL;
12830 }13055 }
13056 bnx2x_set_mdio_clk(bp, chip_id, phy.mdio_ctrl);
12831 switch (phy.type) {13057 switch (phy.type) {
12832 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833:13058 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);
12834 break;13061 break;
12835 default:13062 default:
12836 break;13063 break;
@@ -12867,6 +13094,7 @@ static int bnx2x_ext_phy_common_init(struct bnx2x *bp, u32 shmem_base_path[], · 30 unmodified lines
12867 phy_index, chip_id);13094 phy_index, chip_id);
12868 break;13095 break;
12869 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833:13096 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833:
13097 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834:
12870 /* GPIO3's are linked, and so both need to be toggled13098 /* GPIO3's are linked, and so both need to be toggled
12871 * to obtain required 2us pulse.13099 * to obtain required 2us pulse.
12872 */13100 */
@@ -12898,8 +13126,9 @@ int bnx2x_common_init_phy(struct bnx2x *bp, u32 shmem_base_path[], · 25 unmodified lines
12898 u32 phy_ver, val;13126 u32 phy_ver, val;
12899 u8 phy_index = 0;13127 u8 phy_index = 0;
12900 u32 ext_phy_type, ext_phy_config;13128 u32 ext_phy_type, ext_phy_config;
12901 bnx2x_set_mdio_clk(bp, chip_id, PORT_0);13129
12902 bnx2x_set_mdio_clk(bp, chip_id, PORT_1);13130 bnx2x_set_mdio_clk(bp, chip_id, GRCBASE_EMAC0);
13131 bnx2x_set_mdio_clk(bp, chip_id, GRCBASE_EMAC1);
12903 DP(NETIF_MSG_LINK, "Begin common phy init\n");13132 DP(NETIF_MSG_LINK, "Begin common phy init\n");
12904 if (CHIP_IS_E3(bp)) {13133 if (CHIP_IS_E3(bp)) {
12905 /* Enable EPIO */13134 /* Enable EPIO */
@@ -12960,6 +13189,7 @@ static void bnx2x_check_over_curr(struct link_params *params, · 54 unmodified lines
12960 " error.\n",13189 " error.\n",
12961 params->port);13190 params->port);
12962 vars->phy_flags |= PHY_OVER_CURRENT_FLAG;13191 vars->phy_flags |= PHY_OVER_CURRENT_FLAG;
13192 bnx2x_warpcore_power_module(params, 0);
12963 }13193 }
12964 } else13194 } else
12965 vars->phy_flags &= ~PHY_OVER_CURRENT_FLAG;13195 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
13139 }13369 }
13140 }13370 }
13141}13371}
13372static 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
13408static 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
13418static 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
13142void bnx2x_period_func(struct link_params *params, struct link_vars *vars)13474void bnx2x_period_func(struct link_params *params, struct link_vars *vars)
13143{13475{
13144 u16 phy_idx;13476 u16 phy_idx;
@@ -13156,6 +13488,9 @@ void bnx2x_period_func(struct link_params *params, struct link_vars *vars) · 11 unmodified lines
13156 if (CHIP_IS_E3(bp)) {13488 if (CHIP_IS_E3(bp)) {
13157 struct bnx2x_phy *phy = &params->phy[INT_PHY];13489 struct bnx2x_phy *phy = &params->phy[INT_PHY];
13158 bnx2x_set_aer_mmd(params, phy);13490 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);
13159 bnx2x_check_over_curr(params, vars);13494 bnx2x_check_over_curr(params, vars);
13160 if (vars->rx_tx_asic_rst)13495 if (vars->rx_tx_asic_rst)
13161 bnx2x_warpcore_config_runtime(phy, params, vars);13496 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
13176 bnx2x_update_mng(params, vars->link_status);13511 bnx2x_update_mng(params, vars->link_status);
13177 }13512 }
13178 }13513 }
13179
13180 }
13181
13182}
13183
13184u8 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;
13198 }13514 }
13199 return 0;
13200}13515}
13201 13516
13202u8 bnx2x_fan_failure_det_req(struct bnx2x *bp,13517u8 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
139 u8 addr;139 u8 addr;
140 u8 def_md_devad;140 u8 def_md_devad;
141 u16 flags;141 u16 flags;
142 /* Require HW lock */
143#define FLAGS_HW_LOCK_REQUIRED (1<<0)
144 /* No Over-Current detection */142 /* No Over-Current detection */
145#define FLAGS_NOC (1<<1)143#define FLAGS_NOC (1<<1)
146 /* Fan failure detection required */144 /* Fan failure detection required */
@@ -156,6 +154,7 @@ struct bnx2x_phy { · 9 unmodified lines
156#define FLAGS_MDC_MDIO_WA_B0 (1<<10)154#define FLAGS_MDC_MDIO_WA_B0 (1<<10)
157#define FLAGS_TX_ERROR_CHECK (1<<12)155#define FLAGS_TX_ERROR_CHECK (1<<12)
158#define FLAGS_EEE (1<<13)156#define FLAGS_EEE (1<<13)
157#define FLAGS_MDC_MDIO_WA_G (1<<15)
159 158
160 /* preemphasis values for the rx side */159 /* preemphasis values for the rx side */
161 u16 rx_preemphasis[4];160 u16 rx_preemphasis[4];
@@ -267,6 +266,9 @@ struct link_params { · 105 unmodified lines
267#define FEATURE_CONFIG_AUTOGREEEN_ENABLED (1<<9)266#define FEATURE_CONFIG_AUTOGREEEN_ENABLED (1<<9)
268#define FEATURE_CONFIG_BC_SUPPORTS_SFP_TX_DISABLED (1<<10)267#define FEATURE_CONFIG_BC_SUPPORTS_SFP_TX_DISABLED (1<<10)
269#define FEATURE_CONFIG_DISABLE_REMOTE_FAULT_DET (1<<11)268#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
270 /* Will be populated during common init */272 /* Will be populated during common init */
271 struct bnx2x_phy phy[MAX_PHYS];273 struct bnx2x_phy phy[MAX_PHYS];
272 274
@@ -347,6 +349,8 @@ struct link_vars { · 74 unmodified lines
347 u8 rx_tx_asic_rst;349 u8 rx_tx_asic_rst;
348 u8 turn_to_run_wc_rt;350 u8 turn_to_run_wc_rt;
349 u16 rsrv2;351 u16 rsrv2;
352 /* The same definitions as the shmem2 parameter */
353 u32 link_attr_sync;
350};354};
351 355
352/***********************************************************/356/***********************************************************/
@@ -418,10 +422,6 @@ int bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 65 unmodified lines
418 422
419void bnx2x_hw_reset_phy(struct link_params *params);423void bnx2x_hw_reset_phy(struct link_params *params);
420 424
421/* Checks if HW lock is required for this phy/board type */
422u8 bnx2x_hw_lock_required(struct bnx2x *bp, u32 shmem_base,
423 u32 shmem2_base);
424
425/* Check swap bit and adjust PHY order */425/* Check swap bit and adjust PHY order */
426u32 bnx2x_phy_selection(struct link_params *params);426u32 bnx2x_phy_selection(struct link_params *params);
427 427
@@ -432,7 +432,8 @@ int bnx2x_phy_probe(struct link_params *params); · 4 unmodified lines
432u8 bnx2x_fan_failure_det_req(struct bnx2x *bp, u32 shmem_base,432u8 bnx2x_fan_failure_det_req(struct bnx2x *bp, u32 shmem_base,
433 u32 shmem2_base, u8 port);433 u32 shmem2_base, u8 port);
434 434
435 435/* Open / close the gate between the NIG and the BRB */
436void bnx2x_set_rx_filter(struct link_params *params, u8 en);
436 437
437/* DCBX structs */438/* DCBX structs */
438 439
@@ -459,9 +460,6 @@ struct bnx2x_nig_brb_pfc_port_params { · 20 unmodified lines
459 u32 rx_cos_priority_mask[DCBX_MAX_NUM_COS];460 u32 rx_cos_priority_mask[DCBX_MAX_NUM_COS];
460 u32 llfc_high_priority_classes;461 u32 llfc_high_priority_classes;
461 u32 llfc_low_priority_classes;462 u32 llfc_low_priority_classes;
462 /* BRB */
463 u32 cos0_pauseable;
464 u32 cos1_pauseable;
465};463};
466 464
467 465
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+728−458
@@ -79,7 +79,7 @@ · 78 unmodified lines
79/* Time in jiffies before concluding the transmitter is hung */79/* Time in jiffies before concluding the transmitter is hung */
80#define TX_TIMEOUT (5*HZ)80#define TX_TIMEOUT (5*HZ)
81 81
82static char version[] __devinitdata =82static char version[] =
83 "Broadcom NetXtreme II 5771x/578xx 10/20-Gigabit Ethernet Driver "83 "Broadcom NetXtreme II 5771x/578xx 10/20-Gigabit Ethernet Driver "
84 DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";84 DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
85 85
@@ -149,7 +149,7 @@ enum bnx2x_board_type { · 63 unmodified lines
149/* indexed by board_type, above */149/* indexed by board_type, above */
150static struct {150static struct {
151 char *name;151 char *name;
152} board_info[] __devinitdata = {152} board_info[] = {
153 { "Broadcom NetXtreme II BCM57710 10 Gigabit PCIe [Everest]" },153 { "Broadcom NetXtreme II BCM57710 10 Gigabit PCIe [Everest]" },
154 { "Broadcom NetXtreme II BCM57711 10 Gigabit PCIe" },154 { "Broadcom NetXtreme II BCM57711 10 Gigabit PCIe" },
155 { "Broadcom NetXtreme II BCM57711E 10 Gigabit PCIe" },155 { "Broadcom NetXtreme II BCM57711E 10 Gigabit PCIe" },
@@ -791,10 +791,9 @@ void bnx2x_panic_dump(struct bnx2x *bp) · 635 unmodified lines
791 791
792 /* host sb data */792 /* host sb data */
793 793
794#ifdef BCM_CNIC
795 if (IS_FCOE_FP(fp))794 if (IS_FCOE_FP(fp))
796 continue;795 continue;
797#endif796
798 BNX2X_ERR(" run indexes (");797 BNX2X_ERR(" run indexes (");
799 for (j = 0; j < HC_SB_MAX_SM; j++)798 for (j = 0; j < HC_SB_MAX_SM; j++)
800 pr_cont("0x%x%s",799 pr_cont("0x%x%s",
@@ -859,7 +858,7 @@ void bnx2x_panic_dump(struct bnx2x *bp) · 58 unmodified lines
859#ifdef BNX2X_STOP_ON_ERROR858#ifdef BNX2X_STOP_ON_ERROR
860 /* Rings */859 /* Rings */
861 /* Rx */860 /* Rx */
862 for_each_rx_queue(bp, i) {861 for_each_valid_rx_queue(bp, i) {
863 struct bnx2x_fastpath *fp = &bp->fp[i];862 struct bnx2x_fastpath *fp = &bp->fp[i];
864 863
865 start = RX_BD(le16_to_cpu(*fp->rx_cons_sb) - 10);864 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
893 }892 }
894 893
895 /* Tx */894 /* Tx */
896 for_each_tx_queue(bp, i) {895 for_each_valid_tx_queue(bp, i) {
897 struct bnx2x_fastpath *fp = &bp->fp[i];896 struct bnx2x_fastpath *fp = &bp->fp[i];
898 for_each_cos_in_tx_queue(fp, cos) {897 for_each_cos_in_tx_queue(fp, cos) {
899 struct bnx2x_fp_txdata *txdata = fp->txdata_ptr[cos];898 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
1483 BNX2X_ERR("BUG! proper val not read from IGU!\n");1482 BNX2X_ERR("BUG! proper val not read from IGU!\n");
1484}1483}
1485 1484
1486void bnx2x_int_disable(struct bnx2x *bp)1485static void bnx2x_int_disable(struct bnx2x *bp)
1487{1486{
1488 if (bp->common.int_block == INT_BLOCK_HC)1487 if (bp->common.int_block == INT_BLOCK_HC)
1489 bnx2x_hc_int_disable(bp);1488 bnx2x_hc_int_disable(bp);
@@ -1504,9 +1503,8 @@ void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw) · 14 unmodified lines
1504 if (msix) {1503 if (msix) {
1505 synchronize_irq(bp->msix_table[0].vector);1504 synchronize_irq(bp->msix_table[0].vector);
1506 offset = 1;1505 offset = 1;
1507#ifdef BCM_CNIC1506 if (CNIC_SUPPORT(bp))
1508 offset++;1507 offset++;
1509#endif
1510 for_each_eth_queue(bp, i)1508 for_each_eth_queue(bp, i)
1511 synchronize_irq(bp->msix_table[offset++].vector);1509 synchronize_irq(bp->msix_table[offset++].vector);
1512 } else1510 } else
@@ -1588,9 +1586,8 @@ static bool bnx2x_trylock_leader_lock(struct bnx2x *bp) · 75 unmodified lines
1588 return bnx2x_trylock_hw_lock(bp, bnx2x_get_leader_lock_resource(bp));1586 return bnx2x_trylock_hw_lock(bp, bnx2x_get_leader_lock_resource(bp));
1589}1587}
1590 1588
1591#ifdef BCM_CNIC
1592static void bnx2x_cnic_cfc_comp(struct bnx2x *bp, int cid, u8 err);1589static void bnx2x_cnic_cfc_comp(struct bnx2x *bp, int cid, u8 err);
1593#endif1590
1594 1591
1595void bnx2x_sp_event(struct bnx2x_fastpath *fp, union eth_rx_cqe *rr_cqe)1592void bnx2x_sp_event(struct bnx2x_fastpath *fp, union eth_rx_cqe *rr_cqe)
1596{1593{
@@ -1720,7 +1717,7 @@ irqreturn_t bnx2x_interrupt(int irq, void *dev_instance) · 123 unmodified lines
1720 for_each_eth_queue(bp, i) {1717 for_each_eth_queue(bp, i) {
1721 struct bnx2x_fastpath *fp = &bp->fp[i];1718 struct bnx2x_fastpath *fp = &bp->fp[i];
1722 1719
1723 mask = 0x2 << (fp->index + CNIC_PRESENT);1720 mask = 0x2 << (fp->index + CNIC_SUPPORT(bp));
1724 if (status & mask) {1721 if (status & mask) {
1725 /* Handle Rx or Tx according to SB id */1722 /* Handle Rx or Tx according to SB id */
1726 prefetch(fp->rx_cons_sb);1723 prefetch(fp->rx_cons_sb);
@@ -1732,22 +1729,23 @@ irqreturn_t bnx2x_interrupt(int irq, void *dev_instance) · 5 unmodified lines
1732 }1729 }
1733 }1730 }
1734 1731
1735#ifdef BCM_CNIC1732 if (CNIC_SUPPORT(bp)) {
1736 mask = 0x2;1733 mask = 0x2;
1737 if (status & (mask | 0x1)) {1734 if (status & (mask | 0x1)) {
1738 struct cnic_ops *c_ops = NULL;1735 struct cnic_ops *c_ops = NULL;
1739 1736
1740 if (likely(bp->state == BNX2X_STATE_OPEN)) {1737 if (likely(bp->state == BNX2X_STATE_OPEN)) {
1741 rcu_read_lock();1738 rcu_read_lock();
1742 c_ops = rcu_dereference(bp->cnic_ops);1739 c_ops = rcu_dereference(bp->cnic_ops);
1743 if (c_ops)1740 if (c_ops)
1744 c_ops->cnic_handler(bp->cnic_data, NULL);1741 c_ops->cnic_handler(bp->cnic_data,
1745 rcu_read_unlock();1742 NULL);
1746 }1743 rcu_read_unlock();
1744 }
1747 1745
1748 status &= ~mask;1746 status &= ~mask;
1747 }
1749 }1748 }
1750#endif
1751 1749
1752 if (unlikely(status & 0x1)) {1750 if (unlikely(status & 0x1)) {
1753 queue_delayed_work(bnx2x_wq, &bp->sp_task, 0);1751 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
2034 return 0;2032 return 0;
2035}2033}
2036 2034
2037static int bnx2x_set_spio(struct bnx2x *bp, int spio_num, u32 mode)2035static int bnx2x_set_spio(struct bnx2x *bp, int spio, u32 mode)
2038{2036{
2039 u32 spio_mask = (1 << spio_num);
2040 u32 spio_reg;2037 u32 spio_reg;
2041 2038
2042 if ((spio_num < MISC_REGISTERS_SPIO_4) ||2039 /* Only 2 SPIOs are configurable */
2043 (spio_num > MISC_REGISTERS_SPIO_7)) {2040 if ((spio != MISC_SPIO_SPIO4) && (spio != MISC_SPIO_SPIO5)) {
2044 BNX2X_ERR("Invalid SPIO %d\n", spio_num);2041 BNX2X_ERR("Invalid SPIO 0x%x\n", spio);
2045 return -EINVAL;2042 return -EINVAL;
2046 }2043 }
2047 2044
2048 bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_SPIO);2045 bnx2x_acquire_hw_lock(bp, HW_LOCK_RESOURCE_SPIO);
2049 /* read SPIO and mask except the float bits */2046 /* 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);
2051 2048
2052 switch (mode) {2049 switch (mode) {
2053 case MISC_REGISTERS_SPIO_OUTPUT_LOW:2050 case MISC_SPIO_OUTPUT_LOW:
2054 DP(NETIF_MSG_HW, "Set SPIO %d -> output low\n", spio_num);2051 DP(NETIF_MSG_HW, "Set SPIO 0x%x -> output low\n", spio);
2055 /* clear FLOAT and set CLR */2052 /* clear FLOAT and set CLR */
2056 spio_reg &= ~(spio_mask << MISC_REGISTERS_SPIO_FLOAT_POS);2053 spio_reg &= ~(spio << MISC_SPIO_FLOAT_POS);
2057 spio_reg |= (spio_mask << MISC_REGISTERS_SPIO_CLR_POS);2054 spio_reg |= (spio << MISC_SPIO_CLR_POS);
2058 break;2055 break;
2059 2056
2060 case MISC_REGISTERS_SPIO_OUTPUT_HIGH:2057 case MISC_SPIO_OUTPUT_HIGH:
2061 DP(NETIF_MSG_HW, "Set SPIO %d -> output high\n", spio_num);2058 DP(NETIF_MSG_HW, "Set SPIO 0x%x -> output high\n", spio);
2062 /* clear FLOAT and set SET */2059 /* clear FLOAT and set SET */
2063 spio_reg &= ~(spio_mask << MISC_REGISTERS_SPIO_FLOAT_POS);2060 spio_reg &= ~(spio << MISC_SPIO_FLOAT_POS);
2064 spio_reg |= (spio_mask << MISC_REGISTERS_SPIO_SET_POS);2061 spio_reg |= (spio << MISC_SPIO_SET_POS);
2065 break;2062 break;
2066 2063
2067 case MISC_REGISTERS_SPIO_INPUT_HI_Z:2064 case MISC_SPIO_INPUT_HI_Z:
2068 DP(NETIF_MSG_HW, "Set SPIO %d -> input\n", spio_num);2065 DP(NETIF_MSG_HW, "Set SPIO 0x%x -> input\n", spio);
2069 /* set FLOAT */2066 /* set FLOAT */
2070 spio_reg |= (spio_mask << MISC_REGISTERS_SPIO_FLOAT_POS);2067 spio_reg |= (spio << MISC_SPIO_FLOAT_POS);
2071 break;2068 break;
2072 2069
2073 default:2070 default:
@@ -2106,22 +2103,25 @@ void bnx2x_calc_fc_adv(struct bnx2x *bp) · 32 unmodified lines
2106 }2103 }
2107}2104}
2108 2105
2109u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode)2106static void bnx2x_set_requested_fc(struct bnx2x *bp)
2110{2107{
2111 if (!BP_NOMCP(bp)) {2108 /* Initialize link parameters structure variables
2112 u8 rc;2109 * It is recommended to turn off RX FC for jumbo frames
2113 int cfx_idx = bnx2x_get_link_cfg_idx(bp);2110 * for better performance
2114 u16 req_line_speed = bp->link_params.req_line_speed[cfx_idx];2111 */
2115 /*2112 if (CHIP_IS_E1x(bp) && (bp->dev->mtu > 5000))
2116 * Initialize link parameters structure variables2113 bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_TX;
2117 * It is recommended to turn off RX FC for jumbo frames2114 else
2118 * for better performance2115 bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_BOTH;
2119 */2116}
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;
2124 2117
2118int 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);
2125 bnx2x_acquire_phy_lock(bp);2125 bnx2x_acquire_phy_lock(bp);
2126 2126
2127 if (load_mode == LOAD_DIAG) {2127 if (load_mode == LOAD_DIAG) {
@@ -2150,11 +2150,11 @@ u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) · 22 unmodified lines
2150 2150
2151 bnx2x_calc_fc_adv(bp);2151 bnx2x_calc_fc_adv(bp);
2152 2152
2153 if (CHIP_REV_IS_SLOW(bp) && bp->link_vars.link_up) {2153 if (bp->link_vars.link_up) {
2154 bnx2x_stats_handle(bp, STATS_EVENT_LINK_UP);2154 bnx2x_stats_handle(bp, STATS_EVENT_LINK_UP);
2155 bnx2x_link_report(bp);2155 bnx2x_link_report(bp);
2156 } else2156 }
2157 queue_delayed_work(bnx2x_wq, &bp->period_task, 0);2157 queue_delayed_work(bnx2x_wq, &bp->period_task, 0);
2158 bp->link_params.req_line_speed[cfx_idx] = req_line_speed;2158 bp->link_params.req_line_speed[cfx_idx] = req_line_speed;
2159 return rc;2159 return rc;
2160 }2160 }
@@ -3075,11 +3075,13 @@ static void bnx2x_drv_info_ether_stat(struct bnx2x *bp) · 914 unmodified lines
3075 3075
3076static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp)3076static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp)
3077{3077{
3078#ifdef BCM_CNIC
3079 struct bnx2x_dcbx_app_params *app = &bp->dcbx_port_params.app;3078 struct bnx2x_dcbx_app_params *app = &bp->dcbx_port_params.app;
3080 struct fcoe_stats_info *fcoe_stat =3079 struct fcoe_stats_info *fcoe_stat =
3081 &bp->slowpath->drv_info_to_mcp.fcoe_stat;3080 &bp->slowpath->drv_info_to_mcp.fcoe_stat;
3082 3081
3082 if (!CNIC_LOADED(bp))
3083 return;
3084
3083 memcpy(fcoe_stat->mac_local + MAC_LEADING_ZERO_CNT,3085 memcpy(fcoe_stat->mac_local + MAC_LEADING_ZERO_CNT,
3084 bp->fip_mac, ETH_ALEN);3086 bp->fip_mac, ETH_ALEN);
3085 3087
@@ -3162,16 +3164,17 @@ static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp) · 76 unmodified lines
3162 3164
3163 /* ask L5 driver to add data to the struct */3165 /* ask L5 driver to add data to the struct */
3164 bnx2x_cnic_notify(bp, CNIC_CTL_FCOE_STATS_GET_CMD);3166 bnx2x_cnic_notify(bp, CNIC_CTL_FCOE_STATS_GET_CMD);
3165#endif
3166}3167}
3167 3168
3168static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp)3169static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp)
3169{3170{
3170#ifdef BCM_CNIC
3171 struct bnx2x_dcbx_app_params *app = &bp->dcbx_port_params.app;3171 struct bnx2x_dcbx_app_params *app = &bp->dcbx_port_params.app;
3172 struct iscsi_stats_info *iscsi_stat =3172 struct iscsi_stats_info *iscsi_stat =
3173 &bp->slowpath->drv_info_to_mcp.iscsi_stat;3173 &bp->slowpath->drv_info_to_mcp.iscsi_stat;
3174 3174
3175 if (!CNIC_LOADED(bp))
3176 return;
3177
3175 memcpy(iscsi_stat->mac_local + MAC_LEADING_ZERO_CNT,3178 memcpy(iscsi_stat->mac_local + MAC_LEADING_ZERO_CNT,
3176 bp->cnic_eth_dev.iscsi_mac, ETH_ALEN);3179 bp->cnic_eth_dev.iscsi_mac, ETH_ALEN);
3177 3180
@@ -3180,7 +3183,6 @@ static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp) · 2 unmodified lines
3180 3183
3181 /* ask L5 driver to add data to the struct */3184 /* ask L5 driver to add data to the struct */
3182 bnx2x_cnic_notify(bp, CNIC_CTL_ISCSI_STATS_GET_CMD);3185 bnx2x_cnic_notify(bp, CNIC_CTL_ISCSI_STATS_GET_CMD);
3183#endif
3184}3186}
3185 3187
3186/* called due to MCP event (on pmf):3188/* 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
3589 3591
3590 /* now set back the mask */3592 /* now set back the mask */
3591 if (asserted & ATTN_NIG_FOR_FUNC) {3593 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 }
3592 REG_WR(bp, nig_int_mask_addr, nig_mask);3609 REG_WR(bp, nig_int_mask_addr, nig_mask);
3593 bnx2x_release_phy_lock(bp);3610 bnx2x_release_phy_lock(bp);
3594 }3611 }
@@ -4572,7 +4589,6 @@ static void bnx2x_update_eq_prod(struct bnx2x *bp, u16 prod) · 977 unmodified lines
4572 mmiowb(); /* keep prod updates ordered */4589 mmiowb(); /* keep prod updates ordered */
4573}4590}
4574 4591
4575#ifdef BCM_CNIC
4576static int bnx2x_cnic_handle_cfc_del(struct bnx2x *bp, u32 cid,4592static int bnx2x_cnic_handle_cfc_del(struct bnx2x *bp, u32 cid,
4577 union event_ring_elem *elem)4593 union event_ring_elem *elem)
4578{4594{
@@ -4594,7 +4610,6 @@ static int bnx2x_cnic_handle_cfc_del(struct bnx2x *bp, u32 cid, · 15 unmodified lines
4594 bnx2x_cnic_cfc_comp(bp, cid, err);4610 bnx2x_cnic_cfc_comp(bp, cid, err);
4595 return 0;4611 return 0;
4596}4612}
4597#endif
4598 4613
4599static void bnx2x_handle_mcast_eqe(struct bnx2x *bp)4614static void bnx2x_handle_mcast_eqe(struct bnx2x *bp)
4600{4615{
@@ -4635,11 +4650,9 @@ static void bnx2x_handle_classification_eqe(struct bnx2x *bp, · 34 unmodified lines
4635 switch (elem->message.data.eth_event.echo >> BNX2X_SWCID_SHIFT) {4650 switch (elem->message.data.eth_event.echo >> BNX2X_SWCID_SHIFT) {
4636 case BNX2X_FILTER_MAC_PENDING:4651 case BNX2X_FILTER_MAC_PENDING:
4637 DP(BNX2X_MSG_SP, "Got SETUP_MAC completions\n");4652 DP(BNX2X_MSG_SP, "Got SETUP_MAC completions\n");
4638#ifdef BCM_CNIC4653 if (CNIC_LOADED(bp) && (cid == BNX2X_ISCSI_ETH_CID(bp)))
4639 if (cid == BNX2X_ISCSI_ETH_CID(bp))
4640 vlan_mac_obj = &bp->iscsi_l2_mac_obj;4654 vlan_mac_obj = &bp->iscsi_l2_mac_obj;
4641 else4655 else
4642#endif
4643 vlan_mac_obj = &bp->sp_objs[cid].mac_obj;4656 vlan_mac_obj = &bp->sp_objs[cid].mac_obj;
4644 4657
4645 break;4658 break;
@@ -4665,9 +4678,7 @@ static void bnx2x_handle_classification_eqe(struct bnx2x *bp, · 19 unmodified lines
4665 4678
4666}4679}
4667 4680
4668#ifdef BCM_CNIC
4669static void bnx2x_set_iscsi_eth_rx_mode(struct bnx2x *bp, bool start);4681static void bnx2x_set_iscsi_eth_rx_mode(struct bnx2x *bp, bool start);
4670#endif
4671 4682
4672static void bnx2x_handle_rx_mode_eqe(struct bnx2x *bp)4683static void bnx2x_handle_rx_mode_eqe(struct bnx2x *bp)
4673{4684{
@@ -4678,14 +4689,12 @@ static void bnx2x_handle_rx_mode_eqe(struct bnx2x *bp) · 4 unmodified lines
4678 /* Send rx_mode command again if was requested */4689 /* Send rx_mode command again if was requested */
4679 if (test_and_clear_bit(BNX2X_FILTER_RX_MODE_SCHED, &bp->sp_state))4690 if (test_and_clear_bit(BNX2X_FILTER_RX_MODE_SCHED, &bp->sp_state))
4680 bnx2x_set_storm_rx_mode(bp);4691 bnx2x_set_storm_rx_mode(bp);
4681#ifdef BCM_CNIC
4682 else if (test_and_clear_bit(BNX2X_FILTER_ISCSI_ETH_START_SCHED,4692 else if (test_and_clear_bit(BNX2X_FILTER_ISCSI_ETH_START_SCHED,
4683 &bp->sp_state))4693 &bp->sp_state))
4684 bnx2x_set_iscsi_eth_rx_mode(bp, true);4694 bnx2x_set_iscsi_eth_rx_mode(bp, true);
4685 else if (test_and_clear_bit(BNX2X_FILTER_ISCSI_ETH_STOP_SCHED,4695 else if (test_and_clear_bit(BNX2X_FILTER_ISCSI_ETH_STOP_SCHED,
4686 &bp->sp_state))4696 &bp->sp_state))
4687 bnx2x_set_iscsi_eth_rx_mode(bp, false);4697 bnx2x_set_iscsi_eth_rx_mode(bp, false);
4688#endif
4689 4698
4690 netif_addr_unlock_bh(bp->dev);4699 netif_addr_unlock_bh(bp->dev);
4691}4700}
@@ -4747,7 +4756,6 @@ static void bnx2x_after_function_update(struct bnx2x *bp) · 55 unmodified lines
4747 q);4756 q);
4748 }4757 }
4749 4758
4750#ifdef BCM_CNIC
4751 if (!NO_FCOE(bp)) {4759 if (!NO_FCOE(bp)) {
4752 fp = &bp->fp[FCOE_IDX(bp)];4760 fp = &bp->fp[FCOE_IDX(bp)];
4753 queue_params.q_obj = &bnx2x_sp_obj(bp, fp).q_obj;4761 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
4770 bnx2x_link_report(bp);4778 bnx2x_link_report(bp);
4771 bnx2x_fw_command(bp, DRV_MSG_CODE_AFEX_VIFSET_ACK, 0);4779 bnx2x_fw_command(bp, DRV_MSG_CODE_AFEX_VIFSET_ACK, 0);
4772 }4780 }
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 */
4778}4781}
4779 4782
4780static struct bnx2x_queue_sp_obj *bnx2x_cid_to_q_obj(4783static struct bnx2x_queue_sp_obj *bnx2x_cid_to_q_obj(
4781 struct bnx2x *bp, u32 cid)4784 struct bnx2x *bp, u32 cid)
4782{4785{
4783 DP(BNX2X_MSG_SP, "retrieving fp from cid %d\n", cid);4786 DP(BNX2X_MSG_SP, "retrieving fp from cid %d\n", cid);
4784#ifdef BCM_CNIC4787
4785 if (cid == BNX2X_FCOE_ETH_CID(bp))4788 if (CNIC_LOADED(bp) && (cid == BNX2X_FCOE_ETH_CID(bp)))
4786 return &bnx2x_fcoe_sp_obj(bp, q_obj);4789 return &bnx2x_fcoe_sp_obj(bp, q_obj);
4787 else4790 else
4788#endif
4789 return &bp->sp_objs[CID_TO_FP(cid, bp)].q_obj;4791 return &bp->sp_objs[CID_TO_FP(cid, bp)].q_obj;
4790}4792}
4791 4793
@@ -4793,6 +4795,7 @@ static void bnx2x_eq_int(struct bnx2x *bp) · 1 unmodified line
4793{4795{
4794 u16 hw_cons, sw_cons, sw_prod;4796 u16 hw_cons, sw_cons, sw_prod;
4795 union event_ring_elem *elem;4797 union event_ring_elem *elem;
4798 u8 echo;
4796 u32 cid;4799 u32 cid;
4797 u8 opcode;4800 u8 opcode;
4798 int spqe_cnt = 0;4801 int spqe_cnt = 0;
@@ -4847,10 +4850,11 @@ static void bnx2x_eq_int(struct bnx2x *bp) · 48 unmodified lines
4847 */4850 */
4848 DP(BNX2X_MSG_SP,4851 DP(BNX2X_MSG_SP,
4849 "got delete ramrod for MULTI[%d]\n", cid);4852 "got delete ramrod for MULTI[%d]\n", cid);
4850#ifdef BCM_CNIC4853
4851 if (!bnx2x_cnic_handle_cfc_del(bp, cid, elem))4854 if (CNIC_LOADED(bp) &&
4855 !bnx2x_cnic_handle_cfc_del(bp, cid, elem))
4852 goto next_spqe;4856 goto next_spqe;
4853#endif4857
4854 q_obj = bnx2x_cid_to_q_obj(bp, cid);4858 q_obj = bnx2x_cid_to_q_obj(bp, cid);
4855 4859
4856 if (q_obj->complete_cmd(bp, q_obj, BNX2X_Q_CMD_CFC_DEL))4860 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
4875 break;4879 break;
4876 bnx2x_dcbx_set_params(bp, BNX2X_DCBX_STATE_TX_RELEASED);4880 bnx2x_dcbx_set_params(bp, BNX2X_DCBX_STATE_TX_RELEASED);
4877 goto next_spqe;4881 goto next_spqe;
4882
4878 case EVENT_RING_OPCODE_FUNCTION_UPDATE:4883 case EVENT_RING_OPCODE_FUNCTION_UPDATE:
4879 DP(BNX2X_MSG_SP | BNX2X_MSG_MCP,4884 echo = elem->message.data.function_update_event.echo;
4880 "AFEX: ramrod completed FUNCTION_UPDATE\n");4885 if (echo == SWITCH_UPDATE) {
4881 f_obj->complete_cmd(bp, f_obj, BNX2X_F_CMD_AFEX_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;
4882 4891
4883 /* We will perform the Queues update from sp_rtnl task4892 } else {
4884 * as all Queue SP operations should run under4893 DP(BNX2X_MSG_SP | BNX2X_MSG_MCP,
4885 * rtnl_lock.4894 "AFEX: ramrod completed FUNCTION_UPDATE\n");
4886 */4895 f_obj->complete_cmd(bp, f_obj,
4887 smp_mb__before_clear_bit();4896 BNX2X_F_CMD_AFEX_UPDATE);
4888 set_bit(BNX2X_SP_RTNL_AFEX_F_UPDATE,4897
4889 &bp->sp_rtnl_state);4898 /* We will perform the Queues update from
4890 smp_mb__after_clear_bit();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 }
4891 4909
4892 schedule_delayed_work(&bp->sp_rtnl_task, 0);
4893 goto next_spqe;4910 goto next_spqe;
4894 4911
4895 case EVENT_RING_OPCODE_AFEX_VIF_LISTS:4912 case EVENT_RING_OPCODE_AFEX_VIF_LISTS:
@@ -4999,11 +5016,10 @@ static void bnx2x_sp_task(struct work_struct *work) · 103 unmodified lines
4999 5016
5000 /* SP events: STAT_QUERY and others */5017 /* SP events: STAT_QUERY and others */
5001 if (status & BNX2X_DEF_SB_IDX) {5018 if (status & BNX2X_DEF_SB_IDX) {
5002#ifdef BCM_CNIC
5003 struct bnx2x_fastpath *fp = bnx2x_fcoe_fp(bp);5019 struct bnx2x_fastpath *fp = bnx2x_fcoe_fp(bp);
5004 5020
5005 if ((!NO_FCOE(bp)) &&5021 if (FCOE_INIT(bp) &&
5006 (bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))) {5022 (bnx2x_has_rx_work(fp) || bnx2x_has_tx_work(fp))) {
5007 /*5023 /*
5008 * Prevent local bottom-halves from running as5024 * Prevent local bottom-halves from running as
5009 * we are going to change the local NAPI list.5025 * 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
5012 napi_schedule(&bnx2x_fcoe(bp, napi));5028 napi_schedule(&bnx2x_fcoe(bp, napi));
5013 local_bh_enable();5029 local_bh_enable();
5014 }5030 }
5015#endif5031
5016 /* Handle EQ completions */5032 /* Handle EQ completions */
5017 bnx2x_eq_int(bp);5033 bnx2x_eq_int(bp);
5018 5034
@@ -5050,8 +5066,7 @@ irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) · 31 unmodified lines
5050 return IRQ_HANDLED;5066 return IRQ_HANDLED;
5051#endif5067#endif
5052 5068
5053#ifdef BCM_CNIC5069 if (CNIC_LOADED(bp)) {
5054 {
5055 struct cnic_ops *c_ops;5070 struct cnic_ops *c_ops;
5056 5071
5057 rcu_read_lock();5072 rcu_read_lock();
@@ -5060,7 +5075,7 @@ irqreturn_t bnx2x_msix_sp_int(int irq, void *dev_instance) · 2 unmodified lines
5060 c_ops->cnic_handler(bp->cnic_data, NULL);5075 c_ops->cnic_handler(bp->cnic_data, NULL);
5061 rcu_read_unlock();5076 rcu_read_unlock();
5062 }5077 }
5063#endif5078
5064 queue_delayed_work(bnx2x_wq, &bp->sp_task, 0);5079 queue_delayed_work(bnx2x_wq, &bp->sp_task, 0);
5065 5080
5066 return IRQ_HANDLED;5081 return IRQ_HANDLED;
@@ -5498,12 +5513,10 @@ void bnx2x_set_storm_rx_mode(struct bnx2x *bp) · 431 unmodified lines
5498 unsigned long rx_mode_flags = 0, ramrod_flags = 0;5513 unsigned long rx_mode_flags = 0, ramrod_flags = 0;
5499 unsigned long rx_accept_flags = 0, tx_accept_flags = 0;5514 unsigned long rx_accept_flags = 0, tx_accept_flags = 0;
5500 5515
5501#ifdef BCM_CNIC
5502 if (!NO_FCOE(bp))5516 if (!NO_FCOE(bp))
5503 5517
5504 /* Configure rx_mode of FCoE Queue */5518 /* Configure rx_mode of FCoE Queue */
5505 __set_bit(BNX2X_RX_MODE_FCOE_ETH, &rx_mode_flags);5519 __set_bit(BNX2X_RX_MODE_FCOE_ETH, &rx_mode_flags);
5506#endif
5507 5520
5508 switch (bp->rx_mode) {5521 switch (bp->rx_mode) {
5509 case BNX2X_RX_MODE_NONE:5522 case BNX2X_RX_MODE_NONE:
@@ -5624,12 +5637,12 @@ static void bnx2x_init_internal(struct bnx2x *bp, u32 load_code) · 114 unmodified lines
5624 5637
5625static inline u8 bnx2x_fp_igu_sb_id(struct bnx2x_fastpath *fp)5638static inline u8 bnx2x_fp_igu_sb_id(struct bnx2x_fastpath *fp)
5626{5639{
5627 return fp->bp->igu_base_sb + fp->index + CNIC_PRESENT;5640 return fp->bp->igu_base_sb + fp->index + CNIC_SUPPORT(fp->bp);
5628}5641}
5629 5642
5630static inline u8 bnx2x_fp_fw_sb_id(struct bnx2x_fastpath *fp)5643static inline u8 bnx2x_fp_fw_sb_id(struct bnx2x_fastpath *fp)
5631{5644{
5632 return fp->bp->base_fw_ndsb + fp->index + CNIC_PRESENT;5645 return fp->bp->base_fw_ndsb + fp->index + CNIC_SUPPORT(fp->bp);
5633}5646}
5634 5647
5635static u8 bnx2x_fp_cl_id(struct bnx2x_fastpath *fp)5648static 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
5720 txdata->tx_pkt = 0;5733 txdata->tx_pkt = 0;
5721}5734}
5722 5735
5736static 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}
5723static void bnx2x_init_tx_rings(struct bnx2x *bp)5743static void bnx2x_init_tx_rings(struct bnx2x *bp)
5724{5744{
5725 int i;5745 int i;
5726 u8 cos;5746 u8 cos;
5727 5747
5728 for_each_tx_queue(bp, i)5748 for_each_eth_queue(bp, i)
5729 for_each_cos_in_tx_queue(&bp->fp[i], cos)5749 for_each_cos_in_tx_queue(&bp->fp[i], cos)
5730 bnx2x_init_tx_ring_one(bp->fp[i].txdata_ptr[cos]);5750 bnx2x_init_tx_ring_one(bp->fp[i].txdata_ptr[cos]);
5731}5751}
5732 5752
5733void bnx2x_nic_init(struct bnx2x *bp, u32 load_code)5753void bnx2x_nic_init_cnic(struct bnx2x *bp)
5734{5754{
5735 int i;
5736
5737 for_each_eth_queue(bp, i)
5738 bnx2x_init_eth_fp(bp, i);
5739#ifdef BCM_CNIC
5740 if (!NO_FCOE(bp))5755 if (!NO_FCOE(bp))
5741 bnx2x_init_fcoe_fp(bp);5756 bnx2x_init_fcoe_fp(bp);
5742 5757
@@ -5744,8 +5759,22 @@ void bnx2x_nic_init(struct bnx2x *bp, u32 load_code) · 1 unmodified line
5744 BNX2X_VF_ID_INVALID, false,5759 BNX2X_VF_ID_INVALID, false,
5745 bnx2x_cnic_fw_sb_id(bp), bnx2x_cnic_igu_sb_id(bp));5760 bnx2x_cnic_fw_sb_id(bp), bnx2x_cnic_igu_sb_id(bp));
5746 5761
5747#endif5762 /* 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}
5748 5771
5772void 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);
5749 /* Initialize MOD_ABS interrupts */5778 /* Initialize MOD_ABS interrupts */
5750 bnx2x_init_mod_abs_int(bp, &bp->link_vars, bp->common.chip_id,5779 bnx2x_init_mod_abs_int(bp, &bp->link_vars, bp->common.chip_id,
5751 bp->common.shmem_base, bp->common.shmem2_base,5780 bp->common.shmem_base, bp->common.shmem2_base,
@@ -6031,10 +6060,9 @@ static int bnx2x_int_mem_test(struct bnx2x *bp) · 279 unmodified lines
6031 msleep(50);6060 msleep(50);
6032 bnx2x_init_block(bp, BLOCK_BRB1, PHASE_COMMON);6061 bnx2x_init_block(bp, BLOCK_BRB1, PHASE_COMMON);
6033 bnx2x_init_block(bp, BLOCK_PRS, PHASE_COMMON);6062 bnx2x_init_block(bp, BLOCK_PRS, PHASE_COMMON);
6034#ifndef BCM_CNIC6063 if (!CNIC_SUPPORT(bp))
6035 /* set NIC mode */6064 /* set NIC mode */
6036 REG_WR(bp, PRS_REG_NIC_MODE, 1);6065 REG_WR(bp, PRS_REG_NIC_MODE, 1);
6037#endif
6038 6066
6039 /* Enable inputs of parser neighbor blocks */6067 /* Enable inputs of parser neighbor blocks */
6040 REG_WR(bp, TSDM_REG_ENABLE_IN1, 0x7fffffff);6068 REG_WR(bp, TSDM_REG_ENABLE_IN1, 0x7fffffff);
@@ -6049,6 +6077,8 @@ static int bnx2x_int_mem_test(struct bnx2x *bp) · 8 unmodified lines
6049 6077
6050static void bnx2x_enable_blocks_attention(struct bnx2x *bp)6078static void bnx2x_enable_blocks_attention(struct bnx2x *bp)
6051{6079{
6080 u32 val;
6081
6052 REG_WR(bp, PXP_REG_PXP_INT_MASK_0, 0);6082 REG_WR(bp, PXP_REG_PXP_INT_MASK_0, 0);
6053 if (!CHIP_IS_E1x(bp))6083 if (!CHIP_IS_E1x(bp))
6054 REG_WR(bp, PXP_REG_PXP_INT_MASK_1, 0x40);6084 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
6082/* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_0, 0); */6112/* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_0, 0); */
6083/* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_1, 0); */6113/* REG_WR(bp, CSEM_REG_CSEM_INT_MASK_1, 0); */
6084 6114
6085 if (CHIP_REV_IS_FPGA(bp))6115 val = PXP2_PXP2_INT_MASK_0_REG_PGL_CPL_AFT |
6086 REG_WR(bp, PXP2_REG_PXP2_INT_MASK_0, 0x580000);6116 PXP2_PXP2_INT_MASK_0_REG_PGL_CPL_OF |
6087 else if (!CHIP_IS_E1x(bp))6117 PXP2_PXP2_INT_MASK_0_REG_PGL_PCIE_ATTN;
6088 REG_WR(bp, PXP2_REG_PXP2_INT_MASK_0,6118 if (!CHIP_IS_E1x(bp))
6089 (PXP2_PXP2_INT_MASK_0_REG_PGL_CPL_OF6119 val |= PXP2_PXP2_INT_MASK_0_REG_PGL_READ_BLOCKED |
6090 | PXP2_PXP2_INT_MASK_0_REG_PGL_CPL_AFT6120 PXP2_PXP2_INT_MASK_0_REG_PGL_WRITE_BLOCKED;
6091 | PXP2_PXP2_INT_MASK_0_REG_PGL_PCIE_ATTN6121 REG_WR(bp, PXP2_REG_PXP2_INT_MASK_0, val);
6092 | PXP2_PXP2_INT_MASK_0_REG_PGL_READ_BLOCKED6122
6093 | PXP2_PXP2_INT_MASK_0_REG_PGL_WRITE_BLOCKED));
6094 else
6095 REG_WR(bp, PXP2_REG_PXP2_INT_MASK_0, 0x480000);
6096 REG_WR(bp, TSDM_REG_TSDM_INT_MASK_0, 0);6123 REG_WR(bp, TSDM_REG_TSDM_INT_MASK_0, 0);
6097 REG_WR(bp, TSDM_REG_TSDM_INT_MASK_1, 0);6124 REG_WR(bp, TSDM_REG_TSDM_INT_MASK_1, 0);
6098 REG_WR(bp, TCM_REG_TCM_INT_MASK, 0);6125 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
6185 return;6212 return;
6186 6213
6187 /* Fan failure is indicated by SPIO 5 */6214 /* Fan failure is indicated by SPIO 5 */
6188 bnx2x_set_spio(bp, MISC_REGISTERS_SPIO_5,6215 bnx2x_set_spio(bp, MISC_SPIO_SPIO5, MISC_SPIO_INPUT_HI_Z);
6189 MISC_REGISTERS_SPIO_INPUT_HI_Z);
6190 6216
6191 /* set to active low mode */6217 /* set to active low mode */
6192 val = REG_RD(bp, MISC_REG_SPIO_INT);6218 val = REG_RD(bp, MISC_REG_SPIO_INT);
6193 val |= ((1 << MISC_REGISTERS_SPIO_5) <<6219 val |= (MISC_SPIO_SPIO5 << MISC_SPIO_INT_OLD_SET_POS);
6194 MISC_REGISTERS_SPIO_INT_OLD_SET_POS);
6195 REG_WR(bp, MISC_REG_SPIO_INT, val);6220 REG_WR(bp, MISC_REG_SPIO_INT, val);
6196 6221
6197 /* enable interrupt to signal the IGU */6222 /* enable interrupt to signal the IGU */
6198 val = REG_RD(bp, MISC_REG_SPIO_EVENT_EN);6223 val = REG_RD(bp, MISC_REG_SPIO_EVENT_EN);
6199 val |= (1 << MISC_REGISTERS_SPIO_5);6224 val |= MISC_SPIO_SPIO5;
6200 REG_WR(bp, MISC_REG_SPIO_EVENT_EN, val);6225 REG_WR(bp, MISC_REG_SPIO_EVENT_EN, val);
6201}6226}
6202 6227
@@ -6256,6 +6281,10 @@ void bnx2x_pf_disable(struct bnx2x *bp) · 53 unmodified lines
6256static void bnx2x__common_init_phy(struct bnx2x *bp)6281static void bnx2x__common_init_phy(struct bnx2x *bp)
6257{6282{
6258 u32 shmem_base[2], shmem2_base[2];6283 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;
6259 shmem_base[0] = bp->common.shmem_base;6288 shmem_base[0] = bp->common.shmem_base;
6260 shmem2_base[0] = bp->common.shmem2_base;6289 shmem2_base[0] = bp->common.shmem2_base;
6261 if (!CHIP_IS_E1x(bp)) {6290 if (!CHIP_IS_E1x(bp)) {
@@ -6522,9 +6551,8 @@ static int bnx2x_init_hw_common(struct bnx2x *bp) · 260 unmodified lines
6522 REG_WR(bp, QM_REG_SOFT_RESET, 1);6551 REG_WR(bp, QM_REG_SOFT_RESET, 1);
6523 REG_WR(bp, QM_REG_SOFT_RESET, 0);6552 REG_WR(bp, QM_REG_SOFT_RESET, 0);
6524 6553
6525#ifdef BCM_CNIC6554 if (CNIC_SUPPORT(bp))
6526 bnx2x_init_block(bp, BLOCK_TM, PHASE_COMMON);6555 bnx2x_init_block(bp, BLOCK_TM, PHASE_COMMON);
6527#endif
6528 6556
6529 bnx2x_init_block(bp, BLOCK_DORQ, PHASE_COMMON);6557 bnx2x_init_block(bp, BLOCK_DORQ, PHASE_COMMON);
6530 REG_WR(bp, DORQ_REG_DPM_CID_OFST, BNX2X_DB_SHIFT);6558 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
6611 6639
6612 bnx2x_init_block(bp, BLOCK_SRC, PHASE_COMMON);6640 bnx2x_init_block(bp, BLOCK_SRC, PHASE_COMMON);
6613 6641
6614#ifdef BCM_CNIC6642 if (CNIC_SUPPORT(bp)) {
6615 REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672);6643 REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672);
6616 REG_WR(bp, SRC_REG_KEYSEARCH_1, 0x24b8f2cc);6644 REG_WR(bp, SRC_REG_KEYSEARCH_1, 0x24b8f2cc);
6617 REG_WR(bp, SRC_REG_KEYSEARCH_2, 0x223aef9b);6645 REG_WR(bp, SRC_REG_KEYSEARCH_2, 0x223aef9b);
6618 REG_WR(bp, SRC_REG_KEYSEARCH_3, 0x26001e3a);6646 REG_WR(bp, SRC_REG_KEYSEARCH_3, 0x26001e3a);
6619 REG_WR(bp, SRC_REG_KEYSEARCH_4, 0x7ae91116);6647 REG_WR(bp, SRC_REG_KEYSEARCH_4, 0x7ae91116);
6620 REG_WR(bp, SRC_REG_KEYSEARCH_5, 0x5ce5230b);6648 REG_WR(bp, SRC_REG_KEYSEARCH_5, 0x5ce5230b);
6621 REG_WR(bp, SRC_REG_KEYSEARCH_6, 0x298d8adf);6649 REG_WR(bp, SRC_REG_KEYSEARCH_6, 0x298d8adf);
6622 REG_WR(bp, SRC_REG_KEYSEARCH_7, 0x6eb0ff09);6650 REG_WR(bp, SRC_REG_KEYSEARCH_7, 0x6eb0ff09);
6623 REG_WR(bp, SRC_REG_KEYSEARCH_8, 0x1830f82f);6651 REG_WR(bp, SRC_REG_KEYSEARCH_8, 0x1830f82f);
6624 REG_WR(bp, SRC_REG_KEYSEARCH_9, 0x01e46be7);6652 REG_WR(bp, SRC_REG_KEYSEARCH_9, 0x01e46be7);
6625#endif6653 }
6626 REG_WR(bp, SRC_REG_SOFT_RST, 0);6654 REG_WR(bp, SRC_REG_SOFT_RST, 0);
6627 6655
6628 if (sizeof(union cdu_context) != 1024)6656 if (sizeof(union cdu_context) != 1024)
@@ -6786,11 +6814,11 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) · 157 unmodified lines
6786 /* QM cid (connection) count */6814 /* QM cid (connection) count */
6787 bnx2x_qm_init_cid_count(bp, bp->qm_cid_count, INITOP_SET);6815 bnx2x_qm_init_cid_count(bp, bp->qm_cid_count, INITOP_SET);
6788 6816
6789#ifdef BCM_CNIC6817 if (CNIC_SUPPORT(bp)) {
6790 bnx2x_init_block(bp, BLOCK_TM, init_phase);6818 bnx2x_init_block(bp, BLOCK_TM, init_phase);
6791 REG_WR(bp, TM_REG_LIN0_SCAN_TIME + port*4, 20);6819 REG_WR(bp, TM_REG_LIN0_SCAN_TIME + port*4, 20);
6792 REG_WR(bp, TM_REG_LIN0_MAX_ACTIVE_CID + port*4, 31);6820 REG_WR(bp, TM_REG_LIN0_MAX_ACTIVE_CID + port*4, 31);
6793#endif6821 }
6794 6822
6795 bnx2x_init_block(bp, BLOCK_DORQ, init_phase);6823 bnx2x_init_block(bp, BLOCK_DORQ, init_phase);
6796 6824
@@ -6877,9 +6905,9 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) · 80 unmodified lines
6877 REG_WR(bp, PBF_REG_INIT_P0 + port*4, 0);6905 REG_WR(bp, PBF_REG_INIT_P0 + port*4, 0);
6878 }6906 }
6879 6907
6880#ifdef BCM_CNIC6908 if (CNIC_SUPPORT(bp))
6881 bnx2x_init_block(bp, BLOCK_SRC, init_phase);6909 bnx2x_init_block(bp, BLOCK_SRC, init_phase);
6882#endif6910
6883 bnx2x_init_block(bp, BLOCK_CDU, init_phase);6911 bnx2x_init_block(bp, BLOCK_CDU, init_phase);
6884 bnx2x_init_block(bp, BLOCK_CFC, init_phase);6912 bnx2x_init_block(bp, BLOCK_CFC, init_phase);
6885 6913
@@ -6955,7 +6983,7 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) · 69 unmodified lines
6955 6983
6956 /* If SPIO5 is set to generate interrupts, enable it for this port */6984 /* If SPIO5 is set to generate interrupts, enable it for this port */
6957 val = REG_RD(bp, MISC_REG_SPIO_EVENT_EN);6985 val = REG_RD(bp, MISC_REG_SPIO_EVENT_EN);
6958 if (val & (1 << MISC_REGISTERS_SPIO_5)) {6986 if (val & MISC_SPIO_SPIO5) {
6959 u32 reg_addr = (port ? MISC_REG_AEU_ENABLE1_FUNC_1_OUT_0 :6987 u32 reg_addr = (port ? MISC_REG_AEU_ENABLE1_FUNC_1_OUT_0 :
6960 MISC_REG_AEU_ENABLE1_FUNC_0_OUT_0);6988 MISC_REG_AEU_ENABLE1_FUNC_0_OUT_0);
6961 val = REG_RD(bp, reg_addr);6989 val = REG_RD(bp, reg_addr);
@@ -7040,6 +7068,130 @@ static void bnx2x_clear_func_ilt(struct bnx2x *bp, u32 func) · 78 unmodified lines
7040 bnx2x_ilt_wr(bp, i, 0);7068 bnx2x_ilt_wr(bp, i, 0);
7041}7069}
7042 7070
7071
7072static 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
7080static 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
7102static 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
7175int 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
7043static int bnx2x_init_hw_func(struct bnx2x *bp)7195static int bnx2x_init_hw_func(struct bnx2x *bp)
7044{7196{
7045 int port = BP_PORT(bp);7197 int port = BP_PORT(bp);
@@ -7082,17 +7234,16 @@ static int bnx2x_init_hw_func(struct bnx2x *bp) · 36 unmodified lines
7082 }7234 }
7083 bnx2x_ilt_init_op(bp, INITOP_SET);7235 bnx2x_ilt_init_op(bp, INITOP_SET);
7084 7236
7085#ifdef BCM_CNIC7237 if (!CONFIGURE_NIC_MODE(bp)) {
7086 bnx2x_src_init_t2(bp, bp->t2, bp->t2_mapping, SRC_CONN_NUM);7238 bnx2x_init_searcher(bp);
7087 7239 REG_WR(bp, PRS_REG_NIC_MODE, 0);
7088 /* T1 hash bits value determines the T1 number of entries */7240 DP(NETIF_MSG_IFUP, "NIC MODE disabled\n");
7089 REG_WR(bp, SRC_REG_NUMBER_HASH_BITS0 + port*4, SRC_HASH_BITS);7241 } else {
7090#endif7242 /* Set NIC mode */
7243 REG_WR(bp, PRS_REG_NIC_MODE, 1);
7244 DP(NETIF_MSG_IFUP, "NIC MODE configrued\n");
7091 7245
7092#ifndef BCM_CNIC7246 }
7093 /* set NIC mode */
7094 REG_WR(bp, PRS_REG_NIC_MODE, 1);
7095#endif /* BCM_CNIC */
7096 7247
7097 if (!CHIP_IS_E1x(bp)) {7248 if (!CHIP_IS_E1x(bp)) {
7098 u32 pf_conf = IGU_PF_CONF_FUNC_EN;7249 u32 pf_conf = IGU_PF_CONF_FUNC_EN;
@@ -7343,6 +7494,20 @@ static int bnx2x_init_hw_func(struct bnx2x *bp) · 244 unmodified lines
7343}7494}
7344 7495
7345 7496
7497void 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
7346void bnx2x_free_mem(struct bnx2x *bp)7511void bnx2x_free_mem(struct bnx2x *bp)
7347{7512{
7348 int i;7513 int i;
@@ -7367,17 +7532,6 @@ void bnx2x_free_mem(struct bnx2x *bp) · 18 unmodified lines
7367 7532
7368 BNX2X_FREE(bp->ilt->lines);7533 BNX2X_FREE(bp->ilt->lines);
7369 7534
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
7381 BNX2X_PCI_FREE(bp->spq, bp->spq_mapping, BCM_PAGE_SIZE);7535 BNX2X_PCI_FREE(bp->spq, bp->spq_mapping, BCM_PAGE_SIZE);
7382 7536
7383 BNX2X_PCI_FREE(bp->eq_ring, bp->eq_mapping,7537 BNX2X_PCI_FREE(bp->eq_ring, bp->eq_mapping,
@@ -7445,24 +7599,44 @@ alloc_mem_err: · 61 unmodified lines
7445 return -ENOMEM;7599 return -ENOMEM;
7446}7600}
7447 7601
7448 7602int bnx2x_alloc_mem_cnic(struct bnx2x *bp)
7449int bnx2x_alloc_mem(struct bnx2x *bp)
7450{7603{
7451 int i, allocated, context_size;
7452
7453#ifdef BCM_CNIC
7454 if (!CHIP_IS_E1x(bp))7604 if (!CHIP_IS_E1x(bp))
7455 /* size = the status block + ramrod buffers */7605 /* size = the status block + ramrod buffers */
7456 BNX2X_PCI_ALLOC(bp->cnic_sb.e2_sb, &bp->cnic_sb_mapping,7606 BNX2X_PCI_ALLOC(bp->cnic_sb.e2_sb, &bp->cnic_sb_mapping,
7457 sizeof(struct host_hc_status_block_e2));7607 sizeof(struct host_hc_status_block_e2));
7458 else7608 else
7459 BNX2X_PCI_ALLOC(bp->cnic_sb.e1x_sb, &bp->cnic_sb_mapping,7609 BNX2X_PCI_ALLOC(bp->cnic_sb.e1x_sb,
7460 sizeof(struct host_hc_status_block_e1x));7610 &bp->cnic_sb_mapping,
7611 sizeof(struct
7612 host_hc_status_block_e1x));
7461 7613
7462 /* allocate searcher T2 table */7614 if (CONFIGURE_NIC_MODE(bp))
7463 BNX2X_PCI_ALLOC(bp->t2, &bp->t2_mapping, SRC_T2_SZ);7615 /* allocate searcher T2 table, as it wan't allocated before */
7464#endif7616 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;
7465 7621
7622 if (bnx2x_ilt_mem_op_cnic(bp, ILT_MEMOP_ALLOC))
7623 goto alloc_mem_err;
7624
7625 return 0;
7626
7627alloc_mem_err:
7628 bnx2x_free_mem_cnic(bp);
7629 BNX2X_ERR("Can't allocate memory\n");
7630 return -ENOMEM;
7631}
7632
7633int 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);
7466 7640
7467 BNX2X_PCI_ALLOC(bp->def_status_blk, &bp->def_status_blk_mapping,7641 BNX2X_PCI_ALLOC(bp->def_status_blk, &bp->def_status_blk_mapping,
7468 sizeof(struct host_sp_status_block));7642 sizeof(struct host_sp_status_block));
@@ -7470,11 +7644,6 @@ int bnx2x_alloc_mem(struct bnx2x *bp) · 1 unmodified line
7470 BNX2X_PCI_ALLOC(bp->slowpath, &bp->slowpath_mapping,7644 BNX2X_PCI_ALLOC(bp->slowpath, &bp->slowpath_mapping,
7471 sizeof(struct bnx2x_slowpath));7645 sizeof(struct bnx2x_slowpath));
7472 7646
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
7478 /* Allocated memory for FW statistics */7647 /* Allocated memory for FW statistics */
7479 if (bnx2x_alloc_fw_stats_mem(bp))7648 if (bnx2x_alloc_fw_stats_mem(bp))
7480 goto alloc_mem_err;7649 goto alloc_mem_err;
@@ -7596,14 +7765,12 @@ int bnx2x_set_eth_mac(struct bnx2x *bp, bool set) · 115 unmodified lines
7596{7765{
7597 unsigned long ramrod_flags = 0;7766 unsigned long ramrod_flags = 0;
7598 7767
7599#ifdef BCM_CNIC
7600 if (is_zero_ether_addr(bp->dev->dev_addr) &&7768 if (is_zero_ether_addr(bp->dev->dev_addr) &&
7601 (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))) {7769 (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))) {
7602 DP(NETIF_MSG_IFUP | NETIF_MSG_IFDOWN,7770 DP(NETIF_MSG_IFUP | NETIF_MSG_IFDOWN,
7603 "Ignoring Zero MAC for STORAGE SD mode\n");7771 "Ignoring Zero MAC for STORAGE SD mode\n");
7604 return 0;7772 return 0;
7605 }7773 }
7606#endif
7607 7774
7608 DP(NETIF_MSG_IFUP, "Adding Eth MAC\n");7775 DP(NETIF_MSG_IFUP, "Adding Eth MAC\n");
7609 7776
@@ -7632,7 +7799,8 @@ void bnx2x_set_int_mode(struct bnx2x *bp) · 22 unmodified lines
7632 bnx2x_enable_msi(bp);7799 bnx2x_enable_msi(bp);
7633 /* falling through... */7800 /* falling through... */
7634 case INT_MODE_INTx:7801 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;
7636 BNX2X_DEV_INFO("set number of queues to 1\n");7804 BNX2X_DEV_INFO("set number of queues to 1\n");
7637 break;7805 break;
7638 default:7806 default:
@@ -7644,9 +7812,10 @@ void bnx2x_set_int_mode(struct bnx2x *bp) · 5 unmodified lines
7644 bp->flags & USING_SINGLE_MSIX_FLAG) {7812 bp->flags & USING_SINGLE_MSIX_FLAG) {
7645 /* failed to enable multiple MSI-X */7813 /* failed to enable multiple MSI-X */
7646 BNX2X_DEV_INFO("Failed to enable multiple MSI-X (%d), set number of queues to %d\n",7814 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);
7648 7817
7649 bp->num_queues = 1 + NON_ETH_CONTEXT_USE;7818 bp->num_queues = 1 + bp->num_cnic_queues;
7650 7819
7651 /* Try to enable MSI */7820 /* Try to enable MSI */
7652 if (!(bp->flags & USING_SINGLE_MSIX_FLAG) &&7821 if (!(bp->flags & USING_SINGLE_MSIX_FLAG) &&
@@ -7679,9 +7848,9 @@ void bnx2x_ilt_set_info(struct bnx2x *bp) · 26 unmodified lines
7679 ilt_client->flags = ILT_CLIENT_SKIP_MEM;7848 ilt_client->flags = ILT_CLIENT_SKIP_MEM;
7680 ilt_client->start = line;7849 ilt_client->start = line;
7681 line += bnx2x_cid_ilt_lines(bp);7850 line += bnx2x_cid_ilt_lines(bp);
7682#ifdef BCM_CNIC7851
7683 line += CNIC_ILT_LINES;7852 if (CNIC_SUPPORT(bp))
7684#endif7853 line += CNIC_ILT_LINES;
7685 ilt_client->end = line - 1;7854 ilt_client->end = line - 1;
7686 7855
7687 DP(NETIF_MSG_IFUP, "ilt client[CDU]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n",7856 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
7714 ilog2(ilt_client->page_size >> 12));7883 ilog2(ilt_client->page_size >> 12));
7715 7884
7716 }7885 }
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;
7726 7886
7727 DP(NETIF_MSG_IFUP,7887 if (CNIC_SUPPORT(bp)) {
7728 "ilt client[SRC]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n",7888 /* SRC */
7729 ilt_client->start,7889 ilt_client = &ilt->clients[ILT_CLIENT_SRC];
7730 ilt_client->end,7890 ilt_client->client_num = ILT_CLIENT_SRC;
7731 ilt_client->page_size,7891 ilt_client->page_size = SRC_ILT_PAGE_SZ;
7732 ilt_client->flags,7892 ilt_client->flags = 0;
7733 ilog2(ilt_client->page_size >> 12));7893 ilt_client->start = line;
7894 line += SRC_ILT_LINES;
7895 ilt_client->end = line - 1;
7734 7896
7735#else7897 DP(NETIF_MSG_IFUP,
7736 ilt_client->flags = (ILT_CLIENT_SKIP_INIT | ILT_CLIENT_SKIP_MEM);7898 "ilt client[SRC]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n",
7737#endif7899 ilt_client->start,
7900 ilt_client->end,
7901 ilt_client->page_size,
7902 ilt_client->flags,
7903 ilog2(ilt_client->page_size >> 12));
7738 7904
7739 /* TM */7905 /* TM */
7740 ilt_client = &ilt->clients[ILT_CLIENT_TM];7906 ilt_client = &ilt->clients[ILT_CLIENT_TM];
7741#ifdef BCM_CNIC7907 ilt_client->client_num = ILT_CLIENT_TM;
7742 ilt_client->client_num = ILT_CLIENT_TM;7908 ilt_client->page_size = TM_ILT_PAGE_SZ;
7743 ilt_client->page_size = TM_ILT_PAGE_SZ;7909 ilt_client->flags = 0;
7744 ilt_client->flags = 0;7910 ilt_client->start = line;
7745 ilt_client->start = line;7911 line += TM_ILT_LINES;
7746 line += TM_ILT_LINES;7912 ilt_client->end = line - 1;
7747 ilt_client->end = line - 1;
7748 7913
7749 DP(NETIF_MSG_IFUP,7914 DP(NETIF_MSG_IFUP,
7750 "ilt client[TM]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n",7915 "ilt client[TM]: start %d, end %d, psz 0x%x, flags 0x%x, hw psz %d\n",
7751 ilt_client->start,7916 ilt_client->start,
7752 ilt_client->end,7917 ilt_client->end,
7753 ilt_client->page_size,7918 ilt_client->page_size,
7754 ilt_client->flags,7919 ilt_client->flags,
7755 ilog2(ilt_client->page_size >> 12));7920 ilog2(ilt_client->page_size >> 12));
7921 }
7756 7922
7757#else
7758 ilt_client->flags = (ILT_CLIENT_SKIP_INIT | ILT_CLIENT_SKIP_MEM);
7759#endif
7760 BUG_ON(line > ILT_MAX_LINES);7923 BUG_ON(line > ILT_MAX_LINES);
7761}7924}
7762 7925
@@ -7823,7 +7986,7 @@ static void bnx2x_pf_q_prep_init(struct bnx2x *bp, · 60 unmodified lines
7823 }7986 }
7824}7987}
7825 7988
7826int bnx2x_setup_tx_only(struct bnx2x *bp, struct bnx2x_fastpath *fp,7989static int bnx2x_setup_tx_only(struct bnx2x *bp, struct bnx2x_fastpath *fp,
7827 struct bnx2x_queue_state_params *q_params,7990 struct bnx2x_queue_state_params *q_params,
7828 struct bnx2x_queue_setup_tx_only_params *tx_only_params,7991 struct bnx2x_queue_setup_tx_only_params *tx_only_params,
7829 int tx_index, bool leading)7992 int tx_index, bool leading)
@@ -7924,6 +8087,9 @@ int bnx2x_setup_queue(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 94 unmodified lines
7924 /* Set the command */8087 /* Set the command */
7925 q_params.cmd = BNX2X_Q_CMD_SETUP;8088 q_params.cmd = BNX2X_Q_CMD_SETUP;
7926 8089
8090 if (IS_FCOE_FP(fp))
8091 bp->fcoe_init = true;
8092
7927 /* Change the state to SETUP */8093 /* Change the state to SETUP */
7928 rc = bnx2x_queue_state_change(bp, &q_params);8094 rc = bnx2x_queue_state_change(bp, &q_params);
7929 if (rc) {8095 if (rc) {
@@ -8037,12 +8203,12 @@ static void bnx2x_reset_func(struct bnx2x *bp) · 107 unmodified lines
8037 SB_DISABLED);8203 SB_DISABLED);
8038 }8204 }
8039 8205
8040#ifdef BCM_CNIC8206 if (CNIC_LOADED(bp))
8041 /* CNIC SB */8207 /* CNIC SB */
8042 REG_WR8(bp, BAR_CSTRORM_INTMEM +8208 REG_WR8(bp, BAR_CSTRORM_INTMEM +
8043 CSTORM_STATUS_BLOCK_DATA_STATE_OFFSET(bnx2x_cnic_fw_sb_id(bp)),8209 CSTORM_STATUS_BLOCK_DATA_STATE_OFFSET
8044 SB_DISABLED);8210 (bnx2x_cnic_fw_sb_id(bp)), SB_DISABLED);
8045#endif8211
8046 /* SP SB */8212 /* SP SB */
8047 REG_WR8(bp, BAR_CSTRORM_INTMEM +8213 REG_WR8(bp, BAR_CSTRORM_INTMEM +
8048 CSTORM_SP_STATUS_BLOCK_DATA_STATE_OFFSET(func),8214 CSTORM_SP_STATUS_BLOCK_DATA_STATE_OFFSET(func),
@@ -8061,19 +8227,19 @@ static void bnx2x_reset_func(struct bnx2x *bp) · 12 unmodified lines
8061 REG_WR(bp, IGU_REG_TRAILING_EDGE_LATCH, 0);8227 REG_WR(bp, IGU_REG_TRAILING_EDGE_LATCH, 0);
8062 }8228 }
8063 8229
8064#ifdef BCM_CNIC8230 if (CNIC_LOADED(bp)) {
8065 /* Disable Timer scan */8231 /* Disable Timer scan */
8066 REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 0);8232 REG_WR(bp, TM_REG_EN_LINEAR0_TIMER + port*4, 0);
8067 /*8233 /*
8068 * Wait for at least 10ms and up to 2 second for the timers scan to8234 * Wait for at least 10ms and up to 2 second for the timers
8069 * complete8235 * scan to complete
8070 */8236 */
8071 for (i = 0; i < 200; i++) {8237 for (i = 0; i < 200; i++) {
8072 msleep(10);8238 msleep(10);
8073 if (!REG_RD(bp, TM_REG_LIN0_SCAN_ON + port*4))8239 if (!REG_RD(bp, TM_REG_LIN0_SCAN_ON + port*4))
8074 break;8240 break;
8241 }
8075 }8242 }
8076#endif
8077 /* Clear ILT */8243 /* Clear ILT */
8078 bnx2x_clear_func_ilt(bp, func);8244 bnx2x_clear_func_ilt(bp, func);
8079 8245
@@ -8409,13 +8575,24 @@ void bnx2x_chip_cleanup(struct bnx2x *bp, int unload_mode, bool keep_link) · 329 unmodified lines
8409 /* Close multi and leading connections8575 /* Close multi and leading connections
8410 * Completions for ramrods are collected in a synchronous way8576 * Completions for ramrods are collected in a synchronous way
8411 */8577 */
8412 for_each_queue(bp, i)8578 for_each_eth_queue(bp, i)
8413 if (bnx2x_stop_queue(bp, i))8579 if (bnx2x_stop_queue(bp, i))
8414#ifdef BNX2X_STOP_ON_ERROR8580#ifdef BNX2X_STOP_ON_ERROR
8415 return;8581 return;
8416#else8582#else
8417 goto unload_error;8583 goto unload_error;
8418#endif8584#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
8419 /* If SP settings didn't get completed so far - something8596 /* If SP settings didn't get completed so far - something
8420 * very wrong has happen.8597 * very wrong has happen.
8421 */8598 */
@@ -8437,6 +8614,8 @@ unload_error: · 15 unmodified lines
8437 bnx2x_netif_stop(bp, 1);8614 bnx2x_netif_stop(bp, 1);
8438 /* Delete all NAPI objects */8615 /* Delete all NAPI objects */
8439 bnx2x_del_all_napi(bp);8616 bnx2x_del_all_napi(bp);
8617 if (CNIC_LOADED(bp))
8618 bnx2x_del_all_napi_cnic(bp);
8440 8619
8441 /* Release IRQs */8620 /* Release IRQs */
8442 bnx2x_free_irq(bp);8621 bnx2x_free_irq(bp);
@@ -8558,7 +8737,8 @@ static void bnx2x_reset_mcp_prep(struct bnx2x *bp, u32 *magic_val) · 115 unmodified lines
8558 8737
8559 /* Get shmem offset */8738 /* Get shmem offset */
8560 shmem = REG_RD(bp, MISC_REG_SHARED_MEM_ADDR);8739 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)]);
8562 8742
8563 /* Clear validity map flags */8743 /* Clear validity map flags */
8564 if (shmem > 0)8744 if (shmem > 0)
@@ -8651,7 +8831,11 @@ static void bnx2x_process_kill_chip_reset(struct bnx2x *bp, bool global) · 86 unmodified lines
8651 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_RESET_CMN_CPU |8831 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_RESET_CMN_CPU |
8652 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_RESET_CMN_CORE;8832 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_RESET_CMN_CORE;
8653 8833
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 */
8655 not_reset_mask1 =8839 not_reset_mask1 =
8656 MISC_REGISTERS_RESET_REG_1_RST_HC |8840 MISC_REGISTERS_RESET_REG_1_RST_HC |
8657 MISC_REGISTERS_RESET_REG_1_RST_PXPV |8841 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
8667 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_RESET_REG_HARD_CORE |8851 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_RESET_REG_HARD_CORE |
8668 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_HARD_CORE_RST_B |8852 MISC_REGISTERS_RESET_REG_2_RST_MCP_N_HARD_CORE_RST_B |
8669 MISC_REGISTERS_RESET_REG_2_RST_ATC |8853 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;
8671 8861
8672 /*8862 /*
8673 * Keep the following blocks in reset:8863 * Keep the following blocks in reset:
8674 * - all xxMACs are handled by the bnx2x_link code.8864 * - all xxMACs are handled by the bnx2x_link code.
8675 */8865 */
8676 stay_reset2 =8866 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 |
8683 MISC_REGISTERS_RESET_REG_2_XMAC |8867 MISC_REGISTERS_RESET_REG_2_XMAC |
8684 MISC_REGISTERS_RESET_REG_2_XMAC_SOFT;8868 MISC_REGISTERS_RESET_REG_2_XMAC_SOFT;
8685 8869
@@ -8769,6 +8953,7 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global) · 83 unmodified lines
8769 int cnt = 1000;8953 int cnt = 1000;
8770 u32 val = 0;8954 u32 val = 0;
8771 u32 sr_cnt, blk_cnt, port_is_idle_0, port_is_idle_1, pgl_exp_rom2;8955 u32 sr_cnt, blk_cnt, port_is_idle_0, port_is_idle_1, pgl_exp_rom2;
8956 u32 tags_63_32 = 0;
8772 8957
8773 8958
8774 /* Empty the Tetris buffer, wait for 1s */8959 /* Empty the Tetris buffer, wait for 1s */
@@ -8778,10 +8963,14 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global) · 3 unmodified lines
8778 port_is_idle_0 = REG_RD(bp, PXP2_REG_RD_PORT_IS_IDLE_0);8963 port_is_idle_0 = REG_RD(bp, PXP2_REG_RD_PORT_IS_IDLE_0);
8779 port_is_idle_1 = REG_RD(bp, PXP2_REG_RD_PORT_IS_IDLE_1);8964 port_is_idle_1 = REG_RD(bp, PXP2_REG_RD_PORT_IS_IDLE_1);
8780 pgl_exp_rom2 = REG_RD(bp, PXP2_REG_PGL_EXP_ROM2);8965 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
8781 if ((sr_cnt == 0x7e) && (blk_cnt == 0xa0) &&8969 if ((sr_cnt == 0x7e) && (blk_cnt == 0xa0) &&
8782 ((port_is_idle_0 & 0x1) == 0x1) &&8970 ((port_is_idle_0 & 0x1) == 0x1) &&
8783 ((port_is_idle_1 & 0x1) == 0x1) &&8971 ((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)))
8785 break;8974 break;
8786 usleep_range(1000, 1000);8975 usleep_range(1000, 1000);
8787 } while (cnt-- > 0);8976 } while (cnt-- > 0);
@@ -8838,9 +9027,6 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global) · 50 unmodified lines
8838 9027
8839 /* TBD: Add resetting the NO_MCP mode DB here */9028 /* TBD: Add resetting the NO_MCP mode DB here */
8840 9029
8841 /* PXP */
8842 bnx2x_pxp_prep(bp);
8843
8844 /* Open the gates #2, #3 and #4 */9030 /* Open the gates #2, #3 and #4 */
8845 bnx2x_set_234_gates(bp, false);9031 bnx2x_set_234_gates(bp, false);
8846 9032
@@ -8850,7 +9036,7 @@ static int bnx2x_process_kill(struct bnx2x *bp, bool global) · 3 unmodified lines
8850 return 0;9036 return 0;
8851}9037}
8852 9038
8853int bnx2x_leader_reset(struct bnx2x *bp)9039static int bnx2x_leader_reset(struct bnx2x *bp)
8854{9040{
8855 int rc = 0;9041 int rc = 0;
8856 bool global = bnx2x_reset_is_global(bp);9042 bool global = bnx2x_reset_is_global(bp);
@@ -9234,7 +9420,7 @@ static inline void bnx2x_undi_int_disable(struct bnx2x *bp) · 377 unmodified lines
9234 bnx2x_undi_int_disable_e1h(bp);9420 bnx2x_undi_int_disable_e1h(bp);
9235}9421}
9236 9422
9237static void __devinit bnx2x_prev_unload_close_mac(struct bnx2x *bp)9423static void bnx2x_prev_unload_close_mac(struct bnx2x *bp)
9238{9424{
9239 u32 val, base_addr, offset, mask, reset_reg;9425 u32 val, base_addr, offset, mask, reset_reg;
9240 bool mac_stopped = false;9426 bool mac_stopped = false;
@@ -9301,8 +9487,7 @@ static void __devinit bnx2x_prev_unload_close_mac(struct bnx2x *bp) · 60 unmodified lines
9301#define BNX2X_PREV_UNDI_BD(val) ((val) >> 16 & 0xffff)9487#define BNX2X_PREV_UNDI_BD(val) ((val) >> 16 & 0xffff)
9302#define BNX2X_PREV_UNDI_PROD(rcq, bd) ((bd) << 16 | (rcq))9488#define BNX2X_PREV_UNDI_PROD(rcq, bd) ((bd) << 16 | (rcq))
9303 9489
9304static void __devinit bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 port,9490static void bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 port, u8 inc)
9305 u8 inc)
9306{9491{
9307 u16 rcq, bd;9492 u16 rcq, bd;
9308 u32 tmp_reg = REG_RD(bp, BNX2X_PREV_UNDI_PROD_ADDR(port));9493 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
9317 port, bd, rcq);9502 port, bd, rcq);
9318}9503}
9319 9504
9320static int __devinit bnx2x_prev_mcp_done(struct bnx2x *bp)9505static int bnx2x_prev_mcp_done(struct bnx2x *bp)
9321{9506{
9322 u32 rc = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE,9507 u32 rc = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE,
9323 DRV_MSG_CODE_UNLOAD_SKIP_LINK_RESET);9508 DRV_MSG_CODE_UNLOAD_SKIP_LINK_RESET);
@@ -9329,7 +9514,21 @@ static int __devinit bnx2x_prev_mcp_done(struct bnx2x *bp) · 5 unmodified lines
9329 return 0;9514 return 0;
9330}9515}
9331 9516
9332static bool __devinit bnx2x_prev_is_path_marked(struct bnx2x *bp)9517static 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
9531static bool bnx2x_prev_is_path_marked(struct bnx2x *bp)
9333{9532{
9334 struct bnx2x_prev_path_list *tmp_list;9533 struct bnx2x_prev_path_list *tmp_list;
9335 int rc = false;9534 int rc = false;
@@ -9353,7 +9552,7 @@ static bool __devinit bnx2x_prev_is_path_marked(struct bnx2x *bp) · 17 unmodified lines
9353 return rc;9552 return rc;
9354}9553}
9355 9554
9356static int __devinit bnx2x_prev_mark_path(struct bnx2x *bp)9555static int bnx2x_prev_mark_path(struct bnx2x *bp, bool after_undi)
9357{9556{
9358 struct bnx2x_prev_path_list *tmp_list;9557 struct bnx2x_prev_path_list *tmp_list;
9359 int rc;9558 int rc;
@@ -9367,6 +9566,7 @@ static int __devinit bnx2x_prev_mark_path(struct bnx2x *bp) · 7 unmodified lines
9367 tmp_list->bus = bp->pdev->bus->number;9566 tmp_list->bus = bp->pdev->bus->number;
9368 tmp_list->slot = PCI_SLOT(bp->pdev->devfn);9567 tmp_list->slot = PCI_SLOT(bp->pdev->devfn);
9369 tmp_list->path = BP_PATH(bp);9568 tmp_list->path = BP_PATH(bp);
9569 tmp_list->undi = after_undi ? (1 << BP_PORT(bp)) : 0;
9370 9570
9371 rc = down_interruptible(&bnx2x_prev_sem);9571 rc = down_interruptible(&bnx2x_prev_sem);
9372 if (rc) {9572 if (rc) {
@@ -9382,7 +9582,7 @@ static int __devinit bnx2x_prev_mark_path(struct bnx2x *bp) · 9 unmodified lines
9382 return rc;9582 return rc;
9383}9583}
9384 9584
9385static int __devinit bnx2x_do_flr(struct bnx2x *bp)9585static int bnx2x_do_flr(struct bnx2x *bp)
9386{9586{
9387 int i;9587 int i;
9388 u16 status;9588 u16 status;
@@ -9422,7 +9622,7 @@ clear: · 33 unmodified lines
9422 return 0;9622 return 0;
9423}9623}
9424 9624
9425static int __devinit bnx2x_prev_unload_uncommon(struct bnx2x *bp)9625static int bnx2x_prev_unload_uncommon(struct bnx2x *bp)
9426{9626{
9427 int rc;9627 int rc;
9428 9628
@@ -9460,9 +9660,10 @@ static int __devinit bnx2x_prev_unload_uncommon(struct bnx2x *bp) · 31 unmodified lines
9460 return rc;9660 return rc;
9461}9661}
9462 9662
9463static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp)9663static int bnx2x_prev_unload_common(struct bnx2x *bp)
9464{9664{
9465 u32 reset_reg, tmp_reg = 0, rc;9665 u32 reset_reg, tmp_reg = 0, rc;
9666 bool prev_undi = false;
9466 /* It is possible a previous function received 'common' answer,9667 /* It is possible a previous function received 'common' answer,
9467 * but hasn't loaded yet, therefore creating a scenario of9668 * but hasn't loaded yet, therefore creating a scenario of
9468 * multiple functions receiving 'common' on the same path.9669 * 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
9477 /* Reset should be performed after BRB is emptied */9678 /* Reset should be performed after BRB is emptied */
9478 if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_BRB1) {9679 if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_BRB1) {
9479 u32 timer_count = 1000;9680 u32 timer_count = 1000;
9480 bool prev_undi = false;
9481 9681
9482 /* Close the MAC Rx to prevent BRB from filling up */9682 /* Close the MAC Rx to prevent BRB from filling up */
9483 bnx2x_prev_unload_close_mac(bp);9683 bnx2x_prev_unload_close_mac(bp);
@@ -9527,7 +9727,7 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp) · 43 unmodified lines
9527 /* No packets are in the pipeline, path is ready for reset */9727 /* No packets are in the pipeline, path is ready for reset */
9528 bnx2x_reset_common(bp);9728 bnx2x_reset_common(bp);
9529 9729
9530 rc = bnx2x_prev_mark_path(bp);9730 rc = bnx2x_prev_mark_path(bp, prev_undi);
9531 if (rc) {9731 if (rc) {
9532 bnx2x_prev_mcp_done(bp);9732 bnx2x_prev_mcp_done(bp);
9533 return rc;9733 return rc;
@@ -9543,7 +9743,7 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp) · 9 unmodified lines
9543 * to clear the interrupt which detected this from the pglueb and the was done9743 * to clear the interrupt which detected this from the pglueb and the was done
9544 * bit9744 * bit
9545 */9745 */
9546static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp)9746static void bnx2x_prev_interrupted_dmae(struct bnx2x *bp)
9547{9747{
9548 if (!CHIP_IS_E1x(bp)) {9748 if (!CHIP_IS_E1x(bp)) {
9549 u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS);9749 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
9555 }9755 }
9556}9756}
9557 9757
9558static int __devinit bnx2x_prev_unload(struct bnx2x *bp)9758static int bnx2x_prev_unload(struct bnx2x *bp)
9559{9759{
9560 int time_counter = 10;9760 int time_counter = 10;
9561 u32 rc, fw, hw_lock_reg, hw_lock_val;9761 u32 rc, fw, hw_lock_reg, hw_lock_val;
9762 struct bnx2x_prev_path_list *prev_list;
9562 BNX2X_DEV_INFO("Entering Previous Unload Flow\n");9763 BNX2X_DEV_INFO("Entering Previous Unload Flow\n");
9563 9764
9564 /* clear hw from errors which may have resulted from an interrupted9765 /* 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
9617 rc = -EBUSY;9818 rc = -EBUSY;
9618 }9819 }
9619 9820
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
9620 BNX2X_DEV_INFO("Finished Previous Unload Flow [%d]\n", rc);9827 BNX2X_DEV_INFO("Finished Previous Unload Flow [%d]\n", rc);
9621 9828
9622 return rc;9829 return rc;
9623}9830}
9624 9831
9625static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp)9832static void bnx2x_get_common_hwinfo(struct bnx2x *bp)
9626{9833{
9627 u32 val, val2, val3, val4, id, boot_mode;9834 u32 val, val2, val3, val4, id, boot_mode;
9628 u16 pmc;9835 u16 pmc;
@@ -9701,6 +9908,14 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) · 72 unmodified lines
9701 9908
9702 bp->link_params.shmem_base = bp->common.shmem_base;9909 bp->link_params.shmem_base = bp->common.shmem_base;
9703 bp->link_params.shmem2_base = bp->common.shmem2_base;9910 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;
9704 BNX2X_DEV_INFO("shmem offset 0x%x shmem2 offset 0x%x\n",9919 BNX2X_DEV_INFO("shmem offset 0x%x shmem2 offset 0x%x\n",
9705 bp->common.shmem_base, bp->common.shmem2_base);9920 bp->common.shmem_base, bp->common.shmem2_base);
9706 9921
@@ -9748,6 +9963,11 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) · 41 unmodified lines
9748 bp->link_params.feature_config_flags |=9963 bp->link_params.feature_config_flags |=
9749 (val >= REQ_BC_VER_4_SFP_TX_DISABLE_SUPPORTED) ?9964 (val >= REQ_BC_VER_4_SFP_TX_DISABLE_SUPPORTED) ?
9750 FEATURE_CONFIG_BC_SUPPORTS_SFP_TX_DISABLED : 0;9965 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
9751 bp->flags |= (val >= REQ_BC_VER_4_PFC_STATS_SUPPORTED) ?9971 bp->flags |= (val >= REQ_BC_VER_4_PFC_STATS_SUPPORTED) ?
9752 BC_SUPPORTS_PFC_STATS : 0;9972 BC_SUPPORTS_PFC_STATS : 0;
9753 9973
@@ -9792,7 +10012,7 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) · 38 unmodified lines
9792#define IGU_FID(val) GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID)10012#define IGU_FID(val) GET_FIELD((val), IGU_REG_MAPPING_MEMORY_FID)
9793#define IGU_VEC(val) GET_FIELD((val), IGU_REG_MAPPING_MEMORY_VECTOR)10013#define IGU_VEC(val) GET_FIELD((val), IGU_REG_MAPPING_MEMORY_VECTOR)
9794 10014
9795static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp)10015static int bnx2x_get_igu_cam_info(struct bnx2x *bp)
9796{10016{
9797 int pfid = BP_FUNC(bp);10017 int pfid = BP_FUNC(bp);
9798 int igu_sb_id;10018 int igu_sb_id;
@@ -9809,7 +10029,7 @@ static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp) · 10 unmodified lines
9809 bp->igu_dsb_id = E1HVN_MAX * FP_SB_MAX_E1x +10029 bp->igu_dsb_id = E1HVN_MAX * FP_SB_MAX_E1x +
9810 (CHIP_MODE_IS_4_PORT(bp) ? pfid : vn);10030 (CHIP_MODE_IS_4_PORT(bp) ? pfid : vn);
9811 10031
9812 return;10032 return 0;
9813 }10033 }
9814 10034
9815 /* IGU in normal mode - read CAM */10035 /* IGU in normal mode - read CAM */
@@ -9843,12 +10063,15 @@ static void __devinit bnx2x_get_igu_cam_info(struct bnx2x *bp) · 27 unmodified lines
9843 bp->igu_sb_cnt = min_t(int, bp->igu_sb_cnt, igu_sb_cnt);10063 bp->igu_sb_cnt = min_t(int, bp->igu_sb_cnt, igu_sb_cnt);
9844#endif10064#endif
9845 10065
9846 if (igu_sb_cnt == 0)10066 if (igu_sb_cnt == 0) {
9847 BNX2X_ERR("CAM configuration error\n");10067 BNX2X_ERR("CAM configuration error\n");
10068 return -EINVAL;
10069 }
10070
10071 return 0;
9848}10072}
9849 10073
9850static void __devinit bnx2x_link_settings_supported(struct bnx2x *bp,10074static void bnx2x_link_settings_supported(struct bnx2x *bp, u32 switch_cfg)
9851 u32 switch_cfg)
9852{10075{
9853 int cfg_size = 0, idx, port = BP_PORT(bp);10076 int cfg_size = 0, idx, port = BP_PORT(bp);
9854 10077
@@ -9946,7 +10169,7 @@ static void __devinit bnx2x_link_settings_supported(struct bnx2x *bp, · 91 unmodified lines
9946 bp->port.supported[1]);10169 bp->port.supported[1]);
9947}10170}
9948 10171
9949static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp)10172static void bnx2x_link_settings_requested(struct bnx2x *bp)
9950{10173{
9951 u32 link_config, idx, cfg_size = 0;10174 u32 link_config, idx, cfg_size = 0;
9952 bp->port.advertising[0] = 0;10175 bp->port.advertising[0] = 0;
@@ -10115,11 +10338,13 @@ static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp) · 162 unmodified lines
10115 10338
10116 bp->link_params.req_flow_ctrl[idx] = (link_config &10339 bp->link_params.req_flow_ctrl[idx] = (link_config &
10117 PORT_FEATURE_FLOW_CONTROL_MASK);10340 PORT_FEATURE_FLOW_CONTROL_MASK);
10118 if ((bp->link_params.req_flow_ctrl[idx] ==10341 if (bp->link_params.req_flow_ctrl[idx] ==
10119 BNX2X_FLOW_CTRL_AUTO) &&10342 BNX2X_FLOW_CTRL_AUTO) {
10120 !(bp->port.supported[idx] & SUPPORTED_Autoneg)) {10343 if (!(bp->port.supported[idx] & SUPPORTED_Autoneg))
10121 bp->link_params.req_flow_ctrl[idx] =10344 bp->link_params.req_flow_ctrl[idx] =
10122 BNX2X_FLOW_CTRL_NONE;10345 BNX2X_FLOW_CTRL_NONE;
10346 else
10347 bnx2x_set_requested_fc(bp);
10123 }10348 }
10124 10349
10125 BNX2X_DEV_INFO("req_line_speed %d req_duplex %d req_flow_ctrl 0x%x advertising 0x%x\n",10350 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
10130 }10355 }
10131}10356}
10132 10357
10133static void __devinit bnx2x_set_mac_buf(u8 *mac_buf, u32 mac_lo, u16 mac_hi)10358static void bnx2x_set_mac_buf(u8 *mac_buf, u32 mac_lo, u16 mac_hi)
10134{10359{
10135 mac_hi = cpu_to_be16(mac_hi);10360 mac_hi = cpu_to_be16(mac_hi);
10136 mac_lo = cpu_to_be32(mac_lo);10361 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
10138 memcpy(mac_buf + sizeof(mac_hi), &mac_lo, sizeof(mac_lo));10363 memcpy(mac_buf + sizeof(mac_hi), &mac_lo, sizeof(mac_lo));
10139}10364}
10140 10365
10141static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp)10366static void bnx2x_get_port_hwinfo(struct bnx2x *bp)
10142{10367{
10143 int port = BP_PORT(bp);10368 int port = BP_PORT(bp);
10144 u32 config;10369 u32 config;
@@ -10199,17 +10424,6 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) · 54 unmodified lines
10199 bp->mdio.prtad =10424 bp->mdio.prtad =
10200 XGXS_EXT_PHY_ADDR(ext_phy_config);10425 XGXS_EXT_PHY_ADDR(ext_phy_config);
10201 10426
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
10213 /* Configure link feature according to nvram value */10427 /* Configure link feature according to nvram value */
10214 eee_mode = (((SHMEM_RD(bp, dev_info.10428 eee_mode = (((SHMEM_RD(bp, dev_info.
10215 port_feature_config[port].eee_power_mode)) &10429 port_feature_config[port].eee_power_mode)) &
@@ -10227,12 +10441,15 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) · 11 unmodified lines
10227void bnx2x_get_iscsi_info(struct bnx2x *bp)10441void bnx2x_get_iscsi_info(struct bnx2x *bp)
10228{10442{
10229 u32 no_flags = NO_ISCSI_FLAG;10443 u32 no_flags = NO_ISCSI_FLAG;
10230#ifdef BCM_CNIC
10231 int port = BP_PORT(bp);10444 int port = BP_PORT(bp);
10232
10233 u32 max_iscsi_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp,10445 u32 max_iscsi_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp,
10234 drv_lic_key[port].max_iscsi_conn);10446 drv_lic_key[port].max_iscsi_conn);
10235 10447
10448 if (!CNIC_SUPPORT(bp)) {
10449 bp->flags |= no_flags;
10450 return;
10451 }
10452
10236 /* Get the number of maximum allowed iSCSI connections */10453 /* Get the number of maximum allowed iSCSI connections */
10237 bp->cnic_eth_dev.max_iscsi_conn =10454 bp->cnic_eth_dev.max_iscsi_conn =
10238 (max_iscsi_conn & BNX2X_MAX_ISCSI_INIT_CONN_MASK) >>10455 (max_iscsi_conn & BNX2X_MAX_ISCSI_INIT_CONN_MASK) >>
@@ -10247,13 +10464,10 @@ void bnx2x_get_iscsi_info(struct bnx2x *bp) · 8 unmodified lines
10247 */10464 */
10248 if (!bp->cnic_eth_dev.max_iscsi_conn)10465 if (!bp->cnic_eth_dev.max_iscsi_conn)
10249 bp->flags |= no_flags;10466 bp->flags |= no_flags;
10250#else10467
10251 bp->flags |= no_flags;
10252#endif
10253}10468}
10254 10469
10255#ifdef BCM_CNIC10470static void bnx2x_get_ext_wwn_info(struct bnx2x *bp, int func)
10256static void __devinit bnx2x_get_ext_wwn_info(struct bnx2x *bp, int func)
10257{10471{
10258 /* Port info */10472 /* Port info */
10259 bp->cnic_eth_dev.fcoe_wwn_port_name_hi =10473 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
10267 bp->cnic_eth_dev.fcoe_wwn_node_name_lo =10481 bp->cnic_eth_dev.fcoe_wwn_node_name_lo =
10268 MF_CFG_RD(bp, func_ext_config[func].fcoe_wwn_node_name_lower);10482 MF_CFG_RD(bp, func_ext_config[func].fcoe_wwn_node_name_lower);
10269}10483}
10270#endif10484static void bnx2x_get_fcoe_info(struct bnx2x *bp)
10271static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp)
10272{10485{
10273#ifdef BCM_CNIC
10274 int port = BP_PORT(bp);10486 int port = BP_PORT(bp);
10275 int func = BP_ABS_FUNC(bp);10487 int func = BP_ABS_FUNC(bp);
10276
10277 u32 max_fcoe_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp,10488 u32 max_fcoe_conn = FW_ENCODE_32BIT_PATTERN ^ SHMEM_RD(bp,
10278 drv_lic_key[port].max_fcoe_conn);10489 drv_lic_key[port].max_fcoe_conn);
10279 10490
10491 if (!CNIC_SUPPORT(bp)) {
10492 bp->flags |= NO_FCOE_FLAG;
10493 return;
10494 }
10495
10280 /* Get the number of maximum allowed FCoE connections */10496 /* Get the number of maximum allowed FCoE connections */
10281 bp->cnic_eth_dev.max_fcoe_conn =10497 bp->cnic_eth_dev.max_fcoe_conn =
10282 (max_fcoe_conn & BNX2X_MAX_FCOE_INIT_CONN_MASK) >>10498 (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
10311 if (BNX2X_MF_EXT_PROTOCOL_FCOE(bp) && !CHIP_IS_E1x(bp))10527 if (BNX2X_MF_EXT_PROTOCOL_FCOE(bp) && !CHIP_IS_E1x(bp))
10312 bnx2x_get_ext_wwn_info(bp, func);10528 bnx2x_get_ext_wwn_info(bp, func);
10313 10529
10314 } else if (IS_MF_FCOE_SD(bp))10530 } else if (IS_MF_FCOE_SD(bp) && !CHIP_IS_E1x(bp)) {
10315 bnx2x_get_ext_wwn_info(bp, func);10531 bnx2x_get_ext_wwn_info(bp, func);
10532 }
10316 10533
10317 BNX2X_DEV_INFO("max_fcoe_conn 0x%x\n", bp->cnic_eth_dev.max_fcoe_conn);10534 BNX2X_DEV_INFO("max_fcoe_conn 0x%x\n", bp->cnic_eth_dev.max_fcoe_conn);
10318 10535
@@ -10322,12 +10539,9 @@ static void __devinit bnx2x_get_fcoe_info(struct bnx2x *bp) · 3 unmodified lines
10322 */10539 */
10323 if (!bp->cnic_eth_dev.max_fcoe_conn)10540 if (!bp->cnic_eth_dev.max_fcoe_conn)
10324 bp->flags |= NO_FCOE_FLAG;10541 bp->flags |= NO_FCOE_FLAG;
10325#else
10326 bp->flags |= NO_FCOE_FLAG;
10327#endif
10328}10542}
10329 10543
10330static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp)10544static void bnx2x_get_cnic_info(struct bnx2x *bp)
10331{10545{
10332 /*10546 /*
10333 * iSCSI may be dynamically disabled but reading10547 * iSCSI may be dynamically disabled but reading
@@ -10338,143 +10552,162 @@ static void __devinit bnx2x_get_cnic_info(struct bnx2x *bp) · 4 unmodified lines
10338 bnx2x_get_fcoe_info(bp);10552 bnx2x_get_fcoe_info(bp);
10339}10553}
10340 10554
10341static void __devinit bnx2x_get_mac_hwinfo(struct bnx2x *bp)10555static void bnx2x_get_cnic_mac_hwinfo(struct bnx2x *bp)
10342{10556{
10343 u32 val, val2;10557 u32 val, val2;
10344 int func = BP_ABS_FUNC(bp);10558 int func = BP_ABS_FUNC(bp);
10345 int port = BP_PORT(bp);10559 int port = BP_PORT(bp);
10346#ifdef BCM_CNIC
10347 u8 *iscsi_mac = bp->cnic_eth_dev.iscsi_mac;10560 u8 *iscsi_mac = bp->cnic_eth_dev.iscsi_mac;
10348 u8 *fip_mac = bp->fip_mac;10561 u8 *fip_mac = bp->fip_mac;
10349#endif
10350 10562
10351 /* Zero primary MAC configuration */10563 if (IS_MF(bp)) {
10352 memset(bp->dev->dev_addr, 0, ETH_ALEN);10564 /* iSCSI and FCoE NPAR MACs: if there is no either iSCSI or
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
10367 * FCoE MAC then the appropriate feature should be disabled.10565 * FCoE MAC then the appropriate feature should be disabled.
10368 *10566 * In non SD mode features configuration comes from struct
10369 * In non SD mode features configuration comes from10567 * func_ext_config.
10370 * struct func_ext_config.
10371 */10568 */
10372 if (!IS_MF_SD(bp)) {10569 if (!IS_MF_SD(bp) && !CHIP_IS_E1x(bp)) {
10373 u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg);10570 u32 cfg = MF_CFG_RD(bp, func_ext_config[func].func_cfg);
10374 if (cfg & MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD) {10571 if (cfg & MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD) {
10375 val2 = MF_CFG_RD(bp, func_ext_config[func].10572 val2 = MF_CFG_RD(bp, func_ext_config[func].
10376 iscsi_mac_addr_upper);10573 iscsi_mac_addr_upper);
10377 val = MF_CFG_RD(bp, func_ext_config[func].10574 val = MF_CFG_RD(bp, func_ext_config[func].
10378 iscsi_mac_addr_lower);10575 iscsi_mac_addr_lower);
10379 bnx2x_set_mac_buf(iscsi_mac, val, val2);10576 bnx2x_set_mac_buf(iscsi_mac, val, val2);
10380 BNX2X_DEV_INFO("Read iSCSI MAC: %pM\n",10577 BNX2X_DEV_INFO
10381 iscsi_mac);10578 ("Read iSCSI MAC: %pM\n", iscsi_mac);
10382 } else10579 } else {
10383 bp->flags |= NO_ISCSI_OOO_FLAG | NO_ISCSI_FLAG;10580 bp->flags |= NO_ISCSI_OOO_FLAG | NO_ISCSI_FLAG;
10581 }
10384 10582
10385 if (cfg & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) {10583 if (cfg & MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD) {
10386 val2 = MF_CFG_RD(bp, func_ext_config[func].10584 val2 = MF_CFG_RD(bp, func_ext_config[func].
10387 fcoe_mac_addr_upper);10585 fcoe_mac_addr_upper);
10388 val = MF_CFG_RD(bp, func_ext_config[func].10586 val = MF_CFG_RD(bp, func_ext_config[func].
10389 fcoe_mac_addr_lower);10587 fcoe_mac_addr_lower);
10390 bnx2x_set_mac_buf(fip_mac, val, val2);10588 bnx2x_set_mac_buf(fip_mac, val, val2);
10391 BNX2X_DEV_INFO("Read FCoE L2 MAC: %pM\n",10589 BNX2X_DEV_INFO
10392 fip_mac);10590 ("Read FCoE L2 MAC: %pM\n", fip_mac);
10393 10591 } else {
10394 } else
10395 bp->flags |= NO_FCOE_FLAG;10592 bp->flags |= NO_FCOE_FLAG;
10593 }
10396 10594
10397 bp->mf_ext_config = cfg;10595 bp->mf_ext_config = cfg;
10398 10596
10399 } else { /* SD MODE */10597 } else { /* SD MODE */
10400 if (IS_MF_STORAGE_SD(bp)) {10598 if (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp)) {
10401 if (BNX2X_IS_MF_SD_PROTOCOL_ISCSI(bp)) {10599 /* use primary mac as iscsi mac */
10402 /* use primary mac as iscsi mac */10600 memcpy(iscsi_mac, bp->dev->dev_addr, ETH_ALEN);
10403 memcpy(iscsi_mac, bp->dev->dev_addr,10601
10404 ETH_ALEN);10602 BNX2X_DEV_INFO("SD ISCSI MODE\n");
10405 10603 BNX2X_DEV_INFO
10406 BNX2X_DEV_INFO("SD ISCSI MODE\n");10604 ("Read iSCSI MAC: %pM\n", iscsi_mac);
10407 BNX2X_DEV_INFO("Read iSCSI MAC: %pM\n",10605 } else if (BNX2X_IS_MF_SD_PROTOCOL_FCOE(bp)) {
10408 iscsi_mac);10606 /* use primary mac as fip mac */
10409 } else { /* FCoE */10607 memcpy(fip_mac, bp->dev->dev_addr, ETH_ALEN);
10410 memcpy(fip_mac, bp->dev->dev_addr,10608 BNX2X_DEV_INFO("SD FCoE MODE\n");
10411 ETH_ALEN);10609 BNX2X_DEV_INFO
10412 BNX2X_DEV_INFO("SD FCoE MODE\n");10610 ("Read FIP MAC: %pM\n", fip_mac);
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);
10418 }10611 }
10419 }10612 }
10420 10613
10614 if (IS_MF_STORAGE_SD(bp))
10615 /* Zero primary MAC configuration */
10616 memset(bp->dev->dev_addr, 0, ETH_ALEN);
10617
10421 if (IS_MF_FCOE_AFEX(bp))10618 if (IS_MF_FCOE_AFEX(bp))
10422 /* use FIP MAC as primary MAC */10619 /* use FIP MAC as primary MAC */
10423 memcpy(bp->dev->dev_addr, fip_mac, ETH_ALEN);10620 memcpy(bp->dev->dev_addr, fip_mac, ETH_ALEN);
10424 10621
10425#endif
10426 } else {10622 } 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
10433 val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].10623 val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].
10434 iscsi_mac_upper);10624 iscsi_mac_upper);
10435 val = SHMEM_RD(bp, dev_info.port_hw_config[port].10625 val = SHMEM_RD(bp, dev_info.port_hw_config[port].
10436 iscsi_mac_lower);10626 iscsi_mac_lower);
10437 bnx2x_set_mac_buf(iscsi_mac, val, val2);10627 bnx2x_set_mac_buf(iscsi_mac, val, val2);
10438 10628
10439 val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].10629 val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].
10440 fcoe_fip_mac_upper);10630 fcoe_fip_mac_upper);
10441 val = SHMEM_RD(bp, dev_info.port_hw_config[port].10631 val = SHMEM_RD(bp, dev_info.port_hw_config[port].
10442 fcoe_fip_mac_lower);10632 fcoe_fip_mac_lower);
10443 bnx2x_set_mac_buf(fip_mac, val, val2);10633 bnx2x_set_mac_buf(fip_mac, val, val2);
10444#endif
10445 }10634 }
10446 10635
10447 memcpy(bp->link_params.mac_addr, bp->dev->dev_addr, ETH_ALEN);10636 /* Disable iSCSI OOO if MAC configuration is invalid. */
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 */
10454 if (!is_valid_ether_addr(iscsi_mac)) {10637 if (!is_valid_ether_addr(iscsi_mac)) {
10455 bp->flags |= NO_ISCSI_FLAG;10638 bp->flags |= NO_ISCSI_OOO_FLAG | NO_ISCSI_FLAG;
10456 memset(iscsi_mac, 0, ETH_ALEN);10639 memset(iscsi_mac, 0, ETH_ALEN);
10457 }10640 }
10458 10641
10459 /* Disable FCoE if MAC configuration is10642 /* Disable FCoE if MAC configuration is invalid. */
10460 * invalid.
10461 */
10462 if (!is_valid_ether_addr(fip_mac)) {10643 if (!is_valid_ether_addr(fip_mac)) {
10463 bp->flags |= NO_FCOE_FLAG;10644 bp->flags |= NO_FCOE_FLAG;
10464 memset(bp->fip_mac, 0, ETH_ALEN);10645 memset(bp->fip_mac, 0, ETH_ALEN);
10465 }10646 }
10466#endif10647}
10648
10649static 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);
10467 10682
10468 if (!bnx2x_is_valid_ether_addr(bp, bp->dev->dev_addr))10683 if (!bnx2x_is_valid_ether_addr(bp, bp->dev->dev_addr))
10469 dev_err(&bp->pdev->dev,10684 dev_err(&bp->pdev->dev,
10470 "bad Ethernet MAC address configuration: %pM\n"10685 "bad Ethernet MAC address configuration: %pM\n"
10471 "change it manually before bringing up the appropriate network interface\n",10686 "change it manually before bringing up the appropriate network interface\n",
10472 bp->dev->dev_addr);10687 bp->dev->dev_addr);
10688}
10473 10689
10690static bool bnx2x_get_dropless_info(struct bnx2x *bp)
10691{
10692 int tmp;
10693 u32 cfg;
10474 10694
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;
10475}10708}
10476 10709
10477static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp)10710static int bnx2x_get_hwinfo(struct bnx2x *bp)
10478{10711{
10479 int /*abs*/func = BP_ABS_FUNC(bp);10712 int /*abs*/func = BP_ABS_FUNC(bp);
10480 int vn;10713 int vn;
@@ -10516,6 +10749,8 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp) · 35 unmodified lines
10516 if (REG_RD(bp, IGU_REG_RESET_MEMORIES)) {10749 if (REG_RD(bp, IGU_REG_RESET_MEMORIES)) {
10517 dev_err(&bp->pdev->dev,10750 dev_err(&bp->pdev->dev,
10518 "FORCING Normal Mode failed!!!\n");10751 "FORCING Normal Mode failed!!!\n");
10752 bnx2x_release_hw_lock(bp,
10753 HW_LOCK_RESOURCE_RESET);
10519 return -EPERM;10754 return -EPERM;
10520 }10755 }
10521 }10756 }
@@ -10526,9 +10761,10 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp) · 4 unmodified lines
10526 } else10761 } else
10527 BNX2X_DEV_INFO("IGU Normal Mode\n");10762 BNX2X_DEV_INFO("IGU Normal Mode\n");
10528 10763
10529 bnx2x_get_igu_cam_info(bp);10764 rc = bnx2x_get_igu_cam_info(bp);
10530
10531 bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_RESET);10765 bnx2x_release_hw_lock(bp, HW_LOCK_RESOURCE_RESET);
10766 if (rc)
10767 return rc;
10532 }10768 }
10533 10769
10534 /*10770 /*
@@ -10697,7 +10933,7 @@ static int __devinit bnx2x_get_hwinfo(struct bnx2x *bp) · 162 unmodified lines
10697 return rc;10933 return rc;
10698}10934}
10699 10935
10700static void __devinit bnx2x_read_fwinfo(struct bnx2x *bp)10936static void bnx2x_read_fwinfo(struct bnx2x *bp)
10701{10937{
10702 int cnt, i, block_end, rodi;10938 int cnt, i, block_end, rodi;
10703 char vpd_start[BNX2X_VPD_LEN+1];10939 char vpd_start[BNX2X_VPD_LEN+1];
@@ -10782,7 +11018,7 @@ out_not_found: · 78 unmodified lines
10782 return;11018 return;
10783}11019}
10784 11020
10785static void __devinit bnx2x_set_modes_bitmap(struct bnx2x *bp)11021static void bnx2x_set_modes_bitmap(struct bnx2x *bp)
10786{11022{
10787 u32 flags = 0;11023 u32 flags = 0;
10788 11024
@@ -10832,7 +11068,7 @@ static void __devinit bnx2x_set_modes_bitmap(struct bnx2x *bp) · 43 unmodified lines
10832 INIT_MODE_FLAGS(bp) = flags;11068 INIT_MODE_FLAGS(bp) = flags;
10833}11069}
10834 11070
10835static int __devinit bnx2x_init_bp(struct bnx2x *bp)11071static int bnx2x_init_bp(struct bnx2x *bp)
10836{11072{
10837 int func;11073 int func;
10838 int rc;11074 int rc;
@@ -10840,9 +11076,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) · 1 unmodified line
10840 mutex_init(&bp->port.phy_mutex);11076 mutex_init(&bp->port.phy_mutex);
10841 mutex_init(&bp->fw_mb_mutex);11077 mutex_init(&bp->fw_mb_mutex);
10842 spin_lock_init(&bp->stats_lock);11078 spin_lock_init(&bp->stats_lock);
10843#ifdef BCM_CNIC11079
10844 mutex_init(&bp->cnic_mutex);
10845#endif
10846 11080
10847 INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task);11081 INIT_DELAYED_WORK(&bp->sp_task, bnx2x_sp_task);
10848 INIT_DELAYED_WORK(&bp->sp_rtnl_task, bnx2x_sp_rtnl_task);11082 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
10880 dev_err(&bp->pdev->dev, "MCP disabled, must load devices in order!\n");11114 dev_err(&bp->pdev->dev, "MCP disabled, must load devices in order!\n");
10881 11115
10882 bp->disable_tpa = disable_tpa;11116 bp->disable_tpa = disable_tpa;
10883
10884#ifdef BCM_CNIC
10885 bp->disable_tpa |= IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp);11117 bp->disable_tpa |= IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp);
10886#endif
10887 11118
10888 /* Set TPA flags */11119 /* Set TPA flags */
10889 if (bp->disable_tpa) {11120 if (bp->disable_tpa) {
@@ -10897,7 +11128,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) · 7 unmodified lines
10897 if (CHIP_IS_E1(bp))11128 if (CHIP_IS_E1(bp))
10898 bp->dropless_fc = 0;11129 bp->dropless_fc = 0;
10899 else11130 else
10900 bp->dropless_fc = dropless_fc;11131 bp->dropless_fc = dropless_fc | bnx2x_get_dropless_info(bp);
10901 11132
10902 bp->mrrs = mrrs;11133 bp->mrrs = mrrs;
10903 11134
@@ -10914,15 +11145,20 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) · 10 unmodified lines
10914 bp->timer.data = (unsigned long) bp;11145 bp->timer.data = (unsigned long) bp;
10915 bp->timer.function = bnx2x_timer;11146 bp->timer.function = bnx2x_timer;
10916 11147
10917 bnx2x_dcbx_set_state(bp, true, BNX2X_DCBX_ENABLED_ON_NEG_ON);11148 if (SHMEM2_HAS(bp, dcbx_lldp_params_offset) &&
10918 bnx2x_dcbx_init_params(bp);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 }
10919 11157
10920#ifdef BCM_CNIC
10921 if (CHIP_IS_E1x(bp))11158 if (CHIP_IS_E1x(bp))
10922 bp->cnic_base_cl_id = FP_SB_MAX_E1x;11159 bp->cnic_base_cl_id = FP_SB_MAX_E1x;
10923 else11160 else
10924 bp->cnic_base_cl_id = FP_SB_MAX_E2;11161 bp->cnic_base_cl_id = FP_SB_MAX_E2;
10925#endif
10926 11162
10927 /* multiple tx priority */11163 /* multiple tx priority */
10928 if (CHIP_IS_E1x(bp))11164 if (CHIP_IS_E1x(bp))
@@ -10932,6 +11168,16 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp) · 3 unmodified lines
10932 if (CHIP_IS_E3B0(bp))11168 if (CHIP_IS_E3B0(bp))
10933 bp->max_cos = BNX2X_MULTI_TX_COS_E3B0;11169 bp->max_cos = BNX2X_MULTI_TX_COS_E3B0;
10934 11170
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
10935 return rc;11181 return rc;
10936}11182}
10937 11183
@@ -11168,11 +11414,9 @@ void bnx2x_set_rx_mode(struct net_device *dev) · 230 unmodified lines
11168 }11414 }
11169 11415
11170 bp->rx_mode = rx_mode;11416 bp->rx_mode = rx_mode;
11171#ifdef BCM_CNIC
11172 /* handle ISCSI SD mode */11417 /* handle ISCSI SD mode */
11173 if (IS_MF_ISCSI_SD(bp))11418 if (IS_MF_ISCSI_SD(bp))
11174 bp->rx_mode = BNX2X_RX_MODE_NONE;11419 bp->rx_mode = BNX2X_RX_MODE_NONE;
11175#endif
11176 11420
11177 /* Schedule the rx_mode command */11421 /* Schedule the rx_mode command */
11178 if (test_bit(BNX2X_FILTER_RX_MODE_PENDING, &bp->sp_state)) {11422 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
11284#endif11528#endif
11285 .ndo_setup_tc = bnx2x_setup_tc,11529 .ndo_setup_tc = bnx2x_setup_tc,
11286 11530
11287#if defined(NETDEV_FCOE_WWNN) && defined(BCM_CNIC)11531#ifdef NETDEV_FCOE_WWNN
11288 .ndo_fcoe_get_wwn = bnx2x_fcoe_get_wwn,11532 .ndo_fcoe_get_wwn = bnx2x_fcoe_get_wwn,
11289#endif11533#endif
11290};11534};
@@ -11307,9 +11551,8 @@ static int bnx2x_set_coherency_mask(struct bnx2x *bp) · 16 unmodified lines
11307 return 0;11551 return 0;
11308}11552}
11309 11553
11310static int __devinit bnx2x_init_dev(struct pci_dev *pdev,11554static int bnx2x_init_dev(struct pci_dev *pdev, struct net_device *dev,
11311 struct net_device *dev,11555 unsigned long board_type)
11312 unsigned long board_type)
11313{11556{
11314 struct bnx2x *bp;11557 struct bnx2x *bp;
11315 int rc;11558 int rc;
@@ -11346,6 +11589,14 @@ static int __devinit bnx2x_init_dev(struct pci_dev *pdev, · 30 unmodified lines
11346 goto err_out_disable;11589 goto err_out_disable;
11347 }11590 }
11348 11591
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
11349 if (atomic_read(&pdev->enable_cnt) == 1) {11600 if (atomic_read(&pdev->enable_cnt) == 1) {
11350 rc = pci_request_regions(pdev, DRV_MODULE_NAME);11601 rc = pci_request_regions(pdev, DRV_MODULE_NAME);
11351 if (rc) {11602 if (rc) {
@@ -11481,8 +11732,7 @@ err_out: · 129 unmodified lines
11481 return rc;11732 return rc;
11482}11733}
11483 11734
11484static void __devinit bnx2x_get_pcie_width_speed(struct bnx2x *bp,11735static void bnx2x_get_pcie_width_speed(struct bnx2x *bp, int *width, int *speed)
11485 int *width, int *speed)
11486{11736{
11487 u32 val = REG_RD(bp, PCICFG_OFFSET + PCICFG_LINK_CONTROL);11737 u32 val = REG_RD(bp, PCICFG_OFFSET + PCICFG_LINK_CONTROL);
11488 11738
@@ -11750,9 +12000,8 @@ static int bnx2x_set_qm_cid_count(struct bnx2x *bp) · 261 unmodified lines
11750{12000{
11751 int cid_count = BNX2X_L2_MAX_CID(bp);12001 int cid_count = BNX2X_L2_MAX_CID(bp);
11752 12002
11753#ifdef BCM_CNIC12003 if (CNIC_SUPPORT(bp))
11754 cid_count += CNIC_CID_MAX;12004 cid_count += CNIC_CID_MAX;
11755#endif
11756 return roundup(cid_count, QM_CID_ROUND);12005 return roundup(cid_count, QM_CID_ROUND);
11757}12006}
11758 12007
@@ -11762,7 +12011,8 @@ static int bnx2x_set_qm_cid_count(struct bnx2x *bp) · 3 unmodified lines
11762 * @dev: pci device12011 * @dev: pci device
11763 *12012 *
11764 */12013 */
11765static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev)12014static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev,
12015 int cnic_cnt)
11766{12016{
11767 int pos;12017 int pos;
11768 u16 control;12018 u16 control;
@@ -11774,7 +12024,7 @@ static int bnx2x_get_num_non_def_sbs(struct pci_dev *pdev) · 5 unmodified lines
11774 * one fast path queue: one FP queue + SB for CNIC12024 * one fast path queue: one FP queue + SB for CNIC
11775 */12025 */
11776 if (!pos)12026 if (!pos)
11777 return 1 + CNIC_PRESENT;12027 return 1 + cnic_cnt;
11778 12028
11779 /*12029 /*
11780 * The value in the PCI configuration space is the index of the last12030 * 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
11786 return control & PCI_MSIX_FLAGS_QSIZE;12036 return control & PCI_MSIX_FLAGS_QSIZE;
11787}12037}
11788 12038
11789static int __devinit bnx2x_init_one(struct pci_dev *pdev,12039struct cnic_eth_dev *bnx2x_cnic_probe(struct net_device *);
11790 const struct pci_device_id *ent)12040
12041static int bnx2x_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
11791{12042{
11792 struct net_device *dev = NULL;12043 struct net_device *dev = NULL;
11793 struct bnx2x *bp;12044 struct bnx2x *bp;
11794 int pcie_width, pcie_speed;12045 int pcie_width, pcie_speed;
11795 int rc, max_non_def_sbs;12046 int rc, max_non_def_sbs;
11796 int rx_count, tx_count, rss_count, doorbell_size;12047 int rx_count, tx_count, rss_count, doorbell_size;
12048 int cnic_cnt;
11797 /*12049 /*
11798 * An estimated maximum supported CoS number according to the chip12050 * An estimated maximum supported CoS number according to the chip
11799 * version.12051 * version.
@@ -11837,21 +12089,22 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 37 unmodified lines
11837 return -ENODEV;12089 return -ENODEV;
11838 }12090 }
11839 12091
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);
11841 12094
11842 WARN_ON(!max_non_def_sbs);12095 WARN_ON(!max_non_def_sbs);
11843 12096
11844 /* Maximum number of RSS queues: one IGU SB goes to CNIC */12097 /* 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;
11846 12099
11847 /* Maximum number of netdev Rx queues: RSS + FCoE L2 */12100 /* Maximum number of netdev Rx queues: RSS + FCoE L2 */
11848 rx_count = rss_count + FCOE_PRESENT;12101 rx_count = rss_count + cnic_cnt;
11849 12102
11850 /*12103 /*
11851 * Maximum number of netdev Tx queues:12104 * Maximum number of netdev Tx queues:
11852 * Maximum TSS queues * Maximum supported number of CoS + FCoE L212105 * Maximum TSS queues * Maximum supported number of CoS + FCoE L2
11853 */12106 */
11854 tx_count = rss_count * max_cos_est + FCOE_PRESENT;12107 tx_count = rss_count * max_cos_est + cnic_cnt;
11855 12108
11856 /* dev zeroed in init_etherdev */12109 /* dev zeroed in init_etherdev */
11857 dev = alloc_etherdev_mqs(sizeof(*bp), tx_count, rx_count);12110 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
11862 12115
11863 bp->igu_sb_cnt = max_non_def_sbs;12116 bp->igu_sb_cnt = max_non_def_sbs;
11864 bp->msg_enable = debug;12117 bp->msg_enable = debug;
12118 bp->cnic_support = cnic_cnt;
12119 bp->cnic_probe = bnx2x_cnic_probe;
12120
11865 pci_set_drvdata(pdev, dev);12121 pci_set_drvdata(pdev, dev);
11866 12122
11867 rc = bnx2x_init_dev(pdev, dev, ent->driver_data);12123 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
11870 return rc;12126 return rc;
11871 }12127 }
11872 12128
12129 BNX2X_DEV_INFO("Cnic support is %s\n", CNIC_SUPPORT(bp) ? "on" : "off");
11873 BNX2X_DEV_INFO("max_non_def_sbs %d\n", max_non_def_sbs);12130 BNX2X_DEV_INFO("max_non_def_sbs %d\n", max_non_def_sbs);
11874 12131
11875 BNX2X_DEV_INFO("Allocated netdev with %d tx and %d rx queues\n",12132 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
11902 /* calc qm_cid_count */12159 /* calc qm_cid_count */
11903 bp->qm_cid_count = bnx2x_set_qm_cid_count(bp);12160 bp->qm_cid_count = bnx2x_set_qm_cid_count(bp);
11904 12161
11905#ifdef BCM_CNIC12162 /* disable FCOE L2 queue for E1x*/
11906 /* disable FCOE L2 queue for E1x */
11907 if (CHIP_IS_E1x(bp))12163 if (CHIP_IS_E1x(bp))
11908 bp->flags |= NO_FCOE_FLAG;12164 bp->flags |= NO_FCOE_FLAG;
12165
11909 /* disable FCOE for 57840 device, until FW supports it */12166 /* disable FCOE for 57840 device, until FW supports it */
11910 switch (ent->driver_data) {12167 switch (ent->driver_data) {
11911 case BCM57840_O:12168 case BCM57840_O:
@@ -11915,8 +12172,6 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 3 unmodified lines
11915 case BCM57840_MF:12172 case BCM57840_MF:
11916 bp->flags |= NO_FCOE_FLAG;12173 bp->flags |= NO_FCOE_FLAG;
11917 }12174 }
11918#endif
11919
11920 12175
11921 /* Set bp->num_queues for MSI-X mode*/12176 /* Set bp->num_queues for MSI-X mode*/
11922 bnx2x_set_num_queues(bp);12177 bnx2x_set_num_queues(bp);
@@ -11932,14 +12187,13 @@ static int __devinit bnx2x_init_one(struct pci_dev *pdev, · 9 unmodified lines
11932 goto init_one_exit;12187 goto init_one_exit;
11933 }12188 }
11934 12189
11935#ifdef BCM_CNIC12190
11936 if (!NO_FCOE(bp)) {12191 if (!NO_FCOE(bp)) {
11937 /* Add storage MAC address */12192 /* Add storage MAC address */
11938 rtnl_lock();12193 rtnl_lock();
11939 dev_addr_add(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);12194 dev_addr_add(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);
11940 rtnl_unlock();12195 rtnl_unlock();
11941 }12196 }
11942#endif
11943 12197
11944 bnx2x_get_pcie_width_speed(bp, &pcie_width, &pcie_speed);12198 bnx2x_get_pcie_width_speed(bp, &pcie_width, &pcie_speed);
11945 12199
@@ -11973,7 +12227,7 @@ init_one_exit: · 27 unmodified lines
11973 return rc;12227 return rc;
11974}12228}
11975 12229
11976static void __devexit bnx2x_remove_one(struct pci_dev *pdev)12230static void bnx2x_remove_one(struct pci_dev *pdev)
11977{12231{
11978 struct net_device *dev = pci_get_drvdata(pdev);12232 struct net_device *dev = pci_get_drvdata(pdev);
11979 struct bnx2x *bp;12233 struct bnx2x *bp;
@@ -11984,14 +12238,12 @@ static void __devexit bnx2x_remove_one(struct pci_dev *pdev) · 4 unmodified lines
11984 }12238 }
11985 bp = netdev_priv(dev);12239 bp = netdev_priv(dev);
11986 12240
11987#ifdef BCM_CNIC
11988 /* Delete storage MAC address */12241 /* Delete storage MAC address */
11989 if (!NO_FCOE(bp)) {12242 if (!NO_FCOE(bp)) {
11990 rtnl_lock();12243 rtnl_lock();
11991 dev_addr_del(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);12244 dev_addr_del(bp->dev, bp->fip_mac, NETDEV_HW_ADDR_T_SAN);
11992 rtnl_unlock();12245 rtnl_unlock();
11993 }12246 }
11994#endif
11995 12247
11996#ifdef BCM_DCBNL12248#ifdef BCM_DCBNL
11997 /* Delete app tlvs from dcbnl */12249 /* Delete app tlvs from dcbnl */
@@ -12039,15 +12291,17 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) · 41 unmodified lines
12039 12291
12040 bp->rx_mode = BNX2X_RX_MODE_NONE;12292 bp->rx_mode = BNX2X_RX_MODE_NONE;
12041 12293
12042#ifdef BCM_CNIC12294 if (CNIC_LOADED(bp))
12043 bnx2x_cnic_notify(bp, CNIC_CTL_STOP_CMD);12295 bnx2x_cnic_notify(bp, CNIC_CTL_STOP_CMD);
12044#endif12296
12045 /* Stop Tx */12297 /* Stop Tx */
12046 bnx2x_tx_disable(bp);12298 bnx2x_tx_disable(bp);
12047 12299
12048 bnx2x_netif_stop(bp, 0);12300 bnx2x_netif_stop(bp, 0);
12049 /* Delete all NAPI objects */12301 /* Delete all NAPI objects */
12050 bnx2x_del_all_napi(bp);12302 bnx2x_del_all_napi(bp);
12303 if (CNIC_LOADED(bp))
12304 bnx2x_del_all_napi_cnic(bp);
12051 12305
12052 del_timer_sync(&bp->timer);12306 del_timer_sync(&bp->timer);
12053 12307
@@ -12188,7 +12442,7 @@ static struct pci_driver bnx2x_pci_driver = { · 134 unmodified lines
12188 .name = DRV_MODULE_NAME,12442 .name = DRV_MODULE_NAME,
12189 .id_table = bnx2x_pci_tbl,12443 .id_table = bnx2x_pci_tbl,
12190 .probe = bnx2x_init_one,12444 .probe = bnx2x_init_one,
12191 .remove = __devexit_p(bnx2x_remove_one),12445 .remove = bnx2x_remove_one,
12192 .suspend = bnx2x_suspend,12446 .suspend = bnx2x_suspend,
12193 .resume = bnx2x_resume,12447 .resume = bnx2x_resume,
12194 .err_handler = &bnx2x_err_handler,12448 .err_handler = &bnx2x_err_handler,
@@ -12238,7 +12492,6 @@ void bnx2x_notify_link_changed(struct bnx2x *bp) · 43 unmodified lines
12238module_init(bnx2x_init);12492module_init(bnx2x_init);
12239module_exit(bnx2x_cleanup);12493module_exit(bnx2x_cleanup);
12240 12494
12241#ifdef BCM_CNIC
12242/**12495/**
12243 * bnx2x_set_iscsi_eth_mac_addr - set iSCSI MAC(s).12496 * bnx2x_set_iscsi_eth_mac_addr - set iSCSI MAC(s).
12244 *12497 *
@@ -12691,12 +12944,31 @@ static int bnx2x_register_cnic(struct net_device *dev, struct cnic_ops *ops, · 446 unmodified lines
12691{12944{
12692 struct bnx2x *bp = netdev_priv(dev);12945 struct bnx2x *bp = netdev_priv(dev);
12693 struct cnic_eth_dev *cp = &bp->cnic_eth_dev;12946 struct cnic_eth_dev *cp = &bp->cnic_eth_dev;
12947 int rc;
12948
12949 DP(NETIF_MSG_IFUP, "Register_cnic called\n");
12694 12950
12695 if (ops == NULL) {12951 if (ops == NULL) {
12696 BNX2X_ERR("NULL ops received\n");12952 BNX2X_ERR("NULL ops received\n");
12697 return -EINVAL;12953 return -EINVAL;
12698 }12954 }
12699 12955
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
12700 bp->cnic_kwq = kzalloc(PAGE_SIZE, GFP_KERNEL);12972 bp->cnic_kwq = kzalloc(PAGE_SIZE, GFP_KERNEL);
12701 if (!bp->cnic_kwq)12973 if (!bp->cnic_kwq)
12702 return -ENOMEM;12974 return -ENOMEM;
@@ -12786,7 +13058,5 @@ struct cnic_eth_dev *bnx2x_cnic_probe(struct net_device *dev) · 83 unmodified lines
12786 cp->starting_cid);13058 cp->starting_cid);
12787 return cp;13059 return cp;
12788}13060}
12789EXPORT_SYMBOL(bnx2x_cnic_probe);
12790 13061
12791#endif /* BCM_CNIC */
12792 13062
drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h+56−3
@@ -2107,6 +2107,7 @@ · 2106 unmodified lines
2107#define NIG_REG_LLH1_ERROR_MASK 0x100902107#define NIG_REG_LLH1_ERROR_MASK 0x10090
2108/* [RW 8] event id for llh1 */2108/* [RW 8] event id for llh1 */
2109#define NIG_REG_LLH1_EVENT_ID 0x100882109#define NIG_REG_LLH1_EVENT_ID 0x10088
2110#define NIG_REG_LLH1_FUNC_EN 0x16104
2110#define NIG_REG_LLH1_FUNC_MEM 0x161c02111#define NIG_REG_LLH1_FUNC_MEM 0x161c0
2111#define NIG_REG_LLH1_FUNC_MEM_ENABLE 0x161602112#define NIG_REG_LLH1_FUNC_MEM_ENABLE 0x16160
2112#define NIG_REG_LLH1_FUNC_MEM_SIZE 162113#define NIG_REG_LLH1_FUNC_MEM_SIZE 16
@@ -2302,6 +2303,15 @@ · 189 unmodified lines
2302 * set to 0x345678021. This is a new register (with 2_) added in E3 B0 to2303 * set to 0x345678021. This is a new register (with 2_) added in E3 B0 to
2303 * accommodate the 9 input clients to ETS arbiter. */2304 * accommodate the 9 input clients to ETS arbiter. */
2304#define NIG_REG_P0_TX_ARB_PRIORITY_CLIENT2_MSB 0x186842305#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
2305#define NIG_REG_P1_HWPFC_ENABLE 0x181d02315#define NIG_REG_P1_HWPFC_ENABLE 0x181d0
2306#define NIG_REG_P1_MAC_IN_EN 0x185c02316#define NIG_REG_P1_MAC_IN_EN 0x185c0
2307/* [RW 1] Output enable for TX MAC interface */2317/* [RW 1] Output enable for TX MAC interface */
@@ -2418,6 +2428,12 @@ · 110 unmodified lines
2418#define NIG_REG_P1_TX_ARB_PRIORITY_CLIENT2_MSB 0x186e42428#define NIG_REG_P1_TX_ARB_PRIORITY_CLIENT2_MSB 0x186e4
2419/* [R 1] TX FIFO for transmitting data to MAC is empty. */2429/* [R 1] TX FIFO for transmitting data to MAC is empty. */
2420#define NIG_REG_P1_TX_MACFIFO_EMPTY 0x185942430#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
2421/* [R 1] FIFO empty status of the MCP TX FIFO used for storing MCP packets2437/* [R 1] FIFO empty status of the MCP TX FIFO used for storing MCP packets
2422 forwarded to the host. */2438 forwarded to the host. */
2423#define NIG_REG_P1_TX_MNG_HOST_FIFO_EMPTY 0x182b82439#define NIG_REG_P1_TX_MNG_HOST_FIFO_EMPTY 0x182b8
@@ -5482,6 +5498,7 @@ · 3058 unmodified lines
5482#define XMAC_CTRL_REG_RX_EN (0x1<<1)5498#define XMAC_CTRL_REG_RX_EN (0x1<<1)
5483#define XMAC_CTRL_REG_SOFT_RESET (0x1<<6)5499#define XMAC_CTRL_REG_SOFT_RESET (0x1<<6)
5484#define XMAC_CTRL_REG_TX_EN (0x1<<0)5500#define XMAC_CTRL_REG_TX_EN (0x1<<0)
5501#define XMAC_CTRL_REG_XLGMII_ALIGN_ENB (0x1<<7)
5485#define XMAC_PAUSE_CTRL_REG_RX_PAUSE_EN (0x1<<18)5502#define XMAC_PAUSE_CTRL_REG_RX_PAUSE_EN (0x1<<18)
5486#define XMAC_PAUSE_CTRL_REG_TX_PAUSE_EN (0x1<<17)5503#define XMAC_PAUSE_CTRL_REG_TX_PAUSE_EN (0x1<<17)
5487#define XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON (0x1<<1)5504#define XMAC_PFC_CTRL_HI_REG_FORCE_PFC_XON (0x1<<1)
@@ -5502,11 +5519,14 @@ · 14 unmodified lines
5502#define XMAC_REG_PAUSE_CTRL 0x685519#define XMAC_REG_PAUSE_CTRL 0x68
5503#define XMAC_REG_PFC_CTRL 0x705520#define XMAC_REG_PFC_CTRL 0x70
5504#define XMAC_REG_PFC_CTRL_HI 0x745521#define XMAC_REG_PFC_CTRL_HI 0x74
5522#define XMAC_REG_RX_LSS_CTRL 0x50
5505#define XMAC_REG_RX_LSS_STATUS 0x585523#define XMAC_REG_RX_LSS_STATUS 0x58
5506/* [RW 14] Maximum packet size in receive direction; exclusive of preamble &5524/* [RW 14] Maximum packet size in receive direction; exclusive of preamble &
5507 * CRC in strip mode */5525 * CRC in strip mode */
5508#define XMAC_REG_RX_MAX_SIZE 0x405526#define XMAC_REG_RX_MAX_SIZE 0x40
5509#define XMAC_REG_TX_CTRL 0x205527#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)
5510/* [RW 16] Indirect access to the XX table of the XX protection mechanism.5530/* [RW 16] Indirect access to the XX table of the XX protection mechanism.
5511 The fields are:[4:0] - tail pointer; 9:5] - Link List size; 14:10] -5531 The fields are:[4:0] - tail pointer; 9:5] - Link List size; 14:10] -
5512 header pointer. */5532 header pointer. */
@@ -5922,6 +5942,16 @@ · 409 unmodified lines
5922#define MISC_REGISTERS_SPIO_OUTPUT_HIGH 15942#define MISC_REGISTERS_SPIO_OUTPUT_HIGH 1
5923#define MISC_REGISTERS_SPIO_OUTPUT_LOW 05943#define MISC_REGISTERS_SPIO_OUTPUT_LOW 0
5924#define MISC_REGISTERS_SPIO_SET_POS 85944#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
5925#define HW_LOCK_MAX_RESOURCE_VALUE 315955#define HW_LOCK_MAX_RESOURCE_VALUE 31
5926#define HW_LOCK_RESOURCE_DCBX_ADMIN_MIB 135956#define HW_LOCK_RESOURCE_DCBX_ADMIN_MIB 13
5927#define HW_LOCK_RESOURCE_DRV_FLAGS 105957#define HW_LOCK_RESOURCE_DRV_FLAGS 10
@@ -6130,7 +6160,9 @@ · 202 unmodified lines
6130#define PCICFG_COMMAND_INT_DISABLE (1<<10)6160#define PCICFG_COMMAND_INT_DISABLE (1<<10)
6131#define PCICFG_COMMAND_RESERVED (0x1f<<11)6161#define PCICFG_COMMAND_RESERVED (0x1f<<11)
6132#define PCICFG_STATUS_OFFSET 0x066162#define PCICFG_STATUS_OFFSET 0x06
6133#define PCICFG_REVESION_ID_OFFSET 0x086163#define PCICFG_REVISION_ID_OFFSET 0x08
6164#define PCICFG_REVESION_ID_MASK 0xff
6165#define PCICFG_REVESION_ID_ERROR_VAL 0xff
6134#define PCICFG_CACHE_LINE_SIZE 0x0c6166#define PCICFG_CACHE_LINE_SIZE 0x0c
6135#define PCICFG_LATENCY_TIMER 0x0d6167#define PCICFG_LATENCY_TIMER 0x0d
6136#define PCICFG_BAR_1_LOW 0x106168#define PCICFG_BAR_1_LOW 0x10
@@ -6672,6 +6704,7 @@ · 535 unmodified lines
6672#define MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_10G_XFI 0x1B006704#define MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_10G_XFI 0x1B00
6673#define MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_20G_DXGXS 0x1E006705#define MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_20G_DXGXS 0x1E00
6674#define MDIO_GP_STATUS_TOP_AN_STATUS1_ACTUAL_SPEED_10G_SFI 0x1F006706#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
6675 6708
6676 6709
6677#define MDIO_REG_BANK_10G_PARALLEL_DETECT 0x81306710#define MDIO_REG_BANK_10G_PARALLEL_DETECT 0x8130
@@ -7046,7 +7079,8 @@ Theotherbitsarereservedandshouldbezero*/ · 368 unmodified lines
7046#define MDIO_WC_REG_AN_IEEE1BLK_AN_ADVERTISEMENT2 0x127079#define MDIO_WC_REG_AN_IEEE1BLK_AN_ADVERTISEMENT2 0x12
7047#define MDIO_WC_REG_AN_IEEE1BLK_AN_ADV2_FEC_ABILITY 0x40007080#define MDIO_WC_REG_AN_IEEE1BLK_AN_ADV2_FEC_ABILITY 0x4000
7048#define MDIO_WC_REG_AN_IEEE1BLK_AN_ADV2_FEC_REQ 0x80007081#define MDIO_WC_REG_AN_IEEE1BLK_AN_ADV2_FEC_REQ 0x8000
7049#define MDIO_WC_REG_PMD_IEEE9BLK_TENGBASE_KR_PMD_CONTROL_REGISTER_150 0x967082#define MDIO_WC_REG_PCS_STATUS2 0x0021
7083#define MDIO_WC_REG_PMD_KR_CONTROL 0x0096
7050#define MDIO_WC_REG_XGXSBLK0_XGXSCONTROL 0x80007084#define MDIO_WC_REG_XGXSBLK0_XGXSCONTROL 0x8000
7051#define MDIO_WC_REG_XGXSBLK0_MISCCONTROL1 0x800e7085#define MDIO_WC_REG_XGXSBLK0_MISCCONTROL1 0x800e
7052#define MDIO_WC_REG_XGXSBLK1_DESKEW 0x80107086#define MDIO_WC_REG_XGXSBLK1_DESKEW 0x8010
@@ -7078,6 +7112,7 @@ Theotherbitsarereservedandshouldbezero*/ · 25 unmodified lines
7078#define MDIO_WC_REG_PAR_DET_10G_STATUS 0x81307112#define MDIO_WC_REG_PAR_DET_10G_STATUS 0x8130
7079#define MDIO_WC_REG_PAR_DET_10G_CTRL 0x81317113#define MDIO_WC_REG_PAR_DET_10G_CTRL 0x8131
7080#define MDIO_WC_REG_XGXS_X2_CONTROL2 0x81417114#define MDIO_WC_REG_XGXS_X2_CONTROL2 0x8141
7115#define MDIO_WC_REG_XGXS_X2_CONTROL3 0x8142
7081#define MDIO_WC_REG_XGXS_RX_LN_SWAP1 0x816B7116#define MDIO_WC_REG_XGXS_RX_LN_SWAP1 0x816B
7082#define MDIO_WC_REG_XGXS_TX_LN_SWAP1 0x81697117#define MDIO_WC_REG_XGXS_TX_LN_SWAP1 0x8169
7083#define MDIO_WC_REG_GP2_STATUS_GP_2_0 0x81d07118#define MDIO_WC_REG_GP2_STATUS_GP_2_0 0x81d0
@@ -7112,6 +7147,7 @@ Theotherbitsarereservedandshouldbezero*/ · 28 unmodified lines
7112#define MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET 0x0a7147#define MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET 0x0a
7113#define MDIO_WC_REG_TX_FIR_TAP_POST_TAP_MASK 0x7c007148#define MDIO_WC_REG_TX_FIR_TAP_POST_TAP_MASK 0x7c00
7114#define MDIO_WC_REG_TX_FIR_TAP_ENABLE 0x80007149#define MDIO_WC_REG_TX_FIR_TAP_ENABLE 0x8000
7150#define MDIO_WC_REG_CL72_USERB0_CL72_TX_FIR_TAP 0x82e2
7115#define MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL 0x82e37151#define MDIO_WC_REG_CL72_USERB0_CL72_MISC1_CONTROL 0x82e3
7116#define MDIO_WC_REG_CL72_USERB0_CL72_OS_DEF_CTRL 0x82e67152#define MDIO_WC_REG_CL72_USERB0_CL72_OS_DEF_CTRL 0x82e6
7117#define MDIO_WC_REG_CL72_USERB0_CL72_BR_DEF_CTRL 0x82e77153#define MDIO_WC_REG_CL72_USERB0_CL72_BR_DEF_CTRL 0x82e7
@@ -7129,9 +7165,16 @@ Theotherbitsarereservedandshouldbezero*/ · 11 unmodified lines
7129#define MDIO_WC_REG_DIGITAL4_MISC5 0x833e7165#define MDIO_WC_REG_DIGITAL4_MISC5 0x833e
7130#define MDIO_WC_REG_DIGITAL5_MISC6 0x83457166#define MDIO_WC_REG_DIGITAL5_MISC6 0x8345
7131#define MDIO_WC_REG_DIGITAL5_MISC7 0x83497167#define MDIO_WC_REG_DIGITAL5_MISC7 0x8349
7168#define MDIO_WC_REG_DIGITAL5_LINK_STATUS 0x834d
7132#define MDIO_WC_REG_DIGITAL5_ACTUAL_SPEED 0x834e7169#define MDIO_WC_REG_DIGITAL5_ACTUAL_SPEED 0x834e
7133#define MDIO_WC_REG_DIGITAL6_MP5_NEXTPAGECTRL 0x83507170#define MDIO_WC_REG_DIGITAL6_MP5_NEXTPAGECTRL 0x8350
7134#define MDIO_WC_REG_CL49_USERB0_CTRL 0x83687171#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
7135#define MDIO_WC_REG_EEE_COMBO_CONTROL0 0x83907178#define MDIO_WC_REG_EEE_COMBO_CONTROL0 0x8390
7136#define MDIO_WC_REG_TX66_CONTROL 0x83b07179#define MDIO_WC_REG_TX66_CONTROL 0x83b0
7137#define MDIO_WC_REG_RX66_CONTROL 0x83c07180#define MDIO_WC_REG_RX66_CONTROL 0x83c0
@@ -7145,7 +7188,17 @@ Theotherbitsarereservedandshouldbezero*/ · 7 unmodified lines
7145#define MDIO_WC_REG_RX66_SCW3_MASK 0x83c97188#define MDIO_WC_REG_RX66_SCW3_MASK 0x83c9
7146#define MDIO_WC_REG_FX100_CTRL1 0x84007189#define MDIO_WC_REG_FX100_CTRL1 0x8400
7147#define MDIO_WC_REG_FX100_CTRL3 0x84027190#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
7149#define MDIO_WC_REG_MICROBLK_CMD 0xffc27202#define MDIO_WC_REG_MICROBLK_CMD 0xffc2
7150#define MDIO_WC_REG_MICROBLK_DL_STATUS 0xffc57203#define MDIO_WC_REG_MICROBLK_DL_STATUS 0xffc5
7151#define MDIO_WC_REG_MICROBLK_CMD3 0xffcc7204#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
5350 else if ((cmd == BNX2X_F_CMD_AFEX_VIFLISTS) &&5350 else if ((cmd == BNX2X_F_CMD_AFEX_VIFLISTS) &&
5351 (!test_bit(BNX2X_F_CMD_STOP, &o->pending)))5351 (!test_bit(BNX2X_F_CMD_STOP, &o->pending)))
5352 next_state = BNX2X_F_STATE_STARTED;5352 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
5353 else if (cmd == BNX2X_F_CMD_TX_STOP)5361 else if (cmd == BNX2X_F_CMD_TX_STOP)
5354 next_state = BNX2X_F_STATE_TX_STOPPED;5362 next_state = BNX2X_F_STATE_TX_STOPPED;
5355 5363
5356 break;5364 break;
5357 case BNX2X_F_STATE_TX_STOPPED:5365 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)
5359 next_state = BNX2X_F_STATE_STARTED;5371 next_state = BNX2X_F_STATE_STARTED;
5360 5372
5361 break;5373 break;
@@ -5637,6 +5649,28 @@ static inline int bnx2x_func_send_start(struct bnx2x *bp, · 275 unmodified lines
5637 U64_LO(data_mapping), NONE_CONNECTION_TYPE);5649 U64_LO(data_mapping), NONE_CONNECTION_TYPE);
5638}5650}
5639 5651
5652static 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
5640static inline int bnx2x_func_send_afex_update(struct bnx2x *bp,5674static inline int bnx2x_func_send_afex_update(struct bnx2x *bp,
5641 struct bnx2x_func_state_params *params)5675 struct bnx2x_func_state_params *params)
5642{5676{
@@ -5657,6 +5691,7 @@ static inline int bnx2x_func_send_afex_update(struct bnx2x *bp, · 14 unmodified lines
5657 cpu_to_le16(afex_update_params->afex_default_vlan);5691 cpu_to_le16(afex_update_params->afex_default_vlan);
5658 rdata->allowed_priorities_change_flg = 1;5692 rdata->allowed_priorities_change_flg = 1;
5659 rdata->allowed_priorities = afex_update_params->allowed_priorities;5693 rdata->allowed_priorities = afex_update_params->allowed_priorities;
5694 rdata->echo = AFEX_UPDATE;
5660 5695
5661 /* No need for an explicit memory barrier here as long we would5696 /* No need for an explicit memory barrier here as long we would
5662 * need to ensure the ordering of writing to the SPQ element5697 * 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
5773 return bnx2x_func_send_tx_stop(bp, params);5808 return bnx2x_func_send_tx_stop(bp, params);
5774 case BNX2X_F_CMD_TX_START:5809 case BNX2X_F_CMD_TX_START:
5775 return bnx2x_func_send_tx_start(bp, params);5810 return bnx2x_func_send_tx_start(bp, params);
5811 case BNX2X_F_CMD_SWITCH_UPDATE:
5812 return bnx2x_func_send_switch_update(bp, params);
5776 default:5813 default:
5777 BNX2X_ERR("Unknown command: %d\n", params->cmd);5814 BNX2X_ERR("Unknown command: %d\n", params->cmd);
5778 return -EINVAL;5815 return -EINVAL;
@@ -5818,16 +5855,30 @@ int bnx2x_func_state_change(struct bnx2x *bp, · 39 unmodified lines
5818 struct bnx2x_func_state_params *params)5855 struct bnx2x_func_state_params *params)
5819{5856{
5820 struct bnx2x_func_sp_obj *o = params->f_obj;5857 struct bnx2x_func_sp_obj *o = params->f_obj;
5821 int rc;5858 int rc, cnt = 300;
5822 enum bnx2x_func_cmd cmd = params->cmd;5859 enum bnx2x_func_cmd cmd = params->cmd;
5823 unsigned long *pending = &o->pending;5860 unsigned long *pending = &o->pending;
5824 5861
5825 mutex_lock(&o->one_pending_mutex);5862 mutex_lock(&o->one_pending_mutex);
5826 5863
5827 /* Check that the requested transition is legal */5864 /* 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) {
5829 mutex_unlock(&o->one_pending_mutex);5880 mutex_unlock(&o->one_pending_mutex);
5830 return -EINVAL;5881 return rc;
5831 }5882 }
5832 5883
5833 /* Set "pending" bit */5884 /* Set "pending" bit */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h+12−0
@@ -40,6 +40,12 @@ enum { · 39 unmodified lines
40 * pending commands list.40 * pending commands list.
41 */41 */
42 RAMROD_CONT,42 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,
43};49};
44 50
45typedef enum {51typedef enum {
@@ -1061,6 +1067,7 @@ enum bnx2x_func_cmd { · 1015 unmodified lines
1061 BNX2X_F_CMD_AFEX_VIFLISTS,1067 BNX2X_F_CMD_AFEX_VIFLISTS,
1062 BNX2X_F_CMD_TX_STOP,1068 BNX2X_F_CMD_TX_STOP,
1063 BNX2X_F_CMD_TX_START,1069 BNX2X_F_CMD_TX_START,
1070 BNX2X_F_CMD_SWITCH_UPDATE,
1064 BNX2X_F_CMD_MAX,1071 BNX2X_F_CMD_MAX,
1065};1072};
1066 1073
@@ -1103,6 +1110,10 @@ struct bnx2x_func_start_params { · 36 unmodified lines
1103 u8 network_cos_mode;1110 u8 network_cos_mode;
1104};1111};
1105 1112
1113struct bnx2x_func_switch_update_params {
1114 u8 suspend;
1115};
1116
1106struct bnx2x_func_afex_update_params {1117struct bnx2x_func_afex_update_params {
1107 u16 vif_id;1118 u16 vif_id;
1108 u16 afex_default_vlan;1119 u16 afex_default_vlan;
@@ -1136,6 +1147,7 @@ struct bnx2x_func_state_params { · 27 unmodified lines
1136 struct bnx2x_func_hw_init_params hw_init;1147 struct bnx2x_func_hw_init_params hw_init;
1137 struct bnx2x_func_hw_reset_params hw_reset;1148 struct bnx2x_func_hw_reset_params hw_reset;
1138 struct bnx2x_func_start_params start;1149 struct bnx2x_func_start_params start;
1150 struct bnx2x_func_switch_update_params switch_update;
1139 struct bnx2x_func_afex_update_params afex_update;1151 struct bnx2x_func_afex_update_params afex_update;
1140 struct bnx2x_func_afex_viflists_params afex_viflists;1152 struct bnx2x_func_afex_viflists_params afex_viflists;
1141 struct bnx2x_func_tx_start_params tx_start;1153 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
1149 UPDATE_ESTAT_QSTAT(rx_err_discard_pkt);1149 UPDATE_ESTAT_QSTAT(rx_err_discard_pkt);
1150 UPDATE_ESTAT_QSTAT(rx_skb_alloc_failed);1150 UPDATE_ESTAT_QSTAT(rx_skb_alloc_failed);
1151 UPDATE_ESTAT_QSTAT(hw_csum_err);1151 UPDATE_ESTAT_QSTAT(hw_csum_err);
1152 UPDATE_ESTAT_QSTAT(driver_filtered_tx_pkt);
1152 }1153 }
1153}1154}
1154 1155
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h+3−0
@@ -203,6 +203,7 @@ struct bnx2x_eth_stats { · 202 unmodified lines
203 /* Recovery */203 /* Recovery */
204 u32 recoverable_error;204 u32 recoverable_error;
205 u32 unrecoverable_error;205 u32 unrecoverable_error;
206 u32 driver_filtered_tx_pkt;
206 /* src: Clear-on-Read register; Will not survive PMF Migration */207 /* src: Clear-on-Read register; Will not survive PMF Migration */
207 u32 eee_tx_lpi;208 u32 eee_tx_lpi;
208};209};
@@ -264,6 +265,7 @@ struct bnx2x_eth_q_stats { · 55 unmodified lines
264 u32 total_tpa_aggregated_frames_lo;265 u32 total_tpa_aggregated_frames_lo;
265 u32 total_tpa_bytes_hi;266 u32 total_tpa_bytes_hi;
266 u32 total_tpa_bytes_lo;267 u32 total_tpa_bytes_lo;
268 u32 driver_filtered_tx_pkt;
267};269};
268 270
269struct bnx2x_eth_stats_old {271struct bnx2x_eth_stats_old {
@@ -315,6 +317,7 @@ struct bnx2x_eth_q_stats_old { · 45 unmodified lines
315 u32 rx_err_discard_pkt_old;317 u32 rx_err_discard_pkt_old;
316 u32 rx_skb_alloc_failed_old;318 u32 rx_skb_alloc_failed_old;
317 u32 hw_csum_err_old;319 u32 hw_csum_err_old;
320 u32 driver_filtered_tx_pkt_old;
318};321};
319 322
320struct bnx2x_net_stats_old {323struct bnx2x_net_stats_old {
drivers/net/ethernet/broadcom/cnic.c+102−87
@@ -40,8 +40,10 @@ · 39 unmodified lines
40#include <net/ip6_checksum.h>40#include <net/ip6_checksum.h>
41#include <scsi/iscsi_if.h>41#include <scsi/iscsi_if.h>
42 42
43#define BCM_CNIC 1
43#include "cnic_if.h"44#include "cnic_if.h"
44#include "bnx2.h"45#include "bnx2.h"
46#include "bnx2x/bnx2x.h"
45#include "bnx2x/bnx2x_reg.h"47#include "bnx2x/bnx2x_reg.h"
46#include "bnx2x/bnx2x_fw_defs.h"48#include "bnx2x/bnx2x_fw_defs.h"
47#include "bnx2x/bnx2x_hsi.h"49#include "bnx2x/bnx2x_hsi.h"
@@ -51,10 +53,10 @@ · 3 unmodified lines
51#include "cnic.h"53#include "cnic.h"
52#include "cnic_defs.h"54#include "cnic_defs.h"
53 55
54#define DRV_MODULE_NAME "cnic"56#define CNIC_MODULE_NAME "cnic"
55 57
56static char version[] __devinitdata =58static char version[] =
57 "Broadcom NetXtreme II CNIC Driver " DRV_MODULE_NAME " v" CNIC_MODULE_VERSION " (" CNIC_MODULE_RELDATE ")\n";59 "Broadcom NetXtreme II CNIC Driver " CNIC_MODULE_NAME " v" CNIC_MODULE_VERSION " (" CNIC_MODULE_RELDATE ")\n";
58 60
59MODULE_AUTHOR("Michael Chan <mchan@broadcom.com> and John(Zongxi) "61MODULE_AUTHOR("Michael Chan <mchan@broadcom.com> and John(Zongxi) "
60 "Chen (zongxi@broadcom.com");62 "Chen (zongxi@broadcom.com");
@@ -724,7 +726,7 @@ static void cnic_free_dma(struct cnic_dev *dev, struct cnic_dma *dma) · 663 unmodified lines
724 726
725 for (i = 0; i < dma->num_pages; i++) {727 for (i = 0; i < dma->num_pages; i++) {
726 if (dma->pg_arr[i]) {728 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,
728 dma->pg_arr[i], dma->pg_map_arr[i]);730 dma->pg_arr[i], dma->pg_map_arr[i]);
729 dma->pg_arr[i] = NULL;731 dma->pg_arr[i] = NULL;
730 }732 }
@@ -783,7 +785,7 @@ static int cnic_alloc_dma(struct cnic_dev *dev, struct cnic_dma *dma, · 52 unmodified lines
783 785
784 for (i = 0; i < pages; i++) {786 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