History

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

Pull networking updates from David Miller: "Highlights (1721 non-merge commits, this has to be a record of some sort): 1) Add 'random' mode to team driver, from Jiri Pirko and Eric Dumazet. 2) Make it so that any driver that supports configuration of multiple MAC addresses can provide the forwarding database add and del calls by providing a default implementation and hooking that up if the driver doesn't have an explicit set of handlers. From Vlad Yasevich. 3) Support GSO segmentation over tunnels and other encapsulating devices such as VXLAN, from Pravin B Shelar. 4) Support L2 GRE tunnels in the flow dissector, from Michael Dalton. 5) Implement Tail Loss Probe (TLP) detection in TCP, from Nandita Dukkipati. 6) In the PHY layer, allow supporting wake-on-lan in situations where the PHY registers have to be written for it to be configured. Use it to support wake-on-lan in mv643xx_eth. From Michael Stapelberg. 7) Significantly improve firewire IPV6 support, from YOSHIFUJI Hideaki. 8) Allow multiple packets to be sent in a single transmission using network coding in batman-adv, from Martin Hundebøll. 9) Add support for T5 cxgb4 chips, from Santosh Rastapur. 10) Generalize the VXLAN forwarding tables so that there is more flexibility in configurating various aspects of the endpoints. From David Stevens. 11) Support RSS and TSO in hardware over GRE tunnels in bxn2x driver, from Dmitry Kravkov. 12) Zero copy support in nfnelink_queue, from Eric Dumazet and Pablo Neira Ayuso. 13) Start adding networking selftests. 14) In situations of overload on the same AF_PACKET fanout socket, or per-cpu packet receive queue, minimize drop by distributing the load to other cpus/fanouts. From Willem de Bruijn and Eric Dumazet. 15) Add support for new payload offset BPF instruction, from Daniel Borkmann. 16) Convert several drivers over to mdoule_platform_driver(), from Sachin Kamat. 17) Provide a minimal BPF JIT image disassembler userspace tool, from Daniel Borkmann. 18) Rewrite F-RTO implementation in TCP to match the final specification of it in RFC4138 and RFC5682. From Yuchung Cheng. 19) Provide netlink socket diag of netlink sockets ("Yo dawg, I hear you like netlink, so I implemented netlink dumping of netlink sockets.") From Andrey Vagin. 20) Remove ugly passing of rtnetlink attributes into rtnl_doit functions, from Thomas Graf. 21) Allow userspace to be able to see if a configuration change occurs in the middle of an address or device list dump, from Nicolas Dichtel. 22) Support RFC3168 ECN protection for ipv6 fragments, from Hannes Frederic Sowa. 23) Increase accuracy of packet length used by packet scheduler, from Jason Wang. 24) Beginning set of changes to make ipv4/ipv6 fragment handling more scalable and less susceptible to overload and locking contention, from Jesper Dangaard Brouer. 25) Get rid of using non-type-safe NLMSG_* macros and use nlmsg_*() instead. From Hong Zhiguo. 26) Optimize route usage in IPVS by avoiding reference counting where possible, from Julian Anastasov. 27) Convert IPVS schedulers to RCU, also from Julian Anastasov. 28) Support cpu fanouts in xt_NFQUEUE netfilter target, from Holger Eitzenberger. 29) Network namespace support for nf_log, ebt_log, xt_LOG, ipt_ULOG, nfnetlink_log, and nfnetlink_queue. From Gao feng. 30) Implement RFC3168 ECN protection, from Hannes Frederic Sowa. 31) Support several new r8169 chips, from Hayes Wang. 32) Support tokenized interface identifiers in ipv6, from Daniel Borkmann. 33) Use usbnet_link_change() helper in USB net driver, from Ming Lei. 34) Add 802.1ad vlan offload support, from Patrick McHardy. 35) Support mmap() based netlink communication, also from Patrick McHardy. 36) Support HW timestamping in mlx4 driver, from Amir Vadai. 37) Rationalize AF_PACKET packet timestamping when transmitting, from Willem de Bruijn and Daniel Borkmann. 38) Bring parity to what's provided by /proc/net/packet socket dumping and the info provided by netlink socket dumping of AF_PACKET sockets. From Nicolas Dichtel. 39) Fix peeking beyond zero sized SKBs in AF_UNIX, from Benjamin Poirier" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1722 commits) filter: fix va_list build error af_unix: fix a fatal race with bit fields bnx2x: Prevent memory leak when cnic is absent bnx2x: correct reading of speed capabilities net: sctp: attribute printl with __printf for gcc fmt checks netlink: kconfig: move mmap i/o into netlink kconfig netpoll: convert mutex into a semaphore netlink: Fix skb ref counting. net_sched: act_ipt forward compat with xtables mlx4_en: fix a build error on 32bit arches Revert "bnx2x: allow nvram test to run when device is down" bridge: avoid OOPS if root port not found drivers: net: cpsw: fix kernel warn on cpsw irq enable sh_eth: use random MAC address if no valid one supplied 3c509.c: call SET_NETDEV_DEV for all device types (ISA/ISAPnP/EISA) tg3: fix to append hardware time stamping flags unix/stream: fix peeking with an offset larger than data in queue unix/dgram: fix peeking with an offset larger than data in queue unix/dgram: peek beyond 0-sized skbs openvswitch: Remove unneeded ovs_netdev_get_ifindex() ...

Linus Torvalds committed 13 years ago

Commit 73287a42 parents 251df49 20074f31506 files · +86375 −37075Browse files

Unified · Split

1506 files
  1. Documentation/ABI/testing/sysfs-class-net-mesh +8 −0
  2. Documentation/DocBook/80211.tmpl +1 −1
  3. Documentation/cgroups/00-INDEX +2 −0
  4. Documentation/cgroups/net_cls.txt +34 −0
  5. Documentation/devicetree/bindings/marvell.txt +3 −0
  6. Documentation/devicetree/bindings/net/can/atmel-can.txt +14 −0
  7. Documentation/devicetree/bindings/net/cpsw.txt +11 −5
  8. Documentation/devicetree/bindings/net/dsa/dsa.txt +91 −0
  9. Documentation/devicetree/bindings/net/marvell-orion-mdio.txt +4 −0
  10. Documentation/networking/ieee802154.txt +3 −2
  11. Documentation/networking/ip-sysctl.txt +13 −40
  12. Documentation/networking/netlink_mmap.txt +339 −0
  13. Documentation/networking/packet_mmap.txt +362 −6
  14. Documentation/networking/stmmac.txt +39 −6
  15. MAINTAINERS +5 −3
  16. arch/alpha/include/uapi/asm/socket.h +2 −0
  17. arch/arm/boot/dts/am33xx.dtsi +1 −1
  18. arch/arm/net/bpf_jit_32.c +2 −3
  19. arch/arm/plat-orion/common.c +31 −23
  20. arch/avr32/include/uapi/asm/socket.h +2 −0
  21. arch/cris/include/uapi/asm/socket.h +2 −0
  22. arch/frv/include/uapi/asm/socket.h +2 −0
  23. arch/h8300/include/uapi/asm/socket.h +2 −0
  24. arch/ia64/include/uapi/asm/socket.h +2 −0
  25. arch/m32r/include/uapi/asm/socket.h +2 −0
  26. arch/mips/include/uapi/asm/socket.h +2 −0
  27. arch/mn10300/include/uapi/asm/socket.h +2 −0
  28. arch/parisc/include/uapi/asm/socket.h +2 −0
  29. arch/powerpc/include/uapi/asm/socket.h +2 −0
  30. arch/powerpc/net/bpf_jit_comp.c +4 −8
  31. arch/powerpc/platforms/chrp/pegasos_eth.c +20 −0
  32. arch/powerpc/sysdev/mv64x60_dev.c +14 −2
  33. arch/s390/include/uapi/asm/socket.h +2 −0
  34. arch/sparc/include/uapi/asm/socket.h +2 −0
  35. arch/sparc/net/bpf_jit_comp.c +1 −5
  36. arch/x86/net/bpf_jit_comp.c +2 −7
  37. arch/xtensa/include/uapi/asm/socket.h +2 −0
  38. drivers/atm/he.c +1 −1
  39. drivers/bcma/core.c +7 −1
  40. drivers/bcma/driver_chipcommon.c +4 −1
  41. drivers/bcma/driver_chipcommon_pmu.c +25 −9
  42. drivers/bcma/main.c +5 −0
  43. drivers/bcma/scan.c +8 −8
  44. drivers/bcma/sprom.c +1 −0
  45. drivers/bluetooth/ath3k.c +2 −0
  46. drivers/bluetooth/btmrvl_debugfs.c +22 −244
  47. drivers/bluetooth/btmrvl_sdio.c +27 −22
  48. drivers/bluetooth/btusb.c +402 −16
  49. drivers/bluetooth/hci_h4.c +3 −0
  50. drivers/bluetooth/hci_ldisc.c +9 −6
  51. drivers/connector/cn_proc.c +25 −0
  52. drivers/connector/connector.c +6 −6
  53. drivers/dma/ioat/dca.c +8 −3
  54. drivers/firewire/Kconfig +3 −3
  55. drivers/firewire/net.c +232 −230
  56. drivers/infiniband/hw/cxgb4/cm.c +49 −19
  57. drivers/infiniband/hw/cxgb4/device.c +30 −4
  58. drivers/infiniband/hw/cxgb4/iw_cxgb4.h +12 −2
  59. drivers/infiniband/hw/cxgb4/mem.c +144 −11
  60. drivers/infiniband/hw/cxgb4/provider.c +11 −4
  61. drivers/infiniband/hw/cxgb4/qp.c +77 −36
  62. drivers/infiniband/hw/cxgb4/t4.h +1 −10
  63. drivers/infiniband/hw/mlx4/cq.c +1 −1
  64. drivers/infiniband/hw/nes/nes_hw.c +1 −1
  65. drivers/infiniband/hw/nes/nes_nic.c +7 −7
  66. drivers/infiniband/ulp/ipoib/ipoib_main.c +3 −1
  67. drivers/isdn/capi/capidrv.c +1 −2
  68. drivers/isdn/divert/isdn_divert.c +3 −5
  69. drivers/isdn/hisax/fsm.c +1 −1
  70. drivers/isdn/hisax/hfc_sx.c +1 −1
  71. drivers/isdn/i4l/isdn_net.c +1 −1
  72. drivers/isdn/mISDN/socket.c +1 −0
  73. drivers/isdn/sc/init.c +2 −2
  74. drivers/media/dvb-core/dvb_net.c +5 −5
  75. drivers/net/Kconfig +1 −0
  76. drivers/net/appletalk/Kconfig +1 −17
  77. drivers/net/bonding/bond_alb.c +2 −2
  78. drivers/net/bonding/bond_main.c +55 −17
  79. drivers/net/caif/Kconfig +0 −7
  80. drivers/net/caif/Makefile +0 −4
  81. drivers/net/caif/caif_hsi.c +3 −4
  82. drivers/net/caif/caif_serial.c +2 −2
  83. drivers/net/caif/caif_shm_u5500.c +0 −128
  84. drivers/net/caif/caif_shmcore.c +0 −747
  85. drivers/net/caif/caif_spi.c +3 −3
  86. drivers/net/caif/caif_spi_slave.c +1 −2
  87. drivers/net/can/Kconfig +1 −1
  88. drivers/net/can/at91_can.c +57 −19
  89. drivers/net/can/bfin_can.c +2 −2
  90. drivers/net/can/mcp251x.c +27 −38
  91. drivers/net/can/sja1000/ems_pci.c +3 −3
  92. drivers/net/can/sja1000/ems_pcmcia.c +3 −3
  93. drivers/net/can/sja1000/kvaser_pci.c +2 −2
  94. drivers/net/can/sja1000/peak_pci.c +1 −1
  95. drivers/net/can/sja1000/peak_pcmcia.c +4 −4
  96. drivers/net/can/sja1000/plx_pci.c +6 −6
  97. drivers/net/can/sja1000/sja1000.c +64 −62
  98. drivers/net/can/sja1000/sja1000.h +34 −34
  99. drivers/net/ethernet/3com/3c509.c +2 −0
  100. drivers/net/ethernet/3com/typhoon.c +3 −3
  101. drivers/net/ethernet/adaptec/starfire.c +6 −4
  102. drivers/net/ethernet/adi/bfin_mac.c +2 −4
  103. drivers/net/ethernet/aeroflex/greth.c +6 −18
  104. drivers/net/ethernet/alteon/acenic.c +2 −2
  105. drivers/net/ethernet/amd/7990.c +0 −2
  106. drivers/net/ethernet/amd/a2065.c +0 −1
  107. drivers/net/ethernet/amd/am79c961a.c +0 −1
  108. drivers/net/ethernet/amd/amd8111e.c +3 −3
  109. drivers/net/ethernet/amd/ariadne.c +0 −1
  110. drivers/net/ethernet/amd/atarilance.c +1 −5
  111. drivers/net/ethernet/amd/au1000_eth.c +0 −1
  112. drivers/net/ethernet/amd/declance.c +0 −2
  113. drivers/net/ethernet/amd/mvme147.c +1 −3
  114. drivers/net/ethernet/amd/ni65.c +1 −1
  115. drivers/net/ethernet/amd/pcnet32.c +0 −1
  116. drivers/net/ethernet/amd/sun3lance.c +1 −6
  117. drivers/net/ethernet/amd/sunlance.c +2 −7
  118. drivers/net/ethernet/apple/macmace.c +6 −10
  119. drivers/net/ethernet/atheros/atl1c/atl1c_main.c +12 −12
  120. drivers/net/ethernet/atheros/atl1e/atl1e_main.c +10 −12
  121. drivers/net/ethernet/atheros/atlx/atl1.c +8 −13
  122. drivers/net/ethernet/atheros/atlx/atl2.c +9 −12
  123. drivers/net/ethernet/atheros/atlx/atlx.c +5 −5
  124. drivers/net/ethernet/broadcom/bcm63xx_enet.c +20 −53
  125. drivers/net/ethernet/broadcom/bgmac.c +80 −4
  126. drivers/net/ethernet/broadcom/bgmac.h +1 −0
  127. drivers/net/ethernet/broadcom/bnx2.c +9 −10
  128. drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +34 −24
  129. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +270 −98
  130. drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +35 −12
  131. drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +316 −61
  132. drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h +46 −45
  133. drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h +221 −31
  134. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +146 −94
  135. drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h +14 −2
  136. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +232 −117
  137. drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h +2 −4
  138. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +46 −33
  139. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h +18 −3
  140. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +311 −40
  141. drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h +21 −6
  142. drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +43 −34
  143. drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h +1 −1
  144. drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +88 −38
  145. drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h +8 −1
  146. drivers/net/ethernet/broadcom/cnic.c +3 −1
  147. drivers/net/ethernet/broadcom/cnic_if.h +3 −0
  148. drivers/net/ethernet/broadcom/sb1250-mac.c +1 −4
  149. drivers/net/ethernet/broadcom/tg3.c +672 −240
  150. drivers/net/ethernet/broadcom/tg3.h +28 −2
  151. drivers/net/ethernet/brocade/bna/bfa_ioc.c +1 −1
  152. drivers/net/ethernet/brocade/bna/bnad.c +7 −10
  153. drivers/net/ethernet/cadence/at91_ether.c +17 −63
  154. drivers/net/ethernet/cadence/macb.c +23 −61
  155. drivers/net/ethernet/cadence/macb.h +2 −0
  156. drivers/net/ethernet/calxeda/xgmac.c +3 −6
  157. drivers/net/ethernet/chelsio/cxgb/cxgb2.c +7 −6
  158. drivers/net/ethernet/chelsio/cxgb/sge.c +4 −5
  159. drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +11 −9
  160. drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c +1 −1
  161. drivers/net/ethernet/chelsio/cxgb3/sge.c +2 −2
  162. drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +53 −2
  163. drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +760 −59
  164. drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h +3 −0
  165. drivers/net/ethernet/chelsio/cxgb4/sge.c +78 −15
  166. drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +210 −46
  167. drivers/net/ethernet/chelsio/cxgb4/t4_hw.h +0 −1
  168. drivers/net/ethernet/chelsio/cxgb4/t4_msg.h +64 −0
  169. drivers/net/ethernet/chelsio/cxgb4/t4_regs.h +98 −0
  170. drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h +36 −4
  171. drivers/net/ethernet/chelsio/cxgb4vf/adapter.h +1 −0
  172. drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +65 −10
  173. drivers/net/ethernet/chelsio/cxgb4vf/sge.c +9 −4
  174. drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h +24 −0
  175. drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c +10 −4
  176. drivers/net/ethernet/cirrus/cs89x0.c +2 −72
  177. drivers/net/ethernet/cirrus/ep93xx_eth.c +1 −12
  178. drivers/net/ethernet/cisco/enic/enic_dev.c +2 −2
  179. drivers/net/ethernet/cisco/enic/enic_dev.h +2 −2
  180. drivers/net/ethernet/cisco/enic/enic_main.c +3 −3
  181. drivers/net/ethernet/cisco/enic/vnic_dev.c +3 −0
  182. drivers/net/ethernet/davicom/dm9000.c +1 −16
  183. drivers/net/ethernet/dec/tulip/xircom_cb.c +3 −6
  184. drivers/net/ethernet/dlink/dl2k.c +2 −5
  185. drivers/net/ethernet/emulex/benet/be.h +12 −2
  186. drivers/net/ethernet/emulex/benet/be_cmds.c +185 −72
  187. drivers/net/ethernet/emulex/benet/be_cmds.h +57 −46
  188. drivers/net/ethernet/emulex/benet/be_ethtool.c +167 −10
  189. drivers/net/ethernet/emulex/benet/be_hw.h +7 −2
  190. drivers/net/ethernet/emulex/benet/be_main.c +218 −89
  191. drivers/net/ethernet/emulex/benet/be_roce.c +1 −1
  192. drivers/net/ethernet/emulex/benet/be_roce.h +1 −1
  193. drivers/net/ethernet/faraday/ftgmac100.c +3 −19
  194. drivers/net/ethernet/faraday/ftmac100.c +4 −4
  195. drivers/net/ethernet/freescale/Makefile +2 −1
  196. drivers/net/ethernet/freescale/fec.h +9 −1
  197. drivers/net/ethernet/freescale/fec_main.c +127 −80
  198. drivers/net/ethernet/freescale/fec_mpc52xx.c +8 −8
  199. drivers/net/ethernet/freescale/fec_ptp.c +2 −5
  200. drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +3 −14
  201. drivers/net/ethernet/freescale/gianfar.c +97 −79
  202. drivers/net/ethernet/freescale/gianfar.h +4 −4
  203. drivers/net/ethernet/freescale/gianfar_ethtool.c +15 −14
  204. drivers/net/ethernet/freescale/gianfar_ptp.c +4 −2
  205. drivers/net/ethernet/freescale/gianfar_sysfs.c +1 −1
  206. drivers/net/ethernet/freescale/ucc_geth.c +392 −489
  207. drivers/net/ethernet/freescale/ucc_geth_ethtool.c +11 −13
  208. drivers/net/ethernet/fujitsu/fmvj18x_cs.c +0 −2
  209. drivers/net/ethernet/i825xx/82596.c +3 −5
  210. drivers/net/ethernet/i825xx/lib82596.c +2 −4
  211. drivers/net/ethernet/ibm/ehea/ehea_main.c +12 −16
  212. drivers/net/ethernet/ibm/emac/mal.c +2 −7
  213. drivers/net/ethernet/ibm/ibmveth.c +2 −4
  214. drivers/net/ethernet/intel/e1000/e1000_ethtool.c +2 −4
  215. drivers/net/ethernet/intel/e1000/e1000_main.c +23 −24
  216. drivers/net/ethernet/intel/e1000e/80003es2lan.c +65 −66
  217. drivers/net/ethernet/intel/e1000e/82571.c +18 −20
  218. drivers/net/ethernet/intel/e1000e/82571.h +2 −0
  219. drivers/net/ethernet/intel/e1000e/defines.h +16 −11
  220. drivers/net/ethernet/intel/e1000e/e1000.h +12 −9
  221. drivers/net/ethernet/intel/e1000e/ethtool.c +111 −129
  222. drivers/net/ethernet/intel/e1000e/hw.h +2 −2
  223. drivers/net/ethernet/intel/e1000e/ich8lan.c +278 −130
  224. drivers/net/ethernet/intel/e1000e/ich8lan.h +3 −8
  225. drivers/net/ethernet/intel/e1000e/mac.c +25 −12
  226. drivers/net/ethernet/intel/e1000e/netdev.c +180 −163
  227. drivers/net/ethernet/intel/e1000e/nvm.c +1 −1
  228. drivers/net/ethernet/intel/e1000e/param.c +39 −23
  229. drivers/net/ethernet/intel/e1000e/phy.c +73 −61
  230. drivers/net/ethernet/intel/e1000e/ptp.c +1 −2
  231. drivers/net/ethernet/intel/igb/e1000_82575.c +193 −68
  232. drivers/net/ethernet/intel/igb/e1000_82575.h +2 −0
  233. drivers/net/ethernet/intel/igb/e1000_defines.h +30 −20
  234. drivers/net/ethernet/intel/igb/e1000_hw.h +32 −28
  235. drivers/net/ethernet/intel/igb/e1000_i210.c +114 −42
  236. drivers/net/ethernet/intel/igb/e1000_i210.h +4 −0
  237. drivers/net/ethernet/intel/igb/e1000_mac.c +51 −73
  238. drivers/net/ethernet/intel/igb/e1000_mac.h +8 −9
  239. drivers/net/ethernet/intel/igb/e1000_mbx.c +6 −5
  240. drivers/net/ethernet/intel/igb/e1000_mbx.h +26 −26
  241. drivers/net/ethernet/intel/igb/e1000_nvm.c +11 −16
  242. drivers/net/ethernet/intel/igb/e1000_phy.c +98 −163
  243. drivers/net/ethernet/intel/igb/e1000_regs.h +30 −23
  244. drivers/net/ethernet/intel/igb/igb.h +71 −62
  245. drivers/net/ethernet/intel/igb/igb_ethtool.c +259 −95
  246. drivers/net/ethernet/intel/igb/igb_hwmon.c +15 −14
  247. drivers/net/ethernet/intel/igb/igb_main.c +763 −656
  248. drivers/net/ethernet/intel/igb/igb_ptp.c +22 −39
  249. drivers/net/ethernet/intel/igbvf/netdev.c +9 −9
  250. drivers/net/ethernet/intel/ixgb/ixgb_main.c +17 −20
  251. drivers/net/ethernet/intel/ixgbe/ixgbe.h +5 −0
  252. drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c +1 −0
  253. drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c +89 −21
  254. drivers/net/ethernet/intel/ixgbe/ixgbe_common.c +33 −30
  255. drivers/net/ethernet/intel/ixgbe/ixgbe_common.h +2 −0
  256. drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +20 −19
  257. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +105 −74
  258. drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +17 −4
  259. drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +14 −11
  260. drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +20 −0
  261. drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c +1 −0
  262. drivers/net/ethernet/intel/ixgbevf/ixgbevf.h +1 −1
  263. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +67 −54
  264. drivers/net/ethernet/intel/ixgbevf/vf.c +6 −1
  265. drivers/net/ethernet/jme.c +3 −3
  266. drivers/net/ethernet/marvell/Kconfig +2 −4
  267. drivers/net/ethernet/marvell/Makefile +1 −1
  268. drivers/net/ethernet/marvell/mv643xx_eth.c +74 −304
  269. drivers/net/ethernet/marvell/mvmdio.c +112 −30
  270. drivers/net/ethernet/marvell/mvneta.c +2 −12
  271. drivers/net/ethernet/marvell/pxa168_eth.c +12 −15
  272. drivers/net/ethernet/marvell/sky2.c +6 −5
  273. drivers/net/ethernet/mellanox/mlx4/Makefile +1 −1
  274. drivers/net/ethernet/mellanox/mlx4/cmd.c +201 −3
  275. drivers/net/ethernet/mellanox/mlx4/cq.c +7 −3
  276. drivers/net/ethernet/mellanox/mlx4/en_clock.c +151 −0
  277. drivers/net/ethernet/mellanox/mlx4/en_cq.c +8 −2
  278. drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c +9 −1
  279. drivers/net/ethernet/mellanox/mlx4/en_ethtool.c +30 −0
  280. drivers/net/ethernet/mellanox/mlx4/en_main.c +5 −0
  281. drivers/net/ethernet/mellanox/mlx4/en_netdev.c +168 −67
  282. drivers/net/ethernet/mellanox/mlx4/en_resources.c +3 −0
  283. drivers/net/ethernet/mellanox/mlx4/en_rx.c +26 −7
  284. drivers/net/ethernet/mellanox/mlx4/en_selftest.c +2 −3
  285. drivers/net/ethernet/mellanox/mlx4/en_tx.c +28 −3
  286. drivers/net/ethernet/mellanox/mlx4/fw.c +36 −2
  287. drivers/net/ethernet/mellanox/mlx4/fw.h +1 −0
  288. drivers/net/ethernet/mellanox/mlx4/main.c +79 −0
  289. drivers/net/ethernet/mellanox/mlx4/mcg.c +29 −22
  290. drivers/net/ethernet/mellanox/mlx4/mlx4.h +37 −1
  291. drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +25 −1
  292. drivers/net/ethernet/mellanox/mlx4/port.c +15 −8
  293. drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +107 −22
  294. drivers/net/ethernet/micrel/ks8695net.c +1 −19
  295. drivers/net/ethernet/micrel/ks8851.c +20 −33
  296. drivers/net/ethernet/micrel/ks8851_mll.c +26 −6
  297. drivers/net/ethernet/microchip/enc28j60.c +2 −2
  298. drivers/net/ethernet/myricom/myri10ge/myri10ge.c +6 −6
  299. drivers/net/ethernet/natsemi/jazzsonic.c +6 −6
  300. drivers/net/ethernet/natsemi/macsonic.c +6 −6
  301. drivers/net/ethernet/natsemi/ns83820.c +2 −2
  302. drivers/net/ethernet/natsemi/sonic.c +0 −1
  303. drivers/net/ethernet/natsemi/xtsonic.c +5 −7
  304. drivers/net/ethernet/neterion/s2io.c +4 −6
  305. drivers/net/ethernet/neterion/vxge/vxge-main.c +8 −6
  306. drivers/net/ethernet/netx-eth.c +0 −2
  307. drivers/net/ethernet/nuvoton/w90p910_ether.c +6 −14
  308. drivers/net/ethernet/nvidia/forcedeth.c +52 −12
  309. drivers/net/ethernet/nxp/lpc_eth.c +0 −4
  310. drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +9 −14
  311. drivers/net/ethernet/pasemi/pasemi_mac.c +2 −3
  312. drivers/net/ethernet/qlogic/Kconfig +10 −0
  313. drivers/net/ethernet/qlogic/netxen/netxen_nic.h +3 −2
  314. drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +2 −2
  315. drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c +145 −77
  316. drivers/net/ethernet/qlogic/qla3xxx.c +0 −1
  317. drivers/net/ethernet/qlogic/qlcnic/Makefile +3 −1
  318. drivers/net/ethernet/qlogic/qlcnic/qlcnic.h +103 −26
  319. drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c +340 −165
  320. drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h +196 −8
  321. drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c +86 −21
  322. drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c +27 −48
  323. drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +100 −25
  324. drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h +4 −2
  325. drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c +48 −15
  326. drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h +8 −2
  327. drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +69 −35
  328. drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +284 −87
  329. drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c +1 −4
  330. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h +263 −0
  331. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +1954 −0
  332. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c +1780 −0
  333. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c +253 −2
  334. drivers/net/ethernet/qlogic/qlge/qlge_main.c +14 −20
  335. drivers/net/ethernet/rdc/r6040.c +7 −5
  336. drivers/net/ethernet/realtek/8139cp.c +4 −4
  337. drivers/net/ethernet/realtek/8139too.c +0 −2
  338. drivers/net/ethernet/realtek/atp.c +0 −2
  339. drivers/net/ethernet/realtek/r8169.c +208 −87
  340. drivers/net/ethernet/renesas/Kconfig +2 −1
  341. drivers/net/ethernet/renesas/sh_eth.c +349 −61
  342. drivers/net/ethernet/renesas/sh_eth.h +0 −220
  343. drivers/net/ethernet/s6gmac.c +2 −14
  344. drivers/net/ethernet/seeq/ether3.c +5 −17
  345. drivers/net/ethernet/seeq/sgiseeq.c +0 −2
  346. drivers/net/ethernet/sfc/efx.c +224 −43
  347. drivers/net/ethernet/sfc/efx.h +10 −4
  348. drivers/net/ethernet/sfc/enum.h +9 −3
  349. drivers/net/ethernet/sfc/ethtool.c +3 −1
  350. drivers/net/ethernet/sfc/falcon.c +10 −7
  351. drivers/net/ethernet/sfc/filter.c +179 −70
  352. drivers/net/ethernet/sfc/mcdi.c +1 −1
  353. drivers/net/ethernet/sfc/mcdi_pcol.h +1 −0
  354. drivers/net/ethernet/sfc/net_driver.h +63 −34
  355. drivers/net/ethernet/sfc/nic.c +77 −17
  356. drivers/net/ethernet/sfc/ptp.c +61 −55
  357. drivers/net/ethernet/sfc/rx.c +410 −383
  358. drivers/net/ethernet/sfc/siena.c +24 −1
  359. drivers/net/ethernet/sgi/meth.c +3 −2
  360. drivers/net/ethernet/sis/sis900.c +32 −9
  361. drivers/net/ethernet/smsc/smc9194.c +0 −2
  362. drivers/net/ethernet/smsc/smc91x.c +0 −2
  363. drivers/net/ethernet/smsc/smsc911x.c +1 −1
  364. drivers/net/ethernet/smsc/smsc9420.c +1 −3
  365. drivers/net/ethernet/stmicro/stmmac/Kconfig +1 −18
  366. drivers/net/ethernet/stmicro/stmmac/Makefile +3 −5
  367. drivers/net/ethernet/stmicro/stmmac/chain_mode.c +58 −34
  368. drivers/net/ethernet/stmicro/stmmac/common.h +140 −59
  369. drivers/net/ethernet/stmicro/stmmac/descs.h +48 −3
  370. drivers/net/ethernet/stmicro/stmmac/descs_com.h +23 −20
  371. drivers/net/ethernet/stmicro/stmmac/dwmac1000.h +58 −23
  372. drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c +120 −48
  373. drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c +19 −12
  374. drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c +15 −16
  375. drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c +16 −14
  376. drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h +2 −2
  377. drivers/net/ethernet/stmicro/stmmac/enh_desc.c +127 −24
  378. drivers/net/ethernet/stmicro/stmmac/mmc.h +1 −2
  379. drivers/net/ethernet/stmicro/stmmac/norm_desc.c +65 −24
  380. drivers/net/ethernet/stmicro/stmmac/ring_mode.c +20 −20
  381. drivers/net/ethernet/stmicro/stmmac/stmmac.h +47 −26
  382. drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +155 −1
  383. drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +148 −0
  384. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1013 −327
  385. drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +1 −1
  386. drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c +1 −1
  387. drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +3 −5
  388. drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +211 −0
  389. drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h +74 −0
  390. drivers/net/ethernet/sun/niu.c +1 −1
  391. drivers/net/ethernet/sun/sunbmac.c +1 −3
  392. drivers/net/ethernet/sun/sunhme.c +4 −9
  393. drivers/net/ethernet/sun/sunqe.c +1 −4
  394. drivers/net/ethernet/tehuti/tehuti.c +8 −9
  395. drivers/net/ethernet/ti/cpsw.c +260 −70
  396. drivers/net/ethernet/ti/davinci_cpdma.c +21 −10
  397. drivers/net/ethernet/ti/davinci_cpdma.h +1 −1
  398. drivers/net/ethernet/ti/davinci_emac.c +20 −34
  399. drivers/net/ethernet/ti/davinci_mdio.c +1 −0
  400. drivers/net/ethernet/ti/tlan.c +2 −3
  401. drivers/net/ethernet/toshiba/ps3_gelic_net.c +117 −123
  402. drivers/net/ethernet/toshiba/spider_net.c +3 −4
  403. drivers/net/ethernet/tundra/tsi108_eth.c +5 −16
  404. drivers/net/ethernet/via/via-rhine.c +10 −7
  405. drivers/net/ethernet/via/via-velocity.c +9 −6
  406. drivers/net/ethernet/wiznet/w5100.c +2 −2
  407. drivers/net/ethernet/wiznet/w5300.c +2 −2
  408. drivers/net/ethernet/xilinx/ll_temac_main.c +11 −22
  409. drivers/net/ethernet/xilinx/xilinx_axienet_main.c +7 −18
  410. drivers/net/ethernet/xircom/xirc2ps_cs.c +0 −1
  411. drivers/net/fddi/defxx.c +3 −6
  412. drivers/net/hamradio/yam.c +1 −1
  413. drivers/net/hyperv/netvsc.c +1 −1
  414. drivers/net/hyperv/netvsc_drv.c +1 −1
  415. drivers/net/ieee802154/at86rf230.c +117 −34
  416. drivers/net/ieee802154/fakehard.c +0 −21
  417. drivers/net/ieee802154/mrf24j40.c +20 −21
  418. drivers/net/ifb.c +2 −1
  419. drivers/net/irda/ali-ircc.c +2 −4
  420. drivers/net/irda/au1k_ir.c +4 −14
  421. drivers/net/irda/bfin_sir.c +2 −1
  422. drivers/net/irda/nsc-ircc.c +2 −4
  423. drivers/net/irda/pxaficp_ir.c +2 −2
  424. drivers/net/irda/smsc-ircc2.c +4 −13
  425. drivers/net/irda/via-ircc.c +2 −4
  426. drivers/net/irda/w83977af_ir.c +2 −5
  427. drivers/net/macvlan.c +18 −11
  428. drivers/net/macvtap.c +2 −0
  429. drivers/net/phy/lxt.c +1 −1
  430. drivers/net/phy/marvell.c +127 −0
  431. drivers/net/phy/mdio-gpio.c +1 −11
  432. drivers/net/phy/mdio-octeon.c +88 −19
  433. drivers/net/phy/micrel.c +32 −9
  434. drivers/net/phy/phy.c +17 −49
  435. drivers/net/phy/spi_ks8995.c +4 −4
  436. drivers/net/phy/vitesse.c +1 −2
  437. drivers/net/plip/plip.c +1 −1
  438. drivers/net/ppp/ppp_synctty.c +2 −51
  439. drivers/net/team/Kconfig +12 −0
  440. drivers/net/team/Makefile +1 −0
  441. drivers/net/team/team.c +29 −16
  442. drivers/net/team/team_mode_broadcast.c +2 −12
  443. drivers/net/team/team_mode_random.c +71 −0
  444. drivers/net/team/team_mode_roundrobin.c +3 −33
  445. drivers/net/tun.c +14 −6
  446. drivers/net/usb/asix_devices.c +1 −5
  447. drivers/net/usb/ax88179_178a.c +4 −8
  448. drivers/net/usb/cdc_ether.c +1 −4
  449. drivers/net/usb/cdc_mbim.c +2 −2
  450. drivers/net/usb/cdc_ncm.c +8 −10
  451. drivers/net/usb/dm9601.c +1 −6
  452. drivers/net/usb/mcs7830.c +1 −5
  453. drivers/net/usb/pegasus.c +120 −327
  454. drivers/net/usb/pegasus.h +2 −9
  455. drivers/net/usb/sierra_net.c +1 −2
  456. drivers/net/usb/usbnet.c +44 −1
  457. drivers/net/veth.c +2 −1
  458. drivers/net/virtio_net.c +9 −5
  459. drivers/net/vmxnet3/vmxnet3_drv.c +9 −8
  460. drivers/net/vmxnet3/vmxnet3_ethtool.c +3 −2
  461. drivers/net/vxlan.c +330 −216
  462. drivers/net/wireless/adm8211.c +2 −1
  463. drivers/net/wireless/at76c50x-usb.c +2 −2
  464. drivers/net/wireless/ath/ar5523/ar5523.c +8 −8
  465. drivers/net/wireless/ath/ath5k/Makefile +1 −0
  466. drivers/net/wireless/ath/ath5k/ath5k.h +2 −1
  467. drivers/net/wireless/ath/ath5k/base.c +1 −1
  468. drivers/net/wireless/ath/ath5k/eeprom.c +4 −2
  469. drivers/net/wireless/ath/ath5k/eeprom.h +0 −3
  470. drivers/net/wireless/ath/ath5k/mac80211-ops.c +2 −2
  471. drivers/net/wireless/ath/ath5k/phy.c +3 −17
  472. drivers/net/wireless/ath/ath5k/reset.c +1 −3
  473. drivers/net/wireless/ath/ath5k/trace.h +1 −1
  474. drivers/net/wireless/ath/ath6kl/Kconfig +9 −0
  475. drivers/net/wireless/ath/ath6kl/Makefile +5 −0
  476. drivers/net/wireless/ath/ath6kl/cfg80211.c +9 −6
  477. drivers/net/wireless/ath/ath6kl/core.h +0 −3
  478. drivers/net/wireless/ath/ath6kl/debug.c +66 −6
  479. drivers/net/wireless/ath/ath6kl/debug.h +4 −7
  480. drivers/net/wireless/ath/ath6kl/hif.c +3 −0
  481. drivers/net/wireless/ath/ath6kl/htc_mbox.c +20 −1
  482. drivers/net/wireless/ath/ath6kl/htc_pipe.c +7 −8
  483. drivers/net/wireless/ath/ath6kl/init.c +103 −13
  484. drivers/net/wireless/ath/ath6kl/main.c +5 −36
  485. drivers/net/wireless/ath/ath6kl/sdio.c +14 −2
  486. drivers/net/wireless/ath/ath6kl/target.h +1 −1
  487. drivers/net/wireless/ath/ath6kl/trace.c +23 −0
  488. drivers/net/wireless/ath/ath6kl/trace.h +332 −0
  489. drivers/net/wireless/ath/ath6kl/txrx.c +4 −1
  490. drivers/net/wireless/ath/ath6kl/usb.c +23 −15
  491. drivers/net/wireless/ath/ath6kl/wmi.c +6 −0
  492. drivers/net/wireless/ath/ath9k/ar5008_phy.c +23 −69
  493. drivers/net/wireless/ath/ath9k/ar9002_calib.c +6 −3
  494. drivers/net/wireless/ath/ath9k/ar9002_hw.c +3 −14
  495. drivers/net/wireless/ath/ath9k/ar9003_calib.c +2 −1
  496. drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +17 −0
  497. drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h +24 −25
  498. drivers/net/wireless/ath/ath9k/ath9k.h +5 −4
  499. drivers/net/wireless/ath/ath9k/beacon.c +1 −1
  500. drivers/net/wireless/ath/ath9k/calib.c +2 −4
  501. drivers/net/wireless/ath/ath9k/calib.h +6 −0
  502. drivers/net/wireless/ath/ath9k/common.c +3 −16
  503. drivers/net/wireless/ath/ath9k/common.h +1 −2
  504. drivers/net/wireless/ath/ath9k/debug.c +6 −1
  505. drivers/net/wireless/ath/ath9k/debug.h +2 −0
  506. drivers/net/wireless/ath/ath9k/dfs.c +1 −9
  507. drivers/net/wireless/ath/ath9k/dfs_debug.c +20 −0
  508. drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c +24 −19
  509. drivers/net/wireless/ath/ath9k/dfs_pattern_detector.h +4 −2
  510. drivers/net/wireless/ath/ath9k/dfs_pri_detector.c +11 −38
  511. drivers/net/wireless/ath/ath9k/dfs_pri_detector.h +25 −2
  512. drivers/net/wireless/ath/ath9k/htc_drv_beacon.c +1 −1
  513. drivers/net/wireless/ath/ath9k/htc_drv_main.c +10 −8
  514. drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +8 −10
  515. drivers/net/wireless/ath/ath9k/hw.c +112 −86
  516. drivers/net/wireless/ath/ath9k/hw.h +0 −14
  517. drivers/net/wireless/ath/ath9k/init.c +31 −10
  518. drivers/net/wireless/ath/ath9k/link.c +1 −1
  519. drivers/net/wireless/ath/ath9k/mac.c +8 −0
  520. drivers/net/wireless/ath/ath9k/mac.h +1 −0
  521. drivers/net/wireless/ath/ath9k/main.c +35 −11
  522. drivers/net/wireless/ath/ath9k/rc.c +2 −2
  523. drivers/net/wireless/ath/ath9k/recv.c +94 −83
  524. drivers/net/wireless/ath/ath9k/reg.h +0 −3
  525. drivers/net/wireless/ath/ath9k/xmit.c +73 −64
  526. drivers/net/wireless/ath/carl9170/carl9170.h +1 −7
  527. drivers/net/wireless/ath/carl9170/debug.c +2 −2
  528. drivers/net/wireless/ath/carl9170/mac.c +4 −4
  529. drivers/net/wireless/ath/carl9170/main.c +7 −4
  530. drivers/net/wireless/ath/carl9170/phy.c +26 −59
  531. drivers/net/wireless/ath/carl9170/tx.c +28 −41
  532. drivers/net/wireless/ath/hw.c +6 −0
  533. drivers/net/wireless/ath/key.c +6 −3
  534. drivers/net/wireless/ath/reg.h +4 −0
  535. drivers/net/wireless/ath/wil6210/Makefile +3 −1
  536. drivers/net/wireless/ath/wil6210/cfg80211.c +11 −22
  537. drivers/net/wireless/ath/wil6210/dbg_hexdump.h +0 −20
  538. drivers/net/wireless/ath/wil6210/debugfs.c +47 −11
  539. drivers/net/wireless/ath/wil6210/interrupt.c +22 −3
  540. drivers/net/wireless/ath/wil6210/main.c +27 −33
  541. drivers/net/wireless/ath/wil6210/netdev.c +0 −3
  542. drivers/net/wireless/ath/wil6210/pcie_bus.c +0 −3
  543. drivers/net/wireless/ath/wil6210/txrx.c +22 −14
  544. drivers/net/wireless/ath/wil6210/txrx.h +42 −7
  545. drivers/net/wireless/ath/wil6210/wil6210.h +10 −7
  546. drivers/net/wireless/ath/wil6210/wmi.c +111 −43
  547. drivers/net/wireless/ath/wil6210/wmi.h +264 −99
  548. drivers/net/wireless/b43/Kconfig +3 −3
  549. drivers/net/wireless/b43/b43.h +9 −1
  550. drivers/net/wireless/b43/dma.c +2 −7
  551. drivers/net/wireless/b43/main.c +21 −17
  552. drivers/net/wireless/b43/phy_ht.c +615 −93
  553. drivers/net/wireless/b43/phy_ht.h +77 −6
  554. drivers/net/wireless/b43/phy_lcn.c +3 −2
  555. drivers/net/wireless/b43/phy_lp.c +5 −11
  556. drivers/net/wireless/b43/phy_n.c +355 −361
  557. drivers/net/wireless/b43/phy_n.h +146 −0
  558. drivers/net/wireless/b43/radio_2056.c +3 −3
  559. drivers/net/wireless/b43/radio_2059.c +9 −30
  560. drivers/net/wireless/b43/radio_2059.h +3 −11
  561. drivers/net/wireless/b43/sdio.h +2 −2
  562. drivers/net/wireless/b43/tables_nphy.c +56 −45
  563. drivers/net/wireless/b43/tables_nphy.h +15 −14
  564. drivers/net/wireless/b43/tables_phy_lcn.c +3 −3
  565. drivers/net/wireless/b43legacy/dma.c +2 −6
  566. drivers/net/wireless/b43legacy/main.c +5 −4
  567. drivers/net/wireless/brcm80211/Kconfig +3 −11
  568. drivers/net/wireless/brcm80211/brcmfmac/Makefile +5 −1
  569. drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c +157 −112
  570. drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +64 −112
  571. drivers/net/wireless/brcm80211/brcmfmac/btcoex.c +497 −0
  572. drivers/net/wireless/brcm80211/brcmfmac/btcoex.h +29 −0
  573. drivers/net/wireless/brcm80211/brcmfmac/dhd.h +39 −2
  574. drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h +13 −2
  575. drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c +25 −9
  576. drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c +33 −0
  577. drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c +80 −0
  578. drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h +48 −7
  579. drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c +94 −54
  580. drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h +1 −1
  581. drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +402 −392
  582. drivers/net/wireless/brcm80211/brcmfmac/fweh.c +15 −10
  583. drivers/net/wireless/brcm80211/brcmfmac/fweh.h +3 −3
  584. drivers/net/wireless/brcm80211/brcmfmac/fwil.c +1 −0
  585. drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c +2067 −0
  586. drivers/net/wireless/brcm80211/brcmfmac/fwsignal.h +33 −0
  587. drivers/net/wireless/brcm80211/brcmfmac/p2p.c +213 −75
  588. drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c +336 −33
  589. drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h +98 −3
  590. drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h +26 −6
  591. drivers/net/wireless/brcm80211/brcmfmac/tracepoint.c +22 −0
  592. drivers/net/wireless/brcm80211/brcmfmac/tracepoint.h +101 −0
  593. drivers/net/wireless/brcm80211/brcmfmac/usb.c +18 −19
  594. drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c +415 −179
  595. drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h +17 −8
  596. drivers/net/wireless/brcm80211/brcmsmac/Makefile +3 −4
  597. drivers/net/wireless/brcm80211/brcmsmac/aiutils.c +0 −6
  598. drivers/net/wireless/brcm80211/brcmsmac/channel.c +2 −2
  599. drivers/net/wireless/brcm80211/brcmsmac/d11.h +1 −0
  600. drivers/net/wireless/brcm80211/brcmsmac/led.c +126 −0
  601. drivers/net/wireless/brcm80211/brcmsmac/led.h +36 −0
  602. drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c +86 −11
  603. drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h +4 −0
  604. drivers/net/wireless/brcm80211/brcmsmac/main.c +277 −100
  605. drivers/net/wireless/brcm80211/brcmsmac/main.h +15 −10
  606. drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c +15 −25
  607. drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h +0 −1
  608. drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c +22 −13
  609. drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c +6 −8
  610. drivers/net/wireless/brcm80211/brcmsmac/pmu.c +0 −54
  611. drivers/net/wireless/brcm80211/brcmsmac/pmu.h +0 −6
  612. drivers/net/wireless/brcm80211/brcmsmac/pub.h +15 −2
  613. drivers/net/wireless/brcm80211/brcmutil/Makefile +2 −7
  614. drivers/net/wireless/brcm80211/brcmutil/d11.c +162 −0
  615. drivers/net/wireless/brcm80211/brcmutil/utils.c +27 −10
  616. drivers/net/wireless/brcm80211/include/brcm_hw_ids.h +2 −0
  617. drivers/net/wireless/brcm80211/include/brcmu_d11.h +145 −0
  618. drivers/net/wireless/brcm80211/include/brcmu_utils.h +27 −0
  619. drivers/net/wireless/brcm80211/include/brcmu_wifi.h +25 −3
  620. drivers/net/wireless/brcm80211/include/chipcommon.h +12 −2
  621. drivers/net/wireless/ipw2x00/ipw2100.c +7 −25
  622. drivers/net/wireless/iwlegacy/3945-mac.c +1 −1
  623. drivers/net/wireless/iwlegacy/3945-rs.c +1 −1
  624. drivers/net/wireless/iwlegacy/3945.c +1 −3
  625. drivers/net/wireless/iwlegacy/3945.h +0 −4
  626. drivers/net/wireless/iwlegacy/4965-mac.c +32 −33
  627. drivers/net/wireless/iwlegacy/4965-rs.c +1 −1
  628. drivers/net/wireless/iwlegacy/4965.c +1 −1
  629. drivers/net/wireless/iwlegacy/common.c +11 −15
  630. drivers/net/wireless/iwlegacy/common.h +3 −8
  631. drivers/net/wireless/iwlwifi/Kconfig +10 −1
  632. drivers/net/wireless/iwlwifi/Makefile +1 −2
  633. drivers/net/wireless/iwlwifi/dvm/agn.h +7 −3
  634. drivers/net/wireless/iwlwifi/dvm/calib.c +1 −1
  635. drivers/net/wireless/iwlwifi/dvm/calib.h +1 −1
  636. drivers/net/wireless/iwlwifi/dvm/commands.h +2 −1
  637. drivers/net/wireless/iwlwifi/dvm/debugfs.c +32 −10
  638. drivers/net/wireless/iwlwifi/dvm/devices.c +6 −4
  639. drivers/net/wireless/iwlwifi/dvm/lib.c +14 −4
  640. drivers/net/wireless/iwlwifi/dvm/mac80211.c +23 −9
  641. drivers/net/wireless/iwlwifi/dvm/main.c +3 −3
  642. drivers/net/wireless/iwlwifi/dvm/rs.c +1 −1
  643. drivers/net/wireless/iwlwifi/dvm/rxon.c +6 −5
  644. drivers/net/wireless/iwlwifi/dvm/scan.c +1 −1
  645. drivers/net/wireless/iwlwifi/dvm/sta.c +4 −1
  646. drivers/net/wireless/iwlwifi/dvm/testmode.c +1 −1
  647. drivers/net/wireless/iwlwifi/dvm/tx.c +52 −6
  648. drivers/net/wireless/iwlwifi/dvm/ucode.c +1 −1
  649. drivers/net/wireless/iwlwifi/iwl-1000.c +0 −1
  650. drivers/net/wireless/iwlwifi/iwl-2000.c +0 −1
  651. drivers/net/wireless/iwlwifi/iwl-5000.c +0 −1
  652. drivers/net/wireless/iwlwifi/iwl-6000.c +0 −1
  653. drivers/net/wireless/iwlwifi/iwl-7000.c +49 −14
  654. drivers/net/wireless/iwlwifi/iwl-agn-hw.h +1 −1
  655. drivers/net/wireless/iwlwifi/iwl-config.h +48 −1
  656. drivers/net/wireless/iwlwifi/iwl-csr.h +1 −1
  657. drivers/net/wireless/iwlwifi/iwl-debug.c +7 −6
  658. drivers/net/wireless/iwlwifi/iwl-devtrace.h +1 −1
  659. drivers/net/wireless/iwlwifi/iwl-drv.c +17 −15
  660. drivers/net/wireless/iwlwifi/iwl-drv.h +16 −1
  661. drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c +5 −4
  662. drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h +1 −1
  663. drivers/net/wireless/iwlwifi/iwl-eeprom-read.c +3 −2
  664. drivers/net/wireless/iwlwifi/iwl-eeprom-read.h +1 −1
  665. drivers/net/wireless/iwlwifi/iwl-fh.h +1 −1
  666. drivers/net/wireless/iwlwifi/iwl-fw-file.h +1 −1
  667. drivers/net/wireless/iwlwifi/iwl-fw.h +28 −1
  668. drivers/net/wireless/iwlwifi/iwl-io.c +10 −9
  669. drivers/net/wireless/iwlwifi/iwl-modparams.h +2 −4
  670. drivers/net/wireless/iwlwifi/iwl-notif-wait.c +8 −7
  671. drivers/net/wireless/iwlwifi/iwl-notif-wait.h +1 −1
  672. drivers/net/wireless/iwlwifi/iwl-nvm-parse.c +49 −2
  673. drivers/net/wireless/iwlwifi/iwl-nvm-parse.h +1 −1
  674. drivers/net/wireless/iwlwifi/iwl-op-mode.h +1 −1
  675. drivers/net/wireless/iwlwifi/iwl-phy-db.c +6 −5
  676. drivers/net/wireless/iwlwifi/iwl-phy-db.h +1 −1
  677. drivers/net/wireless/iwlwifi/iwl-prph.h +1 −1
  678. drivers/net/wireless/iwlwifi/iwl-test.c +7 −7
  679. drivers/net/wireless/iwlwifi/iwl-test.h +1 −1
  680. drivers/net/wireless/iwlwifi/iwl-testmode.h +1 −1
  681. drivers/net/wireless/iwlwifi/iwl-trans.h +2 −6
  682. drivers/net/wireless/iwlwifi/mvm/Makefile +1 −1
  683. drivers/net/wireless/iwlwifi/mvm/binding.c +1 −1
  684. drivers/net/wireless/iwlwifi/mvm/bt-coex.c +589 −0
  685. drivers/net/wireless/iwlwifi/mvm/d3.c +264 −3
  686. drivers/net/wireless/iwlwifi/mvm/debugfs.c +247 −10
  687. drivers/net/wireless/iwlwifi/mvm/fw-api-bt-coex.h +319 −0
  688. drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h +51 −2
  689. drivers/net/wireless/iwlwifi/mvm/fw-api-mac.h +1 −1
  690. drivers/net/wireless/iwlwifi/mvm/fw-api-power.h +23 −43
  691. drivers/net/wireless/iwlwifi/mvm/fw-api-rs.h +1 −1
  692. drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h +1 −1
  693. drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h +1 −1
  694. drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h +7 −1
  695. drivers/net/wireless/iwlwifi/mvm/fw-api.h +40 −43
  696. drivers/net/wireless/iwlwifi/mvm/fw.c +24 −13
  697. drivers/net/wireless/iwlwifi/mvm/led.c +1 −1
  698. drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c +70 −17
  699. drivers/net/wireless/iwlwifi/mvm/mac80211.c +95 −24
  700. drivers/net/wireless/iwlwifi/mvm/mvm.h +45 −14
  701. drivers/net/wireless/iwlwifi/mvm/nvm.c +36 −109
  702. drivers/net/wireless/iwlwifi/mvm/ops.c +17 −31
  703. drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c +4 −10
  704. drivers/net/wireless/iwlwifi/mvm/power.c +45 −72
  705. drivers/net/wireless/iwlwifi/mvm/quota.c +3 −2
  706. drivers/net/wireless/iwlwifi/mvm/rs.c +26 −24
  707. drivers/net/wireless/iwlwifi/mvm/rx.c +1 −1
  708. drivers/net/wireless/iwlwifi/mvm/scan.c +3 −3
  709. drivers/net/wireless/iwlwifi/mvm/sta.c +87 −12
  710. drivers/net/wireless/iwlwifi/mvm/sta.h +5 −1
  711. drivers/net/wireless/iwlwifi/mvm/time-event.c +29 −21
  712. drivers/net/wireless/iwlwifi/mvm/time-event.h +3 −2
  713. drivers/net/wireless/iwlwifi/mvm/tx.c +15 −13
  714. drivers/net/wireless/iwlwifi/mvm/utils.c +5 −4
  715. drivers/net/wireless/iwlwifi/pcie/cfg.h +0 −115
  716. drivers/net/wireless/iwlwifi/pcie/drv.c +3 −3
  717. drivers/net/wireless/iwlwifi/pcie/trans.c +4 −21
  718. drivers/net/wireless/iwlwifi/pcie/tx.c +7 −6
  719. drivers/net/wireless/libertas_tf/main.c +4 −4
  720. drivers/net/wireless/mac80211_hwsim.c +96 −29
  721. drivers/net/wireless/mwifiex/11ac.c +42 −1
  722. drivers/net/wireless/mwifiex/11ac.h +17 −0
  723. drivers/net/wireless/mwifiex/11n.c +22 −0
  724. drivers/net/wireless/mwifiex/11n_aggr.c +1 −13
  725. drivers/net/wireless/mwifiex/11n_rxreorder.c +1 −1
  726. drivers/net/wireless/mwifiex/Makefile +1 −0
  727. drivers/net/wireless/mwifiex/cfg80211.c +184 −71
  728. drivers/net/wireless/mwifiex/cmdevt.c +27 −12
  729. drivers/net/wireless/mwifiex/decl.h +9 −2
  730. drivers/net/wireless/mwifiex/ethtool.c +70 −0
  731. drivers/net/wireless/mwifiex/fw.h +51 −32
  732. drivers/net/wireless/mwifiex/init.c +11 −22
  733. drivers/net/wireless/mwifiex/ioctl.h +31 −0
  734. drivers/net/wireless/mwifiex/join.c +23 −0
  735. drivers/net/wireless/mwifiex/main.c +12 −3
  736. drivers/net/wireless/mwifiex/main.h +19 −4
  737. drivers/net/wireless/mwifiex/pcie.c +114 −102
  738. drivers/net/wireless/mwifiex/scan.c +8 −29
  739. drivers/net/wireless/mwifiex/sta_cmd.c +82 −1
  740. drivers/net/wireless/mwifiex/sta_cmdresp.c +5 −1
  741. drivers/net/wireless/mwifiex/sta_ioctl.c +18 −12
  742. drivers/net/wireless/mwifiex/txrx.c +2 −0
  743. drivers/net/wireless/mwifiex/uap_cmd.c +55 −0
  744. drivers/net/wireless/mwifiex/util.c +3 −3
  745. drivers/net/wireless/mwifiex/wmm.c +74 −134
  746. drivers/net/wireless/mwifiex/wmm.h +3 −0
  747. drivers/net/wireless/mwl8k.c +98 −69
  748. drivers/net/wireless/orinoco/orinoco_usb.c +1 −1
  749. drivers/net/wireless/p54/fwio.c +2 −2
  750. drivers/net/wireless/p54/main.c +3 −3
  751. drivers/net/wireless/p54/p54spi.c +3 −3
  752. drivers/net/wireless/p54/txrx.c +2 −2
  753. drivers/net/wireless/ray_cs.c +4 −4
  754. drivers/net/wireless/rndis_wlan.c +2 −3
  755. drivers/net/wireless/rt2x00/Kconfig +7 −0
  756. drivers/net/wireless/rt2x00/rt2400pci.c +162 −161
  757. drivers/net/wireless/rt2x00/rt2500pci.c +177 −176
  758. drivers/net/wireless/rt2x00/rt2500usb.c +18 −17
  759. drivers/net/wireless/rt2x00/rt2800.h +99 −4
  760. drivers/net/wireless/rt2x00/rt2800lib.c +1208 −389
  761. drivers/net/wireless/rt2x00/rt2800pci.c +244 −133
  762. drivers/net/wireless/rt2x00/rt2800usb.c +86 −25
  763. drivers/net/wireless/rt2x00/rt2x00.h +54 −41
  764. drivers/net/wireless/rt2x00/rt2x00config.c +5 −5
  765. drivers/net/wireless/rt2x00/rt2x00debug.c +4 −4
  766. drivers/net/wireless/rt2x00/rt2x00dev.c +11 −13
  767. drivers/net/wireless/rt2x00/rt2x00firmware.c +12 −13
  768. drivers/net/wireless/rt2x00/rt2x00leds.c +1 −1
  769. drivers/net/wireless/rt2x00/rt2x00mac.c +10 −9
  770. drivers/net/wireless/rt2x00/rt2x00mmio.c +26 −26
  771. drivers/net/wireless/rt2x00/rt2x00mmio.h +26 −26
  772. drivers/net/wireless/rt2x00/rt2x00pci.c +7 −7
  773. drivers/net/wireless/rt2x00/rt2x00queue.c +31 −26
  774. drivers/net/wireless/rt2x00/rt2x00queue.h +12 −3
  775. drivers/net/wireless/rt2x00/rt2x00soc.c +2 −2
  776. drivers/net/wireless/rt2x00/rt2x00usb.c +25 −19
  777. drivers/net/wireless/rt2x00/rt61pci.c +276 −274
  778. drivers/net/wireless/rt2x00/rt73usb.c +16 −16
  779. drivers/net/wireless/rtl818x/rtl8180/dev.c +2 −2
  780. drivers/net/wireless/rtl818x/rtl8180/grf5101.c +2 −1
  781. drivers/net/wireless/rtl818x/rtl8180/max2820.c +1 −1
  782. drivers/net/wireless/rtl818x/rtl8180/rtl8225.c +2 −1
  783. drivers/net/wireless/rtl818x/rtl8180/sa2400.c +2 −1
  784. drivers/net/wireless/rtl818x/rtl8187/dev.c +2 −2
  785. drivers/net/wireless/rtl818x/rtl8187/rtl8225.c +2 −1
  786. drivers/net/wireless/rtlwifi/Kconfig +9 −0
  787. drivers/net/wireless/rtlwifi/Makefile +1 −0
  788. drivers/net/wireless/rtlwifi/base.c +329 −54
  789. drivers/net/wireless/rtlwifi/base.h +12 −2
  790. drivers/net/wireless/rtlwifi/core.c +177 −44
  791. drivers/net/wireless/rtlwifi/debug.c +4 −1
  792. drivers/net/wireless/rtlwifi/debug.h +11 −2
  793. drivers/net/wireless/rtlwifi/efuse.c +41 −12
  794. drivers/net/wireless/rtlwifi/efuse.h +0 −1
  795. drivers/net/wireless/rtlwifi/pci.c +119 −31
  796. drivers/net/wireless/rtlwifi/pci.h +2 −0
  797. drivers/net/wireless/rtlwifi/ps.c +305 −25
  798. drivers/net/wireless/rtlwifi/ps.h +2 −0
  799. drivers/net/wireless/rtlwifi/rtl8188ee/Makefile +16 −0
  800. drivers/net/wireless/rtlwifi/rtl8188ee/def.h +324 −0
  801. drivers/net/wireless/rtlwifi/rtl8188ee/dm.c +1794 −0
  802. drivers/net/wireless/rtlwifi/rtl8188ee/dm.h +326 −0
  803. drivers/net/wireless/rtlwifi/rtl8188ee/fw.c +830 −0
  804. drivers/net/wireless/rtlwifi/rtl8188ee/fw.h +301 −0
  805. drivers/net/wireless/rtlwifi/rtl8188ee/hw.c +2530 −0
  806. drivers/net/wireless/rtlwifi/rtl8188ee/hw.h +68 −0
  807. drivers/net/wireless/rtlwifi/rtl8188ee/led.c +157 −0
  808. drivers/net/wireless/rtlwifi/rtl8188ee/led.h +38 −0
  809. drivers/net/wireless/rtlwifi/rtl8188ee/phy.c +2202 −0
  810. drivers/net/wireless/rtlwifi/rtl8188ee/phy.h +236 −0
  811. drivers/net/wireless/rtlwifi/rtl8188ee/pwrseq.c +109 −0
  812. drivers/net/wireless/rtlwifi/rtl8188ee/pwrseq.h +327 −0
  813. drivers/net/wireless/rtlwifi/rtl8188ee/pwrseqcmd.c +140 −0
  814. drivers/net/wireless/rtlwifi/rtl8188ee/pwrseqcmd.h +97 −0
  815. drivers/net/wireless/rtlwifi/rtl8188ee/reg.h +2258 −0
  816. drivers/net/wireless/rtlwifi/rtl8188ee/rf.c +467 −0
  817. drivers/net/wireless/rtlwifi/rtl8188ee/rf.h +46 −0
  818. drivers/net/wireless/rtlwifi/rtl8188ee/sw.c +400 −0
  819. drivers/net/wireless/rtlwifi/rtl8188ee/sw.h +36 −0
  820. drivers/net/wireless/rtlwifi/rtl8188ee/table.c +643 −0
  821. drivers/net/wireless/rtlwifi/rtl8188ee/table.h +47 −0
  822. drivers/net/wireless/rtlwifi/rtl8188ee/trx.c +817 −0
  823. drivers/net/wireless/rtlwifi/rtl8188ee/trx.h +795 −0
  824. drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c +22 −83
  825. drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c +98 −1
  826. drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h +4 −0
  827. drivers/net/wireless/rtlwifi/rtl8192ce/hw.c +103 −15
  828. drivers/net/wireless/rtlwifi/rtl8192ce/hw.h +4 −0
  829. drivers/net/wireless/rtlwifi/rtl8192ce/reg.h +1 −0
  830. drivers/net/wireless/rtlwifi/rtl8192ce/sw.c +3 −1
  831. drivers/net/wireless/rtlwifi/rtl8192ce/trx.c +84 −244
  832. drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +10 −10
  833. drivers/net/wireless/rtlwifi/rtl8192cu/sw.c +1 −1
  834. drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +5 −5
  835. drivers/net/wireless/rtlwifi/rtl8192de/dm.c +16 −16
  836. drivers/net/wireless/rtlwifi/rtl8192de/hw.c +1 −1
  837. drivers/net/wireless/rtlwifi/rtl8192de/phy.c +20 −20
  838. drivers/net/wireless/rtlwifi/rtl8192de/reg.h +1 −1
  839. drivers/net/wireless/rtlwifi/rtl8192de/sw.c +3 −3
  840. drivers/net/wireless/rtlwifi/rtl8192de/trx.c +2 −2
  841. drivers/net/wireless/rtlwifi/rtl8192se/def.h +0 −7
  842. drivers/net/wireless/rtlwifi/rtl8192se/dm.c +32 −17
  843. drivers/net/wireless/rtlwifi/rtl8192se/hw.c +99 −51
  844. drivers/net/wireless/rtlwifi/rtl8192se/hw.h +2 −1
  845. drivers/net/wireless/rtlwifi/rtl8192se/phy.c +42 −19
  846. drivers/net/wireless/rtlwifi/rtl8192se/phy.h +1 −0
  847. drivers/net/wireless/rtlwifi/rtl8192se/sw.c +2 −1
  848. drivers/net/wireless/rtlwifi/rtl8192se/trx.c +26 −274
  849. drivers/net/wireless/rtlwifi/rtl8723ae/dm.c +81 −7
  850. drivers/net/wireless/rtlwifi/rtl8723ae/dm.h +6 −0
  851. drivers/net/wireless/rtlwifi/rtl8723ae/fw.c +96 −1
  852. drivers/net/wireless/rtlwifi/rtl8723ae/fw.h +5 −2
  853. drivers/net/wireless/rtlwifi/rtl8723ae/hw.c +47 −23
  854. drivers/net/wireless/rtlwifi/rtl8723ae/led.c +14 −8
  855. drivers/net/wireless/rtlwifi/rtl8723ae/sw.c +1 −1
  856. drivers/net/wireless/rtlwifi/rtl8723ae/trx.c +9 −5
  857. drivers/net/wireless/rtlwifi/usb.c +155 −71
  858. drivers/net/wireless/rtlwifi/usb.h +4 −1
  859. drivers/net/wireless/rtlwifi/wifi.h +202 −22
  860. drivers/net/wireless/ti/wl1251/main.c +3 −2
  861. drivers/net/wireless/ti/wl1251/sdio.c +3 −1
  862. drivers/net/wireless/ti/wl1251/spi.c +2 −2
  863. drivers/net/wireless/ti/wl12xx/cmd.c +1 −1
  864. drivers/net/wireless/ti/wl12xx/main.c +1 −0
  865. drivers/net/wireless/ti/wl12xx/wl12xx.h +2 −0
  866. drivers/net/wireless/ti/wl18xx/cmd.c +3 −3
  867. drivers/net/wireless/ti/wl18xx/main.c +24 −1
  868. drivers/net/wireless/ti/wl18xx/reg.h +29 −0
  869. drivers/net/wireless/ti/wl18xx/wl18xx.h +3 −1
  870. drivers/net/wireless/ti/wlcore/acx.c +29 −0
  871. drivers/net/wireless/ti/wlcore/acx.h +14 −2
  872. drivers/net/wireless/ti/wlcore/cmd.c +32 −0
  873. drivers/net/wireless/ti/wlcore/debug.h +16 −17
  874. drivers/net/wireless/ti/wlcore/debugfs.c +1 −2
  875. drivers/net/wireless/ti/wlcore/event.c +8 −1
  876. drivers/net/wireless/ti/wlcore/main.c +132 −73
  877. drivers/net/wireless/ti/wlcore/ps.c +3 −1
  878. drivers/net/wireless/ti/wlcore/tx.c +13 −26
  879. drivers/net/wireless/ti/wlcore/wlcore.h +3 −0
  880. drivers/net/wireless/ti/wlcore/wlcore_i.h +21 −8
  881. drivers/net/wireless/zd1211rw/zd_mac.c +2 −2
  882. drivers/net/xen-netback/netback.c +248 −68
  883. drivers/net/xen-netfront.c +27 −20
  884. drivers/nfc/Kconfig +10 −0
  885. drivers/nfc/Makefile +1 −0
  886. drivers/nfc/mei_phy.c +164 −0
  887. drivers/nfc/mei_phy.h +30 −0
  888. drivers/nfc/microread/Kconfig +1 −1
  889. drivers/nfc/microread/mei.c +9 −130
  890. drivers/nfc/pn533.c +455 −198
  891. drivers/nfc/pn544/Kconfig +12 −1
  892. drivers/nfc/pn544/Makefile +2 −0
  893. drivers/nfc/pn544/mei.c +121 −0
  894. drivers/of/of_mdio.c +58 −6
  895. drivers/pci/iov.c +41 −0
  896. drivers/ptp/ptp_clock.c +13 −25
  897. drivers/ptp/ptp_pch.c +15 −14
  898. drivers/s390/kvm/virtio_ccw.c +3 −3
  899. drivers/s390/net/qeth_core.h +2 −2
  900. drivers/s390/net/qeth_core_main.c +5 −3
  901. drivers/s390/net/qeth_l2_main.c +7 −6
  902. drivers/s390/net/qeth_l3_main.c +19 −14
  903. drivers/scsi/bnx2fc/bnx2fc.h +10 −13
  904. drivers/scsi/bnx2fc/bnx2fc_fcoe.c +20 −15
  905. drivers/scsi/bnx2fc/bnx2fc_hwi.c +13 −9
  906. drivers/scsi/bnx2fc/bnx2fc_io.c +5 −4
  907. drivers/scsi/csiostor/Makefile +2 −1
  908. drivers/scsi/csiostor/csio_hw.c +119 −440
  909. drivers/scsi/csiostor/csio_hw.h +18 −29
  910. drivers/scsi/csiostor/csio_hw_chip.h +175 −0
  911. drivers/scsi/csiostor/csio_hw_t4.c +403 −0
  912. drivers/scsi/csiostor/csio_hw_t5.c +397 −0
  913. drivers/scsi/csiostor/csio_init.c +38 −10
  914. drivers/scsi/csiostor/csio_init.h +4 −25
  915. drivers/scsi/csiostor/csio_lnode.h +1 −1
  916. drivers/scsi/csiostor/csio_rnode.c +9 −1
  917. drivers/scsi/csiostor/csio_rnode.h +1 −1
  918. drivers/scsi/csiostor/csio_wr.c +38 −22
  919. drivers/scsi/fcoe/fcoe.c +1 −1
  920. drivers/scsi/scsi_netlink.c +2 −2
  921. drivers/scsi/scsi_transport_fc.c +8 −13
  922. drivers/scsi/scsi_transport_iscsi.c +35 −35
  923. drivers/ssb/driver_chipcommon.c +1 −1
  924. drivers/ssb/driver_chipcommon_pmu.c +35 −25
  925. drivers/ssb/driver_mipscore.c +13 −12
  926. drivers/ssb/driver_pcicore.c +7 −8
  927. drivers/ssb/embedded.c +2 −3
  928. drivers/ssb/main.c +22 −29
  929. drivers/ssb/pci.c +63 −57
  930. drivers/ssb/pcmcia.c +20 −26
  931. drivers/ssb/scan.c +11 −20
  932. drivers/ssb/sprom.c +2 −2
  933. drivers/ssb/ssb_private.h +15 −4
  934. drivers/staging/gdm72xx/netlink_k.c +6 −6
  935. drivers/vhost/net.c +6 −68
  936. drivers/vhost/vhost.c +3 −0
  937. fs/dlm/lowcomms.c +1 −1
  938. include/linux/bcma/bcma.h +55 −0
  939. include/linux/bcma/bcma_driver_chipcommon.h +6 −0
  940. include/linux/bcma/bcma_regs.h +1 −0
  941. include/linux/cn_proc.h +4 −0
  942. include/linux/filter.h +15 −0
  943. include/linux/icmpv6.h +15 −3
  944. include/linux/ieee80211.h +108 −17
  945. include/linux/if_arp.h +10 −2
  946. include/linux/if_team.h +24 −1
  947. include/linux/if_vlan.h +37 −19
  948. include/linux/ktime.h +18 −0
  949. include/linux/micrel_phy.h +1 −0
  950. include/linux/mlx4/cmd.h +6 −0
  951. include/linux/mlx4/cq.h +16 −0
  952. include/linux/mlx4/device.h +11 −2
  953. include/linux/mv643xx_eth.h +0 −1
  954. include/linux/netdev_features.h +17 −10
  955. include/linux/netdevice.h +53 −26
  956. include/linux/netfilter.h +0 −5
  957. include/linux/netfilter/ipset/ip_set.h +119 −7
  958. include/linux/netfilter/ipset/ip_set_ahash.h +0 −1241
  959. include/linux/netfilter/ipset/ip_set_bitmap.h +6 −0
  960. include/linux/netfilter/ipset/ip_set_timeout.h +22 −80
  961. include/linux/netfilter/ipset/pfxlen.h +9 −0
  962. include/linux/netfilter/nfnetlink.h +7 −4
  963. include/linux/netlink.h +10 −1
  964. include/linux/netpoll.h +1 −1
  965. include/linux/of_net.h +10 −0
  966. include/linux/openvswitch.h +1 −430
  967. include/linux/pci.h +5 −0
  968. include/linux/phy.h +10 −0
  969. include/linux/platform_data/brcmfmac-sdio.h +124 −0
  970. include/linux/platform_data/cpsw.h +1 −1
  971. include/linux/rtnetlink.h +9 −0
  972. include/linux/sctp.h +2 −4
  973. include/linux/sh_eth.h +1 −0
  974. include/linux/skbuff.h +94 −1
  975. include/linux/sock_diag.h +3 −0
  976. include/linux/socket.h +1 −0
  977. include/linux/spi/at86rf230.h +14 −0
  978. include/linux/ssb/ssb.h +54 −6
  979. include/linux/ssb/ssb_regs.h +5 −5
  980. include/linux/tcp.h +3 −18
  981. include/linux/usb/usbnet.h +2 −0
  982. include/linux/virtio.h +0 −6
  983. include/linux/vm_sockets.h +23 −0
  984. include/net/af_unix.h +5 −3
  985. include/net/bluetooth/bluetooth.h +14 −3
  986. include/net/bluetooth/hci.h +27 −3
  987. include/net/bluetooth/hci_core.h +90 −38
  988. include/net/bluetooth/l2cap.h +15 −0
  989. include/net/bluetooth/rfcomm.h +0 −6
  990. include/net/caif/caif_dev.h +1 −1
  991. include/net/caif/caif_device.h +1 −1
  992. include/net/caif/caif_hsi.h +0 −1
  993. include/net/caif/caif_layer.h +1 −1
  994. include/net/caif/caif_shm.h +0 −26
  995. include/net/caif/cfcnfg.h +1 −1
  996. include/net/caif/cfctrl.h +1 −1
  997. include/net/caif/cffrml.h +1 −1
  998. include/net/caif/cfmuxl.h +1 −1
  999. include/net/caif/cfpkt.h +1 −1
  1000. include/net/caif/cfserl.h +1 −1
  1001. include/net/caif/cfsrvl.h +1 −1
  1002. include/net/cfg80211.h +144 −20
  1003. include/net/cls_cgroup.h +2 −2
  1004. include/net/dn_fib.h +6 −22
  1005. include/net/firewire.h +25 −0
  1006. include/net/genetlink.h +1 −0
  1007. include/net/gre.h +51 −0
  1008. include/net/ieee802154_netdev.h +4 −1
  1009. include/net/if_inet6.h +4 −0
  1010. include/net/inet_connection_sock.h +4 −1
  1011. include/net/inet_frag.h +22 −2
  1012. include/net/ip6_tunnel.h +21 −0
  1013. include/net/ip_tunnels.h +177 −0
  1014. include/net/ip_vs.h +93 −47
  1015. include/net/ipip.h +0 −87
  1016. include/net/ipv6.h +18 −4
  1017. include/net/mac80211.h +162 −62
  1018. include/net/net_namespace.h +2 −0
  1019. include/net/netfilter/nf_conntrack.h +1 −1
  1020. include/net/netfilter/nf_conntrack_core.h +1 −0
  1021. include/net/netfilter/nf_conntrack_expect.h +2 −2
  1022. include/net/netfilter/nf_log.h +10 −4
  1023. include/net/netfilter/nf_queue.h +6 −0
  1024. include/net/netns/ipv6.h +1 −0
  1025. include/net/netns/netfilter.h +18 −0
  1026. include/net/netprio_cgroup.h +2 −2
  1027. include/net/nfc/nfc.h +2 −0
  1028. include/net/request_sock.h +2 −8
  1029. include/net/rtnetlink.h +1 −1
  1030. include/net/scm.h +6 −10
  1031. include/net/sctp/checksum.h +1 −1
  1032. include/net/sctp/constants.h +0 −1
  1033. include/net/sctp/structs.h +3 −17
  1034. include/net/sctp/ulpqueue.h +0 −1
  1035. include/net/secure_seq.h +1 −0
  1036. include/net/sock.h +3 −3
  1037. include/net/tcp.h +7 −139
  1038. include/net/xfrm.h +1 −0
  1039. include/uapi/asm-generic/socket.h +2 −0
  1040. include/uapi/linux/Kbuild +2 −0
  1041. include/uapi/linux/caif/caif_socket.h +1 −1
  1042. include/uapi/linux/caif/if_caif.h +1 −1
  1043. include/uapi/linux/cn_proc.h +9 −1
  1044. include/uapi/linux/filter.h +2 −1
  1045. include/uapi/linux/if_ether.h +3 −0
  1046. include/uapi/linux/if_link.h +5 −2
  1047. include/uapi/linux/if_packet.h +18 −11
  1048. include/uapi/linux/ip_vs.h +2 −2
  1049. include/uapi/linux/neighbour.h +3 −0
  1050. include/uapi/linux/netfilter/ipset/ip_set.h +32 −4
  1051. include/uapi/linux/netfilter/nfnetlink_queue.h +9 −1
  1052. include/uapi/linux/netfilter/xt_NFQUEUE.h +9 −0
  1053. include/uapi/linux/netfilter/xt_set.h +9 −0
  1054. include/uapi/linux/netfilter_ipv6/ip6t_frag.h +2 −2
  1055. include/uapi/linux/netlink.h +33 −1
  1056. include/uapi/linux/netlink_diag.h +52 −0
  1057. include/uapi/linux/nfc.h +19 −0
  1058. include/uapi/linux/nl80211.h +145 −11
  1059. include/uapi/linux/openvswitch.h +456 −0
  1060. include/uapi/linux/packet_diag.h +5 −0
  1061. include/uapi/linux/pkt_sched.h +1 −0
  1062. include/uapi/linux/rfkill.h +2 −0
  1063. include/uapi/linux/sctp.h +74 −10
  1064. include/uapi/linux/snmp.h +8 −0
  1065. include/uapi/linux/tcp.h +0 −26
  1066. include/uapi/linux/vm_sockets.h +8 −15
  1067. include/uapi/linux/xfrm.h +3 −0
  1068. include/xen/interface/io/netif.h +19 −0
  1069. kernel/audit.c +5 −5
  1070. kernel/signal.c +2 −0
  1071. net/802/garp.c +4 −0
  1072. net/8021q/Kconfig +1 −1
  1073. net/8021q/vlan.c +35 −62
  1074. net/8021q/vlan.h +49 −9
  1075. net/8021q/vlan_core.c +50 −30
  1076. net/8021q/vlan_dev.c +6 −5
  1077. net/8021q/vlan_gvrp.c +4 −0
  1078. net/8021q/vlan_mvrp.c +4 −0
  1079. net/8021q/vlan_netlink.c +26 −6
  1080. net/Kconfig +1 −0
  1081. net/appletalk/ddp.c +1 −1
  1082. net/atm/lec.h +1 −1
  1083. net/batman-adv/Kconfig +14 −0
  1084. net/batman-adv/Makefile +2 −1
  1085. net/batman-adv/bat_iv_ogm.c +5 −0
  1086. net/batman-adv/bridge_loop_avoidance.c +1 −1
  1087. net/batman-adv/debugfs.c +18 −0
  1088. net/batman-adv/distributed-arp-table.c +4 −18
  1089. net/batman-adv/gateway_client.c +1 −1
  1090. net/batman-adv/hard-interface.c +54 −12
  1091. net/batman-adv/hard-interface.h +12 −1
  1092. net/batman-adv/main.c +15 −1
  1093. net/batman-adv/main.h +13 −2
  1094. net/batman-adv/network-coding.c +1822 −0
  1095. net/batman-adv/network-coding.h +123 −0
  1096. net/batman-adv/originator.c +8 −2
  1097. net/batman-adv/packet.h +33 −0
  1098. net/batman-adv/routing.c +42 −19
  1099. net/batman-adv/send.c +5 −0
  1100. net/batman-adv/soft-interface.c +199 −89
  1101. net/batman-adv/soft-interface.h +2 −1
  1102. net/batman-adv/sysfs.c +11 −11
  1103. net/batman-adv/translation-table.c +8 −21
  1104. net/batman-adv/types.h +136 −0
  1105. net/batman-adv/unicast.c +3 −3
  1106. net/batman-adv/vis.c +2 −2
  1107. net/bluetooth/a2mp.c +2 −4
  1108. net/bluetooth/af_bluetooth.c +5 −13
  1109. net/bluetooth/bnep/netdev.c +1 −1
  1110. net/bluetooth/bnep/sock.c +1 −3
  1111. net/bluetooth/cmtp/sock.c +1 −3
  1112. net/bluetooth/hci_conn.c +19 −23
  1113. net/bluetooth/hci_core.c +748 −153
  1114. net/bluetooth/hci_event.c +186 −595
  1115. net/bluetooth/hci_sock.c +6 −3
  1116. net/bluetooth/hci_sysfs.c +9 −12
  1117. net/bluetooth/hidp/core.c +586 −408
  1118. net/bluetooth/hidp/hidp.h +31 −36
  1119. net/bluetooth/hidp/sock.c +7 −19
  1120. net/bluetooth/l2cap_core.c +122 −12
  1121. net/bluetooth/l2cap_sock.c +7 −3
  1122. net/bluetooth/mgmt.c +482 −221
  1123. net/bluetooth/rfcomm/core.c +79 −88
  1124. net/bluetooth/rfcomm/sock.c +1 −2
  1125. net/bluetooth/sco.c +43 −9
  1126. net/bluetooth/smp.c +1 −1
  1127. net/bridge/br_device.c +2 −2
  1128. net/bridge/br_fdb.c +17 −13
  1129. net/bridge/br_if.c +0 −1
  1130. net/bridge/br_mdb.c +2 −2
  1131. net/bridge/br_multicast.c +1 −1
  1132. net/bridge/br_netfilter.c +2 −1
  1133. net/bridge/br_netlink.c +6 −15
  1134. net/bridge/br_stp.c +8 −1
  1135. net/bridge/br_vlan.c +12 −8
  1136. net/bridge/netfilter/ebt_log.c +39 −5
  1137. net/bridge/netfilter/ebt_nflog.c +3 −2
  1138. net/bridge/netfilter/ebt_ulog.c +91 −41
  1139. net/bridge/netfilter/ebtable_broute.c +1 −3
  1140. net/bridge/netfilter/ebtables.c +1 −1
  1141. net/caif/caif_dev.c +6 −5
  1142. net/caif/caif_socket.c +12 −12
  1143. net/caif/caif_usb.c +3 −3
  1144. net/caif/cfcnfg.c +10 −11
  1145. net/caif/cfctrl.c +8 −8
  1146. net/caif/cfdbgl.c +1 −1
  1147. net/caif/cfdgml.c +1 −1
  1148. net/caif/cffrml.c +3 −3
  1149. net/caif/cfmuxl.c +3 −3
  1150. net/caif/cfpkt_skbuff.c +5 −5
  1151. net/caif/cfrfml.c +3 −3
  1152. net/caif/cfserl.c +3 −3
  1153. net/caif/cfsrvl.c +7 −8
  1154. net/caif/cfutill.c +1 −1
  1155. net/caif/cfveil.c +1 −1
  1156. net/caif/cfvidl.c +1 −1
  1157. net/caif/chnl_net.c +5 −5
  1158. net/can/af_can.c +11 −19
  1159. net/can/gw.c +2 −3
  1160. net/can/raw.c +2 −3
  1161. net/core/datagram.c +17 −9
  1162. net/core/dev.c +68 −52
  1163. net/core/dev_addr_lists.c +168 −42
  1164. net/core/dst.c +5 −4
  1165. net/core/ethtool.c +17 −12
  1166. net/core/fib_rules.c +2 −2
  1167. net/core/filter.c +5 −0
  1168. net/core/flow.c +39 −3
  1169. net/core/flow_dissector.c +68 −0
  1170. net/core/neighbour.c +23 −32
  1171. net/core/net-procfs.c +1 −1
  1172. net/core/netpoll.c +11 −11
  1173. net/core/rtnetlink.c +93 −85
  1174. net/core/scm.c +2 −18
  1175. net/core/secure_seq.c +1 −3
  1176. net/core/skbuff.c +66 −27
  1177. net/core/sock.c +14 −8
  1178. net/core/sock_diag.c +33 −0
  1179. net/core/utils.c +2 −3
  1180. net/dcb/dcbevent.c +1 −0
  1181. net/dcb/dcbnl.c +1 −1
  1182. net/dccp/ipv4.c +2 −3
  1183. net/dccp/ipv6.c +2 −3
  1184. net/decnet/dn_dev.c +2 −2
  1185. net/decnet/dn_fib.c +104 −99
  1186. net/decnet/dn_route.c +31 −12
  1187. net/decnet/dn_table.c +24 −21
  1188. net/decnet/netfilter/dn_rtmsg.c +6 −6
  1189. net/dsa/dsa.c +228 −5
  1190. net/ethernet/eth.c +1 −1
  1191. net/ieee802154/6lowpan.c +113 −29
  1192. net/ieee802154/6lowpan.h +4 −3
  1193. net/ieee802154/dgram.c +10 −0
  1194. net/ieee802154/netlink.c +4 −4
  1195. net/ieee802154/nl-mac.c +20 −5
  1196. net/ipv4/Kconfig +7 −0
  1197. net/ipv4/Makefile +1 −0
  1198. net/ipv4/af_inet.c +9 −6
  1199. net/ipv4/arp.c +21 −6
  1200. net/ipv4/devinet.c +78 −5
  1201. net/ipv4/fib_frontend.c +5 −5
  1202. net/ipv4/gre.c +0 −5
  1203. net/ipv4/icmp.c +3 −1
  1204. net/ipv4/inet_connection_sock.c +1 −1
  1205. net/ipv4/inet_diag.c +6 −4
  1206. net/ipv4/inet_fragment.c +69 −15
  1207. net/ipv4/inet_lro.c +2 −3
  1208. net/ipv4/ip_fragment.c +1 −30
  1209. net/ipv4/ip_gre.c +317 −1200
  1210. net/ipv4/ip_input.c +3 −1
  1211. net/ipv4/ip_output.c +1 −2
  1212. net/ipv4/ip_tunnel.c +1035 −0
  1213. net/ipv4/ip_vti.c +2 −40
  1214. net/ipv4/ipcomp.c +1 −0
  1215. net/ipv4/ipconfig.c +12 −1
  1216. net/ipv4/ipip.c +59 −689
  1217. net/ipv4/ipmr.c +6 −6
  1218. net/ipv4/netfilter.c +10 −5
  1219. net/ipv4/netfilter/Kconfig +1 −1
  1220. net/ipv4/netfilter/arp_tables.c +1 −0
  1221. net/ipv4/netfilter/arptable_filter.c +1 −3
  1222. net/ipv4/netfilter/ip_tables.c +5 −5
  1223. net/ipv4/netfilter/ipt_ULOG.c +92 −42
  1224. net/ipv4/netfilter/iptable_mangle.c +6 −3
  1225. net/ipv4/netfilter/iptable_nat.c +15 −8
  1226. net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +1 −0
  1227. net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c +1 −0
  1228. net/ipv4/netfilter/nf_conntrack_proto_icmp.c +5 −4
  1229. net/ipv4/netfilter/nf_nat_h323.c +1 −0
  1230. net/ipv4/netfilter/nf_nat_pptp.c +2 −0
  1231. net/ipv4/netfilter/nf_nat_proto_gre.c +2 −0
  1232. net/ipv4/netfilter/nf_nat_snmp_basic.c +2 −0
  1233. net/ipv4/ping.c +2 −3
  1234. net/ipv4/proc.c +10 −3
  1235. net/ipv4/route.c +1 −1
  1236. net/ipv4/syncookies.c +1 −2
  1237. net/ipv4/sysctl_net_ipv4.c +2 −16
  1238. net/ipv4/tcp.c +18 −269
  1239. net/ipv4/tcp_input.c +144 −463
  1240. net/ipv4/tcp_ipv4.c +64 −59
  1241. net/ipv4/tcp_memcontrol.c +0 −3
  1242. net/ipv4/tcp_minisocks.c +12 −39
  1243. net/ipv4/tcp_output.c +150 −227
  1244. net/ipv4/tcp_timer.c +11 −10
  1245. net/ipv4/tcp_westwood.c +1 −1
  1246. net/ipv4/udp.c +102 −30
  1247. net/ipv4/udp_diag.c +5 −5
  1248. net/ipv4/xfrm4_mode_tunnel.c +6 −2
  1249. net/ipv6/Kconfig +2 −0
  1250. net/ipv6/Makefile +1 −1
  1251. net/ipv6/addrconf.c +197 −11
  1252. net/ipv6/addrlabel.c +2 −10
  1253. net/ipv6/af_inet6.c +3 −4
  1254. net/ipv6/datagram.c +12 −8
  1255. net/ipv6/icmp.c +24 −17
  1256. net/ipv6/inet6_connection_sock.c +6 −4
  1257. net/ipv6/ip6_flowlabel.c +8 −3
  1258. net/ipv6/ip6_gre.c +4 −58
  1259. net/ipv6/ip6_icmp.c +47 −0
  1260. net/ipv6/ip6_offload.c +1 −3
  1261. net/ipv6/ip6_output.c +2 −5
  1262. net/ipv6/ip6_tunnel.c +2 −14
  1263. net/ipv6/ip6mr.c +5 −5
  1264. net/ipv6/ndisc.c +0 −2
  1265. net/ipv6/netfilter.c +9 −3
  1266. net/ipv6/netfilter/Kconfig +1 −1
  1267. net/ipv6/netfilter/ip6_tables.c +3 −1
  1268. net/ipv6/netfilter/ip6t_NPT.c +3 −8
  1269. net/ipv6/netfilter/ip6t_REJECT.c +2 −0
  1270. net/ipv6/netfilter/ip6table_mangle.c +6 −3
  1271. net/ipv6/netfilter/ip6table_nat.c +15 −8
  1272. net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +2 −6
  1273. net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +4 −3
  1274. net/ipv6/netfilter/nf_conntrack_reasm.c +20 −2
  1275. net/ipv6/proc.c +4 −0
  1276. net/ipv6/raw.c +4 −5
  1277. net/ipv6/reassembly.c +21 −2
  1278. net/ipv6/route.c +3 −3
  1279. net/ipv6/sit.c +4 −37
  1280. net/ipv6/syncookies.c +1 −2
  1281. net/ipv6/tcp_ipv6.c +14 −61
  1282. net/ipv6/udp.c +22 −12
  1283. net/ipv6/udp_offload.c +7 −1
  1284. net/ipv6/xfrm6_mode_tunnel.c +5 −2
  1285. net/irda/af_irda.c +2 −3
  1286. net/irda/ircomm/ircomm_core.c +1 −1
  1287. net/irda/irlmp.c +1 −1
  1288. net/iucv/af_iucv.c +2 −1
  1289. net/l2tp/l2tp_core.c +1 −1
  1290. net/mac80211/cfg.c +157 −78
  1291. net/mac80211/chan.c +39 −15
  1292. net/mac80211/debugfs_key.c +5 −5
  1293. net/mac80211/debugfs_netdev.c +22 −11
  1294. net/mac80211/debugfs_sta.c +33 −0
  1295. net/mac80211/driver-ops.h +24 −43
  1296. net/mac80211/ht.c +25 −27
  1297. net/mac80211/ibss.c +76 −99
  1298. net/mac80211/ieee80211_i.h +35 −51
  1299. net/mac80211/iface.c +99 −51
  1300. net/mac80211/key.c +139 −69
  1301. net/mac80211/key.h +10 −8
  1302. net/mac80211/main.c +67 −92
  1303. net/mac80211/mesh.c +7 −63
  1304. net/mac80211/mesh.h +2 −13
  1305. net/mac80211/mesh_hwmp.c +12 −16
  1306. net/mac80211/mesh_pathtbl.c +28 −28
  1307. net/mac80211/mesh_plink.c +11 −32
  1308. net/mac80211/mlme.c +310 −244
  1309. net/mac80211/offchannel.c +8 −8
  1310. net/mac80211/pm.c +16 −116
  1311. net/mac80211/rate.c +268 −56
  1312. net/mac80211/rc80211_minstrel.c +193 −149
  1313. net/mac80211/rc80211_minstrel.h +29 −5
  1314. net/mac80211/rc80211_minstrel_debugfs.c +9 −7
  1315. net/mac80211/rc80211_minstrel_ht.c +159 −114
  1316. net/mac80211/rc80211_minstrel_ht.h +3 −5
  1317. net/mac80211/rx.c +45 −40
  1318. net/mac80211/scan.c +8 −12
  1319. net/mac80211/sta_info.c +24 −32
  1320. net/mac80211/sta_info.h +5 −6
  1321. net/mac80211/trace.h +61 −36
  1322. net/mac80211/tx.c +55 −108
  1323. net/mac80211/util.c +132 −92
  1324. net/mac80211/vht.c +211 −1
  1325. net/mac802154/mac802154.h +2 −3
  1326. net/mac802154/mac_cmd.c +1 −0
  1327. net/mac802154/mib.c +20 −1
  1328. net/mac802154/tx.c +19 −10
  1329. net/mac802154/wpan.c +3 −1
  1330. net/netfilter/core.c +24 −6
  1331. net/netfilter/ipset/ip_set_bitmap_gen.h +277 −0
  1332. net/netfilter/ipset/ip_set_bitmap_ip.c +128 −283
  1333. net/netfilter/ipset/ip_set_bitmap_ipmac.c +225 −399
  1334. net/netfilter/ipset/ip_set_bitmap_port.c +130 −284
  1335. net/netfilter/ipset/ip_set_core.c +30 −11
  1336. net/netfilter/ipset/ip_set_hash_gen.h +1100 −0
  1337. net/netfilter/ipset/ip_set_hash_ip.c +98 −246
  1338. net/netfilter/ipset/ip_set_hash_ipport.c +118 −244
  1339. net/netfilter/ipset/ip_set_hash_ipportip.c +121 −247
  1340. net/netfilter/ipset/ip_set_hash_ipportnet.c +162 −307
  1341. net/netfilter/ipset/ip_set_hash_net.c +127 −275
  1342. net/netfilter/ipset/ip_set_hash_netiface.c +165 −313
  1343. net/netfilter/ipset/ip_set_hash_netport.c +153 −303
  1344. net/netfilter/ipset/ip_set_list_set.c +371 −251
  1345. net/netfilter/ipvs/ip_vs_app.c +21 −10
  1346. net/netfilter/ipvs/ip_vs_conn.c +168 −144
  1347. net/netfilter/ipvs/ip_vs_core.c +31 −57
  1348. net/netfilter/ipvs/ip_vs_ctl.c +347 −355
  1349. net/netfilter/ipvs/ip_vs_dh.c +47 −39
  1350. net/netfilter/ipvs/ip_vs_est.c +1 −1
  1351. net/netfilter/ipvs/ip_vs_ftp.c +4 −0
  1352. net/netfilter/ipvs/ip_vs_lblc.c +64 −51
  1353. net/netfilter/ipvs/ip_vs_lblcr.c +99 −91
  1354. net/netfilter/ipvs/ip_vs_lc.c +2 −1
  1355. net/netfilter/ipvs/ip_vs_nq.c +2 −1
  1356. net/netfilter/ipvs/ip_vs_pe.c +13 −42
  1357. net/netfilter/ipvs/ip_vs_pe_sip.c +4 −6
  1358. net/netfilter/ipvs/ip_vs_proto_sctp.c +16 −22
  1359. net/netfilter/ipvs/ip_vs_proto_tcp.c +17 −23
  1360. net/netfilter/ipvs/ip_vs_proto_udp.c +13 −20
  1361. net/netfilter/ipvs/ip_vs_rr.c +40 −24
  1362. net/netfilter/ipvs/ip_vs_sched.c +29 −34
  1363. net/netfilter/ipvs/ip_vs_sed.c +3 −2
  1364. net/netfilter/ipvs/ip_vs_sh.c +47 −39
  1365. net/netfilter/ipvs/ip_vs_sync.c +22 −34
  1366. net/netfilter/ipvs/ip_vs_wlc.c +3 −2
  1367. net/netfilter/ipvs/ip_vs_wrr.c +107 −69
  1368. net/netfilter/ipvs/ip_vs_xmit.c +442 −608
  1369. net/netfilter/nf_conntrack_amanda.c +1 −0
  1370. net/netfilter/nf_conntrack_core.c +38 −18
  1371. net/netfilter/nf_conntrack_ecache.c +5 −3
  1372. net/netfilter/nf_conntrack_expect.c +5 −4
  1373. net/netfilter/nf_conntrack_ftp.c +1 −0
  1374. net/netfilter/nf_conntrack_h323_main.c +1 −0
  1375. net/netfilter/nf_conntrack_helper.c +2 −1
  1376. net/netfilter/nf_conntrack_irc.c +1 −0
  1377. net/netfilter/nf_conntrack_netlink.c +95 −5
  1378. net/netfilter/nf_conntrack_pptp.c +2 −0
  1379. net/netfilter/nf_conntrack_proto.c +1 −0
  1380. net/netfilter/nf_conntrack_proto_dccp.c +5 −4
  1381. net/netfilter/nf_conntrack_proto_gre.c +1 −0
  1382. net/netfilter/nf_conntrack_proto_sctp.c +3 −0
  1383. net/netfilter/nf_conntrack_proto_tcp.c +11 −9
  1384. net/netfilter/nf_conntrack_proto_udp.c +4 −3
  1385. net/netfilter/nf_conntrack_proto_udplite.c +4 −4
  1386. net/netfilter/nf_conntrack_standalone.c +11 −6
  1387. net/netfilter/nf_conntrack_tftp.c +1 −1
  1388. net/netfilter/nf_log.c +148 −58
  1389. net/netfilter/nf_nat_amanda.c +1 −0
  1390. net/netfilter/nf_nat_core.c +6 −4
  1391. net/netfilter/nf_nat_helper.c +1 −0
  1392. net/netfilter/nf_nat_proto_sctp.c +2 −3
  1393. net/netfilter/nf_queue.c +41 −107
  1394. net/netfilter/nfnetlink.c +17 −10
  1395. net/netfilter/nfnetlink_log.c +130 −69
  1396. net/netfilter/nfnetlink_queue_core.c +339 −100
  1397. net/netfilter/x_tables.c +1 −0
  1398. net/netfilter/xt_LOG.c +49 −3
  1399. net/netfilter/xt_NFQUEUE.c +51 −12
  1400. net/netfilter/xt_TCPMSS.c +1 −0
  1401. net/netfilter/xt_conntrack.c +1 −0
  1402. net/netfilter/xt_hashlimit.c +1 −0
  1403. net/netfilter/xt_limit.c +1 −0
  1404. net/netfilter/xt_osf.c +4 −2
  1405. net/netfilter/xt_set.c +78 −16
  1406. net/netlink/Kconfig +19 −0
  1407. net/netlink/Makefile +3 −0
  1408. net/netlink/af_netlink.c +804 −96
  1409. net/netlink/af_netlink.h +82 −0
  1410. net/netlink/diag.c +227 −0
  1411. net/netlink/genetlink.c +79 −40
  1412. net/netrom/af_netrom.c +2 −0
  1413. net/nfc/Kconfig +1 −1
  1414. net/nfc/Makefile +4 −2
  1415. net/nfc/core.c +43 −0
  1416. net/nfc/llcp.h +37 −2
  1417. net/nfc/llcp/Kconfig +0 −7
  1418. net/nfc/llcp_commands.c +186 −43
  1419. net/nfc/llcp_core.c +193 −48
  1420. net/nfc/llcp_sock.c +162 −9
  1421. net/nfc/netlink.c +173 −2
  1422. net/nfc/nfc.h +5 −55
  1423. net/openvswitch/actions.c +3 −3
  1424. net/openvswitch/datapath.c +258 −163
  1425. net/openvswitch/datapath.h +48 −24
  1426. net/openvswitch/dp_notify.c +57 −25
  1427. net/openvswitch/flow.c +4 −4
  1428. net/openvswitch/flow.h +0 −21
  1429. net/openvswitch/vport-internal_dev.c +9 −13
  1430. net/openvswitch/vport-netdev.c +7 −8
  1431. net/openvswitch/vport-netdev.h +0 −1
  1432. net/openvswitch/vport.c +28 −30
  1433. net/openvswitch/vport.h +6 −15
  1434. net/packet/af_packet.c +190 −112
  1435. net/packet/diag.c +22 −5
  1436. net/packet/internal.h +6 −4
  1437. net/phonet/pn_netlink.c +2 −2
  1438. net/rfkill/core.c +3 −1
  1439. net/rfkill/rfkill-gpio.c +5 −2
  1440. net/rfkill/rfkill-regulator.c +1 −1
  1441. net/sched/act_api.c +1 −1
  1442. net/sched/act_csum.c +25 −14
  1443. net/sched/act_ipt.c +30 −3
  1444. net/sched/cls_api.c +7 −7
  1445. net/sched/cls_flow.c +1 −1
  1446. net/sched/em_ipset.c +1 −1
  1447. net/sched/sch_api.c +25 −19
  1448. net/sched/sch_htb.c +16 −15
  1449. net/sctp/associola.c +4 −8
  1450. net/sctp/bind_addr.c +0 −7
  1451. net/sctp/endpointola.c +5 −9
  1452. net/sctp/inqueue.c +0 −7
  1453. net/sctp/output.c +1 −4
  1454. net/sctp/outqueue.c +2 −9
  1455. net/sctp/probe.c +1 −1
  1456. net/sctp/proc.c +9 −3
  1457. net/sctp/socket.c +5 −3
  1458. net/sctp/ssnmap.c +12 −11
  1459. net/sctp/transport.c +0 −1
  1460. net/sctp/ulpqueue.c +0 −3
  1461. net/socket.c +5 −18
  1462. net/tipc/Kconfig +7 −0
  1463. net/tipc/Makefile +2 −0
  1464. net/tipc/bcast.c +2 −2
  1465. net/tipc/bearer.c +2 −5
  1466. net/tipc/bearer.h +12 −4
  1467. net/tipc/core.c +10 −2
  1468. net/tipc/discover.c +1 −1
  1469. net/tipc/eth_media.c +12 −27
  1470. net/tipc/ib_media.c +387 −0
  1471. net/tipc/netlink.c +3 −3
  1472. net/unix/af_unix.c +23 −22
  1473. net/unix/garbage.c +6 −6
  1474. net/vmw_vsock/af_vsock.c +2 −2
  1475. net/vmw_vsock/vmci_transport.c +13 −3
  1476. net/vmw_vsock/vmci_transport.h +3 −0
  1477. net/wireless/ap.c +0 −62
  1478. net/wireless/core.c +44 −33
  1479. net/wireless/core.h +14 −11
  1480. net/wireless/mesh.c +1 −14
  1481. net/wireless/mlme.c +39 −196
  1482. net/wireless/nl80211.c +1444 −698
  1483. net/wireless/nl80211.h +0 −68
  1484. net/wireless/rdev-ops.h +40 −4
  1485. net/wireless/reg.c +4 −4
  1486. net/wireless/sme.c +16 −12
  1487. net/wireless/sysfs.c +20 −5
  1488. net/wireless/trace.h +81 −0
  1489. net/wireless/util.c +25 −5
  1490. net/xfrm/xfrm_policy.c +21 −2
  1491. net/xfrm/xfrm_state.c +1 −0
  1492. net/xfrm/xfrm_user.c +15 −2
  1493. security/selinux/hooks.c +2 −2
  1494. security/selinux/netlink.c +1 −2
  1495. tools/Makefile +6 −5
  1496. tools/net/Makefile +15 −0
  1497. tools/net/bpf_jit_disasm.c +199 −0
  1498. tools/testing/selftests/Makefile +1 −0
  1499. tools/testing/selftests/net/.gitignore +3 −0
  1500. tools/testing/selftests/net/Makefile +19 −0
  1501. tools/testing/selftests/net/psock_fanout.c +312 −0
  1502. tools/testing/selftests/net/psock_lib.h +127 −0
  1503. tools/testing/selftests/net/psock_tpacket.c +824 −0
  1504. tools/testing/selftests/net/run_afpackettests +26 −0
  1505. tools/testing/selftests/net/run_netsocktests +12 −0
  1506. tools/testing/selftests/net/socket.c +92 −0
Documentation/ABI/testing/sysfs-class-net-mesh+8−0
@@ -67,6 +67,14 @@ Description: · 66 unmodified lines
6767 Defines the penalty which will be applied to an
6868 originator message's tq-field on every hop.
6969
70+What: /sys/class/net/<mesh_iface>/mesh/network_coding
71+Date: Nov 2012
72+Contact: Martin Hundeboll <martin@hundeboll.net>
73+Description:
74+ Controls whether Network Coding (using some magic
75+ to send fewer wifi packets but still the same
76+ content) is enabled or not.
77+
7078 What: /sys/class/net/<mesh_iface>/mesh/orig_interval
7179 Date: May 2010
7280 Contact: Marek Lindner <lindner_marek@yahoo.de>
Documentation/DocBook/80211.tmpl+1−1
@@ -437,7 +437,7 @@ · 436 unmodified lines
437437 </section>
438438 !Finclude/net/mac80211.h ieee80211_get_buffered_bc
439439 !Finclude/net/mac80211.h ieee80211_beacon_get
440−!Finclude/net/mac80211.h ieee80211_sta_eosp_irqsafe
440+!Finclude/net/mac80211.h ieee80211_sta_eosp
441441 !Finclude/net/mac80211.h ieee80211_frame_release_type
442442 !Finclude/net/mac80211.h ieee80211_sta_ps_transition
443443 !Finclude/net/mac80211.h ieee80211_sta_ps_transition_ni
Documentation/cgroups/00-INDEX+2−0
@@ -18,6 +18,8 @@ memcg_test.txt · 17 unmodified lines
1818 - Memory Resource Controller; implementation details.
1919 memory.txt
2020 - Memory Resource Controller; design, accounting, interface, testing.
21+net_cls.txt
22+ - Network classifier cgroups details and usages.
2123 net_prio.txt
2224 - Network priority cgroups details and usages.
2325 resource_counter.txt
Documentation/cgroups/net_cls.txt+34−0
@@ -0,0 +1,34 @@
1+Network classifier cgroup
2+-------------------------
3+
4+The Network classifier cgroup provides an interface to
5+tag network packets with a class identifier (classid).
6+
7+The Traffic Controller (tc) can be used to assign
8+different priorities to packets from different cgroups.
9+
10+Creating a net_cls cgroups instance creates a net_cls.classid file.
11+This net_cls.classid value is initialized to 0.
12+
13+You can write hexadecimal values to net_cls.classid; the format for these
14+values is 0xAAAABBBB; AAAA is the major handle number and BBBB
15+is the minor handle number.
16+Reading net_cls.classid yields a decimal result.
17+
18+Example:
19+mkdir /sys/fs/cgroup/net_cls
20+mount -t cgroup -onet_cls net_cls /sys/fs/cgroup/net_cls
21+mkdir /sys/fs/cgroup/net_cls/0
22+echo 0x100001 > /sys/fs/cgroup/net_cls/0/net_cls.classid
23+ - setting a 10:1 handle.
24+
25+cat /sys/fs/cgroup/net_cls/0/net_cls.classid
26+1048577
27+
28+configuring tc:
29+tc qdisc add dev eth0 root handle 10: htb
30+
31+tc class add dev eth0 parent 10: classid 10:1 htb rate 40mbit
32+ - creating traffic class 10:1
33+
34+tc filter add dev eth0 parent 10: protocol ip prio 10 handle 1: cgroup
Documentation/devicetree/bindings/marvell.txt+3−0
@@ -115,6 +115,9 @@ prefixed with the string "marvell,", for Marvell Technology Group Ltd. · 114 unmodified lines
115115 - compatible : "marvell,mv64360-eth-block"
116116 - reg : Offset and length of the register set for this block
117117
118+ Optional properties:
119+ - clocks : Phandle to the clock control device and gate bit
120+
118121 Example Discovery Ethernet block node:
119122 ethernet-block@2000 {
120123 #address-cells = <1>;
Documentation/devicetree/bindings/net/can/atmel-can.txt+14−0
@@ -0,0 +1,14 @@
1+* AT91 CAN *
2+
3+Required properties:
4+ - compatible: Should be "atmel,at91sam9263-can" or "atmel,at91sam9x5-can"
5+ - reg: Should contain CAN controller registers location and length
6+ - interrupts: Should contain IRQ line for the CAN controller
7+
8+Example:
9+
10+ can0: can@f000c000 {
11+ compatbile = "atmel,at91sam9x5-can";
12+ reg = <0xf000c000 0x300>;
13+ interrupts = <40 4 5>
14+ };
Documentation/devicetree/bindings/net/cpsw.txt+11−5
@@ -15,16 +15,22 @@ Required properties: · 14 unmodified lines
1515 - mac_control : Specifies Default MAC control register content
1616 for the specific platform
1717 - slaves : Specifies number for slaves
18−- cpts_active_slave : Specifies the slave to use for time stamping
18+- active_slave : Specifies the slave to use for time stamping,
19+ ethtool and SIOCGMIIPHY
1920 - cpts_clock_mult : Numerator to convert input clock ticks into nanoseconds
2021 - cpts_clock_shift : Denominator to convert input clock ticks into nanoseconds
21−- phy_id : Specifies slave phy id
22−- mac-address : Specifies slave MAC address
2322
2423 Optional properties:
2524 - ti,hwmods : Must be "cpgmac0"
2625 - no_bd_ram : Must be 0 or 1
2726 - dual_emac : Specifies Switch to act as Dual EMAC
27+
28+Slave Properties:
29+Required properties:
30+- phy_id : Specifies slave phy id
31+- mac-address : Specifies slave MAC address
32+
33+Optional properties:
2834 - dual_emac_res_vlan : Specifies VID to be used to segregate the ports
2935
3036 Note: "ti,hwmods" field is used to fetch the base address and irq
@@ -47,7 +53,7 @@ Examples: · 16 unmodified lines
4753 rx_descs = <64>;
4854 mac_control = <0x20>;
4955 slaves = <2>;
50− cpts_active_slave = <0>;
56+ active_slave = <0>;
5157 cpts_clock_mult = <0x80000000>;
5258 cpts_clock_shift = <29>;
5359 cpsw_emac0: slave@0 {
@@ -73,7 +79,7 @@ Examples: · 19 unmodified lines
7379 rx_descs = <64>;
7480 mac_control = <0x20>;
7581 slaves = <2>;
76− cpts_active_slave = <0>;
82+ active_slave = <0>;
7783 cpts_clock_mult = <0x80000000>;
7884 cpts_clock_shift = <29>;
7985 cpsw_emac0: slave@0 {
Documentation/devicetree/bindings/net/dsa/dsa.txt+91−0
@@ -0,0 +1,91 @@
1+Marvell Distributed Switch Architecture Device Tree Bindings
2+------------------------------------------------------------
3+
4+Required properties:
5+- compatible : Should be "marvell,dsa"
6+- #address-cells : Must be 2, first cell is the address on the MDIO bus
7+ and second cell is the address in the switch tree.
8+ Second cell is used only when cascading/chaining.
9+- #size-cells : Must be 0
10+- dsa,ethernet : Should be a phandle to a valid Ethernet device node
11+- dsa,mii-bus : Should be a phandle to a valid MDIO bus device node
12+
13+Optionnal properties:
14+- interrupts : property with a value describing the switch
15+ interrupt number (not supported by the driver)
16+
17+A DSA node can contain multiple switch chips which are therefore child nodes of
18+the parent DSA node. The maximum number of allowed child nodes is 4
19+(DSA_MAX_SWITCHES).
20+Each of these switch child nodes should have the following required properties:
21+
22+- reg : Describes the switch address on the MII bus
23+- #address-cells : Must be 1
24+- #size-cells : Must be 0
25+
26+A switch may have multiple "port" children nodes
27+
28+Each port children node must have the following mandatory properties:
29+- reg : Describes the port address in the switch
30+- label : Describes the label associated with this port, special
31+ labels are "cpu" to indicate a CPU port and "dsa" to
32+ indicate an uplink/downlink port.
33+
34+Note that a port labelled "dsa" will imply checking for the uplink phandle
35+described below.
36+
37+Optionnal property:
38+- link : Should be a phandle to another switch's DSA port.
39+ This property is only used when switches are being
40+ chained/cascaded together.
41+
42+Example:
43+
44+ dsa@0 {
45+ compatible = "marvell,dsa";
46+ #address-cells = <2>;
47+ #size-cells = <0>;
48+
49+ interrupts = <10>;
50+ dsa,ethernet = <&ethernet0>;
51+ dsa,mii-bus = <&mii_bus0>;
52+
53+ switch@0 {
54+ #address-cells = <1>;
55+ #size-cells = <0>;
56+ reg = <16 0>; /* MDIO address 16, switch 0 in tree */
57+
58+ port@0 {
59+ reg = <0>;
60+ label = "lan1";
61+ };
62+
63+ port@1 {
64+ reg = <1>;
65+ label = "lan2";
66+ };
67+
68+ port@5 {
69+ reg = <5>;
70+ label = "cpu";
71+ };
72+
73+ switch0uplink: port@6 {
74+ reg = <6>;
75+ label = "dsa";
76+ link = <&switch1uplink>;
77+ };
78+ };
79+
80+ switch@1 {
81+ #address-cells = <1>;
82+ #size-cells = <0>;
83+ reg = <17 1>; /* MDIO address 17, switch 1 in tree */
84+
85+ switch1uplink: port@0 {
86+ reg = <0>;
87+ label = "dsa";
88+ link = <&switch0uplink>;
89+ };
90+ };
91+ };
Documentation/devicetree/bindings/net/marvell-orion-mdio.txt+4−0
@@ -9,6 +9,10 @@ Required properties: · 8 unmodified lines
99 - compatible: "marvell,orion-mdio"
1010 - reg: address and length of the SMI register
1111
12+Optional properties:
13+- interrupts: interrupt line number for the SMI error/done interrupt
14+- clocks: Phandle to the clock control device and gate bit
15+
1216 The child nodes of the MDIO driver are the individual PHY devices
1317 connected to this MDIO bus. They must have a "reg" property given the
1418 PHY address on the MDIO bus.
Documentation/networking/ieee802154.txt+3−2
@@ -71,8 +71,9 @@ submits skb to qdisc), so if you need something from that cb later, you should · 70 unmodified lines
7171 store info in the skb->data on your own.
7272
7373 To hook the MLME interface you have to populate the ml_priv field of your
74−net_device with a pointer to struct ieee802154_mlme_ops instance. All fields are
75−required.
74+net_device with a pointer to struct ieee802154_mlme_ops instance. The fields
75+assoc_req, assoc_resp, disassoc_req, start_req, and scan_req are optional.
76+All other fields are required.
7677
7778 We provide an example of simple HardMAC driver at drivers/ieee802154/fakehard.c
7879
Documentation/networking/ip-sysctl.txt+13−40
@@ -29,7 +29,7 @@ route/max_size - INTEGER · 28 unmodified lines
2929 neigh/default/gc_thresh1 - INTEGER
3030 Minimum number of entries to keep. Garbage collector will not
3131 purge entries if there are fewer than this number.
32− Default: 256
32+ Default: 128
3333
3434 neigh/default/gc_thresh3 - INTEGER
3535 Maximum number of neighbor entries allowed. Increase this
@@ -175,14 +175,6 @@ tcp_congestion_control - STRING · 139 unmodified lines
175175 is inherited.
176176 [see setsockopt(listenfd, SOL_TCP, TCP_CONGESTION, "name" ...) ]
177177
178−tcp_cookie_size - INTEGER
179− Default size of TCP Cookie Transactions (TCPCT) option, that may be
180− overridden on a per socket basis by the TCPCT socket option.
181− Values greater than the maximum (16) are interpreted as the maximum.
182− Values greater than zero and less than the minimum (8) are interpreted
183− as the minimum. Odd values are interpreted as the next even value.
184− Default: 0 (off).
185−
186178 tcp_dsack - BOOLEAN
187179 Allows TCP to send "duplicate" SACKs.
188180
@@ -190,7 +182,9 @@ tcp_early_retrans - INTEGER · 1 unmodified line
190182 Enable Early Retransmit (ER), per RFC 5827. ER lowers the threshold
191183 for triggering fast retransmit when the amount of outstanding data is
192184 small and when no previously unsent data can be transmitted (such
193− that limited transmit could be used).
185+ that limited transmit could be used). Also controls the use of
186+ Tail loss probe (TLP) that converts RTOs occuring due to tail
187+ losses into fast recovery (draft-dukkipati-tcpm-tcp-loss-probe-01).
194188 Possible values:
195189 0 disables ER
196190 1 enables ER
@@ -198,7 +192,9 @@ tcp_early_retrans - INTEGER · 1 unmodified line
198192 by a fourth of RTT. This mitigates connection falsely
199193 recovers when network has a small degree of reordering
200194 (less than 3 packets).
201− Default: 2
195+ 3 enables delayed ER and TLP.
196+ 4 enables TLP only.
197+ Default: 3
202198
203199 tcp_ecn - INTEGER
204200 Control use of Explicit Congestion Notification (ECN) by TCP.
@@ -229,36 +225,13 @@ tcp_fin_timeout - INTEGER · 24 unmodified lines
229225 Default: 60 seconds
230226
231227 tcp_frto - INTEGER
232− Enables Forward RTO-Recovery (F-RTO) defined in RFC4138.
228+ Enables Forward RTO-Recovery (F-RTO) defined in RFC5682.
233229 F-RTO is an enhanced recovery algorithm for TCP retransmission
234− timeouts. It is particularly beneficial in wireless environments
235− where packet loss is typically due to random radio interference
236− rather than intermediate router congestion. F-RTO is sender-side
237− only modification. Therefore it does not require any support from
238− the peer.
239−
240− If set to 1, basic version is enabled. 2 enables SACK enhanced
241− F-RTO if flow uses SACK. The basic version can be used also when
242− SACK is in use though scenario(s) with it exists where F-RTO
243− interacts badly with the packet counting of the SACK enabled TCP
244− flow.
245−
246−tcp_frto_response - INTEGER
247− When F-RTO has detected that a TCP retransmission timeout was
248− spurious (i.e, the timeout would have been avoided had TCP set a
249− longer retransmission timeout), TCP has several options what to do
250− next. Possible values are:
251− 0 Rate halving based; a smooth and conservative response,
252− results in halved cwnd and ssthresh after one RTT
253− 1 Very conservative response; not recommended because even
254− though being valid, it interacts poorly with the rest of
255− Linux TCP, halves cwnd and ssthresh immediately
256− 2 Aggressive response; undoes congestion control measures
257− that are now known to be unnecessary (ignoring the
258− possibility of a lost retransmission that would require
259− TCP to be more cautious), cwnd and ssthresh are restored
260− to the values prior timeout
261− Default: 0 (rate halving based)
230+ timeouts. It is particularly beneficial in networks where the
231+ RTT fluctuates (e.g., wireless). F-RTO is sender-side only
232+ modification. It does not require any support from the peer.
233+
234+ By default it's enabled with a non-zero value. 0 disables F-RTO.
262235
263236 tcp_keepalive_time - INTEGER
264237 How often TCP sends out keepalive messages when keepalive is enabled.
Documentation/networking/netlink_mmap.txt+339−0
@@ -0,0 +1,339 @@
1+This file documents how to use memory mapped I/O with netlink.
2+
3+Author: Patrick McHardy <kaber@trash.net>
4+
5+Overview
6+--------
7+
8+Memory mapped netlink I/O can be used to increase throughput and decrease
9+overhead of unicast receive and transmit operations. Some netlink subsystems
10+require high throughput, these are mainly the netfilter subsystems
11+nfnetlink_queue and nfnetlink_log, but it can also help speed up large
12+dump operations of f.i. the routing database.
13+
14+Memory mapped netlink I/O used two circular ring buffers for RX and TX which
15+are mapped into the processes address space.
16+
17+The RX ring is used by the kernel to directly construct netlink messages into
18+user-space memory without copying them as done with regular socket I/O,
19+additionally as long as the ring contains messages no recvmsg() or poll()
20+syscalls have to be issued by user-space to get more message.
21+
22+The TX ring is used to process messages directly from user-space memory, the
23+kernel processes all messages contained in the ring using a single sendmsg()
24+call.
25+
26+Usage overview
27+--------------
28+
29+In order to use memory mapped netlink I/O, user-space needs three main changes:
30+
31+- ring setup
32+- conversion of the RX path to get messages from the ring instead of recvmsg()
33+- conversion of the TX path to construct messages into the ring
34+
35+Ring setup is done using setsockopt() to provide the ring parameters to the
36+kernel, then a call to mmap() to map the ring into the processes address space:
37+
38+- setsockopt(fd, SOL_NETLINK, NETLINK_RX_RING, &params, sizeof(params));
39+- setsockopt(fd, SOL_NETLINK, NETLINK_TX_RING, &params, sizeof(params));
40+- ring = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0)
41+
42+Usage of either ring is optional, but even if only the RX ring is used the
43+mapping still needs to be writable in order to update the frame status after
44+processing.
45+
46+Conversion of the reception path involves calling poll() on the file
47+descriptor, once the socket is readable the frames from the ring are
48+processsed in order until no more messages are available, as indicated by
49+a status word in the frame header.
50+
51+On kernel side, in order to make use of memory mapped I/O on receive, the
52+originating netlink subsystem needs to support memory mapped I/O, otherwise
53+it will use an allocated socket buffer as usual and the contents will be
54+ copied to the ring on transmission, nullifying most of the performance gains.
55+Dumps of kernel databases automatically support memory mapped I/O.
56+
57+Conversion of the transmit path involves changing message contruction to
58+use memory from the TX ring instead of (usually) a buffer declared on the
59+stack and setting up the frame header approriately. Optionally poll() can
60+be used to wait for free frames in the TX ring.
61+
62+Structured and definitions for using memory mapped I/O are contained in
63+<linux/netlink.h>.
64+
65+RX and TX rings
66+----------------
67+
68+Each ring contains a number of continous memory blocks, containing frames of
69+fixed size dependant on the parameters used for ring setup.
70+
71+Ring: [ block 0 ]
72+ [ frame 0 ]
73+ [ frame 1 ]
74+ [ block 1 ]
75+ [ frame 2 ]
76+ [ frame 3 ]
77+ ...
78+ [ block n ]
79+ [ frame 2 * n ]
80+ [ frame 2 * n + 1 ]
81+
82+The blocks are only visible to the kernel, from the point of view of user-space
83+the ring just contains the frames in a continous memory zone.
84+
85+The ring parameters used for setting up the ring are defined as follows:
86+
87+struct nl_mmap_req {
88+ unsigned int nm_block_size;
89+ unsigned int nm_block_nr;
90+ unsigned int nm_frame_size;
91+ unsigned int nm_frame_nr;
92+};
93+
94+Frames are grouped into blocks, where each block is a continous region of memory
95+and holds nm_block_size / nm_frame_size frames. The total number of frames in
96+the ring is nm_frame_nr. The following invariants hold:
97+
98+- frames_per_block = nm_block_size / nm_frame_size
99+
100+- nm_frame_nr = frames_per_block * nm_block_nr
101+
102+Some parameters are constrained, specifically:
103+
104+- nm_block_size must be a multiple of the architectures memory page size.
105+ The getpagesize() function can be used to get the page size.
106+
107+- nm_frame_size must be equal or larger to NL_MMAP_HDRLEN, IOW a frame must be
108+ able to hold at least the frame header
109+
110+- nm_frame_size must be smaller or equal to nm_block_size
111+
112+- nm_frame_size must be a multiple of NL_MMAP_MSG_ALIGNMENT
113+
114+- nm_frame_nr must equal the actual number of frames as specified above.
115+
116+When the kernel can't allocate phsyically continous memory for a ring block,
117+it will fall back to use physically discontinous memory. This might affect
118+performance negatively, in order to avoid this the nm_frame_size parameter
119+should be chosen to be as small as possible for the required frame size and
120+the number of blocks should be increased instead.
121+
122+Ring frames
123+------------
124+
125+Each frames contain a frame header, consisting of a synchronization word and some
126+meta-data, and the message itself.
127+
128+Frame: [ header message ]
129+
130+The frame header is defined as follows:
131+
132+struct nl_mmap_hdr {
133+ unsigned int nm_status;
134+ unsigned int nm_len;
135+ __u32 nm_group;
136+ /* credentials */
137+ __u32 nm_pid;
138+ __u32 nm_uid;
139+ __u32 nm_gid;
140+};
141+
142+- nm_status is used for synchronizing processing between the kernel and user-
143+ space and specifies ownership of the frame as well as the operation to perform
144+
145+- nm_len contains the length of the message contained in the data area
146+
147+- nm_group specified the destination multicast group of message
148+
149+- nm_pid, nm_uid and nm_gid contain the netlink pid, UID and GID of the sending
150+ process. These values correspond to the data available using SOCK_PASSCRED in
151+ the SCM_CREDENTIALS cmsg.
152+
153+The possible values in the status word are:
154+
155+- NL_MMAP_STATUS_UNUSED:
156+ RX ring: frame belongs to the kernel and contains no message
157+ for user-space. Approriate action is to invoke poll()
158+ to wait for new messages.
159+
160+ TX ring: frame belongs to user-space and can be used for
161+ message construction.
162+
163+- NL_MMAP_STATUS_RESERVED:
164+ RX ring only: frame is currently used by the kernel for message
165+ construction and contains no valid message yet.
166+ Appropriate action is to invoke poll() to wait for
167+ new messages.
168+
169+- NL_MMAP_STATUS_VALID:
170+ RX ring: frame contains a valid message. Approriate action is
171+ to process the message and release the frame back to
172+ the kernel by setting the status to
173+ NL_MMAP_STATUS_UNUSED or queue the frame by setting the
174+ status to NL_MMAP_STATUS_SKIP.
175+
176+ TX ring: the frame contains a valid message from user-space to
177+ be processed by the kernel. After completing processing
178+ the kernel will release the frame back to user-space by
179+ setting the status to NL_MMAP_STATUS_UNUSED.
180+
181+- NL_MMAP_STATUS_COPY:
182+ RX ring only: a message is ready to be processed but could not be
183+ stored in the ring, either because it exceeded the
184+ frame size or because the originating subsystem does
185+ not support memory mapped I/O. Appropriate action is
186+ to invoke recvmsg() to receive the message and release
187+ the frame back to the kernel by setting the status to
188+ NL_MMAP_STATUS_UNUSED.
189+
190+- NL_MMAP_STATUS_SKIP:
191+ RX ring only: user-space queued the message for later processing, but
192+ processed some messages following it in the ring. The
193+ kernel should skip this frame when looking for unused
194+ frames.
195+
196+The data area of a frame begins at a offset of NL_MMAP_HDRLEN relative to the
197+frame header.
198+
199+TX limitations
200+--------------
201+
202+Kernel processing usually involves validation of the message received by
203+user-space, then processing its contents. The kernel must assure that
204+userspace is not able to modify the message contents after they have been
205+validated. In order to do so, the message is copied from the ring frame
206+to an allocated buffer if either of these conditions is false:
207+
208+- only a single mapping of the ring exists
209+- the file descriptor is not shared between processes
210+
211+This means that for threaded programs, the kernel will fall back to copying.
212+
213+Example
214+-------
215+
216+Ring setup:
217+
218+ unsigned int block_size = 16 * getpagesize();
219+ struct nl_mmap_req req = {
220+ .nm_block_size = block_size,
221+ .nm_block_nr = 64,
222+ .nm_frame_size = 16384,
223+ .nm_frame_nr = 64 * block_size / 16384,
224+ };
225+ unsigned int ring_size;
226+ void *rx_ring, *tx_ring;
227+
228+ /* Configure ring parameters */
229+ if (setsockopt(fd, NETLINK_RX_RING, &req, sizeof(req)) < 0)
230+ exit(1);
231+ if (setsockopt(fd, NETLINK_TX_RING, &req, sizeof(req)) < 0)
232+ exit(1)
233+
234+ /* Calculate size of each invididual ring */
235+ ring_size = req.nm_block_nr * req.nm_block_size;
236+
237+ /* Map RX/TX rings. The TX ring is located after the RX ring */
238+ rx_ring = mmap(NULL, 2 * ring_size, PROT_READ | PROT_WRITE,
239+ MAP_SHARED, fd, 0);
240+ if ((long)rx_ring == -1L)
241+ exit(1);
242+ tx_ring = rx_ring + ring_size:
243+
244+Message reception:
245+
246+This example assumes some ring parameters of the ring setup are available.
247+
248+ unsigned int frame_offset = 0;
249+ struct nl_mmap_hdr *hdr;
250+ struct nlmsghdr *nlh;
251+ unsigned char buf[16384];
252+ ssize_t len;
253+
254+ while (1) {
255+ struct pollfd pfds[1];
256+
257+ pfds[0].fd = fd;
258+ pfds[0].events = POLLIN | POLLERR;
259+ pfds[0].revents = 0;
260+
261+ if (poll(pfds, 1, -1) < 0 && errno != -EINTR)
262+ exit(1);
263+
264+ /* Check for errors. Error handling omitted */
265+ if (pfds[0].revents & POLLERR)
266+ <handle error>
267+
268+ /* If no new messages, poll again */
269+ if (!(pfds[0].revents & POLLIN))
270+ continue;
271+
272+ /* Process all frames */
273+ while (1) {
274+ /* Get next frame header */
275+ hdr = rx_ring + frame_offset;
276+
277+ if (hdr->nm_status == NL_MMAP_STATUS_VALID)
278+ /* Regular memory mapped frame */
279+ nlh = (void *hdr) + NL_MMAP_HDRLEN;
280+ len = hdr->nm_len;
281+
282+ /* Release empty message immediately. May happen
283+ * on error during message construction.
284+ */
285+ if (len == 0)
286+ goto release;
287+ } else if (hdr->nm_status == NL_MMAP_STATUS_COPY) {
288+ /* Frame queued to socket receive queue */
289+ len = recv(fd, buf, sizeof(buf), MSG_DONTWAIT);
290+ if (len <= 0)
291+ break;
292+ nlh = buf;
293+ } else
294+ /* No more messages to process, continue polling */
295+ break;
296+
297+ process_msg(nlh);
298+release:
299+ /* Release frame back to the kernel */
300+ hdr->nm_status = NL_MMAP_STATUS_UNUSED;
301+
302+ /* Advance frame offset to next frame */
303+ frame_offset = (frame_offset + frame_size) % ring_size;
304+ }
305+ }
306+
307+Message transmission:
308+
309+This example assumes some ring parameters of the ring setup are available.
310+A single message is constructed and transmitted, to send multiple messages
311+at once they would be constructed in consecutive frames before a final call
312+to sendto().
313+
314+ unsigned int frame_offset = 0;
315+ struct nl_mmap_hdr *hdr;
316+ struct nlmsghdr *nlh;
317+ struct sockaddr_nl addr = {
318+ .nl_family = AF_NETLINK,
319+ };
320+
321+ hdr = tx_ring + frame_offset;
322+ if (hdr->nm_status != NL_MMAP_STATUS_UNUSED)
323+ /* No frame available. Use poll() to avoid. */
324+ exit(1);
325+
326+ nlh = (void *)hdr + NL_MMAP_HDRLEN;
327+
328+ /* Build message */
329+ build_message(nlh);
330+
331+ /* Fill frame header: length and status need to be set */
332+ hdr->nm_len = nlh->nlmsg_len;
333+ hdr->nm_status = NL_MMAP_STATUS_VALID;
334+
335+ if (sendto(fd, NULL, 0, 0, &addr, sizeof(addr)) < 0)
336+ exit(1);
337+
338+ /* Advance frame offset to next frame */
339+ frame_offset = (frame_offset + frame_size) % ring_size;
Documentation/networking/packet_mmap.txt+362−6
@@ -684,15 +684,343 @@ int main(int argc, char **argp) · 683 unmodified lines
684684 return 0;
685685 }
686686
687+-------------------------------------------------------------------------------
688++ AF_PACKET TPACKET_V3 example
689+-------------------------------------------------------------------------------
690+
691+AF_PACKET's TPACKET_V3 ring buffer can be configured to use non-static frame
692+sizes by doing it's own memory management. It is based on blocks where polling
693+works on a per block basis instead of per ring as in TPACKET_V2 and predecessor.
694+
695+It is said that TPACKET_V3 brings the following benefits:
696+ *) ~15 - 20% reduction in CPU-usage
697+ *) ~20% increase in packet capture rate
698+ *) ~2x increase in packet density
699+ *) Port aggregation analysis
700+ *) Non static frame size to capture entire packet payload
701+
702+So it seems to be a good candidate to be used with packet fanout.
703+
704+Minimal example code by Daniel Borkmann based on Chetan Loke's lolpcap (compile
705+it with gcc -Wall -O2 blob.c, and try things like "./a.out eth0", etc.):
706+
707+#include <stdio.h>
708+#include <stdlib.h>
709+#include <stdint.h>
710+#include <string.h>
711+#include <assert.h>
712+#include <net/if.h>
713+#include <arpa/inet.h>
714+#include <netdb.h>
715+#include <poll.h>
716+#include <unistd.h>
717+#include <signal.h>
718+#include <inttypes.h>
719+#include <sys/socket.h>
720+#include <sys/mman.h>
721+#include <linux/if_packet.h>
722+#include <linux/if_ether.h>
723+#include <linux/ip.h>
724+
725+#define BLOCK_SIZE (1 << 22)
726+#define FRAME_SIZE 2048
727+
728+#define NUM_BLOCKS 64
729+#define NUM_FRAMES ((BLOCK_SIZE * NUM_BLOCKS) / FRAME_SIZE)
730+
731+#define BLOCK_RETIRE_TOV_IN_MS 64
732+#define BLOCK_PRIV_AREA_SZ 13
733+
734+#define ALIGN_8(x) (((x) + 8 - 1) & ~(8 - 1))
735+
736+#define BLOCK_STATUS(x) ((x)->h1.block_status)
737+#define BLOCK_NUM_PKTS(x) ((x)->h1.num_pkts)
738+#define BLOCK_O2FP(x) ((x)->h1.offset_to_first_pkt)
739+#define BLOCK_LEN(x) ((x)->h1.blk_len)
740+#define BLOCK_SNUM(x) ((x)->h1.seq_num)
741+#define BLOCK_O2PRIV(x) ((x)->offset_to_priv)
742+#define BLOCK_PRIV(x) ((void *) ((uint8_t *) (x) + BLOCK_O2PRIV(x)))
743+#define BLOCK_HDR_LEN (ALIGN_8(sizeof(struct block_desc)))
744+#define BLOCK_PLUS_PRIV(sz_pri) (BLOCK_HDR_LEN + ALIGN_8((sz_pri)))
745+
746+#ifndef likely
747+# define likely(x) __builtin_expect(!!(x), 1)
748+#endif
749+#ifndef unlikely
750+# define unlikely(x) __builtin_expect(!!(x), 0)
751+#endif
752+
753+struct block_desc {
754+ uint32_t version;
755+ uint32_t offset_to_priv;
756+ struct tpacket_hdr_v1 h1;
757+};
758+
759+struct ring {
760+ struct iovec *rd;
761+ uint8_t *map;
762+ struct tpacket_req3 req;
763+};
764+
765+static unsigned long packets_total = 0, bytes_total = 0;
766+static sig_atomic_t sigint = 0;
767+
768+void sighandler(int num)
769+{
770+ sigint = 1;
771+}
772+
773+static int setup_socket(struct ring *ring, char *netdev)
774+{
775+ int err, i, fd, v = TPACKET_V3;
776+ struct sockaddr_ll ll;
777+
778+ fd = socket(AF_PACKET, SOCK_RAW, htons(ETH_P_ALL));
779+ if (fd < 0) {
780+ perror("socket");
781+ exit(1);
782+ }
783+
784+ err = setsockopt(fd, SOL_PACKET, PACKET_VERSION, &v, sizeof(v));
785+ if (err < 0) {
786+ perror("setsockopt");
787+ exit(1);
788+ }
789+
790+ memset(&ring->req, 0, sizeof(ring->req));
791+ ring->req.tp_block_size = BLOCK_SIZE;
792+ ring->req.tp_frame_size = FRAME_SIZE;
793+ ring->req.tp_block_nr = NUM_BLOCKS;
794+ ring->req.tp_frame_nr = NUM_FRAMES;
795+ ring->req.tp_retire_blk_tov = BLOCK_RETIRE_TOV_IN_MS;
796+ ring->req.tp_sizeof_priv = BLOCK_PRIV_AREA_SZ;
797+ ring->req.tp_feature_req_word |= TP_FT_REQ_FILL_RXHASH;
798+
799+ err = setsockopt(fd, SOL_PACKET, PACKET_RX_RING, &ring->req,
800+ sizeof(ring->req));
801+ if (err < 0) {
802+ perror("setsockopt");
803+ exit(1);
804+ }
805+
806+ ring->map = mmap(NULL, ring->req.tp_block_size * ring->req.tp_block_nr,
807+ PROT_READ | PROT_WRITE, MAP_SHARED | MAP_LOCKED,
808+ fd, 0);
809+ if (ring->map == MAP_FAILED) {
810+ perror("mmap");
811+ exit(1);
812+ }
813+
814+ ring->rd = malloc(ring->req.tp_block_nr * sizeof(*ring->rd));
815+ assert(ring->rd);
816+ for (i = 0; i < ring->req.tp_block_nr; ++i) {
817+ ring->rd[i].iov_base = ring->map + (i * ring->req.tp_block_size);
818+ ring->rd[i].iov_len = ring->req.tp_block_size;
819+ }
820+
821+ memset(&ll, 0, sizeof(ll));
822+ ll.sll_family = PF_PACKET;
823+ ll.sll_protocol = htons(ETH_P_ALL);
824+ ll.sll_ifindex = if_nametoindex(netdev);
825+ ll.sll_hatype = 0;
826+ ll.sll_pkttype = 0;
827+ ll.sll_halen = 0;
828+
829+ err = bind(fd, (struct sockaddr *) &ll, sizeof(ll));
830+ if (err < 0) {
831+ perror("bind");
832+ exit(1);
833+ }
834+
835+ return fd;
836+}
837+
838+#ifdef __checked
839+static uint64_t prev_block_seq_num = 0;
840+
841+void assert_block_seq_num(struct block_desc *pbd)
842+{
843+ if (unlikely(prev_block_seq_num + 1 != BLOCK_SNUM(pbd))) {
844+ printf("prev_block_seq_num:%"PRIu64", expected seq:%"PRIu64" != "
845+ "actual seq:%"PRIu64"\n", prev_block_seq_num,
846+ prev_block_seq_num + 1, (uint64_t) BLOCK_SNUM(pbd));
847+ exit(1);
848+ }
849+
850+ prev_block_seq_num = BLOCK_SNUM(pbd);
851+}
852+
853+static void assert_block_len(struct block_desc *pbd, uint32_t bytes, int block_num)
854+{
855+ if (BLOCK_NUM_PKTS(pbd)) {
856+ if (unlikely(bytes != BLOCK_LEN(pbd))) {
857+ printf("block:%u with %upackets, expected len:%u != actual len:%u\n",
858+ block_num, BLOCK_NUM_PKTS(pbd), bytes, BLOCK_LEN(pbd));
859+ exit(1);
860+ }
861+ } else {
862+ if (unlikely(BLOCK_LEN(pbd) != BLOCK_PLUS_PRIV(BLOCK_PRIV_AREA_SZ))) {
863+ printf("block:%u, expected len:%lu != actual len:%u\n",
864+ block_num, BLOCK_HDR_LEN, BLOCK_LEN(pbd));
865+ exit(1);
866+ }
867+ }
868+}
869+
870+static void assert_block_header(struct block_desc *pbd, const int block_num)
871+{
872+ uint32_t block_status = BLOCK_STATUS(pbd);
873+
874+ if (unlikely((block_status & TP_STATUS_USER) == 0)) {
875+ printf("block:%u, not in TP_STATUS_USER\n", block_num);
876+ exit(1);
877+ }
878+
879+ assert_block_seq_num(pbd);
880+}
881+#else
882+static inline void assert_block_header(struct block_desc *pbd, const int block_num)
883+{
884+}
885+static void assert_block_len(struct block_desc *pbd, uint32_t bytes, int block_num)
886+{
887+}
888+#endif
889+
890+static void display(struct tpacket3_hdr *ppd)
891+{
892+ struct ethhdr *eth = (struct ethhdr *) ((uint8_t *) ppd + ppd->tp_mac);
893+ struct iphdr *ip = (struct iphdr *) ((uint8_t *) eth + ETH_HLEN);
894+
895+ if (eth->h_proto == htons(ETH_P_IP)) {
896+ struct sockaddr_in ss, sd;
897+ char sbuff[NI_MAXHOST], dbuff[NI_MAXHOST];
898+
899+ memset(&ss, 0, sizeof(ss));
900+ ss.sin_family = PF_INET;
901+ ss.sin_addr.s_addr = ip->saddr;
902+ getnameinfo((struct sockaddr *) &ss, sizeof(ss),
903+ sbuff, sizeof(sbuff), NULL, 0, NI_NUMERICHOST);
904+
905+ memset(&sd, 0, sizeof(sd));
906+ sd.sin_family = PF_INET;
907+ sd.sin_addr.s_addr = ip->daddr;
908+ getnameinfo((struct sockaddr *) &sd, sizeof(sd),
909+ dbuff, sizeof(dbuff), NULL, 0, NI_NUMERICHOST);
910+
911+ printf("%s -> %s, ", sbuff, dbuff);
912+ }
913+
914+ printf("rxhash: 0x%x\n", ppd->hv1.tp_rxhash);
915+}
916+
917+static void walk_block(struct block_desc *pbd, const int block_num)
918+{
919+ int num_pkts = BLOCK_NUM_PKTS(pbd), i;
920+ unsigned long bytes = 0;
921+ unsigned long bytes_with_padding = BLOCK_PLUS_PRIV(BLOCK_PRIV_AREA_SZ);
922+ struct tpacket3_hdr *ppd;
923+
924+ assert_block_header(pbd, block_num);
925+
926+ ppd = (struct tpacket3_hdr *) ((uint8_t *) pbd + BLOCK_O2FP(pbd));
927+ for (i = 0; i < num_pkts; ++i) {
928+ bytes += ppd->tp_snaplen;
929+ if (ppd->tp_next_offset)
930+ bytes_with_padding += ppd->tp_next_offset;
931+ else
932+ bytes_with_padding += ALIGN_8(ppd->tp_snaplen + ppd->tp_mac);
933+
934+ display(ppd);
935+
936+ ppd = (struct tpacket3_hdr *) ((uint8_t *) ppd + ppd->tp_next_offset);
937+ __sync_synchronize();
938+ }
939+
940+ assert_block_len(pbd, bytes_with_padding, block_num);
941+
942+ packets_total += num_pkts;
943+ bytes_total += bytes;
944+}
945+
946+void flush_block(struct block_desc *pbd)
947+{
948+ BLOCK_STATUS(pbd) = TP_STATUS_KERNEL;
949+ __sync_synchronize();
950+}
951+
952+static void teardown_socket(struct ring *ring, int fd)
953+{
954+ munmap(ring->map, ring->req.tp_block_size * ring->req.tp_block_nr);
955+ free(ring->rd);
956+ close(fd);
957+}
958+
959+int main(int argc, char **argp)
960+{
961+ int fd, err;
962+ socklen_t len;
963+ struct ring ring;
964+ struct pollfd pfd;
965+ unsigned int block_num = 0;
966+ struct block_desc *pbd;
967+ struct tpacket_stats_v3 stats;
968+
969+ if (argc != 2) {
970+ fprintf(stderr, "Usage: %s INTERFACE\n", argp[0]);
971+ return EXIT_FAILURE;
972+ }
973+
974+ signal(SIGINT, sighandler);
975+
976+ memset(&ring, 0, sizeof(ring));
977+ fd = setup_socket(&ring, argp[argc - 1]);
978+ assert(fd > 0);
979+
980+ memset(&pfd, 0, sizeof(pfd));
981+ pfd.fd = fd;
982+ pfd.events = POLLIN | POLLERR;
983+ pfd.revents = 0;
984+
985+ while (likely(!sigint)) {
986+ pbd = (struct block_desc *) ring.rd[block_num].iov_base;
987+retry_block:
988+ if ((BLOCK_STATUS(pbd) & TP_STATUS_USER) == 0) {
989+ poll(&pfd, 1, -1);
990+ goto retry_block;
991+ }
992+
993+ walk_block(pbd, block_num);
994+ flush_block(pbd);
995+ block_num = (block_num + 1) % NUM_BLOCKS;
996+ }
997+
998+ len = sizeof(stats);
999+ err = getsockopt(fd, SOL_PACKET, PACKET_STATISTICS, &stats, &len);
1000+ if (err < 0) {
1001+ perror("getsockopt");
1002+ exit(1);
1003+ }
1004+
1005+ fflush(stdout);
1006+ printf("\nReceived %u packets, %lu bytes, %u dropped, freeze_q_cnt: %u\n",
1007+ stats.tp_packets, bytes_total, stats.tp_drops,
1008+ stats.tp_freeze_q_cnt);
1009+
1010+ teardown_socket(&ring, fd);
1011+ return 0;
1012+}
1013+
6871014 -------------------------------------------------------------------------------
6881015 + PACKET_TIMESTAMP
6891016 -------------------------------------------------------------------------------
6901017
6911018 The PACKET_TIMESTAMP setting determines the source of the timestamp in
692−the packet meta information. If your NIC is capable of timestamping
693−packets in hardware, you can request those hardware timestamps to used.
694−Note: you may need to enable the generation of hardware timestamps with
695−SIOCSHWTSTAMP.
1019+the packet meta information for mmap(2)ed RX_RING and TX_RINGs. If your
1020+NIC is capable of timestamping packets in hardware, you can request those
1021+hardware timestamps to be used. Note: you may need to enable the generation
1022+of hardware timestamps with SIOCSHWTSTAMP (see related information from
1023+Documentation/networking/timestamping.txt).
6961024
6971025 PACKET_TIMESTAMP accepts the same integer bit field as
6981026 SO_TIMESTAMPING. However, only the SOF_TIMESTAMPING_SYS_HARDWARE
@@ -704,8 +1032,36 @@ SOF_TIMESTAMPING_RAW_HARDWARE if both bits are set. · 5 unmodified lines
7041032 req |= SOF_TIMESTAMPING_SYS_HARDWARE;
7051033 setsockopt(fd, SOL_PACKET, PACKET_TIMESTAMP, (void *) &req, sizeof(req))
7061034
707−If PACKET_TIMESTAMP is not set, a software timestamp generated inside
708−the networking stack is used (the behavior before this setting was added).
1035+For the mmap(2)ed ring buffers, such timestamps are stored in the
1036+tpacket{,2,3}_hdr structure's tp_sec and tp_{n,u}sec members. To determine
1037+what kind of timestamp has been reported, the tp_status field is binary |'ed
1038+with the following possible bits ...
1039+
1040+ TP_STATUS_TS_SYS_HARDWARE
1041+ TP_STATUS_TS_RAW_HARDWARE
1042+ TP_STATUS_TS_SOFTWARE
1043+
1044+... that are equivalent to its SOF_TIMESTAMPING_* counterparts. For the
1045+RX_RING, if none of those 3 are set (i.e. PACKET_TIMESTAMP is not set),
1046+then this means that a software fallback was invoked *within* PF_PACKET's
1047+processing code (less precise).
1048+
1049+Getting timestamps for the TX_RING works as follows: i) fill the ring frames,
1050+ii) call sendto() e.g. in blocking mode, iii) wait for status of relevant
1051+frames to be updated resp. the frame handed over to the application, iv) walk
1052+through the frames to pick up the individual hw/sw timestamps.
1053+
1054+Only (!) if transmit timestamping is enabled, then these bits are combined
1055+with binary | with TP_STATUS_AVAILABLE, so you must check for that in your
1056+application (e.g. !(tp_status & (TP_STATUS_SEND_REQUEST | TP_STATUS_SENDING))
1057+in a first step to see if the frame belongs to the application, and then
1058+one can extract the type of timestamp in a second step from tp_status)!
1059+
1060+If you don't care about them, thus having it disabled, checking for
1061+TP_STATUS_AVAILABLE resp. TP_STATUS_WRONG_FORMAT is sufficient. If in the
1062+TX_RING part only TP_STATUS_AVAILABLE is set, then the tp_sec and tp_{n,u}sec
1063+members do not contain a valid value. For TX_RINGs, by default no timestamp
1064+is generated!
7091065
7101066 See include/linux/net_tstamp.h and Documentation/networking/timestamping
7111067 for more information on hardware timestamps.
Documentation/networking/stmmac.txt+39−6
@@ -1,6 +1,6 @@
11 STMicroelectronics 10/100/1000 Synopsys Ethernet driver
22
3−Copyright (C) 2007-2010 STMicroelectronics Ltd
3+Copyright (C) 2007-2013 STMicroelectronics Ltd
44 Author: Giuseppe Cavallaro <peppe.cavallaro@st.com>
55
66 This is the driver for the MAC 10/100/1000 on-chip Ethernet controllers
@@ -10,7 +10,7 @@ Currently this network device driver is for all STM embedded MAC/GMAC · 3 unmodified lines
1010 (i.e. 7xxx/5xxx SoCs), SPEAr (arm), Loongson1B (mips) and XLINX XC2V3000
1111 FF1152AMT0221 D1215994A VIRTEX FPGA board.
1212
13−DWC Ether MAC 10/100/1000 Universal version 3.60a (and older) and DWC Ether
13+DWC Ether MAC 10/100/1000 Universal version 3.70a (and older) and DWC Ether
1414 MAC 10/100 Universal version 4.0 have been used for developing this driver.
1515
1616 This driver supports both the platform bus and PCI.
@@ -32,6 +32,8 @@ The kernel configuration option is STMMAC_ETH: · 15 unmodified lines
3232 watchdog: transmit timeout (in milliseconds);
3333 flow_ctrl: Flow control ability [on/off];
3434 pause: Flow Control Pause Time;
35+ eee_timer: tx EEE timer;
36+ chain_mode: select chain mode instead of ring.
3537
3638 3) Command line options
3739 Driver parameters can be also passed in command line by using:
@@ -164,12 +166,12 @@ Where: · 126 unmodified lines
164166 o bus_setup: perform HW setup of the bus. For example, on some ST platforms
165167 this field is used to configure the AMBA bridge to generate more
166168 efficient STBus traffic.
167− o init/exit: callbacks used for calling a custom initialisation;
169+ o init/exit: callbacks used for calling a custom initialization;
168170 this is sometime necessary on some platforms (e.g. ST boxes)
169171 where the HW needs to have set some PIO lines or system cfg
170172 registers.
171173 o custom_cfg/custom_data: this is a custom configuration that can be passed
172− while initialising the resources.
174+ while initializing the resources.
173175 o bsp_priv: another private poiter.
174176
175177 For MDIO bus The we have:
@@ -273,6 +275,8 @@ reset procedure etc). · 97 unmodified lines
273275 o norm_desc.c: functions for handling normal descriptors;
274276 o chain_mode.c/ring_mode.c:: functions to manage RING/CHAINED modes;
275277 o mmc_core.c/mmc.h: Management MAC Counters;
278+ o stmmac_hwtstamp.c: HW timestamp support for PTP
279+ o stmmac_ptp.c: PTP 1588 clock
276280
277281 5) Debug Information
278282
@@ -326,6 +330,35 @@ To enter in Tx LPI mode the driver needs to have a software timer · 47 unmodified lines
326330 that enable and disable the LPI mode when there is nothing to be
327331 transmitted.
328332
329−7) TODO:
333+7) Extended descriptors
334+The extended descriptors give us information about the receive Ethernet payload
335+when it is carrying PTP packets or TCP/UDP/ICMP over IP.
336+These are not available on GMAC Synopsys chips older than the 3.50.
337+At probe time the driver will decide if these can be actually used.
338+This support also is mandatory for PTPv2 because the extra descriptors 6 and 7
339+are used for saving the hardware timestamps.
340+
341+8) Precision Time Protocol (PTP)
342+The driver supports the IEEE 1588-2002, Precision Time Protocol (PTP),
343+which enables precise synchronization of clocks in measurement and
344+control systems implemented with technologies such as network
345+communication.
346+
347+In addition to the basic timestamp features mentioned in IEEE 1588-2002
348+Timestamps, new GMAC cores support the advanced timestamp features.
349+IEEE 1588-2008 that can be enabled when configure the Kernel.
350+
351+9) SGMII/RGMII supports
352+New GMAC devices provide own way to manage RGMII/SGMII.
353+This information is available at run-time by looking at the
354+HW capability register. This means that the stmmac can manage
355+auto-negotiation and link status w/o using the PHYLIB stuff
356+In fact, the HW provides a subset of extended registers to
357+restart the ANE, verify Full/Half duplex mode and Speed.
358+Also thanks to these registers it is possible to look at the
359+Auto-negotiated Link Parter Ability.
360+
361+10) TODO:
330362 o XGMAC is not supported.
331− o Add the PTP - precision time protocol
363+ o Complete the TBI & RTBI support.
364+ o extened VLAN support for 3.70a SYNP GMAC.
MAINTAINERS+5−3
@@ -1767,7 +1767,7 @@ F: arch/arm/configs/bcm2835_defconfig · 1766 unmodified lines
17671767 F: drivers/*/*bcm2835*
17681768
17691769 BROADCOM TG3 GIGABIT ETHERNET DRIVER
1770−M: Matt Carlson <mcarlson@broadcom.com>
1770+M: Nithin Nayak Sujir <nsujir@broadcom.com>
17711771 M: Michael Chan <mchan@broadcom.com>
17721772 L: netdev@vger.kernel.org
17731773 S: Supported
@@ -1889,7 +1889,7 @@ F: Documentation/video4linux/cafe_ccic · 115 unmodified lines
18891889 F: drivers/media/platform/marvell-ccic/
18901890
18911891 CAIF NETWORK LAYER
1892−M: Sjur Braendeland <sjur.brandeland@stericsson.com>
1892+M: Dmitry Tarnyagin <dmitry.tarnyagin@lockless.no>
18931893 L: netdev@vger.kernel.org
18941894 S: Supported
18951895 F: Documentation/networking/caif/
@@ -6396,6 +6396,7 @@ F: drivers/acpi/apei/erst.c · 4500 unmodified lines
63966396
63976397 PTP HARDWARE CLOCK SUPPORT
63986398 M: Richard Cochran <richardcochran@gmail.com>
6399+L: netdev@vger.kernel.org
63996400 S: Maintained
64006401 W: http://linuxptp.sourceforge.net/
64016402 F: Documentation/ABI/testing/sysfs-ptp
@@ -6527,6 +6528,7 @@ S: Supported · 125 unmodified lines
65276528 F: drivers/net/ethernet/qlogic/qlcnic/
65286529
65296530 QLOGIC QLGE 10Gb ETHERNET DRIVER
6531+M: Shahed Shaikh <shahed.shaikh@qlogic.com>
65306532 M: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
65316533 M: Ron Mercer <ron.mercer@qlogic.com>
65326534 M: linux-driver@qlogic.com
@@ -8627,7 +8629,7 @@ F: drivers/usb/gadget/*uvc*.c · 2094 unmodified lines
86278629 F: drivers/usb/gadget/webcam.c
86288630
86298631 USB WIRELESS RNDIS DRIVER (rndis_wlan)
8630−M: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
8632+M: Jussi Kivilinna <jussi.kivilinna@iki.fi>
86318633 L: linux-wireless@vger.kernel.org
86328634 S: Maintained
86338635 F: drivers/net/wireless/rndis_wlan.c
arch/alpha/include/uapi/asm/socket.h+2−0
@@ -79,4 +79,6 @@ · 78 unmodified lines
7979
8080 #define SO_LOCK_FILTER 44
8181
82+#define SO_SELECT_ERR_QUEUE 45
83+
8284 #endif /* _UAPI_ASM_SOCKET_H */
arch/arm/boot/dts/am33xx.dtsi+1−1
@@ -349,7 +349,7 @@ · 348 unmodified lines
349349 rx_descs = <64>;
350350 mac_control = <0x20>;
351351 slaves = <2>;
352− cpts_active_slave = <0>;
352+ active_slave = <0>;
353353 cpts_clock_mult = <0x80000000>;
354354 cpts_clock_shift = <29>;
355355 reg = <0x4a100000 0x800
arch/arm/net/bpf_jit_32.c+2−3
@@ -918,9 +918,8 @@ void bpf_jit_compile(struct sk_filter *fp) · 917 unmodified lines
918918 #endif
919919
920920 if (bpf_jit_enable > 1)
921− print_hex_dump(KERN_INFO, "BPF JIT code: ",
922− DUMP_PREFIX_ADDRESS, 16, 4, ctx.target,
923− alloc_size, false);
921+ /* there are 2 passes here */
922+ bpf_jit_dump(fp->len, alloc_size, 2, ctx.target);
924923
925924 fp->bpf_func = (void *)ctx.target;
926925 out:
arch/arm/plat-orion/common.c+31−23
@@ -238,6 +238,7 @@ static __init void ge_complete( · 237 unmodified lines
238238 struct mv643xx_eth_shared_platform_data *orion_ge_shared_data,
239239 struct resource *orion_ge_resource, unsigned long irq,
240240 struct platform_device *orion_ge_shared,
241+ struct platform_device *orion_ge_mvmdio,
241242 struct mv643xx_eth_platform_data *eth_data,
242243 struct platform_device *orion_ge)
243244 {
@@ -247,6 +248,8 @@ static __init void ge_complete( · 3 unmodified lines
247248 orion_ge->dev.platform_data = eth_data;
248249
249250 platform_device_register(orion_ge_shared);
251+ if (orion_ge_mvmdio)
252+ platform_device_register(orion_ge_mvmdio);
250253 platform_device_register(orion_ge);
251254 }
252255
@@ -258,8 +261,6 @@ struct mv643xx_eth_shared_platform_data orion_ge00_shared_data; · 5 unmodified lines
258261 static struct resource orion_ge00_shared_resources[] = {
259262 {
260263 .name = "ge00 base",
261− }, {
262− .name = "ge00 err irq",
263264 },
264265 };
265266
@@ -271,6 +272,19 @@ static struct platform_device orion_ge00_shared = { · 5 unmodified lines
271272 },
272273 };
273274
275+static struct resource orion_ge_mvmdio_resources[] = {
276+ {
277+ .name = "ge00 mvmdio base",
278+ }, {
279+ .name = "ge00 mvmdio err irq",
280+ },
281+};
282+
283+static struct platform_device orion_ge_mvmdio = {
284+ .name = "orion-mdio",
285+ .id = -1,
286+};
287+
274288 static struct resource orion_ge00_resources[] = {
275289 {
276290 .name = "ge00 irq",
@@ -295,26 +309,25 @@ void __init orion_ge00_init(struct mv643xx_eth_platform_data *eth_data, · 18 unmodified lines
295309 unsigned int tx_csum_limit)
296310 {
297311 fill_resources(&orion_ge00_shared, orion_ge00_shared_resources,
298− mapbase + 0x2000, SZ_16K - 1, irq_err);
312+ mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
313+ fill_resources(&orion_ge_mvmdio, orion_ge_mvmdio_resources,
314+ mapbase + 0x2004, 0x84 - 1, irq_err);
299315 orion_ge00_shared_data.tx_csum_limit = tx_csum_limit;
300316 ge_complete(&orion_ge00_shared_data,
301317 orion_ge00_resources, irq, &orion_ge00_shared,
318+ &orion_ge_mvmdio,
302319 eth_data, &orion_ge00);
303320 }
304321
305322 /*****************************************************************************
306323 * GE01
307324 ****************************************************************************/
308−struct mv643xx_eth_shared_platform_data orion_ge01_shared_data = {
309− .shared_smi = &orion_ge00_shared,
310−};
325+struct mv643xx_eth_shared_platform_data orion_ge01_shared_data;
311326
312327 static struct resource orion_ge01_shared_resources[] = {
313328 {
314329 .name = "ge01 base",
315− }, {
316− .name = "ge01 err irq",
317− },
330+ }
318331 };
319332
320333 static struct platform_device orion_ge01_shared = {
@@ -349,26 +362,23 @@ void __init orion_ge01_init(struct mv643xx_eth_platform_data *eth_data, · 28 unmodified lines
349362 unsigned int tx_csum_limit)
350363 {
351364 fill_resources(&orion_ge01_shared, orion_ge01_shared_resources,
352− mapbase + 0x2000, SZ_16K - 1, irq_err);
365+ mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
353366 orion_ge01_shared_data.tx_csum_limit = tx_csum_limit;
354367 ge_complete(&orion_ge01_shared_data,
355368 orion_ge01_resources, irq, &orion_ge01_shared,
369+ NULL,
356370 eth_data, &orion_ge01);
357371 }
358372
359373 /*****************************************************************************
360374 * GE10
361375 ****************************************************************************/
362−struct mv643xx_eth_shared_platform_data orion_ge10_shared_data = {
363− .shared_smi = &orion_ge00_shared,
364−};
376+struct mv643xx_eth_shared_platform_data orion_ge10_shared_data;
365377
366378 static struct resource orion_ge10_shared_resources[] = {
367379 {
368380 .name = "ge10 base",
369− }, {
370− .name = "ge10 err irq",
371− },
381+ }
372382 };
373383
374384 static struct platform_device orion_ge10_shared = {
@@ -402,24 +412,21 @@ void __init orion_ge10_init(struct mv643xx_eth_platform_data *eth_data, · 27 unmodified lines
402412 unsigned long irq_err)
403413 {
404414 fill_resources(&orion_ge10_shared, orion_ge10_shared_resources,
405− mapbase + 0x2000, SZ_16K - 1, irq_err);
415+ mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
406416 ge_complete(&orion_ge10_shared_data,
407417 orion_ge10_resources, irq, &orion_ge10_shared,
418+ NULL,
408419 eth_data, &orion_ge10);
409420 }
410421
411422 /*****************************************************************************
412423 * GE11
413424 ****************************************************************************/
414−struct mv643xx_eth_shared_platform_data orion_ge11_shared_data = {
415− .shared_smi = &orion_ge00_shared,
416−};
425+struct mv643xx_eth_shared_platform_data orion_ge11_shared_data;
417426
418427 static struct resource orion_ge11_shared_resources[] = {
419428 {
420429 .name = "ge11 base",
421− }, {
422− .name = "ge11 err irq",
423430 },
424431 };
425432
@@ -454,9 +461,10 @@ void __init orion_ge11_init(struct mv643xx_eth_platform_data *eth_data, · 28 unmodified lines
454461 unsigned long irq_err)
455462 {
456463 fill_resources(&orion_ge11_shared, orion_ge11_shared_resources,
457− mapbase + 0x2000, SZ_16K - 1, irq_err);
464+ mapbase + 0x2000, SZ_16K - 1, NO_IRQ);
458465 ge_complete(&orion_ge11_shared_data,
459466 orion_ge11_resources, irq, &orion_ge11_shared,
467+ NULL,
460468 eth_data, &orion_ge11);
461469 }
462470
arch/avr32/include/uapi/asm/socket.h+2−0
@@ -72,4 +72,6 @@ · 71 unmodified lines
7272
7373 #define SO_LOCK_FILTER 44
7474
75+#define SO_SELECT_ERR_QUEUE 45
76+
7577 #endif /* __ASM_AVR32_SOCKET_H */
arch/cris/include/uapi/asm/socket.h+2−0
@@ -74,6 +74,8 @@ · 73 unmodified lines
7474
7575 #define SO_LOCK_FILTER 44
7676
77+#define SO_SELECT_ERR_QUEUE 45
78+
7779 #endif /* _ASM_SOCKET_H */
7880
7981
arch/frv/include/uapi/asm/socket.h+2−0
@@ -72,5 +72,7 @@ · 71 unmodified lines
7272
7373 #define SO_LOCK_FILTER 44
7474
75+#define SO_SELECT_ERR_QUEUE 45
76+
7577 #endif /* _ASM_SOCKET_H */
7678
arch/h8300/include/uapi/asm/socket.h+2−0
@@ -72,4 +72,6 @@ · 71 unmodified lines
7272
7373 #define SO_LOCK_FILTER 44
7474
75+#define SO_SELECT_ERR_QUEUE 45
76+
7577 #endif /* _ASM_SOCKET_H */
arch/ia64/include/uapi/asm/socket.h+2−0
@@ -81,4 +81,6 @@ · 80 unmodified lines
8181
8282 #define SO_LOCK_FILTER 44
8383
84+#define SO_SELECT_ERR_QUEUE 45
85+
8486 #endif /* _ASM_IA64_SOCKET_H */
arch/m32r/include/uapi/asm/socket.h+2−0
@@ -72,4 +72,6 @@ · 71 unmodified lines
7272
7373 #define SO_LOCK_FILTER 44
7474
75+#define SO_SELECT_ERR_QUEUE 45
76+
7577 #endif /* _ASM_M32R_SOCKET_H */
arch/mips/include/uapi/asm/socket.h+2−0
@@ -90,4 +90,6 @@ · 89 unmodified lines
9090
9191 #define SO_LOCK_FILTER 44
9292
93+#define SO_SELECT_ERR_QUEUE 45
94+
9395 #endif /* _UAPI_ASM_SOCKET_H */
arch/mn10300/include/uapi/asm/socket.h+2−0
@@ -72,4 +72,6 @@ · 71 unmodified lines
7272
7373 #define SO_LOCK_FILTER 44
7474
75+#define SO_SELECT_ERR_QUEUE 45
76+
7577 #endif /* _ASM_SOCKET_H */
arch/parisc/include/uapi/asm/socket.h+2−0
@@ -71,6 +71,8 @@ · 70 unmodified lines
7171
7272 #define SO_LOCK_FILTER 0x4025
7373
74+#define SO_SELECT_ERR_QUEUE 0x4026
75+
7476 /* O_NONBLOCK clashes with the bits used for socket types. Therefore we
7577 * have to define SOCK_NONBLOCK to a different value here.
7678 */
arch/powerpc/include/uapi/asm/socket.h+2−0
@@ -79,4 +79,6 @@ · 78 unmodified lines
7979
8080 #define SO_LOCK_FILTER 44
8181
82+#define SO_SELECT_ERR_QUEUE 45
83+
8284 #endif /* _ASM_POWERPC_SOCKET_H */
arch/powerpc/net/bpf_jit_comp.c+4−8
@@ -671,16 +671,12 @@ void bpf_jit_compile(struct sk_filter *fp) · 670 unmodified lines
671671 }
672672
673673 if (bpf_jit_enable > 1)
674− pr_info("flen=%d proglen=%u pass=%d image=%p\n",
675− flen, proglen, pass, image);
674+ /* Note that we output the base address of the code_base
675+ * rather than image, since opcodes are in code_base.
676+ */
677+ bpf_jit_dump(flen, proglen, pass, code_base);
676678
677679 if (image) {
678− if (bpf_jit_enable > 1)
679− print_hex_dump(KERN_ERR, "JIT code: ",
680− DUMP_PREFIX_ADDRESS,
681− 16, 1, code_base,
682− proglen, false);
683−
684680 bpf_flush_icache(code_base, code_base + (proglen/4));
685681 /* Function descriptor nastiness: Address + TOC */
686682 ((u64 *)image)[0] = (u64)code_base;
arch/powerpc/platforms/chrp/pegasos_eth.c+20−0
@@ -47,6 +47,25 @@ static struct platform_device mv643xx_eth_shared_device = { · 46 unmodified lines
4747 .resource = mv643xx_eth_shared_resources,
4848 };
4949
50+/*
51+ * The orion mdio driver only covers shared + 0x4 up to shared + 0x84 - 1
52+ */
53+static struct resource mv643xx_eth_mvmdio_resources[] = {
54+ [0] = {
55+ .name = "ethernet mdio base",
56+ .start = 0xf1000000 + MV643XX_ETH_SHARED_REGS + 0x4,
57+ .end = 0xf1000000 + MV643XX_ETH_SHARED_REGS + 0x83,
58+ .flags = IORESOURCE_MEM,
59+ },
60+};
61+
62+static struct platform_device mv643xx_eth_mvmdio_device = {
63+ .name = "orion-mdio",
64+ .id = -1,
65+ .num_resources = ARRAY_SIZE(mv643xx_eth_mvmdio_resources),
66+ .resource = mv643xx_eth_shared_resources,
67+};
68+
5069 static struct resource mv643xx_eth_port1_resources[] = {
5170 [0] = {
5271 .name = "eth port1 irq",
@@ -82,6 +101,7 @@ static struct platform_device eth_port1_device = { · 29 unmodified lines
82101
83102 static struct platform_device *mv643xx_eth_pd_devs[] __initdata = {
84103 &mv643xx_eth_shared_device,
104+ &mv643xx_eth_mvmdio_device,
85105 &eth_port1_device,
86106 };
87107
arch/powerpc/sysdev/mv64x60_dev.c+14−2
@@ -214,15 +214,27 @@ static struct platform_device * __init mv64x60_eth_register_shared_pdev( · 213 unmodified lines
214214 struct device_node *np, int id)
215215 {
216216 struct platform_device *pdev;
217− struct resource r[1];
217+ struct resource r[2];
218218 int err;
219219
220220 err = of_address_to_resource(np, 0, &r[0]);
221221 if (err)
222222 return ERR_PTR(err);
223223
224+ /* register an orion mdio bus driver */
225+ r[1].start = r[0].start + 0x4;
226+ r[1].end = r[0].start + 0x84 - 1;
227+ r[1].flags = IORESOURCE_MEM;
228+
229+ if (id == 0) {
230+ pdev = platform_device_register_simple("orion-mdio", -1, &r[1], 1);
231+ if (!pdev)
232+ return pdev;
233+ }
234+
224235 pdev = platform_device_register_simple(MV643XX_ETH_SHARED_NAME, id,
225− r, 1);
236+ &r[0], 1);
237+
226238 return pdev;
227239 }
228240
arch/s390/include/uapi/asm/socket.h+2−0
@@ -78,4 +78,6 @@ · 77 unmodified lines
7878
7979 #define SO_LOCK_FILTER 44
8080
81+#define SO_SELECT_ERR_QUEUE 45
82+
8183 #endif /* _ASM_SOCKET_H */
arch/sparc/include/uapi/asm/socket.h+2−0
@@ -68,6 +68,8 @@ · 67 unmodified lines
6868
6969 #define SO_LOCK_FILTER 0x0028
7070
71+#define SO_SELECT_ERR_QUEUE 0x0029
72+
7173 /* Security levels - as per NRL IPv6 - don't actually do anything */
7274 #define SO_SECURITY_AUTHENTICATION 0x5001
7375 #define SO_SECURITY_ENCRYPTION_TRANSPORT 0x5002
arch/sparc/net/bpf_jit_comp.c+1−5
@@ -795,13 +795,9 @@ cond_branch: f_offset = addrs[i + filter[i].jf]; · 794 unmodified lines
795795 }
796796
797797 if (bpf_jit_enable > 1)
798− pr_err("flen=%d proglen=%u pass=%d image=%p\n",
799− flen, proglen, pass, image);
798+ bpf_jit_dump(flen, proglen, pass, image);
800799
801800 if (image) {
802− if (bpf_jit_enable > 1)
803− print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_ADDRESS,
804− 16, 1, image, proglen, false);
805801 bpf_flush_icache(image, image + proglen);
806802 fp->bpf_func = (void *)image;
807803 }
arch/x86/net/bpf_jit_comp.c+2−7
@@ -725,17 +725,12 @@ cond_branch: f_offset = addrs[i + filter[i].jf] - addrs[i]; · 724 unmodified lines
725725 }
726726 oldproglen = proglen;
727727 }
728+
728729 if (bpf_jit_enable > 1)
729− pr_err("flen=%d proglen=%u pass=%d image=%p\n",
730− flen, proglen, pass, image);
730+ bpf_jit_dump(flen, proglen, pass, image);
731731
732732 if (image) {
733− if (bpf_jit_enable > 1)
734− print_hex_dump(KERN_ERR, "JIT code: ", DUMP_PREFIX_ADDRESS,
735− 16, 1, image, proglen, false);
736−
737733 bpf_flush_icache(image, image + proglen);
738−
739734 fp->bpf_func = (void *)image;
740735 }
741736 out:
arch/xtensa/include/uapi/asm/socket.h+2−0
@@ -83,4 +83,6 @@ · 82 unmodified lines
8383
8484 #define SO_LOCK_FILTER 44
8585
86+#define SO_SELECT_ERR_QUEUE 45
87+
8688 #endif /* _XTENSA_SOCKET_H */
drivers/atm/he.c+1−1
@@ -1055,7 +1055,7 @@ static int he_start(struct atm_dev *dev) · 1054 unmodified lines
10551055 he_writel(he_dev, 0x0, RESET_CNTL);
10561056 he_writel(he_dev, 0xff, RESET_CNTL);
10571057
1058− udelay(16*1000); /* 16 ms */
1058+ msleep(16); /* 16 ms */
10591059 status = he_readl(he_dev, RESET_CNTL);
10601060 if ((status & BOARD_RST_STATUS) == 0) {
10611061 hprintk("reset failed\n");
drivers/bcma/core.c+7−1
@@ -104,7 +104,13 @@ void bcma_core_pll_ctl(struct bcma_device *core, u32 req, u32 status, bool on) · 103 unmodified lines
104104 if (i)
105105 bcma_err(core->bus, "PLL enable timeout\n");
106106 } else {
107− bcma_warn(core->bus, "Disabling PLL not supported yet!\n");
107+ /*
108+ * Mask the PLL but don't wait for it to be disabled. PLL may be
109+ * shared between cores and will be still up if there is another
110+ * core using it.
111+ */
112+ bcma_mask32(core, BCMA_CLKCTLST, ~req);
113+ bcma_read32(core, BCMA_CLKCTLST);
108114 }
109115 }
110116 EXPORT_SYMBOL_GPL(bcma_core_pll_ctl);
drivers/bcma/driver_chipcommon.c+4−1
@@ -25,13 +25,14 @@ static inline u32 bcma_cc_write32_masked(struct bcma_drv_cc *cc, u16 offset, · 24 unmodified lines
2525 return value;
2626 }
2727
28−static u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc)
28+u32 bcma_chipco_get_alp_clock(struct bcma_drv_cc *cc)
2929 {
3030 if (cc->capabilities & BCMA_CC_CAP_PMU)
3131 return bcma_pmu_get_alp_clock(cc);
3232
3333 return 20000000;
3434 }
35+EXPORT_SYMBOL_GPL(bcma_chipco_get_alp_clock);
3536
3637 static u32 bcma_chipco_watchdog_get_max_timer(struct bcma_drv_cc *cc)
3738 {
@@ -213,6 +214,7 @@ u32 bcma_chipco_gpio_out(struct bcma_drv_cc *cc, u32 mask, u32 value) · 175 unmodified lines
213214
214215 return res;
215216 }
217+EXPORT_SYMBOL_GPL(bcma_chipco_gpio_out);
216218
217219 u32 bcma_chipco_gpio_outen(struct bcma_drv_cc *cc, u32 mask, u32 value)
218220 {
@@ -225,6 +227,7 @@ u32 bcma_chipco_gpio_outen(struct bcma_drv_cc *cc, u32 mask, u32 value) · 6 unmodified lines
225227
226228 return res;
227229 }
230+EXPORT_SYMBOL_GPL(bcma_chipco_gpio_outen);
228231
229232 /*
230233 * If the bit is set to 0, chipcommon controlls this GPIO,
drivers/bcma/driver_chipcommon_pmu.c+25−9
@@ -174,19 +174,35 @@ u32 bcma_pmu_get_alp_clock(struct bcma_drv_cc *cc) · 173 unmodified lines
174174 struct bcma_bus *bus = cc->core->bus;
175175
176176 switch (bus->chipinfo.id) {
177+ case BCMA_CHIP_ID_BCM4313:
178+ case BCMA_CHIP_ID_BCM43224:
179+ case BCMA_CHIP_ID_BCM43225:
180+ case BCMA_CHIP_ID_BCM43227:
181+ case BCMA_CHIP_ID_BCM43228:
182+ case BCMA_CHIP_ID_BCM4331:
183+ case BCMA_CHIP_ID_BCM43421:
184+ case BCMA_CHIP_ID_BCM43428:
185+ case BCMA_CHIP_ID_BCM43431:
177186 case BCMA_CHIP_ID_BCM4716:
178− case BCMA_CHIP_ID_BCM4748:
179187 case BCMA_CHIP_ID_BCM47162:
180− case BCMA_CHIP_ID_BCM4313:
181− case BCMA_CHIP_ID_BCM5357:
188+ case BCMA_CHIP_ID_BCM4748:
182189 case BCMA_CHIP_ID_BCM4749:
190+ case BCMA_CHIP_ID_BCM5357:
183191 case BCMA_CHIP_ID_BCM53572:
192+ case BCMA_CHIP_ID_BCM6362:
184193 /* always 20Mhz */
185194 return 20000 * 1000;
186− case BCMA_CHIP_ID_BCM5356:
187195 case BCMA_CHIP_ID_BCM4706:
196+ case BCMA_CHIP_ID_BCM5356:
188197 /* always 25Mhz */
189198 return 25000 * 1000;
199+ case BCMA_CHIP_ID_BCM43460:
200+ case BCMA_CHIP_ID_BCM4352:
201+ case BCMA_CHIP_ID_BCM4360:
202+ if (cc->status & BCMA_CC_CHIPST_4360_XTAL_40MZ)
203+ return 40000 * 1000;
204+ else
205+ return 20000 * 1000;
190206 default:
191207 bcma_warn(bus, "No ALP clock specified for %04X device, pmu rev. %d, using default %d Hz\n",
192208 bus->chipinfo.id, cc->pmu.rev, BCMA_CC_PMU_ALP_CLOCK);
@@ -373,7 +389,7 @@ void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid) · 180 unmodified lines
373389 tmp |= (bcm5357_bcm43236_ndiv[spuravoid]) << BCMA_CC_PMU1_PLL0_PC2_NDIV_INT_SHIFT;
374390 bcma_cc_write32(cc, BCMA_CC_PLLCTL_DATA, tmp);
375391
376− tmp = 1 << 10;
392+ tmp = BCMA_CC_PMU_CTL_PLL_UPD;
377393 break;
378394
379395 case BCMA_CHIP_ID_BCM4331:
@@ -394,7 +410,7 @@ void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid) · 14 unmodified lines
394410 bcma_pmu_spuravoid_pll_write(cc, BCMA_CC_PMU_PLL_CTL2,
395411 0x03000a08);
396412 }
397− tmp = 1 << 10;
413+ tmp = BCMA_CC_PMU_CTL_PLL_UPD;
398414 break;
399415
400416 case BCMA_CHIP_ID_BCM43224:
@@ -427,7 +443,7 @@ void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid) · 26 unmodified lines
427443 bcma_pmu_spuravoid_pll_write(cc, BCMA_CC_PMU_PLL_CTL5,
428444 0x88888815);
429445 }
430− tmp = 1 << 10;
446+ tmp = BCMA_CC_PMU_CTL_PLL_UPD;
431447 break;
432448
433449 case BCMA_CHIP_ID_BCM4716:
@@ -461,7 +477,7 @@ void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid) · 27 unmodified lines
461477 0x88888815);
462478 }
463479
464− tmp = 3 << 9;
480+ tmp = BCMA_CC_PMU_CTL_PLL_UPD | BCMA_CC_PMU_CTL_NOILPONW;
465481 break;
466482
467483 case BCMA_CHIP_ID_BCM43227:
@@ -497,7 +513,7 @@ void bcma_pmu_spuravoid_pllupdate(struct bcma_drv_cc *cc, int spuravoid) · 29 unmodified lines
497513 bcma_pmu_spuravoid_pll_write(cc, BCMA_CC_PMU_PLL_CTL5,
498514 0x88888815);
499515 }
500− tmp = 1 << 10;
516+ tmp = BCMA_CC_PMU_CTL_PLL_UPD;
501517 break;
502518 default:
503519 bcma_err(bus, "Unknown spuravoidance settings for chip 0x%04X, not changing PLL\n",
drivers/bcma/main.c+5−0
@@ -120,6 +120,11 @@ static int bcma_register_cores(struct bcma_bus *bus) · 119 unmodified lines
120120 continue;
121121 }
122122
123+ /* Only first GMAC core on BCM4706 is connected and working */
124+ if (core->id.id == BCMA_CORE_4706_MAC_GBIT &&
125+ core->core_unit > 0)
126+ continue;
127+
123128 core->dev.release = bcma_release_core_dev;
124129 core->dev.bus = &bcma_bus_type;
125130 dev_set_name(&core->dev, "bcma%d:%d", bus->num, dev_id);
drivers/bcma/scan.c+8−8
@@ -137,19 +137,19 @@ static void bcma_scan_switch_core(struct bcma_bus *bus, u32 addr) · 136 unmodified lines
137137 addr);
138138 }
139139
140−static u32 bcma_erom_get_ent(struct bcma_bus *bus, u32 **eromptr)
140+static u32 bcma_erom_get_ent(struct bcma_bus *bus, u32 __iomem **eromptr)
141141 {
142142 u32 ent = readl(*eromptr);
143143 (*eromptr)++;
144144 return ent;
145145 }
146146
147−static void bcma_erom_push_ent(u32 **eromptr)
147+static void bcma_erom_push_ent(u32 __iomem **eromptr)
148148 {
149149 (*eromptr)--;
150150 }
151151
152−static s32 bcma_erom_get_ci(struct bcma_bus *bus, u32 **eromptr)
152+static s32 bcma_erom_get_ci(struct bcma_bus *bus, u32 __iomem **eromptr)
153153 {
154154 u32 ent = bcma_erom_get_ent(bus, eromptr);
155155 if (!(ent & SCAN_ER_VALID))
@@ -159,14 +159,14 @@ static s32 bcma_erom_get_ci(struct bcma_bus *bus, u32 **eromptr) · 3 unmodified lines
159159 return ent;
160160 }
161161
162−static bool bcma_erom_is_end(struct bcma_bus *bus, u32 **eromptr)
162+static bool bcma_erom_is_end(struct bcma_bus *bus, u32 __iomem **eromptr)
163163 {
164164 u32 ent = bcma_erom_get_ent(bus, eromptr);
165165 bcma_erom_push_ent(eromptr);
166166 return (ent == (SCAN_ER_TAG_END | SCAN_ER_VALID));
167167 }
168168
169−static bool bcma_erom_is_bridge(struct bcma_bus *bus, u32 **eromptr)
169+static bool bcma_erom_is_bridge(struct bcma_bus *bus, u32 __iomem **eromptr)
170170 {
171171 u32 ent = bcma_erom_get_ent(bus, eromptr);
172172 bcma_erom_push_ent(eromptr);
@@ -175,7 +175,7 @@ static bool bcma_erom_is_bridge(struct bcma_bus *bus, u32 **eromptr) · 2 unmodified lines
175175 ((ent & SCAN_ADDR_TYPE) == SCAN_ADDR_TYPE_BRIDGE));
176176 }
177177
178−static void bcma_erom_skip_component(struct bcma_bus *bus, u32 **eromptr)
178+static void bcma_erom_skip_component(struct bcma_bus *bus, u32 __iomem **eromptr)
179179 {
180180 u32 ent;
181181 while (1) {
@@ -189,7 +189,7 @@ static void bcma_erom_skip_component(struct bcma_bus *bus, u32 **eromptr) · 7 unmodified lines
189189 bcma_erom_push_ent(eromptr);
190190 }
191191
192−static s32 bcma_erom_get_mst_port(struct bcma_bus *bus, u32 **eromptr)
192+static s32 bcma_erom_get_mst_port(struct bcma_bus *bus, u32 __iomem **eromptr)
193193 {
194194 u32 ent = bcma_erom_get_ent(bus, eromptr);
195195 if (!(ent & SCAN_ER_VALID))
@@ -199,7 +199,7 @@ static s32 bcma_erom_get_mst_port(struct bcma_bus *bus, u32 **eromptr) · 3 unmodified lines
199199 return ent;
200200 }
201201
202−static s32 bcma_erom_get_addr_desc(struct bcma_bus *bus, u32 **eromptr,
202+static s32 bcma_erom_get_addr_desc(struct bcma_bus *bus, u32 __iomem **eromptr,
203203 u32 type, u8 port)
204204 {
205205 u32 addrl, addrh, sizel, sizeh = 0;
drivers/bcma/sprom.c+1−0
@@ -217,6 +217,7 @@ static void bcma_sprom_extract_r8(struct bcma_bus *bus, const u16 *sprom) · 216 unmodified lines
217217 }
218218
219219 SPEX(board_rev, SSB_SPROM8_BOARDREV, ~0, 0);
220+ SPEX(board_type, SSB_SPROM1_SPID, ~0, 0);
220221
221222 SPEX(txpid2g[0], SSB_SPROM4_TXPID2G01, SSB_SPROM4_TXPID2G0,
222223 SSB_SPROM4_TXPID2G0_SHIFT);
drivers/bluetooth/ath3k.c+2−0
@@ -90,6 +90,7 @@ static struct usb_device_id ath3k_table[] = { · 89 unmodified lines
9090 { USB_DEVICE(0x13d3, 0x3393) },
9191 { USB_DEVICE(0x0489, 0xe04e) },
9292 { USB_DEVICE(0x0489, 0xe056) },
93+ { USB_DEVICE(0x0489, 0xe04d) },
9394
9495 /* Atheros AR5BBU12 with sflash firmware */
9596 { USB_DEVICE(0x0489, 0xE02C) },
@@ -126,6 +127,7 @@ static struct usb_device_id ath3k_blist_tbl[] = { · 30 unmodified lines
126127 { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
127128 { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
128129 { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
130+ { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 },
129131
130132 /* Atheros AR5BBU22 with sflash firmware */
131133 { USB_DEVICE(0x0489, 0xE03C), .driver_info = BTUSB_ATH3012 },
drivers/bluetooth/btmrvl_debugfs.c+22−244
@@ -29,20 +29,6 @@ · 28 unmodified lines
2929 struct btmrvl_debugfs_data {
3030 struct dentry *config_dir;
3131 struct dentry *status_dir;
32−
33− /* config */
34− struct dentry *psmode;
35− struct dentry *pscmd;
36− struct dentry *hsmode;
37− struct dentry *hscmd;
38− struct dentry *gpiogap;
39− struct dentry *hscfgcmd;
40−
41− /* status */
42− struct dentry *curpsmode;
43− struct dentry *hsstate;
44− struct dentry *psstate;
45− struct dentry *txdnldready;
4632 };
4733
4834 static ssize_t btmrvl_hscfgcmd_write(struct file *file,
@@ -91,47 +77,6 @@ static const struct file_operations btmrvl_hscfgcmd_fops = { · 42 unmodified lines
9177 .llseek = default_llseek,
9278 };
9379
94−static ssize_t btmrvl_psmode_write(struct file *file, const char __user *ubuf,
95− size_t count, loff_t *ppos)
96−{
97− struct btmrvl_private *priv = file->private_data;
98− char buf[16];
99− long result, ret;
100−
101− memset(buf, 0, sizeof(buf));
102−
103− if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
104− return -EFAULT;
105−
106− ret = strict_strtol(buf, 10, &result);
107− if (ret)
108− return ret;
109−
110− priv->btmrvl_dev.psmode = result;
111−
112− return count;
113−}
114−
115−static ssize_t btmrvl_psmode_read(struct file *file, char __user *userbuf,
116− size_t count, loff_t *ppos)
117−{
118− struct btmrvl_private *priv = file->private_data;
119− char buf[16];
120− int ret;
121−
122− ret = snprintf(buf, sizeof(buf) - 1, "%d\n",
123− priv->btmrvl_dev.psmode);
124−
125− return simple_read_from_buffer(userbuf, count, ppos, buf, ret);
126−}
127−
128−static const struct file_operations btmrvl_psmode_fops = {
129− .read = btmrvl_psmode_read,
130− .write = btmrvl_psmode_write,
131− .open = simple_open,
132− .llseek = default_llseek,
133−};
134−
13580 static ssize_t btmrvl_pscmd_write(struct file *file, const char __user *ubuf,
13681 size_t count, loff_t *ppos)
13782 {
@@ -178,47 +123,6 @@ static const struct file_operations btmrvl_pscmd_fops = { · 40 unmodified lines
178123 .llseek = default_llseek,
179124 };
180125
181−static ssize_t btmrvl_gpiogap_write(struct file *file, const char __user *ubuf,
182− size_t count, loff_t *ppos)
183−{
184− struct btmrvl_private *priv = file->private_data;
185− char buf[16];
186− long result, ret;
187−
188− memset(buf, 0, sizeof(buf));
189−
190− if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
191− return -EFAULT;
192−
193− ret = strict_strtol(buf, 16, &result);
194− if (ret)
195− return ret;
196−
197− priv->btmrvl_dev.gpio_gap = result;
198−
199− return count;
200−}
201−
202−static ssize_t btmrvl_gpiogap_read(struct file *file, char __user *userbuf,
203− size_t count, loff_t *ppos)
204−{
205− struct btmrvl_private *priv = file->private_data;
206− char buf[16];
207− int ret;
208−
209− ret = snprintf(buf, sizeof(buf) - 1, "0x%x\n",
210− priv->btmrvl_dev.gpio_gap);
211−
212− return simple_read_from_buffer(userbuf, count, ppos, buf, ret);
213−}
214−
215−static const struct file_operations btmrvl_gpiogap_fops = {
216− .read = btmrvl_gpiogap_read,
217− .write = btmrvl_gpiogap_write,
218− .open = simple_open,
219− .llseek = default_llseek,
220−};
221−
222126 static ssize_t btmrvl_hscmd_write(struct file *file, const char __user *ubuf,
223127 size_t count, loff_t *ppos)
224128 {
@@ -263,119 +167,6 @@ static const struct file_operations btmrvl_hscmd_fops = { · 38 unmodified lines
263167 .llseek = default_llseek,
264168 };
265169
266−static ssize_t btmrvl_hsmode_write(struct file *file, const char __user *ubuf,
267− size_t count, loff_t *ppos)
268−{
269− struct btmrvl_private *priv = file->private_data;
270− char buf[16];
271− long result, ret;
272−
273− memset(buf, 0, sizeof(buf));
274−
275− if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count)))
276− return -EFAULT;
277−
278− ret = strict_strtol(buf, 10, &result);
279− if (ret)
280− return ret;
281−
282− priv->btmrvl_dev.hsmode = result;
283−
284− return count;
285−}
286−
287−static ssize_t btmrvl_hsmode_read(struct file *file, char __user * userbuf,
288− size_t count, loff_t *ppos)
289−{
290− struct btmrvl_private *priv = file->private_data;
291− char buf[16];
292− int ret;
293−
294− ret = snprintf(buf, sizeof(buf) - 1, "%d\n", priv->btmrvl_dev.hsmode);
295−
296− return simple_read_from_buffer(userbuf, count, ppos, buf, ret);
297−}
298−
299−static const struct file_operations btmrvl_hsmode_fops = {
300− .read = btmrvl_hsmode_read,
301− .write = btmrvl_hsmode_write,
302− .open = simple_open,
303− .llseek = default_llseek,
304−};
305−
306−static ssize_t btmrvl_curpsmode_read(struct file *file, char __user *userbuf,
307− size_t count, loff_t *ppos)
308−{
309− struct btmrvl_private *priv = file->private_data;
310− char buf[16];
311− int ret;
312−
313− ret = snprintf(buf, sizeof(buf) - 1, "%d\n", priv->adapter->psmode);
314−
315− return simple_read_from_buffer(userbuf, count, ppos, buf, ret);
316−}
317−
318−static const struct file_operations btmrvl_curpsmode_fops = {
319− .read = btmrvl_curpsmode_read,
320− .open = simple_open,
321− .llseek = default_llseek,
322−};
323−
324−static ssize_t btmrvl_psstate_read(struct file *file, char __user * userbuf,
325− size_t count, loff_t *ppos)
326−{
327− struct btmrvl_private *priv = file->private_data;
328− char buf[16];
329− int ret;
330−
331− ret = snprintf(buf, sizeof(buf) - 1, "%d\n", priv->adapter->ps_state);
332−
333− return simple_read_from_buffer(userbuf, count, ppos, buf, ret);
334−}
335−
336−static const struct file_operations btmrvl_psstate_fops = {
337− .read = btmrvl_psstate_read,
338− .open = simple_open,
339− .llseek = default_llseek,
340−};
341−
342−static ssize_t btmrvl_hsstate_read(struct file *file, char __user *userbuf,
343− size_t count, loff_t *ppos)
344−{
345− struct btmrvl_private *priv = file->private_data;
346− char buf[16];
347− int ret;
348−
349− ret = snprintf(buf, sizeof(buf) - 1, "%d\n", priv->adapter->hs_state);
350−
351− return simple_read_from_buffer(userbuf, count, ppos, buf, ret);
352−}
353−
354−static const struct file_operations btmrvl_hsstate_fops = {
355− .read = btmrvl_hsstate_read,
356− .open = simple_open,
357− .llseek = default_llseek,
358−};
359−
360−static ssize_t btmrvl_txdnldready_read(struct file *file, char __user *userbuf,
361− size_t count, loff_t *ppos)
362−{
363− struct btmrvl_private *priv = file->private_data;
364− char buf[16];
365− int ret;
366−
367− ret = snprintf(buf, sizeof(buf) - 1, "%d\n",
368− priv->btmrvl_dev.tx_dnld_rdy);
369−
370− return simple_read_from_buffer(userbuf, count, ppos, buf, ret);
371−}
372−
373−static const struct file_operations btmrvl_txdnldready_fops = {
374− .read = btmrvl_txdnldready_read,
375− .open = simple_open,
376− .llseek = default_llseek,
377−};
378−
379170 void btmrvl_debugfs_init(struct hci_dev *hdev)
380171 {
381172 struct btmrvl_private *priv = hci_get_drvdata(hdev);
@@ -394,30 +185,28 @@ void btmrvl_debugfs_init(struct hci_dev *hdev) · 12 unmodified lines
394185
395186 dbg->config_dir = debugfs_create_dir("config", hdev->debugfs);
396187
397− dbg->psmode = debugfs_create_file("psmode", 0644, dbg->config_dir,
398− priv, &btmrvl_psmode_fops);
399− dbg->pscmd = debugfs_create_file("pscmd", 0644, dbg->config_dir,
400− priv, &btmrvl_pscmd_fops);
401− dbg->gpiogap = debugfs_create_file("gpiogap", 0644, dbg->config_dir,
402− priv, &btmrvl_gpiogap_fops);
403− dbg->hsmode = debugfs_create_file("hsmode", 0644, dbg->config_dir,
404− priv, &btmrvl_hsmode_fops);
405− dbg->hscmd = debugfs_create_file("hscmd", 0644, dbg->config_dir,
406− priv, &btmrvl_hscmd_fops);
407− dbg->hscfgcmd = debugfs_create_file("hscfgcmd", 0644, dbg->config_dir,
408− priv, &btmrvl_hscfgcmd_fops);
188+ debugfs_create_u8("psmode", 0644, dbg->config_dir,
189+ &priv->btmrvl_dev.psmode);
190+ debugfs_create_file("pscmd", 0644, dbg->config_dir,
191+ priv, &btmrvl_pscmd_fops);
192+ debugfs_create_x16("gpiogap", 0644, dbg->config_dir,
193+ &priv->btmrvl_dev.gpio_gap);
194+ debugfs_create_u8("hsmode", 0644, dbg->config_dir,
195+ &priv->btmrvl_dev.hsmode);
196+ debugfs_create_file("hscmd", 0644, dbg->config_dir,
197+ priv, &btmrvl_hscmd_fops);
198+ debugfs_create_file("hscfgcmd", 0644, dbg->config_dir,
199+ priv, &btmrvl_hscfgcmd_fops);
409200
410201 dbg->status_dir = debugfs_create_dir("status", hdev->debugfs);
411− dbg->curpsmode = debugfs_create_file("curpsmode", 0444,
412− dbg->status_dir, priv,
413− &btmrvl_curpsmode_fops);
414− dbg->psstate = debugfs_create_file("psstate", 0444, dbg->status_dir,
415− priv, &btmrvl_psstate_fops);
416− dbg->hsstate = debugfs_create_file("hsstate", 0444, dbg->status_dir,
417− priv, &btmrvl_hsstate_fops);
418− dbg->txdnldready = debugfs_create_file("txdnldready", 0444,
419− dbg->status_dir, priv,
420− &btmrvl_txdnldready_fops);
202+ debugfs_create_u8("curpsmode", 0444, dbg->status_dir,
203+ &priv->adapter->psmode);
204+ debugfs_create_u8("psstate", 0444, dbg->status_dir,
205+ &priv->adapter->ps_state);
206+ debugfs_create_u8("hsstate", 0444, dbg->status_dir,
207+ &priv->adapter->hs_state);
208+ debugfs_create_u8("txdnldready", 0444, dbg->status_dir,
209+ &priv->btmrvl_dev.tx_dnld_rdy);
421210 }
422211
423212 void btmrvl_debugfs_remove(struct hci_dev *hdev)
@@ -428,19 +217,8 @@ void btmrvl_debugfs_remove(struct hci_dev *hdev) · 4 unmodified lines
428217 if (!dbg)
429218 return;
430219
431− debugfs_remove(dbg->psmode);
432− debugfs_remove(dbg->pscmd);
433− debugfs_remove(dbg->gpiogap);
434− debugfs_remove(dbg->hsmode);
435− debugfs_remove(dbg->hscmd);
436− debugfs_remove(dbg->hscfgcmd);
437− debugfs_remove(dbg->config_dir);
438−
439− debugfs_remove(dbg->curpsmode);
440− debugfs_remove(dbg->psstate);
441− debugfs_remove(dbg->hsstate);
442− debugfs_remove(dbg->txdnldready);
443− debugfs_remove(dbg->status_dir);
220+ debugfs_remove_recursive(dbg->config_dir);
221+ debugfs_remove_recursive(dbg->status_dir);
444222
445223 kfree(dbg);
446224 }
drivers/bluetooth/btmrvl_sdio.c+27−22
@@ -83,8 +83,8 @@ static const struct btmrvl_sdio_card_reg btmrvl_reg_87xx = { · 82 unmodified lines
8383 };
8484
8585 static const struct btmrvl_sdio_device btmrvl_sdio_sd8688 = {
86− .helper = "sd8688_helper.bin",
87− .firmware = "sd8688.bin",
86+ .helper = "mrvl/sd8688_helper.bin",
87+ .firmware = "mrvl/sd8688.bin",
8888 .reg = &btmrvl_reg_8688,
8989 .sd_blksz_fw_dl = 64,
9090 };
@@ -228,24 +228,24 @@ failed: · 137 unmodified lines
228228 static int btmrvl_sdio_verify_fw_download(struct btmrvl_sdio_card *card,
229229 int pollnum)
230230 {
231− int ret = -ETIMEDOUT;
232231 u16 firmwarestat;
233− unsigned int tries;
232+ int tries, ret;
234233
235234 /* Wait for firmware to become ready */
236235 for (tries = 0; tries < pollnum; tries++) {
237− if (btmrvl_sdio_read_fw_status(card, &firmwarestat) < 0)
236+ sdio_claim_host(card->func);
237+ ret = btmrvl_sdio_read_fw_status(card, &firmwarestat);
238+ sdio_release_host(card->func);
239+ if (ret < 0)
238240 continue;
239241
240− if (firmwarestat == FIRMWARE_READY) {
241− ret = 0;
242− break;
243− } else {
244− msleep(10);
245− }
242+ if (firmwarestat == FIRMWARE_READY)
243+ return 0;
244+
245+ msleep(10);
246246 }
247247
248− return ret;
248+ return -ETIMEDOUT;
249249 }
250250
251251 static int btmrvl_sdio_download_helper(struct btmrvl_sdio_card *card)
@@ -874,7 +874,7 @@ exit: · 622 unmodified lines
874874
875875 static int btmrvl_sdio_download_fw(struct btmrvl_sdio_card *card)
876876 {
877− int ret = 0;
877+ int ret;
878878 u8 fws0;
879879 int pollnum = MAX_POLL_TRIES;
880880
@@ -882,13 +882,14 @@ static int btmrvl_sdio_download_fw(struct btmrvl_sdio_card *card) · 1 unmodified line
882882 BT_ERR("card or function is NULL!");
883883 return -EINVAL;
884884 }
885− sdio_claim_host(card->func);
886885
887886 if (!btmrvl_sdio_verify_fw_download(card, 1)) {
888887 BT_DBG("Firmware already downloaded!");
889− goto done;
888+ return 0;
890889 }
891890
891+ sdio_claim_host(card->func);
892+
892893 /* Check if other function driver is downloading the firmware */
893894 fws0 = sdio_readb(card->func, card->reg->card_fw_status0, &ret);
894895 if (ret) {
@@ -918,15 +919,21 @@ static int btmrvl_sdio_download_fw(struct btmrvl_sdio_card *card) · 23 unmodified lines
918919 }
919920 }
920921
922+ sdio_release_host(card->func);
923+
924+ /*
925+ * winner or not, with this test the FW synchronizes when the
926+ * module can continue its initialization
927+ */
921928 if (btmrvl_sdio_verify_fw_download(card, pollnum)) {
922929 BT_ERR("FW failed to be active in time!");
923− ret = -ETIMEDOUT;
924− goto done;
930+ return -ETIMEDOUT;
925931 }
926932
933+ return 0;
934+
927935 done:
928936 sdio_release_host(card->func);
929−
930937 return ret;
931938 }
932939
@@ -989,8 +996,6 @@ static int btmrvl_sdio_probe(struct sdio_func *func, · 56 unmodified lines
989996 goto unreg_dev;
990997 }
991998
992− msleep(100);
993−
994999 btmrvl_sdio_enable_host_int(card);
9951000
9961001 priv = btmrvl_add_card(card);
@@ -1185,7 +1190,7 @@ MODULE_AUTHOR("Marvell International Ltd."); · 188 unmodified lines
11851190 MODULE_DESCRIPTION("Marvell BT-over-SDIO driver ver " VERSION);
11861191 MODULE_VERSION(VERSION);
11871192 MODULE_LICENSE("GPL v2");
1188−MODULE_FIRMWARE("sd8688_helper.bin");
1189−MODULE_FIRMWARE("sd8688.bin");
1193+MODULE_FIRMWARE("mrvl/sd8688_helper.bin");
1194+MODULE_FIRMWARE("mrvl/sd8688.bin");
11901195 MODULE_FIRMWARE("mrvl/sd8787_uapsta.bin");
11911196 MODULE_FIRMWARE("mrvl/sd8797_uapsta.bin");
drivers/bluetooth/btusb.c+402−16
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323
2424 #include <linux/module.h>
2525 #include <linux/usb.h>
26+#include <linux/firmware.h>
2627
2728 #include <net/bluetooth/bluetooth.h>
2829 #include <net/bluetooth/hci_core.h>
@@ -47,6 +48,7 @@ static struct usb_driver btusb_driver; · 18 unmodified lines
4748 #define BTUSB_BROKEN_ISOC 0x20
4849 #define BTUSB_WRONG_SCO_MTU 0x40
4950 #define BTUSB_ATH3012 0x80
51+#define BTUSB_INTEL 0x100
5052
5153 static struct usb_device_id btusb_table[] = {
5254 /* Generic Bluetooth USB device */
@@ -148,6 +150,7 @@ static struct usb_device_id blacklist_table[] = { · 95 unmodified lines
148150 { USB_DEVICE(0x13d3, 0x3393), .driver_info = BTUSB_ATH3012 },
149151 { USB_DEVICE(0x0489, 0xe04e), .driver_info = BTUSB_ATH3012 },
150152 { USB_DEVICE(0x0489, 0xe056), .driver_info = BTUSB_ATH3012 },
153+ { USB_DEVICE(0x0489, 0xe04d), .driver_info = BTUSB_ATH3012 },
151154
152155 /* Atheros AR5BBU12 with sflash firmware */
153156 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
@@ -206,6 +209,9 @@ static struct usb_device_id blacklist_table[] = { · 52 unmodified lines
206209 /* Frontline ComProbe Bluetooth Sniffer */
207210 { USB_DEVICE(0x16d3, 0x0002), .driver_info = BTUSB_SNIFFER },
208211
212+ /* Intel Bluetooth device */
213+ { USB_DEVICE(0x8087, 0x07dc), .driver_info = BTUSB_INTEL },
214+
209215 { } /* Terminating entry */
210216 };
211217
@@ -926,6 +932,391 @@ static void btusb_waker(struct work_struct *work) · 714 unmodified lines
926932 usb_autopm_put_interface(data->intf);
927933 }
928934
935+static int btusb_setup_bcm92035(struct hci_dev *hdev)
936+{
937+ struct sk_buff *skb;
938+ u8 val = 0x00;
939+
940+ BT_DBG("%s", hdev->name);
941+
942+ skb = __hci_cmd_sync(hdev, 0xfc3b, 1, &val, HCI_INIT_TIMEOUT);
943+ if (IS_ERR(skb))
944+ BT_ERR("BCM92035 command failed (%ld)", -PTR_ERR(skb));
945+ else
946+ kfree_skb(skb);
947+
948+ return 0;
949+}
950+
951+struct intel_version {
952+ u8 status;
953+ u8 hw_platform;
954+ u8 hw_variant;
955+ u8 hw_revision;
956+ u8 fw_variant;
957+ u8 fw_revision;
958+ u8 fw_build_num;
959+ u8 fw_build_ww;
960+ u8 fw_build_yy;
961+ u8 fw_patch_num;
962+} __packed;
963+
964+static const struct firmware *btusb_setup_intel_get_fw(struct hci_dev *hdev,
965+ struct intel_version *ver)
966+{
967+ const struct firmware *fw;
968+ char fwname[64];
969+ int ret;
970+
971+ snprintf(fwname, sizeof(fwname),
972+ "intel/ibt-hw-%x.%x.%x-fw-%x.%x.%x.%x.%x.bseq",
973+ ver->hw_platform, ver->hw_variant, ver->hw_revision,
974+ ver->fw_variant, ver->fw_revision, ver->fw_build_num,
975+ ver->fw_build_ww, ver->fw_build_yy);
976+
977+ ret = request_firmware(&fw, fwname, &hdev->dev);
978+ if (ret < 0) {
979+ if (ret == -EINVAL) {
980+ BT_ERR("%s Intel firmware file request failed (%d)",
981+ hdev->name, ret);
982+ return NULL;
983+ }
984+
985+ BT_ERR("%s failed to open Intel firmware file: %s(%d)",
986+ hdev->name, fwname, ret);
987+
988+ /* If the correct firmware patch file is not found, use the
989+ * default firmware patch file instead
990+ */
991+ snprintf(fwname, sizeof(fwname), "intel/ibt-hw-%x.%x.bseq",
992+ ver->hw_platform, ver->hw_variant);
993+ if (request_firmware(&fw, fwname, &hdev->dev) < 0) {
994+ BT_ERR("%s failed to open default Intel fw file: %s",
995+ hdev->name, fwname);
996+ return NULL;
997+ }
998+ }
999+
1000+ BT_INFO("%s: Intel Bluetooth firmware file: %s", hdev->name, fwname);
1001+
1002+ return fw;
1003+}
1004+
1005+static int btusb_setup_intel_patching(struct hci_dev *hdev,
1006+ const struct firmware *fw,
1007+ const u8 **fw_ptr, int *disable_patch)
1008+{
1009+ struct sk_buff *skb;
1010+ struct hci_command_hdr *cmd;
1011+ const u8 *cmd_param;
1012+ struct hci_event_hdr *evt = NULL;
1013+ const u8 *evt_param = NULL;
1014+ int remain = fw->size - (*fw_ptr - fw->data);
1015+
1016+ /* The first byte indicates the types of the patch command or event.
1017+ * 0x01 means HCI command and 0x02 is HCI event. If the first bytes
1018+ * in the current firmware buffer doesn't start with 0x01 or
1019+ * the size of remain buffer is smaller than HCI command header,
1020+ * the firmware file is corrupted and it should stop the patching
1021+ * process.
1022+ */
1023+ if (remain > HCI_COMMAND_HDR_SIZE && *fw_ptr[0] != 0x01) {
1024+ BT_ERR("%s Intel fw corrupted: invalid cmd read", hdev->name);
1025+ return -EINVAL;
1026+ }
1027+ (*fw_ptr)++;
1028+ remain--;
1029+
1030+ cmd = (struct hci_command_hdr *)(*fw_ptr);
1031+ *fw_ptr += sizeof(*cmd);
1032+ remain -= sizeof(*cmd);
1033+
1034+ /* Ensure that the remain firmware data is long enough than the length
1035+ * of command parameter. If not, the firmware file is corrupted.
1036+ */
1037+ if (remain < cmd->plen) {
1038+ BT_ERR("%s Intel fw corrupted: invalid cmd len", hdev->name);
1039+ return -EFAULT;
1040+ }
1041+
1042+ /* If there is a command that loads a patch in the firmware
1043+ * file, then enable the patch upon success, otherwise just
1044+ * disable the manufacturer mode, for example patch activation
1045+ * is not required when the default firmware patch file is used
1046+ * because there are no patch data to load.
1047+ */
1048+ if (*disable_patch && le16_to_cpu(cmd->opcode) == 0xfc8e)
1049+ *disable_patch = 0;
1050+
1051+ cmd_param = *fw_ptr;
1052+ *fw_ptr += cmd->plen;
1053+ remain -= cmd->plen;
1054+
1055+ /* This reads the expected events when the above command is sent to the
1056+ * device. Some vendor commands expects more than one events, for
1057+ * example command status event followed by vendor specific event.
1058+ * For this case, it only keeps the last expected event. so the command
1059+ * can be sent with __hci_cmd_sync_ev() which returns the sk_buff of
1060+ * last expected event.
1061+ */
1062+ while (remain > HCI_EVENT_HDR_SIZE && *fw_ptr[0] == 0x02) {
1063+ (*fw_ptr)++;
1064+ remain--;
1065+
1066+ evt = (struct hci_event_hdr *)(*fw_ptr);
1067+ *fw_ptr += sizeof(*evt);
1068+ remain -= sizeof(*evt);
1069+
1070+ if (remain < evt->plen) {
1071+ BT_ERR("%s Intel fw corrupted: invalid evt len",
1072+ hdev->name);
1073+ return -EFAULT;
1074+ }
1075+
1076+ evt_param = *fw_ptr;
1077+ *fw_ptr += evt->plen;
1078+ remain -= evt->plen;
1079+ }
1080+
1081+ /* Every HCI commands in the firmware file has its correspond event.
1082+ * If event is not found or remain is smaller than zero, the firmware
1083+ * file is corrupted.
1084+ */
1085+ if (!evt || !evt_param || remain < 0) {
1086+ BT_ERR("%s Intel fw corrupted: invalid evt read", hdev->name);
1087+ return -EFAULT;
1088+ }
1089+
1090+ skb = __hci_cmd_sync_ev(hdev, le16_to_cpu(cmd->opcode), cmd->plen,
1091+ cmd_param, evt->evt, HCI_INIT_TIMEOUT);
1092+ if (IS_ERR(skb)) {
1093+ BT_ERR("%s sending Intel patch command (0x%4.4x) failed (%ld)",
1094+ hdev->name, cmd->opcode, PTR_ERR(skb));
1095+ return -PTR_ERR(skb);
1096+ }
1097+
1098+ /* It ensures that the returned event matches the event data read from
1099+ * the firmware file. At fist, it checks the length and then
1100+ * the contents of the event.
1101+ */
1102+ if (skb->len != evt->plen) {
1103+ BT_ERR("%s mismatch event length (opcode 0x%4.4x)", hdev->name,
1104+ le16_to_cpu(cmd->opcode));
1105+ kfree_skb(skb);
1106+ return -EFAULT;
1107+ }
1108+
1109+ if (memcmp(skb->data, evt_param, evt->plen)) {
1110+ BT_ERR("%s mismatch event parameter (opcode 0x%4.4x)",
1111+ hdev->name, le16_to_cpu(cmd->opcode));
1112+ kfree_skb(skb);
1113+ return -EFAULT;
1114+ }
1115+ kfree_skb(skb);
1116+
1117+ return 0;
1118+}
1119+
1120+static int btusb_setup_intel(struct hci_dev *hdev)
1121+{
1122+ struct sk_buff *skb;
1123+ const struct firmware *fw;
1124+ const u8 *fw_ptr;
1125+ int disable_patch;
1126+ struct intel_version *ver;
1127+
1128+ const u8 mfg_enable[] = { 0x01, 0x00 };
1129+ const u8 mfg_disable[] = { 0x00, 0x00 };
1130+ const u8 mfg_reset_deactivate[] = { 0x00, 0x01 };
1131+ const u8 mfg_reset_activate[] = { 0x00, 0x02 };
1132+
1133+ BT_DBG("%s", hdev->name);
1134+
1135+ /* The controller has a bug with the first HCI command sent to it
1136+ * returning number of completed commands as zero. This would stall the
1137+ * command processing in the Bluetooth core.
1138+ *
1139+ * As a workaround, send HCI Reset command first which will reset the
1140+ * number of completed commands and allow normal command processing
1141+ * from now on.
1142+ */
1143+ skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
1144+ if (IS_ERR(skb)) {
1145+ BT_ERR("%s sending initial HCI reset command failed (%ld)",
1146+ hdev->name, PTR_ERR(skb));
1147+ return -PTR_ERR(skb);
1148+ }
1149+ kfree_skb(skb);
1150+
1151+ /* Read Intel specific controller version first to allow selection of
1152+ * which firmware file to load.
1153+ *
1154+ * The returned information are hardware variant and revision plus
1155+ * firmware variant, revision and build number.
1156+ */
1157+ skb = __hci_cmd_sync(hdev, 0xfc05, 0, NULL, HCI_INIT_TIMEOUT);
1158+ if (IS_ERR(skb)) {
1159+ BT_ERR("%s reading Intel fw version command failed (%ld)",
1160+ hdev->name, PTR_ERR(skb));
1161+ return -PTR_ERR(skb);
1162+ }
1163+
1164+ if (skb->len != sizeof(*ver)) {
1165+ BT_ERR("%s Intel version event length mismatch", hdev->name);
1166+ kfree_skb(skb);
1167+ return -EIO;
1168+ }
1169+
1170+ ver = (struct intel_version *)skb->data;
1171+ if (ver->status) {
1172+ BT_ERR("%s Intel fw version event failed (%02x)", hdev->name,
1173+ ver->status);
1174+ kfree_skb(skb);
1175+ return -bt_to_errno(ver->status);
1176+ }
1177+
1178+ BT_INFO("%s: read Intel version: %02x%02x%02x%02x%02x%02x%02x%02x%02x",
1179+ hdev->name, ver->hw_platform, ver->hw_variant,
1180+ ver->hw_revision, ver->fw_variant, ver->fw_revision,
1181+ ver->fw_build_num, ver->fw_build_ww, ver->fw_build_yy,
1182+ ver->fw_patch_num);
1183+
1184+ /* fw_patch_num indicates the version of patch the device currently
1185+ * have. If there is no patch data in the device, it is always 0x00.
1186+ * So, if it is other than 0x00, no need to patch the deivce again.
1187+ */
1188+ if (ver->fw_patch_num) {
1189+ BT_INFO("%s: Intel device is already patched. patch num: %02x",
1190+ hdev->name, ver->fw_patch_num);
1191+ kfree_skb(skb);
1192+ return 0;
1193+ }
1194+
1195+ /* Opens the firmware patch file based on the firmware version read
1196+ * from the controller. If it fails to open the matching firmware
1197+ * patch file, it tries to open the default firmware patch file.
1198+ * If no patch file is found, allow the device to operate without
1199+ * a patch.
1200+ */
1201+ fw = btusb_setup_intel_get_fw(hdev, ver);
1202+ if (!fw) {
1203+ kfree_skb(skb);
1204+ return 0;
1205+ }
1206+ fw_ptr = fw->data;
1207+
1208+ /* This Intel specific command enables the manufacturer mode of the
1209+ * controller.
1210+ *
1211+ * Only while this mode is enabled, the driver can download the
1212+ * firmware patch data and configuration parameters.
1213+ */
1214+ skb = __hci_cmd_sync(hdev, 0xfc11, 2, mfg_enable, HCI_INIT_TIMEOUT);
1215+ if (IS_ERR(skb)) {
1216+ BT_ERR("%s entering Intel manufacturer mode failed (%ld)",
1217+ hdev->name, PTR_ERR(skb));
1218+ release_firmware(fw);
1219+ return -PTR_ERR(skb);
1220+ }
1221+
1222+ if (skb->data[0]) {
1223+ u8 evt_status = skb->data[0];
1224+ BT_ERR("%s enable Intel manufacturer mode event failed (%02x)",
1225+ hdev->name, evt_status);
1226+ kfree_skb(skb);
1227+ release_firmware(fw);
1228+ return -bt_to_errno(evt_status);
1229+ }
1230+ kfree_skb(skb);
1231+
1232+ disable_patch = 1;
1233+
1234+ /* The firmware data file consists of list of Intel specific HCI
1235+ * commands and its expected events. The first byte indicates the
1236+ * type of the message, either HCI command or HCI event.
1237+ *
1238+ * It reads the command and its expected event from the firmware file,
1239+ * and send to the controller. Once __hci_cmd_sync_ev() returns,
1240+ * the returned event is compared with the event read from the firmware
1241+ * file and it will continue until all the messages are downloaded to
1242+ * the controller.
1243+ *
1244+ * Once the firmware patching is completed successfully,
1245+ * the manufacturer mode is disabled with reset and activating the
1246+ * downloaded patch.
1247+ *
1248+ * If the firmware patching fails, the manufacturer mode is
1249+ * disabled with reset and deactivating the patch.
1250+ *
1251+ * If the default patch file is used, no reset is done when disabling
1252+ * the manufacturer.
1253+ */
1254+ while (fw->size > fw_ptr - fw->data) {
1255+ int ret;
1256+
1257+ ret = btusb_setup_intel_patching(hdev, fw, &fw_ptr,
1258+ &disable_patch);
1259+ if (ret < 0)
1260+ goto exit_mfg_deactivate;
1261+ }
1262+
1263+ release_firmware(fw);
1264+
1265+ if (disable_patch)
1266+ goto exit_mfg_disable;
1267+
1268+ /* Patching completed successfully and disable the manufacturer mode
1269+ * with reset and activate the downloaded firmware patches.
1270+ */
1271+ skb = __hci_cmd_sync(hdev, 0xfc11, sizeof(mfg_reset_activate),
1272+ mfg_reset_activate, HCI_INIT_TIMEOUT);
1273+ if (IS_ERR(skb)) {
1274+ BT_ERR("%s exiting Intel manufacturer mode failed (%ld)",
1275+ hdev->name, PTR_ERR(skb));
1276+ return -PTR_ERR(skb);
1277+ }
1278+ kfree_skb(skb);
1279+
1280+ BT_INFO("%s: Intel Bluetooth firmware patch completed and activated",
1281+ hdev->name);
1282+
1283+ return 0;
1284+
1285+exit_mfg_disable:
1286+ /* Disable the manufacturer mode without reset */
1287+ skb = __hci_cmd_sync(hdev, 0xfc11, sizeof(mfg_disable), mfg_disable,
1288+ HCI_INIT_TIMEOUT);
1289+ if (IS_ERR(skb)) {
1290+ BT_ERR("%s exiting Intel manufacturer mode failed (%ld)",
1291+ hdev->name, PTR_ERR(skb));
1292+ return -PTR_ERR(skb);
1293+ }
1294+ kfree_skb(skb);
1295+
1296+ BT_INFO("%s: Intel Bluetooth firmware patch completed", hdev->name);
1297+ return 0;
1298+
1299+exit_mfg_deactivate:
1300+ release_firmware(fw);
1301+
1302+ /* Patching failed. Disable the manufacturer mode with reset and
1303+ * deactivate the downloaded firmware patches.
1304+ */
1305+ skb = __hci_cmd_sync(hdev, 0xfc11, sizeof(mfg_reset_deactivate),
1306+ mfg_reset_deactivate, HCI_INIT_TIMEOUT);
1307+ if (IS_ERR(skb)) {
1308+ BT_ERR("%s exiting Intel manufacturer mode failed (%ld)",
1309+ hdev->name, PTR_ERR(skb));
1310+ return -PTR_ERR(skb);
1311+ }
1312+ kfree_skb(skb);
1313+
1314+ BT_INFO("%s: Intel Bluetooth firmware patch completed and deactivated",
1315+ hdev->name);
1316+
1317+ return 0;
1318+}
1319+
9291320 static int btusb_probe(struct usb_interface *intf,
9301321 const struct usb_device_id *id)
9311322 {
@@ -1022,11 +1413,17 @@ static int btusb_probe(struct usb_interface *intf, · 90 unmodified lines
10221413
10231414 SET_HCIDEV_DEV(hdev, &intf->dev);
10241415
1025− hdev->open = btusb_open;
1026− hdev->close = btusb_close;
1027− hdev->flush = btusb_flush;
1028− hdev->send = btusb_send_frame;
1029− hdev->notify = btusb_notify;
1416+ hdev->open = btusb_open;
1417+ hdev->close = btusb_close;
1418+ hdev->flush = btusb_flush;
1419+ hdev->send = btusb_send_frame;
1420+ hdev->notify = btusb_notify;
1421+
1422+ if (id->driver_info & BTUSB_BCM92035)
1423+ hdev->setup = btusb_setup_bcm92035;
1424+
1425+ if (id->driver_info & BTUSB_INTEL)
1426+ hdev->setup = btusb_setup_intel;
10301427
10311428 /* Interface numbers are hardcoded in the specification */
10321429 data->isoc = usb_ifnum_to_if(data->udev, 1);
@@ -1065,17 +1462,6 @@ static int btusb_probe(struct usb_interface *intf, · 32 unmodified lines
10651462 data->isoc = NULL;
10661463 }
10671464
1068− if (id->driver_info & BTUSB_BCM92035) {
1069− unsigned char cmd[] = { 0x3b, 0xfc, 0x01, 0x00 };
1070− struct sk_buff *skb;
1071−
1072− skb = bt_skb_alloc(sizeof(cmd), GFP_KERNEL);
1073− if (skb) {
1074− memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));
1075− skb_queue_tail(&hdev->driver_init, skb);
1076− }
1077− }
1078−
10791465 if (data->isoc) {
10801466 err = usb_driver_claim_interface(&btusb_driver,
10811467 data->isoc, data);
drivers/bluetooth/hci_h4.c+3−0
@@ -153,6 +153,9 @@ static int h4_recv(struct hci_uart *hu, void *data, int count) · 152 unmodified lines
153153 {
154154 int ret;
155155
156+ if (!test_bit(HCI_UART_REGISTERED, &hu->flags))
157+ return -EUNATCH;
158+
156159 ret = hci_recv_stream_fragment(hu->hdev, data, count);
157160 if (ret < 0) {
158161 BT_ERR("Frame Reassembly Failed");
drivers/bluetooth/hci_ldisc.c+9−6
@@ -260,12 +260,12 @@ static int hci_uart_send_frame(struct sk_buff *skb) · 259 unmodified lines
260260
261261 /* ------ LDISC part ------ */
262262 /* hci_uart_tty_open
263− *
263+ *
264264 * Called when line discipline changed to HCI_UART.
265265 *
266266 * Arguments:
267267 * tty pointer to tty info structure
268− * Return Value:
268+ * Return Value:
269269 * 0 if success, otherwise error code
270270 */
271271 static int hci_uart_tty_open(struct tty_struct *tty)
@@ -365,15 +365,15 @@ static void hci_uart_tty_wakeup(struct tty_struct *tty) · 93 unmodified lines
365365 }
366366
367367 /* hci_uart_tty_receive()
368− *
368+ *
369369 * Called by tty low level driver when receive data is
370370 * available.
371− *
371+ *
372372 * Arguments: tty pointer to tty isntance data
373373 * data pointer to received data
374374 * flags pointer to flags for data
375375 * count count of received data in bytes
376− *
376+ *
377377 * Return Value: None
378378 */
379379 static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, char *flags, int count)
@@ -388,7 +388,10 @@ static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, char *f · 8 unmodified lines
388388
389389 spin_lock(&hu->rx_lock);
390390 hu->proto->recv(hu, (void *) data, count);
391− hu->hdev->stat.byte_rx += count;
391+
392+ if (hu->hdev)
393+ hu->hdev->stat.byte_rx += count;
394+
392395 spin_unlock(&hu->rx_lock);
393396
394397 tty_unthrottle(tty);
drivers/connector/cn_proc.c+25−0
@@ -232,6 +232,31 @@ void proc_comm_connector(struct task_struct *task) · 231 unmodified lines
232232 cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL);
233233 }
234234
235+void proc_coredump_connector(struct task_struct *task)
236+{
237+ struct cn_msg *msg;
238+ struct proc_event *ev;
239+ __u8 buffer[CN_PROC_MSG_SIZE];
240+ struct timespec ts;
241+
242+ if (atomic_read(&proc_event_num_listeners) < 1)
243+ return;
244+
245+ msg = (struct cn_msg *)buffer;
246+ ev = (struct proc_event *)msg->data;
247+ get_seq(&msg->seq, &ev->cpu);
248+ ktime_get_ts(&ts); /* get high res monotonic timestamp */
249+ put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
250+ ev->what = PROC_EVENT_COREDUMP;
251+ ev->event_data.coredump.process_pid = task->pid;
252+ ev->event_data.coredump.process_tgid = task->tgid;
253+
254+ memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
255+ msg->ack = 0; /* not used */
256+ msg->len = sizeof(*ev);
257+ cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL);
258+}
259+
235260 void proc_exit_connector(struct task_struct *task)
236261 {
237262 struct cn_msg *msg;
drivers/connector/connector.c+6−6
@@ -23,7 +23,7 @@ · 22 unmodified lines
2323 #include <linux/module.h>
2424 #include <linux/list.h>
2525 #include <linux/skbuff.h>
26−#include <linux/netlink.h>
26+#include <net/netlink.h>
2727 #include <linux/moduleparam.h>
2828 #include <linux/connector.h>
2929 #include <linux/slab.h>
@@ -95,13 +95,13 @@ int cn_netlink_send(struct cn_msg *msg, u32 __group, gfp_t gfp_mask) · 65 unmodified lines
9595 if (!netlink_has_listeners(dev->nls, group))
9696 return -ESRCH;
9797
98− size = NLMSG_SPACE(sizeof(*msg) + msg->len);
98+ size = sizeof(*msg) + msg->len;
9999
100− skb = alloc_skb(size, gfp_mask);
100+ skb = nlmsg_new(size, gfp_mask);
101101 if (!skb)
102102 return -ENOMEM;
103103
104− nlh = nlmsg_put(skb, 0, msg->seq, NLMSG_DONE, size - sizeof(*nlh), 0);
104+ nlh = nlmsg_put(skb, 0, msg->seq, NLMSG_DONE, size, 0);
105105 if (!nlh) {
106106 kfree_skb(skb);
107107 return -EMSGSIZE;
@@ -124,7 +124,7 @@ static int cn_call_callback(struct sk_buff *skb) · 16 unmodified lines
124124 {
125125 struct cn_callback_entry *i, *cbq = NULL;
126126 struct cn_dev *dev = &cdev;
127− struct cn_msg *msg = NLMSG_DATA(nlmsg_hdr(skb));
127+ struct cn_msg *msg = nlmsg_data(nlmsg_hdr(skb));
128128 struct netlink_skb_parms *nsp = &NETLINK_CB(skb);
129129 int err = -ENODEV;
130130
@@ -162,7 +162,7 @@ static void cn_rx_skb(struct sk_buff *__skb) · 31 unmodified lines
162162
163163 skb = skb_get(__skb);
164164
165− if (skb->len >= NLMSG_SPACE(0)) {
165+ if (skb->len >= NLMSG_HDRLEN) {
166166 nlh = nlmsg_hdr(skb);
167167
168168 if (nlh->nlmsg_len < sizeof(struct cn_msg) ||
drivers/dma/ioat/dca.c+8−3
@@ -470,8 +470,10 @@ struct dca_provider *ioat2_dca_init(struct pci_dev *pdev, void __iomem *iobase) · 469 unmodified lines
470470 }
471471
472472 if (!dca2_tag_map_valid(ioatdca->tag_map)) {
473− dev_err(&pdev->dev, "APICID_TAG_MAP set incorrectly by BIOS, "
474− "disabling DCA\n");
473+ WARN_TAINT_ONCE(1, TAINT_FIRMWARE_WORKAROUND,
474+ "%s %s: APICID_TAG_MAP set incorrectly by BIOS, disabling DCA\n",
475+ dev_driver_string(&pdev->dev),
476+ dev_name(&pdev->dev));
475477 free_dca_provider(dca);
476478 return NULL;
477479 }
@@ -689,7 +691,10 @@ struct dca_provider *ioat3_dca_init(struct pci_dev *pdev, void __iomem *iobase) · 211 unmodified lines
689691 }
690692
691693 if (dca3_tag_map_invalid(ioatdca->tag_map)) {
692− dev_err(&pdev->dev, "APICID_TAG_MAP set incorrectly by BIOS, disabling DCA\n");
694+ WARN_TAINT_ONCE(1, TAINT_FIRMWARE_WORKAROUND,
695+ "%s %s: APICID_TAG_MAP set incorrectly by BIOS, disabling DCA\n",
696+ dev_driver_string(&pdev->dev),
697+ dev_name(&pdev->dev));
693698 free_dca_provider(dca);
694699 return NULL;
695700 }
drivers/firewire/Kconfig+3−3
@@ -47,9 +47,9 @@ config FIREWIRE_NET · 46 unmodified lines
4747 tristate "IP networking over 1394"
4848 depends on FIREWIRE && INET
4949 help
50− This enables IPv4 over IEEE 1394, providing IP connectivity with
51− other implementations of RFC 2734 as found on several operating
52− systems. Multicast support is currently limited.
50+ This enables IPv4/IPv6 over IEEE 1394, providing IP connectivity
51+ with other implementations of RFC 2734/3146 as found on several
52+ operating systems. Multicast support is currently limited.
5353
5454 To compile this driver as a module, say M here: The module will be
5555 called firewire-net.
drivers/firewire/net.c+232−230
@@ -1,5 +1,6 @@
11 /*
22 * IPv4 over IEEE 1394, per RFC 2734
3+ * IPv6 over IEEE 1394, per RFC 3146
34 *
45 * Copyright (C) 2009 Jay Fenlason <fenlason@redhat.com>
56 *
@@ -28,6 +29,7 @@ · 22 unmodified lines
2829
2930 #include <asm/unaligned.h>
3031 #include <net/arp.h>
32+#include <net/firewire.h>
3133
3234 /* rx limits */
3335 #define FWNET_MAX_FRAGMENTS 30 /* arbitrary, > TX queue depth */
@@ -45,6 +47,7 @@ · 11 unmodified lines
4547
4648 #define IANA_SPECIFIER_ID 0x00005eU
4749 #define RFC2734_SW_VERSION 0x000001U
50+#define RFC3146_SW_VERSION 0x000002U
4851
4952 #define IEEE1394_GASP_HDR_SIZE 8
5053
@@ -57,32 +60,10 @@ · 6 unmodified lines
5760 #define RFC2374_HDR_LASTFRAG 2 /* last fragment */
5861 #define RFC2374_HDR_INTFRAG 3 /* interior fragment */
5962
60−#define RFC2734_HW_ADDR_LEN 16
61−
62−struct rfc2734_arp {
63− __be16 hw_type; /* 0x0018 */
64− __be16 proto_type; /* 0x0806 */
65− u8 hw_addr_len; /* 16 */
66− u8 ip_addr_len; /* 4 */
67− __be16 opcode; /* ARP Opcode */
68− /* Above is exactly the same format as struct arphdr */
69−
70− __be64 s_uniq_id; /* Sender's 64bit EUI */
71− u8 max_rec; /* Sender's max packet size */
72− u8 sspd; /* Sender's max speed */
73− __be16 fifo_hi; /* hi 16bits of sender's FIFO addr */
74− __be32 fifo_lo; /* lo 32bits of sender's FIFO addr */
75− __be32 sip; /* Sender's IP Address */
76− __be32 tip; /* IP Address of requested hw addr */
77−} __packed;
78−
79−/* This header format is specific to this driver implementation. */
80−#define FWNET_ALEN 8
81−#define FWNET_HLEN 10
82−struct fwnet_header {
83− u8 h_dest[FWNET_ALEN]; /* destination address */
84− __be16 h_proto; /* packet type ID field */
85−} __packed;
63+static bool fwnet_hwaddr_is_multicast(u8 *ha)
64+{
65+ return !!(*ha & 1);
66+}
8667
8768 /* IPv4 and IPv6 encapsulation header */
8869 struct rfc2734_header {
@@ -191,8 +172,6 @@ struct fwnet_peer { · 102 unmodified lines
191172 struct list_head peer_link;
192173 struct fwnet_device *dev;
193174 u64 guid;
194− u64 fifo;
195− __be32 ip;
196175
197176 /* guarded by dev->lock */
198177 struct list_head pd_list; /* received partial datagrams */
@@ -221,6 +200,15 @@ struct fwnet_packet_task { · 22 unmodified lines
221200 u8 enqueued;
222201 };
223202
203+/*
204+ * Get fifo address embedded in hwaddr
205+ */
206+static __u64 fwnet_hwaddr_fifo(union fwnet_hwaddr *ha)
207+{
208+ return (u64)get_unaligned_be16(&ha->uc.fifo_hi) << 32
209+ | get_unaligned_be32(&ha->uc.fifo_lo);
210+}
211+
224212 /*
225213 * saddr == NULL means use device source address.
226214 * daddr == NULL means leave destination address (eg unresolved arp).
@@ -513,10 +501,20 @@ static int fwnet_finish_incoming_packet(struct net_device *net, · 286 unmodified lines
513501 bool is_broadcast, u16 ether_type)
514502 {
515503 struct fwnet_device *dev;
516− static const __be64 broadcast_hw = cpu_to_be64(~0ULL);
517504 int status;
518505 __be64 guid;
519506
507+ switch (ether_type) {
508+ case ETH_P_ARP:
509+ case ETH_P_IP:
510+#if IS_ENABLED(CONFIG_IPV6)
511+ case ETH_P_IPV6:
512+#endif
513+ break;
514+ default:
515+ goto err;
516+ }
517+
520518 dev = netdev_priv(net);
521519 /* Write metadata, and then pass to the receive level */
522520 skb->dev = net;
@@ -524,92 +522,11 @@ static int fwnet_finish_incoming_packet(struct net_device *net, · 1 unmodified line
524522
525523 /*
526524 * Parse the encapsulation header. This actually does the job of
527− * converting to an ethernet frame header, as well as arp
528− * conversion if needed. ARP conversion is easier in this
529− * direction, since we are using ethernet as our backend.
525+ * converting to an ethernet-like pseudo frame header.
530526 */
531− /*
532− * If this is an ARP packet, convert it. First, we want to make
533− * use of some of the fields, since they tell us a little bit
534− * about the sending machine.
535− */
536− if (ether_type == ETH_P_ARP) {
537− struct rfc2734_arp *arp1394;
538− struct arphdr *arp;
539− unsigned char *arp_ptr;
540− u64 fifo_addr;
541− u64 peer_guid;
542− unsigned sspd;
543− u16 max_payload;
544− struct fwnet_peer *peer;
545− unsigned long flags;
546−
547− arp1394 = (struct rfc2734_arp *)skb->data;
548− arp = (struct arphdr *)skb->data;
549− arp_ptr = (unsigned char *)(arp + 1);
550− peer_guid = get_unaligned_be64(&arp1394->s_uniq_id);
551− fifo_addr = (u64)get_unaligned_be16(&arp1394->fifo_hi) << 32
552− | get_unaligned_be32(&arp1394->fifo_lo);
553−
554− sspd = arp1394->sspd;
555− /* Sanity check. OS X 10.3 PPC reportedly sends 131. */
556− if (sspd > SCODE_3200) {
557− dev_notice(&net->dev, "sspd %x out of range\n", sspd);
558− sspd = SCODE_3200;
559− }
560− max_payload = fwnet_max_payload(arp1394->max_rec, sspd);
561−
562− spin_lock_irqsave(&dev->lock, flags);
563− peer = fwnet_peer_find_by_guid(dev, peer_guid);
564− if (peer) {
565− peer->fifo = fifo_addr;
566−
567− if (peer->speed > sspd)
568− peer->speed = sspd;
569− if (peer->max_payload > max_payload)
570− peer->max_payload = max_payload;
571−
572− peer->ip = arp1394->sip;
573− }
574− spin_unlock_irqrestore(&dev->lock, flags);
575−
576− if (!peer) {
577− dev_notice(&net->dev,
578− "no peer for ARP packet from %016llx\n",
579− (unsigned long long)peer_guid);
580− goto no_peer;
581− }
582−
583− /*
584− * Now that we're done with the 1394 specific stuff, we'll
585− * need to alter some of the data. Believe it or not, all
586− * that needs to be done is sender_IP_address needs to be
587− * moved, the destination hardware address get stuffed
588− * in and the hardware address length set to 8.
589− *
590− * IMPORTANT: The code below overwrites 1394 specific data
591− * needed above so keep the munging of the data for the
592− * higher level IP stack last.
593− */
594−
595− arp->ar_hln = 8;
596− /* skip over sender unique id */
597− arp_ptr += arp->ar_hln;
598− /* move sender IP addr */
599− put_unaligned(arp1394->sip, (u32 *)arp_ptr);
600− /* skip over sender IP addr */
601− arp_ptr += arp->ar_pln;
602−
603− if (arp->ar_op == htons(ARPOP_REQUEST))
604− memset(arp_ptr, 0, sizeof(u64));
605− else
606− memcpy(arp_ptr, net->dev_addr, sizeof(u64));
607− }
608−
609− /* Now add the ethernet header. */
610527 guid = cpu_to_be64(dev->card->guid);
611528 if (dev_hard_header(skb, net, ether_type,
612− is_broadcast ? &broadcast_hw : &guid,
529+ is_broadcast ? net->broadcast : net->dev_addr,
613530 NULL, skb->len) >= 0) {
614531 struct fwnet_header *eth;
615532 u16 *rawp;
@@ -618,7 +535,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, · 2 unmodified lines
618535 skb_reset_mac_header(skb);
619536 skb_pull(skb, sizeof(*eth));
620537 eth = (struct fwnet_header *)skb_mac_header(skb);
621− if (*eth->h_dest & 1) {
538+ if (fwnet_hwaddr_is_multicast(eth->h_dest)) {
622539 if (memcmp(eth->h_dest, net->broadcast,
623540 net->addr_len) == 0)
624541 skb->pkt_type = PACKET_BROADCAST;
@@ -630,7 +547,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, · 5 unmodified lines
630547 if (memcmp(eth->h_dest, net->dev_addr, net->addr_len))
631548 skb->pkt_type = PACKET_OTHERHOST;
632549 }
633− if (ntohs(eth->h_proto) >= 1536) {
550+ if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN) {
634551 protocol = eth->h_proto;
635552 } else {
636553 rawp = (u16 *)skb->data;
@@ -652,7 +569,7 @@ static int fwnet_finish_incoming_packet(struct net_device *net, · 15 unmodified lines
652569
653570 return 0;
654571
655− no_peer:
572+ err:
656573 net->stats.rx_errors++;
657574 net->stats.rx_dropped++;
658575
@@ -856,7 +773,12 @@ static void fwnet_receive_broadcast(struct fw_iso_context *context, · 197 unmodified lines
856773 ver = be32_to_cpu(buf_ptr[1]) & 0xffffff;
857774 source_node_id = be32_to_cpu(buf_ptr[0]) >> 16;
858775
859− if (specifier_id == IANA_SPECIFIER_ID && ver == RFC2734_SW_VERSION) {
776+ if (specifier_id == IANA_SPECIFIER_ID &&
777+ (ver == RFC2734_SW_VERSION
778+#if IS_ENABLED(CONFIG_IPV6)
779+ || ver == RFC3146_SW_VERSION
780+#endif
781+ )) {
860782 buf_ptr += 2;
861783 length -= IEEE1394_GASP_HDR_SIZE;
862784 fwnet_incoming_packet(dev, buf_ptr, length, source_node_id,
@@ -1059,16 +981,27 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask) · 196 unmodified lines
1059981 u8 *p;
1060982 int generation;
1061983 int node_id;
984+ unsigned int sw_version;
1062985
1063986 /* ptask->generation may not have been set yet */
1064987 generation = dev->card->generation;
1065988 smp_rmb();
1066989 node_id = dev->card->node_id;
1067990
991+ switch (ptask->skb->protocol) {
992+ default:
993+ sw_version = RFC2734_SW_VERSION;
994+ break;
995+#if IS_ENABLED(CONFIG_IPV6)
996+ case htons(ETH_P_IPV6):
997+ sw_version = RFC3146_SW_VERSION;
998+#endif
999+ }
1000+
10681001 p = skb_push(ptask->skb, IEEE1394_GASP_HDR_SIZE);
10691002 put_unaligned_be32(node_id << 16 | IANA_SPECIFIER_ID >> 8, p);
10701003 put_unaligned_be32((IANA_SPECIFIER_ID & 0xff) << 24
1071− | RFC2734_SW_VERSION, &p[4]);
1004+ | sw_version, &p[4]);
10721005
10731006 /* We should not transmit if broadcast_channel.valid == 0. */
10741007 fw_send_request(dev->card, &ptask->transaction,
@@ -1116,6 +1049,62 @@ static int fwnet_send_packet(struct fwnet_packet_task *ptask) · 41 unmodified lines
11161049 return 0;
11171050 }
11181051
1052+static void fwnet_fifo_stop(struct fwnet_device *dev)
1053+{
1054+ if (dev->local_fifo == FWNET_NO_FIFO_ADDR)
1055+ return;
1056+
1057+ fw_core_remove_address_handler(&dev->handler);
1058+ dev->local_fifo = FWNET_NO_FIFO_ADDR;
1059+}
1060+
1061+static int fwnet_fifo_start(struct fwnet_device *dev)
1062+{
1063+ int retval;
1064+
1065+ if (dev->local_fifo != FWNET_NO_FIFO_ADDR)
1066+ return 0;
1067+
1068+ dev->handler.length = 4096;
1069+ dev->handler.address_callback = fwnet_receive_packet;
1070+ dev->handler.callback_data = dev;
1071+
1072+ retval = fw_core_add_address_handler(&dev->handler,
1073+ &fw_high_memory_region);
1074+ if (retval < 0)
1075+ return retval;
1076+
1077+ dev->local_fifo = dev->handler.offset;
1078+
1079+ return 0;
1080+}
1081+
1082+static void __fwnet_broadcast_stop(struct fwnet_device *dev)
1083+{
1084+ unsigned u;
1085+
1086+ if (dev->broadcast_state != FWNET_BROADCAST_ERROR) {
1087+ for (u = 0; u < FWNET_ISO_PAGE_COUNT; u++)
1088+ kunmap(dev->broadcast_rcv_buffer.pages[u]);
1089+ fw_iso_buffer_destroy(&dev->broadcast_rcv_buffer, dev->card);
1090+ }
1091+ if (dev->broadcast_rcv_context) {
1092+ fw_iso_context_destroy(dev->broadcast_rcv_context);
1093+ dev->broadcast_rcv_context = NULL;
1094+ }
1095+ kfree(dev->broadcast_rcv_buffer_ptrs);
1096+ dev->broadcast_rcv_buffer_ptrs = NULL;
1097+ dev->broadcast_state = FWNET_BROADCAST_ERROR;
1098+}
1099+
1100+static void fwnet_broadcast_stop(struct fwnet_device *dev)
1101+{
1102+ if (dev->broadcast_state == FWNET_BROADCAST_ERROR)
1103+ return;
1104+ fw_iso_context_stop(dev->broadcast_rcv_context);
1105+ __fwnet_broadcast_stop(dev);
1106+}
1107+
11191108 static int fwnet_broadcast_start(struct fwnet_device *dev)
11201109 {
11211110 struct fw_iso_context *context;
@@ -1124,60 +1113,47 @@ static int fwnet_broadcast_start(struct fwnet_device *dev) · 2 unmodified lines
11241113 unsigned max_receive;
11251114 struct fw_iso_packet packet;
11261115 unsigned long offset;
1116+ void **ptrptr;
11271117 unsigned u;
11281118
1129− if (dev->local_fifo == FWNET_NO_FIFO_ADDR) {
1130− dev->handler.length = 4096;
1131− dev->handler.address_callback = fwnet_receive_packet;
1132− dev->handler.callback_data = dev;
1133−
1134− retval = fw_core_add_address_handler(&dev->handler,
1135− &fw_high_memory_region);
1136− if (retval < 0)
1137− goto failed_initial;
1138−
1139− dev->local_fifo = dev->handler.offset;
1140− }
1119+ if (dev->broadcast_state != FWNET_BROADCAST_ERROR)
1120+ return 0;
11411121
11421122 max_receive = 1U << (dev->card->max_receive + 1);
11431123 num_packets = (FWNET_ISO_PAGE_COUNT * PAGE_SIZE) / max_receive;
11441124
1145− if (!dev->broadcast_rcv_context) {
1146− void **ptrptr;
1147−
1148− context = fw_iso_context_create(dev->card,
1149− FW_ISO_CONTEXT_RECEIVE, IEEE1394_BROADCAST_CHANNEL,
1150− dev->card->link_speed, 8, fwnet_receive_broadcast, dev);
1151− if (IS_ERR(context)) {
1152− retval = PTR_ERR(context);
1153− goto failed_context_create;
1154− }
1125+ ptrptr = kmalloc(sizeof(void *) * num_packets, GFP_KERNEL);
1126+ if (!ptrptr) {
1127+ retval = -ENOMEM;
1128+ goto failed;
1129+ }
1130+ dev->broadcast_rcv_buffer_ptrs = ptrptr;
1131+
1132+ context = fw_iso_context_create(dev->card, FW_ISO_CONTEXT_RECEIVE,
1133+ IEEE1394_BROADCAST_CHANNEL,
1134+ dev->card->link_speed, 8,
1135+ fwnet_receive_broadcast, dev);
1136+ if (IS_ERR(context)) {
1137+ retval = PTR_ERR(context);
1138+ goto failed;
1139+ }
11551140
1156− retval = fw_iso_buffer_init(&dev->broadcast_rcv_buffer,
1157− dev->card, FWNET_ISO_PAGE_COUNT, DMA_FROM_DEVICE);
1158− if (retval < 0)
1159− goto failed_buffer_init;
1141+ retval = fw_iso_buffer_init(&dev->broadcast_rcv_buffer, dev->card,
1142+ FWNET_ISO_PAGE_COUNT, DMA_FROM_DEVICE);
1143+ if (retval < 0)
1144+ goto failed;
11601145
1161− ptrptr = kmalloc(sizeof(void *) * num_packets, GFP_KERNEL);
1162− if (!ptrptr) {
1163− retval = -ENOMEM;
1164− goto failed_ptrs_alloc;
1165− }
1146+ dev->broadcast_state = FWNET_BROADCAST_STOPPED;
11661147
1167− dev->broadcast_rcv_buffer_ptrs = ptrptr;
1168− for (u = 0; u < FWNET_ISO_PAGE_COUNT; u++) {
1169− void *ptr;
1170− unsigned v;
1148+ for (u = 0; u < FWNET_ISO_PAGE_COUNT; u++) {
1149+ void *ptr;
1150+ unsigned v;
11711151
1172− ptr = kmap(dev->broadcast_rcv_buffer.pages[u]);
1173− for (v = 0; v < num_packets / FWNET_ISO_PAGE_COUNT; v++)
1174− *ptrptr++ = (void *)
1175− ((char *)ptr + v * max_receive);
1176− }
1177− dev->broadcast_rcv_context = context;
1178− } else {
1179− context = dev->broadcast_rcv_context;
1152+ ptr = kmap(dev->broadcast_rcv_buffer.pages[u]);
1153+ for (v = 0; v < num_packets / FWNET_ISO_PAGE_COUNT; v++)
1154+ *ptrptr++ = (void *) ((char *)ptr + v * max_receive);
11801155 }
1156+ dev->broadcast_rcv_context = context;
11811157
11821158 packet.payload_length = max_receive;
11831159 packet.interrupt = 1;
@@ -1191,7 +1167,7 @@ static int fwnet_broadcast_start(struct fwnet_device *dev) · 7 unmodified lines
11911167 retval = fw_iso_context_queue(context, &packet,
11921168 &dev->broadcast_rcv_buffer, offset);
11931169 if (retval < 0)
1194− goto failed_rcv_queue;
1170+ goto failed;
11951171
11961172 offset += max_receive;
11971173 }
@@ -1201,7 +1177,7 @@ static int fwnet_broadcast_start(struct fwnet_device *dev) · 3 unmodified lines
12011177 retval = fw_iso_context_start(context, -1, 0,
12021178 FW_ISO_CONTEXT_MATCH_ALL_TAGS); /* ??? sync */
12031179 if (retval < 0)
1204− goto failed_rcv_queue;
1180+ goto failed;
12051181
12061182 /* FIXME: adjust it according to the min. speed of all known peers? */
12071183 dev->broadcast_xmt_max_payload = IEEE1394_MAX_PAYLOAD_S100
@@ -1210,19 +1186,8 @@ static int fwnet_broadcast_start(struct fwnet_device *dev) · 2 unmodified lines
12101186
12111187 return 0;
12121188
1213− failed_rcv_queue:
1214− kfree(dev->broadcast_rcv_buffer_ptrs);
1215− dev->broadcast_rcv_buffer_ptrs = NULL;
1216− failed_ptrs_alloc:
1217− fw_iso_buffer_destroy(&dev->broadcast_rcv_buffer, dev->card);
1218− failed_buffer_init:
1219− fw_iso_context_destroy(context);
1220− dev->broadcast_rcv_context = NULL;
1221− failed_context_create:
1222− fw_core_remove_address_handler(&dev->handler);
1223− failed_initial:
1224− dev->local_fifo = FWNET_NO_FIFO_ADDR;
1225−
1189+ failed:
1190+ __fwnet_broadcast_stop(dev);
12261191 return retval;
12271192 }
12281193
@@ -1240,11 +1205,10 @@ static int fwnet_open(struct net_device *net) · 11 unmodified lines
12401205 struct fwnet_device *dev = netdev_priv(net);
12411206 int ret;
12421207
1243− if (dev->broadcast_state == FWNET_BROADCAST_ERROR) {
1244− ret = fwnet_broadcast_start(dev);
1245− if (ret)
1246− return ret;
1247− }
1208+ ret = fwnet_broadcast_start(dev);
1209+ if (ret)
1210+ return ret;
1211+
12481212 netif_start_queue(net);
12491213
12501214 spin_lock_irq(&dev->lock);
@@ -1257,9 +1221,10 @@ static int fwnet_open(struct net_device *net) · 6 unmodified lines
12571221 /* ifdown */
12581222 static int fwnet_stop(struct net_device *net)
12591223 {
1260− netif_stop_queue(net);
1224+ struct fwnet_device *dev = netdev_priv(net);
12611225
1262− /* Deallocate iso context for use by other applications? */
1226+ netif_stop_queue(net);
1227+ fwnet_broadcast_stop(dev);
12631228
12641229 return 0;
12651230 }
@@ -1299,19 +1264,27 @@ static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net) · 33 unmodified lines
12991264 * We might need to rebuild the header on tx failure.
13001265 */
13011266 memcpy(&hdr_buf, skb->data, sizeof(hdr_buf));
1302− skb_pull(skb, sizeof(hdr_buf));
1303−
13041267 proto = hdr_buf.h_proto;
1268+
1269+ switch (proto) {
1270+ case htons(ETH_P_ARP):
1271+ case htons(ETH_P_IP):
1272+#if IS_ENABLED(CONFIG_IPV6)
1273+ case htons(ETH_P_IPV6):
1274+#endif
1275+ break;
1276+ default:
1277+ goto fail;
1278+ }
1279+
1280+ skb_pull(skb, sizeof(hdr_buf));
13051281 dg_size = skb->len;
13061282
13071283 /*
13081284 * Set the transmission type for the packet. ARP packets and IP
13091285 * broadcast packets are sent via GASP.
13101286 */
1311− if (memcmp(hdr_buf.h_dest, net->broadcast, FWNET_ALEN) == 0
1312− || proto == htons(ETH_P_ARP)
1313− || (proto == htons(ETH_P_IP)
1314− && IN_MULTICAST(ntohl(ip_hdr(skb)->daddr)))) {
1287+ if (fwnet_hwaddr_is_multicast(hdr_buf.h_dest)) {
13151288 max_payload = dev->broadcast_xmt_max_payload;
13161289 datagram_label_ptr = &dev->broadcast_xmt_datagramlabel;
13171290
@@ -1320,11 +1293,12 @@ static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net) · 2 unmodified lines
13201293 ptask->dest_node = IEEE1394_ALL_NODES;
13211294 ptask->speed = SCODE_100;
13221295 } else {
1323− __be64 guid = get_unaligned((__be64 *)hdr_buf.h_dest);
1296+ union fwnet_hwaddr *ha = (union fwnet_hwaddr *)hdr_buf.h_dest;
1297+ __be64 guid = get_unaligned(&ha->uc.uniq_id);
13241298 u8 generation;
13251299
13261300 peer = fwnet_peer_find_by_guid(dev, be64_to_cpu(guid));
1327− if (!peer || peer->fifo == FWNET_NO_FIFO_ADDR)
1301+ if (!peer)
13281302 goto fail;
13291303
13301304 generation = peer->generation;
@@ -1332,32 +1306,12 @@ static netdev_tx_t fwnet_tx(struct sk_buff *skb, struct net_device *net) · 1 unmodified line
13321306 max_payload = peer->max_payload;
13331307 datagram_label_ptr = &peer->datagram_label;
13341308
1335− ptask->fifo_addr = peer->fifo;
1309+ ptask->fifo_addr = fwnet_hwaddr_fifo(ha);
13361310 ptask->generation = generation;
13371311 ptask->dest_node = dest_node;
13381312 ptask->speed = peer->speed;
13391313 }
13401314
1341− /* If this is an ARP packet, convert it */
1342− if (proto == htons(ETH_P_ARP)) {
1343− struct arphdr *arp = (struct arphdr *)skb->data;
1344− unsigned char *arp_ptr = (unsigned char *)(arp + 1);
1345− struct rfc2734_arp *arp1394 = (struct rfc2734_arp *)skb->data;
1346− __be32 ipaddr;
1347−
1348− ipaddr = get_unaligned((__be32 *)(arp_ptr + FWNET_ALEN));
1349−
1350− arp1394->hw_addr_len = RFC2734_HW_ADDR_LEN;
1351− arp1394->max_rec = dev->card->max_receive;
1352− arp1394->sspd = dev->card->link_speed;
1353−
1354− put_unaligned_be16(dev->local_fifo >> 32,
1355− &arp1394->fifo_hi);
1356− put_unaligned_be32(dev->local_fifo & 0xffffffff,
1357− &arp1394->fifo_lo);
1358− put_unaligned(ipaddr, &arp1394->sip);
1359− }
1360−
13611315 ptask->hdr.w0 = 0;
13621316 ptask->hdr.w1 = 0;
13631317 ptask->skb = skb;
@@ -1472,8 +1426,6 @@ static int fwnet_add_peer(struct fwnet_device *dev, · 108 unmodified lines
14721426
14731427 peer->dev = dev;
14741428 peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4];
1475− peer->fifo = FWNET_NO_FIFO_ADDR;
1476− peer->ip = 0;
14771429 INIT_LIST_HEAD(&peer->pd_list);
14781430 peer->pdg_size = 0;
14791431 peer->datagram_label = 0;
@@ -1503,6 +1455,7 @@ static int fwnet_probe(struct device *_dev) · 23 unmodified lines
15031455 struct fwnet_device *dev;
15041456 unsigned max_mtu;
15051457 int ret;
1458+ union fwnet_hwaddr *ha;
15061459
15071460 mutex_lock(&fwnet_device_mutex);
15081461
@@ -1533,6 +1486,11 @@ static int fwnet_probe(struct device *_dev) · 24 unmodified lines
15331486 dev->card = card;
15341487 dev->netdev = net;
15351488
1489+ ret = fwnet_fifo_start(dev);
1490+ if (ret < 0)
1491+ goto out;
1492+ dev->local_fifo = dev->handler.offset;
1493+
15361494 /*
15371495 * Use the RFC 2734 default 1500 octets or the maximum payload
15381496 * as initial MTU
@@ -1542,24 +1500,31 @@ static int fwnet_probe(struct device *_dev) · 3 unmodified lines
15421500 net->mtu = min(1500U, max_mtu);
15431501
15441502 /* Set our hardware address while we're at it */
1545− put_unaligned_be64(card->guid, net->dev_addr);
1546− put_unaligned_be64(~0ULL, net->broadcast);
1503+ ha = (union fwnet_hwaddr *)net->dev_addr;
1504+ put_unaligned_be64(card->guid, &ha->uc.uniq_id);
1505+ ha->uc.max_rec = dev->card->max_receive;
1506+ ha->uc.sspd = dev->card->link_speed;
1507+ put_unaligned_be16(dev->local_fifo >> 32, &ha->uc.fifo_hi);
1508+ put_unaligned_be32(dev->local_fifo & 0xffffffff, &ha->uc.fifo_lo);
1509+
1510+ memset(net->broadcast, -1, net->addr_len);
1511+
15471512 ret = register_netdev(net);
15481513 if (ret)
15491514 goto out;
15501515
15511516 list_add_tail(&dev->dev_link, &fwnet_device_list);
1552− dev_notice(&net->dev, "IPv4 over IEEE 1394 on card %s\n",
1517+ dev_notice(&net->dev, "IP over IEEE 1394 on card %s\n",
15531518 dev_name(card->device));
15541519 have_dev:
15551520 ret = fwnet_add_peer(dev, unit, device);
15561521 if (ret && allocated_netdev) {
15571522 unregister_netdev(net);
15581523 list_del(&dev->dev_link);
1559− }
15601524 out:
1561− if (ret && allocated_netdev)
1525+ fwnet_fifo_stop(dev);
15621526 free_netdev(net);
1527+ }
15631528
15641529 mutex_unlock(&fwnet_device_mutex);
15651530
@@ -1592,22 +1557,14 @@ static int fwnet_remove(struct device *_dev) · 26 unmodified lines
15921557 mutex_lock(&fwnet_device_mutex);
15931558
15941559 net = dev->netdev;
1595− if (net && peer->ip)
1596− arp_invalidate(net, peer->ip);
15971560
15981561 fwnet_remove_peer(peer, dev);
15991562
16001563 if (list_empty(&dev->peer_list)) {
16011564 unregister_netdev(net);
16021565
1603− if (dev->local_fifo != FWNET_NO_FIFO_ADDR)
1604− fw_core_remove_address_handler(&dev->handler);
1605− if (dev->broadcast_rcv_context) {
1606− fw_iso_context_stop(dev->broadcast_rcv_context);
1607− fw_iso_buffer_destroy(&dev->broadcast_rcv_buffer,
1608− dev->card);
1609− fw_iso_context_destroy(dev->broadcast_rcv_context);
1610− }
1566+ fwnet_fifo_stop(dev);
1567+
16111568 for (i = 0; dev->queued_datagrams && i < 5; i++)
16121569 ssleep(1);
16131570 WARN_ON(dev->queued_datagrams);
@@ -1646,6 +1603,14 @@ static const struct ieee1394_device_id fwnet_id_table[] = { · 32 unmodified lines
16461603 .specifier_id = IANA_SPECIFIER_ID,
16471604 .version = RFC2734_SW_VERSION,
16481605 },
1606+#if IS_ENABLED(CONFIG_IPV6)
1607+ {
1608+ .match_flags = IEEE1394_MATCH_SPECIFIER_ID |
1609+ IEEE1394_MATCH_VERSION,
1610+ .specifier_id = IANA_SPECIFIER_ID,
1611+ .version = RFC3146_SW_VERSION,
1612+ },
1613+#endif
16491614 { }
16501615 };
16511616
@@ -1683,6 +1648,30 @@ static struct fw_descriptor rfc2374_unit_directory = { · 31 unmodified lines
16831648 .data = rfc2374_unit_directory_data
16841649 };
16851650
1651+#if IS_ENABLED(CONFIG_IPV6)
1652+static const u32 rfc3146_unit_directory_data[] = {
1653+ 0x00040000, /* directory_length */
1654+ 0x1200005e, /* unit_specifier_id: IANA */
1655+ 0x81000003, /* textual descriptor offset */
1656+ 0x13000002, /* unit_sw_version: RFC 3146 */
1657+ 0x81000005, /* textual descriptor offset */
1658+ 0x00030000, /* descriptor_length */
1659+ 0x00000000, /* text */
1660+ 0x00000000, /* minimal ASCII, en */
1661+ 0x49414e41, /* I A N A */
1662+ 0x00030000, /* descriptor_length */
1663+ 0x00000000, /* text */
1664+ 0x00000000, /* minimal ASCII, en */
1665+ 0x49507636, /* I P v 6 */
1666+};
1667+
1668+static struct fw_descriptor rfc3146_unit_directory = {
1669+ .length = ARRAY_SIZE(rfc3146_unit_directory_data),
1670+ .key = (CSR_DIRECTORY | CSR_UNIT) << 24,
1671+ .data = rfc3146_unit_directory_data
1672+};
1673+#endif
1674+
16861675 static int __init fwnet_init(void)
16871676 {
16881677 int err;
@@ -1691,11 +1680,17 @@ static int __init fwnet_init(void) · 2 unmodified lines
16911680 if (err)
16921681 return err;
16931682
1683+#if IS_ENABLED(CONFIG_IPV6)
1684+ err = fw_core_add_descriptor(&rfc3146_unit_directory);
1685+ if (err)
1686+ goto out;
1687+#endif
1688+
16941689 fwnet_packet_task_cache = kmem_cache_create("packet_task",
16951690 sizeof(struct fwnet_packet_task), 0, 0, NULL);
16961691 if (!fwnet_packet_task_cache) {
16971692 err = -ENOMEM;
1698− goto out;
1693+ goto out2;
16991694 }
17001695
17011696 err = driver_register(&fwnet_driver.driver);
@@ -1703,7 +1698,11 @@ static int __init fwnet_init(void) · 1 unmodified line
17031698 return 0;
17041699
17051700 kmem_cache_destroy(fwnet_packet_task_cache);
1701+out2:
1702+#if IS_ENABLED(CONFIG_IPV6)
1703+ fw_core_remove_descriptor(&rfc3146_unit_directory);
17061704 out:
1705+#endif
17071706 fw_core_remove_descriptor(&rfc2374_unit_directory);
17081707
17091708 return err;
@@ -1714,11 +1713,14 @@ static void __exit fwnet_cleanup(void) · 4 unmodified lines
17141713 {
17151714 driver_unregister(&fwnet_driver.driver);
17161715 kmem_cache_destroy(fwnet_packet_task_cache);
1716+#if IS_ENABLED(CONFIG_IPV6)
1717+ fw_core_remove_descriptor(&rfc3146_unit_directory);
1718+#endif
17171719 fw_core_remove_descriptor(&rfc2374_unit_directory);
17181720 }
17191721 module_exit(fwnet_cleanup);
17201722
17211723 MODULE_AUTHOR("Jay Fenlason <fenlason@redhat.com>");
1722−MODULE_DESCRIPTION("IPv4 over IEEE1394 as per RFC 2734");
1724+MODULE_DESCRIPTION("IP over IEEE1394 as per RFC 2734/3146");
17231725 MODULE_LICENSE("GPL");
17241726 MODULE_DEVICE_TABLE(ieee1394, fwnet_id_table);
drivers/infiniband/hw/cxgb4/cm.c+49−19
@@ -511,12 +511,16 @@ static unsigned int select_ntuple(struct c4iw_dev *dev, struct dst_entry *dst, · 510 unmodified lines
511511 static int send_connect(struct c4iw_ep *ep)
512512 {
513513 struct cpl_act_open_req *req;
514+ struct cpl_t5_act_open_req *t5_req;
514515 struct sk_buff *skb;
515516 u64 opt0;
516517 u32 opt2;
517518 unsigned int mtu_idx;
518519 int wscale;
519− int wrlen = roundup(sizeof *req, 16);
520+ int size = is_t4(ep->com.dev->rdev.lldi.adapter_type) ?
521+ sizeof(struct cpl_act_open_req) :
522+ sizeof(struct cpl_t5_act_open_req);
523+ int wrlen = roundup(size, 16);
520524
521525 PDBG("%s ep %p atid %u\n", __func__, ep, ep->atid);
522526
@@ -552,17 +556,36 @@ static int send_connect(struct c4iw_ep *ep) · 29 unmodified lines
552556 opt2 |= WND_SCALE_EN(1);
553557 t4_set_arp_err_handler(skb, NULL, act_open_req_arp_failure);
554558
555− req = (struct cpl_act_open_req *) skb_put(skb, wrlen);
556− INIT_TP_WR(req, 0);
557− OPCODE_TID(req) = cpu_to_be32(
558− MK_OPCODE_TID(CPL_ACT_OPEN_REQ, ((ep->rss_qid<<14)|ep->atid)));
559− req->local_port = ep->com.local_addr.sin_port;
560− req->peer_port = ep->com.remote_addr.sin_port;
561− req->local_ip = ep->com.local_addr.sin_addr.s_addr;
562− req->peer_ip = ep->com.remote_addr.sin_addr.s_addr;
563− req->opt0 = cpu_to_be64(opt0);
564− req->params = cpu_to_be32(select_ntuple(ep->com.dev, ep->dst, ep->l2t));
565− req->opt2 = cpu_to_be32(opt2);
559+ if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) {
560+ req = (struct cpl_act_open_req *) skb_put(skb, wrlen);
561+ INIT_TP_WR(req, 0);
562+ OPCODE_TID(req) = cpu_to_be32(
563+ MK_OPCODE_TID(CPL_ACT_OPEN_REQ,
564+ ((ep->rss_qid << 14) | ep->atid)));
565+ req->local_port = ep->com.local_addr.sin_port;
566+ req->peer_port = ep->com.remote_addr.sin_port;
567+ req->local_ip = ep->com.local_addr.sin_addr.s_addr;
568+ req->peer_ip = ep->com.remote_addr.sin_addr.s_addr;
569+ req->opt0 = cpu_to_be64(opt0);
570+ req->params = cpu_to_be32(select_ntuple(ep->com.dev,
571+ ep->dst, ep->l2t));
572+ req->opt2 = cpu_to_be32(opt2);
573+ } else {
574+ t5_req = (struct cpl_t5_act_open_req *) skb_put(skb, wrlen);
575+ INIT_TP_WR(t5_req, 0);
576+ OPCODE_TID(t5_req) = cpu_to_be32(
577+ MK_OPCODE_TID(CPL_ACT_OPEN_REQ,
578+ ((ep->rss_qid << 14) | ep->atid)));
579+ t5_req->local_port = ep->com.local_addr.sin_port;
580+ t5_req->peer_port = ep->com.remote_addr.sin_port;
581+ t5_req->local_ip = ep->com.local_addr.sin_addr.s_addr;
582+ t5_req->peer_ip = ep->com.remote_addr.sin_addr.s_addr;
583+ t5_req->opt0 = cpu_to_be64(opt0);
584+ t5_req->params = cpu_to_be64(V_FILTER_TUPLE(
585+ select_ntuple(ep->com.dev, ep->dst, ep->l2t)));
586+ t5_req->opt2 = cpu_to_be32(opt2);
587+ }
588+
566589 set_bit(ACT_OPEN_REQ, &ep->com.history);
567590 return c4iw_l2t_send(&ep->com.dev->rdev, skb, ep->l2t);
568591 }
@@ -1676,9 +1699,9 @@ static int act_open_rpl(struct c4iw_dev *dev, struct sk_buff *skb) · 1107 unmodified lines
16761699 case CPL_ERR_CONN_TIMEDOUT:
16771700 break;
16781701 case CPL_ERR_TCAM_FULL:
1702+ dev->rdev.stats.tcam_full++;
16791703 if (dev->rdev.lldi.enable_fw_ofld_conn) {
16801704 mutex_lock(&dev->rdev.stats.lock);
1681− dev->rdev.stats.tcam_full++;
16821705 mutex_unlock(&dev->rdev.stats.lock);
16831706 send_fw_act_open_req(ep,
16841707 GET_TID_TID(GET_AOPEN_ATID(
@@ -2875,12 +2898,14 @@ static int deferred_fw6_msg(struct c4iw_dev *dev, struct sk_buff *skb) · 1190 unmodified lines
28752898 static void build_cpl_pass_accept_req(struct sk_buff *skb, int stid , u8 tos)
28762899 {
28772900 u32 l2info;
2878− u16 vlantag, len, hdr_len;
2901+ u16 vlantag, len, hdr_len, eth_hdr_len;
28792902 u8 intf;
28802903 struct cpl_rx_pkt *cpl = cplhdr(skb);
28812904 struct cpl_pass_accept_req *req;
28822905 struct tcp_options_received tmp_opt;
2906+ struct c4iw_dev *dev;
28832907
2908+ dev = *((struct c4iw_dev **) (skb->cb + sizeof(void *)));
28842909 /* Store values from cpl_rx_pkt in temporary location. */
28852910 vlantag = (__force u16) cpl->vlan;
28862911 len = (__force u16) cpl->len;
@@ -2896,7 +2921,7 @@ static void build_cpl_pass_accept_req(struct sk_buff *skb, int stid , u8 tos) · 9 unmodified lines
28962921 */
28972922 memset(&tmp_opt, 0, sizeof(tmp_opt));
28982923 tcp_clear_options(&tmp_opt);
2899− tcp_parse_options(skb, &tmp_opt, NULL, 0, NULL);
2924+ tcp_parse_options(skb, &tmp_opt, 0, NULL);
29002925
29012926 req = (struct cpl_pass_accept_req *)__skb_push(skb, sizeof(*req));
29022927 memset(req, 0, sizeof(*req));
@@ -2904,14 +2929,16 @@ static void build_cpl_pass_accept_req(struct sk_buff *skb, int stid , u8 tos) · 1 unmodified line
29042929 V_SYN_MAC_IDX(G_RX_MACIDX(
29052930 (__force int) htonl(l2info))) |
29062931 F_SYN_XACT_MATCH);
2932+ eth_hdr_len = is_t4(dev->rdev.lldi.adapter_type) ?
2933+ G_RX_ETHHDR_LEN((__force int) htonl(l2info)) :
2934+ G_RX_T5_ETHHDR_LEN((__force int) htonl(l2info));
29072935 req->hdr_len = cpu_to_be32(V_SYN_RX_CHAN(G_RX_CHAN(
29082936 (__force int) htonl(l2info))) |
29092937 V_TCP_HDR_LEN(G_RX_TCPHDR_LEN(
29102938 (__force int) htons(hdr_len))) |
29112939 V_IP_HDR_LEN(G_RX_IPHDR_LEN(
29122940 (__force int) htons(hdr_len))) |
2913− V_ETH_HDR_LEN(G_RX_ETHHDR_LEN(
2914− (__force int) htonl(l2info))));
2941+ V_ETH_HDR_LEN(G_RX_ETHHDR_LEN(eth_hdr_len)));
29152942 req->vlan = (__force __be16) vlantag;
29162943 req->len = (__force __be16) len;
29172944 req->tos_stid = cpu_to_be32(PASS_OPEN_TID(stid) |
@@ -2999,7 +3026,7 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb) · 81 unmodified lines
29993026 u16 window;
30003027 struct port_info *pi;
30013028 struct net_device *pdev;
3002− u16 rss_qid;
3029+ u16 rss_qid, eth_hdr_len;
30033030 int step;
30043031 u32 tx_chan;
30053032 struct neighbour *neigh;
@@ -3028,7 +3055,10 @@ static int rx_pkt(struct c4iw_dev *dev, struct sk_buff *skb) · 22 unmodified lines
30283055 goto reject;
30293056 }
30303057
3031− if (G_RX_ETHHDR_LEN(ntohl(cpl->l2info)) == ETH_HLEN) {
3058+ eth_hdr_len = is_t4(dev->rdev.lldi.adapter_type) ?
3059+ G_RX_ETHHDR_LEN(htonl(cpl->l2info)) :
3060+ G_RX_T5_ETHHDR_LEN(htonl(cpl->l2info));
3061+ if (eth_hdr_len == ETH_HLEN) {
30323062 eh = (struct ethhdr *)(req + 1);
30333063 iph = (struct iphdr *)(eh + 1);
30343064 } else {
drivers/infiniband/hw/cxgb4/device.c+30−4
@@ -41,10 +41,20 @@ · 40 unmodified lines
4141 #define DRV_VERSION "0.1"
4242
4343 MODULE_AUTHOR("Steve Wise");
44−MODULE_DESCRIPTION("Chelsio T4 RDMA Driver");
44+MODULE_DESCRIPTION("Chelsio T4/T5 RDMA Driver");
4545 MODULE_LICENSE("Dual BSD/GPL");
4646 MODULE_VERSION(DRV_VERSION);
4747
48+static int allow_db_fc_on_t5;
49+module_param(allow_db_fc_on_t5, int, 0644);
50+MODULE_PARM_DESC(allow_db_fc_on_t5,
51+ "Allow DB Flow Control on T5 (default = 0)");
52+
53+static int allow_db_coalescing_on_t5;
54+module_param(allow_db_coalescing_on_t5, int, 0644);
55+MODULE_PARM_DESC(allow_db_coalescing_on_t5,
56+ "Allow DB Coalescing on T5 (default = 0)");
57+
4858 struct uld_ctx {
4959 struct list_head entry;
5060 struct cxgb4_lld_info lldi;
@@ -614,7 +624,7 @@ static int rdma_supported(const struct cxgb4_lld_info *infop) · 563 unmodified lines
614624 {
615625 return infop->vr->stag.size > 0 && infop->vr->pbl.size > 0 &&
616626 infop->vr->rq.size > 0 && infop->vr->qp.size > 0 &&
617− infop->vr->cq.size > 0 && infop->vr->ocq.size > 0;
627+ infop->vr->cq.size > 0;
618628 }
619629
620630 static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)
@@ -627,6 +637,22 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop) · 6 unmodified lines
627637 pci_name(infop->pdev));
628638 return ERR_PTR(-ENOSYS);
629639 }
640+ if (!ocqp_supported(infop))
641+ pr_info("%s: On-Chip Queues not supported on this device.\n",
642+ pci_name(infop->pdev));
643+
644+ if (!is_t4(infop->adapter_type)) {
645+ if (!allow_db_fc_on_t5) {
646+ db_fc_threshold = 100000;
647+ pr_info("DB Flow Control Disabled.\n");
648+ }
649+
650+ if (!allow_db_coalescing_on_t5) {
651+ db_coalescing_threshold = -1;
652+ pr_info("DB Coalescing Disabled.\n");
653+ }
654+ }
655+
630656 devp = (struct c4iw_dev *)ib_alloc_device(sizeof(*devp));
631657 if (!devp) {
632658 printk(KERN_ERR MOD "Cannot allocate ib device\n");
@@ -678,8 +704,8 @@ static void *c4iw_uld_add(const struct cxgb4_lld_info *infop) · 45 unmodified lines
678704 int i;
679705
680706 if (!vers_printed++)
681− printk(KERN_INFO MOD "Chelsio T4 RDMA Driver - version %s\n",
682− DRV_VERSION);
707+ pr_info("Chelsio T4/T5 RDMA Driver - version %s\n",
708+ DRV_VERSION);
683709
684710 ctx = kzalloc(sizeof *ctx, GFP_KERNEL);
685711 if (!ctx) {
drivers/infiniband/hw/cxgb4/iw_cxgb4.h+12−2
@@ -162,7 +162,7 @@ static inline int c4iw_num_stags(struct c4iw_rdev *rdev) · 161 unmodified lines
162162 return min((int)T4_MAX_NUM_STAG, (int)(rdev->lldi.vr->stag.size >> 5));
163163 }
164164
165−#define C4IW_WR_TO (10*HZ)
165+#define C4IW_WR_TO (30*HZ)
166166
167167 struct c4iw_wr_wait {
168168 struct completion completion;
@@ -369,7 +369,6 @@ struct c4iw_fr_page_list { · 200 unmodified lines
369369 DEFINE_DMA_UNMAP_ADDR(mapping);
370370 dma_addr_t dma_addr;
371371 struct c4iw_dev *dev;
372− int size;
373372 };
374373
375374 static inline struct c4iw_fr_page_list *to_c4iw_fr_page_list(
@@ -817,6 +816,15 @@ static inline int compute_wscale(int win) · 441 unmodified lines
817816 return wscale;
818817 }
819818
819+static inline int ocqp_supported(const struct cxgb4_lld_info *infop)
820+{
821+#if defined(__i386__) || defined(__x86_64__) || defined(CONFIG_PPC64)
822+ return infop->vr->ocq.size > 0;
823+#else
824+ return 0;
825+#endif
826+}
827+
820828 u32 c4iw_id_alloc(struct c4iw_id_table *alloc);
821829 void c4iw_id_free(struct c4iw_id_table *alloc, u32 obj);
822830 int c4iw_id_table_alloc(struct c4iw_id_table *alloc, u32 start, u32 num,
@@ -930,6 +938,8 @@ extern struct cxgb4_client t4c_client; · 107 unmodified lines
930938 extern c4iw_handler_func c4iw_handlers[NUM_CPL_CMDS];
931939 extern int c4iw_max_read_depth;
932940 extern int db_fc_threshold;
941+extern int db_coalescing_threshold;
942+extern int use_dsgl;
933943
934944
935945 #endif
drivers/infiniband/hw/cxgb4/mem.c+144−11
@@ -30,16 +30,76 @@ · 29 unmodified lines
3030 * SOFTWARE.
3131 */
3232
33+#include <linux/module.h>
34+#include <linux/moduleparam.h>
3335 #include <rdma/ib_umem.h>
3436 #include <linux/atomic.h>
3537
3638 #include "iw_cxgb4.h"
3739
40+int use_dsgl = 1;
41+module_param(use_dsgl, int, 0644);
42+MODULE_PARM_DESC(use_dsgl, "Use DSGL for PBL/FastReg (default=1)");
43+
3844 #define T4_ULPTX_MIN_IO 32
3945 #define C4IW_MAX_INLINE_SIZE 96
46+#define T4_ULPTX_MAX_DMA 1024
47+#define C4IW_INLINE_THRESHOLD 128
4048
41−static int write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len,
42− void *data)
49+static int inline_threshold = C4IW_INLINE_THRESHOLD;
50+module_param(inline_threshold, int, 0644);
51+MODULE_PARM_DESC(inline_threshold, "inline vs dsgl threshold (default=128)");
52+
53+static int _c4iw_write_mem_dma_aligned(struct c4iw_rdev *rdev, u32 addr,
54+ u32 len, dma_addr_t data, int wait)
55+{
56+ struct sk_buff *skb;
57+ struct ulp_mem_io *req;
58+ struct ulptx_sgl *sgl;
59+ u8 wr_len;
60+ int ret = 0;
61+ struct c4iw_wr_wait wr_wait;
62+
63+ addr &= 0x7FFFFFF;
64+
65+ if (wait)
66+ c4iw_init_wr_wait(&wr_wait);
67+ wr_len = roundup(sizeof(*req) + sizeof(*sgl), 16);
68+
69+ skb = alloc_skb(wr_len, GFP_KERNEL | __GFP_NOFAIL);
70+ if (!skb)
71+ return -ENOMEM;
72+ set_wr_txq(skb, CPL_PRIORITY_CONTROL, 0);
73+
74+ req = (struct ulp_mem_io *)__skb_put(skb, wr_len);
75+ memset(req, 0, wr_len);
76+ INIT_ULPTX_WR(req, wr_len, 0, 0);
77+ req->wr.wr_hi = cpu_to_be32(FW_WR_OP(FW_ULPTX_WR) |
78+ (wait ? FW_WR_COMPL(1) : 0));
79+ req->wr.wr_lo = wait ? (__force __be64)&wr_wait : 0;
80+ req->wr.wr_mid = cpu_to_be32(FW_WR_LEN16(DIV_ROUND_UP(wr_len, 16)));
81+ req->cmd = cpu_to_be32(ULPTX_CMD(ULP_TX_MEM_WRITE));
82+ req->cmd |= cpu_to_be32(V_T5_ULP_MEMIO_ORDER(1));
83+ req->dlen = cpu_to_be32(ULP_MEMIO_DATA_LEN(len>>5));
84+ req->len16 = cpu_to_be32(DIV_ROUND_UP(wr_len-sizeof(req->wr), 16));
85+ req->lock_addr = cpu_to_be32(ULP_MEMIO_ADDR(addr));
86+
87+ sgl = (struct ulptx_sgl *)(req + 1);
88+ sgl->cmd_nsge = cpu_to_be32(ULPTX_CMD(ULP_TX_SC_DSGL) |
89+ ULPTX_NSGE(1));
90+ sgl->len0 = cpu_to_be32(len);
91+ sgl->addr0 = cpu_to_be64(data);
92+
93+ ret = c4iw_ofld_send(rdev, skb);
94+ if (ret)
95+ return ret;
96+ if (wait)
97+ ret = c4iw_wait_for_reply(rdev, &wr_wait, 0, 0, __func__);
98+ return ret;
99+}
100+
101+static int _c4iw_write_mem_inline(struct c4iw_rdev *rdev, u32 addr, u32 len,
102+ void *data)
43103 {
44104 struct sk_buff *skb;
45105 struct ulp_mem_io *req;
@@ -47,6 +107,12 @@ static int write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len, · 1 unmodified line
47107 u8 wr_len, *to_dp, *from_dp;
48108 int copy_len, num_wqe, i, ret = 0;
49109 struct c4iw_wr_wait wr_wait;
110+ __be32 cmd = cpu_to_be32(ULPTX_CMD(ULP_TX_MEM_WRITE));
111+
112+ if (is_t4(rdev->lldi.adapter_type))
113+ cmd |= cpu_to_be32(ULP_MEMIO_ORDER(1));
114+ else
115+ cmd |= cpu_to_be32(V_T5_ULP_MEMIO_IMM(1));
50116
51117 addr &= 0x7FFFFFF;
52118 PDBG("%s addr 0x%x len %u\n", __func__, addr, len);
@@ -77,7 +143,7 @@ static int write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len, · 24 unmodified lines
77143 req->wr.wr_mid = cpu_to_be32(
78144 FW_WR_LEN16(DIV_ROUND_UP(wr_len, 16)));
79145
80− req->cmd = cpu_to_be32(ULPTX_CMD(ULP_TX_MEM_WRITE) | (1<<23));
146+ req->cmd = cmd;
81147 req->dlen = cpu_to_be32(ULP_MEMIO_DATA_LEN(
82148 DIV_ROUND_UP(copy_len, T4_ULPTX_MIN_IO)));
83149 req->len16 = cpu_to_be32(DIV_ROUND_UP(wr_len-sizeof(req->wr),
@@ -107,6 +173,67 @@ static int write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len, · 23 unmodified lines
107173 return ret;
108174 }
109175
176+int _c4iw_write_mem_dma(struct c4iw_rdev *rdev, u32 addr, u32 len, void *data)
177+{
178+ u32 remain = len;
179+ u32 dmalen;
180+ int ret = 0;
181+ dma_addr_t daddr;
182+ dma_addr_t save;
183+
184+ daddr = dma_map_single(&rdev->lldi.pdev->dev, data, len, DMA_TO_DEVICE);
185+ if (dma_mapping_error(&rdev->lldi.pdev->dev, daddr))
186+ return -1;
187+ save = daddr;
188+
189+ while (remain > inline_threshold) {
190+ if (remain < T4_ULPTX_MAX_DMA) {
191+ if (remain & ~T4_ULPTX_MIN_IO)
192+ dmalen = remain & ~(T4_ULPTX_MIN_IO-1);
193+ else
194+ dmalen = remain;
195+ } else
196+ dmalen = T4_ULPTX_MAX_DMA;
197+ remain -= dmalen;
198+ ret = _c4iw_write_mem_dma_aligned(rdev, addr, dmalen, daddr,
199+ !remain);
200+ if (ret)
201+ goto out;
202+ addr += dmalen >> 5;
203+ data += dmalen;
204+ daddr += dmalen;
205+ }
206+ if (remain)
207+ ret = _c4iw_write_mem_inline(rdev, addr, remain, data);
208+out:
209+ dma_unmap_single(&rdev->lldi.pdev->dev, save, len, DMA_TO_DEVICE);
210+ return ret;
211+}
212+
213+/*
214+ * write len bytes of data into addr (32B aligned address)
215+ * If data is NULL, clear len byte of memory to zero.
216+ */
217+static int write_adapter_mem(struct c4iw_rdev *rdev, u32 addr, u32 len,
218+ void *data)
219+{
220+ if (is_t5(rdev->lldi.adapter_type) && use_dsgl) {
221+ if (len > inline_threshold) {
222+ if (_c4iw_write_mem_dma(rdev, addr, len, data)) {
223+ printk_ratelimited(KERN_WARNING
224+ "%s: dma map"
225+ " failure (non fatal)\n",
226+ pci_name(rdev->lldi.pdev));
227+ return _c4iw_write_mem_inline(rdev, addr, len,
228+ data);
229+ } else
230+ return 0;
231+ } else
232+ return _c4iw_write_mem_inline(rdev, addr, len, data);
233+ } else
234+ return _c4iw_write_mem_inline(rdev, addr, len, data);
235+}
236+
110237 /*
111238 * Build and write a TPT entry.
112239 * IN: stag key, pdid, perm, bind_enabled, zbva, to, len, page_size,
@@ -760,19 +887,23 @@ struct ib_fast_reg_page_list *c4iw_alloc_fastreg_pbl(struct ib_device *device, · 647 unmodified lines
760887 struct c4iw_fr_page_list *c4pl;
761888 struct c4iw_dev *dev = to_c4iw_dev(device);
762889 dma_addr_t dma_addr;
763− int size = sizeof *c4pl + page_list_len * sizeof(u64);
890+ int pll_len = roundup(page_list_len * sizeof(u64), 32);
764891
765− c4pl = dma_alloc_coherent(&dev->rdev.lldi.pdev->dev, size,
766− &dma_addr, GFP_KERNEL);
892+ c4pl = kmalloc(sizeof(*c4pl), GFP_KERNEL);
767893 if (!c4pl)
768894 return ERR_PTR(-ENOMEM);
769895
896+ c4pl->ibpl.page_list = dma_alloc_coherent(&dev->rdev.lldi.pdev->dev,
897+ pll_len, &dma_addr,
898+ GFP_KERNEL);
899+ if (!c4pl->ibpl.page_list) {
900+ kfree(c4pl);
901+ return ERR_PTR(-ENOMEM);
902+ }
770903 dma_unmap_addr_set(c4pl, mapping, dma_addr);
771904 c4pl->dma_addr = dma_addr;
772905 c4pl->dev = dev;
773− c4pl->size = size;
774− c4pl->ibpl.page_list = (u64 *)(c4pl + 1);
775− c4pl->ibpl.max_page_list_len = page_list_len;
906+ c4pl->ibpl.max_page_list_len = pll_len;
776907
777908 return &c4pl->ibpl;
778909 }
@@ -781,8 +912,10 @@ void c4iw_free_fastreg_pbl(struct ib_fast_reg_page_list *ibpl) · 2 unmodified lines
781912 {
782913 struct c4iw_fr_page_list *c4pl = to_c4iw_fr_page_list(ibpl);
783914
784− dma_free_coherent(&c4pl->dev->rdev.lldi.pdev->dev, c4pl->size,
785− c4pl, dma_unmap_addr(c4pl, mapping));
915+ dma_free_coherent(&c4pl->dev->rdev.lldi.pdev->dev,
916+ c4pl->ibpl.max_page_list_len,
917+ c4pl->ibpl.page_list, dma_unmap_addr(c4pl, mapping));
918+ kfree(c4pl);
786919 }
787920
788921 int c4iw_dereg_mr(struct ib_mr *ib_mr)
drivers/infiniband/hw/cxgb4/provider.c+11−4
@@ -162,8 +162,14 @@ static int c4iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) · 161 unmodified lines
162162 */
163163 if (addr >= rdev->oc_mw_pa)
164164 vma->vm_page_prot = t4_pgprot_wc(vma->vm_page_prot);
165− else
166− vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
165+ else {
166+ if (is_t5(rdev->lldi.adapter_type))
167+ vma->vm_page_prot =
168+ t4_pgprot_wc(vma->vm_page_prot);
169+ else
170+ vma->vm_page_prot =
171+ pgprot_noncached(vma->vm_page_prot);
172+ }
167173 ret = io_remap_pfn_range(vma, vma->vm_start,
168174 addr >> PAGE_SHIFT,
169175 len, vma->vm_page_prot);
@@ -263,7 +269,7 @@ static int c4iw_query_device(struct ib_device *ibdev, · 93 unmodified lines
263269 dev = to_c4iw_dev(ibdev);
264270 memset(props, 0, sizeof *props);
265271 memcpy(&props->sys_image_guid, dev->rdev.lldi.ports[0]->dev_addr, 6);
266− props->hw_ver = dev->rdev.lldi.adapter_type;
272+ props->hw_ver = CHELSIO_CHIP_RELEASE(dev->rdev.lldi.adapter_type);
267273 props->fw_ver = dev->rdev.lldi.fw_vers;
268274 props->device_cap_flags = dev->device_cap_flags;
269275 props->page_size_cap = T4_PAGESIZE_MASK;
@@ -346,7 +352,8 @@ static ssize_t show_rev(struct device *dev, struct device_attribute *attr, · 76 unmodified lines
346352 struct c4iw_dev *c4iw_dev = container_of(dev, struct c4iw_dev,
347353 ibdev.dev);
348354 PDBG("%s dev 0x%p\n", __func__, dev);
349− return sprintf(buf, "%d\n", c4iw_dev->rdev.lldi.adapter_type);
355+ return sprintf(buf, "%d\n",
356+ CHELSIO_CHIP_RELEASE(c4iw_dev->rdev.lldi.adapter_type));
350357 }
351358
352359 static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr,
drivers/infiniband/hw/cxgb4/qp.c+77−36
@@ -42,10 +42,21 @@ static int ocqp_support = 1; · 41 unmodified lines
4242 module_param(ocqp_support, int, 0644);
4343 MODULE_PARM_DESC(ocqp_support, "Support on-chip SQs (default=1)");
4444
45−int db_fc_threshold = 2000;
45+int db_fc_threshold = 1000;
4646 module_param(db_fc_threshold, int, 0644);
47−MODULE_PARM_DESC(db_fc_threshold, "QP count/threshold that triggers automatic "
48− "db flow control mode (default = 2000)");
47+MODULE_PARM_DESC(db_fc_threshold,
48+ "QP count/threshold that triggers"
49+ " automatic db flow control mode (default = 1000)");
50+
51+int db_coalescing_threshold;
52+module_param(db_coalescing_threshold, int, 0644);
53+MODULE_PARM_DESC(db_coalescing_threshold,
54+ "QP count/threshold that triggers"
55+ " disabling db coalescing (default = 0)");
56+
57+static int max_fr_immd = T4_MAX_FR_IMMD;
58+module_param(max_fr_immd, int, 0644);
59+MODULE_PARM_DESC(max_fr_immd, "fastreg threshold for using DSGL instead of immedate");
4960
5061 static void set_state(struct c4iw_qp *qhp, enum c4iw_qp_state state)
5162 {
@@ -76,7 +87,7 @@ static void dealloc_sq(struct c4iw_rdev *rdev, struct t4_sq *sq) · 24 unmodified lines
7687
7788 static int alloc_oc_sq(struct c4iw_rdev *rdev, struct t4_sq *sq)
7889 {
79− if (!ocqp_support || !t4_ocqp_supported())
90+ if (!ocqp_support || !ocqp_supported(&rdev->lldi))
8091 return -ENOSYS;
8192 sq->dma_addr = c4iw_ocqp_pool_alloc(rdev, sq->memsize);
8293 if (!sq->dma_addr)
@@ -129,7 +140,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, · 46 unmodified lines
129140 int wr_len;
130141 struct c4iw_wr_wait wr_wait;
131142 struct sk_buff *skb;
132− int ret;
143+ int ret = 0;
133144 int eqsize;
134145
135146 wq->sq.qid = c4iw_get_qpid(rdev, uctx);
@@ -169,17 +180,14 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq, · 33 unmodified lines
169180 }
170181
171182 if (user) {
172− ret = alloc_oc_sq(rdev, &wq->sq);
173− if (ret)
183+ if (alloc_oc_sq(rdev, &wq->sq) && alloc_host_sq(rdev, &wq->sq))
174184 goto free_hwaddr;
175−
176− ret = alloc_host_sq(rdev, &wq->sq);
177− if (ret)
178− goto free_sq;
179− } else
185+ } else {
180186 ret = alloc_host_sq(rdev, &wq->sq);
181187 if (ret)
182188 goto free_hwaddr;
189+ }
190+
183191 memset(wq->sq.queue, 0, wq->sq.memsize);
184192 dma_unmap_addr_set(&wq->sq, mapping, wq->sq.dma_addr);
185193
@@ -534,7 +542,7 @@ static int build_rdma_recv(struct c4iw_qp *qhp, union t4_recv_wr *wqe, · 348 unmodified lines
534542 }
535543
536544 static int build_fastreg(struct t4_sq *sq, union t4_wr *wqe,
537− struct ib_send_wr *wr, u8 *len16)
545+ struct ib_send_wr *wr, u8 *len16, u8 t5dev)
538546 {
539547
540548 struct fw_ri_immd *imdp;
@@ -556,28 +564,51 @@ static int build_fastreg(struct t4_sq *sq, union t4_wr *wqe, · 15 unmodified lines
556564 wqe->fr.va_hi = cpu_to_be32(wr->wr.fast_reg.iova_start >> 32);
557565 wqe->fr.va_lo_fbo = cpu_to_be32(wr->wr.fast_reg.iova_start &
558566 0xffffffff);
559− WARN_ON(pbllen > T4_MAX_FR_IMMD);
560− imdp = (struct fw_ri_immd *)(&wqe->fr + 1);
561− imdp->op = FW_RI_DATA_IMMD;
562− imdp->r1 = 0;
563− imdp->r2 = 0;
564− imdp->immdlen = cpu_to_be32(pbllen);
565− p = (__be64 *)(imdp + 1);
566− rem = pbllen;
567− for (i = 0; i < wr->wr.fast_reg.page_list_len; i++) {
568− *p = cpu_to_be64((u64)wr->wr.fast_reg.page_list->page_list[i]);
569− rem -= sizeof *p;
570− if (++p == (__be64 *)&sq->queue[sq->size])
571− p = (__be64 *)sq->queue;
572− }
573− BUG_ON(rem < 0);
574− while (rem) {
575− *p = 0;
576− rem -= sizeof *p;
577− if (++p == (__be64 *)&sq->queue[sq->size])
578− p = (__be64 *)sq->queue;
567+
568+ if (t5dev && use_dsgl && (pbllen > max_fr_immd)) {
569+ struct c4iw_fr_page_list *c4pl =
570+ to_c4iw_fr_page_list(wr->wr.fast_reg.page_list);
571+ struct fw_ri_dsgl *sglp;
572+
573+ for (i = 0; i < wr->wr.fast_reg.page_list_len; i++) {
574+ wr->wr.fast_reg.page_list->page_list[i] = (__force u64)
575+ cpu_to_be64((u64)
576+ wr->wr.fast_reg.page_list->page_list[i]);
577+ }
578+
579+ sglp = (struct fw_ri_dsgl *)(&wqe->fr + 1);
580+ sglp->op = FW_RI_DATA_DSGL;
581+ sglp->r1 = 0;
582+ sglp->nsge = cpu_to_be16(1);
583+ sglp->addr0 = cpu_to_be64(c4pl->dma_addr);
584+ sglp->len0 = cpu_to_be32(pbllen);
585+
586+ *len16 = DIV_ROUND_UP(sizeof(wqe->fr) + sizeof(*sglp), 16);
587+ } else {
588+ imdp = (struct fw_ri_immd *)(&wqe->fr + 1);
589+ imdp->op = FW_RI_DATA_IMMD;
590+ imdp->r1 = 0;
591+ imdp->r2 = 0;
592+ imdp->immdlen = cpu_to_be32(pbllen);
593+ p = (__be64 *)(imdp + 1);
594+ rem = pbllen;
595+ for (i = 0; i < wr->wr.fast_reg.page_list_len; i++) {
596+ *p = cpu_to_be64(
597+ (u64)wr->wr.fast_reg.page_list->page_list[i]);
598+ rem -= sizeof(*p);
599+ if (++p == (__be64 *)&sq->queue[sq->size])
600+ p = (__be64 *)sq->queue;
601+ }
602+ BUG_ON(rem < 0);
603+ while (rem) {
604+ *p = 0;
605+ rem -= sizeof(*p);
606+ if (++p == (__be64 *)&sq->queue[sq->size])
607+ p = (__be64 *)sq->queue;
608+ }
609+ *len16 = DIV_ROUND_UP(sizeof(wqe->fr) + sizeof(*imdp)
610+ + pbllen, 16);
579611 }
580− *len16 = DIV_ROUND_UP(sizeof wqe->fr + sizeof *imdp + pbllen, 16);
581612 return 0;
582613 }
583614
@@ -678,7 +709,10 @@ int c4iw_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, · 94 unmodified lines
678709 case IB_WR_FAST_REG_MR:
679710 fw_opcode = FW_RI_FR_NSMR_WR;
680711 swsqe->opcode = FW_RI_FAST_REGISTER;
681− err = build_fastreg(&qhp->wq.sq, wqe, wr, &len16);
712+ err = build_fastreg(&qhp->wq.sq, wqe, wr, &len16,
713+ is_t5(
714+ qhp->rhp->rdev.lldi.adapter_type) ?
715+ 1 : 0);
682716 break;
683717 case IB_WR_LOCAL_INV:
684718 if (wr->send_flags & IB_SEND_FENCE)
@@ -1450,6 +1484,9 @@ int c4iw_destroy_qp(struct ib_qp *ib_qp) · 765 unmodified lines
14501484 rhp->db_state = NORMAL;
14511485 idr_for_each(&rhp->qpidr, enable_qp_db, NULL);
14521486 }
1487+ if (db_coalescing_threshold >= 0)
1488+ if (rhp->qpcnt <= db_coalescing_threshold)
1489+ cxgb4_enable_db_coalescing(rhp->rdev.lldi.ports[0]);
14531490 spin_unlock_irq(&rhp->lock);
14541491 atomic_dec(&qhp->refcnt);
14551492 wait_event(qhp->wait, !atomic_read(&qhp->refcnt));
@@ -1561,11 +1598,15 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs, · 105 unmodified lines
15611598 spin_lock_irq(&rhp->lock);
15621599 if (rhp->db_state != NORMAL)
15631600 t4_disable_wq_db(&qhp->wq);
1564− if (++rhp->qpcnt > db_fc_threshold && rhp->db_state == NORMAL) {
1601+ rhp->qpcnt++;
1602+ if (rhp->qpcnt > db_fc_threshold && rhp->db_state == NORMAL) {
15651603 rhp->rdev.stats.db_state_transitions++;
15661604 rhp->db_state = FLOW_CONTROL;
15671605 idr_for_each(&rhp->qpidr, disable_qp_db, NULL);
15681606 }
1607+ if (db_coalescing_threshold >= 0)
1608+ if (rhp->qpcnt > db_coalescing_threshold)
1609+ cxgb4_disable_db_coalescing(rhp->rdev.lldi.ports[0]);
15691610 ret = insert_handle_nolock(rhp, &rhp->qpidr, qhp, qhp->wq.sq.qid);
15701611 spin_unlock_irq(&rhp->lock);
15711612 if (ret)
drivers/infiniband/hw/cxgb4/t4.h+1−10
@@ -84,7 +84,7 @@ struct t4_status_page { · 83 unmodified lines
8484 sizeof(struct fw_ri_isgl)) / sizeof(struct fw_ri_sge))
8585 #define T4_MAX_FR_IMMD ((T4_SQ_NUM_BYTES - sizeof(struct fw_ri_fr_nsmr_wr) - \
8686 sizeof(struct fw_ri_immd)) & ~31UL)
87−#define T4_MAX_FR_DEPTH (T4_MAX_FR_IMMD / sizeof(u64))
87+#define T4_MAX_FR_DEPTH (1024 / sizeof(u64))
8888
8989 #define T4_RQ_NUM_SLOTS 2
9090 #define T4_RQ_NUM_BYTES (T4_EQ_ENTRY_SIZE * T4_RQ_NUM_SLOTS)
@@ -280,15 +280,6 @@ static inline pgprot_t t4_pgprot_wc(pgprot_t prot) · 189 unmodified lines
280280 #endif
281281 }
282282
283−static inline int t4_ocqp_supported(void)
284−{
285−#if defined(__i386__) || defined(__x86_64__) || defined(CONFIG_PPC64)
286− return 1;
287−#else
288− return 0;
289−#endif
290−}
291−
292283 enum {
293284 T4_SQ_ONCHIP = (1<<0),
294285 };
drivers/infiniband/hw/mlx4/cq.c+1−1
@@ -228,7 +228,7 @@ struct ib_cq *mlx4_ib_create_cq(struct ib_device *ibdev, int entries, int vector · 227 unmodified lines
228228 vector = dev->eq_table[vector % ibdev->num_comp_vectors];
229229
230230 err = mlx4_cq_alloc(dev->dev, entries, &cq->buf.mtt, uar,
231− cq->db.dma, &cq->mcq, vector, 0);
231+ cq->db.dma, &cq->mcq, vector, 0, 0);
232232 if (err)
233233 goto err_dbmap;
234234
drivers/infiniband/hw/nes/nes_hw.c+1−1
@@ -2948,7 +2948,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct nes_hw_nic_cq *cq) · 2947 unmodified lines
29482948 nes_debug(NES_DBG_CQ, "%s: Reporting stripped VLAN packet. Tag = 0x%04X\n",
29492949 nesvnic->netdev->name, vlan_tag);
29502950
2951− __vlan_hwaccel_put_tag(rx_skb, vlan_tag);
2951+ __vlan_hwaccel_put_tag(rx_skb, htons(ETH_P_8021Q), vlan_tag);
29522952 }
29532953 if (nes_use_lro)
29542954 lro_receive_skb(&nesvnic->lro_mgr, rx_skb, NULL);
drivers/infiniband/hw/nes/nes_nic.c+7−7
@@ -1599,7 +1599,7 @@ static void nes_vlan_mode(struct net_device *netdev, struct nes_device *nesdev, · 1598 unmodified lines
15991599
16001600 /* Enable/Disable VLAN Stripping */
16011601 u32temp = nes_read_indexed(nesdev, NES_IDX_PCIX_DIAG);
1602− if (features & NETIF_F_HW_VLAN_RX)
1602+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
16031603 u32temp &= 0xfdffffff;
16041604 else
16051605 u32temp |= 0x02000000;
@@ -1614,10 +1614,10 @@ static netdev_features_t nes_fix_features(struct net_device *netdev, netdev_feat · 8 unmodified lines
16141614 * Since there is no support for separate rx/tx vlan accel
16151615 * enable/disable make sure tx flag is always in same state as rx.
16161616 */
1617− if (features & NETIF_F_HW_VLAN_RX)
1618− features |= NETIF_F_HW_VLAN_TX;
1617+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
1618+ features |= NETIF_F_HW_VLAN_CTAG_TX;
16191619 else
1620− features &= ~NETIF_F_HW_VLAN_TX;
1620+ features &= ~NETIF_F_HW_VLAN_CTAG_TX;
16211621
16221622 return features;
16231623 }
@@ -1628,7 +1628,7 @@ static int nes_set_features(struct net_device *netdev, netdev_features_t feature · 4 unmodified lines
16281628 struct nes_device *nesdev = nesvnic->nesdev;
16291629 u32 changed = netdev->features ^ features;
16301630
1631− if (changed & NETIF_F_HW_VLAN_RX)
1631+ if (changed & NETIF_F_HW_VLAN_CTAG_RX)
16321632 nes_vlan_mode(netdev, nesdev, features);
16331633
16341634 return 0;
@@ -1706,11 +1706,11 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev, · 71 unmodified lines
17061706 netdev->dev_addr[4] = (u8)(u64temp>>8);
17071707 netdev->dev_addr[5] = (u8)u64temp;
17081708
1709− netdev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_RX;
1709+ netdev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_RX;
17101710 if ((nesvnic->logical_port < 2) || (nesdev->nesadapter->hw_rev != NE020_REV))
17111711 netdev->hw_features |= NETIF_F_TSO;
17121712
1713− netdev->features = netdev->hw_features | NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_TX;
1713+ netdev->features = netdev->hw_features | NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_CTAG_TX;
17141714 netdev->hw_features |= NETIF_F_LRO;
17151715
17161716 nes_debug(NES_DBG_INIT, "nesvnic = %p, reported features = 0x%lX, QPid = %d,"
drivers/infiniband/ulp/ipoib/ipoib_main.c+3−1
@@ -730,7 +730,8 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) · 729 unmodified lines
730730 if ((header->proto != htons(ETH_P_IP)) &&
731731 (header->proto != htons(ETH_P_IPV6)) &&
732732 (header->proto != htons(ETH_P_ARP)) &&
733− (header->proto != htons(ETH_P_RARP))) {
733+ (header->proto != htons(ETH_P_RARP)) &&
734+ (header->proto != htons(ETH_P_TIPC))) {
734735 /* ethertype not supported by IPoIB */
735736 ++dev->stats.tx_dropped;
736737 dev_kfree_skb_any(skb);
@@ -751,6 +752,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) · 14 unmodified lines
751752 switch (header->proto) {
752753 case htons(ETH_P_IP):
753754 case htons(ETH_P_IPV6):
755+ case htons(ETH_P_TIPC):
754756 neigh = ipoib_neigh_get(dev, cb->hwaddr);
755757 if (unlikely(!neigh)) {
756758 neigh_add_path(skb, cb->hwaddr, dev);
drivers/isdn/capi/capidrv.c+1−2
@@ -469,8 +469,7 @@ static int capidrv_add_ack(struct capidrv_ncci *nccip, · 468 unmodified lines
469469 {
470470 struct ncci_datahandle_queue *n, **pp;
471471
472− n = (struct ncci_datahandle_queue *)
473− kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
472+ n = kmalloc(sizeof(struct ncci_datahandle_queue), GFP_ATOMIC);
474473 if (!n) {
475474 printk(KERN_ERR "capidrv: kmalloc ncci_datahandle failed\n");
476475 return -1;
drivers/isdn/divert/isdn_divert.c+3−5
@@ -441,8 +441,7 @@ static int isdn_divert_icall(isdn_ctrl *ic) · 440 unmodified lines
441441
442442 switch (dv->rule.action) {
443443 case DEFLECT_IGNORE:
444− return (0);
445− break;
444+ return 0;
446445
447446 case DEFLECT_ALERT:
448447 case DEFLECT_PROCEED:
@@ -510,10 +509,9 @@ static int isdn_divert_icall(isdn_ctrl *ic) · 61 unmodified lines
510509 break;
511510
512511 default:
513− return (0); /* ignore call */
514− break;
512+ return 0; /* ignore call */
515513 } /* switch action */
516− break;
514+ break; /* will break the 'for' looping */
517515 } /* scan_table */
518516
519517 if (cs) {
drivers/isdn/hisax/fsm.c+1−1
@@ -26,7 +26,7 @@ FsmNew(struct Fsm *fsm, struct FsmNode *fnlist, int fncount) · 25 unmodified lines
2626 {
2727 int i;
2828
29− fsm->jumpmatrix = (FSMFNPTR *)
29+ fsm->jumpmatrix =
3030 kzalloc(sizeof(FSMFNPTR) * fsm->state_count * fsm->event_count, GFP_KERNEL);
3131 if (!fsm->jumpmatrix)
3232 return -ENOMEM;
drivers/isdn/hisax/hfc_sx.c+1−1
@@ -1479,7 +1479,7 @@ int setup_hfcsx(struct IsdnCard *card) · 1478 unmodified lines
14791479 release_region(cs->hw.hfcsx.base, 2);
14801480 return (0);
14811481 }
1482− if (!(cs->hw.hfcsx.extra = (void *)
1482+ if (!(cs->hw.hfcsx.extra =
14831483 kmalloc(sizeof(struct hfcsx_extra), GFP_ATOMIC))) {
14841484 release_region(cs->hw.hfcsx.base, 2);
14851485 printk(KERN_WARNING "HFC-SX: unable to allocate memory\n");
drivers/isdn/i4l/isdn_net.c+1−1
@@ -1385,7 +1385,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev) · 1384 unmodified lines
13851385 if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN))
13861386 skb->pkt_type = PACKET_OTHERHOST;
13871387 }
1388− if (ntohs(eth->h_proto) >= 1536)
1388+ if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
13891389 return eth->h_proto;
13901390
13911391 rawp = skb->data;
drivers/isdn/mISDN/socket.c+1−0
@@ -578,6 +578,7 @@ data_sock_getname(struct socket *sock, struct sockaddr *addr, · 577 unmodified lines
578578 lock_sock(sk);
579579
580580 *addr_len = sizeof(*maddr);
581+ maddr->family = AF_ISDN;
581582 maddr->dev = _pms(sk)->dev->id;
582583 maddr->channel = _pms(sk)->ch.nr;
583584 maddr->sapi = _pms(sk)->ch.addr & 0xff;
drivers/isdn/sc/init.c+2−2
@@ -33,8 +33,8 @@ static unsigned long ram[] = {0, 0, 0, 0}; · 32 unmodified lines
3333 static bool do_reset = 0;
3434
3535 module_param_array(io, int, NULL, 0);
36−module_param_array(irq, int, NULL, 0);
37−module_param_array(ram, int, NULL, 0);
36+module_param_array(irq, byte, NULL, 0);
37+module_param_array(ram, long, NULL, 0);
3838 module_param(do_reset, bool, 0);
3939
4040 static int identify_board(unsigned long, unsigned int);
drivers/media/dvb-core/dvb_net.c+5−5
@@ -185,7 +185,7 @@ static __be16 dvb_net_eth_type_trans(struct sk_buff *skb, · 184 unmodified lines
185185 skb->pkt_type=PACKET_MULTICAST;
186186 }
187187
188− if (ntohs(eth->h_proto) >= 1536)
188+ if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)
189189 return eth->h_proto;
190190
191191 rawp = skb->data;
@@ -228,9 +228,9 @@ static int ule_test_sndu( struct dvb_net_priv *p ) · 36 unmodified lines
228228 static int ule_bridged_sndu( struct dvb_net_priv *p )
229229 {
230230 struct ethhdr *hdr = (struct ethhdr*) p->ule_next_hdr;
231− if(ntohs(hdr->h_proto) < 1536) {
231+ if(ntohs(hdr->h_proto) < ETH_P_802_3_MIN) {
232232 int framelen = p->ule_sndu_len - ((p->ule_next_hdr+sizeof(struct ethhdr)) - p->ule_skb->data);
233− /* A frame Type < 1536 for a bridged frame, introduces a LLC Length field. */
233+ /* A frame Type < ETH_P_802_3_MIN for a bridged frame, introduces a LLC Length field. */
234234 if(framelen != ntohs(hdr->h_proto)) {
235235 return -1;
236236 }
@@ -320,7 +320,7 @@ static int handle_ule_extensions( struct dvb_net_priv *p ) · 83 unmodified lines
320320 (int) p->ule_sndu_type, l, total_ext_len);
321321 #endif
322322
323− } while (p->ule_sndu_type < 1536);
323+ } while (p->ule_sndu_type < ETH_P_802_3_MIN);
324324
325325 return total_ext_len;
326326 }
@@ -712,7 +712,7 @@ static void dvb_net_ule( struct net_device *dev, const u8 *buf, size_t buf_len ) · 385 unmodified lines
712712 }
713713
714714 /* Handle ULE Extension Headers. */
715− if (priv->ule_sndu_type < 1536) {
715+ if (priv->ule_sndu_type < ETH_P_802_3_MIN) {
716716 /* There is an extension header. Handle it accordingly. */
717717 int l = handle_ule_extensions(priv);
718718 if (l < 0) {
drivers/net/Kconfig+1−0
@@ -151,6 +151,7 @@ config MACVTAP · 150 unmodified lines
151151 config VXLAN
152152 tristate "Virtual eXtensible Local Area Network (VXLAN)"
153153 depends on INET
154+ select NET_IP_TUNNEL
154155 ---help---
155156 This allows one to create vxlan virtual interfaces that provide
156157 Layer 2 Networks over Layer 3 Networks. VXLAN is often used
drivers/net/appletalk/Kconfig+1−17
@@ -106,20 +106,4 @@ config IPDDP_ENCAP · 105 unmodified lines
106106 IP packets inside AppleTalk frames; this is useful if your Linux box
107107 is stuck on an AppleTalk network (which hopefully contains a
108108 decapsulator somewhere). Please see
109− <file:Documentation/networking/ipddp.txt> for more information. If
110− you said Y to "AppleTalk-IP driver support" above and you say Y
111− here, then you cannot say Y to "AppleTalk-IP to IP Decapsulation
112− support", below.
113−
114−config IPDDP_DECAP
115− bool "Appletalk-IP to IP Decapsulation support"
116− depends on IPDDP
117− help
118− If you say Y here, the AppleTalk-IP code will be able to decapsulate
119− AppleTalk-IP frames to IP packets; this is useful if you want your
120− Linux box to act as an Internet gateway for an AppleTalk network.
121− Please see <file:Documentation/networking/ipddp.txt> for more
122− information. If you said Y to "AppleTalk-IP driver support" above
123− and you say Y here, then you cannot say Y to "IP to AppleTalk-IP
124− Encapsulation support", above.
125−
109+ <file:Documentation/networking/ipddp.txt> for more information.
drivers/net/bonding/bond_alb.c+2−2
@@ -514,7 +514,7 @@ static void rlb_update_client(struct rlb_client_info *client_info) · 513 unmodified lines
514514 skb->dev = client_info->slave->dev;
515515
516516 if (client_info->tag) {
517− skb = vlan_put_tag(skb, client_info->vlan_id);
517+ skb = vlan_put_tag(skb, htons(ETH_P_8021Q), client_info->vlan_id);
518518 if (!skb) {
519519 pr_err("%s: Error: failed to insert VLAN tag\n",
520520 client_info->slave->bond->dev->name);
@@ -1014,7 +1014,7 @@ static void alb_send_learning_packets(struct slave *slave, u8 mac_addr[]) · 493 unmodified lines
10141014 continue;
10151015 }
10161016
1017− skb = vlan_put_tag(skb, vlan->vlan_id);
1017+ skb = vlan_put_tag(skb, htons(ETH_P_8021Q), vlan->vlan_id);
10181018 if (!skb) {
10191019 pr_err("%s: Error: failed to insert VLAN tag\n",
10201020 bond->dev->name);
drivers/net/bonding/bond_main.c+55−17
@@ -428,14 +428,15 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, · 427 unmodified lines
428428 * @bond_dev: bonding net device that got called
429429 * @vid: vlan id being added
430430 */
431−static int bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid)
431+static int bond_vlan_rx_add_vid(struct net_device *bond_dev,
432+ __be16 proto, u16 vid)
432433 {
433434 struct bonding *bond = netdev_priv(bond_dev);
434435 struct slave *slave, *stop_at;
435436 int i, res;
436437
437438 bond_for_each_slave(bond, slave, i) {
438− res = vlan_vid_add(slave->dev, vid);
439+ res = vlan_vid_add(slave->dev, proto, vid);
439440 if (res)
440441 goto unwind;
441442 }
@@ -453,7 +454,7 @@ unwind: · 11 unmodified lines
453454 /* unwind from head to the slave that failed */
454455 stop_at = slave;
455456 bond_for_each_slave_from_to(bond, slave, i, bond->first_slave, stop_at)
456− vlan_vid_del(slave->dev, vid);
457+ vlan_vid_del(slave->dev, proto, vid);
457458
458459 return res;
459460 }
@@ -463,14 +464,15 @@ unwind: · 3 unmodified lines
463464 * @bond_dev: bonding net device that got called
464465 * @vid: vlan id being removed
465466 */
466−static int bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid)
467+static int bond_vlan_rx_kill_vid(struct net_device *bond_dev,
468+ __be16 proto, u16 vid)
467469 {
468470 struct bonding *bond = netdev_priv(bond_dev);
469471 struct slave *slave;
470472 int i, res;
471473
472474 bond_for_each_slave(bond, slave, i)
473− vlan_vid_del(slave->dev, vid);
475+ vlan_vid_del(slave->dev, proto, vid);
474476
475477 res = bond_del_vlan(bond, vid);
476478 if (res) {
@@ -488,7 +490,8 @@ static void bond_add_vlans_on_slave(struct bonding *bond, struct net_device *sla · 11 unmodified lines
488490 int res;
489491
490492 list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
491− res = vlan_vid_add(slave_dev, vlan->vlan_id);
493+ res = vlan_vid_add(slave_dev, htons(ETH_P_8021Q),
494+ vlan->vlan_id);
492495 if (res)
493496 pr_warning("%s: Failed to add vlan id %d to device %s\n",
494497 bond->dev->name, vlan->vlan_id,
@@ -504,7 +507,7 @@ static void bond_del_vlans_from_slave(struct bonding *bond, · 9 unmodified lines
504507 list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
505508 if (!vlan->vlan_id)
506509 continue;
507− vlan_vid_del(slave_dev, vlan->vlan_id);
510+ vlan_vid_del(slave_dev, htons(ETH_P_8021Q), vlan->vlan_id);
508511 }
509512 }
510513
@@ -779,7 +782,7 @@ static void bond_resend_igmp_join_requests(struct bonding *bond) · 268 unmodified lines
779782
780783 /* rejoin all groups on vlan devices */
781784 list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
782− vlan_dev = __vlan_find_dev_deep(bond_dev,
785+ vlan_dev = __vlan_find_dev_deep(bond_dev, htons(ETH_P_8021Q),
783786 vlan->vlan_id);
784787 if (vlan_dev)
785788 __bond_resend_igmp_join_requests(vlan_dev);
@@ -796,9 +799,8 @@ static void bond_resend_igmp_join_requests_delayed(struct work_struct *work) · 10 unmodified lines
796799 {
797800 struct bonding *bond = container_of(work, struct bonding,
798801 mcast_work.work);
799− rcu_read_lock();
802+
800803 bond_resend_igmp_join_requests(bond);
801− rcu_read_unlock();
802804 }
803805
804806 /*
@@ -1915,14 +1917,16 @@ err_detach: · 1110 unmodified lines
19151917 bond_detach_slave(bond, new_slave);
19161918 if (bond->primary_slave == new_slave)
19171919 bond->primary_slave = NULL;
1918− write_unlock_bh(&bond->lock);
19191920 if (bond->curr_active_slave == new_slave) {
1921+ bond_change_active_slave(bond, NULL);
1922+ write_unlock_bh(&bond->lock);
19201923 read_lock(&bond->lock);
19211924 write_lock_bh(&bond->curr_slave_lock);
1922− bond_change_active_slave(bond, NULL);
19231925 bond_select_active_slave(bond);
19241926 write_unlock_bh(&bond->curr_slave_lock);
19251927 read_unlock(&bond->lock);
1928+ } else {
1929+ write_unlock_bh(&bond->lock);
19261930 }
19271931 slave_disable_netpoll(new_slave);
19281932
@@ -2532,7 +2536,8 @@ static int bond_has_this_ip(struct bonding *bond, __be32 ip) · 603 unmodified lines
25322536
25332537 list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
25342538 rcu_read_lock();
2535− vlan_dev = __vlan_find_dev_deep(bond->dev, vlan->vlan_id);
2539+ vlan_dev = __vlan_find_dev_deep(bond->dev, htons(ETH_P_8021Q),
2540+ vlan->vlan_id);
25362541 rcu_read_unlock();
25372542 if (vlan_dev && ip == bond_confirm_addr(vlan_dev, 0, ip))
25382543 return 1;
@@ -2561,7 +2566,7 @@ static void bond_arp_send(struct net_device *slave_dev, int arp_op, __be32 dest_ · 22 unmodified lines
25612566 return;
25622567 }
25632568 if (vlan_id) {
2564− skb = vlan_put_tag(skb, vlan_id);
2569+ skb = vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_id);
25652570 if (!skb) {
25662571 pr_err("failed to insert VLAN tag\n");
25672572 return;
@@ -2623,6 +2628,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) · 55 unmodified lines
26232628 list_for_each_entry(vlan, &bond->vlan_list, vlan_list) {
26242629 rcu_read_lock();
26252630 vlan_dev = __vlan_find_dev_deep(bond->dev,
2631+ htons(ETH_P_8021Q),
26262632 vlan->vlan_id);
26272633 rcu_read_unlock();
26282634 if (vlan_dev == rt->dst.dev) {
@@ -4258,6 +4264,37 @@ void bond_set_mode_ops(struct bonding *bond, int mode) · 1629 unmodified lines
42584264 }
42594265 }
42604266
4267+static int bond_ethtool_get_settings(struct net_device *bond_dev,
4268+ struct ethtool_cmd *ecmd)
4269+{
4270+ struct bonding *bond = netdev_priv(bond_dev);
4271+ struct slave *slave;
4272+ int i;
4273+ unsigned long speed = 0;
4274+
4275+ ecmd->duplex = DUPLEX_UNKNOWN;
4276+ ecmd->port = PORT_OTHER;
4277+
4278+ /* Since SLAVE_IS_OK returns false for all inactive or down slaves, we
4279+ * do not need to check mode. Though link speed might not represent
4280+ * the true receive or transmit bandwidth (not all modes are symmetric)
4281+ * this is an accurate maximum.
4282+ */
4283+ read_lock(&bond->lock);
4284+ bond_for_each_slave(bond, slave, i) {
4285+ if (SLAVE_IS_OK(slave)) {
4286+ if (slave->speed != SPEED_UNKNOWN)
4287+ speed += slave->speed;
4288+ if (ecmd->duplex == DUPLEX_UNKNOWN &&
4289+ slave->duplex != DUPLEX_UNKNOWN)
4290+ ecmd->duplex = slave->duplex;
4291+ }
4292+ }
4293+ ethtool_cmd_speed_set(ecmd, speed ? : SPEED_UNKNOWN);
4294+ read_unlock(&bond->lock);
4295+ return 0;
4296+}
4297+
42614298 static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
42624299 struct ethtool_drvinfo *drvinfo)
42634300 {
@@ -4269,6 +4306,7 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev, · 5 unmodified lines
42694306
42704307 static const struct ethtool_ops bond_ethtool_ops = {
42714308 .get_drvinfo = bond_ethtool_get_drvinfo,
4309+ .get_settings = bond_ethtool_get_settings,
42724310 .get_link = ethtool_op_get_link,
42734311 };
42744312
@@ -4359,9 +4397,9 @@ static void bond_setup(struct net_device *bond_dev) · 84 unmodified lines
43594397 */
43604398
43614399 bond_dev->hw_features = BOND_VLAN_FEATURES |
4362− NETIF_F_HW_VLAN_TX |
4363− NETIF_F_HW_VLAN_RX |
4364− NETIF_F_HW_VLAN_FILTER;
4400+ NETIF_F_HW_VLAN_CTAG_TX |
4401+ NETIF_F_HW_VLAN_CTAG_RX |
4402+ NETIF_F_HW_VLAN_CTAG_FILTER;
43654403
43664404 bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
43674405 bond_dev->features |= bond_dev->hw_features;
drivers/net/caif/Kconfig+0−7
@@ -32,13 +32,6 @@ config CAIF_SPI_SYNC · 31 unmodified lines
3232 help to synchronize to the next transfer in case of over or under-runs.
3333 This option also needs to be enabled on the modem.
3434
35−config CAIF_SHM
36− tristate "CAIF shared memory protocol driver"
37− depends on CAIF && U5500_MBOX
38− default n
39− ---help---
40− The CAIF shared memory protocol driver for the STE UX5500 platform.
41−
4235 config CAIF_HSI
4336 tristate "CAIF HSI transport driver"
4437 depends on CAIF
drivers/net/caif/Makefile+0−4
@@ -7,9 +7,5 @@ obj-$(CONFIG_CAIF_TTY) += caif_serial.o · 6 unmodified lines
77 cfspi_slave-objs := caif_spi.o caif_spi_slave.o
88 obj-$(CONFIG_CAIF_SPI_SLAVE) += cfspi_slave.o
99
10−# Shared memory
11−caif_shm-objs := caif_shmcore.o caif_shm_u5500.o
12−obj-$(CONFIG_CAIF_SHM) += caif_shm.o
13−
1410 # HSI interface
1511 obj-$(CONFIG_CAIF_HSI) += caif_hsi.o
drivers/net/caif/caif_hsi.c+3−4
@@ -1,8 +1,7 @@
11 /*
22 * Copyright (C) ST-Ericsson AB 2010
3− * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
4− * Author: Daniel Martensson / daniel.martensson@stericsson.com
5− * Dmitry.Tarnyagin / dmitry.tarnyagin@stericsson.com
3+ * Author: Daniel Martensson
4+ * Dmitry.Tarnyagin / dmitry.tarnyagin@lockless.no
65 * License terms: GNU General Public License (GPL) version 2.
76 */
87
@@ -25,7 +24,7 @@ · 16 unmodified lines
2524 #include <net/caif/caif_hsi.h>
2625
2726 MODULE_LICENSE("GPL");
28−MODULE_AUTHOR("Daniel Martensson<daniel.martensson@stericsson.com>");
27+MODULE_AUTHOR("Daniel Martensson");
2928 MODULE_DESCRIPTION("CAIF HSI driver");
3029
3130 /* Returns the number of padding bytes for alignment. */
drivers/net/caif/caif_serial.c+2−2
@@ -1,6 +1,6 @@
11 /*
22 * Copyright (C) ST-Ericsson AB 2010
3− * Author: Sjur Brendeland / sjur.brandeland@stericsson.com
3+ * Author: Sjur Brendeland
44 * License terms: GNU General Public License (GPL) version 2
55 */
66
@@ -21,7 +21,7 @@ · 14 unmodified lines
2121 #include <linux/debugfs.h>
2222
2323 MODULE_LICENSE("GPL");
24−MODULE_AUTHOR("Sjur Brendeland<sjur.brandeland@stericsson.com>");
24+MODULE_AUTHOR("Sjur Brendeland");
2525 MODULE_DESCRIPTION("CAIF serial device TTY line discipline");
2626 MODULE_LICENSE("GPL");
2727 MODULE_ALIAS_LDISC(N_CAIF);
drivers/net/caif/caif_shm_u5500.c+0−128
@@ -1,128 +0,0 @@
1−/*
2− * Copyright (C) ST-Ericsson AB 2010
3− * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
4− * Author: Amarnath Revanna / amarnath.bangalore.revanna@stericsson.com
5− * License terms: GNU General Public License (GPL) version 2
6− */
7−
8−#define pr_fmt(fmt) KBUILD_MODNAME ":" fmt
9−
10−#include <linux/init.h>
11−#include <linux/module.h>
12−#include <linux/netdevice.h>
13−#include <mach/mbox-db5500.h>
14−#include <net/caif/caif_shm.h>
15−
16−MODULE_LICENSE("GPL");
17−MODULE_DESCRIPTION("CAIF Shared Memory protocol driver");
18−
19−#define MAX_SHM_INSTANCES 1
20−
21−enum {
22− MBX_ACC0,
23− MBX_ACC1,
24− MBX_DSP
25−};
26−
27−static struct shmdev_layer shmdev_lyr[MAX_SHM_INSTANCES];
28−
29−static unsigned int shm_start;
30−static unsigned int shm_size;
31−
32−module_param(shm_size, uint , 0440);
33−MODULE_PARM_DESC(shm_total_size, "Start of SHM shared memory");
34−
35−module_param(shm_start, uint , 0440);
36−MODULE_PARM_DESC(shm_total_start, "Total Size of SHM shared memory");
37−
38−static int shmdev_send_msg(u32 dev_id, u32 mbx_msg)
39−{
40− /* Always block until msg is written successfully */
41− mbox_send(shmdev_lyr[dev_id].hmbx, mbx_msg, true);
42− return 0;
43−}
44−
45−static int shmdev_mbx_setup(void *pshmdrv_cb, struct shmdev_layer *pshm_dev,
46− void *pshm_drv)
47−{
48− /*
49− * For UX5500, we have only 1 SHM instance which uses MBX0
50− * for communication with the peer modem
51− */
52− pshm_dev->hmbx = mbox_setup(MBX_ACC0, pshmdrv_cb, pshm_drv);
53−
54− if (!pshm_dev->hmbx)
55− return -ENODEV;
56− else
57− return 0;
58−}
59−
60−static int __init caif_shmdev_init(void)
61−{
62− int i, result;
63−
64− /* Loop is currently overkill, there is only one instance */
65− for (i = 0; i < MAX_SHM_INSTANCES; i++) {
66−
67− shmdev_lyr[i].shm_base_addr = shm_start;
68− shmdev_lyr[i].shm_total_sz = shm_size;
69−
70− if (((char *)shmdev_lyr[i].shm_base_addr == NULL)
71− || (shmdev_lyr[i].shm_total_sz <= 0)) {
72− pr_warn("ERROR,"
73− "Shared memory Address and/or Size incorrect"
74− ", Bailing out ...\n");
75− result = -EINVAL;
76− goto clean;
77− }
78−
79− pr_info("SHM AREA (instance %d) STARTS"
80− " AT %p\n", i, (char *)shmdev_lyr[i].shm_base_addr);
81−
82− shmdev_lyr[i].shm_id = i;
83− shmdev_lyr[i].pshmdev_mbxsend = shmdev_send_msg;
84− shmdev_lyr[i].pshmdev_mbxsetup = shmdev_mbx_setup;
85−
86− /*
87− * Finally, CAIF core module is called with details in place:
88− * 1. SHM base address
89− * 2. SHM size
90− * 3. MBX handle
91− */
92− result = caif_shmcore_probe(&shmdev_lyr[i]);
93− if (result) {
94− pr_warn("ERROR[%d],"
95− "Could not probe SHM core (instance %d)"
96− " Bailing out ...\n", result, i);
97− goto clean;
98− }
99− }
100−
101− return 0;
102−
103−clean:
104− /*
105− * For now, we assume that even if one instance of SHM fails, we bail
106− * out of the driver support completely. For this, we need to release
107− * any memory allocated and unregister any instance of SHM net device.
108− */
109− for (i = 0; i < MAX_SHM_INSTANCES; i++) {
110− if (shmdev_lyr[i].pshm_netdev)
111− unregister_netdev(shmdev_lyr[i].pshm_netdev);
112− }
113− return result;
114−}
115−
116−static void __exit caif_shmdev_exit(void)
117−{
118− int i;
119−
120− for (i = 0; i < MAX_SHM_INSTANCES; i++) {
121− caif_shmcore_remove(shmdev_lyr[i].pshm_netdev);
122− kfree((void *)shmdev_lyr[i].shm_base_addr);
123− }
124−
125−}
126−
127−module_init(caif_shmdev_init);
128−module_exit(caif_shmdev_exit);
drivers/net/caif/caif_shmcore.c+0−747
@@ -1,747 +0,0 @@
1−/*
2− * Copyright (C) ST-Ericsson AB 2010
3− * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
4− * Authors: Amarnath Revanna / amarnath.bangalore.revanna@stericsson.com,
5− * Daniel Martensson / daniel.martensson@stericsson.com
6− * License terms: GNU General Public License (GPL) version 2
7− */
8−
9−#define pr_fmt(fmt) KBUILD_MODNAME ":" fmt
10−
11−#include <linux/spinlock.h>
12−#include <linux/sched.h>
13−#include <linux/list.h>
14−#include <linux/netdevice.h>
15−#include <linux/if_arp.h>
16−#include <linux/io.h>
17−
18−#include <net/caif/caif_device.h>
19−#include <net/caif/caif_shm.h>
20−
21−#define NR_TX_BUF 6
22−#define NR_RX_BUF 6
23−#define TX_BUF_SZ 0x2000
24−#define RX_BUF_SZ 0x2000
25−
26−#define CAIF_NEEDED_HEADROOM 32
27−
28−#define CAIF_FLOW_ON 1
29−#define CAIF_FLOW_OFF 0
30−
31−#define LOW_WATERMARK 3
32−#define HIGH_WATERMARK 4
33−
34−/* Maximum number of CAIF buffers per shared memory buffer. */
35−#define SHM_MAX_FRMS_PER_BUF 10
36−
37−/*
38− * Size in bytes of the descriptor area
39− * (With end of descriptor signalling)
40− */
41−#define SHM_CAIF_DESC_SIZE ((SHM_MAX_FRMS_PER_BUF + 1) * \
42− sizeof(struct shm_pck_desc))
43−
44−/*
45− * Offset to the first CAIF frame within a shared memory buffer.
46− * Aligned on 32 bytes.
47− */
48−#define SHM_CAIF_FRM_OFS (SHM_CAIF_DESC_SIZE + (SHM_CAIF_DESC_SIZE % 32))
49−
50−/* Number of bytes for CAIF shared memory header. */
51−#define SHM_HDR_LEN 1
52−
53−/* Number of padding bytes for the complete CAIF frame. */
54−#define SHM_FRM_PAD_LEN 4
55−
56−#define CAIF_MAX_MTU 4096
57−
58−#define SHM_SET_FULL(x) (((x+1) & 0x0F) << 0)
59−#define SHM_GET_FULL(x) (((x >> 0) & 0x0F) - 1)
60−
61−#define SHM_SET_EMPTY(x) (((x+1) & 0x0F) << 4)
62−#define SHM_GET_EMPTY(x) (((x >> 4) & 0x0F) - 1)
63−
64−#define SHM_FULL_MASK (0x0F << 0)
65−#define SHM_EMPTY_MASK (0x0F << 4)
66−
67−struct shm_pck_desc {
68− /*
69− * Offset from start of shared memory area to start of
70− * shared memory CAIF frame.
71− */
72− u32 frm_ofs;
73− u32 frm_len;
74−};
75−
76−struct buf_list {
77− unsigned char *desc_vptr;
78− u32 phy_addr;
79− u32 index;
80− u32 len;
81− u32 frames;
82− u32 frm_ofs;
83− struct list_head list;
84−};
85−
86−struct shm_caif_frm {
87− /* Number of bytes of padding before the CAIF frame. */
88− u8 hdr_ofs;
89−};
90−
91−struct shmdrv_layer {
92− /* caif_dev_common must always be first in the structure*/
93− struct caif_dev_common cfdev;
94−
95− u32 shm_tx_addr;
96− u32 shm_rx_addr;
97− u32 shm_base_addr;
98− u32 tx_empty_available;
99− spinlock_t lock;
100−
101− struct list_head tx_empty_list;
102− struct list_head tx_pend_list;
103− struct list_head tx_full_list;
104− struct list_head rx_empty_list;
105− struct list_head rx_pend_list;
106− struct list_head rx_full_list;
107−
108− struct workqueue_struct *pshm_tx_workqueue;
109− struct workqueue_struct *pshm_rx_workqueue;
110−
111− struct work_struct shm_tx_work;
112− struct work_struct shm_rx_work;
113−
114− struct sk_buff_head sk_qhead;
115− struct shmdev_layer *pshm_dev;
116−};
117−
118−static int shm_netdev_open(struct net_device *shm_netdev)
119−{
120− netif_wake_queue(shm_netdev);
121− return 0;
122−}
123−
124−static int shm_netdev_close(struct net_device *shm_netdev)
125−{
126− netif_stop_queue(shm_netdev);
127− return 0;
128−}
129−
130−int caif_shmdrv_rx_cb(u32 mbx_msg, void *priv)
131−{
132− struct buf_list *pbuf;
133− struct shmdrv_layer *pshm_drv;
134− struct list_head *pos;
135− u32 avail_emptybuff = 0;
136− unsigned long flags = 0;
137−
138− pshm_drv = priv;
139−
140− /* Check for received buffers. */
141− if (mbx_msg & SHM_FULL_MASK) {
142− int idx;
143−
144− spin_lock_irqsave(&pshm_drv->lock, flags);
145−
146− /* Check whether we have any outstanding buffers. */
147− if (list_empty(&pshm_drv->rx_empty_list)) {
148−
149− /* Release spin lock. */
150− spin_unlock_irqrestore(&pshm_drv->lock, flags);
151−
152− /* We print even in IRQ context... */
153− pr_warn("No empty Rx buffers to fill: "
154− "mbx_msg:%x\n", mbx_msg);
155−
156− /* Bail out. */
157− goto err_sync;
158− }
159−
160− pbuf =
161− list_entry(pshm_drv->rx_empty_list.next,
162− struct buf_list, list);
163− idx = pbuf->index;
164−
165− /* Check buffer synchronization. */
166− if (idx != SHM_GET_FULL(mbx_msg)) {
167−
168− /* We print even in IRQ context... */
169− pr_warn(
170− "phyif_shm_mbx_msg_cb: RX full out of sync:"
171− " idx:%d, msg:%x SHM_GET_FULL(mbx_msg):%x\n",
172− idx, mbx_msg, SHM_GET_FULL(mbx_msg));
173−
174− spin_unlock_irqrestore(&pshm_drv->lock, flags);
175−
176− /* Bail out. */
177− goto err_sync;
178− }
179−
180− list_del_init(&pbuf->list);
181− list_add_tail(&pbuf->list, &pshm_drv->rx_full_list);
182−
183− spin_unlock_irqrestore(&pshm_drv->lock, flags);
184−
185− /* Schedule RX work queue. */
186− if (!work_pending(&pshm_drv->shm_rx_work))
187− queue_work(pshm_drv->pshm_rx_workqueue,
188− &pshm_drv->shm_rx_work);
189− }
190−
191− /* Check for emptied buffers. */
192− if (mbx_msg & SHM_EMPTY_MASK) {
193− int idx;
194−
195− spin_lock_irqsave(&pshm_drv->lock, flags);
196−
197− /* Check whether we have any outstanding buffers. */
198− if (list_empty(&pshm_drv->tx_full_list)) {
199−
200− /* We print even in IRQ context... */
201− pr_warn("No TX to empty: msg:%x\n", mbx_msg);
202−
203− spin_unlock_irqrestore(&pshm_drv->lock, flags);
204−
205− /* Bail out. */
206− goto err_sync;
207− }
208−
209− pbuf =
210− list_entry(pshm_drv->tx_full_list.next,
211− struct buf_list, list);
212− idx = pbuf->index;
213−
214− /* Check buffer synchronization. */
215− if (idx != SHM_GET_EMPTY(mbx_msg)) {
216−
217− spin_unlock_irqrestore(&pshm_drv->lock, flags);
218−
219− /* We print even in IRQ context... */
220− pr_warn("TX empty "
221− "out of sync:idx:%d, msg:%x\n", idx, mbx_msg);
222−
223− /* Bail out. */
224− goto err_sync;
225− }
226− list_del_init(&pbuf->list);
227−
228− /* Reset buffer parameters. */
229− pbuf->frames = 0;
230− pbuf->frm_ofs = SHM_CAIF_FRM_OFS;
231−
232− list_add_tail(&pbuf->list, &pshm_drv->tx_empty_list);
233−
234− /* Check the available no. of buffers in the empty list */
235− list_for_each(pos, &pshm_drv->tx_empty_list)
236− avail_emptybuff++;
237−
238− /* Check whether we have to wake up the transmitter. */
239− if ((avail_emptybuff > HIGH_WATERMARK) &&
240− (!pshm_drv->tx_empty_available)) {
241− pshm_drv->tx_empty_available = 1;
242− spin_unlock_irqrestore(&pshm_drv->lock, flags);
243− pshm_drv->cfdev.flowctrl
244− (pshm_drv->pshm_dev->pshm_netdev,
245− CAIF_FLOW_ON);
246−
247−
248− /* Schedule the work queue. if required */
249− if (!work_pending(&pshm_drv->shm_tx_work))
250− queue_work(pshm_drv->pshm_tx_workqueue,
251− &pshm_drv->shm_tx_work);
252− } else
253− spin_unlock_irqrestore(&pshm_drv->lock, flags);
254− }
255−
256− return 0;
257−
258−err_sync:
259− return -EIO;
260−}
261−
262−static void shm_rx_work_func(struct work_struct *rx_work)
263−{
264− struct shmdrv_layer *pshm_drv;
265− struct buf_list *pbuf;
266− unsigned long flags = 0;
267− struct sk_buff *skb;
268− char *p;
269− int ret;
270−
271− pshm_drv = container_of(rx_work, struct shmdrv_layer, shm_rx_work);
272−
273− while (1) {
274−
275− struct shm_pck_desc *pck_desc;
276−
277− spin_lock_irqsave(&pshm_drv->lock, flags);
278−
279− /* Check for received buffers. */
280− if (list_empty(&pshm_drv->rx_full_list)) {
281− spin_unlock_irqrestore(&pshm_drv->lock, flags);
282− break;
283− }
284−
285− pbuf =
286− list_entry(pshm_drv->rx_full_list.next, struct buf_list,
287− list);
288− list_del_init(&pbuf->list);
289− spin_unlock_irqrestore(&pshm_drv->lock, flags);
290−
291− /* Retrieve pointer to start of the packet descriptor area. */
292− pck_desc = (struct shm_pck_desc *) pbuf->desc_vptr;
293−
294− /*
295− * Check whether descriptor contains a CAIF shared memory
296− * frame.
297− */
298− while (pck_desc->frm_ofs) {
299− unsigned int frm_buf_ofs;
300− unsigned int frm_pck_ofs;
301− unsigned int frm_pck_len;
302− /*
303− * Check whether offset is within buffer limits
304− * (lower).
305− */
306− if (pck_desc->frm_ofs <
307− (pbuf->phy_addr - pshm_drv->shm_base_addr))
308− break;
309− /*
310− * Check whether offset is within buffer limits
311− * (higher).
312− */
313− if (pck_desc->frm_ofs >
314− ((pbuf->phy_addr - pshm_drv->shm_base_addr) +
315− pbuf->len))
316− break;
317−
318− /* Calculate offset from start of buffer. */
319− frm_buf_ofs =
320− pck_desc->frm_ofs - (pbuf->phy_addr -
321− pshm_drv->shm_base_addr);
322−
323− /*
324− * Calculate offset and length of CAIF packet while
325− * taking care of the shared memory header.
326− */
327− frm_pck_ofs =
328− frm_buf_ofs + SHM_HDR_LEN +
329− (*(pbuf->desc_vptr + frm_buf_ofs));
330− frm_pck_len =
331− (pck_desc->frm_len - SHM_HDR_LEN -
332− (*(pbuf->desc_vptr + frm_buf_ofs)));
333−
334− /* Check whether CAIF packet is within buffer limits */
335− if ((frm_pck_ofs + pck_desc->frm_len) > pbuf->len)
336− break;
337−
338− /* Get a suitable CAIF packet and copy in data. */
339− skb = netdev_alloc_skb(pshm_drv->pshm_dev->pshm_netdev,
340− frm_pck_len + 1);
341−
342− if (skb == NULL) {
343− pr_info("OOM: Try next frame in descriptor\n");
344− break;
345− }
346−
347− p = skb_put(skb, frm_pck_len);
348− memcpy(p, pbuf->desc_vptr + frm_pck_ofs, frm_pck_len);
349−
350− skb->protocol = htons(ETH_P_CAIF);
351− skb_reset_mac_header(skb);
352− skb->dev = pshm_drv->pshm_dev->pshm_netdev;
353−
354− /* Push received packet up the stack. */
355− ret = netif_rx_ni(skb);
356−
357− if (!ret) {
358− pshm_drv->pshm_dev->pshm_netdev->stats.
359− rx_packets++;
360− pshm_drv->pshm_dev->pshm_netdev->stats.
361− rx_bytes += pck_desc->frm_len;
362− } else
363− ++pshm_drv->pshm_dev->pshm_netdev->stats.
364− rx_dropped;
365− /* Move to next packet descriptor. */
366− pck_desc++;
367− }
368−
369− spin_lock_irqsave(&pshm_drv->lock, flags);
370− list_add_tail(&pbuf->list, &pshm_drv->rx_pend_list);
371−
372− spin_unlock_irqrestore(&pshm_drv->lock, flags);
373−
374− }
375−
376− /* Schedule the work queue. if required */
377− if (!work_pending(&pshm_drv->shm_tx_work))
378− queue_work(pshm_drv->pshm_tx_workqueue, &pshm_drv->shm_tx_work);
379−
380−}
381−
382−static void shm_tx_work_func(struct work_struct *tx_work)
383−{
384− u32 mbox_msg;
385− unsigned int frmlen, avail_emptybuff, append = 0;
386− unsigned long flags = 0;
387− struct buf_list *pbuf = NULL;
388− struct shmdrv_layer *pshm_drv;
389− struct shm_caif_frm *frm;
390− struct sk_buff *skb;
391− struct shm_pck_desc *pck_desc;
392− struct list_head *pos;
393−
394− pshm_drv = container_of(tx_work, struct shmdrv_layer, shm_tx_work);
395−
396− do {
397− /* Initialize mailbox message. */
398− mbox_msg = 0x00;
399− avail_emptybuff = 0;
400−
401− spin_lock_irqsave(&pshm_drv->lock, flags);
402−
403− /* Check for pending receive buffers. */
404− if (!list_empty(&pshm_drv->rx_pend_list)) {
405−
406− pbuf = list_entry(pshm_drv->rx_pend_list.next,
407− struct buf_list, list);
408−
409− list_del_init(&pbuf->list);
410− list_add_tail(&pbuf->list, &pshm_drv->rx_empty_list);
411− /*
412− * Value index is never changed,
413− * so read access should be safe.
414− */
415− mbox_msg |= SHM_SET_EMPTY(pbuf->index);
416− }
417−
418− skb = skb_peek(&pshm_drv->sk_qhead);
419−
420− if (skb == NULL)
421− goto send_msg;
422− /* Check the available no. of buffers in the empty list */
423− list_for_each(pos, &pshm_drv->tx_empty_list)
424− avail_emptybuff++;
425−
426− if ((avail_emptybuff < LOW_WATERMARK) &&
427− pshm_drv->tx_empty_available) {
428− /* Update blocking condition. */
429− pshm_drv->tx_empty_available = 0;
430− spin_unlock_irqrestore(&pshm_drv->lock, flags);
431− pshm_drv->cfdev.flowctrl
432− (pshm_drv->pshm_dev->pshm_netdev,
433− CAIF_FLOW_OFF);
434− spin_lock_irqsave(&pshm_drv->lock, flags);
435− }
436− /*
437− * We simply return back to the caller if we do not have space
438− * either in Tx pending list or Tx empty list. In this case,
439− * we hold the received skb in the skb list, waiting to
440− * be transmitted once Tx buffers become available
441− */
442− if (list_empty(&pshm_drv->tx_empty_list))
443− goto send_msg;
444−
445− /* Get the first free Tx buffer. */
446− pbuf = list_entry(pshm_drv->tx_empty_list.next,
447− struct buf_list, list);
448− do {
449− if (append) {
450− skb = skb_peek(&pshm_drv->sk_qhead);
451− if (skb == NULL)
452− break;
453− }
454−
455− frm = (struct shm_caif_frm *)
456− (pbuf->desc_vptr + pbuf->frm_ofs);
457−
458− frm->hdr_ofs = 0;
459− frmlen = 0;
460− frmlen += SHM_HDR_LEN + frm->hdr_ofs + skb->len;
461−
462− /* Add tail padding if needed. */
463− if (frmlen % SHM_FRM_PAD_LEN)
464− frmlen += SHM_FRM_PAD_LEN -
465− (frmlen % SHM_FRM_PAD_LEN);
466−
467− /*
468− * Verify that packet, header and additional padding
469− * can fit within the buffer frame area.
470− */
471− if (frmlen >= (pbuf->len - pbuf->frm_ofs))
472− break;
473−
474− if (!append) {
475− list_del_init(&pbuf->list);
476− append = 1;
477− }
478−
479− skb = skb_dequeue(&pshm_drv->sk_qhead);
480− if (skb == NULL)
481− break;
482− /* Copy in CAIF frame. */
483− skb_copy_bits(skb, 0, pbuf->desc_vptr +
484− pbuf->frm_ofs + SHM_HDR_LEN +
485− frm->hdr_ofs, skb->len);
486−
487− pshm_drv->pshm_dev->pshm_netdev->stats.tx_packets++;
488− pshm_drv->pshm_dev->pshm_netdev->stats.tx_bytes +=
489− frmlen;
490− dev_kfree_skb_irq(skb);
491−
492− /* Fill in the shared memory packet descriptor area. */
493− pck_desc = (struct shm_pck_desc *) (pbuf->desc_vptr);
494− /* Forward to current frame. */
495− pck_desc += pbuf->frames;
496− pck_desc->frm_ofs = (pbuf->phy_addr -
497− pshm_drv->shm_base_addr) +
498− pbuf->frm_ofs;
499− pck_desc->frm_len = frmlen;
500− /* Terminate packet descriptor area. */
501− pck_desc++;
502− pck_desc->frm_ofs = 0;
503− /* Update buffer parameters. */
504− pbuf->frames++;
505− pbuf->frm_ofs += frmlen + (frmlen % 32);
506−
507− } while (pbuf->frames < SHM_MAX_FRMS_PER_BUF);
508−
509− /* Assign buffer as full. */
510− list_add_tail(&pbuf->list, &pshm_drv->tx_full_list);
511− append = 0;
512− mbox_msg |= SHM_SET_FULL(pbuf->index);
513−send_msg:
514− spin_unlock_irqrestore(&pshm_drv->lock, flags);
515−
516− if (mbox_msg)
517− pshm_drv->pshm_dev->pshmdev_mbxsend
518− (pshm_drv->pshm_dev->shm_id, mbox_msg);
519− } while (mbox_msg);
520−}
521−
522−static int shm_netdev_tx(struct sk_buff *skb, struct net_device *shm_netdev)
523−{
524− struct shmdrv_layer *pshm_drv;
525−
526− pshm_drv = netdev_priv(shm_netdev);
527−
528− skb_queue_tail(&pshm_drv->sk_qhead, skb);
529−
530− /* Schedule Tx work queue. for deferred processing of skbs*/
531− if (!work_pending(&pshm_drv->shm_tx_work))
532− queue_work(pshm_drv->pshm_tx_workqueue, &pshm_drv->shm_tx_work);
533−
534− return 0;
535−}
536−
537−static const struct net_device_ops netdev_ops = {
538− .ndo_open = shm_netdev_open,
539− .ndo_stop = shm_netdev_close,
540− .ndo_start_xmit = shm_netdev_tx,
541−};
542−
543−static void shm_netdev_setup(struct net_device *pshm_netdev)
544−{
545− struct shmdrv_layer *pshm_drv;
546− pshm_netdev->netdev_ops = &netdev_ops;
547−
548− pshm_netdev->mtu = CAIF_MAX_MTU;
549− pshm_netdev->type = ARPHRD_CAIF;
550− pshm_netdev->hard_header_len = CAIF_NEEDED_HEADROOM;
551− pshm_netdev->tx_queue_len = 0;
552− pshm_netdev->destructor = free_netdev;
553−
554− pshm_drv = netdev_priv(pshm_netdev);
555−
556− /* Initialize structures in a clean state. */
557− memset(pshm_drv, 0, sizeof(struct shmdrv_layer));
558−
559− pshm_drv->cfdev.link_select = CAIF_LINK_LOW_LATENCY;
560−}
561−
562−int caif_shmcore_probe(struct shmdev_layer *pshm_dev)
563−{
564− int result, j;
565− struct shmdrv_layer *pshm_drv = NULL;
566−
567− pshm_dev->pshm_netdev = alloc_netdev(sizeof(struct shmdrv_layer),
568− "cfshm%d", shm_netdev_setup);
569− if (!pshm_dev->pshm_netdev)
570− return -ENOMEM;
571−
572− pshm_drv = netdev_priv(pshm_dev->pshm_netdev);
573− pshm_drv->pshm_dev = pshm_dev;
574−
575− /*
576− * Initialization starts with the verification of the
577− * availability of MBX driver by calling its setup function.
578− * MBX driver must be available by this time for proper
579− * functioning of SHM driver.
580− */
581− if ((pshm_dev->pshmdev_mbxsetup
582− (caif_shmdrv_rx_cb, pshm_dev, pshm_drv)) != 0) {
583− pr_warn("Could not config. SHM Mailbox,"
584− " Bailing out.....\n");
585− free_netdev(pshm_dev->pshm_netdev);
586− return -ENODEV;
587− }
588−
589− skb_queue_head_init(&pshm_drv->sk_qhead);
590−
591− pr_info("SHM DEVICE[%d] PROBED BY DRIVER, NEW SHM DRIVER"
592− " INSTANCE AT pshm_drv =0x%p\n",
593− pshm_drv->pshm_dev->shm_id, pshm_drv);
594−
595− if (pshm_dev->shm_total_sz <
596− (NR_TX_BUF * TX_BUF_SZ + NR_RX_BUF * RX_BUF_SZ)) {
597−
598− pr_warn("ERROR, Amount of available"
599− " Phys. SHM cannot accommodate current SHM "
600− "driver configuration, Bailing out ...\n");
601− free_netdev(pshm_dev->pshm_netdev);
602− return -ENOMEM;
603− }
604−
605− pshm_drv->shm_base_addr = pshm_dev->shm_base_addr;
606− pshm_drv->shm_tx_addr = pshm_drv->shm_base_addr;
607−
608− if (pshm_dev->shm_loopback)
609− pshm_drv->shm_rx_addr = pshm_drv->shm_tx_addr;
610− else
611− pshm_drv->shm_rx_addr = pshm_dev->shm_base_addr +
612− (NR_TX_BUF * TX_BUF_SZ);
613−
614− spin_lock_init(&pshm_drv->lock);
615− INIT_LIST_HEAD(&pshm_drv->tx_empty_list);
616− INIT_LIST_HEAD(&pshm_drv->tx_pend_list);
617− INIT_LIST_HEAD(&pshm_drv->tx_full_list);
618−
619− INIT_LIST_HEAD(&pshm_drv->rx_empty_list);
620− INIT_LIST_HEAD(&pshm_drv->rx_pend_list);
621− INIT_LIST_HEAD(&pshm_drv->rx_full_list);
622−
623− INIT_WORK(&pshm_drv->shm_tx_work, shm_tx_work_func);
624− INIT_WORK(&pshm_drv->shm_rx_work, shm_rx_work_func);
625−
626− pshm_drv->pshm_tx_workqueue =
627− create_singlethread_workqueue("shm_tx_work");
628− pshm_drv->pshm_rx_workqueue =
629− create_singlethread_workqueue("shm_rx_work");
630−
631− for (j = 0; j < NR_TX_BUF; j++) {
632− struct buf_list *tx_buf =
633− kmalloc(sizeof(struct buf_list), GFP_KERNEL);
634−
635− if (tx_buf == NULL) {
636− free_netdev(pshm_dev->pshm_netdev);
637− return -ENOMEM;
638− }
639− tx_buf->index = j;
640− tx_buf->phy_addr = pshm_drv->shm_tx_addr + (TX_BUF_SZ * j);
641− tx_buf->len = TX_BUF_SZ;
642− tx_buf->frames = 0;
643− tx_buf->frm_ofs = SHM_CAIF_FRM_OFS;
644−
645− if (pshm_dev->shm_loopback)
646− tx_buf->desc_vptr = (unsigned char *)tx_buf->phy_addr;
647− else
648− /*
649− * FIXME: the result of ioremap is not a pointer - arnd
650− */
651− tx_buf->desc_vptr =
652− ioremap(tx_buf->phy_addr, TX_BUF_SZ);
653−
654− list_add_tail(&tx_buf->list, &pshm_drv->tx_empty_list);
655− }
656−
657− for (j = 0; j < NR_RX_BUF; j++) {
658− struct buf_list *rx_buf =
659− kmalloc(sizeof(struct buf_list), GFP_KERNEL);
660−
661− if (rx_buf == NULL) {
662− free_netdev(pshm_dev->pshm_netdev);
663− return -ENOMEM;
664− }
665− rx_buf->index = j;
666− rx_buf->phy_addr = pshm_drv->shm_rx_addr + (RX_BUF_SZ * j);
667− rx_buf->len = RX_BUF_SZ;
668−
669− if (pshm_dev->shm_loopback)
670− rx_buf->desc_vptr = (unsigned char *)rx_buf->phy_addr;
671− else
672− rx_buf->desc_vptr =
673− ioremap(rx_buf->phy_addr, RX_BUF_SZ);
674− list_add_tail(&rx_buf->list, &pshm_drv->rx_empty_list);
675− }
676−
677− pshm_drv->tx_empty_available = 1;
678− result = register_netdev(pshm_dev->pshm_netdev);
679− if (result)
680− pr_warn("ERROR[%d], SHM could not, "
681− "register with NW FRMWK Bailing out ...\n", result);
682−
683− return result;
684−}
685−
686−void caif_shmcore_remove(struct net_device *pshm_netdev)
687−{
688− struct buf_list *pbuf;
689− struct shmdrv_layer *pshm_drv = NULL;
690−
691− pshm_drv = netdev_priv(pshm_netdev);
692−
693− while (!(list_empty(&pshm_drv->tx_pend_list))) {
694− pbuf =
695− list_entry(pshm_drv->tx_pend_list.next,
696− struct buf_list, list);
697−
698− list_del(&pbuf->list);
699− kfree(pbuf);
700− }
701−
702− while (!(list_empty(&pshm_drv->tx_full_list))) {
703− pbuf =
704− list_entry(pshm_drv->tx_full_list.next,
705− struct buf_list, list);
706− list_del(&pbuf->list);
707− kfree(pbuf);
708− }
709−
710− while (!(list_empty(&pshm_drv->tx_empty_list))) {
711− pbuf =
712− list_entry(pshm_drv->tx_empty_list.next,
713− struct buf_list, list);
714− list_del(&pbuf->list);
715− kfree(pbuf);
716− }
717−
718− while (!(list_empty(&pshm_drv->rx_full_list))) {
719− pbuf =
720− list_entry(pshm_drv->tx_full_list.next,
721− struct buf_list, list);
722− list_del(&pbuf->list);
723− kfree(pbuf);
724− }
725−
726− while (!(list_empty(&pshm_drv->rx_pend_list))) {
727− pbuf =
728− list_entry(pshm_drv->tx_pend_list.next,
729− struct buf_list, list);
730− list_del(&pbuf->list);
731− kfree(pbuf);
732− }
733−
734− while (!(list_empty(&pshm_drv->rx_empty_list))) {
735− pbuf =
736− list_entry(pshm_drv->rx_empty_list.next,
737− struct buf_list, list);
738− list_del(&pbuf->list);
739− kfree(pbuf);
740− }
741−
742− /* Destroy work queues. */
743− destroy_workqueue(pshm_drv->pshm_tx_workqueue);
744− destroy_workqueue(pshm_drv->pshm_rx_workqueue);
745−
746− unregister_netdev(pshm_netdev);
747−}
drivers/net/caif/caif_spi.c+3−3
@@ -1,7 +1,6 @@
11 /*
22 * Copyright (C) ST-Ericsson AB 2010
3− * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
4− * Author: Daniel Martensson / Daniel.Martensson@stericsson.com
3+ * Author: Daniel Martensson
54 * License terms: GNU General Public License (GPL) version 2.
65 */
76
@@ -29,7 +28,7 @@ · 21 unmodified lines
2928 #endif /* CONFIG_CAIF_SPI_SYNC */
3029
3130 MODULE_LICENSE("GPL");
32−MODULE_AUTHOR("Daniel Martensson<daniel.martensson@stericsson.com>");
31+MODULE_AUTHOR("Daniel Martensson");
3332 MODULE_DESCRIPTION("CAIF SPI driver");
3433
3534 /* Returns the number of padding bytes for alignment. */
@@ -864,6 +863,7 @@ static int __init cfspi_init_module(void) · 828 unmodified lines
864863 driver_remove_file(&cfspi_spi_driver.driver,
865864 &driver_attr_up_head_align);
866865 err_create_up_head_align:
866+ platform_driver_unregister(&cfspi_spi_driver);
867867 err_dev_register:
868868 return result;
869869 }
drivers/net/caif/caif_spi_slave.c+1−2
@@ -1,7 +1,6 @@
11 /*
22 * Copyright (C) ST-Ericsson AB 2010
3− * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
4− * Author: Daniel Martensson / Daniel.Martensson@stericsson.com
3+ * Author: Daniel Martensson
54 * License terms: GNU General Public License (GPL) version 2.
65 */
76 #include <linux/init.h>
drivers/net/can/Kconfig+1−1
@@ -65,7 +65,7 @@ config CAN_LEDS · 64 unmodified lines
6565
6666 config CAN_AT91
6767 tristate "Atmel AT91 onchip CAN controller"
68− depends on ARCH_AT91SAM9263 || ARCH_AT91SAM9X5
68+ depends on ARM
6969 ---help---
7070 This is a driver for the SoC CAN controller in Atmel's AT91SAM9263
7171 and AT91SAM9X5 processors.
drivers/net/can/at91_can.c+57−19
@@ -27,6 +27,7 @@ · 26 unmodified lines
2727 #include <linux/kernel.h>
2828 #include <linux/module.h>
2929 #include <linux/netdevice.h>
30+#include <linux/of.h>
3031 #include <linux/platform_device.h>
3132 #include <linux/rtnetlink.h>
3233 #include <linux/skbuff.h>
@@ -155,19 +156,20 @@ struct at91_priv { · 122 unmodified lines
155156 canid_t mb0_id;
156157 };
157158
158−static const struct at91_devtype_data at91_devtype_data[] = {
159− [AT91_DEVTYPE_SAM9263] = {
160− .rx_first = 1,
161− .rx_split = 8,
162− .rx_last = 11,
163− .tx_shift = 2,
164− },
165− [AT91_DEVTYPE_SAM9X5] = {
166− .rx_first = 0,
167− .rx_split = 4,
168− .rx_last = 5,
169− .tx_shift = 1,
170− },
159+static const struct at91_devtype_data at91_at91sam9263_data = {
160+ .rx_first = 1,
161+ .rx_split = 8,
162+ .rx_last = 11,
163+ .tx_shift = 2,
164+ .type = AT91_DEVTYPE_SAM9263,
165+};
166+
167+static const struct at91_devtype_data at91_at91sam9x5_data = {
168+ .rx_first = 0,
169+ .rx_split = 4,
170+ .rx_last = 5,
171+ .tx_shift = 1,
172+ .type = AT91_DEVTYPE_SAM9X5,
171173 };
172174
173175 static const struct can_bittiming_const at91_bittiming_const = {
@@ -1249,10 +1251,42 @@ static struct attribute_group at91_sysfs_attr_group = { · 1075 unmodified lines
12491251 .attrs = at91_sysfs_attrs,
12501252 };
12511253
1254+#if defined(CONFIG_OF)
1255+static const struct of_device_id at91_can_dt_ids[] = {
1256+ {
1257+ .compatible = "atmel,at91sam9x5-can",
1258+ .data = &at91_at91sam9x5_data,
1259+ }, {
1260+ .compatible = "atmel,at91sam9263-can",
1261+ .data = &at91_at91sam9263_data,
1262+ }, {
1263+ /* sentinel */
1264+ }
1265+};
1266+MODULE_DEVICE_TABLE(of, at91_can_dt_ids);
1267+#else
1268+#define at91_can_dt_ids NULL
1269+#endif
1270+
1271+static const struct at91_devtype_data *at91_can_get_driver_data(struct platform_device *pdev)
1272+{
1273+ if (pdev->dev.of_node) {
1274+ const struct of_device_id *match;
1275+
1276+ match = of_match_node(at91_can_dt_ids, pdev->dev.of_node);
1277+ if (!match) {
1278+ dev_err(&pdev->dev, "no matching node found in dtb\n");
1279+ return NULL;
1280+ }
1281+ return (const struct at91_devtype_data *)match->data;
1282+ }
1283+ return (const struct at91_devtype_data *)
1284+ platform_get_device_id(pdev)->driver_data;
1285+}
1286+
12521287 static int at91_can_probe(struct platform_device *pdev)
12531288 {
12541289 const struct at91_devtype_data *devtype_data;
1255− enum at91_devtype devtype;
12561290 struct net_device *dev;
12571291 struct at91_priv *priv;
12581292 struct resource *res;
@@ -1260,8 +1294,12 @@ static int at91_can_probe(struct platform_device *pdev) · 1 unmodified line
12601294 void __iomem *addr;
12611295 int err, irq;
12621296
1263− devtype = pdev->id_entry->driver_data;
1264− devtype_data = &at91_devtype_data[devtype];
1297+ devtype_data = at91_can_get_driver_data(pdev);
1298+ if (!devtype_data) {
1299+ dev_err(&pdev->dev, "no driver data\n");
1300+ err = -ENODEV;
1301+ goto exit;
1302+ }
12651303
12661304 clk = clk_get(&pdev->dev, "can_clk");
12671305 if (IS_ERR(clk)) {
@@ -1310,7 +1348,6 @@ static int at91_can_probe(struct platform_device *pdev) · 42 unmodified lines
13101348 priv->dev = dev;
13111349 priv->reg_base = addr;
13121350 priv->devtype_data = *devtype_data;
1313− priv->devtype_data.type = devtype;
13141351 priv->clk = clk;
13151352 priv->pdata = pdev->dev.platform_data;
13161353 priv->mb0_id = 0x7ff;
@@ -1373,10 +1410,10 @@ static int at91_can_remove(struct platform_device *pdev) · 56 unmodified lines
13731410 static const struct platform_device_id at91_can_id_table[] = {
13741411 {
13751412 .name = "at91_can",
1376− .driver_data = AT91_DEVTYPE_SAM9263,
1413+ .driver_data = (kernel_ulong_t)&at91_at91sam9x5_data,
13771414 }, {
13781415 .name = "at91sam9x5_can",
1379− .driver_data = AT91_DEVTYPE_SAM9X5,
1416+ .driver_data = (kernel_ulong_t)&at91_at91sam9263_data,
13801417 }, {
13811418 /* sentinel */
13821419 }
@@ -1389,6 +1426,7 @@ static struct platform_driver at91_can_driver = { · 6 unmodified lines
13891426 .driver = {
13901427 .name = KBUILD_MODNAME,
13911428 .owner = THIS_MODULE,
1429+ .of_match_table = at91_can_dt_ids,
13921430 },
13931431 .id_table = at91_can_id_table,
13941432 };
drivers/net/can/bfin_can.c+2−2
@@ -412,7 +412,7 @@ static int bfin_can_err(struct net_device *dev, u16 isrc, u16 status) · 411 unmodified lines
412412 return 0;
413413 }
414414
415−irqreturn_t bfin_can_interrupt(int irq, void *dev_id)
415+static irqreturn_t bfin_can_interrupt(int irq, void *dev_id)
416416 {
417417 struct net_device *dev = dev_id;
418418 struct bfin_can_priv *priv = netdev_priv(dev);
@@ -504,7 +504,7 @@ static int bfin_can_close(struct net_device *dev) · 85 unmodified lines
504504 return 0;
505505 }
506506
507−struct net_device *alloc_bfin_candev(void)
507+static struct net_device *alloc_bfin_candev(void)
508508 {
509509 struct net_device *dev;
510510 struct bfin_can_priv *priv;
drivers/net/can/mcp251x.c+27−38
@@ -269,7 +269,7 @@ struct mcp251x_priv { · 268 unmodified lines
269269 #define MCP251X_IS(_model) \
270270 static inline int mcp251x_is_##_model(struct spi_device *spi) \
271271 { \
272− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev); \
272+ struct mcp251x_priv *priv = spi_get_drvdata(spi); \
273273 return priv->model == CAN_MCP251X_MCP##_model; \
274274 }
275275
@@ -305,7 +305,7 @@ static void mcp251x_clean(struct net_device *net) · 29 unmodified lines
305305 */
306306 static int mcp251x_spi_trans(struct spi_device *spi, int len)
307307 {
308− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
308+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
309309 struct spi_transfer t = {
310310 .tx_buf = priv->spi_tx_buf,
311311 .rx_buf = priv->spi_rx_buf,
@@ -333,7 +333,7 @@ static int mcp251x_spi_trans(struct spi_device *spi, int len) · 21 unmodified lines
333333
334334 static u8 mcp251x_read_reg(struct spi_device *spi, uint8_t reg)
335335 {
336− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
336+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
337337 u8 val = 0;
338338
339339 priv->spi_tx_buf[0] = INSTRUCTION_READ;
@@ -348,7 +348,7 @@ static u8 mcp251x_read_reg(struct spi_device *spi, uint8_t reg) · 8 unmodified lines
348348 static void mcp251x_read_2regs(struct spi_device *spi, uint8_t reg,
349349 uint8_t *v1, uint8_t *v2)
350350 {
351− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
351+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
352352
353353 priv->spi_tx_buf[0] = INSTRUCTION_READ;
354354 priv->spi_tx_buf[1] = reg;
@@ -361,7 +361,7 @@ static void mcp251x_read_2regs(struct spi_device *spi, uint8_t reg, · 6 unmodified lines
361361
362362 static void mcp251x_write_reg(struct spi_device *spi, u8 reg, uint8_t val)
363363 {
364− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
364+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
365365
366366 priv->spi_tx_buf[0] = INSTRUCTION_WRITE;
367367 priv->spi_tx_buf[1] = reg;
@@ -373,7 +373,7 @@ static void mcp251x_write_reg(struct spi_device *spi, u8 reg, uint8_t val) · 5 unmodified lines
373373 static void mcp251x_write_bits(struct spi_device *spi, u8 reg,
374374 u8 mask, uint8_t val)
375375 {
376− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
376+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
377377
378378 priv->spi_tx_buf[0] = INSTRUCTION_BIT_MODIFY;
379379 priv->spi_tx_buf[1] = reg;
@@ -386,7 +386,7 @@ static void mcp251x_write_bits(struct spi_device *spi, u8 reg, · 6 unmodified lines
386386 static void mcp251x_hw_tx_frame(struct spi_device *spi, u8 *buf,
387387 int len, int tx_buf_idx)
388388 {
389− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
389+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
390390
391391 if (mcp251x_is_2510(spi)) {
392392 int i;
@@ -403,7 +403,7 @@ static void mcp251x_hw_tx_frame(struct spi_device *spi, u8 *buf, · 10 unmodified lines
403403 static void mcp251x_hw_tx(struct spi_device *spi, struct can_frame *frame,
404404 int tx_buf_idx)
405405 {
406− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
406+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
407407 u32 sid, eid, exide, rtr;
408408 u8 buf[SPI_TRANSFER_BUF_LEN];
409409
@@ -434,7 +434,7 @@ static void mcp251x_hw_tx(struct spi_device *spi, struct can_frame *frame, · 24 unmodified lines
434434 static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf,
435435 int buf_idx)
436436 {
437− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
437+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
438438
439439 if (mcp251x_is_2510(spi)) {
440440 int i, len;
@@ -454,7 +454,7 @@ static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf, · 13 unmodified lines
454454
455455 static void mcp251x_hw_rx(struct spi_device *spi, int buf_idx)
456456 {
457− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
457+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
458458 struct sk_buff *skb;
459459 struct can_frame *frame;
460460 u8 buf[SPI_TRANSFER_BUF_LEN];
@@ -550,7 +550,7 @@ static int mcp251x_do_set_mode(struct net_device *net, enum can_mode mode) · 89 unmodified lines
550550
551551 static int mcp251x_set_normal_mode(struct spi_device *spi)
552552 {
553− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
553+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
554554 unsigned long timeout;
555555
556556 /* Enable interrupts */
@@ -620,7 +620,7 @@ static int mcp251x_setup(struct net_device *net, struct mcp251x_priv *priv, · 63 unmodified lines
620620
621621 static int mcp251x_hw_reset(struct spi_device *spi)
622622 {
623− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
623+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
624624 int ret;
625625 unsigned long timeout;
626626
@@ -1026,7 +1026,7 @@ static int mcp251x_can_probe(struct spi_device *spi) · 399 unmodified lines
10261026 CAN_CTRLMODE_LOOPBACK | CAN_CTRLMODE_LISTENONLY;
10271027 priv->model = spi_get_device_id(spi)->driver_data;
10281028 priv->net = net;
1029− dev_set_drvdata(&spi->dev, priv);
1029+ spi_set_drvdata(spi, priv);
10301030
10311031 priv->spi = spi;
10321032 mutex_init(&priv->mcp_lock);
@@ -1124,7 +1124,7 @@ error_out: · 91 unmodified lines
11241124 static int mcp251x_can_remove(struct spi_device *spi)
11251125 {
11261126 struct mcp251x_platform_data *pdata = spi->dev.platform_data;
1127− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
1127+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
11281128 struct net_device *net = priv->net;
11291129
11301130 unregister_candev(net);
@@ -1144,11 +1144,13 @@ static int mcp251x_can_remove(struct spi_device *spi) · 13 unmodified lines
11441144 return 0;
11451145 }
11461146
1147−#ifdef CONFIG_PM
1148−static int mcp251x_can_suspend(struct spi_device *spi, pm_message_t state)
1147+#ifdef CONFIG_PM_SLEEP
1148+
1149+static int mcp251x_can_suspend(struct device *dev)
11491150 {
1151+ struct spi_device *spi = to_spi_device(dev);
11501152 struct mcp251x_platform_data *pdata = spi->dev.platform_data;
1151− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
1153+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
11521154 struct net_device *net = priv->net;
11531155
11541156 priv->force_quit = 1;
@@ -1176,10 +1178,11 @@ static int mcp251x_can_suspend(struct spi_device *spi, pm_message_t state) · 21 unmodified lines
11761178 return 0;
11771179 }
11781180
1179−static int mcp251x_can_resume(struct spi_device *spi)
1181+static int mcp251x_can_resume(struct device *dev)
11801182 {
1183+ struct spi_device *spi = to_spi_device(dev);
11811184 struct mcp251x_platform_data *pdata = spi->dev.platform_data;
1182− struct mcp251x_priv *priv = dev_get_drvdata(&spi->dev);
1185+ struct mcp251x_priv *priv = spi_get_drvdata(spi);
11831186
11841187 if (priv->after_suspend & AFTER_SUSPEND_POWER) {
11851188 pdata->power_enable(1);
@@ -1197,11 +1200,11 @@ static int mcp251x_can_resume(struct spi_device *spi) · 11 unmodified lines
11971200 enable_irq(spi->irq);
11981201 return 0;
11991202 }
1200−#else
1201−#define mcp251x_can_suspend NULL
1202−#define mcp251x_can_resume NULL
12031203 #endif
12041204
1205+static SIMPLE_DEV_PM_OPS(mcp251x_can_pm_ops, mcp251x_can_suspend,
1206+ mcp251x_can_resume);
1207+
12051208 static const struct spi_device_id mcp251x_id_table[] = {
12061209 { "mcp2510", CAN_MCP251X_MCP2510 },
12071210 { "mcp2515", CAN_MCP251X_MCP2515 },
@@ -1213,29 +1216,15 @@ MODULE_DEVICE_TABLE(spi, mcp251x_id_table); · 5 unmodified lines
12131216 static struct spi_driver mcp251x_can_driver = {
12141217 .driver = {
12151218 .name = DEVICE_NAME,
1216− .bus = &spi_bus_type,
12171219 .owner = THIS_MODULE,
1220+ .pm = &mcp251x_can_pm_ops,
12181221 },
12191222
12201223 .id_table = mcp251x_id_table,
12211224 .probe = mcp251x_can_probe,
12221225 .remove = mcp251x_can_remove,
1223− .suspend = mcp251x_can_suspend,
1224− .resume = mcp251x_can_resume,
12251226 };
1226−
1227−static int __init mcp251x_can_init(void)
1228−{
1229− return spi_register_driver(&mcp251x_can_driver);
1230−}
1231−
1232−static void __exit mcp251x_can_exit(void)
1233−{
1234− spi_unregister_driver(&mcp251x_can_driver);
1235−}
1236−
1237−module_init(mcp251x_can_init);
1238−module_exit(mcp251x_can_exit);
1227+module_spi_driver(mcp251x_can_driver);
12391228
12401229 MODULE_AUTHOR("Chris Elston <celston@katalix.com>, "
12411230 "Christian Pellegrin <chripell@evolware.org>");
drivers/net/can/sja1000/ems_pci.c+3−3
@@ -168,12 +168,12 @@ static inline int ems_pci_check_chan(const struct sja1000_priv *priv) · 167 unmodified lines
168168 unsigned char res;
169169
170170 /* Make sure SJA1000 is in reset mode */
171− priv->write_reg(priv, REG_MOD, 1);
171+ priv->write_reg(priv, SJA1000_MOD, 1);
172172
173− priv->write_reg(priv, REG_CDR, CDR_PELICAN);
173+ priv->write_reg(priv, SJA1000_CDR, CDR_PELICAN);
174174
175175 /* read reset-values */
176− res = priv->read_reg(priv, REG_CDR);
176+ res = priv->read_reg(priv, SJA1000_CDR);
177177
178178 if (res == CDR_PELICAN)
179179 return 1;
drivers/net/can/sja1000/ems_pcmcia.c+3−3
@@ -126,11 +126,11 @@ static irqreturn_t ems_pcmcia_interrupt(int irq, void *dev_id) · 125 unmodified lines
126126 static inline int ems_pcmcia_check_chan(struct sja1000_priv *priv)
127127 {
128128 /* Make sure SJA1000 is in reset mode */
129− ems_pcmcia_write_reg(priv, REG_MOD, 1);
130− ems_pcmcia_write_reg(priv, REG_CDR, CDR_PELICAN);
129+ ems_pcmcia_write_reg(priv, SJA1000_MOD, 1);
130+ ems_pcmcia_write_reg(priv, SJA1000_CDR, CDR_PELICAN);
131131
132132 /* read reset-values */
133− if (ems_pcmcia_read_reg(priv, REG_CDR) == CDR_PELICAN)
133+ if (ems_pcmcia_read_reg(priv, SJA1000_CDR) == CDR_PELICAN)
134134 return 1;
135135
136136 return 0;
drivers/net/can/sja1000/kvaser_pci.c+2−2
@@ -159,9 +159,9 @@ static int number_of_sja1000_chip(void __iomem *base_addr) · 158 unmodified lines
159159 for (i = 0; i < MAX_NO_OF_CHANNELS; i++) {
160160 /* reset chip */
161161 iowrite8(MOD_RM, base_addr +
162− (i * KVASER_PCI_PORT_BYTES) + REG_MOD);
162+ (i * KVASER_PCI_PORT_BYTES) + SJA1000_MOD);
163163 status = ioread8(base_addr +
164− (i * KVASER_PCI_PORT_BYTES) + REG_MOD);
164+ (i * KVASER_PCI_PORT_BYTES) + SJA1000_MOD);
165165 /* check reset bit */
166166 if (!(status & MOD_RM))
167167 break;
drivers/net/can/sja1000/peak_pci.c+1−1
@@ -402,7 +402,7 @@ static void peak_pciec_write_reg(const struct sja1000_priv *priv, · 401 unmodified lines
402402 int c = (priv->reg_base - card->reg_base) / PEAK_PCI_CHAN_SIZE;
403403
404404 /* sja1000 register changes control the leds state */
405− if (port == REG_MOD)
405+ if (port == SJA1000_MOD)
406406 switch (val) {
407407 case MOD_RM:
408408 /* Reset Mode: set led on */
drivers/net/can/sja1000/peak_pcmcia.c+4−4
@@ -196,7 +196,7 @@ static void pcan_write_canreg(const struct sja1000_priv *priv, int port, u8 v) · 195 unmodified lines
196196 int c = (priv->reg_base - card->ioport_addr) / PCC_CHAN_SIZE;
197197
198198 /* sja1000 register changes control the leds state */
199− if (port == REG_MOD)
199+ if (port == SJA1000_MOD)
200200 switch (v) {
201201 case MOD_RM:
202202 /* Reset Mode: set led on */
@@ -509,11 +509,11 @@ static void pcan_free_channels(struct pcan_pccard *card) · 306 unmodified lines
509509 static inline int pcan_channel_present(struct sja1000_priv *priv)
510510 {
511511 /* make sure SJA1000 is in reset mode */
512− pcan_write_canreg(priv, REG_MOD, 1);
513− pcan_write_canreg(priv, REG_CDR, CDR_PELICAN);
512+ pcan_write_canreg(priv, SJA1000_MOD, 1);
513+ pcan_write_canreg(priv, SJA1000_CDR, CDR_PELICAN);
514514
515515 /* read reset-values */
516− if (pcan_read_canreg(priv, REG_CDR) == CDR_PELICAN)
516+ if (pcan_read_canreg(priv, SJA1000_CDR) == CDR_PELICAN)
517517 return 1;
518518
519519 return 0;
drivers/net/can/sja1000/plx_pci.c+6−6
@@ -348,20 +348,20 @@ static inline int plx_pci_check_sja1000(const struct sja1000_priv *priv) · 347 unmodified lines
348348 */
349349 if ((priv->read_reg(priv, REG_CR) & REG_CR_BASICCAN_INITIAL_MASK) ==
350350 REG_CR_BASICCAN_INITIAL &&
351− (priv->read_reg(priv, SJA1000_REG_SR) == REG_SR_BASICCAN_INITIAL) &&
352− (priv->read_reg(priv, REG_IR) == REG_IR_BASICCAN_INITIAL))
351+ (priv->read_reg(priv, SJA1000_SR) == REG_SR_BASICCAN_INITIAL) &&
352+ (priv->read_reg(priv, SJA1000_IR) == REG_IR_BASICCAN_INITIAL))
353353 flag = 1;
354354
355355 /* Bring the SJA1000 into the PeliCAN mode*/
356− priv->write_reg(priv, REG_CDR, CDR_PELICAN);
356+ priv->write_reg(priv, SJA1000_CDR, CDR_PELICAN);
357357
358358 /*
359359 * Check registers after reset in the PeliCAN mode.
360360 * See states on p. 23 of the Datasheet.
361361 */
362− if (priv->read_reg(priv, REG_MOD) == REG_MOD_PELICAN_INITIAL &&
363− priv->read_reg(priv, SJA1000_REG_SR) == REG_SR_PELICAN_INITIAL &&
364− priv->read_reg(priv, REG_IR) == REG_IR_PELICAN_INITIAL)
362+ if (priv->read_reg(priv, SJA1000_MOD) == REG_MOD_PELICAN_INITIAL &&
363+ priv->read_reg(priv, SJA1000_SR) == REG_SR_PELICAN_INITIAL &&
364+ priv->read_reg(priv, SJA1000_IR) == REG_IR_PELICAN_INITIAL)
365365 return flag;
366366
367367 return 0;
drivers/net/can/sja1000/sja1000.c+64−62
@@ -91,14 +91,14 @@ static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val) · 90 unmodified lines
9191 * the write_reg() operation - especially on SMP systems.
9292 */
9393 spin_lock_irqsave(&priv->cmdreg_lock, flags);
94− priv->write_reg(priv, REG_CMR, val);
95− priv->read_reg(priv, SJA1000_REG_SR);
94+ priv->write_reg(priv, SJA1000_CMR, val);
95+ priv->read_reg(priv, SJA1000_SR);
9696 spin_unlock_irqrestore(&priv->cmdreg_lock, flags);
9797 }
9898
9999 static int sja1000_is_absent(struct sja1000_priv *priv)
100100 {
101− return (priv->read_reg(priv, REG_MOD) == 0xFF);
101+ return (priv->read_reg(priv, SJA1000_MOD) == 0xFF);
102102 }
103103
104104 static int sja1000_probe_chip(struct net_device *dev)
@@ -116,11 +116,11 @@ static int sja1000_probe_chip(struct net_device *dev) · 11 unmodified lines
116116 static void set_reset_mode(struct net_device *dev)
117117 {
118118 struct sja1000_priv *priv = netdev_priv(dev);
119− unsigned char status = priv->read_reg(priv, REG_MOD);
119+ unsigned char status = priv->read_reg(priv, SJA1000_MOD);
120120 int i;
121121
122122 /* disable interrupts */
123− priv->write_reg(priv, REG_IER, IRQ_OFF);
123+ priv->write_reg(priv, SJA1000_IER, IRQ_OFF);
124124
125125 for (i = 0; i < 100; i++) {
126126 /* check reset bit */
@@ -129,9 +129,10 @@ static void set_reset_mode(struct net_device *dev) · 2 unmodified lines
129129 return;
130130 }
131131
132− priv->write_reg(priv, REG_MOD, MOD_RM); /* reset chip */
132+ /* reset chip */
133+ priv->write_reg(priv, SJA1000_MOD, MOD_RM);
133134 udelay(10);
134− status = priv->read_reg(priv, REG_MOD);
135+ status = priv->read_reg(priv, SJA1000_MOD);
135136 }
136137
137138 netdev_err(dev, "setting SJA1000 into reset mode failed!\n");
@@ -140,7 +141,7 @@ static void set_reset_mode(struct net_device *dev) · 2 unmodified lines
140141 static void set_normal_mode(struct net_device *dev)
141142 {
142143 struct sja1000_priv *priv = netdev_priv(dev);
143− unsigned char status = priv->read_reg(priv, REG_MOD);
144+ unsigned char status = priv->read_reg(priv, SJA1000_MOD);
144145 int i;
145146
146147 for (i = 0; i < 100; i++) {
@@ -149,22 +150,22 @@ static void set_normal_mode(struct net_device *dev) · 2 unmodified lines
149150 priv->can.state = CAN_STATE_ERROR_ACTIVE;
150151 /* enable interrupts */
151152 if (priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)
152− priv->write_reg(priv, REG_IER, IRQ_ALL);
153+ priv->write_reg(priv, SJA1000_IER, IRQ_ALL);
153154 else
154− priv->write_reg(priv, REG_IER,
155+ priv->write_reg(priv, SJA1000_IER,
155156 IRQ_ALL & ~IRQ_BEI);
156157 return;
157158 }
158159
159160 /* set chip to normal mode */
160161 if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
161− priv->write_reg(priv, REG_MOD, MOD_LOM);
162+ priv->write_reg(priv, SJA1000_MOD, MOD_LOM);
162163 else
163− priv->write_reg(priv, REG_MOD, 0x00);
164+ priv->write_reg(priv, SJA1000_MOD, 0x00);
164165
165166 udelay(10);
166167
167− status = priv->read_reg(priv, REG_MOD);
168+ status = priv->read_reg(priv, SJA1000_MOD);
168169 }
169170
170171 netdev_err(dev, "setting SJA1000 into normal mode failed!\n");
@@ -179,9 +180,9 @@ static void sja1000_start(struct net_device *dev) · 8 unmodified lines
179180 set_reset_mode(dev);
180181
181182 /* Clear error counters and error code capture */
182− priv->write_reg(priv, REG_TXERR, 0x0);
183− priv->write_reg(priv, REG_RXERR, 0x0);
184− priv->read_reg(priv, REG_ECC);
183+ priv->write_reg(priv, SJA1000_TXERR, 0x0);
184+ priv->write_reg(priv, SJA1000_RXERR, 0x0);
185+ priv->read_reg(priv, SJA1000_ECC);
185186
186187 /* leave reset mode */
187188 set_normal_mode(dev);
@@ -217,8 +218,8 @@ static int sja1000_set_bittiming(struct net_device *dev) · 29 unmodified lines
217218
218219 netdev_info(dev, "setting BTR0=0x%02x BTR1=0x%02x\n", btr0, btr1);
219220
220− priv->write_reg(priv, REG_BTR0, btr0);
221− priv->write_reg(priv, REG_BTR1, btr1);
221+ priv->write_reg(priv, SJA1000_BTR0, btr0);
222+ priv->write_reg(priv, SJA1000_BTR1, btr1);
222223
223224 return 0;
224225 }
@@ -228,8 +229,8 @@ static int sja1000_get_berr_counter(const struct net_device *dev, · 3 unmodified lines
228229 {
229230 struct sja1000_priv *priv = netdev_priv(dev);
230231
231− bec->txerr = priv->read_reg(priv, REG_TXERR);
232− bec->rxerr = priv->read_reg(priv, REG_RXERR);
232+ bec->txerr = priv->read_reg(priv, SJA1000_TXERR);
233+ bec->rxerr = priv->read_reg(priv, SJA1000_RXERR);
233234
234235 return 0;
235236 }
@@ -247,20 +248,20 @@ static void chipset_init(struct net_device *dev) · 11 unmodified lines
247248 struct sja1000_priv *priv = netdev_priv(dev);
248249
249250 /* set clock divider and output control register */
250− priv->write_reg(priv, REG_CDR, priv->cdr | CDR_PELICAN);
251+ priv->write_reg(priv, SJA1000_CDR, priv->cdr | CDR_PELICAN);
251252
252253 /* set acceptance filter (accept all) */
253− priv->write_reg(priv, REG_ACCC0, 0x00);
254− priv->write_reg(priv, REG_ACCC1, 0x00);
255− priv->write_reg(priv, REG_ACCC2, 0x00);
256− priv->write_reg(priv, REG_ACCC3, 0x00);
254+ priv->write_reg(priv, SJA1000_ACCC0, 0x00);
255+ priv->write_reg(priv, SJA1000_ACCC1, 0x00);
256+ priv->write_reg(priv, SJA1000_ACCC2, 0x00);
257+ priv->write_reg(priv, SJA1000_ACCC3, 0x00);
257258
258− priv->write_reg(priv, REG_ACCM0, 0xFF);
259− priv->write_reg(priv, REG_ACCM1, 0xFF);
260− priv->write_reg(priv, REG_ACCM2, 0xFF);
261− priv->write_reg(priv, REG_ACCM3, 0xFF);
259+ priv->write_reg(priv, SJA1000_ACCM0, 0xFF);
260+ priv->write_reg(priv, SJA1000_ACCM1, 0xFF);
261+ priv->write_reg(priv, SJA1000_ACCM2, 0xFF);
262+ priv->write_reg(priv, SJA1000_ACCM3, 0xFF);
262263
263− priv->write_reg(priv, REG_OCR, priv->ocr | OCR_MODE_NORMAL);
264+ priv->write_reg(priv, SJA1000_OCR, priv->ocr | OCR_MODE_NORMAL);
264265 }
265266
266267 /*
@@ -289,21 +290,21 @@ static netdev_tx_t sja1000_start_xmit(struct sk_buff *skb, · 22 unmodified lines
289290 id = cf->can_id;
290291
291292 if (id & CAN_RTR_FLAG)
292− fi |= FI_RTR;
293+ fi |= SJA1000_FI_RTR;
293294
294295 if (id & CAN_EFF_FLAG) {
295− fi |= FI_FF;
296− dreg = EFF_BUF;
297− priv->write_reg(priv, REG_FI, fi);
298− priv->write_reg(priv, REG_ID1, (id & 0x1fe00000) >> (5 + 16));
299− priv->write_reg(priv, REG_ID2, (id & 0x001fe000) >> (5 + 8));
300− priv->write_reg(priv, REG_ID3, (id & 0x00001fe0) >> 5);
301− priv->write_reg(priv, REG_ID4, (id & 0x0000001f) << 3);
296+ fi |= SJA1000_FI_FF;
297+ dreg = SJA1000_EFF_BUF;
298+ priv->write_reg(priv, SJA1000_FI, fi);
299+ priv->write_reg(priv, SJA1000_ID1, (id & 0x1fe00000) >> 21);
300+ priv->write_reg(priv, SJA1000_ID2, (id & 0x001fe000) >> 13);
301+ priv->write_reg(priv, SJA1000_ID3, (id & 0x00001fe0) >> 5);
302+ priv->write_reg(priv, SJA1000_ID4, (id & 0x0000001f) << 3);
302303 } else {
303− dreg = SFF_BUF;
304− priv->write_reg(priv, REG_FI, fi);
305− priv->write_reg(priv, REG_ID1, (id & 0x000007f8) >> 3);
306− priv->write_reg(priv, REG_ID2, (id & 0x00000007) << 5);
304+ dreg = SJA1000_SFF_BUF;
305+ priv->write_reg(priv, SJA1000_FI, fi);
306+ priv->write_reg(priv, SJA1000_ID1, (id & 0x000007f8) >> 3);
307+ priv->write_reg(priv, SJA1000_ID2, (id & 0x00000007) << 5);
307308 }
308309
309310 for (i = 0; i < dlc; i++)
@@ -335,25 +336,25 @@ static void sja1000_rx(struct net_device *dev) · 25 unmodified lines
335336 if (skb == NULL)
336337 return;
337338
338− fi = priv->read_reg(priv, REG_FI);
339+ fi = priv->read_reg(priv, SJA1000_FI);
339340
340− if (fi & FI_FF) {
341+ if (fi & SJA1000_FI_FF) {
341342 /* extended frame format (EFF) */
342− dreg = EFF_BUF;
343− id = (priv->read_reg(priv, REG_ID1) << (5 + 16))
344− | (priv->read_reg(priv, REG_ID2) << (5 + 8))
345− | (priv->read_reg(priv, REG_ID3) << 5)
346− | (priv->read_reg(priv, REG_ID4) >> 3);
343+ dreg = SJA1000_EFF_BUF;
344+ id = (priv->read_reg(priv, SJA1000_ID1) << 21)
345+ | (priv->read_reg(priv, SJA1000_ID2) << 13)
346+ | (priv->read_reg(priv, SJA1000_ID3) << 5)
347+ | (priv->read_reg(priv, SJA1000_ID4) >> 3);
347348 id |= CAN_EFF_FLAG;
348349 } else {
349350 /* standard frame format (SFF) */
350− dreg = SFF_BUF;
351− id = (priv->read_reg(priv, REG_ID1) << 3)
352− | (priv->read_reg(priv, REG_ID2) >> 5);
351+ dreg = SJA1000_SFF_BUF;
352+ id = (priv->read_reg(priv, SJA1000_ID1) << 3)
353+ | (priv->read_reg(priv, SJA1000_ID2) >> 5);
353354 }
354355
355356 cf->can_dlc = get_can_dlc(fi & 0x0F);
356− if (fi & FI_RTR) {
357+ if (fi & SJA1000_FI_RTR) {
357358 id |= CAN_RTR_FLAG;
358359 } else {
359360 for (i = 0; i < cf->can_dlc; i++)
@@ -414,7 +415,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) · 54 unmodified lines
414415 priv->can.can_stats.bus_error++;
415416 stats->rx_errors++;
416417
417− ecc = priv->read_reg(priv, REG_ECC);
418+ ecc = priv->read_reg(priv, SJA1000_ECC);
418419
419420 cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
420421
@@ -448,7 +449,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) · 27 unmodified lines
448449 if (isrc & IRQ_ALI) {
449450 /* arbitration lost interrupt */
450451 netdev_dbg(dev, "arbitration lost interrupt\n");
451− alc = priv->read_reg(priv, REG_ALC);
452+ alc = priv->read_reg(priv, SJA1000_ALC);
452453 priv->can.can_stats.arbitration_lost++;
453454 stats->tx_errors++;
454455 cf->can_id |= CAN_ERR_LOSTARB;
@@ -457,8 +458,8 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status) · 2 unmodified lines
457458
458459 if (state != priv->can.state && (state == CAN_STATE_ERROR_WARNING ||
459460 state == CAN_STATE_ERROR_PASSIVE)) {
460− uint8_t rxerr = priv->read_reg(priv, REG_RXERR);
461− uint8_t txerr = priv->read_reg(priv, REG_TXERR);
461+ uint8_t rxerr = priv->read_reg(priv, SJA1000_RXERR);
462+ uint8_t txerr = priv->read_reg(priv, SJA1000_TXERR);
462463 cf->can_id |= CAN_ERR_CRTL;
463464 if (state == CAN_STATE_ERROR_WARNING) {
464465 priv->can.can_stats.error_warning++;
@@ -494,15 +495,16 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) · 29 unmodified lines
494495 int n = 0;
495496
496497 /* Shared interrupts and IRQ off? */
497− if (priv->read_reg(priv, REG_IER) == IRQ_OFF)
498+ if (priv->read_reg(priv, SJA1000_IER) == IRQ_OFF)
498499 return IRQ_NONE;
499500
500501 if (priv->pre_irq)
501502 priv->pre_irq(priv);
502503
503− while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) {
504+ while ((isrc = priv->read_reg(priv, SJA1000_IR)) &&
505+ (n < SJA1000_MAX_IRQ)) {
504506 n++;
505− status = priv->read_reg(priv, SJA1000_REG_SR);
507+ status = priv->read_reg(priv, SJA1000_SR);
506508 /* check for absent controller due to hw unplug */
507509 if (status == 0xFF && sja1000_is_absent(priv))
508510 return IRQ_NONE;
@@ -519,7 +521,7 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) · 10 unmodified lines
519521 } else {
520522 /* transmission complete */
521523 stats->tx_bytes +=
522− priv->read_reg(priv, REG_FI) & 0xf;
524+ priv->read_reg(priv, SJA1000_FI) & 0xf;
523525 stats->tx_packets++;
524526 can_get_echo_skb(dev, 0);
525527 }
@@ -530,7 +532,7 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id) · 4 unmodified lines
530532 /* receive interrupt */
531533 while (status & SR_RBS) {
532534 sja1000_rx(dev);
533− status = priv->read_reg(priv, SJA1000_REG_SR);
535+ status = priv->read_reg(priv, SJA1000_SR);
534536 /* check for absent controller */
535537 if (status == 0xFF && sja1000_is_absent(priv))
536538 return IRQ_NONE;
drivers/net/can/sja1000/sja1000.h+34−34
@@ -54,46 +54,46 @@ · 53 unmodified lines
5454 #define SJA1000_MAX_IRQ 20 /* max. number of interrupts handled in ISR */
5555
5656 /* SJA1000 registers - manual section 6.4 (Pelican Mode) */
57−#define REG_MOD 0x00
58−#define REG_CMR 0x01
59−#define SJA1000_REG_SR 0x02
60−#define REG_IR 0x03
61−#define REG_IER 0x04
62−#define REG_ALC 0x0B
63−#define REG_ECC 0x0C
64−#define REG_EWL 0x0D
65−#define REG_RXERR 0x0E
66−#define REG_TXERR 0x0F
67−#define REG_ACCC0 0x10
68−#define REG_ACCC1 0x11
69−#define REG_ACCC2 0x12
70−#define REG_ACCC3 0x13
71−#define REG_ACCM0 0x14
72−#define REG_ACCM1 0x15
73−#define REG_ACCM2 0x16
74−#define REG_ACCM3 0x17
75−#define REG_RMC 0x1D
76−#define REG_RBSA 0x1E
57+#define SJA1000_MOD 0x00
58+#define SJA1000_CMR 0x01
59+#define SJA1000_SR 0x02
60+#define SJA1000_IR 0x03
61+#define SJA1000_IER 0x04
62+#define SJA1000_ALC 0x0B
63+#define SJA1000_ECC 0x0C
64+#define SJA1000_EWL 0x0D
65+#define SJA1000_RXERR 0x0E
66+#define SJA1000_TXERR 0x0F
67+#define SJA1000_ACCC0 0x10
68+#define SJA1000_ACCC1 0x11
69+#define SJA1000_ACCC2 0x12
70+#define SJA1000_ACCC3 0x13
71+#define SJA1000_ACCM0 0x14
72+#define SJA1000_ACCM1 0x15
73+#define SJA1000_ACCM2 0x16
74+#define SJA1000_ACCM3 0x17
75+#define SJA1000_RMC 0x1D
76+#define SJA1000_RBSA 0x1E
7777
7878 /* Common registers - manual section 6.5 */
79−#define REG_BTR0 0x06
80−#define REG_BTR1 0x07
81−#define REG_OCR 0x08
82−#define REG_CDR 0x1F
79+#define SJA1000_BTR0 0x06
80+#define SJA1000_BTR1 0x07
81+#define SJA1000_OCR 0x08
82+#define SJA1000_CDR 0x1F
8383
84−#define REG_FI 0x10
85−#define SFF_BUF 0x13
86−#define EFF_BUF 0x15
84+#define SJA1000_FI 0x10
85+#define SJA1000_SFF_BUF 0x13
86+#define SJA1000_EFF_BUF 0x15
8787
88−#define FI_FF 0x80
89−#define FI_RTR 0x40
88+#define SJA1000_FI_FF 0x80
89+#define SJA1000_FI_RTR 0x40
9090
91−#define REG_ID1 0x11
92−#define REG_ID2 0x12
93−#define REG_ID3 0x13
94−#define REG_ID4 0x14
91+#define SJA1000_ID1 0x11
92+#define SJA1000_ID2 0x12
93+#define SJA1000_ID3 0x13
94+#define SJA1000_ID4 0x14
9595
96−#define CAN_RAM 0x20
96+#define SJA1000_CAN_RAM 0x20
9797
9898 /* mode register */
9999 #define MOD_RM 0x01
drivers/net/ethernet/3com/3c509.c+2−0
@@ -306,6 +306,7 @@ static int el3_isa_match(struct device *pdev, unsigned int ndev) · 305 unmodified lines
306306 if (!dev)
307307 return -ENOMEM;
308308
309+ SET_NETDEV_DEV(dev, pdev);
309310 netdev_boot_setup_check(dev);
310311
311312 if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509-isa")) {
@@ -595,6 +596,7 @@ static int __init el3_eisa_probe (struct device *device) · 283 unmodified lines
595596 return -ENOMEM;
596597 }
597598
599+ SET_NETDEV_DEV(dev, device);
598600 netdev_boot_setup_check(dev);
599601
600602 el3_dev_fill(dev, phys_addr, ioaddr, irq, if_port, EL3_EISA);
drivers/net/ethernet/3com/typhoon.c+3−3
@@ -1690,7 +1690,7 @@ typhoon_rx(struct typhoon *tp, struct basic_ring *rxRing, volatile __le32 * read · 1689 unmodified lines
16901690 skb_checksum_none_assert(new_skb);
16911691
16921692 if (rx->rxStatus & TYPHOON_RX_VLAN)
1693− __vlan_hwaccel_put_tag(new_skb,
1693+ __vlan_hwaccel_put_tag(new_skb, htons(ETH_P_8021Q),
16941694 ntohl(rx->vlanTag) & 0xffff);
16951695 netif_receive_skb(new_skb);
16961696
@@ -2445,9 +2445,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 748 unmodified lines
24452445 * settings -- so we only allow the user to toggle the TX processing.
24462446 */
24472447 dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
2448− NETIF_F_HW_VLAN_TX;
2448+ NETIF_F_HW_VLAN_CTAG_TX;
24492449 dev->features = dev->hw_features |
2450− NETIF_F_HW_VLAN_RX | NETIF_F_RXCSUM;
2450+ NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_RXCSUM;
24512451
24522452 if(register_netdev(dev) < 0) {
24532453 err_msg = "unable to register netdev";
drivers/net/ethernet/adaptec/starfire.c+6−4
@@ -594,7 +594,8 @@ static const struct ethtool_ops ethtool_ops; · 593 unmodified lines
594594
595595
596596 #ifdef VLAN_SUPPORT
597−static int netdev_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
597+static int netdev_vlan_rx_add_vid(struct net_device *dev,
598+ __be16 proto, u16 vid)
598599 {
599600 struct netdev_private *np = netdev_priv(dev);
600601
@@ -608,7 +609,8 @@ static int netdev_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) · 7 unmodified lines
608609 return 0;
609610 }
610611
611−static int netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
612+static int netdev_vlan_rx_kill_vid(struct net_device *dev,
613+ __be16 proto, u16 vid)
612614 {
613615 struct netdev_private *np = netdev_priv(dev);
614616
@@ -702,7 +704,7 @@ static int starfire_init_one(struct pci_dev *pdev, · 87 unmodified lines
702704 #endif /* ZEROCOPY */
703705
704706 #ifdef VLAN_SUPPORT
705− dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
707+ dev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER;
706708 #endif /* VLAN_RX_KILL_VID */
707709 #ifdef ADDR_64BITS
708710 dev->features |= NETIF_F_HIGHDMA;
@@ -1496,7 +1498,7 @@ static int __netdev_rx(struct net_device *dev, int *quota) · 787 unmodified lines
14961498 printk(KERN_DEBUG " netdev_rx() vlanid = %d\n",
14971499 vlid);
14981500 }
1499− __vlan_hwaccel_put_tag(skb, vlid);
1501+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlid);
15001502 }
15011503 #endif /* VLAN_SUPPORT */
15021504 netif_receive_skb(skb);
drivers/net/ethernet/adi/bfin_mac.c+2−4
@@ -188,10 +188,9 @@ static int desc_list_init(struct net_device *dev) · 187 unmodified lines
188188
189189 /* allocate a new skb for next time receive */
190190 new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN);
191− if (!new_skb) {
192− pr_notice("init: low on mem - packet dropped\n");
191+ if (!new_skb)
193192 goto init_error;
194− }
193+
195194 skb_reserve(new_skb, NET_IP_ALIGN);
196195 /* Invidate the data cache of skb->data range when it is write back
197196 * cache. It will prevent overwritting the new data from DMA
@@ -1236,7 +1235,6 @@ static void bfin_mac_rx(struct net_device *dev) · 1038 unmodified lines
12361235
12371236 new_skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN);
12381237 if (!new_skb) {
1239− netdev_notice(dev, "rx: low on mem - packet dropped\n");
12401238 dev->stats.rx_dropped++;
12411239 goto out;
12421240 }
drivers/net/ethernet/aeroflex/greth.c+6−18
@@ -1464,35 +1464,23 @@ static int greth_of_probe(struct platform_device *ofdev) · 1463 unmodified lines
14641464 }
14651465
14661466 /* Allocate TX descriptor ring in coherent memory */
1467− greth->tx_bd_base = (struct greth_bd *) dma_alloc_coherent(greth->dev,
1468− 1024,
1469− &greth->tx_bd_base_phys,
1470− GFP_KERNEL);
1471−
1467+ greth->tx_bd_base = dma_alloc_coherent(greth->dev, 1024,
1468+ &greth->tx_bd_base_phys,
1469+ GFP_KERNEL | __GFP_ZERO);
14721470 if (!greth->tx_bd_base) {
1473− if (netif_msg_probe(greth))
1474− dev_err(&dev->dev, "could not allocate descriptor memory.\n");
14751471 err = -ENOMEM;
14761472 goto error3;
14771473 }
14781474
1479− memset(greth->tx_bd_base, 0, 1024);
1480−
14811475 /* Allocate RX descriptor ring in coherent memory */
1482− greth->rx_bd_base = (struct greth_bd *) dma_alloc_coherent(greth->dev,
1483− 1024,
1484− &greth->rx_bd_base_phys,
1485− GFP_KERNEL);
1486−
1476+ greth->rx_bd_base = dma_alloc_coherent(greth->dev, 1024,
1477+ &greth->rx_bd_base_phys,
1478+ GFP_KERNEL | __GFP_ZERO);
14871479 if (!greth->rx_bd_base) {
1488− if (netif_msg_probe(greth))
1489− dev_err(greth->dev, "could not allocate descriptor memory.\n");
14901480 err = -ENOMEM;
14911481 goto error4;
14921482 }
14931483
1494− memset(greth->rx_bd_base, 0, 1024);
1495−
14961484 /* Get MAC address from: module param, OF property or ID prom */
14971485 for (i = 0; i < 6; i++) {
14981486 if (macaddr[i] != 0)
drivers/net/ethernet/alteon/acenic.c+2−2
@@ -472,7 +472,7 @@ static int acenic_probe_one(struct pci_dev *pdev, · 471 unmodified lines
472472 ap->name = pci_name(pdev);
473473
474474 dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
475− dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
475+ dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
476476
477477 dev->watchdog_timeo = 5*HZ;
478478
@@ -2019,7 +2019,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm) · 1540 unmodified lines
20192019
20202020 /* send it up */
20212021 if ((bd_flags & BD_FLG_VLAN_TAG))
2022− __vlan_hwaccel_put_tag(skb, retdesc->vlan);
2022+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), retdesc->vlan);
20232023 netif_rx(skb);
20242024
20252025 dev->stats.rx_packets++;
drivers/net/ethernet/amd/7990.c+0−2
@@ -318,8 +318,6 @@ static int lance_rx (struct net_device *dev) · 317 unmodified lines
318318 struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);
319319
320320 if (!skb) {
321− printk ("%s: Memory squeeze, deferring packet.\n",
322− dev->name);
323321 dev->stats.rx_dropped++;
324322 rd->mblength = 0;
325323 rd->rmd1_bits = LE_R1_OWN;
drivers/net/ethernet/amd/a2065.c+0−1
@@ -293,7 +293,6 @@ static int lance_rx(struct net_device *dev) · 292 unmodified lines
293293 struct sk_buff *skb = netdev_alloc_skb(dev, len + 2);
294294
295295 if (!skb) {
296− netdev_warn(dev, "Memory squeeze, deferring packet\n");
297296 dev->stats.rx_dropped++;
298297 rd->mblength = 0;
299298 rd->rmd1_bits = LE_R1_OWN;
drivers/net/ethernet/amd/am79c961a.c+0−1
@@ -528,7 +528,6 @@ am79c961_rx(struct net_device *dev, struct dev_priv *priv) · 527 unmodified lines
528528 dev->stats.rx_packets++;
529529 } else {
530530 am_writeword (dev, hdraddr + 2, RMD_OWN);
531− printk (KERN_WARNING "%s: memory squeeze, dropping packet.\n", dev->name);
532531 dev->stats.rx_dropped++;
533532 break;
534533 }
drivers/net/ethernet/amd/amd8111e.c+3−3
@@ -793,7 +793,7 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget) · 792 unmodified lines
793793 #if AMD8111E_VLAN_TAG_USED
794794 if (vtag == TT_VLAN_TAGGED){
795795 u16 vlan_tag = le16_to_cpu(lp->rx_ring[rx_index].tag_ctrl_info);
796− __vlan_hwaccel_put_tag(skb, vlan_tag);
796+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
797797 }
798798 #endif
799799 netif_receive_skb(skb);
@@ -1869,7 +1869,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev, · 1069 unmodified lines
18691869 SET_NETDEV_DEV(dev, &pdev->dev);
18701870
18711871 #if AMD8111E_VLAN_TAG_USED
1872− dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX ;
1872+ dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX ;
18731873 #endif
18741874
18751875 lp = netdev_priv(dev);
@@ -1907,7 +1907,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev, · 31 unmodified lines
19071907 netif_napi_add(dev, &lp->napi, amd8111e_rx_poll, 32);
19081908
19091909 #if AMD8111E_VLAN_TAG_USED
1910− dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1910+ dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
19111911 #endif
19121912 /* Probe the external PHY */
19131913 amd8111e_probe_ext_phy(dev);
drivers/net/ethernet/amd/ariadne.c+0−1
@@ -193,7 +193,6 @@ static int ariadne_rx(struct net_device *dev) · 192 unmodified lines
193193
194194 skb = netdev_alloc_skb(dev, pkt_len + 2);
195195 if (skb == NULL) {
196− netdev_warn(dev, "Memory squeeze, deferring packet\n");
197196 for (i = 0; i < RX_RING_SIZE; i++)
198197 if (lowb(priv->rx_ring[(entry + i) % RX_RING_SIZE]->RMD1) & RF_OWN)
199198 break;
drivers/net/ethernet/amd/atarilance.c+1−5
@@ -996,8 +996,6 @@ static int lance_rx( struct net_device *dev ) · 995 unmodified lines
996996 else {
997997 skb = netdev_alloc_skb(dev, pkt_len + 2);
998998 if (skb == NULL) {
999− DPRINTK( 1, ( "%s: Memory squeeze, deferring packet.\n",
1000− dev->name ));
1001999 for( i = 0; i < RX_RING_SIZE; i++ )
10021000 if (MEM->rx_head[(entry+i) & RX_RING_MOD_MASK].flag &
10031001 RMD1_OWN_CHIP)
@@ -1149,9 +1147,7 @@ static struct net_device *atarilance_dev; · 145 unmodified lines
11491147 static int __init atarilance_module_init(void)
11501148 {
11511149 atarilance_dev = atarilance_probe(-1);
1152− if (IS_ERR(atarilance_dev))
1153− return PTR_ERR(atarilance_dev);
1154− return 0;
1150+ return PTR_RET(atarilance_dev);
11551151 }
11561152
11571153 static void __exit atarilance_module_exit(void)
drivers/net/ethernet/amd/au1000_eth.c+0−1
@@ -727,7 +727,6 @@ static int au1000_rx(struct net_device *dev) · 726 unmodified lines
727727 frmlen -= 4; /* Remove FCS */
728728 skb = netdev_alloc_skb(dev, frmlen + 2);
729729 if (skb == NULL) {
730− netdev_err(dev, "Memory squeeze, dropping packet.\n");
731730 dev->stats.rx_dropped++;
732731 continue;
733732 }
drivers/net/ethernet/amd/declance.c+0−2
@@ -607,8 +607,6 @@ static int lance_rx(struct net_device *dev) · 606 unmodified lines
607607 skb = netdev_alloc_skb(dev, len + 2);
608608
609609 if (skb == 0) {
610− printk("%s: Memory squeeze, deferring packet.\n",
611− dev->name);
612610 dev->stats.rx_dropped++;
613611 *rds_ptr(rd, mblength, lp->type) = 0;
614612 *rds_ptr(rd, rmd1, lp->type) =
drivers/net/ethernet/amd/mvme147.c+1−3
@@ -188,9 +188,7 @@ static struct net_device *dev_mvme147_lance; · 187 unmodified lines
188188 int __init init_module(void)
189189 {
190190 dev_mvme147_lance = mvme147lance_probe(-1);
191− if (IS_ERR(dev_mvme147_lance))
192− return PTR_ERR(dev_mvme147_lance);
193− return 0;
191+ return PTR_RET(dev_mvme147_lance);
194192 }
195193
196194 void __exit cleanup_module(void)
drivers/net/ethernet/amd/ni65.c+1−1
@@ -1238,7 +1238,7 @@ MODULE_PARM_DESC(dma, "ni6510 ISA DMA channel (ignored for some cards)"); · 1237 unmodified lines
12381238 int __init init_module(void)
12391239 {
12401240 dev_ni65 = ni65_probe(-1);
1241− return IS_ERR(dev_ni65) ? PTR_ERR(dev_ni65) : 0;
1241+ return PTR_RET(dev_ni65);
12421242 }
12431243
12441244 void __exit cleanup_module(void)
drivers/net/ethernet/amd/pcnet32.c+0−1
@@ -1166,7 +1166,6 @@ static void pcnet32_rx_entry(struct net_device *dev, · 1165 unmodified lines
11661166 skb = netdev_alloc_skb(dev, pkt_len + NET_IP_ALIGN);
11671167
11681168 if (skb == NULL) {
1169− netif_err(lp, drv, dev, "Memory squeeze, dropping packet\n");
11701169 dev->stats.rx_dropped++;
11711170 return;
11721171 }
drivers/net/ethernet/amd/sun3lance.c+1−6
@@ -812,9 +812,6 @@ static int lance_rx( struct net_device *dev ) · 811 unmodified lines
812812 else {
813813 skb = netdev_alloc_skb(dev, pkt_len + 2);
814814 if (skb == NULL) {
815− DPRINTK( 1, ( "%s: Memory squeeze, deferring packet.\n",
816− dev->name ));
817−
818815 dev->stats.rx_dropped++;
819816 head->msg_length = 0;
820817 head->flag |= RMD1_OWN_CHIP;
@@ -943,9 +940,7 @@ static struct net_device *sun3lance_dev; · 122 unmodified lines
943940 int __init init_module(void)
944941 {
945942 sun3lance_dev = sun3lance_probe(-1);
946− if (IS_ERR(sun3lance_dev))
947− return PTR_ERR(sun3lance_dev);
948− return 0;
943+ return PTR_RET(sun3lance_dev);
949944 }
950945
951946 void __exit cleanup_module(void)
drivers/net/ethernet/amd/sunlance.c+2−7
@@ -536,8 +536,6 @@ static void lance_rx_dvma(struct net_device *dev) · 535 unmodified lines
536536 skb = netdev_alloc_skb(dev, len + 2);
537537
538538 if (skb == NULL) {
539− printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n",
540− dev->name);
541539 dev->stats.rx_dropped++;
542540 rd->mblength = 0;
543541 rd->rmd1_bits = LE_R1_OWN;
@@ -708,8 +706,6 @@ static void lance_rx_pio(struct net_device *dev) · 164 unmodified lines
708706 skb = netdev_alloc_skb(dev, len + 2);
709707
710708 if (skb == NULL) {
711− printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n",
712− dev->name);
713709 dev->stats.rx_dropped++;
714710 sbus_writew(0, &rd->mblength);
715711 sbus_writeb(LE_R1_OWN, &rd->rmd1_bits);
@@ -1377,10 +1373,9 @@ static int sparc_lance_probe_one(struct platform_device *op, · 661 unmodified lines
13771373 dma_alloc_coherent(&op->dev,
13781374 sizeof(struct lance_init_block),
13791375 &lp->init_block_dvma, GFP_ATOMIC);
1380− if (!lp->init_block_mem) {
1381− printk(KERN_ERR "SunLance: Cannot allocate consistent DMA memory.\n");
1376+ if (!lp->init_block_mem)
13821377 goto fail;
1383− }
1378+
13841379 lp->pio_buffer = 0;
13851380 lp->init_ring = lance_init_ring_dvma;
13861381 lp->rx = lance_rx_dvma;
drivers/net/ethernet/apple/macmace.c+6−10
@@ -386,20 +386,16 @@ static int mace_open(struct net_device *dev) · 385 unmodified lines
386386 /* Allocate the DMA ring buffers */
387387
388388 mp->tx_ring = dma_alloc_coherent(mp->device,
389− N_TX_RING * MACE_BUFF_SIZE,
390− &mp->tx_ring_phys, GFP_KERNEL);
391− if (mp->tx_ring == NULL) {
392− printk(KERN_ERR "%s: unable to allocate DMA tx buffers\n", dev->name);
389+ N_TX_RING * MACE_BUFF_SIZE,
390+ &mp->tx_ring_phys, GFP_KERNEL);
391+ if (mp->tx_ring == NULL)
393392 goto out1;
394− }
395393
396394 mp->rx_ring = dma_alloc_coherent(mp->device,
397− N_RX_RING * MACE_BUFF_SIZE,
398− &mp->rx_ring_phys, GFP_KERNEL);
399− if (mp->rx_ring == NULL) {
400− printk(KERN_ERR "%s: unable to allocate DMA rx buffers\n", dev->name);
395+ N_RX_RING * MACE_BUFF_SIZE,
396+ &mp->rx_ring_phys, GFP_KERNEL);
397+ if (mp->rx_ring == NULL)
401398 goto out2;
402− }
403399
404400 mace_dma_off(dev);
405401
drivers/net/ethernet/atheros/atl1c/atl1c_main.c+12−12
@@ -417,7 +417,7 @@ static void atl1c_set_multi(struct net_device *netdev) · 416 unmodified lines
417417
418418 static void __atl1c_vlan_mode(netdev_features_t features, u32 *mac_ctrl_data)
419419 {
420− if (features & NETIF_F_HW_VLAN_RX) {
420+ if (features & NETIF_F_HW_VLAN_CTAG_RX) {
421421 /* enable VLAN tag insert/strip */
422422 *mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
423423 } else {
@@ -494,10 +494,10 @@ static netdev_features_t atl1c_fix_features(struct net_device *netdev, · 70 unmodified lines
494494 * Since there is no support for separate rx/tx vlan accel
495495 * enable/disable make sure tx flag is always in same state as rx.
496496 */
497− if (features & NETIF_F_HW_VLAN_RX)
498− features |= NETIF_F_HW_VLAN_TX;
497+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
498+ features |= NETIF_F_HW_VLAN_CTAG_TX;
499499 else
500− features &= ~NETIF_F_HW_VLAN_TX;
500+ features &= ~NETIF_F_HW_VLAN_CTAG_TX;
501501
502502 if (netdev->mtu > MAX_TSO_FRAME_SIZE)
503503 features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
@@ -510,7 +510,7 @@ static int atl1c_set_features(struct net_device *netdev, · 6 unmodified lines
510510 {
511511 netdev_features_t changed = netdev->features ^ features;
512512
513− if (changed & NETIF_F_HW_VLAN_RX)
513+ if (changed & NETIF_F_HW_VLAN_CTAG_RX)
514514 atl1c_vlan_mode(netdev, features);
515515
516516 return 0;
@@ -1809,7 +1809,7 @@ rrs_checked: · 1292 unmodified lines
18091809
18101810 AT_TAG_TO_VLAN(rrs->vlan_tag, vlan);
18111811 vlan = le16_to_cpu(vlan);
1812− __vlan_hwaccel_put_tag(skb, vlan);
1812+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan);
18131813 }
18141814 netif_receive_skb(skb);
18151815
@@ -2475,13 +2475,13 @@ static int atl1c_init_netdev(struct net_device *netdev, struct pci_dev *pdev) · 659 unmodified lines
24752475 atl1c_set_ethtool_ops(netdev);
24762476
24772477 /* TODO: add when ready */
2478− netdev->hw_features = NETIF_F_SG |
2479− NETIF_F_HW_CSUM |
2480− NETIF_F_HW_VLAN_RX |
2481− NETIF_F_TSO |
2478+ netdev->hw_features = NETIF_F_SG |
2479+ NETIF_F_HW_CSUM |
2480+ NETIF_F_HW_VLAN_CTAG_RX |
2481+ NETIF_F_TSO |
24822482 NETIF_F_TSO6;
2483− netdev->features = netdev->hw_features |
2484− NETIF_F_HW_VLAN_TX;
2483+ netdev->features = netdev->hw_features |
2484+ NETIF_F_HW_VLAN_CTAG_TX;
24852485 return 0;
24862486 }
24872487
drivers/net/ethernet/atheros/atl1e/atl1e_main.c+10−12
@@ -315,7 +315,7 @@ static void atl1e_set_multi(struct net_device *netdev) · 314 unmodified lines
315315
316316 static void __atl1e_vlan_mode(netdev_features_t features, u32 *mac_ctrl_data)
317317 {
318− if (features & NETIF_F_HW_VLAN_RX) {
318+ if (features & NETIF_F_HW_VLAN_CTAG_RX) {
319319 /* enable VLAN tag insert/strip */
320320 *mac_ctrl_data |= MAC_CTRL_RMV_VLAN;
321321 } else {
@@ -378,10 +378,10 @@ static netdev_features_t atl1e_fix_features(struct net_device *netdev, · 56 unmodified lines
378378 * Since there is no support for separate rx/tx vlan accel
379379 * enable/disable make sure tx flag is always in same state as rx.
380380 */
381− if (features & NETIF_F_HW_VLAN_RX)
382− features |= NETIF_F_HW_VLAN_TX;
381+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
382+ features |= NETIF_F_HW_VLAN_CTAG_TX;
383383 else
384− features &= ~NETIF_F_HW_VLAN_TX;
384+ features &= ~NETIF_F_HW_VLAN_CTAG_TX;
385385
386386 return features;
387387 }
@@ -391,7 +391,7 @@ static int atl1e_set_features(struct net_device *netdev, · 3 unmodified lines
391391 {
392392 netdev_features_t changed = netdev->features ^ features;
393393
394− if (changed & NETIF_F_HW_VLAN_RX)
394+ if (changed & NETIF_F_HW_VLAN_CTAG_RX)
395395 atl1e_vlan_mode(netdev, features);
396396
397397 return 0;
@@ -1420,11 +1420,9 @@ static void atl1e_clean_rx_irq(struct atl1e_adapter *adapter, u8 que, · 1022 unmodified lines
14201420 packet_size = ((prrs->word1 >> RRS_PKT_SIZE_SHIFT) &
14211421 RRS_PKT_SIZE_MASK) - 4; /* CRC */
14221422 skb = netdev_alloc_skb_ip_align(netdev, packet_size);
1423− if (skb == NULL) {
1424− netdev_warn(netdev,
1425− "Memory squeeze, deferring packet\n");
1423+ if (skb == NULL)
14261424 goto skip_pkt;
1427− }
1425+
14281426 memcpy(skb->data, (u8 *)(prrs + 1), packet_size);
14291427 skb_put(skb, packet_size);
14301428 skb->protocol = eth_type_trans(skb, netdev);
@@ -1437,7 +1435,7 @@ static void atl1e_clean_rx_irq(struct atl1e_adapter *adapter, u8 que, · 6 unmodified lines
14371435 netdev_dbg(netdev,
14381436 "RXD VLAN TAG<RRD>=0x%04x\n",
14391437 prrs->vtag);
1440− __vlan_hwaccel_put_tag(skb, vlan_tag);
1438+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
14411439 }
14421440 netif_receive_skb(skb);
14431441
@@ -2200,9 +2198,9 @@ static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev) · 756 unmodified lines
22002198 atl1e_set_ethtool_ops(netdev);
22012199
22022200 netdev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO |
2203− NETIF_F_HW_VLAN_RX;
2201+ NETIF_F_HW_VLAN_CTAG_RX;
22042202 netdev->features = netdev->hw_features | NETIF_F_LLTX |
2205− NETIF_F_HW_VLAN_TX;
2203+ NETIF_F_HW_VLAN_CTAG_TX;
22062204
22072205 return 0;
22082206 }
drivers/net/ethernet/atheros/atlx/atl1.c+8−13
@@ -2024,7 +2024,7 @@ rrd_ok: · 2023 unmodified lines
20242024 ((rrd->vlan_tag & 7) << 13) |
20252025 ((rrd->vlan_tag & 8) << 9);
20262026
2027− __vlan_hwaccel_put_tag(skb, vlan_tag);
2027+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
20282028 }
20292029 netif_receive_skb(skb);
20302030
@@ -2774,7 +2774,7 @@ static int atl1_close(struct net_device *netdev) · 743 unmodified lines
27742774 return 0;
27752775 }
27762776
2777−#ifdef CONFIG_PM
2777+#ifdef CONFIG_PM_SLEEP
27782778 static int atl1_suspend(struct device *dev)
27792779 {
27802780 struct pci_dev *pdev = to_pci_dev(dev);
@@ -2876,23 +2876,18 @@ static int atl1_resume(struct device *dev) · 95 unmodified lines
28762876
28772877 return 0;
28782878 }
2879+#endif
28792880
28802881 static SIMPLE_DEV_PM_OPS(atl1_pm_ops, atl1_suspend, atl1_resume);
2881−#define ATL1_PM_OPS (&atl1_pm_ops)
2882−
2883−#else
2884−
2885−static int atl1_suspend(struct device *dev) { return 0; }
2886−
2887−#define ATL1_PM_OPS NULL
2888−#endif
28892882
28902883 static void atl1_shutdown(struct pci_dev *pdev)
28912884 {
28922885 struct net_device *netdev = pci_get_drvdata(pdev);
28932886 struct atl1_adapter *adapter = netdev_priv(netdev);
28942887
2888+#ifdef CONFIG_PM_SLEEP
28952889 atl1_suspend(&pdev->dev);
2890+#endif
28962891 pci_wake_from_d3(pdev, adapter->wol);
28972892 pci_set_power_state(pdev, PCI_D3hot);
28982893 }
@@ -3023,10 +3018,10 @@ static int atl1_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 124 unmodified lines
30233018
30243019 netdev->features = NETIF_F_HW_CSUM;
30253020 netdev->features |= NETIF_F_SG;
3026− netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
3021+ netdev->features |= (NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX);
30273022
30283023 netdev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_TSO |
3029− NETIF_F_HW_VLAN_RX;
3024+ NETIF_F_HW_VLAN_CTAG_RX;
30303025
30313026 /* is this valid? see atl1_setup_mac_ctrl() */
30323027 netdev->features |= NETIF_F_RXCSUM;
@@ -3147,7 +3142,7 @@ static struct pci_driver atl1_driver = { · 114 unmodified lines
31473142 .probe = atl1_probe,
31483143 .remove = atl1_remove,
31493144 .shutdown = atl1_shutdown,
3150− .driver.pm = ATL1_PM_OPS,
3145+ .driver.pm = &atl1_pm_ops,
31513146 };
31523147
31533148 /**
drivers/net/ethernet/atheros/atlx/atl2.c+9−12
@@ -363,7 +363,7 @@ static inline void atl2_irq_disable(struct atl2_adapter *adapter) · 362 unmodified lines
363363
364364 static void __atl2_vlan_mode(netdev_features_t features, u32 *ctrl)
365365 {
366− if (features & NETIF_F_HW_VLAN_RX) {
366+ if (features & NETIF_F_HW_VLAN_CTAG_RX) {
367367 /* enable VLAN tag insert/strip */
368368 *ctrl |= MAC_CTRL_RMV_VLAN;
369369 } else {
@@ -399,10 +399,10 @@ static netdev_features_t atl2_fix_features(struct net_device *netdev, · 29 unmodified lines
399399 * Since there is no support for separate rx/tx vlan accel
400400 * enable/disable make sure tx flag is always in same state as rx.
401401 */
402− if (features & NETIF_F_HW_VLAN_RX)
403− features |= NETIF_F_HW_VLAN_TX;
402+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
403+ features |= NETIF_F_HW_VLAN_CTAG_TX;
404404 else
405− features &= ~NETIF_F_HW_VLAN_TX;
405+ features &= ~NETIF_F_HW_VLAN_CTAG_TX;
406406
407407 return features;
408408 }
@@ -412,7 +412,7 @@ static int atl2_set_features(struct net_device *netdev, · 3 unmodified lines
412412 {
413413 netdev_features_t changed = netdev->features ^ features;
414414
415− if (changed & NETIF_F_HW_VLAN_RX)
415+ if (changed & NETIF_F_HW_VLAN_CTAG_RX)
416416 atl2_vlan_mode(netdev, features);
417417
418418 return 0;
@@ -437,9 +437,6 @@ static void atl2_intr_rx(struct atl2_adapter *adapter) · 18 unmodified lines
437437 /* alloc new buffer */
438438 skb = netdev_alloc_skb_ip_align(netdev, rx_size);
439439 if (NULL == skb) {
440− printk(KERN_WARNING
441− "%s: Mem squeeze, deferring packet.\n",
442− netdev->name);
443440 /*
444441 * Check that some rx space is free. If not,
445442 * free one and mark stats->rx_dropped++.
@@ -455,7 +452,7 @@ static void atl2_intr_rx(struct atl2_adapter *adapter) · 9 unmodified lines
455452 ((rxd->status.vtag&7) << 13) |
456453 ((rxd->status.vtag&8) << 9);
457454
458− __vlan_hwaccel_put_tag(skb, vlan_tag);
455+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
459456 }
460457 netif_rx(skb);
461458 netdev->stats.rx_bytes += rx_size;
@@ -890,7 +887,7 @@ static netdev_tx_t atl2_xmit_frame(struct sk_buff *skb, · 428 unmodified lines
890887 skb->len-copy_len);
891888 offset = ((u32)(skb->len-copy_len + 3) & ~3);
892889 }
893−#ifdef NETIF_F_HW_VLAN_TX
890+#ifdef NETIF_F_HW_VLAN_CTAG_TX
894891 if (vlan_tx_tag_present(skb)) {
895892 u16 vlan_tag = vlan_tx_tag_get(skb);
896893 vlan_tag = (vlan_tag << 4) |
@@ -1416,8 +1413,8 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 519 unmodified lines
14161413
14171414 err = -EIO;
14181415
1419− netdev->hw_features = NETIF_F_SG | NETIF_F_HW_VLAN_RX;
1420− netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
1416+ netdev->hw_features = NETIF_F_SG | NETIF_F_HW_VLAN_CTAG_RX;
1417+ netdev->features |= (NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX);
14211418
14221419 /* Init PHY as early as possible due to power saving issue */
14231420 atl2_phy_init(&adapter->hw);
drivers/net/ethernet/atheros/atlx/atlx.c+5−5
@@ -220,7 +220,7 @@ static void atlx_link_chg_task(struct work_struct *work) · 219 unmodified lines
220220
221221 static void __atlx_vlan_mode(netdev_features_t features, u32 *ctrl)
222222 {
223− if (features & NETIF_F_HW_VLAN_RX) {
223+ if (features & NETIF_F_HW_VLAN_CTAG_RX) {
224224 /* enable VLAN tag insert/strip */
225225 *ctrl |= MAC_CTRL_RMV_VLAN;
226226 } else {
@@ -257,10 +257,10 @@ static netdev_features_t atlx_fix_features(struct net_device *netdev, · 30 unmodified lines
257257 * Since there is no support for separate rx/tx vlan accel
258258 * enable/disable make sure tx flag is always in same state as rx.
259259 */
260− if (features & NETIF_F_HW_VLAN_RX)
261− features |= NETIF_F_HW_VLAN_TX;
260+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
261+ features |= NETIF_F_HW_VLAN_CTAG_TX;
262262 else
263− features &= ~NETIF_F_HW_VLAN_TX;
263+ features &= ~NETIF_F_HW_VLAN_CTAG_TX;
264264
265265 return features;
266266 }
@@ -270,7 +270,7 @@ static int atlx_set_features(struct net_device *netdev, · 3 unmodified lines
270270 {
271271 netdev_features_t changed = netdev->features ^ features;
272272
273− if (changed & NETIF_F_HW_VLAN_RX)
273+ if (changed & NETIF_F_HW_VLAN_CTAG_RX)
274274 atlx_vlan_mode(netdev, features);
275275
276276 return 0;
drivers/net/ethernet/broadcom/bcm63xx_enet.c+20−53
@@ -862,27 +862,25 @@ static int bcm_enet_open(struct net_device *dev) · 861 unmodified lines
862862
863863 /* allocate rx dma ring */
864864 size = priv->rx_ring_size * sizeof(struct bcm_enet_desc);
865− p = dma_alloc_coherent(kdev, size, &priv->rx_desc_dma, GFP_KERNEL);
865+ p = dma_alloc_coherent(kdev, size, &priv->rx_desc_dma,
866+ GFP_KERNEL | __GFP_ZERO);
866867 if (!p) {
867− dev_err(kdev, "cannot allocate rx ring %u\n", size);
868868 ret = -ENOMEM;
869869 goto out_freeirq_tx;
870870 }
871871
872− memset(p, 0, size);
873872 priv->rx_desc_alloc_size = size;
874873 priv->rx_desc_cpu = p;
875874
876875 /* allocate tx dma ring */
877876 size = priv->tx_ring_size * sizeof(struct bcm_enet_desc);
878− p = dma_alloc_coherent(kdev, size, &priv->tx_desc_dma, GFP_KERNEL);
877+ p = dma_alloc_coherent(kdev, size, &priv->tx_desc_dma,
878+ GFP_KERNEL | __GFP_ZERO);
879879 if (!p) {
880− dev_err(kdev, "cannot allocate tx ring\n");
881880 ret = -ENOMEM;
882881 goto out_free_rx_ring;
883882 }
884883
885− memset(p, 0, size);
886884 priv->tx_desc_alloc_size = size;
887885 priv->tx_desc_cpu = p;
888886
@@ -1619,7 +1617,6 @@ static int bcm_enet_probe(struct platform_device *pdev) · 730 unmodified lines
16191617 struct resource *res_mem, *res_irq, *res_irq_rx, *res_irq_tx;
16201618 struct mii_bus *bus;
16211619 const char *clk_name;
1622− unsigned int iomem_size;
16231620 int i, ret;
16241621
16251622 /* stop if shared driver failed, assume driver->probe will be
@@ -1644,17 +1641,12 @@ static int bcm_enet_probe(struct platform_device *pdev) · 18 unmodified lines
16441641 if (ret)
16451642 goto out;
16461643
1647− iomem_size = resource_size(res_mem);
1648− if (!request_mem_region(res_mem->start, iomem_size, "bcm63xx_enet")) {
1649− ret = -EBUSY;
1650− goto out;
1651− }
1652−
1653− priv->base = ioremap(res_mem->start, iomem_size);
1644+ priv->base = devm_request_and_ioremap(&pdev->dev, res_mem);
16541645 if (priv->base == NULL) {
16551646 ret = -ENOMEM;
1656− goto out_release_mem;
1647+ goto out;
16571648 }
1649+
16581650 dev->irq = priv->irq = res_irq->start;
16591651 priv->irq_rx = res_irq_rx->start;
16601652 priv->irq_tx = res_irq_tx->start;
@@ -1674,9 +1666,9 @@ static int bcm_enet_probe(struct platform_device *pdev) · 13 unmodified lines
16741666 priv->mac_clk = clk_get(&pdev->dev, clk_name);
16751667 if (IS_ERR(priv->mac_clk)) {
16761668 ret = PTR_ERR(priv->mac_clk);
1677− goto out_unmap;
1669+ goto out;
16781670 }
1679− clk_enable(priv->mac_clk);
1671+ clk_prepare_enable(priv->mac_clk);
16801672
16811673 /* initialize default and fetch platform data */
16821674 priv->rx_ring_size = BCMENET_DEF_RX_DESC;
@@ -1705,7 +1697,7 @@ static int bcm_enet_probe(struct platform_device *pdev) · 22 unmodified lines
17051697 priv->phy_clk = NULL;
17061698 goto out_put_clk_mac;
17071699 }
1708− clk_enable(priv->phy_clk);
1700+ clk_prepare_enable(priv->phy_clk);
17091701 }
17101702
17111703 /* do minimal hardware init to be able to probe mii bus */
@@ -1733,7 +1725,8 @@ static int bcm_enet_probe(struct platform_device *pdev) · 21 unmodified lines
17331725 * if a slave is not present on hw */
17341726 bus->phy_mask = ~(1 << priv->phy_id);
17351727
1736− bus->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL);
1728+ bus->irq = devm_kzalloc(&pdev->dev, sizeof(int) * PHY_MAX_ADDR,
1729+ GFP_KERNEL);
17371730 if (!bus->irq) {
17381731 ret = -ENOMEM;
17391732 goto out_free_mdio;
@@ -1794,10 +1787,8 @@ static int bcm_enet_probe(struct platform_device *pdev) · 54 unmodified lines
17941787 return 0;
17951788
17961789 out_unregister_mdio:
1797− if (priv->mii_bus) {
1790+ if (priv->mii_bus)
17981791 mdiobus_unregister(priv->mii_bus);
1799− kfree(priv->mii_bus->irq);
1800− }
18011792
18021793 out_free_mdio:
18031794 if (priv->mii_bus)
@@ -1807,19 +1798,13 @@ out_uninit_hw: · 3 unmodified lines
18071798 /* turn off mdc clock */
18081799 enet_writel(priv, 0, ENET_MIISC_REG);
18091800 if (priv->phy_clk) {
1810− clk_disable(priv->phy_clk);
1801+ clk_disable_unprepare(priv->phy_clk);
18111802 clk_put(priv->phy_clk);
18121803 }
18131804
18141805 out_put_clk_mac:
1815− clk_disable(priv->mac_clk);
1806+ clk_disable_unprepare(priv->mac_clk);
18161807 clk_put(priv->mac_clk);
1817−
1818−out_unmap:
1819− iounmap(priv->base);
1820−
1821−out_release_mem:
1822− release_mem_region(res_mem->start, iomem_size);
18231808 out:
18241809 free_netdev(dev);
18251810 return ret;
@@ -1833,7 +1818,6 @@ static int bcm_enet_remove(struct platform_device *pdev) · 7 unmodified lines
18331818 {
18341819 struct bcm_enet_priv *priv;
18351820 struct net_device *dev;
1836− struct resource *res;
18371821
18381822 /* stop netdevice */
18391823 dev = platform_get_drvdata(pdev);
@@ -1845,7 +1829,6 @@ static int bcm_enet_remove(struct platform_device *pdev) · 5 unmodified lines
18451829
18461830 if (priv->has_phy) {
18471831 mdiobus_unregister(priv->mii_bus);
1848− kfree(priv->mii_bus->irq);
18491832 mdiobus_free(priv->mii_bus);
18501833 } else {
18511834 struct bcm63xx_enet_platform_data *pd;
@@ -1856,17 +1839,12 @@ static int bcm_enet_remove(struct platform_device *pdev) · 4 unmodified lines
18561839 bcm_enet_mdio_write_mii);
18571840 }
18581841
1859− /* release device resources */
1860− iounmap(priv->base);
1861− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1862− release_mem_region(res->start, resource_size(res));
1863−
18641842 /* disable hw block clocks */
18651843 if (priv->phy_clk) {
1866− clk_disable(priv->phy_clk);
1844+ clk_disable_unprepare(priv->phy_clk);
18671845 clk_put(priv->phy_clk);
18681846 }
1869− clk_disable(priv->mac_clk);
1847+ clk_disable_unprepare(priv->mac_clk);
18701848 clk_put(priv->mac_clk);
18711849
18721850 platform_set_drvdata(pdev, NULL);
@@ -1889,31 +1867,20 @@ struct platform_driver bcm63xx_enet_driver = { · 16 unmodified lines
18891867 static int bcm_enet_shared_probe(struct platform_device *pdev)
18901868 {
18911869 struct resource *res;
1892− unsigned int iomem_size;
18931870
18941871 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
18951872 if (!res)
18961873 return -ENODEV;
18971874
1898− iomem_size = resource_size(res);
1899− if (!request_mem_region(res->start, iomem_size, "bcm63xx_enet_dma"))
1900− return -EBUSY;
1901−
1902− bcm_enet_shared_base = ioremap(res->start, iomem_size);
1903− if (!bcm_enet_shared_base) {
1904− release_mem_region(res->start, iomem_size);
1875+ bcm_enet_shared_base = devm_request_and_ioremap(&pdev->dev, res);
1876+ if (!bcm_enet_shared_base)
19051877 return -ENOMEM;
1906− }
1878+
19071879 return 0;
19081880 }
19091881
19101882 static int bcm_enet_shared_remove(struct platform_device *pdev)
19111883 {
1912− struct resource *res;
1913−
1914− iounmap(bcm_enet_shared_base);
1915− res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1916− release_mem_region(res->start, resource_size(res));
19171884 return 0;
19181885 }
19191886
drivers/net/ethernet/broadcom/bgmac.c+80−4
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <linux/delay.h>
1414 #include <linux/etherdevice.h>
1515 #include <linux/mii.h>
16+#include <linux/phy.h>
1617 #include <linux/interrupt.h>
1718 #include <linux/dma-mapping.h>
1819 #include <bcm47xx_nvram.h>
@@ -244,10 +245,8 @@ static int bgmac_dma_rx_skb_for_slot(struct bgmac *bgmac, · 225 unmodified lines
244245
245246 /* Alloc skb */
246247 slot->skb = netdev_alloc_skb(bgmac->net_dev, BGMAC_RX_BUF_SIZE);
247− if (!slot->skb) {
248− bgmac_err(bgmac, "Allocation of skb failed!\n");
248+ if (!slot->skb)
249249 return -ENOMEM;
250− }
251250
252251 /* Poison - if everything goes fine, hardware will overwrite it */
253252 rx = (struct bgmac_rx_header *)slot->skb->data;
@@ -1312,6 +1311,73 @@ static const struct ethtool_ops bgmac_ethtool_ops = { · 1058 unmodified lines
13121311 .get_drvinfo = bgmac_get_drvinfo,
13131312 };
13141313
1314+/**************************************************
1315+ * MII
1316+ **************************************************/
1317+
1318+static int bgmac_mii_read(struct mii_bus *bus, int mii_id, int regnum)
1319+{
1320+ return bgmac_phy_read(bus->priv, mii_id, regnum);
1321+}
1322+
1323+static int bgmac_mii_write(struct mii_bus *bus, int mii_id, int regnum,
1324+ u16 value)
1325+{
1326+ return bgmac_phy_write(bus->priv, mii_id, regnum, value);
1327+}
1328+
1329+static int bgmac_mii_register(struct bgmac *bgmac)
1330+{
1331+ struct mii_bus *mii_bus;
1332+ int i, err = 0;
1333+
1334+ mii_bus = mdiobus_alloc();
1335+ if (!mii_bus)
1336+ return -ENOMEM;
1337+
1338+ mii_bus->name = "bgmac mii bus";
1339+ sprintf(mii_bus->id, "%s-%d-%d", "bgmac", bgmac->core->bus->num,
1340+ bgmac->core->core_unit);
1341+ mii_bus->priv = bgmac;
1342+ mii_bus->read = bgmac_mii_read;
1343+ mii_bus->write = bgmac_mii_write;
1344+ mii_bus->parent = &bgmac->core->dev;
1345+ mii_bus->phy_mask = ~(1 << bgmac->phyaddr);
1346+
1347+ mii_bus->irq = kmalloc_array(PHY_MAX_ADDR, sizeof(int), GFP_KERNEL);
1348+ if (!mii_bus->irq) {
1349+ err = -ENOMEM;
1350+ goto err_free_bus;
1351+ }
1352+ for (i = 0; i < PHY_MAX_ADDR; i++)
1353+ mii_bus->irq[i] = PHY_POLL;
1354+
1355+ err = mdiobus_register(mii_bus);
1356+ if (err) {
1357+ bgmac_err(bgmac, "Registration of mii bus failed\n");
1358+ goto err_free_irq;
1359+ }
1360+
1361+ bgmac->mii_bus = mii_bus;
1362+
1363+ return err;
1364+
1365+err_free_irq:
1366+ kfree(mii_bus->irq);
1367+err_free_bus:
1368+ mdiobus_free(mii_bus);
1369+ return err;
1370+}
1371+
1372+static void bgmac_mii_unregister(struct bgmac *bgmac)
1373+{
1374+ struct mii_bus *mii_bus = bgmac->mii_bus;
1375+
1376+ mdiobus_unregister(mii_bus);
1377+ kfree(mii_bus->irq);
1378+ mdiobus_free(mii_bus);
1379+}
1380+
13151381 /**************************************************
13161382 * BCMA bus ops
13171383 **************************************************/
@@ -1404,11 +1470,18 @@ static int bgmac_probe(struct bcma_device *core) · 86 unmodified lines
14041470 if (core->bus->sprom.boardflags_lo & BGMAC_BFL_ENETADM)
14051471 bgmac_warn(bgmac, "Support for ADMtek ethernet switch not implemented\n");
14061472
1473+ err = bgmac_mii_register(bgmac);
1474+ if (err) {
1475+ bgmac_err(bgmac, "Cannot register MDIO\n");
1476+ err = -ENOTSUPP;
1477+ goto err_dma_free;
1478+ }
1479+
14071480 err = register_netdev(bgmac->net_dev);
14081481 if (err) {
14091482 bgmac_err(bgmac, "Cannot register net device\n");
14101483 err = -ENOTSUPP;
1411− goto err_dma_free;
1484+ goto err_mii_unregister;
14121485 }
14131486
14141487 netif_carrier_off(net_dev);
@@ -1417,6 +1490,8 @@ static int bgmac_probe(struct bcma_device *core) · 2 unmodified lines
14171490
14181491 return 0;
14191492
1493+err_mii_unregister:
1494+ bgmac_mii_unregister(bgmac);
14201495 err_dma_free:
14211496 bgmac_dma_free(bgmac);
14221497
@@ -1433,6 +1508,7 @@ static void bgmac_remove(struct bcma_device *core) · 10 unmodified lines
14331508
14341509 netif_napi_del(&bgmac->napi);
14351510 unregister_netdev(bgmac->net_dev);
1511+ bgmac_mii_unregister(bgmac);
14361512 bgmac_dma_free(bgmac);
14371513 bcma_set_drvdata(core, NULL);
14381514 free_netdev(bgmac->net_dev);
drivers/net/ethernet/broadcom/bgmac.h+1−0
@@ -399,6 +399,7 @@ struct bgmac { · 398 unmodified lines
399399 struct bcma_device *cmn; /* Reference to CMN core for BCM4706 */
400400 struct net_device *net_dev;
401401 struct napi_struct napi;
402+ struct mii_bus *mii_bus;
402403
403404 /* DMA */
404405 struct bgmac_dma_ring tx_ring[BGMAC_MAX_TX_RINGS];
drivers/net/ethernet/broadcom/bnx2.c+9−10
@@ -416,7 +416,7 @@ static int bnx2_unregister_cnic(struct net_device *dev) · 415 unmodified lines
416416 return 0;
417417 }
418418
419−struct cnic_eth_dev *bnx2_cnic_probe(struct net_device *dev)
419+static struct cnic_eth_dev *bnx2_cnic_probe(struct net_device *dev)
420420 {
421421 struct bnx2 *bp = netdev_priv(dev);
422422 struct cnic_eth_dev *cp = &bp->cnic_eth_dev;
@@ -854,12 +854,11 @@ bnx2_alloc_mem(struct bnx2 *bp) · 431 unmodified lines
854854 sizeof(struct statistics_block);
855855
856856 status_blk = dma_alloc_coherent(&bp->pdev->dev, bp->status_stats_size,
857− &bp->status_blk_mapping, GFP_KERNEL);
857+ &bp->status_blk_mapping,
858+ GFP_KERNEL | __GFP_ZERO);
858859 if (status_blk == NULL)
859860 goto alloc_mem_err;
860861
861− memset(status_blk, 0, bp->status_stats_size);
862−
863862 bnapi = &bp->bnx2_napi[0];
864863 bnapi->status_blk.msi = status_blk;
865864 bnapi->hw_tx_cons_ptr =
@@ -3212,7 +3211,7 @@ bnx2_rx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) · 2346 unmodified lines
32123211 }
32133212 if ((status & L2_FHDR_STATUS_L2_VLAN_TAG) &&
32143213 !(bp->rx_mode & BNX2_EMAC_RX_MODE_KEEP_VLAN_TAG))
3215− __vlan_hwaccel_put_tag(skb, rx_hdr->l2_fhdr_vlan_tag);
3214+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), rx_hdr->l2_fhdr_vlan_tag);
32163215
32173216 skb->protocol = eth_type_trans(skb, bp->dev);
32183217
@@ -3554,7 +3553,7 @@ bnx2_set_rx_mode(struct net_device *dev) · 335 unmodified lines
35543553 rx_mode = bp->rx_mode & ~(BNX2_EMAC_RX_MODE_PROMISCUOUS |
35553554 BNX2_EMAC_RX_MODE_KEEP_VLAN_TAG);
35563555 sort_mode = 1 | BNX2_RPM_SORT_USER0_BC_EN;
3557− if (!(dev->features & NETIF_F_HW_VLAN_RX) &&
3556+ if (!(dev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
35583557 (bp->flags & BNX2_FLAG_CAN_KEEP_VLAN))
35593558 rx_mode |= BNX2_EMAC_RX_MODE_KEEP_VLAN_TAG;
35603559 if (dev->flags & IFF_PROMISC) {
@@ -7696,7 +7695,7 @@ bnx2_fix_features(struct net_device *dev, netdev_features_t features) · 4135 unmodified lines
76967695 struct bnx2 *bp = netdev_priv(dev);
76977696
76987697 if (!(bp->flags & BNX2_FLAG_CAN_KEEP_VLAN))
7699− features |= NETIF_F_HW_VLAN_RX;
7698+ features |= NETIF_F_HW_VLAN_CTAG_RX;
77007699
77017700 return features;
77027701 }
@@ -7707,12 +7706,12 @@ bnx2_set_features(struct net_device *dev, netdev_features_t features) · 4 unmodified lines
77077706 struct bnx2 *bp = netdev_priv(dev);
77087707
77097708 /* TSO with VLAN tag won't work with current firmware */
7710− if (features & NETIF_F_HW_VLAN_TX)
7709+ if (features & NETIF_F_HW_VLAN_CTAG_TX)
77117710 dev->vlan_features |= (dev->hw_features & NETIF_F_ALL_TSO);
77127711 else
77137712 dev->vlan_features &= ~NETIF_F_ALL_TSO;
77147713
7715− if ((!!(features & NETIF_F_HW_VLAN_RX) !=
7714+ if ((!!(features & NETIF_F_HW_VLAN_CTAG_RX) !=
77167715 !!(bp->rx_mode & BNX2_EMAC_RX_MODE_KEEP_VLAN_TAG)) &&
77177716 netif_running(dev)) {
77187717 bnx2_netif_stop(bp, false);
@@ -8552,7 +8551,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 833 unmodified lines
85528551 dev->hw_features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
85538552
85548553 dev->vlan_features = dev->hw_features;
8555− dev->hw_features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
8554+ dev->hw_features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
85568555 dev->features |= dev->hw_features;
85578556 dev->priv_flags |= IFF_UNICAST_FLT;
85588557
drivers/net/ethernet/broadcom/bnx2x/bnx2x.h+34−24
@@ -26,8 +26,8 @@ · 25 unmodified lines
2626 * (you will need to reboot afterwards) */
2727 /* #define BNX2X_STOP_ON_ERROR */
2828
29−#define DRV_MODULE_VERSION "1.78.02-0"
30−#define DRV_MODULE_RELDATE "2013/01/14"
29+#define DRV_MODULE_VERSION "1.78.17-0"
30+#define DRV_MODULE_RELDATE "2013/04/11"
3131 #define BNX2X_BC_VER 0x040200
3232
3333 #if defined(CONFIG_DCB)
@@ -492,7 +492,6 @@ enum bnx2x_tpa_mode_t { · 458 unmodified lines
492492 struct bnx2x_fastpath {
493493 struct bnx2x *bp; /* parent */
494494
495−#define BNX2X_NAPI_WEIGHT 128
496495 struct napi_struct napi;
497496 union host_hc_status_block status_blk;
498497 /* chip independed shortcuts into sb structure */
@@ -613,9 +612,10 @@ struct bnx2x_fastpath { · 114 unmodified lines
613612 * START_BD - describes packed
614613 * START_BD(splitted) - includes unpaged data segment for GSO
615614 * PARSING_BD - for TSO and CSUM data
615+ * PARSING_BD2 - for encapsulation data
616616 * Frag BDs - decribes pages for frags
617617 */
618−#define BDS_PER_TX_PKT 3
618+#define BDS_PER_TX_PKT 4
619619 #define MAX_BDS_PER_TX_PKT (MAX_SKB_FRAGS + BDS_PER_TX_PKT)
620620 /* max BDs per tx packet including next pages */
621621 #define MAX_DESC_PER_TX_PKT (MAX_BDS_PER_TX_PKT + \
@@ -730,18 +730,24 @@ struct bnx2x_fastpath { · 108 unmodified lines
730730 #define SKB_CS(skb) (*(u16 *)(skb_transport_header(skb) + \
731731 skb->csum_offset))
732732
733−#define pbd_tcp_flags(skb) (ntohl(tcp_flag_word(tcp_hdr(skb)))>>16 & 0xff)
733+#define pbd_tcp_flags(tcp_hdr) (ntohl(tcp_flag_word(tcp_hdr))>>16 & 0xff)
734734
735−#define XMIT_PLAIN 0
736−#define XMIT_CSUM_V4 0x1
737−#define XMIT_CSUM_V6 0x2
738−#define XMIT_CSUM_TCP 0x4
739−#define XMIT_GSO_V4 0x8
740−#define XMIT_GSO_V6 0x10
735+#define XMIT_PLAIN 0
736+#define XMIT_CSUM_V4 (1 << 0)
737+#define XMIT_CSUM_V6 (1 << 1)
738+#define XMIT_CSUM_TCP (1 << 2)
739+#define XMIT_GSO_V4 (1 << 3)
740+#define XMIT_GSO_V6 (1 << 4)
741+#define XMIT_CSUM_ENC_V4 (1 << 5)
742+#define XMIT_CSUM_ENC_V6 (1 << 6)
743+#define XMIT_GSO_ENC_V4 (1 << 7)
744+#define XMIT_GSO_ENC_V6 (1 << 8)
741745
742−#define XMIT_CSUM (XMIT_CSUM_V4 | XMIT_CSUM_V6)
743−#define XMIT_GSO (XMIT_GSO_V4 | XMIT_GSO_V6)
746+#define XMIT_CSUM_ENC (XMIT_CSUM_ENC_V4 | XMIT_CSUM_ENC_V6)
747+#define XMIT_GSO_ENC (XMIT_GSO_ENC_V4 | XMIT_GSO_ENC_V6)
744748
749+#define XMIT_CSUM (XMIT_CSUM_V4 | XMIT_CSUM_V6 | XMIT_CSUM_ENC)
750+#define XMIT_GSO (XMIT_GSO_V4 | XMIT_GSO_V6 | XMIT_GSO_ENC)
745751
746752 /* stuff added to make the code fit 80Col */
747753 #define CQE_TYPE(cqe_fp_flags) ((cqe_fp_flags) & ETH_FAST_PATH_RX_CQE_TYPE)
@@ -844,6 +850,9 @@ struct bnx2x_common { · 96 unmodified lines
844850 #define CHIP_IS_57840_VF(bp) (CHIP_NUM(bp) == CHIP_NUM_57840_VF)
845851 #define CHIP_IS_E1H(bp) (CHIP_IS_57711(bp) || \
846852 CHIP_IS_57711E(bp))
853+#define CHIP_IS_57811xx(bp) (CHIP_IS_57811(bp) || \
854+ CHIP_IS_57811_MF(bp) || \
855+ CHIP_IS_57811_VF(bp))
847856 #define CHIP_IS_E2(bp) (CHIP_IS_57712(bp) || \
848857 CHIP_IS_57712_MF(bp) || \
849858 CHIP_IS_57712_VF(bp))
@@ -853,9 +862,7 @@ struct bnx2x_common { · 3 unmodified lines
853862 CHIP_IS_57810(bp) || \
854863 CHIP_IS_57810_MF(bp) || \
855864 CHIP_IS_57810_VF(bp) || \
856− CHIP_IS_57811(bp) || \
857− CHIP_IS_57811_MF(bp) || \
858− CHIP_IS_57811_VF(bp) || \
865+ CHIP_IS_57811xx(bp) || \
859866 CHIP_IS_57840(bp) || \
860867 CHIP_IS_57840_MF(bp) || \
861868 CHIP_IS_57840_VF(bp))
@@ -1215,14 +1222,16 @@ enum { · 353 unmodified lines
12151222 BNX2X_SP_RTNL_ENABLE_SRIOV,
12161223 BNX2X_SP_RTNL_VFPF_MCAST,
12171224 BNX2X_SP_RTNL_VFPF_STORM_RX_MODE,
1225+ BNX2X_SP_RTNL_HYPERVISOR_VLAN,
12181226 };
12191227
12201228
12211229 struct bnx2x_prev_path_list {
1230+ struct list_head list;
12221231 u8 bus;
12231232 u8 slot;
12241233 u8 path;
1225− struct list_head list;
1234+ u8 aer;
12261235 u8 undi;
12271236 };
12281237
@@ -1269,6 +1278,8 @@ struct bnx2x { · 40 unmodified lines
12691278 #define BP_FW_MB_IDX(bp) BP_FW_MB_IDX_VN(bp, BP_VN(bp))
12701279
12711280 #ifdef CONFIG_BNX2X_SRIOV
1281+ /* protects vf2pf mailbox from simultaneous access */
1282+ struct mutex vf2pf_mutex;
12721283 /* vf pf channel mailbox contains request and response buffers */
12731284 struct bnx2x_vf_mbx_msg *vf2pf_mbox;
12741285 dma_addr_t vf2pf_mbox_mapping;
@@ -1281,6 +1292,8 @@ struct bnx2x { · 6 unmodified lines
12811292 dma_addr_t pf2vf_bulletin_mapping;
12821293
12831294 struct pf_vf_bulletin_content old_bulletin;
1295+
1296+ u16 requested_nr_virtfn;
12841297 #endif /* CONFIG_BNX2X_SRIOV */
12851298
12861299 struct net_device *dev;
@@ -1944,12 +1957,9 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg, u32 expected, int ms, · 657 unmodified lines
19441957 void bnx2x_igu_clear_sb_gen(struct bnx2x *bp, u8 func, u8 idu_sb_id,
19451958 bool is_pf);
19461959
1947−#define BNX2X_ILT_ZALLOC(x, y, size) \
1948− do { \
1949− x = dma_alloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \
1950− if (x) \
1951− memset(x, 0, size); \
1952− } while (0)
1960+#define BNX2X_ILT_ZALLOC(x, y, size) \
1961+ x = dma_alloc_coherent(&bp->pdev->dev, size, y, \
1962+ GFP_KERNEL | __GFP_ZERO)
19531963
19541964 #define BNX2X_ILT_FREE(x, y, size) \
19551965 do { \
@@ -2286,7 +2296,7 @@ static const u32 dmae_reg_go_c[] = { · 330 unmodified lines
22862296 DMAE_REG_GO_C12, DMAE_REG_GO_C13, DMAE_REG_GO_C14, DMAE_REG_GO_C15
22872297 };
22882298
2289−void bnx2x_set_ethtool_ops(struct net_device *netdev);
2299+void bnx2x_set_ethtool_ops(struct bnx2x *bp, struct net_device *netdev);
22902300 void bnx2x_notify_link_changed(struct bnx2x *bp);
22912301
22922302 #define BNX2X_MF_SD_PROTOCOL(bp) \
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c+270−98
@@ -451,7 +451,8 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue, · 450 unmodified lines
451451 * Compute number of aggregated segments, and gso_type.
452452 */
453453 static void bnx2x_set_gro_params(struct sk_buff *skb, u16 parsing_flags,
454− u16 len_on_bd, unsigned int pkt_len)
454+ u16 len_on_bd, unsigned int pkt_len,
455+ u16 num_of_coalesced_segs)
455456 {
456457 /* TPA aggregation won't have either IP options or TCP options
457458 * other than timestamp or IPv6 extension headers.
@@ -480,8 +481,7 @@ static void bnx2x_set_gro_params(struct sk_buff *skb, u16 parsing_flags, · 22 unmodified lines
480481 /* tcp_gro_complete() will copy NAPI_GRO_CB(skb)->count
481482 * to skb_shinfo(skb)->gso_segs
482483 */
483− NAPI_GRO_CB(skb)->count = DIV_ROUND_UP(pkt_len - hdrs_len,
484− skb_shinfo(skb)->gso_size);
484+ NAPI_GRO_CB(skb)->count = num_of_coalesced_segs;
485485 }
486486
487487 static int bnx2x_alloc_rx_sge(struct bnx2x *bp,
@@ -537,7 +537,8 @@ static int bnx2x_fill_frag_skb(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 49 unmodified lines
537537 /* This is needed in order to enable forwarding support */
538538 if (frag_size)
539539 bnx2x_set_gro_params(skb, tpa_info->parsing_flags, len_on_bd,
540− le16_to_cpu(cqe->pkt_len));
540+ le16_to_cpu(cqe->pkt_len),
541+ le16_to_cpu(cqe->num_of_coalesced_segs));
541542
542543 #ifdef BNX2X_STOP_ON_ERROR
543544 if (pages > min_t(u32, 8, MAX_SKB_FRAGS) * SGE_PAGES) {
@@ -641,6 +642,14 @@ static void bnx2x_gro_ipv6_csum(struct bnx2x *bp, struct sk_buff *skb) · 97 unmodified lines
641642 th->check = ~tcp_v6_check(skb->len - skb_transport_offset(skb),
642643 &iph->saddr, &iph->daddr, 0);
643644 }
645+
646+static void bnx2x_gro_csum(struct bnx2x *bp, struct sk_buff *skb,
647+ void (*gro_func)(struct bnx2x*, struct sk_buff*))
648+{
649+ skb_set_network_header(skb, 0);
650+ gro_func(bp, skb);
651+ tcp_gro_complete(skb);
652+}
644653 #endif
645654
646655 static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp,
@@ -648,19 +657,17 @@ static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 1 unmodified line
648657 {
649658 #ifdef CONFIG_INET
650659 if (skb_shinfo(skb)->gso_size) {
651− skb_set_network_header(skb, 0);
652660 switch (be16_to_cpu(skb->protocol)) {
653661 case ETH_P_IP:
654− bnx2x_gro_ip_csum(bp, skb);
662+ bnx2x_gro_csum(bp, skb, bnx2x_gro_ip_csum);
655663 break;
656664 case ETH_P_IPV6:
657− bnx2x_gro_ipv6_csum(bp, skb);
665+ bnx2x_gro_csum(bp, skb, bnx2x_gro_ipv6_csum);
658666 break;
659667 default:
660− BNX2X_ERR("FW GRO supports only IPv4/IPv6, not 0x%04x\n",
668+ BNX2X_ERR("Error: FW GRO supports only IPv4/IPv6, not 0x%04x\n",
661669 be16_to_cpu(skb->protocol));
662670 }
663− tcp_gro_complete(skb);
664671 }
665672 #endif
666673 napi_gro_receive(&fp->napi, skb);
@@ -718,7 +725,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, · 51 unmodified lines
718725 if (!bnx2x_fill_frag_skb(bp, fp, tpa_info, pages,
719726 skb, cqe, cqe_idx)) {
720727 if (tpa_info->parsing_flags & PARSING_FLAGS_VLAN)
721− __vlan_hwaccel_put_tag(skb, tpa_info->vlan_tag);
728+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), tpa_info->vlan_tag);
722729 bnx2x_gro_receive(bp, fp, skb);
723730 } else {
724731 DP(NETIF_MSG_RX_STATUS,
@@ -993,7 +1000,7 @@ reuse_rx: · 268 unmodified lines
9931000
9941001 if (le16_to_cpu(cqe_fp->pars_flags.flags) &
9951002 PARSING_FLAGS_VLAN)
996− __vlan_hwaccel_put_tag(skb,
1003+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
9971004 le16_to_cpu(cqe_fp->vlan_tag));
9981005 napi_gro_receive(&fp->napi, skb);
9991006
@@ -1037,6 +1044,7 @@ static irqreturn_t bnx2x_msix_fp_int(int irq, void *fp_cookie) · 37 unmodified lines
10371044 DP(NETIF_MSG_INTR,
10381045 "got an MSI-X interrupt on IDX:SB [fp %d fw_sd %d igusb %d]\n",
10391046 fp->index, fp->fw_sb_id, fp->igu_sb_id);
1047+
10401048 bnx2x_ack_sb(bp, fp->igu_sb_id, USTORM_ID, 0, IGU_INT_DISABLE, 0);
10411049
10421050 #ifdef BNX2X_STOP_ON_ERROR
@@ -1718,7 +1726,7 @@ static int bnx2x_req_irq(struct bnx2x *bp) · 675 unmodified lines
17181726 return request_irq(irq, bnx2x_interrupt, flags, bp->dev->name, bp->dev);
17191727 }
17201728
1721−static int bnx2x_setup_irqs(struct bnx2x *bp)
1729+int bnx2x_setup_irqs(struct bnx2x *bp)
17221730 {
17231731 int rc = 0;
17241732 if (bp->flags & USING_MSIX_FLAG &&
@@ -2009,7 +2017,7 @@ static int bnx2x_init_hw(struct bnx2x *bp, u32 load_code) · 284 unmodified lines
20092017 * Cleans the object that have internal lists without sending
20102018 * ramrods. Should be run when interrutps are disabled.
20112019 */
2012−static void bnx2x_squeeze_objects(struct bnx2x *bp)
2020+void bnx2x_squeeze_objects(struct bnx2x *bp)
20132021 {
20142022 int rc;
20152023 unsigned long ramrod_flags = 0, vlan_mac_flags = 0;
@@ -2574,6 +2582,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 558 unmodified lines
25742582 }
25752583 }
25762584
2585+ bnx2x_pre_irq_nic_init(bp);
2586+
25772587 /* Connect to IRQs */
25782588 rc = bnx2x_setup_irqs(bp);
25792589 if (rc) {
@@ -2583,11 +2593,11 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 3 unmodified lines
25832593 LOAD_ERROR_EXIT(bp, load_error2);
25842594 }
25852595
2586− /* Setup NIC internals and enable interrupts */
2587− bnx2x_nic_init(bp, load_code);
2588−
25892596 /* Init per-function objects */
25902597 if (IS_PF(bp)) {
2598+ /* Setup NIC internals and enable interrupts */
2599+ bnx2x_post_irq_nic_init(bp, load_code);
2600+
25912601 bnx2x_init_bp_objs(bp);
25922602 bnx2x_iov_nic_init(bp);
25932603
@@ -2657,7 +2667,8 @@ int bnx2x_nic_load(struct bnx2x *bp, int load_mode) · 63 unmodified lines
26572667 if (IS_PF(bp))
26582668 rc = bnx2x_set_eth_mac(bp, true);
26592669 else /* vf */
2660− rc = bnx2x_vfpf_set_mac(bp);
2670+ rc = bnx2x_vfpf_config_mac(bp, bp->dev->dev_addr, bp->fp->index,
2671+ true);
26612672 if (rc) {
26622673 BNX2X_ERR("Setting Ethernet MAC failed\n");
26632674 LOAD_ERROR_EXIT(bp, load_error3);
@@ -2777,7 +2788,7 @@ load_error0: · 113 unmodified lines
27772788 #endif /* ! BNX2X_STOP_ON_ERROR */
27782789 }
27792790
2780−static int bnx2x_drain_tx_queues(struct bnx2x *bp)
2791+int bnx2x_drain_tx_queues(struct bnx2x *bp)
27812792 {
27822793 u8 rc = 0, cos, i;
27832794
@@ -2926,9 +2937,9 @@ int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link) · 142 unmodified lines
29262937 bnx2x_free_fp_mem_cnic(bp);
29272938
29282939 if (IS_PF(bp)) {
2929− bnx2x_free_mem(bp);
29302940 if (CNIC_LOADED(bp))
29312941 bnx2x_free_mem_cnic(bp);
2942+ bnx2x_free_mem(bp);
29322943 }
29332944 bp->state = BNX2X_STATE_CLOSED;
29342945 bp->cnic_loaded = false;
@@ -3089,11 +3100,11 @@ int bnx2x_poll(struct napi_struct *napi, int budget) · 154 unmodified lines
30893100 * to ease the pain of our fellow microcode engineers
30903101 * we use one mapping for both BDs
30913102 */
3092−static noinline u16 bnx2x_tx_split(struct bnx2x *bp,
3093− struct bnx2x_fp_txdata *txdata,
3094− struct sw_tx_bd *tx_buf,
3095− struct eth_tx_start_bd **tx_bd, u16 hlen,
3096− u16 bd_prod, int nbd)
3103+static u16 bnx2x_tx_split(struct bnx2x *bp,
3104+ struct bnx2x_fp_txdata *txdata,
3105+ struct sw_tx_bd *tx_buf,
3106+ struct eth_tx_start_bd **tx_bd, u16 hlen,
3107+ u16 bd_prod)
30973108 {
30983109 struct eth_tx_start_bd *h_tx_bd = *tx_bd;
30993110 struct eth_tx_bd *d_tx_bd;
@@ -3101,11 +3112,10 @@ static noinline u16 bnx2x_tx_split(struct bnx2x *bp, · 1 unmodified line
31013112 int old_len = le16_to_cpu(h_tx_bd->nbytes);
31023113
31033114 /* first fix first BD */
3104− h_tx_bd->nbd = cpu_to_le16(nbd);
31053115 h_tx_bd->nbytes = cpu_to_le16(hlen);
31063116
3107− DP(NETIF_MSG_TX_QUEUED, "TSO split header size is %d (%x:%x) nbd %d\n",
3108− h_tx_bd->nbytes, h_tx_bd->addr_hi, h_tx_bd->addr_lo, h_tx_bd->nbd);
3117+ DP(NETIF_MSG_TX_QUEUED, "TSO split header size is %d (%x:%x)\n",
3118+ h_tx_bd->nbytes, h_tx_bd->addr_hi, h_tx_bd->addr_lo);
31093119
31103120 /* now get a new data BD
31113121 * (after the pbd) and fill it */
@@ -3134,7 +3144,7 @@ static noinline u16 bnx2x_tx_split(struct bnx2x *bp, · 22 unmodified lines
31343144
31353145 #define bswab32(b32) ((__force __le32) swab32((__force __u32) (b32)))
31363146 #define bswab16(b16) ((__force __le16) swab16((__force __u16) (b16)))
3137−static inline __le16 bnx2x_csum_fix(unsigned char *t_header, u16 csum, s8 fix)
3147+static __le16 bnx2x_csum_fix(unsigned char *t_header, u16 csum, s8 fix)
31383148 {
31393149 __sum16 tsum = (__force __sum16) csum;
31403150
@@ -3149,30 +3159,47 @@ static inline __le16 bnx2x_csum_fix(unsigned char *t_header, u16 csum, s8 fix) · 8 unmodified lines
31493159 return bswab16(tsum);
31503160 }
31513161
3152−static inline u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
3162+static u32 bnx2x_xmit_type(struct bnx2x *bp, struct sk_buff *skb)
31533163 {
31543164 u32 rc;
3165+ __u8 prot = 0;
3166+ __be16 protocol;
31553167
31563168 if (skb->ip_summed != CHECKSUM_PARTIAL)
3157− rc = XMIT_PLAIN;
3169+ return XMIT_PLAIN;
31583170
3159− else {
3160− if (vlan_get_protocol(skb) == htons(ETH_P_IPV6)) {
3161− rc = XMIT_CSUM_V6;
3162− if (ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
3163− rc |= XMIT_CSUM_TCP;
3171+ protocol = vlan_get_protocol(skb);
3172+ if (protocol == htons(ETH_P_IPV6)) {
3173+ rc = XMIT_CSUM_V6;
3174+ prot = ipv6_hdr(skb)->nexthdr;
3175+ } else {
3176+ rc = XMIT_CSUM_V4;
3177+ prot = ip_hdr(skb)->protocol;
3178+ }
31643179
3180+ if (!CHIP_IS_E1x(bp) && skb->encapsulation) {
3181+ if (inner_ip_hdr(skb)->version == 6) {
3182+ rc |= XMIT_CSUM_ENC_V6;
3183+ if (inner_ipv6_hdr(skb)->nexthdr == IPPROTO_TCP)
3184+ rc |= XMIT_CSUM_TCP;
31653185 } else {
3166− rc = XMIT_CSUM_V4;
3167− if (ip_hdr(skb)->protocol == IPPROTO_TCP)
3186+ rc |= XMIT_CSUM_ENC_V4;
3187+ if (inner_ip_hdr(skb)->protocol == IPPROTO_TCP)
31683188 rc |= XMIT_CSUM_TCP;
31693189 }
31703190 }
3191+ if (prot == IPPROTO_TCP)
3192+ rc |= XMIT_CSUM_TCP;
31713193
3172− if (skb_is_gso_v6(skb))
3173− rc |= XMIT_GSO_V6 | XMIT_CSUM_TCP | XMIT_CSUM_V6;
3174− else if (skb_is_gso(skb))
3175− rc |= XMIT_GSO_V4 | XMIT_CSUM_V4 | XMIT_CSUM_TCP;
3194+ if (skb_is_gso_v6(skb)) {
3195+ rc |= (XMIT_GSO_V6 | XMIT_CSUM_TCP | XMIT_CSUM_V6);
3196+ if (rc & XMIT_CSUM_ENC)
3197+ rc |= XMIT_GSO_ENC_V6;
3198+ } else if (skb_is_gso(skb)) {
3199+ rc |= (XMIT_GSO_V4 | XMIT_CSUM_V4 | XMIT_CSUM_TCP);
3200+ if (rc & XMIT_CSUM_ENC)
3201+ rc |= XMIT_GSO_ENC_V4;
3202+ }
31763203
31773204 return rc;
31783205 }
@@ -3257,14 +3284,23 @@ exit_lbl: · 78 unmodified lines
32573284 }
32583285 #endif
32593286
3260−static inline void bnx2x_set_pbd_gso_e2(struct sk_buff *skb, u32 *parsing_data,
3261− u32 xmit_type)
3287+static void bnx2x_set_pbd_gso_e2(struct sk_buff *skb, u32 *parsing_data,
3288+ u32 xmit_type)
32623289 {
3290+ struct ipv6hdr *ipv6;
3291+
32633292 *parsing_data |= (skb_shinfo(skb)->gso_size <<
32643293 ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT) &
32653294 ETH_TX_PARSE_BD_E2_LSO_MSS;
3266− if ((xmit_type & XMIT_GSO_V6) &&
3267− (ipv6_hdr(skb)->nexthdr == NEXTHDR_IPV6))
3295+
3296+ if (xmit_type & XMIT_GSO_ENC_V6)
3297+ ipv6 = inner_ipv6_hdr(skb);
3298+ else if (xmit_type & XMIT_GSO_V6)
3299+ ipv6 = ipv6_hdr(skb);
3300+ else
3301+ ipv6 = NULL;
3302+
3303+ if (ipv6 && ipv6->nexthdr == NEXTHDR_IPV6)
32683304 *parsing_data |= ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR;
32693305 }
32703306
@@ -3275,13 +3311,13 @@ static inline void bnx2x_set_pbd_gso_e2(struct sk_buff *skb, u32 *parsing_data, · 4 unmodified lines
32753311 * @pbd: parse BD
32763312 * @xmit_type: xmit flags
32773313 */
3278−static inline void bnx2x_set_pbd_gso(struct sk_buff *skb,
3279− struct eth_tx_parse_bd_e1x *pbd,
3280− u32 xmit_type)
3314+static void bnx2x_set_pbd_gso(struct sk_buff *skb,
3315+ struct eth_tx_parse_bd_e1x *pbd,
3316+ u32 xmit_type)
32813317 {
32823318 pbd->lso_mss = cpu_to_le16(skb_shinfo(skb)->gso_size);
32833319 pbd->tcp_send_seq = bswab32(tcp_hdr(skb)->seq);
3284− pbd->tcp_flags = pbd_tcp_flags(skb);
3320+ pbd->tcp_flags = pbd_tcp_flags(tcp_hdr(skb));
32853321
32863322 if (xmit_type & XMIT_GSO_V4) {
32873323 pbd->ip_id = bswab16(ip_hdr(skb)->id);
@@ -3300,6 +3336,40 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb, · 12 unmodified lines
33003336 cpu_to_le16(ETH_TX_PARSE_BD_E1X_PSEUDO_CS_WITHOUT_LEN);
33013337 }
33023338
3339+/**
3340+ * bnx2x_set_pbd_csum_enc - update PBD with checksum and return header length
3341+ *
3342+ * @bp: driver handle
3343+ * @skb: packet skb
3344+ * @parsing_data: data to be updated
3345+ * @xmit_type: xmit flags
3346+ *
3347+ * 57712/578xx related, when skb has encapsulation
3348+ */
3349+static u8 bnx2x_set_pbd_csum_enc(struct bnx2x *bp, struct sk_buff *skb,
3350+ u32 *parsing_data, u32 xmit_type)
3351+{
3352+ *parsing_data |=
3353+ ((((u8 *)skb_inner_transport_header(skb) - skb->data) >> 1) <<
3354+ ETH_TX_PARSE_BD_E2_L4_HDR_START_OFFSET_W_SHIFT) &
3355+ ETH_TX_PARSE_BD_E2_L4_HDR_START_OFFSET_W;
3356+
3357+ if (xmit_type & XMIT_CSUM_TCP) {
3358+ *parsing_data |= ((inner_tcp_hdrlen(skb) / 4) <<
3359+ ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) &
3360+ ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW;
3361+
3362+ return skb_inner_transport_header(skb) +
3363+ inner_tcp_hdrlen(skb) - skb->data;
3364+ }
3365+
3366+ /* We support checksum offload for TCP and UDP only.
3367+ * No need to pass the UDP header length - it's a constant.
3368+ */
3369+ return skb_inner_transport_header(skb) +
3370+ sizeof(struct udphdr) - skb->data;
3371+}
3372+
33033373 /**
33043374 * bnx2x_set_pbd_csum_e2 - update PBD with checksum and return header length
33053375 *
@@ -3308,15 +3378,15 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb, · 2 unmodified lines
33083378 * @parsing_data: data to be updated
33093379 * @xmit_type: xmit flags
33103380 *
3311− * 57712 related
3381+ * 57712/578xx related
33123382 */
3313−static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb,
3314− u32 *parsing_data, u32 xmit_type)
3383+static u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb,
3384+ u32 *parsing_data, u32 xmit_type)
33153385 {
33163386 *parsing_data |=
33173387 ((((u8 *)skb_transport_header(skb) - skb->data) >> 1) <<
3318− ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) &
3319− ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W;
3388+ ETH_TX_PARSE_BD_E2_L4_HDR_START_OFFSET_W_SHIFT) &
3389+ ETH_TX_PARSE_BD_E2_L4_HDR_START_OFFSET_W;
33203390
33213391 if (xmit_type & XMIT_CSUM_TCP) {
33223392 *parsing_data |= ((tcp_hdrlen(skb) / 4) <<
@@ -3331,17 +3401,15 @@ static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb, · 8 unmodified lines
33313401 return skb_transport_header(skb) + sizeof(struct udphdr) - skb->data;
33323402 }
33333403
3334−static inline void bnx2x_set_sbd_csum(struct bnx2x *bp, struct sk_buff *skb,
3335− struct eth_tx_start_bd *tx_start_bd, u32 xmit_type)
3404+/* set FW indication according to inner or outer protocols if tunneled */
3405+static void bnx2x_set_sbd_csum(struct bnx2x *bp, struct sk_buff *skb,
3406+ struct eth_tx_start_bd *tx_start_bd,
3407+ u32 xmit_type)
33363408 {
33373409 tx_start_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_L4_CSUM;
33383410
3339− if (xmit_type & XMIT_CSUM_V4)
3340− tx_start_bd->bd_flags.as_bitfield |=
3341− ETH_TX_BD_FLAGS_IP_CSUM;
3342− else
3343− tx_start_bd->bd_flags.as_bitfield |=
3344− ETH_TX_BD_FLAGS_IPV6;
3411+ if (xmit_type & (XMIT_CSUM_ENC_V6 | XMIT_CSUM_V6))
3412+ tx_start_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_IPV6;
33453413
33463414 if (!(xmit_type & XMIT_CSUM_TCP))
33473415 tx_start_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_IS_UDP;
@@ -3355,9 +3423,9 @@ static inline void bnx2x_set_sbd_csum(struct bnx2x *bp, struct sk_buff *skb, · 7 unmodified lines
33553423 * @pbd: parse BD to be updated
33563424 * @xmit_type: xmit flags
33573425 */
3358−static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb,
3359− struct eth_tx_parse_bd_e1x *pbd,
3360− u32 xmit_type)
3426+static u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb,
3427+ struct eth_tx_parse_bd_e1x *pbd,
3428+ u32 xmit_type)
33613429 {
33623430 u8 hlen = (skb_network_header(skb) - skb->data) >> 1;
33633431
@@ -3403,6 +3471,75 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb, · 39 unmodified lines
34033471 return hlen;
34043472 }
34053473
3474+static void bnx2x_update_pbds_gso_enc(struct sk_buff *skb,
3475+ struct eth_tx_parse_bd_e2 *pbd_e2,
3476+ struct eth_tx_parse_2nd_bd *pbd2,
3477+ u16 *global_data,
3478+ u32 xmit_type)
3479+{
3480+ u16 hlen_w = 0;
3481+ u8 outerip_off, outerip_len = 0;
3482+ /* from outer IP to transport */
3483+ hlen_w = (skb_inner_transport_header(skb) -
3484+ skb_network_header(skb)) >> 1;
3485+
3486+ /* transport len */
3487+ if (xmit_type & XMIT_CSUM_TCP)
3488+ hlen_w += inner_tcp_hdrlen(skb) >> 1;
3489+ else
3490+ hlen_w += sizeof(struct udphdr) >> 1;
3491+
3492+ pbd2->fw_ip_hdr_to_payload_w = hlen_w;
3493+
3494+ if (xmit_type & XMIT_CSUM_ENC_V4) {
3495+ struct iphdr *iph = ip_hdr(skb);
3496+ pbd2->fw_ip_csum_wo_len_flags_frag =
3497+ bswab16(csum_fold((~iph->check) -
3498+ iph->tot_len - iph->frag_off));
3499+ } else {
3500+ pbd2->fw_ip_hdr_to_payload_w =
3501+ hlen_w - ((sizeof(struct ipv6hdr)) >> 1);
3502+ }
3503+
3504+ pbd2->tcp_send_seq = bswab32(inner_tcp_hdr(skb)->seq);
3505+
3506+ pbd2->tcp_flags = pbd_tcp_flags(inner_tcp_hdr(skb));
3507+
3508+ if (xmit_type & XMIT_GSO_V4) {
3509+ pbd2->hw_ip_id = bswab16(inner_ip_hdr(skb)->id);
3510+
3511+ pbd_e2->data.tunnel_data.pseudo_csum =
3512+ bswab16(~csum_tcpudp_magic(
3513+ inner_ip_hdr(skb)->saddr,
3514+ inner_ip_hdr(skb)->daddr,
3515+ 0, IPPROTO_TCP, 0));
3516+
3517+ outerip_len = ip_hdr(skb)->ihl << 1;
3518+ } else {
3519+ pbd_e2->data.tunnel_data.pseudo_csum =
3520+ bswab16(~csum_ipv6_magic(
3521+ &inner_ipv6_hdr(skb)->saddr,
3522+ &inner_ipv6_hdr(skb)->daddr,
3523+ 0, IPPROTO_TCP, 0));
3524+ }
3525+
3526+ outerip_off = (skb_network_header(skb) - skb->data) >> 1;
3527+
3528+ *global_data |=
3529+ outerip_off |
3530+ (!!(xmit_type & XMIT_CSUM_V6) <<
3531+ ETH_TX_PARSE_2ND_BD_IP_HDR_TYPE_OUTER_SHIFT) |
3532+ (outerip_len <<
3533+ ETH_TX_PARSE_2ND_BD_IP_HDR_LEN_OUTER_W_SHIFT) |
3534+ ((skb->protocol == cpu_to_be16(ETH_P_8021Q)) <<
3535+ ETH_TX_PARSE_2ND_BD_LLC_SNAP_EN_SHIFT);
3536+
3537+ if (ip_hdr(skb)->protocol == IPPROTO_UDP) {
3538+ SET_FLAG(*global_data, ETH_TX_PARSE_2ND_BD_TUNNEL_UDP_EXIST, 1);
3539+ pbd2->tunnel_udp_hdr_start_w = skb_transport_offset(skb) >> 1;
3540+ }
3541+}
3542+
34063543 /* called with netif_tx_lock
34073544 * bnx2x_tx_int() runs without netif_tx_lock unless it needs to call
34083545 * netif_wake_queue()
@@ -3418,6 +3555,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 9 unmodified lines
34183555 struct eth_tx_bd *tx_data_bd, *total_pkt_bd = NULL;
34193556 struct eth_tx_parse_bd_e1x *pbd_e1x = NULL;
34203557 struct eth_tx_parse_bd_e2 *pbd_e2 = NULL;
3558+ struct eth_tx_parse_2nd_bd *pbd2 = NULL;
34213559 u32 pbd_e2_parsing_data = 0;
34223560 u16 pkt_prod, bd_prod;
34233561 int nbd, txq_index;
@@ -3485,7 +3623,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 61 unmodified lines
34853623 mac_type = MULTICAST_ADDRESS;
34863624 }
34873625
3488−#if (MAX_SKB_FRAGS >= MAX_FETCH_BD - 3)
3626+#if (MAX_SKB_FRAGS >= MAX_FETCH_BD - BDS_PER_TX_PKT)
34893627 /* First, check if we need to linearize the skb (due to FW
34903628 restrictions). No need to check fragmentation if page size > 8K
34913629 (there will be no violation to FW restrictions) */
@@ -3533,12 +3671,9 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 41 unmodified lines
35333671 first_bd = tx_start_bd;
35343672
35353673 tx_start_bd->bd_flags.as_bitfield = ETH_TX_BD_FLAGS_START_BD;
3536− SET_FLAG(tx_start_bd->general_data,
3537− ETH_TX_START_BD_PARSE_NBDS,
3538− 0);
35393674
3540− /* header nbd */
3541− SET_FLAG(tx_start_bd->general_data, ETH_TX_START_BD_HDR_NBDS, 1);
3675+ /* header nbd: indirectly zero other flags! */
3676+ tx_start_bd->general_data = 1 << ETH_TX_START_BD_HDR_NBDS_SHIFT;
35423677
35433678 /* remember the first BD of the packet */
35443679 tx_buf->first_bd = txdata->tx_bd_prod;
@@ -3558,19 +3693,16 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 13 unmodified lines
35583693 /* when transmitting in a vf, start bd must hold the ethertype
35593694 * for fw to enforce it
35603695 */
3561−#ifndef BNX2X_STOP_ON_ERROR
3562− if (IS_VF(bp)) {
3563−#endif
3696+ if (IS_VF(bp))
35643697 tx_start_bd->vlan_or_ethertype =
35653698 cpu_to_le16(ntohs(eth->h_proto));
3566−#ifndef BNX2X_STOP_ON_ERROR
3567− } else {
3699+ else
35683700 /* used by FW for packet accounting */
35693701 tx_start_bd->vlan_or_ethertype = cpu_to_le16(pkt_prod);
3570− }
3571−#endif
35723702 }
35733703
3704+ nbd = 2; /* start_bd + pbd + frags (updated when pages are mapped) */
3705+
35743706 /* turn on parsing and get a BD */
35753707 bd_prod = TX_BD(NEXT_TX_IDX(bd_prod));
35763708
@@ -3580,23 +3712,58 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 3 unmodified lines
35803712 if (!CHIP_IS_E1x(bp)) {
35813713 pbd_e2 = &txdata->tx_desc_ring[bd_prod].parse_bd_e2;
35823714 memset(pbd_e2, 0, sizeof(struct eth_tx_parse_bd_e2));
3583− /* Set PBD in checksum offload case */
3584− if (xmit_type & XMIT_CSUM)
3715+
3716+ if (xmit_type & XMIT_CSUM_ENC) {
3717+ u16 global_data = 0;
3718+
3719+ /* Set PBD in enc checksum offload case */
3720+ hlen = bnx2x_set_pbd_csum_enc(bp, skb,
3721+ &pbd_e2_parsing_data,
3722+ xmit_type);
3723+
3724+ /* turn on 2nd parsing and get a BD */
3725+ bd_prod = TX_BD(NEXT_TX_IDX(bd_prod));
3726+
3727+ pbd2 = &txdata->tx_desc_ring[bd_prod].parse_2nd_bd;
3728+
3729+ memset(pbd2, 0, sizeof(*pbd2));
3730+
3731+ pbd_e2->data.tunnel_data.ip_hdr_start_inner_w =
3732+ (skb_inner_network_header(skb) -
3733+ skb->data) >> 1;
3734+
3735+ if (xmit_type & XMIT_GSO_ENC)
3736+ bnx2x_update_pbds_gso_enc(skb, pbd_e2, pbd2,
3737+ &global_data,
3738+ xmit_type);
3739+
3740+ pbd2->global_data = cpu_to_le16(global_data);
3741+
3742+ /* add addition parse BD indication to start BD */
3743+ SET_FLAG(tx_start_bd->general_data,
3744+ ETH_TX_START_BD_PARSE_NBDS, 1);
3745+ /* set encapsulation flag in start BD */
3746+ SET_FLAG(tx_start_bd->general_data,
3747+ ETH_TX_START_BD_TUNNEL_EXIST, 1);
3748+ nbd++;
3749+ } else if (xmit_type & XMIT_CSUM) {
3750+ /* Set PBD in checksum offload case w/o encapsulation */
35853751 hlen = bnx2x_set_pbd_csum_e2(bp, skb,
35863752 &pbd_e2_parsing_data,
35873753 xmit_type);
3754+ }
35883755
3589− if (IS_MF_SI(bp) || IS_VF(bp)) {
3590− /* fill in the MAC addresses in the PBD - for local
3591− * switching
3592− */
3593− bnx2x_set_fw_mac_addr(&pbd_e2->src_mac_addr_hi,
3594− &pbd_e2->src_mac_addr_mid,
3595− &pbd_e2->src_mac_addr_lo,
3756+ /* Add the macs to the parsing BD this is a vf */
3757+ if (IS_VF(bp)) {
3758+ /* override GRE parameters in BD */
3759+ bnx2x_set_fw_mac_addr(&pbd_e2->data.mac_addr.src_hi,
3760+ &pbd_e2->data.mac_addr.src_mid,
3761+ &pbd_e2->data.mac_addr.src_lo,
35963762 eth->h_source);
3597− bnx2x_set_fw_mac_addr(&pbd_e2->dst_mac_addr_hi,
3598− &pbd_e2->dst_mac_addr_mid,
3599− &pbd_e2->dst_mac_addr_lo,
3763+
3764+ bnx2x_set_fw_mac_addr(&pbd_e2->data.mac_addr.dst_hi,
3765+ &pbd_e2->data.mac_addr.dst_mid,
3766+ &pbd_e2->data.mac_addr.dst_lo,
36003767 eth->h_dest);
36013768 }
36023769
@@ -3618,14 +3785,13 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 15 unmodified lines
36183785 /* Setup the data pointer of the first BD of the packet */
36193786 tx_start_bd->addr_hi = cpu_to_le32(U64_HI(mapping));
36203787 tx_start_bd->addr_lo = cpu_to_le32(U64_LO(mapping));
3621− nbd = 2; /* start_bd + pbd + frags (updated when pages are mapped) */
36223788 tx_start_bd->nbytes = cpu_to_le16(skb_headlen(skb));
36233789 pkt_size = tx_start_bd->nbytes;
36243790
36253791 DP(NETIF_MSG_TX_QUEUED,
3626− "first bd @%p addr (%x:%x) nbd %d nbytes %d flags %x vlan %x\n",
3792+ "first bd @%p addr (%x:%x) nbytes %d flags %x vlan %x\n",
36273793 tx_start_bd, tx_start_bd->addr_hi, tx_start_bd->addr_lo,
3628− le16_to_cpu(tx_start_bd->nbd), le16_to_cpu(tx_start_bd->nbytes),
3794+ le16_to_cpu(tx_start_bd->nbytes),
36293795 tx_start_bd->bd_flags.as_bitfield,
36303796 le16_to_cpu(tx_start_bd->vlan_or_ethertype));
36313797
@@ -3638,10 +3804,12 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 6 unmodified lines
36383804
36393805 tx_start_bd->bd_flags.as_bitfield |= ETH_TX_BD_FLAGS_SW_LSO;
36403806
3641− if (unlikely(skb_headlen(skb) > hlen))
3807+ if (unlikely(skb_headlen(skb) > hlen)) {
3808+ nbd++;
36423809 bd_prod = bnx2x_tx_split(bp, txdata, tx_buf,
36433810 &tx_start_bd, hlen,
3644− bd_prod, ++nbd);
3811+ bd_prod);
3812+ }
36453813 if (!CHIP_IS_E1x(bp))
36463814 bnx2x_set_pbd_gso_e2(skb, &pbd_e2_parsing_data,
36473815 xmit_type);
@@ -3731,9 +3899,13 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) · 83 unmodified lines
37313899 if (pbd_e2)
37323900 DP(NETIF_MSG_TX_QUEUED,
37333901 "PBD (E2) @%p dst %x %x %x src %x %x %x parsing_data %x\n",
3734− pbd_e2, pbd_e2->dst_mac_addr_hi, pbd_e2->dst_mac_addr_mid,
3735− pbd_e2->dst_mac_addr_lo, pbd_e2->src_mac_addr_hi,
3736− pbd_e2->src_mac_addr_mid, pbd_e2->src_mac_addr_lo,
3902+ pbd_e2,
3903+ pbd_e2->data.mac_addr.dst_hi,
3904+ pbd_e2->data.mac_addr.dst_mid,
3905+ pbd_e2->data.mac_addr.dst_lo,
3906+ pbd_e2->data.mac_addr.src_hi,
3907+ pbd_e2->data.mac_addr.src_mid,
3908+ pbd_e2->data.mac_addr.src_lo,
37373909 pbd_e2->parsing_data);
37383910 DP(NETIF_MSG_TX_QUEUED, "doorbell: nbd %d bd %u\n", nbd, bd_prod);
37393911
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h+35−12
@@ -50,13 +50,13 @@ extern int int_mode; · 49 unmodified lines
5050 } \
5151 } while (0)
5252
53−#define BNX2X_PCI_ALLOC(x, y, size) \
54− do { \
55− x = dma_alloc_coherent(&bp->pdev->dev, size, y, GFP_KERNEL); \
56− if (x == NULL) \
57− goto alloc_mem_err; \
58− memset((void *)x, 0, size); \
59− } while (0)
53+#define BNX2X_PCI_ALLOC(x, y, size) \
54+do { \
55+ x = dma_alloc_coherent(&bp->pdev->dev, size, y, \
56+ GFP_KERNEL | __GFP_ZERO); \
57+ if (x == NULL) \
58+ goto alloc_mem_err; \
59+} while (0)
6060
6161 #define BNX2X_ALLOC(x, size) \
6262 do { \
@@ -295,16 +295,29 @@ void bnx2x_int_disable_sync(struct bnx2x *bp, int disable_hw); · 232 unmodified lines
295295 void bnx2x_nic_init_cnic(struct bnx2x *bp);
296296
297297 /**
298− * bnx2x_nic_init - init driver internals.
298+ * bnx2x_preirq_nic_init - init driver internals.
299299 *
300300 * @bp: driver handle
301301 *
302302 * Initializes:
303− * - rings
303+ * - fastpath object
304+ * - fastpath rings
305+ * etc.
306+ */
307+void bnx2x_pre_irq_nic_init(struct bnx2x *bp);
308+
309+/**
310+ * bnx2x_postirq_nic_init - init driver internals.
311+ *
312+ * @bp: driver handle
313+ * @load_code: COMMON, PORT or FUNCTION
314+ *
315+ * Initializes:
304316 * - status blocks
317+ * - slowpath rings
305318 * - etc.
306319 */
307−void bnx2x_nic_init(struct bnx2x *bp, u32 load_code);
320+void bnx2x_post_irq_nic_init(struct bnx2x *bp, u32 load_code);
308321 /**
309322 * bnx2x_alloc_mem_cnic - allocate driver's memory for cnic.
310323 *
@@ -496,7 +509,10 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev); · 185 unmodified lines
496509 /* setup_tc callback */
497510 int bnx2x_setup_tc(struct net_device *dev, u8 num_tc);
498511
512+int bnx2x_get_vf_config(struct net_device *dev, int vf,
513+ struct ifla_vf_info *ivi);
499514 int bnx2x_set_vf_mac(struct net_device *dev, int queue, u8 *mac);
515+int bnx2x_set_vf_vlan(struct net_device *netdev, int vf, u16 vlan, u8 qos);
500516
501517 /* select_queue callback */
502518 u16 bnx2x_select_queue(struct net_device *dev, struct sk_buff *skb);
@@ -834,7 +850,7 @@ static inline void bnx2x_add_all_napi_cnic(struct bnx2x *bp) · 331 unmodified lines
834850 /* Add NAPI objects */
835851 for_each_rx_queue_cnic(bp, i)
836852 netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi),
837− bnx2x_poll, BNX2X_NAPI_WEIGHT);
853+ bnx2x_poll, NAPI_POLL_WEIGHT);
838854 }
839855
840856 static inline void bnx2x_add_all_napi(struct bnx2x *bp)
@@ -844,7 +860,7 @@ static inline void bnx2x_add_all_napi(struct bnx2x *bp) · 3 unmodified lines
844860 /* Add NAPI objects */
845861 for_each_eth_queue(bp, i)
846862 netif_napi_add(bp->dev, &bnx2x_fp(bp, i, napi),
847− bnx2x_poll, BNX2X_NAPI_WEIGHT);
863+ bnx2x_poll, NAPI_POLL_WEIGHT);
848864 }
849865
850866 static inline void bnx2x_del_all_napi_cnic(struct bnx2x *bp)
@@ -970,6 +986,9 @@ static inline int bnx2x_func_start(struct bnx2x *bp) · 119 unmodified lines
970986 else /* CHIP_IS_E1X */
971987 start_params->network_cos_mode = FW_WRR;
972988
989+ start_params->gre_tunnel_mode = IPGRE_TUNNEL;
990+ start_params->gre_tunnel_rss = GRE_INNER_HEADERS_RSS;
991+
973992 return bnx2x_func_state_change(bp, &func_params);
974993 }
975994
@@ -1396,4 +1415,8 @@ static inline bool bnx2x_is_valid_ether_addr(struct bnx2x *bp, u8 *addr) · 420 unmodified lines
13961415 *
13971416 */
13981417 void bnx2x_fill_fw_str(struct bnx2x *bp, char *buf, size_t buf_len);
1418+
1419+int bnx2x_drain_tx_queues(struct bnx2x *bp);
1420+void bnx2x_squeeze_objects(struct bnx2x *bp);
1421+
13991422 #endif /* BNX2X_CMN_H */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c+316−61
@@ -1364,11 +1364,27 @@ static int bnx2x_nvram_read(struct bnx2x *bp, u32 offset, u8 *ret_buf, · 1363 unmodified lines
13641364 return rc;
13651365 }
13661366
1367+static int bnx2x_nvram_read32(struct bnx2x *bp, u32 offset, u32 *buf,
1368+ int buf_size)
1369+{
1370+ int rc;
1371+
1372+ rc = bnx2x_nvram_read(bp, offset, (u8 *)buf, buf_size);
1373+
1374+ if (!rc) {
1375+ __be32 *be = (__be32 *)buf;
1376+
1377+ while ((buf_size -= 4) >= 0)
1378+ *buf++ = be32_to_cpu(*be++);
1379+ }
1380+
1381+ return rc;
1382+}
1383+
13671384 static int bnx2x_get_eeprom(struct net_device *dev,
13681385 struct ethtool_eeprom *eeprom, u8 *eebuf)
13691386 {
13701387 struct bnx2x *bp = netdev_priv(dev);
1371− int rc;
13721388
13731389 if (!netif_running(dev)) {
13741390 DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
@@ -1383,9 +1399,7 @@ static int bnx2x_get_eeprom(struct net_device *dev, · 8 unmodified lines
13831399
13841400 /* parameters already validated in ethtool_get_eeprom */
13851401
1386− rc = bnx2x_nvram_read(bp, eeprom->offset, eebuf, eeprom->len);
1387−
1388− return rc;
1402+ return bnx2x_nvram_read(bp, eeprom->offset, eebuf, eeprom->len);
13891403 }
13901404
13911405 static int bnx2x_get_module_eeprom(struct net_device *dev,
@@ -1393,10 +1407,9 @@ static int bnx2x_get_module_eeprom(struct net_device *dev, · 1 unmodified line
13931407 u8 *data)
13941408 {
13951409 struct bnx2x *bp = netdev_priv(dev);
1396− int rc = 0, phy_idx;
1410+ int rc = -EINVAL, phy_idx;
13971411 u8 *user_data = data;
1398− int remaining_len = ee->len, xfer_size;
1399− unsigned int page_off = ee->offset;
1412+ unsigned int start_addr = ee->offset, xfer_size = 0;
14001413
14011414 if (!netif_running(dev)) {
14021415 DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
@@ -1405,21 +1418,52 @@ static int bnx2x_get_module_eeprom(struct net_device *dev, · 2 unmodified lines
14051418 }
14061419
14071420 phy_idx = bnx2x_get_cur_phy_idx(bp);
1408− bnx2x_acquire_phy_lock(bp);
1409− while (!rc && remaining_len > 0) {
1410− xfer_size = (remaining_len > SFP_EEPROM_PAGE_SIZE) ?
1411− SFP_EEPROM_PAGE_SIZE : remaining_len;
1421+
1422+ /* Read A0 section */
1423+ if (start_addr < ETH_MODULE_SFF_8079_LEN) {
1424+ /* Limit transfer size to the A0 section boundary */
1425+ if (start_addr + ee->len > ETH_MODULE_SFF_8079_LEN)
1426+ xfer_size = ETH_MODULE_SFF_8079_LEN - start_addr;
1427+ else
1428+ xfer_size = ee->len;
1429+ bnx2x_acquire_phy_lock(bp);
14121430 rc = bnx2x_read_sfp_module_eeprom(&bp->link_params.phy[phy_idx],
14131431 &bp->link_params,
1414− page_off,
1432+ I2C_DEV_ADDR_A0,
1433+ start_addr,
14151434 xfer_size,
14161435 user_data);
1417− remaining_len -= xfer_size;
1436+ bnx2x_release_phy_lock(bp);
1437+ if (rc) {
1438+ DP(BNX2X_MSG_ETHTOOL, "Failed reading A0 section\n");
1439+
1440+ return -EINVAL;
1441+ }
14181442 user_data += xfer_size;
1419− page_off += xfer_size;
1443+ start_addr += xfer_size;
14201444 }
14211445
1422− bnx2x_release_phy_lock(bp);
1446+ /* Read A2 section */
1447+ if ((start_addr >= ETH_MODULE_SFF_8079_LEN) &&
1448+ (start_addr < ETH_MODULE_SFF_8472_LEN)) {
1449+ xfer_size = ee->len - xfer_size;
1450+ /* Limit transfer size to the A2 section boundary */
1451+ if (start_addr + xfer_size > ETH_MODULE_SFF_8472_LEN)
1452+ xfer_size = ETH_MODULE_SFF_8472_LEN - start_addr;
1453+ start_addr -= ETH_MODULE_SFF_8079_LEN;
1454+ bnx2x_acquire_phy_lock(bp);
1455+ rc = bnx2x_read_sfp_module_eeprom(&bp->link_params.phy[phy_idx],
1456+ &bp->link_params,
1457+ I2C_DEV_ADDR_A2,
1458+ start_addr,
1459+ xfer_size,
1460+ user_data);
1461+ bnx2x_release_phy_lock(bp);
1462+ if (rc) {
1463+ DP(BNX2X_MSG_ETHTOOL, "Failed reading A2 section\n");
1464+ return -EINVAL;
1465+ }
1466+ }
14231467 return rc;
14241468 }
14251469
@@ -1427,24 +1471,50 @@ static int bnx2x_get_module_info(struct net_device *dev, · 1 unmodified line
14271471 struct ethtool_modinfo *modinfo)
14281472 {
14291473 struct bnx2x *bp = netdev_priv(dev);
1430− int phy_idx;
1474+ int phy_idx, rc;
1475+ u8 sff8472_comp, diag_type;
1476+
14311477 if (!netif_running(dev)) {
1432− DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
1478+ DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
14331479 "cannot access eeprom when the interface is down\n");
14341480 return -EAGAIN;
14351481 }
1436−
14371482 phy_idx = bnx2x_get_cur_phy_idx(bp);
1438− switch (bp->link_params.phy[phy_idx].media_type) {
1439− case ETH_PHY_SFPP_10G_FIBER:
1440− case ETH_PHY_SFP_1G_FIBER:
1441− case ETH_PHY_DA_TWINAX:
1483+ bnx2x_acquire_phy_lock(bp);
1484+ rc = bnx2x_read_sfp_module_eeprom(&bp->link_params.phy[phy_idx],
1485+ &bp->link_params,
1486+ I2C_DEV_ADDR_A0,
1487+ SFP_EEPROM_SFF_8472_COMP_ADDR,
1488+ SFP_EEPROM_SFF_8472_COMP_SIZE,
1489+ &sff8472_comp);
1490+ bnx2x_release_phy_lock(bp);
1491+ if (rc) {
1492+ DP(BNX2X_MSG_ETHTOOL, "Failed reading SFF-8472 comp field\n");
1493+ return -EINVAL;
1494+ }
1495+
1496+ bnx2x_acquire_phy_lock(bp);
1497+ rc = bnx2x_read_sfp_module_eeprom(&bp->link_params.phy[phy_idx],
1498+ &bp->link_params,
1499+ I2C_DEV_ADDR_A0,
1500+ SFP_EEPROM_DIAG_TYPE_ADDR,
1501+ SFP_EEPROM_DIAG_TYPE_SIZE,
1502+ &diag_type);
1503+ bnx2x_release_phy_lock(bp);
1504+ if (rc) {
1505+ DP(BNX2X_MSG_ETHTOOL, "Failed reading Diag Type field\n");
1506+ return -EINVAL;
1507+ }
1508+
1509+ if (!sff8472_comp ||
1510+ (diag_type & SFP_EEPROM_DIAG_ADDR_CHANGE_REQ)) {
14421511 modinfo->type = ETH_MODULE_SFF_8079;
14431512 modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN;
1444− return 0;
1445− default:
1446− return -EOPNOTSUPP;
1513+ } else {
1514+ modinfo->type = ETH_MODULE_SFF_8472;
1515+ modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN;
14471516 }
1517+ return 0;
14481518 }
14491519
14501520 static int bnx2x_nvram_write_dword(struct bnx2x *bp, u32 offset, u32 val,
@@ -1496,9 +1566,8 @@ static int bnx2x_nvram_write1(struct bnx2x *bp, u32 offset, u8 *data_buf, · 45 unmodified lines
14961566 int buf_size)
14971567 {
14981568 int rc;
1499− u32 cmd_flags;
1500− u32 align_offset;
1501− __be32 val;
1569+ u32 cmd_flags, align_offset, val;
1570+ __be32 val_be;
15021571
15031572 if (offset + buf_size > bp->common.flash_size) {
15041573 DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
@@ -1517,16 +1586,16 @@ static int bnx2x_nvram_write1(struct bnx2x *bp, u32 offset, u8 *data_buf, · 12 unmodified lines
15171586
15181587 cmd_flags = (MCPR_NVM_COMMAND_FIRST | MCPR_NVM_COMMAND_LAST);
15191588 align_offset = (offset & ~0x03);
1520− rc = bnx2x_nvram_read_dword(bp, align_offset, &val, cmd_flags);
1589+ rc = bnx2x_nvram_read_dword(bp, align_offset, &val_be, cmd_flags);
15211590
15221591 if (rc == 0) {
1523− val &= ~(0xff << BYTE_OFFSET(offset));
1524− val |= (*data_buf << BYTE_OFFSET(offset));
1525−
15261592 /* nvram data is returned as an array of bytes
15271593 * convert it back to cpu order
15281594 */
1529− val = be32_to_cpu(val);
1595+ val = be32_to_cpu(val_be);
1596+
1597+ val &= ~le32_to_cpu(0xff << BYTE_OFFSET(offset));
1598+ val |= le32_to_cpu(*data_buf << BYTE_OFFSET(offset));
15301599
15311600 rc = bnx2x_nvram_write_dword(bp, align_offset, val,
15321601 cmd_flags);
@@ -1820,12 +1889,15 @@ static int bnx2x_set_pauseparam(struct net_device *dev, · 287 unmodified lines
18201889 bp->link_params.req_flow_ctrl[cfg_idx] =
18211890 BNX2X_FLOW_CTRL_AUTO;
18221891 }
1823− bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_NONE;
1892+ bp->link_params.req_fc_auto_adv = 0;
18241893 if (epause->rx_pause)
18251894 bp->link_params.req_fc_auto_adv |= BNX2X_FLOW_CTRL_RX;
18261895
18271896 if (epause->tx_pause)
18281897 bp->link_params.req_fc_auto_adv |= BNX2X_FLOW_CTRL_TX;
1898+
1899+ if (!bp->link_params.req_fc_auto_adv)
1900+ bp->link_params.req_fc_auto_adv |= BNX2X_FLOW_CTRL_NONE;
18291901 }
18301902
18311903 DP(BNX2X_MSG_ETHTOOL,
@@ -2526,14 +2598,168 @@ static int bnx2x_test_ext_loopback(struct bnx2x *bp) · 694 unmodified lines
25262598 return rc;
25272599 }
25282600
2601+struct code_entry {
2602+ u32 sram_start_addr;
2603+ u32 code_attribute;
2604+#define CODE_IMAGE_TYPE_MASK 0xf0800003
2605+#define CODE_IMAGE_VNTAG_PROFILES_DATA 0xd0000003
2606+#define CODE_IMAGE_LENGTH_MASK 0x007ffffc
2607+#define CODE_IMAGE_TYPE_EXTENDED_DIR 0xe0000000
2608+ u32 nvm_start_addr;
2609+};
2610+
2611+#define CODE_ENTRY_MAX 16
2612+#define CODE_ENTRY_EXTENDED_DIR_IDX 15
2613+#define MAX_IMAGES_IN_EXTENDED_DIR 64
2614+#define NVRAM_DIR_OFFSET 0x14
2615+
2616+#define EXTENDED_DIR_EXISTS(code) \
2617+ ((code & CODE_IMAGE_TYPE_MASK) == CODE_IMAGE_TYPE_EXTENDED_DIR && \
2618+ (code & CODE_IMAGE_LENGTH_MASK) != 0)
2619+
25292620 #define CRC32_RESIDUAL 0xdebb20e3
2621+#define CRC_BUFF_SIZE 256
2622+
2623+static int bnx2x_nvram_crc(struct bnx2x *bp,
2624+ int offset,
2625+ int size,
2626+ u8 *buff)
2627+{
2628+ u32 crc = ~0;
2629+ int rc = 0, done = 0;
2630+
2631+ DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
2632+ "NVRAM CRC from 0x%08x to 0x%08x\n", offset, offset + size);
2633+
2634+ while (done < size) {
2635+ int count = min_t(int, size - done, CRC_BUFF_SIZE);
2636+
2637+ rc = bnx2x_nvram_read(bp, offset + done, buff, count);
2638+
2639+ if (rc)
2640+ return rc;
2641+
2642+ crc = crc32_le(crc, buff, count);
2643+ done += count;
2644+ }
2645+
2646+ if (crc != CRC32_RESIDUAL)
2647+ rc = -EINVAL;
2648+
2649+ return rc;
2650+}
2651+
2652+static int bnx2x_test_nvram_dir(struct bnx2x *bp,
2653+ struct code_entry *entry,
2654+ u8 *buff)
2655+{
2656+ size_t size = entry->code_attribute & CODE_IMAGE_LENGTH_MASK;
2657+ u32 type = entry->code_attribute & CODE_IMAGE_TYPE_MASK;
2658+ int rc;
2659+
2660+ /* Zero-length images and AFEX profiles do not have CRC */
2661+ if (size == 0 || type == CODE_IMAGE_VNTAG_PROFILES_DATA)
2662+ return 0;
2663+
2664+ rc = bnx2x_nvram_crc(bp, entry->nvm_start_addr, size, buff);
2665+ if (rc)
2666+ DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
2667+ "image %x has failed crc test (rc %d)\n", type, rc);
2668+
2669+ return rc;
2670+}
2671+
2672+static int bnx2x_test_dir_entry(struct bnx2x *bp, u32 addr, u8 *buff)
2673+{
2674+ int rc;
2675+ struct code_entry entry;
2676+
2677+ rc = bnx2x_nvram_read32(bp, addr, (u32 *)&entry, sizeof(entry));
2678+ if (rc)
2679+ return rc;
2680+
2681+ return bnx2x_test_nvram_dir(bp, &entry, buff);
2682+}
2683+
2684+static int bnx2x_test_nvram_ext_dirs(struct bnx2x *bp, u8 *buff)
2685+{
2686+ u32 rc, cnt, dir_offset = NVRAM_DIR_OFFSET;
2687+ struct code_entry entry;
2688+ int i;
2689+
2690+ rc = bnx2x_nvram_read32(bp,
2691+ dir_offset +
2692+ sizeof(entry) * CODE_ENTRY_EXTENDED_DIR_IDX,
2693+ (u32 *)&entry, sizeof(entry));
2694+ if (rc)
2695+ return rc;
2696+
2697+ if (!EXTENDED_DIR_EXISTS(entry.code_attribute))
2698+ return 0;
2699+
2700+ rc = bnx2x_nvram_read32(bp, entry.nvm_start_addr,
2701+ &cnt, sizeof(u32));
2702+ if (rc)
2703+ return rc;
2704+
2705+ dir_offset = entry.nvm_start_addr + 8;
2706+
2707+ for (i = 0; i < cnt && i < MAX_IMAGES_IN_EXTENDED_DIR; i++) {
2708+ rc = bnx2x_test_dir_entry(bp, dir_offset +
2709+ sizeof(struct code_entry) * i,
2710+ buff);
2711+ if (rc)
2712+ return rc;
2713+ }
2714+
2715+ return 0;
2716+}
2717+
2718+static int bnx2x_test_nvram_dirs(struct bnx2x *bp, u8 *buff)
2719+{
2720+ u32 rc, dir_offset = NVRAM_DIR_OFFSET;
2721+ int i;
2722+
2723+ DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM, "NVRAM DIRS CRC test-set\n");
2724+
2725+ for (i = 0; i < CODE_ENTRY_EXTENDED_DIR_IDX; i++) {
2726+ rc = bnx2x_test_dir_entry(bp, dir_offset +
2727+ sizeof(struct code_entry) * i,
2728+ buff);
2729+ if (rc)
2730+ return rc;
2731+ }
2732+
2733+ return bnx2x_test_nvram_ext_dirs(bp, buff);
2734+}
2735+
2736+struct crc_pair {
2737+ int offset;
2738+ int size;
2739+};
2740+
2741+static int bnx2x_test_nvram_tbl(struct bnx2x *bp,
2742+ const struct crc_pair *nvram_tbl, u8 *buf)
2743+{
2744+ int i;
2745+
2746+ for (i = 0; nvram_tbl[i].size; i++) {
2747+ int rc = bnx2x_nvram_crc(bp, nvram_tbl[i].offset,
2748+ nvram_tbl[i].size, buf);
2749+ if (rc) {
2750+ DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
2751+ "nvram_tbl[%d] has failed crc test (rc %d)\n",
2752+ i, rc);
2753+ return rc;
2754+ }
2755+ }
2756+
2757+ return 0;
2758+}
25302759
25312760 static int bnx2x_test_nvram(struct bnx2x *bp)
25322761 {
2533− static const struct {
2534− int offset;
2535− int size;
2536− } nvram_tbl[] = {
2762+ const struct crc_pair nvram_tbl[] = {
25372763 { 0, 0x14 }, /* bootstrap */
25382764 { 0x14, 0xec }, /* dir */
25392765 { 0x100, 0x350 }, /* manuf_info */
@@ -2542,30 +2768,33 @@ static int bnx2x_test_nvram(struct bnx2x *bp) · 2 unmodified lines
25422768 { 0x708, 0x70 }, /* manuf_key_info */
25432769 { 0, 0 }
25442770 };
2545− __be32 *buf;
2546− u8 *data;
2547− int i, rc;
2548− u32 magic, crc;
2771+ const struct crc_pair nvram_tbl2[] = {
2772+ { 0x7e8, 0x350 }, /* manuf_info2 */
2773+ { 0xb38, 0xf0 }, /* feature_info */
2774+ { 0, 0 }
2775+ };
2776+
2777+ u8 *buf;
2778+ int rc;
2779+ u32 magic;
25492780
25502781 if (BP_NOMCP(bp))
25512782 return 0;
25522783
2553− buf = kmalloc(0x350, GFP_KERNEL);
2784+ buf = kmalloc(CRC_BUFF_SIZE, GFP_KERNEL);
25542785 if (!buf) {
25552786 DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM, "kmalloc failed\n");
25562787 rc = -ENOMEM;
25572788 goto test_nvram_exit;
25582789 }
2559− data = (u8 *)buf;
25602790
2561− rc = bnx2x_nvram_read(bp, 0, data, 4);
2791+ rc = bnx2x_nvram_read32(bp, 0, &magic, sizeof(magic));
25622792 if (rc) {
25632793 DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
25642794 "magic value read (rc %d)\n", rc);
25652795 goto test_nvram_exit;
25662796 }
25672797
2568− magic = be32_to_cpu(buf[0]);
25692798 if (magic != 0x669955aa) {
25702799 DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
25712800 "wrong magic value (0x%08x)\n", magic);
@@ -2573,25 +2802,26 @@ static int bnx2x_test_nvram(struct bnx2x *bp) · 1 unmodified line
25732802 goto test_nvram_exit;
25742803 }
25752804
2576− for (i = 0; nvram_tbl[i].size; i++) {
2805+ DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM, "Port 0 CRC test-set\n");
2806+ rc = bnx2x_test_nvram_tbl(bp, nvram_tbl, buf);
2807+ if (rc)
2808+ goto test_nvram_exit;
25772809
2578− rc = bnx2x_nvram_read(bp, nvram_tbl[i].offset, data,
2579− nvram_tbl[i].size);
2580− if (rc) {
2581− DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
2582− "nvram_tbl[%d] read data (rc %d)\n", i, rc);
2583− goto test_nvram_exit;
2584− }
2810+ if (!CHIP_IS_E1x(bp) && !CHIP_IS_57811xx(bp)) {
2811+ u32 hide = SHMEM_RD(bp, dev_info.shared_hw_config.config2) &
2812+ SHARED_HW_CFG_HIDE_PORT1;
25852813
2586− crc = ether_crc_le(nvram_tbl[i].size, data);
2587− if (crc != CRC32_RESIDUAL) {
2814+ if (!hide) {
25882815 DP(BNX2X_MSG_ETHTOOL | BNX2X_MSG_NVM,
2589− "nvram_tbl[%d] wrong crc value (0x%08x)\n", i, crc);
2590− rc = -ENODEV;
2591− goto test_nvram_exit;
2816+ "Port 1 CRC test-set\n");
2817+ rc = bnx2x_test_nvram_tbl(bp, nvram_tbl2, buf);
2818+ if (rc)
2819+ goto test_nvram_exit;
25922820 }
25932821 }
25942822
2823+ rc = bnx2x_test_nvram_dirs(bp, buf);
2824+
25952825 test_nvram_exit:
25962826 kfree(buf);
25972827 return rc;
@@ -3232,7 +3462,32 @@ static const struct ethtool_ops bnx2x_ethtool_ops = { · 634 unmodified lines
32323462 .get_ts_info = ethtool_op_get_ts_info,
32333463 };
32343464
3235−void bnx2x_set_ethtool_ops(struct net_device *netdev)
3465+static const struct ethtool_ops bnx2x_vf_ethtool_ops = {
3466+ .get_settings = bnx2x_get_settings,
3467+ .set_settings = bnx2x_set_settings,
3468+ .get_drvinfo = bnx2x_get_drvinfo,
3469+ .get_msglevel = bnx2x_get_msglevel,
3470+ .set_msglevel = bnx2x_set_msglevel,
3471+ .get_link = bnx2x_get_link,
3472+ .get_coalesce = bnx2x_get_coalesce,
3473+ .get_ringparam = bnx2x_get_ringparam,
3474+ .set_ringparam = bnx2x_set_ringparam,
3475+ .get_sset_count = bnx2x_get_sset_count,
3476+ .get_strings = bnx2x_get_strings,
3477+ .get_ethtool_stats = bnx2x_get_ethtool_stats,
3478+ .get_rxnfc = bnx2x_get_rxnfc,
3479+ .set_rxnfc = bnx2x_set_rxnfc,
3480+ .get_rxfh_indir_size = bnx2x_get_rxfh_indir_size,
3481+ .get_rxfh_indir = bnx2x_get_rxfh_indir,
3482+ .set_rxfh_indir = bnx2x_set_rxfh_indir,
3483+ .get_channels = bnx2x_get_channels,
3484+ .set_channels = bnx2x_set_channels,
3485+};
3486+
3487+void bnx2x_set_ethtool_ops(struct bnx2x *bp, struct net_device *netdev)
32363488 {
3237− SET_ETHTOOL_OPS(netdev, &bnx2x_ethtool_ops);
3489+ if (IS_PF(bp))
3490+ SET_ETHTOOL_OPS(netdev, &bnx2x_ethtool_ops);
3491+ else /* vf */
3492+ SET_ETHTOOL_OPS(netdev, &bnx2x_vf_ethtool_ops);
32383493 }
drivers/net/ethernet/broadcom/bnx2x/bnx2x_fw_defs.h+46−45
@@ -30,31 +30,31 @@ · 29 unmodified lines
3030 * IRO[138].m2) + ((sbId) * IRO[138].m3))
3131 #define CSTORM_IGU_MODE_OFFSET (IRO[157].base)
3232 #define CSTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \
33− (IRO[316].base + ((pfId) * IRO[316].m1))
34−#define CSTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \
3533 (IRO[317].base + ((pfId) * IRO[317].m1))
34+#define CSTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \
35+ (IRO[318].base + ((pfId) * IRO[318].m1))
3636 #define CSTORM_ISCSI_EQ_CONS_OFFSET(pfId, iscsiEqId) \
37− (IRO[309].base + ((pfId) * IRO[309].m1) + ((iscsiEqId) * IRO[309].m2))
37+ (IRO[310].base + ((pfId) * IRO[310].m1) + ((iscsiEqId) * IRO[310].m2))
3838 #define CSTORM_ISCSI_EQ_NEXT_EQE_ADDR_OFFSET(pfId, iscsiEqId) \
39− (IRO[311].base + ((pfId) * IRO[311].m1) + ((iscsiEqId) * IRO[311].m2))
39+ (IRO[312].base + ((pfId) * IRO[312].m1) + ((iscsiEqId) * IRO[312].m2))
4040 #define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_OFFSET(pfId, iscsiEqId) \
41− (IRO[310].base + ((pfId) * IRO[310].m1) + ((iscsiEqId) * IRO[310].m2))
41+ (IRO[311].base + ((pfId) * IRO[311].m1) + ((iscsiEqId) * IRO[311].m2))
4242 #define CSTORM_ISCSI_EQ_NEXT_PAGE_ADDR_VALID_OFFSET(pfId, iscsiEqId) \
43− (IRO[312].base + ((pfId) * IRO[312].m1) + ((iscsiEqId) * IRO[312].m2))
43+ (IRO[313].base + ((pfId) * IRO[313].m1) + ((iscsiEqId) * IRO[313].m2))
4444 #define CSTORM_ISCSI_EQ_PROD_OFFSET(pfId, iscsiEqId) \
45− (IRO[308].base + ((pfId) * IRO[308].m1) + ((iscsiEqId) * IRO[308].m2))
45+ (IRO[309].base + ((pfId) * IRO[309].m1) + ((iscsiEqId) * IRO[309].m2))
4646 #define CSTORM_ISCSI_EQ_SB_INDEX_OFFSET(pfId, iscsiEqId) \
47− (IRO[314].base + ((pfId) * IRO[314].m1) + ((iscsiEqId) * IRO[314].m2))
47+ (IRO[315].base + ((pfId) * IRO[315].m1) + ((iscsiEqId) * IRO[315].m2))
4848 #define CSTORM_ISCSI_EQ_SB_NUM_OFFSET(pfId, iscsiEqId) \
49− (IRO[313].base + ((pfId) * IRO[313].m1) + ((iscsiEqId) * IRO[313].m2))
49+ (IRO[314].base + ((pfId) * IRO[314].m1) + ((iscsiEqId) * IRO[314].m2))
5050 #define CSTORM_ISCSI_HQ_SIZE_OFFSET(pfId) \
51− (IRO[315].base + ((pfId) * IRO[315].m1))
51+ (IRO[316].base + ((pfId) * IRO[316].m1))
5252 #define CSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \
53− (IRO[307].base + ((pfId) * IRO[307].m1))
53+ (IRO[308].base + ((pfId) * IRO[308].m1))
5454 #define CSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \
55− (IRO[306].base + ((pfId) * IRO[306].m1))
55+ (IRO[307].base + ((pfId) * IRO[307].m1))
5656 #define CSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \
57− (IRO[305].base + ((pfId) * IRO[305].m1))
57+ (IRO[306].base + ((pfId) * IRO[306].m1))
5858 #define CSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \
5959 (IRO[151].base + ((funcId) * IRO[151].m1))
6060 #define CSTORM_SP_STATUS_BLOCK_DATA_OFFSET(pfId) \
@@ -114,7 +114,7 @@ · 53 unmodified lines
114114 #define TSTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \
115115 (IRO[268].base + ((pfId) * IRO[268].m1))
116116 #define TSTORM_ISCSI_TCP_LOCAL_ADV_WND_OFFSET(pfId) \
117− (IRO[277].base + ((pfId) * IRO[277].m1))
117+ (IRO[278].base + ((pfId) * IRO[278].m1))
118118 #define TSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(pfId) \
119119 (IRO[264].base + ((pfId) * IRO[264].m1))
120120 #define TSTORM_ISCSI_TCP_VARS_LSB_LOCAL_MAC_ADDR_OFFSET(pfId) \
@@ -136,35 +136,32 @@ · 15 unmodified lines
136136 #define USTORM_ASSERT_LIST_INDEX_OFFSET (IRO[177].base)
137137 #define USTORM_ASSERT_LIST_OFFSET(assertListEntry) \
138138 (IRO[176].base + ((assertListEntry) * IRO[176].m1))
139−#define USTORM_CQE_PAGE_NEXT_OFFSET(portId, clientId) \
140− (IRO[205].base + ((portId) * IRO[205].m1) + ((clientId) * \
141− IRO[205].m2))
142139 #define USTORM_ETH_PAUSE_ENABLED_OFFSET(portId) \
143140 (IRO[183].base + ((portId) * IRO[183].m1))
144141 #define USTORM_FCOE_EQ_PROD_OFFSET(pfId) \
145− (IRO[318].base + ((pfId) * IRO[318].m1))
142+ (IRO[319].base + ((pfId) * IRO[319].m1))
146143 #define USTORM_FUNC_EN_OFFSET(funcId) \
147144 (IRO[178].base + ((funcId) * IRO[178].m1))
148145 #define USTORM_ISCSI_CQ_SIZE_OFFSET(pfId) \
149− (IRO[282].base + ((pfId) * IRO[282].m1))
150−#define USTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \
151146 (IRO[283].base + ((pfId) * IRO[283].m1))
147+#define USTORM_ISCSI_CQ_SQN_SIZE_OFFSET(pfId) \
148+ (IRO[284].base + ((pfId) * IRO[284].m1))
152149 #define USTORM_ISCSI_ERROR_BITMAP_OFFSET(pfId) \
153− (IRO[287].base + ((pfId) * IRO[287].m1))
150+ (IRO[288].base + ((pfId) * IRO[288].m1))
154151 #define USTORM_ISCSI_GLOBAL_BUF_PHYS_ADDR_OFFSET(pfId) \
155− (IRO[284].base + ((pfId) * IRO[284].m1))
152+ (IRO[285].base + ((pfId) * IRO[285].m1))
156153 #define USTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \
157− (IRO[280].base + ((pfId) * IRO[280].m1))
154+ (IRO[281].base + ((pfId) * IRO[281].m1))
158155 #define USTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \
159− (IRO[279].base + ((pfId) * IRO[279].m1))
156+ (IRO[280].base + ((pfId) * IRO[280].m1))
160157 #define USTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \
161− (IRO[278].base + ((pfId) * IRO[278].m1))
158+ (IRO[279].base + ((pfId) * IRO[279].m1))
162159 #define USTORM_ISCSI_R2TQ_SIZE_OFFSET(pfId) \
163− (IRO[281].base + ((pfId) * IRO[281].m1))
160+ (IRO[282].base + ((pfId) * IRO[282].m1))
164161 #define USTORM_ISCSI_RQ_BUFFER_SIZE_OFFSET(pfId) \
165− (IRO[285].base + ((pfId) * IRO[285].m1))
166−#define USTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \
167162 (IRO[286].base + ((pfId) * IRO[286].m1))
163+#define USTORM_ISCSI_RQ_SIZE_OFFSET(pfId) \
164+ (IRO[287].base + ((pfId) * IRO[287].m1))
168165 #define USTORM_MEM_WORKAROUND_ADDRESS_OFFSET(pfId) \
169166 (IRO[182].base + ((pfId) * IRO[182].m1))
170167 #define USTORM_RECORD_SLOW_PATH_OFFSET(funcId) \
@@ -190,39 +187,39 @@ · 19 unmodified lines
190187 #define XSTORM_FUNC_EN_OFFSET(funcId) \
191188 (IRO[47].base + ((funcId) * IRO[47].m1))
192189 #define XSTORM_ISCSI_HQ_SIZE_OFFSET(pfId) \
193− (IRO[295].base + ((pfId) * IRO[295].m1))
190+ (IRO[296].base + ((pfId) * IRO[296].m1))
194191 #define XSTORM_ISCSI_LOCAL_MAC_ADDR0_OFFSET(pfId) \
195− (IRO[298].base + ((pfId) * IRO[298].m1))
196−#define XSTORM_ISCSI_LOCAL_MAC_ADDR1_OFFSET(pfId) \
197192 (IRO[299].base + ((pfId) * IRO[299].m1))
198−#define XSTORM_ISCSI_LOCAL_MAC_ADDR2_OFFSET(pfId) \
193+#define XSTORM_ISCSI_LOCAL_MAC_ADDR1_OFFSET(pfId) \
199194 (IRO[300].base + ((pfId) * IRO[300].m1))
200−#define XSTORM_ISCSI_LOCAL_MAC_ADDR3_OFFSET(pfId) \
195+#define XSTORM_ISCSI_LOCAL_MAC_ADDR2_OFFSET(pfId) \
201196 (IRO[301].base + ((pfId) * IRO[301].m1))
202−#define XSTORM_ISCSI_LOCAL_MAC_ADDR4_OFFSET(pfId) \
197+#define XSTORM_ISCSI_LOCAL_MAC_ADDR3_OFFSET(pfId) \
203198 (IRO[302].base + ((pfId) * IRO[302].m1))
204−#define XSTORM_ISCSI_LOCAL_MAC_ADDR5_OFFSET(pfId) \
199+#define XSTORM_ISCSI_LOCAL_MAC_ADDR4_OFFSET(pfId) \
205200 (IRO[303].base + ((pfId) * IRO[303].m1))
206−#define XSTORM_ISCSI_LOCAL_VLAN_OFFSET(pfId) \
201+#define XSTORM_ISCSI_LOCAL_MAC_ADDR5_OFFSET(pfId) \
207202 (IRO[304].base + ((pfId) * IRO[304].m1))
203+#define XSTORM_ISCSI_LOCAL_VLAN_OFFSET(pfId) \
204+ (IRO[305].base + ((pfId) * IRO[305].m1))
208205 #define XSTORM_ISCSI_NUM_OF_TASKS_OFFSET(pfId) \
209− (IRO[294].base + ((pfId) * IRO[294].m1))
206+ (IRO[295].base + ((pfId) * IRO[295].m1))
210207 #define XSTORM_ISCSI_PAGE_SIZE_LOG_OFFSET(pfId) \
211− (IRO[293].base + ((pfId) * IRO[293].m1))
208+ (IRO[294].base + ((pfId) * IRO[294].m1))
212209 #define XSTORM_ISCSI_PAGE_SIZE_OFFSET(pfId) \
213− (IRO[292].base + ((pfId) * IRO[292].m1))
210+ (IRO[293].base + ((pfId) * IRO[293].m1))
214211 #define XSTORM_ISCSI_R2TQ_SIZE_OFFSET(pfId) \
215− (IRO[297].base + ((pfId) * IRO[297].m1))
212+ (IRO[298].base + ((pfId) * IRO[298].m1))
216213 #define XSTORM_ISCSI_SQ_SIZE_OFFSET(pfId) \
217− (IRO[296].base + ((pfId) * IRO[296].m1))
214+ (IRO[297].base + ((pfId) * IRO[297].m1))
218215 #define XSTORM_ISCSI_TCP_VARS_ADV_WND_SCL_OFFSET(pfId) \
219− (IRO[291].base + ((pfId) * IRO[291].m1))
216+ (IRO[292].base + ((pfId) * IRO[292].m1))
220217 #define XSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(pfId) \
221− (IRO[290].base + ((pfId) * IRO[290].m1))
218+ (IRO[291].base + ((pfId) * IRO[291].m1))
222219 #define XSTORM_ISCSI_TCP_VARS_TOS_OFFSET(pfId) \
223− (IRO[289].base + ((pfId) * IRO[289].m1))
220+ (IRO[290].base + ((pfId) * IRO[290].m1))
224221 #define XSTORM_ISCSI_TCP_VARS_TTL_OFFSET(pfId) \
225− (IRO[288].base + ((pfId) * IRO[288].m1))
222+ (IRO[289].base + ((pfId) * IRO[289].m1))
226223 #define XSTORM_RATE_SHAPING_PER_VN_VARS_OFFSET(pfId) \
227224 (IRO[44].base + ((pfId) * IRO[44].m1))
228225 #define XSTORM_RECORD_SLOW_PATH_OFFSET(funcId) \
@@ -389,4 +386,8 @@ · 160 unmodified lines
389386
390387 #define UNDEF_IRO 0x80000000
391388
389+/* used for defining the amount of FCoE tasks supported for PF */
390+#define MAX_FCOE_FUNCS_PER_ENGINE 2
391+#define MAX_NUM_FCOE_TASKS_PER_ENGINE 4096
392+
392393 #endif /* BNX2X_FW_DEFS_H */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_hsi.h+221−31
@@ -114,6 +114,10 @@ struct license_key { · 113 unmodified lines
114114 #define EPIO_CFG_EPIO30 0x0000001f
115115 #define EPIO_CFG_EPIO31 0x00000020
116116
117+struct mac_addr {
118+ u32 upper;
119+ u32 lower;
120+};
117121
118122 struct shared_hw_cfg { /* NVRAM Offset */
119123 /* Up to 16 bytes of NULL-terminated string */
@@ -508,7 +512,22 @@ struct port_hw_cfg { /* port 0: 0x12c port 1: 0x2bc */ · 388 unmodified lines
508512 #define PORT_HW_CFG_PAUSE_ON_HOST_RING_DISABLED 0x00000000
509513 #define PORT_HW_CFG_PAUSE_ON_HOST_RING_ENABLED 0x00000001
510514
511− u32 reserved0[6]; /* 0x178 */
515+ /* SFP+ Tx Equalization: NIC recommended and tested value is 0xBEB2
516+ * LOM recommended and tested value is 0xBEB2. Using a different
517+ * value means using a value not tested by BRCM
518+ */
519+ u32 sfi_tap_values; /* 0x178 */
520+ #define PORT_HW_CFG_TX_EQUALIZATION_MASK 0x0000FFFF
521+ #define PORT_HW_CFG_TX_EQUALIZATION_SHIFT 0
522+
523+ /* SFP+ Tx driver broadcast IDRIVER: NIC recommended and tested
524+ * value is 0x2. LOM recommended and tested value is 0x2. Using a
525+ * different value means using a value not tested by BRCM
526+ */
527+ #define PORT_HW_CFG_TX_DRV_BROADCAST_MASK 0x000F0000
528+ #define PORT_HW_CFG_TX_DRV_BROADCAST_SHIFT 16
529+
530+ u32 reserved0[5]; /* 0x17c */
512531
513532 u32 aeu_int_mask; /* 0x190 */
514533
@@ -2821,8 +2840,8 @@ struct afex_stats { · 2306 unmodified lines
28212840
28222841 #define BCM_5710_FW_MAJOR_VERSION 7
28232842 #define BCM_5710_FW_MINOR_VERSION 8
2824−#define BCM_5710_FW_REVISION_VERSION 2
2825−#define BCM_5710_FW_ENGINEERING_VERSION 0
2843+#define BCM_5710_FW_REVISION_VERSION 17
2844+#define BCM_5710_FW_ENGINEERING_VERSION 0
28262845 #define BCM_5710_FW_COMPILE_FLAGS 1
28272846
28282847
@@ -3513,11 +3532,14 @@ struct client_init_tx_data { · 684 unmodified lines
35133532 #define CLIENT_INIT_TX_DATA_BCAST_ACCEPT_ALL_SHIFT 2
35143533 #define CLIENT_INIT_TX_DATA_ACCEPT_ANY_VLAN (0x1<<3)
35153534 #define CLIENT_INIT_TX_DATA_ACCEPT_ANY_VLAN_SHIFT 3
3516−#define CLIENT_INIT_TX_DATA_RESERVED1 (0xFFF<<4)
3517−#define CLIENT_INIT_TX_DATA_RESERVED1_SHIFT 4
3535+#define CLIENT_INIT_TX_DATA_RESERVED0 (0xFFF<<4)
3536+#define CLIENT_INIT_TX_DATA_RESERVED0_SHIFT 4
35183537 u8 default_vlan_flg;
35193538 u8 force_default_pri_flg;
3520− __le32 reserved3;
3539+ u8 tunnel_lso_inc_ip_id;
3540+ u8 refuse_outband_vlan_flg;
3541+ u8 tunnel_non_lso_pcsum_location;
3542+ u8 reserved1;
35213543 };
35223544
35233545 /*
@@ -3551,6 +3573,11 @@ struct client_update_ramrod_data { · 27 unmodified lines
35513573 __le16 silent_vlan_mask;
35523574 u8 silent_vlan_removal_flg;
35533575 u8 silent_vlan_change_flg;
3576+ u8 refuse_outband_vlan_flg;
3577+ u8 refuse_outband_vlan_change_flg;
3578+ u8 tx_switching_flg;
3579+ u8 tx_switching_change_flg;
3580+ __le32 reserved1;
35543581 __le32 echo;
35553582 };
35563583
@@ -3620,7 +3647,8 @@ struct eth_classify_header { · 63 unmodified lines
36203647 */
36213648 struct eth_classify_mac_cmd {
36223649 struct eth_classify_cmd_header header;
3623− __le32 reserved0;
3650+ __le16 reserved0;
3651+ __le16 inner_mac;
36243652 __le16 mac_lsb;
36253653 __le16 mac_mid;
36263654 __le16 mac_msb;
@@ -3633,7 +3661,8 @@ struct eth_classify_mac_cmd { · 6 unmodified lines
36333661 */
36343662 struct eth_classify_pair_cmd {
36353663 struct eth_classify_cmd_header header;
3636− __le32 reserved0;
3664+ __le16 reserved0;
3665+ __le16 inner_mac;
36373666 __le16 mac_lsb;
36383667 __le16 mac_mid;
36393668 __le16 mac_msb;
@@ -3855,8 +3884,68 @@ struct eth_halt_ramrod_data { · 215 unmodified lines
38553884
38563885
38573886 /*
3858− * Command for setting multicast classification for a client
3887+ * destination and source mac address.
3888+ */
3889+struct eth_mac_addresses {
3890+#if defined(__BIG_ENDIAN)
3891+ __le16 dst_mid;
3892+ __le16 dst_lo;
3893+#elif defined(__LITTLE_ENDIAN)
3894+ __le16 dst_lo;
3895+ __le16 dst_mid;
3896+#endif
3897+#if defined(__BIG_ENDIAN)
3898+ __le16 src_lo;
3899+ __le16 dst_hi;
3900+#elif defined(__LITTLE_ENDIAN)
3901+ __le16 dst_hi;
3902+ __le16 src_lo;
3903+#endif
3904+#if defined(__BIG_ENDIAN)
3905+ __le16 src_hi;
3906+ __le16 src_mid;
3907+#elif defined(__LITTLE_ENDIAN)
3908+ __le16 src_mid;
3909+ __le16 src_hi;
3910+#endif
3911+};
3912+
3913+/* tunneling related data */
3914+struct eth_tunnel_data {
3915+#if defined(__BIG_ENDIAN)
3916+ __le16 dst_mid;
3917+ __le16 dst_lo;
3918+#elif defined(__LITTLE_ENDIAN)
3919+ __le16 dst_lo;
3920+ __le16 dst_mid;
3921+#endif
3922+#if defined(__BIG_ENDIAN)
3923+ __le16 reserved0;
3924+ __le16 dst_hi;
3925+#elif defined(__LITTLE_ENDIAN)
3926+ __le16 dst_hi;
3927+ __le16 reserved0;
3928+#endif
3929+#if defined(__BIG_ENDIAN)
3930+ u8 reserved1;
3931+ u8 ip_hdr_start_inner_w;
3932+ __le16 pseudo_csum;
3933+#elif defined(__LITTLE_ENDIAN)
3934+ __le16 pseudo_csum;
3935+ u8 ip_hdr_start_inner_w;
3936+ u8 reserved1;
3937+#endif
3938+};
3939+
3940+/* union for mac addresses and for tunneling data.
3941+ * considered as tunneling data only if (tunnel_exist == 1).
38593942 */
3943+union eth_mac_addr_or_tunnel_data {
3944+ struct eth_mac_addresses mac_addr;
3945+ struct eth_tunnel_data tunnel_data;
3946+};
3947+
3948+/*Command for setting multicast classification for a client */
38603949 struct eth_multicast_rules_cmd {
38613950 u8 cmd_general_data;
38623951 #define ETH_MULTICAST_RULES_CMD_RX_CMD (0x1<<0)
@@ -3874,7 +3963,6 @@ struct eth_multicast_rules_cmd { · 11 unmodified lines
38743963 struct regpair reserved3;
38753964 };
38763965
3877−
38783966 /*
38793967 * parameters for multicast classification ramrod
38803968 */
@@ -3883,7 +3971,6 @@ struct eth_multicast_rules_ramrod_data { · 2 unmodified lines
38833971 struct eth_multicast_rules_cmd rules[MULTICAST_RULES_COUNT];
38843972 };
38853973
3886−
38873974 /*
38883975 * Place holder for ramrods protocol specific data
38893976 */
@@ -3947,11 +4034,14 @@ struct eth_rss_update_ramrod_data { · 57 unmodified lines
39474034 #define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_TCP_CAPABILITY_SHIFT 4
39484035 #define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_UDP_CAPABILITY (0x1<<5)
39494036 #define ETH_RSS_UPDATE_RAMROD_DATA_IPV6_UDP_CAPABILITY_SHIFT 5
4037+#define ETH_RSS_UPDATE_RAMROD_DATA_EN_5_TUPLE_CAPABILITY (0x1<<6)
4038+#define ETH_RSS_UPDATE_RAMROD_DATA_EN_5_TUPLE_CAPABILITY_SHIFT 6
39504039 #define ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY (0x1<<7)
39514040 #define ETH_RSS_UPDATE_RAMROD_DATA_UPDATE_RSS_KEY_SHIFT 7
39524041 u8 rss_result_mask;
39534042 u8 rss_mode;
3954− __le32 __reserved2;
4043+ __le16 udp_4tuple_dst_port_mask;
4044+ __le16 udp_4tuple_dst_port_value;
39554045 u8 indirection_table[T_ETH_INDIRECTION_TABLE_SIZE];
39564046 __le32 rss_key[T_ETH_RSS_KEY];
39574047 __le32 echo;
@@ -4115,6 +4205,23 @@ enum eth_tpa_update_command { · 157 unmodified lines
41154205 MAX_ETH_TPA_UPDATE_COMMAND
41164206 };
41174207
4208+/* In case of LSO over IPv4 tunnel, whether to increment
4209+ * IP ID on external IP header or internal IP header
4210+ */
4211+enum eth_tunnel_lso_inc_ip_id {
4212+ EXT_HEADER,
4213+ INT_HEADER,
4214+ MAX_ETH_TUNNEL_LSO_INC_IP_ID
4215+};
4216+
4217+/* In case tunnel exist and L4 checksum offload,
4218+ * the pseudo checksum location, on packet or on BD.
4219+ */
4220+enum eth_tunnel_non_lso_pcsum_location {
4221+ PCSUM_ON_PKT,
4222+ PCSUM_ON_BD,
4223+ MAX_ETH_TUNNEL_NON_LSO_PCSUM_LOCATION
4224+};
41184225
41194226 /*
41204227 * Tx regular BD structure
@@ -4166,8 +4273,8 @@ struct eth_tx_start_bd { · 45 unmodified lines
41664273 #define ETH_TX_START_BD_FORCE_VLAN_MODE_SHIFT 4
41674274 #define ETH_TX_START_BD_PARSE_NBDS (0x3<<5)
41684275 #define ETH_TX_START_BD_PARSE_NBDS_SHIFT 5
4169−#define ETH_TX_START_BD_RESREVED (0x1<<7)
4170−#define ETH_TX_START_BD_RESREVED_SHIFT 7
4276+#define ETH_TX_START_BD_TUNNEL_EXIST (0x1<<7)
4277+#define ETH_TX_START_BD_TUNNEL_EXIST_SHIFT 7
41714278 };
41724279
41734280 /*
@@ -4216,15 +4323,10 @@ struct eth_tx_parse_bd_e1x { · 42 unmodified lines
42164323 * Tx parsing BD structure for ETH E2
42174324 */
42184325 struct eth_tx_parse_bd_e2 {
4219− __le16 dst_mac_addr_lo;
4220− __le16 dst_mac_addr_mid;
4221− __le16 dst_mac_addr_hi;
4222− __le16 src_mac_addr_lo;
4223− __le16 src_mac_addr_mid;
4224− __le16 src_mac_addr_hi;
4326+ union eth_mac_addr_or_tunnel_data data;
42254327 __le32 parsing_data;
4226−#define ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W (0x7FF<<0)
4227−#define ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT 0
4328+#define ETH_TX_PARSE_BD_E2_L4_HDR_START_OFFSET_W (0x7FF<<0)
4329+#define ETH_TX_PARSE_BD_E2_L4_HDR_START_OFFSET_W_SHIFT 0
42284330 #define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW (0xF<<11)
42294331 #define ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT 11
42304332 #define ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR (0x1<<15)
@@ -4236,8 +4338,51 @@ struct eth_tx_parse_bd_e2 { · 5 unmodified lines
42364338 };
42374339
42384340 /*
4239− * The last BD in the BD memory will hold a pointer to the next BD memory
4341+ * Tx 2nd parsing BD structure for ETH packet
42404342 */
4343+struct eth_tx_parse_2nd_bd {
4344+ __le16 global_data;
4345+#define ETH_TX_PARSE_2ND_BD_IP_HDR_START_OUTER_W (0xF<<0)
4346+#define ETH_TX_PARSE_2ND_BD_IP_HDR_START_OUTER_W_SHIFT 0
4347+#define ETH_TX_PARSE_2ND_BD_IP_HDR_TYPE_OUTER (0x1<<4)
4348+#define ETH_TX_PARSE_2ND_BD_IP_HDR_TYPE_OUTER_SHIFT 4
4349+#define ETH_TX_PARSE_2ND_BD_LLC_SNAP_EN (0x1<<5)
4350+#define ETH_TX_PARSE_2ND_BD_LLC_SNAP_EN_SHIFT 5
4351+#define ETH_TX_PARSE_2ND_BD_NS_FLG (0x1<<6)
4352+#define ETH_TX_PARSE_2ND_BD_NS_FLG_SHIFT 6
4353+#define ETH_TX_PARSE_2ND_BD_TUNNEL_UDP_EXIST (0x1<<7)
4354+#define ETH_TX_PARSE_2ND_BD_TUNNEL_UDP_EXIST_SHIFT 7
4355+#define ETH_TX_PARSE_2ND_BD_IP_HDR_LEN_OUTER_W (0x1F<<8)
4356+#define ETH_TX_PARSE_2ND_BD_IP_HDR_LEN_OUTER_W_SHIFT 8
4357+#define ETH_TX_PARSE_2ND_BD_RESERVED0 (0x7<<13)
4358+#define ETH_TX_PARSE_2ND_BD_RESERVED0_SHIFT 13
4359+ __le16 reserved1;
4360+ u8 tcp_flags;
4361+#define ETH_TX_PARSE_2ND_BD_FIN_FLG (0x1<<0)
4362+#define ETH_TX_PARSE_2ND_BD_FIN_FLG_SHIFT 0
4363+#define ETH_TX_PARSE_2ND_BD_SYN_FLG (0x1<<1)
4364+#define ETH_TX_PARSE_2ND_BD_SYN_FLG_SHIFT 1
4365+#define ETH_TX_PARSE_2ND_BD_RST_FLG (0x1<<2)
4366+#define ETH_TX_PARSE_2ND_BD_RST_FLG_SHIFT 2
4367+#define ETH_TX_PARSE_2ND_BD_PSH_FLG (0x1<<3)
4368+#define ETH_TX_PARSE_2ND_BD_PSH_FLG_SHIFT 3
4369+#define ETH_TX_PARSE_2ND_BD_ACK_FLG (0x1<<4)
4370+#define ETH_TX_PARSE_2ND_BD_ACK_FLG_SHIFT 4
4371+#define ETH_TX_PARSE_2ND_BD_URG_FLG (0x1<<5)
4372+#define ETH_TX_PARSE_2ND_BD_URG_FLG_SHIFT 5
4373+#define ETH_TX_PARSE_2ND_BD_ECE_FLG (0x1<<6)
4374+#define ETH_TX_PARSE_2ND_BD_ECE_FLG_SHIFT 6
4375+#define ETH_TX_PARSE_2ND_BD_CWR_FLG (0x1<<7)
4376+#define ETH_TX_PARSE_2ND_BD_CWR_FLG_SHIFT 7
4377+ u8 reserved2;
4378+ u8 tunnel_udp_hdr_start_w;
4379+ u8 fw_ip_hdr_to_payload_w;
4380+ __le16 fw_ip_csum_wo_len_flags_frag;
4381+ __le16 hw_ip_id;
4382+ __le32 tcp_send_seq;
4383+};
4384+
4385+/* The last BD in the BD memory will hold a pointer to the next BD memory */
42414386 struct eth_tx_next_bd {
42424387 __le32 addr_lo;
42434388 __le32 addr_hi;
@@ -4252,6 +4397,7 @@ union eth_tx_bd_types { · 8 unmodified lines
42524397 struct eth_tx_bd reg_bd;
42534398 struct eth_tx_parse_bd_e1x parse_bd_e1x;
42544399 struct eth_tx_parse_bd_e2 parse_bd_e2;
4400+ struct eth_tx_parse_2nd_bd parse_2nd_bd;
42554401 struct eth_tx_next_bd next_bd;
42564402 };
42574403
@@ -4663,10 +4809,10 @@ enum common_spqe_cmd_id { · 405 unmodified lines
46634809 RAMROD_CMD_ID_COMMON_STOP_TRAFFIC,
46644810 RAMROD_CMD_ID_COMMON_START_TRAFFIC,
46654811 RAMROD_CMD_ID_COMMON_AFEX_VIF_LISTS,
4812+ RAMROD_CMD_ID_COMMON_SET_TIMESYNC,
46664813 MAX_COMMON_SPQE_CMD_ID
46674814 };
46684815
4669−
46704816 /*
46714817 * Per-protocol connection types
46724818 */
@@ -4863,7 +5009,7 @@ struct vf_flr_event_data { · 190 unmodified lines
48635009 */
48645010 struct malicious_vf_event_data {
48655011 u8 vf_id;
4866− u8 reserved0;
5012+ u8 err_id;
48675013 u16 reserved1;
48685014 u32 reserved2;
48695015 u32 reserved3;
@@ -4969,10 +5115,10 @@ enum event_ring_opcode { · 99 unmodified lines
49695115 EVENT_RING_OPCODE_CLASSIFICATION_RULES,
49705116 EVENT_RING_OPCODE_FILTERS_RULES,
49715117 EVENT_RING_OPCODE_MULTICAST_RULES,
5118+ EVENT_RING_OPCODE_SET_TIMESYNC,
49725119 MAX_EVENT_RING_OPCODE
49735120 };
49745121
4975−
49765122 /*
49775123 * Modes for fairness algorithm
49785124 */
@@ -5010,14 +5156,18 @@ struct flow_control_configuration { · 31 unmodified lines
50105156 */
50115157 struct function_start_data {
50125158 u8 function_mode;
5013− u8 reserved;
5159+ u8 allow_npar_tx_switching;
50145160 __le16 sd_vlan_tag;
50155161 __le16 vif_id;
50165162 u8 path_id;
50175163 u8 network_cos_mode;
5164+ u8 dmae_cmd_id;
5165+ u8 gre_tunnel_mode;
5166+ u8 gre_tunnel_rss;
5167+ u8 nvgre_clss_en;
5168+ __le16 reserved1[2];
50185169 };
50195170
5020−
50215171 struct function_update_data {
50225172 u8 vif_id_change_flg;
50235173 u8 afex_default_vlan_change_flg;
@@ -5027,14 +5177,19 @@ struct function_update_data { · 3 unmodified lines
50275177 __le16 afex_default_vlan;
50285178 u8 allowed_priorities;
50295179 u8 network_cos_mode;
5180+ u8 lb_mode_en_change_flg;
50305181 u8 lb_mode_en;
50315182 u8 tx_switch_suspend_change_flg;
50325183 u8 tx_switch_suspend;
50335184 u8 echo;
5034− __le16 reserved1;
5185+ u8 reserved1;
5186+ u8 update_gre_cfg_flg;
5187+ u8 gre_tunnel_mode;
5188+ u8 gre_tunnel_rss;
5189+ u8 nvgre_clss_en;
5190+ u32 reserved3;
50355191 };
50365192
5037−
50385193 /*
50395194 * FW version stored in the Xstorm RAM
50405195 */
@@ -5061,6 +5216,22 @@ struct fw_version { · 20 unmodified lines
50615216 #define __FW_VERSION_RESERVED_SHIFT 4
50625217 };
50635218
5219+/* GRE RSS Mode */
5220+enum gre_rss_mode {
5221+ GRE_OUTER_HEADERS_RSS,
5222+ GRE_INNER_HEADERS_RSS,
5223+ NVGRE_KEY_ENTROPY_RSS,
5224+ MAX_GRE_RSS_MODE
5225+};
5226+
5227+/* GRE Tunnel Mode */
5228+enum gre_tunnel_type {
5229+ NO_GRE_TUNNEL,
5230+ NVGRE_TUNNEL,
5231+ L2GRE_TUNNEL,
5232+ IPGRE_TUNNEL,
5233+ MAX_GRE_TUNNEL_TYPE
5234+};
50645235
50655236 /*
50665237 * Dynamic Host-Coalescing - Driver(host) counters
@@ -5224,6 +5395,26 @@ enum ip_ver { · 157 unmodified lines
52245395 MAX_IP_VER
52255396 };
52265397
5398+/*
5399+ * Malicious VF error ID
5400+ */
5401+enum malicious_vf_error_id {
5402+ VF_PF_CHANNEL_NOT_READY,
5403+ ETH_ILLEGAL_BD_LENGTHS,
5404+ ETH_PACKET_TOO_SHORT,
5405+ ETH_PAYLOAD_TOO_BIG,
5406+ ETH_ILLEGAL_ETH_TYPE,
5407+ ETH_ILLEGAL_LSO_HDR_LEN,
5408+ ETH_TOO_MANY_BDS,
5409+ ETH_ZERO_HDR_NBDS,
5410+ ETH_START_BD_NOT_SET,
5411+ ETH_ILLEGAL_PARSE_NBDS,
5412+ ETH_IPV6_AND_CHECKSUM,
5413+ ETH_VLAN_FLG_INCORRECT,
5414+ ETH_ILLEGAL_LSO_MSS,
5415+ ETH_TUNNEL_NOT_SUPPORTED,
5416+ MAX_MALICIOUS_VF_ERROR_ID
5417+};
52275418
52285419 /*
52295420 * Multi-function modes
@@ -5368,7 +5559,6 @@ struct protocol_common_spe { · 138 unmodified lines
53685559 union protocol_common_specific_data data;
53695560 };
53705561
5371−
53725562 /*
53735563 * The send queue element
53745564 */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c+146−94
@@ -27,6 +27,10 @@ · 26 unmodified lines
2727 #include "bnx2x.h"
2828 #include "bnx2x_cmn.h"
2929
30+typedef int (*read_sfp_module_eeprom_func_p)(struct bnx2x_phy *phy,
31+ struct link_params *params,
32+ u8 dev_addr, u16 addr, u8 byte_cnt,
33+ u8 *o_buf, u8);
3034 /********************************************************/
3135 #define ETH_HLEN 14
3236 /* L2 header size + 2*VLANs (8 bytes) + LLC SNAP (8 bytes) */
@@ -152,6 +156,7 @@ · 119 unmodified lines
152156 #define SFP_EEPROM_CON_TYPE_ADDR 0x2
153157 #define SFP_EEPROM_CON_TYPE_VAL_LC 0x7
154158 #define SFP_EEPROM_CON_TYPE_VAL_COPPER 0x21
159+ #define SFP_EEPROM_CON_TYPE_VAL_RJ45 0x22
155160
156161
157162 #define SFP_EEPROM_COMP_CODE_ADDR 0x3
@@ -3127,11 +3132,6 @@ static int bnx2x_bsc_read(struct link_params *params, · 2969 unmodified lines
31273132 int rc = 0;
31283133 struct bnx2x *bp = params->bp;
31293134
3130− if ((sl_devid != 0xa0) && (sl_devid != 0xa2)) {
3131− DP(NETIF_MSG_LINK, "invalid sl_devid 0x%x\n", sl_devid);
3132− return -EINVAL;
3133− }
3134−
31353135 if (xfer_cnt > 16) {
31363136 DP(NETIF_MSG_LINK, "invalid xfer_cnt %d. Max is 16 bytes\n",
31373137 xfer_cnt);
@@ -3426,13 +3426,19 @@ static void bnx2x_calc_ieee_aneg_adv(struct bnx2x_phy *phy, · 288 unmodified lines
34263426
34273427 switch (phy->req_flow_ctrl) {
34283428 case BNX2X_FLOW_CTRL_AUTO:
3429− if (params->req_fc_auto_adv == BNX2X_FLOW_CTRL_BOTH)
3429+ switch (params->req_fc_auto_adv) {
3430+ case BNX2X_FLOW_CTRL_BOTH:
34303431 *ieee_fc |= MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_BOTH;
3431− else
3432+ break;
3433+ case BNX2X_FLOW_CTRL_RX:
3434+ case BNX2X_FLOW_CTRL_TX:
34323435 *ieee_fc |=
3433− MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_ASYMMETRIC;
3436+ MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_ASYMMETRIC;
3437+ break;
3438+ default:
3439+ break;
3440+ }
34343441 break;
3435−
34363442 case BNX2X_FLOW_CTRL_TX:
34373443 *ieee_fc |= MDIO_COMBO_IEEE0_AUTO_NEG_ADV_PAUSE_ASYMMETRIC;
34383444 break;
@@ -3629,6 +3635,16 @@ static u8 bnx2x_ext_phy_resolve_fc(struct bnx2x_phy *phy, · 190 unmodified lines
36293635 * init configuration, and set/clear SGMII flag. Internal
36303636 * phy init is done purely in phy_init stage.
36313637 */
3638+#define WC_TX_DRIVER(post2, idriver, ipre) \
3639+ ((post2 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) | \
3640+ (idriver << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) | \
3641+ (ipre << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET))
3642+
3643+#define WC_TX_FIR(post, main, pre) \
3644+ ((post << MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET) | \
3645+ (main << MDIO_WC_REG_TX_FIR_TAP_MAIN_TAP_OFFSET) | \
3646+ (pre << MDIO_WC_REG_TX_FIR_TAP_PRE_TAP_OFFSET))
3647+
36323648 static void bnx2x_warpcore_enable_AN_KR2(struct bnx2x_phy *phy,
36333649 struct link_params *params,
36343650 struct link_vars *vars)
@@ -3728,7 +3744,7 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 93 unmodified lines
37283744 if (((vars->line_speed == SPEED_AUTO_NEG) &&
37293745 (phy->speed_cap_mask & PORT_HW_CFG_SPEED_CAPABILITY_D0_1G)) ||
37303746 (vars->line_speed == SPEED_1000)) {
3731− u32 addr = MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2;
3747+ u16 addr = MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2;
37323748 an_adv |= (1<<5);
37333749
37343750 /* Enable CL37 1G Parallel Detect */
@@ -3753,20 +3769,13 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, · 18 unmodified lines
37533769 /* Set Transmit PMD settings */
37543770 lane = bnx2x_get_warpcore_lane(phy, params);
37553771 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3756− MDIO_WC_REG_TX0_TX_DRIVER + 0x10*lane,
3757− ((0x02 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) |
3758− (0x06 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) |
3759− (0x09 << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET)));
3772+ MDIO_WC_REG_TX0_TX_DRIVER + 0x10*lane,
3773+ WC_TX_DRIVER(0x02, 0x06, 0x09));
37603774 /* Configure the next lane if dual mode */
37613775 if (phy->flags & FLAGS_WC_DUAL_MODE)
37623776 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
37633777 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)));
3778+ WC_TX_DRIVER(0x02, 0x06, 0x09));
37703779 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
37713780 MDIO_WC_REG_CL72_USERB0_CL72_OS_DEF_CTRL,
37723781 0x03f0);
@@ -3909,6 +3918,8 @@ static void bnx2x_warpcore_set_10G_XFI(struct bnx2x_phy *phy, · 136 unmodified lines
39093918 {
39103919 struct bnx2x *bp = params->bp;
39113920 u16 misc1_val, tap_val, tx_driver_val, lane, val;
3921+ u32 cfg_tap_val, tx_drv_brdct, tx_equal;
3922+
39123923 /* Hold rxSeqStart */
39133924 bnx2x_cl45_read_or_write(bp, phy, MDIO_WC_DEVAD,
39143925 MDIO_WC_REG_DSC2B0_DSC_MISC_CTRL0, 0x8000);
@@ -3952,23 +3963,33 @@ static void bnx2x_warpcore_set_10G_XFI(struct bnx2x_phy *phy, · 37 unmodified lines
39523963
39533964 if (is_xfi) {
39543965 misc1_val |= 0x5;
3955− tap_val = ((0x08 << MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET) |
3956− (0x37 << MDIO_WC_REG_TX_FIR_TAP_MAIN_TAP_OFFSET) |
3957− (0x00 << MDIO_WC_REG_TX_FIR_TAP_PRE_TAP_OFFSET));
3958− tx_driver_val =
3959− ((0x00 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) |
3960− (0x02 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) |
3961− (0x03 << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET));
3962−
3966+ tap_val = WC_TX_FIR(0x08, 0x37, 0x00);
3967+ tx_driver_val = WC_TX_DRIVER(0x00, 0x02, 0x03);
39633968 } else {
3969+ cfg_tap_val = REG_RD(bp, params->shmem_base +
3970+ offsetof(struct shmem_region, dev_info.
3971+ port_hw_config[params->port].
3972+ sfi_tap_values));
3973+
3974+ tx_equal = cfg_tap_val & PORT_HW_CFG_TX_EQUALIZATION_MASK;
3975+
3976+ tx_drv_brdct = (cfg_tap_val &
3977+ PORT_HW_CFG_TX_DRV_BROADCAST_MASK) >>
3978+ PORT_HW_CFG_TX_DRV_BROADCAST_SHIFT;
3979+
39643980 misc1_val |= 0x9;
3965− tap_val = ((0x0f << MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET) |
3966− (0x2b << MDIO_WC_REG_TX_FIR_TAP_MAIN_TAP_OFFSET) |
3967− (0x02 << MDIO_WC_REG_TX_FIR_TAP_PRE_TAP_OFFSET));
3968− tx_driver_val =
3969− ((0x03 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) |
3970− (0x02 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) |
3971− (0x06 << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET));
3981+
3982+ /* TAP values are controlled by nvram, if value there isn't 0 */
3983+ if (tx_equal)
3984+ tap_val = (u16)tx_equal;
3985+ else
3986+ tap_val = WC_TX_FIR(0x0f, 0x2b, 0x02);
3987+
3988+ if (tx_drv_brdct)
3989+ tx_driver_val = WC_TX_DRIVER(0x03, (u16)tx_drv_brdct,
3990+ 0x06);
3991+ else
3992+ tx_driver_val = WC_TX_DRIVER(0x03, 0x02, 0x06);
39723993 }
39733994 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
39743995 MDIO_WC_REG_SERDESDIGITAL_MISC1, misc1_val);
@@ -4105,15 +4126,11 @@ static void bnx2x_warpcore_set_20G_DXGXS(struct bnx2x *bp, · 130 unmodified lines
41054126 /* Set Transmit PMD settings */
41064127 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
41074128 MDIO_WC_REG_TX_FIR_TAP,
4108− ((0x12 << MDIO_WC_REG_TX_FIR_TAP_POST_TAP_OFFSET) |
4109− (0x2d << MDIO_WC_REG_TX_FIR_TAP_MAIN_TAP_OFFSET) |
4110− (0x00 << MDIO_WC_REG_TX_FIR_TAP_PRE_TAP_OFFSET) |
4111− MDIO_WC_REG_TX_FIR_TAP_ENABLE));
4129+ (WC_TX_FIR(0x12, 0x2d, 0x00) |
4130+ MDIO_WC_REG_TX_FIR_TAP_ENABLE));
41124131 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
4113− MDIO_WC_REG_TX0_TX_DRIVER + 0x10*lane,
4114− ((0x02 << MDIO_WC_REG_TX0_TX_DRIVER_POST2_COEFF_OFFSET) |
4115− (0x02 << MDIO_WC_REG_TX0_TX_DRIVER_IDRIVER_OFFSET) |
4116− (0x02 << MDIO_WC_REG_TX0_TX_DRIVER_IPRE_DRIVER_OFFSET)));
4132+ MDIO_WC_REG_TX0_TX_DRIVER + 0x10*lane,
4133+ WC_TX_DRIVER(0x02, 0x02, 0x02));
41174134 }
41184135
41194136 static void bnx2x_warpcore_set_sgmii_speed(struct bnx2x_phy *phy,
@@ -4750,8 +4767,8 @@ void bnx2x_link_status_update(struct link_params *params, · 630 unmodified lines
47504767 port_mb[port].link_status));
47514768
47524769 /* Force link UP in non LOOPBACK_EXT loopback mode(s) */
4753− if (bp->link_params.loopback_mode != LOOPBACK_NONE &&
4754− bp->link_params.loopback_mode != LOOPBACK_EXT)
4770+ if (params->loopback_mode != LOOPBACK_NONE &&
4771+ params->loopback_mode != LOOPBACK_EXT)
47554772 vars->link_status |= LINK_STATUS_LINK_UP;
47564773
47574774 if (bnx2x_eee_has_cap(params))
@@ -7758,7 +7775,8 @@ static void bnx2x_sfp_set_transmitter(struct link_params *params, · 3000 unmodified lines
77587775
77597776 static int bnx2x_8726_read_sfp_module_eeprom(struct bnx2x_phy *phy,
77607777 struct link_params *params,
7761− u16 addr, u8 byte_cnt, u8 *o_buf)
7778+ u8 dev_addr, u16 addr, u8 byte_cnt,
7779+ u8 *o_buf, u8 is_init)
77627780 {
77637781 struct bnx2x *bp = params->bp;
77647782 u16 val = 0;
@@ -7771,7 +7789,7 @@ static int bnx2x_8726_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 6 unmodified lines
77717789 /* Set the read command byte count */
77727790 bnx2x_cl45_write(bp, phy,
77737791 MDIO_PMA_DEVAD, MDIO_PMA_REG_SFP_TWO_WIRE_BYTE_CNT,
7774− (byte_cnt | 0xa000));
7792+ (byte_cnt | (dev_addr << 8)));
77757793
77767794 /* Set the read command address */
77777795 bnx2x_cl45_write(bp, phy,
@@ -7845,6 +7863,7 @@ static void bnx2x_warpcore_power_module(struct link_params *params, · 67 unmodified lines
78457863 }
78467864 static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy,
78477865 struct link_params *params,
7866+ u8 dev_addr,
78487867 u16 addr, u8 byte_cnt,
78497868 u8 *o_buf, u8 is_init)
78507869 {
@@ -7869,7 +7888,7 @@ static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 18 unmodified lines
78697888 usleep_range(1000, 2000);
78707889 bnx2x_warpcore_power_module(params, 1);
78717890 }
7872− rc = bnx2x_bsc_read(params, phy, 0xa0, addr32, 0, byte_cnt,
7891+ rc = bnx2x_bsc_read(params, phy, dev_addr, addr32, 0, byte_cnt,
78737892 data_array);
78747893 } while ((rc != 0) && (++cnt < I2C_WA_RETRY_CNT));
78757894
@@ -7885,7 +7904,8 @@ static int bnx2x_warpcore_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 9 unmodified lines
78857904
78867905 static int bnx2x_8727_read_sfp_module_eeprom(struct bnx2x_phy *phy,
78877906 struct link_params *params,
7888− u16 addr, u8 byte_cnt, u8 *o_buf)
7907+ u8 dev_addr, u16 addr, u8 byte_cnt,
7908+ u8 *o_buf, u8 is_init)
78897909 {
78907910 struct bnx2x *bp = params->bp;
78917911 u16 val, i;
@@ -7896,6 +7916,15 @@ static int bnx2x_8727_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 4 unmodified lines
78967916 return -EINVAL;
78977917 }
78987918
7919+ /* Set 2-wire transfer rate of SFP+ module EEPROM
7920+ * to 100Khz since some DACs(direct attached cables) do
7921+ * not work at 400Khz.
7922+ */
7923+ bnx2x_cl45_write(bp, phy,
7924+ MDIO_PMA_DEVAD,
7925+ MDIO_PMA_REG_8727_TWO_WIRE_SLAVE_ADDR,
7926+ ((dev_addr << 8) | 1));
7927+
78997928 /* Need to read from 1.8000 to clear it */
79007929 bnx2x_cl45_read(bp, phy,
79017930 MDIO_PMA_DEVAD,
@@ -7968,26 +7997,44 @@ static int bnx2x_8727_read_sfp_module_eeprom(struct bnx2x_phy *phy, · 66 unmodified lines
79687997
79697998 return -EINVAL;
79707999 }
7971−
79728000 int bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy,
7973− struct link_params *params, u16 addr,
7974− u8 byte_cnt, u8 *o_buf)
8001+ struct link_params *params, u8 dev_addr,
8002+ u16 addr, u16 byte_cnt, u8 *o_buf)
79758003 {
7976− int rc = -EOPNOTSUPP;
8004+ int rc = 0;
8005+ struct bnx2x *bp = params->bp;
8006+ u8 xfer_size;
8007+ u8 *user_data = o_buf;
8008+ read_sfp_module_eeprom_func_p read_func;
8009+
8010+ if ((dev_addr != 0xa0) && (dev_addr != 0xa2)) {
8011+ DP(NETIF_MSG_LINK, "invalid dev_addr 0x%x\n", dev_addr);
8012+ return -EINVAL;
8013+ }
8014+
79778015 switch (phy->type) {
79788016 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726:
7979− rc = bnx2x_8726_read_sfp_module_eeprom(phy, params, addr,
7980− byte_cnt, o_buf);
7981− break;
8017+ read_func = bnx2x_8726_read_sfp_module_eeprom;
8018+ break;
79828019 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727:
79838020 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8722:
7984− rc = bnx2x_8727_read_sfp_module_eeprom(phy, params, addr,
7985− byte_cnt, o_buf);
7986− break;
8021+ read_func = bnx2x_8727_read_sfp_module_eeprom;
8022+ break;
79878023 case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT:
7988− rc = bnx2x_warpcore_read_sfp_module_eeprom(phy, params, addr,
7989− byte_cnt, o_buf, 0);
7990− break;
8024+ read_func = bnx2x_warpcore_read_sfp_module_eeprom;
8025+ break;
8026+ default:
8027+ return -EOPNOTSUPP;
8028+ }
8029+
8030+ while (!rc && (byte_cnt > 0)) {
8031+ xfer_size = (byte_cnt > SFP_EEPROM_PAGE_SIZE) ?
8032+ SFP_EEPROM_PAGE_SIZE : byte_cnt;
8033+ rc = read_func(phy, params, dev_addr, addr, xfer_size,
8034+ user_data, 0);
8035+ byte_cnt -= xfer_size;
8036+ user_data += xfer_size;
8037+ addr += xfer_size;
79918038 }
79928039 return rc;
79938040 }
@@ -8004,6 +8051,7 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, · 10 unmodified lines
80048051 /* First check for copper cable */
80058052 if (bnx2x_read_sfp_module_eeprom(phy,
80068053 params,
8054+ I2C_DEV_ADDR_A0,
80078055 SFP_EEPROM_CON_TYPE_ADDR,
80088056 2,
80098057 (u8 *)val) != 0) {
@@ -8021,6 +8069,7 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, · 11 unmodified lines
80218069 */
80228070 if (bnx2x_read_sfp_module_eeprom(phy,
80238071 params,
8072+ I2C_DEV_ADDR_A0,
80248073 SFP_EEPROM_FC_TX_TECH_ADDR,
80258074 1,
80268075 &copper_module_type) != 0) {
@@ -8049,20 +8098,24 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, · 22 unmodified lines
80498098 break;
80508099 }
80518100 case SFP_EEPROM_CON_TYPE_VAL_LC:
8101+ case SFP_EEPROM_CON_TYPE_VAL_RJ45:
80528102 check_limiting_mode = 1;
80538103 if ((val[1] & (SFP_EEPROM_COMP_CODE_SR_MASK |
80548104 SFP_EEPROM_COMP_CODE_LR_MASK |
80558105 SFP_EEPROM_COMP_CODE_LRM_MASK)) == 0) {
8056− DP(NETIF_MSG_LINK, "1G Optic module detected\n");
8106+ DP(NETIF_MSG_LINK, "1G SFP module detected\n");
80578107 gport = params->port;
80588108 phy->media_type = ETH_PHY_SFP_1G_FIBER;
8059− phy->req_line_speed = SPEED_1000;
8060− if (!CHIP_IS_E1x(bp))
8061− gport = BP_PATH(bp) + (params->port << 1);
8062− netdev_err(bp->dev, "Warning: Link speed was forced to 1000Mbps."
8063− " Current SFP module in port %d is not"
8064− " compliant with 10G Ethernet\n",
8065− gport);
8109+ if (phy->req_line_speed != SPEED_1000) {
8110+ phy->req_line_speed = SPEED_1000;
8111+ if (!CHIP_IS_E1x(bp)) {
8112+ gport = BP_PATH(bp) +
8113+ (params->port << 1);
8114+ }
8115+ netdev_err(bp->dev,
8116+ "Warning: Link speed was forced to 1000Mbps. Current SFP module in port %d is not compliant with 10G Ethernet\n",
8117+ gport);
8118+ }
80668119 } else {
80678120 int idx, cfg_idx = 0;
80688121 DP(NETIF_MSG_LINK, "10G Optic module detected\n");
@@ -8101,6 +8154,7 @@ static int bnx2x_get_edc_mode(struct bnx2x_phy *phy, · 32 unmodified lines
81018154 u8 options[SFP_EEPROM_OPTIONS_SIZE];
81028155 if (bnx2x_read_sfp_module_eeprom(phy,
81038156 params,
8157+ I2C_DEV_ADDR_A0,
81048158 SFP_EEPROM_OPTIONS_ADDR,
81058159 SFP_EEPROM_OPTIONS_SIZE,
81068160 options) != 0) {
@@ -8167,6 +8221,7 @@ static int bnx2x_verify_sfp_module(struct bnx2x_phy *phy, · 60 unmodified lines
81678221 /* Format the warning message */
81688222 if (bnx2x_read_sfp_module_eeprom(phy,
81698223 params,
8224+ I2C_DEV_ADDR_A0,
81708225 SFP_EEPROM_VENDOR_NAME_ADDR,
81718226 SFP_EEPROM_VENDOR_NAME_SIZE,
81728227 (u8 *)vendor_name))
@@ -8175,6 +8230,7 @@ static int bnx2x_verify_sfp_module(struct bnx2x_phy *phy, · 2 unmodified lines
81758230 vendor_name[SFP_EEPROM_VENDOR_NAME_SIZE] = '\0';
81768231 if (bnx2x_read_sfp_module_eeprom(phy,
81778232 params,
8233+ I2C_DEV_ADDR_A0,
81788234 SFP_EEPROM_PART_NO_ADDR,
81798235 SFP_EEPROM_PART_NO_SIZE,
81808236 (u8 *)vendor_pn))
@@ -8205,12 +8261,13 @@ static int bnx2x_wait_for_sfp_module_initialized(struct bnx2x_phy *phy, · 24 unmodified lines
82058261
82068262 for (timeout = 0; timeout < 60; timeout++) {
82078263 if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT)
8208− rc = bnx2x_warpcore_read_sfp_module_eeprom(phy,
8209− params, 1,
8210− 1, &val, 1);
8264+ rc = bnx2x_warpcore_read_sfp_module_eeprom(
8265+ phy, params, I2C_DEV_ADDR_A0, 1, 1, &val,
8266+ 1);
82118267 else
8212− rc = bnx2x_read_sfp_module_eeprom(phy, params, 1, 1,
8213− &val);
8268+ rc = bnx2x_read_sfp_module_eeprom(phy, params,
8269+ I2C_DEV_ADDR_A0,
8270+ 1, 1, &val);
82148271 if (rc == 0) {
82158272 DP(NETIF_MSG_LINK,
82168273 "SFP+ module initialization took %d ms\n",
@@ -8219,7 +8276,8 @@ static int bnx2x_wait_for_sfp_module_initialized(struct bnx2x_phy *phy, · 2 unmodified lines
82198276 }
82208277 usleep_range(5000, 10000);
82218278 }
8222− rc = bnx2x_read_sfp_module_eeprom(phy, params, 1, 1, &val);
8279+ rc = bnx2x_read_sfp_module_eeprom(phy, params, I2C_DEV_ADDR_A0,
8280+ 1, 1, &val);
82238281 return rc;
82248282 }
82258283
@@ -8376,15 +8434,6 @@ static void bnx2x_8727_specific_func(struct bnx2x_phy *phy, · 150 unmodified lines
83768434 bnx2x_cl45_write(bp, phy,
83778435 MDIO_PMA_DEVAD, MDIO_PMA_REG_8727_PCS_OPT_CTRL,
83788436 val);
8379−
8380− /* Set 2-wire transfer rate of SFP+ module EEPROM
8381− * to 100Khz since some DACs(direct attached cables) do
8382− * not work at 400Khz.
8383− */
8384− bnx2x_cl45_write(bp, phy,
8385− MDIO_PMA_DEVAD,
8386− MDIO_PMA_REG_8727_TWO_WIRE_SLAVE_ADDR,
8387− 0xa001);
83888437 break;
83898438 default:
83908439 DP(NETIF_MSG_LINK, "Function 0x%x not supported by 8727\n",
@@ -9528,8 +9577,7 @@ static void bnx2x_save_848xx_spirom_version(struct bnx2x_phy *phy, · 1137 unmodified lines
95289577 } else {
95299578 /* For 32-bit registers in 848xx, access via MDIO2ARM i/f. */
95309579 /* (1) set reg 0xc200_0014(SPI_BRIDGE_CTRL_2) to 0x03000000 */
9531− for (i = 0; i < ARRAY_SIZE(reg_set);
9532− i++)
9580+ for (i = 0; i < ARRAY_SIZE(reg_set); i++)
95339581 bnx2x_cl45_write(bp, phy, reg_set[i].devad,
95349582 reg_set[i].reg, reg_set[i].val);
95359583
@@ -10281,7 +10329,8 @@ static u8 bnx2x_848xx_read_status(struct bnx2x_phy *phy, · 745 unmodified lines
1028110329 LINK_STATUS_LINK_PARTNER_10GXFD_CAPABLE;
1028210330
1028310331 /* Determine if EEE was negotiated */
10284− if (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833)
10332+ if ((phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84833) ||
10333+ (phy->type == PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM84834))
1028510334 bnx2x_eee_an_resolve(phy, params, vars);
1028610335 }
1028710336
@@ -12242,7 +12291,7 @@ static void bnx2x_init_bmac_loopback(struct link_params *params, · 1954 unmodified lines
1224212291
1224312292 bnx2x_xgxs_deassert(params);
1224412293
12245− /* set bmac loopback */
12294+ /* Set bmac loopback */
1224612295 bnx2x_bmac_enable(params, vars, 1, 1);
1224712296
1224812297 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
@@ -12261,7 +12310,7 @@ static void bnx2x_init_emac_loopback(struct link_params *params, · 12 unmodified lines
1226112310 vars->phy_flags = PHY_XGXS_FLAG;
1226212311
1226312312 bnx2x_xgxs_deassert(params);
12264− /* set bmac loopback */
12313+ /* Set bmac loopback */
1226512314 bnx2x_emac_enable(params, vars, 1);
1226612315 bnx2x_emac_program(params, vars);
1226712316 REG_WR(bp, NIG_REG_EGRESS_DRAIN0_MODE + params->port*4, 0);
@@ -12521,6 +12570,7 @@ int bnx2x_phy_init(struct link_params *params, struct link_vars *vars) · 253 unmodified lines
1252112570 params->req_line_speed[0], params->req_flow_ctrl[0]);
1252212571 DP(NETIF_MSG_LINK, "(2) req_speed %d, req_flowctrl %d\n",
1252312572 params->req_line_speed[1], params->req_flow_ctrl[1]);
12573+ DP(NETIF_MSG_LINK, "req_adv_flow_ctrl 0x%x\n", params->req_fc_auto_adv);
1252412574 vars->link_status = 0;
1252512575 vars->phy_link_up = 0;
1252612576 vars->link_up = 0;
@@ -13440,8 +13490,8 @@ static void bnx2x_check_kr2_wa(struct link_params *params, · 913 unmodified lines
1344013490 int sigdet;
1344113491
1344213492 /* Once KR2 was disabled, wait 5 seconds before checking KR2 recovery
13443− * since some switches tend to reinit the AN process and clear the
13444− * advertised BP/NP after ~2 seconds causing the KR2 to be disabled
13493+ * Since some switches tend to reinit the AN process and clear the
13494+ * the advertised BP/NP after ~2 seconds causing the KR2 to be disabled
1344513495 * and recovered many times
1344613496 */
1344713497 if (vars->check_kr2_recovery_cnt > 0) {
@@ -13469,8 +13519,10 @@ static void bnx2x_check_kr2_wa(struct link_params *params, · 21 unmodified lines
1346913519
1347013520 /* CL73 has not begun yet */
1347113521 if (base_page == 0) {
13472− if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE))
13522+ if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {
1347313523 bnx2x_kr2_recovery(params, vars, phy);
13524+ DP(NETIF_MSG_LINK, "No BP\n");
13525+ }
1347413526 return;
1347513527 }
1347613528
@@ -13486,7 +13538,7 @@ static void bnx2x_check_kr2_wa(struct link_params *params, · 9 unmodified lines
1348613538 if (!(vars->link_attr_sync & LINK_ATTR_SYNC_KR2_ENABLE)) {
1348713539 if (!not_kr2_device) {
1348813540 DP(NETIF_MSG_LINK, "BP=0x%x, NP=0x%x\n", base_page,
13489− next_page);
13541+ next_page);
1349013542 bnx2x_kr2_recovery(params, vars, phy);
1349113543 }
1349213544 return;
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h+14−2
@@ -41,6 +41,9 @@ · 40 unmodified lines
4141 #define SPEED_AUTO_NEG 0
4242 #define SPEED_20000 20000
4343
44+#define I2C_DEV_ADDR_A0 0xa0
45+#define I2C_DEV_ADDR_A2 0xa2
46+
4447 #define SFP_EEPROM_PAGE_SIZE 16
4548 #define SFP_EEPROM_VENDOR_NAME_ADDR 0x14
4649 #define SFP_EEPROM_VENDOR_NAME_SIZE 16
@@ -54,6 +57,15 @@ · 7 unmodified lines
5457 #define SFP_EEPROM_SERIAL_SIZE 16
5558 #define SFP_EEPROM_DATE_ADDR 0x54 /* ASCII YYMMDD */
5659 #define SFP_EEPROM_DATE_SIZE 6
60+#define SFP_EEPROM_DIAG_TYPE_ADDR 0x5c
61+#define SFP_EEPROM_DIAG_TYPE_SIZE 1
62+#define SFP_EEPROM_DIAG_ADDR_CHANGE_REQ (1<<2)
63+#define SFP_EEPROM_SFF_8472_COMP_ADDR 0x5e
64+#define SFP_EEPROM_SFF_8472_COMP_SIZE 1
65+
66+#define SFP_EEPROM_A2_CHECKSUM_RANGE 0x5e
67+#define SFP_EEPROM_A2_CC_DMI_ADDR 0x5f
68+
5769 #define PWR_FLT_ERR_MSG_LEN 250
5870
5971 #define XGXS_EXT_PHY_TYPE(ext_phy_config) \
@@ -420,8 +432,8 @@ void bnx2x_sfx7101_sp_sw_reset(struct bnx2x *bp, struct bnx2x_phy *phy); · 360 unmodified lines
420432
421433 /* Read "byte_cnt" bytes from address "addr" from the SFP+ EEPROM */
422434 int bnx2x_read_sfp_module_eeprom(struct bnx2x_phy *phy,
423− struct link_params *params, u16 addr,
424− u8 byte_cnt, u8 *o_buf);
435+ struct link_params *params, u8 dev_addr,
436+ u16 addr, u16 byte_cnt, u8 *o_buf);
425437
426438 void bnx2x_hw_reset_phy(struct link_params *params);
427439
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+232−117
@@ -75,8 +75,6 @@ · 74 unmodified lines
7575 #define FW_FILE_NAME_E1H "bnx2x/bnx2x-e1h-" FW_FILE_VERSION ".fw"
7676 #define FW_FILE_NAME_E2 "bnx2x/bnx2x-e2-" FW_FILE_VERSION ".fw"
7777
78−#define MAC_LEADING_ZERO_CNT (ALIGN(ETH_ALEN, sizeof(u32)) - ETH_ALEN)
79−
8078 /* Time in jiffies before concluding the transmitter is hung */
8179 #define TX_TIMEOUT (5*HZ)
8280
@@ -2955,14 +2953,16 @@ static unsigned long bnx2x_get_common_flags(struct bnx2x *bp, · 2872 unmodified lines
29552953 __set_bit(BNX2X_Q_FLG_ACTIVE, &flags);
29562954
29572955 /* tx only connections collect statistics (on the same index as the
2958− * parent connection). The statistics are zeroed when the parent
2959− * connection is initialized.
2956+ * parent connection). The statistics are zeroed when the parent
2957+ * connection is initialized.
29602958 */
29612959
29622960 __set_bit(BNX2X_Q_FLG_STATS, &flags);
29632961 if (zero_stats)
29642962 __set_bit(BNX2X_Q_FLG_ZERO_STATS, &flags);
29652963
2964+ __set_bit(BNX2X_Q_FLG_PCSUM_ON_PKT, &flags);
2965+ __set_bit(BNX2X_Q_FLG_TUN_INC_INNER_IP_ID, &flags);
29662966
29672967 #ifdef BNX2X_STOP_ON_ERROR
29682968 __set_bit(BNX2X_Q_FLG_TX_SEC, &flags);
@@ -3227,16 +3227,29 @@ static void bnx2x_drv_info_ether_stat(struct bnx2x *bp) · 258 unmodified lines
32273227 {
32283228 struct eth_stats_info *ether_stat =
32293229 &bp->slowpath->drv_info_to_mcp.ether_stat;
3230+ struct bnx2x_vlan_mac_obj *mac_obj =
3231+ &bp->sp_objs->mac_obj;
3232+ int i;
32303233
32313234 strlcpy(ether_stat->version, DRV_MODULE_VERSION,
32323235 ETH_STAT_INFO_VERSION_LEN);
32333236
3234− bp->sp_objs[0].mac_obj.get_n_elements(bp, &bp->sp_objs[0].mac_obj,
3235− DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED,
3236− ether_stat->mac_local);
3237−
3237+ /* get DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED macs, placing them in the
3238+ * mac_local field in ether_stat struct. The base address is offset by 2
3239+ * bytes to account for the field being 8 bytes but a mac address is
3240+ * only 6 bytes. Likewise, the stride for the get_n_elements function is
3241+ * 2 bytes to compensate from the 6 bytes of a mac to the 8 bytes
3242+ * allocated by the ether_stat struct, so the macs will land in their
3243+ * proper positions.
3244+ */
3245+ for (i = 0; i < DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED; i++)
3246+ memset(ether_stat->mac_local + i, 0,
3247+ sizeof(ether_stat->mac_local[0]));
3248+ mac_obj->get_n_elements(bp, &bp->sp_objs[0].mac_obj,
3249+ DRV_INFO_ETH_STAT_NUM_MACS_REQUIRED,
3250+ ether_stat->mac_local + MAC_PAD, MAC_PAD,
3251+ ETH_ALEN);
32383252 ether_stat->mtu_size = bp->dev->mtu;
3239−
32403253 if (bp->dev->features & NETIF_F_RXCSUM)
32413254 ether_stat->feature_flags |= FEATURE_ETH_CHKSUM_OFFLOAD_MASK;
32423255 if (bp->dev->features & NETIF_F_TSO)
@@ -3258,8 +3271,7 @@ static void bnx2x_drv_info_fcoe_stat(struct bnx2x *bp) · 15 unmodified lines
32583271 if (!CNIC_LOADED(bp))
32593272 return;
32603273
3261− memcpy(fcoe_stat->mac_local + MAC_LEADING_ZERO_CNT,
3262− bp->fip_mac, ETH_ALEN);
3274+ memcpy(fcoe_stat->mac_local + MAC_PAD, bp->fip_mac, ETH_ALEN);
32633275
32643276 fcoe_stat->qos_priority =
32653277 app->traffic_type_priority[LLFC_TRAFFIC_TYPE_FCOE];
@@ -3361,8 +3373,8 @@ static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp) · 95 unmodified lines
33613373 if (!CNIC_LOADED(bp))
33623374 return;
33633375
3364− memcpy(iscsi_stat->mac_local + MAC_LEADING_ZERO_CNT,
3365− bp->cnic_eth_dev.iscsi_mac, ETH_ALEN);
3376+ memcpy(iscsi_stat->mac_local + MAC_PAD, bp->cnic_eth_dev.iscsi_mac,
3377+ ETH_ALEN);
33663378
33673379 iscsi_stat->qos_priority =
33683380 app->traffic_type_priority[LLFC_TRAFFIC_TYPE_ISCSI];
@@ -6018,10 +6030,11 @@ void bnx2x_nic_init_cnic(struct bnx2x *bp) · 2649 unmodified lines
60186030 mmiowb();
60196031 }
60206032
6021−void bnx2x_nic_init(struct bnx2x *bp, u32 load_code)
6033+void bnx2x_pre_irq_nic_init(struct bnx2x *bp)
60226034 {
60236035 int i;
60246036
6037+ /* Setup NIC internals and enable interrupts */
60256038 for_each_eth_queue(bp, i)
60266039 bnx2x_init_eth_fp(bp, i);
60276040
@@ -6030,17 +6043,26 @@ void bnx2x_nic_init(struct bnx2x *bp, u32 load_code) · 2 unmodified lines
60306043 bnx2x_init_rx_rings(bp);
60316044 bnx2x_init_tx_rings(bp);
60326045
6033− if (IS_VF(bp))
6046+ if (IS_VF(bp)) {
6047+ bnx2x_memset_stats(bp);
60346048 return;
6049+ }
60356050
6036− /* Initialize MOD_ABS interrupts */
6037− bnx2x_init_mod_abs_int(bp, &bp->link_vars, bp->common.chip_id,
6038− bp->common.shmem_base, bp->common.shmem2_base,
6039− BP_PORT(bp));
6051+ if (IS_PF(bp)) {
6052+ /* Initialize MOD_ABS interrupts */
6053+ bnx2x_init_mod_abs_int(bp, &bp->link_vars, bp->common.chip_id,
6054+ bp->common.shmem_base,
6055+ bp->common.shmem2_base, BP_PORT(bp));
60406056
6041− bnx2x_init_def_sb(bp);
6042− bnx2x_update_dsb_idx(bp);
6043− bnx2x_init_sp_ring(bp);
6057+ /* initialize the default status block and sp ring */
6058+ bnx2x_init_def_sb(bp);
6059+ bnx2x_update_dsb_idx(bp);
6060+ bnx2x_init_sp_ring(bp);
6061+ }
6062+}
6063+
6064+void bnx2x_post_irq_nic_init(struct bnx2x *bp, u32 load_code)
6065+{
60446066 bnx2x_init_eq_ring(bp);
60456067 bnx2x_init_internal(bp, load_code);
60466068 bnx2x_pf_init(bp);
@@ -6058,12 +6080,7 @@ void bnx2x_nic_init(struct bnx2x *bp, u32 load_code) · 11 unmodified lines
60586080 AEU_INPUTS_ATTN_BITS_SPIO5);
60596081 }
60606082
6061−/* end of nic init */
6062−
6063−/*
6064− * gzip service functions
6065− */
6066−
6083+/* gzip service functions */
60676084 static int bnx2x_gunzip_init(struct bnx2x *bp)
60686085 {
60696086 bp->gunzip_buf = dma_alloc_coherent(&bp->pdev->dev, FW_BUF_SIZE,
@@ -7757,6 +7774,8 @@ void bnx2x_free_mem(struct bnx2x *bp) · 1687 unmodified lines
77577774 BNX2X_PCI_FREE(bp->eq_ring, bp->eq_mapping,
77587775 BCM_PAGE_SIZE * NUM_EQ_PAGES);
77597776
7777+ BNX2X_PCI_FREE(bp->t2, bp->t2_mapping, SRC_T2_SZ);
7778+
77607779 bnx2x_iov_free_mem(bp);
77617780 }
77627781
@@ -7773,7 +7792,7 @@ int bnx2x_alloc_mem_cnic(struct bnx2x *bp) · 10 unmodified lines
77737792 sizeof(struct
77747793 host_hc_status_block_e1x));
77757794
7776− if (CONFIGURE_NIC_MODE(bp))
7795+ if (CONFIGURE_NIC_MODE(bp) && !bp->t2)
77777796 /* allocate searcher T2 table, as it wan't allocated before */
77787797 BNX2X_PCI_ALLOC(bp->t2, &bp->t2_mapping, SRC_T2_SZ);
77797798
@@ -7796,7 +7815,7 @@ int bnx2x_alloc_mem(struct bnx2x *bp) · 16 unmodified lines
77967815 {
77977816 int i, allocated, context_size;
77987817
7799− if (!CONFIGURE_NIC_MODE(bp))
7818+ if (!CONFIGURE_NIC_MODE(bp) && !bp->t2)
78007819 /* allocate searcher T2 table */
78017820 BNX2X_PCI_ALLOC(bp->t2, &bp->t2_mapping, SRC_T2_SZ);
78027821
@@ -7917,8 +7936,6 @@ int bnx2x_del_all_macs(struct bnx2x *bp, · 114 unmodified lines
79177936
79187937 int bnx2x_set_eth_mac(struct bnx2x *bp, bool set)
79197938 {
7920− unsigned long ramrod_flags = 0;
7921−
79227939 if (is_zero_ether_addr(bp->dev->dev_addr) &&
79237940 (IS_MF_STORAGE_SD(bp) || IS_MF_FCOE_AFEX(bp))) {
79247941 DP(NETIF_MSG_IFUP | NETIF_MSG_IFDOWN,
@@ -7926,12 +7943,18 @@ int bnx2x_set_eth_mac(struct bnx2x *bp, bool set) · 1 unmodified line
79267943 return 0;
79277944 }
79287945
7929− DP(NETIF_MSG_IFUP, "Adding Eth MAC\n");
7946+ if (IS_PF(bp)) {
7947+ unsigned long ramrod_flags = 0;
79307948
7931− __set_bit(RAMROD_COMP_WAIT, &ramrod_flags);
7932− /* Eth MAC is set on RSS leading client (fp[0]) */
7933− return bnx2x_set_mac_one(bp, bp->dev->dev_addr, &bp->sp_objs->mac_obj,
7934− set, BNX2X_ETH_MAC, &ramrod_flags);
7949+ DP(NETIF_MSG_IFUP, "Adding Eth MAC\n");
7950+ __set_bit(RAMROD_COMP_WAIT, &ramrod_flags);
7951+ return bnx2x_set_mac_one(bp, bp->dev->dev_addr,
7952+ &bp->sp_objs->mac_obj, set,
7953+ BNX2X_ETH_MAC, &ramrod_flags);
7954+ } else { /* vf */
7955+ return bnx2x_vfpf_config_mac(bp, bp->dev->dev_addr,
7956+ bp->fp->index, true);
7957+ }
79357958 }
79367959
79377960 int bnx2x_setup_leading(struct bnx2x *bp)
@@ -9525,6 +9548,10 @@ sp_rtnl_not_reset: · 1587 unmodified lines
95259548 bnx2x_vfpf_storm_rx_mode(bp);
95269549 }
95279550
9551+ if (test_and_clear_bit(BNX2X_SP_RTNL_HYPERVISOR_VLAN,
9552+ &bp->sp_rtnl_state))
9553+ bnx2x_pf_set_vfs_vlan(bp);
9554+
95289555 /* work which needs rtnl lock not-taken (as it takes the lock itself and
95299556 * can be called from other contexts as well)
95309557 */
@@ -9532,8 +9559,10 @@ sp_rtnl_not_reset: · 1 unmodified line
95329559
95339560 /* enable SR-IOV if applicable */
95349561 if (IS_SRIOV(bp) && test_and_clear_bit(BNX2X_SP_RTNL_ENABLE_SRIOV,
9535− &bp->sp_rtnl_state))
9562+ &bp->sp_rtnl_state)) {
9563+ bnx2x_disable_sriov(bp);
95369564 bnx2x_enable_sriov(bp);
9565+ }
95379566 }
95389567
95399568 static void bnx2x_period_task(struct work_struct *work)
@@ -9701,6 +9730,31 @@ static struct bnx2x_prev_path_list * · 161 unmodified lines
97019730 return NULL;
97029731 }
97039732
9733+static int bnx2x_prev_path_mark_eeh(struct bnx2x *bp)
9734+{
9735+ struct bnx2x_prev_path_list *tmp_list;
9736+ int rc;
9737+
9738+ rc = down_interruptible(&bnx2x_prev_sem);
9739+ if (rc) {
9740+ BNX2X_ERR("Received %d when tried to take lock\n", rc);
9741+ return rc;
9742+ }
9743+
9744+ tmp_list = bnx2x_prev_path_get_entry(bp);
9745+ if (tmp_list) {
9746+ tmp_list->aer = 1;
9747+ rc = 0;
9748+ } else {
9749+ BNX2X_ERR("path %d: Entry does not exist for eeh; Flow occurs before initial insmod is over ?\n",
9750+ BP_PATH(bp));
9751+ }
9752+
9753+ up(&bnx2x_prev_sem);
9754+
9755+ return rc;
9756+}
9757+
97049758 static bool bnx2x_prev_is_path_marked(struct bnx2x *bp)
97059759 {
97069760 struct bnx2x_prev_path_list *tmp_list;
@@ -9709,14 +9763,15 @@ static bool bnx2x_prev_is_path_marked(struct bnx2x *bp) · 2 unmodified lines
97099763 if (down_trylock(&bnx2x_prev_sem))
97109764 return false;
97119765
9712− list_for_each_entry(tmp_list, &bnx2x_prev_list, list) {
9713− if (PCI_SLOT(bp->pdev->devfn) == tmp_list->slot &&
9714− bp->pdev->bus->number == tmp_list->bus &&
9715− BP_PATH(bp) == tmp_list->path) {
9766+ tmp_list = bnx2x_prev_path_get_entry(bp);
9767+ if (tmp_list) {
9768+ if (tmp_list->aer) {
9769+ DP(NETIF_MSG_HW, "Path %d was marked by AER\n",
9770+ BP_PATH(bp));
9771+ } else {
97169772 rc = true;
97179773 BNX2X_DEV_INFO("Path %d was already cleaned from previous drivers\n",
97189774 BP_PATH(bp));
9719− break;
97209775 }
97219776 }
97229777
@@ -9730,6 +9785,28 @@ static int bnx2x_prev_mark_path(struct bnx2x *bp, bool after_undi) · 7 unmodified lines
97309785 struct bnx2x_prev_path_list *tmp_list;
97319786 int rc;
97329787
9788+ rc = down_interruptible(&bnx2x_prev_sem);
9789+ if (rc) {
9790+ BNX2X_ERR("Received %d when tried to take lock\n", rc);
9791+ return rc;
9792+ }
9793+
9794+ /* Check whether the entry for this path already exists */
9795+ tmp_list = bnx2x_prev_path_get_entry(bp);
9796+ if (tmp_list) {
9797+ if (!tmp_list->aer) {
9798+ BNX2X_ERR("Re-Marking the path.\n");
9799+ } else {
9800+ DP(NETIF_MSG_HW, "Removing AER indication from path %d\n",
9801+ BP_PATH(bp));
9802+ tmp_list->aer = 0;
9803+ }
9804+ up(&bnx2x_prev_sem);
9805+ return 0;
9806+ }
9807+ up(&bnx2x_prev_sem);
9808+
9809+ /* Create an entry for this path and add it */
97339810 tmp_list = kmalloc(sizeof(struct bnx2x_prev_path_list), GFP_KERNEL);
97349811 if (!tmp_list) {
97359812 BNX2X_ERR("Failed to allocate 'bnx2x_prev_path_list'\n");
@@ -9739,6 +9816,7 @@ static int bnx2x_prev_mark_path(struct bnx2x *bp, bool after_undi) · 3 unmodified lines
97399816 tmp_list->bus = bp->pdev->bus->number;
97409817 tmp_list->slot = PCI_SLOT(bp->pdev->devfn);
97419818 tmp_list->path = BP_PATH(bp);
9819+ tmp_list->aer = 0;
97429820 tmp_list->undi = after_undi ? (1 << BP_PORT(bp)) : 0;
97439821
97449822 rc = down_interruptible(&bnx2x_prev_sem);
@@ -9746,8 +9824,8 @@ static int bnx2x_prev_mark_path(struct bnx2x *bp, bool after_undi) · 1 unmodified line
97469824 BNX2X_ERR("Received %d when tried to take lock\n", rc);
97479825 kfree(tmp_list);
97489826 } else {
9749− BNX2X_DEV_INFO("Marked path [%d] - finished previous unload\n",
9750− BP_PATH(bp));
9827+ DP(NETIF_MSG_HW, "Marked path [%d] - finished previous unload\n",
9828+ BP_PATH(bp));
97519829 list_add(&tmp_list->list, &bnx2x_prev_list);
97529830 up(&bnx2x_prev_sem);
97539831 }
@@ -9990,6 +10068,7 @@ static int bnx2x_prev_unload(struct bnx2x *bp) · 236 unmodified lines
999010068 }
999110069
999210070 do {
10071+ int aer = 0;
999310072 /* Lock MCP using an unload request */
999410073 fw = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS, 0);
999510074 if (!fw) {
@@ -9998,7 +10077,18 @@ static int bnx2x_prev_unload(struct bnx2x *bp) · 2 unmodified lines
999810077 break;
999910078 }
1000010079
10001− if (fw == FW_MSG_CODE_DRV_UNLOAD_COMMON) {
10080+ rc = down_interruptible(&bnx2x_prev_sem);
10081+ if (rc) {
10082+ BNX2X_ERR("Cannot check for AER; Received %d when tried to take lock\n",
10083+ rc);
10084+ } else {
10085+ /* If Path is marked by EEH, ignore unload status */
10086+ aer = !!(bnx2x_prev_path_get_entry(bp) &&
10087+ bnx2x_prev_path_get_entry(bp)->aer);
10088+ up(&bnx2x_prev_sem);
10089+ }
10090+
10091+ if (fw == FW_MSG_CODE_DRV_UNLOAD_COMMON || aer) {
1000210092 rc = bnx2x_prev_unload_common(bp);
1000310093 break;
1000410094 }
@@ -10038,8 +10128,12 @@ static void bnx2x_get_common_hwinfo(struct bnx2x *bp) · 33 unmodified lines
1003810128 id = ((val & 0xffff) << 16);
1003910129 val = REG_RD(bp, MISC_REG_CHIP_REV);
1004010130 id |= ((val & 0xf) << 12);
10041− val = REG_RD(bp, MISC_REG_CHIP_METAL);
10042− id |= ((val & 0xff) << 4);
10131+
10132+ /* Metal is read from PCI regs, but we can't access >=0x400 from
10133+ * the configuration space (so we need to reg_rd)
10134+ */
10135+ val = REG_RD(bp, PCICFG_OFFSET + PCI_ID_VAL3);
10136+ id |= (((val >> 24) & 0xf) << 4);
1004310137 val = REG_RD(bp, MISC_REG_BOND_ID);
1004410138 id |= (val & 0xf);
1004510139 bp->common.chip_id = id;
@@ -10575,10 +10669,12 @@ static void bnx2x_get_port_hwinfo(struct bnx2x *bp) · 529 unmodified lines
1057510669
1057610670 bp->link_params.speed_cap_mask[0] =
1057710671 SHMEM_RD(bp,
10578− dev_info.port_hw_config[port].speed_capability_mask);
10672+ dev_info.port_hw_config[port].speed_capability_mask) &
10673+ PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK;
1057910674 bp->link_params.speed_cap_mask[1] =
1058010675 SHMEM_RD(bp,
10581− dev_info.port_hw_config[port].speed_capability_mask2);
10676+ dev_info.port_hw_config[port].speed_capability_mask2) &
10677+ PORT_HW_CFG_SPEED_CAPABILITY_D0_MASK;
1058210678 bp->port.link_config[0] =
1058310679 SHMEM_RD(bp, dev_info.port_feature_config[port].link_config);
1058410680
@@ -10703,6 +10799,12 @@ static void bnx2x_get_fcoe_info(struct bnx2x *bp) · 118 unmodified lines
1070310799 (max_fcoe_conn & BNX2X_MAX_FCOE_INIT_CONN_MASK) >>
1070410800 BNX2X_MAX_FCOE_INIT_CONN_SHIFT;
1070510801
10802+ /* Calculate the number of maximum allowed FCoE tasks */
10803+ bp->cnic_eth_dev.max_fcoe_exchanges = MAX_NUM_FCOE_TASKS_PER_ENGINE;
10804+ if (IS_MF(bp) || CHIP_MODE_IS_4_PORT(bp))
10805+ bp->cnic_eth_dev.max_fcoe_exchanges /=
10806+ MAX_FCOE_FUNCS_PER_ENGINE;
10807+
1070610808 /* Read the WWN: */
1070710809 if (!IS_MF(bp)) {
1070810810 /* Port info */
@@ -10816,14 +10918,12 @@ static void bnx2x_get_cnic_mac_hwinfo(struct bnx2x *bp) · 107 unmodified lines
1081610918 }
1081710919 }
1081810920
10819− if (IS_MF_STORAGE_SD(bp))
10820− /* Zero primary MAC configuration */
10821− memset(bp->dev->dev_addr, 0, ETH_ALEN);
10822−
10823− if (IS_MF_FCOE_AFEX(bp) || IS_MF_FCOE_SD(bp))
10824− /* use FIP MAC as primary MAC */
10921+ /* If this is a storage-only interface, use SAN mac as
10922+ * primary MAC. Notice that for SD this is already the case,
10923+ * as the SAN mac was copied from the primary MAC.
10924+ */
10925+ if (IS_MF_FCOE_AFEX(bp))
1082510926 memcpy(bp->dev->dev_addr, fip_mac, ETH_ALEN);
10826−
1082710927 } else {
1082810928 val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].
1082910929 iscsi_mac_upper);
@@ -11060,6 +11160,9 @@ static int bnx2x_get_hwinfo(struct bnx2x *bp) · 230 unmodified lines
1106011160 } else
1106111161 BNX2X_DEV_INFO("illegal OV for SD\n");
1106211162 break;
11163+ case SHARED_FEAT_CFG_FORCE_SF_MODE_FORCED_SF:
11164+ bp->mf_config[vn] = 0;
11165+ break;
1106311166 default:
1106411167 /* Unknown configuration: reset mf_config */
1106511168 bp->mf_config[vn] = 0;
@@ -11406,26 +11509,6 @@ static int bnx2x_init_bp(struct bnx2x *bp) · 340 unmodified lines
1140611509 * net_device service functions
1140711510 */
1140811511
11409−static int bnx2x_open_epilog(struct bnx2x *bp)
11410−{
11411− /* Enable sriov via delayed work. This must be done via delayed work
11412− * because it causes the probe of the vf devices to be run, which invoke
11413− * register_netdevice which must have rtnl lock taken. As we are holding
11414− * the lock right now, that could only work if the probe would not take
11415− * the lock. However, as the probe of the vf may be called from other
11416− * contexts as well (such as passthrough to vm failes) it can't assume
11417− * the lock is being held for it. Using delayed work here allows the
11418− * probe code to simply take the lock (i.e. wait for it to be released
11419− * if it is being held).
11420− */
11421− smp_mb__before_clear_bit();
11422− set_bit(BNX2X_SP_RTNL_ENABLE_SRIOV, &bp->sp_rtnl_state);
11423− smp_mb__after_clear_bit();
11424− schedule_delayed_work(&bp->sp_rtnl_task, 0);
11425−
11426− return 0;
11427−}
11428−
1142911512 /* called with rtnl_lock */
1143011513 static int bnx2x_open(struct net_device *dev)
1143111514 {
@@ -11795,6 +11878,8 @@ static const struct net_device_ops bnx2x_netdev_ops = { · 363 unmodified lines
1179511878 .ndo_setup_tc = bnx2x_setup_tc,
1179611879 #ifdef CONFIG_BNX2X_SRIOV
1179711880 .ndo_set_vf_mac = bnx2x_set_vf_mac,
11881+ .ndo_set_vf_vlan = bnx2x_set_vf_vlan,
11882+ .ndo_get_vf_config = bnx2x_get_vf_config,
1179811883 #endif
1179911884 #ifdef NETDEV_FCOE_WWNN
1180011885 .ndo_fcoe_get_wwn = bnx2x_fcoe_get_wwn,
@@ -11957,19 +12042,26 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev, · 156 unmodified lines
1195712042 dev->watchdog_timeo = TX_TIMEOUT;
1195812043
1195912044 dev->netdev_ops = &bnx2x_netdev_ops;
11960− bnx2x_set_ethtool_ops(dev);
12045+ bnx2x_set_ethtool_ops(bp, dev);
1196112046
1196212047 dev->priv_flags |= IFF_UNICAST_FLT;
1196312048
1196412049 dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1196512050 NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 |
1196612051 NETIF_F_RXCSUM | NETIF_F_LRO | NETIF_F_GRO |
11967− NETIF_F_RXHASH | NETIF_F_HW_VLAN_TX;
12052+ NETIF_F_RXHASH | NETIF_F_HW_VLAN_CTAG_TX;
12053+ if (!CHIP_IS_E1x(bp)) {
12054+ dev->hw_features |= NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL;
12055+ dev->hw_enc_features =
12056+ NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_SG |
12057+ NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 |
12058+ NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL;
12059+ }
1196812060
1196912061 dev->vlan_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1197012062 NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA;
1197112063
11972− dev->features |= dev->hw_features | NETIF_F_HW_VLAN_RX;
12064+ dev->features |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX;
1197312065 if (bp->flags & USING_DAC_FLAG)
1197412066 dev->features |= NETIF_F_HIGHDMA;
1197512067
@@ -12451,7 +12543,7 @@ static int bnx2x_init_one(struct pci_dev *pdev, · 475 unmodified lines
1245112543 * l2 connections.
1245212544 */
1245312545 if (IS_VF(bp)) {
12454− bnx2x_vf_map_doorbells(bp);
12546+ bp->doorbells = bnx2x_vf_doorbells(bp);
1245512547 rc = bnx2x_vf_pci_alloc(bp);
1245612548 if (rc)
1245712549 goto init_one_exit;
@@ -12479,13 +12571,8 @@ static int bnx2x_init_one(struct pci_dev *pdev, · 21 unmodified lines
1247912571 goto init_one_exit;
1248012572 }
1248112573
12482− /* Enable SRIOV if capability found in configuration space.
12483− * Once the generic SR-IOV framework makes it in from the
12484− * pci tree this will be revised, to allow dynamic control
12485− * over the number of VFs. Right now, change the num of vfs
12486− * param below to enable SR-IOV.
12487− */
12488− rc = bnx2x_iov_init_one(bp, int_mode, 0/*num vfs*/);
12574+ /* Enable SRIOV if capability found in configuration space */
12575+ rc = bnx2x_iov_init_one(bp, int_mode, BNX2X_MAX_NUM_OF_VFS);
1248912576 if (rc)
1249012577 goto init_one_exit;
1249112578
@@ -12497,16 +12584,6 @@ static int bnx2x_init_one(struct pci_dev *pdev, · 5 unmodified lines
1249712584 if (CHIP_IS_E1x(bp))
1249812585 bp->flags |= NO_FCOE_FLAG;
1249912586
12500− /* disable FCOE for 57840 device, until FW supports it */
12501− switch (ent->driver_data) {
12502− case BCM57840_O:
12503− case BCM57840_4_10:
12504− case BCM57840_2_20:
12505− case BCM57840_MFO:
12506− case BCM57840_MF:
12507− bp->flags |= NO_FCOE_FLAG;
12508− }
12509−
1251012587 /* Set bp->num_queues for MSI-X mode*/
1251112588 bnx2x_set_num_queues(bp);
1251212589
@@ -12640,9 +12717,7 @@ static void bnx2x_remove_one(struct pci_dev *pdev) · 127 unmodified lines
1264012717
1264112718 static int bnx2x_eeh_nic_unload(struct bnx2x *bp)
1264212719 {
12643− int i;
12644−
12645− bp->state = BNX2X_STATE_ERROR;
12720+ bp->state = BNX2X_STATE_CLOSING_WAIT4_HALT;
1264612721
1264712722 bp->rx_mode = BNX2X_RX_MODE_NONE;
1264812723
@@ -12651,29 +12726,21 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) · 2 unmodified lines
1265112726
1265212727 /* Stop Tx */
1265312728 bnx2x_tx_disable(bp);
12654−
12655− bnx2x_netif_stop(bp, 0);
1265612729 /* Delete all NAPI objects */
1265712730 bnx2x_del_all_napi(bp);
1265812731 if (CNIC_LOADED(bp))
1265912732 bnx2x_del_all_napi_cnic(bp);
12733+ netdev_reset_tc(bp->dev);
1266012734
1266112735 del_timer_sync(&bp->timer);
12736+ cancel_delayed_work(&bp->sp_task);
12737+ cancel_delayed_work(&bp->period_task);
1266212738
12663− bnx2x_stats_handle(bp, STATS_EVENT_STOP);
12664−
12665− /* Release IRQs */
12666− bnx2x_free_irq(bp);
12667−
12668− /* Free SKBs, SGEs, TPA pool and driver internals */
12669− bnx2x_free_skbs(bp);
12670−
12671− for_each_rx_queue(bp, i)
12672− bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE);
12673−
12674− bnx2x_free_mem(bp);
12739+ spin_lock_bh(&bp->stats_lock);
12740+ bp->stats_state = STATS_STATE_DISABLED;
12741+ spin_unlock_bh(&bp->stats_lock);
1267512742
12676− bp->state = BNX2X_STATE_CLOSED;
12743+ bnx2x_save_statistics(bp);
1267712744
1267812745 netif_carrier_off(bp->dev);
1267912746
@@ -12709,6 +12776,8 @@ static pci_ers_result_t bnx2x_io_error_detected(struct pci_dev *pdev, · 29 unmodified lines
1270912776
1271012777 rtnl_lock();
1271112778
12779+ BNX2X_ERR("IO error detected\n");
12780+
1271212781 netif_device_detach(dev);
1271312782
1271412783 if (state == pci_channel_io_perm_failure) {
@@ -12719,6 +12788,8 @@ static pci_ers_result_t bnx2x_io_error_detected(struct pci_dev *pdev, · 4 unmodified lines
1271912788 if (netif_running(dev))
1272012789 bnx2x_eeh_nic_unload(bp);
1272112790
12791+ bnx2x_prev_path_mark_eeh(bp);
12792+
1272212793 pci_disable_device(pdev);
1272312794
1272412795 rtnl_unlock();
@@ -12737,9 +12808,10 @@ static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev) · 12 unmodified lines
1273712808 {
1273812809 struct net_device *dev = pci_get_drvdata(pdev);
1273912810 struct bnx2x *bp = netdev_priv(dev);
12811+ int i;
1274012812
1274112813 rtnl_lock();
12742−
12814+ BNX2X_ERR("IO slot reset initializing...\n");
1274312815 if (pci_enable_device(pdev)) {
1274412816 dev_err(&pdev->dev,
1274512817 "Cannot re-enable PCI device after reset\n");
@@ -12749,10 +12821,47 @@ static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev) · 3 unmodified lines
1274912821
1275012822 pci_set_master(pdev);
1275112823 pci_restore_state(pdev);
12824+ pci_save_state(pdev);
1275212825
1275312826 if (netif_running(dev))
1275412827 bnx2x_set_power_state(bp, PCI_D0);
1275512828
12829+ if (netif_running(dev)) {
12830+ BNX2X_ERR("IO slot reset --> driver unload\n");
12831+ if (IS_PF(bp) && SHMEM2_HAS(bp, drv_capabilities_flag)) {
12832+ u32 v;
12833+
12834+ v = SHMEM2_RD(bp,
12835+ drv_capabilities_flag[BP_FW_MB_IDX(bp)]);
12836+ SHMEM2_WR(bp, drv_capabilities_flag[BP_FW_MB_IDX(bp)],
12837+ v & ~DRV_FLAGS_CAPABILITIES_LOADED_L2);
12838+ }
12839+ bnx2x_drain_tx_queues(bp);
12840+ bnx2x_send_unload_req(bp, UNLOAD_RECOVERY);
12841+ bnx2x_netif_stop(bp, 1);
12842+ bnx2x_free_irq(bp);
12843+
12844+ /* Report UNLOAD_DONE to MCP */
12845+ bnx2x_send_unload_done(bp, true);
12846+
12847+ bp->sp_state = 0;
12848+ bp->port.pmf = 0;
12849+
12850+ bnx2x_prev_unload(bp);
12851+
12852+ /* We should have resetted the engine, so It's fair to
12853+ * assume the FW will no longer write to the bnx2x driver.
12854+ */
12855+ bnx2x_squeeze_objects(bp);
12856+ bnx2x_free_skbs(bp);
12857+ for_each_rx_queue(bp, i)
12858+ bnx2x_free_rx_sge_range(bp, bp->fp + i, NUM_RX_SGE);
12859+ bnx2x_free_fp_mem(bp);
12860+ bnx2x_free_mem(bp);
12861+
12862+ bp->state = BNX2X_STATE_CLOSED;
12863+ }
12864+
1275612865 rtnl_unlock();
1275712866
1275812867 return PCI_ERS_RESULT_RECOVERED;
@@ -12779,6 +12888,9 @@ static void bnx2x_io_resume(struct pci_dev *pdev) · 20 unmodified lines
1277912888
1278012889 bnx2x_eeh_recover(bp);
1278112890
12891+ bp->fw_seq = SHMEM_RD(bp, func_mb[BP_FW_MB_IDX(bp)].drv_mb_header) &
12892+ DRV_MSG_SEQ_NUMBER_MASK;
12893+
1278212894 if (netif_running(dev))
1278312895 bnx2x_nic_load(bp, LOAD_NORMAL);
1278412896
@@ -12801,6 +12913,9 @@ static struct pci_driver bnx2x_pci_driver = { · 16 unmodified lines
1280112913 .suspend = bnx2x_suspend,
1280212914 .resume = bnx2x_resume,
1280312915 .err_handler = &bnx2x_err_handler,
12916+#ifdef CONFIG_BNX2X_SRIOV
12917+ .sriov_configure = bnx2x_sriov_configure,
12918+#endif
1280412919 };
1280512920
1280612921 static int __init bnx2x_init(void)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h+2−4
@@ -1491,10 +1491,6 @@ · 1490 unmodified lines
14911491 /* [R 4] This field indicates the type of the device. '0' - 2 Ports; '1' - 1
14921492 Port. */
14931493 #define MISC_REG_BOND_ID 0xa400
1494−/* [R 8] These bits indicate the metal revision of the chip. This value
1495− starts at 0x00 for each all-layer tape-out and increments by one for each
1496− tape-out. */
1497−#define MISC_REG_CHIP_METAL 0xa404
14981494 /* [R 16] These bits indicate the part number for the chip. */
14991495 #define MISC_REG_CHIP_NUM 0xa408
15001496 /* [R 4] These bits indicate the base revision of the chip. This value
@@ -6331,6 +6327,8 @@ · 4830 unmodified lines
63316327 #define PCI_PM_DATA_B 0x414
63326328 #define PCI_ID_VAL1 0x434
63336329 #define PCI_ID_VAL2 0x438
6330+#define PCI_ID_VAL3 0x43c
6331+
63346332 #define GRC_CONFIG_REG_PF_INIT_VF 0x624
63356333 #define GRC_CR_PF_INIT_VF_PF_FIRST_VF_NUM_MASK 0xf
63366334 /* First VF_NUM for PF is encoded in this register.
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c+46−33
@@ -30,8 +30,6 @@ · 29 unmodified lines
3030
3131 #define BNX2X_MAX_EMUL_MULTI 16
3232
33−#define MAC_LEADING_ZERO_CNT (ALIGN(ETH_ALEN, sizeof(u32)) - ETH_ALEN)
34−
3533 /**** Exe Queue interfaces ****/
3634
3735 /**
@@ -444,30 +442,21 @@ static bool bnx2x_put_credit_vlan_mac(struct bnx2x_vlan_mac_obj *o) · 406 unmodified lines
444442 }
445443
446444 static int bnx2x_get_n_elements(struct bnx2x *bp, struct bnx2x_vlan_mac_obj *o,
447− int n, u8 *buf)
445+ int n, u8 *base, u8 stride, u8 size)
448446 {
449447 struct bnx2x_vlan_mac_registry_elem *pos;
450− u8 *next = buf;
448+ u8 *next = base;
451449 int counter = 0;
452450
453451 /* traverse list */
454452 list_for_each_entry(pos, &o->head, link) {
455453 if (counter < n) {
456− /* place leading zeroes in buffer */
457− memset(next, 0, MAC_LEADING_ZERO_CNT);
458−
459− /* place mac after leading zeroes*/
460− memcpy(next + MAC_LEADING_ZERO_CNT, pos->u.mac.mac,
461− ETH_ALEN);
462−
463− /* calculate address of next element and
464− * advance counter
465− */
454+ memcpy(next, &pos->u, size);
466455 counter++;
467− next = buf + counter * ALIGN(ETH_ALEN, sizeof(u32));
456+ DP(BNX2X_MSG_SP, "copied element number %d to address %p element was:\n",
457+ counter, next);
458+ next += stride + size;
468459
469− DP(BNX2X_MSG_SP, "copied element number %d to address %p element was %pM\n",
470− counter, next, pos->u.mac.mac);
471460 }
472461 }
473462 return counter * ETH_ALEN;
@@ -487,7 +476,8 @@ static int bnx2x_check_mac_add(struct bnx2x *bp, · 13 unmodified lines
487476
488477 /* Check if a requested MAC already exists */
489478 list_for_each_entry(pos, &o->head, link)
490− if (!memcmp(data->mac.mac, pos->u.mac.mac, ETH_ALEN))
479+ if (!memcmp(data->mac.mac, pos->u.mac.mac, ETH_ALEN) &&
480+ (data->mac.is_inner_mac == pos->u.mac.is_inner_mac))
491481 return -EEXIST;
492482
493483 return 0;
@@ -520,7 +510,9 @@ static int bnx2x_check_vlan_mac_add(struct bnx2x *bp, · 26 unmodified lines
520510 list_for_each_entry(pos, &o->head, link)
521511 if ((data->vlan_mac.vlan == pos->u.vlan_mac.vlan) &&
522512 (!memcmp(data->vlan_mac.mac, pos->u.vlan_mac.mac,
523− ETH_ALEN)))
513+ ETH_ALEN)) &&
514+ (data->vlan_mac.is_inner_mac ==
515+ pos->u.vlan_mac.is_inner_mac))
524516 return -EEXIST;
525517
526518 return 0;
@@ -538,7 +530,8 @@ static struct bnx2x_vlan_mac_registry_elem * · 11 unmodified lines
538530 DP(BNX2X_MSG_SP, "Checking MAC %pM for DEL command\n", data->mac.mac);
539531
540532 list_for_each_entry(pos, &o->head, link)
541− if (!memcmp(data->mac.mac, pos->u.mac.mac, ETH_ALEN))
533+ if ((!memcmp(data->mac.mac, pos->u.mac.mac, ETH_ALEN)) &&
534+ (data->mac.is_inner_mac == pos->u.mac.is_inner_mac))
542535 return pos;
543536
544537 return NULL;
@@ -573,7 +566,9 @@ static struct bnx2x_vlan_mac_registry_elem * · 28 unmodified lines
573566 list_for_each_entry(pos, &o->head, link)
574567 if ((data->vlan_mac.vlan == pos->u.vlan_mac.vlan) &&
575568 (!memcmp(data->vlan_mac.mac, pos->u.vlan_mac.mac,
576− ETH_ALEN)))
569+ ETH_ALEN)) &&
570+ (data->vlan_mac.is_inner_mac ==
571+ pos->u.vlan_mac.is_inner_mac))
577572 return pos;
578573
579574 return NULL;
@@ -770,6 +765,8 @@ static void bnx2x_set_one_mac_e2(struct bnx2x *bp, · 190 unmodified lines
770765 bnx2x_set_fw_mac_addr(&rule_entry->mac.mac_msb,
771766 &rule_entry->mac.mac_mid,
772767 &rule_entry->mac.mac_lsb, mac);
768+ rule_entry->mac.inner_mac =
769+ cpu_to_le16(elem->cmd_data.vlan_mac.u.mac.is_inner_mac);
773770
774771 /* MOVE: Add a rule that will add this MAC to the target Queue */
775772 if (cmd == BNX2X_VLAN_MAC_MOVE) {
@@ -786,6 +783,9 @@ static void bnx2x_set_one_mac_e2(struct bnx2x *bp, · 10 unmodified lines
786783 bnx2x_set_fw_mac_addr(&rule_entry->mac.mac_msb,
787784 &rule_entry->mac.mac_mid,
788785 &rule_entry->mac.mac_lsb, mac);
786+ rule_entry->mac.inner_mac =
787+ cpu_to_le16(elem->cmd_data.vlan_mac.
788+ u.mac.is_inner_mac);
789789 }
790790
791791 /* Set the ramrod data header */
@@ -974,7 +974,8 @@ static void bnx2x_set_one_vlan_mac_e2(struct bnx2x *bp, · 182 unmodified lines
974974 bnx2x_set_fw_mac_addr(&rule_entry->pair.mac_msb,
975975 &rule_entry->pair.mac_mid,
976976 &rule_entry->pair.mac_lsb, mac);
977−
977+ rule_entry->pair.inner_mac =
978+ cpu_to_le16(elem->cmd_data.vlan_mac.u.vlan_mac.is_inner_mac);
978979 /* MOVE: Add a rule that will add this MAC to the target Queue */
979980 if (cmd == BNX2X_VLAN_MAC_MOVE) {
980981 rule_entry++;
@@ -991,6 +992,9 @@ static void bnx2x_set_one_vlan_mac_e2(struct bnx2x *bp, · 10 unmodified lines
991992 bnx2x_set_fw_mac_addr(&rule_entry->pair.mac_msb,
992993 &rule_entry->pair.mac_mid,
993994 &rule_entry->pair.mac_lsb, mac);
995+ rule_entry->pair.inner_mac =
996+ cpu_to_le16(elem->cmd_data.vlan_mac.u.
997+ vlan_mac.is_inner_mac);
994998 }
995999
9961000 /* Set the ramrod data header */
@@ -1854,6 +1858,7 @@ static int bnx2x_vlan_mac_del_all(struct bnx2x *bp, · 857 unmodified lines
18541858 return rc;
18551859 }
18561860 list_del(&exeq_pos->link);
1861+ bnx2x_exe_queue_free_elem(bp, exeq_pos);
18571862 }
18581863 }
18591864
@@ -2012,6 +2017,7 @@ void bnx2x_init_vlan_obj(struct bnx2x *bp, · 152 unmodified lines
20122017 vlan_obj->check_move = bnx2x_check_move;
20132018 vlan_obj->ramrod_cmd =
20142019 RAMROD_CMD_ID_ETH_CLASSIFICATION_RULES;
2020+ vlan_obj->get_n_elements = bnx2x_get_n_elements;
20152021
20162022 /* Exe Queue */
20172023 bnx2x_exe_queue_init(bp,
@@ -4426,6 +4432,12 @@ static void bnx2x_q_fill_init_tx_data(struct bnx2x_queue_sp_obj *o, · 2408 unmodified lines
44264432 tx_data->force_default_pri_flg =
44274433 test_bit(BNX2X_Q_FLG_FORCE_DEFAULT_PRI, flags);
44284434
4435+ tx_data->tunnel_lso_inc_ip_id =
4436+ test_bit(BNX2X_Q_FLG_TUN_INC_INNER_IP_ID, flags);
4437+ tx_data->tunnel_non_lso_pcsum_location =
4438+ test_bit(BNX2X_Q_FLG_PCSUM_ON_PKT, flags) ? PCSUM_ON_PKT :
4439+ PCSUM_ON_BD;
4440+
44294441 tx_data->tx_status_block_id = params->fw_sb_id;
44304442 tx_data->tx_sb_index_number = params->sb_cq_index;
44314443 tx_data->tss_leading_client_id = params->tss_leading_cl_id;
@@ -5669,17 +5681,18 @@ static inline int bnx2x_func_send_start(struct bnx2x *bp, · 1237 unmodified lines
56695681 memset(rdata, 0, sizeof(*rdata));
56705682
56715683 /* Fill the ramrod data with provided parameters */
5672− rdata->function_mode = (u8)start_params->mf_mode;
5673− rdata->sd_vlan_tag = cpu_to_le16(start_params->sd_vlan_tag);
5674− rdata->path_id = BP_PATH(bp);
5675− rdata->network_cos_mode = start_params->network_cos_mode;
5676−
5677− /*
5678− * No need for an explicit memory barrier here as long we would
5679− * need to ensure the ordering of writing to the SPQ element
5680− * and updating of the SPQ producer which involves a memory
5681− * read and we will have to put a full memory barrier there
5682− * (inside bnx2x_sp_post()).
5684+ rdata->function_mode = (u8)start_params->mf_mode;
5685+ rdata->sd_vlan_tag = cpu_to_le16(start_params->sd_vlan_tag);
5686+ rdata->path_id = BP_PATH(bp);
5687+ rdata->network_cos_mode = start_params->network_cos_mode;
5688+ rdata->gre_tunnel_mode = start_params->gre_tunnel_mode;
5689+ rdata->gre_tunnel_rss = start_params->gre_tunnel_rss;
5690+
5691+ /* No need for an explicit memory barrier here as long we would
5692+ * need to ensure the ordering of writing to the SPQ element
5693+ * and updating of the SPQ producer which involves a memory
5694+ * read and we will have to put a full memory barrier there
5695+ * (inside bnx2x_sp_post()).
56835696 */
56845697
56855698 return bnx2x_sp_post(bp, RAMROD_CMD_ID_COMMON_FUNCTION_START, 0,
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.h+18−3
@@ -100,6 +100,7 @@ struct bnx2x_raw_obj { · 99 unmodified lines
100100 /************************* VLAN-MAC commands related parameters ***************/
101101 struct bnx2x_mac_ramrod_data {
102102 u8 mac[ETH_ALEN];
103+ u8 is_inner_mac;
103104 };
104105
105106 struct bnx2x_vlan_ramrod_data {
@@ -108,6 +109,7 @@ struct bnx2x_vlan_ramrod_data { · 2 unmodified lines
108109
109110 struct bnx2x_vlan_mac_ramrod_data {
110111 u8 mac[ETH_ALEN];
112+ u8 is_inner_mac;
111113 u16 vlan;
112114 };
113115
@@ -313,8 +315,9 @@ struct bnx2x_vlan_mac_obj { · 199 unmodified lines
313315 *
314316 * @return number of copied bytes
315317 */
316− int (*get_n_elements)(struct bnx2x *bp, struct bnx2x_vlan_mac_obj *o,
317− int n, u8 *buf);
318+ int (*get_n_elements)(struct bnx2x *bp,
319+ struct bnx2x_vlan_mac_obj *o, int n, u8 *base,
320+ u8 stride, u8 size);
318321
319322 /**
320323 * Checks if ADD-ramrod with the given params may be performed.
@@ -824,7 +827,9 @@ enum { · 503 unmodified lines
824827 BNX2X_Q_FLG_TX_SEC,
825828 BNX2X_Q_FLG_ANTI_SPOOF,
826829 BNX2X_Q_FLG_SILENT_VLAN_REM,
827− BNX2X_Q_FLG_FORCE_DEFAULT_PRI
830+ BNX2X_Q_FLG_FORCE_DEFAULT_PRI,
831+ BNX2X_Q_FLG_PCSUM_ON_PKT,
832+ BNX2X_Q_FLG_TUN_INC_INNER_IP_ID
828833 };
829834
830835 /* Queue type options: queue type may be a compination of below. */
@@ -842,6 +847,7 @@ enum bnx2x_q_type { · 11 unmodified lines
842847 #define BNX2X_MULTI_TX_COS_E3B0 3
843848 #define BNX2X_MULTI_TX_COS 3 /* Maximum possible */
844849
850+#define MAC_PAD (ALIGN(ETH_ALEN, sizeof(u32)) - ETH_ALEN)
845851
846852 struct bnx2x_queue_init_params {
847853 struct {
@@ -1118,6 +1124,15 @@ struct bnx2x_func_start_params { · 270 unmodified lines
11181124
11191125 /* Function cos mode */
11201126 u8 network_cos_mode;
1127+
1128+ /* NVGRE classification enablement */
1129+ u8 nvgre_clss_en;
1130+
1131+ /* NO_GRE_TUNNEL/NVGRE_TUNNEL/L2GRE_TUNNEL/IPGRE_TUNNEL */
1132+ u8 gre_tunnel_mode;
1133+
1134+ /* GRE_OUTER_HEADERS_RSS/GRE_INNER_HEADERS_RSS/NVGRE_KEY_ENTROPY_RSS */
1135+ u8 gre_tunnel_rss;
11211136 };
11221137
11231138 struct bnx2x_func_switch_update_params {
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c+311−40
@@ -20,7 +20,9 @@ · 19 unmodified lines
2020 #include "bnx2x.h"
2121 #include "bnx2x_init.h"
2222 #include "bnx2x_cmn.h"
23+#include "bnx2x_sp.h"
2324 #include <linux/crc32.h>
25+#include <linux/if_vlan.h>
2426
2527 /* General service functions */
2628 static void storm_memset_vf_to_pf(struct bnx2x *bp, u16 abs_fid,
@@ -555,8 +557,7 @@ static int bnx2x_vfop_config_list(struct bnx2x *bp, · 528 unmodified lines
555557 rc = bnx2x_config_vlan_mac(bp, vlan_mac);
556558 if (rc >= 0) {
557559 cnt += pos->add ? 1 : -1;
558− list_del(&pos->link);
559− list_add(&pos->link, &rollback_list);
560+ list_move(&pos->link, &rollback_list);
560561 rc = 0;
561562 } else if (rc == -EEXIST) {
562563 rc = 0;
@@ -958,6 +959,12 @@ op_err: · 395 unmodified lines
958959 BNX2X_ERR("QSETUP[%d:%d] error: rc %d\n", vf->abs_vfid, qid, vfop->rc);
959960 op_done:
960961 case BNX2X_VFOP_QSETUP_DONE:
962+ vf->cfg_flags |= VF_CFG_VLAN;
963+ smp_mb__before_clear_bit();
964+ set_bit(BNX2X_SP_RTNL_HYPERVISOR_VLAN,
965+ &bp->sp_rtnl_state);
966+ smp_mb__after_clear_bit();
967+ schedule_delayed_work(&bp->sp_rtnl_task, 0);
961968 bnx2x_vfop_end(bp, vf, vfop);
962969 return;
963970 default:
@@ -1459,7 +1466,6 @@ static u8 bnx2x_vf_is_pcie_pending(struct bnx2x *bp, u8 abs_vfid) · 495 unmodified lines
14591466 return bnx2x_is_pcie_pending(dev);
14601467
14611468 unknown_dev:
1462− BNX2X_ERR("Unknown device\n");
14631469 return false;
14641470 }
14651471
@@ -1926,20 +1932,22 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, · 460 unmodified lines
19261932
19271933 /* SRIOV can be enabled only with MSIX */
19281934 if (int_mode_param == BNX2X_INT_MODE_MSI ||
1929− int_mode_param == BNX2X_INT_MODE_INTX)
1935+ int_mode_param == BNX2X_INT_MODE_INTX) {
19301936 BNX2X_ERR("Forced MSI/INTx mode is incompatible with SRIOV\n");
1937+ return 0;
1938+ }
19311939
19321940 err = -EIO;
19331941 /* verify ari is enabled */
19341942 if (!bnx2x_ari_enabled(bp->pdev)) {
1935− BNX2X_ERR("ARI not supported, SRIOV can not be enabled\n");
1936− return err;
1943+ BNX2X_ERR("ARI not supported (check pci bridge ARI forwarding), SRIOV can not be enabled\n");
1944+ return 0;
19371945 }
19381946
19391947 /* verify igu is in normal mode */
19401948 if (CHIP_INT_MODE_IS_BC(bp)) {
19411949 BNX2X_ERR("IGU not normal mode, SRIOV can not be enabled\n");
1942− return err;
1950+ return 0;
19431951 }
19441952
19451953 /* allocate the vfs database */
@@ -1964,8 +1972,10 @@ int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param, · 18 unmodified lines
19641972 if (iov->total == 0)
19651973 goto failed;
19661974
1967− /* calculate the actual number of VFs */
1968− iov->nr_virtfn = min_t(u16, iov->total, (u16)num_vfs_param);
1975+ iov->nr_virtfn = min_t(u16, iov->total, num_vfs_param);
1976+
1977+ DP(BNX2X_MSG_IOV, "num_vfs_param was %d, nr_virtfn was %d\n",
1978+ num_vfs_param, iov->nr_virtfn);
19691979
19701980 /* allocate the vf array */
19711981 bp->vfdb->vfs = kzalloc(sizeof(struct bnx2x_virtf) *
@@ -2378,8 +2388,8 @@ int bnx2x_iov_eq_sp_event(struct bnx2x *bp, union event_ring_elem *elem) · 406 unmodified lines
23782388 goto get_vf;
23792389 case EVENT_RING_OPCODE_MALICIOUS_VF:
23802390 abs_vfid = elem->message.data.malicious_vf_event.vf_id;
2381− DP(BNX2X_MSG_IOV, "Got VF MALICIOUS notification abs_vfid=%d\n",
2382− abs_vfid);
2391+ DP(BNX2X_MSG_IOV, "Got VF MALICIOUS notification abs_vfid=%d err_id=0x%x\n",
2392+ abs_vfid, elem->message.data.malicious_vf_event.err_id);
23832393 goto get_vf;
23842394 default:
23852395 return 1;
@@ -2436,8 +2446,8 @@ get_vf: · 50 unmodified lines
24362446 /* Do nothing for now */
24372447 break;
24382448 case EVENT_RING_OPCODE_MALICIOUS_VF:
2439− DP(BNX2X_MSG_IOV, "got VF [%d] MALICIOUS notification\n",
2440− vf->abs_vfid);
2449+ DP(BNX2X_MSG_IOV, "Got VF MALICIOUS notification abs_vfid=%d error id %x\n",
2450+ abs_vfid, elem->message.data.malicious_vf_event.err_id);
24412451 /* Do nothing for now */
24422452 break;
24432453 }
@@ -3012,21 +3022,138 @@ void bnx2x_unlock_vf_pf_channel(struct bnx2x *bp, struct bnx2x_virtf *vf, · 568 unmodified lines
30123022 vf->op_current = CHANNEL_TLV_NONE;
30133023 }
30143024
3015−void bnx2x_enable_sriov(struct bnx2x *bp)
3025+int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs_param)
30163026 {
3017− int rc = 0;
30183027
3019− /* disbale sriov in case it is still enabled */
3028+ struct bnx2x *bp = netdev_priv(pci_get_drvdata(dev));
3029+
3030+ DP(BNX2X_MSG_IOV, "bnx2x_sriov_configure called with %d, BNX2X_NR_VIRTFN(bp) was %d\n",
3031+ num_vfs_param, BNX2X_NR_VIRTFN(bp));
3032+
3033+ /* HW channel is only operational when PF is up */
3034+ if (bp->state != BNX2X_STATE_OPEN) {
3035+ BNX2X_ERR("VF num configurtion via sysfs not supported while PF is down");
3036+ return -EINVAL;
3037+ }
3038+
3039+ /* we are always bound by the total_vfs in the configuration space */
3040+ if (num_vfs_param > BNX2X_NR_VIRTFN(bp)) {
3041+ BNX2X_ERR("truncating requested number of VFs (%d) down to maximum allowed (%d)\n",
3042+ num_vfs_param, BNX2X_NR_VIRTFN(bp));
3043+ num_vfs_param = BNX2X_NR_VIRTFN(bp);
3044+ }
3045+
3046+ bp->requested_nr_virtfn = num_vfs_param;
3047+ if (num_vfs_param == 0) {
3048+ pci_disable_sriov(dev);
3049+ return 0;
3050+ } else {
3051+ return bnx2x_enable_sriov(bp);
3052+ }
3053+}
3054+
3055+int bnx2x_enable_sriov(struct bnx2x *bp)
3056+{
3057+ int rc = 0, req_vfs = bp->requested_nr_virtfn;
3058+
3059+ rc = pci_enable_sriov(bp->pdev, req_vfs);
3060+ if (rc) {
3061+ BNX2X_ERR("pci_enable_sriov failed with %d\n", rc);
3062+ return rc;
3063+ }
3064+ DP(BNX2X_MSG_IOV, "sriov enabled (%d vfs)\n", req_vfs);
3065+ return req_vfs;
3066+}
3067+
3068+void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp)
3069+{
3070+ int vfidx;
3071+ struct pf_vf_bulletin_content *bulletin;
3072+
3073+ DP(BNX2X_MSG_IOV, "configuring vlan for VFs from sp-task\n");
3074+ for_each_vf(bp, vfidx) {
3075+ bulletin = BP_VF_BULLETIN(bp, vfidx);
3076+ if (BP_VF(bp, vfidx)->cfg_flags & VF_CFG_VLAN)
3077+ bnx2x_set_vf_vlan(bp->dev, vfidx, bulletin->vlan, 0);
3078+ }
3079+}
3080+
3081+void bnx2x_disable_sriov(struct bnx2x *bp)
3082+{
30203083 pci_disable_sriov(bp->pdev);
3021− DP(BNX2X_MSG_IOV, "sriov disabled\n");
3084+}
3085+
3086+static int bnx2x_vf_ndo_sanity(struct bnx2x *bp, int vfidx,
3087+ struct bnx2x_virtf *vf)
3088+{
3089+ if (!IS_SRIOV(bp)) {
3090+ BNX2X_ERR("vf ndo called though sriov is disabled\n");
3091+ return -EINVAL;
3092+ }
3093+
3094+ if (vfidx >= BNX2X_NR_VIRTFN(bp)) {
3095+ BNX2X_ERR("vf ndo called for uninitialized VF. vfidx was %d BNX2X_NR_VIRTFN was %d\n",
3096+ vfidx, BNX2X_NR_VIRTFN(bp));
3097+ return -EINVAL;
3098+ }
3099+
3100+ if (!vf) {
3101+ BNX2X_ERR("vf ndo called but vf was null. vfidx was %d\n",
3102+ vfidx);
3103+ return -EINVAL;
3104+ }
30223105
3023− /* enable sriov */
3024− DP(BNX2X_MSG_IOV, "vf num (%d)\n", (bp->vfdb->sriov.nr_virtfn));
3025− rc = pci_enable_sriov(bp->pdev, (bp->vfdb->sriov.nr_virtfn));
3106+ return 0;
3107+}
3108+
3109+int bnx2x_get_vf_config(struct net_device *dev, int vfidx,
3110+ struct ifla_vf_info *ivi)
3111+{
3112+ struct bnx2x *bp = netdev_priv(dev);
3113+ struct bnx2x_virtf *vf = BP_VF(bp, vfidx);
3114+ struct bnx2x_vlan_mac_obj *mac_obj = &bnx2x_vfq(vf, 0, mac_obj);
3115+ struct bnx2x_vlan_mac_obj *vlan_obj = &bnx2x_vfq(vf, 0, vlan_obj);
3116+ struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vfidx);
3117+ int rc;
3118+
3119+ /* sanity */
3120+ rc = bnx2x_vf_ndo_sanity(bp, vfidx, vf);
30263121 if (rc)
3027− BNX2X_ERR("pci_enable_sriov failed with %d\n", rc);
3028− else
3029− DP(BNX2X_MSG_IOV, "sriov enabled\n");
3122+ return rc;
3123+ if (!mac_obj || !vlan_obj || !bulletin) {
3124+ BNX2X_ERR("VF partially initialized\n");
3125+ return -EINVAL;
3126+ }
3127+
3128+ ivi->vf = vfidx;
3129+ ivi->qos = 0;
3130+ ivi->tx_rate = 10000; /* always 10G. TBA take from link struct */
3131+ ivi->spoofchk = 1; /*always enabled */
3132+ if (vf->state == VF_ENABLED) {
3133+ /* mac and vlan are in vlan_mac objects */
3134+ mac_obj->get_n_elements(bp, mac_obj, 1, (u8 *)&ivi->mac,
3135+ 0, ETH_ALEN);
3136+ vlan_obj->get_n_elements(bp, vlan_obj, 1, (u8 *)&ivi->vlan,
3137+ 0, VLAN_HLEN);
3138+ } else {
3139+ /* mac */
3140+ if (bulletin->valid_bitmap & (1 << MAC_ADDR_VALID))
3141+ /* mac configured by ndo so its in bulletin board */
3142+ memcpy(&ivi->mac, bulletin->mac, ETH_ALEN);
3143+ else
3144+ /* funtion has not been loaded yet. Show mac as 0s */
3145+ memset(&ivi->mac, 0, ETH_ALEN);
3146+
3147+ /* vlan */
3148+ if (bulletin->valid_bitmap & (1 << VLAN_VALID))
3149+ /* vlan configured by ndo so its in bulletin board */
3150+ memcpy(&ivi->vlan, &bulletin->vlan, VLAN_HLEN);
3151+ else
3152+ /* funtion has not been loaded yet. Show vlans as 0s */
3153+ memset(&ivi->vlan, 0, VLAN_HLEN);
3154+ }
3155+
3156+ return 0;
30303157 }
30313158
30323159 /* New mac for VF. Consider these cases:
@@ -3044,23 +3171,19 @@ void bnx2x_enable_sriov(struct bnx2x *bp) · 11 unmodified lines
30443171 * VF to configure any mac for itself except for this mac. In case of a race
30453172 * where the VF fails to see the new post on its bulletin board before sending a
30463173 * mac configuration request, the PF will simply fail the request and VF can try
3047− * again after consulting its bulletin board
3174+ * again after consulting its bulletin board.
30483175 */
3049−int bnx2x_set_vf_mac(struct net_device *dev, int queue, u8 *mac)
3176+int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac)
30503177 {
30513178 struct bnx2x *bp = netdev_priv(dev);
3052− int rc, q_logical_state, vfidx = queue;
3179+ int rc, q_logical_state;
30533180 struct bnx2x_virtf *vf = BP_VF(bp, vfidx);
30543181 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vfidx);
30553182
3056− /* if SRIOV is disabled there is nothing to do (and somewhere, someone
3057− * has erred).
3058− */
3059− if (!IS_SRIOV(bp)) {
3060− BNX2X_ERR("bnx2x_set_vf_mac called though sriov is disabled\n");
3061− return -EINVAL;
3062− }
3063−
3183+ /* sanity */
3184+ rc = bnx2x_vf_ndo_sanity(bp, vfidx, vf);
3185+ if (rc)
3186+ return rc;
30643187 if (!is_valid_ether_addr(mac)) {
30653188 BNX2X_ERR("mac address invalid\n");
30663189 return -EINVAL;
@@ -3085,7 +3208,7 @@ int bnx2x_set_vf_mac(struct net_device *dev, int queue, u8 *mac) · 18 unmodified lines
30853208 if (vf->state == VF_ENABLED &&
30863209 q_logical_state == BNX2X_Q_LOGICAL_STATE_ACTIVE) {
30873210 /* configure the mac in device on this vf's queue */
3088− unsigned long flags = 0;
3211+ unsigned long ramrod_flags = 0;
30893212 struct bnx2x_vlan_mac_obj *mac_obj = &bnx2x_vfq(vf, 0, mac_obj);
30903213
30913214 /* must lock vfpf channel to protect against vf flows */
@@ -3106,14 +3229,133 @@ int bnx2x_set_vf_mac(struct net_device *dev, int queue, u8 *mac) · 14 unmodified lines
31063229 }
31073230
31083231 /* configure the new mac to device */
3109− __set_bit(RAMROD_COMP_WAIT, &flags);
3232+ __set_bit(RAMROD_COMP_WAIT, &ramrod_flags);
31103233 bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true,
3111− BNX2X_ETH_MAC, &flags);
3234+ BNX2X_ETH_MAC, &ramrod_flags);
31123235
31133236 bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC);
31143237 }
31153238
3116− return rc;
3239+ return 0;
3240+}
3241+
3242+int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos)
3243+{
3244+ struct bnx2x *bp = netdev_priv(dev);
3245+ int rc, q_logical_state;
3246+ struct bnx2x_virtf *vf = BP_VF(bp, vfidx);
3247+ struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vfidx);
3248+
3249+ /* sanity */
3250+ rc = bnx2x_vf_ndo_sanity(bp, vfidx, vf);
3251+ if (rc)
3252+ return rc;
3253+
3254+ if (vlan > 4095) {
3255+ BNX2X_ERR("illegal vlan value %d\n", vlan);
3256+ return -EINVAL;
3257+ }
3258+
3259+ DP(BNX2X_MSG_IOV, "configuring VF %d with VLAN %d qos %d\n",
3260+ vfidx, vlan, 0);
3261+
3262+ /* update PF's copy of the VF's bulletin. No point in posting the vlan
3263+ * to the VF since it doesn't have anything to do with it. But it useful
3264+ * to store it here in case the VF is not up yet and we can only
3265+ * configure the vlan later when it does.
3266+ */
3267+ bulletin->valid_bitmap |= 1 << VLAN_VALID;
3268+ bulletin->vlan = vlan;
3269+
3270+ /* is vf initialized and queue set up? */
3271+ q_logical_state =
3272+ bnx2x_get_q_logical_state(bp, &bnx2x_vfq(vf, 0, sp_obj));
3273+ if (vf->state == VF_ENABLED &&
3274+ q_logical_state == BNX2X_Q_LOGICAL_STATE_ACTIVE) {
3275+ /* configure the vlan in device on this vf's queue */
3276+ unsigned long ramrod_flags = 0;
3277+ unsigned long vlan_mac_flags = 0;
3278+ struct bnx2x_vlan_mac_obj *vlan_obj =
3279+ &bnx2x_vfq(vf, 0, vlan_obj);
3280+ struct bnx2x_vlan_mac_ramrod_params ramrod_param;
3281+ struct bnx2x_queue_state_params q_params = {NULL};
3282+ struct bnx2x_queue_update_params *update_params;
3283+
3284+ memset(&ramrod_param, 0, sizeof(ramrod_param));
3285+
3286+ /* must lock vfpf channel to protect against vf flows */
3287+ bnx2x_lock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN);
3288+
3289+ /* remove existing vlans */
3290+ __set_bit(RAMROD_COMP_WAIT, &ramrod_flags);
3291+ rc = vlan_obj->delete_all(bp, vlan_obj, &vlan_mac_flags,
3292+ &ramrod_flags);
3293+ if (rc) {
3294+ BNX2X_ERR("failed to delete vlans\n");
3295+ return -EINVAL;
3296+ }
3297+
3298+ /* send queue update ramrod to configure default vlan and silent
3299+ * vlan removal
3300+ */
3301+ __set_bit(RAMROD_COMP_WAIT, &q_params.ramrod_flags);
3302+ q_params.cmd = BNX2X_Q_CMD_UPDATE;
3303+ q_params.q_obj = &bnx2x_vfq(vf, 0, sp_obj);
3304+ update_params = &q_params.params.update;
3305+ __set_bit(BNX2X_Q_UPDATE_DEF_VLAN_EN_CHNG,
3306+ &update_params->update_flags);
3307+ __set_bit(BNX2X_Q_UPDATE_SILENT_VLAN_REM_CHNG,
3308+ &update_params->update_flags);
3309+
3310+ if (vlan == 0) {
3311+ /* if vlan is 0 then we want to leave the VF traffic
3312+ * untagged, and leave the incoming traffic untouched
3313+ * (i.e. do not remove any vlan tags).
3314+ */
3315+ __clear_bit(BNX2X_Q_UPDATE_DEF_VLAN_EN,
3316+ &update_params->update_flags);
3317+ __clear_bit(BNX2X_Q_UPDATE_SILENT_VLAN_REM,
3318+ &update_params->update_flags);
3319+ } else {
3320+ /* configure the new vlan to device */
3321+ __set_bit(RAMROD_COMP_WAIT, &ramrod_flags);
3322+ ramrod_param.vlan_mac_obj = vlan_obj;
3323+ ramrod_param.ramrod_flags = ramrod_flags;
3324+ ramrod_param.user_req.u.vlan.vlan = vlan;
3325+ ramrod_param.user_req.cmd = BNX2X_VLAN_MAC_ADD;
3326+ rc = bnx2x_config_vlan_mac(bp, &ramrod_param);
3327+ if (rc) {
3328+ BNX2X_ERR("failed to configure vlan\n");
3329+ return -EINVAL;
3330+ }
3331+
3332+ /* configure default vlan to vf queue and set silent
3333+ * vlan removal (the vf remains unaware of this vlan).
3334+ */
3335+ update_params = &q_params.params.update;
3336+ __set_bit(BNX2X_Q_UPDATE_DEF_VLAN_EN,
3337+ &update_params->update_flags);
3338+ __set_bit(BNX2X_Q_UPDATE_SILENT_VLAN_REM,
3339+ &update_params->update_flags);
3340+ update_params->def_vlan = vlan;
3341+ }
3342+
3343+ /* Update the Queue state */
3344+ rc = bnx2x_queue_state_change(bp, &q_params);
3345+ if (rc) {
3346+ BNX2X_ERR("Failed to configure default VLAN\n");
3347+ return rc;
3348+ }
3349+
3350+ /* clear the flag indicating that this VF needs its vlan
3351+ * (will only be set if the HV configured th Vlan before vf was
3352+ * and we were called because the VF came up later
3353+ */
3354+ vf->cfg_flags &= ~VF_CFG_VLAN;
3355+
3356+ bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN);
3357+ }
3358+ return 0;
31173359 }
31183360
31193361 /* crc is the first field in the bulletin board. compute the crc over the
@@ -3165,20 +3407,26 @@ enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp) · 45 unmodified lines
31653407 memcpy(bp->dev->dev_addr, bulletin.mac, ETH_ALEN);
31663408 }
31673409
3410+ /* the vlan in bulletin board is valid and is new */
3411+ if (bulletin.valid_bitmap & 1 << VLAN_VALID)
3412+ memcpy(&bulletin.vlan, &bp->old_bulletin.vlan, VLAN_HLEN);
3413+
31683414 /* copy new bulletin board to bp */
31693415 bp->old_bulletin = bulletin;
31703416
31713417 return PFVF_BULLETIN_UPDATED;
31723418 }
31733419
3174−void bnx2x_vf_map_doorbells(struct bnx2x *bp)
3420+void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp)
31753421 {
31763422 /* vf doorbells are embedded within the regview */
3177− bp->doorbells = bp->regview + PXP_VF_ADDR_DB_START;
3423+ return bp->regview + PXP_VF_ADDR_DB_START;
31783424 }
31793425
31803426 int bnx2x_vf_pci_alloc(struct bnx2x *bp)
31813427 {
3428+ mutex_init(&bp->vf2pf_mutex);
3429+
31823430 /* allocate vf2pf mailbox for vf to pf channel */
31833431 BNX2X_PCI_ALLOC(bp->vf2pf_mbox, &bp->vf2pf_mbox_mapping,
31843432 sizeof(struct bnx2x_vf_mbx_msg));
@@ -3196,3 +3444,26 @@ alloc_mem_err: · 11 unmodified lines
31963444 sizeof(union pf_vf_bulletin));
31973445 return -ENOMEM;
31983446 }
3447+
3448+int bnx2x_open_epilog(struct bnx2x *bp)
3449+{
3450+ /* Enable sriov via delayed work. This must be done via delayed work
3451+ * because it causes the probe of the vf devices to be run, which invoke
3452+ * register_netdevice which must have rtnl lock taken. As we are holding
3453+ * the lock right now, that could only work if the probe would not take
3454+ * the lock. However, as the probe of the vf may be called from other
3455+ * contexts as well (such as passthrough to vm failes) it can't assume
3456+ * the lock is being held for it. Using delayed work here allows the
3457+ * probe code to simply take the lock (i.e. wait for it to be released
3458+ * if it is being held). We only want to do this if the number of VFs
3459+ * was set before PF driver was loaded.
3460+ */
3461+ if (IS_SRIOV(bp) && BNX2X_NR_VIRTFN(bp)) {
3462+ smp_mb__before_clear_bit();
3463+ set_bit(BNX2X_SP_RTNL_ENABLE_SRIOV, &bp->sp_rtnl_state);
3464+ smp_mb__after_clear_bit();
3465+ schedule_delayed_work(&bp->sp_rtnl_task, 0);
3466+ }
3467+
3468+ return 0;
3469+}
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h+21−6
@@ -193,6 +193,7 @@ struct bnx2x_virtf { · 192 unmodified lines
193193 #define VF_CFG_TPA 0x0004
194194 #define VF_CFG_INT_SIMD 0x0008
195195 #define VF_CACHE_LINE 0x0010
196+#define VF_CFG_VLAN 0x0020
196197
197198 u8 state;
198199 #define VF_FREE 0 /* VF ready to be acquired holds no resc */
@@ -712,6 +713,7 @@ void bnx2x_add_tlv(struct bnx2x *bp, void *tlvs_list, u16 offset, u16 type, · 513 unmodified lines
712713 u16 length);
713714 void bnx2x_vfpf_prep(struct bnx2x *bp, struct vfpf_first_tlv *first_tlv,
714715 u16 type, u16 length);
716+void bnx2x_vfpf_finalize(struct bnx2x *bp, struct vfpf_first_tlv *first_tlv);
715717 void bnx2x_dp_tlv_list(struct bnx2x *bp, void *tlvs_list);
716718
717719 bool bnx2x_tlv_supported(u16 tlvtype);
@@ -731,7 +733,7 @@ int bnx2x_vfpf_init(struct bnx2x *bp); · 13 unmodified lines
731733 void bnx2x_vfpf_close_vf(struct bnx2x *bp);
732734 int bnx2x_vfpf_setup_q(struct bnx2x *bp, int fp_idx);
733735 int bnx2x_vfpf_teardown_queue(struct bnx2x *bp, int qidx);
734−int bnx2x_vfpf_set_mac(struct bnx2x *bp);
736+int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, u8 vf_qid, bool set);
735737 int bnx2x_vfpf_set_mcast(struct net_device *dev);
736738 int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp);
737739
@@ -750,13 +752,17 @@ static inline int bnx2x_vf_ustorm_prods_offset(struct bnx2x *bp, · 12 unmodified lines
750752 }
751753
752754 enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp);
753−void bnx2x_vf_map_doorbells(struct bnx2x *bp);
755+void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp);
754756 int bnx2x_vf_pci_alloc(struct bnx2x *bp);
755−void bnx2x_enable_sriov(struct bnx2x *bp);
757+int bnx2x_enable_sriov(struct bnx2x *bp);
758+void bnx2x_disable_sriov(struct bnx2x *bp);
756759 static inline int bnx2x_vf_headroom(struct bnx2x *bp)
757760 {
758761 return bp->vfdb->sriov.nr_virtfn * BNX2X_CLIENTS_PER_VF;
759762 }
763+void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp);
764+int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs);
765+int bnx2x_open_epilog(struct bnx2x *bp);
760766
761767 #else /* CONFIG_BNX2X_SRIOV */
762768
@@ -779,7 +785,8 @@ static inline void bnx2x_iov_init_dmae(struct bnx2x *bp) {} · 16 unmodified lines
779785 static inline int bnx2x_iov_init_one(struct bnx2x *bp, int int_mode_param,
780786 int num_vfs_param) {return 0; }
781787 static inline void bnx2x_iov_remove_one(struct bnx2x *bp) {}
782−static inline void bnx2x_enable_sriov(struct bnx2x *bp) {}
788+static inline int bnx2x_enable_sriov(struct bnx2x *bp) {return 0; }
789+static inline void bnx2x_disable_sriov(struct bnx2x *bp) {}
783790 static inline int bnx2x_vfpf_acquire(struct bnx2x *bp,
784791 u8 tx_count, u8 rx_count) {return 0; }
785792 static inline int bnx2x_vfpf_release(struct bnx2x *bp) {return 0; }
@@ -787,7 +794,8 @@ static inline int bnx2x_vfpf_init(struct bnx2x *bp) {return 0; } · 1 unmodified line
787794 static inline void bnx2x_vfpf_close_vf(struct bnx2x *bp) {}
788795 static inline int bnx2x_vfpf_setup_q(struct bnx2x *bp, int fp_idx) {return 0; }
789796 static inline int bnx2x_vfpf_teardown_queue(struct bnx2x *bp, int qidx) {return 0; }
790−static inline int bnx2x_vfpf_set_mac(struct bnx2x *bp) {return 0; }
797+static inline int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr,
798+ u8 vf_qid, bool set) {return 0; }
791799 static inline int bnx2x_vfpf_set_mcast(struct net_device *dev) {return 0; }
792800 static inline int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp) {return 0; }
793801 static inline int bnx2x_iov_nic_init(struct bnx2x *bp) {return 0; }
@@ -802,8 +810,15 @@ static inline enum sample_bulletin_result bnx2x_sample_bulletin(struct bnx2x *bp · 8 unmodified lines
802810 return PFVF_BULLETIN_UNCHANGED;
803811 }
804812
805−static inline int bnx2x_vf_map_doorbells(struct bnx2x *bp) {return 0; }
813+static inline void __iomem *bnx2x_vf_doorbells(struct bnx2x *bp)
814+{
815+ return NULL;
816+}
817+
806818 static inline int bnx2x_vf_pci_alloc(struct bnx2x *bp) {return 0; }
819+static inline void bnx2x_pf_set_vfs_vlan(struct bnx2x *bp) {}
820+static inline int bnx2x_sriov_configure(struct pci_dev *dev, int num_vfs) {return 0; }
821+static inline int bnx2x_open_epilog(struct bnx2x *bp) {return 0; }
807822
808823 #endif /* CONFIG_BNX2X_SRIOV */
809824 #endif /* bnx2x_sriov.h */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c+43−34
@@ -1547,11 +1547,51 @@ static void bnx2x_prep_fw_stats_req(struct bnx2x *bp) · 1546 unmodified lines
15471547 }
15481548 }
15491549
1550+void bnx2x_memset_stats(struct bnx2x *bp)
1551+{
1552+ int i;
1553+
1554+ /* function stats */
1555+ for_each_queue(bp, i) {
1556+ struct bnx2x_fp_stats *fp_stats = &bp->fp_stats[i];
1557+
1558+ memset(&fp_stats->old_tclient, 0,
1559+ sizeof(fp_stats->old_tclient));
1560+ memset(&fp_stats->old_uclient, 0,
1561+ sizeof(fp_stats->old_uclient));
1562+ memset(&fp_stats->old_xclient, 0,
1563+ sizeof(fp_stats->old_xclient));
1564+ if (bp->stats_init) {
1565+ memset(&fp_stats->eth_q_stats, 0,
1566+ sizeof(fp_stats->eth_q_stats));
1567+ memset(&fp_stats->eth_q_stats_old, 0,
1568+ sizeof(fp_stats->eth_q_stats_old));
1569+ }
1570+ }
1571+
1572+ memset(&bp->dev->stats, 0, sizeof(bp->dev->stats));
1573+
1574+ if (bp->stats_init) {
1575+ memset(&bp->net_stats_old, 0, sizeof(bp->net_stats_old));
1576+ memset(&bp->fw_stats_old, 0, sizeof(bp->fw_stats_old));
1577+ memset(&bp->eth_stats_old, 0, sizeof(bp->eth_stats_old));
1578+ memset(&bp->eth_stats, 0, sizeof(bp->eth_stats));
1579+ memset(&bp->func_stats, 0, sizeof(bp->func_stats));
1580+ }
1581+
1582+ bp->stats_state = STATS_STATE_DISABLED;
1583+
1584+ if (bp->port.pmf && bp->port.port_stx)
1585+ bnx2x_port_stats_base_init(bp);
1586+
1587+ /* mark the end of statistics initializiation */
1588+ bp->stats_init = false;
1589+}
1590+
15501591 void bnx2x_stats_init(struct bnx2x *bp)
15511592 {
15521593 int /*abs*/port = BP_PORT(bp);
15531594 int mb_idx = BP_FW_MB_IDX(bp);
1554− int i;
15551595
15561596 bp->stats_pending = 0;
15571597 bp->executer_idx = 0;
@@ -1587,36 +1627,11 @@ void bnx2x_stats_init(struct bnx2x *bp) · 29 unmodified lines
15871627 &(bp->port.old_nig_stats.egress_mac_pkt1_lo), 2);
15881628 }
15891629
1590− /* function stats */
1591− for_each_queue(bp, i) {
1592− struct bnx2x_fp_stats *fp_stats = &bp->fp_stats[i];
1593−
1594− memset(&fp_stats->old_tclient, 0,
1595− sizeof(fp_stats->old_tclient));
1596− memset(&fp_stats->old_uclient, 0,
1597− sizeof(fp_stats->old_uclient));
1598− memset(&fp_stats->old_xclient, 0,
1599− sizeof(fp_stats->old_xclient));
1600− if (bp->stats_init) {
1601− memset(&fp_stats->eth_q_stats, 0,
1602− sizeof(fp_stats->eth_q_stats));
1603− memset(&fp_stats->eth_q_stats_old, 0,
1604− sizeof(fp_stats->eth_q_stats_old));
1605− }
1606− }
1607−
16081630 /* Prepare statistics ramrod data */
16091631 bnx2x_prep_fw_stats_req(bp);
16101632
1611− memset(&bp->dev->stats, 0, sizeof(bp->dev->stats));
1633+ /* Clean SP from previous statistics */
16121634 if (bp->stats_init) {
1613− memset(&bp->net_stats_old, 0, sizeof(bp->net_stats_old));
1614− memset(&bp->fw_stats_old, 0, sizeof(bp->fw_stats_old));
1615− memset(&bp->eth_stats_old, 0, sizeof(bp->eth_stats_old));
1616− memset(&bp->eth_stats, 0, sizeof(bp->eth_stats));
1617− memset(&bp->func_stats, 0, sizeof(bp->func_stats));
1618−
1619− /* Clean SP from previous statistics */
16201635 if (bp->func_stx) {
16211636 memset(bnx2x_sp(bp, func_stats), 0,
16221637 sizeof(struct host_func_stats));
@@ -1626,13 +1641,7 @@ void bnx2x_stats_init(struct bnx2x *bp) · 3 unmodified lines
16261641 }
16271642 }
16281643
1629− bp->stats_state = STATS_STATE_DISABLED;
1630−
1631− if (bp->port.pmf && bp->port.port_stx)
1632− bnx2x_port_stats_base_init(bp);
1633−
1634− /* mark the end of statistics initializiation */
1635− bp->stats_init = false;
1644+ bnx2x_memset_stats(bp);
16361645 }
16371646
16381647 void bnx2x_save_statistics(struct bnx2x *bp)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.h+1−1
@@ -540,8 +540,8 @@ struct bnx2x_fw_port_stats_old { · 539 unmodified lines
540540 /* forward */
541541 struct bnx2x;
542542
543+void bnx2x_memset_stats(struct bnx2x *bp);
543544 void bnx2x_stats_init(struct bnx2x *bp);
544−
545545 void bnx2x_stats_handle(struct bnx2x *bp, enum bnx2x_stats_event event);
546546
547547 /**
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c+88−38
@@ -36,6 +36,8 @@ void bnx2x_add_tlv(struct bnx2x *bp, void *tlvs_list, u16 offset, u16 type, · 35 unmodified lines
3636 void bnx2x_vfpf_prep(struct bnx2x *bp, struct vfpf_first_tlv *first_tlv,
3737 u16 type, u16 length)
3838 {
39+ mutex_lock(&bp->vf2pf_mutex);
40+
3941 DP(BNX2X_MSG_IOV, "preparing to send %d tlv over vf pf channel\n",
4042 type);
4143
@@ -49,6 +51,15 @@ void bnx2x_vfpf_prep(struct bnx2x *bp, struct vfpf_first_tlv *first_tlv, · 7 unmodified lines
4951 first_tlv->resp_msg_offset = sizeof(bp->vf2pf_mbox->req);
5052 }
5153
54+/* releases the mailbox */
55+void bnx2x_vfpf_finalize(struct bnx2x *bp, struct vfpf_first_tlv *first_tlv)
56+{
57+ DP(BNX2X_MSG_IOV, "done sending [%d] tlv over vf pf channel\n",
58+ first_tlv->tl.type);
59+
60+ mutex_unlock(&bp->vf2pf_mutex);
61+}
62+
5263 /* list the types and lengths of the tlvs on the buffer */
5364 void bnx2x_dp_tlv_list(struct bnx2x *bp, void *tlvs_list)
5465 {
@@ -181,8 +192,10 @@ int bnx2x_vfpf_acquire(struct bnx2x *bp, u8 tx_count, u8 rx_count) · 126 unmodified lines
181192 /* clear mailbox and prep first tlv */
182193 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_ACQUIRE, sizeof(*req));
183194
184− if (bnx2x_get_vf_id(bp, &vf_id))
185− return -EAGAIN;
195+ if (bnx2x_get_vf_id(bp, &vf_id)) {
196+ rc = -EAGAIN;
197+ goto out;
198+ }
186199
187200 req->vfdev_info.vf_id = vf_id;
188201 req->vfdev_info.vf_os = 0;
@@ -213,7 +226,7 @@ int bnx2x_vfpf_acquire(struct bnx2x *bp, u8 tx_count, u8 rx_count) · 24 unmodified lines
213226
214227 /* PF timeout */
215228 if (rc)
216− return rc;
229+ goto out;
217230
218231 /* copy acquire response from buffer to bp */
219232 memcpy(&bp->acquire_resp, resp, sizeof(bp->acquire_resp));
@@ -253,7 +266,8 @@ int bnx2x_vfpf_acquire(struct bnx2x *bp, u8 tx_count, u8 rx_count) · 33 unmodified lines
253266 /* PF reports error */
254267 BNX2X_ERR("Failed to get the requested amount of resources: %d. Breaking...\n",
255268 bp->acquire_resp.hdr.status);
256− return -EAGAIN;
269+ rc = -EAGAIN;
270+ goto out;
257271 }
258272 }
259273
@@ -279,20 +293,24 @@ int bnx2x_vfpf_acquire(struct bnx2x *bp, u8 tx_count, u8 rx_count) · 19 unmodified lines
279293 bp->acquire_resp.resc.current_mac_addr,
280294 ETH_ALEN);
281295
282− return 0;
296+out:
297+ bnx2x_vfpf_finalize(bp, &req->first_tlv);
298+ return rc;
283299 }
284300
285301 int bnx2x_vfpf_release(struct bnx2x *bp)
286302 {
287303 struct vfpf_release_tlv *req = &bp->vf2pf_mbox->req.release;
288304 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp;
289− u32 rc = 0, vf_id;
305+ u32 rc, vf_id;
290306
291307 /* clear mailbox and prep first tlv */
292308 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_RELEASE, sizeof(*req));
293309
294− if (bnx2x_get_vf_id(bp, &vf_id))
295− return -EAGAIN;
310+ if (bnx2x_get_vf_id(bp, &vf_id)) {
311+ rc = -EAGAIN;
312+ goto out;
313+ }
296314
297315 req->vf_id = vf_id;
298316
@@ -308,7 +326,8 @@ int bnx2x_vfpf_release(struct bnx2x *bp) · 9 unmodified lines
308326
309327 if (rc)
310328 /* PF timeout */
311− return rc;
329+ goto out;
330+
312331 if (resp->hdr.status == PFVF_STATUS_SUCCESS) {
313332 /* PF released us */
314333 DP(BNX2X_MSG_SP, "vf released\n");
@@ -316,10 +335,13 @@ int bnx2x_vfpf_release(struct bnx2x *bp) · 1 unmodified line
316335 /* PF reports error */
317336 BNX2X_ERR("PF failed our release request - are we out of sync? response status: %d\n",
318337 resp->hdr.status);
319− return -EAGAIN;
338+ rc = -EAGAIN;
339+ goto out;
320340 }
341+out:
342+ bnx2x_vfpf_finalize(bp, &req->first_tlv);
321343
322− return 0;
344+ return rc;
323345 }
324346
325347 /* Tell PF about SB addresses */
@@ -350,16 +372,20 @@ int bnx2x_vfpf_init(struct bnx2x *bp) · 24 unmodified lines
350372
351373 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping);
352374 if (rc)
353− return rc;
375+ goto out;
354376
355377 if (resp->hdr.status != PFVF_STATUS_SUCCESS) {
356378 BNX2X_ERR("INIT VF failed: %d. Breaking...\n",
357379 resp->hdr.status);
358− return -EAGAIN;
380+ rc = -EAGAIN;
381+ goto out;
359382 }
360383
361384 DP(BNX2X_MSG_SP, "INIT VF Succeeded\n");
362− return 0;
385+out:
386+ bnx2x_vfpf_finalize(bp, &req->first_tlv);
387+
388+ return rc;
363389 }
364390
365391 /* CLOSE VF - opposite to INIT_VF */
@@ -380,6 +406,9 @@ void bnx2x_vfpf_close_vf(struct bnx2x *bp) · 14 unmodified lines
380406 for_each_queue(bp, i)
381407 bnx2x_vfpf_teardown_queue(bp, i);
382408
409+ /* remove mac */
410+ bnx2x_vfpf_config_mac(bp, bp->dev->dev_addr, bp->fp->index, false);
411+
383412 /* clear mailbox and prep first tlv */
384413 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_CLOSE, sizeof(*req));
385414
@@ -401,6 +430,8 @@ void bnx2x_vfpf_close_vf(struct bnx2x *bp) · 15 unmodified lines
401430 BNX2X_ERR("Sending CLOSE failed: pf response was %d\n",
402431 resp->hdr.status);
403432
433+ bnx2x_vfpf_finalize(bp, &req->first_tlv);
434+
404435 free_irq:
405436 /* Disable HW interrupts, NAPI */
406437 bnx2x_netif_stop(bp, 0);
@@ -435,7 +466,6 @@ int bnx2x_vfpf_setup_q(struct bnx2x *bp, int fp_idx) · 28 unmodified lines
435466 /* calculate queue flags */
436467 flags |= VFPF_QUEUE_FLG_STATS;
437468 flags |= VFPF_QUEUE_FLG_CACHE_ALIGN;
438− flags |= IS_MF_SD(bp) ? VFPF_QUEUE_FLG_OV : 0;
439469 flags |= VFPF_QUEUE_FLG_VLAN;
440470 DP(NETIF_MSG_IFUP, "vlan removal enabled\n");
441471
@@ -486,8 +516,11 @@ int bnx2x_vfpf_setup_q(struct bnx2x *bp, int fp_idx) · 44 unmodified lines
486516 if (resp->hdr.status != PFVF_STATUS_SUCCESS) {
487517 BNX2X_ERR("Status of SETUP_Q for queue[%d] is %d\n",
488518 fp_idx, resp->hdr.status);
489− return -EINVAL;
519+ rc = -EINVAL;
490520 }
521+
522+ bnx2x_vfpf_finalize(bp, &req->first_tlv);
523+
491524 return rc;
492525 }
493526
@@ -515,41 +548,46 @@ int bnx2x_vfpf_teardown_queue(struct bnx2x *bp, int qidx) · 21 unmodified lines
515548 if (rc) {
516549 BNX2X_ERR("Sending TEARDOWN for queue %d failed: %d\n", qidx,
517550 rc);
518− return rc;
551+ goto out;
519552 }
520553
521554 /* PF failed the transaction */
522555 if (resp->hdr.status != PFVF_STATUS_SUCCESS) {
523556 BNX2X_ERR("TEARDOWN for queue %d failed: %d\n", qidx,
524557 resp->hdr.status);
525− return -EINVAL;
558+ rc = -EINVAL;
526559 }
527560
528− return 0;
561+out:
562+ bnx2x_vfpf_finalize(bp, &req->first_tlv);
563+ return rc;
529564 }
530565
531566 /* request pf to add a mac for the vf */
532−int bnx2x_vfpf_set_mac(struct bnx2x *bp)
567+int bnx2x_vfpf_config_mac(struct bnx2x *bp, u8 *addr, u8 vf_qid, bool set)
533568 {
534569 struct vfpf_set_q_filters_tlv *req = &bp->vf2pf_mbox->req.set_q_filters;
535570 struct pfvf_general_resp_tlv *resp = &bp->vf2pf_mbox->resp.general_resp;
536− int rc;
571+ struct pf_vf_bulletin_content bulletin = bp->pf2vf_bulletin->content;
572+ int rc = 0;
537573
538574 /* clear mailbox and prep first tlv */
539575 bnx2x_vfpf_prep(bp, &req->first_tlv, CHANNEL_TLV_SET_Q_FILTERS,
540576 sizeof(*req));
541577
542578 req->flags = VFPF_SET_Q_FILTERS_MAC_VLAN_CHANGED;
543− req->vf_qid = 0;
579+ req->vf_qid = vf_qid;
544580 req->n_mac_vlan_filters = 1;
545− req->filters[0].flags =
546− VFPF_Q_FILTER_DEST_MAC_VALID | VFPF_Q_FILTER_SET_MAC;
581+
582+ req->filters[0].flags = VFPF_Q_FILTER_DEST_MAC_VALID;
583+ if (set)
584+ req->filters[0].flags |= VFPF_Q_FILTER_SET_MAC;
547585
548586 /* sample bulletin board for new mac */
549587 bnx2x_sample_bulletin(bp);
550588
551589 /* copy mac from device to request */
552− memcpy(req->filters[0].mac, bp->dev->dev_addr, ETH_ALEN);
590+ memcpy(req->filters[0].mac, addr, ETH_ALEN);
553591
554592 /* add list termination tlv */
555593 bnx2x_add_tlv(bp, req, req->first_tlv.tl.length, CHANNEL_TLV_LIST_END,
@@ -562,7 +600,7 @@ int bnx2x_vfpf_set_mac(struct bnx2x *bp) · 6 unmodified lines
562600 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping);
563601 if (rc) {
564602 BNX2X_ERR("failed to send message to pf. rc was %d\n", rc);
565− return rc;
603+ goto out;
566604 }
567605
568606 /* failure may mean PF was configured with a new mac for us */
@@ -570,6 +608,9 @@ int bnx2x_vfpf_set_mac(struct bnx2x *bp) · 1 unmodified line
570608 DP(BNX2X_MSG_IOV,
571609 "vfpf SET MAC failed. Check bulletin board for new posts\n");
572610
611+ /* copy mac from bulletin to device */
612+ memcpy(bp->dev->dev_addr, bulletin.mac, ETH_ALEN);
613+
573614 /* check if bulletin board was updated */
574615 if (bnx2x_sample_bulletin(bp) == PFVF_BULLETIN_UPDATED) {
575616 /* copy mac from device to request */
@@ -587,8 +628,10 @@ int bnx2x_vfpf_set_mac(struct bnx2x *bp) · 11 unmodified lines
587628
588629 if (resp->hdr.status != PFVF_STATUS_SUCCESS) {
589630 BNX2X_ERR("vfpf SET MAC failed: %d\n", resp->hdr.status);
590− return -EINVAL;
631+ rc = -EINVAL;
591632 }
633+out:
634+ bnx2x_vfpf_finalize(bp, &req->first_tlv);
592635
593636 return 0;
594637 }
@@ -643,14 +686,16 @@ int bnx2x_vfpf_set_mcast(struct net_device *dev) · 48 unmodified lines
643686 rc = bnx2x_send_msg2pf(bp, &resp->hdr.status, bp->vf2pf_mbox_mapping);
644687 if (rc) {
645688 BNX2X_ERR("Sending a message failed: %d\n", rc);
646− return rc;
689+ goto out;
647690 }
648691
649692 if (resp->hdr.status != PFVF_STATUS_SUCCESS) {
650693 BNX2X_ERR("Set Rx mode/multicast failed: %d\n",
651694 resp->hdr.status);
652− return -EINVAL;
695+ rc = -EINVAL;
653696 }
697+out:
698+ bnx2x_vfpf_finalize(bp, &req->first_tlv);
654699
655700 return 0;
656701 }
@@ -689,7 +734,8 @@ int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp) · 32 unmodified lines
689734 break;
690735 default:
691736 BNX2X_ERR("BAD rx mode (%d)\n", mode);
692− return -EINVAL;
737+ rc = -EINVAL;
738+ goto out;
693739 }
694740
695741 req->flags |= VFPF_SET_Q_FILTERS_RX_MASK_CHANGED;
@@ -708,8 +754,10 @@ int bnx2x_vfpf_storm_rx_mode(struct bnx2x *bp) · 12 unmodified lines
708754
709755 if (resp->hdr.status != PFVF_STATUS_SUCCESS) {
710756 BNX2X_ERR("Set Rx mode failed: %d\n", resp->hdr.status);
711− return -EINVAL;
757+ rc = -EINVAL;
712758 }
759+out:
760+ bnx2x_vfpf_finalize(bp, &req->first_tlv);
713761
714762 return rc;
715763 }
@@ -1004,7 +1052,7 @@ static void bnx2x_vf_mbx_init_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, · 288 unmodified lines
10041052 }
10051053
10061054 /* convert MBX queue-flags to standard SP queue-flags */
1007−static void bnx2x_vf_mbx_set_q_flags(u32 mbx_q_flags,
1055+static void bnx2x_vf_mbx_set_q_flags(struct bnx2x *bp, u32 mbx_q_flags,
10081056 unsigned long *sp_q_flags)
10091057 {
10101058 if (mbx_q_flags & VFPF_QUEUE_FLG_TPA)
@@ -1015,8 +1063,6 @@ static void bnx2x_vf_mbx_set_q_flags(u32 mbx_q_flags, · 4 unmodified lines
10151063 __set_bit(BNX2X_Q_FLG_TPA_GRO, sp_q_flags);
10161064 if (mbx_q_flags & VFPF_QUEUE_FLG_STATS)
10171065 __set_bit(BNX2X_Q_FLG_STATS, sp_q_flags);
1018− if (mbx_q_flags & VFPF_QUEUE_FLG_OV)
1019− __set_bit(BNX2X_Q_FLG_OV, sp_q_flags);
10201066 if (mbx_q_flags & VFPF_QUEUE_FLG_VLAN)
10211067 __set_bit(BNX2X_Q_FLG_VLAN, sp_q_flags);
10221068 if (mbx_q_flags & VFPF_QUEUE_FLG_COS)
@@ -1025,6 +1071,10 @@ static void bnx2x_vf_mbx_set_q_flags(u32 mbx_q_flags, · 2 unmodified lines
10251071 __set_bit(BNX2X_Q_FLG_HC, sp_q_flags);
10261072 if (mbx_q_flags & VFPF_QUEUE_FLG_DHC)
10271073 __set_bit(BNX2X_Q_FLG_DHC, sp_q_flags);
1074+
1075+ /* outer vlan removal is set according to the PF's multi fuction mode */
1076+ if (IS_MF_SD(bp))
1077+ __set_bit(BNX2X_Q_FLG_OV, sp_q_flags);
10281078 }
10291079
10301080 static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp, struct bnx2x_virtf *vf,
@@ -1075,11 +1125,11 @@ static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp, struct bnx2x_virtf *vf, · 44 unmodified lines
10751125 init_p->tx.hc_rate = setup_q->txq.hc_rate;
10761126 init_p->tx.sb_cq_index = setup_q->txq.sb_index;
10771127
1078− bnx2x_vf_mbx_set_q_flags(setup_q->txq.flags,
1128+ bnx2x_vf_mbx_set_q_flags(bp, setup_q->txq.flags,
10791129 &init_p->tx.flags);
10801130
10811131 /* tx setup - flags */
1082− bnx2x_vf_mbx_set_q_flags(setup_q->txq.flags,
1132+ bnx2x_vf_mbx_set_q_flags(bp, setup_q->txq.flags,
10831133 &setup_p->flags);
10841134
10851135 /* tx setup - general, nothing */
@@ -1107,11 +1157,11 @@ static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp, struct bnx2x_virtf *vf, · 21 unmodified lines
11071157 /* rx init */
11081158 init_p->rx.hc_rate = setup_q->rxq.hc_rate;
11091159 init_p->rx.sb_cq_index = setup_q->rxq.sb_index;
1110− bnx2x_vf_mbx_set_q_flags(setup_q->rxq.flags,
1160+ bnx2x_vf_mbx_set_q_flags(bp, setup_q->rxq.flags,
11111161 &init_p->rx.flags);
11121162
11131163 /* rx setup - flags */
1114− bnx2x_vf_mbx_set_q_flags(setup_q->rxq.flags,
1164+ bnx2x_vf_mbx_set_q_flags(bp, setup_q->rxq.flags,
11151165 &setup_p->flags);
11161166
11171167 /* rx setup - general */
drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.h+8−1
@@ -328,9 +328,15 @@ struct pf_vf_bulletin_content { · 327 unmodified lines
328328 #define MAC_ADDR_VALID 0 /* alert the vf that a new mac address
329329 * is available for it
330330 */
331+#define VLAN_VALID 1 /* when set, the vf should not access
332+ * the vfpf channel
333+ */
331334
332335 u8 mac[ETH_ALEN];
333− u8 padding[2];
336+ u8 mac_padding[2];
337+
338+ u16 vlan;
339+ u8 vlan_padding[6];
334340 };
335341
336342 union pf_vf_bulletin {
@@ -353,6 +359,7 @@ enum channel_tlvs { · 16 unmodified lines
353359 CHANNEL_TLV_LIST_END,
354360 CHANNEL_TLV_FLR,
355361 CHANNEL_TLV_PF_SET_MAC,
362+ CHANNEL_TLV_PF_SET_VLAN,
356363 CHANNEL_TLV_MAX
357364 };
358365
drivers/net/ethernet/broadcom/cnic.c+3−1
@@ -5544,8 +5544,10 @@ static struct cnic_dev *init_bnx2x_cnic(struct net_device *dev) · 5543 unmodified lines
55445544
55455545 if (!(ethdev->drv_state & CNIC_DRV_STATE_NO_ISCSI))
55465546 cdev->max_iscsi_conn = ethdev->max_iscsi_conn;
5547− if (CNIC_SUPPORTS_FCOE(cp))
5547+ if (CNIC_SUPPORTS_FCOE(cp)) {
55485548 cdev->max_fcoe_conn = ethdev->max_fcoe_conn;
5549+ cdev->max_fcoe_exchanges = ethdev->max_fcoe_exchanges;
5550+ }
55495551
55505552 if (cdev->max_fcoe_conn > BNX2X_FCOE_NUM_CONNECTIONS)
55515553 cdev->max_fcoe_conn = BNX2X_FCOE_NUM_CONNECTIONS;
drivers/net/ethernet/broadcom/cnic_if.h+3−0
@@ -195,6 +195,7 @@ struct cnic_eth_dev { · 194 unmodified lines
195195 u32 max_fcoe_conn;
196196 u32 max_rdma_conn;
197197 u32 fcoe_init_cid;
198+ u32 max_fcoe_exchanges;
198199 u32 fcoe_wwn_port_name_hi;
199200 u32 fcoe_wwn_port_name_lo;
200201 u32 fcoe_wwn_node_name_hi;
@@ -313,6 +314,8 @@ struct cnic_dev { · 112 unmodified lines
313314 int max_fcoe_conn;
314315 int max_rdma_conn;
315316
317+ int max_fcoe_exchanges;
318+
316319 union drv_info_to_mcp *stats_addr;
317320 struct fcoe_capabilities *fcoe_cap;
318321
drivers/net/ethernet/broadcom/sb1250-mac.c+1−4
@@ -831,11 +831,8 @@ static int sbdma_add_rcvbuffer(struct sbmac_softc *sc, struct sbmacdma *d, · 830 unmodified lines
831831 sb_new = netdev_alloc_skb(dev, ENET_PACKET_SIZE +
832832 SMP_CACHE_BYTES * 2 +
833833 NET_IP_ALIGN);
834− if (sb_new == NULL) {
835− pr_info("%s: sk_buff allocation failed\n",
836− d->sbdma_eth->sbm_dev->name);
834+ if (sb_new == NULL)
837835 return -ENOBUFS;
838− }
839836
840837 sbdma_align_skb(sb_new, SMP_CACHE_BYTES, NET_IP_ALIGN);
841838 }
drivers/net/ethernet/broadcom/tg3.c+672−240
@@ -94,10 +94,10 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits) · 93 unmodified lines
9494
9595 #define DRV_MODULE_NAME "tg3"
9696 #define TG3_MAJ_NUM 3
97−#define TG3_MIN_NUM 130
97+#define TG3_MIN_NUM 131
9898 #define DRV_MODULE_VERSION \
9999 __stringify(TG3_MAJ_NUM) "." __stringify(TG3_MIN_NUM)
100−#define DRV_MODULE_RELDATE "February 14, 2013"
100+#define DRV_MODULE_RELDATE "April 09, 2013"
101101
102102 #define RESET_KIND_SHUTDOWN 0
103103 #define RESET_KIND_INIT 1
@@ -212,6 +212,7 @@ static inline void _tg3_flag_clear(enum TG3_FLAGS flag, unsigned long *bits) · 108 unmodified lines
212212 #define TG3_FW_UPDATE_FREQ_SEC (TG3_FW_UPDATE_TIMEOUT_SEC / 2)
213213
214214 #define FIRMWARE_TG3 "tigon/tg3.bin"
215+#define FIRMWARE_TG357766 "tigon/tg357766.bin"
215216 #define FIRMWARE_TG3TSO "tigon/tg3_tso.bin"
216217 #define FIRMWARE_TG3TSO5 "tigon/tg3_tso5.bin"
217218
@@ -1873,6 +1874,20 @@ static void tg3_link_report(struct tg3 *tp) · 1655 unmodified lines
18731874 tp->link_up = netif_carrier_ok(tp->dev);
18741875 }
18751876
1877+static u32 tg3_decode_flowctrl_1000T(u32 adv)
1878+{
1879+ u32 flowctrl = 0;
1880+
1881+ if (adv & ADVERTISE_PAUSE_CAP) {
1882+ flowctrl |= FLOW_CTRL_RX;
1883+ if (!(adv & ADVERTISE_PAUSE_ASYM))
1884+ flowctrl |= FLOW_CTRL_TX;
1885+ } else if (adv & ADVERTISE_PAUSE_ASYM)
1886+ flowctrl |= FLOW_CTRL_TX;
1887+
1888+ return flowctrl;
1889+}
1890+
18761891 static u16 tg3_advert_flowctrl_1000X(u8 flow_ctrl)
18771892 {
18781893 u16 miireg;
@@ -1889,6 +1904,20 @@ static u16 tg3_advert_flowctrl_1000X(u8 flow_ctrl) · 10 unmodified lines
18891904 return miireg;
18901905 }
18911906
1907+static u32 tg3_decode_flowctrl_1000X(u32 adv)
1908+{
1909+ u32 flowctrl = 0;
1910+
1911+ if (adv & ADVERTISE_1000XPAUSE) {
1912+ flowctrl |= FLOW_CTRL_RX;
1913+ if (!(adv & ADVERTISE_1000XPSE_ASYM))
1914+ flowctrl |= FLOW_CTRL_TX;
1915+ } else if (adv & ADVERTISE_1000XPSE_ASYM)
1916+ flowctrl |= FLOW_CTRL_TX;
1917+
1918+ return flowctrl;
1919+}
1920+
18921921 static u8 tg3_resolve_flowctrl_1000X(u16 lcladv, u16 rmtadv)
18931922 {
18941923 u8 cap = 0;
@@ -2199,7 +2228,7 @@ static void tg3_phy_toggle_apd(struct tg3 *tp, bool enable) · 304 unmodified lines
21992228 tg3_writephy(tp, MII_TG3_MISC_SHDW, reg);
22002229 }
22012230
2202−static void tg3_phy_toggle_automdix(struct tg3 *tp, int enable)
2231+static void tg3_phy_toggle_automdix(struct tg3 *tp, bool enable)
22032232 {
22042233 u32 phy;
22052234
@@ -2291,7 +2320,7 @@ static void tg3_phy_apply_otp(struct tg3 *tp) · 85 unmodified lines
22912320 tg3_phy_toggle_auxctl_smdsp(tp, false);
22922321 }
22932322
2294−static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up)
2323+static void tg3_phy_eee_adjust(struct tg3 *tp, bool current_link_up)
22952324 {
22962325 u32 val;
22972326
@@ -2301,7 +2330,7 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up) · 3 unmodified lines
23012330 tp->setlpicnt = 0;
23022331
23032332 if (tp->link_config.autoneg == AUTONEG_ENABLE &&
2304− current_link_up == 1 &&
2333+ current_link_up &&
23052334 tp->link_config.active_duplex == DUPLEX_FULL &&
23062335 (tp->link_config.active_speed == SPEED_100 ||
23072336 tp->link_config.active_speed == SPEED_1000)) {
@@ -2323,7 +2352,7 @@ static void tg3_phy_eee_adjust(struct tg3 *tp, u32 current_link_up) · 15 unmodified lines
23232352 }
23242353
23252354 if (!tp->setlpicnt) {
2326− if (current_link_up == 1 &&
2355+ if (current_link_up &&
23272356 !tg3_phy_toggle_auxctl_smdsp(tp, true)) {
23282357 tg3_phydsp_write(tp, MII_TG3_DSP_TAP26, 0x0000);
23292358 tg3_phy_toggle_auxctl_smdsp(tp, false);
@@ -2530,6 +2559,13 @@ static void tg3_carrier_off(struct tg3 *tp) · 200 unmodified lines
25302559 tp->link_up = false;
25312560 }
25322561
2562+static void tg3_warn_mgmt_link_flap(struct tg3 *tp)
2563+{
2564+ if (tg3_flag(tp, ENABLE_ASF))
2565+ netdev_warn(tp->dev,
2566+ "Management side-band traffic will be interrupted during phy settings change\n");
2567+}
2568+
25332569 /* This will reset the tigon3 PHY if there is no valid
25342570 * link unless the FORCE argument is non-zero.
25352571 */
@@ -2669,7 +2705,7 @@ out: · 133 unmodified lines
26692705 if (tg3_chip_rev_id(tp) == CHIPREV_ID_5762_A0)
26702706 tg3_phydsp_write(tp, 0xffb, 0x4000);
26712707
2672− tg3_phy_toggle_automdix(tp, 1);
2708+ tg3_phy_toggle_automdix(tp, true);
26732709 tg3_phy_set_wirespeed(tp);
26742710 return 0;
26752711 }
@@ -2925,6 +2961,9 @@ static void tg3_power_down_phy(struct tg3 *tp, bool do_low_power) · 249 unmodified lines
29252961 {
29262962 u32 val;
29272963
2964+ if (tp->phy_flags & TG3_PHYFLG_KEEP_LINK_ON_PWRDN)
2965+ return;
2966+
29282967 if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) {
29292968 if (tg3_asic_rev(tp) == ASIC_REV_5704) {
29302969 u32 sg_dig_ctrl = tr32(SG_DIG_CTRL);
@@ -3448,11 +3487,58 @@ static int tg3_nvram_write_block(struct tg3 *tp, u32 offset, u32 len, u8 *buf) · 517 unmodified lines
34483487 #define TX_CPU_SCRATCH_SIZE 0x04000
34493488
34503489 /* tp->lock is held. */
3451−static int tg3_halt_cpu(struct tg3 *tp, u32 offset)
3490+static int tg3_pause_cpu(struct tg3 *tp, u32 cpu_base)
34523491 {
34533492 int i;
3493+ const int iters = 10000;
3494+
3495+ for (i = 0; i < iters; i++) {
3496+ tw32(cpu_base + CPU_STATE, 0xffffffff);
3497+ tw32(cpu_base + CPU_MODE, CPU_MODE_HALT);
3498+ if (tr32(cpu_base + CPU_MODE) & CPU_MODE_HALT)
3499+ break;
3500+ }
3501+
3502+ return (i == iters) ? -EBUSY : 0;
3503+}
3504+
3505+/* tp->lock is held. */
3506+static int tg3_rxcpu_pause(struct tg3 *tp)
3507+{
3508+ int rc = tg3_pause_cpu(tp, RX_CPU_BASE);
3509+
3510+ tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
3511+ tw32_f(RX_CPU_BASE + CPU_MODE, CPU_MODE_HALT);
3512+ udelay(10);
3513+
3514+ return rc;
3515+}
3516+
3517+/* tp->lock is held. */
3518+static int tg3_txcpu_pause(struct tg3 *tp)
3519+{
3520+ return tg3_pause_cpu(tp, TX_CPU_BASE);
3521+}
3522+
3523+/* tp->lock is held. */
3524+static void tg3_resume_cpu(struct tg3 *tp, u32 cpu_base)
3525+{
3526+ tw32(cpu_base + CPU_STATE, 0xffffffff);
3527+ tw32_f(cpu_base + CPU_MODE, 0x00000000);
3528+}
34543529
3455− BUG_ON(offset == TX_CPU_BASE && tg3_flag(tp, 5705_PLUS));
3530+/* tp->lock is held. */
3531+static void tg3_rxcpu_resume(struct tg3 *tp)
3532+{
3533+ tg3_resume_cpu(tp, RX_CPU_BASE);
3534+}
3535+
3536+/* tp->lock is held. */
3537+static int tg3_halt_cpu(struct tg3 *tp, u32 cpu_base)
3538+{
3539+ int rc;
3540+
3541+ BUG_ON(cpu_base == TX_CPU_BASE && tg3_flag(tp, 5705_PLUS));
34563542
34573543 if (tg3_asic_rev(tp) == ASIC_REV_5906) {
34583544 u32 val = tr32(GRC_VCPU_EXT_CTRL);
@@ -3460,17 +3546,8 @@ static int tg3_halt_cpu(struct tg3 *tp, u32 offset) · 1 unmodified line
34603546 tw32(GRC_VCPU_EXT_CTRL, val | GRC_VCPU_EXT_CTRL_HALT_CPU);
34613547 return 0;
34623548 }
3463− if (offset == RX_CPU_BASE) {
3464− for (i = 0; i < 10000; i++) {
3465− tw32(offset + CPU_STATE, 0xffffffff);
3466− tw32(offset + CPU_MODE, CPU_MODE_HALT);
3467− if (tr32(offset + CPU_MODE) & CPU_MODE_HALT)
3468− break;
3469− }
3470−
3471− tw32(offset + CPU_STATE, 0xffffffff);
3472− tw32_f(offset + CPU_MODE, CPU_MODE_HALT);
3473− udelay(10);
3549+ if (cpu_base == RX_CPU_BASE) {
3550+ rc = tg3_rxcpu_pause(tp);
34743551 } else {
34753552 /*
34763553 * There is only an Rx CPU for the 5750 derivative in the
@@ -3479,17 +3556,12 @@ static int tg3_halt_cpu(struct tg3 *tp, u32 offset) · 2 unmodified lines
34793556 if (tg3_flag(tp, IS_SSB_CORE))
34803557 return 0;
34813558
3482− for (i = 0; i < 10000; i++) {
3483− tw32(offset + CPU_STATE, 0xffffffff);
3484− tw32(offset + CPU_MODE, CPU_MODE_HALT);
3485− if (tr32(offset + CPU_MODE) & CPU_MODE_HALT)
3486− break;
3487− }
3559+ rc = tg3_txcpu_pause(tp);
34883560 }
34893561
3490− if (i >= 10000) {
3562+ if (rc) {
34913563 netdev_err(tp->dev, "%s timed out, %s CPU\n",
3492− __func__, offset == RX_CPU_BASE ? "RX" : "TX");
3564+ __func__, cpu_base == RX_CPU_BASE ? "RX" : "TX");
34933565 return -ENODEV;
34943566 }
34953567
@@ -3499,19 +3571,41 @@ static int tg3_halt_cpu(struct tg3 *tp, u32 offset) · 3 unmodified lines
34993571 return 0;
35003572 }
35013573
3502−struct fw_info {
3503− unsigned int fw_base;
3504− unsigned int fw_len;
3505− const __be32 *fw_data;
3506−};
3574+static int tg3_fw_data_len(struct tg3 *tp,
3575+ const struct tg3_firmware_hdr *fw_hdr)
3576+{
3577+ int fw_len;
3578+
3579+ /* Non fragmented firmware have one firmware header followed by a
3580+ * contiguous chunk of data to be written. The length field in that
3581+ * header is not the length of data to be written but the complete
3582+ * length of the bss. The data length is determined based on
3583+ * tp->fw->size minus headers.
3584+ *
3585+ * Fragmented firmware have a main header followed by multiple
3586+ * fragments. Each fragment is identical to non fragmented firmware
3587+ * with a firmware header followed by a contiguous chunk of data. In
3588+ * the main header, the length field is unused and set to 0xffffffff.
3589+ * In each fragment header the length is the entire size of that
3590+ * fragment i.e. fragment data + header length. Data length is
3591+ * therefore length field in the header minus TG3_FW_HDR_LEN.
3592+ */
3593+ if (tp->fw_len == 0xffffffff)
3594+ fw_len = be32_to_cpu(fw_hdr->len);
3595+ else
3596+ fw_len = tp->fw->size;
3597+
3598+ return (fw_len - TG3_FW_HDR_LEN) / sizeof(u32);
3599+}
35073600
35083601 /* tp->lock is held. */
35093602 static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base,
35103603 u32 cpu_scratch_base, int cpu_scratch_size,
3511− struct fw_info *info)
3604+ const struct tg3_firmware_hdr *fw_hdr)
35123605 {
3513− int err, lock_err, i;
3606+ int err, i;
35143607 void (*write_op)(struct tg3 *, u32, u32);
3608+ int total_len = tp->fw->size;
35153609
35163610 if (cpu_base == TX_CPU_BASE && tg3_flag(tp, 5705_PLUS)) {
35173611 netdev_err(tp->dev,
@@ -3520,30 +3614,49 @@ static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, · 2 unmodified lines
35203614 return -EINVAL;
35213615 }
35223616
3523− if (tg3_flag(tp, 5705_PLUS))
3617+ if (tg3_flag(tp, 5705_PLUS) && tg3_asic_rev(tp) != ASIC_REV_57766)
35243618 write_op = tg3_write_mem;
35253619 else
35263620 write_op = tg3_write_indirect_reg32;
35273621
3528− /* It is possible that bootcode is still loading at this point.
3529− * Get the nvram lock first before halting the cpu.
3530− */
3531− lock_err = tg3_nvram_lock(tp);
3532− err = tg3_halt_cpu(tp, cpu_base);
3533− if (!lock_err)
3534− tg3_nvram_unlock(tp);
3535− if (err)
3536− goto out;
3622+ if (tg3_asic_rev(tp) != ASIC_REV_57766) {
3623+ /* It is possible that bootcode is still loading at this point.
3624+ * Get the nvram lock first before halting the cpu.
3625+ */
3626+ int lock_err = tg3_nvram_lock(tp);
3627+ err = tg3_halt_cpu(tp, cpu_base);
3628+ if (!lock_err)
3629+ tg3_nvram_unlock(tp);
3630+ if (err)
3631+ goto out;
35373632
3538− for (i = 0; i < cpu_scratch_size; i += sizeof(u32))
3539− write_op(tp, cpu_scratch_base + i, 0);
3540− tw32(cpu_base + CPU_STATE, 0xffffffff);
3541− tw32(cpu_base + CPU_MODE, tr32(cpu_base+CPU_MODE)|CPU_MODE_HALT);
3542− for (i = 0; i < (info->fw_len / sizeof(u32)); i++)
3543− write_op(tp, (cpu_scratch_base +
3544− (info->fw_base & 0xffff) +
3545− (i * sizeof(u32))),
3546− be32_to_cpu(info->fw_data[i]));
3633+ for (i = 0; i < cpu_scratch_size; i += sizeof(u32))
3634+ write_op(tp, cpu_scratch_base + i, 0);
3635+ tw32(cpu_base + CPU_STATE, 0xffffffff);
3636+ tw32(cpu_base + CPU_MODE,
3637+ tr32(cpu_base + CPU_MODE) | CPU_MODE_HALT);
3638+ } else {
3639+ /* Subtract additional main header for fragmented firmware and
3640+ * advance to the first fragment
3641+ */
3642+ total_len -= TG3_FW_HDR_LEN;
3643+ fw_hdr++;
3644+ }
3645+
3646+ do {
3647+ u32 *fw_data = (u32 *)(fw_hdr + 1);
3648+ for (i = 0; i < tg3_fw_data_len(tp, fw_hdr); i++)
3649+ write_op(tp, cpu_scratch_base +
3650+ (be32_to_cpu(fw_hdr->base_addr) & 0xffff) +
3651+ (i * sizeof(u32)),
3652+ be32_to_cpu(fw_data[i]));
3653+
3654+ total_len -= be32_to_cpu(fw_hdr->len);
3655+
3656+ /* Advance to next fragment */
3657+ fw_hdr = (struct tg3_firmware_hdr *)
3658+ ((void *)fw_hdr + be32_to_cpu(fw_hdr->len));
3659+ } while (total_len > 0);
35473660
35483661 err = 0;
35493662
@@ -3551,14 +3664,34 @@ out: · 1 unmodified line
35513664 return err;
35523665 }
35533666
3667+/* tp->lock is held. */
3668+static int tg3_pause_cpu_and_set_pc(struct tg3 *tp, u32 cpu_base, u32 pc)
3669+{
3670+ int i;
3671+ const int iters = 5;
3672+
3673+ tw32(cpu_base + CPU_STATE, 0xffffffff);
3674+ tw32_f(cpu_base + CPU_PC, pc);
3675+
3676+ for (i = 0; i < iters; i++) {
3677+ if (tr32(cpu_base + CPU_PC) == pc)
3678+ break;
3679+ tw32(cpu_base + CPU_STATE, 0xffffffff);
3680+ tw32(cpu_base + CPU_MODE, CPU_MODE_HALT);
3681+ tw32_f(cpu_base + CPU_PC, pc);
3682+ udelay(1000);
3683+ }
3684+
3685+ return (i == iters) ? -EBUSY : 0;
3686+}
3687+
35543688 /* tp->lock is held. */
35553689 static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
35563690 {
3557− struct fw_info info;
3558− const __be32 *fw_data;
3559− int err, i;
3691+ const struct tg3_firmware_hdr *fw_hdr;
3692+ int err;
35603693
3561− fw_data = (void *)tp->fw->data;
3694+ fw_hdr = (struct tg3_firmware_hdr *)tp->fw->data;
35623695
35633696 /* Firmware blob starts with version numbers, followed by
35643697 start address and length. We are setting complete length.
@@ -3566,60 +3699,117 @@ static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp) · 1 unmodified line
35663699 Remainder is the blob to be loaded contiguously
35673700 from start address. */
35683701
3569− info.fw_base = be32_to_cpu(fw_data[1]);
3570− info.fw_len = tp->fw->size - 12;
3571− info.fw_data = &fw_data[3];
3572−
35733702 err = tg3_load_firmware_cpu(tp, RX_CPU_BASE,
35743703 RX_CPU_SCRATCH_BASE, RX_CPU_SCRATCH_SIZE,
3575− &info);
3704+ fw_hdr);
35763705 if (err)
35773706 return err;
35783707
35793708 err = tg3_load_firmware_cpu(tp, TX_CPU_BASE,
35803709 TX_CPU_SCRATCH_BASE, TX_CPU_SCRATCH_SIZE,
3581− &info);
3710+ fw_hdr);
35823711 if (err)
35833712 return err;
35843713
35853714 /* Now startup only the RX cpu. */
3586− tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
3587− tw32_f(RX_CPU_BASE + CPU_PC, info.fw_base);
3588−
3589− for (i = 0; i < 5; i++) {
3590− if (tr32(RX_CPU_BASE + CPU_PC) == info.fw_base)
3591− break;
3592− tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
3593− tw32(RX_CPU_BASE + CPU_MODE, CPU_MODE_HALT);
3594− tw32_f(RX_CPU_BASE + CPU_PC, info.fw_base);
3595− udelay(1000);
3596− }
3597− if (i >= 5) {
3715+ err = tg3_pause_cpu_and_set_pc(tp, RX_CPU_BASE,
3716+ be32_to_cpu(fw_hdr->base_addr));
3717+ if (err) {
35983718 netdev_err(tp->dev, "%s fails to set RX CPU PC, is %08x "
35993719 "should be %08x\n", __func__,
3600− tr32(RX_CPU_BASE + CPU_PC), info.fw_base);
3720+ tr32(RX_CPU_BASE + CPU_PC),
3721+ be32_to_cpu(fw_hdr->base_addr));
36013722 return -ENODEV;
36023723 }
3603− tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
3604− tw32_f(RX_CPU_BASE + CPU_MODE, 0x00000000);
3724+
3725+ tg3_rxcpu_resume(tp);
36053726
36063727 return 0;
36073728 }
36083729
3730+static int tg3_validate_rxcpu_state(struct tg3 *tp)
3731+{
3732+ const int iters = 1000;
3733+ int i;
3734+ u32 val;
3735+
3736+ /* Wait for boot code to complete initialization and enter service
3737+ * loop. It is then safe to download service patches
3738+ */
3739+ for (i = 0; i < iters; i++) {
3740+ if (tr32(RX_CPU_HWBKPT) == TG3_SBROM_IN_SERVICE_LOOP)
3741+ break;
3742+
3743+ udelay(10);
3744+ }
3745+
3746+ if (i == iters) {
3747+ netdev_err(tp->dev, "Boot code not ready for service patches\n");
3748+ return -EBUSY;
3749+ }
3750+
3751+ val = tg3_read_indirect_reg32(tp, TG3_57766_FW_HANDSHAKE);
3752+ if (val & 0xff) {
3753+ netdev_warn(tp->dev,
3754+ "Other patches exist. Not downloading EEE patch\n");
3755+ return -EEXIST;
3756+ }
3757+
3758+ return 0;
3759+}
3760+
3761+/* tp->lock is held. */
3762+static void tg3_load_57766_firmware(struct tg3 *tp)
3763+{
3764+ struct tg3_firmware_hdr *fw_hdr;
3765+
3766+ if (!tg3_flag(tp, NO_NVRAM))
3767+ return;
3768+
3769+ if (tg3_validate_rxcpu_state(tp))
3770+ return;
3771+
3772+ if (!tp->fw)
3773+ return;
3774+
3775+ /* This firmware blob has a different format than older firmware
3776+ * releases as given below. The main difference is we have fragmented
3777+ * data to be written to non-contiguous locations.
3778+ *
3779+ * In the beginning we have a firmware header identical to other
3780+ * firmware which consists of version, base addr and length. The length
3781+ * here is unused and set to 0xffffffff.
3782+ *
3783+ * This is followed by a series of firmware fragments which are
3784+ * individually identical to previous firmware. i.e. they have the
3785+ * firmware header and followed by data for that fragment. The version
3786+ * field of the individual fragment header is unused.
3787+ */
3788+
3789+ fw_hdr = (struct tg3_firmware_hdr *)tp->fw->data;
3790+ if (be32_to_cpu(fw_hdr->base_addr) != TG3_57766_FW_BASE_ADDR)
3791+ return;
3792+
3793+ if (tg3_rxcpu_pause(tp))
3794+ return;
3795+
3796+ /* tg3_load_firmware_cpu() will always succeed for the 57766 */
3797+ tg3_load_firmware_cpu(tp, 0, TG3_57766_FW_BASE_ADDR, 0, fw_hdr);
3798+
3799+ tg3_rxcpu_resume(tp);
3800+}
3801+
36093802 /* tp->lock is held. */
36103803 static int tg3_load_tso_firmware(struct tg3 *tp)
36113804 {
3612− struct fw_info info;
3613− const __be32 *fw_data;
3805+ const struct tg3_firmware_hdr *fw_hdr;
36143806 unsigned long cpu_base, cpu_scratch_base, cpu_scratch_size;
3615− int err, i;
3807+ int err;
36163808
3617− if (tg3_flag(tp, HW_TSO_1) ||
3618− tg3_flag(tp, HW_TSO_2) ||
3619− tg3_flag(tp, HW_TSO_3))
3809+ if (!tg3_flag(tp, FW_TSO))
36203810 return 0;
36213811
3622− fw_data = (void *)tp->fw->data;
3812+ fw_hdr = (struct tg3_firmware_hdr *)tp->fw->data;
36233813
36243814 /* Firmware blob starts with version numbers, followed by
36253815 start address and length. We are setting complete length.
@@ -3627,10 +3817,7 @@ static int tg3_load_tso_firmware(struct tg3 *tp) · 1 unmodified line
36273817 Remainder is the blob to be loaded contiguously
36283818 from start address. */
36293819
3630− info.fw_base = be32_to_cpu(fw_data[1]);
36313820 cpu_scratch_size = tp->fw_len;
3632− info.fw_len = tp->fw->size - 12;
3633− info.fw_data = &fw_data[3];
36343821
36353822 if (tg3_asic_rev(tp) == ASIC_REV_5705) {
36363823 cpu_base = RX_CPU_BASE;
@@ -3643,36 +3830,28 @@ static int tg3_load_tso_firmware(struct tg3 *tp) · 6 unmodified lines
36433830
36443831 err = tg3_load_firmware_cpu(tp, cpu_base,
36453832 cpu_scratch_base, cpu_scratch_size,
3646− &info);
3833+ fw_hdr);
36473834 if (err)
36483835 return err;
36493836
36503837 /* Now startup the cpu. */
3651− tw32(cpu_base + CPU_STATE, 0xffffffff);
3652− tw32_f(cpu_base + CPU_PC, info.fw_base);
3653−
3654− for (i = 0; i < 5; i++) {
3655− if (tr32(cpu_base + CPU_PC) == info.fw_base)
3656− break;
3657− tw32(cpu_base + CPU_STATE, 0xffffffff);
3658− tw32(cpu_base + CPU_MODE, CPU_MODE_HALT);
3659− tw32_f(cpu_base + CPU_PC, info.fw_base);
3660− udelay(1000);
3661− }
3662− if (i >= 5) {
3838+ err = tg3_pause_cpu_and_set_pc(tp, cpu_base,
3839+ be32_to_cpu(fw_hdr->base_addr));
3840+ if (err) {
36633841 netdev_err(tp->dev,
36643842 "%s fails to set CPU PC, is %08x should be %08x\n",
3665− __func__, tr32(cpu_base + CPU_PC), info.fw_base);
3843+ __func__, tr32(cpu_base + CPU_PC),
3844+ be32_to_cpu(fw_hdr->base_addr));
36663845 return -ENODEV;
36673846 }
3668− tw32(cpu_base + CPU_STATE, 0xffffffff);
3669− tw32_f(cpu_base + CPU_MODE, 0x00000000);
3847+
3848+ tg3_resume_cpu(tp, cpu_base);
36703849 return 0;
36713850 }
36723851
36733852
36743853 /* tp->lock is held. */
3675−static void __tg3_set_mac_addr(struct tg3 *tp, int skip_mac_1)
3854+static void __tg3_set_mac_addr(struct tg3 *tp, bool skip_mac_1)
36763855 {
36773856 u32 addr_high, addr_low;
36783857 int i;
@@ -3735,7 +3914,7 @@ static int tg3_power_up(struct tg3 *tp) · 56 unmodified lines
37353914 return err;
37363915 }
37373916
3738−static int tg3_setup_phy(struct tg3 *, int);
3917+static int tg3_setup_phy(struct tg3 *, bool);
37393918
37403919 static int tg3_power_down_prepare(struct tg3 *tp)
37413920 {
@@ -3807,7 +3986,7 @@ static int tg3_power_down_prepare(struct tg3 *tp) · 65 unmodified lines
38073986 tp->phy_flags |= TG3_PHYFLG_IS_LOW_POWER;
38083987
38093988 if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES))
3810− tg3_setup_phy(tp, 0);
3989+ tg3_setup_phy(tp, false);
38113990 }
38123991
38133992 if (tg3_asic_rev(tp) == ASIC_REV_5906) {
@@ -3848,7 +4027,13 @@ static int tg3_power_down_prepare(struct tg3 *tp) · 34 unmodified lines
38484027
38494028 if (tp->phy_flags & TG3_PHYFLG_MII_SERDES)
38504029 mac_mode = MAC_MODE_PORT_MODE_GMII;
3851− else
4030+ else if (tp->phy_flags &
4031+ TG3_PHYFLG_KEEP_LINK_ON_PWRDN) {
4032+ if (tp->link_config.active_speed == SPEED_1000)
4033+ mac_mode = MAC_MODE_PORT_MODE_GMII;
4034+ else
4035+ mac_mode = MAC_MODE_PORT_MODE_MII;
4036+ } else
38524037 mac_mode = MAC_MODE_PORT_MODE_MII;
38534038
38544039 mac_mode |= tp->mac_mode & MAC_MODE_LINK_POLARITY;
@@ -4102,12 +4287,16 @@ static void tg3_phy_copper_begin(struct tg3 *tp) · 247 unmodified lines
41024287 (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)) {
41034288 u32 adv, fc;
41044289
4105− if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) {
4290+ if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) &&
4291+ !(tp->phy_flags & TG3_PHYFLG_KEEP_LINK_ON_PWRDN)) {
41064292 adv = ADVERTISED_10baseT_Half |
41074293 ADVERTISED_10baseT_Full;
41084294 if (tg3_flag(tp, WOL_SPEED_100MB))
41094295 adv |= ADVERTISED_100baseT_Half |
41104296 ADVERTISED_100baseT_Full;
4297+ if (tp->phy_flags & TG3_PHYFLG_1G_ON_VAUX_OK)
4298+ adv |= ADVERTISED_1000baseT_Half |
4299+ ADVERTISED_1000baseT_Full;
41114300
41124301 fc = FLOW_CTRL_TX | FLOW_CTRL_RX;
41134302 } else {
@@ -4121,6 +4310,15 @@ static void tg3_phy_copper_begin(struct tg3 *tp) · 7 unmodified lines
41214310
41224311 tg3_phy_autoneg_cfg(tp, adv, fc);
41234312
4313+ if ((tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER) &&
4314+ (tp->phy_flags & TG3_PHYFLG_KEEP_LINK_ON_PWRDN)) {
4315+ /* Normally during power down we want to autonegotiate
4316+ * the lowest possible speed for WOL. However, to avoid
4317+ * link flap, we leave it untouched.
4318+ */
4319+ return;
4320+ }
4321+
41244322 tg3_writephy(tp, MII_BMCR,
41254323 BMCR_ANENABLE | BMCR_ANRESTART);
41264324 } else {
@@ -4177,6 +4375,103 @@ static void tg3_phy_copper_begin(struct tg3 *tp) · 50 unmodified lines
41774375 }
41784376 }
41794377
4378+static int tg3_phy_pull_config(struct tg3 *tp)
4379+{
4380+ int err;
4381+ u32 val;
4382+
4383+ err = tg3_readphy(tp, MII_BMCR, &val);
4384+ if (err)
4385+ goto done;
4386+
4387+ if (!(val & BMCR_ANENABLE)) {
4388+ tp->link_config.autoneg = AUTONEG_DISABLE;
4389+ tp->link_config.advertising = 0;
4390+ tg3_flag_clear(tp, PAUSE_AUTONEG);
4391+
4392+ err = -EIO;
4393+
4394+ switch (val & (BMCR_SPEED1000 | BMCR_SPEED100)) {
4395+ case 0:
4396+ if (tp->phy_flags & TG3_PHYFLG_ANY_SERDES)
4397+ goto done;
4398+
4399+ tp->link_config.speed = SPEED_10;
4400+ break;
4401+ case BMCR_SPEED100:
4402+ if (tp->phy_flags & TG3_PHYFLG_ANY_SERDES)
4403+ goto done;
4404+
4405+ tp->link_config.speed = SPEED_100;
4406+ break;
4407+ case BMCR_SPEED1000:
4408+ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
4409+ tp->link_config.speed = SPEED_1000;
4410+ break;
4411+ }
4412+ /* Fall through */
4413+ default:
4414+ goto done;
4415+ }
4416+
4417+ if (val & BMCR_FULLDPLX)
4418+ tp->link_config.duplex = DUPLEX_FULL;
4419+ else
4420+ tp->link_config.duplex = DUPLEX_HALF;
4421+
4422+ tp->link_config.flowctrl = FLOW_CTRL_RX | FLOW_CTRL_TX;
4423+
4424+ err = 0;
4425+ goto done;
4426+ }
4427+
4428+ tp->link_config.autoneg = AUTONEG_ENABLE;
4429+ tp->link_config.advertising = ADVERTISED_Autoneg;
4430+ tg3_flag_set(tp, PAUSE_AUTONEG);
4431+
4432+ if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES)) {
4433+ u32 adv;
4434+
4435+ err = tg3_readphy(tp, MII_ADVERTISE, &val);
4436+ if (err)
4437+ goto done;
4438+
4439+ adv = mii_adv_to_ethtool_adv_t(val & ADVERTISE_ALL);
4440+ tp->link_config.advertising |= adv | ADVERTISED_TP;
4441+
4442+ tp->link_config.flowctrl = tg3_decode_flowctrl_1000T(val);
4443+ } else {
4444+ tp->link_config.advertising |= ADVERTISED_FIBRE;
4445+ }
4446+
4447+ if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
4448+ u32 adv;
4449+
4450+ if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES)) {
4451+ err = tg3_readphy(tp, MII_CTRL1000, &val);
4452+ if (err)
4453+ goto done;
4454+
4455+ adv = mii_ctrl1000_to_ethtool_adv_t(val);
4456+ } else {
4457+ err = tg3_readphy(tp, MII_ADVERTISE, &val);
4458+ if (err)
4459+ goto done;
4460+
4461+ adv = tg3_decode_flowctrl_1000X(val);
4462+ tp->link_config.flowctrl = adv;
4463+
4464+ val &= (ADVERTISE_1000XHALF | ADVERTISE_1000XFULL);
4465+ adv = mii_adv_to_ethtool_adv_x(val);
4466+ }
4467+
4468+ tp->link_config.advertising |= adv;
4469+ }
4470+
4471+done:
4472+ return err;
4473+}
4474+
41804475 static int tg3_init_5401phy_dsp(struct tg3 *tp)
41814476 {
41824477 int err;
@@ -4196,6 +4491,32 @@ static int tg3_init_5401phy_dsp(struct tg3 *tp) · 13 unmodified lines
41964491 return err;
41974492 }
41984493
4494+static bool tg3_phy_eee_config_ok(struct tg3 *tp)
4495+{
4496+ u32 val;
4497+ u32 tgtadv = 0;
4498+ u32 advertising = tp->link_config.advertising;
4499+
4500+ if (!(tp->phy_flags & TG3_PHYFLG_EEE_CAP))
4501+ return true;
4502+
4503+ if (tg3_phy_cl45_read(tp, MDIO_MMD_AN, MDIO_AN_EEE_ADV, &val))
4504+ return false;
4505+
4506+ val &= (MDIO_AN_EEE_ADV_100TX | MDIO_AN_EEE_ADV_1000T);
4507+
4508+
4509+ if (advertising & ADVERTISED_100baseT_Full)
4510+ tgtadv |= MDIO_AN_EEE_ADV_100TX;
4511+ if (advertising & ADVERTISED_1000baseT_Full)
4512+ tgtadv |= MDIO_AN_EEE_ADV_1000T;
4513+
4514+ if (val != tgtadv)
4515+ return false;
4516+
4517+ return true;
4518+}
4519+
41994520 static bool tg3_phy_copper_an_config_ok(struct tg3 *tp, u32 *lcladv)
42004521 {
42014522 u32 advmsk, tgtadv, advertising;
@@ -4262,7 +4583,7 @@ static bool tg3_phy_copper_fetch_rmtadv(struct tg3 *tp, u32 *rmtadv) · 60 unmodified lines
42624583 return true;
42634584 }
42644585
4265−static bool tg3_test_and_report_link_chg(struct tg3 *tp, int curr_link_up)
4586+static bool tg3_test_and_report_link_chg(struct tg3 *tp, bool curr_link_up)
42664587 {
42674588 if (curr_link_up != tp->link_up) {
42684589 if (curr_link_up) {
@@ -4280,23 +4601,28 @@ static bool tg3_test_and_report_link_chg(struct tg3 *tp, int curr_link_up) · 11 unmodified lines
42804601 return false;
42814602 }
42824603
4283−static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset)
4604+static void tg3_clear_mac_status(struct tg3 *tp)
42844605 {
4285− int current_link_up;
4606+ tw32(MAC_EVENT, 0);
4607+
4608+ tw32_f(MAC_STATUS,
4609+ MAC_STATUS_SYNC_CHANGED |
4610+ MAC_STATUS_CFG_CHANGED |
4611+ MAC_STATUS_MI_COMPLETION |
4612+ MAC_STATUS_LNKSTATE_CHANGED);
4613+ udelay(40);
4614+}
4615+
4616+static int tg3_setup_copper_phy(struct tg3 *tp, bool force_reset)
4617+{
4618+ bool current_link_up;
42864619 u32 bmsr, val;
42874620 u32 lcl_adv, rmt_adv;
42884621 u16 current_speed;
42894622 u8 current_duplex;
42904623 int i, err;
42914624
4292− tw32(MAC_EVENT, 0);
4293−
4294− tw32_f(MAC_STATUS,
4295− (MAC_STATUS_SYNC_CHANGED |
4296− MAC_STATUS_CFG_CHANGED |
4297− MAC_STATUS_MI_COMPLETION |
4298− MAC_STATUS_LNKSTATE_CHANGED));
4299− udelay(40);
4625+ tg3_clear_mac_status(tp);
43004626
43014627 if ((tp->mi_mode & MAC_MI_MODE_AUTO_POLL) != 0) {
43024628 tw32_f(MAC_MI_MODE,
@@ -4316,7 +4642,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset) · 13 unmodified lines
43164642 tg3_readphy(tp, MII_BMSR, &bmsr);
43174643 if (!tg3_readphy(tp, MII_BMSR, &bmsr) &&
43184644 !(bmsr & BMSR_LSTATUS))
4319− force_reset = 1;
4645+ force_reset = true;
43204646 }
43214647 if (force_reset)
43224648 tg3_phy_reset(tp);
@@ -4380,7 +4706,7 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset) · 57 unmodified lines
43804706 tg3_writephy(tp, MII_TG3_EXT_CTRL, 0);
43814707 }
43824708
4383− current_link_up = 0;
4709+ current_link_up = false;
43844710 current_speed = SPEED_UNKNOWN;
43854711 current_duplex = DUPLEX_UNKNOWN;
43864712 tp->phy_flags &= ~TG3_PHYFLG_MDIX_STATE;
@@ -4439,21 +4765,31 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset) · 52 unmodified lines
44394765 tp->link_config.active_duplex = current_duplex;
44404766
44414767 if (tp->link_config.autoneg == AUTONEG_ENABLE) {
4768+ bool eee_config_ok = tg3_phy_eee_config_ok(tp);
4769+
44424770 if ((bmcr & BMCR_ANENABLE) &&
4771+ eee_config_ok &&
44434772 tg3_phy_copper_an_config_ok(tp, &lcl_adv) &&
44444773 tg3_phy_copper_fetch_rmtadv(tp, &rmt_adv))
4445− current_link_up = 1;
4774+ current_link_up = true;
4775+
4776+ /* EEE settings changes take effect only after a phy
4777+ * reset. If we have skipped a reset due to Link Flap
4778+ * Avoidance being enabled, do it now.
4779+ */
4780+ if (!eee_config_ok &&
4781+ (tp->phy_flags & TG3_PHYFLG_KEEP_LINK_ON_PWRDN) &&
4782+ !force_reset)
4783+ tg3_phy_reset(tp);
44464784 } else {
44474785 if (!(bmcr & BMCR_ANENABLE) &&
44484786 tp->link_config.speed == current_speed &&
4449− tp->link_config.duplex == current_duplex &&
4450− tp->link_config.flowctrl ==
4451− tp->link_config.active_flowctrl) {
4452− current_link_up = 1;
4787+ tp->link_config.duplex == current_duplex) {
4788+ current_link_up = true;
44534789 }
44544790 }
44554791
4456− if (current_link_up == 1 &&
4792+ if (current_link_up &&
44574793 tp->link_config.active_duplex == DUPLEX_FULL) {
44584794 u32 reg, bit;
44594795
@@ -4473,11 +4809,11 @@ static int tg3_setup_copper_phy(struct tg3 *tp, int force_reset) · 13 unmodified lines
44734809 }
44744810
44754811 relink:
4476− if (current_link_up == 0 || (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)) {
4812+ if (!current_link_up || (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)) {
44774813 tg3_phy_copper_begin(tp);
44784814
44794815 if (tg3_flag(tp, ROBOSWITCH)) {
4480− current_link_up = 1;
4816+ current_link_up = true;
44814817 /* FIXME: when BCM5325 switch is used use 100 MBit/s */
44824818 current_speed = SPEED_1000;
44834819 current_duplex = DUPLEX_FULL;
@@ -4488,11 +4824,11 @@ relink: · 4 unmodified lines
44884824 tg3_readphy(tp, MII_BMSR, &bmsr);
44894825 if ((!tg3_readphy(tp, MII_BMSR, &bmsr) && (bmsr & BMSR_LSTATUS)) ||
44904826 (tp->mac_mode & MAC_MODE_PORT_INT_LPBACK))
4491− current_link_up = 1;
4827+ current_link_up = true;
44924828 }
44934829
44944830 tp->mac_mode &= ~MAC_MODE_PORT_MODE_MASK;
4495− if (current_link_up == 1) {
4831+ if (current_link_up) {
44964832 if (tp->link_config.active_speed == SPEED_100 ||
44974833 tp->link_config.active_speed == SPEED_10)
44984834 tp->mac_mode |= MAC_MODE_PORT_MODE_MII;
@@ -4528,7 +4864,7 @@ relink: · 29 unmodified lines
45284864 tp->mac_mode |= MAC_MODE_HALF_DUPLEX;
45294865
45304866 if (tg3_asic_rev(tp) == ASIC_REV_5700) {
4531− if (current_link_up == 1 &&
4867+ if (current_link_up &&
45324868 tg3_5700_link_polarity(tp, tp->link_config.active_speed))
45334869 tp->mac_mode |= MAC_MODE_LINK_POLARITY;
45344870 else
@@ -4559,7 +4895,7 @@ relink: · 24 unmodified lines
45594895 udelay(40);
45604896
45614897 if (tg3_asic_rev(tp) == ASIC_REV_5700 &&
4562− current_link_up == 1 &&
4898+ current_link_up &&
45634899 tp->link_config.active_speed == SPEED_1000 &&
45644900 (tg3_flag(tp, PCIX_MODE) || tg3_flag(tp, PCI_HIGH_SPEED))) {
45654901 udelay(120);
@@ -4999,19 +5335,19 @@ static void tg3_init_bcm8002(struct tg3 *tp) · 433 unmodified lines
49995335 tg3_writephy(tp, 0x10, 0x8011);
50005336 }
50015337
5002−static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status)
5338+static bool tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status)
50035339 {
50045340 u16 flowctrl;
5341+ bool current_link_up;
50055342 u32 sg_dig_ctrl, sg_dig_status;
50065343 u32 serdes_cfg, expected_sg_dig_ctrl;
50075344 int workaround, port_a;
5008− int current_link_up;
50095345
50105346 serdes_cfg = 0;
50115347 expected_sg_dig_ctrl = 0;
50125348 workaround = 0;
50135349 port_a = 1;
5014− current_link_up = 0;
5350+ current_link_up = false;
50155351
50165352 if (tg3_chip_rev_id(tp) != CHIPREV_ID_5704_A0 &&
50175353 tg3_chip_rev_id(tp) != CHIPREV_ID_5704_A1) {
@@ -5042,7 +5378,7 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status) · 24 unmodified lines
50425378 }
50435379 if (mac_status & MAC_STATUS_PCS_SYNCED) {
50445380 tg3_setup_flow_control(tp, 0, 0);
5045− current_link_up = 1;
5381+ current_link_up = true;
50465382 }
50475383 goto out;
50485384 }
@@ -5063,7 +5399,7 @@ static int tg3_setup_fiber_hw_autoneg(struct tg3 *tp, u32 mac_status) · 14 unmodified lines
50635399 MAC_STATUS_RCVD_CFG)) ==
50645400 MAC_STATUS_PCS_SYNCED)) {
50655401 tp->serdes_counter--;
5066− current_link_up = 1;
5402+ current_link_up = true;
50675403 goto out;
50685404 }
50695405 restart_autoneg:
@@ -5098,7 +5434,7 @@ restart_autoneg: · 28 unmodified lines
50985434 mii_adv_to_ethtool_adv_x(remote_adv);
50995435
51005436 tg3_setup_flow_control(tp, local_adv, remote_adv);
5101− current_link_up = 1;
5437+ current_link_up = true;
51025438 tp->serdes_counter = 0;
51035439 tp->phy_flags &= ~TG3_PHYFLG_PARALLEL_DETECT;
51045440 } else if (!(sg_dig_status & SG_DIG_AUTONEG_COMPLETE)) {
@@ -5126,7 +5462,7 @@ restart_autoneg: · 21 unmodified lines
51265462 if ((mac_status & MAC_STATUS_PCS_SYNCED) &&
51275463 !(mac_status & MAC_STATUS_RCVD_CFG)) {
51285464 tg3_setup_flow_control(tp, 0, 0);
5129− current_link_up = 1;
5465+ current_link_up = true;
51305466 tp->phy_flags |=
51315467 TG3_PHYFLG_PARALLEL_DETECT;
51325468 tp->serdes_counter =
@@ -5144,9 +5480,9 @@ out: · 11 unmodified lines
51445480 return current_link_up;
51455481 }
51465482
5147−static int tg3_setup_fiber_by_hand(struct tg3 *tp, u32 mac_status)
5483+static bool tg3_setup_fiber_by_hand(struct tg3 *tp, u32 mac_status)
51485484 {
5149− int current_link_up = 0;
5485+ bool current_link_up = false;
51505486
51515487 if (!(mac_status & MAC_STATUS_PCS_SYNCED))
51525488 goto out;
@@ -5173,7 +5509,7 @@ static int tg3_setup_fiber_by_hand(struct tg3 *tp, u32 mac_status) · 20 unmodified lines
51735509
51745510 tg3_setup_flow_control(tp, local_adv, remote_adv);
51755511
5176− current_link_up = 1;
5512+ current_link_up = true;
51775513 }
51785514 for (i = 0; i < 30; i++) {
51795515 udelay(20);
@@ -5188,15 +5524,15 @@ static int tg3_setup_fiber_by_hand(struct tg3 *tp, u32 mac_status) · 8 unmodified lines
51885524 }
51895525
51905526 mac_status = tr32(MAC_STATUS);
5191− if (current_link_up == 0 &&
5527+ if (!current_link_up &&
51925528 (mac_status & MAC_STATUS_PCS_SYNCED) &&
51935529 !(mac_status & MAC_STATUS_RCVD_CFG))
5194− current_link_up = 1;
5530+ current_link_up = true;
51955531 } else {
51965532 tg3_setup_flow_control(tp, 0, 0);
51975533
51985534 /* Forcing 1000FD link up. */
5199− current_link_up = 1;
5535+ current_link_up = true;
52005536
52015537 tw32_f(MAC_MODE, (tp->mac_mode | MAC_MODE_SEND_CONFIGS));
52025538 udelay(40);
@@ -5209,13 +5545,13 @@ out: · 6 unmodified lines
52095545 return current_link_up;
52105546 }
52115547
5212−static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset)
5548+static int tg3_setup_fiber_phy(struct tg3 *tp, bool force_reset)
52135549 {
52145550 u32 orig_pause_cfg;
52155551 u16 orig_active_speed;
52165552 u8 orig_active_duplex;
52175553 u32 mac_status;
5218− int current_link_up;
5554+ bool current_link_up;
52195555 int i;
52205556
52215557 orig_pause_cfg = tp->link_config.active_flowctrl;
@@ -5252,7 +5588,7 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset) · 30 unmodified lines
52525588 tw32_f(MAC_EVENT, MAC_EVENT_LNKSTATE_CHANGED);
52535589 udelay(40);
52545590
5255− current_link_up = 0;
5591+ current_link_up = false;
52565592 tp->link_config.rmt_adv = 0;
52575593 mac_status = tr32(MAC_STATUS);
52585594
@@ -5277,7 +5613,7 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset) · 18 unmodified lines
52775613
52785614 mac_status = tr32(MAC_STATUS);
52795615 if ((mac_status & MAC_STATUS_PCS_SYNCED) == 0) {
5280− current_link_up = 0;
5616+ current_link_up = false;
52815617 if (tp->link_config.autoneg == AUTONEG_ENABLE &&
52825618 tp->serdes_counter == 0) {
52835619 tw32_f(MAC_MODE, (tp->mac_mode |
@@ -5287,7 +5623,7 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset) · 3 unmodified lines
52875623 }
52885624 }
52895625
5290− if (current_link_up == 1) {
5626+ if (current_link_up) {
52915627 tp->link_config.active_speed = SPEED_1000;
52925628 tp->link_config.active_duplex = DUPLEX_FULL;
52935629 tw32(MAC_LED_CTRL, (tp->led_ctrl |
@@ -5312,33 +5648,63 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset) · 18 unmodified lines
53125648 return 0;
53135649 }
53145650
5315−static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
5651+static int tg3_setup_fiber_mii_phy(struct tg3 *tp, bool force_reset)
53165652 {
5317− int current_link_up, err = 0;
5653+ int err = 0;
53185654 u32 bmsr, bmcr;
5319− u16 current_speed;
5320− u8 current_duplex;
5321− u32 local_adv, remote_adv;
5655+ u16 current_speed = SPEED_UNKNOWN;
5656+ u8 current_duplex = DUPLEX_UNKNOWN;
5657+ bool current_link_up = false;
5658+ u32 local_adv, remote_adv, sgsr;
5659+
5660+ if ((tg3_asic_rev(tp) == ASIC_REV_5719 ||
5661+ tg3_asic_rev(tp) == ASIC_REV_5720) &&
5662+ !tg3_readphy(tp, SERDES_TG3_1000X_STATUS, &sgsr) &&
5663+ (sgsr & SERDES_TG3_SGMII_MODE)) {
5664+
5665+ if (force_reset)
5666+ tg3_phy_reset(tp);
5667+
5668+ tp->mac_mode &= ~MAC_MODE_PORT_MODE_MASK;
5669+
5670+ if (!(sgsr & SERDES_TG3_LINK_UP)) {
5671+ tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
5672+ } else {
5673+ current_link_up = true;
5674+ if (sgsr & SERDES_TG3_SPEED_1000) {
5675+ current_speed = SPEED_1000;
5676+ tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
5677+ } else if (sgsr & SERDES_TG3_SPEED_100) {
5678+ current_speed = SPEED_100;
5679+ tp->mac_mode |= MAC_MODE_PORT_MODE_MII;
5680+ } else {
5681+ current_speed = SPEED_10;
5682+ tp->mac_mode |= MAC_MODE_PORT_MODE_MII;
5683+ }
5684+
5685+ if (sgsr & SERDES_TG3_FULL_DUPLEX)
5686+ current_duplex = DUPLEX_FULL;
5687+ else
5688+ current_duplex = DUPLEX_HALF;
5689+ }
5690+
5691+ tw32_f(MAC_MODE, tp->mac_mode);
5692+ udelay(40);
5693+
5694+ tg3_clear_mac_status(tp);
5695+
5696+ goto fiber_setup_done;
5697+ }
53225698
53235699 tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
53245700 tw32_f(MAC_MODE, tp->mac_mode);
53255701 udelay(40);
53265702
5327− tw32(MAC_EVENT, 0);
5328−
5329− tw32_f(MAC_STATUS,
5330− (MAC_STATUS_SYNC_CHANGED |
5331− MAC_STATUS_CFG_CHANGED |
5332− MAC_STATUS_MI_COMPLETION |
5333− MAC_STATUS_LNKSTATE_CHANGED));
5334− udelay(40);
5703+ tg3_clear_mac_status(tp);
53355704
53365705 if (force_reset)
53375706 tg3_phy_reset(tp);
53385707
5339− current_link_up = 0;
5340− current_speed = SPEED_UNKNOWN;
5341− current_duplex = DUPLEX_UNKNOWN;
53425708 tp->link_config.rmt_adv = 0;
53435709
53445710 err |= tg3_readphy(tp, MII_BMSR, &bmsr);
@@ -5424,7 +5790,7 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset) · 79 unmodified lines
54245790
54255791 if (bmsr & BMSR_LSTATUS) {
54265792 current_speed = SPEED_1000;
5427− current_link_up = 1;
5793+ current_link_up = true;
54285794 if (bmcr & BMCR_FULLDPLX)
54295795 current_duplex = DUPLEX_FULL;
54305796 else
@@ -5451,12 +5817,13 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset) · 20 unmodified lines
54515817 } else if (!tg3_flag(tp, 5780_CLASS)) {
54525818 /* Link is up via parallel detect */
54535819 } else {
5454− current_link_up = 0;
5820+ current_link_up = false;
54555821 }
54565822 }
54575823 }
54585824
5459− if (current_link_up == 1 && current_duplex == DUPLEX_FULL)
5825+fiber_setup_done:
5826+ if (current_link_up && current_duplex == DUPLEX_FULL)
54605827 tg3_setup_flow_control(tp, local_adv, remote_adv);
54615828
54625829 tp->mac_mode &= ~MAC_MODE_HALF_DUPLEX;
@@ -5535,7 +5902,7 @@ static void tg3_serdes_parallel_detect(struct tg3 *tp) · 72 unmodified lines
55355902 }
55365903 }
55375904
5538−static int tg3_setup_phy(struct tg3 *tp, int force_reset)
5905+static int tg3_setup_phy(struct tg3 *tp, bool force_reset)
55395906 {
55405907 u32 val;
55415908 int err;
@@ -5625,10 +5992,13 @@ static int tg3_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) · 83 unmodified lines
56255992
56265993 info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE |
56275994 SOF_TIMESTAMPING_RX_SOFTWARE |
5628− SOF_TIMESTAMPING_SOFTWARE |
5629− SOF_TIMESTAMPING_TX_HARDWARE |
5630− SOF_TIMESTAMPING_RX_HARDWARE |
5631− SOF_TIMESTAMPING_RAW_HARDWARE;
5995+ SOF_TIMESTAMPING_SOFTWARE;
5996+
5997+ if (tg3_flag(tp, PTP_CAPABLE)) {
5998+ info->so_timestamping |= SOF_TIMESTAMPING_TX_HARDWARE |
5999+ SOF_TIMESTAMPING_RX_HARDWARE |
6000+ SOF_TIMESTAMPING_RAW_HARDWARE;
6001+ }
56326002
56336003 if (tp->ptp_clock)
56346004 info->phc_index = ptp_clock_index(tp->ptp_clock);
@@ -6348,7 +6718,7 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget) · 713 unmodified lines
63486718
63496719 if (desc->type_flags & RXD_FLAG_VLAN &&
63506720 !(tp->rx_mode & RX_MODE_KEEP_VLAN_TAG))
6351− __vlan_hwaccel_put_tag(skb,
6721+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q),
63526722 desc->err_vlan & RXD_VLAN_MASK);
63536723
63546724 napi_gro_receive(&tnapi->napi, skb);
@@ -6436,7 +6806,7 @@ static void tg3_poll_link(struct tg3 *tp) · 81 unmodified lines
64366806 MAC_STATUS_LNKSTATE_CHANGED));
64376807 udelay(40);
64386808 } else
6439− tg3_setup_phy(tp, 0);
6809+ tg3_setup_phy(tp, false);
64406810 spin_unlock(&tp->lock);
64416811 }
64426812 }
@@ -7533,7 +7903,7 @@ static int tg3_phy_lpbk_set(struct tg3 *tp, u32 speed, bool extlpbk) · 1090 unmodified lines
75337903 u32 val, bmcr, mac_mode, ptest = 0;
75347904
75357905 tg3_phy_toggle_apd(tp, false);
7536− tg3_phy_toggle_automdix(tp, 0);
7906+ tg3_phy_toggle_automdix(tp, false);
75377907
75387908 if (extlpbk && tg3_phy_set_extloopbk(tp))
75397909 return -EIO;
@@ -7641,7 +8011,7 @@ static void tg3_set_loopback(struct net_device *dev, netdev_features_t features) · 101 unmodified lines
76418011 spin_lock_bh(&tp->lock);
76428012 tg3_mac_loopback(tp, false);
76438013 /* Force link status check */
7644− tg3_setup_phy(tp, 1);
8014+ tg3_setup_phy(tp, true);
76458015 spin_unlock_bh(&tp->lock);
76468016 netdev_info(dev, "Internal MAC loopback mode disabled.\n");
76478017 }
@@ -8039,11 +8409,9 @@ static int tg3_mem_rx_acquire(struct tg3 *tp) · 391 unmodified lines
80398409 tnapi->rx_rcb = dma_alloc_coherent(&tp->pdev->dev,
80408410 TG3_RX_RCB_RING_BYTES(tp),
80418411 &tnapi->rx_rcb_mapping,
8042− GFP_KERNEL);
8412+ GFP_KERNEL | __GFP_ZERO);
80438413 if (!tnapi->rx_rcb)
80448414 goto err_out;
8045−
8046− memset(tnapi->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
80478415 }
80488416
80498417 return 0;
@@ -8093,12 +8461,10 @@ static int tg3_alloc_consistent(struct tg3 *tp) · 43 unmodified lines
80938461 tp->hw_stats = dma_alloc_coherent(&tp->pdev->dev,
80948462 sizeof(struct tg3_hw_stats),
80958463 &tp->stats_mapping,
8096− GFP_KERNEL);
8464+ GFP_KERNEL | __GFP_ZERO);
80978465 if (!tp->hw_stats)
80988466 goto err_out;
80998467
8100− memset(tp->hw_stats, 0, sizeof(struct tg3_hw_stats));
8101−
81028468 for (i = 0; i < tp->irq_cnt; i++) {
81038469 struct tg3_napi *tnapi = &tp->napi[i];
81048470 struct tg3_hw_status *sblk;
@@ -8106,11 +8472,10 @@ static int tg3_alloc_consistent(struct tg3 *tp) · 1 unmodified line
81068472 tnapi->hw_status = dma_alloc_coherent(&tp->pdev->dev,
81078473 TG3_HW_STATUS_SIZE,
81088474 &tnapi->status_mapping,
8109− GFP_KERNEL);
8475+ GFP_KERNEL | __GFP_ZERO);
81108476 if (!tnapi->hw_status)
81118477 goto err_out;
81128478
8113− memset(tnapi->hw_status, 0, TG3_HW_STATUS_SIZE);
81148479 sblk = tnapi->hw_status;
81158480
81168481 if (tg3_flag(tp, ENABLE_RSS)) {
@@ -8157,7 +8522,7 @@ err_out: · 40 unmodified lines
81578522 /* To stop a block, clear the enable bit and poll till it
81588523 * clears. tp->lock is held.
81598524 */
8160−static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, int silent)
8525+static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, bool silent)
81618526 {
81628527 unsigned int i;
81638528 u32 val;
@@ -8201,7 +8566,7 @@ static int tg3_stop_block(struct tg3 *tp, unsigned long ofs, u32 enable_bit, int · 37 unmodified lines
82018566 }
82028567
82038568 /* tp->lock is held. */
8204−static int tg3_abort_hw(struct tg3 *tp, int silent)
8569+static int tg3_abort_hw(struct tg3 *tp, bool silent)
82058570 {
82068571 int i, err;
82078572
@@ -8561,6 +8926,9 @@ static int tg3_chip_reset(struct tg3 *tp) · 353 unmodified lines
85618926
85628927 /* Reprobe ASF enable state. */
85638928 tg3_flag_clear(tp, ENABLE_ASF);
8929+ tp->phy_flags &= ~(TG3_PHYFLG_1G_ON_VAUX_OK |
8930+ TG3_PHYFLG_KEEP_LINK_ON_PWRDN);
8931+
85648932 tg3_flag_clear(tp, ASF_NEW_HANDSHAKE);
85658933 tg3_read_mem(tp, NIC_SRAM_DATA_SIG, &val);
85668934 if (val == NIC_SRAM_DATA_SIG_MAGIC) {
@@ -8572,6 +8940,12 @@ static int tg3_chip_reset(struct tg3 *tp) · 5 unmodified lines
85728940 tp->last_event_jiffies = jiffies;
85738941 if (tg3_flag(tp, 5750_PLUS))
85748942 tg3_flag_set(tp, ASF_NEW_HANDSHAKE);
8943+
8944+ tg3_read_mem(tp, NIC_SRAM_DATA_CFG_3, &nic_cfg);
8945+ if (nic_cfg & NIC_SRAM_1G_ON_VAUX_OK)
8946+ tp->phy_flags |= TG3_PHYFLG_1G_ON_VAUX_OK;
8947+ if (nic_cfg & NIC_SRAM_LNK_FLAP_AVOID)
8948+ tp->phy_flags |= TG3_PHYFLG_KEEP_LINK_ON_PWRDN;
85758949 }
85768950 }
85778951
@@ -8582,7 +8956,7 @@ static void tg3_get_nstats(struct tg3 *, struct rtnl_link_stats64 *); · 4 unmodified lines
85828956 static void tg3_get_estats(struct tg3 *, struct tg3_ethtool_stats *);
85838957
85848958 /* tp->lock is held. */
8585−static int tg3_halt(struct tg3 *tp, int kind, int silent)
8959+static int tg3_halt(struct tg3 *tp, int kind, bool silent)
85868960 {
85878961 int err;
85888962
@@ -8593,7 +8967,7 @@ static int tg3_halt(struct tg3 *tp, int kind, int silent) · 4 unmodified lines
85938967 tg3_abort_hw(tp, silent);
85948968 err = tg3_chip_reset(tp);
85958969
8596− __tg3_set_mac_addr(tp, 0);
8970+ __tg3_set_mac_addr(tp, false);
85978971
85988972 tg3_write_sig_legacy(tp, kind);
85998973 tg3_write_sig_post_reset(tp, kind);
@@ -8617,7 +8991,8 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p) · 17 unmodified lines
86178991 {
86188992 struct tg3 *tp = netdev_priv(dev);
86198993 struct sockaddr *addr = p;
8620− int err = 0, skip_mac_1 = 0;
8994+ int err = 0;
8995+ bool skip_mac_1 = false;
86218996
86228997 if (!is_valid_ether_addr(addr->sa_data))
86238998 return -EADDRNOTAVAIL;
@@ -8638,7 +9013,7 @@ static int tg3_set_mac_addr(struct net_device *dev, void *p) · 14 unmodified lines
86389013 /* Skip MAC addr 1 if ASF is using it. */
86399014 if ((addr0_high != addr1_high || addr0_low != addr1_low) &&
86409015 !(addr1_high == 0 && addr1_low == 0))
8641− skip_mac_1 = 1;
9016+ skip_mac_1 = true;
86429017 }
86439018 spin_lock_bh(&tp->lock);
86449019 __tg3_set_mac_addr(tp, skip_mac_1);
@@ -9057,7 +9432,7 @@ static void tg3_rss_write_indir_tbl(struct tg3 *tp) · 412 unmodified lines
90579432 }
90589433
90599434 /* tp->lock is held. */
9060−static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
9435+static int tg3_reset_hw(struct tg3 *tp, bool reset_phy)
90619436 {
90629437 u32 val, rdmac_mode;
90639438 int i, err, limit;
@@ -9106,6 +9481,12 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) · 42 unmodified lines
91069481 TG3_CPMU_DBTMR2_TXIDXEQ_2047US);
91079482 }
91089483
9484+ if ((tp->phy_flags & TG3_PHYFLG_KEEP_LINK_ON_PWRDN) &&
9485+ !(tp->phy_flags & TG3_PHYFLG_USER_CONFIGURED)) {
9486+ tg3_phy_pull_config(tp);
9487+ tp->phy_flags |= TG3_PHYFLG_USER_CONFIGURED;
9488+ }
9489+
91099490 if (reset_phy)
91109491 tg3_phy_reset(tp);
91119492
@@ -9444,7 +9825,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) · 332 unmodified lines
94449825 tg3_rings_reset(tp);
94459826
94469827 /* Initialize MAC address and backoff seed. */
9447− __tg3_set_mac_addr(tp, 0);
9828+ __tg3_set_mac_addr(tp, false);
94489829
94499830 /* MTU + ethernet header + FCS + optional VLAN tag */
94509831 tw32(MAC_RX_MTU_SIZE,
@@ -9781,6 +10162,13 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) · 330 unmodified lines
978110162 return err;
978210163 }
978310164
10165+ if (tg3_asic_rev(tp) == ASIC_REV_57766) {
10166+ /* Ignore any errors for the firmware download. If download
10167+ * fails, the device will operate with EEE disabled
10168+ */
10169+ tg3_load_57766_firmware(tp);
10170+ }
10171+
978410172 if (tg3_flag(tp, TSO_CAPABLE)) {
978510173 err = tg3_load_tso_firmware(tp);
978610174 if (err)
@@ -9888,7 +10276,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) · 101 unmodified lines
988810276 if (tp->phy_flags & TG3_PHYFLG_IS_LOW_POWER)
988910277 tp->phy_flags &= ~TG3_PHYFLG_IS_LOW_POWER;
989010278
9891− err = tg3_setup_phy(tp, 0);
10279+ err = tg3_setup_phy(tp, false);
989210280 if (err)
989310281 return err;
989410282
@@ -9968,7 +10356,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) · 73 unmodified lines
996810356 /* Called at device open time to get the chip ready for
996910357 * packet processing. Invoked with tp->lock held.
997010358 */
9971−static int tg3_init_hw(struct tg3 *tp, int reset_phy)
10359+static int tg3_init_hw(struct tg3 *tp, bool reset_phy)
997210360 {
997310361 tg3_switch_clocks(tp);
997410362
@@ -10229,7 +10617,7 @@ static void tg3_timer(unsigned long __opaque) · 254 unmodified lines
1022910617 phy_event = 1;
1023010618
1023110619 if (phy_event)
10232− tg3_setup_phy(tp, 0);
10620+ tg3_setup_phy(tp, false);
1023310621 } else if (tg3_flag(tp, POLL_SERDES)) {
1023410622 u32 mac_stat = tr32(MAC_STATUS);
1023510623 int need_setup = 0;
@@ -10252,7 +10640,7 @@ static void tg3_timer(unsigned long __opaque) · 16 unmodified lines
1025210640 tw32_f(MAC_MODE, tp->mac_mode);
1025310641 udelay(40);
1025410642 }
10255− tg3_setup_phy(tp, 0);
10643+ tg3_setup_phy(tp, false);
1025610644 }
1025710645 } else if ((tp->phy_flags & TG3_PHYFLG_MII_SERDES) &&
1025810646 tg3_flag(tp, 5780_CLASS)) {
@@ -10338,7 +10726,7 @@ static void tg3_timer_stop(struct tg3 *tp) · 79 unmodified lines
1033810726 /* Restart hardware after configuration changes, self-test, etc.
1033910727 * Invoked with tp->lock held.
1034010728 */
10341−static int tg3_restart_hw(struct tg3 *tp, int reset_phy)
10729+static int tg3_restart_hw(struct tg3 *tp, bool reset_phy)
1034210730 __releases(tp->lock)
1034310731 __acquires(tp->lock)
1034410732 {
@@ -10388,7 +10776,7 @@ static void tg3_reset_task(struct work_struct *work) · 43 unmodified lines
1038810776 }
1038910777
1039010778 tg3_halt(tp, RESET_KIND_SHUTDOWN, 0);
10391− err = tg3_init_hw(tp, 1);
10779+ err = tg3_init_hw(tp, true);
1039210780 if (err)
1039310781 goto out;
1039410782
@@ -10558,7 +10946,7 @@ static int tg3_test_msi(struct tg3 *tp) · 163 unmodified lines
1055810946 tg3_full_lock(tp, 1);
1055910947
1056010948 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
10561− err = tg3_init_hw(tp, 1);
10949+ err = tg3_init_hw(tp, true);
1056210950
1056310951 tg3_full_unlock(tp);
1056410952
@@ -10570,7 +10958,7 @@ static int tg3_test_msi(struct tg3 *tp) · 5 unmodified lines
1057010958
1057110959 static int tg3_request_firmware(struct tg3 *tp)
1057210960 {
10573− const __be32 *fw_data;
10961+ const struct tg3_firmware_hdr *fw_hdr;
1057410962
1057510963 if (request_firmware(&tp->fw, tp->fw_needed, &tp->pdev->dev)) {
1057610964 netdev_err(tp->dev, "Failed to load firmware \"%s\"\n",
@@ -10578,15 +10966,15 @@ static int tg3_request_firmware(struct tg3 *tp) · 1 unmodified line
1057810966 return -ENOENT;
1057910967 }
1058010968
10581− fw_data = (void *)tp->fw->data;
10969+ fw_hdr = (struct tg3_firmware_hdr *)tp->fw->data;
1058210970
1058310971 /* Firmware blob starts with version numbers, followed by
1058410972 * start address and _full_ length including BSS sections
1058510973 * (which must be longer than the actual data, of course
1058610974 */
1058710975
10588− tp->fw_len = be32_to_cpu(fw_data[2]); /* includes bss */
10589− if (tp->fw_len < (tp->fw->size - 12)) {
10976+ tp->fw_len = be32_to_cpu(fw_hdr->len); /* includes bss */
10977+ if (tp->fw_len < (tp->fw->size - TG3_FW_HDR_LEN)) {
1059010978 netdev_err(tp->dev, "bogus length %d in \"%s\"\n",
1059110979 tp->fw_len, tp->fw_needed);
1059210980 release_firmware(tp->fw);
@@ -10885,7 +11273,15 @@ static int tg3_open(struct net_device *dev) · 292 unmodified lines
1088511273
1088611274 if (tp->fw_needed) {
1088711275 err = tg3_request_firmware(tp);
10888− if (tg3_chip_rev_id(tp) == CHIPREV_ID_5701_A0) {
11276+ if (tg3_asic_rev(tp) == ASIC_REV_57766) {
11277+ if (err) {
11278+ netdev_warn(tp->dev, "EEE capability disabled\n");
11279+ tp->phy_flags &= ~TG3_PHYFLG_EEE_CAP;
11280+ } else if (!(tp->phy_flags & TG3_PHYFLG_EEE_CAP)) {
11281+ netdev_warn(tp->dev, "EEE capability restored\n");
11282+ tp->phy_flags |= TG3_PHYFLG_EEE_CAP;
11283+ }
11284+ } else if (tg3_chip_rev_id(tp) == CHIPREV_ID_5701_A0) {
1088911285 if (err)
1089011286 return err;
1089111287 } else if (err) {
@@ -10910,7 +11306,9 @@ static int tg3_open(struct net_device *dev) · 18 unmodified lines
1091011306
1091111307 tg3_full_unlock(tp);
1091211308
10913− err = tg3_start(tp, true, true, true);
11309+ err = tg3_start(tp,
11310+ !(tp->phy_flags & TG3_PHYFLG_KEEP_LINK_ON_PWRDN),
11311+ true, true);
1091411312 if (err) {
1091511313 tg3_frob_aux_power(tp, false);
1091611314 pci_set_power_state(tp->pdev, PCI_D3hot);
@@ -11416,8 +11814,12 @@ static int tg3_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) · 499 unmodified lines
1141611814 tp->link_config.duplex = cmd->duplex;
1141711815 }
1141811816
11817+ tp->phy_flags |= TG3_PHYFLG_USER_CONFIGURED;
11818+
11819+ tg3_warn_mgmt_link_flap(tp);
11820+
1141911821 if (netif_running(dev))
11420− tg3_setup_phy(tp, 1);
11822+ tg3_setup_phy(tp, true);
1142111823
1142211824 tg3_full_unlock(tp);
1142311825
@@ -11494,6 +11896,8 @@ static int tg3_nway_reset(struct net_device *dev) · 70 unmodified lines
1149411896 if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES)
1149511897 return -EINVAL;
1149611898
11899+ tg3_warn_mgmt_link_flap(tp);
11900+
1149711901 if (tg3_flag(tp, USE_PHYLIB)) {
1149811902 if (!(tp->phy_flags & TG3_PHYFLG_IS_CONNECTED))
1149911903 return -EAGAIN;
@@ -11571,7 +11975,7 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e · 71 unmodified lines
1157111975
1157211976 if (netif_running(dev)) {
1157311977 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
11574− err = tg3_restart_hw(tp, 1);
11978+ err = tg3_restart_hw(tp, false);
1157511979 if (!err)
1157611980 tg3_netif_start(tp);
1157711981 }
@@ -11606,6 +12010,9 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam · 28 unmodified lines
1160612010 struct tg3 *tp = netdev_priv(dev);
1160712011 int err = 0;
1160812012
12013+ if (tp->link_config.autoneg == AUTONEG_ENABLE)
12014+ tg3_warn_mgmt_link_flap(tp);
12015+
1160912016 if (tg3_flag(tp, USE_PHYLIB)) {
1161012017 u32 newadv;
1161112018 struct phy_device *phydev;
@@ -11692,7 +12099,7 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam · 80 unmodified lines
1169212099
1169312100 if (netif_running(dev)) {
1169412101 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
11695− err = tg3_restart_hw(tp, 1);
12102+ err = tg3_restart_hw(tp, false);
1169612103 if (!err)
1169712104 tg3_netif_start(tp);
1169812105 }
@@ -11700,6 +12107,8 @@ static int tg3_set_pauseparam(struct net_device *dev, struct ethtool_pauseparam · 1 unmodified line
1170012107 tg3_full_unlock(tp);
1170112108 }
1170212109
12110+ tp->phy_flags |= TG3_PHYFLG_USER_CONFIGURED;
12111+
1170312112 return err;
1170412113 }
1170512114
@@ -12760,7 +13169,7 @@ static int tg3_test_loopback(struct tg3 *tp, u64 *data, bool do_extlpbk) · 1054 unmodified lines
1276013169 goto done;
1276113170 }
1276213171
12763− err = tg3_reset_hw(tp, 1);
13172+ err = tg3_reset_hw(tp, true);
1276413173 if (err) {
1276513174 data[TG3_MAC_LOOPB_TEST] = TG3_LOOPBACK_FAILED;
1276613175 data[TG3_PHY_LOOPB_TEST] = TG3_LOOPBACK_FAILED;
@@ -12927,7 +13336,7 @@ static void tg3_self_test(struct net_device *dev, struct ethtool_test *etest, · 160 unmodified lines
1292713336 tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
1292813337 if (netif_running(dev)) {
1292913338 tg3_flag_set(tp, INIT_COMPLETE);
12930− err2 = tg3_restart_hw(tp, 1);
13339+ err2 = tg3_restart_hw(tp, true);
1293113340 if (!err2)
1293213341 tg3_netif_start(tp);
1293313342 }
@@ -13244,7 +13653,8 @@ static inline void tg3_set_mtu(struct net_device *dev, struct tg3 *tp, · 310 unmodified lines
1324413653 static int tg3_change_mtu(struct net_device *dev, int new_mtu)
1324513654 {
1324613655 struct tg3 *tp = netdev_priv(dev);
13247− int err, reset_phy = 0;
13656+ int err;
13657+ bool reset_phy = false;
1324813658
1324913659 if (new_mtu < TG3_MIN_MTU || new_mtu > TG3_MAX_MTU(tp))
1325013660 return -EINVAL;
@@ -13271,7 +13681,7 @@ static int tg3_change_mtu(struct net_device *dev, int new_mtu) · 20 unmodified lines
1327113681 * breaks all requests to 256 bytes.
1327213682 */
1327313683 if (tg3_asic_rev(tp) == ASIC_REV_57766)
13274− reset_phy = 1;
13684+ reset_phy = true;
1327513685
1327613686 err = tg3_restart_hw(tp, reset_phy);
1327713687
@@ -13837,6 +14247,12 @@ static void tg3_get_5720_nvram_info(struct tg3 *tp) · 559 unmodified lines
1383714247 case FLASH_5762_EEPROM_LD:
1383814248 nvmpinstrp = FLASH_5720_EEPROM_LD;
1383914249 break;
14250+ case FLASH_5720VENDOR_M_ST_M45PE20:
14251+ /* This pinstrap supports multiple sizes, so force it
14252+ * to read the actual size from location 0xf0.
14253+ */
14254+ nvmpinstrp = FLASH_5720VENDOR_ST_45USPT;
14255+ break;
1384014256 }
1384114257 }
1384214258
@@ -14289,14 +14705,18 @@ static void tg3_get_eeprom_hw_cfg(struct tg3 *tp) · 446 unmodified lines
1428914705 (cfg2 & NIC_SRAM_DATA_CFG_2_APD_EN))
1429014706 tp->phy_flags |= TG3_PHYFLG_ENABLE_APD;
1429114707
14292− if (tg3_flag(tp, PCI_EXPRESS) &&
14293− tg3_asic_rev(tp) != ASIC_REV_5785 &&
14294− !tg3_flag(tp, 57765_PLUS)) {
14708+ if (tg3_flag(tp, PCI_EXPRESS)) {
1429514709 u32 cfg3;
1429614710
1429714711 tg3_read_mem(tp, NIC_SRAM_DATA_CFG_3, &cfg3);
14298− if (cfg3 & NIC_SRAM_ASPM_DEBOUNCE)
14712+ if (tg3_asic_rev(tp) != ASIC_REV_5785 &&
14713+ !tg3_flag(tp, 57765_PLUS) &&
14714+ (cfg3 & NIC_SRAM_ASPM_DEBOUNCE))
1429914715 tg3_flag_set(tp, ASPM_WORKAROUND);
14716+ if (cfg3 & NIC_SRAM_LNK_FLAP_AVOID)
14717+ tp->phy_flags |= TG3_PHYFLG_KEEP_LINK_ON_PWRDN;
14718+ if (cfg3 & NIC_SRAM_1G_ON_VAUX_OK)
14719+ tp->phy_flags |= TG3_PHYFLG_1G_ON_VAUX_OK;
1430014720 }
1430114721
1430214722 if (cfg4 & NIC_SRAM_RGMII_INBAND_DISABLE)
@@ -14450,6 +14870,12 @@ static int tg3_phy_probe(struct tg3 *tp) · 147 unmodified lines
1445014870 }
1445114871 }
1445214872
14873+ if (!tg3_flag(tp, ENABLE_ASF) &&
14874+ !(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
14875+ !(tp->phy_flags & TG3_PHYFLG_10_100_ONLY))
14876+ tp->phy_flags &= ~(TG3_PHYFLG_1G_ON_VAUX_OK |
14877+ TG3_PHYFLG_KEEP_LINK_ON_PWRDN);
14878+
1445314879 if (tg3_flag(tp, USE_PHYLIB))
1445414880 return tg3_phy_init(tp);
1445514881
@@ -14515,6 +14941,7 @@ static int tg3_phy_probe(struct tg3 *tp) · 59 unmodified lines
1451514941 if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
1451614942 (tg3_asic_rev(tp) == ASIC_REV_5719 ||
1451714943 tg3_asic_rev(tp) == ASIC_REV_5720 ||
14944+ tg3_asic_rev(tp) == ASIC_REV_57766 ||
1451814945 tg3_asic_rev(tp) == ASIC_REV_5762 ||
1451914946 (tg3_asic_rev(tp) == ASIC_REV_5717 &&
1452014947 tg3_chip_rev_id(tp) != CHIPREV_ID_5717_A0) ||
@@ -14524,7 +14951,8 @@ static int tg3_phy_probe(struct tg3 *tp) · 3 unmodified lines
1452414951
1452514952 tg3_phy_init_link_config(tp);
1452614953
14527− if (!(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
14954+ if (!(tp->phy_flags & TG3_PHYFLG_KEEP_LINK_ON_PWRDN) &&
14955+ !(tp->phy_flags & TG3_PHYFLG_ANY_SERDES) &&
1452814956 !tg3_flag(tp, ENABLE_APE) &&
1452914957 !tg3_flag(tp, ENABLE_ASF)) {
1453014958 u32 bmsr, dummy;
@@ -15300,7 +15728,8 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) · 769 unmodified lines
1530015728 } else if (tg3_asic_rev(tp) != ASIC_REV_5700 &&
1530115729 tg3_asic_rev(tp) != ASIC_REV_5701 &&
1530215730 tg3_chip_rev_id(tp) != CHIPREV_ID_5705_A0) {
15303− tg3_flag_set(tp, TSO_BUG);
15731+ tg3_flag_set(tp, FW_TSO);
15732+ tg3_flag_set(tp, TSO_BUG);
1530415733 if (tg3_asic_rev(tp) == ASIC_REV_5705)
1530515734 tp->fw_needed = FIRMWARE_TG3TSO5;
1530615735 else
@@ -15311,7 +15740,7 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) · 4 unmodified lines
1531115740 if (tg3_flag(tp, HW_TSO_1) ||
1531215741 tg3_flag(tp, HW_TSO_2) ||
1531315742 tg3_flag(tp, HW_TSO_3) ||
15314− tp->fw_needed) {
15743+ tg3_flag(tp, FW_TSO)) {
1531515744 /* For firmware TSO, assume ASF is disabled.
1531615745 * We'll disable TSO later if we discover ASF
1531715746 * is enabled in tg3_get_eeprom_hw_cfg().
@@ -15326,6 +15755,9 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) · 8 unmodified lines
1532615755 if (tg3_chip_rev_id(tp) == CHIPREV_ID_5701_A0)
1532715756 tp->fw_needed = FIRMWARE_TG3;
1532815757
15758+ if (tg3_asic_rev(tp) == ASIC_REV_57766)
15759+ tp->fw_needed = FIRMWARE_TG357766;
15760+
1532915761 tp->irq_max = 1;
1533015762
1533115763 if (tg3_flag(tp, 5750_PLUS)) {
@@ -15598,7 +16030,7 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) · 266 unmodified lines
1559816030 */
1559916031 tg3_get_eeprom_hw_cfg(tp);
1560016032
15601− if (tp->fw_needed && tg3_flag(tp, ENABLE_ASF)) {
16033+ if (tg3_flag(tp, FW_TSO) && tg3_flag(tp, ENABLE_ASF)) {
1560216034 tg3_flag_clear(tp, TSO_CAPABLE);
1560316035 tg3_flag_clear(tp, TSO_BUG);
1560416036 tp->fw_needed = NULL;
@@ -15786,6 +16218,11 @@ static int tg3_get_invariants(struct tg3 *tp, const struct pci_device_id *ent) · 181 unmodified lines
1578616218 udelay(50);
1578716219 tg3_nvram_init(tp);
1578816220
16221+ /* If the device has an NVRAM, no need to load patch firmware */
16222+ if (tg3_asic_rev(tp) == ASIC_REV_57766 &&
16223+ !tg3_flag(tp, NO_NVRAM))
16224+ tp->fw_needed = NULL;
16225+
1578916226 grc_misc_cfg = tr32(GRC_MISC_CFG);
1579016227 grc_misc_cfg &= GRC_MISC_CFG_BOARD_ID_MASK;
1579116228
@@ -16144,7 +16581,7 @@ out: · 352 unmodified lines
1614416581 }
1614516582
1614616583 static int tg3_do_test_dma(struct tg3 *tp, u32 *buf, dma_addr_t buf_dma,
16147− int size, int to_device)
16584+ int size, bool to_device)
1614816585 {
1614916586 struct tg3_internal_buffer_desc test_desc;
1615016587 u32 sram_dma_descs;
@@ -16344,7 +16781,7 @@ static int tg3_test_dma(struct tg3 *tp) · 193 unmodified lines
1634416781 p[i] = i;
1634516782
1634616783 /* Send the buffer to the chip. */
16347− ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 1);
16784+ ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, true);
1634816785 if (ret) {
1634916786 dev_err(&tp->pdev->dev,
1635016787 "%s: Buffer write failed. err = %d\n",
@@ -16367,7 +16804,7 @@ static int tg3_test_dma(struct tg3 *tp) · 16 unmodified lines
1636716804 }
1636816805 #endif
1636916806 /* Now read it back. */
16370− ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, 0);
16807+ ret = tg3_do_test_dma(tp, buf, buf_dma, TEST_BUFFER_SIZE, false);
1637116808 if (ret) {
1637216809 dev_err(&tp->pdev->dev, "%s: Buffer read failed. "
1637316810 "err = %d\n", __func__, ret);
@@ -16763,7 +17200,7 @@ static int tg3_init_one(struct pci_dev *pdev, · 389 unmodified lines
1676317200
1676417201 tg3_init_bufmgr_config(tp);
1676517202
16766− features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
17203+ features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
1676717204
1676817205 /* 5700 B0 chips do not support checksumming correctly due
1676917206 * to hardware bugs.
@@ -17048,7 +17485,7 @@ static int tg3_suspend(struct device *device) · 278 unmodified lines
1704817485 tg3_full_lock(tp, 0);
1704917486
1705017487 tg3_flag_set(tp, INIT_COMPLETE);
17051− err2 = tg3_restart_hw(tp, 1);
17488+ err2 = tg3_restart_hw(tp, true);
1705217489 if (err2)
1705317490 goto out;
1705417491
@@ -17082,7 +17519,8 @@ static int tg3_resume(struct device *device) · 27 unmodified lines
1708217519 tg3_full_lock(tp, 0);
1708317520
1708417521 tg3_flag_set(tp, INIT_COMPLETE);
17085− err = tg3_restart_hw(tp, 1);
17522+ err = tg3_restart_hw(tp,
17523+ !(tp->phy_flags & TG3_PHYFLG_KEEP_LINK_ON_PWRDN));
1708617524 if (err)
1708717525 goto out;
1708817526
@@ -17098,15 +17536,9 @@ out: · 9 unmodified lines
1709817536
1709917537 return err;
1710017538 }
17539+#endif /* CONFIG_PM_SLEEP */
1710117540
1710217541 static SIMPLE_DEV_PM_OPS(tg3_pm_ops, tg3_suspend, tg3_resume);
17103−#define TG3_PM_OPS (&tg3_pm_ops)
17104−
17105−#else
17106−
17107−#define TG3_PM_OPS NULL
17108−
17109−#endif /* CONFIG_PM_SLEEP */
1711017542
1711117543 /**
1711217544 * tg3_io_error_detected - called when PCI error is detected
@@ -17221,7 +17653,7 @@ static void tg3_io_resume(struct pci_dev *pdev) · 108 unmodified lines
1722117653
1722217654 tg3_full_lock(tp, 0);
1722317655 tg3_flag_set(tp, INIT_COMPLETE);
17224− err = tg3_restart_hw(tp, 1);
17656+ err = tg3_restart_hw(tp, true);
1722517657 if (err) {
1722617658 tg3_full_unlock(tp);
1722717659 netdev_err(netdev, "Cannot restart hardware after reset.\n");
@@ -17254,7 +17686,7 @@ static struct pci_driver tg3_driver = { · 26 unmodified lines
1725417686 .probe = tg3_init_one,
1725517687 .remove = tg3_remove_one,
1725617688 .err_handler = &tg3_err_handler,
17257− .driver.pm = TG3_PM_OPS,
17689+ .driver.pm = &tg3_pm_ops,
1725817690 };
1725917691
1726017692 static int __init tg3_init(void)
drivers/net/ethernet/broadcom/tg3.h+28−2
@@ -2198,6 +2198,8 @@ · 2197 unmodified lines
21982198
21992199 #define NIC_SRAM_DATA_CFG_3 0x00000d3c
22002200 #define NIC_SRAM_ASPM_DEBOUNCE 0x00000002
2201+#define NIC_SRAM_LNK_FLAP_AVOID 0x00400000
2202+#define NIC_SRAM_1G_ON_VAUX_OK 0x00800000
22012203
22022204 #define NIC_SRAM_DATA_CFG_4 0x00000d60
22032205 #define NIC_SRAM_GMII_MODE 0x00000002
@@ -2222,6 +2224,12 @@ · 18 unmodified lines
22222224 #define NIC_SRAM_MBUF_POOL_BASE5705 0x00010000
22232225 #define NIC_SRAM_MBUF_POOL_SIZE5705 0x0000e000
22242226
2227+#define TG3_SRAM_RXCPU_SCRATCH_BASE_57766 0x00030000
2228+#define TG3_SRAM_RXCPU_SCRATCH_SIZE_57766 0x00010000
2229+#define TG3_57766_FW_BASE_ADDR 0x00030000
2230+#define TG3_57766_FW_HANDSHAKE 0x0003fccc
2231+#define TG3_SBROM_IN_SERVICE_LOOP 0x51
2232+
22252233 #define TG3_SRAM_RX_STD_BDCACHE_SIZE_5700 128
22262234 #define TG3_SRAM_RX_STD_BDCACHE_SIZE_5755 64
22272235 #define TG3_SRAM_RX_STD_BDCACHE_SIZE_5906 32
@@ -2365,6 +2373,13 @@ · 137 unmodified lines
23652373 #define MII_TG3_FET_SHDW_AUXSTAT2 0x1b
23662374 #define MII_TG3_FET_SHDW_AUXSTAT2_APD 0x0020
23672375
2376+/* Serdes PHY Register Definitions */
2377+#define SERDES_TG3_1000X_STATUS 0x14
2378+#define SERDES_TG3_SGMII_MODE 0x0001
2379+#define SERDES_TG3_LINK_UP 0x0002
2380+#define SERDES_TG3_FULL_DUPLEX 0x0004
2381+#define SERDES_TG3_SPEED_100 0x0008
2382+#define SERDES_TG3_SPEED_1000 0x0010
23682383
23692384 /* APE registers. Accessible through BAR1 */
23702385 #define TG3_APE_GPIO_MSG 0x0008
@@ -3009,17 +3024,18 @@ enum TG3_FLAGS { · 638 unmodified lines
30093024 TG3_FLAG_JUMBO_CAPABLE,
30103025 TG3_FLAG_CHIP_RESETTING,
30113026 TG3_FLAG_INIT_COMPLETE,
3012− TG3_FLAG_TSO_BUG,
30133027 TG3_FLAG_MAX_RXPEND_64,
3014− TG3_FLAG_TSO_CAPABLE,
30153028 TG3_FLAG_PCI_EXPRESS, /* BCM5785 + pci_is_pcie() */
30163029 TG3_FLAG_ASF_NEW_HANDSHAKE,
30173030 TG3_FLAG_HW_AUTONEG,
30183031 TG3_FLAG_IS_NIC,
30193032 TG3_FLAG_FLASH,
3033+ TG3_FLAG_FW_TSO,
30203034 TG3_FLAG_HW_TSO_1,
30213035 TG3_FLAG_HW_TSO_2,
30223036 TG3_FLAG_HW_TSO_3,
3037+ TG3_FLAG_TSO_CAPABLE,
3038+ TG3_FLAG_TSO_BUG,
30233039 TG3_FLAG_ICH_WORKAROUND,
30243040 TG3_FLAG_1SHOT_MSI,
30253041 TG3_FLAG_NO_FWARE_REPORTED,
@@ -3064,6 +3080,13 @@ enum TG3_FLAGS { · 38 unmodified lines
30643080 TG3_FLAG_NUMBER_OF_FLAGS, /* Last entry in enum TG3_FLAGS */
30653081 };
30663082
3083+struct tg3_firmware_hdr {
3084+ __be32 version; /* unused for fragments */
3085+ __be32 base_addr;
3086+ __be32 len;
3087+};
3088+#define TG3_FW_HDR_LEN (sizeof(struct tg3_firmware_hdr))
3089+
30673090 struct tg3 {
30683091 /* begin "general, frequently-used members" cacheline section */
30693092
@@ -3267,6 +3290,7 @@ struct tg3 { · 197 unmodified lines
32673290 #define TG3_PHYFLG_IS_LOW_POWER 0x00000001
32683291 #define TG3_PHYFLG_IS_CONNECTED 0x00000002
32693292 #define TG3_PHYFLG_USE_MI_INTERRUPT 0x00000004
3293+#define TG3_PHYFLG_USER_CONFIGURED 0x00000008
32703294 #define TG3_PHYFLG_PHY_SERDES 0x00000010
32713295 #define TG3_PHYFLG_MII_SERDES 0x00000020
32723296 #define TG3_PHYFLG_ANY_SERDES (TG3_PHYFLG_PHY_SERDES | \
@@ -3284,6 +3308,8 @@ struct tg3 { · 11 unmodified lines
32843308 #define TG3_PHYFLG_SERDES_PREEMPHASIS 0x00010000
32853309 #define TG3_PHYFLG_PARALLEL_DETECT 0x00020000
32863310 #define TG3_PHYFLG_EEE_CAP 0x00040000
3311+#define TG3_PHYFLG_1G_ON_VAUX_OK 0x00080000
3312+#define TG3_PHYFLG_KEEP_LINK_ON_PWRDN 0x00100000
32873313 #define TG3_PHYFLG_MDIX_STATE 0x00200000
32883314
32893315 u32 led_ctrl;
drivers/net/ethernet/brocade/bna/bfa_ioc.c+1−1
@@ -76,7 +76,7 @@ static void bfa_ioc_pf_disabled(struct bfa_ioc *ioc); · 75 unmodified lines
7676 static void bfa_ioc_pf_failed(struct bfa_ioc *ioc);
7777 static void bfa_ioc_pf_hwfailed(struct bfa_ioc *ioc);
7878 static void bfa_ioc_pf_fwmismatch(struct bfa_ioc *ioc);
79−static void bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type,
79+static void bfa_ioc_boot(struct bfa_ioc *ioc, enum bfi_fwboot_type boot_type,
8080 u32 boot_param);
8181 static u32 bfa_ioc_smem_pgnum(struct bfa_ioc *ioc, u32 fmaddr);
8282 static void bfa_ioc_get_adapter_serial_num(struct bfa_ioc *ioc,
drivers/net/ethernet/brocade/bna/bnad.c+7−10
@@ -610,7 +610,7 @@ bnad_cq_process(struct bnad *bnad, struct bna_ccb *ccb, int budget) · 609 unmodified lines
610610 rcb->rxq->rx_bytes += length;
611611
612612 if (flags & BNA_CQ_EF_VLAN)
613− __vlan_hwaccel_put_tag(skb, ntohs(cmpl->vlan_tag));
613+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(cmpl->vlan_tag));
614614
615615 if (BNAD_RXBUF_IS_PAGE(unmap_q->type))
616616 napi_gro_frags(&rx_ctrl->napi);
@@ -1264,9 +1264,8 @@ bnad_mem_alloc(struct bnad *bnad, · 647 unmodified lines
12641264 mem_info->mdl[i].len = mem_info->len;
12651265 mem_info->mdl[i].kva =
12661266 dma_alloc_coherent(&bnad->pcidev->dev,
1267− mem_info->len, &dma_pa,
1268− GFP_KERNEL);
1269−
1267+ mem_info->len, &dma_pa,
1268+ GFP_KERNEL);
12701269 if (mem_info->mdl[i].kva == NULL)
12711270 goto err_return;
12721271
@@ -3069,8 +3068,7 @@ bnad_change_mtu(struct net_device *netdev, int new_mtu) · 1796 unmodified lines
30693068 }
30703069
30713070 static int
3072−bnad_vlan_rx_add_vid(struct net_device *netdev,
3073− unsigned short vid)
3071+bnad_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
30743072 {
30753073 struct bnad *bnad = netdev_priv(netdev);
30763074 unsigned long flags;
@@ -3091,8 +3089,7 @@ bnad_vlan_rx_add_vid(struct net_device *netdev, · 14 unmodified lines
30913089 }
30923090
30933091 static int
3094−bnad_vlan_rx_kill_vid(struct net_device *netdev,
3095− unsigned short vid)
3092+bnad_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
30963093 {
30973094 struct bnad *bnad = netdev_priv(netdev);
30983095 unsigned long flags;
@@ -3171,14 +3168,14 @@ bnad_netdev_init(struct bnad *bnad, bool using_dac) · 72 unmodified lines
31713168
31723169 netdev->hw_features = NETIF_F_SG | NETIF_F_RXCSUM |
31733170 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
3174− NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_TX;
3171+ NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_HW_VLAN_CTAG_TX;
31753172
31763173 netdev->vlan_features = NETIF_F_SG | NETIF_F_HIGHDMA |
31773174 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
31783175 NETIF_F_TSO | NETIF_F_TSO6;
31793176
31803177 netdev->features |= netdev->hw_features |
3181− NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
3178+ NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER;
31823179
31833180 if (using_dac)
31843181 netdev->features |= NETIF_F_HIGHDMA;
drivers/net/ethernet/cadence/at91_ether.c+17−63
@@ -47,22 +47,19 @@ static int at91ether_start(struct net_device *dev) · 46 unmodified lines
4747 int i;
4848
4949 lp->rx_ring = dma_alloc_coherent(&lp->pdev->dev,
50− MAX_RX_DESCR * sizeof(struct macb_dma_desc),
51− &lp->rx_ring_dma, GFP_KERNEL);
52− if (!lp->rx_ring) {
53− netdev_err(dev, "unable to alloc rx ring DMA buffer\n");
50+ (MAX_RX_DESCR *
51+ sizeof(struct macb_dma_desc)),
52+ &lp->rx_ring_dma, GFP_KERNEL);
53+ if (!lp->rx_ring)
5454 return -ENOMEM;
55− }
5655
5756 lp->rx_buffers = dma_alloc_coherent(&lp->pdev->dev,
58− MAX_RX_DESCR * MAX_RBUFF_SZ,
59− &lp->rx_buffers_dma, GFP_KERNEL);
57+ MAX_RX_DESCR * MAX_RBUFF_SZ,
58+ &lp->rx_buffers_dma, GFP_KERNEL);
6059 if (!lp->rx_buffers) {
61− netdev_err(dev, "unable to alloc rx data DMA buffer\n");
62−
6360 dma_free_coherent(&lp->pdev->dev,
64− MAX_RX_DESCR * sizeof(struct macb_dma_desc),
65− lp->rx_ring, lp->rx_ring_dma);
61+ MAX_RX_DESCR * sizeof(struct macb_dma_desc),
62+ lp->rx_ring, lp->rx_ring_dma);
6663 lp->rx_ring = NULL;
6764 return -ENOMEM;
6865 }
@@ -209,7 +206,6 @@ static void at91ether_rx(struct net_device *dev) · 140 unmodified lines
209206 netif_rx(skb);
210207 } else {
211208 lp->stats.rx_dropped++;
212− netdev_notice(dev, "Memory squeeze, dropping packet.\n");
213209 }
214210
215211 if (lp->rx_ring[lp->rx_tail].ctrl & MACB_BIT(RX_MHASH_MATCH))
@@ -303,42 +299,7 @@ static const struct of_device_id at91ether_dt_ids[] = { · 87 unmodified lines
303299 { .compatible = "cdns,emac" },
304300 { /* sentinel */ }
305301 };
306−
307302 MODULE_DEVICE_TABLE(of, at91ether_dt_ids);
308−
309−static int at91ether_get_phy_mode_dt(struct platform_device *pdev)
310−{
311− struct device_node *np = pdev->dev.of_node;
312−
313− if (np)
314− return of_get_phy_mode(np);
315−
316− return -ENODEV;
317−}
318−
319−static int at91ether_get_hwaddr_dt(struct macb *bp)
320−{
321− struct device_node *np = bp->pdev->dev.of_node;
322−
323− if (np) {
324− const char *mac = of_get_mac_address(np);
325− if (mac) {
326− memcpy(bp->dev->dev_addr, mac, ETH_ALEN);
327− return 0;
328− }
329− }
330−
331− return -ENODEV;
332−}
333−#else
334−static int at91ether_get_phy_mode_dt(struct platform_device *pdev)
335−{
336− return -ENODEV;
337−}
338−static int at91ether_get_hwaddr_dt(struct macb *bp)
339−{
340− return -ENODEV;
341−}
342303 #endif
343304
344305 /* Detect MAC & PHY and perform ethernet interface initialization */
@@ -352,6 +313,7 @@ static int __init at91ether_probe(struct platform_device *pdev) · 7 unmodified lines
352313 struct macb *lp;
353314 int res;
354315 u32 reg;
316+ const char *mac;
355317
356318 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
357319 if (!regs)
@@ -403,11 +365,13 @@ static int __init at91ether_probe(struct platform_device *pdev) · 45 unmodified lines
403365 platform_set_drvdata(pdev, dev);
404366 SET_NETDEV_DEV(dev, &pdev->dev);
405367
406− res = at91ether_get_hwaddr_dt(lp);
407− if (res < 0)
368+ mac = of_get_mac_address(pdev->dev.of_node);
369+ if (mac)
370+ memcpy(lp->dev->dev_addr, mac, ETH_ALEN);
371+ else
408372 macb_get_hwaddr(lp);
409373
410− res = at91ether_get_phy_mode_dt(pdev);
374+ res = of_get_phy_mode(pdev->dev.of_node);
411375 if (res < 0) {
412376 if (board_data && board_data->is_rmii)
413377 lp->phy_interface = PHY_INTERFACE_MODE_RMII;
@@ -430,7 +394,8 @@ static int __init at91ether_probe(struct platform_device *pdev) · 16 unmodified lines
430394 if (res)
431395 goto err_disable_clock;
432396
433− if (macb_mii_init(lp) != 0)
397+ res = macb_mii_init(lp);
398+ if (res)
434399 goto err_out_unregister_netdev;
435400
436401 /* will be enabled in open() */
@@ -519,18 +484,7 @@ static struct platform_driver at91ether_driver = { · 82 unmodified lines
519484 },
520485 };
521486
522−static int __init at91ether_init(void)
523−{
524− return platform_driver_probe(&at91ether_driver, at91ether_probe);
525−}
526−
527−static void __exit at91ether_exit(void)
528−{
529− platform_driver_unregister(&at91ether_driver);
530−}
531−
532−module_init(at91ether_init)
533−module_exit(at91ether_exit)
487+module_platform_driver_probe(at91ether_driver, at91ether_probe);
534488
535489 MODULE_LICENSE("GPL");
536490 MODULE_DESCRIPTION("AT91RM9200 EMAC Ethernet driver");
drivers/net/ethernet/cadence/macb.c+23−61
@@ -485,6 +485,8 @@ static void macb_tx_interrupt(struct macb *bp) · 484 unmodified lines
485485 status = macb_readl(bp, TSR);
486486 macb_writel(bp, TSR, status);
487487
488+ macb_writel(bp, ISR, MACB_BIT(TCOMP));
489+
488490 netdev_vdbg(bp->dev, "macb_tx_interrupt status = 0x%03lx\n",
489491 (unsigned long)status);
490492
@@ -736,6 +738,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id) · 245 unmodified lines
736738 * now.
737739 */
738740 macb_writel(bp, IDR, MACB_RX_INT_FLAGS);
741+ macb_writel(bp, ISR, MACB_BIT(RCOMP));
739742
740743 if (napi_schedule_prep(&bp->napi)) {
741744 netdev_vdbg(bp->dev, "scheduling RX softirq\n");
@@ -1054,6 +1057,7 @@ static void macb_configure_dma(struct macb *bp) · 312 unmodified lines
10541057 dmacfg |= GEM_BF(RXBS, RX_BUFFER_SIZE / 64);
10551058 dmacfg |= GEM_BF(FBLDO, 16);
10561059 dmacfg |= GEM_BIT(TXPBMS) | GEM_BF(RXBMS, -1L);
1060+ dmacfg &= ~GEM_BIT(ENDIA);
10571061 gem_writel(bp, DMACFG, dmacfg);
10581062 }
10591063 }
@@ -1472,41 +1476,7 @@ static const struct of_device_id macb_dt_ids[] = { · 412 unmodified lines
14721476 { .compatible = "cdns,gem" },
14731477 { /* sentinel */ }
14741478 };
1475−
14761479 MODULE_DEVICE_TABLE(of, macb_dt_ids);
1477−
1478−static int macb_get_phy_mode_dt(struct platform_device *pdev)
1479−{
1480− struct device_node *np = pdev->dev.of_node;
1481−
1482− if (np)
1483− return of_get_phy_mode(np);
1484−
1485− return -ENODEV;
1486−}
1487−
1488−static int macb_get_hwaddr_dt(struct macb *bp)
1489−{
1490− struct device_node *np = bp->pdev->dev.of_node;
1491− if (np) {
1492− const char *mac = of_get_mac_address(np);
1493− if (mac) {
1494− memcpy(bp->dev->dev_addr, mac, ETH_ALEN);
1495− return 0;
1496− }
1497− }
1498−
1499− return -ENODEV;
1500−}
1501−#else
1502−static int macb_get_phy_mode_dt(struct platform_device *pdev)
1503−{
1504− return -ENODEV;
1505−}
1506−static int macb_get_hwaddr_dt(struct macb *bp)
1507−{
1508− return -ENODEV;
1509−}
15101480 #endif
15111481
15121482 static int __init macb_probe(struct platform_device *pdev)
@@ -1519,6 +1489,7 @@ static int __init macb_probe(struct platform_device *pdev) · 6 unmodified lines
15191489 u32 config;
15201490 int err = -ENXIO;
15211491 struct pinctrl *pinctrl;
1492+ const char *mac;
15221493
15231494 regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
15241495 if (!regs) {
@@ -1557,14 +1528,14 @@ static int __init macb_probe(struct platform_device *pdev) · 32 unmodified lines
15571528 dev_err(&pdev->dev, "failed to get macb_clk\n");
15581529 goto err_out_free_dev;
15591530 }
1560− clk_enable(bp->pclk);
1531+ clk_prepare_enable(bp->pclk);
15611532
15621533 bp->hclk = clk_get(&pdev->dev, "hclk");
15631534 if (IS_ERR(bp->hclk)) {
15641535 dev_err(&pdev->dev, "failed to get hclk\n");
15651536 goto err_out_put_pclk;
15661537 }
1567− clk_enable(bp->hclk);
1538+ clk_prepare_enable(bp->hclk);
15681539
15691540 bp->regs = ioremap(regs->start, resource_size(regs));
15701541 if (!bp->regs) {
@@ -1592,11 +1563,13 @@ static int __init macb_probe(struct platform_device *pdev) · 21 unmodified lines
15921563 config |= macb_dbw(bp);
15931564 macb_writel(bp, NCFGR, config);
15941565
1595− err = macb_get_hwaddr_dt(bp);
1596− if (err < 0)
1566+ mac = of_get_mac_address(pdev->dev.of_node);
1567+ if (mac)
1568+ memcpy(bp->dev->dev_addr, mac, ETH_ALEN);
1569+ else
15971570 macb_get_hwaddr(bp);
15981571
1599− err = macb_get_phy_mode_dt(pdev);
1572+ err = of_get_phy_mode(pdev->dev.of_node);
16001573 if (err < 0) {
16011574 pdata = pdev->dev.platform_data;
16021575 if (pdata && pdata->is_rmii)
@@ -1629,9 +1602,9 @@ static int __init macb_probe(struct platform_device *pdev) · 26 unmodified lines
16291602 goto err_out_free_irq;
16301603 }
16311604
1632− if (macb_mii_init(bp) != 0) {
1605+ err = macb_mii_init(bp);
1606+ if (err)
16331607 goto err_out_unregister_netdev;
1634− }
16351608
16361609 platform_set_drvdata(pdev, dev);
16371610
@@ -1654,9 +1627,9 @@ err_out_free_irq: · 16 unmodified lines
16541627 err_out_iounmap:
16551628 iounmap(bp->regs);
16561629 err_out_disable_clocks:
1657− clk_disable(bp->hclk);
1630+ clk_disable_unprepare(bp->hclk);
16581631 clk_put(bp->hclk);
1659− clk_disable(bp->pclk);
1632+ clk_disable_unprepare(bp->pclk);
16601633 err_out_put_pclk:
16611634 clk_put(bp->pclk);
16621635 err_out_free_dev:
@@ -1683,9 +1656,9 @@ static int __exit macb_remove(struct platform_device *pdev) · 20 unmodified lines
16831656 unregister_netdev(dev);
16841657 free_irq(dev->irq, dev);
16851658 iounmap(bp->regs);
1686− clk_disable(bp->hclk);
1659+ clk_disable_unprepare(bp->hclk);
16871660 clk_put(bp->hclk);
1688− clk_disable(bp->pclk);
1661+ clk_disable_unprepare(bp->pclk);
16891662 clk_put(bp->pclk);
16901663 free_netdev(dev);
16911664 platform_set_drvdata(pdev, NULL);
@@ -1703,8 +1676,8 @@ static int macb_suspend(struct platform_device *pdev, pm_message_t state) · 11 unmodified lines
17031676 netif_carrier_off(netdev);
17041677 netif_device_detach(netdev);
17051678
1706− clk_disable(bp->hclk);
1707− clk_disable(bp->pclk);
1679+ clk_disable_unprepare(bp->hclk);
1680+ clk_disable_unprepare(bp->pclk);
17081681
17091682 return 0;
17101683 }
@@ -1714,8 +1687,8 @@ static int macb_resume(struct platform_device *pdev) · 3 unmodified lines
17141687 struct net_device *netdev = platform_get_drvdata(pdev);
17151688 struct macb *bp = netdev_priv(netdev);
17161689
1717− clk_enable(bp->pclk);
1718− clk_enable(bp->hclk);
1690+ clk_prepare_enable(bp->pclk);
1691+ clk_prepare_enable(bp->hclk);
17191692
17201693 netif_device_attach(netdev);
17211694
@@ -1737,18 +1710,7 @@ static struct platform_driver macb_driver = { · 15 unmodified lines
17371710 },
17381711 };
17391712
1740−static int __init macb_init(void)
1741−{
1742− return platform_driver_probe(&macb_driver, macb_probe);
1743−}
1744−
1745−static void __exit macb_exit(void)
1746−{
1747− platform_driver_unregister(&macb_driver);
1748−}
1749−
1750−module_init(macb_init);
1751−module_exit(macb_exit);
1713+module_platform_driver_probe(macb_driver, macb_probe);
17521714
17531715 MODULE_LICENSE("GPL");
17541716 MODULE_DESCRIPTION("Cadence MACB/GEM Ethernet driver");
drivers/net/ethernet/cadence/macb.h+2−0
@@ -173,6 +173,8 @@ · 172 unmodified lines
173173 /* Bitfields in DMACFG. */
174174 #define GEM_FBLDO_OFFSET 0
175175 #define GEM_FBLDO_SIZE 5
176+#define GEM_ENDIA_OFFSET 7
177+#define GEM_ENDIA_SIZE 1
176178 #define GEM_RXBMS_OFFSET 8
177179 #define GEM_RXBMS_SIZE 2
178180 #define GEM_TXPBMS_OFFSET 10
drivers/net/ethernet/calxeda/xgmac.c+3−6
@@ -1482,7 +1482,7 @@ static int xgmac_set_features(struct net_device *dev, netdev_features_t features · 1481 unmodified lines
14821482 u32 ctrl;
14831483 struct xgmac_priv *priv = netdev_priv(dev);
14841484 void __iomem *ioaddr = priv->base;
1485− u32 changed = dev->features ^ features;
1485+ netdev_features_t changed = dev->features ^ features;
14861486
14871487 if (!(changed & NETIF_F_RXCSUM))
14881488 return 0;
@@ -1886,12 +1886,9 @@ static int xgmac_resume(struct device *dev) · 397 unmodified lines
18861886
18871887 return 0;
18881888 }
1889+#endif /* CONFIG_PM_SLEEP */
18891890
18901891 static SIMPLE_DEV_PM_OPS(xgmac_pm_ops, xgmac_suspend, xgmac_resume);
1891−#define XGMAC_PM_OPS (&xgmac_pm_ops)
1892−#else
1893−#define XGMAC_PM_OPS NULL
1894−#endif /* CONFIG_PM_SLEEP */
18951892
18961893 static const struct of_device_id xgmac_of_match[] = {
18971894 { .compatible = "calxeda,hb-xgmac", },
@@ -1906,7 +1903,7 @@ static struct platform_driver xgmac_driver = { · 8 unmodified lines
19061903 },
19071904 .probe = xgmac_probe,
19081905 .remove = xgmac_remove,
1909− .driver.pm = XGMAC_PM_OPS,
1906+ .driver.pm = &xgmac_pm_ops,
19101907 };
19111908
19121909 module_platform_driver(xgmac_driver);
drivers/net/ethernet/chelsio/cxgb/cxgb2.c+7−6
@@ -856,10 +856,10 @@ static netdev_features_t t1_fix_features(struct net_device *dev, · 855 unmodified lines
856856 * Since there is no support for separate rx/tx vlan accel
857857 * enable/disable make sure tx flag is always in same state as rx.
858858 */
859− if (features & NETIF_F_HW_VLAN_RX)
860− features |= NETIF_F_HW_VLAN_TX;
859+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
860+ features |= NETIF_F_HW_VLAN_CTAG_TX;
861861 else
862− features &= ~NETIF_F_HW_VLAN_TX;
862+ features &= ~NETIF_F_HW_VLAN_CTAG_TX;
863863
864864 return features;
865865 }
@@ -869,7 +869,7 @@ static int t1_set_features(struct net_device *dev, netdev_features_t features) · 3 unmodified lines
869869 netdev_features_t changed = dev->features ^ features;
870870 struct adapter *adapter = dev->ml_priv;
871871
872− if (changed & NETIF_F_HW_VLAN_RX)
872+ if (changed & NETIF_F_HW_VLAN_CTAG_RX)
873873 t1_vlan_mode(adapter, features);
874874
875875 return 0;
@@ -1085,8 +1085,9 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 209 unmodified lines
10851085 netdev->features |= NETIF_F_HIGHDMA;
10861086 if (vlan_tso_capable(adapter)) {
10871087 netdev->features |=
1088− NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
1089− netdev->hw_features |= NETIF_F_HW_VLAN_RX;
1088+ NETIF_F_HW_VLAN_CTAG_TX |
1089+ NETIF_F_HW_VLAN_CTAG_RX;
1090+ netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
10901091
10911092 /* T204: disable TSO */
10921093 if (!(is_T2(adapter)) || bi->port_number != 4) {
drivers/net/ethernet/chelsio/cxgb/sge.c+4−5
@@ -734,7 +734,7 @@ void t1_vlan_mode(struct adapter *adapter, netdev_features_t features) · 733 unmodified lines
734734 {
735735 struct sge *sge = adapter->sge;
736736
737− if (features & NETIF_F_HW_VLAN_RX)
737+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
738738 sge->sge_control |= F_VLAN_XTRACT;
739739 else
740740 sge->sge_control &= ~F_VLAN_XTRACT;
@@ -835,7 +835,7 @@ static void refill_free_list(struct sge *sge, struct freelQ *q) · 94 unmodified lines
835835 struct sk_buff *skb;
836836 dma_addr_t mapping;
837837
838− skb = alloc_skb(q->rx_buffer_size, GFP_ATOMIC);
838+ skb = dev_alloc_skb(q->rx_buffer_size);
839839 if (!skb)
840840 break;
841841
@@ -1046,11 +1046,10 @@ static inline struct sk_buff *get_packet(struct pci_dev *pdev, · 204 unmodified lines
10461046 const struct freelQ_ce *ce = &fl->centries[fl->cidx];
10471047
10481048 if (len < copybreak) {
1049− skb = alloc_skb(len + 2, GFP_ATOMIC);
1049+ skb = netdev_alloc_skb_ip_align(NULL, len);
10501050 if (!skb)
10511051 goto use_orig_buf;
10521052
1053− skb_reserve(skb, 2); /* align IP header */
10541053 skb_put(skb, len);
10551054 pci_dma_sync_single_for_cpu(pdev,
10561055 dma_unmap_addr(ce, dma_addr),
@@ -1387,7 +1386,7 @@ static void sge_rx(struct sge *sge, struct freelQ *fl, unsigned int len) · 330 unmodified lines
13871386
13881387 if (p->vlan_valid) {
13891388 st->vlan_xtract++;
1390− __vlan_hwaccel_put_tag(skb, ntohs(p->vlan));
1389+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(p->vlan));
13911390 }
13921391 netif_receive_skb(skb);
13931392 }
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c+11−9
@@ -1181,14 +1181,15 @@ static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features) · 1180 unmodified lines
11811181
11821182 if (adapter->params.rev > 0) {
11831183 t3_set_vlan_accel(adapter, 1 << pi->port_id,
1184− features & NETIF_F_HW_VLAN_RX);
1184+ features & NETIF_F_HW_VLAN_CTAG_RX);
11851185 } else {
11861186 /* single control for all ports */
1187− unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX;
1187+ unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_CTAG_RX;
11881188
11891189 for_each_port(adapter, i)
11901190 have_vlans |=
1191− adapter->port[i]->features & NETIF_F_HW_VLAN_RX;
1191+ adapter->port[i]->features &
1192+ NETIF_F_HW_VLAN_CTAG_RX;
11921193
11931194 t3_set_vlan_accel(adapter, 1, have_vlans);
11941195 }
@@ -2563,10 +2564,10 @@ static netdev_features_t cxgb_fix_features(struct net_device *dev, · 1368 unmodified lines
25632564 * Since there is no support for separate rx/tx vlan accel
25642565 * enable/disable make sure tx flag is always in same state as rx.
25652566 */
2566− if (features & NETIF_F_HW_VLAN_RX)
2567− features |= NETIF_F_HW_VLAN_TX;
2567+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
2568+ features |= NETIF_F_HW_VLAN_CTAG_TX;
25682569 else
2569− features &= ~NETIF_F_HW_VLAN_TX;
2570+ features &= ~NETIF_F_HW_VLAN_CTAG_TX;
25702571
25712572 return features;
25722573 }
@@ -2575,7 +2576,7 @@ static int cxgb_set_features(struct net_device *dev, netdev_features_t features) · 2 unmodified lines
25752576 {
25762577 netdev_features_t changed = dev->features ^ features;
25772578
2578− if (changed & NETIF_F_HW_VLAN_RX)
2579+ if (changed & NETIF_F_HW_VLAN_CTAG_RX)
25792580 cxgb_vlan_mode(dev, features);
25802581
25812582 return 0;
@@ -3288,8 +3289,9 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 706 unmodified lines
32883289 netdev->mem_start = mmio_start;
32893290 netdev->mem_end = mmio_start + mmio_len - 1;
32903291 netdev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
3291− NETIF_F_TSO | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_RX;
3292− netdev->features |= netdev->hw_features | NETIF_F_HW_VLAN_TX;
3292+ NETIF_F_TSO | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_RX;
3293+ netdev->features |= netdev->hw_features |
3294+ NETIF_F_HW_VLAN_CTAG_TX;
32933295 netdev->vlan_features |= netdev->features & VLAN_FEAT;
32943296 if (pci_using_dac)
32953297 netdev->features |= NETIF_F_HIGHDMA;
drivers/net/ethernet/chelsio/cxgb3/cxgb3_offload.c+1−1
@@ -185,7 +185,7 @@ static struct net_device *get_iff_from_mac(struct adapter *adapter, · 184 unmodified lines
185185 if (!memcmp(dev->dev_addr, mac, ETH_ALEN)) {
186186 rcu_read_lock();
187187 if (vlan && vlan != VLAN_VID_MASK) {
188− dev = __vlan_find_dev_deep(dev, vlan);
188+ dev = __vlan_find_dev_deep(dev, htons(ETH_P_8021Q), vlan);
189189 } else if (netif_is_bond_slave(dev)) {
190190 struct net_device *upper_dev;
191191
drivers/net/ethernet/chelsio/cxgb3/sge.c+2−2
@@ -2030,7 +2030,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq, · 2029 unmodified lines
20302030
20312031 if (p->vlan_valid) {
20322032 qs->port_stats[SGE_PSTAT_VLANEX]++;
2033− __vlan_hwaccel_put_tag(skb, ntohs(p->vlan));
2033+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(p->vlan));
20342034 }
20352035 if (rq->polling) {
20362036 if (lro)
@@ -2132,7 +2132,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs, · 95 unmodified lines
21322132
21332133 if (cpl->vlan_valid) {
21342134 qs->port_stats[SGE_PSTAT_VLANEX]++;
2135− __vlan_hwaccel_put_tag(skb, ntohs(cpl->vlan));
2135+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(cpl->vlan));
21362136 }
21372137 napi_gro_frags(&qs->napi);
21382138 }
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h+53−2
@@ -54,6 +54,10 @@ · 53 unmodified lines
5454 #define FW_VERSION_MINOR 1
5555 #define FW_VERSION_MICRO 0
5656
57+#define FW_VERSION_MAJOR_T5 0
58+#define FW_VERSION_MINOR_T5 0
59+#define FW_VERSION_MICRO_T5 0
60+
5761 #define CH_WARN(adap, fmt, ...) dev_warn(adap->pdev_dev, fmt, ## __VA_ARGS__)
5862
5963 enum {
@@ -66,7 +70,9 @@ enum { · 6 unmodified lines
6670 enum {
6771 MEM_EDC0,
6872 MEM_EDC1,
69− MEM_MC
73+ MEM_MC,
74+ MEM_MC0 = MEM_MC,
75+ MEM_MC1
7076 };
7177
7278 enum {
@@ -74,8 +80,10 @@ enum { · 1 unmodified line
7480 MEMWIN0_BASE = 0x1b800,
7581 MEMWIN1_APERTURE = 32768,
7682 MEMWIN1_BASE = 0x28000,
83+ MEMWIN1_BASE_T5 = 0x52000,
7784 MEMWIN2_APERTURE = 65536,
7885 MEMWIN2_BASE = 0x30000,
86+ MEMWIN2_BASE_T5 = 0x54000,
7987 };
8088
8189 enum dev_master {
@@ -431,6 +439,7 @@ struct sge_txq { · 349 unmodified lines
431439 spinlock_t db_lock;
432440 int db_disabled;
433441 unsigned short db_pidx;
442+ u64 udb;
434443 };
435444
436445 struct sge_eth_txq { /* state for an SGE Ethernet Tx queue */
@@ -504,13 +513,44 @@ struct sge { · 67 unmodified lines
504513
505514 struct l2t_data;
506515
516+#define CHELSIO_CHIP_CODE(version, revision) (((version) << 4) | (revision))
517+#define CHELSIO_CHIP_VERSION(code) ((code) >> 4)
518+#define CHELSIO_CHIP_RELEASE(code) ((code) & 0xf)
519+
520+#define CHELSIO_T4 0x4
521+#define CHELSIO_T5 0x5
522+
523+enum chip_type {
524+ T4_A1 = CHELSIO_CHIP_CODE(CHELSIO_T4, 0),
525+ T4_A2 = CHELSIO_CHIP_CODE(CHELSIO_T4, 1),
526+ T4_A3 = CHELSIO_CHIP_CODE(CHELSIO_T4, 2),
527+ T4_FIRST_REV = T4_A1,
528+ T4_LAST_REV = T4_A3,
529+
530+ T5_A1 = CHELSIO_CHIP_CODE(CHELSIO_T5, 0),
531+ T5_FIRST_REV = T5_A1,
532+ T5_LAST_REV = T5_A1,
533+};
534+
535+#ifdef CONFIG_PCI_IOV
536+
537+/* T4 supports SRIOV on PF0-3 and T5 on PF0-7. However, the Serial
538+ * Configuration initialization for T5 only has SR-IOV functionality enabled
539+ * on PF0-3 in order to simplify everything.
540+ */
541+#define NUM_OF_PF_WITH_SRIOV 4
542+
543+#endif
544+
507545 struct adapter {
508546 void __iomem *regs;
547+ void __iomem *bar2;
509548 struct pci_dev *pdev;
510549 struct device *pdev_dev;
511550 unsigned int mbox;
512551 unsigned int fn;
513552 unsigned int flags;
553+ enum chip_type chip;
514554
515555 int msg_enable;
516556
@@ -673,6 +713,16 @@ enum { · 156 unmodified lines
673713 VLAN_REWRITE
674714 };
675715
716+static inline int is_t5(enum chip_type chip)
717+{
718+ return (chip >= T5_FIRST_REV && chip <= T5_LAST_REV);
719+}
720+
721+static inline int is_t4(enum chip_type chip)
722+{
723+ return (chip >= T4_FIRST_REV && chip <= T4_LAST_REV);
724+}
725+
676726 static inline u32 t4_read_reg(struct adapter *adap, u32 reg_addr)
677727 {
678728 return readl(adap->regs + reg_addr);
@@ -858,7 +908,8 @@ int t4_config_rss_range(struct adapter *adapter, int mbox, unsigned int viid, · 179 unmodified lines
858908 int start, int n, const u16 *rspq, unsigned int nrspq);
859909 int t4_config_glbl_rss(struct adapter *adapter, int mbox, unsigned int mode,
860910 unsigned int flags);
861−int t4_mc_read(struct adapter *adap, u32 addr, __be32 *data, u64 *parity);
911+int t4_mc_read(struct adapter *adap, int idx, u32 addr, __be32 *data,
912+ u64 *parity);
862913 int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data,
863914 u64 *parity);
864915
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c+760−59
@@ -68,8 +68,8 @@ · 67 unmodified lines
6868 #include "t4fw_api.h"
6969 #include "l2t.h"
7070
71−#define DRV_VERSION "1.3.0-ko"
72−#define DRV_DESC "Chelsio T4 Network Driver"
71+#define DRV_VERSION "2.0.0-ko"
72+#define DRV_DESC "Chelsio T4/T5 Network Driver"
7373
7474 /*
7575 * Max interrupt hold-off timer value in us. Queues fall back to this value
@@ -229,11 +229,51 @@ static DEFINE_PCI_DEVICE_TABLE(cxgb4_pci_tbl) = { · 153 unmodified lines
229229 CH_DEVICE(0x440a, 4),
230230 CH_DEVICE(0x440d, 4),
231231 CH_DEVICE(0x440e, 4),
232+ CH_DEVICE(0x5001, 4),
233+ CH_DEVICE(0x5002, 4),
234+ CH_DEVICE(0x5003, 4),
235+ CH_DEVICE(0x5004, 4),
236+ CH_DEVICE(0x5005, 4),
237+ CH_DEVICE(0x5006, 4),
238+ CH_DEVICE(0x5007, 4),
239+ CH_DEVICE(0x5008, 4),
240+ CH_DEVICE(0x5009, 4),
241+ CH_DEVICE(0x500A, 4),
242+ CH_DEVICE(0x500B, 4),
243+ CH_DEVICE(0x500C, 4),
244+ CH_DEVICE(0x500D, 4),
245+ CH_DEVICE(0x500E, 4),
246+ CH_DEVICE(0x500F, 4),
247+ CH_DEVICE(0x5010, 4),
248+ CH_DEVICE(0x5011, 4),
249+ CH_DEVICE(0x5012, 4),
250+ CH_DEVICE(0x5013, 4),
251+ CH_DEVICE(0x5401, 4),
252+ CH_DEVICE(0x5402, 4),
253+ CH_DEVICE(0x5403, 4),
254+ CH_DEVICE(0x5404, 4),
255+ CH_DEVICE(0x5405, 4),
256+ CH_DEVICE(0x5406, 4),
257+ CH_DEVICE(0x5407, 4),
258+ CH_DEVICE(0x5408, 4),
259+ CH_DEVICE(0x5409, 4),
260+ CH_DEVICE(0x540A, 4),
261+ CH_DEVICE(0x540B, 4),
262+ CH_DEVICE(0x540C, 4),
263+ CH_DEVICE(0x540D, 4),
264+ CH_DEVICE(0x540E, 4),
265+ CH_DEVICE(0x540F, 4),
266+ CH_DEVICE(0x5410, 4),
267+ CH_DEVICE(0x5411, 4),
268+ CH_DEVICE(0x5412, 4),
269+ CH_DEVICE(0x5413, 4),
232270 { 0, }
233271 };
234272
235273 #define FW_FNAME "cxgb4/t4fw.bin"
274+#define FW5_FNAME "cxgb4/t5fw.bin"
236275 #define FW_CFNAME "cxgb4/t4-config.txt"
276+#define FW5_CFNAME "cxgb4/t5-config.txt"
237277
238278 MODULE_DESCRIPTION(DRV_DESC);
239279 MODULE_AUTHOR("Chelsio Communications");
@@ -241,6 +281,7 @@ MODULE_LICENSE("Dual BSD/GPL"); · 1 unmodified line
241281 MODULE_VERSION(DRV_VERSION);
242282 MODULE_DEVICE_TABLE(pci, cxgb4_pci_tbl);
243283 MODULE_FIRMWARE(FW_FNAME);
284+MODULE_FIRMWARE(FW5_FNAME);
244285
245286 /*
246287 * Normally we're willing to become the firmware's Master PF but will be happy
@@ -319,7 +360,10 @@ static bool vf_acls; · 72 unmodified lines
319360 module_param(vf_acls, bool, 0644);
320361 MODULE_PARM_DESC(vf_acls, "if set enable virtualization L2 ACL enforcement");
321362
322−static unsigned int num_vf[4];
363+/* Configure the number of PCI-E Virtual Function which are to be instantiated
364+ * on SR-IOV Capable Physical Functions.
365+ */
366+static unsigned int num_vf[NUM_OF_PF_WITH_SRIOV];
323367
324368 module_param_array(num_vf, uint, NULL, 0644);
325369 MODULE_PARM_DESC(num_vf, "number of VFs for each of PFs 0-3");
@@ -515,7 +559,7 @@ static int link_start(struct net_device *dev) · 189 unmodified lines
515559 * that step explicitly.
516560 */
517561 ret = t4_set_rxmode(pi->adapter, mb, pi->viid, dev->mtu, -1, -1, -1,
518− !!(dev->features & NETIF_F_HW_VLAN_RX), true);
562+ !!(dev->features & NETIF_F_HW_VLAN_CTAG_RX), true);
519563 if (ret == 0) {
520564 ret = t4_change_mac(pi->adapter, mb, pi->viid,
521565 pi->xact_addr_filt, dev->dev_addr, true,
@@ -601,6 +645,21 @@ static int fwevtq_handler(struct sge_rspq *q, const __be64 *rsp, · 79 unmodified lines
601645 u8 opcode = ((const struct rss_header *)rsp)->opcode;
602646
603647 rsp++; /* skip RSS header */
648+
649+ /* FW can send EGR_UPDATEs encapsulated in a CPL_FW4_MSG.
650+ */
651+ if (unlikely(opcode == CPL_FW4_MSG &&
652+ ((const struct cpl_fw4_msg *)rsp)->type == FW_TYPE_RSSCPL)) {
653+ rsp++;
654+ opcode = ((const struct rss_header *)rsp)->opcode;
655+ rsp++;
656+ if (opcode != CPL_SGE_EGR_UPDATE) {
657+ dev_err(q->adap->pdev_dev, "unexpected FW4/CPL %#x on FW event queue\n"
658+ , opcode);
659+ goto out;
660+ }
661+ }
662+
604663 if (likely(opcode == CPL_SGE_EGR_UPDATE)) {
605664 const struct cpl_sge_egr_update *p = (void *)rsp;
606665 unsigned int qid = EGR_QID(ntohl(p->opcode_qid));
@@ -635,6 +694,7 @@ static int fwevtq_handler(struct sge_rspq *q, const __be64 *rsp, · 28 unmodified lines
635694 } else
636695 dev_err(q->adap->pdev_dev,
637696 "unexpected CPL %#x on FW event queue\n", opcode);
697+out:
638698 return 0;
639699 }
640700
@@ -652,6 +712,12 @@ static int uldrx_handler(struct sge_rspq *q, const __be64 *rsp, · 11 unmodified lines
652712 {
653713 struct sge_ofld_rxq *rxq = container_of(q, struct sge_ofld_rxq, rspq);
654714
715+ /* FW can send CPLs encapsulated in a CPL_FW4_MSG.
716+ */
717+ if (((const struct rss_header *)rsp)->opcode == CPL_FW4_MSG &&
718+ ((const struct cpl_fw4_msg *)(rsp + 1))->type == FW_TYPE_RSSCPL)
719+ rsp += 2;
720+
655721 if (ulds[q->uld].rx_handler(q->adap->uld_handle[q->uld], rsp, gl)) {
656722 rxq->stats.nomem++;
657723 return -1;
@@ -1002,21 +1068,36 @@ freeout: t4_free_sge_resources(adap); · 344 unmodified lines
10021068 static int upgrade_fw(struct adapter *adap)
10031069 {
10041070 int ret;
1005− u32 vers;
1071+ u32 vers, exp_major;
10061072 const struct fw_hdr *hdr;
10071073 const struct firmware *fw;
10081074 struct device *dev = adap->pdev_dev;
1075+ char *fw_file_name;
10091076
1010− ret = request_firmware(&fw, FW_FNAME, dev);
1077+ switch (CHELSIO_CHIP_VERSION(adap->chip)) {
1078+ case CHELSIO_T4:
1079+ fw_file_name = FW_FNAME;
1080+ exp_major = FW_VERSION_MAJOR;
1081+ break;
1082+ case CHELSIO_T5:
1083+ fw_file_name = FW5_FNAME;
1084+ exp_major = FW_VERSION_MAJOR_T5;
1085+ break;
1086+ default:
1087+ dev_err(dev, "Unsupported chip type, %x\n", adap->chip);
1088+ return -EINVAL;
1089+ }
1090+
1091+ ret = request_firmware(&fw, fw_file_name, dev);
10111092 if (ret < 0) {
1012− dev_err(dev, "unable to load firmware image " FW_FNAME
1013− ", error %d\n", ret);
1093+ dev_err(dev, "unable to load firmware image %s, error %d\n",
1094+ fw_file_name, ret);
10141095 return ret;
10151096 }
10161097
10171098 hdr = (const struct fw_hdr *)fw->data;
10181099 vers = ntohl(hdr->fw_ver);
1019− if (FW_HDR_FW_VER_MAJOR_GET(vers) != FW_VERSION_MAJOR) {
1100+ if (FW_HDR_FW_VER_MAJOR_GET(vers) != exp_major) {
10201101 ret = -EINVAL; /* wrong major version, won't do */
10211102 goto out;
10221103 }
@@ -1024,18 +1105,15 @@ static int upgrade_fw(struct adapter *adap) · 1 unmodified line
10241105 /*
10251106 * If the flash FW is unusable or we found something newer, load it.
10261107 */
1027− if (FW_HDR_FW_VER_MAJOR_GET(adap->params.fw_vers) != FW_VERSION_MAJOR ||
1108+ if (FW_HDR_FW_VER_MAJOR_GET(adap->params.fw_vers) != exp_major ||
10281109 vers > adap->params.fw_vers) {
10291110 dev_info(dev, "upgrading firmware ...\n");
10301111 ret = t4_fw_upgrade(adap, adap->mbox, fw->data, fw->size,
10311112 /*force=*/false);
10321113 if (!ret)
1033− dev_info(dev, "firmware successfully upgraded to "
1034− FW_FNAME " (%d.%d.%d.%d)\n",
1035− FW_HDR_FW_VER_MAJOR_GET(vers),
1036− FW_HDR_FW_VER_MINOR_GET(vers),
1037− FW_HDR_FW_VER_MICRO_GET(vers),
1038− FW_HDR_FW_VER_BUILD_GET(vers));
1114+ dev_info(dev,
1115+ "firmware upgraded to version %pI4 from %s\n",
1116+ &hdr->fw_ver, fw_file_name);
10391117 else
10401118 dev_err(dev, "firmware upgrade failed! err=%d\n", -ret);
10411119 } else {
@@ -1308,6 +1386,8 @@ static char stats_strings[][ETH_GSTRING_LEN] = { · 266 unmodified lines
13081386 "VLANinsertions ",
13091387 "GROpackets ",
13101388 "GROmerged ",
1389+ "WriteCoalSuccess ",
1390+ "WriteCoalFail ",
13111391 };
13121392
13131393 static int get_sset_count(struct net_device *dev, int sset)
@@ -1321,10 +1401,15 @@ static int get_sset_count(struct net_device *dev, int sset) · 7 unmodified lines
13211401 }
13221402
13231403 #define T4_REGMAP_SIZE (160 * 1024)
1404+#define T5_REGMAP_SIZE (332 * 1024)
13241405
13251406 static int get_regs_len(struct net_device *dev)
13261407 {
1327− return T4_REGMAP_SIZE;
1408+ struct adapter *adap = netdev2adap(dev);
1409+ if (is_t4(adap->chip))
1410+ return T4_REGMAP_SIZE;
1411+ else
1412+ return T5_REGMAP_SIZE;
13281413 }
13291414
13301415 static int get_eeprom_len(struct net_device *dev)
@@ -1398,11 +1483,25 @@ static void get_stats(struct net_device *dev, struct ethtool_stats *stats, · 67 unmodified lines
13981483 {
13991484 struct port_info *pi = netdev_priv(dev);
14001485 struct adapter *adapter = pi->adapter;
1486+ u32 val1, val2;
14011487
14021488 t4_get_port_stats(adapter, pi->tx_chan, (struct port_stats *)data);
14031489
14041490 data += sizeof(struct port_stats) / sizeof(u64);
14051491 collect_sge_port_stats(adapter, pi, (struct queue_port_stats *)data);
1492+ data += sizeof(struct queue_port_stats) / sizeof(u64);
1493+ if (!is_t4(adapter->chip)) {
1494+ t4_write_reg(adapter, SGE_STAT_CFG, STATSOURCE_T5(7));
1495+ val1 = t4_read_reg(adapter, SGE_STAT_TOTAL);
1496+ val2 = t4_read_reg(adapter, SGE_STAT_MATCH);
1497+ *data = val1 - val2;
1498+ data++;
1499+ *data = val2;
1500+ data++;
1501+ } else {
1502+ memset(data, 0, 2 * sizeof(u64));
1503+ *data += 2;
1504+ }
14061505 }
14071506
14081507 /*
@@ -1413,7 +1512,8 @@ static void get_stats(struct net_device *dev, struct ethtool_stats *stats, · 4 unmodified lines
14131512 */
14141513 static inline unsigned int mk_adap_vers(const struct adapter *ap)
14151514 {
1416− return 4 | (ap->params.rev << 10) | (1 << 16);
1515+ return CHELSIO_CHIP_VERSION(ap->chip) |
1516+ (CHELSIO_CHIP_RELEASE(ap->chip) << 10) | (1 << 16);
14171517 }
14181518
14191519 static void reg_block_dump(struct adapter *ap, void *buf, unsigned int start,
@@ -1428,7 +1528,7 @@ static void reg_block_dump(struct adapter *ap, void *buf, unsigned int start, · 8 unmodified lines
14281528 static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
14291529 void *buf)
14301530 {
1431− static const unsigned int reg_ranges[] = {
1531+ static const unsigned int t4_reg_ranges[] = {
14321532 0x1008, 0x1108,
14331533 0x1180, 0x11b4,
14341534 0x11fc, 0x123c,
@@ -1648,13 +1748,452 @@ static void get_regs(struct net_device *dev, struct ethtool_regs *regs, · 213 unmodified lines
16481748 0x27e00, 0x27e04
16491749 };
16501750
1751+ static const unsigned int t5_reg_ranges[] = {
1752+ 0x1008, 0x1148,
1753+ 0x1180, 0x11b4,
1754+ 0x11fc, 0x123c,
1755+ 0x1280, 0x173c,
1756+ 0x1800, 0x18fc,
1757+ 0x3000, 0x3028,
1758+ 0x3060, 0x30d8,
1759+ 0x30e0, 0x30fc,
1760+ 0x3140, 0x357c,
1761+ 0x35a8, 0x35cc,
1762+ 0x35ec, 0x35ec,
1763+ 0x3600, 0x5624,
1764+ 0x56cc, 0x575c,
1765+ 0x580c, 0x5814,
1766+ 0x5890, 0x58bc,
1767+ 0x5940, 0x59dc,
1768+ 0x59fc, 0x5a18,
1769+ 0x5a60, 0x5a9c,
1770+ 0x5b9c, 0x5bfc,
1771+ 0x6000, 0x6040,
1772+ 0x6058, 0x614c,
1773+ 0x7700, 0x7798,
1774+ 0x77c0, 0x78fc,
1775+ 0x7b00, 0x7c54,
1776+ 0x7d00, 0x7efc,
1777+ 0x8dc0, 0x8de0,
1778+ 0x8df8, 0x8e84,
1779+ 0x8ea0, 0x8f84,
1780+ 0x8fc0, 0x90f8,
1781+ 0x9400, 0x9470,
1782+ 0x9600, 0x96f4,
1783+ 0x9800, 0x9808,
1784+ 0x9820, 0x983c,
1785+ 0x9850, 0x9864,
1786+ 0x9c00, 0x9c6c,
1787+ 0x9c80, 0x9cec,
1788+ 0x9d00, 0x9d6c,
1789+ 0x9d80, 0x9dec,
1790+ 0x9e00, 0x9e6c,
1791+ 0x9e80, 0x9eec,
1792+ 0x9f00, 0x9f6c,
1793+ 0x9f80, 0xa020,
1794+ 0xd004, 0xd03c,
1795+ 0xdfc0, 0xdfe0,
1796+ 0xe000, 0x11088,
1797+ 0x1109c, 0x1117c,
1798+ 0x11190, 0x11204,
1799+ 0x19040, 0x1906c,
1800+ 0x19078, 0x19080,
1801+ 0x1908c, 0x19124,
1802+ 0x19150, 0x191b0,
1803+ 0x191d0, 0x191e8,
1804+ 0x19238, 0x19290,
1805+ 0x193f8, 0x19474,
1806+ 0x19490, 0x194cc,
1807+ 0x194f0, 0x194f8,
1808+ 0x19c00, 0x19c60,
1809+ 0x19c94, 0x19e10,
1810+ 0x19e50, 0x19f34,
1811+ 0x19f40, 0x19f50,
1812+ 0x19f90, 0x19fe4,
1813+ 0x1a000, 0x1a06c,
1814+ 0x1a0b0, 0x1a120,
1815+ 0x1a128, 0x1a138,
1816+ 0x1a190, 0x1a1c4,
1817+ 0x1a1fc, 0x1a1fc,
1818+ 0x1e008, 0x1e00c,
1819+ 0x1e040, 0x1e04c,
1820+ 0x1e284, 0x1e290,
1821+ 0x1e2c0, 0x1e2c0,
1822+ 0x1e2e0, 0x1e2e0,
1823+ 0x1e300, 0x1e384,
1824+ 0x1e3c0, 0x1e3c8,
1825+ 0x1e408, 0x1e40c,
1826+ 0x1e440, 0x1e44c,
1827+ 0x1e684, 0x1e690,
1828+ 0x1e6c0, 0x1e6c0,
1829+ 0x1e6e0, 0x1e6e0,
1830+ 0x1e700, 0x1e784,
1831+ 0x1e7c0, 0x1e7c8,
1832+ 0x1e808, 0x1e80c,
1833+ 0x1e840, 0x1e84c,
1834+ 0x1ea84, 0x1ea90,
1835+ 0x1eac0, 0x1eac0,
1836+ 0x1eae0, 0x1eae0,
1837+ 0x1eb00, 0x1eb84,
1838+ 0x1ebc0, 0x1ebc8,
1839+ 0x1ec08, 0x1ec0c,
1840+ 0x1ec40, 0x1ec4c,
1841+ 0x1ee84, 0x1ee90,
1842+ 0x1eec0, 0x1eec0,
1843+ 0x1eee0, 0x1eee0,
1844+ 0x1ef00, 0x1ef84,
1845+ 0x1efc0, 0x1efc8,
1846+ 0x1f008, 0x1f00c,
1847+ 0x1f040, 0x1f04c,
1848+ 0x1f284, 0x1f290,
1849+ 0x1f2c0, 0x1f2c0,
1850+ 0x1f2e0, 0x1f2e0,
1851+ 0x1f300, 0x1f384,
1852+ 0x1f3c0, 0x1f3c8,
1853+ 0x1f408, 0x1f40c,
1854+ 0x1f440, 0x1f44c,
1855+ 0x1f684, 0x1f690,
1856+ 0x1f6c0, 0x1f6c0,
1857+ 0x1f6e0, 0x1f6e0,
1858+ 0x1f700, 0x1f784,
1859+ 0x1f7c0, 0x1f7c8,
1860+ 0x1f808, 0x1f80c,
1861+ 0x1f840, 0x1f84c,
1862+ 0x1fa84, 0x1fa90,
1863+ 0x1fac0, 0x1fac0,
1864+ 0x1fae0, 0x1fae0,
1865+ 0x1fb00, 0x1fb84,
1866+ 0x1fbc0, 0x1fbc8,
1867+ 0x1fc08, 0x1fc0c,
1868+ 0x1fc40, 0x1fc4c,
1869+ 0x1fe84, 0x1fe90,
1870+ 0x1fec0, 0x1fec0,
1871+ 0x1fee0, 0x1fee0,
1872+ 0x1ff00, 0x1ff84,
1873+ 0x1ffc0, 0x1ffc8,
1874+ 0x30000, 0x30030,
1875+ 0x30100, 0x30144,
1876+ 0x30190, 0x301d0,
1877+ 0x30200, 0x30318,
1878+ 0x30400, 0x3052c,
1879+ 0x30540, 0x3061c,
1880+ 0x30800, 0x30834,
1881+ 0x308c0, 0x30908,
1882+ 0x30910, 0x309ac,
1883+ 0x30a00, 0x30a04,
1884+ 0x30a0c, 0x30a2c,
1885+ 0x30a44, 0x30a50,
1886+ 0x30a74, 0x30c24,
1887+ 0x30d08, 0x30d14,
1888+ 0x30d1c, 0x30d20,
1889+ 0x30d3c, 0x30d50,
1890+ 0x31200, 0x3120c,
1891+ 0x31220, 0x31220,
1892+ 0x31240, 0x31240,
1893+ 0x31600, 0x31600,
1894+ 0x31608, 0x3160c,
1895+ 0x31a00, 0x31a1c,
1896+ 0x31e04, 0x31e20,
1897+ 0x31e38, 0x31e3c,
1898+ 0x31e80, 0x31e80,
1899+ 0x31e88, 0x31ea8,
1900+ 0x31eb0, 0x31eb4,
1901+ 0x31ec8, 0x31ed4,
1902+ 0x31fb8, 0x32004,
1903+ 0x32208, 0x3223c,
1904+ 0x32600, 0x32630,
1905+ 0x32a00, 0x32abc,
1906+ 0x32b00, 0x32b70,
1907+ 0x33000, 0x33048,
1908+ 0x33060, 0x3309c,
1909+ 0x330f0, 0x33148,
1910+ 0x33160, 0x3319c,
1911+ 0x331f0, 0x332e4,
1912+ 0x332f8, 0x333e4,
1913+ 0x333f8, 0x33448,
1914+ 0x33460, 0x3349c,
1915+ 0x334f0, 0x33548,
1916+ 0x33560, 0x3359c,
1917+ 0x335f0, 0x336e4,
1918+ 0x336f8, 0x337e4,
1919+ 0x337f8, 0x337fc,
1920+ 0x33814, 0x33814,
1921+ 0x3382c, 0x3382c,
1922+ 0x33880, 0x3388c,
1923+ 0x338e8, 0x338ec,
1924+ 0x33900, 0x33948,
1925+ 0x33960, 0x3399c,
1926+ 0x339f0, 0x33ae4,
1927+ 0x33af8, 0x33b10,
1928+ 0x33b28, 0x33b28,
1929+ 0x33b3c, 0x33b50,
1930+ 0x33bf0, 0x33c10,
1931+ 0x33c28, 0x33c28,
1932+ 0x33c3c, 0x33c50,
1933+ 0x33cf0, 0x33cfc,
1934+ 0x34000, 0x34030,
1935+ 0x34100, 0x34144,
1936+ 0x34190, 0x341d0,
1937+ 0x34200, 0x34318,
1938+ 0x34400, 0x3452c,
1939+ 0x34540, 0x3461c,
1940+ 0x34800, 0x34834,
1941+ 0x348c0, 0x34908,
1942+ 0x34910, 0x349ac,
1943+ 0x34a00, 0x34a04,
1944+ 0x34a0c, 0x34a2c,
1945+ 0x34a44, 0x34a50,
1946+ 0x34a74, 0x34c24,
1947+ 0x34d08, 0x34d14,
1948+ 0x34d1c, 0x34d20,
1949+ 0x34d3c, 0x34d50,
1950+ 0x35200, 0x3520c,
1951+ 0x35220, 0x35220,
1952+ 0x35240, 0x35240,
1953+ 0x35600, 0x35600,
1954+ 0x35608, 0x3560c,
1955+ 0x35a00, 0x35a1c,
1956+ 0x35e04, 0x35e20,
1957+ 0x35e38, 0x35e3c,
1958+ 0x35e80, 0x35e80,
1959+ 0x35e88, 0x35ea8,
1960+ 0x35eb0, 0x35eb4,
1961+ 0x35ec8, 0x35ed4,
1962+ 0x35fb8, 0x36004,
1963+ 0x36208, 0x3623c,
1964+ 0x36600, 0x36630,
1965+ 0x36a00, 0x36abc,
1966+ 0x36b00, 0x36b70,
1967+ 0x37000, 0x37048,
1968+ 0x37060, 0x3709c,
1969+ 0x370f0, 0x37148,
1970+ 0x37160, 0x3719c,
1971+ 0x371f0, 0x372e4,
1972+ 0x372f8, 0x373e4,
1973+ 0x373f8, 0x37448,
1974+ 0x37460, 0x3749c,
1975+ 0x374f0, 0x37548,
1976+ 0x37560, 0x3759c,
1977+ 0x375f0, 0x376e4,
1978+ 0x376f8, 0x377e4,
1979+ 0x377f8, 0x377fc,
1980+ 0x37814, 0x37814,
1981+ 0x3782c, 0x3782c,
1982+ 0x37880, 0x3788c,
1983+ 0x378e8, 0x378ec,
1984+ 0x37900, 0x37948,
1985+ 0x37960, 0x3799c,
1986+ 0x379f0, 0x37ae4,
1987+ 0x37af8, 0x37b10,
1988+ 0x37b28, 0x37b28,
1989+ 0x37b3c, 0x37b50,
1990+ 0x37bf0, 0x37c10,
1991+ 0x37c28, 0x37c28,
1992+ 0x37c3c, 0x37c50,
1993+ 0x37cf0, 0x37cfc,
1994+ 0x38000, 0x38030,
1995+ 0x38100, 0x38144,
1996+ 0x38190, 0x381d0,
1997+ 0x38200, 0x38318,
1998+ 0x38400, 0x3852c,
1999+ 0x38540, 0x3861c,
2000+ 0x38800, 0x38834,
2001+ 0x388c0, 0x38908,
2002+ 0x38910, 0x389ac,
2003+ 0x38a00, 0x38a04,
2004+ 0x38a0c, 0x38a2c,
2005+ 0x38a44, 0x38a50,
2006+ 0x38a74, 0x38c24,
2007+ 0x38d08, 0x38d14,
2008+ 0x38d1c, 0x38d20,
2009+ 0x38d3c, 0x38d50,
2010+ 0x39200, 0x3920c,
2011+ 0x39220, 0x39220,
2012+ 0x39240, 0x39240,
2013+ 0x39600, 0x39600,
2014+ 0x39608, 0x3960c,
2015+ 0x39a00, 0x39a1c,
2016+ 0x39e04, 0x39e20,
2017+ 0x39e38, 0x39e3c,
2018+ 0x39e80, 0x39e80,
2019+ 0x39e88, 0x39ea8,
2020+ 0x39eb0, 0x39eb4,
2021+ 0x39ec8, 0x39ed4,
2022+ 0x39fb8, 0x3a004,
2023+ 0x3a208, 0x3a23c,
2024+ 0x3a600, 0x3a630,
2025+ 0x3aa00, 0x3aabc,
2026+ 0x3ab00, 0x3ab70,
2027+ 0x3b000, 0x3b048,
2028+ 0x3b060, 0x3b09c,
2029+ 0x3b0f0, 0x3b148,
2030+ 0x3b160, 0x3b19c,
2031+ 0x3b1f0, 0x3b2e4,
2032+ 0x3b2f8, 0x3b3e4,
2033+ 0x3b3f8, 0x3b448,
2034+ 0x3b460, 0x3b49c,
2035+ 0x3b4f0, 0x3b548,
2036+ 0x3b560, 0x3b59c,
2037+ 0x3b5f0, 0x3b6e4,
2038+ 0x3b6f8, 0x3b7e4,
2039+ 0x3b7f8, 0x3b7fc,
2040+ 0x3b814, 0x3b814,
2041+ 0x3b82c, 0x3b82c,
2042+ 0x3b880, 0x3b88c,
2043+ 0x3b8e8, 0x3b8ec,
2044+ 0x3b900, 0x3b948,
2045+ 0x3b960, 0x3b99c,
2046+ 0x3b9f0, 0x3bae4,
2047+ 0x3baf8, 0x3bb10,
2048+ 0x3bb28, 0x3bb28,
2049+ 0x3bb3c, 0x3bb50,
2050+ 0x3bbf0, 0x3bc10,
2051+ 0x3bc28, 0x3bc28,
2052+ 0x3bc3c, 0x3bc50,
2053+ 0x3bcf0, 0x3bcfc,
2054+ 0x3c000, 0x3c030,
2055+ 0x3c100, 0x3c144,
2056+ 0x3c190, 0x3c1d0,
2057+ 0x3c200, 0x3c318,
2058+ 0x3c400, 0x3c52c,
2059+ 0x3c540, 0x3c61c,
2060+ 0x3c800, 0x3c834,
2061+ 0x3c8c0, 0x3c908,
2062+ 0x3c910, 0x3c9ac,
2063+ 0x3ca00, 0x3ca04,
2064+ 0x3ca0c, 0x3ca2c,
2065+ 0x3ca44, 0x3ca50,
2066+ 0x3ca74, 0x3cc24,
2067+ 0x3cd08, 0x3cd14,
2068+ 0x3cd1c, 0x3cd20,
2069+ 0x3cd3c, 0x3cd50,
2070+ 0x3d200, 0x3d20c,
2071+ 0x3d220, 0x3d220,
2072+ 0x3d240, 0x3d240,
2073+ 0x3d600, 0x3d600,
2074+ 0x3d608, 0x3d60c,
2075+ 0x3da00, 0x3da1c,
2076+ 0x3de04, 0x3de20,
2077+ 0x3de38, 0x3de3c,
2078+ 0x3de80, 0x3de80,
2079+ 0x3de88, 0x3dea8,
2080+ 0x3deb0, 0x3deb4,
2081+ 0x3dec8, 0x3ded4,
2082+ 0x3dfb8, 0x3e004,
2083+ 0x3e208, 0x3e23c,
2084+ 0x3e600, 0x3e630,
2085+ 0x3ea00, 0x3eabc,
2086+ 0x3eb00, 0x3eb70,
2087+ 0x3f000, 0x3f048,
2088+ 0x3f060, 0x3f09c,
2089+ 0x3f0f0, 0x3f148,
2090+ 0x3f160, 0x3f19c,
2091+ 0x3f1f0, 0x3f2e4,
2092+ 0x3f2f8, 0x3f3e4,
2093+ 0x3f3f8, 0x3f448,
2094+ 0x3f460, 0x3f49c,
2095+ 0x3f4f0, 0x3f548,
2096+ 0x3f560, 0x3f59c,
2097+ 0x3f5f0, 0x3f6e4,
2098+ 0x3f6f8, 0x3f7e4,
2099+ 0x3f7f8, 0x3f7fc,
2100+ 0x3f814, 0x3f814,
2101+ 0x3f82c, 0x3f82c,
2102+ 0x3f880, 0x3f88c,
2103+ 0x3f8e8, 0x3f8ec,
2104+ 0x3f900, 0x3f948,
2105+ 0x3f960, 0x3f99c,
2106+ 0x3f9f0, 0x3fae4,
2107+ 0x3faf8, 0x3fb10,
2108+ 0x3fb28, 0x3fb28,
2109+ 0x3fb3c, 0x3fb50,
2110+ 0x3fbf0, 0x3fc10,
2111+ 0x3fc28, 0x3fc28,
2112+ 0x3fc3c, 0x3fc50,
2113+ 0x3fcf0, 0x3fcfc,
2114+ 0x40000, 0x4000c,
2115+ 0x40040, 0x40068,
2116+ 0x40080, 0x40144,
2117+ 0x40180, 0x4018c,
2118+ 0x40200, 0x40298,
2119+ 0x402ac, 0x4033c,
2120+ 0x403f8, 0x403fc,
2121+ 0x41300, 0x413c4,
2122+ 0x41400, 0x4141c,
2123+ 0x41480, 0x414d0,
2124+ 0x44000, 0x44078,
2125+ 0x440c0, 0x44278,
2126+ 0x442c0, 0x44478,
2127+ 0x444c0, 0x44678,
2128+ 0x446c0, 0x44878,
2129+ 0x448c0, 0x449fc,
2130+ 0x45000, 0x45068,
2131+ 0x45080, 0x45084,
2132+ 0x450a0, 0x450b0,
2133+ 0x45200, 0x45268,
2134+ 0x45280, 0x45284,
2135+ 0x452a0, 0x452b0,
2136+ 0x460c0, 0x460e4,
2137+ 0x47000, 0x4708c,
2138+ 0x47200, 0x47250,
2139+ 0x47400, 0x47420,
2140+ 0x47600, 0x47618,
2141+ 0x47800, 0x47814,
2142+ 0x48000, 0x4800c,
2143+ 0x48040, 0x48068,
2144+ 0x48080, 0x48144,
2145+ 0x48180, 0x4818c,
2146+ 0x48200, 0x48298,
2147+ 0x482ac, 0x4833c,
2148+ 0x483f8, 0x483fc,
2149+ 0x49300, 0x493c4,
2150+ 0x49400, 0x4941c,
2151+ 0x49480, 0x494d0,
2152+ 0x4c000, 0x4c078,
2153+ 0x4c0c0, 0x4c278,
2154+ 0x4c2c0, 0x4c478,
2155+ 0x4c4c0, 0x4c678,
2156+ 0x4c6c0, 0x4c878,
2157+ 0x4c8c0, 0x4c9fc,
2158+ 0x4d000, 0x4d068,
2159+ 0x4d080, 0x4d084,
2160+ 0x4d0a0, 0x4d0b0,
2161+ 0x4d200, 0x4d268,
2162+ 0x4d280, 0x4d284,
2163+ 0x4d2a0, 0x4d2b0,
2164+ 0x4e0c0, 0x4e0e4,
2165+ 0x4f000, 0x4f08c,
2166+ 0x4f200, 0x4f250,
2167+ 0x4f400, 0x4f420,
2168+ 0x4f600, 0x4f618,
2169+ 0x4f800, 0x4f814,
2170+ 0x50000, 0x500cc,
2171+ 0x50400, 0x50400,
2172+ 0x50800, 0x508cc,
2173+ 0x50c00, 0x50c00,
2174+ 0x51000, 0x5101c,
2175+ 0x51300, 0x51308,
2176+ };
2177+
16512178 int i;
16522179 struct adapter *ap = netdev2adap(dev);
2180+ static const unsigned int *reg_ranges;
2181+ int arr_size = 0, buf_size = 0;
2182+
2183+ if (is_t4(ap->chip)) {
2184+ reg_ranges = &t4_reg_ranges[0];
2185+ arr_size = ARRAY_SIZE(t4_reg_ranges);
2186+ buf_size = T4_REGMAP_SIZE;
2187+ } else {
2188+ reg_ranges = &t5_reg_ranges[0];
2189+ arr_size = ARRAY_SIZE(t5_reg_ranges);
2190+ buf_size = T5_REGMAP_SIZE;
2191+ }
16532192
16542193 regs->version = mk_adap_vers(ap);
16552194
1656− memset(buf, 0, T4_REGMAP_SIZE);
1657− for (i = 0; i < ARRAY_SIZE(reg_ranges); i += 2)
2195+ memset(buf, 0, buf_size);
2196+ for (i = 0; i < arr_size; i += 2)
16582197 reg_block_dump(ap, buf, reg_ranges[i], reg_ranges[i + 1]);
16592198 }
16602199
@@ -2205,14 +2744,14 @@ static int cxgb_set_features(struct net_device *dev, netdev_features_t features) · 544 unmodified lines
22052744 netdev_features_t changed = dev->features ^ features;
22062745 int err;
22072746
2208− if (!(changed & NETIF_F_HW_VLAN_RX))
2747+ if (!(changed & NETIF_F_HW_VLAN_CTAG_RX))
22092748 return 0;
22102749
22112750 err = t4_set_rxmode(pi->adapter, pi->adapter->fn, pi->viid, -1,
22122751 -1, -1, -1,
2213− !!(features & NETIF_F_HW_VLAN_RX), true);
2752+ !!(features & NETIF_F_HW_VLAN_CTAG_RX), true);
22142753 if (unlikely(err))
2215− dev->features = features ^ NETIF_F_HW_VLAN_RX;
2754+ dev->features = features ^ NETIF_F_HW_VLAN_CTAG_RX;
22162755 return err;
22172756 }
22182757
@@ -2363,8 +2902,8 @@ static ssize_t mem_read(struct file *file, char __user *buf, size_t count, · 144 unmodified lines
23632902 int ret, ofst;
23642903 __be32 data[16];
23652904
2366− if (mem == MEM_MC)
2367− ret = t4_mc_read(adap, pos, data, NULL);
2905+ if ((mem == MEM_MC) || (mem == MEM_MC1))
2906+ ret = t4_mc_read(adap, mem % MEM_MC, pos, data, NULL);
23682907 else
23692908 ret = t4_edc_read(adap, mem, pos, data, NULL);
23702909 if (ret)
@@ -2405,18 +2944,37 @@ static void add_debugfs_mem(struct adapter *adap, const char *name, · 34 unmodified lines
24052944 static int setup_debugfs(struct adapter *adap)
24062945 {
24072946 int i;
2947+ u32 size;
24082948
24092949 if (IS_ERR_OR_NULL(adap->debugfs_root))
24102950 return -1;
24112951
24122952 i = t4_read_reg(adap, MA_TARGET_MEM_ENABLE);
2413− if (i & EDRAM0_ENABLE)
2414− add_debugfs_mem(adap, "edc0", MEM_EDC0, 5);
2415− if (i & EDRAM1_ENABLE)
2416− add_debugfs_mem(adap, "edc1", MEM_EDC1, 5);
2417− if (i & EXT_MEM_ENABLE)
2418− add_debugfs_mem(adap, "mc", MEM_MC,
2419− EXT_MEM_SIZE_GET(t4_read_reg(adap, MA_EXT_MEMORY_BAR)));
2953+ if (i & EDRAM0_ENABLE) {
2954+ size = t4_read_reg(adap, MA_EDRAM0_BAR);
2955+ add_debugfs_mem(adap, "edc0", MEM_EDC0, EDRAM_SIZE_GET(size));
2956+ }
2957+ if (i & EDRAM1_ENABLE) {
2958+ size = t4_read_reg(adap, MA_EDRAM1_BAR);
2959+ add_debugfs_mem(adap, "edc1", MEM_EDC1, EDRAM_SIZE_GET(size));
2960+ }
2961+ if (is_t4(adap->chip)) {
2962+ size = t4_read_reg(adap, MA_EXT_MEMORY_BAR);
2963+ if (i & EXT_MEM_ENABLE)
2964+ add_debugfs_mem(adap, "mc", MEM_MC,
2965+ EXT_MEM_SIZE_GET(size));
2966+ } else {
2967+ if (i & EXT_MEM_ENABLE) {
2968+ size = t4_read_reg(adap, MA_EXT_MEMORY_BAR);
2969+ add_debugfs_mem(adap, "mc0", MEM_MC0,
2970+ EXT_MEM_SIZE_GET(size));
2971+ }
2972+ if (i & EXT_MEM1_ENABLE) {
2973+ size = t4_read_reg(adap, MA_EXT_MEMORY1_BAR);
2974+ add_debugfs_mem(adap, "mc1", MEM_MC1,
2975+ EXT_MEM_SIZE_GET(size));
2976+ }
2977+ }
24202978 if (adap->l2t)
24212979 debugfs_create_file("l2t", S_IRUSR, adap->debugfs_root, adap,
24222980 &t4_l2t_fops);
@@ -2747,10 +3305,18 @@ EXPORT_SYMBOL(cxgb4_port_chan); · 324 unmodified lines
27473305 unsigned int cxgb4_dbfifo_count(const struct net_device *dev, int lpfifo)
27483306 {
27493307 struct adapter *adap = netdev2adap(dev);
2750− u32 v;
3308+ u32 v1, v2, lp_count, hp_count;
27513309
2752− v = t4_read_reg(adap, A_SGE_DBFIFO_STATUS);
2753− return lpfifo ? G_LP_COUNT(v) : G_HP_COUNT(v);
3310+ v1 = t4_read_reg(adap, A_SGE_DBFIFO_STATUS);
3311+ v2 = t4_read_reg(adap, SGE_DBFIFO_STATUS2);
3312+ if (is_t4(adap->chip)) {
3313+ lp_count = G_LP_COUNT(v1);
3314+ hp_count = G_HP_COUNT(v1);
3315+ } else {
3316+ lp_count = G_LP_COUNT_T5(v1);
3317+ hp_count = G_HP_COUNT_T5(v2);
3318+ }
3319+ return lpfifo ? lp_count : hp_count;
27543320 }
27553321 EXPORT_SYMBOL(cxgb4_dbfifo_count);
27563322
@@ -2853,6 +3419,25 @@ out: · 96 unmodified lines
28533419 }
28543420 EXPORT_SYMBOL(cxgb4_sync_txq_pidx);
28553421
3422+void cxgb4_disable_db_coalescing(struct net_device *dev)
3423+{
3424+ struct adapter *adap;
3425+
3426+ adap = netdev2adap(dev);
3427+ t4_set_reg_field(adap, A_SGE_DOORBELL_CONTROL, F_NOCOALESCE,
3428+ F_NOCOALESCE);
3429+}
3430+EXPORT_SYMBOL(cxgb4_disable_db_coalescing);
3431+
3432+void cxgb4_enable_db_coalescing(struct net_device *dev)
3433+{
3434+ struct adapter *adap;
3435+
3436+ adap = netdev2adap(dev);
3437+ t4_set_reg_field(adap, A_SGE_DOORBELL_CONTROL, F_NOCOALESCE, 0);
3438+}
3439+EXPORT_SYMBOL(cxgb4_enable_db_coalescing);
3440+
28563441 static struct pci_driver cxgb4_driver;
28573442
28583443 static void check_neigh_update(struct neighbour *neigh)
@@ -2888,14 +3473,23 @@ static struct notifier_block cxgb4_netevent_nb = { · 29 unmodified lines
28883473
28893474 static void drain_db_fifo(struct adapter *adap, int usecs)
28903475 {
2891− u32 v;
3476+ u32 v1, v2, lp_count, hp_count;
28923477
28933478 do {
3479+ v1 = t4_read_reg(adap, A_SGE_DBFIFO_STATUS);
3480+ v2 = t4_read_reg(adap, SGE_DBFIFO_STATUS2);
3481+ if (is_t4(adap->chip)) {
3482+ lp_count = G_LP_COUNT(v1);
3483+ hp_count = G_HP_COUNT(v1);
3484+ } else {
3485+ lp_count = G_LP_COUNT_T5(v1);
3486+ hp_count = G_HP_COUNT_T5(v2);
3487+ }
3488+
3489+ if (lp_count == 0 && hp_count == 0)
3490+ break;
28943491 set_current_state(TASK_UNINTERRUPTIBLE);
28953492 schedule_timeout(usecs_to_jiffies(usecs));
2896− v = t4_read_reg(adap, A_SGE_DBFIFO_STATUS);
2897− if (G_LP_COUNT(v) == 0 && G_HP_COUNT(v) == 0)
2898− break;
28993493 } while (1);
29003494 }
29013495
@@ -3004,24 +3598,62 @@ static void process_db_drop(struct work_struct *work) · 102 unmodified lines
30043598
30053599 adap = container_of(work, struct adapter, db_drop_task);
30063600
3601+ if (is_t4(adap->chip)) {
3602+ disable_dbs(adap);
3603+ notify_rdma_uld(adap, CXGB4_CONTROL_DB_DROP);
3604+ drain_db_fifo(adap, 1);
3605+ recover_all_queues(adap);
3606+ enable_dbs(adap);
3607+ } else {
3608+ u32 dropped_db = t4_read_reg(adap, 0x010ac);
3609+ u16 qid = (dropped_db >> 15) & 0x1ffff;
3610+ u16 pidx_inc = dropped_db & 0x1fff;
3611+ unsigned int s_qpp;
3612+ unsigned short udb_density;
3613+ unsigned long qpshift;
3614+ int page;
3615+ u32 udb;
3616+
3617+ dev_warn(adap->pdev_dev,
3618+ "Dropped DB 0x%x qid %d bar2 %d coalesce %d pidx %d\n",
3619+ dropped_db, qid,
3620+ (dropped_db >> 14) & 1,
3621+ (dropped_db >> 13) & 1,
3622+ pidx_inc);
3623+
3624+ drain_db_fifo(adap, 1);
3625+
3626+ s_qpp = QUEUESPERPAGEPF1 * adap->fn;
3627+ udb_density = 1 << QUEUESPERPAGEPF0_GET(t4_read_reg(adap,
3628+ SGE_EGRESS_QUEUES_PER_PAGE_PF) >> s_qpp);
3629+ qpshift = PAGE_SHIFT - ilog2(udb_density);
3630+ udb = qid << qpshift;
3631+ udb &= PAGE_MASK;
3632+ page = udb / PAGE_SIZE;
3633+ udb += (qid - (page * udb_density)) * 128;
3634+
3635+ writel(PIDX(pidx_inc), adap->bar2 + udb + 8);
3636+
3637+ /* Re-enable BAR2 WC */
3638+ t4_set_reg_field(adap, 0x10b0, 1<<15, 1<<15);
3639+ }
3640+
30073641 t4_set_reg_field(adap, A_SGE_DOORBELL_CONTROL, F_DROPPED_DB, 0);
3008− disable_dbs(adap);
3009− notify_rdma_uld(adap, CXGB4_CONTROL_DB_DROP);
3010− drain_db_fifo(adap, 1);
3011− recover_all_queues(adap);
3012− enable_dbs(adap);
30133642 }
30143643
30153644 void t4_db_full(struct adapter *adap)
30163645 {
3017− t4_set_reg_field(adap, SGE_INT_ENABLE3,
3018− DBFIFO_HP_INT | DBFIFO_LP_INT, 0);
3019− queue_work(workq, &adap->db_full_task);
3646+ if (is_t4(adap->chip)) {
3647+ t4_set_reg_field(adap, SGE_INT_ENABLE3,
3648+ DBFIFO_HP_INT | DBFIFO_LP_INT, 0);
3649+ queue_work(workq, &adap->db_full_task);
3650+ }
30203651 }
30213652
30223653 void t4_db_dropped(struct adapter *adap)
30233654 {
3024− queue_work(workq, &adap->db_drop_task);
3655+ if (is_t4(adap->chip))
3656+ queue_work(workq, &adap->db_drop_task);
30253657 }
30263658
30273659 static void uld_attach(struct adapter *adap, unsigned int uld)
@@ -3566,17 +4198,27 @@ void t4_fatal_err(struct adapter *adap) · 538 unmodified lines
35664198
35674199 static void setup_memwin(struct adapter *adap)
35684200 {
3569− u32 bar0;
4201+ u32 bar0, mem_win0_base, mem_win1_base, mem_win2_base;
35704202
35714203 bar0 = pci_resource_start(adap->pdev, 0); /* truncation intentional */
4204+ if (is_t4(adap->chip)) {
4205+ mem_win0_base = bar0 + MEMWIN0_BASE;
4206+ mem_win1_base = bar0 + MEMWIN1_BASE;
4207+ mem_win2_base = bar0 + MEMWIN2_BASE;
4208+ } else {
4209+ /* For T5, only relative offset inside the PCIe BAR is passed */
4210+ mem_win0_base = MEMWIN0_BASE;
4211+ mem_win1_base = MEMWIN1_BASE_T5;
4212+ mem_win2_base = MEMWIN2_BASE_T5;
4213+ }
35724214 t4_write_reg(adap, PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN, 0),
3573− (bar0 + MEMWIN0_BASE) | BIR(0) |
4215+ mem_win0_base | BIR(0) |
35744216 WINDOW(ilog2(MEMWIN0_APERTURE) - 10));
35754217 t4_write_reg(adap, PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN, 1),
3576− (bar0 + MEMWIN1_BASE) | BIR(0) |
4218+ mem_win1_base | BIR(0) |
35774219 WINDOW(ilog2(MEMWIN1_APERTURE) - 10));
35784220 t4_write_reg(adap, PCIE_MEM_ACCESS_REG(PCIE_MEM_ACCESS_BASE_WIN, 2),
3579− (bar0 + MEMWIN2_BASE) | BIR(0) |
4221+ mem_win2_base | BIR(0) |
35804222 WINDOW(ilog2(MEMWIN2_APERTURE) - 10));
35814223 }
35824224
@@ -3745,6 +4387,7 @@ static int adap_init0_config(struct adapter *adapter, int reset) · 162 unmodified lines
37454387 unsigned long mtype = 0, maddr = 0;
37464388 u32 finiver, finicsum, cfcsum;
37474389 int ret, using_flash;
4390+ char *fw_config_file, fw_config_file_path[256];
37484391
37494392 /*
37504393 * Reset device if necessary.
@@ -3761,7 +4404,21 @@ static int adap_init0_config(struct adapter *adapter, int reset) · 10 unmodified lines
37614404 * then use that. Otherwise, use the configuration file stored
37624405 * in the adapter flash ...
37634406 */
3764− ret = request_firmware(&cf, FW_CFNAME, adapter->pdev_dev);
4407+ switch (CHELSIO_CHIP_VERSION(adapter->chip)) {
4408+ case CHELSIO_T4:
4409+ fw_config_file = FW_CFNAME;
4410+ break;
4411+ case CHELSIO_T5:
4412+ fw_config_file = FW5_CFNAME;
4413+ break;
4414+ default:
4415+ dev_err(adapter->pdev_dev, "Device %d is not supported\n",
4416+ adapter->pdev->device);
4417+ ret = -EINVAL;
4418+ goto bye;
4419+ }
4420+
4421+ ret = request_firmware(&cf, fw_config_file, adapter->pdev_dev);
37654422 if (ret < 0) {
37664423 using_flash = 1;
37674424 mtype = FW_MEMTYPE_CF_FLASH;
@@ -3877,6 +4534,7 @@ static int adap_init0_config(struct adapter *adapter, int reset) · 109 unmodified lines
38774534 if (ret < 0)
38784535 goto bye;
38794536
4537+ sprintf(fw_config_file_path, "/lib/firmware/%s", fw_config_file);
38804538 /*
38814539 * Return successfully and note that we're operating with parameters
38824540 * not supplied by the driver, rather than from hard-wired
@@ -3887,7 +4545,7 @@ static int adap_init0_config(struct adapter *adapter, int reset) · 4 unmodified lines
38874545 "Configuration File %s, version %#x, computed checksum %#x\n",
38884546 (using_flash
38894547 ? "in device FLASH"
3890− : "/lib/firmware/" FW_CFNAME),
4548+ : fw_config_file_path),
38914549 finiver, cfcsum);
38924550 return 0;
38934551
@@ -4354,6 +5012,15 @@ static int adap_init0(struct adapter *adap) · 460 unmodified lines
43545012 adap->tids.aftid_end = val[1];
43555013 }
43565014
5015+ /* If we're running on newer firmware, let it know that we're
5016+ * prepared to deal with encapsulated CPL messages. Older
5017+ * firmware won't understand this and we'll just get
5018+ * unencapsulated messages ...
5019+ */
5020+ params[0] = FW_PARAM_PFVF(CPLFW4MSG_ENCAP);
5021+ val[0] = 1;
5022+ (void) t4_set_params(adap, adap->mbox, adap->fn, 0, 1, params, val);
5023+
43575024 /*
43585025 * Get device capabilities so we can determine what resources we need
43595026 * to manage.
@@ -4814,7 +5481,8 @@ static void print_port_info(const struct net_device *dev) · 454 unmodified lines
48145481 sprintf(bufp, "BASE-%s", base[pi->port_type]);
48155482
48165483 netdev_info(dev, "Chelsio %s rev %d %s %sNIC PCIe x%d%s%s\n",
4817− adap->params.vpd.id, adap->params.rev, buf,
5484+ adap->params.vpd.id,
5485+ CHELSIO_CHIP_RELEASE(adap->params.rev), buf,
48185486 is_offload(adap) ? "R" : "", adap->params.pci.width, spd,
48195487 (adap->flags & USING_MSIX) ? " MSI-X" :
48205488 (adap->flags & USING_MSI) ? " MSI" : "");
@@ -4854,10 +5522,11 @@ static void free_some_resources(struct adapter *adapter) · 33 unmodified lines
48545522 #define TSO_FLAGS (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)
48555523 #define VLAN_FEAT (NETIF_F_SG | NETIF_F_IP_CSUM | TSO_FLAGS | \
48565524 NETIF_F_IPV6_CSUM | NETIF_F_HIGHDMA)
5525+#define SEGMENT_SIZE 128
48575526
48585527 static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
48595528 {
4860− int func, i, err;
5529+ int func, i, err, s_qpp, qpp, num_seg;
48615530 struct port_info *pi;
48625531 bool highdma = false;
48635532 struct adapter *adapter = NULL;
@@ -4934,7 +5603,34 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 70 unmodified lines
49345603
49355604 err = t4_prep_adapter(adapter);
49365605 if (err)
4937− goto out_unmap_bar;
5606+ goto out_unmap_bar0;
5607+
5608+ if (!is_t4(adapter->chip)) {
5609+ s_qpp = QUEUESPERPAGEPF1 * adapter->fn;
5610+ qpp = 1 << QUEUESPERPAGEPF0_GET(t4_read_reg(adapter,
5611+ SGE_EGRESS_QUEUES_PER_PAGE_PF) >> s_qpp);
5612+ num_seg = PAGE_SIZE / SEGMENT_SIZE;
5613+
5614+ /* Each segment size is 128B. Write coalescing is enabled only
5615+ * when SGE_EGRESS_QUEUES_PER_PAGE_PF reg value for the
5616+ * queue is less no of segments that can be accommodated in
5617+ * a page size.
5618+ */
5619+ if (qpp > num_seg) {
5620+ dev_err(&pdev->dev,
5621+ "Incorrect number of egress queues per page\n");
5622+ err = -EINVAL;
5623+ goto out_unmap_bar0;
5624+ }
5625+ adapter->bar2 = ioremap_wc(pci_resource_start(pdev, 2),
5626+ pci_resource_len(pdev, 2));
5627+ if (!adapter->bar2) {
5628+ dev_err(&pdev->dev, "cannot map device bar2 region\n");
5629+ err = -ENOMEM;
5630+ goto out_unmap_bar0;
5631+ }
5632+ }
5633+
49385634 setup_memwin(adapter);
49395635 err = adap_init0(adapter);
49405636 setup_memwin_rdma(adapter);
@@ -4963,7 +5659,7 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 22 unmodified lines
49635659 netdev->hw_features = NETIF_F_SG | TSO_FLAGS |
49645660 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
49655661 NETIF_F_RXCSUM | NETIF_F_RXHASH |
4966− NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
5662+ NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
49675663 if (highdma)
49685664 netdev->hw_features |= NETIF_F_HIGHDMA;
49695665 netdev->features |= netdev->hw_features;
@@ -5063,6 +5759,9 @@ sriov: · 93 unmodified lines
50635759 out_free_dev:
50645760 free_some_resources(adapter);
50655761 out_unmap_bar:
5762+ if (!is_t4(adapter->chip))
5763+ iounmap(adapter->bar2);
5764+ out_unmap_bar0:
50665765 iounmap(adapter->regs);
50675766 out_free_adapter:
50685767 kfree(adapter);
@@ -5113,6 +5812,8 @@ static void remove_one(struct pci_dev *pdev) · 44 unmodified lines
51135812
51145813 free_some_resources(adapter);
51155814 iounmap(adapter->regs);
5815+ if (!is_t4(adapter->chip))
5816+ iounmap(adapter->bar2);
51165817 kfree(adapter);
51175818 pci_disable_pcie_error_reporting(pdev);
51185819 pci_disable_device(pdev);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h+3−0
@@ -269,4 +269,7 @@ struct sk_buff *cxgb4_pktgl_to_skb(const struct pkt_gl *gl, · 268 unmodified lines
269269 unsigned int skb_len, unsigned int pull_len);
270270 int cxgb4_sync_txq_pidx(struct net_device *dev, u16 qid, u16 pidx, u16 size);
271271 int cxgb4_flush_eq_cache(struct net_device *dev);
272+void cxgb4_disable_db_coalescing(struct net_device *dev);
273+void cxgb4_enable_db_coalescing(struct net_device *dev);
274+
272275 #endif /* !__CXGB4_OFLD_H */
drivers/net/ethernet/chelsio/cxgb4/sge.c+78−15
@@ -506,10 +506,14 @@ static void unmap_rx_buf(struct adapter *adap, struct sge_fl *q) · 505 unmodified lines
506506
507507 static inline void ring_fl_db(struct adapter *adap, struct sge_fl *q)
508508 {
509+ u32 val;
509510 if (q->pend_cred >= 8) {
511+ val = PIDX(q->pend_cred / 8);
512+ if (!is_t4(adap->chip))
513+ val |= DBTYPE(1);
510514 wmb();
511515 t4_write_reg(adap, MYPF_REG(SGE_PF_KDOORBELL), DBPRIO(1) |
512− QID(q->cntxt_id) | PIDX(q->pend_cred / 8));
516+ QID(q->cntxt_id) | val);
513517 q->pend_cred &= 7;
514518 }
515519 }
@@ -812,6 +816,22 @@ static void write_sgl(const struct sk_buff *skb, struct sge_txq *q, · 296 unmodified lines
812816 *end = 0;
813817 }
814818
819+/* This function copies 64 byte coalesced work request to
820+ * memory mapped BAR2 space(user space writes).
821+ * For coalesced WR SGE, fetches data from the FIFO instead of from Host.
822+ */
823+static void cxgb_pio_copy(u64 __iomem *dst, u64 *src)
824+{
825+ int count = 8;
826+
827+ while (count) {
828+ writeq(*src, dst);
829+ src++;
830+ dst++;
831+ count--;
832+ }
833+}
834+
815835 /**
816836 * ring_tx_db - check and potentially ring a Tx queue's doorbell
817837 * @adap: the adapter
@@ -822,11 +842,25 @@ static void write_sgl(const struct sk_buff *skb, struct sge_txq *q, · 4 unmodified lines
822842 */
823843 static inline void ring_tx_db(struct adapter *adap, struct sge_txq *q, int n)
824844 {
845+ unsigned int *wr, index;
846+
825847 wmb(); /* write descriptors before telling HW */
826848 spin_lock(&q->db_lock);
827849 if (!q->db_disabled) {
828− t4_write_reg(adap, MYPF_REG(SGE_PF_KDOORBELL),
829− QID(q->cntxt_id) | PIDX(n));
850+ if (is_t4(adap->chip)) {
851+ t4_write_reg(adap, MYPF_REG(SGE_PF_KDOORBELL),
852+ QID(q->cntxt_id) | PIDX(n));
853+ } else {
854+ if (n == 1) {
855+ index = q->pidx ? (q->pidx - 1) : (q->size - 1);
856+ wr = (unsigned int *)&q->desc[index];
857+ cxgb_pio_copy((u64 __iomem *)
858+ (adap->bar2 + q->udb + 64),
859+ (u64 *)wr);
860+ } else
861+ writel(n, adap->bar2 + q->udb + 8);
862+ wmb();
863+ }
830864 }
831865 q->db_pidx = q->pidx;
832866 spin_unlock(&q->db_lock);
@@ -1555,7 +1589,6 @@ static noinline int handle_trace_pkt(struct adapter *adap, · 722 unmodified lines
15551589 const struct pkt_gl *gl)
15561590 {
15571591 struct sk_buff *skb;
1558− struct cpl_trace_pkt *p;
15591592
15601593 skb = cxgb4_pktgl_to_skb(gl, RX_PULL_LEN, RX_PULL_LEN);
15611594 if (unlikely(!skb)) {
@@ -1563,8 +1596,11 @@ static noinline int handle_trace_pkt(struct adapter *adap, · 1 unmodified line
15631596 return 0;
15641597 }
15651598
1566− p = (struct cpl_trace_pkt *)skb->data;
1567− __skb_pull(skb, sizeof(*p));
1599+ if (is_t4(adap->chip))
1600+ __skb_pull(skb, sizeof(struct cpl_trace_pkt));
1601+ else
1602+ __skb_pull(skb, sizeof(struct cpl_t5_trace_pkt));
1603+
15681604 skb_reset_mac_header(skb);
15691605 skb->protocol = htons(0xffff);
15701606 skb->dev = adap->port[0];
@@ -1597,7 +1633,7 @@ static void do_gro(struct sge_eth_rxq *rxq, const struct pkt_gl *gl, · 26 unmodified lines
15971633 skb->rxhash = (__force u32)pkt->rsshdr.hash_val;
15981634
15991635 if (unlikely(pkt->vlan_ex)) {
1600− __vlan_hwaccel_put_tag(skb, ntohs(pkt->vlan));
1636+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(pkt->vlan));
16011637 rxq->stats.vlan_ex++;
16021638 }
16031639 ret = napi_gro_frags(&rxq->rspq.napi);
@@ -1625,8 +1661,10 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp, · 21 unmodified lines
16251661 const struct cpl_rx_pkt *pkt;
16261662 struct sge_eth_rxq *rxq = container_of(q, struct sge_eth_rxq, rspq);
16271663 struct sge *s = &q->adap->sge;
1664+ int cpl_trace_pkt = is_t4(q->adap->chip) ?
1665+ CPL_TRACE_PKT : CPL_TRACE_PKT_T5;
16281666
1629− if (unlikely(*(u8 *)rsp == CPL_TRACE_PKT))
1667+ if (unlikely(*(u8 *)rsp == cpl_trace_pkt))
16301668 return handle_trace_pkt(q->adap, si);
16311669
16321670 pkt = (const struct cpl_rx_pkt *)rsp;
@@ -1667,7 +1705,7 @@ int t4_ethrx_handler(struct sge_rspq *q, const __be64 *rsp, · 34 unmodified lines
16671705 skb_checksum_none_assert(skb);
16681706
16691707 if (unlikely(pkt->vlan_ex)) {
1670− __vlan_hwaccel_put_tag(skb, ntohs(pkt->vlan));
1708+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), ntohs(pkt->vlan));
16711709 rxq->stats.vlan_ex++;
16721710 }
16731711 netif_receive_skb(skb);
@@ -2143,11 +2181,27 @@ err: · 469 unmodified lines
21432181
21442182 static void init_txq(struct adapter *adap, struct sge_txq *q, unsigned int id)
21452183 {
2184+ q->cntxt_id = id;
2185+ if (!is_t4(adap->chip)) {
2186+ unsigned int s_qpp;
2187+ unsigned short udb_density;
2188+ unsigned long qpshift;
2189+ int page;
2190+
2191+ s_qpp = QUEUESPERPAGEPF1 * adap->fn;
2192+ udb_density = 1 << QUEUESPERPAGEPF0_GET((t4_read_reg(adap,
2193+ SGE_EGRESS_QUEUES_PER_PAGE_PF) >> s_qpp));
2194+ qpshift = PAGE_SHIFT - ilog2(udb_density);
2195+ q->udb = q->cntxt_id << qpshift;
2196+ q->udb &= PAGE_MASK;
2197+ page = q->udb / PAGE_SIZE;
2198+ q->udb += (q->cntxt_id - (page * udb_density)) * 128;
2199+ }
2200+
21462201 q->in_use = 0;
21472202 q->cidx = q->pidx = 0;
21482203 q->stops = q->restarts = 0;
21492204 q->stat = (void *)&q->desc[q->size];
2150− q->cntxt_id = id;
21512205 spin_lock_init(&q->db_lock);
21522206 adap->sge.egr_map[id - adap->sge.egr_start] = q;
21532207 }
@@ -2587,11 +2641,20 @@ static int t4_sge_init_hard(struct adapter *adap) · 433 unmodified lines
25872641 * Set up to drop DOORBELL writes when the DOORBELL FIFO overflows
25882642 * and generate an interrupt when this occurs so we can recover.
25892643 */
2590− t4_set_reg_field(adap, A_SGE_DBFIFO_STATUS,
2591− V_HP_INT_THRESH(M_HP_INT_THRESH) |
2592− V_LP_INT_THRESH(M_LP_INT_THRESH),
2593− V_HP_INT_THRESH(dbfifo_int_thresh) |
2594− V_LP_INT_THRESH(dbfifo_int_thresh));
2644+ if (is_t4(adap->chip)) {
2645+ t4_set_reg_field(adap, A_SGE_DBFIFO_STATUS,
2646+ V_HP_INT_THRESH(M_HP_INT_THRESH) |
2647+ V_LP_INT_THRESH(M_LP_INT_THRESH),
2648+ V_HP_INT_THRESH(dbfifo_int_thresh) |
2649+ V_LP_INT_THRESH(dbfifo_int_thresh));
2650+ } else {
2651+ t4_set_reg_field(adap, A_SGE_DBFIFO_STATUS,
2652+ V_LP_INT_THRESH_T5(M_LP_INT_THRESH_T5),
2653+ V_LP_INT_THRESH_T5(dbfifo_int_thresh));
2654+ t4_set_reg_field(adap, SGE_DBFIFO_STATUS2,
2655+ V_HP_INT_THRESH_T5(M_HP_INT_THRESH_T5),
2656+ V_HP_INT_THRESH_T5(dbfifo_int_thresh));
2657+ }
25952658 t4_set_reg_field(adap, A_SGE_DOORBELL_CONTROL, F_ENABLE_DROP,
25962659 F_ENABLE_DROP);
25972660
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c+210−46
@@ -282,6 +282,7 @@ int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size, · 281 unmodified lines
282282 * t4_mc_read - read from MC through backdoor accesses
283283 * @adap: the adapter
284284 * @addr: address of first byte requested
285+ * @idx: which MC to access
285286 * @data: 64 bytes of data containing the requested address
286287 * @ecc: where to store the corresponding 64-bit ECC word
287288 *
@@ -289,22 +290,38 @@ int t4_wr_mbox_meat(struct adapter *adap, int mbox, const void *cmd, int size, · 1 unmodified line
289290 * that covers the requested address @addr. If @parity is not %NULL it
290291 * is assigned the 64-bit ECC word for the read data.
291292 */
292−int t4_mc_read(struct adapter *adap, u32 addr, __be32 *data, u64 *ecc)
293+int t4_mc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc)
293294 {
294295 int i;
296+ u32 mc_bist_cmd, mc_bist_cmd_addr, mc_bist_cmd_len;
297+ u32 mc_bist_status_rdata, mc_bist_data_pattern;
298+
299+ if (is_t4(adap->chip)) {
300+ mc_bist_cmd = MC_BIST_CMD;
301+ mc_bist_cmd_addr = MC_BIST_CMD_ADDR;
302+ mc_bist_cmd_len = MC_BIST_CMD_LEN;
303+ mc_bist_status_rdata = MC_BIST_STATUS_RDATA;
304+ mc_bist_data_pattern = MC_BIST_DATA_PATTERN;
305+ } else {
306+ mc_bist_cmd = MC_REG(MC_P_BIST_CMD, idx);
307+ mc_bist_cmd_addr = MC_REG(MC_P_BIST_CMD_ADDR, idx);
308+ mc_bist_cmd_len = MC_REG(MC_P_BIST_CMD_LEN, idx);
309+ mc_bist_status_rdata = MC_REG(MC_P_BIST_STATUS_RDATA, idx);
310+ mc_bist_data_pattern = MC_REG(MC_P_BIST_DATA_PATTERN, idx);
311+ }
295312
296− if (t4_read_reg(adap, MC_BIST_CMD) & START_BIST)
313+ if (t4_read_reg(adap, mc_bist_cmd) & START_BIST)
297314 return -EBUSY;
298− t4_write_reg(adap, MC_BIST_CMD_ADDR, addr & ~0x3fU);
299− t4_write_reg(adap, MC_BIST_CMD_LEN, 64);
300− t4_write_reg(adap, MC_BIST_DATA_PATTERN, 0xc);
301− t4_write_reg(adap, MC_BIST_CMD, BIST_OPCODE(1) | START_BIST |
315+ t4_write_reg(adap, mc_bist_cmd_addr, addr & ~0x3fU);
316+ t4_write_reg(adap, mc_bist_cmd_len, 64);
317+ t4_write_reg(adap, mc_bist_data_pattern, 0xc);
318+ t4_write_reg(adap, mc_bist_cmd, BIST_OPCODE(1) | START_BIST |
302319 BIST_CMD_GAP(1));
303− i = t4_wait_op_done(adap, MC_BIST_CMD, START_BIST, 0, 10, 1);
320+ i = t4_wait_op_done(adap, mc_bist_cmd, START_BIST, 0, 10, 1);
304321 if (i)
305322 return i;
306323
307−#define MC_DATA(i) MC_BIST_STATUS_REG(MC_BIST_STATUS_RDATA, i)
324+#define MC_DATA(i) MC_BIST_STATUS_REG(mc_bist_status_rdata, i)
308325
309326 for (i = 15; i >= 0; i--)
310327 *data++ = htonl(t4_read_reg(adap, MC_DATA(i)));
@@ -329,20 +346,39 @@ int t4_mc_read(struct adapter *adap, u32 addr, __be32 *data, u64 *ecc) · 18 unmodified lines
329346 int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc)
330347 {
331348 int i;
349+ u32 edc_bist_cmd, edc_bist_cmd_addr, edc_bist_cmd_len;
350+ u32 edc_bist_cmd_data_pattern, edc_bist_status_rdata;
351+
352+ if (is_t4(adap->chip)) {
353+ edc_bist_cmd = EDC_REG(EDC_BIST_CMD, idx);
354+ edc_bist_cmd_addr = EDC_REG(EDC_BIST_CMD_ADDR, idx);
355+ edc_bist_cmd_len = EDC_REG(EDC_BIST_CMD_LEN, idx);
356+ edc_bist_cmd_data_pattern = EDC_REG(EDC_BIST_DATA_PATTERN,
357+ idx);
358+ edc_bist_status_rdata = EDC_REG(EDC_BIST_STATUS_RDATA,
359+ idx);
360+ } else {
361+ edc_bist_cmd = EDC_REG_T5(EDC_H_BIST_CMD, idx);
362+ edc_bist_cmd_addr = EDC_REG_T5(EDC_H_BIST_CMD_ADDR, idx);
363+ edc_bist_cmd_len = EDC_REG_T5(EDC_H_BIST_CMD_LEN, idx);
364+ edc_bist_cmd_data_pattern =
365+ EDC_REG_T5(EDC_H_BIST_DATA_PATTERN, idx);
366+ edc_bist_status_rdata =
367+ EDC_REG_T5(EDC_H_BIST_STATUS_RDATA, idx);
368+ }
332369
333− idx *= EDC_STRIDE;
334− if (t4_read_reg(adap, EDC_BIST_CMD + idx) & START_BIST)
370+ if (t4_read_reg(adap, edc_bist_cmd) & START_BIST)
335371 return -EBUSY;
336− t4_write_reg(adap, EDC_BIST_CMD_ADDR + idx, addr & ~0x3fU);
337− t4_write_reg(adap, EDC_BIST_CMD_LEN + idx, 64);
338− t4_write_reg(adap, EDC_BIST_DATA_PATTERN + idx, 0xc);
339− t4_write_reg(adap, EDC_BIST_CMD + idx,
372+ t4_write_reg(adap, edc_bist_cmd_addr, addr & ~0x3fU);
373+ t4_write_reg(adap, edc_bist_cmd_len, 64);
374+ t4_write_reg(adap, edc_bist_cmd_data_pattern, 0xc);
375+ t4_write_reg(adap, edc_bist_cmd,
340376 BIST_OPCODE(1) | BIST_CMD_GAP(1) | START_BIST);
341− i = t4_wait_op_done(adap, EDC_BIST_CMD + idx, START_BIST, 0, 10, 1);
377+ i = t4_wait_op_done(adap, edc_bist_cmd, START_BIST, 0, 10, 1);
342378 if (i)
343379 return i;
344380
345−#define EDC_DATA(i) (EDC_BIST_STATUS_REG(EDC_BIST_STATUS_RDATA, i) + idx)
381+#define EDC_DATA(i) (EDC_BIST_STATUS_REG(edc_bist_status_rdata, i))
346382
347383 for (i = 15; i >= 0; i--)
348384 *data++ = htonl(t4_read_reg(adap, EDC_DATA(i)));
@@ -366,6 +402,7 @@ int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc) · 17 unmodified lines
366402 static int t4_mem_win_rw(struct adapter *adap, u32 addr, __be32 *data, int dir)
367403 {
368404 int i;
405+ u32 win_pf = is_t4(adap->chip) ? 0 : V_PFNUM(adap->fn);
369406
370407 /*
371408 * Setup offset into PCIE memory window. Address must be a
@@ -374,7 +411,7 @@ static int t4_mem_win_rw(struct adapter *adap, u32 addr, __be32 *data, int dir) · 2 unmodified lines
374411 * values.)
375412 */
376413 t4_write_reg(adap, PCIE_MEM_ACCESS_OFFSET,
377− addr & ~(MEMWIN0_APERTURE - 1));
414+ (addr & ~(MEMWIN0_APERTURE - 1)) | win_pf);
378415 t4_read_reg(adap, PCIE_MEM_ACCESS_OFFSET);
379416
380417 /* Collecting data 4 bytes at a time upto MEMWIN0_APERTURE */
@@ -410,6 +447,7 @@ static int t4_memory_rw(struct adapter *adap, int mtype, u32 addr, u32 len, · 29 unmodified lines
410447 __be32 *buf, int dir)
411448 {
412449 u32 pos, start, end, offset, memoffset;
450+ u32 edc_size, mc_size;
413451 int ret = 0;
414452 __be32 *data;
415453
@@ -423,13 +461,21 @@ static int t4_memory_rw(struct adapter *adap, int mtype, u32 addr, u32 len, · 7 unmodified lines
423461 if (!data)
424462 return -ENOMEM;
425463
426− /*
427− * Offset into the region of memory which is being accessed
464+ /* Offset into the region of memory which is being accessed
428465 * MEM_EDC0 = 0
429466 * MEM_EDC1 = 1
430− * MEM_MC = 2
467+ * MEM_MC = 2 -- T4
468+ * MEM_MC0 = 2 -- For T5
469+ * MEM_MC1 = 3 -- For T5
431470 */
432− memoffset = (mtype * (5 * 1024 * 1024));
471+ edc_size = EDRAM_SIZE_GET(t4_read_reg(adap, MA_EDRAM0_BAR));
472+ if (mtype != MEM_MC1)
473+ memoffset = (mtype * (edc_size * 1024 * 1024));
474+ else {
475+ mc_size = EXT_MEM_SIZE_GET(t4_read_reg(adap,
476+ MA_EXT_MEMORY_BAR));
477+ memoffset = (MEM_MC0 * edc_size + mc_size) * 1024 * 1024;
478+ }
433479
434480 /* Determine the PCIE_MEM_ACCESS_OFFSET */
435481 addr = addr + memoffset;
@@ -497,9 +543,9 @@ int t4_memory_write(struct adapter *adap, int mtype, u32 addr, u32 len, · 61 unmodified lines
497543 }
498544
499545 #define EEPROM_STAT_ADDR 0x7bfc
500−#define VPD_LEN 512
501546 #define VPD_BASE 0x400
502547 #define VPD_BASE_OLD 0
548+#define VPD_LEN 1024
503549
504550 /**
505551 * t4_seeprom_wp - enable/disable EEPROM write protection
@@ -856,6 +902,7 @@ int t4_check_fw_version(struct adapter *adapter) · 350 unmodified lines
856902 {
857903 u32 api_vers[2];
858904 int ret, major, minor, micro;
905+ int exp_major, exp_minor, exp_micro;
859906
860907 ret = get_fw_version(adapter, &adapter->params.fw_vers);
861908 if (!ret)
@@ -870,17 +917,35 @@ int t4_check_fw_version(struct adapter *adapter) · 8 unmodified lines
870917 major = FW_HDR_FW_VER_MAJOR_GET(adapter->params.fw_vers);
871918 minor = FW_HDR_FW_VER_MINOR_GET(adapter->params.fw_vers);
872919 micro = FW_HDR_FW_VER_MICRO_GET(adapter->params.fw_vers);
920+
921+ switch (CHELSIO_CHIP_VERSION(adapter->chip)) {
922+ case CHELSIO_T4:
923+ exp_major = FW_VERSION_MAJOR;
924+ exp_minor = FW_VERSION_MINOR;
925+ exp_micro = FW_VERSION_MICRO;
926+ break;
927+ case CHELSIO_T5:
928+ exp_major = FW_VERSION_MAJOR_T5;
929+ exp_minor = FW_VERSION_MINOR_T5;
930+ exp_micro = FW_VERSION_MICRO_T5;
931+ break;
932+ default:
933+ dev_err(adapter->pdev_dev, "Unsupported chip type, %x\n",
934+ adapter->chip);
935+ return -EINVAL;
936+ }
937+
873938 memcpy(adapter->params.api_vers, api_vers,
874939 sizeof(adapter->params.api_vers));
875940
876− if (major != FW_VERSION_MAJOR) { /* major mismatch - fail */
941+ if (major != exp_major) { /* major mismatch - fail */
877942 dev_err(adapter->pdev_dev,
878943 "card FW has major version %u, driver wants %u\n",
879− major, FW_VERSION_MAJOR);
944+ major, exp_major);
880945 return -EINVAL;
881946 }
882947
883− if (minor == FW_VERSION_MINOR && micro == FW_VERSION_MICRO)
948+ if (minor == exp_minor && micro == exp_micro)
884949 return 0; /* perfect match */
885950
886951 /* Minor/micro version mismatch. Report it but often it's OK. */
@@ -1246,6 +1311,45 @@ static void pcie_intr_handler(struct adapter *adapter) · 359 unmodified lines
12461311 { 0 }
12471312 };
12481313
1314+ static struct intr_info t5_pcie_intr_info[] = {
1315+ { MSTGRPPERR, "Master Response Read Queue parity error",
1316+ -1, 1 },
1317+ { MSTTIMEOUTPERR, "Master Timeout FIFO parity error", -1, 1 },
1318+ { MSIXSTIPERR, "MSI-X STI SRAM parity error", -1, 1 },
1319+ { MSIXADDRLPERR, "MSI-X AddrL parity error", -1, 1 },
1320+ { MSIXADDRHPERR, "MSI-X AddrH parity error", -1, 1 },
1321+ { MSIXDATAPERR, "MSI-X data parity error", -1, 1 },
1322+ { MSIXDIPERR, "MSI-X DI parity error", -1, 1 },
1323+ { PIOCPLGRPPERR, "PCI PIO completion Group FIFO parity error",
1324+ -1, 1 },
1325+ { PIOREQGRPPERR, "PCI PIO request Group FIFO parity error",
1326+ -1, 1 },
1327+ { TARTAGPERR, "PCI PCI target tag FIFO parity error", -1, 1 },
1328+ { MSTTAGQPERR, "PCI master tag queue parity error", -1, 1 },
1329+ { CREQPERR, "PCI CMD channel request parity error", -1, 1 },
1330+ { CRSPPERR, "PCI CMD channel response parity error", -1, 1 },
1331+ { DREQWRPERR, "PCI DMA channel write request parity error",
1332+ -1, 1 },
1333+ { DREQPERR, "PCI DMA channel request parity error", -1, 1 },
1334+ { DRSPPERR, "PCI DMA channel response parity error", -1, 1 },
1335+ { HREQWRPERR, "PCI HMA channel count parity error", -1, 1 },
1336+ { HREQPERR, "PCI HMA channel request parity error", -1, 1 },
1337+ { HRSPPERR, "PCI HMA channel response parity error", -1, 1 },
1338+ { CFGSNPPERR, "PCI config snoop FIFO parity error", -1, 1 },
1339+ { FIDPERR, "PCI FID parity error", -1, 1 },
1340+ { VFIDPERR, "PCI INTx clear parity error", -1, 1 },
1341+ { MAGRPPERR, "PCI MA group FIFO parity error", -1, 1 },
1342+ { PIOTAGPERR, "PCI PIO tag parity error", -1, 1 },
1343+ { IPRXHDRGRPPERR, "PCI IP Rx header group parity error",
1344+ -1, 1 },
1345+ { IPRXDATAGRPPERR, "PCI IP Rx data group parity error", -1, 1 },
1346+ { RPLPERR, "PCI IP replay buffer parity error", -1, 1 },
1347+ { IPSOTPERR, "PCI IP SOT buffer parity error", -1, 1 },
1348+ { TRGT1GRPPERR, "PCI TRGT1 group FIFOs parity error", -1, 1 },
1349+ { READRSPERR, "Outbound read error", -1, 0 },
1350+ { 0 }
1351+ };
1352+
12491353 int fat;
12501354
12511355 fat = t4_handle_intr_status(adapter,
@@ -1254,7 +1358,10 @@ static void pcie_intr_handler(struct adapter *adapter) · 2 unmodified lines
12541358 t4_handle_intr_status(adapter,
12551359 PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS,
12561360 pcie_port_intr_info) +
1257− t4_handle_intr_status(adapter, PCIE_INT_CAUSE, pcie_intr_info);
1361+ t4_handle_intr_status(adapter, PCIE_INT_CAUSE,
1362+ is_t4(adapter->chip) ?
1363+ pcie_intr_info : t5_pcie_intr_info);
1364+
12581365 if (fat)
12591366 t4_fatal_err(adapter);
12601367 }
@@ -1664,7 +1771,14 @@ static void ncsi_intr_handler(struct adapter *adap) · 403 unmodified lines
16641771 */
16651772 static void xgmac_intr_handler(struct adapter *adap, int port)
16661773 {
1667− u32 v = t4_read_reg(adap, PORT_REG(port, XGMAC_PORT_INT_CAUSE));
1774+ u32 v, int_cause_reg;
1775+
1776+ if (is_t4(adap->chip))
1777+ int_cause_reg = PORT_REG(port, XGMAC_PORT_INT_CAUSE);
1778+ else
1779+ int_cause_reg = T5_PORT_REG(port, MAC_PORT_INT_CAUSE);
1780+
1781+ v = t4_read_reg(adap, int_cause_reg);
16681782
16691783 v &= TXFIFO_PRTY_ERR | RXFIFO_PRTY_ERR;
16701784 if (!v)
@@ -2126,7 +2240,9 @@ void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) · 455 unmodified lines
21262240 u32 bgmap = get_mps_bg_map(adap, idx);
21272241
21282242 #define GET_STAT(name) \
2129− t4_read_reg64(adap, PORT_REG(idx, MPS_PORT_STAT_##name##_L))
2243+ t4_read_reg64(adap, \
2244+ (is_t4(adap->chip) ? PORT_REG(idx, MPS_PORT_STAT_##name##_L) : \
2245+ T5_PORT_REG(idx, MPS_PORT_STAT_##name##_L)))
21302246 #define GET_STAT_COM(name) t4_read_reg64(adap, MPS_STAT_##name##_L)
21312247
21322248 p->tx_octets = GET_STAT(TX_PORT_BYTES);
@@ -2205,14 +2321,26 @@ void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) · 72 unmodified lines
22052321 void t4_wol_magic_enable(struct adapter *adap, unsigned int port,
22062322 const u8 *addr)
22072323 {
2324+ u32 mag_id_reg_l, mag_id_reg_h, port_cfg_reg;
2325+
2326+ if (is_t4(adap->chip)) {
2327+ mag_id_reg_l = PORT_REG(port, XGMAC_PORT_MAGIC_MACID_LO);
2328+ mag_id_reg_h = PORT_REG(port, XGMAC_PORT_MAGIC_MACID_HI);
2329+ port_cfg_reg = PORT_REG(port, XGMAC_PORT_CFG2);
2330+ } else {
2331+ mag_id_reg_l = T5_PORT_REG(port, MAC_PORT_MAGIC_MACID_LO);
2332+ mag_id_reg_h = T5_PORT_REG(port, MAC_PORT_MAGIC_MACID_HI);
2333+ port_cfg_reg = T5_PORT_REG(port, MAC_PORT_CFG2);
2334+ }
2335+
22082336 if (addr) {
2209− t4_write_reg(adap, PORT_REG(port, XGMAC_PORT_MAGIC_MACID_LO),
2337+ t4_write_reg(adap, mag_id_reg_l,
22102338 (addr[2] << 24) | (addr[3] << 16) |
22112339 (addr[4] << 8) | addr[5]);
2212− t4_write_reg(adap, PORT_REG(port, XGMAC_PORT_MAGIC_MACID_HI),
2340+ t4_write_reg(adap, mag_id_reg_h,
22132341 (addr[0] << 8) | addr[1]);
22142342 }
2215− t4_set_reg_field(adap, PORT_REG(port, XGMAC_PORT_CFG2), MAGICEN,
2343+ t4_set_reg_field(adap, port_cfg_reg, MAGICEN,
22162344 addr ? MAGICEN : 0);
22172345 }
22182346
@@ -2235,16 +2363,23 @@ int t4_wol_pat_enable(struct adapter *adap, unsigned int port, unsigned int map, · 16 unmodified lines
22352363 u64 mask0, u64 mask1, unsigned int crc, bool enable)
22362364 {
22372365 int i;
2366+ u32 port_cfg_reg;
2367+
2368+ if (is_t4(adap->chip))
2369+ port_cfg_reg = PORT_REG(port, XGMAC_PORT_CFG2);
2370+ else
2371+ port_cfg_reg = T5_PORT_REG(port, MAC_PORT_CFG2);
22382372
22392373 if (!enable) {
2240− t4_set_reg_field(adap, PORT_REG(port, XGMAC_PORT_CFG2),
2241− PATEN, 0);
2374+ t4_set_reg_field(adap, port_cfg_reg, PATEN, 0);
22422375 return 0;
22432376 }
22442377 if (map > 0xff)
22452378 return -EINVAL;
22462379
2247−#define EPIO_REG(name) PORT_REG(port, XGMAC_PORT_EPIO_##name)
2380+#define EPIO_REG(name) \
2381+ (is_t4(adap->chip) ? PORT_REG(port, XGMAC_PORT_EPIO_##name) : \
2382+ T5_PORT_REG(port, MAC_PORT_EPIO_##name))
22482383
22492384 t4_write_reg(adap, EPIO_REG(DATA1), mask0 >> 32);
22502385 t4_write_reg(adap, EPIO_REG(DATA2), mask1);
@@ -2322,24 +2457,24 @@ int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, · 71 unmodified lines
23222457 * @addr: address of first byte requested aligned on 32b.
23232458 * @data: len bytes to hold the data read
23242459 * @len: amount of data to read from window. Must be <=
2325− * MEMWIN0_APERATURE after adjusting for 16B alignment
2326− * requirements of the the memory window.
2460+ * MEMWIN0_APERATURE after adjusting for 16B for T4 and
2461+ * 128B for T5 alignment requirements of the the memory window.
23272462 *
23282463 * Read len bytes of data from MC starting at @addr.
23292464 */
23302465 int t4_mem_win_read_len(struct adapter *adap, u32 addr, __be32 *data, int len)
23312466 {
2332− int i;
2333− int off;
2467+ int i, off;
2468+ u32 win_pf = is_t4(adap->chip) ? 0 : V_PFNUM(adap->fn);
23342469
2335− /*
2336− * Align on a 16B boundary.
2470+ /* Align on a 2KB boundary.
23372471 */
2338− off = addr & 15;
2472+ off = addr & MEMWIN0_APERTURE;
23392473 if ((addr & 3) || (len + off) > MEMWIN0_APERTURE)
23402474 return -EINVAL;
23412475
2342− t4_write_reg(adap, PCIE_MEM_ACCESS_OFFSET, addr & ~15);
2476+ t4_write_reg(adap, PCIE_MEM_ACCESS_OFFSET,
2477+ (addr & ~MEMWIN0_APERTURE) | win_pf);
23432478 t4_read_reg(adap, PCIE_MEM_ACCESS_OFFSET);
23442479
23452480 for (i = 0; i < len; i += 4)
@@ -3162,6 +3297,9 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, · 816 unmodified lines
31623297 int i, ret;
31633298 struct fw_vi_mac_cmd c;
31643299 struct fw_vi_mac_exact *p;
3300+ unsigned int max_naddr = is_t4(adap->chip) ?
3301+ NUM_MPS_CLS_SRAM_L_INSTANCES :
3302+ NUM_MPS_T5_CLS_SRAM_L_INSTANCES;
31653303
31663304 if (naddr > 7)
31673305 return -EINVAL;
@@ -3187,8 +3325,8 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, · 19 unmodified lines
31873325 u16 index = FW_VI_MAC_CMD_IDX_GET(ntohs(p->valid_to_idx));
31883326
31893327 if (idx)
3190− idx[i] = index >= NEXACT_MAC ? 0xffff : index;
3191− if (index < NEXACT_MAC)
3328+ idx[i] = index >= max_naddr ? 0xffff : index;
3329+ if (index < max_naddr)
31923330 ret++;
31933331 else if (hash)
31943332 *hash |= (1ULL << hash_mac_addr(addr[i]));
@@ -3221,6 +3359,9 @@ int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, · 26 unmodified lines
32213359 int ret, mode;
32223360 struct fw_vi_mac_cmd c;
32233361 struct fw_vi_mac_exact *p = c.u.exact;
3362+ unsigned int max_mac_addr = is_t4(adap->chip) ?
3363+ NUM_MPS_CLS_SRAM_L_INSTANCES :
3364+ NUM_MPS_T5_CLS_SRAM_L_INSTANCES;
32243365
32253366 if (idx < 0) /* new allocation */
32263367 idx = persist ? FW_VI_MAC_ADD_PERSIST_MAC : FW_VI_MAC_ADD_MAC;
@@ -3238,7 +3379,7 @@ int t4_change_mac(struct adapter *adap, unsigned int mbox, unsigned int viid, · 11 unmodified lines
32383379 ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c);
32393380 if (ret == 0) {
32403381 ret = FW_VI_MAC_CMD_IDX_GET(ntohs(p->valid_to_idx));
3241− if (ret >= NEXACT_MAC)
3382+ if (ret >= max_mac_addr)
32423383 ret = -ENOMEM;
32433384 }
32443385 return ret;
@@ -3547,7 +3688,8 @@ static int get_flash_params(struct adapter *adap) · 302 unmodified lines
35473688 */
35483689 int t4_prep_adapter(struct adapter *adapter)
35493690 {
3550− int ret;
3691+ int ret, ver;
3692+ uint16_t device_id;
35513693
35523694 ret = t4_wait_dev_ready(adapter);
35533695 if (ret < 0)
@@ -3562,6 +3704,28 @@ int t4_prep_adapter(struct adapter *adapter) · 8 unmodified lines
35623704 return ret;
35633705 }
35643706
3707+ /* Retrieve adapter's device ID
3708+ */
3709+ pci_read_config_word(adapter->pdev, PCI_DEVICE_ID, &device_id);
3710+ ver = device_id >> 12;
3711+ switch (ver) {
3712+ case CHELSIO_T4:
3713+ adapter->chip = CHELSIO_CHIP_CODE(CHELSIO_T4,
3714+ adapter->params.rev);
3715+ break;
3716+ case CHELSIO_T5:
3717+ adapter->chip = CHELSIO_CHIP_CODE(CHELSIO_T5,
3718+ adapter->params.rev);
3719+ break;
3720+ default:
3721+ dev_err(adapter->pdev_dev, "Device %d is not supported\n",
3722+ device_id);
3723+ return -EINVAL;
3724+ }
3725+
3726+ /* Reassign the updated revision field */
3727+ adapter->params.rev = adapter->chip;
3728+
35653729 init_cong_ctrl(adapter->params.a_wnd, adapter->params.b_wnd);
35663730
35673731 /*
drivers/net/ethernet/chelsio/cxgb4/t4_hw.h+0−1
@@ -47,7 +47,6 @@ enum { · 46 unmodified lines
4747 TCB_SIZE = 128, /* TCB size */
4848 NMTUS = 16, /* size of MTU table */
4949 NCCTRL_WIN = 32, /* # of congestion control windows */
50− NEXACT_MAC = 336, /* # of exact MAC address filters */
5150 L2T_SIZE = 4096, /* # of L2T entries */
5251 MBOX_LEN = 64, /* mailbox size in bytes */
5352 TRACE_LEN = 112, /* length of trace data and mask */
drivers/net/ethernet/chelsio/cxgb4/t4_msg.h+64−0
@@ -74,6 +74,7 @@ enum { · 73 unmodified lines
7474 CPL_PASS_ESTABLISH = 0x41,
7575 CPL_RX_DATA_DDP = 0x42,
7676 CPL_PASS_ACCEPT_REQ = 0x44,
77+ CPL_TRACE_PKT_T5 = 0x48,
7778
7879 CPL_RDMA_READ_REQ = 0x60,
7980
@@ -157,6 +158,7 @@ union opcode_tid { · 77 unmodified lines
157158 };
158159
159160 #define CPL_OPCODE(x) ((x) << 24)
161+#define G_CPL_OPCODE(x) (((x) >> 24) & 0xFF)
160162 #define MK_OPCODE_TID(opcode, tid) (CPL_OPCODE(opcode) | (tid))
161163 #define OPCODE_TID(cmd) ((cmd)->ot.opcode_tid)
162164 #define GET_TID(cmd) (ntohl(OPCODE_TID(cmd)) & 0xFFFFFF)
@@ -287,6 +289,23 @@ struct cpl_act_open_req { · 124 unmodified lines
287289 __be32 opt2;
288290 };
289291
292+#define S_FILTER_TUPLE 24
293+#define M_FILTER_TUPLE 0xFFFFFFFFFF
294+#define V_FILTER_TUPLE(x) ((x) << S_FILTER_TUPLE)
295+#define G_FILTER_TUPLE(x) (((x) >> S_FILTER_TUPLE) & M_FILTER_TUPLE)
296+struct cpl_t5_act_open_req {
297+ WR_HDR;
298+ union opcode_tid ot;
299+ __be16 local_port;
300+ __be16 peer_port;
301+ __be32 local_ip;
302+ __be32 peer_ip;
303+ __be64 opt0;
304+ __be32 rsvd;
305+ __be32 opt2;
306+ __be64 params;
307+};
308+
290309 struct cpl_act_open_req6 {
291310 WR_HDR;
292311 union opcode_tid ot;
@@ -566,6 +585,11 @@ struct cpl_rx_pkt { · 273 unmodified lines
566585 #define V_RX_ETHHDR_LEN(x) ((x) << S_RX_ETHHDR_LEN)
567586 #define G_RX_ETHHDR_LEN(x) (((x) >> S_RX_ETHHDR_LEN) & M_RX_ETHHDR_LEN)
568587
588+#define S_RX_T5_ETHHDR_LEN 0
589+#define M_RX_T5_ETHHDR_LEN 0x3F
590+#define V_RX_T5_ETHHDR_LEN(x) ((x) << S_RX_T5_ETHHDR_LEN)
591+#define G_RX_T5_ETHHDR_LEN(x) (((x) >> S_RX_T5_ETHHDR_LEN) & M_RX_T5_ETHHDR_LEN)
592+
569593 #define S_RX_MACIDX 8
570594 #define M_RX_MACIDX 0x1FF
571595 #define V_RX_MACIDX(x) ((x) << S_RX_MACIDX)
@@ -612,6 +636,28 @@ struct cpl_trace_pkt { · 40 unmodified lines
612636 __be64 tstamp;
613637 };
614638
639+struct cpl_t5_trace_pkt {
640+ __u8 opcode;
641+ __u8 intf;
642+#if defined(__LITTLE_ENDIAN_BITFIELD)
643+ __u8 runt:4;
644+ __u8 filter_hit:4;
645+ __u8:6;
646+ __u8 err:1;
647+ __u8 trunc:1;
648+#else
649+ __u8 filter_hit:4;
650+ __u8 runt:4;
651+ __u8 trunc:1;
652+ __u8 err:1;
653+ __u8:6;
654+#endif
655+ __be16 rsvd;
656+ __be16 len;
657+ __be64 tstamp;
658+ __be64 rsvd1;
659+};
660+
615661 struct cpl_l2t_write_req {
616662 WR_HDR;
617663 union opcode_tid ot;
@@ -643,6 +689,15 @@ struct cpl_sge_egr_update { · 25 unmodified lines
643689 __be16 pidx;
644690 };
645691
692+/* cpl_fw*.type values */
693+enum {
694+ FW_TYPE_CMD_RPL = 0,
695+ FW_TYPE_WR_RPL = 1,
696+ FW_TYPE_CQE = 2,
697+ FW_TYPE_OFLD_CONNECTION_WR_RPL = 3,
698+ FW_TYPE_RSSCPL = 4,
699+};
700+
646701 struct cpl_fw4_pld {
647702 u8 opcode;
648703 u8 rsvd0[3];
@@ -692,6 +747,7 @@ enum { · 43 unmodified lines
692747 FW6_TYPE_WR_RPL = 1,
693748 FW6_TYPE_CQE = 2,
694749 FW6_TYPE_OFLD_CONNECTION_WR_RPL = 3,
750+ FW6_TYPE_RSSCPL = FW_TYPE_RSSCPL,
695751 };
696752
697753 struct cpl_fw6_msg_ofld_connection_wr_rpl {
@@ -742,4 +798,12 @@ struct ulp_mem_io { · 44 unmodified lines
742798 #define ULP_MEMIO_LOCK(x) ((x) << 31)
743799 };
744800
801+#define S_T5_ULP_MEMIO_IMM 23
802+#define V_T5_ULP_MEMIO_IMM(x) ((x) << S_T5_ULP_MEMIO_IMM)
803+#define F_T5_ULP_MEMIO_IMM V_T5_ULP_MEMIO_IMM(1U)
804+
805+#define S_T5_ULP_MEMIO_ORDER 22
806+#define V_T5_ULP_MEMIO_ORDER(x) ((x) << S_T5_ULP_MEMIO_ORDER)
807+#define F_T5_ULP_MEMIO_ORDER V_T5_ULP_MEMIO_ORDER(1U)
808+
745809 #endif /* __T4_MSG_H */
drivers/net/ethernet/chelsio/cxgb4/t4_regs.h+98−0
@@ -68,9 +68,14 @@ · 67 unmodified lines
6868 #define QID_SHIFT 15
6969 #define QID(x) ((x) << QID_SHIFT)
7070 #define DBPRIO(x) ((x) << 14)
71+#define DBTYPE(x) ((x) << 13)
7172 #define PIDX_MASK 0x00003fffU
7273 #define PIDX_SHIFT 0
7374 #define PIDX(x) ((x) << PIDX_SHIFT)
75+#define S_PIDX_T5 0
76+#define M_PIDX_T5 0x1fffU
77+#define PIDX_T5(x) (((x) >> S_PIDX_T5) & M_PIDX_T5)
78+
7479
7580 #define SGE_PF_GTS 0x4
7681 #define INGRESSQID_MASK 0xffff0000U
@@ -152,6 +157,8 @@ · 75 unmodified lines
152157 #define QUEUESPERPAGEPF0_MASK 0x0000000fU
153158 #define QUEUESPERPAGEPF0_GET(x) ((x) & QUEUESPERPAGEPF0_MASK)
154159
160+#define QUEUESPERPAGEPF1 4
161+
155162 #define SGE_INT_CAUSE1 0x1024
156163 #define SGE_INT_CAUSE2 0x1030
157164 #define SGE_INT_CAUSE3 0x103c
@@ -234,6 +241,10 @@ · 76 unmodified lines
234241 #define SGE_DOORBELL_CONTROL 0x10a8
235242 #define ENABLE_DROP (1 << 13)
236243
244+#define S_NOCOALESCE 26
245+#define V_NOCOALESCE(x) ((x) << S_NOCOALESCE)
246+#define F_NOCOALESCE V_NOCOALESCE(1U)
247+
237248 #define SGE_TIMER_VALUE_0_AND_1 0x10b8
238249 #define TIMERVALUE0_MASK 0xffff0000U
239250 #define TIMERVALUE0_SHIFT 16
@@ -272,17 +283,36 @@ · 32 unmodified lines
272283 #define S_HP_INT_THRESH 28
273284 #define M_HP_INT_THRESH 0xfU
274285 #define V_HP_INT_THRESH(x) ((x) << S_HP_INT_THRESH)
286+#define S_LP_INT_THRESH_T5 18
287+#define V_LP_INT_THRESH_T5(x) ((x) << S_LP_INT_THRESH_T5)
288+#define M_LP_COUNT_T5 0x3ffffU
289+#define G_LP_COUNT_T5(x) (((x) >> S_LP_COUNT) & M_LP_COUNT_T5)
275290 #define M_HP_COUNT 0x7ffU
276291 #define S_HP_COUNT 16
277292 #define G_HP_COUNT(x) (((x) >> S_HP_COUNT) & M_HP_COUNT)
278293 #define S_LP_INT_THRESH 12
279294 #define M_LP_INT_THRESH 0xfU
295+#define M_LP_INT_THRESH_T5 0xfffU
280296 #define V_LP_INT_THRESH(x) ((x) << S_LP_INT_THRESH)
281297 #define M_LP_COUNT 0x7ffU
282298 #define S_LP_COUNT 0
283299 #define G_LP_COUNT(x) (((x) >> S_LP_COUNT) & M_LP_COUNT)
284300 #define A_SGE_DBFIFO_STATUS 0x10a4
285301
302+#define SGE_STAT_TOTAL 0x10e4
303+#define SGE_STAT_MATCH 0x10e8
304+
305+#define SGE_STAT_CFG 0x10ec
306+#define S_STATSOURCE_T5 9
307+#define STATSOURCE_T5(x) ((x) << S_STATSOURCE_T5)
308+
309+#define SGE_DBFIFO_STATUS2 0x1118
310+#define M_HP_COUNT_T5 0x3ffU
311+#define G_HP_COUNT_T5(x) ((x) & M_HP_COUNT_T5)
312+#define S_HP_INT_THRESH_T5 10
313+#define M_HP_INT_THRESH_T5 0xfU
314+#define V_HP_INT_THRESH_T5(x) ((x) << S_HP_INT_THRESH_T5)
315+
286316 #define S_ENABLE_DROP 13
287317 #define V_ENABLE_DROP(x) ((x) << S_ENABLE_DROP)
288318 #define F_ENABLE_DROP V_ENABLE_DROP(1U)
@@ -331,8 +361,27 @@ · 42 unmodified lines
331361 #define MSIADDRHPERR 0x00000002U
332362 #define MSIADDRLPERR 0x00000001U
333363
364+#define READRSPERR 0x20000000U
365+#define TRGT1GRPPERR 0x10000000U
366+#define IPSOTPERR 0x08000000U
367+#define IPRXDATAGRPPERR 0x02000000U
368+#define IPRXHDRGRPPERR 0x01000000U
369+#define MAGRPPERR 0x00400000U
370+#define VFIDPERR 0x00200000U
371+#define HREQWRPERR 0x00010000U
372+#define DREQWRPERR 0x00002000U
373+#define MSTTAGQPERR 0x00000400U
374+#define PIOREQGRPPERR 0x00000100U
375+#define PIOCPLGRPPERR 0x00000080U
376+#define MSIXSTIPERR 0x00000004U
377+#define MSTTIMEOUTPERR 0x00000002U
378+#define MSTGRPPERR 0x00000001U
379+
334380 #define PCIE_NONFAT_ERR 0x3010
335381 #define PCIE_MEM_ACCESS_BASE_WIN 0x3068
382+#define S_PCIEOFST 10
383+#define M_PCIEOFST 0x3fffffU
384+#define GET_PCIEOFST(x) (((x) >> S_PCIEOFST) & M_PCIEOFST)
336385 #define PCIEOFST_MASK 0xfffffc00U
337386 #define BIR_MASK 0x00000300U
338387 #define BIR_SHIFT 8
@@ -342,6 +391,9 @@ · 3 unmodified lines
342391 #define WINDOW(x) ((x) << WINDOW_SHIFT)
343392 #define PCIE_MEM_ACCESS_OFFSET 0x306c
344393
394+#define S_PFNUM 0
395+#define V_PFNUM(x) ((x) << S_PFNUM)
396+
345397 #define PCIE_FW 0x30b8
346398 #define PCIE_FW_ERR 0x80000000U
347399 #define PCIE_FW_INIT 0x40000000U
@@ -407,12 +459,18 @@ · 59 unmodified lines
407459
408460 #define MC_BIST_STATUS_RDATA 0x7688
409461
462+#define MA_EDRAM0_BAR 0x77c0
463+#define MA_EDRAM1_BAR 0x77c4
464+#define EDRAM_SIZE_MASK 0xfffU
465+#define EDRAM_SIZE_GET(x) ((x) & EDRAM_SIZE_MASK)
466+
410467 #define MA_EXT_MEMORY_BAR 0x77c8
411468 #define EXT_MEM_SIZE_MASK 0x00000fffU
412469 #define EXT_MEM_SIZE_SHIFT 0
413470 #define EXT_MEM_SIZE_GET(x) (((x) & EXT_MEM_SIZE_MASK) >> EXT_MEM_SIZE_SHIFT)
414471
415472 #define MA_TARGET_MEM_ENABLE 0x77d8
473+#define EXT_MEM1_ENABLE 0x00000010U
416474 #define EXT_MEM_ENABLE 0x00000004U
417475 #define EDRAM1_ENABLE 0x00000002U
418476 #define EDRAM0_ENABLE 0x00000001U
@@ -431,6 +489,7 @@ · 12 unmodified lines
431489 #define MA_PCIE_FW 0x30b8
432490 #define MA_PARITY_ERROR_STATUS 0x77f4
433491
492+#define MA_EXT_MEMORY1_BAR 0x7808
434493 #define EDC_0_BASE_ADDR 0x7900
435494
436495 #define EDC_BIST_CMD 0x7904
@@ -801,6 +860,15 @@ · 364 unmodified lines
801860 #define MPS_PORT_STAT_RX_PORT_PPP7_H 0x60c
802861 #define MPS_PORT_STAT_RX_PORT_LESS_64B_L 0x610
803862 #define MPS_PORT_STAT_RX_PORT_LESS_64B_H 0x614
863+#define MAC_PORT_CFG2 0x818
864+#define MAC_PORT_MAGIC_MACID_LO 0x824
865+#define MAC_PORT_MAGIC_MACID_HI 0x828
866+#define MAC_PORT_EPIO_DATA0 0x8c0
867+#define MAC_PORT_EPIO_DATA1 0x8c4
868+#define MAC_PORT_EPIO_DATA2 0x8c8
869+#define MAC_PORT_EPIO_DATA3 0x8cc
870+#define MAC_PORT_EPIO_OP 0x8d0
871+
804872 #define MPS_CMN_CTL 0x9000
805873 #define NUMPORTS_MASK 0x00000003U
806874 #define NUMPORTS_SHIFT 0
@@ -1063,6 +1131,7 @@ · 256 unmodified lines
10631131 #define ADDRESS_SHIFT 0
10641132 #define ADDRESS(x) ((x) << ADDRESS_SHIFT)
10651133
1134+#define MAC_PORT_INT_CAUSE 0x8dc
10661135 #define XGMAC_PORT_INT_CAUSE 0x10dc
10671136
10681137 #define A_TP_TX_MOD_QUEUE_REQ_MAP 0x7e28
@@ -1101,4 +1170,33 @@ · 32 unmodified lines
11011170 #define V_PORT(x) ((x) << S_PORT)
11021171 #define F_PORT V_PORT(1U)
11031172
1173+#define NUM_MPS_CLS_SRAM_L_INSTANCES 336
1174+#define NUM_MPS_T5_CLS_SRAM_L_INSTANCES 512
1175+
1176+#define T5_PORT0_BASE 0x30000
1177+#define T5_PORT_STRIDE 0x4000
1178+#define T5_PORT_BASE(idx) (T5_PORT0_BASE + (idx) * T5_PORT_STRIDE)
1179+#define T5_PORT_REG(idx, reg) (T5_PORT_BASE(idx) + (reg))
1180+
1181+#define MC_0_BASE_ADDR 0x40000
1182+#define MC_1_BASE_ADDR 0x48000
1183+#define MC_STRIDE (MC_1_BASE_ADDR - MC_0_BASE_ADDR)
1184+#define MC_REG(reg, idx) (reg + MC_STRIDE * idx)
1185+
1186+#define MC_P_BIST_CMD 0x41400
1187+#define MC_P_BIST_CMD_ADDR 0x41404
1188+#define MC_P_BIST_CMD_LEN 0x41408
1189+#define MC_P_BIST_DATA_PATTERN 0x4140c
1190+#define MC_P_BIST_STATUS_RDATA 0x41488
1191+#define EDC_T50_BASE_ADDR 0x50000
1192+#define EDC_H_BIST_CMD 0x50004
1193+#define EDC_H_BIST_CMD_ADDR 0x50008
1194+#define EDC_H_BIST_CMD_LEN 0x5000c
1195+#define EDC_H_BIST_DATA_PATTERN 0x50010
1196+#define EDC_H_BIST_STATUS_RDATA 0x50028
1197+
1198+#define EDC_T51_BASE_ADDR 0x50800
1199+#define EDC_STRIDE_T5 (EDC_T51_BASE_ADDR - EDC_T50_BASE_ADDR)
1200+#define EDC_REG_T5(reg, idx) (reg + EDC_STRIDE_T5 * idx)
1201+
11041202 #endif /* __T4_REGS_H */
drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h+36−4
@@ -574,7 +574,7 @@ struct fw_eth_tx_pkt_vm_wr { · 573 unmodified lines
574574 __be16 vlantci;
575575 };
576576
577−#define FW_CMD_MAX_TIMEOUT 3000
577+#define FW_CMD_MAX_TIMEOUT 10000
578578
579579 /*
580580 * If a host driver does a HELLO and discovers that there's already a MASTER
@@ -973,7 +973,9 @@ enum fw_params_param_pfvf { · 392 unmodified lines
973973 FW_PARAMS_PARAM_PFVF_EQ_START = 0x2B,
974974 FW_PARAMS_PARAM_PFVF_EQ_END = 0x2C,
975975 FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_START = 0x2D,
976− FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_END = 0x2E
976+ FW_PARAMS_PARAM_PFVF_ACTIVE_FILTER_END = 0x2E,
977+ FW_PARAMS_PARAM_PFVF_ETHOFLD_END = 0x30,
978+ FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP = 0x31
977979 };
978980
979981 /*
@@ -1758,6 +1760,25 @@ enum fw_port_module_type { · 778 unmodified lines
17581760 FW_PORT_MOD_TYPE_NONE = FW_PORT_CMD_MODTYPE_MASK
17591761 };
17601762
1763+enum fw_port_mod_sub_type {
1764+ FW_PORT_MOD_SUB_TYPE_NA,
1765+ FW_PORT_MOD_SUB_TYPE_MV88E114X = 0x1,
1766+ FW_PORT_MOD_SUB_TYPE_TN8022 = 0x2,
1767+ FW_PORT_MOD_SUB_TYPE_AQ1202 = 0x3,
1768+ FW_PORT_MOD_SUB_TYPE_88x3120 = 0x4,
1769+ FW_PORT_MOD_SUB_TYPE_BCM84834 = 0x5,
1770+ FW_PORT_MOD_SUB_TYPE_BT_VSC8634 = 0x8,
1771+
1772+ /* The following will never been in the VPD. They are TWINAX cable
1773+ * lengths decoded from SFP+ module i2c PROMs. These should
1774+ * almost certainly go somewhere else ...
1775+ */
1776+ FW_PORT_MOD_SUB_TYPE_TWINAX_1 = 0x9,
1777+ FW_PORT_MOD_SUB_TYPE_TWINAX_3 = 0xA,
1778+ FW_PORT_MOD_SUB_TYPE_TWINAX_5 = 0xB,
1779+ FW_PORT_MOD_SUB_TYPE_TWINAX_7 = 0xC,
1780+};
1781+
17611782 /* port stats */
17621783 #define FW_NUM_PORT_STATS 50
17631784 #define FW_NUM_PORT_TX_STATS 23
@@ -2123,11 +2144,11 @@ struct fw_hdr { · 359 unmodified lines
21232144 u8 intfver_ri;
21242145 u8 intfver_iscsipdu;
21252146 u8 intfver_iscsi;
2147+ u8 intfver_fcoepdu;
21262148 u8 intfver_fcoe;
2127− u8 reserved2;
2149+ __u32 reserved2;
21282150 __u32 reserved3;
21292151 __u32 reserved4;
2130− __u32 reserved5;
21312152 __be32 flags;
21322153 __be32 reserved6[23];
21332154 };
@@ -2137,6 +2158,17 @@ struct fw_hdr { · 3 unmodified lines
21372158 #define FW_HDR_FW_VER_MICRO_GET(x) (((x) >> 8) & 0xff)
21382159 #define FW_HDR_FW_VER_BUILD_GET(x) (((x) >> 0) & 0xff)
21392160
2161+enum fw_hdr_intfver {
2162+ FW_HDR_INTFVER_NIC = 0x00,
2163+ FW_HDR_INTFVER_VNIC = 0x00,
2164+ FW_HDR_INTFVER_OFLD = 0x00,
2165+ FW_HDR_INTFVER_RI = 0x00,
2166+ FW_HDR_INTFVER_ISCSIPDU = 0x00,
2167+ FW_HDR_INTFVER_ISCSI = 0x00,
2168+ FW_HDR_INTFVER_FCOEPDU = 0x00,
2169+ FW_HDR_INTFVER_FCOE = 0x00,
2170+};
2171+
21402172 enum fw_hdr_flags {
21412173 FW_HDR_FLAGS_RESET_HALT = 0x00000001,
21422174 };
drivers/net/ethernet/chelsio/cxgb4vf/adapter.h+1−0
@@ -344,6 +344,7 @@ struct adapter { · 343 unmodified lines
344344 unsigned long registered_device_map;
345345 unsigned long open_device_map;
346346 unsigned long flags;
347+ enum chip_type chip;
347348 struct adapter_params params;
348349
349350 /* queue and interrupt resources */
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c+65−10
@@ -54,8 +54,8 @@ · 53 unmodified lines
5454 /*
5555 * Generic information about the driver.
5656 */
57−#define DRV_VERSION "1.0.0"
58−#define DRV_DESC "Chelsio T4 Virtual Function (VF) Network Driver"
57+#define DRV_VERSION "2.0.0-ko"
58+#define DRV_DESC "Chelsio T4/T5 Virtual Function (VF) Network Driver"
5959
6060 /*
6161 * Module Parameters.
@@ -409,6 +409,20 @@ static int fwevtq_handler(struct sge_rspq *rspq, const __be64 *rsp, · 347 unmodified lines
409409 break;
410410 }
411411
412+ case CPL_FW4_MSG: {
413+ /* FW can send EGR_UPDATEs encapsulated in a CPL_FW4_MSG.
414+ */
415+ const struct cpl_sge_egr_update *p = (void *)(rsp + 3);
416+ opcode = G_CPL_OPCODE(ntohl(p->opcode_qid));
417+ if (opcode != CPL_SGE_EGR_UPDATE) {
418+ dev_err(adapter->pdev_dev, "unexpected FW4/CPL %#x on FW event queue\n"
419+ , opcode);
420+ break;
421+ }
422+ cpl = (void *)p;
423+ /*FALLTHROUGH*/
424+ }
425+
412426 case CPL_SGE_EGR_UPDATE: {
413427 /*
414428 * We've received an Egress Queue Status Update message. We
@@ -1050,7 +1064,7 @@ static inline unsigned int mk_adap_vers(const struct adapter *adapter) · 635 unmodified lines
10501064 /*
10511065 * Chip version 4, revision 0x3f (cxgb4vf).
10521066 */
1053− return 4 | (0x3f << 10);
1067+ return CHELSIO_CHIP_VERSION(adapter->chip) | (0x3f << 10);
10541068 }
10551069
10561070 /*
@@ -1100,10 +1114,10 @@ static netdev_features_t cxgb4vf_fix_features(struct net_device *dev, · 43 unmodified lines
11001114 * Since there is no support for separate rx/tx vlan accel
11011115 * enable/disable make sure tx flag is always in same state as rx.
11021116 */
1103− if (features & NETIF_F_HW_VLAN_RX)
1104− features |= NETIF_F_HW_VLAN_TX;
1117+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
1118+ features |= NETIF_F_HW_VLAN_CTAG_TX;
11051119 else
1106− features &= ~NETIF_F_HW_VLAN_TX;
1120+ features &= ~NETIF_F_HW_VLAN_CTAG_TX;
11071121
11081122 return features;
11091123 }
@@ -1114,9 +1128,9 @@ static int cxgb4vf_set_features(struct net_device *dev, · 4 unmodified lines
11141128 struct port_info *pi = netdev_priv(dev);
11151129 netdev_features_t changed = dev->features ^ features;
11161130
1117− if (changed & NETIF_F_HW_VLAN_RX)
1131+ if (changed & NETIF_F_HW_VLAN_CTAG_RX)
11181132 t4vf_set_rxmode(pi->adapter, pi->viid, -1, -1, -1, -1,
1119− features & NETIF_F_HW_VLAN_TX, 0);
1133+ features & NETIF_F_HW_VLAN_CTAG_TX, 0);
11201134
11211135 return 0;
11221136 }
@@ -2072,6 +2086,7 @@ static int adap_init0(struct adapter *adapter) · 949 unmodified lines
20722086 struct sge *s = &adapter->sge;
20732087 unsigned int ethqsets;
20742088 int err;
2089+ u32 param, val = 0;
20752090
20762091 /*
20772092 * Wait for the device to become ready before proceeding ...
@@ -2099,6 +2114,15 @@ static int adap_init0(struct adapter *adapter) · 21 unmodified lines
20992114 return err;
21002115 }
21012116
2117+ switch (adapter->pdev->device >> 12) {
2118+ case CHELSIO_T4:
2119+ adapter->chip = CHELSIO_CHIP_CODE(CHELSIO_T4, 0);
2120+ break;
2121+ case CHELSIO_T5:
2122+ adapter->chip = CHELSIO_CHIP_CODE(CHELSIO_T5, 0);
2123+ break;
2124+ }
2125+
21022126 /*
21032127 * Grab basic operational parameters. These will predominantly have
21042128 * been set up by the Physical Function Driver or will be hard coded
@@ -2144,6 +2168,16 @@ static int adap_init0(struct adapter *adapter) · 39 unmodified lines
21442168 return err;
21452169 }
21462170
2171+ /* If we're running on newer firmware, let it know that we're
2172+ * prepared to deal with encapsulated CPL messages. Older
2173+ * firmware won't understand this and we'll just get
2174+ * unencapsulated messages ...
2175+ */
2176+ param = FW_PARAMS_MNEM(FW_PARAMS_MNEM_PFVF) |
2177+ FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_PFVF_CPLFW4MSG_ENCAP);
2178+ val = 1;
2179+ (void) t4vf_set_params(adapter, 1, &param, &val);
2180+
21472181 /*
21482182 * Retrieve our RX interrupt holdoff timer values and counter
21492183 * threshold values from the SGE parameters.
@@ -2614,11 +2648,12 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev, · 464 unmodified lines
26142648
26152649 netdev->hw_features = NETIF_F_SG | TSO_FLAGS |
26162650 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
2617− NETIF_F_HW_VLAN_RX | NETIF_F_RXCSUM;
2651+ NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_RXCSUM;
26182652 netdev->vlan_features = NETIF_F_SG | TSO_FLAGS |
26192653 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
26202654 NETIF_F_HIGHDMA;
2621− netdev->features = netdev->hw_features | NETIF_F_HW_VLAN_TX;
2655+ netdev->features = netdev->hw_features |
2656+ NETIF_F_HW_VLAN_CTAG_TX;
26222657 if (pci_using_dac)
26232658 netdev->features |= NETIF_F_HIGHDMA;
26242659
@@ -2888,6 +2923,26 @@ static struct pci_device_id cxgb4vf_pci_tbl[] = { · 263 unmodified lines
28882923 CH_DEVICE(0x480a, 0), /* T404-bt */
28892924 CH_DEVICE(0x480d, 0), /* T480-cr */
28902925 CH_DEVICE(0x480e, 0), /* T440-lp-cr */
2926+ CH_DEVICE(0x5800, 0), /* T580-dbg */
2927+ CH_DEVICE(0x5801, 0), /* T520-cr */
2928+ CH_DEVICE(0x5802, 0), /* T522-cr */
2929+ CH_DEVICE(0x5803, 0), /* T540-cr */
2930+ CH_DEVICE(0x5804, 0), /* T520-bch */
2931+ CH_DEVICE(0x5805, 0), /* T540-bch */
2932+ CH_DEVICE(0x5806, 0), /* T540-ch */
2933+ CH_DEVICE(0x5807, 0), /* T520-so */
2934+ CH_DEVICE(0x5808, 0), /* T520-cx */
2935+ CH_DEVICE(0x5809, 0), /* T520-bt */
2936+ CH_DEVICE(0x580a, 0), /* T504-bt */
2937+ CH_DEVICE(0x580b, 0), /* T520-sr */
2938+ CH_DEVICE(0x580c, 0), /* T504-bt */
2939+ CH_DEVICE(0x580d, 0), /* T580-cr */
2940+ CH_DEVICE(0x580e, 0), /* T540-lp-cr */
2941+ CH_DEVICE(0x580f, 0), /* Amsterdam */
2942+ CH_DEVICE(0x5810, 0), /* T580-lp-cr */
2943+ CH_DEVICE(0x5811, 0), /* T520-lp-cr */
2944+ CH_DEVICE(0x5812, 0), /* T560-cr */
2945+ CH_DEVICE(0x5813, 0), /* T580-cr */
28912946 { 0, }
28922947 };
28932948
drivers/net/ethernet/chelsio/cxgb4vf/sge.c+9−4
@@ -528,17 +528,21 @@ static void unmap_rx_buf(struct adapter *adapter, struct sge_fl *fl) · 527 unmodified lines
528528 */
529529 static inline void ring_fl_db(struct adapter *adapter, struct sge_fl *fl)
530530 {
531+ u32 val;
532+
531533 /*
532534 * The SGE keeps track of its Producer and Consumer Indices in terms
533535 * of Egress Queue Units so we can only tell it about integral numbers
534536 * of multiples of Free List Entries per Egress Queue Units ...
535537 */
536538 if (fl->pend_cred >= FL_PER_EQ_UNIT) {
539+ val = PIDX(fl->pend_cred / FL_PER_EQ_UNIT);
540+ if (!is_t4(adapter->chip))
541+ val |= DBTYPE(1);
537542 wmb();
538543 t4_write_reg(adapter, T4VF_SGE_BASE_ADDR + SGE_VF_KDOORBELL,
539544 DBPRIO(1) |
540− QID(fl->cntxt_id) |
541− PIDX(fl->pend_cred / FL_PER_EQ_UNIT));
545+ QID(fl->cntxt_id) | val);
542546 fl->pend_cred %= FL_PER_EQ_UNIT;
543547 }
544548 }
@@ -1478,7 +1482,8 @@ static void do_gro(struct sge_eth_rxq *rxq, const struct pkt_gl *gl, · 933 unmodified lines
14781482 skb_record_rx_queue(skb, rxq->rspq.idx);
14791483
14801484 if (pkt->vlan_ex) {
1481− __vlan_hwaccel_put_tag(skb, be16_to_cpu(pkt->vlan));
1485+ __vlan_hwaccel_put_tag(skb, cpu_to_be16(ETH_P_8021Q),
1486+ be16_to_cpu(pkt->vlan));
14821487 rxq->stats.vlan_ex++;
14831488 }
14841489 ret = napi_gro_frags(&rxq->rspq.napi);
@@ -1547,7 +1552,7 @@ int t4vf_ethrx_handler(struct sge_rspq *rspq, const __be64 *rsp, · 62 unmodified lines
15471552
15481553 if (pkt->vlan_ex) {
15491554 rxq->stats.vlan_ex++;
1550− __vlan_hwaccel_put_tag(skb, be16_to_cpu(pkt->vlan));
1555+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), be16_to_cpu(pkt->vlan));
15511556 }
15521557
15531558 netif_receive_skb(skb);
drivers/net/ethernet/chelsio/cxgb4vf/t4vf_common.h+24−0
@@ -38,6 +38,25 @@ · 37 unmodified lines
3838
3939 #include "../cxgb4/t4fw_api.h"
4040
41+#define CHELSIO_CHIP_CODE(version, revision) (((version) << 4) | (revision))
42+#define CHELSIO_CHIP_VERSION(code) ((code) >> 4)
43+#define CHELSIO_CHIP_RELEASE(code) ((code) & 0xf)
44+
45+#define CHELSIO_T4 0x4
46+#define CHELSIO_T5 0x5
47+
48+enum chip_type {
49+ T4_A1 = CHELSIO_CHIP_CODE(CHELSIO_T4, 0),
50+ T4_A2 = CHELSIO_CHIP_CODE(CHELSIO_T4, 1),
51+ T4_A3 = CHELSIO_CHIP_CODE(CHELSIO_T4, 2),
52+ T4_FIRST_REV = T4_A1,
53+ T4_LAST_REV = T4_A3,
54+
55+ T5_A1 = CHELSIO_CHIP_CODE(CHELSIO_T5, 0),
56+ T5_FIRST_REV = T5_A1,
57+ T5_LAST_REV = T5_A1,
58+};
59+
4160 /*
4261 * The "len16" field of a Firmware Command Structure ...
4362 */
@@ -232,6 +251,11 @@ static inline int t4vf_wr_mbox_ns(struct adapter *adapter, const void *cmd, · 188 unmodified lines
232251 return t4vf_wr_mbox_core(adapter, cmd, size, rpl, false);
233252 }
234253
254+static inline int is_t4(enum chip_type chip)
255+{
256+ return (chip >= T4_FIRST_REV && chip <= T4_LAST_REV);
257+}
258+
235259 int t4vf_wait_dev_ready(struct adapter *);
236260 int t4vf_port_init(struct adapter *, int);
237261
drivers/net/ethernet/chelsio/cxgb4vf/t4vf_hw.c+10−4
@@ -1027,8 +1027,11 @@ int t4vf_alloc_mac_filt(struct adapter *adapter, unsigned int viid, bool free, · 1026 unmodified lines
10271027 unsigned nfilters = 0;
10281028 unsigned int rem = naddr;
10291029 struct fw_vi_mac_cmd cmd, rpl;
1030+ unsigned int max_naddr = is_t4(adapter->chip) ?
1031+ NUM_MPS_CLS_SRAM_L_INSTANCES :
1032+ NUM_MPS_T5_CLS_SRAM_L_INSTANCES;
10301033
1031− if (naddr > FW_CLS_TCAM_NUM_ENTRIES)
1034+ if (naddr > max_naddr)
10321035 return -EINVAL;
10331036
10341037 for (offset = 0; offset < naddr; /**/) {
@@ -1069,10 +1072,10 @@ int t4vf_alloc_mac_filt(struct adapter *adapter, unsigned int viid, bool free, · 34 unmodified lines
10691072
10701073 if (idx)
10711074 idx[offset+i] =
1072− (index >= FW_CLS_TCAM_NUM_ENTRIES
1075+ (index >= max_naddr
10731076 ? 0xffff
10741077 : index);
1075− if (index < FW_CLS_TCAM_NUM_ENTRIES)
1078+ if (index < max_naddr)
10761079 nfilters++;
10771080 else if (hash)
10781081 *hash |= (1ULL << hash_mac_addr(addr[offset+i]));
@@ -1118,6 +1121,9 @@ int t4vf_change_mac(struct adapter *adapter, unsigned int viid, · 39 unmodified lines
11181121 struct fw_vi_mac_exact *p = &cmd.u.exact[0];
11191122 size_t len16 = DIV_ROUND_UP(offsetof(struct fw_vi_mac_cmd,
11201123 u.exact[1]), 16);
1124+ unsigned int max_naddr = is_t4(adapter->chip) ?
1125+ NUM_MPS_CLS_SRAM_L_INSTANCES :
1126+ NUM_MPS_T5_CLS_SRAM_L_INSTANCES;
11211127
11221128 /*
11231129 * If this is a new allocation, determine whether it should be
@@ -1140,7 +1146,7 @@ int t4vf_change_mac(struct adapter *adapter, unsigned int viid, · 16 unmodified lines
11401146 if (ret == 0) {
11411147 p = &rpl.u.exact[0];
11421148 ret = FW_VI_MAC_CMD_IDX_GET(be16_to_cpu(p->valid_to_idx));
1143− if (ret >= FW_CLS_TCAM_NUM_ENTRIES)
1149+ if (ret >= max_naddr)
11441150 ret = -ENOMEM;
11451151 }
11461152 return ret;
drivers/net/ethernet/cirrus/cs89x0.c+2−72
@@ -101,23 +101,6 @@ static char version[] __initdata = · 100 unmodified lines
101101 * them to system IRQ numbers. This mapping is card specific and is set to
102102 * the configuration of the Cirrus Eval board for this chip.
103103 */
104−#if defined(CONFIG_MACH_IXDP2351)
105−#define CS89x0_NONISA_IRQ
106−static unsigned int netcard_portlist[] __used __initdata = {
107− IXDP2351_VIRT_CS8900_BASE, 0
108−};
109−static unsigned int cs8900_irq_map[] = {
110− IRQ_IXDP2351_CS8900, 0, 0, 0
111−};
112−#elif defined(CONFIG_ARCH_IXDP2X01)
113−#define CS89x0_NONISA_IRQ
114−static unsigned int netcard_portlist[] __used __initdata = {
115− IXDP2X01_CS8900_VIRT_BASE, 0
116−};
117−static unsigned int cs8900_irq_map[] = {
118− IRQ_IXDP2X01_CS8900, 0, 0, 0
119−};
120−#else
121104 #ifndef CONFIG_CS89x0_PLATFORM
122105 static unsigned int netcard_portlist[] __used __initdata = {
123106 0x300, 0x320, 0x340, 0x360, 0x200, 0x220, 0x240,
@@ -127,7 +110,6 @@ static unsigned int cs8900_irq_map[] = { · 3 unmodified lines
127110 10, 11, 12, 5
128111 };
129112 #endif
130−#endif
131113
132114 #if DEBUGGING
133115 static unsigned int net_debug = DEBUGGING;
@@ -210,32 +192,6 @@ static int __init media_fn(char *str) · 76 unmodified lines
210192 __setup("cs89x0_media=", media_fn);
211193 #endif
212194
213−#if defined(CONFIG_MACH_IXDP2351)
214−static u16
215−readword(unsigned long base_addr, int portno)
216−{
217− return __raw_readw(base_addr + (portno << 1));
218−}
219−
220−static void
221−writeword(unsigned long base_addr, int portno, u16 value)
222−{
223− __raw_writew(value, base_addr + (portno << 1));
224−}
225−#elif defined(CONFIG_ARCH_IXDP2X01)
226−static u16
227−readword(unsigned long base_addr, int portno)
228−{
229− return __raw_readl(base_addr + (portno << 1));
230−}
231−
232−static void
233−writeword(unsigned long base_addr, int portno, u16 value)
234−{
235− __raw_writel(value, base_addr + (portno << 1));
236−}
237−#endif
238−
239195 static void readwords(struct net_local *lp, int portno, void *buf, int length)
240196 {
241197 u8 *buf8 = (u8 *)buf;
@@ -478,9 +434,6 @@ dma_rx(struct net_device *dev) · 236 unmodified lines
478434 /* Malloc up new buffer. */
479435 skb = netdev_alloc_skb(dev, length + 2);
480436 if (skb == NULL) {
481− /* I don't think we want to do this to a stressed system */
482− cs89_dbg(0, err, "%s: Memory squeeze, dropping packet\n",
483− dev->name);
484437 dev->stats.rx_dropped++;
485438
486439 /* AKPM: advance bp to the next frame */
@@ -731,9 +684,6 @@ net_rx(struct net_device *dev) · 244 unmodified lines
731684 /* Malloc up new buffer. */
732685 skb = netdev_alloc_skb(dev, length + 2);
733686 if (skb == NULL) {
734−#if 0 /* Again, this seems a cruel thing to do */
735− pr_warn("%s: Memory squeeze, dropping packet\n", dev->name);
736−#endif
737687 dev->stats.rx_dropped++;
738688 return;
739689 }
@@ -908,7 +858,7 @@ net_open(struct net_device *dev) · 168 unmodified lines
908858 goto bad_out;
909859 }
910860 } else {
911−#if !defined(CS89x0_NONISA_IRQ) && !defined(CONFIG_CS89x0_PLATFORM)
861+#if !defined(CONFIG_CS89x0_PLATFORM)
912862 if (((1 << dev->irq) & lp->irq_map) == 0) {
913863 pr_err("%s: IRQ %d is not in our map of allowable IRQs, which is %x\n",
914864 dev->name, dev->irq, lp->irq_map);
@@ -1321,9 +1271,7 @@ static const struct net_device_ops net_ops = { · 406 unmodified lines
13211271 static void __init reset_chip(struct net_device *dev)
13221272 {
13231273 #if !defined(CONFIG_MACH_MX31ADS)
1324−#if !defined(CS89x0_NONISA_IRQ)
13251274 struct net_local *lp = netdev_priv(dev);
1326−#endif /* CS89x0_NONISA_IRQ */
13271275 int reset_start_time;
13281276
13291277 writereg(dev, PP_SelfCTL, readreg(dev, PP_SelfCTL) | POWER_ON_RESET);
@@ -1331,7 +1279,6 @@ static void __init reset_chip(struct net_device *dev) · 1 unmodified line
13311279 /* wait 30 ms */
13321280 msleep(30);
13331281
1334−#if !defined(CS89x0_NONISA_IRQ)
13351282 if (lp->chip_type != CS8900) {
13361283 /* Hardware problem requires PNP registers to be reconfigured after a reset */
13371284 iowrite16(PP_CS8920_ISAINT, lp->virt_addr + ADD_PORT);
@@ -1344,7 +1291,6 @@ static void __init reset_chip(struct net_device *dev) · 6 unmodified lines
13441291 iowrite8((dev->mem_start >> 8) & 0xff,
13451292 lp->virt_addr + DATA_PORT + 1);
13461293 }
1347−#endif /* CS89x0_NONISA_IRQ */
13481294
13491295 /* Wait until the chip is reset */
13501296 reset_start_time = jiffies;
@@ -1579,9 +1525,6 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular) · 228 unmodified lines
15791525 i = lp->isa_config & INT_NO_MASK;
15801526 #ifndef CONFIG_CS89x0_PLATFORM
15811527 if (lp->chip_type == CS8900) {
1582−#ifdef CS89x0_NONISA_IRQ
1583− i = cs8900_irq_map[0];
1584−#else
15851528 /* Translate the IRQ using the IRQ mapping table. */
15861529 if (i >= ARRAY_SIZE(cs8900_irq_map))
15871530 pr_err("invalid ISA interrupt number %d\n", i);
@@ -1599,7 +1542,6 @@ cs89x0_probe1(struct net_device *dev, void __iomem *ioaddr, int modular) · 11 unmodified lines
15991542 lp->irq_map = ((irq_map_buff[0] >> 8) |
16001543 (irq_map_buff[1] << 8));
16011544 }
1602−#endif
16031545 }
16041546 #endif
16051547 if (!dev->irq)
@@ -1978,18 +1920,6 @@ static struct platform_driver cs89x0_driver = { · 372 unmodified lines
19781920 .remove = cs89x0_platform_remove,
19791921 };
19801922
1981−static int __init cs89x0_init(void)
1982−{
1983− return platform_driver_probe(&cs89x0_driver, cs89x0_platform_probe);
1984−}
1985−
1986−module_init(cs89x0_init);
1987−
1988−static void __exit cs89x0_cleanup(void)
1989−{
1990− platform_driver_unregister(&cs89x0_driver);
1991−}
1992−
1993−module_exit(cs89x0_cleanup);
1923+module_platform_driver_probe(cs89x0_driver, cs89x0_platform_probe);
19941924
19951925 #endif /* CONFIG_CS89x0_PLATFORM */
drivers/net/ethernet/cirrus/ep93xx_eth.c+1−12
@@ -887,18 +887,7 @@ static struct platform_driver ep93xx_eth_driver = { · 886 unmodified lines
887887 },
888888 };
889889
890−static int __init ep93xx_eth_init_module(void)
891−{
892− printk(KERN_INFO DRV_MODULE_NAME " version " DRV_MODULE_VERSION " loading\n");
893− return platform_driver_register(&ep93xx_eth_driver);
894−}
895−
896−static void __exit ep93xx_eth_cleanup_module(void)
897−{
898− platform_driver_unregister(&ep93xx_eth_driver);
899−}
890+module_platform_driver(ep93xx_eth_driver);
900891
901−module_init(ep93xx_eth_init_module);
902−module_exit(ep93xx_eth_cleanup_module);
903892 MODULE_LICENSE("GPL");
904893 MODULE_ALIAS("platform:ep93xx-eth");
drivers/net/ethernet/cisco/enic/enic_dev.c+2−2
@@ -212,7 +212,7 @@ int enic_dev_deinit_done(struct enic *enic, int *status) · 211 unmodified lines
212212 }
213213
214214 /* rtnl lock is held */
215−int enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid)
215+int enic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
216216 {
217217 struct enic *enic = netdev_priv(netdev);
218218 int err;
@@ -225,7 +225,7 @@ int enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid) · 6 unmodified lines
225225 }
226226
227227 /* rtnl lock is held */
228−int enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid)
228+int enic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid)
229229 {
230230 struct enic *enic = netdev_priv(netdev);
231231 int err;
drivers/net/ethernet/cisco/enic/enic_dev.h+2−2
@@ -46,8 +46,8 @@ int enic_dev_packet_filter(struct enic *enic, int directed, int multicast, · 45 unmodified lines
4646 int broadcast, int promisc, int allmulti);
4747 int enic_dev_add_addr(struct enic *enic, u8 *addr);
4848 int enic_dev_del_addr(struct enic *enic, u8 *addr);
49−int enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid);
50−int enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid);
49+int enic_vlan_rx_add_vid(struct net_device *netdev, __be16 proto, u16 vid);
50+int enic_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto, u16 vid);
5151 int enic_dev_notify_unset(struct enic *enic);
5252 int enic_dev_hang_notify(struct enic *enic);
5353 int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic);
drivers/net/ethernet/cisco/enic/enic_main.c+3−3
@@ -1300,7 +1300,7 @@ static void enic_rq_indicate_buf(struct vnic_rq *rq, · 1299 unmodified lines
13001300 }
13011301
13021302 if (vlan_stripped)
1303− __vlan_hwaccel_put_tag(skb, vlan_tci);
1303+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tci);
13041304
13051305 if (netdev->features & NETIF_F_GRO)
13061306 napi_gro_receive(&enic->napi[q_number], skb);
@@ -2496,9 +2496,9 @@ static int enic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 1189 unmodified lines
24962496 netdev->watchdog_timeo = 2 * HZ;
24972497 netdev->ethtool_ops = &enic_ethtool_ops;
24982498
2499− netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
2499+ netdev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;
25002500 if (ENIC_SETTING(enic, LOOP)) {
2501− netdev->features &= ~NETIF_F_HW_VLAN_TX;
2501+ netdev->features &= ~NETIF_F_HW_VLAN_CTAG_TX;
25022502 enic->loop_enable = 1;
25032503 enic->loop_tag = enic->config.loop_tag;
25042504 dev_info(dev, "loopback tag=0x%04x\n", enic->loop_tag);
drivers/net/ethernet/cisco/enic/vnic_dev.c+3−0
@@ -308,6 +308,9 @@ static int _vnic_dev_cmd(struct vnic_dev *vdev, enum vnic_devcmd_cmd cmd, · 307 unmodified lines
308308
309309 if (status & STAT_ERROR) {
310310 err = (int)readq(&devcmd->args[0]);
311+ if (err == ERR_EINVAL &&
312+ cmd == CMD_CAPABILITY)
313+ return err;
311314 if (err != ERR_ECMDUNKNOWN ||
312315 cmd != CMD_CAPABILITY)
313316 pr_err("Error %d devcmd %d\n",
drivers/net/ethernet/davicom/dm9000.c+1−16
@@ -1693,22 +1693,7 @@ static struct platform_driver dm9000_driver = { · 1692 unmodified lines
16931693 .remove = dm9000_drv_remove,
16941694 };
16951695
1696−static int __init
1697−dm9000_init(void)
1698−{
1699− printk(KERN_INFO "%s Ethernet Driver, V%s\n", CARDNAME, DRV_VERSION);
1700−
1701− return platform_driver_register(&dm9000_driver);
1702−}
1703−
1704−static void __exit
1705−dm9000_cleanup(void)
1706−{
1707− platform_driver_unregister(&dm9000_driver);
1708−}
1709−
1710−module_init(dm9000_init);
1711−module_exit(dm9000_cleanup);
1696+module_platform_driver(dm9000_driver);
17121697
17131698 MODULE_AUTHOR("Sascha Hauer, Ben Dooks");
17141699 MODULE_DESCRIPTION("Davicom DM9000 network driver");
drivers/net/ethernet/dec/tulip/xircom_cb.c+3−6
@@ -236,17 +236,14 @@ static int xircom_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 235 unmodified lines
236236 private->rx_buffer = dma_alloc_coherent(d, 8192,
237237 &private->rx_dma_handle,
238238 GFP_KERNEL);
239− if (private->rx_buffer == NULL) {
240− pr_err("%s: no memory for rx buffer\n", __func__);
239+ if (private->rx_buffer == NULL)
241240 goto rx_buf_fail;
242− }
241+
243242 private->tx_buffer = dma_alloc_coherent(d, 8192,
244243 &private->tx_dma_handle,
245244 GFP_KERNEL);
246− if (private->tx_buffer == NULL) {
247− pr_err("%s: no memory for tx buffer\n", __func__);
245+ if (private->tx_buffer == NULL)
248246 goto tx_buf_fail;
249− }
250247
251248 SET_NETDEV_DEV(dev, &pdev->dev);
252249
drivers/net/ethernet/dlink/dl2k.c+2−5
@@ -580,12 +580,9 @@ alloc_list (struct net_device *dev) · 579 unmodified lines
580580
581581 skb = netdev_alloc_skb_ip_align(dev, np->rx_buf_sz);
582582 np->rx_skbuff[i] = skb;
583− if (skb == NULL) {
584− printk (KERN_ERR
585− "%s: alloc_list: allocate Rx buffer error! ",
586− dev->name);
583+ if (skb == NULL)
587584 break;
588− }
585+
589586 /* Rubicon now supports 40 bits of addressing space. */
590587 np->rx_ring[i].fraginfo =
591588 cpu_to_le64 ( pci_map_single (
drivers/net/ethernet/emulex/benet/be.h+12−2
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (C) 2005 - 2011 Emulex
2+ * Copyright (C) 2005 - 2013 Emulex
33 * All rights reserved.
44 *
55 * This program is free software; you can redistribute it and/or
@@ -214,6 +214,7 @@ struct be_tx_stats { · 208 unmodified lines
214214 };
215215
216216 struct be_tx_obj {
217+ u32 db_offset;
217218 struct be_queue_info q;
218219 struct be_queue_info cq;
219220 /* Remember the skbs that were transmitted */
@@ -292,7 +293,7 @@ struct be_drv_stats { · 72 unmodified lines
292293 u32 rx_in_range_errors;
293294 u32 rx_out_range_errors;
294295 u32 rx_frame_too_long;
295− u32 rx_address_mismatch_drops;
296+ u32 rx_address_filtered;
296297 u32 rx_dropped_too_small;
297298 u32 rx_dropped_too_short;
298299 u32 rx_dropped_header_too_small;
@@ -328,6 +329,7 @@ enum vf_state { · 29 unmodified lines
328329 #define BE_FLAGS_WORKER_SCHEDULED (1 << 3)
329330 #define BE_UC_PMAC_COUNT 30
330331 #define BE_VF_UC_PMAC_COUNT 2
332+#define BE_FLAGS_QNQ_ASYNC_EVT_RCVD (1 << 11)
331333
332334 struct phy_info {
333335 u8 transceiver;
@@ -434,6 +436,8 @@ struct be_adapter { · 100 unmodified lines
434436 u8 wol_cap;
435437 bool wol;
436438 u32 uc_macs; /* Count of secondary UC MAC programmed */
439+ u16 asic_rev;
440+ u16 qnq_vid;
437441 u32 msg_enable;
438442 int be_get_temp_freq;
439443 u16 max_mcast_mac;
@@ -445,6 +449,7 @@ struct be_adapter { · 5 unmodified lines
445449 u16 max_event_queues;
446450 u32 if_cap_flags;
447451 u8 pf_number;
452+ u64 rss_flags;
448453 };
449454
450455 #define be_physfn(adapter) (!adapter->virtfn)
@@ -648,6 +653,11 @@ static inline bool be_is_wol_excluded(struct be_adapter *adapter) · 197 unmodified lines
648653 }
649654 }
650655
656+static inline int qnq_async_evt_rcvd(struct be_adapter *adapter)
657+{
658+ return adapter->flags & BE_FLAGS_QNQ_ASYNC_EVT_RCVD;
659+}
660+
651661 extern void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm,
652662 u16 num_popped);
653663 extern void be_link_status_update(struct be_adapter *adapter, u8 link_status);
drivers/net/ethernet/emulex/benet/be_cmds.c+185−72
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (C) 2005 - 2011 Emulex
2+ * Copyright (C) 2005 - 2013 Emulex
33 * All rights reserved.
44 *
55 * This program is free software; you can redistribute it and/or
@@ -263,6 +263,27 @@ static void be_async_grp5_evt_process(struct be_adapter *adapter, · 257 unmodified lines
263263 }
264264 }
265265
266+static void be_async_dbg_evt_process(struct be_adapter *adapter,
267+ u32 trailer, struct be_mcc_compl *cmp)
268+{
269+ u8 event_type = 0;
270+ struct be_async_event_qnq *evt = (struct be_async_event_qnq *) cmp;
271+
272+ event_type = (trailer >> ASYNC_TRAILER_EVENT_TYPE_SHIFT) &
273+ ASYNC_TRAILER_EVENT_TYPE_MASK;
274+
275+ switch (event_type) {
276+ case ASYNC_DEBUG_EVENT_TYPE_QNQ:
277+ if (evt->valid)
278+ adapter->qnq_vid = le16_to_cpu(evt->vlan_tag);
279+ adapter->flags |= BE_FLAGS_QNQ_ASYNC_EVT_RCVD;
280+ break;
281+ default:
282+ dev_warn(&adapter->pdev->dev, "Unknown debug event\n");
283+ break;
284+ }
285+}
286+
266287 static inline bool is_link_state_evt(u32 trailer)
267288 {
268289 return ((trailer >> ASYNC_TRAILER_EVENT_CODE_SHIFT) &
@@ -277,6 +298,13 @@ static inline bool is_grp5_evt(u32 trailer) · 8 unmodified lines
277298 ASYNC_EVENT_CODE_GRP_5);
278299 }
279300
301+static inline bool is_dbg_evt(u32 trailer)
302+{
303+ return (((trailer >> ASYNC_TRAILER_EVENT_CODE_SHIFT) &
304+ ASYNC_TRAILER_EVENT_CODE_MASK) ==
305+ ASYNC_EVENT_CODE_QNQ);
306+}
307+
280308 static struct be_mcc_compl *be_mcc_compl_get(struct be_adapter *adapter)
281309 {
282310 struct be_queue_info *mcc_cq = &adapter->mcc_obj.cq;
@@ -325,6 +353,9 @@ int be_process_mcc(struct be_adapter *adapter) · 42 unmodified lines
325353 else if (is_grp5_evt(compl->flags))
326354 be_async_grp5_evt_process(adapter,
327355 compl->flags, compl);
356+ else if (is_dbg_evt(compl->flags))
357+ be_async_dbg_evt_process(adapter,
358+ compl->flags, compl);
328359 } else if (compl->flags & CQE_FLAGS_COMPLETED_MASK) {
329360 status = be_mcc_compl_process(adapter, compl);
330361 atomic_dec(&mcc_obj->q.used);
@@ -687,10 +718,8 @@ static struct be_mcc_wrb *wrb_from_mccq(struct be_adapter *adapter) · 356 unmodified lines
687718 if (!mccq->created)
688719 return NULL;
689720
690− if (atomic_read(&mccq->used) >= mccq->len) {
691− dev_err(&adapter->pdev->dev, "Out of MCCQ wrbs\n");
721+ if (atomic_read(&mccq->used) >= mccq->len)
692722 return NULL;
693− }
694723
695724 wrb = queue_head_node(mccq);
696725 queue_head_inc(mccq);
@@ -1022,6 +1051,7 @@ int be_cmd_mccq_ext_create(struct be_adapter *adapter, · 325 unmodified lines
10221051
10231052 /* Subscribe to Link State and Group 5 Events(bits 1 and 5 set) */
10241053 req->async_event_bitmap[0] = cpu_to_le32(0x00000022);
1054+ req->async_event_bitmap[0] |= cpu_to_le32(1 << ASYNC_EVENT_CODE_QNQ);
10251055 be_dws_cpu_to_le(ctxt, sizeof(req->context));
10261056
10271057 be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
@@ -1095,15 +1125,14 @@ int be_cmd_mccq_create(struct be_adapter *adapter, · 67 unmodified lines
10951125 return status;
10961126 }
10971127
1098−int be_cmd_txq_create(struct be_adapter *adapter,
1099− struct be_queue_info *txq,
1100− struct be_queue_info *cq)
1128+int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo)
11011129 {
11021130 struct be_mcc_wrb *wrb;
11031131 struct be_cmd_req_eth_tx_create *req;
1132+ struct be_queue_info *txq = &txo->q;
1133+ struct be_queue_info *cq = &txo->cq;
11041134 struct be_dma_mem *q_mem = &txq->dma_mem;
1105− void *ctxt;
1106− int status;
1135+ int status, ver = 0;
11071136
11081137 spin_lock_bh(&adapter->mcc_lock);
11091138
@@ -1114,34 +1143,37 @@ int be_cmd_txq_create(struct be_adapter *adapter, · 4 unmodified lines
11141143 }
11151144
11161145 req = embedded_payload(wrb);
1117− ctxt = &req->context;
11181146
11191147 be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_ETH,
11201148 OPCODE_ETH_TX_CREATE, sizeof(*req), wrb, NULL);
11211149
11221150 if (lancer_chip(adapter)) {
11231151 req->hdr.version = 1;
1124− AMAP_SET_BITS(struct amap_tx_context, if_id, ctxt,
1125− adapter->if_handle);
1152+ req->if_id = cpu_to_le16(adapter->if_handle);
1153+ } else if (BEx_chip(adapter)) {
1154+ if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC)
1155+ req->hdr.version = 2;
1156+ } else { /* For SH */
1157+ req->hdr.version = 2;
11261158 }
11271159
11281160 req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size);
11291161 req->ulp_num = BE_ULP1_NUM;
11301162 req->type = BE_ETH_TX_RING_TYPE_STANDARD;
1131−
1132− AMAP_SET_BITS(struct amap_tx_context, tx_ring_size, ctxt,
1133− be_encoded_q_len(txq->len));
1134− AMAP_SET_BITS(struct amap_tx_context, ctx_valid, ctxt, 1);
1135− AMAP_SET_BITS(struct amap_tx_context, cq_id_send, ctxt, cq->id);
1136−
1137− be_dws_cpu_to_le(ctxt, sizeof(req->context));
1138−
1163+ req->cq_id = cpu_to_le16(cq->id);
1164+ req->queue_size = be_encoded_q_len(txq->len);
11391165 be_cmd_page_addrs_prepare(req->pages, ARRAY_SIZE(req->pages), q_mem);
11401166
1167+ ver = req->hdr.version;
1168+
11411169 status = be_mcc_notify_wait(adapter);
11421170 if (!status) {
11431171 struct be_cmd_resp_eth_tx_create *resp = embedded_payload(wrb);
11441172 txq->id = le16_to_cpu(resp->cid);
1173+ if (ver == 2)
1174+ txo->db_offset = le32_to_cpu(resp->db_offset);
1175+ else
1176+ txo->db_offset = DB_TXULP1_OFFSET;
11451177 txq->created = true;
11461178 }
11471179
@@ -1834,7 +1866,7 @@ err: · 686 unmodified lines
18341866
18351867 /* Uses mbox */
18361868 int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num,
1837− u32 *mode, u32 *caps)
1869+ u32 *mode, u32 *caps, u16 *asic_rev)
18381870 {
18391871 struct be_mcc_wrb *wrb;
18401872 struct be_cmd_req_query_fw_cfg *req;
@@ -1855,6 +1887,7 @@ int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num, · 14 unmodified lines
18551887 *port_num = le32_to_cpu(resp->phys_port);
18561888 *mode = le32_to_cpu(resp->function_mode);
18571889 *caps = le32_to_cpu(resp->function_caps);
1890+ *asic_rev = le32_to_cpu(resp->asic_revision) & 0xFF;
18581891 }
18591892
18601893 mutex_unlock(&adapter->mbox_lock);
@@ -1897,7 +1930,8 @@ int be_cmd_reset_function(struct be_adapter *adapter) · 36 unmodified lines
18971930 return status;
18981931 }
18991932
1900−int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, u16 table_size)
1933+int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable,
1934+ u32 rss_hash_opts, u16 table_size)
19011935 {
19021936 struct be_mcc_wrb *wrb;
19031937 struct be_cmd_req_rss_config *req;
@@ -1916,16 +1950,12 @@ int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable, u16 table_size) · 12 unmodified lines
19161950 OPCODE_ETH_RSS_CONFIG, sizeof(*req), wrb, NULL);
19171951
19181952 req->if_id = cpu_to_le32(adapter->if_handle);
1919− req->enable_rss = cpu_to_le16(RSS_ENABLE_TCP_IPV4 | RSS_ENABLE_IPV4 |
1920− RSS_ENABLE_TCP_IPV6 | RSS_ENABLE_IPV6);
1953+ req->enable_rss = cpu_to_le16(rss_hash_opts);
1954+ req->cpu_table_size_log2 = cpu_to_le16(fls(table_size) - 1);
19211955
1922− if (lancer_chip(adapter) || skyhawk_chip(adapter)) {
1956+ if (lancer_chip(adapter) || skyhawk_chip(adapter))
19231957 req->hdr.version = 1;
1924− req->enable_rss |= cpu_to_le16(RSS_ENABLE_UDP_IPV4 |
1925− RSS_ENABLE_UDP_IPV6);
1926− }
19271958
1928− req->cpu_table_size_log2 = cpu_to_le16(fls(table_size) - 1);
19291959 memcpy(req->cpu_table, rsstable, table_size);
19301960 memcpy(req->hash, myhash, sizeof(myhash));
19311961 be_dws_cpu_to_le(req->hash, sizeof(req->hash));
@@ -2343,7 +2373,6 @@ int be_cmd_get_seeprom_data(struct be_adapter *adapter, · 411 unmodified lines
23432373 {
23442374 struct be_mcc_wrb *wrb;
23452375 struct be_cmd_req_seeprom_read *req;
2346− struct be_sge *sge;
23472376 int status;
23482377
23492378 spin_lock_bh(&adapter->mcc_lock);
@@ -2354,7 +2383,6 @@ int be_cmd_get_seeprom_data(struct be_adapter *adapter, · 4 unmodified lines
23542383 goto err;
23552384 }
23562385 req = nonemb_cmd->va;
2357− sge = nonembedded_sgl(wrb);
23582386
23592387 be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
23602388 OPCODE_COMMON_SEEPROM_READ, sizeof(*req), wrb,
@@ -2461,6 +2489,9 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter) · 100 unmodified lines
24612489 struct mgmt_controller_attrib *attribs;
24622490 struct be_dma_mem attribs_cmd;
24632491
2492+ if (mutex_lock_interruptible(&adapter->mbox_lock))
2493+ return -1;
2494+
24642495 memset(&attribs_cmd, 0, sizeof(struct be_dma_mem));
24652496 attribs_cmd.size = sizeof(struct be_cmd_resp_cntl_attribs);
24662497 attribs_cmd.va = pci_alloc_consistent(adapter->pdev, attribs_cmd.size,
@@ -2468,12 +2499,10 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter) · 1 unmodified line
24682499 if (!attribs_cmd.va) {
24692500 dev_err(&adapter->pdev->dev,
24702501 "Memory allocation failure\n");
2471− return -ENOMEM;
2502+ status = -ENOMEM;
2503+ goto err;
24722504 }
24732505
2474− if (mutex_lock_interruptible(&adapter->mbox_lock))
2475− return -1;
2476−
24772506 wrb = wrb_from_mbox(adapter);
24782507 if (!wrb) {
24792508 status = -EBUSY;
@@ -2493,8 +2522,9 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter) · 13 unmodified lines
24932522
24942523 err:
24952524 mutex_unlock(&adapter->mbox_lock);
2496− pci_free_consistent(adapter->pdev, attribs_cmd.size, attribs_cmd.va,
2497− attribs_cmd.dma);
2525+ if (attribs_cmd.va)
2526+ pci_free_consistent(adapter->pdev, attribs_cmd.size,
2527+ attribs_cmd.va, attribs_cmd.dma);
24982528 return status;
24992529 }
25002530
@@ -2667,10 +2697,8 @@ int be_cmd_set_mac_list(struct be_adapter *adapter, u8 *mac_array, · 166 unmodified lines
26672697 cmd.size = sizeof(struct be_cmd_req_set_mac_list);
26682698 cmd.va = dma_alloc_coherent(&adapter->pdev->dev, cmd.size,
26692699 &cmd.dma, GFP_KERNEL);
2670− if (!cmd.va) {
2671− dev_err(&adapter->pdev->dev, "Memory alloc failure\n");
2700+ if (!cmd.va)
26722701 return -ENOMEM;
2673− }
26742702
26752703 spin_lock_bh(&adapter->mcc_lock);
26762704
@@ -2794,6 +2822,9 @@ int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter) · 117 unmodified lines
27942822 CMD_SUBSYSTEM_ETH))
27952823 return -EPERM;
27962824
2825+ if (mutex_lock_interruptible(&adapter->mbox_lock))
2826+ return -1;
2827+
27972828 memset(&cmd, 0, sizeof(struct be_dma_mem));
27982829 cmd.size = sizeof(struct be_cmd_resp_acpi_wol_magic_config_v1);
27992830 cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size,
@@ -2801,12 +2832,10 @@ int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter) · 1 unmodified line
28012832 if (!cmd.va) {
28022833 dev_err(&adapter->pdev->dev,
28032834 "Memory allocation failure\n");
2804− return -ENOMEM;
2835+ status = -ENOMEM;
2836+ goto err;
28052837 }
28062838
2807− if (mutex_lock_interruptible(&adapter->mbox_lock))
2808− return -1;
2809−
28102839 wrb = wrb_from_mbox(adapter);
28112840 if (!wrb) {
28122841 status = -EBUSY;
@@ -2837,7 +2866,8 @@ int be_cmd_get_acpi_wol_cap(struct be_adapter *adapter) · 24 unmodified lines
28372866 }
28382867 err:
28392868 mutex_unlock(&adapter->mbox_lock);
2840− pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
2869+ if (cmd.va)
2870+ pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
28412871 return status;
28422872
28432873 }
@@ -2942,14 +2972,15 @@ static struct be_nic_resource_desc *be_get_nic_desc(u8 *buf, u32 desc_count, · 98 unmodified lines
29422972 int i;
29432973
29442974 for (i = 0; i < desc_count; i++) {
2945− desc->desc_len = RESOURCE_DESC_SIZE;
2975+ desc->desc_len = desc->desc_len ? : RESOURCE_DESC_SIZE;
29462976 if (((void *)desc + desc->desc_len) >
29472977 (void *)(buf + max_buf_size)) {
29482978 desc = NULL;
29492979 break;
29502980 }
29512981
2952− if (desc->desc_type == NIC_RESOURCE_DESC_TYPE_ID)
2982+ if (desc->desc_type == NIC_RESOURCE_DESC_TYPE_V0 ||
2983+ desc->desc_type == NIC_RESOURCE_DESC_TYPE_V1)
29532984 break;
29542985
29552986 desc = (void *)desc + desc->desc_len;
@@ -2969,16 +3000,18 @@ int be_cmd_get_func_config(struct be_adapter *adapter) · 13 unmodified lines
29693000 int status;
29703001 struct be_dma_mem cmd;
29713002
3003+ if (mutex_lock_interruptible(&adapter->mbox_lock))
3004+ return -1;
3005+
29723006 memset(&cmd, 0, sizeof(struct be_dma_mem));
29733007 cmd.size = sizeof(struct be_cmd_resp_get_func_config);
29743008 cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size,
29753009 &cmd.dma);
29763010 if (!cmd.va) {
29773011 dev_err(&adapter->pdev->dev, "Memory alloc failure\n");
2978− return -ENOMEM;
3012+ status = -ENOMEM;
3013+ goto err;
29793014 }
2980− if (mutex_lock_interruptible(&adapter->mbox_lock))
2981− return -1;
29823015
29833016 wrb = wrb_from_mbox(adapter);
29843017 if (!wrb) {
@@ -2992,6 +3025,9 @@ int be_cmd_get_func_config(struct be_adapter *adapter) · 7 unmodified lines
29923025 OPCODE_COMMON_GET_FUNC_CONFIG,
29933026 cmd.size, wrb, &cmd);
29943027
3028+ if (skyhawk_chip(adapter))
3029+ req->hdr.version = 1;
3030+
29953031 status = be_mbox_notify_wait(adapter);
29963032 if (!status) {
29973033 struct be_cmd_resp_get_func_config *resp = cmd.va;
@@ -3018,28 +3054,46 @@ int be_cmd_get_func_config(struct be_adapter *adapter) · 20 unmodified lines
30183054 }
30193055 err:
30203056 mutex_unlock(&adapter->mbox_lock);
3021− pci_free_consistent(adapter->pdev, cmd.size,
3022− cmd.va, cmd.dma);
3057+ if (cmd.va)
3058+ pci_free_consistent(adapter->pdev, cmd.size, cmd.va, cmd.dma);
30233059 return status;
30243060 }
30253061
3026− /* Uses sync mcc */
3027−int be_cmd_get_profile_config(struct be_adapter *adapter, u32 *cap_flags,
3028− u8 domain)
3062+/* Uses mbox */
3063+int be_cmd_get_profile_config_mbox(struct be_adapter *adapter,
3064+ u8 domain, struct be_dma_mem *cmd)
30293065 {
30303066 struct be_mcc_wrb *wrb;
30313067 struct be_cmd_req_get_profile_config *req;
30323068 int status;
3033− struct be_dma_mem cmd;
30343069
3035− memset(&cmd, 0, sizeof(struct be_dma_mem));
3036− cmd.size = sizeof(struct be_cmd_resp_get_profile_config);
3037− cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size,
3038− &cmd.dma);
3039− if (!cmd.va) {
3040− dev_err(&adapter->pdev->dev, "Memory alloc failure\n");
3041− return -ENOMEM;
3042− }
3070+ if (mutex_lock_interruptible(&adapter->mbox_lock))
3071+ return -1;
3072+ wrb = wrb_from_mbox(adapter);
3073+
3074+ req = cmd->va;
3075+ be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
3076+ OPCODE_COMMON_GET_PROFILE_CONFIG,
3077+ cmd->size, wrb, cmd);
3078+
3079+ req->type = ACTIVE_PROFILE_TYPE;
3080+ req->hdr.domain = domain;
3081+ if (!lancer_chip(adapter))
3082+ req->hdr.version = 1;
3083+
3084+ status = be_mbox_notify_wait(adapter);
3085+
3086+ mutex_unlock(&adapter->mbox_lock);
3087+ return status;
3088+}
3089+
3090+/* Uses sync mcc */
3091+int be_cmd_get_profile_config_mccq(struct be_adapter *adapter,
3092+ u8 domain, struct be_dma_mem *cmd)
3093+{
3094+ struct be_mcc_wrb *wrb;
3095+ struct be_cmd_req_get_profile_config *req;
3096+ int status;
30433097
30443098 spin_lock_bh(&adapter->mcc_lock);
30453099
@@ -3049,16 +3103,47 @@ int be_cmd_get_profile_config(struct be_adapter *adapter, u32 *cap_flags, · 3 unmodified lines
30493103 goto err;
30503104 }
30513105
3052− req = cmd.va;
3053−
3106+ req = cmd->va;
30543107 be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
30553108 OPCODE_COMMON_GET_PROFILE_CONFIG,
3056− cmd.size, wrb, &cmd);
3109+ cmd->size, wrb, cmd);
30573110
30583111 req->type = ACTIVE_PROFILE_TYPE;
30593112 req->hdr.domain = domain;
3113+ if (!lancer_chip(adapter))
3114+ req->hdr.version = 1;
30603115
30613116 status = be_mcc_notify_wait(adapter);
3117+
3118+err:
3119+ spin_unlock_bh(&adapter->mcc_lock);
3120+ return status;
3121+}
3122+
3123+/* Uses sync mcc, if MCCQ is already created otherwise mbox */
3124+int be_cmd_get_profile_config(struct be_adapter *adapter, u32 *cap_flags,
3125+ u16 *txq_count, u8 domain)
3126+{
3127+ struct be_queue_info *mccq = &adapter->mcc_obj.q;
3128+ struct be_dma_mem cmd;
3129+ int status;
3130+
3131+ memset(&cmd, 0, sizeof(struct be_dma_mem));
3132+ if (!lancer_chip(adapter))
3133+ cmd.size = sizeof(struct be_cmd_resp_get_profile_config_v1);
3134+ else
3135+ cmd.size = sizeof(struct be_cmd_resp_get_profile_config);
3136+ cmd.va = pci_alloc_consistent(adapter->pdev, cmd.size,
3137+ &cmd.dma);
3138+ if (!cmd.va) {
3139+ dev_err(&adapter->pdev->dev, "Memory alloc failure\n");
3140+ return -ENOMEM;
3141+ }
3142+
3143+ if (!mccq->created)
3144+ status = be_cmd_get_profile_config_mbox(adapter, domain, &cmd);
3145+ else
3146+ status = be_cmd_get_profile_config_mccq(adapter, domain, &cmd);
30623147 if (!status) {
30633148 struct be_cmd_resp_get_profile_config *resp = cmd.va;
30643149 u32 desc_count = le32_to_cpu(resp->desc_count);
@@ -3071,12 +3156,15 @@ int be_cmd_get_profile_config(struct be_adapter *adapter, u32 *cap_flags, · 6 unmodified lines
30713156 status = -EINVAL;
30723157 goto err;
30733158 }
3074− *cap_flags = le32_to_cpu(desc->cap_flags);
3159+ if (cap_flags)
3160+ *cap_flags = le32_to_cpu(desc->cap_flags);
3161+ if (txq_count)
3162+ *txq_count = le32_to_cpu(desc->txq_count);
30753163 }
30763164 err:
3077− spin_unlock_bh(&adapter->mcc_lock);
3078− pci_free_consistent(adapter->pdev, cmd.size,
3079− cmd.va, cmd.dma);
3165+ if (cmd.va)
3166+ pci_free_consistent(adapter->pdev, cmd.size,
3167+ cmd.va, cmd.dma);
30803168 return status;
30813169 }
30823170
@@ -3105,7 +3193,7 @@ int be_cmd_set_profile_config(struct be_adapter *adapter, u32 bps, · 22 unmodified lines
31053193 req->hdr.domain = domain;
31063194 req->desc_count = cpu_to_le32(1);
31073195
3108− req->nic_desc.desc_type = NIC_RESOURCE_DESC_TYPE_ID;
3196+ req->nic_desc.desc_type = NIC_RESOURCE_DESC_TYPE_V0;
31093197 req->nic_desc.desc_len = RESOURCE_DESC_SIZE;
31103198 req->nic_desc.flags = (1 << QUN) | (1 << IMM) | (1 << NOSV);
31113199 req->nic_desc.pf_num = adapter->pf_number;
@@ -3202,6 +3290,31 @@ err: · 90 unmodified lines
32023290 return status;
32033291 }
32043292
3293+int be_cmd_intr_set(struct be_adapter *adapter, bool intr_enable)
3294+{
3295+ struct be_mcc_wrb *wrb;
3296+ struct be_cmd_req_intr_set *req;
3297+ int status;
3298+
3299+ if (mutex_lock_interruptible(&adapter->mbox_lock))
3300+ return -1;
3301+
3302+ wrb = wrb_from_mbox(adapter);
3303+
3304+ req = embedded_payload(wrb);
3305+
3306+ be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
3307+ OPCODE_COMMON_SET_INTERRUPT_ENABLE, sizeof(*req),
3308+ wrb, NULL);
3309+
3310+ req->intr_enabled = intr_enable;
3311+
3312+ status = be_mbox_notify_wait(adapter);
3313+
3314+ mutex_unlock(&adapter->mbox_lock);
3315+ return status;
3316+}
3317+
32053318 int be_roce_mcc_cmd(void *netdev_handle, void *wrb_payload,
32063319 int wrb_payload_size, u16 *cmd_status, u16 *ext_status)
32073320 {
drivers/net/ethernet/emulex/benet/be_cmds.h+57−46
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (C) 2005 - 2011 Emulex
2+ * Copyright (C) 2005 - 2013 Emulex
33 * All rights reserved.
44 *
55 * This program is free software; you can redistribute it and/or
@@ -84,6 +84,9 @@ struct be_mcc_compl { · 78 unmodified lines
8484 #define ASYNC_EVENT_QOS_SPEED 0x1
8585 #define ASYNC_EVENT_COS_PRIORITY 0x2
8686 #define ASYNC_EVENT_PVID_STATE 0x3
87+#define ASYNC_EVENT_CODE_QNQ 0x6
88+#define ASYNC_DEBUG_EVENT_TYPE_QNQ 1
89+
8790 struct be_async_event_trailer {
8891 u32 code;
8992 };
@@ -144,6 +147,16 @@ struct be_async_event_grp5_pvid_state { · 54 unmodified lines
144147 struct be_async_event_trailer trailer;
145148 } __packed;
146149
150+/* async event indicating outer VLAN tag in QnQ */
151+struct be_async_event_qnq {
152+ u8 valid; /* Indicates if outer VLAN is valid */
153+ u8 rsvd0;
154+ u16 vlan_tag;
155+ u32 event_tag;
156+ u8 rsvd1[4];
157+ struct be_async_event_trailer trailer;
158+} __packed;
159+
147160 struct be_mcc_mailbox {
148161 struct be_mcc_wrb wrb;
149162 struct be_mcc_compl compl;
@@ -188,6 +201,7 @@ struct be_mcc_mailbox { · 38 unmodified lines
188201 #define OPCODE_COMMON_GET_BEACON_STATE 70
189202 #define OPCODE_COMMON_READ_TRANSRECV_DATA 73
190203 #define OPCODE_COMMON_GET_PORT_NAME 77
204+#define OPCODE_COMMON_SET_INTERRUPT_ENABLE 89
191205 #define OPCODE_COMMON_GET_PHY_DETAILS 102
192206 #define OPCODE_COMMON_SET_DRIVER_FUNCTION_CAP 103
193207 #define OPCODE_COMMON_GET_CNTL_ADDITIONAL_ATTRIBUTES 121
@@ -473,46 +487,27 @@ struct be_cmd_resp_mcc_create { · 279 unmodified lines
473487 #define BE_ETH_TX_RING_TYPE_STANDARD 2
474488 #define BE_ULP1_NUM 1
475489
476−/* Pseudo amap definition in which each bit of the actual structure is defined
477− * as a byte: used to calculate offset/shift/mask of each field */
478−struct amap_tx_context {
479− u8 if_id[16]; /* dword 0 */
480− u8 tx_ring_size[4]; /* dword 0 */
481− u8 rsvd1[26]; /* dword 0 */
482− u8 pci_func_id[8]; /* dword 1 */
483− u8 rsvd2[9]; /* dword 1 */
484− u8 ctx_valid; /* dword 1 */
485− u8 cq_id_send[16]; /* dword 2 */
486− u8 rsvd3[16]; /* dword 2 */
487− u8 rsvd4[32]; /* dword 3 */
488− u8 rsvd5[32]; /* dword 4 */
489− u8 rsvd6[32]; /* dword 5 */
490− u8 rsvd7[32]; /* dword 6 */
491− u8 rsvd8[32]; /* dword 7 */
492− u8 rsvd9[32]; /* dword 8 */
493− u8 rsvd10[32]; /* dword 9 */
494− u8 rsvd11[32]; /* dword 10 */
495− u8 rsvd12[32]; /* dword 11 */
496− u8 rsvd13[32]; /* dword 12 */
497− u8 rsvd14[32]; /* dword 13 */
498− u8 rsvd15[32]; /* dword 14 */
499− u8 rsvd16[32]; /* dword 15 */
500−} __packed;
501−
502490 struct be_cmd_req_eth_tx_create {
503491 struct be_cmd_req_hdr hdr;
504492 u8 num_pages;
505493 u8 ulp_num;
506− u8 type;
507− u8 bound_port;
508− u8 context[sizeof(struct amap_tx_context) / 8];
494+ u16 type;
495+ u16 if_id;
496+ u8 queue_size;
497+ u8 rsvd0;
498+ u32 rsvd1;
499+ u16 cq_id;
500+ u16 rsvd2;
501+ u32 rsvd3[13];
509502 struct phys_addr pages[8];
510503 } __packed;
511504
512505 struct be_cmd_resp_eth_tx_create {
513506 struct be_cmd_resp_hdr hdr;
514507 u16 cid;
515− u16 rsvd0;
508+ u16 rid;
509+ u32 db_offset;
510+ u32 rsvd0[4];
516511 } __packed;
517512
518513 /******************** Create RxQ ***************************/
@@ -608,8 +603,8 @@ struct be_port_rxf_stats_v0 { · 89 unmodified lines
608603 u32 rx_in_range_errors; /* dword 10*/
609604 u32 rx_out_range_errors; /* dword 11*/
610605 u32 rx_frame_too_long; /* dword 12*/
611− u32 rx_address_mismatch_drops; /* dword 13*/
612− u32 rx_vlan_mismatch_drops; /* dword 14*/
606+ u32 rx_address_filtered; /* dword 13*/
607+ u32 rx_vlan_filtered; /* dword 14*/
613608 u32 rx_dropped_too_small; /* dword 15*/
614609 u32 rx_dropped_too_short; /* dword 16*/
615610 u32 rx_dropped_header_too_small; /* dword 17*/
@@ -815,8 +810,8 @@ struct lancer_pport_stats { · 199 unmodified lines
815810 u32 rx_control_frames_unknown_opcode_hi;
816811 u32 rx_in_range_errors;
817812 u32 rx_out_of_range_errors;
818− u32 rx_address_mismatch_drops;
819− u32 rx_vlan_mismatch_drops;
813+ u32 rx_address_filtered;
814+ u32 rx_vlan_filtered;
820815 u32 rx_dropped_too_small;
821816 u32 rx_dropped_too_short;
822817 u32 rx_dropped_header_too_small;
@@ -1066,7 +1061,6 @@ struct be_cmd_resp_modify_eq_delay { · 243 unmodified lines
10661061 } __packed;
10671062
10681063 /******************** Get FW Config *******************/
1069−#define BE_FUNCTION_CAPS_RSS 0x2
10701064 /* The HW can come up in either of the following multi-channel modes
10711065 * based on the skew/IPL.
10721066 */
@@ -1109,6 +1103,9 @@ struct be_cmd_resp_query_fw_cfg { · 36 unmodified lines
11091103 #define RSS_ENABLE_UDP_IPV4 0x10
11101104 #define RSS_ENABLE_UDP_IPV6 0x20
11111105
1106+#define L3_RSS_FLAGS (RXH_IP_DST | RXH_IP_SRC)
1107+#define L4_RSS_FLAGS (RXH_L4_B_0_1 | RXH_L4_B_2_3)
1108+
11121109 struct be_cmd_req_rss_config {
11131110 struct be_cmd_req_hdr hdr;
11141111 u32 if_id;
@@ -1592,7 +1589,7 @@ struct be_port_rxf_stats_v1 { · 477 unmodified lines
15921589 u32 rx_in_range_errors;
15931590 u32 rx_out_range_errors;
15941591 u32 rx_frame_too_long;
1595− u32 rx_address_mismatch_drops;
1592+ u32 rx_address_filtered;
15961593 u32 rx_dropped_too_small;
15971594 u32 rx_dropped_too_short;
15981595 u32 rx_dropped_header_too_small;
@@ -1706,9 +1703,11 @@ struct be_cmd_req_set_ext_fat_caps { · 107 unmodified lines
17061703 struct be_fat_conf_params set_params;
17071704 };
17081705
1709−#define RESOURCE_DESC_SIZE 72
1710−#define NIC_RESOURCE_DESC_TYPE_ID 0x41
1706+#define RESOURCE_DESC_SIZE 88
1707+#define NIC_RESOURCE_DESC_TYPE_V0 0x41
1708+#define NIC_RESOURCE_DESC_TYPE_V1 0x51
17111709 #define MAX_RESOURCE_DESC 4
1710+#define MAX_RESOURCE_DESC_V1 32
17121711
17131712 /* QOS unit number */
17141713 #define QUN 4
@@ -1755,7 +1754,7 @@ struct be_cmd_req_get_func_config { · 40 unmodified lines
17551754 };
17561755
17571756 struct be_cmd_resp_get_func_config {
1758− struct be_cmd_req_hdr hdr;
1757+ struct be_cmd_resp_hdr hdr;
17591758 u32 desc_count;
17601759 u8 func_param[MAX_RESOURCE_DESC * RESOURCE_DESC_SIZE];
17611760 };
@@ -1774,6 +1773,12 @@ struct be_cmd_resp_get_profile_config { · 12 unmodified lines
17741773 u8 func_param[MAX_RESOURCE_DESC * RESOURCE_DESC_SIZE];
17751774 };
17761775
1776+struct be_cmd_resp_get_profile_config_v1 {
1777+ struct be_cmd_req_hdr hdr;
1778+ u32 desc_count;
1779+ u8 func_param[MAX_RESOURCE_DESC_V1 * RESOURCE_DESC_SIZE];
1780+};
1781+
17771782 struct be_cmd_req_set_profile_config {
17781783 struct be_cmd_req_hdr hdr;
17791784 u32 rsvd;
@@ -1791,6 +1796,12 @@ struct be_cmd_enable_disable_vf { · 11 unmodified lines
17911796 u8 rsvd[3];
17921797 };
17931798
1799+struct be_cmd_req_intr_set {
1800+ struct be_cmd_req_hdr hdr;
1801+ u8 intr_enabled;
1802+ u8 rsvd[3];
1803+};
1804+
17941805 static inline bool check_privilege(struct be_adapter *adapter, u32 flags)
17951806 {
17961807 return flags & adapter->cmd_privileges ? true : false;
@@ -1834,8 +1845,7 @@ extern int be_cmd_mccq_create(struct be_adapter *adapter, · 37 unmodified lines
18341845 struct be_queue_info *mccq,
18351846 struct be_queue_info *cq);
18361847 extern int be_cmd_txq_create(struct be_adapter *adapter,
1837− struct be_queue_info *txq,
1838− struct be_queue_info *cq);
1848+ struct be_tx_obj *txo);
18391849 extern int be_cmd_rxq_create(struct be_adapter *adapter,
18401850 struct be_queue_info *rxq, u16 cq_id,
18411851 u16 frag_size, u32 if_id, u32 rss, u8 *rss_id);
@@ -1862,11 +1872,11 @@ extern int be_cmd_set_flow_control(struct be_adapter *adapter, · 20 unmodified lines
18621872 u32 tx_fc, u32 rx_fc);
18631873 extern int be_cmd_get_flow_control(struct be_adapter *adapter,
18641874 u32 *tx_fc, u32 *rx_fc);
1865−extern int be_cmd_query_fw_cfg(struct be_adapter *adapter,
1866− u32 *port_num, u32 *function_mode, u32 *function_caps);
1875+extern int be_cmd_query_fw_cfg(struct be_adapter *adapter, u32 *port_num,
1876+ u32 *function_mode, u32 *function_caps, u16 *asic_rev);
18671877 extern int be_cmd_reset_function(struct be_adapter *adapter);
18681878 extern int be_cmd_rss_config(struct be_adapter *adapter, u8 *rsstable,
1869− u16 table_size);
1879+ u32 rss_hash_opts, u16 table_size);
18701880 extern int be_process_mcc(struct be_adapter *adapter);
18711881 extern int be_cmd_set_beacon_state(struct be_adapter *adapter,
18721882 u8 port_num, u8 beacon, u8 status, u8 state);
@@ -1931,10 +1941,11 @@ extern int lancer_test_and_set_rdy_state(struct be_adapter *adapter); · 58 unmodified lines
19311941 extern int be_cmd_query_port_name(struct be_adapter *adapter, u8 *port_name);
19321942 extern int be_cmd_get_func_config(struct be_adapter *adapter);
19331943 extern int be_cmd_get_profile_config(struct be_adapter *adapter, u32 *cap_flags,
1934− u8 domain);
1944+ u16 *txq_count, u8 domain);
19351945
19361946 extern int be_cmd_set_profile_config(struct be_adapter *adapter, u32 bps,
19371947 u8 domain);
19381948 extern int be_cmd_get_if_id(struct be_adapter *adapter,
19391949 struct be_vf_cfg *vf_cfg, int vf_num);
19401950 extern int be_cmd_enable_vf(struct be_adapter *adapter, u8 domain);
1951+extern int be_cmd_intr_set(struct be_adapter *adapter, bool intr_enable);
drivers/net/ethernet/emulex/benet/be_ethtool.c+167−10
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (C) 2005 - 2011 Emulex
2+ * Copyright (C) 2005 - 2013 Emulex
33 * All rights reserved.
44 *
55 * This program is free software; you can redistribute it and/or
@@ -54,7 +54,7 @@ static const struct be_ethtool_stat et_stats[] = { · 48 unmodified lines
5454 /* Received packets dropped when they don't pass the unicast or
5555 * multicast address filtering.
5656 */
57− {DRVSTAT_INFO(rx_address_mismatch_drops)},
57+ {DRVSTAT_INFO(rx_address_filtered)},
5858 /* Received packets dropped when IP packet length field is less than
5959 * the IP header length field.
6060 */
@@ -680,7 +680,8 @@ be_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) · 619 unmodified lines
680680
681681 if (be_is_wol_supported(adapter)) {
682682 wol->supported |= WAKE_MAGIC;
683− wol->wolopts |= WAKE_MAGIC;
683+ if (adapter->wol)
684+ wol->wolopts |= WAKE_MAGIC;
684685 } else
685686 wol->wolopts = 0;
686687 memset(&wol->sopass, 0, sizeof(wol->sopass));
@@ -719,10 +720,8 @@ be_test_ddr_dma(struct be_adapter *adapter) · 32 unmodified lines
719720 ddrdma_cmd.size = sizeof(struct be_cmd_req_ddrdma_test);
720721 ddrdma_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, ddrdma_cmd.size,
721722 &ddrdma_cmd.dma, GFP_KERNEL);
722− if (!ddrdma_cmd.va) {
723− dev_err(&adapter->pdev->dev, "Memory allocation failure\n");
723+ if (!ddrdma_cmd.va)
724724 return -ENOMEM;
725− }
726725
727726 for (i = 0; i < 2; i++) {
728727 ret = be_cmd_ddr_dma_test(adapter, pattern[i],
@@ -757,6 +756,12 @@ be_self_test(struct net_device *netdev, struct ethtool_test *test, u64 *data) · 28 unmodified lines
757756 int status;
758757 u8 link_status = 0;
759758
759+ if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) {
760+ dev_err(&adapter->pdev->dev, "Self test not supported\n");
761+ test->flags |= ETH_TEST_FL_FAILED;
762+ return;
763+ }
764+
760765 memset(data, 0, sizeof(u64) * ETHTOOL_TESTS_NUM);
761766
762767 if (test->flags & ETH_TEST_FL_OFFLINE) {
@@ -845,11 +850,8 @@ be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, · 82 unmodified lines
845850 eeprom_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, eeprom_cmd.size,
846851 &eeprom_cmd.dma, GFP_KERNEL);
847852
848− if (!eeprom_cmd.va) {
849− dev_err(&adapter->pdev->dev,
850− "Memory allocation failure. Could not read eeprom\n");
853+ if (!eeprom_cmd.va)
851854 return -ENOMEM;
852− }
853855
854856 status = be_cmd_get_seeprom_data(adapter, &eeprom_cmd);
855857
@@ -939,6 +941,159 @@ static void be_set_msg_level(struct net_device *netdev, u32 level) · 83 unmodified lines
939941 return;
940942 }
941943
944+static u64 be_get_rss_hash_opts(struct be_adapter *adapter, u64 flow_type)
945+{
946+ u64 data = 0;
947+
948+ switch (flow_type) {
949+ case TCP_V4_FLOW:
950+ if (adapter->rss_flags & RSS_ENABLE_IPV4)
951+ data |= RXH_IP_DST | RXH_IP_SRC;
952+ if (adapter->rss_flags & RSS_ENABLE_TCP_IPV4)
953+ data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
954+ break;
955+ case UDP_V4_FLOW:
956+ if (adapter->rss_flags & RSS_ENABLE_IPV4)
957+ data |= RXH_IP_DST | RXH_IP_SRC;
958+ if (adapter->rss_flags & RSS_ENABLE_UDP_IPV4)
959+ data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
960+ break;
961+ case TCP_V6_FLOW:
962+ if (adapter->rss_flags & RSS_ENABLE_IPV6)
963+ data |= RXH_IP_DST | RXH_IP_SRC;
964+ if (adapter->rss_flags & RSS_ENABLE_TCP_IPV6)
965+ data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
966+ break;
967+ case UDP_V6_FLOW:
968+ if (adapter->rss_flags & RSS_ENABLE_IPV6)
969+ data |= RXH_IP_DST | RXH_IP_SRC;
970+ if (adapter->rss_flags & RSS_ENABLE_UDP_IPV6)
971+ data |= RXH_L4_B_0_1 | RXH_L4_B_2_3;
972+ break;
973+ }
974+
975+ return data;
976+}
977+
978+static int be_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd,
979+ u32 *rule_locs)
980+{
981+ struct be_adapter *adapter = netdev_priv(netdev);
982+
983+ if (!be_multi_rxq(adapter)) {
984+ dev_info(&adapter->pdev->dev,
985+ "ethtool::get_rxnfc: RX flow hashing is disabled\n");
986+ return -EINVAL;
987+ }
988+
989+ switch (cmd->cmd) {
990+ case ETHTOOL_GRXFH:
991+ cmd->data = be_get_rss_hash_opts(adapter, cmd->flow_type);
992+ break;
993+ case ETHTOOL_GRXRINGS:
994+ cmd->data = adapter->num_rx_qs - 1;
995+ break;
996+ default:
997+ return -EINVAL;
998+ }
999+
1000+ return 0;
1001+}
1002+
1003+static int be_set_rss_hash_opts(struct be_adapter *adapter,
1004+ struct ethtool_rxnfc *cmd)
1005+{
1006+ struct be_rx_obj *rxo;
1007+ int status = 0, i, j;
1008+ u8 rsstable[128];
1009+ u32 rss_flags = adapter->rss_flags;
1010+
1011+ if (cmd->data != L3_RSS_FLAGS &&
1012+ cmd->data != (L3_RSS_FLAGS | L4_RSS_FLAGS))
1013+ return -EINVAL;
1014+
1015+ switch (cmd->flow_type) {
1016+ case TCP_V4_FLOW:
1017+ if (cmd->data == L3_RSS_FLAGS)
1018+ rss_flags &= ~RSS_ENABLE_TCP_IPV4;
1019+ else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
1020+ rss_flags |= RSS_ENABLE_IPV4 |
1021+ RSS_ENABLE_TCP_IPV4;
1022+ break;
1023+ case TCP_V6_FLOW:
1024+ if (cmd->data == L3_RSS_FLAGS)
1025+ rss_flags &= ~RSS_ENABLE_TCP_IPV6;
1026+ else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
1027+ rss_flags |= RSS_ENABLE_IPV6 |
1028+ RSS_ENABLE_TCP_IPV6;
1029+ break;
1030+ case UDP_V4_FLOW:
1031+ if ((cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS)) &&
1032+ BEx_chip(adapter))
1033+ return -EINVAL;
1034+
1035+ if (cmd->data == L3_RSS_FLAGS)
1036+ rss_flags &= ~RSS_ENABLE_UDP_IPV4;
1037+ else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
1038+ rss_flags |= RSS_ENABLE_IPV4 |
1039+ RSS_ENABLE_UDP_IPV4;
1040+ break;
1041+ case UDP_V6_FLOW:
1042+ if ((cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS)) &&
1043+ BEx_chip(adapter))
1044+ return -EINVAL;
1045+
1046+ if (cmd->data == L3_RSS_FLAGS)
1047+ rss_flags &= ~RSS_ENABLE_UDP_IPV6;
1048+ else if (cmd->data == (L3_RSS_FLAGS | L4_RSS_FLAGS))
1049+ rss_flags |= RSS_ENABLE_IPV6 |
1050+ RSS_ENABLE_UDP_IPV6;
1051+ break;
1052+ default:
1053+ return -EINVAL;
1054+ }
1055+
1056+ if (rss_flags == adapter->rss_flags)
1057+ return status;
1058+
1059+ if (be_multi_rxq(adapter)) {
1060+ for (j = 0; j < 128; j += adapter->num_rx_qs - 1) {
1061+ for_all_rss_queues(adapter, rxo, i) {
1062+ if ((j + i) >= 128)
1063+ break;
1064+ rsstable[j + i] = rxo->rss_id;
1065+ }
1066+ }
1067+ }
1068+ status = be_cmd_rss_config(adapter, rsstable, rss_flags, 128);
1069+ if (!status)
1070+ adapter->rss_flags = rss_flags;
1071+
1072+ return status;
1073+}
1074+
1075+static int be_set_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *cmd)
1076+{
1077+ struct be_adapter *adapter = netdev_priv(netdev);
1078+ int status = 0;
1079+
1080+ if (!be_multi_rxq(adapter)) {
1081+ dev_err(&adapter->pdev->dev,
1082+ "ethtool::set_rxnfc: RX flow hashing is disabled\n");
1083+ return -EINVAL;
1084+ }
1085+
1086+ switch (cmd->cmd) {
1087+ case ETHTOOL_SRXFH:
1088+ status = be_set_rss_hash_opts(adapter, cmd);
1089+ break;
1090+ default:
1091+ return -EINVAL;
1092+ }
1093+
1094+ return status;
1095+}
1096+
9421097 const struct ethtool_ops be_ethtool_ops = {
9431098 .get_settings = be_get_settings,
9441099 .get_drvinfo = be_get_drvinfo,
@@ -962,4 +1117,6 @@ const struct ethtool_ops be_ethtool_ops = { · 17 unmodified lines
9621117 .get_regs = be_get_regs,
9631118 .flash_device = be_do_flash,
9641119 .self_test = be_self_test,
1120+ .get_rxnfc = be_get_rxnfc,
1121+ .set_rxnfc = be_set_rxnfc,
9651122 };
drivers/net/ethernet/emulex/benet/be_hw.h+7−2
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (C) 2005 - 2011 Emulex
2+ * Copyright (C) 2005 - 2013 Emulex
33 * All rights reserved.
44 *
55 * This program is free software; you can redistribute it and/or
@@ -72,6 +72,10 @@ · 66 unmodified lines
7272 */
7373 #define MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK (1 << 29) /* bit 29 */
7474
75+/********* PCI Function Capability *********/
76+#define BE_FUNCTION_CAPS_RSS 0x2
77+#define BE_FUNCTION_CAPS_SUPER_NIC 0x40
78+
7579 /********* Power management (WOL) **********/
7680 #define PCICFG_PM_CONTROL_OFFSET 0x44
7781 #define PCICFG_PM_CONTROL_MASK 0x108 /* bits 3 & 8 */
@@ -495,7 +499,8 @@ struct flash_file_hdr_g3 { · 417 unmodified lines
495499 u32 antidote;
496500 u32 num_imgs;
497501 u8 build[24];
498− u8 rsvd[32];
502+ u8 asic_type_rev;
503+ u8 rsvd[31];
499504 };
500505
501506 struct flash_section_hdr {
drivers/net/ethernet/emulex/benet/be_main.c+218−89
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (C) 2005 - 2011 Emulex
2+ * Copyright (C) 2005 - 2013 Emulex
33 * All rights reserved.
44 *
55 * This program is free software; you can redistribute it and/or
@@ -146,20 +146,16 @@ static int be_queue_alloc(struct be_adapter *adapter, struct be_queue_info *q, · 140 unmodified lines
146146 q->entry_size = entry_size;
147147 mem->size = len * entry_size;
148148 mem->va = dma_alloc_coherent(&adapter->pdev->dev, mem->size, &mem->dma,
149− GFP_KERNEL);
149+ GFP_KERNEL | __GFP_ZERO);
150150 if (!mem->va)
151151 return -ENOMEM;
152− memset(mem->va, 0, mem->size);
153152 return 0;
154153 }
155154
156−static void be_intr_set(struct be_adapter *adapter, bool enable)
155+static void be_reg_intr_set(struct be_adapter *adapter, bool enable)
157156 {
158157 u32 reg, enabled;
159158
160− if (adapter->eeh_error)
161− return;
162−
163159 pci_read_config_dword(adapter->pdev, PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET,
164160 &reg);
165161 enabled = reg & MEMBAR_CTRL_INT_CTRL_HOSTINTR_MASK;
@@ -175,6 +171,22 @@ static void be_intr_set(struct be_adapter *adapter, bool enable) · 9 unmodified lines
175171 PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET, reg);
176172 }
177173
174+static void be_intr_set(struct be_adapter *adapter, bool enable)
175+{
176+ int status = 0;
177+
178+ /* On lancer interrupts can't be controlled via this register */
179+ if (lancer_chip(adapter))
180+ return;
181+
182+ if (adapter->eeh_error)
183+ return;
184+
185+ status = be_cmd_intr_set(adapter, enable);
186+ if (status)
187+ be_reg_intr_set(adapter, enable);
188+}
189+
178190 static void be_rxq_notify(struct be_adapter *adapter, u16 qid, u16 posted)
179191 {
180192 u32 val = 0;
@@ -185,14 +197,15 @@ static void be_rxq_notify(struct be_adapter *adapter, u16 qid, u16 posted) · 4 unmodified lines
185197 iowrite32(val, adapter->db + DB_RQ_OFFSET);
186198 }
187199
188−static void be_txq_notify(struct be_adapter *adapter, u16 qid, u16 posted)
200+static void be_txq_notify(struct be_adapter *adapter, struct be_tx_obj *txo,
201+ u16 posted)
189202 {
190203 u32 val = 0;
191− val |= qid & DB_TXULP_RING_ID_MASK;
204+ val |= txo->q.id & DB_TXULP_RING_ID_MASK;
192205 val |= (posted & DB_TXULP_NUM_POSTED_MASK) << DB_TXULP_NUM_POSTED_SHIFT;
193206
194207 wmb();
195− iowrite32(val, adapter->db + DB_TXULP1_OFFSET);
208+ iowrite32(val, adapter->db + txo->db_offset);
196209 }
197210
198211 static void be_eq_notify(struct be_adapter *adapter, u16 qid,
@@ -340,9 +353,9 @@ static void populate_be_v0_stats(struct be_adapter *adapter) · 141 unmodified lines
340353 drvs->rx_input_fifo_overflow_drop = port_stats->rx_input_fifo_overflow;
341354 drvs->rx_dropped_header_too_small =
342355 port_stats->rx_dropped_header_too_small;
343− drvs->rx_address_mismatch_drops =
344− port_stats->rx_address_mismatch_drops +
345− port_stats->rx_vlan_mismatch_drops;
356+ drvs->rx_address_filtered =
357+ port_stats->rx_address_filtered +
358+ port_stats->rx_vlan_filtered;
346359 drvs->rx_alignment_symbol_errors =
347360 port_stats->rx_alignment_symbol_errors;
348361
@@ -391,7 +404,7 @@ static void populate_be_v1_stats(struct be_adapter *adapter) · 42 unmodified lines
391404 port_stats->rx_dropped_header_too_small;
392405 drvs->rx_input_fifo_overflow_drop =
393406 port_stats->rx_input_fifo_overflow_drop;
394− drvs->rx_address_mismatch_drops = port_stats->rx_address_mismatch_drops;
407+ drvs->rx_address_filtered = port_stats->rx_address_filtered;
395408 drvs->rx_alignment_symbol_errors =
396409 port_stats->rx_alignment_symbol_errors;
397410 drvs->rxpp_fifo_overflow_drop = port_stats->rxpp_fifo_overflow_drop;
@@ -432,9 +445,9 @@ static void populate_lancer_stats(struct be_adapter *adapter) · 34 unmodified lines
432445 drvs->rx_dropped_header_too_small =
433446 pport_stats->rx_dropped_header_too_small;
434447 drvs->rx_input_fifo_overflow_drop = pport_stats->rx_fifo_overflow;
435− drvs->rx_address_mismatch_drops =
436− pport_stats->rx_address_mismatch_drops +
437− pport_stats->rx_vlan_mismatch_drops;
448+ drvs->rx_address_filtered =
449+ pport_stats->rx_address_filtered +
450+ pport_stats->rx_vlan_filtered;
438451 drvs->rx_alignment_symbol_errors = pport_stats->rx_symbol_errors_lo;
439452 drvs->rxpp_fifo_overflow_drop = pport_stats->rx_fifo_overflow;
440453 drvs->tx_pauseframes = pport_stats->tx_pause_frames_lo;
@@ -626,13 +639,8 @@ static inline u16 be_get_tx_vlan_tag(struct be_adapter *adapter, · 185 unmodified lines
626639 return vlan_tag;
627640 }
628641
629−static int be_vlan_tag_chk(struct be_adapter *adapter, struct sk_buff *skb)
630−{
631− return vlan_tx_tag_present(skb) || adapter->pvid;
632−}
633−
634642 static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr,
635− struct sk_buff *skb, u32 wrb_cnt, u32 len)
643+ struct sk_buff *skb, u32 wrb_cnt, u32 len, bool skip_hw_vlan)
636644 {
637645 u16 vlan_tag;
638646
@@ -659,8 +667,9 @@ static void wrb_fill_hdr(struct be_adapter *adapter, struct be_eth_hdr_wrb *hdr, · 20 unmodified lines
659667 AMAP_SET_BITS(struct amap_eth_hdr_wrb, vlan_tag, hdr, vlan_tag);
660668 }
661669
670+ /* To skip HW VLAN tagging: evt = 1, compl = 0 */
671+ AMAP_SET_BITS(struct amap_eth_hdr_wrb, complete, hdr, !skip_hw_vlan);
662672 AMAP_SET_BITS(struct amap_eth_hdr_wrb, event, hdr, 1);
663− AMAP_SET_BITS(struct amap_eth_hdr_wrb, complete, hdr, 1);
664673 AMAP_SET_BITS(struct amap_eth_hdr_wrb, num_wrb, hdr, wrb_cnt);
665674 AMAP_SET_BITS(struct amap_eth_hdr_wrb, len, hdr, len);
666675 }
@@ -683,7 +692,8 @@ static void unmap_tx_frag(struct device *dev, struct be_eth_wrb *wrb, · 16 unmodified lines
683692 }
684693
685694 static int make_tx_wrbs(struct be_adapter *adapter, struct be_queue_info *txq,
686− struct sk_buff *skb, u32 wrb_cnt, bool dummy_wrb)
695+ struct sk_buff *skb, u32 wrb_cnt, bool dummy_wrb,
696+ bool skip_hw_vlan)
687697 {
688698 dma_addr_t busaddr;
689699 int i, copied = 0;
@@ -732,7 +742,7 @@ static int make_tx_wrbs(struct be_adapter *adapter, struct be_queue_info *txq, · 42 unmodified lines
732742 queue_head_inc(txq);
733743 }
734744
735− wrb_fill_hdr(adapter, hdr, first_skb, wrb_cnt, copied);
745+ wrb_fill_hdr(adapter, hdr, first_skb, wrb_cnt, copied, skip_hw_vlan);
736746 be_dws_cpu_to_le(hdr, sizeof(*hdr));
737747
738748 return copied;
@@ -749,7 +759,8 @@ dma_err: · 10 unmodified lines
749759 }
750760
751761 static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter,
752− struct sk_buff *skb)
762+ struct sk_buff *skb,
763+ bool *skip_hw_vlan)
753764 {
754765 u16 vlan_tag = 0;
755766
@@ -759,14 +770,72 @@ static struct sk_buff *be_insert_vlan_in_pkt(struct be_adapter *adapter, · 3 unmodified lines
759770
760771 if (vlan_tx_tag_present(skb)) {
761772 vlan_tag = be_get_tx_vlan_tag(adapter, skb);
762− skb = __vlan_put_tag(skb, vlan_tag);
773+ skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
763774 if (skb)
764775 skb->vlan_tci = 0;
765776 }
766777
778+ if (qnq_async_evt_rcvd(adapter) && adapter->pvid) {
779+ if (!vlan_tag)
780+ vlan_tag = adapter->pvid;
781+ if (skip_hw_vlan)
782+ *skip_hw_vlan = true;
783+ }
784+
785+ if (vlan_tag) {
786+ skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
787+ if (unlikely(!skb))
788+ return skb;
789+
790+ skb->vlan_tci = 0;
791+ }
792+
793+ /* Insert the outer VLAN, if any */
794+ if (adapter->qnq_vid) {
795+ vlan_tag = adapter->qnq_vid;
796+ skb = __vlan_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
797+ if (unlikely(!skb))
798+ return skb;
799+ if (skip_hw_vlan)
800+ *skip_hw_vlan = true;
801+ }
802+
767803 return skb;
768804 }
769805
806+static bool be_ipv6_exthdr_check(struct sk_buff *skb)
807+{
808+ struct ethhdr *eh = (struct ethhdr *)skb->data;
809+ u16 offset = ETH_HLEN;
810+
811+ if (eh->h_proto == htons(ETH_P_IPV6)) {
812+ struct ipv6hdr *ip6h = (struct ipv6hdr *)(skb->data + offset);
813+
814+ offset += sizeof(struct ipv6hdr);
815+ if (ip6h->nexthdr != NEXTHDR_TCP &&
816+ ip6h->nexthdr != NEXTHDR_UDP) {
817+ struct ipv6_opt_hdr *ehdr =
818+ (struct ipv6_opt_hdr *) (skb->data + offset);
819+
820+ /* offending pkt: 2nd byte following IPv6 hdr is 0xff */
821+ if (ehdr->hdrlen == 0xff)
822+ return true;
823+ }
824+ }
825+ return false;
826+}
827+
828+static int be_vlan_tag_tx_chk(struct be_adapter *adapter, struct sk_buff *skb)
829+{
830+ return vlan_tx_tag_present(skb) || adapter->pvid || adapter->qnq_vid;
831+}
832+
833+static int be_ipv6_tx_stall_chk(struct be_adapter *adapter, struct sk_buff *skb)
834+{
835+ return BE3_chip(adapter) &&
836+ be_ipv6_exthdr_check(skb);
837+}
838+
770839 static netdev_tx_t be_xmit(struct sk_buff *skb,
771840 struct net_device *netdev)
772841 {
@@ -777,33 +846,64 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, · 4 unmodified lines
777846 u32 wrb_cnt = 0, copied = 0;
778847 u32 start = txq->head, eth_hdr_len;
779848 bool dummy_wrb, stopped = false;
849+ bool skip_hw_vlan = false;
850+ struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
780851
781852 eth_hdr_len = ntohs(skb->protocol) == ETH_P_8021Q ?
782853 VLAN_ETH_HLEN : ETH_HLEN;
783854
784− /* HW has a bug which considers padding bytes as legal
785− * and modifies the IPv4 hdr's 'tot_len' field
855+ /* For padded packets, BE HW modifies tot_len field in IP header
856+ * incorrecly when VLAN tag is inserted by HW.
786857 */
787− if (skb->len <= 60 && be_vlan_tag_chk(adapter, skb) &&
788− is_ipv4_pkt(skb)) {
858+ if (skb->len <= 60 && vlan_tx_tag_present(skb) && is_ipv4_pkt(skb)) {
789859 ip = (struct iphdr *)ip_hdr(skb);
790860 pskb_trim(skb, eth_hdr_len + ntohs(ip->tot_len));
791861 }
792862
863+ /* If vlan tag is already inlined in the packet, skip HW VLAN
864+ * tagging in UMC mode
865+ */
866+ if ((adapter->function_mode & UMC_ENABLED) &&
867+ veh->h_vlan_proto == htons(ETH_P_8021Q))
868+ skip_hw_vlan = true;
869+
793870 /* HW has a bug wherein it will calculate CSUM for VLAN
794871 * pkts even though it is disabled.
795872 * Manually insert VLAN in pkt.
796873 */
797874 if (skb->ip_summed != CHECKSUM_PARTIAL &&
798− be_vlan_tag_chk(adapter, skb)) {
799− skb = be_insert_vlan_in_pkt(adapter, skb);
875+ vlan_tx_tag_present(skb)) {
876+ skb = be_insert_vlan_in_pkt(adapter, skb, &skip_hw_vlan);
877+ if (unlikely(!skb))
878+ goto tx_drop;
879+ }
880+
881+ /* HW may lockup when VLAN HW tagging is requested on
882+ * certain ipv6 packets. Drop such pkts if the HW workaround to
883+ * skip HW tagging is not enabled by FW.
884+ */
885+ if (unlikely(be_ipv6_tx_stall_chk(adapter, skb) &&
886+ (adapter->pvid || adapter->qnq_vid) &&
887+ !qnq_async_evt_rcvd(adapter)))
888+ goto tx_drop;
889+
890+ /* Manual VLAN tag insertion to prevent:
891+ * ASIC lockup when the ASIC inserts VLAN tag into
892+ * certain ipv6 packets. Insert VLAN tags in driver,
893+ * and set event, completion, vlan bits accordingly
894+ * in the Tx WRB.
895+ */
896+ if (be_ipv6_tx_stall_chk(adapter, skb) &&
897+ be_vlan_tag_tx_chk(adapter, skb)) {
898+ skb = be_insert_vlan_in_pkt(adapter, skb, &skip_hw_vlan);
800899 if (unlikely(!skb))
801900 goto tx_drop;
802901 }
803902
804903 wrb_cnt = wrb_cnt_for_skb(adapter, skb, &dummy_wrb);
805904
806− copied = make_tx_wrbs(adapter, txq, skb, wrb_cnt, dummy_wrb);
905+ copied = make_tx_wrbs(adapter, txq, skb, wrb_cnt, dummy_wrb,
906+ skip_hw_vlan);
807907 if (copied) {
808908 int gso_segs = skb_shinfo(skb)->gso_segs;
809909
@@ -822,7 +922,7 @@ static netdev_tx_t be_xmit(struct sk_buff *skb, · 12 unmodified lines
822922 stopped = true;
823923 }
824924
825− be_txq_notify(adapter, txq->id, wrb_cnt);
925+ be_txq_notify(adapter, txo, wrb_cnt);
826926
827927 be_tx_stats_update(txo, wrb_cnt, copied, gso_segs, stopped);
828928 } else {
@@ -891,7 +991,7 @@ set_vlan_promisc: · 62 unmodified lines
891991 return status;
892992 }
893993
894−static int be_vlan_add_vid(struct net_device *netdev, u16 vid)
994+static int be_vlan_add_vid(struct net_device *netdev, __be16 proto, u16 vid)
895995 {
896996 struct be_adapter *adapter = netdev_priv(netdev);
897997 int status = 0;
@@ -917,7 +1017,7 @@ ret: · 19 unmodified lines
9171017 return status;
9181018 }
9191019
920−static int be_vlan_rem_vid(struct net_device *netdev, u16 vid)
1020+static int be_vlan_rem_vid(struct net_device *netdev, __be16 proto, u16 vid)
9211021 {
9221022 struct be_adapter *adapter = netdev_priv(netdev);
9231023 int status = 0;
@@ -1372,7 +1472,7 @@ static void be_rx_compl_process(struct be_rx_obj *rxo, · 448 unmodified lines
13721472
13731473
13741474 if (rxcp->vlanf)
1375− __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag);
1475+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), rxcp->vlan_tag);
13761476
13771477 netif_receive_skb(skb);
13781478 }
@@ -1428,7 +1528,7 @@ void be_rx_compl_process_gro(struct be_rx_obj *rxo, struct napi_struct *napi, · 49 unmodified lines
14281528 skb->rxhash = rxcp->rss_hash;
14291529
14301530 if (rxcp->vlanf)
1431− __vlan_hwaccel_put_tag(skb, rxcp->vlan_tag);
1531+ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), rxcp->vlan_tag);
14321532
14331533 napi_gro_frags(napi);
14341534 }
@@ -1958,7 +2058,7 @@ static int be_tx_qs_create(struct be_adapter *adapter) · 523 unmodified lines
19582058 if (status)
19592059 return status;
19602060
1961− status = be_cmd_txq_create(adapter, &txo->q, &txo->cq);
2061+ status = be_cmd_txq_create(adapter, txo);
19622062 if (status)
19632063 return status;
19642064 }
@@ -2436,9 +2536,6 @@ static int be_close(struct net_device *netdev) · 471 unmodified lines
24362536
24372537 be_roce_dev_close(adapter);
24382538
2439− if (!lancer_chip(adapter))
2440− be_intr_set(adapter, false);
2441−
24422539 for_all_evt_queues(adapter, eqo, i)
24432540 napi_disable(&eqo->napi);
24442541
@@ -2500,9 +2597,19 @@ static int be_rx_qs_create(struct be_adapter *adapter) · 55 unmodified lines
25002597 rsstable[j + i] = rxo->rss_id;
25012598 }
25022599 }
2503− rc = be_cmd_rss_config(adapter, rsstable, 128);
2504− if (rc)
2600+ adapter->rss_flags = RSS_ENABLE_TCP_IPV4 | RSS_ENABLE_IPV4 |
2601+ RSS_ENABLE_TCP_IPV6 | RSS_ENABLE_IPV6;
2602+
2603+ if (!BEx_chip(adapter))
2604+ adapter->rss_flags |= RSS_ENABLE_UDP_IPV4 |
2605+ RSS_ENABLE_UDP_IPV6;
2606+
2607+ rc = be_cmd_rss_config(adapter, rsstable, adapter->rss_flags,
2608+ 128);
2609+ if (rc) {
2610+ adapter->rss_flags = 0;
25052611 return rc;
2612+ }
25062613 }
25072614
25082615 /* First time posting */
@@ -2526,9 +2633,6 @@ static int be_open(struct net_device *netdev) · 17 unmodified lines
25262633
25272634 be_irq_register(adapter);
25282635
2529− if (!lancer_chip(adapter))
2530− be_intr_set(adapter, true);
2531−
25322636 for_all_rx_queues(adapter, rxo, i)
25332637 be_cq_notify(adapter, rxo->cq.id, true, 0);
25342638
@@ -2563,10 +2667,9 @@ static int be_setup_wol(struct be_adapter *adapter, bool enable) · 28 unmodified lines
25632667
25642668 cmd.size = sizeof(struct be_cmd_req_acpi_wol_magic_config);
25652669 cmd.va = dma_alloc_coherent(&adapter->pdev->dev, cmd.size, &cmd.dma,
2566− GFP_KERNEL);
2670+ GFP_KERNEL | __GFP_ZERO);
25672671 if (cmd.va == NULL)
25682672 return -1;
2569− memset(cmd.va, 0, cmd.size);
25702673
25712674 if (enable) {
25722675 status = pci_write_config_dword(adapter->pdev,
@@ -2714,7 +2817,8 @@ static int be_vfs_if_create(struct be_adapter *adapter) · 141 unmodified lines
27142817
27152818 for_all_vfs(adapter, vf_cfg, vf) {
27162819 if (!BE3_chip(adapter))
2717− be_cmd_get_profile_config(adapter, &cap_flags, vf + 1);
2820+ be_cmd_get_profile_config(adapter, &cap_flags,
2821+ NULL, vf + 1);
27182822
27192823 /* If a FW profile exists, then cap_flags are updated */
27202824 en_flags = cap_flags & (BE_IF_FLAGS_UNTAGGED |
@@ -2878,11 +2982,14 @@ static void be_get_resources(struct be_adapter *adapter) · 157 unmodified lines
28782982 u16 dev_num_vfs;
28792983 int pos, status;
28802984 bool profile_present = false;
2985+ u16 txq_count = 0;
28812986
28822987 if (!BEx_chip(adapter)) {
28832988 status = be_cmd_get_func_config(adapter);
28842989 if (!status)
28852990 profile_present = true;
2991+ } else if (BE3_chip(adapter) && be_physfn(adapter)) {
2992+ be_cmd_get_profile_config(adapter, NULL, &txq_count, 0);
28862993 }
28872994
28882995 if (profile_present) {
@@ -2920,7 +3027,9 @@ static void be_get_resources(struct be_adapter *adapter) · 31 unmodified lines
29203027 adapter->max_vlans = BE_NUM_VLANS_SUPPORTED;
29213028
29223029 adapter->max_mcast_mac = BE_MAX_MC;
2923− adapter->max_tx_queues = MAX_TX_QS;
3030+ adapter->max_tx_queues = txq_count ? txq_count : MAX_TX_QS;
3031+ adapter->max_tx_queues = min_t(u16, adapter->max_tx_queues,
3032+ MAX_TX_QS);
29243033 adapter->max_rss_queues = (adapter->be3_native) ?
29253034 BE3_MAX_RSS_QS : BE2_MAX_RSS_QS;
29263035 adapter->max_event_queues = BE3_MAX_RSS_QS;
@@ -2954,7 +3063,8 @@ static int be_get_config(struct be_adapter *adapter) · 27 unmodified lines
29543063
29553064 status = be_cmd_query_fw_cfg(adapter, &adapter->port_num,
29563065 &adapter->function_mode,
2957− &adapter->function_caps);
3066+ &adapter->function_caps,
3067+ &adapter->asic_rev);
29583068 if (status)
29593069 goto err;
29603070
@@ -3215,7 +3325,7 @@ static int be_flash(struct be_adapter *adapter, const u8 *img, · 254 unmodified lines
32153325 return 0;
32163326 }
32173327
3218−/* For BE2 and BE3 */
3328+/* For BE2, BE3 and BE3-R */
32193329 static int be_flash_BEx(struct be_adapter *adapter,
32203330 const struct firmware *fw,
32213331 struct be_dma_mem *flash_cmd,
@@ -3458,11 +3568,9 @@ static int lancer_fw_download(struct be_adapter *adapter, · 236 unmodified lines
34583568 flash_cmd.size = sizeof(struct lancer_cmd_req_write_object)
34593569 + LANCER_FW_DOWNLOAD_CHUNK;
34603570 flash_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, flash_cmd.size,
3461− &flash_cmd.dma, GFP_KERNEL);
3571+ &flash_cmd.dma, GFP_KERNEL);
34623572 if (!flash_cmd.va) {
34633573 status = -ENOMEM;
3464− dev_err(&adapter->pdev->dev,
3465− "Memory allocation failure while flashing\n");
34663574 goto lancer_fw_exit;
34673575 }
34683576
@@ -3530,18 +3638,22 @@ lancer_fw_exit: · 61 unmodified lines
35303638
35313639 #define UFI_TYPE2 2
35323640 #define UFI_TYPE3 3
3641+#define UFI_TYPE3R 10
35333642 #define UFI_TYPE4 4
35343643 static int be_get_ufi_type(struct be_adapter *adapter,
3535− struct flash_file_hdr_g2 *fhdr)
3644+ struct flash_file_hdr_g3 *fhdr)
35363645 {
35373646 if (fhdr == NULL)
35383647 goto be_get_ufi_exit;
35393648
35403649 if (skyhawk_chip(adapter) && fhdr->build[0] == '4')
35413650 return UFI_TYPE4;
3542− else if (BE3_chip(adapter) && fhdr->build[0] == '3')
3543− return UFI_TYPE3;
3544− else if (BE2_chip(adapter) && fhdr->build[0] == '2')
3651+ else if (BE3_chip(adapter) && fhdr->build[0] == '3') {
3652+ if (fhdr->asic_type_rev == 0x10)
3653+ return UFI_TYPE3R;
3654+ else
3655+ return UFI_TYPE3;
3656+ } else if (BE2_chip(adapter) && fhdr->build[0] == '2')
35453657 return UFI_TYPE2;
35463658
35473659 be_get_ufi_exit:
@@ -3552,7 +3664,6 @@ be_get_ufi_exit: · 4 unmodified lines
35523664
35533665 static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw)
35543666 {
3555− struct flash_file_hdr_g2 *fhdr;
35563667 struct flash_file_hdr_g3 *fhdr3;
35573668 struct image_hdr *img_hdr_ptr = NULL;
35583669 struct be_dma_mem flash_cmd;
@@ -3564,29 +3675,41 @@ static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw) · 5 unmodified lines
35643675 &flash_cmd.dma, GFP_KERNEL);
35653676 if (!flash_cmd.va) {
35663677 status = -ENOMEM;
3567− dev_err(&adapter->pdev->dev,
3568− "Memory allocation failure while flashing\n");
35693678 goto be_fw_exit;
35703679 }
35713680
35723681 p = fw->data;
3573− fhdr = (struct flash_file_hdr_g2 *)p;
3682+ fhdr3 = (struct flash_file_hdr_g3 *)p;
35743683
3575− ufi_type = be_get_ufi_type(adapter, fhdr);
3684+ ufi_type = be_get_ufi_type(adapter, fhdr3);
35763685
3577− fhdr3 = (struct flash_file_hdr_g3 *)fw->data;
35783686 num_imgs = le32_to_cpu(fhdr3->num_imgs);
35793687 for (i = 0; i < num_imgs; i++) {
35803688 img_hdr_ptr = (struct image_hdr *)(fw->data +
35813689 (sizeof(struct flash_file_hdr_g3) +
35823690 i * sizeof(struct image_hdr)));
35833691 if (le32_to_cpu(img_hdr_ptr->imageid) == 1) {
3584− if (ufi_type == UFI_TYPE4)
3692+ switch (ufi_type) {
3693+ case UFI_TYPE4:
35853694 status = be_flash_skyhawk(adapter, fw,
35863695 &flash_cmd, num_imgs);
3587− else if (ufi_type == UFI_TYPE3)
3696+ break;
3697+ case UFI_TYPE3R:
35883698 status = be_flash_BEx(adapter, fw, &flash_cmd,
35893699 num_imgs);
3700+ break;
3701+ case UFI_TYPE3:
3702+ /* Do not flash this ufi on BE3-R cards */
3703+ if (adapter->asic_rev < 0x10)
3704+ status = be_flash_BEx(adapter, fw,
3705+ &flash_cmd,
3706+ num_imgs);
3707+ else {
3708+ status = -1;
3709+ dev_err(&adapter->pdev->dev,
3710+ "Can't load BE3 UFI on BE3R\n");
3711+ }
3712+ }
35903713 }
35913714 }
35923715
@@ -3663,12 +3786,12 @@ static void be_netdev_init(struct net_device *netdev) · 70 unmodified lines
36633786
36643787 netdev->hw_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 |
36653788 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_RXCSUM |
3666− NETIF_F_HW_VLAN_TX;
3789+ NETIF_F_HW_VLAN_CTAG_TX;
36673790 if (be_multi_rxq(adapter))
36683791 netdev->hw_features |= NETIF_F_RXHASH;
36693792
36703793 netdev->features |= netdev->hw_features |
3671− NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
3794+ NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER;
36723795
36733796 netdev->vlan_features |= NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 |
36743797 NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
@@ -3792,12 +3915,13 @@ static int be_ctrl_init(struct be_adapter *adapter) · 117 unmodified lines
37923915
37933916 rx_filter->size = sizeof(struct be_cmd_req_rx_filter);
37943917 rx_filter->va = dma_alloc_coherent(&adapter->pdev->dev, rx_filter->size,
3795− &rx_filter->dma, GFP_KERNEL);
3918+ &rx_filter->dma,
3919+ GFP_KERNEL | __GFP_ZERO);
37963920 if (rx_filter->va == NULL) {
37973921 status = -ENOMEM;
37983922 goto free_mbox;
37993923 }
3800− memset(rx_filter->va, 0, rx_filter->size);
3924+
38013925 mutex_init(&adapter->mbox_lock);
38023926 spin_lock_init(&adapter->mcc_lock);
38033927 spin_lock_init(&adapter->mcc_cq_lock);
@@ -3839,10 +3963,9 @@ static int be_stats_init(struct be_adapter *adapter) · 35 unmodified lines
38393963 cmd->size = sizeof(struct be_cmd_req_get_stats_v1);
38403964
38413965 cmd->va = dma_alloc_coherent(&adapter->pdev->dev, cmd->size, &cmd->dma,
3842− GFP_KERNEL);
3966+ GFP_KERNEL | __GFP_ZERO);
38433967 if (cmd->va == NULL)
38443968 return -1;
3845− memset(cmd->va, 0, cmd->size);
38463969 return 0;
38473970 }
38483971
@@ -3854,6 +3977,7 @@ static void be_remove(struct pci_dev *pdev) · 5 unmodified lines
38543977 return;
38553978
38563979 be_roce_dev_remove(adapter);
3980+ be_intr_set(adapter, false);
38573981
38583982 cancel_delayed_work_sync(&adapter->func_recovery_work);
38593983
@@ -4108,6 +4232,11 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id) · 248 unmodified lines
41084232
41094233 status = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
41104234 if (!status) {
4235+ status = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64));
4236+ if (status < 0) {
4237+ dev_err(&pdev->dev, "dma_set_coherent_mask failed\n");
4238+ goto free_netdev;
4239+ }
41114240 netdev->features |= NETIF_F_HIGHDMA;
41124241 } else {
41134242 status = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
@@ -4132,22 +4261,22 @@ static int be_probe(struct pci_dev *pdev, const struct pci_device_id *pdev_id) · 18 unmodified lines
41324261 goto ctrl_clean;
41334262 }
41344263
4135− /* tell fw we're ready to fire cmds */
4136− status = be_cmd_fw_init(adapter);
4137− if (status)
4138− goto ctrl_clean;
4139−
41404264 if (be_reset_required(adapter)) {
41414265 status = be_cmd_reset_function(adapter);
41424266 if (status)
41434267 goto ctrl_clean;
4268+
4269+ /* Wait for interrupts to quiesce after an FLR */
4270+ msleep(100);
41444271 }
41454272
4146− /* The INTR bit may be set in the card when probed by a kdump kernel
4147− * after a crash.
4148− */
4149− if (!lancer_chip(adapter))
4150− be_intr_set(adapter, false);
4273+ /* Allow interrupts for other ULPs running on NIC function */
4274+ be_intr_set(adapter, true);
4275+
4276+ /* tell fw we're ready to fire cmds */
4277+ status = be_cmd_fw_init(adapter);
4278+ if (status)
4279+ goto ctrl_clean;
41514280
41524281 status = be_stats_init(adapter);
41534282 if (status)
@@ -4358,12 +4487,12 @@ static void be_eeh_resume(struct pci_dev *pdev) · 204 unmodified lines
43584487
43594488 pci_save_state(pdev);
43604489
4361− /* tell fw we're ready to fire cmds */
4362− status = be_cmd_fw_init(adapter);
4490+ status = be_cmd_reset_function(adapter);
43634491 if (status)
43644492 goto err;
43654493
4366− status = be_cmd_reset_function(adapter);
4494+ /* tell fw we're ready to fire cmds */
4495+ status = be_cmd_fw_init(adapter);
43674496 if (status)
43684497 goto err;
43694498
drivers/net/ethernet/emulex/benet/be_roce.c+1−1
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (C) 2005 - 2011 Emulex
2+ * Copyright (C) 2005 - 2013 Emulex
33 * All rights reserved.
44 *
55 * This program is free software; you can redistribute it and/or
drivers/net/ethernet/emulex/benet/be_roce.h+1−1
@@ -1,5 +1,5 @@
11 /*
2− * Copyright (C) 2005 - 2011 Emulex
2+ * Copyright (C) 2005 - 2013 Emulex
33 * All rights reserved.
44 *
55 * This program is free software; you can redistribute it and/or
drivers/net/ethernet/faraday/ftgmac100.c+3−19
@@ -780,12 +780,11 @@ static int ftgmac100_alloc_buffers(struct ftgmac100 *priv) · 779 unmodified lines
780780
781781 priv->descs = dma_alloc_coherent(priv->dev,
782782 sizeof(struct ftgmac100_descs),
783− &priv->descs_dma_addr, GFP_KERNEL);
783+ &priv->descs_dma_addr,
784+ GFP_KERNEL | __GFP_ZERO);
784785 if (!priv->descs)
785786 return -ENOMEM;
786787
787− memset(priv->descs, 0, sizeof(struct ftgmac100_descs));
788−
789788 /* initialize RX ring */
790789 ftgmac100_rxdes_set_end_of_ring(&priv->descs->rxdes[RX_QUEUE_ENTRIES - 1]);
791790
@@ -1350,22 +1349,7 @@ static struct platform_driver ftgmac100_driver = { · 558 unmodified lines
13501349 },
13511350 };
13521351
1353−/******************************************************************************
1354− * initialization / finalization
1355− *****************************************************************************/
1356−static int __init ftgmac100_init(void)
1357−{
1358− pr_info("Loading version " DRV_VERSION " ...\n");
1359− return platform_driver_register(&ftgmac100_driver);
1360−}
1361−
1362−static void __exit ftgmac100_exit(void)
1363−{
1364− platform_driver_unregister(&ftgmac100_driver);
1365−}
1366−
1367−module_init(ftgmac100_init);
1368−module_exit(ftgmac100_exit);
1352+module_platform_driver(ftgmac100_driver);
13691353
13701354 MODULE_AUTHOR("Po-Yu Chuang <ratbert@faraday-tech.com>");
13711355 MODULE_DESCRIPTION("FTGMAC100 driver");
drivers/net/ethernet/faraday/ftmac100.c+4−4
@@ -732,13 +732,13 @@ static int ftmac100_alloc_buffers(struct ftmac100 *priv) · 731 unmodified lines
732732 {
733733 int i;
734734
735− priv->descs = dma_alloc_coherent(priv->dev, sizeof(struct ftmac100_descs),
736− &priv->descs_dma_addr, GFP_KERNEL);
735+ priv->descs = dma_alloc_coherent(priv->dev,
736+ sizeof(struct ftmac100_descs),
737+ &priv->descs_dma_addr,
738+ GFP_KERNEL | __GFP_ZERO);
737739 if (!priv->descs)
738740 return -ENOMEM;
739741
740− memset(priv->descs, 0, sizeof(struct ftmac100_descs));
741−
742742 /* initialize RX ring */
743743 ftmac100_rxdes_set_end_of_ring(&priv->descs->rxdes[RX_QUEUE_ENTRIES - 1]);
744744
drivers/net/ethernet/freescale/Makefile+2−1
@@ -2,7 +2,8 @@ · 1 unmodified line
22 # Makefile for the Freescale network device drivers.
33 #
44
5−obj-$(CONFIG_FEC) += fec.o fec_ptp.o
5+obj-$(CONFIG_FEC) += fec.o
6+fec-objs :=fec_main.o fec_ptp.o
67 obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx.o
78 ifeq ($(CONFIG_FEC_MPC52xx_MDIO),y)
89 obj-$(CONFIG_FEC_MPC52xx) += fec_mpc52xx_phy.o
drivers/net/ethernet/freescale/fec.h+9−1
@@ -52,6 +52,7 @@ · 51 unmodified lines
5252 #define FEC_R_FIFO_RSEM 0x194 /* Receive FIFO section empty threshold */
5353 #define FEC_R_FIFO_RAEM 0x198 /* Receive FIFO almost empty threshold */
5454 #define FEC_R_FIFO_RAFL 0x19c /* Receive FIFO almost full threshold */
55+#define FEC_RACC 0x1C4 /* Receive Accelerator function */
5556 #define FEC_MIIGSK_CFGR 0x300 /* MIIGSK Configuration reg */
5657 #define FEC_MIIGSK_ENR 0x308 /* MIIGSK Enable reg */
5758
@@ -164,9 +165,11 @@ struct bufdesc_ex { · 106 unmodified lines
164165 #define BD_ENET_TX_CSL ((ushort)0x0001)
165166 #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */
166167
167−/*enhanced buffer desciptor control/status used by Ethernet transmit*/
168+/*enhanced buffer descriptor control/status used by Ethernet transmit*/
168169 #define BD_ENET_TX_INT 0x40000000
169170 #define BD_ENET_TX_TS 0x20000000
171+#define BD_ENET_TX_PINS 0x10000000
172+#define BD_ENET_TX_IINS 0x08000000
170173
171174
172175 /* This device has up to three irqs on some platforms */
@@ -190,6 +193,10 @@ struct bufdesc_ex { · 17 unmodified lines
190193
191194 #define BD_ENET_RX_INT 0x00800000
192195 #define BD_ENET_RX_PTP ((ushort)0x0400)
196+#define BD_ENET_RX_ICE 0x00000020
197+#define BD_ENET_RX_PCR 0x00000010
198+#define FLAG_RX_CSUM_ENABLED (BD_ENET_RX_ICE | BD_ENET_RX_PCR)
199+#define FLAG_RX_CSUM_ERROR (BD_ENET_RX_ICE | BD_ENET_RX_PCR)
193200
194201 /* The FEC buffer descriptors track the ring buffers. The rx_bd_base and
195202 * tx_bd_base always point to the base of the buffer descriptors. The
@@ -247,6 +254,7 @@ struct fec_enet_private { · 51 unmodified lines
247254 int pause_flag;
248255
249256 struct napi_struct napi;
257+ int csum_flags;
250258
251259 struct ptp_clock *ptp_clock;
252260 struct ptp_clock_info ptp_caps;
drivers/net/ethernet/freescale/fec_main.crenamed from drivers/net/ethernet/freescale/fec.c+127−80
@@ -29,12 +29,17 @@ · 28 unmodified lines
2929 #include <linux/ioport.h>
3030 #include <linux/slab.h>
3131 #include <linux/interrupt.h>
32−#include <linux/pci.h>
3332 #include <linux/init.h>
3433 #include <linux/delay.h>
3534 #include <linux/netdevice.h>
3635 #include <linux/etherdevice.h>
3736 #include <linux/skbuff.h>
37+#include <linux/in.h>
38+#include <linux/ip.h>
39+#include <net/ip.h>
40+#include <linux/tcp.h>
41+#include <linux/udp.h>
42+#include <linux/icmp.h>
3843 #include <linux/spinlock.h>
3944 #include <linux/workqueue.h>
4045 #include <linux/bitops.h>
@@ -53,11 +58,6 @@ · 12 unmodified lines
5358
5459 #include <asm/cacheflush.h>
5560
56−#ifndef CONFIG_ARM
57−#include <asm/coldfire.h>
58−#include <asm/mcfsim.h>
59−#endif
60−
6161 #include "fec.h"
6262
6363 #if defined(CONFIG_ARM)
@@ -106,6 +106,9 @@ static struct platform_device_id fec_devtype[] = { · 42 unmodified lines
106106 .name = "imx6q-fec",
107107 .driver_data = FEC_QUIRK_ENET_MAC | FEC_QUIRK_HAS_GBIT |
108108 FEC_QUIRK_HAS_BUFDESC_EX,
109+ }, {
110+ .name = "mvf-fec",
111+ .driver_data = FEC_QUIRK_ENET_MAC,
109112 }, {
110113 /* sentinel */
111114 }
@@ -117,6 +120,7 @@ enum imx_fec_type { · 5 unmodified lines
117120 IMX27_FEC, /* runs on i.mx27/35/51 */
118121 IMX28_FEC,
119122 IMX6Q_FEC,
123+ MVF_FEC,
120124 };
121125
122126 static const struct of_device_id fec_dt_ids[] = {
@@ -124,6 +128,7 @@ static const struct of_device_id fec_dt_ids[] = { · 1 unmodified line
124128 { .compatible = "fsl,imx27-fec", .data = &fec_devtype[IMX27_FEC], },
125129 { .compatible = "fsl,imx28-fec", .data = &fec_devtype[IMX28_FEC], },
126130 { .compatible = "fsl,imx6q-fec", .data = &fec_devtype[IMX6Q_FEC], },
131+ { .compatible = "fsl,mvf-fec", .data = &fec_devtype[MVF_FEC], },
127132 { /* sentinel */ }
128133 };
129134 MODULE_DEVICE_TABLE(of, fec_dt_ids);
@@ -177,6 +182,11 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address"); · 47 unmodified lines
177182 #define PKT_MINBUF_SIZE 64
178183 #define PKT_MAXBLR_SIZE 1520
179184
185+/* FEC receive acceleration */
186+#define FEC_RACC_IPDIS (1 << 1)
187+#define FEC_RACC_PRODIS (1 << 2)
188+#define FEC_RACC_OPTIONS (FEC_RACC_IPDIS | FEC_RACC_PRODIS)
189+
180190 /*
181191 * The 5270/5271/5280/5282/532x RX control register also contains maximum frame
182192 * size bits. Other FEC hardware does not, so we need to take that into
@@ -237,6 +247,21 @@ static void *swap_buffer(void *bufaddr, int len) · 54 unmodified lines
237247 return bufaddr;
238248 }
239249
250+static int
251+fec_enet_clear_csum(struct sk_buff *skb, struct net_device *ndev)
252+{
253+ /* Only run for packets requiring a checksum. */
254+ if (skb->ip_summed != CHECKSUM_PARTIAL)
255+ return 0;
256+
257+ if (unlikely(skb_cow_head(skb, 0)))
258+ return -1;
259+
260+ *(__sum16 *)(skb->head + skb->csum_start + skb->csum_offset) = 0;
261+
262+ return 0;
263+}
264+
240265 static netdev_tx_t
241266 fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev)
242267 {
@@ -249,7 +274,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 6 unmodified lines
249274 unsigned int index;
250275
251276 if (!fep->link) {
252− /* Link is down or autonegotiation is in progress. */
277+ /* Link is down or auto-negotiation is in progress. */
253278 return NETDEV_TX_BUSY;
254279 }
255280
@@ -262,10 +287,16 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 6 unmodified lines
262287 /* Ooops. All transmit buffers are full. Bail out.
263288 * This should not happen, since ndev->tbusy should be set.
264289 */
265− printk("%s: tx queue full!.\n", ndev->name);
290+ netdev_err(ndev, "tx queue full!\n");
266291 return NETDEV_TX_BUSY;
267292 }
268293
294+ /* Protocol checksum off-load for TCP and UDP. */
295+ if (fec_enet_clear_csum(skb, ndev)) {
296+ kfree_skb(skb);
297+ return NETDEV_TX_OK;
298+ }
299+
269300 /* Clear all of the status flags */
270301 status &= ~BD_ENET_TX_STATS;
271302
@@ -322,8 +353,14 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *ndev) · 50 unmodified lines
322353 ebdp->cbd_esc = (BD_ENET_TX_TS | BD_ENET_TX_INT);
323354 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
324355 } else {
325−
326356 ebdp->cbd_esc = BD_ENET_TX_INT;
357+
358+ /* Enable protocol checksum flags
359+ * We do not bother with the IP Checksum bits as they
360+ * are done by the kernel
361+ */
362+ if (skb->ip_summed == CHECKSUM_PARTIAL)
363+ ebdp->cbd_esc |= BD_ENET_TX_PINS;
327364 }
328365 }
329366 /* If this was the last BD in the ring, start at the beginning again. */
@@ -403,6 +440,7 @@ fec_restart(struct net_device *ndev, int duplex) · 73 unmodified lines
403440 const struct platform_device_id *id_entry =
404441 platform_get_device_id(fep->pdev);
405442 int i;
443+ u32 val;
406444 u32 temp_mac[2];
407445 u32 rcntl = OPT_FRAME_SIZE | 0x04;
408446 u32 ecntl = 0x2; /* ETHEREN */
@@ -469,6 +507,14 @@ fec_restart(struct net_device *ndev, int duplex) · 60 unmodified lines
469507 /* Set MII speed */
470508 writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
471509
510+ /* set RX checksum */
511+ val = readl(fep->hwp + FEC_RACC);
512+ if (fep->csum_flags & FLAG_RX_CSUM_ENABLED)
513+ val |= FEC_RACC_OPTIONS;
514+ else
515+ val &= ~FEC_RACC_OPTIONS;
516+ writel(val, fep->hwp + FEC_RACC);
517+
472518 /*
473519 * The phy interface and speed need to get configured
474520 * differently on enet-mac.
@@ -526,7 +572,7 @@ fec_restart(struct net_device *ndev, int duplex) · 51 unmodified lines
526572 fep->phy_dev && fep->phy_dev->pause)) {
527573 rcntl |= FEC_ENET_FCE;
528574
529− /* set FIFO thresh hold parameter to reduce overrun */
575+ /* set FIFO threshold parameter to reduce overrun */
530576 writel(FEC_ENET_RSEM_V, fep->hwp + FEC_R_FIFO_RSEM);
531577 writel(FEC_ENET_RSFL_V, fep->hwp + FEC_R_FIFO_RSFL);
532578 writel(FEC_ENET_RAEM_V, fep->hwp + FEC_R_FIFO_RAEM);
@@ -574,7 +620,7 @@ fec_stop(struct net_device *ndev) · 41 unmodified lines
574620 writel(1, fep->hwp + FEC_X_CNTRL); /* Graceful transmit stop */
575621 udelay(10);
576622 if (!(readl(fep->hwp + FEC_IEVENT) & FEC_ENET_GRA))
577− printk("fec_stop : Graceful transmit stop did not complete !\n");
623+ netdev_err(ndev, "Graceful transmit stop did not complete!\n");
578624 }
579625
580626 /* Whack a reset. We should wait for this. */
@@ -672,7 +718,7 @@ fec_enet_tx(struct net_device *ndev) · 91 unmodified lines
672718 }
673719
674720 if (status & BD_ENET_TX_READY)
675− printk("HEY! Enet xmit interrupt and TX_READY.\n");
721+ netdev_err(ndev, "HEY! Enet xmit interrupt and TX_READY\n");
676722
677723 /* Deferred means some collisions occurred during transmit,
678724 * but we eventually sent the packet OK.
@@ -740,7 +786,7 @@ fec_enet_rx(struct net_device *ndev, int budget) · 61 unmodified lines
740786 * the last indicator should be set.
741787 */
742788 if ((status & BD_ENET_RX_LAST) == 0)
743− printk("FEC ENET: rcv is not +last\n");
789+ netdev_err(ndev, "rcv is not +last\n");
744790
745791 if (!fep->opened)
746792 goto rx_processing_done;
@@ -791,8 +837,6 @@ fec_enet_rx(struct net_device *ndev, int budget) · 44 unmodified lines
791837 skb = netdev_alloc_skb(ndev, pkt_len - 4 + NET_IP_ALIGN);
792838
793839 if (unlikely(!skb)) {
794− printk("%s: Memory squeeze, dropping packet.\n",
795− ndev->name);
796840 ndev->stats.rx_dropped++;
797841 } else {
798842 skb_reserve(skb, NET_IP_ALIGN);
@@ -816,6 +860,18 @@ fec_enet_rx(struct net_device *ndev, int budget) · 17 unmodified lines
816860 spin_unlock_irqrestore(&fep->tmreg_lock, flags);
817861 }
818862
863+ if (fep->bufdesc_ex &&
864+ (fep->csum_flags & FLAG_RX_CSUM_ENABLED)) {
865+ struct bufdesc_ex *ebdp =
866+ (struct bufdesc_ex *)bdp;
867+ if (!(ebdp->cbd_esc & FLAG_RX_CSUM_ERROR)) {
868+ /* don't check it */
869+ skb->ip_summed = CHECKSUM_UNNECESSARY;
870+ } else {
871+ skb_checksum_none_assert(skb);
872+ }
873+ }
874+
819875 if (!skb_defer_rx_timestamp(skb))
820876 napi_gro_receive(&fep->napi, skb);
821877 }
@@ -916,7 +972,6 @@ static void fec_get_mac(struct net_device *ndev) · 94 unmodified lines
916972 */
917973 iap = macaddr;
918974
919−#ifdef CONFIG_OF
920975 /*
921976 * 2) from device tree data
922977 */
@@ -928,7 +983,6 @@ static void fec_get_mac(struct net_device *ndev) · 5 unmodified lines
928983 iap = (unsigned char *) mac;
929984 }
930985 }
931−#endif
932986
933987 /*
934988 * 3) from flash or fuse (via platform data)
@@ -1032,7 +1086,7 @@ static int fec_enet_mdio_read(struct mii_bus *bus, int mii_id, int regnum) · 97 unmodified lines
10321086 usecs_to_jiffies(FEC_MII_TIMEOUT));
10331087 if (time_left == 0) {
10341088 fep->mii_timeout = 1;
1035− printk(KERN_ERR "FEC: MDIO read timeout\n");
1089+ netdev_err(fep->netdev, "MDIO read timeout\n");
10361090 return -ETIMEDOUT;
10371091 }
10381092
@@ -1060,7 +1114,7 @@ static int fec_enet_mdio_write(struct mii_bus *bus, int mii_id, int regnum, · 21 unmodified lines
10601114 usecs_to_jiffies(FEC_MII_TIMEOUT));
10611115 if (time_left == 0) {
10621116 fep->mii_timeout = 1;
1063− printk(KERN_ERR "FEC: MDIO write timeout\n");
1117+ netdev_err(fep->netdev, "MDIO write timeout\n");
10641118 return -ETIMEDOUT;
10651119 }
10661120
@@ -1100,9 +1154,7 @@ static int fec_enet_mii_probe(struct net_device *ndev) · 33 unmodified lines
11001154 }
11011155
11021156 if (phy_id >= PHY_MAX_ADDR) {
1103− printk(KERN_INFO
1104− "%s: no PHY, assuming direct connection to switch\n",
1105− ndev->name);
1157+ netdev_info(ndev, "no PHY, assuming direct connection to switch\n");
11061158 strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE);
11071159 phy_id = 0;
11081160 }
@@ -1111,7 +1163,7 @@ static int fec_enet_mii_probe(struct net_device *ndev) · 2 unmodified lines
11111163 phy_dev = phy_connect(ndev, phy_name, &fec_enet_adjust_link,
11121164 fep->phy_interface);
11131165 if (IS_ERR(phy_dev)) {
1114− printk(KERN_ERR "%s: could not attach to PHY\n", ndev->name);
1166+ netdev_err(ndev, "could not attach to PHY\n");
11151167 return PTR_ERR(phy_dev);
11161168 }
11171169
@@ -1129,11 +1181,9 @@ static int fec_enet_mii_probe(struct net_device *ndev) · 11 unmodified lines
11291181 fep->link = 0;
11301182 fep->full_duplex = 0;
11311183
1132− printk(KERN_INFO
1133− "%s: Freescale FEC PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
1134− ndev->name,
1135− fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
1136− fep->phy_dev->irq);
1184+ netdev_info(ndev, "Freescale FEC PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
1185+ fep->phy_dev->drv->name, dev_name(&fep->phy_dev->dev),
1186+ fep->phy_dev->irq);
11371187
11381188 return 0;
11391189 }
@@ -1443,7 +1493,7 @@ static int fec_enet_alloc_buffers(struct net_device *ndev) · 303 unmodified lines
14431493
14441494 if (fep->bufdesc_ex) {
14451495 struct bufdesc_ex *ebdp = (struct bufdesc_ex *)bdp;
1446− ebdp->cbd_esc = BD_ENET_RX_INT;
1496+ ebdp->cbd_esc = BD_ENET_TX_INT;
14471497 }
14481498
14491499 bdp = fec_enet_get_nextdesc(bdp, fep->bufdesc_ex);
@@ -1608,7 +1658,7 @@ fec_set_mac_address(struct net_device *ndev, void *p) · 158 unmodified lines
16081658 * Polled functionality used by netconsole and others in non interrupt mode
16091659 *
16101660 */
1611−void fec_poll_controller(struct net_device *dev)
1661+static void fec_poll_controller(struct net_device *dev)
16121662 {
16131663 int i;
16141664 struct fec_enet_private *fep = netdev_priv(dev);
@@ -1623,6 +1673,33 @@ void fec_poll_controller(struct net_device *dev) · 8 unmodified lines
16231673 }
16241674 #endif
16251675
1676+static int fec_set_features(struct net_device *netdev,
1677+ netdev_features_t features)
1678+{
1679+ struct fec_enet_private *fep = netdev_priv(netdev);
1680+ netdev_features_t changed = features ^ netdev->features;
1681+
1682+ netdev->features = features;
1683+
1684+ /* Receive checksum has been changed */
1685+ if (changed & NETIF_F_RXCSUM) {
1686+ if (features & NETIF_F_RXCSUM)
1687+ fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
1688+ else
1689+ fep->csum_flags &= ~FLAG_RX_CSUM_ENABLED;
1690+
1691+ if (netif_running(netdev)) {
1692+ fec_stop(netdev);
1693+ fec_restart(netdev, fep->phy_dev->duplex);
1694+ netif_wake_queue(netdev);
1695+ } else {
1696+ fec_restart(netdev, fep->phy_dev->duplex);
1697+ }
1698+ }
1699+
1700+ return 0;
1701+}
1702+
16261703 static const struct net_device_ops fec_netdev_ops = {
16271704 .ndo_open = fec_enet_open,
16281705 .ndo_stop = fec_enet_close,
@@ -1636,6 +1713,7 @@ static const struct net_device_ops fec_netdev_ops = { · 7 unmodified lines
16361713 #ifdef CONFIG_NET_POLL_CONTROLLER
16371714 .ndo_poll_controller = fec_poll_controller,
16381715 #endif
1716+ .ndo_set_features = fec_set_features,
16391717 };
16401718
16411719 /*
@@ -1649,11 +1727,9 @@ static int fec_enet_init(struct net_device *ndev) · 7 unmodified lines
16491727
16501728 /* Allocate memory for buffer descriptors. */
16511729 cbd_base = dma_alloc_coherent(NULL, PAGE_SIZE, &fep->bd_dma,
1652− GFP_KERNEL);
1653− if (!cbd_base) {
1654− printk("FEC: allocate descriptor memory failed?\n");
1730+ GFP_KERNEL);
1731+ if (!cbd_base)
16551732 return -ENOMEM;
1656− }
16571733
16581734 memset(cbd_base, 0, PAGE_SIZE);
16591735 spin_lock_init(&fep->hw_lock);
@@ -1679,22 +1755,19 @@ static int fec_enet_init(struct net_device *ndev) · 19 unmodified lines
16791755 writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK);
16801756 netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, FEC_NAPI_WEIGHT);
16811757
1758+ /* enable hw accelerator */
1759+ ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
1760+ | NETIF_F_RXCSUM);
1761+ ndev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
1762+ | NETIF_F_RXCSUM);
1763+ fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
1764+
16821765 fec_restart(ndev, 0);
16831766
16841767 return 0;
16851768 }
16861769
16871770 #ifdef CONFIG_OF
1688−static int fec_get_phy_mode_dt(struct platform_device *pdev)
1689−{
1690− struct device_node *np = pdev->dev.of_node;
1691−
1692− if (np)
1693− return of_get_phy_mode(np);
1694−
1695− return -ENODEV;
1696−}
1697−
16981771 static void fec_reset_phy(struct platform_device *pdev)
16991772 {
17001773 int err, phy_reset;
@@ -1723,11 +1796,6 @@ static void fec_reset_phy(struct platform_device *pdev) · 22 unmodified lines

126 more lines aren’t shown here.

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

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

drivers/net/ethernet/freescale/fec_ptp.c+2−5

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

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

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

drivers/net/ethernet/freescale/gianfar.c+97−79

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

drivers/net/ethernet/freescale/gianfar.h+4−4

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

drivers/net/ethernet/freescale/gianfar_ethtool.c+15−14

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

drivers/net/ethernet/freescale/gianfar_ptp.c+4−2

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

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

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

drivers/net/ethernet/freescale/ucc_geth.c+392−489

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

drivers/net/ethernet/freescale/ucc_geth_ethtool.c+11−13

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

drivers/net/ethernet/fujitsu/fmvj18x_cs.c+0−2

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

drivers/net/ethernet/i825xx/82596.c+3−5

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

drivers/net/ethernet/i825xx/lib82596.c+2−4

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

drivers/net/ethernet/ibm/ehea/ehea_main.c+12−16

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

drivers/net/ethernet/ibm/emac/mal.c+2−7

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

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

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

drivers/net/ethernet/intel/e1000/e1000_ethtool.c+2−4

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

drivers/net/ethernet/intel/e1000/e1000_main.c+23−24

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

drivers/net/ethernet/intel/e1000e/80003es2lan.c+65−66

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

drivers/net/ethernet/intel/e1000e/82571.c+18−20

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

drivers/net/ethernet/intel/e1000e/82571.h+2−0

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

drivers/net/ethernet/intel/e1000e/defines.h+16−11

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

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

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

drivers/net/ethernet/intel/e1000e/ethtool.c+111−129

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

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

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

drivers/net/ethernet/intel/e1000e/ich8lan.c+278−130

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

drivers/net/ethernet/intel/e1000e/ich8lan.h+3−8

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

drivers/net/ethernet/intel/e1000e/mac.c+25−12

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

drivers/net/ethernet/intel/e1000e/netdev.c+180−163

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

drivers/net/ethernet/intel/e1000e/nvm.c+1−1

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

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

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

drivers/net/ethernet/intel/e1000e/phy.c+73−61

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

drivers/net/ethernet/intel/e1000e/ptp.c+1−2

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

drivers/net/ethernet/intel/igb/e1000_82575.c+193−68

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

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

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

drivers/net/ethernet/intel/igb/e1000_defines.h+30−20

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

drivers/net/ethernet/intel/igb/e1000_hw.h+32−28

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

drivers/net/ethernet/intel/igb/e1000_i210.c+114−42

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

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

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

drivers/net/ethernet/intel/igb/e1000_mac.c+51−73

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

drivers/net/ethernet/intel/igb/e1000_mac.h+8−9

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

drivers/net/ethernet/intel/igb/e1000_mbx.c+6−5

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

drivers/net/ethernet/intel/igb/e1000_mbx.h+26−26

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

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

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

drivers/net/ethernet/intel/igb/e1000_phy.c+98−163

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

drivers/net/ethernet/intel/igb/e1000_regs.h+30−23

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

drivers/net/ethernet/intel/igb/igb.h+71−62

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

drivers/net/ethernet/intel/igb/igb_ethtool.c+259−95

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

drivers/net/ethernet/intel/igb/igb_hwmon.c+15−14

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

drivers/net/ethernet/intel/igb/igb_main.c+763−656

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

drivers/net/ethernet/intel/igb/igb_ptp.c+22−39

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

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

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

drivers/net/ethernet/intel/ixgb/ixgb_main.c+17−20

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

drivers/net/ethernet/intel/ixgbe/ixgbe.h+5−0

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

drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c+1−0

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

drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c+89−21

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

drivers/net/ethernet/intel/ixgbe/ixgbe_common.c+33−30

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

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

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

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c+20−19

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

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+105−74

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

drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c+17−4

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

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c+14−11

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

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h+20−0

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

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

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

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

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

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+67−54

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

drivers/net/ethernet/intel/ixgbevf/vf.c+6−1

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

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

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

drivers/net/ethernet/marvell/Kconfig+2−4

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

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

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

drivers/net/ethernet/marvell/mv643xx_eth.c+74−304

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

drivers/net/ethernet/marvell/mvmdio.c+112−30

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

drivers/net/ethernet/marvell/mvneta.c+2−12

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

drivers/net/ethernet/marvell/pxa168_eth.c+12−15

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

drivers/net/ethernet/marvell/sky2.c+6−5

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

drivers/net/ethernet/mellanox/mlx4/Makefile+1−1

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

drivers/net/ethernet/mellanox/mlx4/cmd.c+201−3

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

drivers/net/ethernet/mellanox/mlx4/cq.c+7−3

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

drivers/net/ethernet/mellanox/mlx4/en_clock.c+151−0

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

drivers/net/ethernet/mellanox/mlx4/en_cq.c+8−2

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

drivers/net/ethernet/mellanox/mlx4/en_dcb_nl.c+9−1

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

drivers/net/ethernet/mellanox/mlx4/en_ethtool.c+30−0

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

drivers/net/ethernet/mellanox/mlx4/en_main.c+5−0

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

drivers/net/ethernet/mellanox/mlx4/en_netdev.c+168−67

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

drivers/net/ethernet/mellanox/mlx4/en_resources.c+3−0

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

drivers/net/ethernet/mellanox/mlx4/en_rx.c+26−7

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

drivers/net/ethernet/mellanox/mlx4/en_selftest.c+2−3

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

drivers/net/ethernet/mellanox/mlx4/en_tx.c+28−3

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

drivers/net/ethernet/mellanox/mlx4/fw.c+36−2

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

drivers/net/ethernet/mellanox/mlx4/fw.h+1−0

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

drivers/net/ethernet/mellanox/mlx4/main.c+79−0

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

drivers/net/ethernet/mellanox/mlx4/mcg.c+29−22

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

drivers/net/ethernet/mellanox/mlx4/mlx4.h+37−1

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

drivers/net/ethernet/mellanox/mlx4/mlx4_en.h+25−1

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

drivers/net/ethernet/mellanox/mlx4/port.c+15−8

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

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c+107−22

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

drivers/net/ethernet/micrel/ks8695net.c+1−19

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

drivers/net/ethernet/micrel/ks8851.c+20−33

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

drivers/net/ethernet/micrel/ks8851_mll.c+26−6

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

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

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

drivers/net/ethernet/myricom/myri10ge/myri10ge.c+6−6

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

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

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

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

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

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

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

drivers/net/ethernet/natsemi/sonic.c+0−1

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

drivers/net/ethernet/natsemi/xtsonic.c+5−7

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

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

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

drivers/net/ethernet/neterion/vxge/vxge-main.c+8−6

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

drivers/net/ethernet/netx-eth.c+0−2

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

drivers/net/ethernet/nuvoton/w90p910_ether.c+6−14

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

drivers/net/ethernet/nvidia/forcedeth.c+52−12

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

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

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

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

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

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

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

drivers/net/ethernet/qlogic/Kconfig+10−0

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

drivers/net/ethernet/qlogic/netxen/netxen_nic.h+3−2

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

drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c+2−2

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

drivers/net/ethernet/qlogic/netxen/netxen_nic_main.c+145−77

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

drivers/net/ethernet/qlogic/qla3xxx.c+0−1

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

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

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic.h+103−26

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c+340−165

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h+196−8

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_init.c+86−21

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c+27−48

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c+100−25

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_hdr.h+4−2

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c+48−15

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.h+8−2

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c+69−35

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c+284−87

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_minidump.c+1−4

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov.h+263−0

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c+1954−0

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c+1780−0

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c+253−2

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

drivers/net/ethernet/qlogic/qlge/qlge_main.c+14−20

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

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

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

drivers/net/ethernet/realtek/8139cp.c+4−4

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

drivers/net/ethernet/realtek/8139too.c+0−2

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

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

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

drivers/net/ethernet/realtek/r8169.c+208−87

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

drivers/net/ethernet/renesas/Kconfig+2−1

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

drivers/net/ethernet/renesas/sh_eth.c+349−61

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

drivers/net/ethernet/renesas/sh_eth.h+0−220

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

drivers/net/ethernet/s6gmac.c+2−14

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

drivers/net/ethernet/seeq/ether3.c+5−17

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

drivers/net/ethernet/seeq/sgiseeq.c+0−2

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

drivers/net/ethernet/sfc/efx.c+224−43

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

drivers/net/ethernet/sfc/efx.h+10−4

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

drivers/net/ethernet/sfc/enum.h+9−3

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

drivers/net/ethernet/sfc/ethtool.c+3−1

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

drivers/net/ethernet/sfc/falcon.c+10−7

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

drivers/net/ethernet/sfc/filter.c+179−70

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

drivers/net/ethernet/sfc/mcdi.c+1−1

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

drivers/net/ethernet/sfc/mcdi_pcol.h+1−0

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

drivers/net/ethernet/sfc/net_driver.h+63−34

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

drivers/net/ethernet/sfc/nic.c+77−17

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

drivers/net/ethernet/sfc/ptp.c+61−55

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

drivers/net/ethernet/sfc/rx.c+410−383

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

drivers/net/ethernet/sfc/siena.c+24−1

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

drivers/net/ethernet/sgi/meth.c+3−2

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

drivers/net/ethernet/sis/sis900.c+32−9

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

drivers/net/ethernet/smsc/smc9194.c+0−2

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

drivers/net/ethernet/smsc/smc91x.c+0−2

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

drivers/net/ethernet/smsc/smsc911x.c+1−1

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

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

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

drivers/net/ethernet/stmicro/stmmac/Kconfig+1−18

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

drivers/net/ethernet/stmicro/stmmac/Makefile+3−5

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

drivers/net/ethernet/stmicro/stmmac/chain_mode.c+58−34

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

drivers/net/ethernet/stmicro/stmmac/common.h+140−59

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

drivers/net/ethernet/stmicro/stmmac/descs.h+48−3

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

drivers/net/ethernet/stmicro/stmmac/descs_com.h+23−20

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

drivers/net/ethernet/stmicro/stmmac/dwmac1000.h+58−23

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

drivers/net/ethernet/stmicro/stmmac/dwmac1000_core.c+120−48

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

drivers/net/ethernet/stmicro/stmmac/dwmac1000_dma.c+19−12

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

drivers/net/ethernet/stmicro/stmmac/dwmac100_core.c+15−16

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

drivers/net/ethernet/stmicro/stmmac/dwmac100_dma.c+16−14

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

drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h+2−2

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

drivers/net/ethernet/stmicro/stmmac/enh_desc.c+127−24

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

drivers/net/ethernet/stmicro/stmmac/mmc.h+1−2

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

drivers/net/ethernet/stmicro/stmmac/norm_desc.c+65−24

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

drivers/net/ethernet/stmicro/stmmac/ring_mode.c+20−20

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

drivers/net/ethernet/stmicro/stmmac/stmmac.h+47−26

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

drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c+155−1

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

drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c+148−0

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

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+1013−327

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

drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c+1−1

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

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

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

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c+3−5

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

drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c+211−0

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

drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h+74−0

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

drivers/net/ethernet/sun/niu.c+1−1

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

drivers/net/ethernet/sun/sunbmac.c+1−3

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

drivers/net/ethernet/sun/sunhme.c+4−9

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

drivers/net/ethernet/sun/sunqe.c+1−4

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

drivers/net/ethernet/tehuti/tehuti.c+8−9

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

drivers/net/ethernet/ti/cpsw.c+260−70

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

drivers/net/ethernet/ti/davinci_cpdma.c+21−10

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

drivers/net/ethernet/ti/davinci_cpdma.h+1−1

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

drivers/net/ethernet/ti/davinci_emac.c+20−34

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

drivers/net/ethernet/ti/davinci_mdio.c+1−0

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

drivers/net/ethernet/ti/tlan.c+2−3

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

drivers/net/ethernet/toshiba/ps3_gelic_net.c+117−123

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

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

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

drivers/net/ethernet/tundra/tsi108_eth.c+5−16

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

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

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

drivers/net/ethernet/via/via-velocity.c+9−6

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

drivers/net/ethernet/wiznet/w5100.c+2−2

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

drivers/net/ethernet/wiznet/w5300.c+2−2

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

drivers/net/ethernet/xilinx/ll_temac_main.c+11−22

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

drivers/net/ethernet/xilinx/xilinx_axienet_main.c+7−18

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

drivers/net/ethernet/xircom/xirc2ps_cs.c+0−1

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

drivers/net/fddi/defxx.c+3−6

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

drivers/net/hamradio/yam.c+1−1

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

drivers/net/hyperv/netvsc.c+1−1

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

drivers/net/hyperv/netvsc_drv.c+1−1

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

drivers/net/ieee802154/at86rf230.c+117−34

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

drivers/net/ieee802154/fakehard.c+0−21

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

drivers/net/ieee802154/mrf24j40.c+20−21

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

drivers/net/ifb.c+2−1

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

drivers/net/irda/ali-ircc.c+2−4

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

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

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

drivers/net/irda/bfin_sir.c+2−1

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

drivers/net/irda/nsc-ircc.c+2−4

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

drivers/net/irda/pxaficp_ir.c+2−2

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

drivers/net/irda/smsc-ircc2.c+4−13

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

drivers/net/irda/via-ircc.c+2−4

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

drivers/net/irda/w83977af_ir.c+2−5

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

drivers/net/macvlan.c+18−11

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

drivers/net/macvtap.c+2−0

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

drivers/net/phy/lxt.c+1−1

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

drivers/net/phy/marvell.c+127−0

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

drivers/net/phy/mdio-gpio.c+1−11

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

drivers/net/phy/mdio-octeon.c+88−19

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

drivers/net/phy/micrel.c+32−9

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

drivers/net/phy/phy.c+17−49

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

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

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

drivers/net/phy/vitesse.c+1−2

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

drivers/net/plip/plip.c+1−1

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

drivers/net/ppp/ppp_synctty.c+2−51

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

drivers/net/team/Kconfig+12−0

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

drivers/net/team/Makefile+1−0

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

drivers/net/team/team.c+29−16

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

drivers/net/team/team_mode_broadcast.c+2−12

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

drivers/net/team/team_mode_random.c+71−0

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

drivers/net/team/team_mode_roundrobin.c+3−33

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

drivers/net/tun.c+14−6

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

drivers/net/usb/asix_devices.c+1−5

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

drivers/net/usb/ax88179_178a.c+4−8

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

drivers/net/usb/cdc_ether.c+1−4

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

drivers/net/usb/cdc_mbim.c+2−2

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

drivers/net/usb/cdc_ncm.c+8−10

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

drivers/net/usb/dm9601.c+1−6

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

drivers/net/usb/mcs7830.c+1−5

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

drivers/net/usb/pegasus.c+120−327

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

drivers/net/usb/pegasus.h+2−9

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

drivers/net/usb/sierra_net.c+1−2

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

drivers/net/usb/usbnet.c+44−1

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

drivers/net/veth.c+2−1

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

drivers/net/virtio_net.c+9−5

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

drivers/net/vmxnet3/vmxnet3_drv.c+9−8

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

drivers/net/vmxnet3/vmxnet3_ethtool.c+3−2

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

drivers/net/vxlan.c+330−216

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

drivers/net/wireless/adm8211.c+2−1

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

drivers/net/wireless/at76c50x-usb.c+2−2

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

drivers/net/wireless/ath/ar5523/ar5523.c+8−8

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

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

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

drivers/net/wireless/ath/ath5k/ath5k.h+2−1

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

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

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

drivers/net/wireless/ath/ath5k/eeprom.c+4−2

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

drivers/net/wireless/ath/ath5k/eeprom.h+0−3

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

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

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

drivers/net/wireless/ath/ath5k/phy.c+3−17

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

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

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

drivers/net/wireless/ath/ath5k/trace.h+1−1

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

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

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

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

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

drivers/net/wireless/ath/ath6kl/cfg80211.c+9−6

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

drivers/net/wireless/ath/ath6kl/core.h+0−3

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

drivers/net/wireless/ath/ath6kl/debug.c+66−6

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

drivers/net/wireless/ath/ath6kl/debug.h+4−7

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

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

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

drivers/net/wireless/ath/ath6kl/htc_mbox.c+20−1

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

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

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

drivers/net/wireless/ath/ath6kl/init.c+103−13

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

drivers/net/wireless/ath/ath6kl/main.c+5−36

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

drivers/net/wireless/ath/ath6kl/sdio.c+14−2

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

drivers/net/wireless/ath/ath6kl/target.h+1−1

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

drivers/net/wireless/ath/ath6kl/trace.c+23−0

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

drivers/net/wireless/ath/ath6kl/trace.h+332−0

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

drivers/net/wireless/ath/ath6kl/txrx.c+4−1

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

drivers/net/wireless/ath/ath6kl/usb.c+23−15

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

drivers/net/wireless/ath/ath6kl/wmi.c+6−0

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

drivers/net/wireless/ath/ath9k/ar5008_phy.c+23−69

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

drivers/net/wireless/ath/ath9k/ar9002_calib.c+6−3

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

drivers/net/wireless/ath/ath9k/ar9002_hw.c+3−14

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

drivers/net/wireless/ath/ath9k/ar9003_calib.c+2−1

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

drivers/net/wireless/ath/ath9k/ar9003_eeprom.c+17−0

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

drivers/net/wireless/ath/ath9k/ar9462_2p0_initvals.h+24−25

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

drivers/net/wireless/ath/ath9k/ath9k.h+5−4

This diff is large: its 31 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/calib.c+2−4

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

drivers/net/wireless/ath/ath9k/calib.h+6−0

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

drivers/net/wireless/ath/ath9k/common.c+3−16

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

drivers/net/wireless/ath/ath9k/common.h+1−2

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

drivers/net/wireless/ath/ath9k/debug.c+6−1

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

drivers/net/wireless/ath/ath9k/debug.h+2−0

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

drivers/net/wireless/ath/ath9k/dfs.c+1−9

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

drivers/net/wireless/ath/ath9k/dfs_debug.c+20−0

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

drivers/net/wireless/ath/ath9k/dfs_pattern_detector.c+24−19

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

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

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

drivers/net/wireless/ath/ath9k/dfs_pri_detector.c+11−38

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

drivers/net/wireless/ath/ath9k/dfs_pri_detector.h+25−2

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

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

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

drivers/net/wireless/ath/ath9k/htc_drv_main.c+10−8

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

drivers/net/wireless/ath/ath9k/htc_drv_txrx.c+8−10

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

drivers/net/wireless/ath/ath9k/hw.c+112−86

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

drivers/net/wireless/ath/ath9k/hw.h+0−14

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

drivers/net/wireless/ath/ath9k/init.c+31−10

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

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

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

drivers/net/wireless/ath/ath9k/mac.c+8−0

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

drivers/net/wireless/ath/ath9k/mac.h+1−0

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

drivers/net/wireless/ath/ath9k/main.c+35−11

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

drivers/net/wireless/ath/ath9k/rc.c+2−2

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

drivers/net/wireless/ath/ath9k/recv.c+94−83

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

drivers/net/wireless/ath/ath9k/reg.h+0−3

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

drivers/net/wireless/ath/ath9k/xmit.c+73−64

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

drivers/net/wireless/ath/carl9170/carl9170.h+1−7

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

drivers/net/wireless/ath/carl9170/debug.c+2−2

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

drivers/net/wireless/ath/carl9170/mac.c+4−4

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

drivers/net/wireless/ath/carl9170/main.c+7−4

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

drivers/net/wireless/ath/carl9170/phy.c+26−59

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

drivers/net/wireless/ath/carl9170/tx.c+28−41

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

drivers/net/wireless/ath/hw.c+6−0

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

drivers/net/wireless/ath/key.c+6−3

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

drivers/net/wireless/ath/reg.h+4−0

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

drivers/net/wireless/ath/wil6210/Makefile+3−1

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

drivers/net/wireless/ath/wil6210/cfg80211.c+11−22

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

drivers/net/wireless/ath/wil6210/dbg_hexdump.h+0−20

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

drivers/net/wireless/ath/wil6210/debugfs.c+47−11

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

drivers/net/wireless/ath/wil6210/interrupt.c+22−3

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

drivers/net/wireless/ath/wil6210/main.c+27−33

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

drivers/net/wireless/ath/wil6210/netdev.c+0−3

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

drivers/net/wireless/ath/wil6210/pcie_bus.c+0−3

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

drivers/net/wireless/ath/wil6210/txrx.c+22−14

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

drivers/net/wireless/ath/wil6210/txrx.h+42−7

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

drivers/net/wireless/ath/wil6210/wil6210.h+10−7

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

drivers/net/wireless/ath/wil6210/wmi.c+111−43

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

drivers/net/wireless/ath/wil6210/wmi.h+264−99

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

drivers/net/wireless/b43/Kconfig+3−3

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

drivers/net/wireless/b43/b43.h+9−1

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

drivers/net/wireless/b43/dma.c+2−7

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

drivers/net/wireless/b43/main.c+21−17

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

drivers/net/wireless/b43/phy_ht.c+615−93

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

drivers/net/wireless/b43/phy_ht.h+77−6

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

drivers/net/wireless/b43/phy_lcn.c+3−2

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

drivers/net/wireless/b43/phy_lp.c+5−11

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

drivers/net/wireless/b43/phy_n.c+355−361

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

drivers/net/wireless/b43/phy_n.h+146−0

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

drivers/net/wireless/b43/radio_2056.c+3−3

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

drivers/net/wireless/b43/radio_2059.c+9−30

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

drivers/net/wireless/b43/radio_2059.h+3−11

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

drivers/net/wireless/b43/sdio.h+2−2

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

drivers/net/wireless/b43/tables_nphy.c+56−45

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

drivers/net/wireless/b43/tables_nphy.h+15−14

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

drivers/net/wireless/b43/tables_phy_lcn.c+3−3

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

drivers/net/wireless/b43legacy/dma.c+2−6

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

drivers/net/wireless/b43legacy/main.c+5−4

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

drivers/net/wireless/brcm80211/Kconfig+3−11

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

drivers/net/wireless/brcm80211/brcmfmac/Makefile+5−1

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

drivers/net/wireless/brcm80211/brcmfmac/bcmsdh.c+157−112

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

drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c+64−112

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

drivers/net/wireless/brcm80211/brcmfmac/btcoex.c+497−0

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

drivers/net/wireless/brcm80211/brcmfmac/btcoex.h+29−0

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

drivers/net/wireless/brcm80211/brcmfmac/dhd.h+39−2

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

drivers/net/wireless/brcm80211/brcmfmac/dhd_bus.h+13−2

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

drivers/net/wireless/brcm80211/brcmfmac/dhd_cdc.c+25−9

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

drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c+33−0

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

drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.c+80−0

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

drivers/net/wireless/brcm80211/brcmfmac/dhd_dbg.h+48−7

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

drivers/net/wireless/brcm80211/brcmfmac/dhd_linux.c+94−54

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

drivers/net/wireless/brcm80211/brcmfmac/dhd_proto.h+1−1

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

drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c+402−392

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

drivers/net/wireless/brcm80211/brcmfmac/fweh.c+15−10

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

drivers/net/wireless/brcm80211/brcmfmac/fweh.h+3−3

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

drivers/net/wireless/brcm80211/brcmfmac/fwil.c+1−0

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

drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c+2067−0

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

drivers/net/wireless/brcm80211/brcmfmac/fwsignal.h+33−0

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

drivers/net/wireless/brcm80211/brcmfmac/p2p.c+213−75

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

drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.c+336−33

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

drivers/net/wireless/brcm80211/brcmfmac/sdio_chip.h+98−3

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

drivers/net/wireless/brcm80211/brcmfmac/sdio_host.h+26−6

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

drivers/net/wireless/brcm80211/brcmfmac/tracepoint.c+22−0

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

drivers/net/wireless/brcm80211/brcmfmac/tracepoint.h+101−0

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

drivers/net/wireless/brcm80211/brcmfmac/usb.c+18−19

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

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c+415−179

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

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.h+17−8

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

drivers/net/wireless/brcm80211/brcmsmac/Makefile+3−4

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

drivers/net/wireless/brcm80211/brcmsmac/aiutils.c+0−6

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

drivers/net/wireless/brcm80211/brcmsmac/channel.c+2−2

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

drivers/net/wireless/brcm80211/brcmsmac/d11.h+1−0

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

drivers/net/wireless/brcm80211/brcmsmac/led.c+126−0

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

drivers/net/wireless/brcm80211/brcmsmac/led.h+36−0

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

drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.c+86−11

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

drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h+4−0

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

drivers/net/wireless/brcm80211/brcmsmac/main.c+277−100

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

drivers/net/wireless/brcm80211/brcmsmac/main.h+15−10

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

drivers/net/wireless/brcm80211/brcmsmac/phy/phy_cmn.c+15−25

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

drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h+0−1

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

drivers/net/wireless/brcm80211/brcmsmac/phy/phy_lcn.c+22−13

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

drivers/net/wireless/brcm80211/brcmsmac/phy/phy_n.c+6−8

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

drivers/net/wireless/brcm80211/brcmsmac/pmu.c+0−54

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

drivers/net/wireless/brcm80211/brcmsmac/pmu.h+0−6

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

drivers/net/wireless/brcm80211/brcmsmac/pub.h+15−2

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

drivers/net/wireless/brcm80211/brcmutil/Makefile+2−7

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

drivers/net/wireless/brcm80211/brcmutil/d11.c+162−0

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

drivers/net/wireless/brcm80211/brcmutil/utils.c+27−10

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

drivers/net/wireless/brcm80211/include/brcm_hw_ids.h+2−0

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

drivers/net/wireless/brcm80211/include/brcmu_d11.h+145−0

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

drivers/net/wireless/brcm80211/include/brcmu_utils.h+27−0

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

drivers/net/wireless/brcm80211/include/brcmu_wifi.h+25−3

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

drivers/net/wireless/brcm80211/include/chipcommon.h+12−2

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

drivers/net/wireless/ipw2x00/ipw2100.c+7−25

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

drivers/net/wireless/iwlegacy/3945-mac.c+1−1

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

drivers/net/wireless/iwlegacy/3945-rs.c+1−1

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

drivers/net/wireless/iwlegacy/3945.c+1−3

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

drivers/net/wireless/iwlegacy/3945.h+0−4

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

drivers/net/wireless/iwlegacy/4965-mac.c+32−33

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

drivers/net/wireless/iwlegacy/4965-rs.c+1−1

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

drivers/net/wireless/iwlegacy/4965.c+1−1

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

drivers/net/wireless/iwlegacy/common.c+11−15

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

drivers/net/wireless/iwlegacy/common.h+3−8

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

drivers/net/wireless/iwlwifi/Kconfig+10−1

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

drivers/net/wireless/iwlwifi/Makefile+1−2

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

drivers/net/wireless/iwlwifi/dvm/agn.h+7−3

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

drivers/net/wireless/iwlwifi/dvm/calib.c+1−1

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

drivers/net/wireless/iwlwifi/dvm/calib.h+1−1

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

drivers/net/wireless/iwlwifi/dvm/commands.h+2−1

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

drivers/net/wireless/iwlwifi/dvm/debugfs.c+32−10

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

drivers/net/wireless/iwlwifi/dvm/devices.c+6−4

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

drivers/net/wireless/iwlwifi/dvm/lib.c+14−4

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

drivers/net/wireless/iwlwifi/dvm/mac80211.c+23−9

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

drivers/net/wireless/iwlwifi/dvm/main.c+3−3

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

drivers/net/wireless/iwlwifi/dvm/rs.c+1−1

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

drivers/net/wireless/iwlwifi/dvm/rxon.c+6−5

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

drivers/net/wireless/iwlwifi/dvm/scan.c+1−1

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

drivers/net/wireless/iwlwifi/dvm/sta.c+4−1

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

drivers/net/wireless/iwlwifi/dvm/testmode.c+1−1

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

drivers/net/wireless/iwlwifi/dvm/tx.c+52−6

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

drivers/net/wireless/iwlwifi/dvm/ucode.c+1−1

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

drivers/net/wireless/iwlwifi/iwl-1000.crenamed from drivers/net/wireless/iwlwifi/pcie/1000.c+0−1

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

drivers/net/wireless/iwlwifi/iwl-2000.crenamed from drivers/net/wireless/iwlwifi/pcie/2000.c+0−1

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

drivers/net/wireless/iwlwifi/iwl-5000.crenamed from drivers/net/wireless/iwlwifi/pcie/5000.c+0−1

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

drivers/net/wireless/iwlwifi/iwl-6000.crenamed from drivers/net/wireless/iwlwifi/pcie/6000.c+0−1

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

drivers/net/wireless/iwlwifi/iwl-7000.crenamed from drivers/net/wireless/iwlwifi/pcie/7000.c+49−14

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

drivers/net/wireless/iwlwifi/iwl-agn-hw.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-config.h+48−1

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

drivers/net/wireless/iwlwifi/iwl-csr.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-debug.c+7−6

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

drivers/net/wireless/iwlwifi/iwl-devtrace.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-drv.c+17−15

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

drivers/net/wireless/iwlwifi/iwl-drv.h+16−1

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

drivers/net/wireless/iwlwifi/iwl-eeprom-parse.c+5−4

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

drivers/net/wireless/iwlwifi/iwl-eeprom-parse.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-eeprom-read.c+3−2

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

drivers/net/wireless/iwlwifi/iwl-eeprom-read.h+1−1

This diff is large: its 9 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-fw-file.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-fw.h+28−1

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

drivers/net/wireless/iwlwifi/iwl-io.c+10−9

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

drivers/net/wireless/iwlwifi/iwl-modparams.h+2−4

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

drivers/net/wireless/iwlwifi/iwl-notif-wait.c+8−7

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

drivers/net/wireless/iwlwifi/iwl-notif-wait.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-nvm-parse.c+49−2

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

drivers/net/wireless/iwlwifi/iwl-nvm-parse.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-op-mode.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-phy-db.c+6−5

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

drivers/net/wireless/iwlwifi/iwl-phy-db.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-prph.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-test.c+7−7

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

drivers/net/wireless/iwlwifi/iwl-test.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-testmode.h+1−1

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

drivers/net/wireless/iwlwifi/iwl-trans.h+2−6

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

drivers/net/wireless/iwlwifi/mvm/Makefile+1−1

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

drivers/net/wireless/iwlwifi/mvm/binding.c+1−1

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

drivers/net/wireless/iwlwifi/mvm/bt-coex.c+589−0

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

drivers/net/wireless/iwlwifi/mvm/d3.c+264−3

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

drivers/net/wireless/iwlwifi/mvm/debugfs.c+247−10

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

drivers/net/wireless/iwlwifi/mvm/fw-api-bt-coex.h+319−0

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

drivers/net/wireless/iwlwifi/mvm/fw-api-d3.h+51−2

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

drivers/net/wireless/iwlwifi/mvm/fw-api-mac.h+1−1

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

drivers/net/wireless/iwlwifi/mvm/fw-api-power.h+23−43

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

drivers/net/wireless/iwlwifi/mvm/fw-api-rs.h+1−1

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

drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h+1−1

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

drivers/net/wireless/iwlwifi/mvm/fw-api-sta.h+1−1

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

drivers/net/wireless/iwlwifi/mvm/fw-api-tx.h+7−1

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

drivers/net/wireless/iwlwifi/mvm/fw-api.h+40−43

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

drivers/net/wireless/iwlwifi/mvm/fw.c+24−13

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

drivers/net/wireless/iwlwifi/mvm/led.c+1−1

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

drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c+70−17

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

drivers/net/wireless/iwlwifi/mvm/mac80211.c+95−24

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

drivers/net/wireless/iwlwifi/mvm/mvm.h+45−14

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

drivers/net/wireless/iwlwifi/mvm/nvm.c+36−109

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

drivers/net/wireless/iwlwifi/mvm/ops.c+17−31

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

drivers/net/wireless/iwlwifi/mvm/phy-ctxt.c+4−10

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

drivers/net/wireless/iwlwifi/mvm/power.c+45−72

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

drivers/net/wireless/iwlwifi/mvm/quota.c+3−2

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

drivers/net/wireless/iwlwifi/mvm/rs.c+26−24

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

drivers/net/wireless/iwlwifi/mvm/rx.c+1−1

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

drivers/net/wireless/iwlwifi/mvm/scan.c+3−3

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

drivers/net/wireless/iwlwifi/mvm/sta.c+87−12

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

drivers/net/wireless/iwlwifi/mvm/sta.h+5−1

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

drivers/net/wireless/iwlwifi/mvm/time-event.c+29−21

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

drivers/net/wireless/iwlwifi/mvm/time-event.h+3−2

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

drivers/net/wireless/iwlwifi/mvm/tx.c+15−13

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

drivers/net/wireless/iwlwifi/mvm/utils.c+5−4

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

drivers/net/wireless/iwlwifi/pcie/cfg.h+0−115

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

drivers/net/wireless/iwlwifi/pcie/drv.c+3−3

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

drivers/net/wireless/iwlwifi/pcie/trans.c+4−21

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

drivers/net/wireless/iwlwifi/pcie/tx.c+7−6

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

drivers/net/wireless/libertas_tf/main.c+4−4

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

drivers/net/wireless/mac80211_hwsim.c+96−29

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

drivers/net/wireless/mwifiex/11ac.c+42−1

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

drivers/net/wireless/mwifiex/11ac.h+17−0

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

drivers/net/wireless/mwifiex/11n.c+22−0

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

drivers/net/wireless/mwifiex/11n_aggr.c+1−13

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

drivers/net/wireless/mwifiex/11n_rxreorder.c+1−1

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

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

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

drivers/net/wireless/mwifiex/cfg80211.c+184−71

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

drivers/net/wireless/mwifiex/cmdevt.c+27−12

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

drivers/net/wireless/mwifiex/decl.h+9−2

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

drivers/net/wireless/mwifiex/ethtool.c+70−0

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

drivers/net/wireless/mwifiex/fw.h+51−32

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

drivers/net/wireless/mwifiex/init.c+11−22

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

drivers/net/wireless/mwifiex/ioctl.h+31−0

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

drivers/net/wireless/mwifiex/join.c+23−0

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

drivers/net/wireless/mwifiex/main.c+12−3

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

drivers/net/wireless/mwifiex/main.h+19−4

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

drivers/net/wireless/mwifiex/pcie.c+114−102

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

drivers/net/wireless/mwifiex/scan.c+8−29

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

drivers/net/wireless/mwifiex/sta_cmd.c+82−1

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

drivers/net/wireless/mwifiex/sta_cmdresp.c+5−1

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

drivers/net/wireless/mwifiex/sta_ioctl.c+18−12

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

drivers/net/wireless/mwifiex/txrx.c+2−0

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

drivers/net/wireless/mwifiex/uap_cmd.c+55−0

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

drivers/net/wireless/mwifiex/util.c+3−3

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

drivers/net/wireless/mwifiex/wmm.c+74−134

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

drivers/net/wireless/mwifiex/wmm.h+3−0

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

drivers/net/wireless/mwl8k.c+98−69

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

drivers/net/wireless/orinoco/orinoco_usb.c+1−1

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

drivers/net/wireless/p54/fwio.c+2−2

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

drivers/net/wireless/p54/main.c+3−3

This diff is large: its 27 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/txrx.c+2−2

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

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

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

drivers/net/wireless/rndis_wlan.c+2−3

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

drivers/net/wireless/rt2x00/Kconfig+7−0

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

drivers/net/wireless/rt2x00/rt2400pci.c+162−161

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

drivers/net/wireless/rt2x00/rt2500pci.c+177−176

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

drivers/net/wireless/rt2x00/rt2500usb.c+18−17

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

drivers/net/wireless/rt2x00/rt2800.h+99−4

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

drivers/net/wireless/rt2x00/rt2800lib.c+1208−389

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

drivers/net/wireless/rt2x00/rt2800pci.c+244−133

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

drivers/net/wireless/rt2x00/rt2800usb.c+86−25

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

drivers/net/wireless/rt2x00/rt2x00.h+54−41

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

drivers/net/wireless/rt2x00/rt2x00config.c+5−5

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

drivers/net/wireless/rt2x00/rt2x00debug.c+4−4

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

drivers/net/wireless/rt2x00/rt2x00dev.c+11−13

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

drivers/net/wireless/rt2x00/rt2x00firmware.c+12−13

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

drivers/net/wireless/rt2x00/rt2x00leds.c+1−1

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

drivers/net/wireless/rt2x00/rt2x00mac.c+10−9

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

drivers/net/wireless/rt2x00/rt2x00mmio.c+26−26

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

drivers/net/wireless/rt2x00/rt2x00mmio.h+26−26

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

drivers/net/wireless/rt2x00/rt2x00pci.c+7−7

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

drivers/net/wireless/rt2x00/rt2x00queue.c+31−26

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

drivers/net/wireless/rt2x00/rt2x00queue.h+12−3

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

drivers/net/wireless/rt2x00/rt2x00soc.c+2−2

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

drivers/net/wireless/rt2x00/rt2x00usb.c+25−19

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

drivers/net/wireless/rt2x00/rt61pci.c+276−274

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

drivers/net/wireless/rt2x00/rt73usb.c+16−16

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

drivers/net/wireless/rtl818x/rtl8180/dev.c+2−2

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

drivers/net/wireless/rtl818x/rtl8180/grf5101.c+2−1

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

drivers/net/wireless/rtl818x/rtl8180/max2820.c+1−1

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

drivers/net/wireless/rtl818x/rtl8180/rtl8225.c+2−1

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

drivers/net/wireless/rtl818x/rtl8180/sa2400.c+2−1

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

drivers/net/wireless/rtl818x/rtl8187/dev.c+2−2

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

drivers/net/wireless/rtl818x/rtl8187/rtl8225.c+2−1

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

drivers/net/wireless/rtlwifi/Kconfig+9−0

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

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

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

drivers/net/wireless/rtlwifi/base.c+329−54

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

drivers/net/wireless/rtlwifi/base.h+12−2

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

drivers/net/wireless/rtlwifi/core.c+177−44

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

drivers/net/wireless/rtlwifi/debug.c+4−1

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

drivers/net/wireless/rtlwifi/debug.h+11−2

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

drivers/net/wireless/rtlwifi/efuse.c+41−12

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

drivers/net/wireless/rtlwifi/efuse.h+0−1

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

drivers/net/wireless/rtlwifi/pci.c+119−31

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

drivers/net/wireless/rtlwifi/pci.h+2−0

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

drivers/net/wireless/rtlwifi/ps.c+305−25

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

drivers/net/wireless/rtlwifi/ps.h+2−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/Makefile+16−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/def.h+324−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/dm.c+1794−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/dm.h+326−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/fw.c+830−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/fw.h+301−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/hw.c+2530−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/hw.h+68−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/led.c+157−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/led.h+38−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/phy.c+2202−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/phy.h+236−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/pwrseq.c+109−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/pwrseq.h+327−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/pwrseqcmd.c+140−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/pwrseqcmd.h+97−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/reg.h+2258−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/rf.c+467−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/rf.h+46−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/sw.c+400−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/sw.h+36−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/table.c+643−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/table.h+47−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/trx.c+817−0

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

drivers/net/wireless/rtlwifi/rtl8188ee/trx.h+795−0

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

drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c+22−83

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

drivers/net/wireless/rtlwifi/rtl8192c/fw_common.c+98−1

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

drivers/net/wireless/rtlwifi/rtl8192c/fw_common.h+4−0

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

drivers/net/wireless/rtlwifi/rtl8192ce/hw.c+103−15

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

drivers/net/wireless/rtlwifi/rtl8192ce/hw.h+4−0

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

drivers/net/wireless/rtlwifi/rtl8192ce/reg.h+1−0

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

drivers/net/wireless/rtlwifi/rtl8192ce/sw.c+3−1

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

drivers/net/wireless/rtlwifi/rtl8192ce/trx.c+84−244

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

drivers/net/wireless/rtlwifi/rtl8192cu/hw.c+10−10

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

drivers/net/wireless/rtlwifi/rtl8192cu/sw.c+1−1

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

drivers/net/wireless/rtlwifi/rtl8192cu/trx.c+5−5

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

drivers/net/wireless/rtlwifi/rtl8192de/dm.c+16−16

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

drivers/net/wireless/rtlwifi/rtl8192de/hw.c+1−1

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

drivers/net/wireless/rtlwifi/rtl8192de/phy.c+20−20

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

drivers/net/wireless/rtlwifi/rtl8192de/reg.h+1−1

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

drivers/net/wireless/rtlwifi/rtl8192de/sw.c+3−3

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

drivers/net/wireless/rtlwifi/rtl8192de/trx.c+2−2

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

drivers/net/wireless/rtlwifi/rtl8192se/def.h+0−7

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

drivers/net/wireless/rtlwifi/rtl8192se/dm.c+32−17

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

drivers/net/wireless/rtlwifi/rtl8192se/hw.c+99−51

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

drivers/net/wireless/rtlwifi/rtl8192se/hw.h+2−1

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

drivers/net/wireless/rtlwifi/rtl8192se/phy.c+42−19

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

drivers/net/wireless/rtlwifi/rtl8192se/phy.h+1−0

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

drivers/net/wireless/rtlwifi/rtl8192se/sw.c+2−1

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

drivers/net/wireless/rtlwifi/rtl8192se/trx.c+26−274

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

drivers/net/wireless/rtlwifi/rtl8723ae/dm.c+81−7

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

drivers/net/wireless/rtlwifi/rtl8723ae/dm.h+6−0

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

drivers/net/wireless/rtlwifi/rtl8723ae/fw.c+96−1

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

drivers/net/wireless/rtlwifi/rtl8723ae/fw.h+5−2

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

drivers/net/wireless/rtlwifi/rtl8723ae/hw.c+47−23

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

drivers/net/wireless/rtlwifi/rtl8723ae/led.c+14−8

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

drivers/net/wireless/rtlwifi/rtl8723ae/sw.c+1−1

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

drivers/net/wireless/rtlwifi/rtl8723ae/trx.c+9−5

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

drivers/net/wireless/rtlwifi/usb.c+155−71

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

drivers/net/wireless/rtlwifi/usb.h+4−1

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

drivers/net/wireless/rtlwifi/wifi.h+202−22

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

drivers/net/wireless/ti/wl1251/main.c+3−2

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

drivers/net/wireless/ti/wl1251/sdio.c+3−1

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

drivers/net/wireless/ti/wl1251/spi.c+2−2

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

drivers/net/wireless/ti/wl12xx/cmd.c+1−1

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

drivers/net/wireless/ti/wl12xx/main.c+1−0

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

drivers/net/wireless/ti/wl12xx/wl12xx.h+2−0

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

drivers/net/wireless/ti/wl18xx/cmd.c+3−3

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

drivers/net/wireless/ti/wl18xx/main.c+24−1

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

drivers/net/wireless/ti/wl18xx/reg.h+29−0

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

drivers/net/wireless/ti/wl18xx/wl18xx.h+3−1

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

drivers/net/wireless/ti/wlcore/acx.c+29−0

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

drivers/net/wireless/ti/wlcore/acx.h+14−2

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

drivers/net/wireless/ti/wlcore/cmd.c+32−0

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

drivers/net/wireless/ti/wlcore/debug.h+16−17

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

drivers/net/wireless/ti/wlcore/debugfs.c+1−2

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

drivers/net/wireless/ti/wlcore/event.c+8−1

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

drivers/net/wireless/ti/wlcore/main.c+132−73

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

drivers/net/wireless/ti/wlcore/ps.c+3−1

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

drivers/net/wireless/ti/wlcore/tx.c+13−26

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

drivers/net/wireless/ti/wlcore/wlcore.h+3−0

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

drivers/net/wireless/ti/wlcore/wlcore_i.h+21−8

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

drivers/net/wireless/zd1211rw/zd_mac.c+2−2

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

drivers/net/xen-netback/netback.c+248−68

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

drivers/net/xen-netfront.c+27−20

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

drivers/nfc/Kconfig+10−0

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

drivers/nfc/Makefile+1−0

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

drivers/nfc/mei_phy.c+164−0

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

drivers/nfc/mei_phy.h+30−0

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

drivers/nfc/microread/Kconfig+1−1

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

drivers/nfc/microread/mei.c+9−130

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

drivers/nfc/pn533.c+455−198

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

drivers/nfc/pn544/Kconfig+12−1

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

drivers/nfc/pn544/Makefile+2−0

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

drivers/nfc/pn544/mei.c+121−0

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

drivers/of/of_mdio.c+58−6

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

drivers/pci/iov.c+41−0

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

drivers/ptp/ptp_clock.c+13−25

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

drivers/ptp/ptp_pch.c+15−14

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

drivers/s390/kvm/virtio_ccw.c+3−3

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

drivers/s390/net/qeth_core.h+2−2

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

drivers/s390/net/qeth_core_main.c+5−3

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

drivers/s390/net/qeth_l2_main.c+7−6

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

drivers/s390/net/qeth_l3_main.c+19−14

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

drivers/scsi/bnx2fc/bnx2fc.h+10−13

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

drivers/scsi/bnx2fc/bnx2fc_fcoe.c+20−15

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

drivers/scsi/bnx2fc/bnx2fc_hwi.c+13−9

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

drivers/scsi/bnx2fc/bnx2fc_io.c+5−4

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

drivers/scsi/csiostor/Makefile+2−1

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

drivers/scsi/csiostor/csio_hw.c+119−440

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

drivers/scsi/csiostor/csio_hw.h+18−29

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

drivers/scsi/csiostor/csio_hw_chip.h+175−0

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

drivers/scsi/csiostor/csio_hw_t4.c+403−0

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

drivers/scsi/csiostor/csio_hw_t5.c+397−0

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

drivers/scsi/csiostor/csio_init.c+38−10

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

drivers/scsi/csiostor/csio_init.h+4−25

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

drivers/scsi/csiostor/csio_lnode.h+1−1

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

drivers/scsi/csiostor/csio_rnode.c+9−1

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

drivers/scsi/csiostor/csio_rnode.h+1−1

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

drivers/scsi/csiostor/csio_wr.c+38−22

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

drivers/scsi/fcoe/fcoe.c+1−1

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

drivers/scsi/scsi_netlink.c+2−2

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

drivers/scsi/scsi_transport_fc.c+8−13

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

drivers/scsi/scsi_transport_iscsi.c+35−35

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

drivers/ssb/driver_chipcommon.c+1−1

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

drivers/ssb/driver_chipcommon_pmu.c+35−25

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

drivers/ssb/driver_mipscore.c+13−12

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

drivers/ssb/driver_pcicore.c+7−8

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

drivers/ssb/embedded.c+2−3

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

drivers/ssb/main.c+22−29

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

drivers/ssb/pci.c+63−57

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

drivers/ssb/pcmcia.c+20−26

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

drivers/ssb/scan.c+11−20

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

drivers/ssb/sprom.c+2−2

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

drivers/ssb/ssb_private.h+15−4

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

drivers/staging/gdm72xx/netlink_k.c+6−6

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

drivers/vhost/net.c+6−68

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

drivers/vhost/vhost.c+3−0

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

fs/dlm/lowcomms.c+1−1

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

include/linux/bcma/bcma.h+55−0

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

include/linux/bcma/bcma_driver_chipcommon.h+6−0

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

include/linux/bcma/bcma_regs.h+1−0

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

include/linux/cn_proc.h+4−0

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

include/linux/filter.h+15−0

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

include/linux/icmpv6.h+15−3

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

include/linux/ieee80211.h+108−17

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

include/linux/if_arp.h+10−2

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

include/linux/if_team.h+24−1

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

include/linux/if_vlan.h+37−19

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

include/linux/ktime.h+18−0

This diff is large: its 25 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/mlx4/cmd.h+6−0

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

include/linux/mlx4/cq.h+16−0

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

include/linux/mlx4/device.h+11−2

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

include/linux/mv643xx_eth.h+0−1

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

include/linux/netdev_features.h+17−10

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

include/linux/netdevice.h+53−26

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

include/linux/netfilter.h+0−5

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

include/linux/netfilter/ipset/ip_set.h+119−7

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

include/linux/netfilter/ipset/ip_set_ahash.h+0−1241

This diff is large: its 1242 lines aren’t shown here.

include/linux/netfilter/ipset/ip_set_bitmap.h+6−0

This diff is large: its 13 lines aren’t shown here.

include/linux/netfilter/ipset/ip_set_timeout.h+22−80

This diff is large: its 143 lines aren’t shown here.

include/linux/netfilter/ipset/pfxlen.h+9−0

This diff is large: its 14 lines aren’t shown here.

include/linux/netfilter/nfnetlink.h+7−4

This diff is large: its 18 lines aren’t shown here.

include/linux/netlink.h+10−1

This diff is large: its 29 lines aren’t shown here.

include/linux/netpoll.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/of_net.h+10−0

This diff is large: its 17 lines aren’t shown here.

include/linux/openvswitch.h+1−430

This diff is large: its 437 lines aren’t shown here.

include/linux/pci.h+5−0

This diff is large: its 19 lines aren’t shown here.

include/linux/phy.h+10−0

This diff is large: its 24 lines aren’t shown here.

include/linux/platform_data/brcmfmac-sdio.h+124−0

This diff is large: its 125 lines aren’t shown here.

include/linux/platform_data/cpsw.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/rtnetlink.h+9−0

This diff is large: its 16 lines aren’t shown here.

include/linux/sctp.h+2−4

This diff is large: its 25 lines aren’t shown here.

include/linux/sh_eth.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/skbuff.h+94−1

This diff is large: its 182 lines aren’t shown here.

include/linux/sock_diag.h+3−0

This diff is large: its 16 lines aren’t shown here.

include/linux/socket.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/spi/at86rf230.h+14−0

This diff is large: its 21 lines aren’t shown here.

include/linux/ssb/ssb.h+54−6

This diff is large: its 78 lines aren’t shown here.

include/linux/ssb/ssb_regs.h+5−5

This diff is large: its 17 lines aren’t shown here.

include/linux/tcp.h+3−18

This diff is large: its 66 lines aren’t shown here.

include/linux/usb/usbnet.h+2−0

This diff is large: its 15 lines aren’t shown here.

include/linux/virtio.h+0−6

This diff is large: its 13 lines aren’t shown here.

include/linux/vm_sockets.h+23−0

This diff is large: its 24 lines aren’t shown here.

include/net/af_unix.h+5−3

This diff is large: its 23 lines aren’t shown here.

include/net/bluetooth/bluetooth.h+14−3

This diff is large: its 47 lines aren’t shown here.

include/net/bluetooth/hci.h+27−3

This diff is large: its 67 lines aren’t shown here.

include/net/bluetooth/hci_core.h+90−38

This diff is large: its 249 lines aren’t shown here.

include/net/bluetooth/l2cap.h+15−0

This diff is large: its 34 lines aren’t shown here.

include/net/bluetooth/rfcomm.h+0−6

This diff is large: its 20 lines aren’t shown here.

include/net/caif/caif_dev.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/net/caif/caif_device.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/net/caif/caif_hsi.h+0−1

This diff is large: its 7 lines aren’t shown here.

include/net/caif/caif_layer.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/net/caif/caif_shm.h+0−26

This diff is large: its 27 lines aren’t shown here.

include/net/caif/cfcnfg.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/net/caif/cfctrl.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/net/caif/cffrml.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/net/caif/cfmuxl.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/net/caif/cfpkt.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/net/caif/cfserl.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/net/caif/cfsrvl.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/net/cfg80211.h+144−20

This diff is large: its 318 lines aren’t shown here.

include/net/cls_cgroup.h+2−2

This diff is large: its 18 lines aren’t shown here.

include/net/dn_fib.h+6−22

This diff is large: its 56 lines aren’t shown here.

include/net/firewire.h+25−0

This diff is large: its 26 lines aren’t shown here.

include/net/genetlink.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/gre.h+51−0

This diff is large: its 66 lines aren’t shown here.

include/net/ieee802154_netdev.h+4−1

This diff is large: its 26 lines aren’t shown here.

include/net/if_inet6.h+4−0

This diff is large: its 18 lines aren’t shown here.

include/net/inet_connection_sock.h+4−1

This diff is large: its 19 lines aren’t shown here.

include/net/inet_frag.h+22−2

This diff is large: its 55 lines aren’t shown here.

include/net/ip6_tunnel.h+21−0

This diff is large: its 33 lines aren’t shown here.

include/net/ip_tunnels.h+177−0

This diff is large: its 178 lines aren’t shown here.

include/net/ip_vs.h+93−47

This diff is large: its 371 lines aren’t shown here.

include/net/ipip.h+0−87

This diff is large: its 88 lines aren’t shown here.

include/net/ipv6.h+18−4

This diff is large: its 57 lines aren’t shown here.

include/net/mac80211.h+162−62

This diff is large: its 562 lines aren’t shown here.

include/net/net_namespace.h+2−0

This diff is large: its 16 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_conntrack_core.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/netfilter/nf_conntrack_expect.h+2−2

This diff is large: its 18 lines aren’t shown here.

include/net/netfilter/nf_log.h+10−4

This diff is large: its 23 lines aren’t shown here.

include/net/netfilter/nf_queue.h+6−0

This diff is large: its 22 lines aren’t shown here.

include/net/netns/ipv6.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/netns/netfilter.h+18−0

This diff is large: its 19 lines aren’t shown here.

include/net/netprio_cgroup.h+2−2

This diff is large: its 18 lines aren’t shown here.

include/net/nfc/nfc.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/net/request_sock.h+2−8

This diff is large: its 30 lines aren’t shown here.

include/net/rtnetlink.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/scm.h+6−10

This diff is large: its 47 lines aren’t shown here.

include/net/sctp/checksum.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/sctp/constants.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/net/sctp/structs.h+3−17

This diff is large: its 71 lines aren’t shown here.

include/net/sctp/ulpqueue.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/net/secure_seq.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/sock.h+3−3

This diff is large: its 21 lines aren’t shown here.

include/net/tcp.h+7−139

This diff is large: its 230 lines aren’t shown here.

include/net/xfrm.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/asm-generic/socket.h+2−0

This diff is large: its 7 lines aren’t shown here.

include/uapi/linux/Kbuild+2−0

This diff is large: its 16 lines aren’t shown here.

include/uapi/linux/caif/caif_socket.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/uapi/linux/caif/if_caif.h+1−1

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/cn_proc.h+9−1

This diff is large: its 29 lines aren’t shown here.

include/uapi/linux/filter.h+2−1

This diff is large: its 10 lines aren’t shown here.

include/uapi/linux/if_ether.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/uapi/linux/if_link.h+5−2

This diff is large: its 39 lines aren’t shown here.

include/uapi/linux/if_packet.h+18−11

This diff is large: its 45 lines aren’t shown here.

include/uapi/linux/ip_vs.h+2−2

This diff is large: its 11 lines aren’t shown here.

include/uapi/linux/neighbour.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/uapi/linux/netfilter/ipset/ip_set.h+32−4

This diff is large: its 85 lines aren’t shown here.

include/uapi/linux/netfilter/nfnetlink_queue.h+9−1

This diff is large: its 23 lines aren’t shown here.

include/uapi/linux/netfilter/xt_NFQUEUE.h+9−0

This diff is large: its 14 lines aren’t shown here.

include/uapi/linux/netfilter/xt_set.h+9−0

This diff is large: its 14 lines aren’t shown here.

include/uapi/linux/netfilter_ipv6/ip6t_frag.h+2−2

This diff is large: its 12 lines aren’t shown here.

include/uapi/linux/netlink.h+33−1

This diff is large: its 60 lines aren’t shown here.

include/uapi/linux/netlink_diag.h+52−0

This diff is large: its 53 lines aren’t shown here.

include/uapi/linux/nfc.h+19−0

This diff is large: its 43 lines aren’t shown here.

include/uapi/linux/nl80211.h+145−11

This diff is large: its 259 lines aren’t shown here.

include/uapi/linux/openvswitch.h+456−0

This diff is large: its 457 lines aren’t shown here.

include/uapi/linux/packet_diag.h+5−0

This diff is large: its 19 lines aren’t shown here.

include/uapi/linux/pkt_sched.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/rfkill.h+2−0

This diff is large: its 16 lines aren’t shown here.

include/uapi/linux/sctp.hrenamed from include/net/sctp/user.h+74−10

This diff is large: its 187 lines aren’t shown here.

include/uapi/linux/snmp.h+8−0

This diff is large: its 57 lines aren’t shown here.

include/uapi/linux/tcp.h+0−26

This diff is large: its 38 lines aren’t shown here.

include/uapi/linux/vm_sockets.h+8−15

This diff is large: its 45 lines aren’t shown here.

include/uapi/linux/xfrm.h+3−0

This diff is large: its 17 lines aren’t shown here.

include/xen/interface/io/netif.h+19−0

This diff is large: its 33 lines aren’t shown here.

kernel/audit.c+5−5

This diff is large: its 43 lines aren’t shown here.

kernel/signal.c+2−0

This diff is large: its 16 lines aren’t shown here.

net/802/garp.c+4−0

This diff is large: its 13 lines aren’t shown here.

net/8021q/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

net/8021q/vlan.c+35−62

This diff is large: its 266 lines aren’t shown here.

net/8021q/vlan.h+49−9

This diff is large: its 120 lines aren’t shown here.

net/8021q/vlan_core.c+50−30

This diff is large: its 232 lines aren’t shown here.

net/8021q/vlan_dev.c+6−5

This diff is large: its 43 lines aren’t shown here.

net/8021q/vlan_gvrp.c+4−0

This diff is large: its 18 lines aren’t shown here.

net/8021q/vlan_mvrp.c+4−0

This diff is large: its 18 lines aren’t shown here.

net/8021q/vlan_netlink.c+26−6

This diff is large: its 75 lines aren’t shown here.

net/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

net/appletalk/ddp.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/atm/lec.h+1−1

This diff is large: its 9 lines aren’t shown here.

net/batman-adv/Kconfig+14−0

This diff is large: its 21 lines aren’t shown here.

net/batman-adv/Makefile+2−1

This diff is large: its 15 lines aren’t shown here.

net/batman-adv/bat_iv_ogm.c+5−0

This diff is large: its 19 lines aren’t shown here.

net/batman-adv/bridge_loop_avoidance.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/batman-adv/debugfs.c+18−0

This diff is large: its 53 lines aren’t shown here.

net/batman-adv/distributed-arp-table.c+4−18

This diff is large: its 74 lines aren’t shown here.

net/batman-adv/gateway_client.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/batman-adv/hard-interface.c+54−12

This diff is large: its 139 lines aren’t shown here.

net/batman-adv/hard-interface.h+12−1

This diff is large: its 26 lines aren’t shown here.

net/batman-adv/main.c+15−1

This diff is large: its 65 lines aren’t shown here.

net/batman-adv/main.h+13−2

This diff is large: its 55 lines aren’t shown here.

net/batman-adv/network-coding.c+1822−0

This diff is large: its 1823 lines aren’t shown here.

net/batman-adv/network-coding.h+123−0

This diff is large: its 124 lines aren’t shown here.

net/batman-adv/originator.c+8−2

This diff is large: its 45 lines aren’t shown here.

net/batman-adv/packet.h+33−0

This diff is large: its 45 lines aren’t shown here.

net/batman-adv/routing.c+42−19

This diff is large: its 145 lines aren’t shown here.

net/batman-adv/send.c+5−0

This diff is large: its 26 lines aren’t shown here.

net/batman-adv/soft-interface.c+199−89

This diff is large: its 371 lines aren’t shown here.

net/batman-adv/soft-interface.h+2−1

This diff is large: its 10 lines aren’t shown here.

net/batman-adv/sysfs.c+11−11

This diff is large: its 65 lines aren’t shown here.

net/batman-adv/translation-table.c+8−21

This diff is large: its 111 lines aren’t shown here.

net/batman-adv/types.h+136−0

This diff is large: its 192 lines aren’t shown here.

net/batman-adv/unicast.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/batman-adv/vis.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/bluetooth/a2mp.c+2−4

This diff is large: its 30 lines aren’t shown here.

net/bluetooth/af_bluetooth.c+5−13

This diff is large: its 37 lines aren’t shown here.

net/bluetooth/bnep/netdev.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bluetooth/bnep/sock.c+1−3

This diff is large: its 10 lines aren’t shown here.

net/bluetooth/cmtp/sock.c+1−3

This diff is large: its 10 lines aren’t shown here.

net/bluetooth/hci_conn.c+19−23

This diff is large: its 108 lines aren’t shown here.

net/bluetooth/hci_core.c+748−153

This diff is large: its 1228 lines aren’t shown here.

net/bluetooth/hci_event.c+186−595

This diff is large: its 1382 lines aren’t shown here.

net/bluetooth/hci_sock.c+6−3

This diff is large: its 22 lines aren’t shown here.

net/bluetooth/hci_sysfs.c+9−12

This diff is large: its 50 lines aren’t shown here.

net/bluetooth/hidp/core.c+586−408

This diff is large: its 1278 lines aren’t shown here.

net/bluetooth/hidp/hidp.h+31−36

This diff is large: its 108 lines aren’t shown here.

net/bluetooth/hidp/sock.c+7−19

This diff is large: its 54 lines aren’t shown here.

net/bluetooth/l2cap_core.c+122−12

This diff is large: its 243 lines aren’t shown here.

net/bluetooth/l2cap_sock.c+7−3

This diff is large: its 23 lines aren’t shown here.

net/bluetooth/mgmt.c+482−221

This diff is large: its 1235 lines aren’t shown here.

net/bluetooth/rfcomm/core.c+79−88

This diff is large: its 439 lines aren’t shown here.

net/bluetooth/rfcomm/sock.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/bluetooth/sco.c+43−9

This diff is large: its 108 lines aren’t shown here.

net/bluetooth/smp.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bridge/br_device.c+2−2

This diff is large: its 13 lines aren’t shown here.

net/bridge/br_fdb.c+17−13

This diff is large: its 79 lines aren’t shown here.

net/bridge/br_if.c+0−1

This diff is large: its 8 lines aren’t shown here.

net/bridge/br_mdb.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/bridge/br_multicast.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bridge/br_netfilter.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/bridge/br_netlink.c+6−15

This diff is large: its 58 lines aren’t shown here.

net/bridge/br_stp.c+8−1

This diff is large: its 16 lines aren’t shown here.

net/bridge/br_vlan.c+12−8

This diff is large: its 70 lines aren’t shown here.

net/bridge/netfilter/ebt_log.c+39−5

This diff is large: its 84 lines aren’t shown here.

net/bridge/netfilter/ebt_nflog.c+3−2

This diff is large: its 18 lines aren’t shown here.

net/bridge/netfilter/ebt_ulog.c+91−41

This diff is large: its 227 lines aren’t shown here.

net/bridge/netfilter/ebtable_broute.c+1−3

This diff is large: its 11 lines aren’t shown here.

net/bridge/netfilter/ebtables.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/caif/caif_dev.c+6−5

This diff is large: its 25 lines aren’t shown here.

net/caif/caif_socket.c+12−12

This diff is large: its 93 lines aren’t shown here.

net/caif/caif_usb.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/caif/cfcnfg.c+10−11

This diff is large: its 71 lines aren’t shown here.

net/caif/cfctrl.c+8−8

This diff is large: its 61 lines aren’t shown here.

net/caif/cfdbgl.c+1−1

This diff is large: its 8 lines aren’t shown here.

net/caif/cfdgml.c+1−1

This diff is large: its 8 lines aren’t shown here.

net/caif/cffrml.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/caif/cfmuxl.c+3−3

This diff is large: its 26 lines aren’t shown here.

net/caif/cfpkt_skbuff.c+5−5

This diff is large: its 30 lines aren’t shown here.

net/caif/cfrfml.c+3−3

This diff is large: its 26 lines aren’t shown here.

net/caif/cfserl.c+3−3

This diff is large: its 26 lines aren’t shown here.

net/caif/cfsrvl.c+7−8

This diff is large: its 42 lines aren’t shown here.

net/caif/cfutill.c+1−1

This diff is large: its 8 lines aren’t shown here.

net/caif/cfveil.c+1−1

This diff is large: its 8 lines aren’t shown here.

net/caif/cfvidl.c+1−1

This diff is large: its 8 lines aren’t shown here.

net/caif/chnl_net.c+5−5

This diff is large: its 37 lines aren’t shown here.

net/can/af_can.c+11−19

This diff is large: its 83 lines aren’t shown here.

net/can/gw.c+2−3

This diff is large: its 19 lines aren’t shown here.

net/can/raw.c+2−3

This diff is large: its 12 lines aren’t shown here.

net/core/datagram.c+17−9

This diff is large: its 90 lines aren’t shown here.

net/core/dev.c+68−52

This diff is large: its 275 lines aren’t shown here.

net/core/dev_addr_lists.c+168−42

This diff is large: its 337 lines aren’t shown here.

net/core/dst.c+5−4

This diff is large: its 33 lines aren’t shown here.

net/core/ethtool.c+17−12

This diff is large: its 63 lines aren’t shown here.

net/core/fib_rules.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/core/filter.c+5−0

This diff is large: its 26 lines aren’t shown here.

net/core/flow.c+39−3

This diff is large: its 69 lines aren’t shown here.

net/core/flow_dissector.c+68−0

This diff is large: its 89 lines aren’t shown here.

net/core/neighbour.c+23−32

This diff is large: its 175 lines aren’t shown here.

net/core/net-procfs.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/core/netpoll.c+11−11

This diff is large: its 86 lines aren’t shown here.

net/core/rtnetlink.c+93−85

This diff is large: its 332 lines aren’t shown here.

net/core/scm.c+2−18

This diff is large: its 34 lines aren’t shown here.

net/core/secure_seq.c+1−3

This diff is large: its 14 lines aren’t shown here.

net/core/skbuff.c+66−27

This diff is large: its 194 lines aren’t shown here.

net/core/sock.c+14−8

This diff is large: its 68 lines aren’t shown here.

net/core/sock_diag.c+33−0

This diff is large: its 40 lines aren’t shown here.

net/core/utils.c+2−3

This diff is large: its 19 lines aren’t shown here.

net/dcb/dcbevent.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/dcb/dcbnl.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/dccp/ipv4.c+2−3

This diff is large: its 19 lines aren’t shown here.

net/dccp/ipv6.c+2−3

This diff is large: its 19 lines aren’t shown here.

net/decnet/dn_dev.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/decnet/dn_fib.c+104−99

This diff is large: its 333 lines aren’t shown here.

net/decnet/dn_route.c+31−12

This diff is large: its 79 lines aren’t shown here.

net/decnet/dn_table.c+24−21

This diff is large: its 125 lines aren’t shown here.

net/decnet/netfilter/dn_rtmsg.c+6−6

This diff is large: its 36 lines aren’t shown here.

net/dsa/dsa.c+228−5

This diff is large: its 305 lines aren’t shown here.

net/ethernet/eth.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ieee802154/6lowpan.c+113−29

This diff is large: its 313 lines aren’t shown here.

net/ieee802154/6lowpan.h+4−3

This diff is large: its 14 lines aren’t shown here.

net/ieee802154/dgram.c+10−0

This diff is large: its 24 lines aren’t shown here.

net/ieee802154/netlink.c+4−4

This diff is large: its 22 lines aren’t shown here.

net/ieee802154/nl-mac.c+20−5

This diff is large: its 130 lines aren’t shown here.

net/ipv4/Kconfig+7−0

This diff is large: its 31 lines aren’t shown here.

net/ipv4/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/af_inet.c+9−6

This diff is large: its 61 lines aren’t shown here.

net/ipv4/arp.c+21−6

This diff is large: its 41 lines aren’t shown here.

net/ipv4/devinet.c+78−5

This diff is large: its 131 lines aren’t shown here.

net/ipv4/fib_frontend.c+5−5

This diff is large: its 38 lines aren’t shown here.

net/ipv4/gre.c+0−5

This diff is large: its 12 lines aren’t shown here.

net/ipv4/icmp.c+3−1

This diff is large: its 18 lines aren’t shown here.

net/ipv4/inet_connection_sock.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/inet_diag.c+6−4

This diff is large: its 38 lines aren’t shown here.

net/ipv4/inet_fragment.c+69−15

This diff is large: its 181 lines aren’t shown here.

net/ipv4/inet_lro.c+2−3

This diff is large: its 21 lines aren’t shown here.

net/ipv4/ip_fragment.c+1−30

This diff is large: its 50 lines aren’t shown here.

net/ipv4/ip_gre.c+317−1200

This diff is large: its 1856 lines aren’t shown here.

net/ipv4/ip_input.c+3−1

This diff is large: its 18 lines aren’t shown here.

net/ipv4/ip_output.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/ipv4/ip_tunnel.c+1035−0

This diff is large: its 1036 lines aren’t shown here.

net/ipv4/ip_vti.c+2−40

This diff is large: its 63 lines aren’t shown here.

net/ipv4/ipcomp.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/ipconfig.c+12−1

This diff is large: its 33 lines aren’t shown here.

net/ipv4/ipip.c+59−689

This diff is large: its 916 lines aren’t shown here.

net/ipv4/ipmr.c+6−6

This diff is large: its 39 lines aren’t shown here.

net/ipv4/netfilter.c+10−5

This diff is large: its 46 lines aren’t shown here.

net/ipv4/netfilter/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/netfilter/arp_tables.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/netfilter/arptable_filter.c+1−3

This diff is large: its 11 lines aren’t shown here.

net/ipv4/netfilter/ip_tables.c+5−5

This diff is large: its 45 lines aren’t shown here.

net/ipv4/netfilter/ipt_ULOG.c+92−42

This diff is large: its 257 lines aren’t shown here.

net/ipv4/netfilter/iptable_mangle.c+6−3

This diff is large: its 23 lines aren’t shown here.

net/ipv4/netfilter/iptable_nat.c+15−8

This diff is large: its 56 lines aren’t shown here.

net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/netfilter/nf_conntrack_l3proto_ipv4_compat.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/netfilter/nf_conntrack_proto_icmp.c+5−4

This diff is large: its 36 lines aren’t shown here.

net/ipv4/netfilter/nf_nat_h323.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/netfilter/nf_nat_pptp.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/ipv4/netfilter/nf_nat_proto_gre.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/ipv4/netfilter/nf_nat_snmp_basic.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/ipv4/ping.c+2−3

This diff is large: its 12 lines aren’t shown here.

net/ipv4/proc.c+10−3

This diff is large: its 61 lines aren’t shown here.

net/ipv4/route.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/syncookies.c+1−2

This diff is large: its 17 lines aren’t shown here.

net/ipv4/sysctl_net_ipv4.c+2−16

This diff is large: its 46 lines aren’t shown here.

net/ipv4/tcp.c+18−269

This diff is large: its 359 lines aren’t shown here.

net/ipv4/tcp_input.c+144−463

This diff is large: its 940 lines aren’t shown here.

net/ipv4/tcp_ipv4.c+64−59

This diff is large: its 231 lines aren’t shown here.

net/ipv4/tcp_memcontrol.c+0−3

This diff is large: its 17 lines aren’t shown here.

net/ipv4/tcp_minisocks.c+12−39

This diff is large: its 127 lines aren’t shown here.

net/ipv4/tcp_output.c+150−227

This diff is large: its 544 lines aren’t shown here.

net/ipv4/tcp_timer.c+11−10

This diff is large: its 55 lines aren’t shown here.

net/ipv4/tcp_westwood.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/udp.c+102−30

This diff is large: its 210 lines aren’t shown here.

net/ipv4/udp_diag.c+5−5

This diff is large: its 28 lines aren’t shown here.

net/ipv4/xfrm4_mode_tunnel.c+6−2

This diff is large: its 15 lines aren’t shown here.

net/ipv6/Kconfig+2−0

This diff is large: its 16 lines aren’t shown here.

net/ipv6/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/addrconf.c+197−11

This diff is large: its 365 lines aren’t shown here.

net/ipv6/addrlabel.c+2−10

This diff is large: its 42 lines aren’t shown here.

net/ipv6/af_inet6.c+3−4

This diff is large: its 28 lines aren’t shown here.

net/ipv6/datagram.c+12−8

This diff is large: its 66 lines aren’t shown here.

net/ipv6/icmp.c+24−17

This diff is large: its 127 lines aren’t shown here.

net/ipv6/inet6_connection_sock.c+6−4

This diff is large: its 24 lines aren’t shown here.

net/ipv6/ip6_flowlabel.c+8−3

This diff is large: its 32 lines aren’t shown here.

net/ipv6/ip6_gre.c+4−58

This diff is large: its 106 lines aren’t shown here.

net/ipv6/ip6_icmp.c+47−0

This diff is large: its 48 lines aren’t shown here.

net/ipv6/ip6_offload.c+1−3

This diff is large: its 16 lines aren’t shown here.

net/ipv6/ip6_output.c+2−5

This diff is large: its 14 lines aren’t shown here.

net/ipv6/ip6_tunnel.c+2−14

This diff is large: its 37 lines aren’t shown here.

net/ipv6/ip6mr.c+5−5

This diff is large: its 29 lines aren’t shown here.

net/ipv6/ndisc.c+0−2

This diff is large: its 9 lines aren’t shown here.

net/ipv6/netfilter.c+9−3

This diff is large: its 37 lines aren’t shown here.

net/ipv6/netfilter/Kconfig+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/netfilter/ip6_tables.c+3−1

This diff is large: its 25 lines aren’t shown here.

net/ipv6/netfilter/ip6t_NPT.c+3−8

This diff is large: its 26 lines aren’t shown here.

net/ipv6/netfilter/ip6t_REJECT.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/ipv6/netfilter/ip6table_mangle.c+6−3

This diff is large: its 23 lines aren’t shown here.

net/ipv6/netfilter/ip6table_nat.c+15−8

This diff is large: its 56 lines aren’t shown here.

net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c+2−6

This diff is large: its 15 lines aren’t shown here.

net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c+4−3

This diff is large: its 28 lines aren’t shown here.

net/ipv6/netfilter/nf_conntrack_reasm.c+20−2

This diff is large: its 98 lines aren’t shown here.

net/ipv6/proc.c+4−0

This diff is large: its 32 lines aren’t shown here.

net/ipv6/raw.c+4−5

This diff is large: its 30 lines aren’t shown here.

net/ipv6/reassembly.c+21−2

This diff is large: its 103 lines aren’t shown here.

net/ipv6/route.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/ipv6/sit.c+4−37

This diff is large: its 69 lines aren’t shown here.

net/ipv6/syncookies.c+1−2

This diff is large: its 17 lines aren’t shown here.

net/ipv6/tcp_ipv6.c+14−61

This diff is large: its 158 lines aren’t shown here.

net/ipv6/udp.c+22−12

This diff is large: its 98 lines aren’t shown here.

net/ipv6/udp_offload.c+7−1

This diff is large: its 22 lines aren’t shown here.

net/ipv6/xfrm6_mode_tunnel.c+5−2

This diff is large: its 14 lines aren’t shown here.

net/irda/af_irda.c+2−3

This diff is large: its 19 lines aren’t shown here.

net/irda/ircomm/ircomm_core.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/irda/irlmp.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/iucv/af_iucv.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/l2tp/l2tp_core.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/mac80211/cfg.c+157−78

This diff is large: its 523 lines aren’t shown here.

net/mac80211/chan.c+39−15

This diff is large: its 111 lines aren’t shown here.

net/mac80211/debugfs_key.c+5−5

This diff is large: its 45 lines aren’t shown here.

net/mac80211/debugfs_netdev.c+22−11

This diff is large: its 105 lines aren’t shown here.

net/mac80211/debugfs_sta.c+33−0

This diff is large: its 55 lines aren’t shown here.

net/mac80211/driver-ops.h+24−43

This diff is large: its 105 lines aren’t shown here.

net/mac80211/ht.c+25−27

This diff is large: its 111 lines aren’t shown here.

net/mac80211/ibss.c+76−99

This diff is large: its 363 lines aren’t shown here.

net/mac80211/ieee80211_i.h+35−51

This diff is large: its 299 lines aren’t shown here.

net/mac80211/iface.c+99−51

This diff is large: its 285 lines aren’t shown here.

net/mac80211/key.c+139−69

This diff is large: its 288 lines aren’t shown here.

net/mac80211/key.h+10−8

This diff is large: its 34 lines aren’t shown here.

net/mac80211/main.c+67−92

This diff is large: its 280 lines aren’t shown here.

net/mac80211/mesh.c+7−63

This diff is large: its 159 lines aren’t shown here.

net/mac80211/mesh.h+2−13

This diff is large: its 42 lines aren’t shown here.

net/mac80211/mesh_hwmp.c+12−16

This diff is large: its 78 lines aren’t shown here.

net/mac80211/mesh_pathtbl.c+28−28

This diff is large: its 109 lines aren’t shown here.

net/mac80211/mesh_plink.c+11−32

This diff is large: its 93 lines aren’t shown here.

net/mac80211/mlme.c+310−244

This diff is large: its 975 lines aren’t shown here.

net/mac80211/offchannel.c+8−8

This diff is large: its 58 lines aren’t shown here.

net/mac80211/pm.c+16−116

This diff is large: its 194 lines aren’t shown here.

net/mac80211/rate.c+268−56

This diff is large: its 390 lines aren’t shown here.

net/mac80211/rc80211_minstrel.c+193−149

This diff is large: its 479 lines aren’t shown here.

net/mac80211/rc80211_minstrel.h+29−5

This diff is large: its 72 lines aren’t shown here.

net/mac80211/rc80211_minstrel_debugfs.c+9−7

This diff is large: its 33 lines aren’t shown here.

net/mac80211/rc80211_minstrel_ht.c+159−114

This diff is large: its 515 lines aren’t shown here.

net/mac80211/rc80211_minstrel_ht.h+3−5

This diff is large: its 29 lines aren’t shown here.

net/mac80211/rx.c+45−40

This diff is large: its 199 lines aren’t shown here.

net/mac80211/scan.c+8−12

This diff is large: its 84 lines aren’t shown here.

net/mac80211/sta_info.c+24−32

This diff is large: its 112 lines aren’t shown here.

net/mac80211/sta_info.h+5−6

This diff is large: its 39 lines aren’t shown here.

net/mac80211/trace.h+61−36

This diff is large: its 216 lines aren’t shown here.

net/mac80211/tx.c+55−108

This diff is large: its 290 lines aren’t shown here.

net/mac80211/util.c+132−92

This diff is large: its 409 lines aren’t shown here.

net/mac80211/vht.c+211−1

This diff is large: its 238 lines aren’t shown here.

net/mac802154/mac802154.h+2−3

This diff is large: its 18 lines aren’t shown here.

net/mac802154/mac_cmd.c+1−0

This diff is large: its 6 lines aren’t shown here.

net/mac802154/mib.c+20−1

This diff is large: its 52 lines aren’t shown here.

net/mac802154/tx.c+19−10

This diff is large: its 81 lines aren’t shown here.

net/mac802154/wpan.c+3−1

This diff is large: its 18 lines aren’t shown here.

net/netfilter/core.c+24−6

This diff is large: its 54 lines aren’t shown here.

net/netfilter/ipset/ip_set_bitmap_gen.h+277−0

This diff is large: its 278 lines aren’t shown here.

net/netfilter/ipset/ip_set_bitmap_ip.c+128−283

This diff is large: its 589 lines aren’t shown here.

net/netfilter/ipset/ip_set_bitmap_ipmac.c+225−399

This diff is large: its 824 lines aren’t shown here.

net/netfilter/ipset/ip_set_bitmap_port.c+130−284

This diff is large: its 582 lines aren’t shown here.

net/netfilter/ipset/ip_set_core.c+30−11

This diff is large: its 103 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_gen.h+1100−0

This diff is large: its 1101 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_ip.c+98−246

This diff is large: its 534 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_ipport.c+118−244

This diff is large: its 605 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_ipportip.c+121−247

This diff is large: its 619 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_ipportnet.c+162−307

This diff is large: its 797 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_net.c+127−275

This diff is large: its 639 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_netiface.c+165−313

This diff is large: its 794 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_netport.c+153−303

This diff is large: its 766 lines aren’t shown here.

net/netfilter/ipset/ip_set_list_set.c+371−251

This diff is large: its 884 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_app.c+21−10

This diff is large: its 87 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_conn.c+168−144

This diff is large: its 691 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_core.c+31−57

This diff is large: its 222 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_ctl.c+347−355

This diff is large: its 1539 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_dh.c+47−39

This diff is large: its 203 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_est.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_ftp.c+4−0

This diff is large: its 29 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_lblc.c+64−51

This diff is large: its 316 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_lblcr.c+99−91

This diff is large: its 492 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_lc.c+2−1

This diff is large: its 17 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_nq.c+2−1

This diff is large: its 17 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_pe.c+13−42

This diff is large: its 109 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_pe_sip.c+4−6

This diff is large: its 34 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_proto_sctp.c+16−22

This diff is large: its 127 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_proto_tcp.c+17−23

This diff is large: its 134 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_proto_udp.c+13−20

This diff is large: its 107 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_rr.c+40−24

This diff is large: its 102 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_sched.c+29−34

This diff is large: its 168 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_sed.c+3−2

This diff is large: its 26 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_sh.c+47−39

This diff is large: its 201 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_sync.c+22−34

This diff is large: its 189 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_wlc.c+3−2

This diff is large: its 26 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_wrr.c+107−69

This diff is large: its 255 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_xmit.c+442−608

This diff is large: its 1620 lines aren’t shown here.

net/netfilter/nf_conntrack_amanda.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_conntrack_core.c+38−18

This diff is large: its 110 lines aren’t shown here.

net/netfilter/nf_conntrack_ecache.c+5−3

This diff is large: its 14 lines aren’t shown here.

net/netfilter/nf_conntrack_expect.c+5−4

This diff is large: its 44 lines aren’t shown here.

net/netfilter/nf_conntrack_ftp.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_conntrack_h323_main.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_conntrack_helper.c+2−1

This diff is large: its 17 lines aren’t shown here.

net/netfilter/nf_conntrack_irc.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_conntrack_netlink.c+95−5

This diff is large: its 114 lines aren’t shown here.

net/netfilter/nf_conntrack_pptp.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nf_conntrack_proto.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_dccp.c+5−4

This diff is large: its 35 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_gre.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_sctp.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_tcp.c+11−9

This diff is large: its 82 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_udp.c+4−3

This diff is large: its 34 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_udplite.c+4−4

This diff is large: its 36 lines aren’t shown here.

net/netfilter/nf_conntrack_standalone.c+11−6

This diff is large: its 34 lines aren’t shown here.

net/netfilter/nf_conntrack_tftp.c+1−1

This diff is large: its 7 lines aren’t shown here.

net/netfilter/nf_log.c+148−58

This diff is large: its 369 lines aren’t shown here.

net/netfilter/nf_nat_amanda.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_nat_core.c+6−4

This diff is large: its 32 lines aren’t shown here.

net/netfilter/nf_nat_helper.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/nf_nat_proto_sctp.c+2−3

This diff is large: its 19 lines aren’t shown here.

net/netfilter/nf_queue.c+41−107

This diff is large: its 204 lines aren’t shown here.

net/netfilter/nfnetlink.c+17−10

This diff is large: its 67 lines aren’t shown here.

net/netfilter/nfnetlink_log.c+130−69

This diff is large: its 526 lines aren’t shown here.

net/netfilter/nfnetlink_queue_core.c+339−100

This diff is large: its 780 lines aren’t shown here.

net/netfilter/x_tables.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/xt_LOG.c+49−3

This diff is large: its 89 lines aren’t shown here.

net/netfilter/xt_NFQUEUE.c+51−12

This diff is large: its 101 lines aren’t shown here.

net/netfilter/xt_TCPMSS.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/xt_conntrack.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/xt_hashlimit.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/netfilter/xt_limit.c+1−0

This diff is large: its 7 lines aren’t shown here.

net/netfilter/xt_osf.c+4−2

This diff is large: its 27 lines aren’t shown here.

net/netfilter/xt_set.c+78−16

This diff is large: its 152 lines aren’t shown here.

net/netlink/Kconfig+19−0

This diff is large: its 20 lines aren’t shown here.

net/netlink/Makefile+3−0

This diff is large: its 7 lines aren’t shown here.

net/netlink/af_netlink.c+804−96

This diff is large: its 1123 lines aren’t shown here.

net/netlink/af_netlink.h+82−0

This diff is large: its 83 lines aren’t shown here.

net/netlink/diag.c+227−0

This diff is large: its 228 lines aren’t shown here.

net/netlink/genetlink.c+79−40

This diff is large: its 292 lines aren’t shown here.

net/netrom/af_netrom.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/nfc/Kconfig+1−1

This diff is large: its 15 lines aren’t shown here.

net/nfc/Makefile+4−2

This diff is large: its 11 lines aren’t shown here.

net/nfc/core.c+43−0

This diff is large: its 85 lines aren’t shown here.

net/nfc/llcp.hrenamed from net/nfc/llcp/llcp.h+37−2

This diff is large: its 93 lines aren’t shown here.

net/nfc/llcp/Kconfig+0−7

This diff is large: its 8 lines aren’t shown here.

net/nfc/llcp_commands.crenamed from net/nfc/llcp/commands.c+186−43

This diff is large: its 395 lines aren’t shown here.

net/nfc/llcp_core.crenamed from net/nfc/llcp/llcp.c+193−48

This diff is large: its 433 lines aren’t shown here.

net/nfc/llcp_sock.crenamed from net/nfc/llcp/sock.c+162−9

This diff is large: its 228 lines aren’t shown here.

net/nfc/netlink.c+173−2

This diff is large: its 210 lines aren’t shown here.

net/nfc/nfc.h+5−55

This diff is large: its 81 lines aren’t shown here.

net/openvswitch/actions.c+3−3

This diff is large: its 27 lines aren’t shown here.

net/openvswitch/datapath.c+258−163

This diff is large: its 1017 lines aren’t shown here.

net/openvswitch/datapath.h+48−24

This diff is large: its 113 lines aren’t shown here.

net/openvswitch/dp_notify.c+57−25

This diff is large: its 104 lines aren’t shown here.

net/openvswitch/flow.c+4−4

This diff is large: its 36 lines aren’t shown here.

net/openvswitch/flow.h+0−21

This diff is large: its 28 lines aren’t shown here.

net/openvswitch/vport-internal_dev.c+9−13

This diff is large: its 85 lines aren’t shown here.

net/openvswitch/vport-netdev.c+7−8

This diff is large: its 54 lines aren’t shown here.

net/openvswitch/vport-netdev.h+0−1

This diff is large: its 7 lines aren’t shown here.

net/openvswitch/vport.c+28−30

This diff is large: its 179 lines aren’t shown here.

net/openvswitch/vport.h+6−15

This diff is large: its 80 lines aren’t shown here.

net/packet/af_packet.c+190−112

This diff is large: its 608 lines aren’t shown here.

net/packet/diag.c+22−5

This diff is large: its 55 lines aren’t shown here.

net/packet/internal.h+6−4

This diff is large: its 42 lines aren’t shown here.

net/phonet/pn_netlink.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/rfkill/core.c+3−1

This diff is large: its 18 lines aren’t shown here.

net/rfkill/rfkill-gpio.c+5−2

This diff is large: its 22 lines aren’t shown here.

net/rfkill/rfkill-regulator.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/act_api.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/act_csum.c+25−14

This diff is large: its 178 lines aren’t shown here.

net/sched/act_ipt.c+30−3

This diff is large: its 56 lines aren’t shown here.

net/sched/cls_api.c+7−7

This diff is large: its 50 lines aren’t shown here.

net/sched/cls_flow.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/em_ipset.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sched/sch_api.c+25−19

This diff is large: its 125 lines aren’t shown here.

net/sched/sch_htb.c+16−15

This diff is large: its 79 lines aren’t shown here.

net/sctp/associola.c+4−8

This diff is large: its 40 lines aren’t shown here.

net/sctp/bind_addr.c+0−7

This diff is large: its 21 lines aren’t shown here.

net/sctp/endpointola.c+5−9

This diff is large: its 42 lines aren’t shown here.

net/sctp/inqueue.c+0−7

This diff is large: its 21 lines aren’t shown here.

net/sctp/output.c+1−4

This diff is large: its 19 lines aren’t shown here.

net/sctp/outqueue.c+2−9

This diff is large: its 34 lines aren’t shown here.

net/sctp/probe.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sctp/proc.c+9−3

This diff is large: its 29 lines aren’t shown here.

net/sctp/socket.c+5−3

This diff is large: its 23 lines aren’t shown here.

net/sctp/ssnmap.c+12−11

This diff is large: its 35 lines aren’t shown here.

net/sctp/transport.c+0−1

This diff is large: its 8 lines aren’t shown here.

net/sctp/ulpqueue.c+0−3

This diff is large: its 17 lines aren’t shown here.

net/socket.c+5−18

This diff is large: its 56 lines aren’t shown here.

net/tipc/Kconfig+7−0

This diff is large: its 11 lines aren’t shown here.

net/tipc/Makefile+2−0

This diff is large: its 6 lines aren’t shown here.

net/tipc/bcast.c+2−2

This diff is large: its 13 lines aren’t shown here.

net/tipc/bearer.c+2−5

This diff is large: its 28 lines aren’t shown here.

net/tipc/bearer.h+12−4

This diff is large: its 52 lines aren’t shown here.

net/tipc/core.c+10−2

This diff is large: its 26 lines aren’t shown here.

net/tipc/discover.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/tipc/eth_media.c+12−27

This diff is large: its 93 lines aren’t shown here.

net/tipc/ib_media.c+387−0

This diff is large: its 388 lines aren’t shown here.

net/tipc/netlink.c+3−3

This diff is large: its 20 lines aren’t shown here.

net/unix/af_unix.c+23−22

This diff is large: its 144 lines aren’t shown here.

net/unix/garbage.c+6−6

This diff is large: its 47 lines aren’t shown here.

net/vmw_vsock/af_vsock.c+2−2

This diff is large: its 25 lines aren’t shown here.

net/vmw_vsock/vmci_transport.c+13−3

This diff is large: its 51 lines aren’t shown here.

net/vmw_vsock/vmci_transport.h+3−0

This diff is large: its 10 lines aren’t shown here.

net/wireless/ap.c+0−62

This diff is large: its 66 lines aren’t shown here.

net/wireless/core.c+44−33

This diff is large: its 99 lines aren’t shown here.

net/wireless/core.h+14−11

This diff is large: its 56 lines aren’t shown here.

net/wireless/mesh.c+1−14

This diff is large: its 29 lines aren’t shown here.

net/wireless/mlme.c+39−196

This diff is large: its 317 lines aren’t shown here.

net/wireless/nl80211.c+1444−698

This diff is large: its 2895 lines aren’t shown here.

net/wireless/nl80211.h+0−68

This diff is large: its 98 lines aren’t shown here.

net/wireless/rdev-ops.h+40−4

This diff is large: its 65 lines aren’t shown here.

net/wireless/reg.c+4−4

This diff is large: its 27 lines aren’t shown here.

net/wireless/sme.c+16−12

This diff is large: its 49 lines aren’t shown here.

net/wireless/sysfs.c+20−5

This diff is large: its 40 lines aren’t shown here.

net/wireless/trace.h+81−0

This diff is large: its 95 lines aren’t shown here.

net/wireless/util.c+25−5

This diff is large: its 53 lines aren’t shown here.

net/xfrm/xfrm_policy.c+21−2

This diff is large: its 44 lines aren’t shown here.

net/xfrm/xfrm_state.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/xfrm/xfrm_user.c+15−2

This diff is large: its 54 lines aren’t shown here.

security/selinux/hooks.c+2−2

This diff is large: its 18 lines aren’t shown here.

security/selinux/netlink.c+1−2

This diff is large: its 17 lines aren’t shown here.

tools/Makefile+6−5

This diff is large: its 49 lines aren’t shown here.

tools/net/Makefile+15−0

This diff is large: its 16 lines aren’t shown here.

tools/net/bpf_jit_disasm.c+199−0

This diff is large: its 200 lines aren’t shown here.

tools/testing/selftests/Makefile+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/net/.gitignore+3−0

This diff is large: its 4 lines aren’t shown here.

tools/testing/selftests/net/Makefile+19−0

This diff is large: its 20 lines aren’t shown here.

tools/testing/selftests/net/psock_fanout.c+312−0

This diff is large: its 313 lines aren’t shown here.

tools/testing/selftests/net/psock_lib.h+127−0

This diff is large: its 128 lines aren’t shown here.

tools/testing/selftests/net/psock_tpacket.c+824−0

This diff is large: its 825 lines aren’t shown here.

tools/testing/selftests/net/run_afpackettests+26−0

This diff is large: its 27 lines aren’t shown here.

tools/testing/selftests/net/run_netsocktests+12−0

This diff is large: its 13 lines aren’t shown here.

tools/testing/selftests/net/socket.c+92−0

This diff is large: its 93 lines aren’t shown here.