History

Merge tag 'net-next-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next

Pull networking updates from Paolo Abeni: "Core: - Allow live renaming when an interface is up - Add retpoline wrappers for tc, improving considerably the performances of complex queue discipline configurations - Add inet drop monitor support - A few GRO performance improvements - Add infrastructure for atomic dev stats, addressing long standing data races - De-duplicate common code between OVS and conntrack offloading infrastructure - A bunch of UBSAN_BOUNDS/FORTIFY_SOURCE improvements - Netfilter: introduce packet parser for tunneled packets - Replace IPVS timer-based estimators with kthreads to scale up the workload with the number of available CPUs - Add the helper support for connection-tracking OVS offload BPF: - Support for user defined BPF objects: the use case is to allocate own objects, build own object hierarchies and use the building blocks to build own data structures flexibly, for example, linked lists in BPF - Make cgroup local storage available to non-cgroup attached BPF programs - Avoid unnecessary deadlock detection and failures wrt BPF task storage helpers - A relevant bunch of BPF verifier fixes and improvements - Veristat tool improvements to support custom filtering, sorting, and replay of results - Add LLVM disassembler as default library for dumping JITed code - Lots of new BPF documentation for various BPF maps - Add bpf_rcu_read_{,un}lock() support for sleepable programs - Add RCU grace period chaining to BPF to wait for the completion of access from both sleepable and non-sleepable BPF programs - Add support storing struct task_struct objects as kptrs in maps - Improve helper UAPI by explicitly defining BPF_FUNC_xxx integer values - Add libbpf *_opts API-variants for bpf_*_get_fd_by_id() functions Protocols: - TCP: implement Protective Load Balancing across switch links - TCP: allow dynamically disabling TCP-MD5 static key, reverting back to fast[er]-path - UDP: Introduce optional per-netns hash lookup table - IPv6: simplify and cleanup sockets disposal - Netlink: support different type policies for each generic netlink operation - MPTCP: add MSG_FASTOPEN and FastOpen listener side support - MPTCP: add netlink notification support for listener sockets events - SCTP: add VRF support, allowing sctp sockets binding to VRF devices - Add bridging MAC Authentication Bypass (MAB) support - Extensions for Ethernet VPN bridging implementation to better support multicast scenarios - More work for Wi-Fi 7 support, comprising conversion of all the existing drivers to internal TX queue usage - IPSec: introduce a new offload type (packet offload) allowing complete header processing and crypto offloading - IPSec: extended ack support for more descriptive XFRM error reporting - RXRPC: increase SACK table size and move processing into a per-local endpoint kernel thread, reducing considerably the required locking - IEEE 802154: synchronous send frame and extended filtering support, initial support for scanning available 15.4 networks - Tun: bump the link speed from 10Mbps to 10Gbps - Tun/VirtioNet: implement UDP segmentation offload support Driver API: - PHY/SFP: improve power level switching between standard level 1 and the higher power levels - New API for netdev <-> devlink_port linkage - PTP: convert existing drivers to new frequency adjustment implementation - DSA: add support for rx offloading - Autoload DSA tagging driver when dynamically changing protocol - Add new PCP and APPTRUST attributes to Data Center Bridging - Add configuration support for 800Gbps link speed - Add devlink port function attribute to enable/disable RoCE and migratable - Extend devlink-rate to support strict prioriry and weighted fair queuing - Add devlink support to directly reading from region memory - New device tree helper to fetch MAC address from nvmem - New big TCP helper to simplify temporary header stripping New hardware / drivers: - Ethernet: - Marvel Octeon CNF95N and CN10KB Ethernet Switches - Marvel Prestera AC5X Ethernet Switch - WangXun 10 Gigabit NIC - Motorcomm yt8521 Gigabit Ethernet - Microchip ksz9563 Gigabit Ethernet Switch - Microsoft Azure Network Adapter - Linux Automation 10Base-T1L adapter - PHY: - Aquantia AQR112 and AQR412 - Motorcomm YT8531S - PTP: - Orolia ART-CARD - WiFi: - MediaTek Wi-Fi 7 (802.11be) devices - RealTek rtw8821cu, rtw8822bu, rtw8822cu and rtw8723du USB devices - Bluetooth: - Broadcom BCM4377/4378/4387 Bluetooth chipsets - Realtek RTL8852BE and RTL8723DS - Cypress.CYW4373A0 WiFi + Bluetooth combo device Drivers: - CAN: - gs_usb: bus error reporting support - kvaser_usb: listen only and bus error reporting support - Ethernet NICs: - Intel (100G): - extend action skbedit to RX queue mapping - implement devlink-rate support - support direct read from memory - nVidia/Mellanox (mlx5): - SW steering improvements, increasing rules update rate - Support for enhanced events compression - extend H/W offload packet manipulation capabilities - implement IPSec packet offload mode - nVidia/Mellanox (mlx4): - better big TCP support - Netronome Ethernet NICs (nfp): - IPsec offload support - add support for multicast filter - Broadcom: - RSS and PTP support improvements - AMD/SolarFlare: - netlink extened ack improvements - add basic flower matches to offload, and related stats - Virtual NICs: - ibmvnic: introduce affinity hint support - small / embedded: - FreeScale fec: add initial XDP support - Marvel mv643xx_eth: support MII/GMII/RGMII modes for Kirkwood - TI am65-cpsw: add suspend/resume support - Mediatek MT7986: add RX wireless wthernet dispatch support - Realtek 8169: enable GRO software interrupt coalescing per default - Ethernet high-speed switches: - Microchip (sparx5): - add support for Sparx5 TC/flower H/W offload via VCAP - Mellanox mlxsw: - add 802.1X and MAC Authentication Bypass offload support - add ip6gre support - Embedded Ethernet switches: - Mediatek (mtk_eth_soc): - improve PCS implementation, add DSA untag support - enable flow offload support - Renesas: - add rswitch R-Car Gen4 gPTP support - Microchip (lan966x): - add full XDP support - add TC H/W offload via VCAP - enable PTP on bridge interfaces - Microchip (ksz8): - add MTU support for KSZ8 series - Qualcomm 802.11ax WiFi (ath11k): - support configuring channel dwell time during scan - MediaTek WiFi (mt76): - enable Wireless Ethernet Dispatch (WED) offload support - add ack signal support - enable coredump support - remain_on_channel support - Intel WiFi (iwlwifi): - enable Wi-Fi 7 Extremely High Throughput (EHT) PHY capabilities - 320 MHz channels support - RealTek WiFi (rtw89): - new dynamic header firmware format support - wake-over-WLAN support" * tag 'net-next-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next: (2002 commits) ipvs: fix type warning in do_div() on 32 bit net: lan966x: Remove a useless test in lan966x_ptp_add_trap() net: ipa: add IPA v4.7 support dt-bindings: net: qcom,ipa: Add SM6350 compatible bnxt: Use generic HBH removal helper in tx path IPv6/GRO: generic helper to remove temporary HBH/jumbo header in driver selftests: forwarding: Add bridge MDB test selftests: forwarding: Rename bridge_mdb test bridge: mcast: Support replacement of MDB port group entries bridge: mcast: Allow user space to specify MDB entry routing protocol bridge: mcast: Allow user space to add (*, G) with a source list and filter mode bridge: mcast: Add support for (*, G) with a source list and filter mode bridge: mcast: Avoid arming group timer when (S, G) corresponds to a source bridge: mcast: Add a flag for user installed source entries bridge: mcast: Expose __br_multicast_del_group_src() bridge: mcast: Expose br_multicast_new_group_src() bridge: mcast: Add a centralized error path bridge: mcast: Place netlink policy before validation functions bridge: mcast: Split (*, G) and (S, G) addition into different functions bridge: mcast: Do not derive entry type from its filter mode ...

Linus Torvalds committed 3 years ago

Commit 7e68dd72 parents 1ca06f1 7c4a6302013 files · +165982 −34401Browse files

Unified · Split

1873 files
  1. Documentation/bpf/bpf_design_QA.rst +45 −0
  2. Documentation/bpf/bpf_devel_QA.rst +27 −0
  3. Documentation/bpf/bpf_iterators.rst +485 −0
  4. Documentation/bpf/btf.rst +6 −1
  5. Documentation/bpf/index.rst +2 −0
  6. Documentation/bpf/instruction-set.rst +2 −2
  7. Documentation/bpf/kfuncs.rst +242 −13
  8. Documentation/bpf/libbpf/index.rst +3 −0
  9. Documentation/bpf/libbpf/program_types.rst +203 −0
  10. Documentation/bpf/map_array.rst +262 −0
  11. Documentation/bpf/map_bloom_filter.rst +174 −0
  12. Documentation/bpf/map_cgrp_storage.rst +109 −0
  13. Documentation/bpf/map_cpumap.rst +177 −0
  14. Documentation/bpf/map_devmap.rst +238 −0
  15. Documentation/bpf/map_hash.rst +28 −5
  16. Documentation/bpf/map_lpm_trie.rst +197 −0
  17. Documentation/bpf/map_of_maps.rst +130 −0
  18. Documentation/bpf/map_queue_stack.rst +146 −0
  19. Documentation/bpf/map_sk_storage.rst +155 −0
  20. Documentation/bpf/map_xskmap.rst +192 −0
  21. Documentation/bpf/maps.rst +65 −36
  22. Documentation/bpf/programs.rst +3 −0
  23. Documentation/bpf/redirect.rst +81 −0
  24. Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml +52 −0
  25. Documentation/devicetree/bindings/interrupt-controller/fsl,intmux.yaml +2 −1
  26. Documentation/devicetree/bindings/net/adi,adin1110.yaml +4 −0
  27. Documentation/devicetree/bindings/net/asix,ax88178.yaml +3 −1
  28. Documentation/devicetree/bindings/net/bluetooth.txt +0 −5
  29. Documentation/devicetree/bindings/net/bluetooth/bluetooth-controller.yaml +29 −0
  30. Documentation/devicetree/bindings/net/bluetooth/brcm,bcm4377-bluetooth.yaml +81 −0
  31. Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml +3 −3
  32. Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml +3 −0
  33. Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml +1 −0
  34. Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml +73 −62
  35. Documentation/devicetree/bindings/net/dsa/dsa-port.yaml +2 −1
  36. Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml +1 −1
  37. Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml +1 −1
  38. Documentation/devicetree/bindings/net/ethernet-controller.yaml +10 −1
  39. Documentation/devicetree/bindings/net/fsl,fec.yaml +3 −1
  40. Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml +40 −13
  41. Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml +1 −1
  42. Documentation/devicetree/bindings/net/fsl-fman.txt +3 −2
  43. Documentation/devicetree/bindings/net/marvell,dfx-server.yaml +62 −0
  44. Documentation/devicetree/bindings/net/marvell,pp2.yaml +305 −0
  45. Documentation/devicetree/bindings/net/marvell,prestera.txt +0 −81
  46. Documentation/devicetree/bindings/net/marvell,prestera.yaml +91 −0
  47. Documentation/devicetree/bindings/net/marvell-pp2.txt +0 −141
  48. Documentation/devicetree/bindings/net/microchip,lan95xx.yaml +3 −1
  49. Documentation/devicetree/bindings/net/nfc/nxp,nci.yaml +3 −1
  50. Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml +3 −1
  51. Documentation/devicetree/bindings/net/pcs/fsl,lynx-pcs.yaml +40 −0
  52. Documentation/devicetree/bindings/net/qca,ar71xx.yaml +0 −1
  53. Documentation/devicetree/bindings/net/qcom,ipa.yaml +58 −28
  54. Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml +36 −10
  55. Documentation/devicetree/bindings/net/realtek-bluetooth.yaml +1 −0
  56. Documentation/devicetree/bindings/net/renesas,r8a779f0-ether-switch.yaml +262 −0
  57. Documentation/devicetree/bindings/net/sff,sfp.yaml +2 −1
  58. Documentation/devicetree/bindings/net/snps,dwmac.yaml +264 −81
  59. Documentation/devicetree/bindings/net/socionext,synquacer-netsec.yaml +73 −0
  60. Documentation/devicetree/bindings/net/socionext-netsec.txt +0 −56
  61. Documentation/devicetree/bindings/net/xilinx_axienet.txt +2 −0
  62. Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-ccif.yaml +51 −0
  63. Documentation/devicetree/bindings/soc/qcom/qcom,wcnss.yaml +3 −5
  64. Documentation/networking/bonding.rst +3 −1
  65. Documentation/networking/can.rst +33 −0
  66. Documentation/networking/device_drivers/ethernet/freescale/dpaa2/mac-phy-support.rst +6 −3
  67. Documentation/networking/device_drivers/ethernet/marvell/octeon_ep.rst +1 −0
  68. Documentation/networking/device_drivers/ethernet/mellanox/mlx5.rst +54 −70
  69. Documentation/networking/device_drivers/ethernet/netronome/nfp.rst +145 −20
  70. Documentation/networking/devlink/devlink-info.rst +5 −0
  71. Documentation/networking/devlink/devlink-port.rst +161 −7
  72. Documentation/networking/devlink/devlink-region.rst +13 −0
  73. Documentation/networking/devlink/devlink-trap.rst +13 −0
  74. Documentation/networking/devlink/etas_es58x.rst +36 −0
  75. Documentation/networking/devlink/ice.rst +126 −2
  76. Documentation/networking/ethtool-netlink.rst +31 −1
  77. Documentation/networking/index.rst +1 −0
  78. Documentation/networking/ip-sysctl.rst +111 −0
  79. Documentation/networking/ipvs-sysctl.rst +22 −2
  80. Documentation/networking/tc-queue-filters.rst +37 −0
  81. Documentation/networking/timestamping.rst +31 −1
  82. Documentation/networking/xfrm_device.rst +53 −9
  83. MAINTAINERS +17 −6
  84. arch/arm/boot/dts/armada-375.dtsi +8 −4
  85. arch/arm/mach-omap2/pdata-quirks.c +0 −1
  86. arch/arm64/boot/dts/apple/t8103-j274.dts +4 −0
  87. arch/arm64/boot/dts/apple/t8103-j293.dts +4 −0
  88. arch/arm64/boot/dts/apple/t8103-j313.dts +4 −0
  89. arch/arm64/boot/dts/apple/t8103-j456.dts +4 −0
  90. arch/arm64/boot/dts/apple/t8103-j457.dts +4 −0
  91. arch/arm64/boot/dts/apple/t8103-jxxx.dtsi +8 −0
  92. arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi +24 −0
  93. arch/arm64/boot/dts/freescale/fsl-ls1046-post.dtsi +25 −0
  94. arch/arm64/boot/dts/marvell/armada-cp11x.dtsi +11 −6
  95. arch/arm64/boot/dts/mediatek/mt7986a.dtsi +65 −0
  96. arch/arm64/net/bpf_jit_comp.c +2 −7
  97. arch/mips/configs/mtx1_defconfig +0 −1
  98. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi +2 −1
  99. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi +9 −1
  100. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi +9 −1
  101. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi +9 −1
  102. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi +45 −0
  103. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi +45 −0
  104. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi +2 −1
  105. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi +9 −1
  106. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi +9 −1
  107. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi +9 −1
  108. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi +2 −1
  109. arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi +9 −1
  110. arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi +9 −1
  111. arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi +9 −1
  112. arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi +2 −1
  113. arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi +9 −1
  114. arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi +9 −1
  115. arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi +9 −1
  116. arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi +2 −1
  117. arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi +9 −1
  118. arch/powerpc/boot/dts/fsl/t2081si-post.dtsi +2 −2
  119. arch/powerpc/configs/ppc6xx_defconfig +0 −1
  120. arch/riscv/net/bpf_jit_comp64.c +28 −1
  121. arch/sparc/net/bpf_jit_comp_32.c +5 −5
  122. arch/x86/net/bpf_jit_comp.c +97 −31
  123. drivers/bcma/driver_gpio.c +6 −2
  124. drivers/bcma/main.c +3 −1
  125. drivers/bcma/sprom.c +1 −1
  126. drivers/bluetooth/Kconfig +23 −0
  127. drivers/bluetooth/Makefile +1 −0
  128. drivers/bluetooth/btintel.c +11 −10
  129. drivers/bluetooth/btrtl.c +7 −0
  130. drivers/bluetooth/btrtl.h +21 −0
  131. drivers/bluetooth/btusb.c +204 −32
  132. drivers/bluetooth/hci_bcm.c +12 −1
  133. drivers/bluetooth/hci_bcm4377.c +2514 −0
  134. drivers/bluetooth/hci_bcsp.c +1 −1
  135. drivers/bluetooth/hci_h5.c +1 −1
  136. drivers/bluetooth/hci_ll.c +1 −1
  137. drivers/bluetooth/hci_qca.c +3 −2
  138. drivers/bluetooth/virtio_bt.c +30 −5
  139. drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c +0 −4
  140. drivers/hv/hv_util.c +2 −2
  141. drivers/infiniband/hw/mlx5/odp.c +1 −2
  142. drivers/infiniband/hw/mlx5/umr.c +7 −7
  143. drivers/net/bonding/bond_3ad.c +9 −0
  144. drivers/net/bonding/bond_main.c +25 −19
  145. drivers/net/bonding/bond_options.c +0 −18
  146. drivers/net/can/Kconfig +0 −8
  147. drivers/net/can/Makefile +0 −1
  148. drivers/net/can/c_can/Kconfig +2 −1
  149. drivers/net/can/c_can/c_can_platform.c +1 −2
  150. drivers/net/can/ctucanfd/Kconfig +1 −1
  151. drivers/net/can/flexcan/flexcan-core.c +34 −3
  152. drivers/net/can/flexcan/flexcan.h +2 −0
  153. drivers/net/can/m_can/m_can.c +102 −54
  154. drivers/net/can/m_can/m_can.h +9 −9
  155. drivers/net/can/m_can/m_can_platform.c +1 −5
  156. drivers/net/can/m_can/tcan4x5x-core.c +4 −14
  157. drivers/net/can/m_can/tcan4x5x-regmap.c +39 −8
  158. drivers/net/can/pch_can.c +0 −1249
  159. drivers/net/can/rcar/rcar_canfd.c +63 −46
  160. drivers/net/can/usb/Kconfig +7 −3
  161. drivers/net/can/usb/etas_es58x/Makefile +1 −1
  162. drivers/net/can/usb/etas_es58x/es581_4.c +2 −2
  163. drivers/net/can/usb/etas_es58x/es58x_core.c +42 −62
  164. drivers/net/can/usb/etas_es58x/es58x_core.h +54 −4
  165. drivers/net/can/usb/etas_es58x/es58x_devlink.c +235 −0
  166. drivers/net/can/usb/etas_es58x/es58x_fd.c +2 −2
  167. drivers/net/can/usb/gs_usb.c +69 −30
  168. drivers/net/can/usb/kvaser_usb/Makefile +0 −5
  169. drivers/net/can/usb/kvaser_usb/kvaser_usb.h +27 −3
  170. drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c +104 −9
  171. drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +130 −30
  172. drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +415 −49
  173. drivers/net/can/usb/ucan.c +5 −7
  174. drivers/net/can/vxcan.c +1 −1
  175. drivers/net/dsa/Kconfig +2 −0
  176. drivers/net/dsa/b53/Kconfig +1 −0
  177. drivers/net/dsa/hirschmann/hellcreek.c +0 −5
  178. drivers/net/dsa/lan9303-core.c +3 −1
  179. drivers/net/dsa/lan9303_i2c.c +2 −3
  180. drivers/net/dsa/microchip/Kconfig +1 −0
  181. drivers/net/dsa/microchip/ksz8.h +1 −0
  182. drivers/net/dsa/microchip/ksz8795.c +63 −12
  183. drivers/net/dsa/microchip/ksz8795_reg.h +3 −0
  184. drivers/net/dsa/microchip/ksz8863_smi.c +4 −5
  185. drivers/net/dsa/microchip/ksz9477.c +9 −15
  186. drivers/net/dsa/microchip/ksz9477.h +0 −1
  187. drivers/net/dsa/microchip/ksz9477_i2c.c +8 −9
  188. drivers/net/dsa/microchip/ksz9477_reg.h +0 −2
  189. drivers/net/dsa/microchip/ksz_common.c +143 −7
  190. drivers/net/dsa/microchip/ksz_common.h +15 −2
  191. drivers/net/dsa/microchip/ksz_spi.c +4 −6
  192. drivers/net/dsa/microchip/lan937x_main.c +5 −1
  193. drivers/net/dsa/mv88e6xxx/Makefile +4 −0
  194. drivers/net/dsa/mv88e6xxx/chip.c +4 −0
  195. drivers/net/dsa/mv88e6xxx/devlink.c +0 −5
  196. drivers/net/dsa/mv88e6xxx/global1_atu.c +65 −20
  197. drivers/net/dsa/mv88e6xxx/global1_vtu.c +3 −4
  198. drivers/net/dsa/mv88e6xxx/port.c +9 −0
  199. drivers/net/dsa/mv88e6xxx/port.h +2 −0
  200. drivers/net/dsa/mv88e6xxx/trace.c +6 −0
  201. drivers/net/dsa/mv88e6xxx/trace.h +96 −0
  202. drivers/net/dsa/ocelot/felix.c +4 −13
  203. drivers/net/dsa/ocelot/felix.h +0 −4
  204. drivers/net/dsa/ocelot/felix_vsc9959.c +0 −35
  205. drivers/net/dsa/ocelot/seville_vsc9953.c +0 −32
  206. drivers/net/dsa/sja1105/sja1105_devlink.c +3 −9
  207. drivers/net/dsa/xrs700x/xrs700x_i2c.c +2 −3
  208. drivers/net/dummy.c +0 −7
  209. drivers/net/ethernet/Kconfig +0 −10
  210. drivers/net/ethernet/Makefile +0 −1
  211. drivers/net/ethernet/adi/adin1110.c +37 −21
  212. drivers/net/ethernet/alacritech/slic.h +6 −6
  213. drivers/net/ethernet/altera/altera_tse_main.c +0 −1
  214. drivers/net/ethernet/amazon/ena/ena_ethtool.c +2 −2
  215. drivers/net/ethernet/amazon/ena/ena_netdev.c +6 −6
  216. drivers/net/ethernet/amd/atarilance.c +1 −1
  217. drivers/net/ethernet/amd/lance.c +1 −1
  218. drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c +8 −15
  219. drivers/net/ethernet/amd/xgbe/xgbe-ptp.c +4 −16
  220. drivers/net/ethernet/apple/bmac.c +1 −1
  221. drivers/net/ethernet/apple/mace.c +1 −1
  222. drivers/net/ethernet/aquantia/atlantic/aq_ring.c +4 −4
  223. drivers/net/ethernet/asix/ax88796c_main.c +2 −2
  224. drivers/net/ethernet/atheros/ag71xx.c +0 −1
  225. drivers/net/ethernet/broadcom/b44.c +4 −4
  226. drivers/net/ethernet/broadcom/bcm4908_enet.c +40 −17
  227. drivers/net/ethernet/broadcom/bcmsysport.c +17 −6
  228. drivers/net/ethernet/broadcom/bcmsysport.h +11 −0
  229. drivers/net/ethernet/broadcom/bnx2.c +4 −3
  230. drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +5 −4
  231. drivers/net/ethernet/broadcom/bnxt/bnxt.c +79 −33
  232. drivers/net/ethernet/broadcom/bnxt/bnxt.h +3 −0
  233. drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c +0 −4
  234. drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c +127 −7
  235. drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h +216 −65
  236. drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c +25 −14
  237. drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h +5 −2
  238. drivers/net/ethernet/broadcom/genet/bcmgenet.c +27 −22
  239. drivers/net/ethernet/broadcom/genet/bcmmii.c +14 −5
  240. drivers/net/ethernet/broadcom/tg3.c +7 −15
  241. drivers/net/ethernet/brocade/bna/bfa_cs.h +38 −22
  242. drivers/net/ethernet/brocade/bna/bfa_ioc.c +5 −5
  243. drivers/net/ethernet/brocade/bna/bfa_ioc.h +6 −2
  244. drivers/net/ethernet/brocade/bna/bfa_msgq.c +0 −2
  245. drivers/net/ethernet/brocade/bna/bfa_msgq.h +6 −2
  246. drivers/net/ethernet/brocade/bna/bna_enet.c +3 −3
  247. drivers/net/ethernet/brocade/bna/bna_tx_rx.c +3 −3
  248. drivers/net/ethernet/brocade/bna/bna_types.h +21 −6
  249. drivers/net/ethernet/cadence/macb_main.c +15 −2
  250. drivers/net/ethernet/cavium/liquidio/lio_main.c +7 −4
  251. drivers/net/ethernet/cavium/liquidio/octeon_console.c +3 −4
  252. drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c +8 −5
  253. drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c +4 −0
  254. drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c +12 −14
  255. drivers/net/ethernet/cisco/enic/enic.h +6 −17
  256. drivers/net/ethernet/cisco/enic/enic_main.c +5 −6
  257. drivers/net/ethernet/cortina/gemini.c +12 −12
  258. drivers/net/ethernet/dlink/dl2k.c +0 −2
  259. drivers/net/ethernet/dlink/sundance.c +0 −2
  260. drivers/net/ethernet/dnet.c +2 −2
  261. drivers/net/ethernet/emulex/benet/be_ethtool.c +6 −6
  262. drivers/net/ethernet/emulex/benet/be_main.c +8 −8
  263. drivers/net/ethernet/engleder/tsnep.h +8 −0
  264. drivers/net/ethernet/engleder/tsnep_ethtool.c +159 −6
  265. drivers/net/ethernet/engleder/tsnep_hw.h +7 −0
  266. drivers/net/ethernet/engleder/tsnep_main.c +171 −74
  267. drivers/net/ethernet/faraday/ftmac100.c +45 −20
  268. drivers/net/ethernet/fealnx.c +0 −1953
  269. drivers/net/ethernet/freescale/Kconfig +1 −0
  270. drivers/net/ethernet/freescale/dpaa/Kconfig +2 −2
  271. drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +26 −63
  272. drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c +15 −75
  273. drivers/net/ethernet/freescale/dpaa2/Makefile +1 −1
  274. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c +53 −4
  275. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c +2 −20
  276. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-trace.h +91 −51
  277. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c +415 −194
  278. drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h +99 −13
  279. drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c +91 −37
  280. drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +17 −5
  281. drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.h +8 −2
  282. drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c +0 −1
  283. drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c +28 −17
  284. drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +40 −20
  285. drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h +3 −6
  286. drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c +454 −0
  287. drivers/net/ethernet/freescale/dpaa2/dpni-cmd.h +13 −6
  288. drivers/net/ethernet/freescale/dpaa2/dpni.c +5 −1
  289. drivers/net/ethernet/freescale/dpaa2/dpni.h +9 −0
  290. drivers/net/ethernet/freescale/enetc/enetc_pf.c +0 −1
  291. drivers/net/ethernet/freescale/fec.h +19 −1
  292. drivers/net/ethernet/freescale/fec_main.c +324 −73
  293. drivers/net/ethernet/freescale/fec_ptp.c +170 −7
  294. drivers/net/ethernet/freescale/fman/Kconfig +2 −1
  295. drivers/net/ethernet/freescale/fman/fman_dtsec.c +211 −246
  296. drivers/net/ethernet/freescale/fman/fman_mac.h +0 −10
  297. drivers/net/ethernet/freescale/fman/fman_memac.c +376 −368
  298. drivers/net/ethernet/freescale/fman/fman_tgec.c +58 −72
  299. drivers/net/ethernet/freescale/fman/mac.c +6 −162
  300. drivers/net/ethernet/freescale/fman/mac.h +10 −13
  301. drivers/net/ethernet/fungible/funeth/funeth_devlink.c +0 −7
  302. drivers/net/ethernet/fungible/funeth/funeth_main.c +1 −12
  303. drivers/net/ethernet/fungible/funeth/funeth_txrx.h +2 −2
  304. drivers/net/ethernet/google/gve/gve.h +21 −6
  305. drivers/net/ethernet/google/gve/gve_adminq.c +20 −1
  306. drivers/net/ethernet/google/gve/gve_adminq.h +51 −0
  307. drivers/net/ethernet/google/gve/gve_desc_dqo.h +5 −0
  308. drivers/net/ethernet/google/gve/gve_ethtool.c +10 −8
  309. drivers/net/ethernet/google/gve/gve_main.c +58 −6
  310. drivers/net/ethernet/google/gve/gve_rx.c +309 −235
  311. drivers/net/ethernet/google/gve/gve_rx_dqo.c +1 −1
  312. drivers/net/ethernet/google/gve/gve_tx_dqo.c +13 −7
  313. drivers/net/ethernet/google/gve/gve_utils.c +7 −23
  314. drivers/net/ethernet/google/gve/gve_utils.h +1 −1
  315. drivers/net/ethernet/hisilicon/hns/hnae.c +0 −3
  316. drivers/net/ethernet/hisilicon/hns/hns_ethtool.c +4 −7
  317. drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +2 −2
  318. drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +2 −4
  319. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c +0 −5
  320. drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c +5 −17
  321. drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c +0 −5
  322. drivers/net/ethernet/huawei/hinic/hinic_dev.h +4 −0
  323. drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h +118 −52
  324. drivers/net/ethernet/huawei/hinic/hinic_main.c +12 −1
  325. drivers/net/ethernet/huawei/hinic/hinic_port.c +34 −16
  326. drivers/net/ethernet/huawei/hinic/hinic_port.h +12 −0
  327. drivers/net/ethernet/huawei/hinic/hinic_rx.c +2 −2
  328. drivers/net/ethernet/huawei/hinic/hinic_sriov.c +18 −0
  329. drivers/net/ethernet/huawei/hinic/hinic_tx.c +2 −2
  330. drivers/net/ethernet/ibm/ibmveth.c +1 −17
  331. drivers/net/ethernet/ibm/ibmveth.h +0 −1
  332. drivers/net/ethernet/ibm/ibmvnic.c +238 −1
  333. drivers/net/ethernet/ibm/ibmvnic.h +5 −0
  334. drivers/net/ethernet/intel/e1000/e1000_main.c +3 −6
  335. drivers/net/ethernet/intel/e1000e/Makefile +3 −0
  336. drivers/net/ethernet/intel/e1000e/e1000.h +3 −1
  337. drivers/net/ethernet/intel/e1000e/e1000e_trace.h +42 −0
  338. drivers/net/ethernet/intel/e1000e/ethtool.c +2 −0
  339. drivers/net/ethernet/intel/e1000e/hw.h +9 −0
  340. drivers/net/ethernet/intel/e1000e/ich8lan.c +27 −0
  341. drivers/net/ethernet/intel/e1000e/netdev.c +28 −23
  342. drivers/net/ethernet/intel/e1000e/ptp.c +4 −13
  343. drivers/net/ethernet/intel/fm10k/fm10k_netdev.c +4 −4
  344. drivers/net/ethernet/intel/i40e/i40e.h +1 −0
  345. drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h +5 −3
  346. drivers/net/ethernet/intel/i40e/i40e_common.c +26 −0
  347. drivers/net/ethernet/intel/i40e/i40e_ethtool.c +7 −5
  348. drivers/net/ethernet/intel/i40e/i40e_main.c +62 −23
  349. drivers/net/ethernet/intel/i40e/i40e_prototype.h +3 −0
  350. drivers/net/ethernet/intel/i40e/i40e_ptp.c +3 −14
  351. drivers/net/ethernet/intel/i40e/i40e_trace.h +49 −0
  352. drivers/net/ethernet/intel/i40e/i40e_txrx.c +21 −6
  353. drivers/net/ethernet/intel/iavf/iavf_ethtool.c +4 −4
  354. drivers/net/ethernet/intel/iavf/iavf_main.c +2 −2
  355. drivers/net/ethernet/intel/ice/ice.h +24 −0
  356. drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +2 −2
  357. drivers/net/ethernet/intel/ice/ice_base.c +1 −1
  358. drivers/net/ethernet/intel/ice/ice_common.c +44 −4
  359. drivers/net/ethernet/intel/ice/ice_common.h +1 −0
  360. drivers/net/ethernet/intel/ice/ice_dcb.c +1 −1
  361. drivers/net/ethernet/intel/ice/ice_dcb_lib.c +10 −0
  362. drivers/net/ethernet/intel/ice/ice_devlink.c +570 −64
  363. drivers/net/ethernet/intel/ice/ice_devlink.h +3 −0
  364. drivers/net/ethernet/intel/ice/ice_ethtool.c +175 −6
  365. drivers/net/ethernet/intel/ice/ice_hw_autogen.h +3 −0
  366. drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h +0 −12
  367. drivers/net/ethernet/intel/ice/ice_lib.c +237 −35
  368. drivers/net/ethernet/intel/ice/ice_main.c +90 −45
  369. drivers/net/ethernet/intel/ice/ice_ptp.c +272 −292
  370. drivers/net/ethernet/intel/ice/ice_ptp.h +25 −14
  371. drivers/net/ethernet/intel/ice/ice_ptp_hw.c +166 −182
  372. drivers/net/ethernet/intel/ice/ice_ptp_hw.h +6 −2
  373. drivers/net/ethernet/intel/ice/ice_repr.c +25 −15
  374. drivers/net/ethernet/intel/ice/ice_sched.c +93 −11
  375. drivers/net/ethernet/intel/ice/ice_sched.h +30 −1
  376. drivers/net/ethernet/intel/ice/ice_tc_lib.c +251 −100
  377. drivers/net/ethernet/intel/ice/ice_tc_lib.h +32 −8
  378. drivers/net/ethernet/intel/ice/ice_txrx.c +26 −14
  379. drivers/net/ethernet/intel/ice/ice_txrx.h +12 −6
  380. drivers/net/ethernet/intel/ice/ice_txrx_lib.c +1 −1
  381. drivers/net/ethernet/intel/ice/ice_type.h +9 −0
  382. drivers/net/ethernet/intel/ice/ice_vf_lib.c +24 −0
  383. drivers/net/ethernet/intel/ice/ice_vf_lib_private.h +1 −0
  384. drivers/net/ethernet/intel/ice/ice_vf_mbx.c +24 −68
  385. drivers/net/ethernet/intel/ice/ice_virtchnl.c +195 −0
  386. drivers/net/ethernet/intel/ice/ice_virtchnl.h +4 −0
  387. drivers/net/ethernet/intel/ice/ice_virtchnl_allowlist.c +6 −0
  388. drivers/net/ethernet/intel/ice/ice_xsk.c +18 −7
  389. drivers/net/ethernet/intel/igb/igb_ethtool.c +6 −6
  390. drivers/net/ethernet/intel/igb/igb_main.c +11 −7
  391. drivers/net/ethernet/intel/igb/igb_ptp.c +2 −16
  392. drivers/net/ethernet/intel/igc/igc_defines.h +9 −0
  393. drivers/net/ethernet/intel/igc/igc_ethtool.c +6 −6
  394. drivers/net/ethernet/intel/igc/igc_main.c +11 −4
  395. drivers/net/ethernet/intel/igc/igc_regs.h +1 −0
  396. drivers/net/ethernet/intel/igc/igc_tsn.c +30 −0
  397. drivers/net/ethernet/intel/igc/igc_tsn.h +1 −0
  398. drivers/net/ethernet/intel/ixgbe/ixgbe.h +8 −2
  399. drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +46 −15
  400. drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +5 −0
  401. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +4 −4
  402. drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c +5 −21
  403. drivers/net/ethernet/intel/ixgbevf/ethtool.c +6 −6
  404. drivers/net/ethernet/intel/ixgbevf/ipsec.c +5 −0
  405. drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +16 −9
  406. drivers/net/ethernet/marvell/mv643xx_eth.c +42 −7
  407. drivers/net/ethernet/marvell/mvneta.c +5 −8
  408. drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +11 −5
  409. drivers/net/ethernet/marvell/octeon_ep/octep_main.c +17 −3
  410. drivers/net/ethernet/marvell/octeon_ep/octep_main.h +2 −0
  411. drivers/net/ethernet/marvell/octeontx2/af/cgx.c +50 −28
  412. drivers/net/ethernet/marvell/octeontx2/af/cgx.h +3 −6
  413. drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h +13 −2
  414. drivers/net/ethernet/marvell/octeontx2/af/mbox.h +18 −0
  415. drivers/net/ethernet/marvell/octeontx2/af/mcs.c +5 −1
  416. drivers/net/ethernet/marvell/octeontx2/af/npc.h +3 −0
  417. drivers/net/ethernet/marvell/octeontx2/af/rpm.c +239 −23
  418. drivers/net/ethernet/marvell/octeontx2/af/rpm.h +35 −1
  419. drivers/net/ethernet/marvell/octeontx2/af/rvu.h +10 −3
  420. drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c +34 −15
  421. drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c +15 −1
  422. drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c +0 −7
  423. drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c +7 −3
  424. drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c +22 −0
  425. drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c +126 −25
  426. drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c +11 −10
  427. drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +3 −0
  428. drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c +0 −15
  429. drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +34 −0
  430. drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +46 −6
  431. drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +1 −1
  432. drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c +25 −0
  433. drivers/net/ethernet/marvell/prestera/prestera_devlink.c +0 −22
  434. drivers/net/ethernet/marvell/prestera/prestera_devlink.h +0 −5
  435. drivers/net/ethernet/marvell/prestera/prestera_main.c +5 −16
  436. drivers/net/ethernet/marvell/prestera/prestera_pci.c +105 −14
  437. drivers/net/ethernet/marvell/sky2.c +4 −4
  438. drivers/net/ethernet/mediatek/Makefile +1 −1
  439. drivers/net/ethernet/mediatek/mtk_eth_soc.c +390 −114
  440. drivers/net/ethernet/mediatek/mtk_eth_soc.h +47 −12
  441. drivers/net/ethernet/mediatek/mtk_ppe.c +21 −1
  442. drivers/net/ethernet/mediatek/mtk_ppe.h +4 −0
  443. drivers/net/ethernet/mediatek/mtk_ppe_offload.c +9 −3
  444. drivers/net/ethernet/mediatek/mtk_sgmii.c +100 −74
  445. drivers/net/ethernet/mediatek/mtk_wed.c +763 −100
  446. drivers/net/ethernet/mediatek/mtk_wed.h +21 −0
  447. drivers/net/ethernet/mediatek/mtk_wed_debugfs.c +87 −0
  448. drivers/net/ethernet/mediatek/mtk_wed_mcu.c +390 −0
  449. drivers/net/ethernet/mediatek/mtk_wed_regs.h +138 −2
  450. drivers/net/ethernet/mediatek/mtk_wed_wo.c +512 −0
  451. drivers/net/ethernet/mediatek/mtk_wed_wo.h +282 −0
  452. drivers/net/ethernet/mellanox/mlx4/en_clock.c +11 −18
  453. drivers/net/ethernet/mellanox/mlx4/en_netdev.c +3 −6
  454. drivers/net/ethernet/mellanox/mlx4/en_tx.c +10 −8
  455. drivers/net/ethernet/mellanox/mlx4/main.c +1 −1
  456. drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +13 −5
  457. drivers/net/ethernet/mellanox/mlx5/core/Makefile +1 −0
  458. drivers/net/ethernet/mellanox/mlx5/core/cmd.c +0 −1
  459. drivers/net/ethernet/mellanox/mlx5/core/devlink.c +6 −13
  460. drivers/net/ethernet/mellanox/mlx5/core/devlink.h +2 −0
  461. drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c +16 −0
  462. drivers/net/ethernet/mellanox/mlx5/core/en.h +7 −4
  463. drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c +0 −17
  464. drivers/net/ethernet/mellanox/mlx5/core/en/devlink.h +0 −2
  465. drivers/net/ethernet/mellanox/mlx5/core/en/fs.h +2 −1
  466. drivers/net/ethernet/mellanox/mlx5/core/en/params.c +6 −10
  467. drivers/net/ethernet/mellanox/mlx5/core/en/params.h +14 −0
  468. drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +0 −1
  469. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/accept.c +1 −0
  470. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c +1 −1
  471. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.h +12 −0
  472. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/drop.c +1 −0
  473. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/goto.c +1 −0
  474. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c +7 −0
  475. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred_nic.c +1 −0
  476. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c +74 −12
  477. drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/trap.c +2 −8
  478. drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c +24 −16
  479. drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.h +3 −2
  480. drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c +326 −76
  481. drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.h +36 −3
  482. drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +56 −33
  483. drivers/net/ethernet/mellanox/mlx5/core/en/tc_priv.h +0 −4
  484. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c +277 −94
  485. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h +103 −34
  486. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c +764 −305
  487. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c +297 −6
  488. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c +13 −9
  489. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c +52 −0
  490. drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c +26 −39
  491. drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c +6 −6
  492. drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c +0 −2
  493. drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +1 −0
  494. drivers/net/ethernet/mellanox/mlx5/core/en_main.c +19 −10
  495. drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +85 −63
  496. drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +145 −26
  497. drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +18 −0
  498. drivers/net/ethernet/mellanox/mlx5/core/en_stats.h +19 −0
  499. drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +328 −117
  500. drivers/net/ethernet/mellanox/mlx5/core/en_tc.h +7 −2
  501. drivers/net/ethernet/mellanox/mlx5/core/eq.c +5 −0
  502. drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c +4 −4
  503. drivers/net/ethernet/mellanox/mlx5/core/esw/debugfs.c +19 −3
  504. drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c +2 −2
  505. drivers/net/ethernet/mellanox/mlx5/core/eswitch.c +43 −0
  506. drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +15 −1
  507. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +253 −17
  508. drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c +28 −4
  509. drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +15 −5
  510. drivers/net/ethernet/mellanox/mlx5/core/fs_core.h +1 −0
  511. drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c +6 −1
  512. drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c +5 −1
  513. drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c +48 −31
  514. drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c +5 −5
  515. drivers/net/ethernet/mellanox/mlx5/core/lib/aso.h +3 −1
  516. drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c +6 −16
  517. drivers/net/ethernet/mellanox/mlx5/core/main.c +19 −3
  518. drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h +4 −1
  519. drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c +2 −1
  520. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c +254 −46
  521. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_buddy.c +0 −2
  522. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c +84 −0
  523. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c +28 −1
  524. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_definer.c +151 −0
  525. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c +76 −20
  526. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c +102 −72
  527. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c +77 −42
  528. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +140 −1
  529. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c +19 −3
  530. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.h +1 −0
  531. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c +69 −0
  532. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.h +1 −0
  533. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v2.c +1 −0
  534. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c +1 −1
  535. drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h +58 −1
  536. drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c +41 −12
  537. drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5_ifc_dr_ste_v1.h +35 −0
  538. drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h +14 −8
  539. drivers/net/ethernet/mellanox/mlx5/core/uar.c +0 −1
  540. drivers/net/ethernet/mellanox/mlx5/core/vport.c +28 −2
  541. drivers/net/ethernet/mellanox/mlx5/core/wq.h +17 −0
  542. drivers/net/ethernet/mellanox/mlxsw/core.c +4 −21
  543. drivers/net/ethernet/mellanox/mlxsw/core.h +3 −4
  544. drivers/net/ethernet/mellanox/mlxsw/i2c.c +3 −3
  545. drivers/net/ethernet/mellanox/mlxsw/minimal.c +2 −15
  546. drivers/net/ethernet/mellanox/mlxsw/reg.h +36 −0
  547. drivers/net/ethernet/mellanox/mlxsw/spectrum.c +26 −16
  548. drivers/net/ethernet/mellanox/mlxsw/spectrum.h +4 −1
  549. drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c +21 −0
  550. drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c +47 −113
  551. drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h +1 −0
  552. drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c +3 −15
  553. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +85 −17
  554. drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h +4 −0
  555. drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c +53 −11
  556. drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c +25 −0
  557. drivers/net/ethernet/mellanox/mlxsw/trap.h +2 −0
  558. drivers/net/ethernet/microchip/Kconfig +1 −0
  559. drivers/net/ethernet/microchip/Makefile +1 −0
  560. drivers/net/ethernet/microchip/lan743x_ethtool.c +153 −6
  561. drivers/net/ethernet/microchip/lan743x_ethtool.h +70 −1
  562. drivers/net/ethernet/microchip/lan743x_main.c +3 −3
  563. drivers/net/ethernet/microchip/lan743x_main.h +3 −0
  564. drivers/net/ethernet/microchip/lan743x_ptp.c +6 −48
  565. drivers/net/ethernet/microchip/lan966x/Kconfig +2 −0
  566. drivers/net/ethernet/microchip/lan966x/Makefile +6 −1
  567. drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c +329 −104
  568. drivers/net/ethernet/microchip/lan966x/lan966x_goto.c +54 −0
  569. drivers/net/ethernet/microchip/lan966x/lan966x_ifh.h +1 −0
  570. drivers/net/ethernet/microchip/lan966x/lan966x_main.c +37 −5
  571. drivers/net/ethernet/microchip/lan966x/lan966x_main.h +91 −4
  572. drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c +0 −2
  573. drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c +227 −7
  574. drivers/net/ethernet/microchip/lan966x/lan966x_regs.h +196 −0
  575. drivers/net/ethernet/microchip/lan966x/lan966x_tc.c +2 −0
  576. drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c +254 −0
  577. drivers/net/ethernet/microchip/lan966x/lan966x_tc_matchall.c +6 −0
  578. drivers/net/ethernet/microchip/lan966x/lan966x_vcap_ag_api.c +1608 −0
  579. drivers/net/ethernet/microchip/lan966x/lan966x_vcap_ag_api.h +11 −0
  580. drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c +549 −0
  581. drivers/net/ethernet/microchip/lan966x/lan966x_xdp.c +140 −0
  582. drivers/net/ethernet/microchip/sparx5/Kconfig +12 −0
  583. drivers/net/ethernet/microchip/sparx5/Makefile +9 −2
  584. drivers/net/ethernet/microchip/sparx5/sparx5_dcb.c +310 −0
  585. drivers/net/ethernet/microchip/sparx5/sparx5_main.c +12 −0
  586. drivers/net/ethernet/microchip/sparx5/sparx5_main.h +20 −0
  587. drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h +581 −2
  588. drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c +0 −1
  589. drivers/net/ethernet/microchip/sparx5/sparx5_port.c +99 −0
  590. drivers/net/ethernet/microchip/sparx5/sparx5_port.h +42 −0
  591. drivers/net/ethernet/microchip/sparx5/sparx5_qos.c +4 −0
  592. drivers/net/ethernet/microchip/sparx5/sparx5_tc.c +51 −0
  593. drivers/net/ethernet/microchip/sparx5/sparx5_tc.h +19 −0
  594. drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c +1016 −0
  595. drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c +97 −0
  596. drivers/net/ethernet/microchip/sparx5/sparx5_vcap_ag_api.c +1351 −0
  597. drivers/net/ethernet/microchip/sparx5/sparx5_vcap_ag_api.h +18 −0
  598. drivers/net/ethernet/microchip/sparx5/sparx5_vcap_debugfs.c +200 −0
  599. drivers/net/ethernet/microchip/sparx5/sparx5_vcap_debugfs.h +33 −0
  600. drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c +723 −0
  601. drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.h +81 −0
  602. drivers/net/ethernet/microchip/vcap/Kconfig +53 −0
  603. drivers/net/ethernet/microchip/vcap/Makefile +10 −0
  604. drivers/net/ethernet/microchip/vcap/vcap_ag_api.h +735 −0
  605. drivers/net/ethernet/microchip/vcap/vcap_api.c +2883 −0
  606. drivers/net/ethernet/microchip/vcap/vcap_api.h +280 −0
  607. drivers/net/ethernet/microchip/vcap/vcap_api_client.h +265 −0
  608. drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c +431 −0
  609. drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.h +41 −0
  610. drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c +555 −0
  611. drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c +2245 −0
  612. drivers/net/ethernet/microchip/vcap/vcap_api_private.h +113 −0
  613. drivers/net/ethernet/microchip/vcap/vcap_model_kunit.c +5570 −0
  614. drivers/net/ethernet/microchip/vcap/vcap_model_kunit.h +10 −0
  615. drivers/net/ethernet/microsoft/Kconfig +1 −0
  616. drivers/net/ethernet/microsoft/mana/gdma_main.c +56 −14
  617. drivers/net/ethernet/microsoft/mana/hw_channel.c +3 −3
  618. drivers/net/ethernet/microsoft/mana/mana_bpf.c +1 −1
  619. drivers/net/ethernet/microsoft/mana/mana_en.c +160 −25
  620. drivers/net/ethernet/microsoft/mana/mana_ethtool.c +5 −5
  621. drivers/net/ethernet/microsoft/mana/shm_channel.c +1 −1
  622. drivers/net/ethernet/mscc/ocelot.c +2 −4
  623. drivers/net/ethernet/mscc/ocelot_net.c +1 −11
  624. drivers/net/ethernet/mscc/ocelot_stats.c +235 −9
  625. drivers/net/ethernet/mscc/ocelot_vsc7514.c +0 −14
  626. drivers/net/ethernet/myricom/myri10ge/myri10ge.c +1 −2
  627. drivers/net/ethernet/neterion/s2io.c +1 −1
  628. drivers/net/ethernet/netronome/Kconfig +11 −0
  629. drivers/net/ethernet/netronome/nfp/Makefile +2 −0
  630. drivers/net/ethernet/netronome/nfp/ccm_mbox.c +1 −1
  631. drivers/net/ethernet/netronome/nfp/crypto/crypto.h +23 −0
  632. drivers/net/ethernet/netronome/nfp/crypto/ipsec.c +592 −0
  633. drivers/net/ethernet/netronome/nfp/flower/lag_conf.c +41 −11
  634. drivers/net/ethernet/netronome/nfp/flower/main.c +9 −0
  635. drivers/net/ethernet/netronome/nfp/flower/main.h +20 −1
  636. drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c +44 −9
  637. drivers/net/ethernet/netronome/nfp/nfd3/dp.c +48 −10
  638. drivers/net/ethernet/netronome/nfp/nfd3/ipsec.c +18 −0
  639. drivers/net/ethernet/netronome/nfp/nfd3/nfd3.h +8 −0
  640. drivers/net/ethernet/netronome/nfp/nfp_app.h +0 −2
  641. drivers/net/ethernet/netronome/nfp/nfp_devlink.c +2 −25
  642. drivers/net/ethernet/netronome/nfp/nfp_main.h +1 −1
  643. drivers/net/ethernet/netronome/nfp/nfp_net.h +16 −0
  644. drivers/net/ethernet/netronome/nfp/nfp_net_common.c +76 −13
  645. drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h +32 −5
  646. drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +77 −4
  647. drivers/net/ethernet/netronome/nfp/nfp_net_main.c +2 −10
  648. drivers/net/ethernet/netronome/nfp/nfp_net_repr.c +2 −3
  649. drivers/net/ethernet/netronome/nfp/nfp_port.h +0 −2
  650. drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c +17 −0
  651. drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h +56 −0
  652. drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c +26 −0
  653. drivers/net/ethernet/nvidia/forcedeth.c +4 −4
  654. drivers/net/ethernet/pensando/ionic/ionic_dev.c +14 −0
  655. drivers/net/ethernet/pensando/ionic/ionic_dev.h +3 −0
  656. drivers/net/ethernet/pensando/ionic/ionic_devlink.c +1 −5
  657. drivers/net/ethernet/pensando/ionic/ionic_if.h +44 −1
  658. drivers/net/ethernet/pensando/ionic/ionic_lif.c +96 −17
  659. drivers/net/ethernet/pensando/ionic/ionic_main.c +1 −1
  660. drivers/net/ethernet/pensando/ionic/ionic_txrx.c +18 −13
  661. drivers/net/ethernet/qlogic/qed/qed_debug.c +2 −1
  662. drivers/net/ethernet/qlogic/qed/qed_devlink.c +0 −4
  663. drivers/net/ethernet/qlogic/qed/qed_ll2.c +1 −1
  664. drivers/net/ethernet/qlogic/qede/qede_ptp.c +8 −5
  665. drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +1 −1
  666. drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c +2 −0
  667. drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c +2 −2
  668. drivers/net/ethernet/realtek/8139too.c +4 −4
  669. drivers/net/ethernet/realtek/r8169_main.c +6 −3
  670. drivers/net/ethernet/renesas/Kconfig +12 −0
  671. drivers/net/ethernet/renesas/Makefile +4 −0
  672. drivers/net/ethernet/renesas/ravb_ptp.c +5 −12
  673. drivers/net/ethernet/renesas/rcar_gen4_ptp.c +181 −0
  674. drivers/net/ethernet/renesas/rcar_gen4_ptp.h +72 −0
  675. drivers/net/ethernet/renesas/rswitch.c +1841 −0
  676. drivers/net/ethernet/renesas/rswitch.h +973 −0
  677. drivers/net/ethernet/rocker/rocker_ofdpa.c +8 −7
  678. drivers/net/ethernet/sfc/Makefile +1 −1
  679. drivers/net/ethernet/sfc/ef100_ethtool.c +0 −2
  680. drivers/net/ethernet/sfc/ef100_rx.c +19 −4
  681. drivers/net/ethernet/sfc/ef100_tx.c +2 −1
  682. drivers/net/ethernet/sfc/efx_channels.c +8 −1
  683. drivers/net/ethernet/sfc/efx_common.c +1 −1
  684. drivers/net/ethernet/sfc/ethtool_common.c +0 −37
  685. drivers/net/ethernet/sfc/ethtool_common.h +0 −2
  686. drivers/net/ethernet/sfc/mae.c +301 −5
  687. drivers/net/ethernet/sfc/mae.h +7 −0
  688. drivers/net/ethernet/sfc/mae_counter_format.h +73 −0
  689. drivers/net/ethernet/sfc/mcdi.h +17 −0
  690. drivers/net/ethernet/sfc/net_driver.h +16 −3
  691. drivers/net/ethernet/sfc/ptp.c +4 −3
  692. drivers/net/ethernet/sfc/rx_common.c +3 −0
  693. drivers/net/ethernet/sfc/siena/efx_common.c +1 −1
  694. drivers/net/ethernet/sfc/siena/ptp.c +4 −3
  695. drivers/net/ethernet/sfc/tc.c +267 −35
  696. drivers/net/ethernet/sfc/tc.h +31 −17
  697. drivers/net/ethernet/sfc/tc_counters.c +503 −0
  698. drivers/net/ethernet/sfc/tc_counters.h +59 −0
  699. drivers/net/ethernet/sfc/tx.c +2 −2
  700. drivers/net/ethernet/smsc/Kconfig +0 −14
  701. drivers/net/ethernet/smsc/Makefile +0 −1
  702. drivers/net/ethernet/smsc/smc911x.c +0 −2198
  703. drivers/net/ethernet/smsc/smc911x.h +0 −901
  704. drivers/net/ethernet/socionext/sni_ave.c +4 −10
  705. drivers/net/ethernet/stmicro/stmmac/Kconfig +9 −0
  706. drivers/net/ethernet/stmicro/stmmac/Makefile +1 −0
  707. drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c +388 −0
  708. drivers/net/ethernet/stmicro/stmmac/dwmac4.h +1 −3
  709. drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +6 −15
  710. drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +2 −1
  711. drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +7 −4
  712. drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c +7 −16
  713. drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h +1 −1
  714. drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +6 −2
  715. drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c +3 −0
  716. drivers/net/ethernet/sun/cassini.c +15 −33
  717. drivers/net/ethernet/sun/sunvnet_common.c +2 −2
  718. drivers/net/ethernet/ti/am65-cpsw-nuss.c +199 −67
  719. drivers/net/ethernet/ti/am65-cpsw-nuss.h +6 −0
  720. drivers/net/ethernet/ti/am65-cpts.c +79 −2
  721. drivers/net/ethernet/ti/am65-cpts.h +10 −0
  722. drivers/net/ethernet/ti/cpsw_ale.c +10 −0
  723. drivers/net/ethernet/ti/cpsw_ale.h +1 −0
  724. drivers/net/ethernet/ti/cpts.c +4 −16
  725. drivers/net/ethernet/ti/netcp_core.c +5 −5
  726. drivers/net/ethernet/via/via-rhine.c +4 −4
  727. drivers/net/ethernet/wangxun/Kconfig +7 −0
  728. drivers/net/ethernet/wangxun/Makefile +1 −0
  729. drivers/net/ethernet/wangxun/libwx/Makefile +7 −0
  730. drivers/net/ethernet/wangxun/libwx/wx_hw.c +936 −0
  731. drivers/net/ethernet/wangxun/libwx/wx_hw.h +28 −0
  732. drivers/net/ethernet/wangxun/libwx/wx_type.h +352 −0
  733. drivers/net/ethernet/wangxun/ngbe/Makefile +1 −1
  734. drivers/net/ethernet/wangxun/ngbe/ngbe.h +55 −0
  735. drivers/net/ethernet/wangxun/ngbe/ngbe_hw.c +87 −0
  736. drivers/net/ethernet/wangxun/ngbe/ngbe_hw.h +12 −0
  737. drivers/net/ethernet/wangxun/ngbe/ngbe_main.c +368 −0
  738. drivers/net/ethernet/wangxun/ngbe/ngbe_type.h +94 −5
  739. drivers/net/ethernet/wangxun/txgbe/Makefile +2 −1
  740. drivers/net/ethernet/wangxun/txgbe/txgbe.h +21 −2
  741. drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c +312 −0
  742. drivers/net/ethernet/wangxun/txgbe/txgbe_hw.h +11 −0
  743. drivers/net/ethernet/wangxun/txgbe/txgbe_main.c +464 −1
  744. drivers/net/ethernet/wangxun/txgbe/txgbe_type.h +32 −15
  745. drivers/net/ethernet/xilinx/xilinx_axienet.h +0 −2
  746. drivers/net/ethernet/xilinx/xilinx_axienet_main.c +40 −5
  747. drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +48 −31
  748. drivers/net/ethernet/xilinx/xilinx_emaclite.c +1 −1
  749. drivers/net/ethernet/xscale/ptp_ixp46x.c +4 −15
  750. drivers/net/fddi/defxx.c +18 −4
  751. drivers/net/geneve.c +1 −1
  752. drivers/net/hamradio/baycom_epp.c +1 −1
  753. drivers/net/hamradio/scc.c +3 −3
  754. drivers/net/hyperv/netvsc_drv.c +16 −16
  755. drivers/net/ieee802154/atusb.c +28 −5
  756. drivers/net/ieee802154/mac802154_hwsim.c +172 −7
  757. drivers/net/ieee802154/mcr20a.c +3 −6
  758. drivers/net/ifb.c +6 −6
  759. drivers/net/ipa/Makefile +1 −1
  760. drivers/net/ipa/data/ipa_data-v3.1.c +10 −9
  761. drivers/net/ipa/data/ipa_data-v3.5.1.c +14 −13
  762. drivers/net/ipa/data/ipa_data-v4.11.c +9 −8
  763. drivers/net/ipa/data/ipa_data-v4.2.c +9 −8
  764. drivers/net/ipa/data/ipa_data-v4.5.c +9 −8
  765. drivers/net/ipa/data/ipa_data-v4.7.c +405 −0
  766. drivers/net/ipa/data/ipa_data-v4.9.c +9 −8
  767. drivers/net/ipa/gsi_trans.c +5 −2
  768. drivers/net/ipa/ipa.h +21 −11
  769. drivers/net/ipa/ipa_cmd.c +25 −49
  770. drivers/net/ipa/ipa_cmd.h +13 −3
  771. drivers/net/ipa/ipa_data.h +3 −0
  772. drivers/net/ipa/ipa_endpoint.c +160 −117
  773. drivers/net/ipa/ipa_endpoint.h +1 −1
  774. drivers/net/ipa/ipa_interrupt.c +22 −12
  775. drivers/net/ipa/ipa_main.c +90 −22
  776. drivers/net/ipa/ipa_mem.c +10 −9
  777. drivers/net/ipa/ipa_qmi.c +5 −4
  778. drivers/net/ipa/ipa_qmi_msg.c +10 −10
  779. drivers/net/ipa/ipa_qmi_msg.h +10 −10
  780. drivers/net/ipa/ipa_reg.c +2 −0
  781. drivers/net/ipa/ipa_reg.h +1 −0
  782. drivers/net/ipa/ipa_sysfs.c +3 −3
  783. drivers/net/ipa/ipa_table.c +196 −154
  784. drivers/net/ipa/ipa_table.h +10 −20
  785. drivers/net/ipa/ipa_version.h +4 −0
  786. drivers/net/ipa/reg/ipa_reg-v3.1.c +8 −5
  787. drivers/net/ipa/reg/ipa_reg-v3.5.1.c +8 −5
  788. drivers/net/ipa/reg/ipa_reg-v4.11.c +8 −5
  789. drivers/net/ipa/reg/ipa_reg-v4.2.c +8 −5
  790. drivers/net/ipa/reg/ipa_reg-v4.5.c +8 −5
  791. drivers/net/ipa/reg/ipa_reg-v4.7.c +507 −0
  792. drivers/net/ipa/reg/ipa_reg-v4.9.c +8 −5
  793. drivers/net/ipvlan/ipvlan_main.c +2 −2
  794. drivers/net/loopback.c +2 −2
  795. drivers/net/macsec.c +6 −6
  796. drivers/net/macvlan.c +2 −2
  797. drivers/net/mhi_net.c +4 −4
  798. drivers/net/netdevsim/dev.c +1 −6
  799. drivers/net/netdevsim/ipsec.c +5 −0
  800. drivers/net/netdevsim/netdev.c +3 −11
  801. drivers/net/ntb_netdev.c +2 −2
  802. drivers/net/pcs/pcs-altera-tse.c +3 −18
  803. drivers/net/pcs/pcs-xpcs.c +2 −8
  804. drivers/net/phy/Kconfig +1 −4
  805. drivers/net/phy/aquantia_main.c +40 −0
  806. drivers/net/phy/dp83822.c +2 −0
  807. drivers/net/phy/dp83867.c +7 −0
  808. drivers/net/phy/micrel.c +77 −0
  809. drivers/net/phy/motorcomm.c +1675 −2
  810. drivers/net/phy/mscc/mscc_macsec.c +30 −27
  811. drivers/net/phy/mscc/mscc_macsec.h +0 −2
  812. drivers/net/phy/mxl-gpy.c +94 −12
  813. drivers/net/phy/phy-core.c +10 −1
  814. drivers/net/phy/phy.c +1 −0
  815. drivers/net/phy/phy_device.c +12 −0
  816. drivers/net/phy/phylink.c +31 −12
  817. drivers/net/phy/sfp.c +85 −77
  818. drivers/net/ppp/ppp_generic.c +2 −0
  819. drivers/net/tap.c +8 −2
  820. drivers/net/team/team.c +4 −2
  821. drivers/net/team/team_mode_loadbalance.c +2 −2
  822. drivers/net/thunderbolt.c +12 −14
  823. drivers/net/tun.c +37 −38
  824. drivers/net/usb/asix_devices.c +20 −3
  825. drivers/net/usb/cdc_ether.c +6 −0
  826. drivers/net/usb/cdc_ncm.c +2 −1
  827. drivers/net/usb/qmi_wwan.c +3 −2
  828. drivers/net/veth.c +7 −7
  829. drivers/net/virtio_net.c +23 −12
  830. drivers/net/vrf.c +2 −2
  831. drivers/net/vxlan/vxlan_core.c +2 −2
  832. drivers/net/vxlan/vxlan_vnifilter.c +2 −2
  833. drivers/net/wan/farsync.c +2 −0
  834. drivers/net/wireless/admtek/adm8211.c +1 −0
  835. drivers/net/wireless/ath/ar5523/ar5523.c +7 −0
  836. drivers/net/wireless/ath/ath10k/Kconfig +1 −0
  837. drivers/net/wireless/ath/ath10k/core.c +16 −0
  838. drivers/net/wireless/ath/ath10k/debug.c +3 −2
  839. drivers/net/wireless/ath/ath10k/htc.c +9 −0
  840. drivers/net/wireless/ath/ath10k/htt.h +4 −2
  841. drivers/net/wireless/ath/ath10k/htt_rx.c +10 −15
  842. drivers/net/wireless/ath/ath10k/hw.h +2 −0
  843. drivers/net/wireless/ath/ath10k/pci.c +12 −8
  844. drivers/net/wireless/ath/ath10k/qmi.c +36 −1
  845. drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.c +63 −63
  846. drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h +51 −51
  847. drivers/net/wireless/ath/ath10k/wmi-tlv.c +7 −0
  848. drivers/net/wireless/ath/ath11k/core.c +11 −4
  849. drivers/net/wireless/ath/ath11k/core.h +3 −0
  850. drivers/net/wireless/ath/ath11k/hw.h +1 −0
  851. drivers/net/wireless/ath/ath11k/mac.c +162 −70
  852. drivers/net/wireless/ath/ath11k/mac.h +1 −1
  853. drivers/net/wireless/ath/ath11k/pcic.c +10 −3
  854. drivers/net/wireless/ath/ath11k/qmi.c +48 −39
  855. drivers/net/wireless/ath/ath11k/wmi.c +1 −1
  856. drivers/net/wireless/ath/ath5k/mac80211-ops.c +1 −0
  857. drivers/net/wireless/ath/ath9k/Makefile +0 −5
  858. drivers/net/wireless/ath/ath9k/ar9003_mci.c +1 −2
  859. drivers/net/wireless/ath/ath9k/ath9k.h +1 −0
  860. drivers/net/wireless/ath/ath9k/hif_usb.c +29 −17
  861. drivers/net/wireless/ath/ath9k/htc_drv_main.c +1 −0
  862. drivers/net/wireless/ath/ath9k/mci.c +6 −2
  863. drivers/net/wireless/ath/ath9k/tx99.c +1 −1
  864. drivers/net/wireless/ath/ath9k/xmit.c +0 −2
  865. drivers/net/wireless/ath/carl9170/Makefile +0 −5
  866. drivers/net/wireless/ath/carl9170/fwcmd.h +2 −2
  867. drivers/net/wireless/ath/carl9170/main.c +1 −0
  868. drivers/net/wireless/ath/carl9170/wlan.h +1 −1
  869. drivers/net/wireless/ath/wcn36xx/main.c +1 −0
  870. drivers/net/wireless/ath/wil6210/debugfs.c +6 −30
  871. drivers/net/wireless/atmel/at76c50x-usb.c +1 −0
  872. drivers/net/wireless/atmel/atmel.c +79 −83
  873. drivers/net/wireless/broadcom/b43/main.c +4 −7
  874. drivers/net/wireless/broadcom/b43legacy/main.c +1 −0
  875. drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile +11 −0
  876. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/Makefile +12 −0
  877. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/core.c +27 −0
  878. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/module.c +27 −0
  879. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/vops.h +11 −0
  880. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +28 −24
  881. drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +35 −1
  882. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +558 −29
  883. drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c +10 −5
  884. drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +13 −2
  885. drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h +9 −0
  886. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/Makefile +12 −0
  887. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c +27 −0
  888. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/module.c +27 −0
  889. drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/vops.h +11 −0
  890. drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c +2 −1
  891. drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h +3 −1
  892. drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +5 −0
  893. drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h +2 −2
  894. drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c +199 −0
  895. drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.h +47 −0
  896. drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c +6 −2
  897. drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +177 −34
  898. drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c +3 −3
  899. drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +13 −4
  900. drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +19 −8
  901. drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/Makefile +12 −0
  902. drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/core.c +27 −0
  903. drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/module.c +27 −0
  904. drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/vops.h +11 −0
  905. drivers/net/wireless/broadcom/brcm80211/brcmsmac/led.c +0 −3
  906. drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c +1 −0
  907. drivers/net/wireless/cisco/airo.c +108 −96
  908. drivers/net/wireless/intel/ipw2x00/ipw2100.c +0 −11
  909. drivers/net/wireless/intel/ipw2x00/ipw2200.c +1 −15
  910. drivers/net/wireless/intel/iwlegacy/3945-mac.c +1 −6
  911. drivers/net/wireless/intel/iwlegacy/4965-mac.c +1 −0
  912. drivers/net/wireless/intel/iwlwifi/cfg/22000.c +32 −4
  913. drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c +1 −0
  914. drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h +89 −6
  915. drivers/net/wireless/intel/iwlwifi/fw/api/mac.h +3 −3
  916. drivers/net/wireless/intel/iwlwifi/fw/api/phy-ctxt.h +16 −17
  917. drivers/net/wireless/intel/iwlwifi/fw/api/rs.h +4 −6
  918. drivers/net/wireless/intel/iwlwifi/fw/dump.c +4 −3
  919. drivers/net/wireless/intel/iwlwifi/fw/rs.c +2 −0
  920. drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +5 −2
  921. drivers/net/wireless/intel/iwlwifi/iwl-drv.c +3 −0
  922. drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.h +2 −1
  923. drivers/net/wireless/intel/iwlwifi/iwl-modparams.h +1 −0
  924. drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +210 −27
  925. drivers/net/wireless/intel/iwlwifi/iwl-prph.h +5 −0
  926. drivers/net/wireless/intel/iwlwifi/iwl-trans.h +5 −0
  927. drivers/net/wireless/intel/iwlwifi/mei/iwl-mei.h +30 −6
  928. drivers/net/wireless/intel/iwlwifi/mei/main.c +217 −87
  929. drivers/net/wireless/intel/iwlwifi/mei/net.c +7 −3
  930. drivers/net/wireless/intel/iwlwifi/mei/sap.h +59 −6
  931. drivers/net/wireless/intel/iwlwifi/mei/trace-data.h +1 −1
  932. drivers/net/wireless/intel/iwlwifi/mei/trace.h +1 −1
  933. drivers/net/wireless/intel/iwlwifi/mvm/Makefile +1 −0
  934. drivers/net/wireless/intel/iwlwifi/mvm/d3.c +7 −2
  935. drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c +2 −2
  936. drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c +5 −7
  937. drivers/net/wireless/intel/iwlwifi/mvm/fw.c +35 −3
  938. drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +52 −8
  939. drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +182 −30
  940. drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c +226 −0
  941. drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +18 −3
  942. drivers/net/wireless/intel/iwlwifi/mvm/ops.c +19 −6
  943. drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c +27 −27
  944. drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +123 −2
  945. drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +25 −21
  946. drivers/net/wireless/intel/iwlwifi/mvm/sta.c +19 −10
  947. drivers/net/wireless/intel/iwlwifi/mvm/time-event.c +3 −4
  948. drivers/net/wireless/intel/iwlwifi/mvm/tx.c +23 −4
  949. drivers/net/wireless/intel/iwlwifi/pcie/drv.c +23 −10
  950. drivers/net/wireless/intel/iwlwifi/pcie/trans.c +47 −38
  951. drivers/net/wireless/intersil/hostap/hostap_ioctl.c +133 −111
  952. drivers/net/wireless/intersil/orinoco/wext.c +73 −58
  953. drivers/net/wireless/intersil/p54/eeprom.h +2 −2
  954. drivers/net/wireless/intersil/p54/main.c +1 −0
  955. drivers/net/wireless/mac80211_hwsim.c +1 −0
  956. drivers/net/wireless/marvell/libertas_tf/main.c +1 −0
  957. drivers/net/wireless/marvell/mwifiex/debugfs.c +1 −1
  958. drivers/net/wireless/marvell/mwifiex/main.h +1 −0
  959. drivers/net/wireless/marvell/mwl8k.c +1 −0
  960. drivers/net/wireless/mediatek/mt76/Kconfig +1 −0
  961. drivers/net/wireless/mediatek/mt76/Makefile +1 −0
  962. drivers/net/wireless/mediatek/mt76/debugfs.c +0 −19
  963. drivers/net/wireless/mediatek/mt76/dma.c +195 −51
  964. drivers/net/wireless/mediatek/mt76/dma.h +8 −0
  965. drivers/net/wireless/mediatek/mt76/mac80211.c +19 −8
  966. drivers/net/wireless/mediatek/mt76/mt76.h +30 −20
  967. drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c +1 −1
  968. drivers/net/wireless/mediatek/mt76/mt7603/dma.c +1 −1
  969. drivers/net/wireless/mediatek/mt76/mt7603/mac.c +3 −3
  970. drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h +1 −1
  971. drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c +2 −4
  972. drivers/net/wireless/mediatek/mt76/mt7615/mac.c +23 −11
  973. drivers/net/wireless/mediatek/mt76/mt7615/main.c +5 −2
  974. drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +1 −1
  975. drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h +4 −2
  976. drivers/net/wireless/mediatek/mt76/mt7615/regs.h +2 −0
  977. drivers/net/wireless/mediatek/mt76/mt76_connac.h +16 −0
  978. drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c +13 −4
  979. drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c +145 −69
  980. drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h +89 −10
  981. drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c +8 −20
  982. drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h +1 −1
  983. drivers/net/wireless/mediatek/mt76/mt76x0/init.c +1 −1
  984. drivers/net/wireless/mediatek/mt76/mt76x0/phy.c +5 −8
  985. drivers/net/wireless/mediatek/mt76/mt76x02.h +15 −1
  986. drivers/net/wireless/mediatek/mt76/mt76x02_debugfs.c +18 −1
  987. drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.h +0 −2
  988. drivers/net/wireless/mediatek/mt76/mt76x02_mac.c +3 −3
  989. drivers/net/wireless/mediatek/mt76/mt76x02_phy.c +11 −11
  990. drivers/net/wireless/mediatek/mt76/mt76x02_phy.h +3 −3
  991. drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c +7 −7
  992. drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c +2 −14
  993. drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.h +1 −1
  994. drivers/net/wireless/mediatek/mt76/mt76x2/init.c +1 −1
  995. drivers/net/wireless/mediatek/mt76/mt76x2/phy.c +3 −3
  996. drivers/net/wireless/mediatek/mt76/mt7915/Kconfig +1 −0
  997. drivers/net/wireless/mediatek/mt76/mt7915/Makefile +2 −1
  998. drivers/net/wireless/mediatek/mt76/mt7915/coredump.c +410 −0
  999. drivers/net/wireless/mediatek/mt76/mt7915/coredump.h +136 −0
  1000. drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c +262 −45
  1001. drivers/net/wireless/mediatek/mt76/mt7915/dma.c +167 −40
  1002. drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c +29 −37
  1003. drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h +0 −5
  1004. drivers/net/wireless/mediatek/mt76/mt7915/init.c +94 −41
  1005. drivers/net/wireless/mediatek/mt76/mt7915/mac.c +467 −168
  1006. drivers/net/wireless/mediatek/mt76/mt7915/main.c +102 −40
  1007. drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +398 −97
  1008. drivers/net/wireless/mediatek/mt76/mt7915/mcu.h +57 −3
  1009. drivers/net/wireless/mediatek/mt76/mt7915/mmio.c +369 −45
  1010. drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h +59 −6
  1011. drivers/net/wireless/mediatek/mt76/mt7915/pci.c +11 −95
  1012. drivers/net/wireless/mediatek/mt76/mt7915/regs.h +86 −2
  1013. drivers/net/wireless/mediatek/mt76/mt7915/soc.c +15 −6
  1014. drivers/net/wireless/mediatek/mt76/mt7915/testmode.c +35 −36
  1015. drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c +1 −1
  1016. drivers/net/wireless/mediatek/mt76/mt7921/init.c +89 −2
  1017. drivers/net/wireless/mediatek/mt76/mt7921/mac.c +29 −27
  1018. drivers/net/wireless/mediatek/mt76/mt7921/main.c +228 −5
  1019. drivers/net/wireless/mediatek/mt76/mt7921/mcu.c +143 −18
  1020. drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h +72 −2
  1021. drivers/net/wireless/mediatek/mt76/mt7921/pci.c +51 −8
  1022. drivers/net/wireless/mediatek/mt76/mt7921/sdio.c +27 −4
  1023. drivers/net/wireless/mediatek/mt76/mt7921/usb.c +20 −2
  1024. drivers/net/wireless/mediatek/mt76/mt7996/Kconfig +12 −0
  1025. drivers/net/wireless/mediatek/mt76/mt7996/Makefile +6 −0
  1026. drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c +851 −0
  1027. drivers/net/wireless/mediatek/mt76/mt7996/dma.c +360 −0
  1028. drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c +229 −0
  1029. drivers/net/wireless/mediatek/mt76/mt7996/eeprom.h +75 −0
  1030. drivers/net/wireless/mediatek/mt76/mt7996/init.c +823 −0
  1031. drivers/net/wireless/mediatek/mt76/mt7996/mac.c +2498 −0
  1032. drivers/net/wireless/mediatek/mt76/mt7996/mac.h +398 −0
  1033. drivers/net/wireless/mediatek/mt76/mt7996/main.c +1334 −0
  1034. drivers/net/wireless/mediatek/mt76/mt7996/mcu.c +3607 −0
  1035. drivers/net/wireless/mediatek/mt76/mt7996/mcu.h +669 −0
  1036. drivers/net/wireless/mediatek/mt76/mt7996/mmio.c +386 −0
  1037. drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h +523 −0
  1038. drivers/net/wireless/mediatek/mt76/mt7996/pci.c +222 −0
  1039. drivers/net/wireless/mediatek/mt76/mt7996/regs.h +542 −0
  1040. drivers/net/wireless/mediatek/mt76/sdio.c +1 −1
  1041. drivers/net/wireless/mediatek/mt76/tx.c +30 −0
  1042. drivers/net/wireless/mediatek/mt76/usb.c +8 −5
  1043. drivers/net/wireless/mediatek/mt76/util.h +0 −6
  1044. drivers/net/wireless/mediatek/mt7601u/main.c +1 −0
  1045. drivers/net/wireless/microchip/wilc1000/sdio.c +1 −0
  1046. drivers/net/wireless/purelifi/plfxlc/mac.c +1 −0
  1047. drivers/net/wireless/purelifi/plfxlc/usb.c +1 −0
  1048. drivers/net/wireless/ralink/rt2x00/rt2400pci.c +1 −0
  1049. drivers/net/wireless/ralink/rt2x00/rt2500pci.c +1 −0
  1050. drivers/net/wireless/ralink/rt2x00/rt2500usb.c +1 −0
  1051. drivers/net/wireless/ralink/rt2x00/rt2800pci.c +1 −0
  1052. drivers/net/wireless/ralink/rt2x00/rt2800soc.c +1 −0
  1053. drivers/net/wireless/ralink/rt2x00/rt2800usb.c +1 −0
  1054. drivers/net/wireless/ralink/rt2x00/rt61pci.c +1 −0
  1055. drivers/net/wireless/ralink/rt2x00/rt73usb.c +1 −0
  1056. drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c +1 −0
  1057. drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c +1 −0
  1058. drivers/net/wireless/realtek/rtl8xxxu/Kconfig +4 −3
  1059. drivers/net/wireless/realtek/rtl8xxxu/Makefile +1 −1
  1060. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h +89 −8
  1061. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c +1766 −0
  1062. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c +67 −6
  1063. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c +131 −30
  1064. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c +109 −5
  1065. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c +86 −7
  1066. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c +385 −298
  1067. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h +29 −1
  1068. drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c +2 −3
  1069. drivers/net/wireless/realtek/rtlwifi/core.c +1 −0
  1070. drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c +0 −8
  1071. drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c +0 −3
  1072. drivers/net/wireless/realtek/rtw88/Kconfig +47 −0
  1073. drivers/net/wireless/realtek/rtw88/Makefile +15 −0
  1074. drivers/net/wireless/realtek/rtw88/coex.c +1 −2
  1075. drivers/net/wireless/realtek/rtw88/debug.c +15 −0
  1076. drivers/net/wireless/realtek/rtw88/fw.c +17 −14
  1077. drivers/net/wireless/realtek/rtw88/fw.h +11 −0
  1078. drivers/net/wireless/realtek/rtw88/hci.h +3 −6
  1079. drivers/net/wireless/realtek/rtw88/mac.c +20 −1
  1080. drivers/net/wireless/realtek/rtw88/mac80211.c +1 −1
  1081. drivers/net/wireless/realtek/rtw88/main.c +7 −5
  1082. drivers/net/wireless/realtek/rtw88/main.h +5 −7
  1083. drivers/net/wireless/realtek/rtw88/phy.c +3 −3
  1084. drivers/net/wireless/realtek/rtw88/ps.c +1 −1
  1085. drivers/net/wireless/realtek/rtw88/reg.h +1 −0
  1086. drivers/net/wireless/realtek/rtw88/rtw8723d.c +28 −0
  1087. drivers/net/wireless/realtek/rtw88/rtw8723d.h +12 −1
  1088. drivers/net/wireless/realtek/rtw88/rtw8723du.c +36 −0
  1089. drivers/net/wireless/realtek/rtw88/rtw8821c.c +18 −0
  1090. drivers/net/wireless/realtek/rtw88/rtw8821c.h +21 −0
  1091. drivers/net/wireless/realtek/rtw88/rtw8821cu.c +50 −0
  1092. drivers/net/wireless/realtek/rtw88/rtw8822b.c +19 −0
  1093. drivers/net/wireless/realtek/rtw88/rtw8822bu.c +90 −0
  1094. drivers/net/wireless/realtek/rtw88/rtw8822c.c +24 −0
  1095. drivers/net/wireless/realtek/rtw88/rtw8822cu.c +44 −0
  1096. drivers/net/wireless/realtek/rtw88/tx.h +31 −0
  1097. drivers/net/wireless/realtek/rtw88/usb.c +911 −0
  1098. drivers/net/wireless/realtek/rtw88/usb.h +107 −0
  1099. drivers/net/wireless/realtek/rtw88/util.c +103 −0
  1100. drivers/net/wireless/realtek/rtw88/util.h +9 −3
  1101. drivers/net/wireless/realtek/rtw89/Kconfig +14 −0
  1102. drivers/net/wireless/realtek/rtw89/Makefile +11 −0
  1103. drivers/net/wireless/realtek/rtw89/chan.c +36 −4
  1104. drivers/net/wireless/realtek/rtw89/coex.c +7 −2
  1105. drivers/net/wireless/realtek/rtw89/core.c +95 −7
  1106. drivers/net/wireless/realtek/rtw89/core.h +227 −11
  1107. drivers/net/wireless/realtek/rtw89/debug.c +961 −91
  1108. drivers/net/wireless/realtek/rtw89/debug.h +2 −0
  1109. drivers/net/wireless/realtek/rtw89/fw.c +758 −32
  1110. drivers/net/wireless/realtek/rtw89/fw.h +728 −3
  1111. drivers/net/wireless/realtek/rtw89/mac.c +645 −125
  1112. drivers/net/wireless/realtek/rtw89/mac.h +120 −0
  1113. drivers/net/wireless/realtek/rtw89/mac80211.c +69 −1
  1114. drivers/net/wireless/realtek/rtw89/pci.c +37 −4
  1115. drivers/net/wireless/realtek/rtw89/pci.h +12 −0
  1116. drivers/net/wireless/realtek/rtw89/phy.c +342 −16
  1117. drivers/net/wireless/realtek/rtw89/phy.h +73 −14
  1118. drivers/net/wireless/realtek/rtw89/ps.c +1 −1
  1119. drivers/net/wireless/realtek/rtw89/ps.h +1 −0
  1120. drivers/net/wireless/realtek/rtw89/reg.h +461 −5
  1121. drivers/net/wireless/realtek/rtw89/rtw8852a.c +24 −155
  1122. drivers/net/wireless/realtek/rtw89/rtw8852a.h +0 −1
  1123. drivers/net/wireless/realtek/rtw89/rtw8852b.c +2444 −1
  1124. drivers/net/wireless/realtek/rtw89/rtw8852b.h +137 −0
  1125. drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c +4174 −0
  1126. drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.h +25 −0
  1127. drivers/net/wireless/realtek/rtw89/rtw8852b_rfk_table.c +794 −0
  1128. drivers/net/wireless/realtek/rtw89/rtw8852b_rfk_table.h +62 −0
  1129. drivers/net/wireless/realtek/rtw89/rtw8852b_table.c +22877 −0
  1130. drivers/net/wireless/realtek/rtw89/rtw8852b_table.h +30 −0
  1131. drivers/net/wireless/realtek/rtw89/rtw8852be.c +64 −0
  1132. drivers/net/wireless/realtek/rtw89/rtw8852c.c +29 −203
  1133. drivers/net/wireless/realtek/rtw89/rtw8852c.h +0 −1
  1134. drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c +12 −13
  1135. drivers/net/wireless/realtek/rtw89/rtw8852c_table.c +879 −109
  1136. drivers/net/wireless/realtek/rtw89/txrx.h +3 −1
  1137. drivers/net/wireless/realtek/rtw89/util.h +11 −0
  1138. drivers/net/wireless/realtek/rtw89/wow.c +859 −0
  1139. drivers/net/wireless/realtek/rtw89/wow.h +21 −0
  1140. drivers/net/wireless/rsi/rsi_91x_core.c +3 −1
  1141. drivers/net/wireless/rsi/rsi_91x_hal.c +5 −1
  1142. drivers/net/wireless/rsi/rsi_91x_mac80211.c +1 −0
  1143. drivers/net/wireless/silabs/wfx/main.c +1 −0
  1144. drivers/net/wireless/st/cw1200/main.c +1 −0
  1145. drivers/net/wireless/ti/Kconfig +0 −8
  1146. drivers/net/wireless/ti/wilink_platform_data.c +0 −35
  1147. drivers/net/wireless/ti/wl1251/main.c +1 −0
  1148. drivers/net/wireless/ti/wl1251/sdio.c +1 −7
  1149. drivers/net/wireless/ti/wl1251/spi.c +36 −40
  1150. drivers/net/wireless/ti/wl1251/wl1251.h +0 −1
  1151. drivers/net/wireless/ti/wlcore/main.c +1 −0
  1152. drivers/net/wireless/ti/wlcore/spi.c +0 −1
  1153. drivers/net/wireless/zydas/zd1201.c +89 −85
  1154. drivers/net/wireless/zydas/zd1211rw/zd_mac.c +1 −0
  1155. drivers/net/wwan/Kconfig +1 −0
  1156. drivers/net/wwan/iosm/iosm_ipc_chnl_cfg.c +1 −1
  1157. drivers/net/wwan/mhi_wwan_mbim.c +4 −4
  1158. drivers/net/wwan/t7xx/Makefile +3 −0
  1159. drivers/net/wwan/t7xx/t7xx_hif_cldma.c +2 −0
  1160. drivers/net/wwan/t7xx/t7xx_hif_dpmaif.h +5 −9
  1161. drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c +66 −152
  1162. drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.h +1 −0
  1163. drivers/net/wwan/t7xx/t7xx_netdev.c +85 −6
  1164. drivers/net/wwan/t7xx/t7xx_netdev.h +5 −0
  1165. drivers/net/wwan/t7xx/t7xx_pci.h +3 −0
  1166. drivers/net/wwan/t7xx/t7xx_port.h +8 −1
  1167. drivers/net/wwan/t7xx/t7xx_port_proxy.c +12 −0
  1168. drivers/net/wwan/t7xx/t7xx_port_proxy.h +4 −0
  1169. drivers/net/wwan/t7xx/t7xx_port_trace.c +116 −0
  1170. drivers/net/wwan/t7xx/t7xx_port_wwan.c +8 −8
  1171. drivers/net/wwan/wwan_core.c +5 −1
  1172. drivers/net/xen-netfront.c +4 −4
  1173. drivers/nfc/microread/i2c.c +2 −3
  1174. drivers/nfc/nfcmrvl/i2c.c +2 −3
  1175. drivers/nfc/nxp-nci/i2c.c +2 −3
  1176. drivers/nfc/pn533/i2c.c +2 −3
  1177. drivers/nfc/pn544/i2c.c +2 −3
  1178. drivers/nfc/s3fwrn5/i2c.c +7 −17
  1179. drivers/nfc/st-nci/i2c.c +2 −3
  1180. drivers/nfc/st21nfca/i2c.c +2 −3
  1181. drivers/nfc/virtual_ncidev.c +71 −76
  1182. drivers/ptp/ptp_clock.c +1 −4
  1183. drivers/ptp/ptp_dte.c +3 −2
  1184. drivers/ptp/ptp_idt82p33.c +617 −92
  1185. drivers/ptp/ptp_idt82p33.h +19 −2
  1186. drivers/ptp/ptp_kvm_common.c +2 −2
  1187. drivers/ptp/ptp_ocp.c +515 −52
  1188. drivers/ptp/ptp_pch.c +4 −15
  1189. drivers/ptp/ptp_vmw.c +2 −2
  1190. drivers/s390/net/ctcm_main.c +2 −9
  1191. drivers/s390/net/lcs.c +3 −5
  1192. drivers/s390/net/netiucv.c +1 −8
  1193. drivers/staging/vt6655/device_main.c +1 −0
  1194. drivers/staging/vt6656/main_usb.c +1 −0
  1195. drivers/usb/core/message.c +1 −0
  1196. drivers/usb/core/usb.h +0 −1
  1197. include/linux/avf/virtchnl.h +12 −2
  1198. include/linux/bcma/bcma_driver_chipcommon.h +1 −1
  1199. include/linux/bpf.h +236 −121
  1200. include/linux/bpf_local_storage.h +7 −10
  1201. include/linux/bpf_lsm.h +6 −0
  1202. include/linux/bpf_types.h +1 −0
  1203. include/linux/bpf_verifier.h +53 −13
  1204. include/linux/btf.h +123 −27
  1205. include/linux/btf_ids.h +3 −1
  1206. include/linux/cgroup-defs.h +4 −0
  1207. include/linux/compiler_types.h +2 −1
  1208. include/linux/cpuhotplug.h +1 −0
  1209. include/linux/dsa/8021q.h +1 −30
  1210. include/linux/ethtool.h +21 −4
  1211. include/linux/filter.h +10 −10
  1212. include/linux/ieee80211.h +70 −14
  1213. include/linux/ieee802154.h +24 −0
  1214. include/linux/if_bridge.h +1 −0
  1215. include/linux/if_vlan.h +3 −6
  1216. include/linux/jump_label.h +17 −4
  1217. include/linux/mdio.h +13 −0
  1218. include/linux/mlx5/device.h +9 −4
  1219. include/linux/mlx5/driver.h +0 −2
  1220. include/linux/mlx5/fs.h +12 −0
  1221. include/linux/mlx5/mlx5_ifc.h +121 −6
  1222. include/linux/mlx5/vport.h +2 −0
  1223. include/linux/module.h +9 −0
  1224. include/linux/mv643xx_eth.h +2 −0
  1225. include/linux/net.h +1 −0
  1226. include/linux/netdevice.h +64 −39
  1227. include/linux/netfilter/ipset/ip_set.h +10 −0
  1228. include/linux/netlink.h +27 −2
  1229. include/linux/of_net.h +6 −0
  1230. include/linux/phy.h +7 −0
  1231. include/linux/phylink.h +32 −0
  1232. include/linux/proc_fs.h +2 −0
  1233. include/linux/ptp_clock_kernel.h +53 −7
  1234. include/linux/rcupdate.h +12 −0
  1235. include/linux/rhashtable.h +36 −25
  1236. include/linux/rtnetlink.h +5 −4
  1237. include/linux/sctp.h +5 −0
  1238. include/linux/sfp.h +99 −90
  1239. include/linux/skbuff.h +11 −15
  1240. include/linux/skmsg.h +1 −0
  1241. include/linux/smc911x.h +0 −14
  1242. include/linux/soc/mediatek/mtk_wed.h +116 −5
  1243. include/linux/socket.h +4 −1
  1244. include/linux/stmmac.h +1 −0
  1245. include/linux/tcp.h +1 −0
  1246. include/linux/udp.h +7 −1
  1247. include/linux/usb.h +1 −0
  1248. include/linux/virtio_net.h +9 −0
  1249. include/linux/wl12xx.h +0 −44
  1250. include/linux/wwan.h +2 −0
  1251. include/net/act_api.h +6 −5
  1252. include/net/af_rxrpc.h +1 −1
  1253. include/net/bluetooth/hci.h +21 −0
  1254. include/net/bluetooth/hci_core.h +7 −1
  1255. include/net/bond_alb.h +2 −2
  1256. include/net/bonding.h +0 −4
  1257. include/net/cfg80211-wext.h +10 −10
  1258. include/net/cfg80211.h +13 −2
  1259. include/net/cfg802154.h +34 −4
  1260. include/net/dcbnl.h +4 −0
  1261. include/net/devlink.h +110 −8
  1262. include/net/dropreason.h +14 −0
  1263. include/net/dsa.h +1 −75
  1264. include/net/dst.h +2 −3
  1265. include/net/dst_metadata.h +1 −0
  1266. include/net/flow_offload.h +8 −0
  1267. include/net/fq_impl.h +10 −6
  1268. include/net/genetlink.h +70 −9
  1269. include/net/geneve.h +1 −1
  1270. include/net/ieee802154_netdev.h +8 −0
  1271. include/net/inet_frag.h +5 −1
  1272. include/net/ip_vs.h +160 −11
  1273. include/net/ipv6.h +33 −0
  1274. include/net/ipv6_frag.h +2 −1
  1275. include/net/mac80211.h +59 −19
  1276. include/net/mac802154.h +0 −31
  1277. include/net/mana/gdma.h +154 −5
  1278. include/net/mana/hw_channel.h +0 −0
  1279. include/net/mana/mana.h +18 −4
  1280. include/net/mana/mana_auxiliary.h +10 −0
  1281. include/net/mana/shm_channel.h +0 −0
  1282. include/net/mptcp.h +10 −2
  1283. include/net/mrp.h +1 −0
  1284. include/net/net_namespace.h +22 −8
  1285. include/net/netfilter/nf_conntrack_core.h +1 −2
  1286. include/net/netfilter/nf_conntrack_helper.h +5 −0
  1287. include/net/netfilter/nf_nat.h +4 −0
  1288. include/net/netfilter/nf_tables.h +11 −4
  1289. include/net/netfilter/nf_tables_core.h +26 −10
  1290. include/net/netfilter/nf_tables_ipv4.h +4 −0
  1291. include/net/netfilter/nf_tables_ipv6.h +3 −3
  1292. include/net/netfilter/nft_fib.h +1 −1
  1293. include/net/netfilter/nft_meta.h +8 −2
  1294. include/net/netfilter/nft_reject.h +2 −1
  1295. include/net/netlink.h +32 −0
  1296. include/net/netns/ipv4.h +8 −0
  1297. include/net/netns/sctp.h +4 −0
  1298. include/net/netns/xdp.h +1 −1
  1299. include/net/nl802154.h +43 −0
  1300. include/net/rtnetlink.h +3 −2
  1301. include/net/sctp/checksum.h +1 −1
  1302. include/net/sctp/sctp.h +4 −7
  1303. include/net/sctp/stream_sched.h +0 −2
  1304. include/net/sctp/structs.h +6 −3
  1305. include/net/sctp/ulpqueue.h +1 −2
  1306. include/net/sock.h +4 −4
  1307. include/net/sock_reuseport.h +2 −0
  1308. include/net/switchdev.h +1 −0
  1309. include/net/tc_act/tc_ct.h +1 −0
  1310. include/net/tc_act/tc_skbedit.h +29 −0
  1311. include/net/tc_wrapper.h +251 −0
  1312. include/net/tcp.h +37 −5
  1313. include/net/transp_v6.h +0 −2
  1314. include/net/tso.h +7 −1
  1315. include/net/udp.h +9 −0
  1316. include/net/udp_tunnel.h +2 −2
  1317. include/net/xfrm.h +123 −26
  1318. include/soc/mscc/ocelot.h +0 −216
  1319. include/trace/events/rxrpc.h +633 −188
  1320. include/trace/events/skb.h +1 −1
  1321. include/uapi/linux/bpf.h +296 −228
  1322. include/uapi/linux/dcbnl.h +8 −0
  1323. include/uapi/linux/devlink.h +18 −0
  1324. include/uapi/linux/ethtool.h +12 −6
  1325. include/uapi/linux/ethtool_netlink.h +15 −0
  1326. include/uapi/linux/if_bridge.h +21 −0
  1327. include/uapi/linux/if_link.h +3 −0
  1328. include/uapi/linux/if_packet.h +1 −0
  1329. include/uapi/linux/if_tun.h +2 −0
  1330. include/uapi/linux/mptcp.h +9 −0
  1331. include/uapi/linux/neighbour.h +7 −1
  1332. include/uapi/linux/net_tstamp.h +2 −1
  1333. include/uapi/linux/netfilter/ipset/ip_set.h +2 −0
  1334. include/uapi/linux/netfilter/nf_conntrack_sctp.h +1 −0
  1335. include/uapi/linux/netfilter/nf_tables.h +29 −0
  1336. include/uapi/linux/netfilter/nfnetlink_cttimeout.h +1 −0
  1337. include/uapi/linux/nl80211.h +3 −0
  1338. include/uapi/linux/openvswitch.h +14 −0
  1339. include/uapi/linux/snmp.h +1 −0
  1340. include/uapi/linux/tc_act/tc_ct.h +3 −0
  1341. include/uapi/linux/tcp.h +6 −0
  1342. include/uapi/linux/virtio_bt.h +8 −0
  1343. include/uapi/linux/virtio_net.h +4 −0
  1344. include/uapi/linux/xfrm.h +6 −0
  1345. kernel/bpf/Makefile +1 −1
  1346. kernel/bpf/arraymap.c +10 −19
  1347. kernel/bpf/bpf_cgrp_storage.c +246 −0
  1348. kernel/bpf/bpf_inode_storage.c +4 −38
  1349. kernel/bpf/bpf_local_storage.c +134 −72
  1350. kernel/bpf/bpf_lsm.c +20 −2
  1351. kernel/bpf/bpf_task_storage.c +99 −62
  1352. kernel/bpf/btf.c +744 −564
  1353. kernel/bpf/cgroup_iter.c +15 −1
  1354. kernel/bpf/core.c +23 −1
  1355. kernel/bpf/cpumap.c +16 −17
  1356. kernel/bpf/devmap.c +2 −2
  1357. kernel/bpf/hashtab.c +13 −24
  1358. kernel/bpf/helpers.c +420 −19
  1359. kernel/bpf/local_storage.c +1 −1
  1360. kernel/bpf/map_in_map.c +44 −17
  1361. kernel/bpf/memalloc.c +37 −9
  1362. kernel/bpf/ringbuf.c +3 −3
  1363. kernel/bpf/syscall.c +242 −227
  1364. kernel/bpf/trampoline.c +67 −13
  1365. kernel/bpf/verifier.c +2200 −553
  1366. kernel/cgroup/cgroup.c +1 −0
  1367. kernel/jump_label.c +44 −12
  1368. kernel/module/kallsyms.c +0 −2
  1369. kernel/rcu/tasks.h +2 −0
  1370. kernel/trace/bpf_trace.c +107 −6
  1371. kernel/trace/ftrace.c +11 −5
  1372. lib/Kconfig +1 −0
  1373. lib/net_utils.c +2 −1
  1374. lib/nlattr.c +1 −1
  1375. lib/packing.c +2 −14
  1376. lib/rhashtable.c +10 −6
  1377. lib/test_bpf.c +0 −1
  1378. lib/test_rhashtable.c +2 −4
  1379. net/802/mrp.c +13 −5
  1380. net/8021q/vlan_dev.c +2 −2
  1381. net/ax25/af_ax25.c +2 −2
  1382. net/batman-adv/netlink.c +4 −2
  1383. net/bluetooth/Kconfig +11 −0
  1384. net/bluetooth/hci_conn.c +4 −13
  1385. net/bluetooth/hci_core.c +2 −2
  1386. net/bluetooth/hci_debugfs.c +1 −1
  1387. net/bluetooth/hci_event.c +17 −7
  1388. net/bluetooth/hci_sync.c +20 −1
  1389. net/bluetooth/iso.c +42 −25
  1390. net/bluetooth/l2cap_core.c +1 −1
  1391. net/bluetooth/lib.c +2 −2
  1392. net/bluetooth/mgmt.c +1 −1
  1393. net/bluetooth/rfcomm/core.c +1 −1
  1394. net/bpf/bpf_dummy_struct_ops.c +7 −7
  1395. net/bpf/test_run.c +12 −7
  1396. net/bridge/br.c +3 −2
  1397. net/bridge/br_fdb.c +44 −2
  1398. net/bridge/br_input.c +19 −2
  1399. net/bridge/br_mdb.c +603 −221
  1400. net/bridge/br_multicast.c +18 −12
  1401. net/bridge/br_netlink.c +20 −1
  1402. net/bridge/br_private.h +27 −3
  1403. net/bridge/br_switchdev.c +5 −1
  1404. net/bridge/br_vlan.c +2 −2
  1405. net/bridge/netfilter/nf_conntrack_bridge.c +1 −31
  1406. net/can/af_can.c +1 −2
  1407. net/can/j1939/transport.c +1 −1
  1408. net/can/raw.c +1 −0
  1409. net/core/bpf_sk_storage.c +6 −36
  1410. net/core/dev.c +96 −89
  1411. net/core/dev.h +7 −0
  1412. net/core/dev_ioctl.c +1 −1
  1413. net/core/devlink.c +637 −152
  1414. net/core/drop_monitor.c +6 −6
  1415. net/core/dst.c +6 −2
  1416. net/core/failover.c +3 −3
  1417. net/core/filter.c +94 −47
  1418. net/core/flow_dissector.c +3 −1
  1419. net/core/flow_offload.c +7 −0
  1420. net/core/gen_stats.c +8 −8
  1421. net/core/gro.c +36 −38
  1422. net/core/link_watch.c +17 −3
  1423. net/core/net-sysfs.c +2 −2
  1424. net/core/net_namespace.c +5 −0
  1425. net/core/of_net.c +3 −2
  1426. net/core/rtnetlink.c +70 −20
  1427. net/core/skbuff.c +115 −50
  1428. net/core/skmsg.c +6 −3
  1429. net/core/sock.c +25 −4
  1430. net/core/sock_diag.c +9 −6
  1431. net/core/sock_map.c +2 −0
  1432. net/core/sock_reuseport.c +89 −5
  1433. net/core/tso.c +0 −8
  1434. net/core/utils.c +2 −2
  1435. net/dcb/dcbnl.c +148 −5
  1436. net/dccp/dccp.h +1 −0
  1437. net/dccp/ipv6.c +8 −7
  1438. net/dccp/proto.c +7 −1
  1439. net/dsa/Kconfig +6 −0
  1440. net/dsa/Makefile +3 −1
  1441. net/dsa/devlink.c +391 −0
  1442. net/dsa/devlink.h +16 −0
  1443. net/dsa/dsa.c +1462 −283
  1444. net/dsa/dsa.h +40 −0
  1445. net/dsa/dsa2.c +0 −1829
  1446. net/dsa/dsa_priv.h +0 −588
  1447. net/dsa/master.c +22 −3
  1448. net/dsa/master.h +19 −0
  1449. net/dsa/netlink.c +2 −1
  1450. net/dsa/netlink.h +8 −0
  1451. net/dsa/port.c +13 −11
  1452. net/dsa/port.h +114 −0
  1453. net/dsa/slave.c +62 −13
  1454. net/dsa/slave.h +69 −0
  1455. net/dsa/switch.c +52 −1
  1456. net/dsa/switch.h +120 −0
  1457. net/dsa/tag.c +243 −0
  1458. net/dsa/tag.h +310 −0
  1459. net/dsa/tag_8021q.c +28 −2
  1460. net/dsa/tag_8021q.h +27 −0
  1461. net/dsa/tag_ar9331.c +5 −3
  1462. net/dsa/tag_brcm.c +11 −7
  1463. net/dsa/tag_dsa.c +8 −5
  1464. net/dsa/tag_gswip.c +5 −3
  1465. net/dsa/tag_hellcreek.c +5 −3
  1466. net/dsa/tag_ksz.c +15 −9
  1467. net/dsa/tag_lan9303.c +5 −3
  1468. net/dsa/tag_mtk.c +7 −3
  1469. net/dsa/tag_none.c +30 −0
  1470. net/dsa/tag_ocelot.c +9 −5
  1471. net/dsa/tag_ocelot_8021q.c +7 −3
  1472. net/dsa/tag_qca.c +5 −3
  1473. net/dsa/tag_rtl4_a.c +5 −3
  1474. net/dsa/tag_rtl8_4.c +6 −3
  1475. net/dsa/tag_rzn1_a5psw.c +5 −3
  1476. net/dsa/tag_sja1105.c +10 −5
  1477. net/dsa/tag_trailer.c +5 −3
  1478. net/dsa/tag_xrs700x.c +5 −3
  1479. net/ethernet/eth.c +1 −1
  1480. net/ethtool/Makefile +1 −1
  1481. net/ethtool/channels.c +14 −5
  1482. net/ethtool/common.c +81 −0
  1483. net/ethtool/common.h +1 −0
  1484. net/ethtool/ioctl.c +25 −19
  1485. net/ethtool/linkstate.c +23 −1
  1486. net/ethtool/netlink.c +7 −0
  1487. net/ethtool/netlink.h +2 −0
  1488. net/ethtool/rss.c +153 −0
  1489. net/hsr/hsr_debugfs.c +16 −24
  1490. net/hsr/hsr_device.c +13 −18
  1491. net/hsr/hsr_forward.c +6 −8
  1492. net/hsr/hsr_framereg.c +110 −155
  1493. net/hsr/hsr_framereg.h +6 −11
  1494. net/hsr/hsr_main.h +8 −7
  1495. net/hsr/hsr_netlink.c +1 −3
  1496. net/ieee802154/core.c +3 −0
  1497. net/ieee802154/nl802154.c +107 −2
  1498. net/ieee802154/nl802154.h +2 −0
  1499. net/ipv4/Makefile +1 −1
  1500. net/ipv4/af_inet.c +4 −4
  1501. net/ipv4/bpf_tcp_ca.c +9 −8
  1502. net/ipv4/inet_connection_sock.c +4 −3
  1503. net/ipv4/inet_fragment.c +10 −4
  1504. net/ipv4/ip_fragment.c +13 −6
  1505. net/ipv4/ip_gre.c +6 −6
  1506. net/ipv4/ip_sockglue.c +2 −1
  1507. net/ipv4/ip_tunnel.c +16 −16
  1508. net/ipv4/ip_vti.c +10 −10
  1509. net/ipv4/ipip.c +1 −1
  1510. net/ipv4/ipmr.c +6 −6
  1511. net/ipv4/metrics.c +0 −3
  1512. net/ipv4/netfilter/nft_dup_ipv4.c +2 −1
  1513. net/ipv4/netfilter/nft_fib_ipv4.c +2 −3
  1514. net/ipv4/ping.c +1 −1
  1515. net/ipv4/proc.c +1 −0
  1516. net/ipv4/syncookies.c +3 −4
  1517. net/ipv4/sysctl_net_ipv4.c +83 −0
  1518. net/ipv4/tcp.c +6 −4
  1519. net/ipv4/tcp_bpf.c +12 −7
  1520. net/ipv4/tcp_dctcp.c +22 −1
  1521. net/ipv4/tcp_input.c +43 −24
  1522. net/ipv4/tcp_ipv4.c +82 −23
  1523. net/ipv4/tcp_minisocks.c +39 −22
  1524. net/ipv4/tcp_output.c +19 −22
  1525. net/ipv4/tcp_plb.c +109 −0
  1526. net/ipv4/udp.c +176 −41
  1527. net/ipv4/udp_diag.c +3 −3
  1528. net/ipv4/udp_offload.c +5 −3
  1529. net/ipv4/udp_tunnel_core.c +1 −0
  1530. net/ipv4/udp_tunnel_nic.c +2 −0
  1531. net/ipv6/addrconf.c +2 −2
  1532. net/ipv6/af_inet6.c +4 −9
  1533. net/ipv6/datagram.c +12 −6
  1534. net/ipv6/esp6_offload.c +1 −2
  1535. net/ipv6/ip6_fib.c +3 −4
  1536. net/ipv6/ip6_gre.c +4 −27
  1537. net/ipv6/ip6_offload.c +4 −23
  1538. net/ipv6/ip6_tunnel.c +12 −14
  1539. net/ipv6/ip6_vti.c +7 −9
  1540. net/ipv6/ip6mr.c +5 −5
  1541. net/ipv6/ipv6_sockglue.c +2 −4
  1542. net/ipv6/netfilter/nf_conntrack_reasm.c +1 −1
  1543. net/ipv6/netfilter/nft_dup_ipv6.c +2 −1
  1544. net/ipv6/ping.c +0 −6
  1545. net/ipv6/raw.c +0 −2
  1546. net/ipv6/reassembly.c +9 −4
  1547. net/ipv6/seg6_local.c +2 −2
  1548. net/ipv6/sit.c +11 −11
  1549. net/ipv6/tcp_ipv6.c +11 −18
  1550. net/ipv6/udp.c +24 −17
  1551. net/ipv6/udp_offload.c +5 −3
  1552. net/key/af_key.c +3 −3
  1553. net/l2tp/l2tp_ip6.c +0 −2
  1554. net/mac80211/agg-rx.c +3 −22
  1555. net/mac80211/agg-tx.c +1 −1
  1556. net/mac80211/cfg.c +22 −23
  1557. net/mac80211/debugfs.c +1 −3
  1558. net/mac80211/debugfs_netdev.c +1 −2
  1559. net/mac80211/debugfs_sta.c +122 −26
  1560. net/mac80211/debugfs_sta.h +12 −0
  1561. net/mac80211/driver-ops.c +26 −1
  1562. net/mac80211/driver-ops.h +16 −0
  1563. net/mac80211/ieee80211_i.h +20 −2
  1564. net/mac80211/iface.c +6 −68
  1565. net/mac80211/link.c +17 −0
  1566. net/mac80211/main.c +15 −8
  1567. net/mac80211/mlme.c +100 −33
  1568. net/mac80211/rc80211_minstrel_ht.c +0 −3
  1569. net/mac80211/rc80211_minstrel_ht.h +0 −1
  1570. net/mac80211/rx.c +10 −31
  1571. net/mac80211/sta_info.c +74 −44
  1572. net/mac80211/sta_info.h +7 −0
  1573. net/mac80211/tdls.c +0 −1
  1574. net/mac80211/tx.c +200 −127
  1575. net/mac80211/util.c +196 −50
  1576. net/mac80211/wme.c +8 −55
  1577. net/mac80211/wme.h +1 −3
  1578. net/mac802154/cfg.c +3 −3
  1579. net/mac802154/driver-ops.h +161 −92
  1580. net/mac802154/ieee802154_i.h +54 −2
  1581. net/mac802154/iface.c +24 −35
  1582. net/mac802154/main.c +2 −2
  1583. net/mac802154/rx.c +35 −18
  1584. net/mac802154/trace.h +25 −0
  1585. net/mac802154/tx.c +118 −14
  1586. net/mac802154/util.c +64 −7
  1587. net/mpls/af_mpls.c +2 −2
  1588. net/mptcp/Makefile +1 −1
  1589. net/mptcp/fastopen.c +73 −0
  1590. net/mptcp/options.c +17 −8
  1591. net/mptcp/pm_netlink.c +88 −38
  1592. net/mptcp/pm_userspace.c +6 −2
  1593. net/mptcp/protocol.c +25 −62
  1594. net/mptcp/protocol.h +26 −4
  1595. net/mptcp/sockopt.c +21 −24
  1596. net/mptcp/subflow.c +135 −33
  1597. net/mptcp/token.c +2 −2
  1598. net/ncsi/ncsi-cmd.c +2 −1
  1599. net/netfilter/Kconfig +3 −6
  1600. net/netfilter/Makefile +3 −2
  1601. net/netfilter/ipset/ip_set_hash_gen.h +62 −9
  1602. net/netfilter/ipset/ip_set_hash_ip.c +8 −11
  1603. net/netfilter/ipset/ip_set_hash_ipport.c +23 −1
  1604. net/netfilter/ipset/ip_set_hash_netnet.c +21 −5
  1605. net/netfilter/ipvs/ip_vs_core.c +22 −18
  1606. net/netfilter/ipvs/ip_vs_ctl.c +364 −88
  1607. net/netfilter/ipvs/ip_vs_est.c +815 −68
  1608. net/netfilter/nf_conntrack_bpf.c +7 −10
  1609. net/netfilter/nf_conntrack_core.c +13 −17
  1610. net/netfilter/nf_conntrack_helper.c +100 −0
  1611. net/netfilter/nf_conntrack_proto.c +55 −69
  1612. net/netfilter/nf_conntrack_proto_icmpv6.c +53 −0
  1613. net/netfilter/nf_conntrack_proto_sctp.c +61 −43
  1614. net/netfilter/nf_conntrack_standalone.c +8 −0
  1615. net/netfilter/nf_flow_table_ip.c +8 −0
  1616. net/netfilter/nf_nat_ovs.c +135 −0
  1617. net/netfilter/nf_tables_api.c +72 −18
  1618. net/netfilter/nf_tables_core.c +2 −0
  1619. net/netfilter/nft_bitwise.c +4 −2
  1620. net/netfilter/nft_byteorder.c +2 −1
  1621. net/netfilter/nft_cmp.c +6 −3
  1622. net/netfilter/nft_compat.c +6 −3
  1623. net/netfilter/nft_connlimit.c +2 −1
  1624. net/netfilter/nft_counter.c +3 −2
  1625. net/netfilter/nft_ct.c +4 −2
  1626. net/netfilter/nft_dup_netdev.c +2 −1
  1627. net/netfilter/nft_dynset.c +4 −3
  1628. net/netfilter/nft_exthdr.c +6 −4
  1629. net/netfilter/nft_fib.c +1 −1
  1630. net/netfilter/nft_flow_offload.c +2 −1
  1631. net/netfilter/nft_fwd_netdev.c +4 −2
  1632. net/netfilter/nft_hash.c +2 −2
  1633. net/netfilter/nft_immediate.c +2 −1
  1634. net/netfilter/nft_inner.c +385 −0
  1635. net/netfilter/nft_last.c +2 −1
  1636. net/netfilter/nft_limit.c +3 −2
  1637. net/netfilter/nft_log.c +2 −1
  1638. net/netfilter/nft_lookup.c +2 −1
  1639. net/netfilter/nft_masq.c +2 −1
  1640. net/netfilter/nft_meta.c +65 −2
  1641. net/netfilter/nft_nat.c +2 −1
  1642. net/netfilter/nft_numgen.c +4 −2
  1643. net/netfilter/nft_objref.c +5 −23
  1644. net/netfilter/nft_osf.c +2 −1
  1645. net/netfilter/nft_payload.c +138 −3
  1646. net/netfilter/nft_queue.c +4 −2
  1647. net/netfilter/nft_quota.c +3 −2
  1648. net/netfilter/nft_range.c +2 −1
  1649. net/netfilter/nft_redir.c +2 −1
  1650. net/netfilter/nft_reject.c +2 −1
  1651. net/netfilter/nft_rt.c +1 −1
  1652. net/netfilter/nft_socket.c +1 −1
  1653. net/netfilter/nft_synproxy.c +2 −1
  1654. net/netfilter/nft_tproxy.c +1 −1
  1655. net/netfilter/nft_tunnel.c +1 −1
  1656. net/netfilter/nft_xfrm.c +1 −1
  1657. net/netfilter/xt_sctp.c +0 −1
  1658. net/netlink/af_netlink.c +33 −9
  1659. net/netlink/genetlink.c +374 −121
  1660. net/nfc/nci/core.c +7 −1
  1661. net/nfc/nci/hci.c +3 −1
  1662. net/nfc/rawsock.c +3 −0
  1663. net/openvswitch/Kconfig +1 −0
  1664. net/openvswitch/conntrack.c +19 −232
  1665. net/openvswitch/datapath.c +43 −2
  1666. net/openvswitch/flow_netlink.c +1 −1
  1667. net/openvswitch/flow_table.c +4 −5
  1668. net/openvswitch/vport-geneve.c +1 −1
  1669. net/openvswitch/vport-gre.c +1 −1
  1670. net/openvswitch/vport-netdev.c +1 −1
  1671. net/openvswitch/vport-vxlan.c +1 −1
  1672. net/openvswitch/vport.c +50 −0
  1673. net/openvswitch/vport.h +16 −0
  1674. net/packet/af_packet.c +6 −5
  1675. net/rds/message.c +0 −2
  1676. net/rds/send.c +1 −2
  1677. net/rds/tcp.c +3 −0
  1678. net/rxrpc/Kconfig +7 −0
  1679. net/rxrpc/Makefile +5 −0
  1680. net/rxrpc/af_rxrpc.c +14 −18
  1681. net/rxrpc/ar-internal.h +243 −172
  1682. net/rxrpc/call_accept.c +92 −103
  1683. net/rxrpc/call_event.c +302 −267
  1684. net/rxrpc/call_object.c +179 −182
  1685. net/rxrpc/conn_client.c +75 −71
  1686. net/rxrpc/conn_event.c +85 −43
  1687. net/rxrpc/conn_object.c +149 −164
  1688. net/rxrpc/conn_service.c +14 −15
  1689. net/rxrpc/input.c +371 −852
  1690. net/rxrpc/insecure.c +5 −11
  1691. net/rxrpc/io_thread.c +496 −0
  1692. net/rxrpc/key.c +10 −6
  1693. net/rxrpc/local_event.c +3 −43
  1694. net/rxrpc/local_object.c +70 −104
  1695. net/rxrpc/misc.c +1 −22
  1696. net/rxrpc/net_ns.c +3 −1
  1697. net/rxrpc/output.c +274 −251
  1698. net/rxrpc/peer_event.c +67 −358
  1699. net/rxrpc/peer_object.c +24 −35
  1700. net/rxrpc/proc.c +134 −35
  1701. net/rxrpc/protocol.h +1 −8
  1702. net/rxrpc/recvmsg.c +96 −212
  1703. net/rxrpc/rxkad.c +122 −192
  1704. net/rxrpc/rxperf.c +619 −0
  1705. net/rxrpc/security.c +32 −2
  1706. net/rxrpc/sendmsg.c +71 −162
  1707. net/rxrpc/server_key.c +25 −0
  1708. net/rxrpc/skbuff.c +16 −28
  1709. net/rxrpc/sysctl.c +1 −10
  1710. net/rxrpc/txbuf.c +142 −0
  1711. net/sched/Kconfig +1 −0
  1712. net/sched/act_api.c +2 −1
  1713. net/sched/act_bpf.c +4 −2
  1714. net/sched/act_connmark.c +4 −2
  1715. net/sched/act_csum.c +4 −2
  1716. net/sched/act_ct.c +109 −148
  1717. net/sched/act_ctinfo.c +4 −2
  1718. net/sched/act_gact.c +4 −2
  1719. net/sched/act_gate.c +4 −2
  1720. net/sched/act_ife.c +4 −2
  1721. net/sched/act_ipt.c +4 −2
  1722. net/sched/act_mirred.c +4 −2
  1723. net/sched/act_mpls.c +4 −2
  1724. net/sched/act_nat.c +4 −3
  1725. net/sched/act_pedit.c +4 −2
  1726. net/sched/act_police.c +4 −2
  1727. net/sched/act_sample.c +4 −2
  1728. net/sched/act_simple.c +4 −2
  1729. net/sched/act_skbedit.c +16 −4
  1730. net/sched/act_skbmod.c +4 −2
  1731. net/sched/act_tunnel_key.c +4 −2
  1732. net/sched/act_vlan.c +4 −2
  1733. net/sched/cls_api.c +9 −1
  1734. net/sched/cls_basic.c +4 −2
  1735. net/sched/cls_bpf.c +4 −2
  1736. net/sched/cls_cgroup.c +4 −2
  1737. net/sched/cls_flow.c +4 −2
  1738. net/sched/cls_flower.c +4 −2
  1739. net/sched/cls_fw.c +4 −2
  1740. net/sched/cls_matchall.c +4 −2
  1741. net/sched/cls_route.c +4 −2
  1742. net/sched/cls_rsvp.c +2 −0
  1743. net/sched/cls_rsvp.h +3 −3
  1744. net/sched/cls_rsvp6.c +2 −0
  1745. net/sched/cls_tcindex.c +4 −3
  1746. net/sched/cls_u32.c +4 −2
  1747. net/sched/sch_api.c +5 −0
  1748. net/sctp/associola.c +1 −3
  1749. net/sctp/diag.c +2 −1
  1750. net/sctp/endpointola.c +9 −4
  1751. net/sctp/input.c +59 −49
  1752. net/sctp/ipv6.c +18 −4
  1753. net/sctp/protocol.c +16 −3
  1754. net/sctp/sm_statefuns.c +1 −1
  1755. net/sctp/socket.c +27 −11
  1756. net/sctp/stream_interleave.c +3 −9
  1757. net/sctp/stream_sched.c +20 −18
  1758. net/sctp/stream_sched_prio.c +0 −27
  1759. net/sctp/stream_sched_rr.c +0 −6
  1760. net/sctp/sysctl.c +55 −29
  1761. net/sctp/ulpqueue.c +2 −8
  1762. net/socket.c +1 −7
  1763. net/tls/tls_sw.c +4 −2
  1764. net/unix/af_unix.c +1 −0
  1765. net/vmw_vsock/vmci_transport.c +5 −1
  1766. net/wireless/core.h +4 −1
  1767. net/wireless/mlme.c +4 −0
  1768. net/wireless/nl80211.c +21 −5
  1769. net/wireless/nl80211.h +2 −1
  1770. net/wireless/reg.c +3 −1
  1771. net/wireless/scan.c +15 −32
  1772. net/wireless/sme.c +22 −4
  1773. net/wireless/util.c +3 −1
  1774. net/wireless/wext-compat.c +82 −98
  1775. net/wireless/wext-compat.h +4 −4
  1776. net/wireless/wext-sme.c +3 −2
  1777. net/xdp/xskmap.c +2 −2
  1778. net/xfrm/Makefile +8 −0
  1779. net/xfrm/xfrm_device.c +101 −8
  1780. net/xfrm/xfrm_input.c +1 −0
  1781. net/xfrm/xfrm_interface_bpf.c +115 −0
  1782. net/xfrm/xfrm_interface_core.c +14 −0
  1783. net/xfrm/xfrm_output.c +12 −3
  1784. net/xfrm/xfrm_policy.c +106 −16
  1785. net/xfrm/xfrm_state.c +189 −23
  1786. net/xfrm/xfrm_user.c +81 −23
  1787. samples/bpf/README.rst +3 −3
  1788. samples/bpf/hbm_edt_kern.c +1 −1
  1789. samples/bpf/sockex3_kern.c +53 −42
  1790. samples/bpf/sockex3_user.c +10 −13
  1791. samples/bpf/test_cgrp2_tc.sh +1 −1
  1792. samples/bpf/tracex2_kern.c +2 −2
  1793. samples/bpf/tracex2_user.c +2 −1
  1794. samples/bpf/xdp1_user.c +1 −1
  1795. samples/bpf/xdp2_kern.c +4 −0
  1796. samples/bpf/xdp_router_ipv4_user.c +1 −1
  1797. samples/pktgen/functions.sh +1 −1
  1798. scripts/bpf_doc.py +35 −14
  1799. tools/bpf/bpftool/Documentation/bpftool-map.rst +1 −1
  1800. tools/bpf/bpftool/Documentation/bpftool-prog.rst +13 −2
  1801. tools/bpf/bpftool/Documentation/common_options.rst +4 −13
  1802. tools/bpf/bpftool/Documentation/substitutions.rst +1 −1
  1803. tools/bpf/bpftool/Makefile +49 −25
  1804. tools/bpf/bpftool/bash-completion/bpftool +2 −1
  1805. tools/bpf/bpftool/btf.c +17 −27
  1806. tools/bpf/bpftool/btf_dumper.c +1 −1
  1807. tools/bpf/bpftool/common.c +14 −9
  1808. tools/bpf/bpftool/gen.c +11 −18
  1809. tools/bpf/bpftool/iter.c +8 −4
  1810. tools/bpf/bpftool/jit_disasm.c +215 −46
  1811. tools/bpf/bpftool/link.c +4 −6
  1812. tools/bpf/bpftool/main.c +62 −54
  1813. tools/bpf/bpftool/main.h +19 −30
  1814. tools/bpf/bpftool/map.c +12 −21
  1815. tools/bpf/bpftool/net.c +2 −0
  1816. tools/bpf/bpftool/perf.c +2 −0
  1817. tools/bpf/bpftool/pids.c +8 −8
  1818. tools/bpf/bpftool/prog.c +96 −28
  1819. tools/bpf/bpftool/struct_ops.c +9 −13
  1820. tools/bpf/bpftool/xlated_dumper.c +2 −0
  1821. tools/include/uapi/linux/bpf.h +296 −228
  1822. tools/include/uapi/linux/if_link.h +1 −0
  1823. tools/lib/bpf/Makefile +17 −0
  1824. tools/lib/bpf/bpf.c +44 −4
  1825. tools/lib/bpf/bpf.h +23 −0
  1826. tools/lib/bpf/btf.c +192 −80
  1827. tools/lib/bpf/btf_dump.c +36 −10
  1828. tools/lib/bpf/hashmap.c +9 −9
  1829. tools/lib/bpf/hashmap.h +57 −34
  1830. tools/lib/bpf/libbpf.c +166 −100
  1831. tools/lib/bpf/libbpf.map +5 −1
  1832. tools/lib/bpf/libbpf_probes.c +1 −0
  1833. tools/lib/bpf/ringbuf.c +2 −2
  1834. tools/lib/bpf/strset.c +9 −9
  1835. tools/lib/bpf/usdt.c +30 −33
  1836. tools/perf/tests/expr.c +10 −18
  1837. tools/perf/tests/pmu-events.c +3 −3
  1838. tools/perf/util/bpf-loader.c +5 −6
  1839. tools/perf/util/evsel.c +1 −1
  1840. tools/perf/util/expr.c +15 −21
  1841. tools/perf/util/hashmap.c +9 −9
  1842. tools/perf/util/hashmap.h +57 −34
  1843. tools/perf/util/metricgroup.c +5 −5
  1844. tools/perf/util/stat-shadow.c +1 −1
  1845. tools/perf/util/stat.c +4 −5
  1846. tools/testing/selftests/Makefile +1 −0
  1847. tools/testing/selftests/bpf/DENYLIST +2 −1
  1848. tools/testing/selftests/bpf/DENYLIST.aarch64 +84 −0
  1849. tools/testing/selftests/bpf/DENYLIST.s390x +29 −18
  1850. tools/testing/selftests/bpf/Makefile +23 −14
  1851. tools/testing/selftests/bpf/README.rst +47 −6
  1852. tools/testing/selftests/bpf/bpf_experimental.h +68 −0
  1853. tools/testing/selftests/bpf/bpf_legacy.h +13 −6
  1854. tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c +24 −0
  1855. tools/testing/selftests/bpf/bpf_util.h +19 −0
  1856. tools/testing/selftests/bpf/cgroup_helpers.c +21 −1
  1857. tools/testing/selftests/bpf/cgroup_helpers.h +1 −0
  1858. tools/testing/selftests/bpf/config +6 −1
  1859. tools/testing/selftests/bpf/config.aarch64 +181 −0
  1860. tools/testing/selftests/bpf/config.s390x +0 −3
  1861. tools/testing/selftests/bpf/config.x86_64 +0 −1
  1862. tools/testing/selftests/bpf/network_helpers.c +5 −42
  1863. tools/testing/selftests/bpf/prog_tests/align.c +24 −14
  1864. tools/testing/selftests/bpf/prog_tests/bpf_iter.c +22 −19
  1865. tools/testing/selftests/bpf/prog_tests/bpf_nf.c +3 −3
  1866. tools/testing/selftests/bpf/prog_tests/btf.c +273 −5
  1867. tools/testing/selftests/bpf/prog_tests/btf_dedup_split.c +30 −15
  1868. tools/testing/selftests/bpf/prog_tests/btf_dump.c +2 −2
  1869. tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c +10 −15
  1870. tools/testing/selftests/bpf/prog_tests/cgroup_iter.c +76 −0
  1871. tools/testing/selftests/bpf/prog_tests/cgrp_kfunc.c +175 −0
  1872. tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c +265 −0
  1873. tools/testing/selftests/bpf/prog_tests/dynptr.c +3 −77
Documentation/bpf/bpf_design_QA.rst+45−0
@@ -298,3 +298,48 @@ A: NO. · 297 unmodified lines
298298
299299 The BTF_ID macro does not cause a function to become part of the ABI
300300 any more than does the EXPORT_SYMBOL_GPL macro.
301+
302+Q: What is the compatibility story for special BPF types in map values?
303+-----------------------------------------------------------------------
304+Q: Users are allowed to embed bpf_spin_lock, bpf_timer fields in their BPF map
305+values (when using BTF support for BPF maps). This allows to use helpers for
306+such objects on these fields inside map values. Users are also allowed to embed
307+pointers to some kernel types (with __kptr and __kptr_ref BTF tags). Will the
308+kernel preserve backwards compatibility for these features?
309+
310+A: It depends. For bpf_spin_lock, bpf_timer: YES, for kptr and everything else:
311+NO, but see below.
312+
313+For struct types that have been added already, like bpf_spin_lock and bpf_timer,
314+the kernel will preserve backwards compatibility, as they are part of UAPI.
315+
316+For kptrs, they are also part of UAPI, but only with respect to the kptr
317+mechanism. The types that you can use with a __kptr and __kptr_ref tagged
318+pointer in your struct are NOT part of the UAPI contract. The supported types can
319+and will change across kernel releases. However, operations like accessing kptr
320+fields and bpf_kptr_xchg() helper will continue to be supported across kernel
321+releases for the supported types.
322+
323+For any other supported struct type, unless explicitly stated in this document
324+and added to bpf.h UAPI header, such types can and will arbitrarily change their
325+size, type, and alignment, or any other user visible API or ABI detail across
326+kernel releases. The users must adapt their BPF programs to the new changes and
327+update them to make sure their programs continue to work correctly.
328+
329+NOTE: BPF subsystem specially reserves the 'bpf\_' prefix for type names, in
330+order to introduce more special fields in the future. Hence, user programs must
331+avoid defining types with 'bpf\_' prefix to not be broken in future releases.
332+In other words, no backwards compatibility is guaranteed if one using a type
333+in BTF with 'bpf\_' prefix.
334+
335+Q: What is the compatibility story for special BPF types in allocated objects?
336+------------------------------------------------------------------------------
337+Q: Same as above, but for allocated objects (i.e. objects allocated using
338+bpf_obj_new for user defined types). Will the kernel preserve backwards
339+compatibility for these features?
340+
341+A: NO.
342+
343+Unlike map value types, there are no stability guarantees for this case. The
344+whole API to work with allocated objects and any support for special fields
345+inside them is unstable (since it is exposed through kfuncs).
Documentation/bpf/bpf_devel_QA.rst+27−0
@@ -44,6 +44,33 @@ is a guarantee that the reported issue will be overlooked.** · 43 unmodified lines
4444 Submitting patches
4545 ==================
4646
47+Q: How do I run BPF CI on my changes before sending them out for review?
48+------------------------------------------------------------------------
49+A: BPF CI is GitHub based and hosted at https://github.com/kernel-patches/bpf.
50+While GitHub also provides a CLI that can be used to accomplish the same
51+results, here we focus on the UI based workflow.
52+
53+The following steps lay out how to start a CI run for your patches:
54+
55+- Create a fork of the aforementioned repository in your own account (one time
56+ action)
57+
58+- Clone the fork locally, check out a new branch tracking either the bpf-next
59+ or bpf branch, and apply your to-be-tested patches on top of it
60+
61+- Push the local branch to your fork and create a pull request against
62+ kernel-patches/bpf's bpf-next_base or bpf_base branch, respectively
63+
64+Shortly after the pull request has been created, the CI workflow will run. Note
65+that capacity is shared with patches submitted upstream being checked and so
66+depending on utilization the run can take a while to finish.
67+
68+Note furthermore that both base branches (bpf-next_base and bpf_base) will be
69+updated as patches are pushed to the respective upstream branches they track. As
70+such, your patch set will automatically (be attempted to) be rebased as well.
71+This behavior can result in a CI run being aborted and restarted with the new
72+base line.
73+
4774 Q: To which mailing list do I need to submit my BPF patches?
4875 ------------------------------------------------------------
4976 A: Please submit your BPF patches to the bpf kernel mailing list:
Documentation/bpf/bpf_iterators.rst+485−0
@@ -0,0 +1,485 @@
1+=============
2+BPF Iterators
3+=============
4+
5+
6+----------
7+Motivation
8+----------
9+
10+There are a few existing ways to dump kernel data into user space. The most
11+popular one is the ``/proc`` system. For example, ``cat /proc/net/tcp6`` dumps
12+all tcp6 sockets in the system, and ``cat /proc/net/netlink`` dumps all netlink
13+sockets in the system. However, their output format tends to be fixed, and if
14+users want more information about these sockets, they have to patch the kernel,
15+which often takes time to publish upstream and release. The same is true for popular
16+tools like `ss <https://man7.org/linux/man-pages/man8/ss.8.html>`_ where any
17+additional information needs a kernel patch.
18+
19+To solve this problem, the `drgn
20+<https://www.kernel.org/doc/html/latest/bpf/drgn.html>`_ tool is often used to
21+dig out the kernel data with no kernel change. However, the main drawback for
22+drgn is performance, as it cannot do pointer tracing inside the kernel. In
23+addition, drgn cannot validate a pointer value and may read invalid data if the
24+pointer becomes invalid inside the kernel.
25+
26+The BPF iterator solves the above problem by providing flexibility on what data
27+(e.g., tasks, bpf_maps, etc.) to collect by calling BPF programs for each kernel
28+data object.
29+
30+----------------------
31+How BPF Iterators Work
32+----------------------
33+
34+A BPF iterator is a type of BPF program that allows users to iterate over
35+specific types of kernel objects. Unlike traditional BPF tracing programs that
36+allow users to define callbacks that are invoked at particular points of
37+execution in the kernel, BPF iterators allow users to define callbacks that
38+should be executed for every entry in a variety of kernel data structures.
39+
40+For example, users can define a BPF iterator that iterates over every task on
41+the system and dumps the total amount of CPU runtime currently used by each of
42+them. Another BPF task iterator may instead dump the cgroup information for each
43+task. Such flexibility is the core value of BPF iterators.
44+
45+A BPF program is always loaded into the kernel at the behest of a user space
46+process. A user space process loads a BPF program by opening and initializing
47+the program skeleton as required and then invoking a syscall to have the BPF
48+program verified and loaded by the kernel.
49+
50+In traditional tracing programs, a program is activated by having user space
51+obtain a ``bpf_link`` to the program with ``bpf_program__attach()``. Once
52+activated, the program callback will be invoked whenever the tracepoint is
53+triggered in the main kernel. For BPF iterator programs, a ``bpf_link`` to the
54+program is obtained using ``bpf_link_create()``, and the program callback is
55+invoked by issuing system calls from user space.
56+
57+Next, let us see how you can use the iterators to iterate on kernel objects and
58+read data.
59+
60+------------------------
61+How to Use BPF iterators
62+------------------------
63+
64+BPF selftests are a great resource to illustrate how to use the iterators. In
65+this section, we’ll walk through a BPF selftest which shows how to load and use
66+a BPF iterator program. To begin, we’ll look at `bpf_iter.c
67+<https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/prog_tests/bpf_iter.c>`_,
68+which illustrates how to load and trigger BPF iterators on the user space side.
69+Later, we’ll look at a BPF program that runs in kernel space.
70+
71+Loading a BPF iterator in the kernel from user space typically involves the
72+following steps:
73+
74+* The BPF program is loaded into the kernel through ``libbpf``. Once the kernel
75+ has verified and loaded the program, it returns a file descriptor (fd) to user
76+ space.
77+* Obtain a ``link_fd`` to the BPF program by calling the ``bpf_link_create()``
78+ specified with the BPF program file descriptor received from the kernel.
79+* Next, obtain a BPF iterator file descriptor (``bpf_iter_fd``) by calling the
80+ ``bpf_iter_create()`` specified with the ``bpf_link`` received from Step 2.
81+* Trigger the iteration by calling ``read(bpf_iter_fd)`` until no data is
82+ available.
83+* Close the iterator fd using ``close(bpf_iter_fd)``.
84+* If needed to reread the data, get a new ``bpf_iter_fd`` and do the read again.
85+
86+The following are a few examples of selftest BPF iterator programs:
87+
88+* `bpf_iter_tcp4.c <https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/progs/bpf_iter_tcp4.c>`_
89+* `bpf_iter_task_vma.c <https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/progs/bpf_iter_task_vma.c>`_
90+* `bpf_iter_task_file.c <https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/tools/testing/selftests/bpf/progs/bpf_iter_task_file.c>`_
91+
92+Let us look at ``bpf_iter_task_file.c``, which runs in kernel space:
93+
94+Here is the definition of ``bpf_iter__task_file`` in `vmlinux.h
95+<https://facebookmicrosites.github.io/bpf/blog/2020/02/19/bpf-portability-and-co-re.html#btf>`_.
96+Any struct name in ``vmlinux.h`` in the format ``bpf_iter__<iter_name>``
97+represents a BPF iterator. The suffix ``<iter_name>`` represents the type of
98+iterator.
99+
100+::
101+
102+ struct bpf_iter__task_file {
103+ union {
104+ struct bpf_iter_meta *meta;
105+ };
106+ union {
107+ struct task_struct *task;
108+ };
109+ u32 fd;
110+ union {
111+ struct file *file;
112+ };
113+ };
114+
115+In the above code, the field 'meta' contains the metadata, which is the same for
116+all BPF iterator programs. The rest of the fields are specific to different
117+iterators. For example, for task_file iterators, the kernel layer provides the
118+'task', 'fd' and 'file' field values. The 'task' and 'file' are `reference
119+counted
120+<https://facebookmicrosites.github.io/bpf/blog/2018/08/31/object-lifetime.html#file-descriptors-and-reference-counters>`_,
121+so they won't go away when the BPF program runs.
122+
123+Here is a snippet from the ``bpf_iter_task_file.c`` file:
124+
125+::
126+
127+ SEC("iter/task_file")
128+ int dump_task_file(struct bpf_iter__task_file *ctx)
129+ {
130+ struct seq_file *seq = ctx->meta->seq;
131+ struct task_struct *task = ctx->task;
132+ struct file *file = ctx->file;
133+ __u32 fd = ctx->fd;
134+
135+ if (task == NULL || file == NULL)
136+ return 0;
137+
138+ if (ctx->meta->seq_num == 0) {
139+ count = 0;
140+ BPF_SEQ_PRINTF(seq, " tgid gid fd file\n");
141+ }
142+
143+ if (tgid == task->tgid && task->tgid != task->pid)
144+ count++;
145+
146+ if (last_tgid != task->tgid) {
147+ last_tgid = task->tgid;
148+ unique_tgid_count++;
149+ }
150+
151+ BPF_SEQ_PRINTF(seq, "%8d %8d %8d %lx\n", task->tgid, task->pid, fd,
152+ (long)file->f_op);
153+ return 0;
154+ }
155+
156+In the above example, the section name ``SEC(iter/task_file)``, indicates that
157+the program is a BPF iterator program to iterate all files from all tasks. The
158+context of the program is ``bpf_iter__task_file`` struct.
159+
160+The user space program invokes the BPF iterator program running in the kernel
161+by issuing a ``read()`` syscall. Once invoked, the BPF
162+program can export data to user space using a variety of BPF helper functions.
163+You can use either ``bpf_seq_printf()`` (and BPF_SEQ_PRINTF helper macro) or
164+``bpf_seq_write()`` function based on whether you need formatted output or just
165+binary data, respectively. For binary-encoded data, the user space applications
166+can process the data from ``bpf_seq_write()`` as needed. For the formatted data,
167+you can use ``cat <path>`` to print the results similar to ``cat
168+/proc/net/netlink`` after pinning the BPF iterator to the bpffs mount. Later,
169+use ``rm -f <path>`` to remove the pinned iterator.
170+
171+For example, you can use the following command to create a BPF iterator from the
172+``bpf_iter_ipv6_route.o`` object file and pin it to the ``/sys/fs/bpf/my_route``
173+path:
174+
175+::
176+
177+ $ bpftool iter pin ./bpf_iter_ipv6_route.o /sys/fs/bpf/my_route
178+
179+And then print out the results using the following command:
180+
181+::
182+
183+ $ cat /sys/fs/bpf/my_route
184+
185+
186+-------------------------------------------------------
187+Implement Kernel Support for BPF Iterator Program Types
188+-------------------------------------------------------
189+
190+To implement a BPF iterator in the kernel, the developer must make a one-time
191+change to the following key data structure defined in the `bpf.h
192+<https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/tree/include/linux/bpf.h>`_
193+file.
194+
195+::
196+
197+ struct bpf_iter_reg {
198+ const char *target;
199+ bpf_iter_attach_target_t attach_target;
200+ bpf_iter_detach_target_t detach_target;
201+ bpf_iter_show_fdinfo_t show_fdinfo;
202+ bpf_iter_fill_link_info_t fill_link_info;
203+ bpf_iter_get_func_proto_t get_func_proto;
204+ u32 ctx_arg_info_size;
205+ u32 feature;
206+ struct bpf_ctx_arg_aux ctx_arg_info[BPF_ITER_CTX_ARG_MAX];
207+ const struct bpf_iter_seq_info *seq_info;
208+ };
209+
210+After filling the data structure fields, call ``bpf_iter_reg_target()`` to
211+register the iterator to the main BPF iterator subsystem.
212+
213+The following is the breakdown for each field in struct ``bpf_iter_reg``.
214+
215+.. list-table::
216+ :widths: 25 50
217+ :header-rows: 1
218+
219+ * - Fields
220+ - Description
221+ * - target
222+ - Specifies the name of the BPF iterator. For example: ``bpf_map``,
223+ ``bpf_map_elem``. The name should be different from other ``bpf_iter`` target names in the kernel.
224+ * - attach_target and detach_target
225+ - Allows for target specific ``link_create`` action since some targets
226+ may need special processing. Called during the user space link_create stage.
227+ * - show_fdinfo and fill_link_info
228+ - Called to fill target specific information when user tries to get link
229+ info associated with the iterator.
230+ * - get_func_proto
231+ - Permits a BPF iterator to access BPF helpers specific to the iterator.
232+ * - ctx_arg_info_size and ctx_arg_info
233+ - Specifies the verifier states for BPF program arguments associated with
234+ the bpf iterator.
235+ * - feature
236+ - Specifies certain action requests in the kernel BPF iterator
237+ infrastructure. Currently, only BPF_ITER_RESCHED is supported. This means
238+ that the kernel function cond_resched() is called to avoid other kernel
239+ subsystem (e.g., rcu) misbehaving.
240+ * - seq_info
241+ - Specifies certain action requests in the kernel BPF iterator
242+ infrastructure. Currently, only BPF_ITER_RESCHED is supported. This means
243+ that the kernel function cond_resched() is called to avoid other kernel
244+ subsystem (e.g., rcu) misbehaving.
245+
246+
247+`Click here
248+<https://lore.kernel.org/bpf/20210212183107.50963-2-songliubraving@fb.com/>`_
249+to see an implementation of the ``task_vma`` BPF iterator in the kernel.
250+
251+---------------------------------
252+Parameterizing BPF Task Iterators
253+---------------------------------
254+
255+By default, BPF iterators walk through all the objects of the specified types
256+(processes, cgroups, maps, etc.) across the entire system to read relevant
257+kernel data. But often, there are cases where we only care about a much smaller
258+subset of iterable kernel objects, such as only iterating tasks within a
259+specific process. Therefore, BPF iterator programs support filtering out objects
260+from iteration by allowing user space to configure the iterator program when it
261+is attached.
262+
263+--------------------------
264+BPF Task Iterator Program
265+--------------------------
266+
267+The following code is a BPF iterator program to print files and task information
268+through the ``seq_file`` of the iterator. It is a standard BPF iterator program
269+that visits every file of an iterator. We will use this BPF program in our
270+example later.
271+
272+::
273+
274+ #include <vmlinux.h>
275+ #include <bpf/bpf_helpers.h>
276+
277+ char _license[] SEC("license") = "GPL";
278+
279+ SEC("iter/task_file")
280+ int dump_task_file(struct bpf_iter__task_file *ctx)
281+ {
282+ struct seq_file *seq = ctx->meta->seq;
283+ struct task_struct *task = ctx->task;
284+ struct file *file = ctx->file;
285+ __u32 fd = ctx->fd;
286+ if (task == NULL || file == NULL)
287+ return 0;
288+ if (ctx->meta->seq_num == 0) {
289+ BPF_SEQ_PRINTF(seq, " tgid pid fd file\n");
290+ }
291+ BPF_SEQ_PRINTF(seq, "%8d %8d %8d %lx\n", task->tgid, task->pid, fd,
292+ (long)file->f_op);
293+ return 0;
294+ }
295+
296+----------------------------------------
297+Creating a File Iterator with Parameters
298+----------------------------------------
299+
300+Now, let us look at how to create an iterator that includes only files of a
301+process.
302+
303+First, fill the ``bpf_iter_attach_opts`` struct as shown below:
304+
305+::
306+
307+ LIBBPF_OPTS(bpf_iter_attach_opts, opts);
308+ union bpf_iter_link_info linfo;
309+ memset(&linfo, 0, sizeof(linfo));
310+ linfo.task.pid = getpid();
311+ opts.link_info = &linfo;
312+ opts.link_info_len = sizeof(linfo);
313+
314+``linfo.task.pid``, if it is non-zero, directs the kernel to create an iterator
315+that only includes opened files for the process with the specified ``pid``. In
316+this example, we will only be iterating files for our process. If
317+``linfo.task.pid`` is zero, the iterator will visit every opened file of every
318+process. Similarly, ``linfo.task.tid`` directs the kernel to create an iterator
319+that visits opened files of a specific thread, not a process. In this example,
320+``linfo.task.tid`` is different from ``linfo.task.pid`` only if the thread has a
321+separate file descriptor table. In most circumstances, all process threads share
322+a single file descriptor table.
323+
324+Now, in the userspace program, pass the pointer of struct to the
325+``bpf_program__attach_iter()``.
326+
327+::
328+
329+ link = bpf_program__attach_iter(prog, &opts); iter_fd =
330+ bpf_iter_create(bpf_link__fd(link));
331+
332+If both *tid* and *pid* are zero, an iterator created from this struct
333+``bpf_iter_attach_opts`` will include every opened file of every task in the
334+system (in the namespace, actually.) It is the same as passing a NULL as the
335+second argument to ``bpf_program__attach_iter()``.
336+
337+The whole program looks like the following code:
338+
339+::
340+
341+ #include <stdio.h>
342+ #include <unistd.h>
343+ #include <bpf/bpf.h>
344+ #include <bpf/libbpf.h>
345+ #include "bpf_iter_task_ex.skel.h"
346+
347+ static int do_read_opts(struct bpf_program *prog, struct bpf_iter_attach_opts *opts)
348+ {
349+ struct bpf_link *link;
350+ char buf[16] = {};
351+ int iter_fd = -1, len;
352+ int ret = 0;
353+
354+ link = bpf_program__attach_iter(prog, opts);
355+ if (!link) {
356+ fprintf(stderr, "bpf_program__attach_iter() fails\n");
357+ return -1;
358+ }
359+ iter_fd = bpf_iter_create(bpf_link__fd(link));
360+ if (iter_fd < 0) {
361+ fprintf(stderr, "bpf_iter_create() fails\n");
362+ ret = -1;
363+ goto free_link;
364+ }
365+ /* not check contents, but ensure read() ends without error */
366+ while ((len = read(iter_fd, buf, sizeof(buf) - 1)) > 0) {
367+ buf[len] = 0;
368+ printf("%s", buf);
369+ }
370+ printf("\n");
371+ free_link:
372+ if (iter_fd >= 0)
373+ close(iter_fd);
374+ bpf_link__destroy(link);
375+ return 0;
376+ }
377+
378+ static void test_task_file(void)
379+ {
380+ LIBBPF_OPTS(bpf_iter_attach_opts, opts);
381+ struct bpf_iter_task_ex *skel;
382+ union bpf_iter_link_info linfo;
383+ skel = bpf_iter_task_ex__open_and_load();
384+ if (skel == NULL)
385+ return;
386+ memset(&linfo, 0, sizeof(linfo));
387+ linfo.task.pid = getpid();
388+ opts.link_info = &linfo;
389+ opts.link_info_len = sizeof(linfo);
390+ printf("PID %d\n", getpid());
391+ do_read_opts(skel->progs.dump_task_file, &opts);
392+ bpf_iter_task_ex__destroy(skel);
393+ }
394+
395+ int main(int argc, const char * const * argv)
396+ {
397+ test_task_file();
398+ return 0;
399+ }
400+
401+The following lines are the output of the program.
402+::
403+
404+ PID 1859
405+
406+ tgid pid fd file
407+ 1859 1859 0 ffffffff82270aa0
408+ 1859 1859 1 ffffffff82270aa0
409+ 1859 1859 2 ffffffff82270aa0
410+ 1859 1859 3 ffffffff82272980
411+ 1859 1859 4 ffffffff8225e120
412+ 1859 1859 5 ffffffff82255120
413+ 1859 1859 6 ffffffff82254f00
414+ 1859 1859 7 ffffffff82254d80
415+ 1859 1859 8 ffffffff8225abe0
416+
417+------------------
418+Without Parameters
419+------------------
420+
421+Let us look at how a BPF iterator without parameters skips files of other
422+processes in the system. In this case, the BPF program has to check the pid or
423+the tid of tasks, or it will receive every opened file in the system (in the
424+current *pid* namespace, actually). So, we usually add a global variable in the
425+BPF program to pass a *pid* to the BPF program.
426+
427+The BPF program would look like the following block.
428+
429+ ::
430+
431+ ......
432+ int target_pid = 0;
433+
434+ SEC("iter/task_file")
435+ int dump_task_file(struct bpf_iter__task_file *ctx)
436+ {
437+ ......
438+ if (task->tgid != target_pid) /* Check task->pid instead to check thread IDs */
439+ return 0;
440+ BPF_SEQ_PRINTF(seq, "%8d %8d %8d %lx\n", task->tgid, task->pid, fd,
441+ (long)file->f_op);
442+ return 0;
443+ }
444+
445+The user space program would look like the following block:
446+
447+ ::
448+
449+ ......
450+ static void test_task_file(void)
451+ {
452+ ......
453+ skel = bpf_iter_task_ex__open_and_load();
454+ if (skel == NULL)
455+ return;
456+ skel->bss->target_pid = getpid(); /* process ID. For thread id, use gettid() */
457+ memset(&linfo, 0, sizeof(linfo));
458+ linfo.task.pid = getpid();
459+ opts.link_info = &linfo;
460+ opts.link_info_len = sizeof(linfo);
461+ ......
462+ }
463+
464+``target_pid`` is a global variable in the BPF program. The user space program
465+should initialize the variable with a process ID to skip opened files of other
466+processes in the BPF program. When you parametrize a BPF iterator, the iterator
467+calls the BPF program fewer times which can save significant resources.
468+
469+---------------------------
470+Parametrizing VMA Iterators
471+---------------------------
472+
473+By default, a BPF VMA iterator includes every VMA in every process. However,
474+you can still specify a process or a thread to include only its VMAs. Unlike
475+files, a thread can not have a separate address space (since Linux 2.6.0-test6).
476+Here, using *tid* makes no difference from using *pid*.
477+
478+----------------------------
479+Parametrizing Task Iterators
480+----------------------------
481+
482+A BPF task iterator with *pid* includes all tasks (threads) of a process. The
483+BPF program receives these tasks one after another. You can specify a BPF task
484+iterator with *tid* parameter to include only the tasks that match the given
485+*tid*.
Documentation/bpf/btf.rst+6−1
@@ -1062,4 +1062,9 @@ format.:: · 1061 unmodified lines
10621062 7. Testing
10631063 ==========
10641064
1065−Kernel bpf selftest `test_btf.c` provides extensive set of BTF-related tests.
1065+The kernel BPF selftest `tools/testing/selftests/bpf/prog_tests/btf.c`_
1066+provides an extensive set of BTF-related tests.
1067+
1068+.. Links
1069+.. _tools/testing/selftests/bpf/prog_tests/btf.c:
1070+ https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/tools/testing/selftests/bpf/prog_tests/btf.c
Documentation/bpf/index.rst+2−0
@@ -24,11 +24,13 @@ that goes into great technical depth about the BPF Architecture. · 23 unmodified lines
2424 maps
2525 bpf_prog_run
2626 classic_vs_extended.rst
27+ bpf_iterators
2728 bpf_licensing
2829 test_debug
2930 clang-notes
3031 linux-notes
3132 other
33+ redirect
3234
3335 .. only:: subproject and html
3436
Documentation/bpf/instruction-set.rst+2−2
@@ -122,11 +122,11 @@ BPF_END 0xd0 byte swap operations (see `Byte swap instructions`_ below) · 121 unmodified lines
122122
123123 ``BPF_XOR | BPF_K | BPF_ALU`` means::
124124
125− src_reg = (u32) src_reg ^ (u32) imm32
125+ dst_reg = (u32) dst_reg ^ (u32) imm32
126126
127127 ``BPF_XOR | BPF_K | BPF_ALU64`` means::
128128
129− src_reg = src_reg ^ imm32
129+ dst_reg = dst_reg ^ imm32
130130
131131
132132 Byte swap instructions
Documentation/bpf/kfuncs.rst+242−13
@@ -72,6 +72,30 @@ argument as its size. By default, without __sz annotation, the size of the type · 71 unmodified lines
7272 of the pointer is used. Without __sz annotation, a kfunc cannot accept a void
7373 pointer.
7474
75+2.2.2 __k Annotation
76+--------------------
77+
78+This annotation is only understood for scalar arguments, where it indicates that
79+the verifier must check the scalar argument to be a known constant, which does
80+not indicate a size parameter, and the value of the constant is relevant to the
81+safety of the program.
82+
83+An example is given below::
84+
85+ void *bpf_obj_new(u32 local_type_id__k, ...)
86+ {
87+ ...
88+ }
89+
90+Here, bpf_obj_new uses local_type_id argument to find out the size of that type
91+ID in program's BTF and return a sized pointer to it. Each type ID will have a
92+distinct size, hence it is crucial to treat each such call as distinct when
93+values don't match during verifier state pruning checks.
94+
95+Hence, whenever a constant scalar argument is accepted by a kfunc which is not a
96+size parameter, and the value of the constant matters for program safety, __k
97+suffix should be used.
98+
7599 .. _BPF_kfunc_nodef:
76100
77101 2.3 Using an existing kernel function
@@ -137,22 +161,20 @@ KF_ACQUIRE and KF_RET_NULL flags. · 59 unmodified lines
137161 --------------------------
138162
139163 The KF_TRUSTED_ARGS flag is used for kfuncs taking pointer arguments. It
140−indicates that the all pointer arguments will always have a guaranteed lifetime,
141−and pointers to kernel objects are always passed to helpers in their unmodified
142−form (as obtained from acquire kfuncs).
164+indicates that the all pointer arguments are valid, and that all pointers to
165+BTF objects have been passed in their unmodified form (that is, at a zero
166+offset, and without having been obtained from walking another pointer).
143167
144−It can be used to enforce that a pointer to a refcounted object acquired from a
145−kfunc or BPF helper is passed as an argument to this kfunc without any
146−modifications (e.g. pointer arithmetic) such that it is trusted and points to
147−the original object.
168+There are two types of pointers to kernel objects which are considered "valid":
148169
149−Meanwhile, it is also allowed pass pointers to normal memory to such kfuncs,
150−but those can have a non-zero offset.
170+1. Pointers which are passed as tracepoint or struct_ops callback arguments.
171+2. Pointers which were returned from a KF_ACQUIRE or KF_KPTR_GET kfunc.
151172
152−This flag is often used for kfuncs that operate (change some property, perform
153−some operation) on an object that was obtained using an acquire kfunc. Such
154−kfuncs need an unchanged pointer to ensure the integrity of the operation being
155−performed on the expected object.
173+Pointers to non-BTF objects (e.g. scalar pointers) may also be passed to
174+KF_TRUSTED_ARGS kfuncs, and may have a non-zero offset.
175+
176+The definition of "valid" pointers is subject to change at any time, and has
177+absolutely no ABI stability guarantees.
156178
157179 2.4.6 KF_SLEEPABLE flag
158180 -----------------------
@@ -169,6 +191,15 @@ rebooting or panicking. Due to this additional restrictions apply to these · 10 unmodified lines
169191 calls. At the moment they only require CAP_SYS_BOOT capability, but more can be
170192 added later.
171193
194+2.4.8 KF_RCU flag
195+-----------------
196+
197+The KF_RCU flag is used for kfuncs which have a rcu ptr as its argument.
198+When used together with KF_ACQUIRE, it indicates the kfunc should have a
199+single argument which must be a trusted argument or a MEM_RCU pointer.
200+The argument may have reference count of 0 and the kfunc must take this
201+into consideration.
202+
172203 2.5 Registering the kfuncs
173204 --------------------------
174205
@@ -191,3 +222,201 @@ type. An example is shown below:: · 16 unmodified lines
191222 return register_btf_kfunc_id_set(BPF_PROG_TYPE_TRACING, &bpf_task_kfunc_set);
192223 }
193224 late_initcall(init_subsystem);
225+
226+3. Core kfuncs
227+==============
228+
229+The BPF subsystem provides a number of "core" kfuncs that are potentially
230+applicable to a wide variety of different possible use cases and programs.
231+Those kfuncs are documented here.
232+
233+3.1 struct task_struct * kfuncs
234+-------------------------------
235+
236+There are a number of kfuncs that allow ``struct task_struct *`` objects to be
237+used as kptrs:
238+
239+.. kernel-doc:: kernel/bpf/helpers.c
240+ :identifiers: bpf_task_acquire bpf_task_release
241+
242+These kfuncs are useful when you want to acquire or release a reference to a
243+``struct task_struct *`` that was passed as e.g. a tracepoint arg, or a
244+struct_ops callback arg. For example:
245+
246+.. code-block:: c
247+
248+ /**
249+ * A trivial example tracepoint program that shows how to
250+ * acquire and release a struct task_struct * pointer.
251+ */
252+ SEC("tp_btf/task_newtask")
253+ int BPF_PROG(task_acquire_release_example, struct task_struct *task, u64 clone_flags)
254+ {
255+ struct task_struct *acquired;
256+
257+ acquired = bpf_task_acquire(task);
258+
259+ /*
260+ * In a typical program you'd do something like store
261+ * the task in a map, and the map will automatically
262+ * release it later. Here, we release it manually.
263+ */
264+ bpf_task_release(acquired);
265+ return 0;
266+ }
267+
268+----
269+
270+A BPF program can also look up a task from a pid. This can be useful if the
271+caller doesn't have a trusted pointer to a ``struct task_struct *`` object that
272+it can acquire a reference on with bpf_task_acquire().
273+
274+.. kernel-doc:: kernel/bpf/helpers.c
275+ :identifiers: bpf_task_from_pid
276+
277+Here is an example of it being used:
278+
279+.. code-block:: c
280+
281+ SEC("tp_btf/task_newtask")
282+ int BPF_PROG(task_get_pid_example, struct task_struct *task, u64 clone_flags)
283+ {
284+ struct task_struct *lookup;
285+
286+ lookup = bpf_task_from_pid(task->pid);
287+ if (!lookup)
288+ /* A task should always be found, as %task is a tracepoint arg. */
289+ return -ENOENT;
290+
291+ if (lookup->pid != task->pid) {
292+ /* bpf_task_from_pid() looks up the task via its
293+ * globally-unique pid from the init_pid_ns. Thus,
294+ * the pid of the lookup task should always be the
295+ * same as the input task.
296+ */
297+ bpf_task_release(lookup);
298+ return -EINVAL;
299+ }
300+
301+ /* bpf_task_from_pid() returns an acquired reference,
302+ * so it must be dropped before returning from the
303+ * tracepoint handler.
304+ */
305+ bpf_task_release(lookup);
306+ return 0;
307+ }
308+
309+3.2 struct cgroup * kfuncs
310+--------------------------
311+
312+``struct cgroup *`` objects also have acquire and release functions:
313+
314+.. kernel-doc:: kernel/bpf/helpers.c
315+ :identifiers: bpf_cgroup_acquire bpf_cgroup_release
316+
317+These kfuncs are used in exactly the same manner as bpf_task_acquire() and
318+bpf_task_release() respectively, so we won't provide examples for them.
319+
320+----
321+
322+You may also acquire a reference to a ``struct cgroup`` kptr that's already
323+stored in a map using bpf_cgroup_kptr_get():
324+
325+.. kernel-doc:: kernel/bpf/helpers.c
326+ :identifiers: bpf_cgroup_kptr_get
327+
328+Here's an example of how it can be used:
329+
330+.. code-block:: c
331+
332+ /* struct containing the struct task_struct kptr which is actually stored in the map. */
333+ struct __cgroups_kfunc_map_value {
334+ struct cgroup __kptr_ref * cgroup;
335+ };
336+
337+ /* The map containing struct __cgroups_kfunc_map_value entries. */
338+ struct {
339+ __uint(type, BPF_MAP_TYPE_HASH);
340+ __type(key, int);
341+ __type(value, struct __cgroups_kfunc_map_value);
342+ __uint(max_entries, 1);
343+ } __cgroups_kfunc_map SEC(".maps");
344+
345+ /* ... */
346+
347+ /**
348+ * A simple example tracepoint program showing how a
349+ * struct cgroup kptr that is stored in a map can
350+ * be acquired using the bpf_cgroup_kptr_get() kfunc.
351+ */
352+ SEC("tp_btf/cgroup_mkdir")
353+ int BPF_PROG(cgroup_kptr_get_example, struct cgroup *cgrp, const char *path)
354+ {
355+ struct cgroup *kptr;
356+ struct __cgroups_kfunc_map_value *v;
357+ s32 id = cgrp->self.id;
358+
359+ /* Assume a cgroup kptr was previously stored in the map. */
360+ v = bpf_map_lookup_elem(&__cgroups_kfunc_map, &id);
361+ if (!v)
362+ return -ENOENT;
363+
364+ /* Acquire a reference to the cgroup kptr that's already stored in the map. */
365+ kptr = bpf_cgroup_kptr_get(&v->cgroup);
366+ if (!kptr)
367+ /* If no cgroup was present in the map, it's because
368+ * we're racing with another CPU that removed it with
369+ * bpf_kptr_xchg() between the bpf_map_lookup_elem()
370+ * above, and our call to bpf_cgroup_kptr_get().
371+ * bpf_cgroup_kptr_get() internally safely handles this
372+ * race, and will return NULL if the task is no longer
373+ * present in the map by the time we invoke the kfunc.
374+ */
375+ return -EBUSY;
376+
377+ /* Free the reference we just took above. Note that the
378+ * original struct cgroup kptr is still in the map. It will
379+ * be freed either at a later time if another context deletes
380+ * it from the map, or automatically by the BPF subsystem if
381+ * it's still present when the map is destroyed.
382+ */
383+ bpf_cgroup_release(kptr);
384+
385+ return 0;
386+ }
387+
388+----
389+
390+Another kfunc available for interacting with ``struct cgroup *`` objects is
391+bpf_cgroup_ancestor(). This allows callers to access the ancestor of a cgroup,
392+and return it as a cgroup kptr.
393+
394+.. kernel-doc:: kernel/bpf/helpers.c
395+ :identifiers: bpf_cgroup_ancestor
396+
397+Eventually, BPF should be updated to allow this to happen with a normal memory
398+load in the program itself. This is currently not possible without more work in
399+the verifier. bpf_cgroup_ancestor() can be used as follows:
400+
401+.. code-block:: c
402+
403+ /**
404+ * Simple tracepoint example that illustrates how a cgroup's
405+ * ancestor can be accessed using bpf_cgroup_ancestor().
406+ */
407+ SEC("tp_btf/cgroup_mkdir")
408+ int BPF_PROG(cgrp_ancestor_example, struct cgroup *cgrp, const char *path)
409+ {
410+ struct cgroup *parent;
411+
412+ /* The parent cgroup resides at the level before the current cgroup's level. */
413+ parent = bpf_cgroup_ancestor(cgrp, cgrp->level - 1);
414+ if (!parent)
415+ return -ENOENT;
416+
417+ bpf_printk("Parent id is %d", parent->self.id);
418+
419+ /* Return the parent cgroup that was acquired above. */
420+ bpf_cgroup_release(parent);
421+ return 0;
422+ }
Documentation/bpf/libbpf/index.rst+3−0
@@ -1,5 +1,7 @@
11 .. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
22
3+.. _libbpf:
4+
35 libbpf
46 ======
57
@@ -7,6 +9,7 @@ libbpf · 1 unmodified line
79 :maxdepth: 1
810
911 API Documentation <https://libbpf.readthedocs.io/en/latest/api.html>
12+ program_types
1013 libbpf_naming_convention
1114 libbpf_build
1215
Documentation/bpf/libbpf/program_types.rst+203−0
@@ -0,0 +1,203 @@
1+.. SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
2+
3+.. _program_types_and_elf:
4+
5+Program Types and ELF Sections
6+==============================
7+
8+The table below lists the program types, their attach types where relevant and the ELF section
9+names supported by libbpf for them. The ELF section names follow these rules:
10+
11+- ``type`` is an exact match, e.g. ``SEC("socket")``
12+- ``type+`` means it can be either exact ``SEC("type")`` or well-formed ``SEC("type/extras")``
13+ with a '``/``' separator between ``type`` and ``extras``.
14+
15+When ``extras`` are specified, they provide details of how to auto-attach the BPF program. The
16+format of ``extras`` depends on the program type, e.g. ``SEC("tracepoint/<category>/<name>")``
17+for tracepoints or ``SEC("usdt/<path>:<provider>:<name>")`` for USDT probes. The extras are
18+described in more detail in the footnotes.
19+
20+
21++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
22+| Program Type | Attach Type | ELF Section Name | Sleepable |
23++===========================================+========================================+==================================+===========+
24+| ``BPF_PROG_TYPE_CGROUP_DEVICE`` | ``BPF_CGROUP_DEVICE`` | ``cgroup/dev`` | |
25++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
26+| ``BPF_PROG_TYPE_CGROUP_SKB`` | | ``cgroup/skb`` | |
27++ +----------------------------------------+----------------------------------+-----------+
28+| | ``BPF_CGROUP_INET_EGRESS`` | ``cgroup_skb/egress`` | |
29++ +----------------------------------------+----------------------------------+-----------+
30+| | ``BPF_CGROUP_INET_INGRESS`` | ``cgroup_skb/ingress`` | |
31++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
32+| ``BPF_PROG_TYPE_CGROUP_SOCKOPT`` | ``BPF_CGROUP_GETSOCKOPT`` | ``cgroup/getsockopt`` | |
33++ +----------------------------------------+----------------------------------+-----------+
34+| | ``BPF_CGROUP_SETSOCKOPT`` | ``cgroup/setsockopt`` | |
35++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
36+| ``BPF_PROG_TYPE_CGROUP_SOCK_ADDR`` | ``BPF_CGROUP_INET4_BIND`` | ``cgroup/bind4`` | |
37++ +----------------------------------------+----------------------------------+-----------+
38+| | ``BPF_CGROUP_INET4_CONNECT`` | ``cgroup/connect4`` | |
39++ +----------------------------------------+----------------------------------+-----------+
40+| | ``BPF_CGROUP_INET4_GETPEERNAME`` | ``cgroup/getpeername4`` | |
41++ +----------------------------------------+----------------------------------+-----------+
42+| | ``BPF_CGROUP_INET4_GETSOCKNAME`` | ``cgroup/getsockname4`` | |
43++ +----------------------------------------+----------------------------------+-----------+
44+| | ``BPF_CGROUP_INET6_BIND`` | ``cgroup/bind6`` | |
45++ +----------------------------------------+----------------------------------+-----------+
46+| | ``BPF_CGROUP_INET6_CONNECT`` | ``cgroup/connect6`` | |
47++ +----------------------------------------+----------------------------------+-----------+
48+| | ``BPF_CGROUP_INET6_GETPEERNAME`` | ``cgroup/getpeername6`` | |
49++ +----------------------------------------+----------------------------------+-----------+
50+| | ``BPF_CGROUP_INET6_GETSOCKNAME`` | ``cgroup/getsockname6`` | |
51++ +----------------------------------------+----------------------------------+-----------+
52+| | ``BPF_CGROUP_UDP4_RECVMSG`` | ``cgroup/recvmsg4`` | |
53++ +----------------------------------------+----------------------------------+-----------+
54+| | ``BPF_CGROUP_UDP4_SENDMSG`` | ``cgroup/sendmsg4`` | |
55++ +----------------------------------------+----------------------------------+-----------+
56+| | ``BPF_CGROUP_UDP6_RECVMSG`` | ``cgroup/recvmsg6`` | |
57++ +----------------------------------------+----------------------------------+-----------+
58+| | ``BPF_CGROUP_UDP6_SENDMSG`` | ``cgroup/sendmsg6`` | |
59++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
60+| ``BPF_PROG_TYPE_CGROUP_SOCK`` | ``BPF_CGROUP_INET4_POST_BIND`` | ``cgroup/post_bind4`` | |
61++ +----------------------------------------+----------------------------------+-----------+
62+| | ``BPF_CGROUP_INET6_POST_BIND`` | ``cgroup/post_bind6`` | |
63++ +----------------------------------------+----------------------------------+-----------+
64+| | ``BPF_CGROUP_INET_SOCK_CREATE`` | ``cgroup/sock_create`` | |
65++ + +----------------------------------+-----------+
66+| | | ``cgroup/sock`` | |
67++ +----------------------------------------+----------------------------------+-----------+
68+| | ``BPF_CGROUP_INET_SOCK_RELEASE`` | ``cgroup/sock_release`` | |
69++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
70+| ``BPF_PROG_TYPE_CGROUP_SYSCTL`` | ``BPF_CGROUP_SYSCTL`` | ``cgroup/sysctl`` | |
71++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
72+| ``BPF_PROG_TYPE_EXT`` | | ``freplace+`` [#fentry]_ | |
73++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
74+| ``BPF_PROG_TYPE_FLOW_DISSECTOR`` | ``BPF_FLOW_DISSECTOR`` | ``flow_dissector`` | |
75++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
76+| ``BPF_PROG_TYPE_KPROBE`` | | ``kprobe+`` [#kprobe]_ | |
77++ + +----------------------------------+-----------+
78+| | | ``kretprobe+`` [#kprobe]_ | |
79++ + +----------------------------------+-----------+
80+| | | ``ksyscall+`` [#ksyscall]_ | |
81++ + +----------------------------------+-----------+
82+| | | ``kretsyscall+`` [#ksyscall]_ | |
83++ + +----------------------------------+-----------+
84+| | | ``uprobe+`` [#uprobe]_ | |
85++ + +----------------------------------+-----------+
86+| | | ``uprobe.s+`` [#uprobe]_ | Yes |
87++ + +----------------------------------+-----------+
88+| | | ``uretprobe+`` [#uprobe]_ | |
89++ + +----------------------------------+-----------+
90+| | | ``uretprobe.s+`` [#uprobe]_ | Yes |
91++ + +----------------------------------+-----------+
92+| | | ``usdt+`` [#usdt]_ | |
93++ +----------------------------------------+----------------------------------+-----------+
94+| | ``BPF_TRACE_KPROBE_MULTI`` | ``kprobe.multi+`` [#kpmulti]_ | |
95++ + +----------------------------------+-----------+
96+| | | ``kretprobe.multi+`` [#kpmulti]_ | |
97++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
98+| ``BPF_PROG_TYPE_LIRC_MODE2`` | ``BPF_LIRC_MODE2`` | ``lirc_mode2`` | |
99++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
100+| ``BPF_PROG_TYPE_LSM`` | ``BPF_LSM_CGROUP`` | ``lsm_cgroup+`` | |
101++ +----------------------------------------+----------------------------------+-----------+
102+| | ``BPF_LSM_MAC`` | ``lsm+`` [#lsm]_ | |
103++ + +----------------------------------+-----------+
104+| | | ``lsm.s+`` [#lsm]_ | Yes |
105++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
106+| ``BPF_PROG_TYPE_LWT_IN`` | | ``lwt_in`` | |
107++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
108+| ``BPF_PROG_TYPE_LWT_OUT`` | | ``lwt_out`` | |
109++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
110+| ``BPF_PROG_TYPE_LWT_SEG6LOCAL`` | | ``lwt_seg6local`` | |
111++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
112+| ``BPF_PROG_TYPE_LWT_XMIT`` | | ``lwt_xmit`` | |
113++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
114+| ``BPF_PROG_TYPE_PERF_EVENT`` | | ``perf_event`` | |
115++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
116+| ``BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE`` | | ``raw_tp.w+`` [#rawtp]_ | |
117++ + +----------------------------------+-----------+
118+| | | ``raw_tracepoint.w+`` | |
119++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
120+| ``BPF_PROG_TYPE_RAW_TRACEPOINT`` | | ``raw_tp+`` [#rawtp]_ | |
121++ + +----------------------------------+-----------+
122+| | | ``raw_tracepoint+`` | |
123++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
124+| ``BPF_PROG_TYPE_SCHED_ACT`` | | ``action`` | |
125++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
126+| ``BPF_PROG_TYPE_SCHED_CLS`` | | ``classifier`` | |
127++ + +----------------------------------+-----------+
128+| | | ``tc`` | |
129++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
130+| ``BPF_PROG_TYPE_SK_LOOKUP`` | ``BPF_SK_LOOKUP`` | ``sk_lookup`` | |
131++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
132+| ``BPF_PROG_TYPE_SK_MSG`` | ``BPF_SK_MSG_VERDICT`` | ``sk_msg`` | |
133++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
134+| ``BPF_PROG_TYPE_SK_REUSEPORT`` | ``BPF_SK_REUSEPORT_SELECT_OR_MIGRATE`` | ``sk_reuseport/migrate`` | |
135++ +----------------------------------------+----------------------------------+-----------+
136+| | ``BPF_SK_REUSEPORT_SELECT`` | ``sk_reuseport`` | |
137++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
138+| ``BPF_PROG_TYPE_SK_SKB`` | | ``sk_skb`` | |
139++ +----------------------------------------+----------------------------------+-----------+
140+| | ``BPF_SK_SKB_STREAM_PARSER`` | ``sk_skb/stream_parser`` | |
141++ +----------------------------------------+----------------------------------+-----------+
142+| | ``BPF_SK_SKB_STREAM_VERDICT`` | ``sk_skb/stream_verdict`` | |
143++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
144+| ``BPF_PROG_TYPE_SOCKET_FILTER`` | | ``socket`` | |
145++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
146+| ``BPF_PROG_TYPE_SOCK_OPS`` | ``BPF_CGROUP_SOCK_OPS`` | ``sockops`` | |
147++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
148+| ``BPF_PROG_TYPE_STRUCT_OPS`` | | ``struct_ops+`` | |
149++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
150+| ``BPF_PROG_TYPE_SYSCALL`` | | ``syscall`` | Yes |
151++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
152+| ``BPF_PROG_TYPE_TRACEPOINT`` | | ``tp+`` [#tp]_ | |
153++ + +----------------------------------+-----------+
154+| | | ``tracepoint+`` [#tp]_ | |
155++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
156+| ``BPF_PROG_TYPE_TRACING`` | ``BPF_MODIFY_RETURN`` | ``fmod_ret+`` [#fentry]_ | |
157++ + +----------------------------------+-----------+
158+| | | ``fmod_ret.s+`` [#fentry]_ | Yes |
159++ +----------------------------------------+----------------------------------+-----------+
160+| | ``BPF_TRACE_FENTRY`` | ``fentry+`` [#fentry]_ | |
161++ + +----------------------------------+-----------+
162+| | | ``fentry.s+`` [#fentry]_ | Yes |
163++ +----------------------------------------+----------------------------------+-----------+
164+| | ``BPF_TRACE_FEXIT`` | ``fexit+`` [#fentry]_ | |
165++ + +----------------------------------+-----------+
166+| | | ``fexit.s+`` [#fentry]_ | Yes |
167++ +----------------------------------------+----------------------------------+-----------+
168+| | ``BPF_TRACE_ITER`` | ``iter+`` [#iter]_ | |
169++ + +----------------------------------+-----------+
170+| | | ``iter.s+`` [#iter]_ | Yes |
171++ +----------------------------------------+----------------------------------+-----------+
172+| | ``BPF_TRACE_RAW_TP`` | ``tp_btf+`` [#fentry]_ | |
173++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
174+| ``BPF_PROG_TYPE_XDP`` | ``BPF_XDP_CPUMAP`` | ``xdp.frags/cpumap`` | |
175++ + +----------------------------------+-----------+
176+| | | ``xdp/cpumap`` | |
177++ +----------------------------------------+----------------------------------+-----------+
178+| | ``BPF_XDP_DEVMAP`` | ``xdp.frags/devmap`` | |
179++ + +----------------------------------+-----------+
180+| | | ``xdp/devmap`` | |
181++ +----------------------------------------+----------------------------------+-----------+
182+| | ``BPF_XDP`` | ``xdp.frags`` | |
183++ + +----------------------------------+-----------+
184+| | | ``xdp`` | |
185++-------------------------------------------+----------------------------------------+----------------------------------+-----------+
186+
187+
188+.. rubric:: Footnotes
189+
190+.. [#fentry] The ``fentry`` attach format is ``fentry[.s]/<function>``.
191+.. [#kprobe] The ``kprobe`` attach format is ``kprobe/<function>[+<offset>]``. Valid
192+ characters for ``function`` are ``a-zA-Z0-9_.`` and ``offset`` must be a valid
193+ non-negative integer.
194+.. [#ksyscall] The ``ksyscall`` attach format is ``ksyscall/<syscall>``.
195+.. [#uprobe] The ``uprobe`` attach format is ``uprobe[.s]/<path>:<function>[+<offset>]``.
196+.. [#usdt] The ``usdt`` attach format is ``usdt/<path>:<provider>:<name>``.
197+.. [#kpmulti] The ``kprobe.multi`` attach format is ``kprobe.multi/<pattern>`` where ``pattern``
198+ supports ``*`` and ``?`` wildcards. Valid characters for pattern are
199+ ``a-zA-Z0-9_.*?``.
200+.. [#lsm] The ``lsm`` attachment format is ``lsm[.s]/<hook>``.
201+.. [#rawtp] The ``raw_tp`` attach format is ``raw_tracepoint[.w]/<tracepoint>``.
202+.. [#tp] The ``tracepoint`` attach format is ``tracepoint/<category>/<name>``.
203+.. [#iter] The ``iter`` attach format is ``iter[.s]/<struct-name>``.
Documentation/bpf/map_array.rst+262−0
@@ -0,0 +1,262 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Red Hat, Inc.
3+
4+================================================
5+BPF_MAP_TYPE_ARRAY and BPF_MAP_TYPE_PERCPU_ARRAY
6+================================================
7+
8+.. note::
9+ - ``BPF_MAP_TYPE_ARRAY`` was introduced in kernel version 3.19
10+ - ``BPF_MAP_TYPE_PERCPU_ARRAY`` was introduced in version 4.6
11+
12+``BPF_MAP_TYPE_ARRAY`` and ``BPF_MAP_TYPE_PERCPU_ARRAY`` provide generic array
13+storage. The key type is an unsigned 32-bit integer (4 bytes) and the map is
14+of constant size. The size of the array is defined in ``max_entries`` at
15+creation time. All array elements are pre-allocated and zero initialized when
16+created. ``BPF_MAP_TYPE_PERCPU_ARRAY`` uses a different memory region for each
17+CPU whereas ``BPF_MAP_TYPE_ARRAY`` uses the same memory region. The value
18+stored can be of any size, however, all array elements are aligned to 8
19+bytes.
20+
21+Since kernel 5.5, memory mapping may be enabled for ``BPF_MAP_TYPE_ARRAY`` by
22+setting the flag ``BPF_F_MMAPABLE``. The map definition is page-aligned and
23+starts on the first page. Sufficient page-sized and page-aligned blocks of
24+memory are allocated to store all array values, starting on the second page,
25+which in some cases will result in over-allocation of memory. The benefit of
26+using this is increased performance and ease of use since userspace programs
27+would not be required to use helper functions to access and mutate data.
28+
29+Usage
30+=====
31+
32+Kernel BPF
33+----------
34+
35+bpf_map_lookup_elem()
36+~~~~~~~~~~~~~~~~~~~~~
37+
38+.. code-block:: c
39+
40+ void *bpf_map_lookup_elem(struct bpf_map *map, const void *key)
41+
42+Array elements can be retrieved using the ``bpf_map_lookup_elem()`` helper.
43+This helper returns a pointer into the array element, so to avoid data races
44+with userspace reading the value, the user must use primitives like
45+``__sync_fetch_and_add()`` when updating the value in-place.
46+
47+bpf_map_update_elem()
48+~~~~~~~~~~~~~~~~~~~~~
49+
50+.. code-block:: c
51+
52+ long bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags)
53+
54+Array elements can be updated using the ``bpf_map_update_elem()`` helper.
55+
56+``bpf_map_update_elem()`` returns 0 on success, or negative error in case of
57+failure.
58+
59+Since the array is of constant size, ``bpf_map_delete_elem()`` is not supported.
60+To clear an array element, you may use ``bpf_map_update_elem()`` to insert a
61+zero value to that index.
62+
63+Per CPU Array
64+-------------
65+
66+Values stored in ``BPF_MAP_TYPE_ARRAY`` can be accessed by multiple programs
67+across different CPUs. To restrict storage to a single CPU, you may use a
68+``BPF_MAP_TYPE_PERCPU_ARRAY``.
69+
70+When using a ``BPF_MAP_TYPE_PERCPU_ARRAY`` the ``bpf_map_update_elem()`` and
71+``bpf_map_lookup_elem()`` helpers automatically access the slot for the current
72+CPU.
73+
74+bpf_map_lookup_percpu_elem()
75+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76+
77+.. code-block:: c
78+
79+ void *bpf_map_lookup_percpu_elem(struct bpf_map *map, const void *key, u32 cpu)
80+
81+The ``bpf_map_lookup_percpu_elem()`` helper can be used to lookup the array
82+value for a specific CPU. Returns value on success , or ``NULL`` if no entry was
83+found or ``cpu`` is invalid.
84+
85+Concurrency
86+-----------
87+
88+Since kernel version 5.1, the BPF infrastructure provides ``struct bpf_spin_lock``
89+to synchronize access.
90+
91+Userspace
92+---------
93+
94+Access from userspace uses libbpf APIs with the same names as above, with
95+the map identified by its ``fd``.
96+
97+Examples
98+========
99+
100+Please see the ``tools/testing/selftests/bpf`` directory for functional
101+examples. The code samples below demonstrate API usage.
102+
103+Kernel BPF
104+----------
105+
106+This snippet shows how to declare an array in a BPF program.
107+
108+.. code-block:: c
109+
110+ struct {
111+ __uint(type, BPF_MAP_TYPE_ARRAY);
112+ __type(key, u32);
113+ __type(value, long);
114+ __uint(max_entries, 256);
115+ } my_map SEC(".maps");
116+
117+
118+This example BPF program shows how to access an array element.
119+
120+.. code-block:: c
121+
122+ int bpf_prog(struct __sk_buff *skb)
123+ {
124+ struct iphdr ip;
125+ int index;
126+ long *value;
127+
128+ if (bpf_skb_load_bytes(skb, ETH_HLEN, &ip, sizeof(ip)) < 0)
129+ return 0;
130+
131+ index = ip.protocol;
132+ value = bpf_map_lookup_elem(&my_map, &index);
133+ if (value)
134+ __sync_fetch_and_add(value, skb->len);
135+
136+ return 0;
137+ }
138+
139+Userspace
140+---------
141+
142+BPF_MAP_TYPE_ARRAY
143+~~~~~~~~~~~~~~~~~~
144+
145+This snippet shows how to create an array, using ``bpf_map_create_opts`` to
146+set flags.
147+
148+.. code-block:: c
149+
150+ #include <bpf/libbpf.h>
151+ #include <bpf/bpf.h>
152+
153+ int create_array()
154+ {
155+ int fd;
156+ LIBBPF_OPTS(bpf_map_create_opts, opts, .map_flags = BPF_F_MMAPABLE);
157+
158+ fd = bpf_map_create(BPF_MAP_TYPE_ARRAY,
159+ "example_array", /* name */
160+ sizeof(__u32), /* key size */
161+ sizeof(long), /* value size */
162+ 256, /* max entries */
163+ &opts); /* create opts */
164+ return fd;
165+ }
166+
167+This snippet shows how to initialize the elements of an array.
168+
169+.. code-block:: c
170+
171+ int initialize_array(int fd)
172+ {
173+ __u32 i;
174+ long value;
175+ int ret;
176+
177+ for (i = 0; i < 256; i++) {
178+ value = i;
179+ ret = bpf_map_update_elem(fd, &i, &value, BPF_ANY);
180+ if (ret < 0)
181+ return ret;
182+ }
183+
184+ return ret;
185+ }
186+
187+This snippet shows how to retrieve an element value from an array.
188+
189+.. code-block:: c
190+
191+ int lookup(int fd)
192+ {
193+ __u32 index = 42;
194+ long value;
195+ int ret;
196+
197+ ret = bpf_map_lookup_elem(fd, &index, &value);
198+ if (ret < 0)
199+ return ret;
200+
201+ /* use value here */
202+ assert(value == 42);
203+
204+ return ret;
205+ }
206+
207+BPF_MAP_TYPE_PERCPU_ARRAY
208+~~~~~~~~~~~~~~~~~~~~~~~~~
209+
210+This snippet shows how to initialize the elements of a per CPU array.
211+
212+.. code-block:: c
213+
214+ int initialize_array(int fd)
215+ {
216+ int ncpus = libbpf_num_possible_cpus();
217+ long values[ncpus];
218+ __u32 i, j;
219+ int ret;
220+
221+ for (i = 0; i < 256 ; i++) {
222+ for (j = 0; j < ncpus; j++)
223+ values[j] = i;
224+ ret = bpf_map_update_elem(fd, &i, &values, BPF_ANY);
225+ if (ret < 0)
226+ return ret;
227+ }
228+
229+ return ret;
230+ }
231+
232+This snippet shows how to access the per CPU elements of an array value.
233+
234+.. code-block:: c
235+
236+ int lookup(int fd)
237+ {
238+ int ncpus = libbpf_num_possible_cpus();
239+ __u32 index = 42, j;
240+ long values[ncpus];
241+ int ret;
242+
243+ ret = bpf_map_lookup_elem(fd, &index, &values);
244+ if (ret < 0)
245+ return ret;
246+
247+ for (j = 0; j < ncpus; j++) {
248+ /* Use per CPU value here */
249+ assert(values[j] == 42);
250+ }
251+
252+ return ret;
253+ }
254+
255+Semantics
256+=========
257+
258+As shown in the example above, when accessing a ``BPF_MAP_TYPE_PERCPU_ARRAY``
259+in userspace, each value is an array with ``ncpus`` elements.
260+
261+When calling ``bpf_map_update_elem()`` the flag ``BPF_NOEXIST`` can not be used
262+for these maps.
Documentation/bpf/map_bloom_filter.rst+174−0
@@ -0,0 +1,174 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Red Hat, Inc.
3+
4+=========================
5+BPF_MAP_TYPE_BLOOM_FILTER
6+=========================
7+
8+.. note::
9+ - ``BPF_MAP_TYPE_BLOOM_FILTER`` was introduced in kernel version 5.16
10+
11+``BPF_MAP_TYPE_BLOOM_FILTER`` provides a BPF bloom filter map. Bloom
12+filters are a space-efficient probabilistic data structure used to
13+quickly test whether an element exists in a set. In a bloom filter,
14+false positives are possible whereas false negatives are not.
15+
16+The bloom filter map does not have keys, only values. When the bloom
17+filter map is created, it must be created with a ``key_size`` of 0. The
18+bloom filter map supports two operations:
19+
20+- push: adding an element to the map
21+- peek: determining whether an element is present in the map
22+
23+BPF programs must use ``bpf_map_push_elem`` to add an element to the
24+bloom filter map and ``bpf_map_peek_elem`` to query the map. These
25+operations are exposed to userspace applications using the existing
26+``bpf`` syscall in the following way:
27+
28+- ``BPF_MAP_UPDATE_ELEM`` -> push
29+- ``BPF_MAP_LOOKUP_ELEM`` -> peek
30+
31+The ``max_entries`` size that is specified at map creation time is used
32+to approximate a reasonable bitmap size for the bloom filter, and is not
33+otherwise strictly enforced. If the user wishes to insert more entries
34+into the bloom filter than ``max_entries``, this may lead to a higher
35+false positive rate.
36+
37+The number of hashes to use for the bloom filter is configurable using
38+the lower 4 bits of ``map_extra`` in ``union bpf_attr`` at map creation
39+time. If no number is specified, the default used will be 5 hash
40+functions. In general, using more hashes decreases both the false
41+positive rate and the speed of a lookup.
42+
43+It is not possible to delete elements from a bloom filter map. A bloom
44+filter map may be used as an inner map. The user is responsible for
45+synchronising concurrent updates and lookups to ensure no false negative
46+lookups occur.
47+
48+Usage
49+=====
50+
51+Kernel BPF
52+----------
53+
54+bpf_map_push_elem()
55+~~~~~~~~~~~~~~~~~~~
56+
57+.. code-block:: c
58+
59+ long bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
60+
61+A ``value`` can be added to a bloom filter using the
62+``bpf_map_push_elem()`` helper. The ``flags`` parameter must be set to
63+``BPF_ANY`` when adding an entry to the bloom filter. This helper
64+returns ``0`` on success, or negative error in case of failure.
65+
66+bpf_map_peek_elem()
67+~~~~~~~~~~~~~~~~~~~
68+
69+.. code-block:: c
70+
71+ long bpf_map_peek_elem(struct bpf_map *map, void *value)
72+
73+The ``bpf_map_peek_elem()`` helper is used to determine whether
74+``value`` is present in the bloom filter map. This helper returns ``0``
75+if ``value`` is probably present in the map, or ``-ENOENT`` if ``value``
76+is definitely not present in the map.
77+
78+Userspace
79+---------
80+
81+bpf_map_update_elem()
82+~~~~~~~~~~~~~~~~~~~~~
83+
84+.. code-block:: c
85+
86+ int bpf_map_update_elem (int fd, const void *key, const void *value, __u64 flags)
87+
88+A userspace program can add a ``value`` to a bloom filter using libbpf's
89+``bpf_map_update_elem`` function. The ``key`` parameter must be set to
90+``NULL`` and ``flags`` must be set to ``BPF_ANY``. Returns ``0`` on
91+success, or negative error in case of failure.
92+
93+bpf_map_lookup_elem()
94+~~~~~~~~~~~~~~~~~~~~~
95+
96+.. code-block:: c
97+
98+ int bpf_map_lookup_elem (int fd, const void *key, void *value)
99+
100+A userspace program can determine the presence of ``value`` in a bloom
101+filter using libbpf's ``bpf_map_lookup_elem`` function. The ``key``
102+parameter must be set to ``NULL``. Returns ``0`` if ``value`` is
103+probably present in the map, or ``-ENOENT`` if ``value`` is definitely
104+not present in the map.
105+
106+Examples
107+========
108+
109+Kernel BPF
110+----------
111+
112+This snippet shows how to declare a bloom filter in a BPF program:
113+
114+.. code-block:: c
115+
116+ struct {
117+ __uint(type, BPF_MAP_TYPE_BLOOM_FILTER);
118+ __type(value, __u32);
119+ __uint(max_entries, 1000);
120+ __uint(map_extra, 3);
121+ } bloom_filter SEC(".maps");
122+
123+This snippet shows how to determine presence of a value in a bloom
124+filter in a BPF program:
125+
126+.. code-block:: c
127+
128+ void *lookup(__u32 key)
129+ {
130+ if (bpf_map_peek_elem(&bloom_filter, &key) == 0) {
131+ /* Verify not a false positive and fetch an associated
132+ * value using a secondary lookup, e.g. in a hash table
133+ */
134+ return bpf_map_lookup_elem(&hash_table, &key);
135+ }
136+ return 0;
137+ }
138+
139+Userspace
140+---------
141+
142+This snippet shows how to use libbpf to create a bloom filter map from
143+userspace:
144+
145+.. code-block:: c
146+
147+ int create_bloom()
148+ {
149+ LIBBPF_OPTS(bpf_map_create_opts, opts,
150+ .map_extra = 3); /* number of hashes */
151+
152+ return bpf_map_create(BPF_MAP_TYPE_BLOOM_FILTER,
153+ "ipv6_bloom", /* name */
154+ 0, /* key size, must be zero */
155+ sizeof(ipv6_addr), /* value size */
156+ 10000, /* max entries */
157+ &opts); /* create options */
158+ }
159+
160+This snippet shows how to add an element to a bloom filter from
161+userspace:
162+
163+.. code-block:: c
164+
165+ int add_element(struct bpf_map *bloom_map, __u32 value)
166+ {
167+ int bloom_fd = bpf_map__fd(bloom_map);
168+ return bpf_map_update_elem(bloom_fd, NULL, &value, BPF_ANY);
169+ }
170+
171+References
172+==========
173+
174+https://lwn.net/ml/bpf/20210831225005.2762202-1-joannekoong@fb.com/
Documentation/bpf/map_cgrp_storage.rst+109−0
@@ -0,0 +1,109 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Meta Platforms, Inc. and affiliates.
3+
4+=========================
5+BPF_MAP_TYPE_CGRP_STORAGE
6+=========================
7+
8+The ``BPF_MAP_TYPE_CGRP_STORAGE`` map type represents a local fix-sized
9+storage for cgroups. It is only available with ``CONFIG_CGROUPS``.
10+The programs are made available by the same Kconfig. The
11+data for a particular cgroup can be retrieved by looking up the map
12+with that cgroup.
13+
14+This document describes the usage and semantics of the
15+``BPF_MAP_TYPE_CGRP_STORAGE`` map type.
16+
17+Usage
18+=====
19+
20+The map key must be ``sizeof(int)`` representing a cgroup fd.
21+To access the storage in a program, use ``bpf_cgrp_storage_get``::
22+
23+ void *bpf_cgrp_storage_get(struct bpf_map *map, struct cgroup *cgroup, void *value, u64 flags)
24+
25+``flags`` could be 0 or ``BPF_LOCAL_STORAGE_GET_F_CREATE`` which indicates that
26+a new local storage will be created if one does not exist.
27+
28+The local storage can be removed with ``bpf_cgrp_storage_delete``::
29+
30+ long bpf_cgrp_storage_delete(struct bpf_map *map, struct cgroup *cgroup)
31+
32+The map is available to all program types.
33+
34+Examples
35+========
36+
37+A BPF program example with BPF_MAP_TYPE_CGRP_STORAGE::
38+
39+ #include <vmlinux.h>
40+ #include <bpf/bpf_helpers.h>
41+ #include <bpf/bpf_tracing.h>
42+
43+ struct {
44+ __uint(type, BPF_MAP_TYPE_CGRP_STORAGE);
45+ __uint(map_flags, BPF_F_NO_PREALLOC);
46+ __type(key, int);
47+ __type(value, long);
48+ } cgrp_storage SEC(".maps");
49+
50+ SEC("tp_btf/sys_enter")
51+ int BPF_PROG(on_enter, struct pt_regs *regs, long id)
52+ {
53+ struct task_struct *task = bpf_get_current_task_btf();
54+ long *ptr;
55+
56+ ptr = bpf_cgrp_storage_get(&cgrp_storage, task->cgroups->dfl_cgrp, 0,
57+ BPF_LOCAL_STORAGE_GET_F_CREATE);
58+ if (ptr)
59+ __sync_fetch_and_add(ptr, 1);
60+
61+ return 0;
62+ }
63+
64+Userspace accessing map declared above::
65+
66+ #include <linux/bpf.h>
67+ #include <linux/libbpf.h>
68+
69+ __u32 map_lookup(struct bpf_map *map, int cgrp_fd)
70+ {
71+ __u32 *value;
72+ value = bpf_map_lookup_elem(bpf_map__fd(map), &cgrp_fd);
73+ if (value)
74+ return *value;
75+ return 0;
76+ }
77+
78+Difference Between BPF_MAP_TYPE_CGRP_STORAGE and BPF_MAP_TYPE_CGROUP_STORAGE
79+============================================================================
80+
81+The old cgroup storage map ``BPF_MAP_TYPE_CGROUP_STORAGE`` has been marked as
82+deprecated (renamed to ``BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED``). The new
83+``BPF_MAP_TYPE_CGRP_STORAGE`` map should be used instead. The following
84+illusates the main difference between ``BPF_MAP_TYPE_CGRP_STORAGE`` and
85+``BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED``.
86+
87+(1). ``BPF_MAP_TYPE_CGRP_STORAGE`` can be used by all program types while
88+ ``BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED`` is available only to cgroup program types
89+ like BPF_CGROUP_INET_INGRESS or BPF_CGROUP_SOCK_OPS, etc.
90+
91+(2). ``BPF_MAP_TYPE_CGRP_STORAGE`` supports local storage for more than one
92+ cgroup while ``BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED`` only supports one cgroup
93+ which is attached by a BPF program.
94+
95+(3). ``BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED`` allocates local storage at attach time so
96+ ``bpf_get_local_storage()`` always returns non-NULL local storage.
97+ ``BPF_MAP_TYPE_CGRP_STORAGE`` allocates local storage at runtime so
98+ it is possible that ``bpf_cgrp_storage_get()`` may return null local storage.
99+ To avoid such null local storage issue, user space can do
100+ ``bpf_map_update_elem()`` to pre-allocate local storage before a BPF program
101+ is attached.
102+
103+(4). ``BPF_MAP_TYPE_CGRP_STORAGE`` supports deleting local storage by a BPF program
104+ while ``BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED`` only deletes storage during
105+ prog detach time.
106+
107+So overall, ``BPF_MAP_TYPE_CGRP_STORAGE`` supports all ``BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED``
108+functionality and beyond. It is recommended to use ``BPF_MAP_TYPE_CGRP_STORAGE``
109+instead of ``BPF_MAP_TYPE_CGROUP_STORAGE_DEPRECATED``.
Documentation/bpf/map_cpumap.rst+177−0
@@ -0,0 +1,177 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Red Hat, Inc.
3+
4+===================
5+BPF_MAP_TYPE_CPUMAP
6+===================
7+
8+.. note::
9+ - ``BPF_MAP_TYPE_CPUMAP`` was introduced in kernel version 4.15
10+
11+.. kernel-doc:: kernel/bpf/cpumap.c
12+ :doc: cpu map
13+
14+An example use-case for this map type is software based Receive Side Scaling (RSS).
15+
16+The CPUMAP represents the CPUs in the system indexed as the map-key, and the
17+map-value is the config setting (per CPUMAP entry). Each CPUMAP entry has a dedicated
18+kernel thread bound to the given CPU to represent the remote CPU execution unit.
19+
20+Starting from Linux kernel version 5.9 the CPUMAP can run a second XDP program
21+on the remote CPU. This allows an XDP program to split its processing across
22+multiple CPUs. For example, a scenario where the initial CPU (that sees/receives
23+the packets) needs to do minimal packet processing and the remote CPU (to which
24+the packet is directed) can afford to spend more cycles processing the frame. The
25+initial CPU is where the XDP redirect program is executed. The remote CPU
26+receives raw ``xdp_frame`` objects.
27+
28+Usage
29+=====
30+
31+Kernel BPF
32+----------
33+bpf_redirect_map()
34+^^^^^^^^^^^^^^^^^^
35+.. code-block:: c
36+
37+ long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)
38+
39+Redirect the packet to the endpoint referenced by ``map`` at index ``key``.
40+For ``BPF_MAP_TYPE_CPUMAP`` this map contains references to CPUs.
41+
42+The lower two bits of ``flags`` are used as the return code if the map lookup
43+fails. This is so that the return value can be one of the XDP program return
44+codes up to ``XDP_TX``, as chosen by the caller.
45+
46+User space
47+----------
48+.. note::
49+ CPUMAP entries can only be updated/looked up/deleted from user space and not
50+ from an eBPF program. Trying to call these functions from a kernel eBPF
51+ program will result in the program failing to load and a verifier warning.
52+
53+bpf_map_update_elem()
54+^^^^^^^^^^^^^^^^^^^^^
55+.. code-block:: c
56+
57+ int bpf_map_update_elem(int fd, const void *key, const void *value, __u64 flags);
58+
59+CPU entries can be added or updated using the ``bpf_map_update_elem()``
60+helper. This helper replaces existing elements atomically. The ``value`` parameter
61+can be ``struct bpf_cpumap_val``.
62+
63+ .. code-block:: c
64+
65+ struct bpf_cpumap_val {
66+ __u32 qsize; /* queue size to remote target CPU */
67+ union {
68+ int fd; /* prog fd on map write */
69+ __u32 id; /* prog id on map read */
70+ } bpf_prog;
71+ };
72+
73+The flags argument can be one of the following:
74+ - BPF_ANY: Create a new element or update an existing element.
75+ - BPF_NOEXIST: Create a new element only if it did not exist.
76+ - BPF_EXIST: Update an existing element.
77+
78+bpf_map_lookup_elem()
79+^^^^^^^^^^^^^^^^^^^^^
80+.. code-block:: c
81+
82+ int bpf_map_lookup_elem(int fd, const void *key, void *value);
83+
84+CPU entries can be retrieved using the ``bpf_map_lookup_elem()``
85+helper.
86+
87+bpf_map_delete_elem()
88+^^^^^^^^^^^^^^^^^^^^^
89+.. code-block:: c
90+
91+ int bpf_map_delete_elem(int fd, const void *key);
92+
93+CPU entries can be deleted using the ``bpf_map_delete_elem()``
94+helper. This helper will return 0 on success, or negative error in case of
95+failure.
96+
97+Examples
98+========
99+Kernel
100+------
101+
102+The following code snippet shows how to declare a ``BPF_MAP_TYPE_CPUMAP`` called
103+``cpu_map`` and how to redirect packets to a remote CPU using a round robin scheme.
104+
105+.. code-block:: c
106+
107+ struct {
108+ __uint(type, BPF_MAP_TYPE_CPUMAP);
109+ __type(key, __u32);
110+ __type(value, struct bpf_cpumap_val);
111+ __uint(max_entries, 12);
112+ } cpu_map SEC(".maps");
113+
114+ struct {
115+ __uint(type, BPF_MAP_TYPE_ARRAY);
116+ __type(key, __u32);
117+ __type(value, __u32);
118+ __uint(max_entries, 12);
119+ } cpus_available SEC(".maps");
120+
121+ struct {
122+ __uint(type, BPF_MAP_TYPE_PERCPU_ARRAY);
123+ __type(key, __u32);
124+ __type(value, __u32);
125+ __uint(max_entries, 1);
126+ } cpus_iterator SEC(".maps");
127+
128+ SEC("xdp")
129+ int xdp_redir_cpu_round_robin(struct xdp_md *ctx)
130+ {
131+ __u32 key = 0;
132+ __u32 cpu_dest = 0;
133+ __u32 *cpu_selected, *cpu_iterator;
134+ __u32 cpu_idx;
135+
136+ cpu_iterator = bpf_map_lookup_elem(&cpus_iterator, &key);
137+ if (!cpu_iterator)
138+ return XDP_ABORTED;
139+ cpu_idx = *cpu_iterator;
140+
141+ *cpu_iterator += 1;
142+ if (*cpu_iterator == bpf_num_possible_cpus())
143+ *cpu_iterator = 0;
144+
145+ cpu_selected = bpf_map_lookup_elem(&cpus_available, &cpu_idx);
146+ if (!cpu_selected)
147+ return XDP_ABORTED;
148+ cpu_dest = *cpu_selected;
149+
150+ if (cpu_dest >= bpf_num_possible_cpus())
151+ return XDP_ABORTED;
152+
153+ return bpf_redirect_map(&cpu_map, cpu_dest, 0);
154+ }
155+
156+User space
157+----------
158+
159+The following code snippet shows how to dynamically set the max_entries for a
160+CPUMAP to the max number of cpus available on the system.
161+
162+.. code-block:: c
163+
164+ int set_max_cpu_entries(struct bpf_map *cpu_map)
165+ {
166+ if (bpf_map__set_max_entries(cpu_map, libbpf_num_possible_cpus()) < 0) {
167+ fprintf(stderr, "Failed to set max entries for cpu_map map: %s",
168+ strerror(errno));
169+ return -1;
170+ }
171+ return 0;
172+ }
173+
174+References
175+===========
176+
177+- https://developers.redhat.com/blog/2021/05/13/receive-side-scaling-rss-with-ebpf-and-cpumap#redirecting_into_a_cpumap
Documentation/bpf/map_devmap.rst+238−0
@@ -0,0 +1,238 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Red Hat, Inc.
3+
4+=================================================
5+BPF_MAP_TYPE_DEVMAP and BPF_MAP_TYPE_DEVMAP_HASH
6+=================================================
7+
8+.. note::
9+ - ``BPF_MAP_TYPE_DEVMAP`` was introduced in kernel version 4.14
10+ - ``BPF_MAP_TYPE_DEVMAP_HASH`` was introduced in kernel version 5.4
11+
12+``BPF_MAP_TYPE_DEVMAP`` and ``BPF_MAP_TYPE_DEVMAP_HASH`` are BPF maps primarily
13+used as backend maps for the XDP BPF helper call ``bpf_redirect_map()``.
14+``BPF_MAP_TYPE_DEVMAP`` is backed by an array that uses the key as
15+the index to lookup a reference to a net device. While ``BPF_MAP_TYPE_DEVMAP_HASH``
16+is backed by a hash table that uses a key to lookup a reference to a net device.
17+The user provides either <``key``/ ``ifindex``> or <``key``/ ``struct bpf_devmap_val``>
18+pairs to update the maps with new net devices.
19+
20+.. note::
21+ - The key to a hash map doesn't have to be an ``ifindex``.
22+ - While ``BPF_MAP_TYPE_DEVMAP_HASH`` allows for densely packing the net devices
23+ it comes at the cost of a hash of the key when performing a look up.
24+
25+The setup and packet enqueue/send code is shared between the two types of
26+devmap; only the lookup and insertion is different.
27+
28+Usage
29+=====
30+Kernel BPF
31+----------
32+bpf_redirect_map()
33+^^^^^^^^^^^^^^^^^^
34+.. code-block:: c
35+
36+ long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)
37+
38+Redirect the packet to the endpoint referenced by ``map`` at index ``key``.
39+For ``BPF_MAP_TYPE_DEVMAP`` and ``BPF_MAP_TYPE_DEVMAP_HASH`` this map contains
40+references to net devices (for forwarding packets through other ports).
41+
42+The lower two bits of *flags* are used as the return code if the map lookup
43+fails. This is so that the return value can be one of the XDP program return
44+codes up to ``XDP_TX``, as chosen by the caller. The higher bits of ``flags``
45+can be set to ``BPF_F_BROADCAST`` or ``BPF_F_EXCLUDE_INGRESS`` as defined
46+below.
47+
48+With ``BPF_F_BROADCAST`` the packet will be broadcast to all the interfaces
49+in the map, with ``BPF_F_EXCLUDE_INGRESS`` the ingress interface will be excluded
50+from the broadcast.
51+
52+.. note::
53+ - The key is ignored if BPF_F_BROADCAST is set.
54+ - The broadcast feature can also be used to implement multicast forwarding:
55+ simply create multiple DEVMAPs, each one corresponding to a single multicast group.
56+
57+This helper will return ``XDP_REDIRECT`` on success, or the value of the two
58+lower bits of the ``flags`` argument if the map lookup fails.
59+
60+More information about redirection can be found :doc:`redirect`
61+
62+bpf_map_lookup_elem()
63+^^^^^^^^^^^^^^^^^^^^^
64+.. code-block:: c
65+
66+ void *bpf_map_lookup_elem(struct bpf_map *map, const void *key)
67+
68+Net device entries can be retrieved using the ``bpf_map_lookup_elem()``
69+helper.
70+
71+User space
72+----------
73+.. note::
74+ DEVMAP entries can only be updated/deleted from user space and not
75+ from an eBPF program. Trying to call these functions from a kernel eBPF
76+ program will result in the program failing to load and a verifier warning.
77+
78+bpf_map_update_elem()
79+^^^^^^^^^^^^^^^^^^^^^
80+.. code-block:: c
81+
82+ int bpf_map_update_elem(int fd, const void *key, const void *value, __u64 flags);
83+
84+Net device entries can be added or updated using the ``bpf_map_update_elem()``
85+helper. This helper replaces existing elements atomically. The ``value`` parameter
86+can be ``struct bpf_devmap_val`` or a simple ``int ifindex`` for backwards
87+compatibility.
88+
89+ .. code-block:: c
90+
91+ struct bpf_devmap_val {
92+ __u32 ifindex; /* device index */
93+ union {
94+ int fd; /* prog fd on map write */
95+ __u32 id; /* prog id on map read */
96+ } bpf_prog;
97+ };
98+
99+The ``flags`` argument can be one of the following:
100+ - ``BPF_ANY``: Create a new element or update an existing element.
101+ - ``BPF_NOEXIST``: Create a new element only if it did not exist.
102+ - ``BPF_EXIST``: Update an existing element.
103+
104+DEVMAPs can associate a program with a device entry by adding a ``bpf_prog.fd``
105+to ``struct bpf_devmap_val``. Programs are run after ``XDP_REDIRECT`` and have
106+access to both Rx device and Tx device. The program associated with the ``fd``
107+must have type XDP with expected attach type ``xdp_devmap``.
108+When a program is associated with a device index, the program is run on an
109+``XDP_REDIRECT`` and before the buffer is added to the per-cpu queue. Examples
110+of how to attach/use xdp_devmap progs can be found in the kernel selftests:
111+
112+- ``tools/testing/selftests/bpf/prog_tests/xdp_devmap_attach.c``
113+- ``tools/testing/selftests/bpf/progs/test_xdp_with_devmap_helpers.c``
114+
115+bpf_map_lookup_elem()
116+^^^^^^^^^^^^^^^^^^^^^
117+.. code-block:: c
118+
119+.. c:function::
120+ int bpf_map_lookup_elem(int fd, const void *key, void *value);
121+
122+Net device entries can be retrieved using the ``bpf_map_lookup_elem()``
123+helper.
124+
125+bpf_map_delete_elem()
126+^^^^^^^^^^^^^^^^^^^^^
127+.. code-block:: c
128+
129+.. c:function::
130+ int bpf_map_delete_elem(int fd, const void *key);
131+
132+Net device entries can be deleted using the ``bpf_map_delete_elem()``
133+helper. This helper will return 0 on success, or negative error in case of
134+failure.
135+
136+Examples
137+========
138+
139+Kernel BPF
140+----------
141+
142+The following code snippet shows how to declare a ``BPF_MAP_TYPE_DEVMAP``
143+called tx_port.
144+
145+.. code-block:: c
146+
147+ struct {
148+ __uint(type, BPF_MAP_TYPE_DEVMAP);
149+ __type(key, __u32);
150+ __type(value, __u32);
151+ __uint(max_entries, 256);
152+ } tx_port SEC(".maps");
153+
154+The following code snippet shows how to declare a ``BPF_MAP_TYPE_DEVMAP_HASH``
155+called forward_map.
156+
157+.. code-block:: c
158+
159+ struct {
160+ __uint(type, BPF_MAP_TYPE_DEVMAP_HASH);
161+ __type(key, __u32);
162+ __type(value, struct bpf_devmap_val);
163+ __uint(max_entries, 32);
164+ } forward_map SEC(".maps");
165+
166+.. note::
167+
168+ The value type in the DEVMAP above is a ``struct bpf_devmap_val``
169+
170+The following code snippet shows a simple xdp_redirect_map program. This program
171+would work with a user space program that populates the devmap ``forward_map`` based
172+on ingress ifindexes. The BPF program (below) is redirecting packets using the
173+ingress ``ifindex`` as the ``key``.
174+
175+.. code-block:: c
176+
177+ SEC("xdp")
178+ int xdp_redirect_map_func(struct xdp_md *ctx)
179+ {
180+ int index = ctx->ingress_ifindex;
181+
182+ return bpf_redirect_map(&forward_map, index, 0);
183+ }
184+
185+The following code snippet shows a BPF program that is broadcasting packets to
186+all the interfaces in the ``tx_port`` devmap.
187+
188+.. code-block:: c
189+
190+ SEC("xdp")
191+ int xdp_redirect_map_func(struct xdp_md *ctx)
192+ {
193+ return bpf_redirect_map(&tx_port, 0, BPF_F_BROADCAST | BPF_F_EXCLUDE_INGRESS);
194+ }
195+
196+User space
197+----------
198+
199+The following code snippet shows how to update a devmap called ``tx_port``.
200+
201+.. code-block:: c
202+
203+ int update_devmap(int ifindex, int redirect_ifindex)
204+ {
205+ int ret;
206+
207+ ret = bpf_map_update_elem(bpf_map__fd(tx_port), &ifindex, &redirect_ifindex, 0);
208+ if (ret < 0) {
209+ fprintf(stderr, "Failed to update devmap_ value: %s\n",
210+ strerror(errno));
211+ }
212+
213+ return ret;
214+ }
215+
216+The following code snippet shows how to update a hash_devmap called ``forward_map``.
217+
218+.. code-block:: c
219+
220+ int update_devmap(int ifindex, int redirect_ifindex)
221+ {
222+ struct bpf_devmap_val devmap_val = { .ifindex = redirect_ifindex };
223+ int ret;
224+
225+ ret = bpf_map_update_elem(bpf_map__fd(forward_map), &ifindex, &devmap_val, 0);
226+ if (ret < 0) {
227+ fprintf(stderr, "Failed to update devmap_ value: %s\n",
228+ strerror(errno));
229+ }
230+ return ret;
231+ }
232+
233+References
234+===========
235+
236+- https://lwn.net/Articles/728146/
237+- https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=6f9d451ab1a33728adb72d7ff66a7b374d665176
238+- https://elixir.bootlin.com/linux/latest/source/net/core/filter.c#L4106
Documentation/bpf/map_hash.rst+28−5
@@ -34,7 +34,14 @@ the ``BPF_F_NO_COMMON_LRU`` flag when calling ``bpf_map_create``. · 33 unmodified lines
3434 Usage
3535 =====
3636
37−.. c:function::
37+Kernel BPF
38+----------
39+
40+bpf_map_update_elem()
41+~~~~~~~~~~~~~~~~~~~~~
42+
43+.. code-block:: c
44+
3845 long bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags)
3946
4047 Hash entries can be added or updated using the ``bpf_map_update_elem()``
@@ -49,14 +56,22 @@ parameter can be used to control the update behaviour: · 8 unmodified lines
4956 ``bpf_map_update_elem()`` returns 0 on success, or negative error in
5057 case of failure.
5158
52−.. c:function::
59+bpf_map_lookup_elem()
60+~~~~~~~~~~~~~~~~~~~~~
61+
62+.. code-block:: c
63+
5364 void *bpf_map_lookup_elem(struct bpf_map *map, const void *key)
5465
5566 Hash entries can be retrieved using the ``bpf_map_lookup_elem()``
5667 helper. This helper returns a pointer to the value associated with
5768 ``key``, or ``NULL`` if no entry was found.
5869
59−.. c:function::
70+bpf_map_delete_elem()
71+~~~~~~~~~~~~~~~~~~~~~
72+
73+.. code-block:: c
74+
6075 long bpf_map_delete_elem(struct bpf_map *map, const void *key)
6176
6277 Hash entries can be deleted using the ``bpf_map_delete_elem()``
@@ -70,7 +85,11 @@ For ``BPF_MAP_TYPE_PERCPU_HASH`` and ``BPF_MAP_TYPE_LRU_PERCPU_HASH`` · 7 unmodified lines
7085 the ``bpf_map_update_elem()`` and ``bpf_map_lookup_elem()`` helpers
7186 automatically access the hash slot for the current CPU.
7287
73−.. c:function::
88+bpf_map_lookup_percpu_elem()
89+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
90+
91+.. code-block:: c
92+
7493 void *bpf_map_lookup_percpu_elem(struct bpf_map *map, const void *key, u32 cpu)
7594
7695 The ``bpf_map_lookup_percpu_elem()`` helper can be used to lookup the
@@ -89,7 +108,11 @@ See ``tools/testing/selftests/bpf/progs/test_spin_lock.c``. · 12 unmodified lines
89108 Userspace
90109 ---------
91110
92−.. c:function::
111+bpf_map_get_next_key()
112+~~~~~~~~~~~~~~~~~~~~~~
113+
114+.. code-block:: c
115+
93116 int bpf_map_get_next_key(int fd, const void *cur_key, void *next_key)
94117
95118 In userspace, it is possible to iterate through the keys of a hash using
Documentation/bpf/map_lpm_trie.rst+197−0
@@ -0,0 +1,197 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Red Hat, Inc.
3+
4+=====================
5+BPF_MAP_TYPE_LPM_TRIE
6+=====================
7+
8+.. note::
9+ - ``BPF_MAP_TYPE_LPM_TRIE`` was introduced in kernel version 4.11
10+
11+``BPF_MAP_TYPE_LPM_TRIE`` provides a longest prefix match algorithm that
12+can be used to match IP addresses to a stored set of prefixes.
13+Internally, data is stored in an unbalanced trie of nodes that uses
14+``prefixlen,data`` pairs as its keys. The ``data`` is interpreted in
15+network byte order, i.e. big endian, so ``data[0]`` stores the most
16+significant byte.
17+
18+LPM tries may be created with a maximum prefix length that is a multiple
19+of 8, in the range from 8 to 2048. The key used for lookup and update
20+operations is a ``struct bpf_lpm_trie_key``, extended by
21+``max_prefixlen/8`` bytes.
22+
23+- For IPv4 addresses the data length is 4 bytes
24+- For IPv6 addresses the data length is 16 bytes
25+
26+The value type stored in the LPM trie can be any user defined type.
27+
28+.. note::
29+ When creating a map of type ``BPF_MAP_TYPE_LPM_TRIE`` you must set the
30+ ``BPF_F_NO_PREALLOC`` flag.
31+
32+Usage
33+=====
34+
35+Kernel BPF
36+----------
37+
38+bpf_map_lookup_elem()
39+~~~~~~~~~~~~~~~~~~~~~
40+
41+.. code-block:: c
42+
43+ void *bpf_map_lookup_elem(struct bpf_map *map, const void *key)
44+
45+The longest prefix entry for a given data value can be found using the
46+``bpf_map_lookup_elem()`` helper. This helper returns a pointer to the
47+value associated with the longest matching ``key``, or ``NULL`` if no
48+entry was found.
49+
50+The ``key`` should have ``prefixlen`` set to ``max_prefixlen`` when
51+performing longest prefix lookups. For example, when searching for the
52+longest prefix match for an IPv4 address, ``prefixlen`` should be set to
53+``32``.
54+
55+bpf_map_update_elem()
56+~~~~~~~~~~~~~~~~~~~~~
57+
58+.. code-block:: c
59+
60+ long bpf_map_update_elem(struct bpf_map *map, const void *key, const void *value, u64 flags)
61+
62+Prefix entries can be added or updated using the ``bpf_map_update_elem()``
63+helper. This helper replaces existing elements atomically.
64+
65+``bpf_map_update_elem()`` returns ``0`` on success, or negative error in
66+case of failure.
67+
68+ .. note::
69+ The flags parameter must be one of BPF_ANY, BPF_NOEXIST or BPF_EXIST,
70+ but the value is ignored, giving BPF_ANY semantics.
71+
72+bpf_map_delete_elem()
73+~~~~~~~~~~~~~~~~~~~~~
74+
75+.. code-block:: c
76+
77+ long bpf_map_delete_elem(struct bpf_map *map, const void *key)
78+
79+Prefix entries can be deleted using the ``bpf_map_delete_elem()``
80+helper. This helper will return 0 on success, or negative error in case
81+of failure.
82+
83+Userspace
84+---------
85+
86+Access from userspace uses libbpf APIs with the same names as above, with
87+the map identified by ``fd``.
88+
89+bpf_map_get_next_key()
90+~~~~~~~~~~~~~~~~~~~~~~
91+
92+.. code-block:: c
93+
94+ int bpf_map_get_next_key (int fd, const void *cur_key, void *next_key)
95+
96+A userspace program can iterate through the entries in an LPM trie using
97+libbpf's ``bpf_map_get_next_key()`` function. The first key can be
98+fetched by calling ``bpf_map_get_next_key()`` with ``cur_key`` set to
99+``NULL``. Subsequent calls will fetch the next key that follows the
100+current key. ``bpf_map_get_next_key()`` returns ``0`` on success,
101+``-ENOENT`` if ``cur_key`` is the last key in the trie, or negative
102+error in case of failure.
103+
104+``bpf_map_get_next_key()`` will iterate through the LPM trie elements
105+from leftmost leaf first. This means that iteration will return more
106+specific keys before less specific ones.
107+
108+Examples
109+========
110+
111+Please see ``tools/testing/selftests/bpf/test_lpm_map.c`` for examples
112+of LPM trie usage from userspace. The code snippets below demonstrate
113+API usage.
114+
115+Kernel BPF
116+----------
117+
118+The following BPF code snippet shows how to declare a new LPM trie for IPv4
119+address prefixes:
120+
121+.. code-block:: c
122+
123+ #include <linux/bpf.h>
124+ #include <bpf/bpf_helpers.h>
125+
126+ struct ipv4_lpm_key {
127+ __u32 prefixlen;
128+ __u32 data;
129+ };
130+
131+ struct {
132+ __uint(type, BPF_MAP_TYPE_LPM_TRIE);
133+ __type(key, struct ipv4_lpm_key);
134+ __type(value, __u32);
135+ __uint(map_flags, BPF_F_NO_PREALLOC);
136+ __uint(max_entries, 255);
137+ } ipv4_lpm_map SEC(".maps");
138+
139+The following BPF code snippet shows how to lookup by IPv4 address:
140+
141+.. code-block:: c
142+
143+ void *lookup(__u32 ipaddr)
144+ {
145+ struct ipv4_lpm_key key = {
146+ .prefixlen = 32,
147+ .data = ipaddr
148+ };
149+
150+ return bpf_map_lookup_elem(&ipv4_lpm_map, &key);
151+ }
152+
153+Userspace
154+---------
155+
156+The following snippet shows how to insert an IPv4 prefix entry into an
157+LPM trie:
158+
159+.. code-block:: c
160+
161+ int add_prefix_entry(int lpm_fd, __u32 addr, __u32 prefixlen, struct value *value)
162+ {
163+ struct ipv4_lpm_key ipv4_key = {
164+ .prefixlen = prefixlen,
165+ .data = addr
166+ };
167+ return bpf_map_update_elem(lpm_fd, &ipv4_key, value, BPF_ANY);
168+ }
169+
170+The following snippet shows a userspace program walking through the entries
171+of an LPM trie:
172+
173+
174+.. code-block:: c
175+
176+ #include <bpf/libbpf.h>
177+ #include <bpf/bpf.h>
178+
179+ void iterate_lpm_trie(int map_fd)
180+ {
181+ struct ipv4_lpm_key *cur_key = NULL;
182+ struct ipv4_lpm_key next_key;
183+ struct value value;
184+ int err;
185+
186+ for (;;) {
187+ err = bpf_map_get_next_key(map_fd, cur_key, &next_key);
188+ if (err)
189+ break;
190+
191+ bpf_map_lookup_elem(map_fd, &next_key, &value);
192+
193+ /* Use key and value here */
194+
195+ cur_key = &next_key;
196+ }
197+ }
Documentation/bpf/map_of_maps.rst+130−0
@@ -0,0 +1,130 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Red Hat, Inc.
3+
4+========================================================
5+BPF_MAP_TYPE_ARRAY_OF_MAPS and BPF_MAP_TYPE_HASH_OF_MAPS
6+========================================================
7+
8+.. note::
9+ - ``BPF_MAP_TYPE_ARRAY_OF_MAPS`` and ``BPF_MAP_TYPE_HASH_OF_MAPS`` were
10+ introduced in kernel version 4.12
11+
12+``BPF_MAP_TYPE_ARRAY_OF_MAPS`` and ``BPF_MAP_TYPE_HASH_OF_MAPS`` provide general
13+purpose support for map in map storage. One level of nesting is supported, where
14+an outer map contains instances of a single type of inner map, for example
15+``array_of_maps->sock_map``.
16+
17+When creating an outer map, an inner map instance is used to initialize the
18+metadata that the outer map holds about its inner maps. This inner map has a
19+separate lifetime from the outer map and can be deleted after the outer map has
20+been created.
21+
22+The outer map supports element lookup, update and delete from user space using
23+the syscall API. A BPF program is only allowed to do element lookup in the outer
24+map.
25+
26+.. note::
27+ - Multi-level nesting is not supported.
28+ - Any BPF map type can be used as an inner map, except for
29+ ``BPF_MAP_TYPE_PROG_ARRAY``.
30+ - A BPF program cannot update or delete outer map entries.
31+
32+For ``BPF_MAP_TYPE_ARRAY_OF_MAPS`` the key is an unsigned 32-bit integer index
33+into the array. The array is a fixed size with ``max_entries`` elements that are
34+zero initialized when created.
35+
36+For ``BPF_MAP_TYPE_HASH_OF_MAPS`` the key type can be chosen when defining the
37+map. The kernel is responsible for allocating and freeing key/value pairs, up to
38+the max_entries limit that you specify. Hash maps use pre-allocation of hash
39+table elements by default. The ``BPF_F_NO_PREALLOC`` flag can be used to disable
40+pre-allocation when it is too memory expensive.
41+
42+Usage
43+=====
44+
45+Kernel BPF Helper
46+-----------------
47+
48+bpf_map_lookup_elem()
49+~~~~~~~~~~~~~~~~~~~~~
50+
51+.. code-block:: c
52+
53+ void *bpf_map_lookup_elem(struct bpf_map *map, const void *key)
54+
55+Inner maps can be retrieved using the ``bpf_map_lookup_elem()`` helper. This
56+helper returns a pointer to the inner map, or ``NULL`` if no entry was found.
57+
58+Examples
59+========
60+
61+Kernel BPF Example
62+------------------
63+
64+This snippet shows how to create and initialise an array of devmaps in a BPF
65+program. Note that the outer array can only be modified from user space using
66+the syscall API.
67+
68+.. code-block:: c
69+
70+ struct inner_map {
71+ __uint(type, BPF_MAP_TYPE_DEVMAP);
72+ __uint(max_entries, 10);
73+ __type(key, __u32);
74+ __type(value, __u32);
75+ } inner_map1 SEC(".maps"), inner_map2 SEC(".maps");
76+
77+ struct {
78+ __uint(type, BPF_MAP_TYPE_ARRAY_OF_MAPS);
79+ __uint(max_entries, 2);
80+ __type(key, __u32);
81+ __array(values, struct inner_map);
82+ } outer_map SEC(".maps") = {
83+ .values = { &inner_map1,
84+ &inner_map2 }
85+ };
86+
87+See ``progs/test_btf_map_in_map.c`` in ``tools/testing/selftests/bpf`` for more
88+examples of declarative initialisation of outer maps.
89+
90+User Space
91+----------
92+
93+This snippet shows how to create an array based outer map:
94+
95+.. code-block:: c
96+
97+ int create_outer_array(int inner_fd) {
98+ LIBBPF_OPTS(bpf_map_create_opts, opts, .inner_map_fd = inner_fd);
99+ int fd;
100+
101+ fd = bpf_map_create(BPF_MAP_TYPE_ARRAY_OF_MAPS,
102+ "example_array", /* name */
103+ sizeof(__u32), /* key size */
104+ sizeof(__u32), /* value size */
105+ 256, /* max entries */
106+ &opts); /* create opts */
107+ return fd;
108+ }
109+
110+
111+This snippet shows how to add an inner map to an outer map:
112+
113+.. code-block:: c
114+
115+ int add_devmap(int outer_fd, int index, const char *name) {
116+ int fd;
117+
118+ fd = bpf_map_create(BPF_MAP_TYPE_DEVMAP, name,
119+ sizeof(__u32), sizeof(__u32), 256, NULL);
120+ if (fd < 0)
121+ return fd;
122+
123+ return bpf_map_update_elem(outer_fd, &index, &fd, BPF_ANY);
124+ }
125+
126+References
127+==========
128+
129+- https://lore.kernel.org/netdev/20170322170035.923581-3-kafai@fb.com/
130+- https://lore.kernel.org/netdev/20170322170035.923581-4-kafai@fb.com/
Documentation/bpf/map_queue_stack.rst+146−0
@@ -0,0 +1,146 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Red Hat, Inc.
3+
4+=========================================
5+BPF_MAP_TYPE_QUEUE and BPF_MAP_TYPE_STACK
6+=========================================
7+
8+.. note::
9+ - ``BPF_MAP_TYPE_QUEUE`` and ``BPF_MAP_TYPE_STACK`` were introduced
10+ in kernel version 4.20
11+
12+``BPF_MAP_TYPE_QUEUE`` provides FIFO storage and ``BPF_MAP_TYPE_STACK``
13+provides LIFO storage for BPF programs. These maps support peek, pop and
14+push operations that are exposed to BPF programs through the respective
15+helpers. These operations are exposed to userspace applications using
16+the existing ``bpf`` syscall in the following way:
17+
18+- ``BPF_MAP_LOOKUP_ELEM`` -> peek
19+- ``BPF_MAP_LOOKUP_AND_DELETE_ELEM`` -> pop
20+- ``BPF_MAP_UPDATE_ELEM`` -> push
21+
22+``BPF_MAP_TYPE_QUEUE`` and ``BPF_MAP_TYPE_STACK`` do not support
23+``BPF_F_NO_PREALLOC``.
24+
25+Usage
26+=====
27+
28+Kernel BPF
29+----------
30+
31+bpf_map_push_elem()
32+~~~~~~~~~~~~~~~~~~~
33+
34+.. code-block:: c
35+
36+ long bpf_map_push_elem(struct bpf_map *map, const void *value, u64 flags)
37+
38+An element ``value`` can be added to a queue or stack using the
39+``bpf_map_push_elem`` helper. The ``flags`` parameter must be set to
40+``BPF_ANY`` or ``BPF_EXIST``. If ``flags`` is set to ``BPF_EXIST`` then,
41+when the queue or stack is full, the oldest element will be removed to
42+make room for ``value`` to be added. Returns ``0`` on success, or
43+negative error in case of failure.
44+
45+bpf_map_peek_elem()
46+~~~~~~~~~~~~~~~~~~~
47+
48+.. code-block:: c
49+
50+ long bpf_map_peek_elem(struct bpf_map *map, void *value)
51+
52+This helper fetches an element ``value`` from a queue or stack without
53+removing it. Returns ``0`` on success, or negative error in case of
54+failure.
55+
56+bpf_map_pop_elem()
57+~~~~~~~~~~~~~~~~~~
58+
59+.. code-block:: c
60+
61+ long bpf_map_pop_elem(struct bpf_map *map, void *value)
62+
63+This helper removes an element into ``value`` from a queue or
64+stack. Returns ``0`` on success, or negative error in case of failure.
65+
66+
67+Userspace
68+---------
69+
70+bpf_map_update_elem()
71+~~~~~~~~~~~~~~~~~~~~~
72+
73+.. code-block:: c
74+
75+ int bpf_map_update_elem (int fd, const void *key, const void *value, __u64 flags)
76+
77+A userspace program can push ``value`` onto a queue or stack using libbpf's
78+``bpf_map_update_elem`` function. The ``key`` parameter must be set to
79+``NULL`` and ``flags`` must be set to ``BPF_ANY`` or ``BPF_EXIST``, with the
80+same semantics as the ``bpf_map_push_elem`` kernel helper. Returns ``0`` on
81+success, or negative error in case of failure.
82+
83+bpf_map_lookup_elem()
84+~~~~~~~~~~~~~~~~~~~~~
85+
86+.. code-block:: c
87+
88+ int bpf_map_lookup_elem (int fd, const void *key, void *value)
89+
90+A userspace program can peek at the ``value`` at the head of a queue or stack
91+using the libbpf ``bpf_map_lookup_elem`` function. The ``key`` parameter must be
92+set to ``NULL``. Returns ``0`` on success, or negative error in case of
93+failure.
94+
95+bpf_map_lookup_and_delete_elem()
96+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97+
98+.. code-block:: c
99+
100+ int bpf_map_lookup_and_delete_elem (int fd, const void *key, void *value)
101+
102+A userspace program can pop a ``value`` from the head of a queue or stack using
103+the libbpf ``bpf_map_lookup_and_delete_elem`` function. The ``key`` parameter
104+must be set to ``NULL``. Returns ``0`` on success, or negative error in case of
105+failure.
106+
107+Examples
108+========
109+
110+Kernel BPF
111+----------
112+
113+This snippet shows how to declare a queue in a BPF program:
114+
115+.. code-block:: c
116+
117+ struct {
118+ __uint(type, BPF_MAP_TYPE_QUEUE);
119+ __type(value, __u32);
120+ __uint(max_entries, 10);
121+ } queue SEC(".maps");
122+
123+
124+Userspace
125+---------
126+
127+This snippet shows how to use libbpf's low-level API to create a queue from
128+userspace:
129+
130+.. code-block:: c
131+
132+ int create_queue()
133+ {
134+ return bpf_map_create(BPF_MAP_TYPE_QUEUE,
135+ "sample_queue", /* name */
136+ 0, /* key size, must be zero */
137+ sizeof(__u32), /* value size */
138+ 10, /* max entries */
139+ NULL); /* create options */
140+ }
141+
142+
143+References
144+==========
145+
146+https://lwn.net/ml/netdev/153986858555.9127.14517764371945179514.stgit@kernel/
Documentation/bpf/map_sk_storage.rst+155−0
@@ -0,0 +1,155 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Red Hat, Inc.
3+
4+=======================
5+BPF_MAP_TYPE_SK_STORAGE
6+=======================
7+
8+.. note::
9+ - ``BPF_MAP_TYPE_SK_STORAGE`` was introduced in kernel version 5.2
10+
11+``BPF_MAP_TYPE_SK_STORAGE`` is used to provide socket-local storage for BPF
12+programs. A map of type ``BPF_MAP_TYPE_SK_STORAGE`` declares the type of storage
13+to be provided and acts as the handle for accessing the socket-local
14+storage. The values for maps of type ``BPF_MAP_TYPE_SK_STORAGE`` are stored
15+locally with each socket instead of with the map. The kernel is responsible for
16+allocating storage for a socket when requested and for freeing the storage when
17+either the map or the socket is deleted.
18+
19+.. note::
20+ - The key type must be ``int`` and ``max_entries`` must be set to ``0``.
21+ - The ``BPF_F_NO_PREALLOC`` flag must be used when creating a map for
22+ socket-local storage.
23+
24+Usage
25+=====
26+
27+Kernel BPF
28+----------
29+
30+bpf_sk_storage_get()
31+~~~~~~~~~~~~~~~~~~~~
32+
33+.. code-block:: c
34+
35+ void *bpf_sk_storage_get(struct bpf_map *map, void *sk, void *value, u64 flags)
36+
37+Socket-local storage can be retrieved using the ``bpf_sk_storage_get()``
38+helper. The helper gets the storage from ``sk`` that is associated with ``map``.
39+If the ``BPF_LOCAL_STORAGE_GET_F_CREATE`` flag is used then
40+``bpf_sk_storage_get()`` will create the storage for ``sk`` if it does not
41+already exist. ``value`` can be used together with
42+``BPF_LOCAL_STORAGE_GET_F_CREATE`` to initialize the storage value, otherwise it
43+will be zero initialized. Returns a pointer to the storage on success, or
44+``NULL`` in case of failure.
45+
46+.. note::
47+ - ``sk`` is a kernel ``struct sock`` pointer for LSM or tracing programs.
48+ - ``sk`` is a ``struct bpf_sock`` pointer for other program types.
49+
50+bpf_sk_storage_delete()
51+~~~~~~~~~~~~~~~~~~~~~~~
52+
53+.. code-block:: c
54+
55+ long bpf_sk_storage_delete(struct bpf_map *map, void *sk)
56+
57+Socket-local storage can be deleted using the ``bpf_sk_storage_delete()``
58+helper. The helper deletes the storage from ``sk`` that is identified by
59+``map``. Returns ``0`` on success, or negative error in case of failure.
60+
61+User space
62+----------
63+
64+bpf_map_update_elem()
65+~~~~~~~~~~~~~~~~~~~~~
66+
67+.. code-block:: c
68+
69+ int bpf_map_update_elem(int map_fd, const void *key, const void *value, __u64 flags)
70+
71+Socket-local storage for the socket identified by ``key`` belonging to
72+``map_fd`` can be added or updated using the ``bpf_map_update_elem()`` libbpf
73+function. ``key`` must be a pointer to a valid ``fd`` in the user space
74+program. The ``flags`` parameter can be used to control the update behaviour:
75+
76+- ``BPF_ANY`` will create storage for ``fd`` or update existing storage.
77+- ``BPF_NOEXIST`` will create storage for ``fd`` only if it did not already
78+ exist, otherwise the call will fail with ``-EEXIST``.
79+- ``BPF_EXIST`` will update existing storage for ``fd`` if it already exists,
80+ otherwise the call will fail with ``-ENOENT``.
81+
82+Returns ``0`` on success, or negative error in case of failure.
83+
84+bpf_map_lookup_elem()
85+~~~~~~~~~~~~~~~~~~~~~
86+
87+.. code-block:: c
88+
89+ int bpf_map_lookup_elem(int map_fd, const void *key, void *value)
90+
91+Socket-local storage for the socket identified by ``key`` belonging to
92+``map_fd`` can be retrieved using the ``bpf_map_lookup_elem()`` libbpf
93+function. ``key`` must be a pointer to a valid ``fd`` in the user space
94+program. Returns ``0`` on success, or negative error in case of failure.
95+
96+bpf_map_delete_elem()
97+~~~~~~~~~~~~~~~~~~~~~
98+
99+.. code-block:: c
100+
101+ int bpf_map_delete_elem(int map_fd, const void *key)
102+
103+Socket-local storage for the socket identified by ``key`` belonging to
104+``map_fd`` can be deleted using the ``bpf_map_delete_elem()`` libbpf
105+function. Returns ``0`` on success, or negative error in case of failure.
106+
107+Examples
108+========
109+
110+Kernel BPF
111+----------
112+
113+This snippet shows how to declare socket-local storage in a BPF program:
114+
115+.. code-block:: c
116+
117+ struct {
118+ __uint(type, BPF_MAP_TYPE_SK_STORAGE);
119+ __uint(map_flags, BPF_F_NO_PREALLOC);
120+ __type(key, int);
121+ __type(value, struct my_storage);
122+ } socket_storage SEC(".maps");
123+
124+This snippet shows how to retrieve socket-local storage in a BPF program:
125+
126+.. code-block:: c
127+
128+ SEC("sockops")
129+ int _sockops(struct bpf_sock_ops *ctx)
130+ {
131+ struct my_storage *storage;
132+ struct bpf_sock *sk;
133+
134+ sk = ctx->sk;
135+ if (!sk)
136+ return 1;
137+
138+ storage = bpf_sk_storage_get(&socket_storage, sk, 0,
139+ BPF_LOCAL_STORAGE_GET_F_CREATE);
140+ if (!storage)
141+ return 1;
142+
143+ /* Use 'storage' here */
144+
145+ return 1;
146+ }
147+
148+
149+Please see the ``tools/testing/selftests/bpf`` directory for functional
150+examples.
151+
152+References
153+==========
154+
155+https://lwn.net/ml/netdev/20190426171103.61892-1-kafai@fb.com/
Documentation/bpf/map_xskmap.rst+192−0
@@ -0,0 +1,192 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Red Hat, Inc.
3+
4+===================
5+BPF_MAP_TYPE_XSKMAP
6+===================
7+
8+.. note::
9+ - ``BPF_MAP_TYPE_XSKMAP`` was introduced in kernel version 4.18
10+
11+The ``BPF_MAP_TYPE_XSKMAP`` is used as a backend map for XDP BPF helper
12+call ``bpf_redirect_map()`` and ``XDP_REDIRECT`` action, like 'devmap' and 'cpumap'.
13+This map type redirects raw XDP frames to `AF_XDP`_ sockets (XSKs), a new type of
14+address family in the kernel that allows redirection of frames from a driver to
15+user space without having to traverse the full network stack. An AF_XDP socket
16+binds to a single netdev queue. A mapping of XSKs to queues is shown below:
17+
18+.. code-block:: none
19+
20+ +---------------------------------------------------+
21+ | xsk A | xsk B | xsk C |<---+ User space
22+ =========================================================|==========
23+ | Queue 0 | Queue 1 | Queue 2 | | Kernel
24+ +---------------------------------------------------+ |
25+ | Netdev eth0 | |
26+ +---------------------------------------------------+ |
27+ | +=============+ | |
28+ | | key | xsk | | |
29+ | +---------+ +=============+ | |
30+ | | | | 0 | xsk A | | |
31+ | | | +-------------+ | |
32+ | | | | 1 | xsk B | | |
33+ | | BPF |-- redirect -->+-------------+-------------+
34+ | | prog | | 2 | xsk C | |
35+ | | | +-------------+ |
36+ | | | |
37+ | | | |
38+ | +---------+ |
39+ | |
40+ +---------------------------------------------------+
41+
42+.. note::
43+ An AF_XDP socket that is bound to a certain <netdev/queue_id> will *only*
44+ accept XDP frames from that <netdev/queue_id>. If an XDP program tries to redirect
45+ from a <netdev/queue_id> other than what the socket is bound to, the frame will
46+ not be received on the socket.
47+
48+Typically an XSKMAP is created per netdev. This map contains an array of XSK File
49+Descriptors (FDs). The number of array elements is typically set or adjusted using
50+the ``max_entries`` map parameter. For AF_XDP ``max_entries`` is equal to the number
51+of queues supported by the netdev.
52+
53+.. note::
54+ Both the map key and map value size must be 4 bytes.
55+
56+Usage
57+=====
58+
59+Kernel BPF
60+----------
61+bpf_redirect_map()
62+^^^^^^^^^^^^^^^^^^
63+.. code-block:: c
64+
65+ long bpf_redirect_map(struct bpf_map *map, u32 key, u64 flags)
66+
67+Redirect the packet to the endpoint referenced by ``map`` at index ``key``.
68+For ``BPF_MAP_TYPE_XSKMAP`` this map contains references to XSK FDs
69+for sockets attached to a netdev's queues.
70+
71+.. note::
72+ If the map is empty at an index, the packet is dropped. This means that it is
73+ necessary to have an XDP program loaded with at least one XSK in the
74+ XSKMAP to be able to get any traffic to user space through the socket.
75+
76+bpf_map_lookup_elem()
77+^^^^^^^^^^^^^^^^^^^^^
78+.. code-block:: c
79+
80+ void *bpf_map_lookup_elem(struct bpf_map *map, const void *key)
81+
82+XSK entry references of type ``struct xdp_sock *`` can be retrieved using the
83+``bpf_map_lookup_elem()`` helper.
84+
85+User space
86+----------
87+.. note::
88+ XSK entries can only be updated/deleted from user space and not from
89+ a BPF program. Trying to call these functions from a kernel BPF program will
90+ result in the program failing to load and a verifier warning.
91+
92+bpf_map_update_elem()
93+^^^^^^^^^^^^^^^^^^^^^
94+.. code-block:: c
95+
96+ int bpf_map_update_elem(int fd, const void *key, const void *value, __u64 flags)
97+
98+XSK entries can be added or updated using the ``bpf_map_update_elem()``
99+helper. The ``key`` parameter is equal to the queue_id of the queue the XSK
100+is attaching to. And the ``value`` parameter is the FD value of that socket.
101+
102+Under the hood, the XSKMAP update function uses the XSK FD value to retrieve the
103+associated ``struct xdp_sock`` instance.
104+
105+The flags argument can be one of the following:
106+
107+- BPF_ANY: Create a new element or update an existing element.
108+- BPF_NOEXIST: Create a new element only if it did not exist.
109+- BPF_EXIST: Update an existing element.
110+
111+bpf_map_lookup_elem()
112+^^^^^^^^^^^^^^^^^^^^^
113+.. code-block:: c
114+
115+ int bpf_map_lookup_elem(int fd, const void *key, void *value)
116+
117+Returns ``struct xdp_sock *`` or negative error in case of failure.
118+
119+bpf_map_delete_elem()
120+^^^^^^^^^^^^^^^^^^^^^
121+.. code-block:: c
122+
123+ int bpf_map_delete_elem(int fd, const void *key)
124+
125+XSK entries can be deleted using the ``bpf_map_delete_elem()``
126+helper. This helper will return 0 on success, or negative error in case of
127+failure.
128+
129+.. note::
130+ When `libxdp`_ deletes an XSK it also removes the associated socket
131+ entry from the XSKMAP.
132+
133+Examples
134+========
135+Kernel
136+------
137+
138+The following code snippet shows how to declare a ``BPF_MAP_TYPE_XSKMAP`` called
139+``xsks_map`` and how to redirect packets to an XSK.
140+
141+.. code-block:: c
142+
143+ struct {
144+ __uint(type, BPF_MAP_TYPE_XSKMAP);
145+ __type(key, __u32);
146+ __type(value, __u32);
147+ __uint(max_entries, 64);
148+ } xsks_map SEC(".maps");
149+
150+
151+ SEC("xdp")
152+ int xsk_redir_prog(struct xdp_md *ctx)
153+ {
154+ __u32 index = ctx->rx_queue_index;
155+
156+ if (bpf_map_lookup_elem(&xsks_map, &index))
157+ return bpf_redirect_map(&xsks_map, index, 0);
158+ return XDP_PASS;
159+ }
160+
161+User space
162+----------
163+
164+The following code snippet shows how to update an XSKMAP with an XSK entry.
165+
166+.. code-block:: c
167+
168+ int update_xsks_map(struct bpf_map *xsks_map, int queue_id, int xsk_fd)
169+ {
170+ int ret;
171+
172+ ret = bpf_map_update_elem(bpf_map__fd(xsks_map), &queue_id, &xsk_fd, 0);
173+ if (ret < 0)
174+ fprintf(stderr, "Failed to update xsks_map: %s\n", strerror(errno));
175+
176+ return ret;
177+ }
178+
179+For an example on how create AF_XDP sockets, please see the AF_XDP-example and
180+AF_XDP-forwarding programs in the `bpf-examples`_ directory in the `libxdp`_ repository.
181+For a detailed explaination of the AF_XDP interface please see:
182+
183+- `libxdp-readme`_.
184+- `AF_XDP`_ kernel documentation.
185+
186+.. note::
187+ The most comprehensive resource for using XSKMAPs and AF_XDP is `libxdp`_.
188+
189+.. _libxdp: https://github.com/xdp-project/xdp-tools/tree/master/lib/libxdp
190+.. _AF_XDP: https://www.kernel.org/doc/html/latest/networking/af_xdp.html
191+.. _bpf-examples: https://github.com/xdp-project/bpf-examples
192+.. _libxdp-readme: https://github.com/xdp-project/xdp-tools/tree/master/lib/libxdp#using-af_xdp-sockets
Documentation/bpf/maps.rst+65−36
@@ -1,52 +1,81 @@
11
2−=========
3−eBPF maps
2+========
3+BPF maps
4+========
5+
6+BPF 'maps' provide generic storage of different types for sharing data between
7+kernel and user space. There are several storage types available, including
8+hash, array, bloom filter and radix-tree. Several of the map types exist to
9+support specific BPF helpers that perform actions based on the map contents. The
10+maps are accessed from BPF programs via BPF helpers which are documented in the
11+`man-pages`_ for `bpf-helpers(7)`_.
12+
13+BPF maps are accessed from user space via the ``bpf`` syscall, which provides
14+commands to create maps, lookup elements, update elements and delete
15+elements. More details of the BPF syscall are available in
16+:doc:`/userspace-api/ebpf/syscall` and in the `man-pages`_ for `bpf(2)`_.
17+
18+Map Types
419 =========
520
6−'maps' is a generic storage of different types for sharing data between kernel
7−and userspace.
21+.. toctree::
22+ :maxdepth: 1
23+ :glob:
824
9−The maps are accessed from user space via BPF syscall, which has commands:
25+ map_*
1026
11−- create a map with given type and attributes
12− ``map_fd = bpf(BPF_MAP_CREATE, union bpf_attr *attr, u32 size)``
13− using attr->map_type, attr->key_size, attr->value_size, attr->max_entries
14− returns process-local file descriptor or negative error
27+Usage Notes
28+===========
1529
16−- lookup key in a given map
17− ``err = bpf(BPF_MAP_LOOKUP_ELEM, union bpf_attr *attr, u32 size)``
18− using attr->map_fd, attr->key, attr->value
19− returns zero and stores found elem into value or negative error
30+.. c:function::
31+ int bpf(int command, union bpf_attr *attr, u32 size)
2032
21−- create or update key/value pair in a given map
22− ``err = bpf(BPF_MAP_UPDATE_ELEM, union bpf_attr *attr, u32 size)``
23− using attr->map_fd, attr->key, attr->value
24− returns zero or negative error
33+Use the ``bpf()`` system call to perform the operation specified by
34+``command``. The operation takes parameters provided in ``attr``. The ``size``
35+argument is the size of the ``union bpf_attr`` in ``attr``.
2536
26−- find and delete element by key in a given map
27− ``err = bpf(BPF_MAP_DELETE_ELEM, union bpf_attr *attr, u32 size)``
28− using attr->map_fd, attr->key
37+**BPF_MAP_CREATE**
2938
30−- to delete map: close(fd)
31− Exiting process will delete maps automatically
39+Create a map with the desired type and attributes in ``attr``:
3240
33−userspace programs use this syscall to create/access maps that eBPF programs
34−are concurrently updating.
41+.. code-block:: c
3542
36−maps can have different types: hash, array, bloom filter, radix-tree, etc.
43+ int fd;
44+ union bpf_attr attr = {
45+ .map_type = BPF_MAP_TYPE_ARRAY; /* mandatory */
46+ .key_size = sizeof(__u32); /* mandatory */
47+ .value_size = sizeof(__u32); /* mandatory */
48+ .max_entries = 256; /* mandatory */
49+ .map_flags = BPF_F_MMAPABLE;
50+ .map_name = "example_array";
51+ };
3752
38−The map is defined by:
53+ fd = bpf(BPF_MAP_CREATE, &attr, sizeof(attr));
3954
40− - type
41− - max number of elements
42− - key size in bytes
43− - value size in bytes
55+Returns a process-local file descriptor on success, or negative error in case of
56+failure. The map can be deleted by calling ``close(fd)``. Maps held by open
57+file descriptors will be deleted automatically when a process exits.
4458
45−Map Types
46−=========
59+.. note:: Valid characters for ``map_name`` are ``A-Z``, ``a-z``, ``0-9``,
60+ ``'_'`` and ``'.'``.
4761
48−.. toctree::
49− :maxdepth: 1
50− :glob:
62+**BPF_MAP_LOOKUP_ELEM**
63+
64+Lookup key in a given map using ``attr->map_fd``, ``attr->key``,
65+``attr->value``. Returns zero and stores found elem into ``attr->value`` on
66+success, or negative error on failure.
67+
68+**BPF_MAP_UPDATE_ELEM**
69+
70+Create or update key/value pair in a given map using ``attr->map_fd``, ``attr->key``,
71+``attr->value``. Returns zero on success or negative error on failure.
72+
73+**BPF_MAP_DELETE_ELEM**
74+
75+Find and delete element by key in a given map using ``attr->map_fd``,
76+``attr->key``. Returns zero on success or negative error on failure.
5177
52− map_*
78+.. Links:
79+.. _man-pages: https://www.kernel.org/doc/man-pages/
80+.. _bpf(2): https://man7.org/linux/man-pages/man2/bpf.2.html
81+.. _bpf-helpers(7): https://man7.org/linux/man-pages/man7/bpf-helpers.7.html
Documentation/bpf/programs.rst+3−0
@@ -7,3 +7,6 @@ Program Types · 6 unmodified lines
77 :glob:
88
99 prog_*
10+
11+For a list of all program types, see :ref:`program_types_and_elf` in
12+the :ref:`libbpf` documentation.
Documentation/bpf/redirect.rst+81−0
@@ -0,0 +1,81 @@
1+.. SPDX-License-Identifier: GPL-2.0-only
2+.. Copyright (C) 2022 Red Hat, Inc.
3+
4+========
5+Redirect
6+========
7+XDP_REDIRECT
8+############
9+Supported maps
10+--------------
11+
12+XDP_REDIRECT works with the following map types:
13+
14+- ``BPF_MAP_TYPE_DEVMAP``
15+- ``BPF_MAP_TYPE_DEVMAP_HASH``
16+- ``BPF_MAP_TYPE_CPUMAP``
17+- ``BPF_MAP_TYPE_XSKMAP``
18+
19+For more information on these maps, please see the specific map documentation.
20+
21+Process
22+-------
23+
24+.. kernel-doc:: net/core/filter.c
25+ :doc: xdp redirect
26+
27+.. note::
28+ Not all drivers support transmitting frames after a redirect, and for
29+ those that do, not all of them support non-linear frames. Non-linear xdp
30+ bufs/frames are bufs/frames that contain more than one fragment.
31+
32+Debugging packet drops
33+----------------------
34+Silent packet drops for XDP_REDIRECT can be debugged using:
35+
36+- bpf_trace
37+- perf_record
38+
39+bpf_trace
40+^^^^^^^^^
41+The following bpftrace command can be used to capture and count all XDP tracepoints:
42+
43+.. code-block:: none
44+
45+ sudo bpftrace -e 'tracepoint:xdp:* { @cnt[probe] = count(); }'
46+ Attaching 12 probes...
47+ ^C
48+
49+ @cnt[tracepoint:xdp:mem_connect]: 18
50+ @cnt[tracepoint:xdp:mem_disconnect]: 18
51+ @cnt[tracepoint:xdp:xdp_exception]: 19605
52+ @cnt[tracepoint:xdp:xdp_devmap_xmit]: 1393604
53+ @cnt[tracepoint:xdp:xdp_redirect]: 22292200
54+
55+.. note::
56+ The various xdp tracepoints can be found in ``source/include/trace/events/xdp.h``
57+
58+The following bpftrace command can be used to extract the ``ERRNO`` being returned as
59+part of the err parameter:
60+
61+.. code-block:: none
62+
63+ sudo bpftrace -e \
64+ 'tracepoint:xdp:xdp_redirect*_err {@redir_errno[-args->err] = count();}
65+ tracepoint:xdp:xdp_devmap_xmit {@devmap_errno[-args->err] = count();}'
66+
67+perf record
68+^^^^^^^^^^^
69+The perf tool also supports recording tracepoints:
70+
71+.. code-block:: none
72+
73+ perf record -a -e xdp:xdp_redirect_err \
74+ -e xdp:xdp_redirect_map_err \
75+ -e xdp:xdp_exception \
76+ -e xdp:xdp_devmap_xmit
77+
78+References
79+===========
80+
81+- https://github.com/xdp-project/xdp-tutorial/tree/master/tracing02-xdp-monitor
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-wed.yaml+52−0
@@ -29,6 +29,38 @@ properties: · 28 unmodified lines
2929 interrupts:
3030 maxItems: 1
3131
32+ memory-region:
33+ items:
34+ - description: firmware EMI region
35+ - description: firmware ILM region
36+ - description: firmware DLM region
37+ - description: firmware CPU DATA region
38+ - description: firmware BOOT region
39+
40+ memory-region-names:
41+ items:
42+ - const: wo-emi
43+ - const: wo-ilm
44+ - const: wo-dlm
45+ - const: wo-data
46+ - const: wo-boot
47+
48+ mediatek,wo-ccif:
49+ $ref: /schemas/types.yaml#/definitions/phandle
50+ description: mediatek wed-wo controller interface.
51+
52+allOf:
53+ - if:
54+ properties:
55+ compatible:
56+ contains:
57+ const: mediatek,mt7622-wed
58+ then:
59+ properties:
60+ memory-region-names: false
61+ memory-region: false
62+ mediatek,wo-ccif: false
63+
3264 required:
3365 - compatible
3466 - reg
@@ -49,3 +81,23 @@ examples: · 14 unmodified lines
4981 interrupts = <GIC_SPI 214 IRQ_TYPE_LEVEL_LOW>;
5082 };
5183 };
84+
85+ - |
86+ #include <dt-bindings/interrupt-controller/arm-gic.h>
87+ #include <dt-bindings/interrupt-controller/irq.h>
88+ soc {
89+ #address-cells = <2>;
90+ #size-cells = <2>;
91+
92+ wed@15010000 {
93+ compatible = "mediatek,mt7986-wed", "syscon";
94+ reg = <0 0x15010000 0 0x1000>;
95+ interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
96+
97+ memory-region = <&wo_emi>, <&wo_ilm>, <&wo_dlm>,
98+ <&wo_data>, <&wo_boot>;
99+ memory-region-names = "wo-emi", "wo-ilm", "wo-dlm",
100+ "wo-data", "wo-boot";
101+ mediatek,wo-ccif = <&wo_ccif0>;
102+ };
103+ };
Documentation/devicetree/bindings/interrupt-controller/fsl,intmux.yaml+2−1
@@ -7,7 +7,8 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Freescale INTMUX interrupt multiplexer
88
99 maintainers:
10− - Joakim Zhang <qiangqing.zhang@nxp.com>
10+ - Shawn Guo <shawnguo@kernel.org>
11+ - NXP Linux Team <linux-imx@nxp.com>
1112
1213 properties:
1314 compatible:
Documentation/devicetree/bindings/net/adi,adin1110.yaml+4−0
@@ -46,6 +46,10 @@ properties: · 45 unmodified lines
4646 interrupts:
4747 maxItems: 1
4848
49+ reset-gpios:
50+ maxItems: 1
51+ description: GPIO connected to active low reset
52+
4953 required:
5054 - compatible
5155 - reg
Documentation/devicetree/bindings/net/asix,ax88178.yaml+3−1
@@ -27,7 +27,9 @@ properties: · 26 unmodified lines
2727 - usbb95,772b # ASIX AX88772B
2828 - usbb95,7e2b # ASIX AX88772B
2929
30− reg: true
30+ reg:
31+ maxItems: 1
32+
3133 local-mac-address: true
3234 mac-address: true
3335
Documentation/devicetree/bindings/net/bluetooth.txt+0−5
@@ -1,5 +0,0 @@
1−The following properties are common to the Bluetooth controllers:
2−
3−- local-bd-address: array of 6 bytes, specifies the BD address that was
4− uniquely assigned to the Bluetooth device, formatted with least significant
5− byte first (little-endian).
Documentation/devicetree/bindings/net/bluetooth/bluetooth-controller.yaml+29−0
@@ -0,0 +1,29 @@
1+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/net/bluetooth/bluetooth-controller.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Bluetooth Controller Generic Binding
8+
9+maintainers:
10+ - Marcel Holtmann <marcel@holtmann.org>
11+ - Johan Hedberg <johan.hedberg@gmail.com>
12+ - Luiz Augusto von Dentz <luiz.dentz@gmail.com>
13+
14+properties:
15+ $nodename:
16+ pattern: "^bluetooth(@.*)?$"
17+
18+ local-bd-address:
19+ $ref: /schemas/types.yaml#/definitions/uint8-array
20+ maxItems: 6
21+ description:
22+ Specifies the BD address that was uniquely assigned to the Bluetooth
23+ device. Formatted with least significant byte first (little-endian), e.g.
24+ in order to assign the address 00:11:22:33:44:55 this property must have
25+ the value [55 44 33 22 11 00].
26+
27+additionalProperties: true
28+
29+...
Documentation/devicetree/bindings/net/bluetooth/brcm,bcm4377-bluetooth.yaml+81−0
@@ -0,0 +1,81 @@
1+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/net/bluetooth/brcm,bcm4377-bluetooth.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Broadcom BCM4377 family PCIe Bluetooth Chips
8+
9+maintainers:
10+ - Sven Peter <sven@svenpeter.dev>
11+
12+description:
13+ This binding describes Broadcom BCM4377 family PCIe-attached bluetooth chips
14+ usually found in Apple machines. The Wi-Fi part of the chip is described in
15+ bindings/net/wireless/brcm,bcm4329-fmac.yaml.
16+
17+allOf:
18+ - $ref: bluetooth-controller.yaml#
19+
20+properties:
21+ compatible:
22+ enum:
23+ - pci14e4,5fa0 # BCM4377
24+ - pci14e4,5f69 # BCM4378
25+ - pci14e4,5f71 # BCM4387
26+
27+ reg:
28+ maxItems: 1
29+
30+ brcm,board-type:
31+ $ref: /schemas/types.yaml#/definitions/string
32+ description: Board type of the Bluetooth chip. This is used to decouple
33+ the overall system board from the Bluetooth module and used to construct
34+ firmware and calibration data filenames.
35+ On Apple platforms, this should be the Apple module-instance codename
36+ prefixed by "apple,", e.g. "apple,atlantisb".
37+ pattern: '^apple,.*'
38+
39+ brcm,taurus-cal-blob:
40+ $ref: /schemas/types.yaml#/definitions/uint8-array
41+ description: A per-device calibration blob for the Bluetooth radio. This
42+ should be filled in by the bootloader from platform configuration
43+ data, if necessary, and will be uploaded to the device.
44+ This blob is used if the chip stepping of the Bluetooth module does not
45+ support beamforming.
46+
47+ brcm,taurus-bf-cal-blob:
48+ $ref: /schemas/types.yaml#/definitions/uint8-array
49+ description: A per-device calibration blob for the Bluetooth radio. This
50+ should be filled in by the bootloader from platform configuration
51+ data, if necessary, and will be uploaded to the device.
52+ This blob is used if the chip stepping of the Bluetooth module supports
53+ beamforming.
54+
55+ local-bd-address: true
56+
57+required:
58+ - compatible
59+ - reg
60+ - local-bd-address
61+ - brcm,board-type
62+
63+additionalProperties: false
64+
65+examples:
66+ - |
67+ pcie@a0000000 {
68+ #address-cells = <3>;
69+ #size-cells = <2>;
70+ reg = <0xa0000000 0x1000000>;
71+ device_type = "pci";
72+ ranges = <0x43000000 0x6 0xa0000000 0xa0000000 0x0 0x20000000>;
73+
74+ bluetooth@0,1 {
75+ compatible = "pci14e4,5f69";
76+ reg = <0x100 0x0 0x0 0x0 0x0>;
77+ brcm,board-type = "apple,honshu";
78+ /* To be filled by the bootloader */
79+ local-bd-address = [00 00 00 00 00 00];
80+ };
81+ };
Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yamlrenamed from Documentation/devicetree/bindings/net/qualcomm-bluetooth.yaml+3−3
@@ -1,7 +1,7 @@
11 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
22 %YAML 1.2
33 ---
4−$id: http://devicetree.org/schemas/net/qualcomm-bluetooth.yaml#
4+$id: http://devicetree.org/schemas/net/bluetooth/qualcomm-bluetooth.yaml#
55 $schema: http://devicetree.org/meta-schemas/core.yaml#
66
77 title: Qualcomm Bluetooth Chips
@@ -79,8 +79,7 @@ properties: · 71 unmodified lines
7979 firmware-name:
8080 description: specify the name of nvm firmware to load
8181
82− local-bd-address:
83− description: see Documentation/devicetree/bindings/net/bluetooth.txt
82+ local-bd-address: true
8483
8584
8685 required:
@@ -89,6 +88,7 @@ required: · 2 unmodified lines
8988 additionalProperties: false
9089
9190 allOf:
91+ - $ref: bluetooth-controller.yaml#
9292 - if:
9393 properties:
9494 compatible:
Documentation/devicetree/bindings/net/broadcom-bluetooth.yaml+3−0
@@ -19,11 +19,14 @@ properties: · 18 unmodified lines
1919 - brcm,bcm4329-bt
2020 - brcm,bcm4330-bt
2121 - brcm,bcm4334-bt
22+ - brcm,bcm43430a0-bt
23+ - brcm,bcm43430a1-bt
2224 - brcm,bcm43438-bt
2325 - brcm,bcm4345c5
2426 - brcm,bcm43540-bt
2527 - brcm,bcm4335a0
2628 - brcm,bcm4349-bt
29+ - cypress,cyw4373a0-bt
2730 - infineon,cyw55572-bt
2831
2932 shutdown-gpios:
Documentation/devicetree/bindings/net/can/fsl,flexcan.yaml+1−0
@@ -17,6 +17,7 @@ properties: · 16 unmodified lines
1717 compatible:
1818 oneOf:
1919 - enum:
20+ - fsl,imx93-flexcan
2021 - fsl,imx8qm-flexcan
2122 - fsl,imx8mp-flexcan
2223 - fsl,imx6q-flexcan
Documentation/devicetree/bindings/net/can/renesas,rcar-canfd.yaml+73−62
@@ -9,9 +9,6 @@ title: Renesas R-Car CAN FD Controller · 8 unmodified lines
99 maintainers:
1010 - Fabrizio Castro <fabrizio.castro.jz@renesas.com>
1111
12−allOf:
13− - $ref: can-controller.yaml#
14−
1512 properties:
1613 compatible:
1714 oneOf:
@@ -33,7 +30,7 @@ properties: · 15 unmodified lines
3330
3431 - items:
3532 - enum:
36− - renesas,r9a07g043-canfd # RZ/G2UL
33+ - renesas,r9a07g043-canfd # RZ/G2UL and RZ/Five
3734 - renesas,r9a07g044-canfd # RZ/G2{L,LC}
3835 - renesas,r9a07g054-canfd # RZ/V2L
3936 - const: renesas,rzg2l-canfd # RZ/G2L family
@@ -77,12 +74,13 @@ properties: · 37 unmodified lines
7774 description: Maximum frequency of the CANFD clock.
7875
7976 patternProperties:
80− "^channel[01]$":
77+ "^channel[0-7]$":
8178 type: object
8279 description:
83− The controller supports two channels and each is represented as a child
84− node. Each child node supports the "status" property only, which
85− is used to enable/disable the respective channel.
80+ The controller supports multiple channels and each is represented as a
81+ child node. Each channel can be enabled/disabled individually.
82+
83+ additionalProperties: false
8684
8785 required:
8886 - compatible
@@ -98,60 +96,73 @@ required: · 9 unmodified lines
9896 - channel0
9997 - channel1
10098
101−if:
102− properties:
103− compatible:
104− contains:
105− enum:
106− - renesas,rzg2l-canfd
107−then:
108− properties:
109− interrupts:
110− items:
111− - description: CAN global error interrupt
112− - description: CAN receive FIFO interrupt
113− - description: CAN0 error interrupt
114− - description: CAN0 transmit interrupt
115− - description: CAN0 transmit/receive FIFO receive completion interrupt
116− - description: CAN1 error interrupt
117− - description: CAN1 transmit interrupt
118− - description: CAN1 transmit/receive FIFO receive completion interrupt
119−
120− interrupt-names:
121− items:
122− - const: g_err
123− - const: g_recc
124− - const: ch0_err
125− - const: ch0_rec
126− - const: ch0_trx
127− - const: ch1_err
128− - const: ch1_rec
129− - const: ch1_trx
130−
131− resets:
132− maxItems: 2
133−
134− reset-names:
135− items:
136− - const: rstp_n
137− - const: rstc_n
138−
139− required:
140− - reset-names
141−else:
142− properties:
143− interrupts:
144− items:
145− - description: Channel interrupt
146− - description: Global interrupt
147−
148− interrupt-names:
149− items:
150− - const: ch_int
151− - const: g_int
152−
153− resets:
154− maxItems: 1
99+allOf:
100+ - $ref: can-controller.yaml#
101+
102+ - if:
103+ properties:
104+ compatible:
105+ contains:
106+ enum:
107+ - renesas,rzg2l-canfd
108+ then:
109+ properties:
110+ interrupts:
111+ items:
112+ - description: CAN global error interrupt
113+ - description: CAN receive FIFO interrupt
114+ - description: CAN0 error interrupt
115+ - description: CAN0 transmit interrupt
116+ - description: CAN0 transmit/receive FIFO receive completion interrupt
117+ - description: CAN1 error interrupt
118+ - description: CAN1 transmit interrupt
119+ - description: CAN1 transmit/receive FIFO receive completion interrupt
120+
121+ interrupt-names:
122+ items:
123+ - const: g_err
124+ - const: g_recc
125+ - const: ch0_err
126+ - const: ch0_rec
127+ - const: ch0_trx
128+ - const: ch1_err
129+ - const: ch1_rec
130+ - const: ch1_trx
131+
132+ resets:
133+ maxItems: 2
134+
135+ reset-names:
136+ items:
137+ - const: rstp_n
138+ - const: rstc_n
139+
140+ required:
141+ - reset-names
142+ else:
143+ properties:
144+ interrupts:
145+ items:
146+ - description: Channel interrupt
147+ - description: Global interrupt
148+
149+ interrupt-names:
150+ items:
151+ - const: ch_int
152+ - const: g_int
153+
154+ resets:
155+ maxItems: 1
156+
157+ - if:
158+ not:
159+ properties:
160+ compatible:
161+ contains:
162+ const: renesas,r8a779a0-canfd
163+ then:
164+ patternProperties:
165+ "^channel[2-7]$": false
155166
156167 unevaluatedProperties: false
157168
Documentation/devicetree/bindings/net/dsa/dsa-port.yaml+2−1
@@ -19,7 +19,8 @@ allOf: · 18 unmodified lines
1919
2020 properties:
2121 reg:
22− description: Port number
22+ items:
23+ - description: Port number
2324
2425 label:
2526 description:
Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml+1−1
@@ -12,7 +12,7 @@ allOf: · 11 unmodified lines
1212 maintainers:
1313 - Andrew Lunn <andrew@lunn.ch>
1414 - Florian Fainelli <f.fainelli@gmail.com>
15− - Vivien Didelot <vivien.didelot@gmail.com>
15+ - Vladimir Oltean <olteanv@gmail.com>
1616 - Kurt Kanzenbach <kurt@linutronix.de>
1717
1818 description:
Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml+1−1
@@ -74,10 +74,10 @@ properties: · 73 unmodified lines
7474
7575 properties:
7676 pcs-handle:
77+ maxItems: 1
7778 description:
7879 phandle pointing to a PCS sub-node compatible with
7980 renesas,rzn1-miic.yaml#
80− $ref: /schemas/types.yaml#/definitions/phandle
8181
8282 unevaluatedProperties: false
8383
Documentation/devicetree/bindings/net/ethernet-controller.yaml+10−1
@@ -108,11 +108,17 @@ properties: · 107 unmodified lines
108108 $ref: "#/properties/phy-connection-type"
109109
110110 pcs-handle:
111− $ref: /schemas/types.yaml#/definitions/phandle
111+ $ref: /schemas/types.yaml#/definitions/phandle-array
112+ items:
113+ maxItems: 1
112114 description:
113115 Specifies a reference to a node representing a PCS PHY device on a MDIO
114116 bus to link with an external PHY (phy-handle) if exists.
115117
118+ pcs-handle-names:
119+ description:
120+ The name of each PCS in pcs-handle.
121+
116122 phy-handle:
117123 $ref: /schemas/types.yaml#/definitions/phandle
118124 description:
@@ -216,6 +222,9 @@ properties: · 97 unmodified lines
216222 required:
217223 - speed
218224
225+dependencies:
226+ pcs-handle-names: [pcs-handle]
227+
219228 allOf:
220229 - if:
221230 properties:
Documentation/devicetree/bindings/net/fsl,fec.yaml+3−1
@@ -7,7 +7,9 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: Freescale Fast Ethernet Controller (FEC)
88
99 maintainers:
10− - Joakim Zhang <qiangqing.zhang@nxp.com>
10+ - Shawn Guo <shawnguo@kernel.org>
11+ - Wei Fang <wei.fang@nxp.com>
12+ - NXP Linux Team <linux-imx@nxp.com>
1113
1214 allOf:
1315 - $ref: ethernet-controller.yaml#
Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml+40−13
@@ -85,9 +85,39 @@ properties: · 84 unmodified lines
8585 $ref: /schemas/types.yaml#/definitions/phandle
8686 description: A reference to the IEEE1588 timer
8787
88+ phys:
89+ description: A reference to the SerDes lane(s)
90+ maxItems: 1
91+
92+ phy-names:
93+ items:
94+ - const: serdes
95+
8896 pcsphy-handle:
89− $ref: /schemas/types.yaml#/definitions/phandle
90− description: A reference to the PCS (typically found on the SerDes)
97+ $ref: /schemas/types.yaml#/definitions/phandle-array
98+ minItems: 1
99+ maxItems: 3
100+ deprecated: true
101+ description: See pcs-handle.
102+
103+ pcs-handle:
104+ minItems: 1
105+ maxItems: 3
106+ description: |
107+ A reference to the various PCSs (typically found on the SerDes). If
108+ pcs-handle-names is absent, and phy-connection-type is "xgmii", then the first
109+ reference will be assumed to be for "xfi". Otherwise, if pcs-handle-names is
110+ absent, then the first reference will be assumed to be for "sgmii".
111+
112+ pcs-handle-names:
113+ minItems: 1
114+ maxItems: 3
115+ items:
116+ enum:
117+ - sgmii
118+ - qsgmii
119+ - xfi
120+ description: The type of each PCS in pcsphy-handle.
91121
92122 tbi-handle:
93123 $ref: /schemas/types.yaml#/definitions/phandle
@@ -100,6 +130,10 @@ required: · 6 unmodified lines
100130 - fsl,fman-ports
101131 - ptp-timer
102132
133+dependencies:
134+ pcs-handle-names:
135+ - pcs-handle
136+
103137 allOf:
104138 - $ref: ethernet-controller.yaml#
105139 - if:
@@ -110,14 +144,6 @@ allOf: · 4 unmodified lines
110144 then:
111145 required:
112146 - tbi-handle
113− - if:
114− properties:
115− compatible:
116− contains:
117− const: fsl,fman-memac
118− then:
119− required:
120− - pcsphy-handle
121147
122148 unevaluatedProperties: false
123149
@@ -138,8 +164,9 @@ examples: · 14 unmodified lines
138164 reg = <0xe8000 0x1000>;
139165 fsl,fman-ports = <&fman0_rx_0x0c &fman0_tx_0x2c>;
140166 ptp-timer = <&ptp_timer0>;
141− pcsphy-handle = <&pcsphy4>;
142− phy-handle = <&sgmii_phy1>;
143− phy-connection-type = "sgmii";
167+ pcs-handle = <&pcsphy4>, <&qsgmiib_pcs1>;
168+ pcs-handle-names = "sgmii", "qsgmii";
169+ phys = <&serdes1 1>;
170+ phy-names = "serdes";
144171 };
145172 ...
Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml+1−1
@@ -31,7 +31,7 @@ properties: · 30 unmodified lines
3131 phy-mode: true
3232
3333 pcs-handle:
34− $ref: /schemas/types.yaml#/definitions/phandle
34+ maxItems: 1
3535 description:
3636 A reference to a node representing a PCS PHY device found on
3737 the internal MDIO bus.
Documentation/devicetree/bindings/net/fsl-fman.txt+3−2
@@ -320,8 +320,9 @@ For internal PHY device on internal mdio bus, a PHY node should be created. · 319 unmodified lines
320320 See the definition of the PHY node in booting-without-of.txt for an
321321 example of how to define a PHY (Internal PHY has no interrupt line).
322322 - For "fsl,fman-mdio" compatible internal mdio bus, the PHY is TBI PHY.
323−- For "fsl,fman-memac-mdio" compatible internal mdio bus, the PHY is PCS PHY,
324− PCS PHY addr must be '0'.
323+- For "fsl,fman-memac-mdio" compatible internal mdio bus, the PHY is PCS PHY.
324+ The PCS PHY address should correspond to the value of the appropriate
325+ MDEV_PORT.
325326
326327 EXAMPLE
327328
Documentation/devicetree/bindings/net/marvell,dfx-server.yaml+62−0
@@ -0,0 +1,62 @@
1+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/net/marvell,dfx-server.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Marvell Prestera DFX server
8+
9+maintainers:
10+ - Miquel Raynal <miquel.raynal@bootlin.com>
11+
12+select:
13+ properties:
14+ compatible:
15+ contains:
16+ const: marvell,dfx-server
17+ required:
18+ - compatible
19+
20+properties:
21+ compatible:
22+ items:
23+ - const: marvell,dfx-server
24+ - const: simple-bus
25+
26+ reg:
27+ maxItems: 1
28+
29+ ranges: true
30+
31+ '#address-cells':
32+ const: 1
33+
34+ '#size-cells':
35+ const: 1
36+
37+required:
38+ - compatible
39+ - reg
40+ - ranges
41+
42+# The DFX server may expose clocks described as subnodes
43+additionalProperties:
44+ type: object
45+
46+examples:
47+ - |
48+
49+ #define MBUS_ID(target,attributes) (((target) << 24) | ((attributes) << 16))
50+ bus@0 {
51+ reg = <0 0>;
52+ #address-cells = <2>;
53+ #size-cells = <1>;
54+
55+ dfx-bus@ac000000 {
56+ compatible = "marvell,dfx-server", "simple-bus";
57+ #address-cells = <1>;
58+ #size-cells = <1>;
59+ ranges = <0 MBUS_ID(0x08, 0x00) 0 0x100000>;
60+ reg = <MBUS_ID(0x08, 0x00) 0 0x100000>;
61+ };
62+ };
Documentation/devicetree/bindings/net/marvell,pp2.yaml+305−0
@@ -0,0 +1,305 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/net/marvell,pp2.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Marvell CN913X / Marvell Armada 375, 7K, 8K Ethernet Controller
8+
9+maintainers:
10+ - Marcin Wojtas <mw@semihalf.com>
11+ - Russell King <linux@armlinux.org>
12+
13+description: |
14+ Marvell Armada 375 Ethernet Controller (PPv2.1)
15+ Marvell Armada 7K/8K Ethernet Controller (PPv2.2)
16+ Marvell CN913X Ethernet Controller (PPv2.3)
17+
18+properties:
19+ compatible:
20+ enum:
21+ - marvell,armada-375-pp2
22+ - marvell,armada-7k-pp22
23+
24+ reg:
25+ minItems: 3
26+ maxItems: 4
27+
28+ "#address-cells":
29+ const: 1
30+
31+ "#size-cells":
32+ const: 0
33+
34+ clocks:
35+ minItems: 2
36+ items:
37+ - description: main controller clock
38+ - description: GOP clock
39+ - description: MG clock
40+ - description: MG Core clock
41+ - description: AXI clock
42+
43+ clock-names:
44+ minItems: 2
45+ items:
46+ - const: pp_clk
47+ - const: gop_clk
48+ - const: mg_clk
49+ - const: mg_core_clk
50+ - const: axi_clk
51+
52+ dma-coherent: true
53+
54+ marvell,system-controller:
55+ $ref: /schemas/types.yaml#/definitions/phandle
56+ description: a phandle to the system controller.
57+
58+patternProperties:
59+ '^(ethernet-)?port@[0-2]$':
60+ type: object
61+ description: subnode for each ethernet port.
62+ $ref: ethernet-controller.yaml#
63+ unevaluatedProperties: false
64+
65+ properties:
66+ reg:
67+ description: ID of the port from the MAC point of view.
68+ maximum: 2
69+
70+ interrupts:
71+ minItems: 1
72+ maxItems: 10
73+ description: interrupt(s) for the port
74+
75+ interrupt-names:
76+ minItems: 1
77+ items:
78+ - const: hif0
79+ - const: hif1
80+ - const: hif2
81+ - const: hif3
82+ - const: hif4
83+ - const: hif5
84+ - const: hif6
85+ - const: hif7
86+ - const: hif8
87+ - const: link
88+
89+ description: >
90+ if more than a single interrupt for is given, must be the
91+ name associated to the interrupts listed. Valid names are:
92+ "hifX", with X in [0..8], and "link". The names "tx-cpu0",
93+ "tx-cpu1", "tx-cpu2", "tx-cpu3" and "rx-shared" are supported
94+ for backward compatibility but shouldn't be used for new
95+ additions.
96+
97+ phys:
98+ minItems: 1
99+ maxItems: 2
100+ description: >
101+ Generic PHY, providing SerDes connectivity. For most modes,
102+ one lane is sufficient, but some (e.g. RXAUI) may require two.
103+
104+ phy-mode:
105+ enum:
106+ - gmii
107+ - sgmii
108+ - rgmii-id
109+ - 1000base-x
110+ - 2500base-x
111+ - 5gbase-r
112+ - rxaui
113+ - 10gbase-r
114+
115+ port-id:
116+ $ref: /schemas/types.yaml#/definitions/uint32
117+ deprecated: true
118+ description: >
119+ ID of the port from the MAC point of view.
120+ Legacy binding for backward compatibility.
121+
122+ marvell,loopback:
123+ $ref: /schemas/types.yaml#/definitions/flag
124+ description: port is loopback mode.
125+
126+ gop-port-id:
127+ $ref: /schemas/types.yaml#/definitions/uint32
128+ description: >
129+ only for marvell,armada-7k-pp22, ID of the port from the
130+ GOP (Group Of Ports) point of view. This ID is used to index the
131+ per-port registers in the second register area.
132+
133+ required:
134+ - reg
135+ - interrupts
136+ - phy-mode
137+ - port-id
138+
139+required:
140+ - compatible
141+ - reg
142+ - clocks
143+ - clock-names
144+
145+allOf:
146+ - if:
147+ properties:
148+ compatible:
149+ const: marvell,armada-7k-pp22
150+ then:
151+ properties:
152+ reg:
153+ items:
154+ - description: Packet Processor registers
155+ - description: Networking interfaces registers
156+ - description: CM3 address space used for TX Flow Control
157+
158+ clocks:
159+ minItems: 5
160+
161+ clock-names:
162+ minItems: 5
163+
164+ patternProperties:
165+ '^(ethernet-)?port@[0-2]$':
166+ required:
167+ - gop-port-id
168+
169+ required:
170+ - marvell,system-controller
171+ else:
172+ properties:
173+ reg:
174+ items:
175+ - description: Packet Processor registers
176+ - description: LMS registers
177+ - description: Register area per eth0
178+ - description: Register area per eth1
179+
180+ clocks:
181+ maxItems: 2
182+
183+ clock-names:
184+ maxItems: 2
185+
186+ patternProperties:
187+ '^(ethernet-)?port@[0-1]$':
188+ properties:
189+ reg:
190+ maximum: 1
191+
192+ gop-port-id: false
193+
194+additionalProperties: false
195+
196+examples:
197+ - |
198+ // For Armada 375 variant
199+ #include <dt-bindings/interrupt-controller/mvebu-icu.h>
200+ #include <dt-bindings/interrupt-controller/arm-gic.h>
201+
202+ ethernet@f0000 {
203+ #address-cells = <1>;
204+ #size-cells = <0>;
205+ compatible = "marvell,armada-375-pp2";
206+ reg = <0xf0000 0xa000>,
207+ <0xc0000 0x3060>,
208+ <0xc4000 0x100>,
209+ <0xc5000 0x100>;
210+ clocks = <&gateclk 3>, <&gateclk 19>;
211+ clock-names = "pp_clk", "gop_clk";
212+
213+ ethernet-port@0 {
214+ interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
215+ reg = <0>;
216+ port-id = <0>; /* For backward compatibility. */
217+ phy = <&phy0>;
218+ phy-mode = "rgmii-id";
219+ };
220+
221+ ethernet-port@1 {
222+ interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
223+ reg = <1>;
224+ port-id = <1>; /* For backward compatibility. */
225+ phy = <&phy3>;
226+ phy-mode = "gmii";
227+ };
228+ };
229+
230+ - |
231+ // For Armada 7k/8k and Cn913x variants
232+ #include <dt-bindings/interrupt-controller/mvebu-icu.h>
233+ #include <dt-bindings/interrupt-controller/arm-gic.h>
234+
235+ ethernet@0 {
236+ #address-cells = <1>;
237+ #size-cells = <0>;
238+ compatible = "marvell,armada-7k-pp22";
239+ reg = <0x0 0x100000>, <0x129000 0xb000>, <0x220000 0x800>;
240+ clocks = <&cp0_clk 1 3>, <&cp0_clk 1 9>,
241+ <&cp0_clk 1 5>, <&cp0_clk 1 6>, <&cp0_clk 1 18>;
242+ clock-names = "pp_clk", "gop_clk", "mg_clk", "mg_core_clk", "axi_clk";
243+ marvell,system-controller = <&cp0_syscon0>;
244+
245+ ethernet-port@0 {
246+ interrupts = <ICU_GRP_NSR 39 IRQ_TYPE_LEVEL_HIGH>,
247+ <ICU_GRP_NSR 43 IRQ_TYPE_LEVEL_HIGH>,
248+ <ICU_GRP_NSR 47 IRQ_TYPE_LEVEL_HIGH>,
249+ <ICU_GRP_NSR 51 IRQ_TYPE_LEVEL_HIGH>,
250+ <ICU_GRP_NSR 55 IRQ_TYPE_LEVEL_HIGH>,
251+ <ICU_GRP_NSR 59 IRQ_TYPE_LEVEL_HIGH>,
252+ <ICU_GRP_NSR 63 IRQ_TYPE_LEVEL_HIGH>,
253+ <ICU_GRP_NSR 67 IRQ_TYPE_LEVEL_HIGH>,
254+ <ICU_GRP_NSR 71 IRQ_TYPE_LEVEL_HIGH>,
255+ <ICU_GRP_NSR 129 IRQ_TYPE_LEVEL_HIGH>;
256+ interrupt-names = "hif0", "hif1", "hif2", "hif3", "hif4",
257+ "hif5", "hif6", "hif7", "hif8", "link";
258+ phy-mode = "10gbase-r";
259+ phys = <&cp0_comphy4 0>;
260+ reg = <0>;
261+ port-id = <0>; /* For backward compatibility. */
262+ gop-port-id = <0>;
263+ };
264+
265+ ethernet-port@1 {
266+ interrupts = <ICU_GRP_NSR 40 IRQ_TYPE_LEVEL_HIGH>,
267+ <ICU_GRP_NSR 44 IRQ_TYPE_LEVEL_HIGH>,
268+ <ICU_GRP_NSR 48 IRQ_TYPE_LEVEL_HIGH>,
269+ <ICU_GRP_NSR 52 IRQ_TYPE_LEVEL_HIGH>,
270+ <ICU_GRP_NSR 56 IRQ_TYPE_LEVEL_HIGH>,
271+ <ICU_GRP_NSR 60 IRQ_TYPE_LEVEL_HIGH>,
272+ <ICU_GRP_NSR 64 IRQ_TYPE_LEVEL_HIGH>,
273+ <ICU_GRP_NSR 68 IRQ_TYPE_LEVEL_HIGH>,
274+ <ICU_GRP_NSR 72 IRQ_TYPE_LEVEL_HIGH>,
275+ <ICU_GRP_NSR 128 IRQ_TYPE_LEVEL_HIGH>;
276+ interrupt-names = "hif0", "hif1", "hif2", "hif3", "hif4",
277+ "hif5", "hif6", "hif7", "hif8", "link";
278+ phy-mode = "rgmii-id";
279+ reg = <1>;
280+ port-id = <1>; /* For backward compatibility. */
281+ gop-port-id = <2>;
282+ };
283+
284+ ethernet-port@2 {
285+ interrupts = <ICU_GRP_NSR 41 IRQ_TYPE_LEVEL_HIGH>,
286+ <ICU_GRP_NSR 45 IRQ_TYPE_LEVEL_HIGH>,
287+ <ICU_GRP_NSR 49 IRQ_TYPE_LEVEL_HIGH>,
288+ <ICU_GRP_NSR 53 IRQ_TYPE_LEVEL_HIGH>,
289+ <ICU_GRP_NSR 57 IRQ_TYPE_LEVEL_HIGH>,
290+ <ICU_GRP_NSR 61 IRQ_TYPE_LEVEL_HIGH>,
291+ <ICU_GRP_NSR 65 IRQ_TYPE_LEVEL_HIGH>,
292+ <ICU_GRP_NSR 69 IRQ_TYPE_LEVEL_HIGH>,
293+ <ICU_GRP_NSR 73 IRQ_TYPE_LEVEL_HIGH>,
294+ <ICU_GRP_NSR 127 IRQ_TYPE_LEVEL_HIGH>;
295+ interrupt-names = "hif0", "hif1", "hif2", "hif3", "hif4",
296+ "hif5", "hif6", "hif7", "hif8", "link";
297+ phy-mode = "2500base-x";
298+ managed = "in-band-status";
299+ phys = <&cp0_comphy5 2>;
300+ sfp = <&sfp_eth3>;
301+ reg = <2>;
302+ port-id = <2>; /* For backward compatibility. */
303+ gop-port-id = <3>;
304+ };
305+ };
Documentation/devicetree/bindings/net/marvell,prestera.txt+0−81
@@ -1,81 +0,0 @@
1−Marvell Prestera Switch Chip bindings
2−-------------------------------------
3−
4−Required properties:
5−- compatible: must be "marvell,prestera" and one of the following
6− "marvell,prestera-98dx3236",
7− "marvell,prestera-98dx3336",
8− "marvell,prestera-98dx4251",
9−- reg: address and length of the register set for the device.
10−- interrupts: interrupt for the device
11−
12−Optional properties:
13−- dfx: phandle reference to the "DFX Server" node
14−
15−Example:
16−
17−switch {
18− compatible = "simple-bus";
19− #address-cells = <1>;
20− #size-cells = <1>;
21− ranges = <0 MBUS_ID(0x03, 0x00) 0 0x100000>;
22−
23− packet-processor@0 {
24− compatible = "marvell,prestera-98dx3236", "marvell,prestera";
25− reg = <0 0x4000000>;
26− interrupts = <33>, <34>, <35>;
27− dfx = <&dfx>;
28− };
29−};
30−
31−DFX Server bindings
32−-------------------
33−
34−Required properties:
35−- compatible: must be "marvell,dfx-server", "simple-bus"
36−- ranges: describes the address mapping of a memory-mapped bus.
37−- reg: address and length of the register set for the device.
38−
39−Example:
40−
41−dfx-server {
42− compatible = "marvell,dfx-server", "simple-bus";
43− #address-cells = <1>;
44− #size-cells = <1>;
45− ranges = <0 MBUS_ID(0x08, 0x00) 0 0x100000>;
46− reg = <MBUS_ID(0x08, 0x00) 0 0x100000>;
47−};
48−
49−Marvell Prestera SwitchDev bindings
50−-----------------------------------
51−Optional properties:
52−- compatible: must be "marvell,prestera"
53−- base-mac-provider: describes handle to node which provides base mac address,
54− might be a static base mac address or nvme cell provider.
55−
56−Example:
57−
58−eeprom_mac_addr: eeprom-mac-addr {
59− compatible = "eeprom,mac-addr-cell";
60− status = "okay";
61−
62− nvmem = <&eeprom_at24>;
63−};
64−
65−prestera {
66− compatible = "marvell,prestera";
67− status = "okay";
68−
69− base-mac-provider = <&eeprom_mac_addr>;
70−};
71−
72−The current implementation of Prestera Switchdev PCI interface driver requires
73−that BAR2 is assigned to 0xf6000000 as base address from the PCI IO range:
74−
75−&cp0_pcie0 {
76− ranges = <0x81000000 0x0 0xfb000000 0x0 0xfb000000 0x0 0xf0000
77− 0x82000000 0x0 0xf6000000 0x0 0xf6000000 0x0 0x2000000
78− 0x82000000 0x0 0xf9000000 0x0 0xf9000000 0x0 0x100000>;
79− phys = <&cp0_comphy0 0>;
80− status = "okay";
81−};
Documentation/devicetree/bindings/net/marvell,prestera.yaml+91−0
@@ -0,0 +1,91 @@
1+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/net/marvell,prestera.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Marvell Prestera switch family
8+
9+maintainers:
10+ - Miquel Raynal <miquel.raynal@bootlin.com>
11+
12+properties:
13+ compatible:
14+ oneOf:
15+ - items:
16+ - enum:
17+ - marvell,prestera-98dx3236
18+ - marvell,prestera-98dx3336
19+ - marvell,prestera-98dx4251
20+ - const: marvell,prestera
21+ - enum:
22+ - pci11ab,c804
23+ - pci11ab,c80c
24+ - pci11ab,cc1e
25+
26+ reg:
27+ maxItems: 1
28+
29+ interrupts:
30+ maxItems: 3
31+
32+ dfx:
33+ description: Reference to the DFX Server bus node.
34+ $ref: /schemas/types.yaml#/definitions/phandle
35+
36+ nvmem-cells: true
37+
38+ nvmem-cell-names: true
39+
40+if:
41+ properties:
42+ compatible:
43+ contains:
44+ const: marvell,prestera
45+
46+# Memory mapped AlleyCat3 family
47+then:
48+ properties:
49+ nvmem-cells: false
50+ nvmem-cell-names: false
51+ required:
52+ - interrupts
53+
54+# PCI Aldrin family
55+else:
56+ properties:
57+ interrupts: false
58+ dfx: false
59+
60+required:
61+ - compatible
62+ - reg
63+
64+# Ports can also be described
65+additionalProperties:
66+ type: object
67+
68+examples:
69+ - |
70+ packet-processor@0 {
71+ compatible = "marvell,prestera-98dx3236", "marvell,prestera";
72+ reg = <0 0x4000000>;
73+ interrupts = <33>, <34>, <35>;
74+ dfx = <&dfx>;
75+ };
76+
77+ - |
78+ pcie@0 {
79+ #address-cells = <3>;
80+ #size-cells = <2>;
81+ ranges = <0x0 0x0 0x0 0x0 0x0 0x0>;
82+ reg = <0x0 0x0 0x0 0x0 0x0 0x0>;
83+ device_type = "pci";
84+
85+ switch@0,0 {
86+ reg = <0x0 0x0 0x0 0x0 0x0>;
87+ compatible = "pci11ab,c80c";
88+ nvmem-cells = <&mac_address 0>;
89+ nvmem-cell-names = "mac-address";
90+ };
91+ };
Documentation/devicetree/bindings/net/marvell-pp2.txt+0−141
@@ -1,141 +0,0 @@
1−* Marvell Armada 375 Ethernet Controller (PPv2.1)
2− Marvell Armada 7K/8K Ethernet Controller (PPv2.2)
3− Marvell CN913X Ethernet Controller (PPv2.3)
4−
5−Required properties:
6−
7−- compatible: should be one of:
8− "marvell,armada-375-pp2"
9− "marvell,armada-7k-pp2"
10−- reg: addresses and length of the register sets for the device.
11− For "marvell,armada-375-pp2", must contain the following register
12− sets:
13− - common controller registers
14− - LMS registers
15− - one register area per Ethernet port
16− For "marvell,armada-7k-pp2" used by 7K/8K and CN913X, must contain the following register
17− sets:
18− - packet processor registers
19− - networking interfaces registers
20− - CM3 address space used for TX Flow Control
21−
22−- clocks: pointers to the reference clocks for this device, consequently:
23− - main controller clock (for both armada-375-pp2 and armada-7k-pp2)
24− - GOP clock (for both armada-375-pp2 and armada-7k-pp2)
25− - MG clock (only for armada-7k-pp2)
26− - MG Core clock (only for armada-7k-pp2)
27− - AXI clock (only for armada-7k-pp2)
28−- clock-names: names of used clocks, must be "pp_clk", "gop_clk", "mg_clk",
29− "mg_core_clk" and "axi_clk" (the 3 latter only for armada-7k-pp2).
30−
31−The ethernet ports are represented by subnodes. At least one port is
32−required.
33−
34−Required properties (port):
35−
36−- interrupts: interrupt(s) for the port
37−- port-id: ID of the port from the MAC point of view
38−- gop-port-id: only for marvell,armada-7k-pp2, ID of the port from the
39− GOP (Group Of Ports) point of view. This ID is used to index the
40− per-port registers in the second register area.
41−- phy-mode: See ethernet.txt file in the same directory
42−
43−Optional properties (port):
44−
45−- marvell,loopback: port is loopback mode
46−- phy: a phandle to a phy node defining the PHY address (as the reg
47− property, a single integer).
48−- interrupt-names: if more than a single interrupt for is given, must be the
49− name associated to the interrupts listed. Valid names are:
50− "hifX", with X in [0..8], and "link". The names "tx-cpu0",
51− "tx-cpu1", "tx-cpu2", "tx-cpu3" and "rx-shared" are supported
52− for backward compatibility but shouldn't be used for new
53− additions.
54−- marvell,system-controller: a phandle to the system controller.
55−
56−Example for marvell,armada-375-pp2:
57−
58−ethernet@f0000 {
59− compatible = "marvell,armada-375-pp2";
60− reg = <0xf0000 0xa000>,
61− <0xc0000 0x3060>,
62− <0xc4000 0x100>,
63− <0xc5000 0x100>;
64− clocks = <&gateclk 3>, <&gateclk 19>;
65− clock-names = "pp_clk", "gop_clk";
66−
67− eth0: eth0@c4000 {
68− interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
69− port-id = <0>;
70− phy = <&phy0>;
71− phy-mode = "gmii";
72− };
73−
74− eth1: eth1@c5000 {
75− interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
76− port-id = <1>;
77− phy = <&phy3>;
78− phy-mode = "gmii";
79− };
80−};
81−
82−Example for marvell,armada-7k-pp2:
83−
84−cpm_ethernet: ethernet@0 {
85− compatible = "marvell,armada-7k-pp22";
86− reg = <0x0 0x100000>, <0x129000 0xb000>, <0x220000 0x800>;
87− clocks = <&cpm_syscon0 1 3>, <&cpm_syscon0 1 9>,
88− <&cpm_syscon0 1 5>, <&cpm_syscon0 1 6>, <&cpm_syscon0 1 18>;
89− clock-names = "pp_clk", "gop_clk", "mg_clk", "mg_core_clk", "axi_clk";
90−
91− eth0: eth0 {
92− interrupts = <ICU_GRP_NSR 39 IRQ_TYPE_LEVEL_HIGH>,
93− <ICU_GRP_NSR 43 IRQ_TYPE_LEVEL_HIGH>,
94− <ICU_GRP_NSR 47 IRQ_TYPE_LEVEL_HIGH>,
95− <ICU_GRP_NSR 51 IRQ_TYPE_LEVEL_HIGH>,
96− <ICU_GRP_NSR 55 IRQ_TYPE_LEVEL_HIGH>,
97− <ICU_GRP_NSR 59 IRQ_TYPE_LEVEL_HIGH>,
98− <ICU_GRP_NSR 63 IRQ_TYPE_LEVEL_HIGH>,
99− <ICU_GRP_NSR 67 IRQ_TYPE_LEVEL_HIGH>,
100− <ICU_GRP_NSR 71 IRQ_TYPE_LEVEL_HIGH>,
101− <ICU_GRP_NSR 129 IRQ_TYPE_LEVEL_HIGH>;
102− interrupt-names = "hif0", "hif1", "hif2", "hif3", "hif4",
103− "hif5", "hif6", "hif7", "hif8", "link";
104− port-id = <0>;
105− gop-port-id = <0>;
106− };
107−
108− eth1: eth1 {
109− interrupts = <ICU_GRP_NSR 40 IRQ_TYPE_LEVEL_HIGH>,
110− <ICU_GRP_NSR 44 IRQ_TYPE_LEVEL_HIGH>,
111− <ICU_GRP_NSR 48 IRQ_TYPE_LEVEL_HIGH>,
112− <ICU_GRP_NSR 52 IRQ_TYPE_LEVEL_HIGH>,
113− <ICU_GRP_NSR 56 IRQ_TYPE_LEVEL_HIGH>,
114− <ICU_GRP_NSR 60 IRQ_TYPE_LEVEL_HIGH>,
115− <ICU_GRP_NSR 64 IRQ_TYPE_LEVEL_HIGH>,
116− <ICU_GRP_NSR 68 IRQ_TYPE_LEVEL_HIGH>,
117− <ICU_GRP_NSR 72 IRQ_TYPE_LEVEL_HIGH>,
118− <ICU_GRP_NSR 128 IRQ_TYPE_LEVEL_HIGH>;
119− interrupt-names = "hif0", "hif1", "hif2", "hif3", "hif4",
120− "hif5", "hif6", "hif7", "hif8", "link";
121− port-id = <1>;
122− gop-port-id = <2>;
123− };
124−
125− eth2: eth2 {
126− interrupts = <ICU_GRP_NSR 41 IRQ_TYPE_LEVEL_HIGH>,
127− <ICU_GRP_NSR 45 IRQ_TYPE_LEVEL_HIGH>,
128− <ICU_GRP_NSR 49 IRQ_TYPE_LEVEL_HIGH>,
129− <ICU_GRP_NSR 53 IRQ_TYPE_LEVEL_HIGH>,
130− <ICU_GRP_NSR 57 IRQ_TYPE_LEVEL_HIGH>,
131− <ICU_GRP_NSR 61 IRQ_TYPE_LEVEL_HIGH>,
132− <ICU_GRP_NSR 65 IRQ_TYPE_LEVEL_HIGH>,
133− <ICU_GRP_NSR 69 IRQ_TYPE_LEVEL_HIGH>,
134− <ICU_GRP_NSR 73 IRQ_TYPE_LEVEL_HIGH>,
135− <ICU_GRP_NSR 127 IRQ_TYPE_LEVEL_HIGH>;
136− interrupt-names = "hif0", "hif1", "hif2", "hif3", "hif4",
137− "hif5", "hif6", "hif7", "hif8", "link";
138− port-id = <2>;
139− gop-port-id = <3>;
140− };
141−};
Documentation/devicetree/bindings/net/microchip,lan95xx.yaml+3−1
@@ -39,7 +39,9 @@ properties: · 38 unmodified lines
3939 - usb424,9e08 # SMSC LAN89530 USB Ethernet Device
4040 - usb424,ec00 # SMSC9512/9514 USB Hub & Ethernet Device
4141
42− reg: true
42+ reg:
43+ maxItems: 1
44+
4345 local-mac-address: true
4446 mac-address: true
4547
Documentation/devicetree/bindings/net/nfc/nxp,nci.yaml+3−1
@@ -14,7 +14,9 @@ properties: · 13 unmodified lines
1414 oneOf:
1515 - const: nxp,nxp-nci-i2c
1616 - items:
17− - const: nxp,pn547
17+ - enum:
18+ - nxp,nq310
19+ - nxp,pn547
1820 - const: nxp,nxp-nci-i2c
1921
2022 enable-gpios:
Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml+3−1
@@ -7,7 +7,9 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines
77 title: NXP i.MX8 DWMAC glue layer
88
99 maintainers:
10− - Joakim Zhang <qiangqing.zhang@nxp.com>
10+ - Clark Wang <xiaoning.wang@nxp.com>
11+ - Shawn Guo <shawnguo@kernel.org>
12+ - NXP Linux Team <linux-imx@nxp.com>
1113
1214 # We need a select here so we don't match all nodes with 'snps,dwmac'
1315 select:
Documentation/devicetree/bindings/net/pcs/fsl,lynx-pcs.yaml+40−0
@@ -0,0 +1,40 @@
1+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/net/pcs/fsl,lynx-pcs.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: NXP Lynx PCS
8+
9+maintainers:
10+ - Ioana Ciornei <ioana.ciornei@nxp.com>
11+
12+description: |
13+ NXP Lynx 10G and 28G SerDes have Ethernet PCS devices which can be used as
14+ protocol controllers. They are accessible over the Ethernet interface's MDIO
15+ bus.
16+
17+properties:
18+ compatible:
19+ const: fsl,lynx-pcs
20+
21+ reg:
22+ maxItems: 1
23+
24+required:
25+ - compatible
26+ - reg
27+
28+additionalProperties: false
29+
30+examples:
31+ - |
32+ mdio-bus {
33+ #address-cells = <1>;
34+ #size-cells = <0>;
35+
36+ qsgmii_pcs1: ethernet-pcs@1 {
37+ compatible = "fsl,lynx-pcs";
38+ reg = <1>;
39+ };
40+ };
Documentation/devicetree/bindings/net/qca,ar71xx.yaml+0−1
@@ -123,7 +123,6 @@ examples: · 122 unmodified lines
123123
124124 switch_port0: port@0 {
125125 reg = <0x0>;
126− label = "cpu";
127126 ethernet = <&eth1>;
128127
129128 phy-mode = "gmii";
Documentation/devicetree/bindings/net/qcom,ipa.yaml+58−28
@@ -49,6 +49,7 @@ properties: · 48 unmodified lines
4949 - qcom,sc7280-ipa
5050 - qcom,sdm845-ipa
5151 - qcom,sdx55-ipa
52+ - qcom,sm6350-ipa
5253 - qcom,sm8350-ipa
5354
5455 reg:
@@ -124,19 +125,31 @@ properties: · 69 unmodified lines
124125 - const: ipa-clock-enabled-valid
125126 - const: ipa-clock-enabled
126127
128+ qcom,gsi-loader:
129+ enum:
130+ - self
131+ - modem
132+ - skip
133+ description:
134+ Indicates how GSI firmware should be loaded. If the AP loads
135+ and validates GSI firmware, this property has value "self".
136+ If the modem does this, this property has value "modem".
137+ Otherwise, "skip" means GSI firmware loading is not required.
138+
127139 modem-init:
140+ deprecated: true
128141 type: boolean
129142 description:
130− If present, it indicates that the modem is responsible for
131− performing early IPA initialization, including loading and
132− validating firwmare used by the GSI.
143+ This is the older (deprecated) way of indicating how GSI firmware
144+ should be loaded. If present, the modem loads GSI firmware; if
145+ absent, the AP loads GSI firmware.
133146
134147 memory-region:
135148 maxItems: 1
136149 description:
137150 If present, a phandle for a reserved memory area that holds
138151 the firmware passed to Trust Zone for authentication. Required
139− when Trust Zone (not the modem) performs early initialization.
152+ when the AP (not the modem) performs early initialization.
140153
141154 firmware-name:
142155 $ref: /schemas/types.yaml#/definitions/string
@@ -155,22 +168,36 @@ required: · 12 unmodified lines
155168 - interconnects
156169 - qcom,smem-states
157170
158−# Either modem-init is present, or memory-region must be present.
159−oneOf:
160− - required:
161− - modem-init
162− - required:
163− - memory-region
164−
165−# If memory-region is present, firmware-name may optionally be present.
166−# But if modem-init is present, firmware-name must not be present.
167−if:
168− required:
169− - modem-init
170−then:
171− not:
172− required:
173− - firmware-name
171+allOf:
172+ # If qcom,gsi-loader is present, modem-init must not be present
173+ - if:
174+ required:
175+ - qcom,gsi-loader
176+ then:
177+ properties:
178+ modem-init: false
179+
180+ # If qcom,gsi-loader is "self", the AP loads GSI firmware, and
181+ # memory-region must be specified
182+ if:
183+ properties:
184+ qcom,gsi-loader:
185+ contains:
186+ const: self
187+ then:
188+ required:
189+ - memory-region
190+ else:
191+ # If qcom,gsi-loader is not present, we use deprecated behavior.
192+ # If modem-init is not present, the AP loads GSI firmware, and
193+ # memory-region must be specified.
194+ if:
195+ not:
196+ required:
197+ - modem-init
198+ then:
199+ required:
200+ - memory-region
174201
175202 additionalProperties: false
176203
@@ -201,14 +228,17 @@ examples: · 24 unmodified lines
201228 };
202229
203230 ipa@1e40000 {
204− compatible = "qcom,sdm845-ipa";
231+ compatible = "qcom,sc7180-ipa";
205232
206− modem-init;
233+ qcom,gsi-loader = "self";
234+ memory-region = <&ipa_fw_mem>;
235+ firmware-name = "qcom/sc7180-trogdor/modem/modem.mdt";
207236
208− iommus = <&apps_smmu 0x720 0x3>;
237+ iommus = <&apps_smmu 0x440 0x0>,
238+ <&apps_smmu 0x442 0x0>;
209239 reg = <0x1e40000 0x7000>,
210− <0x1e47000 0x2000>,
211− <0x1e04000 0x2c000>;
240+ <0x1e47000 0x2000>,
241+ <0x1e04000 0x2c000>;
212242 reg-names = "ipa-reg",
213243 "ipa-shared",
214244 "gsi";
@@ -226,9 +256,9 @@ examples: · 11 unmodified lines
226256 clock-names = "core";
227257
228258 interconnects =
229− <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_EBI1>,
230− <&rsc_hlos MASTER_IPA &rsc_hlos SLAVE_IMEM>,
231− <&rsc_hlos MASTER_APPSS_PROC &rsc_hlos SLAVE_IPA_CFG>;
259+ <&aggre2_noc MASTER_IPA 0 &mc_virt SLAVE_EBI1 0>,
260+ <&aggre2_noc MASTER_IPA 0 &system_noc SLAVE_IMEM 0>,
261+ <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_IPA_CFG 0>;
232262 interconnect-names = "memory",
233263 "imem",
234264 "config";
Documentation/devicetree/bindings/net/qcom,ipq4019-mdio.yaml+36−10
@@ -9,14 +9,18 @@ title: Qualcomm IPQ40xx MDIO Controller · 8 unmodified lines
99 maintainers:
1010 - Robert Marko <robert.marko@sartura.hr>
1111
12−allOf:
13− - $ref: "mdio.yaml#"
14−
1512 properties:
1613 compatible:
17− enum:
18− - qcom,ipq4019-mdio
19− - qcom,ipq5018-mdio
14+ oneOf:
15+ - enum:
16+ - qcom,ipq4019-mdio
17+ - qcom,ipq5018-mdio
18+
19+ - items:
20+ - enum:
21+ - qcom,ipq6018-mdio
22+ - qcom,ipq8074-mdio
23+ - const: qcom,ipq4019-mdio
2024
2125 "#address-cells":
2226 const: 1
@@ -33,10 +37,12 @@ properties: · 10 unmodified lines
3337 address range is only required by the platform IPQ50xx.
3438
3539 clocks:
36− maxItems: 1
37− description: |
38− MDIO clock source frequency fixed to 100MHZ, this clock should be specified
39− by the platform IPQ807x, IPQ60xx and IPQ50xx.
40+ items:
41+ - description: MDIO clock source frequency fixed to 100MHZ
42+
43+ clock-names:
44+ items:
45+ - const: gcc_mdio_ahb_clk
4046
4147 required:
4248 - compatible
@@ -44,6 +50,26 @@ required: · 1 unmodified line
4450 - "#address-cells"
4551 - "#size-cells"
4652
53+allOf:
54+ - $ref: "mdio.yaml#"
55+
56+ - if:
57+ properties:
58+ compatible:
59+ contains:
60+ enum:
61+ - qcom,ipq5018-mdio
62+ - qcom,ipq6018-mdio
63+ - qcom,ipq8074-mdio
64+ then:
65+ required:
66+ - clocks
67+ - clock-names
68+ else:
69+ properties:
70+ clocks: false
71+ clock-names: false
72+
4773 unevaluatedProperties: false
4874
4975 examples:
Documentation/devicetree/bindings/net/realtek-bluetooth.yaml+1−0
@@ -20,6 +20,7 @@ properties: · 19 unmodified lines
2020 enum:
2121 - realtek,rtl8723bs-bt
2222 - realtek,rtl8723cs-bt
23+ - realtek,rtl8723ds-bt
2324 - realtek,rtl8822cs-bt
2425
2526 device-wake-gpios:
Documentation/devicetree/bindings/net/renesas,r8a779f0-ether-switch.yaml+262−0
@@ -0,0 +1,262 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/net/renesas,r8a779f0-ether-switch.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Renesas Ethernet Switch
8+
9+maintainers:
10+ - Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
11+
12+properties:
13+ compatible:
14+ const: renesas,r8a779f0-ether-switch
15+
16+ reg:
17+ maxItems: 2
18+
19+ reg-names:
20+ items:
21+ - const: base
22+ - const: secure_base
23+
24+ interrupts:
25+ maxItems: 47
26+
27+ interrupt-names:
28+ items:
29+ - const: mfwd_error
30+ - const: race_error
31+ - const: coma_error
32+ - const: gwca0_error
33+ - const: gwca1_error
34+ - const: etha0_error
35+ - const: etha1_error
36+ - const: etha2_error
37+ - const: gptp0_status
38+ - const: gptp1_status
39+ - const: mfwd_status
40+ - const: race_status
41+ - const: coma_status
42+ - const: gwca0_status
43+ - const: gwca1_status
44+ - const: etha0_status
45+ - const: etha1_status
46+ - const: etha2_status
47+ - const: rmac0_status
48+ - const: rmac1_status
49+ - const: rmac2_status
50+ - const: gwca0_rxtx0
51+ - const: gwca0_rxtx1
52+ - const: gwca0_rxtx2
53+ - const: gwca0_rxtx3
54+ - const: gwca0_rxtx4
55+ - const: gwca0_rxtx5
56+ - const: gwca0_rxtx6
57+ - const: gwca0_rxtx7
58+ - const: gwca1_rxtx0
59+ - const: gwca1_rxtx1
60+ - const: gwca1_rxtx2
61+ - const: gwca1_rxtx3
62+ - const: gwca1_rxtx4
63+ - const: gwca1_rxtx5
64+ - const: gwca1_rxtx6
65+ - const: gwca1_rxtx7
66+ - const: gwca0_rxts0
67+ - const: gwca0_rxts1
68+ - const: gwca1_rxts0
69+ - const: gwca1_rxts1
70+ - const: rmac0_mdio
71+ - const: rmac1_mdio
72+ - const: rmac2_mdio
73+ - const: rmac0_phy
74+ - const: rmac1_phy
75+ - const: rmac2_phy
76+
77+ clocks:
78+ maxItems: 1
79+
80+ resets:
81+ maxItems: 1
82+
83+ iommus:
84+ maxItems: 16
85+
86+ power-domains:
87+ maxItems: 1
88+
89+ ethernet-ports:
90+ type: object
91+ additionalProperties: false
92+
93+ properties:
94+ '#address-cells':
95+ description: Port number of ETHA (TSNA).
96+ const: 1
97+
98+ '#size-cells':
99+ const: 0
100+
101+ patternProperties:
102+ "^port@[0-9a-f]+$":
103+ type: object
104+ $ref: /schemas/net/ethernet-controller.yaml#
105+ unevaluatedProperties: false
106+
107+ properties:
108+ reg:
109+ maxItems: 1
110+ description:
111+ Port number of ETHA (TSNA).
112+
113+ phys:
114+ maxItems: 1
115+ description:
116+ Phandle of an Ethernet SERDES.
117+
118+ mdio:
119+ $ref: /schemas/net/mdio.yaml#
120+ unevaluatedProperties: false
121+
122+ required:
123+ - reg
124+ - phy-handle
125+ - phy-mode
126+ - phys
127+ - mdio
128+
129+required:
130+ - compatible
131+ - reg
132+ - reg-names
133+ - interrupts
134+ - interrupt-names
135+ - clocks
136+ - resets
137+ - power-domains
138+ - ethernet-ports
139+
140+additionalProperties: false
141+
142+examples:
143+ - |
144+ #include <dt-bindings/clock/r8a779f0-cpg-mssr.h>
145+ #include <dt-bindings/interrupt-controller/arm-gic.h>
146+ #include <dt-bindings/power/r8a779f0-sysc.h>
147+
148+ ethernet@e6880000 {
149+ compatible = "renesas,r8a779f0-ether-switch";
150+ reg = <0xe6880000 0x20000>, <0xe68c0000 0x20000>;
151+ reg-names = "base", "secure_base";
152+ interrupts = <GIC_SPI 256 IRQ_TYPE_LEVEL_HIGH>,
153+ <GIC_SPI 257 IRQ_TYPE_LEVEL_HIGH>,
154+ <GIC_SPI 258 IRQ_TYPE_LEVEL_HIGH>,
155+ <GIC_SPI 259 IRQ_TYPE_LEVEL_HIGH>,
156+ <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
157+ <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>,
158+ <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>,
159+ <GIC_SPI 263 IRQ_TYPE_LEVEL_HIGH>,
160+ <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>,
161+ <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>,
162+ <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>,
163+ <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
164+ <GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>,
165+ <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH>,
166+ <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>,
167+ <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>,
168+ <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH>,
169+ <GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH>,
170+ <GIC_SPI 276 IRQ_TYPE_LEVEL_HIGH>,
171+ <GIC_SPI 277 IRQ_TYPE_LEVEL_HIGH>,
172+ <GIC_SPI 278 IRQ_TYPE_LEVEL_HIGH>,
173+ <GIC_SPI 280 IRQ_TYPE_LEVEL_HIGH>,
174+ <GIC_SPI 281 IRQ_TYPE_LEVEL_HIGH>,
175+ <GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH>,
176+ <GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH>,
177+ <GIC_SPI 284 IRQ_TYPE_LEVEL_HIGH>,
178+ <GIC_SPI 285 IRQ_TYPE_LEVEL_HIGH>,
179+ <GIC_SPI 286 IRQ_TYPE_LEVEL_HIGH>,
180+ <GIC_SPI 287 IRQ_TYPE_LEVEL_HIGH>,
181+ <GIC_SPI 288 IRQ_TYPE_LEVEL_HIGH>,
182+ <GIC_SPI 289 IRQ_TYPE_LEVEL_HIGH>,
183+ <GIC_SPI 290 IRQ_TYPE_LEVEL_HIGH>,
184+ <GIC_SPI 291 IRQ_TYPE_LEVEL_HIGH>,
185+ <GIC_SPI 292 IRQ_TYPE_LEVEL_HIGH>,
186+ <GIC_SPI 293 IRQ_TYPE_LEVEL_HIGH>,
187+ <GIC_SPI 294 IRQ_TYPE_LEVEL_HIGH>,
188+ <GIC_SPI 295 IRQ_TYPE_LEVEL_HIGH>,
189+ <GIC_SPI 296 IRQ_TYPE_LEVEL_HIGH>,
190+ <GIC_SPI 297 IRQ_TYPE_LEVEL_HIGH>,
191+ <GIC_SPI 298 IRQ_TYPE_LEVEL_HIGH>,
192+ <GIC_SPI 299 IRQ_TYPE_LEVEL_HIGH>,
193+ <GIC_SPI 300 IRQ_TYPE_LEVEL_HIGH>,
194+ <GIC_SPI 301 IRQ_TYPE_LEVEL_HIGH>,
195+ <GIC_SPI 302 IRQ_TYPE_LEVEL_HIGH>,
196+ <GIC_SPI 304 IRQ_TYPE_LEVEL_HIGH>,
197+ <GIC_SPI 305 IRQ_TYPE_LEVEL_HIGH>,
198+ <GIC_SPI 306 IRQ_TYPE_LEVEL_HIGH>;
199+ interrupt-names = "mfwd_error", "race_error",
200+ "coma_error", "gwca0_error",
201+ "gwca1_error", "etha0_error",
202+ "etha1_error", "etha2_error",
203+ "gptp0_status", "gptp1_status",
204+ "mfwd_status", "race_status",
205+ "coma_status", "gwca0_status",
206+ "gwca1_status", "etha0_status",
207+ "etha1_status", "etha2_status",
208+ "rmac0_status", "rmac1_status",
209+ "rmac2_status",
210+ "gwca0_rxtx0", "gwca0_rxtx1",
211+ "gwca0_rxtx2", "gwca0_rxtx3",
212+ "gwca0_rxtx4", "gwca0_rxtx5",
213+ "gwca0_rxtx6", "gwca0_rxtx7",
214+ "gwca1_rxtx0", "gwca1_rxtx1",
215+ "gwca1_rxtx2", "gwca1_rxtx3",
216+ "gwca1_rxtx4", "gwca1_rxtx5",
217+ "gwca1_rxtx6", "gwca1_rxtx7",
218+ "gwca0_rxts0", "gwca0_rxts1",
219+ "gwca1_rxts0", "gwca1_rxts1",
220+ "rmac0_mdio", "rmac1_mdio",
221+ "rmac2_mdio",
222+ "rmac0_phy", "rmac1_phy",
223+ "rmac2_phy";
224+ clocks = <&cpg CPG_MOD 1505>;
225+ power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
226+ resets = <&cpg 1505>;
227+
228+ ethernet-ports {
229+ #address-cells = <1>;
230+ #size-cells = <0>;
231+ port@0 {
232+ reg = <0>;
233+ phy-handle = <&eth_phy0>;
234+ phy-mode = "sgmii";
235+ phys = <&eth_serdes 0>;
236+ mdio {
237+ #address-cells = <1>;
238+ #size-cells = <0>;
239+ };
240+ };
241+ port@1 {
242+ reg = <1>;
243+ phy-handle = <&eth_phy1>;
244+ phy-mode = "sgmii";
245+ phys = <&eth_serdes 1>;
246+ mdio {
247+ #address-cells = <1>;
248+ #size-cells = <0>;
249+ };
250+ };
251+ port@2 {
252+ reg = <2>;
253+ phy-handle = <&eth_phy2>;
254+ phy-mode = "sgmii";
255+ phys = <&eth_serdes 2>;
256+ mdio {
257+ #address-cells = <1>;
258+ #size-cells = <0>;
259+ };
260+ };
261+ };
262+ };
Documentation/devicetree/bindings/net/sff,sfp.yaml+2−1
@@ -22,7 +22,8 @@ properties: · 21 unmodified lines
2222 phandle of an I2C bus controller for the SFP two wire serial
2323
2424 maximum-power-milliwatt:
25− maxItems: 1
25+ minimum: 1000
26+ default: 1000
2627 description:
2728 Maximum module power consumption Specifies the maximum power consumption
2829 allowable by a module in the slot, in milli-Watts. Presently, modules can
Documentation/devicetree/bindings/net/snps,dwmac.yaml+264−81
@@ -167,56 +167,238 @@ properties: · 166 unmodified lines
167167 snps,mtl-rx-config:
168168 $ref: /schemas/types.yaml#/definitions/phandle
169169 description:
170− Multiple RX Queues parameters. Phandle to a node that can
171− contain the following properties
172− * snps,rx-queues-to-use, number of RX queues to be used in the
173− driver
174− * Choose one of these RX scheduling algorithms
175− * snps,rx-sched-sp, Strict priority
176− * snps,rx-sched-wsp, Weighted Strict priority
177− * For each RX queue
178− * Choose one of these modes
179− * snps,dcb-algorithm, Queue to be enabled as DCB
180− * snps,avb-algorithm, Queue to be enabled as AVB
181− * snps,map-to-dma-channel, Channel to map
182− * Specifiy specific packet routing
183− * snps,route-avcp, AV Untagged Control packets
184− * snps,route-ptp, PTP Packets
185− * snps,route-dcbcp, DCB Control Packets
186− * snps,route-up, Untagged Packets
187− * snps,route-multi-broad, Multicast & Broadcast Packets
188− * snps,priority, bitmask of the tagged frames priorities assigned to
189− the queue
170+ Multiple RX Queues parameters. Phandle to a node that
171+ implements the 'rx-queues-config' object described in
172+ this binding.
173+
174+ rx-queues-config:
175+ type: object
176+ properties:
177+ snps,rx-queues-to-use:
178+ $ref: /schemas/types.yaml#/definitions/uint32
179+ description: number of RX queues to be used in the driver
180+ snps,rx-sched-sp:
181+ type: boolean
182+ description: Strict priority
183+ snps,rx-sched-wsp:
184+ type: boolean
185+ description: Weighted Strict priority
186+ allOf:
187+ - if:
188+ required:
189+ - snps,rx-sched-sp
190+ then:
191+ properties:
192+ snps,rx-sched-wsp: false
193+ - if:
194+ required:
195+ - snps,rx-sched-wsp
196+ then:
197+ properties:
198+ snps,rx-sched-sp: false
199+ patternProperties:
200+ "^queue[0-9]$":
201+ description: Each subnode represents a queue.
202+ type: object
203+ properties:
204+ snps,dcb-algorithm:
205+ type: boolean
206+ description: Queue to be enabled as DCB
207+ snps,avb-algorithm:
208+ type: boolean
209+ description: Queue to be enabled as AVB
210+ snps,map-to-dma-channel:
211+ $ref: /schemas/types.yaml#/definitions/uint32
212+ description: DMA channel id to map
213+ snps,route-avcp:
214+ type: boolean
215+ description: AV Untagged Control packets
216+ snps,route-ptp:
217+ type: boolean
218+ description: PTP Packets
219+ snps,route-dcbcp:
220+ type: boolean
221+ description: DCB Control Packets
222+ snps,route-up:
223+ type: boolean
224+ description: Untagged Packets
225+ snps,route-multi-broad:
226+ type: boolean
227+ description: Multicast & Broadcast Packets
228+ snps,priority:
229+ $ref: /schemas/types.yaml#/definitions/uint32
230+ description: Bitmask of the tagged frames priorities assigned to the queue
231+ allOf:
232+ - if:
233+ required:
234+ - snps,dcb-algorithm
235+ then:
236+ properties:
237+ snps,avb-algorithm: false
238+ - if:
239+ required:
240+ - snps,avb-algorithm
241+ then:
242+ properties:
243+ snps,dcb-algorithm: false
244+ - if:
245+ required:
246+ - snps,route-avcp
247+ then:
248+ properties:
249+ snps,route-ptp: false
250+ snps,route-dcbcp: false
251+ snps,route-up: false
252+ snps,route-multi-broad: false
253+ - if:
254+ required:
255+ - snps,route-ptp
256+ then:
257+ properties:
258+ snps,route-avcp: false
259+ snps,route-dcbcp: false
260+ snps,route-up: false
261+ snps,route-multi-broad: false
262+ - if:
263+ required:
264+ - snps,route-dcbcp
265+ then:
266+ properties:
267+ snps,route-avcp: false
268+ snps,route-ptp: false
269+ snps,route-up: false
270+ snps,route-multi-broad: false
271+ - if:
272+ required:
273+ - snps,route-up
274+ then:
275+ properties:
276+ snps,route-avcp: false
277+ snps,route-ptp: false
278+ snps,route-dcbcp: false
279+ snps,route-multi-broad: false
280+ - if:
281+ required:
282+ - snps,route-multi-broad
283+ then:
284+ properties:
285+ snps,route-avcp: false
286+ snps,route-ptp: false
287+ snps,route-dcbcp: false
288+ snps,route-up: false
289+ additionalProperties: false
290+ additionalProperties: false
190291
191292 snps,mtl-tx-config:
192293 $ref: /schemas/types.yaml#/definitions/phandle
193294 description:
194− Multiple TX Queues parameters. Phandle to a node that can
195− contain the following properties
196− * snps,tx-queues-to-use, number of TX queues to be used in the
197− driver
198− * Choose one of these TX scheduling algorithms
199− * snps,tx-sched-wrr, Weighted Round Robin
200− * snps,tx-sched-wfq, Weighted Fair Queuing
201− * snps,tx-sched-dwrr, Deficit Weighted Round Robin
202− * snps,tx-sched-sp, Strict priority
203− * For each TX queue
204− * snps,weight, TX queue weight (if using a DCB weight
205− algorithm)
206− * Choose one of these modes
207− * snps,dcb-algorithm, TX queue will be working in DCB
208− * snps,avb-algorithm, TX queue will be working in AVB
209− [Attention] Queue 0 is reserved for legacy traffic
210− and so no AVB is available in this queue.
211− * Configure Credit Base Shaper (if AVB Mode selected)
212− * snps,send_slope, enable Low Power Interface
213− * snps,idle_slope, unlock on WoL
214− * snps,high_credit, max write outstanding req. limit
215− * snps,low_credit, max read outstanding req. limit
216− * snps,priority, bitmask of the priorities assigned to the queue.
217− When a PFC frame is received with priorities matching the bitmask,
218− the queue is blocked from transmitting for the pause time specified
219− in the PFC frame.
295+ Multiple TX Queues parameters. Phandle to a node that
296+ implements the 'tx-queues-config' object described in
297+ this binding.
298+
299+ tx-queues-config:
300+ type: object
301+ properties:
302+ snps,tx-queues-to-use:
303+ $ref: /schemas/types.yaml#/definitions/uint32
304+ description: number of TX queues to be used in the driver
305+ snps,tx-sched-wrr:
306+ type: boolean
307+ description: Weighted Round Robin
308+ snps,tx-sched-wfq:
309+ type: boolean
310+ description: Weighted Fair Queuing
311+ snps,tx-sched-dwrr:
312+ type: boolean
313+ description: Deficit Weighted Round Robin
314+ snps,tx-sched-sp:
315+ type: boolean
316+ description: Strict priority
317+ allOf:
318+ - if:
319+ required:
320+ - snps,tx-sched-wrr
321+ then:
322+ properties:
323+ snps,tx-sched-wfq: false
324+ snps,tx-sched-dwrr: false
325+ snps,tx-sched-sp: false
326+ - if:
327+ required:
328+ - snps,tx-sched-wfq
329+ then:
330+ properties:
331+ snps,tx-sched-wrr: false
332+ snps,tx-sched-dwrr: false
333+ snps,tx-sched-sp: false
334+ - if:
335+ required:
336+ - snps,tx-sched-dwrr
337+ then:
338+ properties:
339+ snps,tx-sched-wrr: false
340+ snps,tx-sched-wfq: false
341+ snps,tx-sched-sp: false
342+ - if:
343+ required:
344+ - snps,tx-sched-sp
345+ then:
346+ properties:
347+ snps,tx-sched-wrr: false
348+ snps,tx-sched-wfq: false
349+ snps,tx-sched-dwrr: false
350+ patternProperties:
351+ "^queue[0-9]$":
352+ description: Each subnode represents a queue.
353+ type: object
354+ properties:
355+ snps,weight:
356+ $ref: /schemas/types.yaml#/definitions/uint32
357+ description: TX queue weight (if using a DCB weight algorithm)
358+ snps,dcb-algorithm:
359+ type: boolean
360+ description: TX queue will be working in DCB
361+ snps,avb-algorithm:
362+ type: boolean
363+ description:
364+ TX queue will be working in AVB.
365+ Queue 0 is reserved for legacy traffic and so no AVB is
366+ available in this queue.
367+ snps,send_slope:
368+ $ref: /schemas/types.yaml#/definitions/uint32
369+ description: enable Low Power Interface
370+ snps,idle_slope:
371+ $ref: /schemas/types.yaml#/definitions/uint32
372+ description: unlock on WoL
373+ snps,high_credit:
374+ $ref: /schemas/types.yaml#/definitions/uint32
375+ description: max write outstanding req. limit
376+ snps,low_credit:
377+ $ref: /schemas/types.yaml#/definitions/uint32
378+ description: max read outstanding req. limit
379+ snps,priority:
380+ $ref: /schemas/types.yaml#/definitions/uint32
381+ description:
382+ Bitmask of the tagged frames priorities assigned to the queue.
383+ When a PFC frame is received with priorities matching the bitmask,
384+ the queue is blocked from transmitting for the pause time specified
385+ in the PFC frame.
386+ allOf:
387+ - if:
388+ required:
389+ - snps,dcb-algorithm
390+ then:
391+ properties:
392+ snps,avb-algorithm: false
393+ - if:
394+ required:
395+ - snps,avb-algorithm
396+ then:
397+ properties:
398+ snps,dcb-algorithm: false
399+ snps,weight: false
400+ additionalProperties: false
401+ additionalProperties: false
220402
221403 snps,reset-gpio:
222404 deprecated: true
@@ -463,41 +645,6 @@ additionalProperties: true · 240 unmodified lines
463645
464646 examples:
465647 - |
466− stmmac_axi_setup: stmmac-axi-config {
467− snps,wr_osr_lmt = <0xf>;
468− snps,rd_osr_lmt = <0xf>;
469− snps,blen = <256 128 64 32 0 0 0>;
470− };
471−
472− mtl_rx_setup: rx-queues-config {
473− snps,rx-queues-to-use = <1>;
474− snps,rx-sched-sp;
475− queue0 {
476− snps,dcb-algorithm;
477− snps,map-to-dma-channel = <0x0>;
478− snps,priority = <0x0>;
479− };
480− };
481−
482− mtl_tx_setup: tx-queues-config {
483− snps,tx-queues-to-use = <2>;
484− snps,tx-sched-wrr;
485− queue0 {
486− snps,weight = <0x10>;
487− snps,dcb-algorithm;
488− snps,priority = <0x0>;
489− };
490−
491− queue1 {
492− snps,avb-algorithm;
493− snps,send_slope = <0x1000>;
494− snps,idle_slope = <0x1000>;
495− snps,high_credit = <0x3E800>;
496− snps,low_credit = <0xFFC18000>;
497− snps,priority = <0x1>;
498− };
499− };
500−
501648 gmac0: ethernet@e0800000 {
502649 compatible = "snps,dwxgmac-2.10", "snps,dwxgmac";
503650 reg = <0xe0800000 0x8000>;
@@ -516,6 +663,42 @@ examples: · 12 unmodified lines
516663 snps,axi-config = <&stmmac_axi_setup>;
517664 snps,mtl-rx-config = <&mtl_rx_setup>;
518665 snps,mtl-tx-config = <&mtl_tx_setup>;
666+
667+ stmmac_axi_setup: stmmac-axi-config {
668+ snps,wr_osr_lmt = <0xf>;
669+ snps,rd_osr_lmt = <0xf>;
670+ snps,blen = <256 128 64 32 0 0 0>;
671+ };
672+
673+ mtl_rx_setup: rx-queues-config {
674+ snps,rx-queues-to-use = <1>;
675+ snps,rx-sched-sp;
676+ queue0 {
677+ snps,dcb-algorithm;
678+ snps,map-to-dma-channel = <0x0>;
679+ snps,priority = <0x0>;
680+ };
681+ };
682+
683+ mtl_tx_setup: tx-queues-config {
684+ snps,tx-queues-to-use = <2>;
685+ snps,tx-sched-wrr;
686+ queue0 {
687+ snps,weight = <0x10>;
688+ snps,dcb-algorithm;
689+ snps,priority = <0x0>;
690+ };
691+
692+ queue1 {
693+ snps,avb-algorithm;
694+ snps,send_slope = <0x1000>;
695+ snps,idle_slope = <0x1000>;
696+ snps,high_credit = <0x3E800>;
697+ snps,low_credit = <0xFFC18000>;
698+ snps,priority = <0x1>;
699+ };
700+ };
701+
519702 mdio0 {
520703 #address-cells = <1>;
521704 #size-cells = <0>;
Documentation/devicetree/bindings/net/socionext,synquacer-netsec.yaml+73−0
@@ -0,0 +1,73 @@
1+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/net/socionext,synquacer-netsec.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: Socionext NetSec Ethernet Controller IP
8+
9+maintainers:
10+ - Jassi Brar <jaswinder.singh@linaro.org>
11+ - Ilias Apalodimas <ilias.apalodimas@linaro.org>
12+
13+allOf:
14+ - $ref: ethernet-controller.yaml#
15+
16+properties:
17+ compatible:
18+ const: socionext,synquacer-netsec
19+
20+ reg:
21+ items:
22+ - description: control register area
23+ - description: EEPROM holding the MAC address and microengine firmware
24+
25+ clocks:
26+ maxItems: 1
27+
28+ clock-names:
29+ const: phy_ref_clk
30+
31+ dma-coherent: true
32+
33+ interrupts:
34+ maxItems: 1
35+
36+ mdio:
37+ $ref: mdio.yaml#
38+
39+required:
40+ - compatible
41+ - reg
42+ - clocks
43+ - clock-names
44+ - interrupts
45+ - mdio
46+
47+unevaluatedProperties: false
48+
49+examples:
50+ - |
51+ #include <dt-bindings/interrupt-controller/arm-gic.h>
52+
53+ ethernet@522d0000 {
54+ compatible = "socionext,synquacer-netsec";
55+ reg = <0x522d0000 0x10000>, <0x10000000 0x10000>;
56+ interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
57+ clocks = <&clk_netsec>;
58+ clock-names = "phy_ref_clk";
59+ phy-mode = "rgmii";
60+ max-speed = <1000>;
61+ max-frame-size = <9000>;
62+ phy-handle = <&phy1>;
63+
64+ mdio {
65+ #address-cells = <1>;
66+ #size-cells = <0>;
67+ phy1: ethernet-phy@1 {
68+ compatible = "ethernet-phy-ieee802.3-c22";
69+ reg = <1>;
70+ };
71+ };
72+ };
73+...
Documentation/devicetree/bindings/net/socionext-netsec.txt+0−56
@@ -1,56 +0,0 @@
1−* Socionext NetSec Ethernet Controller IP
2−
3−Required properties:
4−- compatible: Should be "socionext,synquacer-netsec"
5−- reg: Address and length of the control register area, followed by the
6− address and length of the EEPROM holding the MAC address and
7− microengine firmware
8−- interrupts: Should contain ethernet controller interrupt
9−- clocks: phandle to the PHY reference clock
10−- clock-names: Should be "phy_ref_clk"
11−- phy-mode: See ethernet.txt file in the same directory
12−- phy-handle: See ethernet.txt in the same directory.
13−
14−- mdio device tree subnode: When the Netsec has a phy connected to its local
15− mdio, there must be device tree subnode with the following
16− required properties:
17−
18− - #address-cells: Must be <1>.
19− - #size-cells: Must be <0>.
20−
21− For each phy on the mdio bus, there must be a node with the following
22− fields:
23− - compatible: Refer to phy.txt
24− - reg: phy id used to communicate to phy.
25−
26−Optional properties: (See ethernet.txt file in the same directory)
27−- dma-coherent: Boolean property, must only be present if memory
28− accesses performed by the device are cache coherent.
29−- max-speed: See ethernet.txt in the same directory.
30−- max-frame-size: See ethernet.txt in the same directory.
31−
32−The MAC address will be determined using the optional properties
33−defined in ethernet.txt. The 'phy-mode' property is required, but may
34−be set to the empty string if the PHY configuration is programmed by
35−the firmware or set by hardware straps, and needs to be preserved.
36−
37−Example:
38− eth0: ethernet@522d0000 {
39− compatible = "socionext,synquacer-netsec";
40− reg = <0 0x522d0000 0x0 0x10000>, <0 0x10000000 0x0 0x10000>;
41− interrupts = <GIC_SPI 176 IRQ_TYPE_LEVEL_HIGH>;
42− clocks = <&clk_netsec>;
43− clock-names = "phy_ref_clk";
44− phy-mode = "rgmii";
45− max-speed = <1000>;
46− max-frame-size = <9000>;
47− phy-handle = <&phy1>;
48−
49− mdio {
50− #address-cells = <1>;
51− #size-cells = <0>;
52− phy1: ethernet-phy@1 {
53− compatible = "ethernet-phy-ieee802.3-c22";
54− reg = <1>;
55− };
56− };
Documentation/devicetree/bindings/net/xilinx_axienet.txt+2−0
@@ -68,6 +68,8 @@ Optional properties: · 67 unmodified lines
6868 - mdio : Child node for MDIO bus. Must be defined if PHY access is
6969 required through the core's MDIO interface (i.e. always,
7070 unless the PHY is accessed through a different bus).
71+ Non-standard MDIO bus frequency is supported via
72+ "clock-frequency", see mdio.yaml.
7173
7274 - pcs-handle: Phandle to the internal PCS/PMA PHY in SGMII or 1000Base-X
7375 modes, where "pcs-handle" should be used to point
Documentation/devicetree/bindings/soc/mediatek/mediatek,mt7986-wo-ccif.yaml+51−0
@@ -0,0 +1,51 @@
1+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2+%YAML 1.2
3+---
4+$id: http://devicetree.org/schemas/soc/mediatek/mediatek,mt7986-wo-ccif.yaml#
5+$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+title: MediaTek Wireless Ethernet Dispatch (WED) WO controller interface for MT7986
8+
9+maintainers:
10+ - Lorenzo Bianconi <lorenzo@kernel.org>
11+ - Felix Fietkau <nbd@nbd.name>
12+
13+description:
14+ The MediaTek wo-ccif provides a configuration interface for WED WO
15+ controller used to perfrom offload rx packet processing (e.g. 802.11
16+ aggregation packet reordering or rx header translation) on MT7986 soc.
17+
18+properties:
19+ compatible:
20+ items:
21+ - enum:
22+ - mediatek,mt7986-wo-ccif
23+ - const: syscon
24+
25+ reg:
26+ maxItems: 1
27+
28+ interrupts:
29+ maxItems: 1
30+
31+required:
32+ - compatible
33+ - reg
34+ - interrupts
35+
36+additionalProperties: false
37+
38+examples:
39+ - |
40+ #include <dt-bindings/interrupt-controller/arm-gic.h>
41+ #include <dt-bindings/interrupt-controller/irq.h>
42+ soc {
43+ #address-cells = <2>;
44+ #size-cells = <2>;
45+
46+ syscon@151a5000 {
47+ compatible = "mediatek,mt7986-wo-ccif", "syscon";
48+ reg = <0 0x151a5000 0 0x1000>;
49+ interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
50+ };
51+ };
Documentation/devicetree/bindings/soc/qcom/qcom,wcnss.yaml+3−5
@@ -42,15 +42,13 @@ properties: · 41 unmodified lines
4242 bluetooth:
4343 type: object
4444 additionalProperties: false
45+ allOf:
46+ - $ref: /schemas/net/bluetooth/bluetooth-controller.yaml#
4547 properties:
4648 compatible:
4749 const: qcom,wcnss-bt
4850
49− local-bd-address:
50− $ref: /schemas/types.yaml#/definitions/uint8-array
51− maxItems: 6
52− description:
53− See Documentation/devicetree/bindings/net/bluetooth.txt
51+ local-bd-address: true
5452
5553 required:
5654 - compatible
Documentation/networking/bonding.rst+3−1
@@ -566,7 +566,8 @@ miimon · 565 unmodified lines
566566 link monitoring. A value of 100 is a good starting point.
567567 The use_carrier option, below, affects how the link state is
568568 determined. See the High Availability section for additional
569− information. The default value is 0.
569+ information. The default value is 100 if arp_interval is not
570+ set.
570571
571572 min_links
572573
@@ -956,6 +957,7 @@ xmit_hash_policy · 383 unmodified lines
956957 hash = hash XOR source IP XOR destination IP
957958 hash = hash XOR (hash RSHIFT 16)
958959 hash = hash XOR (hash RSHIFT 8)
960+ hash = hash RSHIFT 1
959961 And then hash is reduced modulo slave count.
960962
961963 If the protocol is IPv6 then the source and destination
Documentation/networking/can.rst+33−0
@@ -1148,6 +1148,39 @@ tuning on deep embedded systems'. The author is running a MPC603e · 1147 unmodified lines
11481148 load without any problems ...
11491149
11501150
1151+Switchable Termination Resistors
1152+--------------------------------
1153+
1154+CAN bus requires a specific impedance across the differential pair,
1155+typically provided by two 120Ohm resistors on the farthest nodes of
1156+the bus. Some CAN controllers support activating / deactivating a
1157+termination resistor(s) to provide the correct impedance.
1158+
1159+Query the available resistances::
1160+
1161+ $ ip -details link show can0
1162+ ...
1163+ termination 120 [ 0, 120 ]
1164+
1165+Activate the terminating resistor::
1166+
1167+ $ ip link set dev can0 type can termination 120
1168+
1169+Deactivate the terminating resistor::
1170+
1171+ $ ip link set dev can0 type can termination 0
1172+
1173+To enable termination resistor support to a can-controller, either
1174+implement in the controller's struct can-priv::
1175+
1176+ termination_const
1177+ termination_const_cnt
1178+ do_set_termination
1179+
1180+or add gpio control with the device tree entries from
1181+Documentation/devicetree/bindings/net/can/can-controller.yaml
1182+
1183+
11511184 The Virtual CAN Driver (vcan)
11521185 -----------------------------
11531186
Documentation/networking/device_drivers/ethernet/freescale/dpaa2/mac-phy-support.rst+6−3
@@ -181,10 +181,13 @@ when necessary using the below listed API:: · 180 unmodified lines
181181 - int dpaa2_mac_connect(struct dpaa2_mac *mac);
182182 - void dpaa2_mac_disconnect(struct dpaa2_mac *mac);
183183
184−A phylink integration is necessary only when the partner DPMAC is not of TYPE_FIXED.
185−One can check for this condition using the below API::
184+A phylink integration is necessary only when the partner DPMAC is not of
185+``TYPE_FIXED``. This means it is either of ``TYPE_PHY``, or of
186+``TYPE_BACKPLANE`` (the difference being the two that in the ``TYPE_BACKPLANE``
187+mode, the MC firmware does not access the PCS registers). One can check for
188+this condition using the following helper::
186189
187− - bool dpaa2_mac_is_type_fixed(struct fsl_mc_device *dpmac_dev,struct fsl_mc_io *mc_io);
190+ - static inline bool dpaa2_mac_is_type_phy(struct dpaa2_mac *mac);
188191
189192 Before connection to a MAC, the caller must allocate and populate the
190193 dpaa2_mac structure with the associated net_device, a pointer to the MC portal
Documentation/networking/device_drivers/ethernet/marvell/octeon_ep.rst+1−0
@@ -23,6 +23,7 @@ Supported Devices · 22 unmodified lines
2323 =================
2424 Currently, this driver support following devices:
2525 * Network controller: Cavium, Inc. Device b200
26+ * Network controller: Cavium, Inc. Device b400
2627
2728 Interface Control
2829 =================
Documentation/networking/device_drivers/ethernet/mellanox/mlx5.rst+54−70
@@ -25,7 +25,7 @@ Enabling the driver and kconfig options · 24 unmodified lines
2525 | at build time via kernel Kconfig flags.
2626 | Basic features, ethernet net device rx/tx offloads and XDP, are available with the most basic flags
2727 | CONFIG_MLX5_CORE=y/m and CONFIG_MLX5_CORE_EN=y.
28−| For the list of advanced features please see below.
28+| For the list of advanced features, please see below.
2929
3030 **CONFIG_MLX5_CORE=(y/m/n)** (module mlx5_core.ko)
3131
@@ -89,11 +89,11 @@ Enabling the driver and kconfig options · 57 unmodified lines
8989
9090 **CONFIG_MLX5_EN_IPSEC=(y/n)**
9191
92−| Enables `IPSec XFRM cryptography-offload accelaration <http://www.mellanox.com/related-docs/prod_software/Mellanox_Innova_IPsec_Ethernet_Adapter_Card_User_Manual.pdf>`_.
92+| Enables `IPSec XFRM cryptography-offload acceleration <http://www.mellanox.com/related-docs/prod_software/Mellanox_Innova_IPsec_Ethernet_Adapter_Card_User_Manual.pdf>`_.
9393
9494 **CONFIG_MLX5_EN_TLS=(y/n)**
9595
96−| TLS cryptography-offload accelaration.
96+| TLS cryptography-offload acceleration.
9797
9898
9999 **CONFIG_MLX5_INFINIBAND=(y/n/m)** (module mlx5_ib.ko)
@@ -139,14 +139,14 @@ flow_steering_mode: Device flow steering mode · 39 unmodified lines
139139 The flow steering mode parameter controls the flow steering mode of the driver.
140140 Two modes are supported:
141141 1. 'dmfs' - Device managed flow steering.
142−2. 'smfs - Software/Driver managed flow steering.
142+2. 'smfs' - Software/Driver managed flow steering.
143143
144144 In DMFS mode, the HW steering entities are created and managed through the
145145 Firmware.
146146 In SMFS mode, the HW steering entities are created and managed though by
147−the driver directly into Hardware without firmware intervention.
147+the driver directly into hardware without firmware intervention.
148148
149−SMFS mode is faster and provides better rule inserstion rate compared to default DMFS mode.
149+SMFS mode is faster and provides better rule insertion rate compared to default DMFS mode.
150150
151151 User command examples:
152152
@@ -165,9 +165,9 @@ User command examples: · 12 unmodified lines
165165 enable_roce: RoCE enablement state
166166 ----------------------------------
167167 RoCE enablement state controls driver support for RoCE traffic.
168−When RoCE is disabled, there is no gid table, only raw ethernet QPs are supported and traffic on the well known UDP RoCE port is handled as raw ethernet traffic.
168+When RoCE is disabled, there is no gid table, only raw ethernet QPs are supported and traffic on the well-known UDP RoCE port is handled as raw ethernet traffic.
169169
170−To change RoCE enablement state a user must change the driverinit cmode value and run devlink reload.
170+To change RoCE enablement state, a user must change the driverinit cmode value and run devlink reload.
171171
172172 User command examples:
173173
@@ -186,7 +186,7 @@ User command examples: · 12 unmodified lines
186186
187187 esw_port_metadata: Eswitch port metadata state
188188 ----------------------------------------------
189−When applicable, disabling Eswitch metadata can increase packet rate
189+When applicable, disabling eswitch metadata can increase packet rate
190190 up to 20% depending on the use case and packet sizes.
191191
192192 Eswitch port metadata state controls whether to internally tag packets with
@@ -253,26 +253,26 @@ mlx5 subfunction · 60 unmodified lines
253253 ================
254254 mlx5 supports subfunction management using devlink port (see :ref:`Documentation/networking/devlink/devlink-port.rst <devlink_port>`) interface.
255255
256−A Subfunction has its own function capabilities and its own resources. This
256+A subfunction has its own function capabilities and its own resources. This
257257 means a subfunction has its own dedicated queues (txq, rxq, cq, eq). These
258258 queues are neither shared nor stolen from the parent PCI function.
259259
260−When a subfunction is RDMA capable, it has its own QP1, GID table and rdma
260+When a subfunction is RDMA capable, it has its own QP1, GID table, and RDMA
261261 resources neither shared nor stolen from the parent PCI function.
262262
263263 A subfunction has a dedicated window in PCI BAR space that is not shared
264−with ther other subfunctions or the parent PCI function. This ensures that all
265−devices (netdev, rdma, vdpa etc.) of the subfunction accesses only assigned
264+with the other subfunctions or the parent PCI function. This ensures that all
265+devices (netdev, rdma, vdpa, etc.) of the subfunction accesses only assigned
266266 PCI BAR space.
267267
268−A Subfunction supports eswitch representation through which it supports tc
268+A subfunction supports eswitch representation through which it supports tc
269269 offloads. The user configures eswitch to send/receive packets from/to
270270 the subfunction port.
271271
272272 Subfunctions share PCI level resources such as PCI MSI-X IRQs with
273273 other subfunctions and/or with its parent PCI function.
274274
275−Example mlx5 software, system and device view::
275+Example mlx5 software, system, and device view::
276276
277277 _______
278278 | admin |
@@ -310,7 +310,7 @@ Example mlx5 software, system and device view:: · 31 unmodified lines
310310 | (device add/del)
311311 _____|____ ____|________
312312 | | | subfunction |
313− | PCI NIC |---- activate/deactive events---->| host driver |
313+ | PCI NIC |--- activate/deactivate events--->| host driver |
314314 |__________| | (mlx5_core) |
315315 |_____________|
316316
@@ -320,7 +320,7 @@ Subfunction is created using devlink port interface. · 3 unmodified lines
320320
321321 $ devlink dev eswitch set pci/0000:06:00.0 mode switchdev
322322
323−- Add a devlink port of subfunction flaovur::
323+- Add a devlink port of subfunction flavour::
324324
325325 $ devlink port add pci/0000:06:00.0 flavour pcisf pfnum 0 sfnum 88
326326 pci/0000:06:00.0/32768: type eth netdev eth6 flavour pcisf controller 0 pfnum 0 sfnum 88 external false splittable false
@@ -351,46 +351,30 @@ driver. · 24 unmodified lines
351351
352352 MAC address setup
353353 -----------------
354−mlx5 driver provides mechanism to setup the MAC address of the PCI VF/SF.
354+mlx5 driver support devlink port function attr mechanism to setup MAC
355+address. (refer to Documentation/networking/devlink/devlink-port.rst)
355356
356−The configured MAC address of the PCI VF/SF will be used by netdevice and rdma
357−device created for the PCI VF/SF.
357+RoCE capability setup
358+---------------------
359+Not all mlx5 PCI devices/SFs require RoCE capability.
358360
359−- Get the MAC address of the VF identified by its unique devlink port index::
361+When RoCE capability is disabled, it saves 1 Mbytes worth of system memory per
362+PCI devices/SF.
360363
361− $ devlink port show pci/0000:06:00.0/2
362− pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
363− function:
364− hw_addr 00:00:00:00:00:00
365−
366−- Set the MAC address of the VF identified by its unique devlink port index::
367−
368− $ devlink port function set pci/0000:06:00.0/2 hw_addr 00:11:22:33:44:55
369−
370− $ devlink port show pci/0000:06:00.0/2
371− pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
372− function:
373− hw_addr 00:11:22:33:44:55
364+mlx5 driver support devlink port function attr mechanism to setup RoCE
365+capability. (refer to Documentation/networking/devlink/devlink-port.rst)
374366
375−- Get the MAC address of the SF identified by its unique devlink port index::
367+migratable capability setup
368+---------------------------
369+User who wants mlx5 PCI VFs to be able to perform live migration need to
370+explicitly enable the VF migratable capability.
376371
377− $ devlink port show pci/0000:06:00.0/32768
378− pci/0000:06:00.0/32768: type eth netdev enp6s0pf0sf88 flavour pcisf pfnum 0 sfnum 88
379− function:
380− hw_addr 00:00:00:00:00:00
381−
382−- Set the MAC address of the VF identified by its unique devlink port index::
383−
384− $ devlink port function set pci/0000:06:00.0/32768 hw_addr 00:00:00:00:88:88
385−
386− $ devlink port show pci/0000:06:00.0/32768
387− pci/0000:06:00.0/32768: type eth netdev enp6s0pf0sf88 flavour pcivf pfnum 0 sfnum 88
388− function:
389− hw_addr 00:00:00:00:88:88
372+mlx5 driver support devlink port function attr mechanism to setup migratable
373+capability. (refer to Documentation/networking/devlink/devlink-port.rst)
390374
391375 SF state setup
392376 --------------
393−To use the SF, the user must active the SF using the SF function state
377+To use the SF, the user must activate the SF using the SF function state
394378 attribute.
395379
396380 - Get the state of the SF identified by its unique devlink port index::
@@ -447,7 +431,7 @@ for it. · 50 unmodified lines
447431
448432 Additionally, the SF port also gets the event when the driver attaches to the
449433 auxiliary device of the subfunction. This results in changing the operational
450−state of the function. This provides visiblity to the user to decide when is it
434+state of the function. This provides visibility to the user to decide when is it
451435 safe to delete the SF port for graceful termination of the subfunction.
452436
453437 - Show the SF port operational state::
@@ -464,14 +448,14 @@ tx reporter · 10 unmodified lines
464448 -----------
465449 The tx reporter is responsible for reporting and recovering of the following two error scenarios:
466450
467−- TX timeout
451+- tx timeout
468452 Report on kernel tx timeout detection.
469453 Recover by searching lost interrupts.
470−- TX error completion
454+- tx error completion
471455 Report on error tx completion.
472− Recover by flushing the TX queue and reset it.
456+ Recover by flushing the tx queue and reset it.
473457
474−TX reporter also support on demand diagnose callback, on which it provides
458+tx reporter also support on demand diagnose callback, on which it provides
475459 real time information of its send queues status.
476460
477461 User commands examples:
@@ -491,32 +475,32 @@ rx reporter · 13 unmodified lines
491475 -----------
492476 The rx reporter is responsible for reporting and recovering of the following two error scenarios:
493477
494−- RX queues initialization (population) timeout
495− RX queues descriptors population on ring initialization is done in
496− napi context via triggering an irq, in case of a failure to get
497− the minimum amount of descriptors, a timeout would occur and it
498− could be recoverable by polling the EQ (Event Queue).
499−- RX completions with errors (reported by HW on interrupt context)
478+- rx queues' initialization (population) timeout
479+ Population of rx queues' descriptors on ring initialization is done
480+ in napi context via triggering an irq. In case of a failure to get
481+ the minimum amount of descriptors, a timeout would occur, and
482+ descriptors could be recovered by polling the EQ (Event Queue).
483+- rx completions with errors (reported by HW on interrupt context)
500484 Report on rx completion error.
501485 Recover (if needed) by flushing the related queue and reset it.
502486
503−RX reporter also supports on demand diagnose callback, on which it
504−provides real time information of its receive queues status.
487+rx reporter also supports on demand diagnose callback, on which it
488+provides real time information of its receive queues' status.
505489
506−- Diagnose rx queues status, and corresponding completion queue::
490+- Diagnose rx queues' status and corresponding completion queue::
507491
508492 $ devlink health diagnose pci/0000:82:00.0 reporter rx
509493
510−NOTE: This command has valid output only when interface is up, otherwise the command has empty output.
494+NOTE: This command has valid output only when interface is up. Otherwise, the command has empty output.
511495
512496 - Show number of rx errors indicated, number of recover flows ended successfully,
513− is autorecover enabled and graceful period from last recover::
497+ is autorecover enabled, and graceful period from last recover::
514498
515499 $ devlink health show pci/0000:82:00.0 reporter rx
516500
517501 fw reporter
518502 -----------
519−The fw reporter implements diagnose and dump callbacks.
503+The fw reporter implements `diagnose` and `dump` callbacks.
520504 It follows symptoms of fw error such as fw syndrome by triggering
521505 fw core dump and storing it into the dump buffer.
522506 The fw reporter diagnose command can be triggered any time by the user to check
@@ -537,7 +521,7 @@ running it on other PF or any VF will return "Operation not permitted". · 14 unmodified lines
537521
538522 fw fatal reporter
539523 -----------------
540−The fw fatal reporter implements dump and recover callbacks.
524+The fw fatal reporter implements `dump` and `recover` callbacks.
541525 It follows fatal errors indications by CR-space dump and recover flow.
542526 The CR-space dump uses vsc interface which is valid even if the FW command
543527 interface is not functional, which is the case in most FW fatal errors.
@@ -552,7 +536,7 @@ User commands examples: · 8 unmodified lines
552536
553537 $ devlink health recover pci/0000:82:00.0 reporter fw_fatal
554538
555−- Read FW CR-space dump if already strored or trigger new one::
539+- Read FW CR-space dump if already stored or trigger new one::
556540
557541 $ devlink health dump show pci/0000:82:00.1 reporter fw_fatal
558542
@@ -561,10 +545,10 @@ NOTE: This command can run only on PF. · 2 unmodified lines
561545 mlx5 tracepoints
562546 ================
563547
564−mlx5 driver provides internal trace points for tracking and debugging using
548+mlx5 driver provides internal tracepoints for tracking and debugging using
565549 kernel tracepoints interfaces (refer to Documentation/trace/ftrace.rst).
566550
567−For the list of support mlx5 events check /sys/kernel/debug/tracing/events/mlx5/
551+For the list of support mlx5 events, check `/sys/kernel/debug/tracing/events/mlx5/`.
568552
569553 tc and eswitch offloads tracepoints:
570554
Documentation/networking/device_drivers/ethernet/netronome/nfp.rst+145−20
@@ -1,50 +1,57 @@
11 .. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+.. include:: <isonum.txt>
23
3−=============================================
4−Netronome Flow Processor (NFP) Kernel Drivers
5−=============================================
4+===========================================
5+Network Flow Processor (NFP) Kernel Drivers
6+===========================================
67
7−Copyright (c) 2019, Netronome Systems, Inc.
8+:Copyright: |copy| 2019, Netronome Systems, Inc.
9+:Copyright: |copy| 2022, Corigine, Inc.
810
911 Contents
1012 ========
1113
1214 - `Overview`_
1315 - `Acquiring Firmware`_
16+- `Devlink Info`_
17+- `Configure Device`_
18+- `Statistics`_
1419
1520 Overview
1621 ========
1722
18−This driver supports Netronome's line of Flow Processor devices,
19−including the NFP4000, NFP5000, and NFP6000 models, which are also
20−incorporated in the company's family of Agilio SmartNICs. The SR-IOV
21−physical and virtual functions for these devices are supported by
22−the driver.
23+This driver supports Netronome and Corigine's line of Network Flow Processor
24+devices, including the NFP3800, NFP4000, NFP5000, and NFP6000 models, which
25+are also incorporated in the companies' family of Agilio SmartNICs. The SR-IOV
26+physical and virtual functions for these devices are supported by the driver.
2327
2428 Acquiring Firmware
2529 ==================
2630
27−The NFP4000 and NFP6000 devices require application specific firmware
28−to function. Application firmware can be located either on the host file system
31+The NFP3800, NFP4000 and NFP6000 devices require application specific firmware
32+to function. Application firmware can be located either on the host file system
2933 or in the device flash (if supported by management firmware).
3034
3135 Firmware files on the host filesystem contain card type (`AMDA-*` string), media
32−config etc. They should be placed in `/lib/firmware/netronome` directory to
36+config etc. They should be placed in `/lib/firmware/netronome` directory to
3337 load firmware from the host file system.
3438
3539 Firmware for basic NIC operation is available in the upstream
3640 `linux-firmware.git` repository.
3741
42+A more comprehensive list of firmware can be downloaded from the
43+`Corigine Support site <https://www.corigine.com/DPUDownload.html>`_.
44+
3845 Firmware in NVRAM
3946 -----------------
4047
4148 Recent versions of management firmware supports loading application
42−firmware from flash when the host driver gets probed. The firmware loading
49+firmware from flash when the host driver gets probed. The firmware loading
4350 policy configuration may be used to configure this feature appropriately.
4451
4552 Devlink or ethtool can be used to update the application firmware on the device
4653 flash by providing the appropriate `nic_AMDA*.nffw` file to the respective
47−command. Users need to take care to write the correct firmware image for the
54+command. Users need to take care to write the correct firmware image for the
4855 card and media configuration to flash.
4956
5057 Available storage space in flash depends on the card being used.
@@ -79,9 +86,9 @@ You may need to use hard instead of symbolic links on distributions · 28 unmodified lines
7986 which use old `mkinitrd` command instead of `dracut` (e.g. Ubuntu).
8087
8188 After changing firmware files you may need to regenerate the initramfs
82−image. Initramfs contains drivers and firmware files your system may
83−need to boot. Refer to the documentation of your distribution to find
84−out how to update initramfs. Good indication of stale initramfs
89+image. Initramfs contains drivers and firmware files your system may
90+need to boot. Refer to the documentation of your distribution to find
91+out how to update initramfs. Good indication of stale initramfs
8592 is system loading wrong driver or firmware on boot, but when driver is
8693 later reloaded manually everything works correctly.
8794
@@ -89,9 +96,9 @@ Selecting firmware per device · 1 unmodified line
8996 -----------------------------
9097
9198 Most commonly all cards on the system use the same type of firmware.
92−If you want to load specific firmware image for a specific card, you
93−can use either the PCI bus address or serial number. Driver will print
94−which files it's looking for when it recognizes a NFP device::
99+If you want to load a specific firmware image for a specific card, you
100+can use either the PCI bus address or serial number. The driver will
101+print which files it's looking for when it recognizes a NFP device::
95102
96103 nfp: Looking for firmware file in order of priority:
97104 nfp: netronome/serial-00-12-34-aa-bb-cc-10-ff.nffw: not found
@@ -106,6 +113,15 @@ Note that `serial-*` and `pci-*` files are **not** automatically included · 8 unmodified lines
106113 in initramfs, you will have to refer to documentation of appropriate tools
107114 to find out how to include them.
108115
116+Running firmware version
117+------------------------
118+
119+The version of the loaded firmware for a particular <netdev> interface,
120+(e.g. enp4s0), or an interface's port <netdev port> (e.g. enp4s0np0) can
121+be displayed with the ethtool command::
122+
123+ $ ethtool -i <netdev>
124+
109125 Firmware loading policy
110126 -----------------------
111127
@@ -132,6 +148,115 @@ abi_drv_load_ifc · 20 unmodified lines
132148 Defines a list of PF devices allowed to load FW on the device.
133149 This variable is not currently user configurable.
134150
151+Devlink Info
152+============
153+
154+The devlink info command displays the running and stored firmware versions
155+on the device, serial number and board information.
156+
157+Devlink info command example (replace PCI address)::
158+
159+ $ devlink dev info pci/0000:03:00.0
160+ pci/0000:03:00.0:
161+ driver nfp
162+ serial_number CSAAMDA2001-1003000111
163+ versions:
164+ fixed:
165+ board.id AMDA2001-1003
166+ board.rev 01
167+ board.manufacture CSA
168+ board.model mozart
169+ running:
170+ fw.mgmt 22.10.0-rc3
171+ fw.cpld 0x1000003
172+ fw.app nic-22.09.0
173+ chip.init AMDA-2001-1003 1003000111
174+ stored:
175+ fw.bundle_id bspbundle_1003000111
176+ fw.mgmt 22.10.0-rc3
177+ fw.cpld 0x0
178+ chip.init AMDA-2001-1003 1003000111
179+
180+Configure Device
181+================
182+
183+This section explains how to use Agilio SmartNICs running basic NIC firmware.
184+
185+Configure interface link-speed
186+------------------------------
187+The following steps explains how to change between 10G mode and 25G mode on
188+Agilio CX 2x25GbE cards. The changing of port speed must be done in order,
189+port 0 (p0) must be set to 10G before port 1 (p1) may be set to 10G.
190+
191+Down the respective interface(s)::
192+
193+ $ ip link set dev <netdev port 0> down
194+ $ ip link set dev <netdev port 1> down
195+
196+Set interface link-speed to 10G::
197+
198+ $ ethtool -s <netdev port 0> speed 10000
199+ $ ethtool -s <netdev port 1> speed 10000
200+
201+Set interface link-speed to 25G::
202+
203+ $ ethtool -s <netdev port 0> speed 25000
204+ $ ethtool -s <netdev port 1> speed 25000
205+
206+Reload driver for changes to take effect::
207+
208+ $ rmmod nfp; modprobe nfp
209+
210+Configure interface Maximum Transmission Unit (MTU)
211+---------------------------------------------------
212+
213+The MTU of interfaces can temporarily be set using the iproute2, ip link or
214+ifconfig tools. Note that this change will not persist. Setting this via
215+Network Manager, or another appropriate OS configuration tool, is
216+recommended as changes to the MTU using Network Manager can be made to
217+persist.
218+
219+Set interface MTU to 9000 bytes::
220+
221+ $ ip link set dev <netdev port> mtu 9000
222+
223+It is the responsibility of the user or the orchestration layer to set
224+appropriate MTU values when handling jumbo frames or utilizing tunnels. For
225+example, if packets sent from a VM are to be encapsulated on the card and
226+egress a physical port, then the MTU of the VF should be set to lower than
227+that of the physical port to account for the extra bytes added by the
228+additional header. If a setup is expected to see fallback traffic between
229+the SmartNIC and the kernel then the user should also ensure that the PF MTU
230+is appropriately set to avoid unexpected drops on this path.
231+
232+Configure Forward Error Correction (FEC) modes
233+----------------------------------------------
234+
235+Agilio SmartNICs support FEC mode configuration, e.g. Auto, Firecode Base-R,
236+ReedSolomon and Off modes. Each physical port's FEC mode can be set
237+independently using ethtool. The supported FEC modes for an interface can
238+be viewed using::
239+
240+ $ ethtool <netdev>
241+
242+The currently configured FEC mode can be viewed using::
243+
244+ $ ethtool --show-fec <netdev>
245+
246+To force the FEC mode for a particular port, auto-negotiation must be disabled
247+(see the `Auto-negotiation`_ section). An example of how to set the FEC mode
248+to Reed-Solomon is::
249+
250+ $ ethtool --set-fec <netdev> encoding rs
251+
252+Auto-negotiation
253+----------------
254+
255+To change auto-negotiation settings, the link must first be put down. After the
256+link is down, auto-negotiation can be enabled or disabled using::
257+
258+ ethtool -s <netdev> autoneg <on|off>
259+
135260 Statistics
136261 ==========
137262
Documentation/networking/devlink/devlink-info.rst+5−0
@@ -198,6 +198,11 @@ fw.bundle_id · 197 unmodified lines
198198
199199 Unique identifier of the entire firmware bundle.
200200
201+fw.bootloader
202+-------------
203+
204+Version of the bootloader.
205+
201206 Future work
202207 ===========
203208
Documentation/networking/devlink/devlink-port.rst+161−7
@@ -110,7 +110,7 @@ devlink ports for both the controllers. · 109 unmodified lines
110110 Function configuration
111111 ======================
112112
113−A user can configure the function attribute before enumerating the PCI
113+Users can configure one or more function attributes before enumerating the PCI
114114 function. Usually it means, user should configure function attribute
115115 before a bus specific device for the function is created. However, when
116116 SRIOV is enabled, virtual function devices are created on the PCI bus.
@@ -119,9 +119,127 @@ function device to the driver. For subfunctions, this means user should · 2 unmodified lines
119119 configure port function attribute before activating the port function.
120120
121121 A user may set the hardware address of the function using
122−'devlink port function set hw_addr' command. For Ethernet port function
122+`devlink port function set hw_addr` command. For Ethernet port function
123123 this means a MAC address.
124124
125+Users may also set the RoCE capability of the function using
126+`devlink port function set roce` command.
127+
128+Users may also set the function as migratable using
129+'devlink port function set migratable' command.
130+
131+Function attributes
132+===================
133+
134+MAC address setup
135+-----------------
136+The configured MAC address of the PCI VF/SF will be used by netdevice and rdma
137+device created for the PCI VF/SF.
138+
139+- Get the MAC address of the VF identified by its unique devlink port index::
140+
141+ $ devlink port show pci/0000:06:00.0/2
142+ pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
143+ function:
144+ hw_addr 00:00:00:00:00:00
145+
146+- Set the MAC address of the VF identified by its unique devlink port index::
147+
148+ $ devlink port function set pci/0000:06:00.0/2 hw_addr 00:11:22:33:44:55
149+
150+ $ devlink port show pci/0000:06:00.0/2
151+ pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
152+ function:
153+ hw_addr 00:11:22:33:44:55
154+
155+- Get the MAC address of the SF identified by its unique devlink port index::
156+
157+ $ devlink port show pci/0000:06:00.0/32768
158+ pci/0000:06:00.0/32768: type eth netdev enp6s0pf0sf88 flavour pcisf pfnum 0 sfnum 88
159+ function:
160+ hw_addr 00:00:00:00:00:00
161+
162+- Set the MAC address of the SF identified by its unique devlink port index::
163+
164+ $ devlink port function set pci/0000:06:00.0/32768 hw_addr 00:00:00:00:88:88
165+
166+ $ devlink port show pci/0000:06:00.0/32768
167+ pci/0000:06:00.0/32768: type eth netdev enp6s0pf0sf88 flavour pcisf pfnum 0 sfnum 88
168+ function:
169+ hw_addr 00:00:00:00:88:88
170+
171+RoCE capability setup
172+---------------------
173+Not all PCI VFs/SFs require RoCE capability.
174+
175+When RoCE capability is disabled, it saves system memory per PCI VF/SF.
176+
177+When user disables RoCE capability for a VF/SF, user application cannot send or
178+receive any RoCE packets through this VF/SF and RoCE GID table for this PCI
179+will be empty.
180+
181+When RoCE capability is disabled in the device using port function attribute,
182+VF/SF driver cannot override it.
183+
184+- Get RoCE capability of the VF device::
185+
186+ $ devlink port show pci/0000:06:00.0/2
187+ pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
188+ function:
189+ hw_addr 00:00:00:00:00:00 roce enable
190+
191+- Set RoCE capability of the VF device::
192+
193+ $ devlink port function set pci/0000:06:00.0/2 roce disable
194+
195+ $ devlink port show pci/0000:06:00.0/2
196+ pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
197+ function:
198+ hw_addr 00:00:00:00:00:00 roce disable
199+
200+migratable capability setup
201+---------------------------
202+Live migration is the process of transferring a live virtual machine
203+from one physical host to another without disrupting its normal
204+operation.
205+
206+User who want PCI VFs to be able to perform live migration need to
207+explicitly enable the VF migratable capability.
208+
209+When user enables migratable capability for a VF, and the HV binds the VF to VFIO driver
210+with migration support, the user can migrate the VM with this VF from one HV to a
211+different one.
212+
213+However, when migratable capability is enable, device will disable features which cannot
214+be migrated. Thus migratable cap can impose limitations on a VF so let the user decide.
215+
216+Example of LM with migratable function configuration:
217+- Get migratable capability of the VF device::
218+
219+ $ devlink port show pci/0000:06:00.0/2
220+ pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
221+ function:
222+ hw_addr 00:00:00:00:00:00 migratable disable
223+
224+- Set migratable capability of the VF device::
225+
226+ $ devlink port function set pci/0000:06:00.0/2 migratable enable
227+
228+ $ devlink port show pci/0000:06:00.0/2
229+ pci/0000:06:00.0/2: type eth netdev enp6s0pf0vf1 flavour pcivf pfnum 0 vfnum 1
230+ function:
231+ hw_addr 00:00:00:00:00:00 migratable enable
232+
233+- Bind VF to VFIO driver with migration support::
234+
235+ $ echo <pci_id> > /sys/bus/pci/devices/0000:08:00.0/driver/unbind
236+ $ echo mlx5_vfio_pci > /sys/bus/pci/devices/0000:08:00.0/driver_override
237+ $ echo <pci_id> > /sys/bus/pci/devices/0000:08:00.0/driver/bind
238+
239+Attach VF to the VM.
240+Start the VM.
241+Perform live migration.
242+
125243 Subfunction
126244 ============
127245
@@ -130,10 +248,11 @@ it is deployed. Subfunction is created and deployed in unit of 1. Unlike · 2 unmodified lines
130248 SRIOV VFs, a subfunction doesn't require its own PCI virtual function.
131249 A subfunction communicates with the hardware through the parent PCI function.
132250
133−To use a subfunction, 3 steps setup sequence is followed.
134−(1) create - create a subfunction;
135−(2) configure - configure subfunction attributes;
136−(3) deploy - deploy the subfunction;
251+To use a subfunction, 3 steps setup sequence is followed:
252+
253+1) create - create a subfunction;
254+2) configure - configure subfunction attributes;
255+3) deploy - deploy the subfunction;
137256
138257 Subfunction management is done using devlink port user interface.
139258 User performs setup on the subfunction management device.
@@ -191,13 +310,48 @@ API allows to configure following rate object's parameters: · 51 unmodified lines
191310 ``tx_max``
192311 Maximum TX rate value.
193312
313+``tx_priority``
314+ Allows for usage of strict priority arbiter among siblings. This
315+ arbitration scheme attempts to schedule nodes based on their priority
316+ as long as the nodes remain within their bandwidth limit. The higher the
317+ priority the higher the probability that the node will get selected for
318+ scheduling.
319+
320+``tx_weight``
321+ Allows for usage of Weighted Fair Queuing arbitration scheme among
322+ siblings. This arbitration scheme can be used simultaneously with the
323+ strict priority. As a node is configured with a higher rate it gets more
324+ BW relative to it's siblings. Values are relative like a percentage
325+ points, they basically tell how much BW should node take relative to
326+ it's siblings.
327+
194328 ``parent``
195329 Parent node name. Parent node rate limits are considered as additional limits
196330 to all node children limits. ``tx_max`` is an upper limit for children.
197331 ``tx_share`` is a total bandwidth distributed among children.
198332
333+``tx_priority`` and ``tx_weight`` can be used simultaneously. In that case
334+nodes with the same priority form a WFQ subgroup in the sibling group
335+and arbitration among them is based on assigned weights.
336+
337+Arbitration flow from the high level:
338+
339+#. Choose a node, or group of nodes with the highest priority that stays
340+ within the BW limit and are not blocked. Use ``tx_priority`` as a
341+ parameter for this arbitration.
342+
343+#. If group of nodes have the same priority perform WFQ arbitration on
344+ that subgroup. Use ``tx_weight`` as a parameter for this arbitration.
345+
346+#. Select the winner node, and continue arbitration flow among it's children,
347+ until leaf node is reached, and the winner is established.
348+
349+#. If all the nodes from the highest priority sub-group are satisfied, or
350+ overused their assigned BW, move to the lower priority nodes.
351+
199352 Driver implementations are allowed to support both or either rate object types
200−and setting methods of their parameters.
353+and setting methods of their parameters. Additionally driver implementation
354+may export nodes/leafs and their child-parent relationships.
201355
202356 Terms and Definitions
203357 =====================
Documentation/networking/devlink/devlink-region.rst+13−0
@@ -31,6 +31,15 @@ in its ``devlink_region_ops`` structure. If snapshot id is not set in · 30 unmodified lines
3131 the ``DEVLINK_CMD_REGION_NEW`` request kernel will allocate one and send
3232 the snapshot information to user space.
3333
34+Regions may optionally allow directly reading from their contents without a
35+snapshot. Direct read requests are not atomic. In particular a read request
36+of size 256 bytes or larger will be split into multiple chunks. If atomic
37+access is required, use a snapshot. A driver wishing to enable this for a
38+region should implement the ``.read`` callback in the ``devlink_region_ops``
39+structure. User space can request a direct read by using the
40+``DEVLINK_ATTR_REGION_DIRECT`` attribute instead of specifying a snapshot
41+id.
42+
3443 example usage
3544 -------------
3645
@@ -65,6 +74,10 @@ example usage · 28 unmodified lines
6574 $ devlink region read pci/0000:00:05.0/fw-health snapshot 1 address 0 length 16
6675 0000000000000000 0014 95dc 0014 9514 0035 1670 0034 db30
6776
77+ # Read from the region without a snapshot
78+ $ devlink region read pci/0000:00:05.0/fw-health address 16 length 16
79+ 0000000000000010 0000 0000 ffff ff04 0029 8c00 0028 8cc8
80+
6881 As regions are likely very device or driver specific, no generic regions are
6982 defined. See the driver-specific documentation files for information on the
7083 specific regions a driver supports.
Documentation/networking/devlink/devlink-trap.rst+13−0
@@ -485,6 +485,16 @@ be added to the following table: · 484 unmodified lines
485485 - Traps incoming packets that the device decided to drop because
486486 the destination MAC is not configured in the MAC table and
487487 the interface is not in promiscuous mode
488+ * - ``eapol``
489+ - ``control``
490+ - Traps "Extensible Authentication Protocol over LAN" (EAPOL) packets
491+ specified in IEEE 802.1X
492+ * - ``locked_port``
493+ - ``drop``
494+ - Traps packets that the device decided to drop because they failed the
495+ locked bridge port check. That is, packets that were received via a
496+ locked port and whose {SMAC, VID} does not correspond to an FDB entry
497+ pointing to the port
488498
489499 Driver-specific Packet Traps
490500 ============================
@@ -589,6 +599,9 @@ narrow. The description of these groups must be added to the following table: · 98 unmodified lines
589599 * - ``parser_error_drops``
590600 - Contains packet traps for packets that were marked by the device during
591601 parsing as erroneous
602+ * - ``eapol``
603+ - Contains packet traps for "Extensible Authentication Protocol over LAN"
604+ (EAPOL) packets specified in IEEE 802.1X
592605
593606 Packet Trap Policers
594607 ====================
Documentation/networking/devlink/etas_es58x.rst+36−0
@@ -0,0 +1,36 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+==========================
4+etas_es58x devlink support
5+==========================
6+
7+This document describes the devlink features implemented by the
8+``etas_es58x`` device driver.
9+
10+Info versions
11+=============
12+
13+The ``etas_es58x`` driver reports the following versions
14+
15+.. list-table:: devlink info versions implemented
16+ :widths: 5 5 90
17+
18+ * - Name
19+ - Type
20+ - Description
21+ * - ``fw``
22+ - running
23+ - Version of the firmware running on the device. Also available
24+ through ``ethtool -i`` as the first member of the
25+ ``firmware-version``.
26+ * - ``fw.bootloader``
27+ - running
28+ - Version of the bootloader running on the device. Also available
29+ through ``ethtool -i`` as the second member of the
30+ ``firmware-version``.
31+ * - ``board.rev``
32+ - fixed
33+ - The hardware revision of the device.
34+ * - ``serial_number``
35+ - fixed
36+ - The USB serial number. Also available through ``lsusb -v``.
Documentation/networking/devlink/ice.rst+126−2
@@ -189,12 +189,21 @@ device data. · 188 unmodified lines
189189 * - ``nvm-flash``
190190 - The contents of the entire flash chip, sometimes referred to as
191191 the device's Non Volatile Memory.
192+ * - ``shadow-ram``
193+ - The contents of the Shadow RAM, which is loaded from the beginning
194+ of the flash. Although the contents are primarily from the flash,
195+ this area also contains data generated during device boot which is
196+ not stored in flash.
192197 * - ``device-caps``
193198 - The contents of the device firmware's capabilities buffer. Useful to
194199 determine the current state and configuration of the device.
195200
196−Users can request an immediate capture of a snapshot via the
197−``DEVLINK_CMD_REGION_NEW``
201+Both the ``nvm-flash`` and ``shadow-ram`` regions can be accessed without a
202+snapshot. The ``device-caps`` region requires a snapshot as the contents are
203+sent by firmware and can't be split into separate reads.
204+
205+Users can request an immediate capture of a snapshot for all three regions
206+via the ``DEVLINK_CMD_REGION_NEW`` command.
198207
199208 .. code:: shell
200209
@@ -254,3 +263,118 @@ Users can request an immediate capture of a snapshot via the · 53 unmodified lines
254263 0000000000000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
255264
256265 $ devlink region delete pci/0000:01:00.0/device-caps snapshot 1
266+
267+Devlink Rate
268+============
269+
270+The ``ice`` driver implements devlink-rate API. It allows for offload of
271+the Hierarchical QoS to the hardware. It enables user to group Virtual
272+Functions in a tree structure and assign supported parameters: tx_share,
273+tx_max, tx_priority and tx_weight to each node in a tree. So effectively
274+user gains an ability to control how much bandwidth is allocated for each
275+VF group. This is later enforced by the HW.
276+
277+It is assumed that this feature is mutually exclusive with DCB performed
278+in FW and ADQ, or any driver feature that would trigger changes in QoS,
279+for example creation of the new traffic class. The driver will prevent DCB
280+or ADQ configuration if user started making any changes to the nodes using
281+devlink-rate API. To configure those features a driver reload is necessary.
282+Correspondingly if ADQ or DCB will get configured the driver won't export
283+hierarchy at all, or will remove the untouched hierarchy if those
284+features are enabled after the hierarchy is exported, but before any
285+changes are made.
286+
287+This feature is also dependent on switchdev being enabled in the system.
288+It's required bacause devlink-rate requires devlink-port objects to be
289+present, and those objects are only created in switchdev mode.
290+
291+If the driver is set to the switchdev mode, it will export internal
292+hierarchy the moment VF's are created. Root of the tree is always
293+represented by the node_0. This node can't be deleted by the user. Leaf
294+nodes and nodes with children also can't be deleted.
295+
296+.. list-table:: Attributes supported
297+ :widths: 15 85
298+
299+ * - Name
300+ - Description
301+ * - ``tx_max``
302+ - maximum bandwidth to be consumed by the tree Node. Rate Limit is
303+ an absolute number specifying a maximum amount of bytes a Node may
304+ consume during the course of one second. Rate limit guarantees
305+ that a link will not oversaturate the receiver on the remote end
306+ and also enforces an SLA between the subscriber and network
307+ provider.
308+ * - ``tx_share``
309+ - minimum bandwidth allocated to a tree node when it is not blocked.
310+ It specifies an absolute BW. While tx_max defines the maximum
311+ bandwidth the node may consume, the tx_share marks committed BW
312+ for the Node.
313+ * - ``tx_priority``
314+ - allows for usage of strict priority arbiter among siblings. This
315+ arbitration scheme attempts to schedule nodes based on their
316+ priority as long as the nodes remain within their bandwidth limit.
317+ Range 0-7. Nodes with priority 7 have the highest priority and are
318+ selected first, while nodes with priority 0 have the lowest
319+ priority. Nodes that have the same priority are treated equally.
320+ * - ``tx_weight``
321+ - allows for usage of Weighted Fair Queuing arbitration scheme among
322+ siblings. This arbitration scheme can be used simultaneously with
323+ the strict priority. Range 1-200. Only relative values mater for
324+ arbitration.
325+
326+``tx_priority`` and ``tx_weight`` can be used simultaneously. In that case
327+nodes with the same priority form a WFQ subgroup in the sibling group
328+and arbitration among them is based on assigned weights.
329+
330+.. code:: shell
331+
332+ # enable switchdev
333+ $ devlink dev eswitch set pci/0000:4b:00.0 mode switchdev
334+
335+ # at this point driver should export internal hierarchy
336+ $ echo 2 > /sys/class/net/ens785np0/device/sriov_numvfs
337+
338+ $ devlink port function rate show
339+ pci/0000:4b:00.0/node_25: type node parent node_24
340+ pci/0000:4b:00.0/node_24: type node parent node_0
341+ pci/0000:4b:00.0/node_32: type node parent node_31
342+ pci/0000:4b:00.0/node_31: type node parent node_30
343+ pci/0000:4b:00.0/node_30: type node parent node_16
344+ pci/0000:4b:00.0/node_19: type node parent node_18
345+ pci/0000:4b:00.0/node_18: type node parent node_17
346+ pci/0000:4b:00.0/node_17: type node parent node_16
347+ pci/0000:4b:00.0/node_14: type node parent node_5
348+ pci/0000:4b:00.0/node_5: type node parent node_3
349+ pci/0000:4b:00.0/node_13: type node parent node_4
350+ pci/0000:4b:00.0/node_12: type node parent node_4
351+ pci/0000:4b:00.0/node_11: type node parent node_4
352+ pci/0000:4b:00.0/node_10: type node parent node_4
353+ pci/0000:4b:00.0/node_9: type node parent node_4
354+ pci/0000:4b:00.0/node_8: type node parent node_4
355+ pci/0000:4b:00.0/node_7: type node parent node_4
356+ pci/0000:4b:00.0/node_6: type node parent node_4
357+ pci/0000:4b:00.0/node_4: type node parent node_3
358+ pci/0000:4b:00.0/node_3: type node parent node_16
359+ pci/0000:4b:00.0/node_16: type node parent node_15
360+ pci/0000:4b:00.0/node_15: type node parent node_0
361+ pci/0000:4b:00.0/node_2: type node parent node_1
362+ pci/0000:4b:00.0/node_1: type node parent node_0
363+ pci/0000:4b:00.0/node_0: type node
364+ pci/0000:4b:00.0/1: type leaf parent node_25
365+ pci/0000:4b:00.0/2: type leaf parent node_25
366+
367+ # let's create some custom node
368+ $ devlink port function rate add pci/0000:4b:00.0/node_custom parent node_0
369+
370+ # second custom node
371+ $ devlink port function rate add pci/0000:4b:00.0/node_custom_1 parent node_custom
372+
373+ # reassign second VF to newly created branch
374+ $ devlink port function rate set pci/0000:4b:00.0/2 parent node_custom_1
375+
376+ # assign tx_weight to the VF
377+ $ devlink port function rate set pci/0000:4b:00.0/2 tx_weight 5
378+
379+ # assign tx_share to the VF
380+ $ devlink port function rate set pci/0000:4b:00.0/2 tx_share 500Mbps
Documentation/networking/ethtool-netlink.rst+31−1
@@ -222,6 +222,7 @@ Userspace to kernel: · 221 unmodified lines
222222 ``ETHTOOL_MSG_MODULE_GET`` get transceiver module parameters
223223 ``ETHTOOL_MSG_PSE_SET`` set PSE parameters
224224 ``ETHTOOL_MSG_PSE_GET`` get PSE parameters
225+ ``ETHTOOL_MSG_RSS_GET`` get RSS settings
225226 ===================================== =================================
226227
227228 Kernel to userspace:
@@ -263,6 +264,7 @@ Kernel to userspace: · 35 unmodified lines
263264 ``ETHTOOL_MSG_PHC_VCLOCKS_GET_REPLY`` PHC virtual clocks info
264265 ``ETHTOOL_MSG_MODULE_GET_REPLY`` transceiver module parameters
265266 ``ETHTOOL_MSG_PSE_GET_REPLY`` PSE parameters
267+ ``ETHTOOL_MSG_RSS_GET_REPLY`` RSS settings
266268 ======================================== =================================
267269
268270 ``GET`` requests are sent by userspace applications to retrieve device
@@ -491,6 +493,7 @@ Kernel response contents: · 222 unmodified lines
491493 ``ETHTOOL_A_LINKSTATE_SQI_MAX`` u32 Max support SQI value
492494 ``ETHTOOL_A_LINKSTATE_EXT_STATE`` u8 link extended state
493495 ``ETHTOOL_A_LINKSTATE_EXT_SUBSTATE`` u8 link extended substate
496+ ``ETHTOOL_A_LINKSTATE_EXT_DOWN_CNT`` u32 count of link down events
494497 ==================================== ====== ============================
495498
496499 For most NIC drivers, the value of ``ETHTOOL_A_LINKSTATE_LINK`` returns
@@ -1686,6 +1689,33 @@ to control PoDL PSE Admin functions. This option is implementing · 1189 unmodified lines
16861689 ``IEEE 802.3-2018`` 30.15.1.2.1 acPoDLPSEAdminControl. See
16871690 ``ETHTOOL_A_PODL_PSE_ADMIN_STATE`` for supported values.
16881691
1692+RSS_GET
1693+=======
1694+
1695+Get indirection table, hash key and hash function info associated with a
1696+RSS context of an interface similar to ``ETHTOOL_GRSSH`` ioctl request.
1697+
1698+Request contents:
1699+
1700+===================================== ====== ==========================
1701+ ``ETHTOOL_A_RSS_HEADER`` nested request header
1702+ ``ETHTOOL_A_RSS_CONTEXT`` u32 context number
1703+===================================== ====== ==========================
1704+
1705+Kernel response contents:
1706+
1707+===================================== ====== ==========================
1708+ ``ETHTOOL_A_RSS_HEADER`` nested reply header
1709+ ``ETHTOOL_A_RSS_HFUNC`` u32 RSS hash func
1710+ ``ETHTOOL_A_RSS_INDIR`` binary Indir table bytes
1711+ ``ETHTOOL_A_RSS_HKEY`` binary Hash key bytes
1712+===================================== ====== ==========================
1713+
1714+ETHTOOL_A_RSS_HFUNC attribute is bitmap indicating the hash function
1715+being used. Current supported options are toeplitz, xor or crc32.
1716+ETHTOOL_A_RSS_INDIR attribute returns RSS indrection table where each byte
1717+indicates queue number.
1718+
16891719 Request translation
16901720 ===================
16911721
@@ -1767,7 +1797,7 @@ are netlink only. · 75 unmodified lines
17671797 ``ETHTOOL_GMODULEEEPROM`` ``ETHTOOL_MSG_MODULE_EEPROM_GET``
17681798 ``ETHTOOL_GEEE`` ``ETHTOOL_MSG_EEE_GET``
17691799 ``ETHTOOL_SEEE`` ``ETHTOOL_MSG_EEE_SET``
1770− ``ETHTOOL_GRSSH`` n/a
1800+ ``ETHTOOL_GRSSH`` ``ETHTOOL_MSG_RSS_GET``
17711801 ``ETHTOOL_SRSSH`` n/a
17721802 ``ETHTOOL_GTUNABLE`` n/a
17731803 ``ETHTOOL_STUNABLE`` n/a
Documentation/networking/index.rst+1−0
@@ -104,6 +104,7 @@ Contents: · 103 unmodified lines
104104 switchdev
105105 sysfs-tagging
106106 tc-actions-env-rules
107+ tc-queue-filters
107108 tcp-thin
108109 team
109110 timestamping
Documentation/networking/ip-sysctl.rst+111−0
@@ -1069,6 +1069,81 @@ tcp_child_ehash_entries - INTEGER · 1068 unmodified lines
10691069
10701070 Default: 0
10711071
1072+tcp_plb_enabled - BOOLEAN
1073+ If set and the underlying congestion control (e.g. DCTCP) supports
1074+ and enables PLB feature, TCP PLB (Protective Load Balancing) is
1075+ enabled. PLB is described in the following paper:
1076+ https://doi.org/10.1145/3544216.3544226. Based on PLB parameters,
1077+ upon sensing sustained congestion, TCP triggers a change in
1078+ flow label field for outgoing IPv6 packets. A change in flow label
1079+ field potentially changes the path of outgoing packets for switches
1080+ that use ECMP/WCMP for routing.
1081+
1082+ PLB changes socket txhash which results in a change in IPv6 Flow Label
1083+ field, and currently no-op for IPv4 headers. It is possible
1084+ to apply PLB for IPv4 with other network header fields (e.g. TCP
1085+ or IPv4 options) or using encapsulation where outer header is used
1086+ by switches to determine next hop. In either case, further host
1087+ and switch side changes will be needed.
1088+
1089+ When set, PLB assumes that congestion signal (e.g. ECN) is made
1090+ available and used by congestion control module to estimate a
1091+ congestion measure (e.g. ce_ratio). PLB needs a congestion measure to
1092+ make repathing decisions.
1093+
1094+ Default: FALSE
1095+
1096+tcp_plb_idle_rehash_rounds - INTEGER
1097+ Number of consecutive congested rounds (RTT) seen after which
1098+ a rehash can be performed, given there are no packets in flight.
1099+ This is referred to as M in PLB paper:
1100+ https://doi.org/10.1145/3544216.3544226.
1101+
1102+ Possible Values: 0 - 31
1103+
1104+ Default: 3
1105+
1106+tcp_plb_rehash_rounds - INTEGER
1107+ Number of consecutive congested rounds (RTT) seen after which
1108+ a forced rehash can be performed. Be careful when setting this
1109+ parameter, as a small value increases the risk of retransmissions.
1110+ This is referred to as N in PLB paper:
1111+ https://doi.org/10.1145/3544216.3544226.
1112+
1113+ Possible Values: 0 - 31
1114+
1115+ Default: 12
1116+
1117+tcp_plb_suspend_rto_sec - INTEGER
1118+ Time, in seconds, to suspend PLB in event of an RTO. In order to avoid
1119+ having PLB repath onto a connectivity "black hole", after an RTO a TCP
1120+ connection suspends PLB repathing for a random duration between 1x and
1121+ 2x of this parameter. Randomness is added to avoid concurrent rehashing
1122+ of multiple TCP connections. This should be set corresponding to the
1123+ amount of time it takes to repair a failed link.
1124+
1125+ Possible Values: 0 - 255
1126+
1127+ Default: 60
1128+
1129+tcp_plb_cong_thresh - INTEGER
1130+ Fraction of packets marked with congestion over a round (RTT) to
1131+ tag that round as congested. This is referred to as K in the PLB paper:
1132+ https://doi.org/10.1145/3544216.3544226.
1133+
1134+ The 0-1 fraction range is mapped to 0-256 range to avoid floating
1135+ point operations. For example, 128 means that if at least 50% of
1136+ the packets in a round were marked as congested then the round
1137+ will be tagged as congested.
1138+
1139+ Setting threshold to 0 means that PLB repaths every RTT regardless
1140+ of congestion. This is not intended behavior for PLB and should be
1141+ used only for experimentation purpose.
1142+
1143+ Possible Values: 0 - 256
1144+
1145+ Default: 128
1146+
10721147 UDP variables
10731148 =============
10741149
@@ -1102,6 +1177,33 @@ udp_rmem_min - INTEGER · 27 unmodified lines
11021177 udp_wmem_min - INTEGER
11031178 UDP does not have tx memory accounting and this tunable has no effect.
11041179
1180+udp_hash_entries - INTEGER
1181+ Show the number of hash buckets for UDP sockets in the current
1182+ networking namespace.
1183+
1184+ A negative value means the networking namespace does not own its
1185+ hash buckets and shares the initial networking namespace's one.
1186+
1187+udp_child_ehash_entries - INTEGER
1188+ Control the number of hash buckets for UDP sockets in the child
1189+ networking namespace, which must be set before clone() or unshare().
1190+
1191+ If the value is not 0, the kernel uses a value rounded up to 2^n
1192+ as the actual hash bucket size. 0 is a special value, meaning
1193+ the child networking namespace will share the initial networking
1194+ namespace's hash buckets.
1195+
1196+ Note that the child will use the global one in case the kernel
1197+ fails to allocate enough memory. In addition, the global hash
1198+ buckets are spread over available NUMA nodes, but the allocation
1199+ of the child hash table depends on the current process's NUMA
1200+ policy, which could result in performance differences.
1201+
1202+ Possible values: 0, 2^n (n: 7 (128) - 16 (64K))
1203+
1204+ Default: 0
1205+
1206+
11051207 RAW variables
11061208 =============
11071209
@@ -3025,6 +3127,15 @@ ecn_enable - BOOLEAN · 1917 unmodified lines
30253127
30263128 Default: 1
30273129
3130+l3mdev_accept - BOOLEAN
3131+ Enabling this option allows a "global" bound socket to work
3132+ across L3 master domains (e.g., VRFs) with packets capable of
3133+ being received regardless of the L3 domain in which they
3134+ originated. Only valid when the kernel was compiled with
3135+ CONFIG_NET_L3_MASTER_DEV.
3136+
3137+ Default: 1 (enabled)
3138+
30283139
30293140 ``/proc/sys/net/core/*``
30303141 ========================
Documentation/networking/ipvs-sysctl.rst+22−2
@@ -129,6 +129,26 @@ drop_packet - INTEGER · 128 unmodified lines
129129 threshold. When the mode 3 is set, the always mode drop rate
130130 is controlled by the /proc/sys/net/ipv4/vs/am_droprate.
131131
132+est_cpulist - CPULIST
133+ Allowed CPUs for estimation kthreads
134+
135+ Syntax: standard cpulist format
136+ empty list - stop kthread tasks and estimation
137+ default - the system's housekeeping CPUs for kthreads
138+
139+ Example:
140+ "all": all possible CPUs
141+ "0-N": all possible CPUs, N denotes last CPU number
142+ "0,1-N:1/2": first and all CPUs with odd number
143+ "": empty list
144+
145+est_nice - INTEGER
146+ default 0
147+ Valid range: -20 (more favorable) .. 19 (less favorable)
148+
149+ Niceness value to use for the estimation kthreads (scheduling
150+ priority)
151+
132152 expire_nodest_conn - BOOLEAN
133153 - 0 - disabled (default)
134154 - not 0 - enabled
@@ -304,8 +324,8 @@ run_estimation - BOOLEAN · 169 unmodified lines
304324 0 - disabled
305325 not 0 - enabled (default)
306326
307− If disabled, the estimation will be stop, and you can't see
308− any update on speed estimation data.
327+ If disabled, the estimation will be suspended and kthread tasks
328+ stopped.
309329
310330 You can always re-enable estimation by setting this value to 1.
311331 But be careful, the first estimation after re-enable is not
Documentation/networking/tc-queue-filters.rst+37−0
@@ -0,0 +1,37 @@
1+.. SPDX-License-Identifier: GPL-2.0
2+
3+=========================
4+TC queue based filtering
5+=========================
6+
7+TC can be used for directing traffic to either a set of queues or
8+to a single queue on both the transmit and receive side.
9+
10+On the transmit side:
11+
12+1) TC filter directing traffic to a set of queues is achieved
13+ using the action skbedit priority for Tx priority selection,
14+ the priority maps to a traffic class (set of queues) when
15+ the queue-sets are configured using mqprio.
16+
17+2) TC filter directs traffic to a transmit queue with the action
18+ skbedit queue_mapping $tx_qid. The action skbedit queue_mapping
19+ for transmit queue is executed in software only and cannot be
20+ offloaded.
21+
22+Likewise, on the receive side, the two filters for selecting set of
23+queues and/or a single queue are supported as below:
24+
25+1) TC flower filter directs incoming traffic to a set of queues using
26+ the 'hw_tc' option.
27+ hw_tc $TCID - Specify a hardware traffic class to pass matching
28+ packets on to. TCID is in the range 0 through 15.
29+
30+2) TC filter with action skbedit queue_mapping $rx_qid selects a
31+ receive queue. The action skbedit queue_mapping for receive queue
32+ is supported only in hardware. Multiple filters may compete in
33+ the hardware for queue selection. In such case, the hardware
34+ pipeline resolves conflicts based on priority. On Intel E810
35+ devices, TC filter directing traffic to a queue have higher
36+ priority over flow director filter assigning a queue. The hash
37+ filter has lowest priority.
Documentation/networking/timestamping.rst+31−1
@@ -179,7 +179,8 @@ SOF_TIMESTAMPING_OPT_ID: · 178 unmodified lines
179179 identifier and returns that along with the timestamp. The identifier
180180 is derived from a per-socket u32 counter (that wraps). For datagram
181181 sockets, the counter increments with each sent packet. For stream
182− sockets, it increments with every byte.
182+ sockets, it increments with every byte. For stream sockets, also set
183+ SOF_TIMESTAMPING_OPT_ID_TCP, see the section below.
183184
184185 The counter starts at zero. It is initialized the first time that
185186 the socket option is enabled. It is reset each time the option is
@@ -192,6 +193,35 @@ SOF_TIMESTAMPING_OPT_ID: · 6 unmodified lines
192193 among all possibly concurrently outstanding timestamp requests for
193194 that socket.
194195
196+SOF_TIMESTAMPING_OPT_ID_TCP:
197+ Pass this modifier along with SOF_TIMESTAMPING_OPT_ID for new TCP
198+ timestamping applications. SOF_TIMESTAMPING_OPT_ID defines how the
199+ counter increments for stream sockets, but its starting point is
200+ not entirely trivial. This option fixes that.
201+
202+ For stream sockets, if SOF_TIMESTAMPING_OPT_ID is set, this should
203+ always be set too. On datagram sockets the option has no effect.
204+
205+ A reasonable expectation is that the counter is reset to zero with
206+ the system call, so that a subsequent write() of N bytes generates
207+ a timestamp with counter N-1. SOF_TIMESTAMPING_OPT_ID_TCP
208+ implements this behavior under all conditions.
209+
210+ SOF_TIMESTAMPING_OPT_ID without modifier often reports the same,
211+ especially when the socket option is set when no data is in
212+ transmission. If data is being transmitted, it may be off by the
213+ length of the output queue (SIOCOUTQ).
214+
215+ The difference is due to being based on snd_una versus write_seq.
216+ snd_una is the offset in the stream acknowledged by the peer. This
217+ depends on factors outside of process control, such as network RTT.
218+ write_seq is the last byte written by the process. This offset is
219+ not affected by external inputs.
220+
221+ The difference is subtle and unlikely to be noticed when configured
222+ at initial socket creation, when no data is queued or sent. But
223+ SOF_TIMESTAMPING_OPT_ID_TCP behavior is more robust regardless of
224+ when the socket option is set.
195225
196226 SOF_TIMESTAMPING_OPT_CMSG:
197227 Support recv() cmsg for all timestamped packets. Control messages
Documentation/networking/xfrm_device.rst+53−9
@@ -5,6 +5,7 @@ XFRM device - offloading the IPsec computations · 4 unmodified lines
55 ===============================================
66
77 Shannon Nelson <shannon.nelson@oracle.com>
8+Leon Romanovsky <leonro@nvidia.com>
89
910
1011 Overview
@@ -18,10 +19,21 @@ can radically increase throughput and decrease CPU utilization. The XFRM · 7 unmodified lines
1819 Device interface allows NIC drivers to offer to the stack access to the
1920 hardware offload.
2021
22+Right now, there are two types of hardware offload that kernel supports.
23+ * IPsec crypto offload:
24+ * NIC performs encrypt/decrypt
25+ * Kernel does everything else
26+ * IPsec packet offload:
27+ * NIC performs encrypt/decrypt
28+ * NIC does encapsulation
29+ * Kernel and NIC have SA and policy in-sync
30+ * NIC handles the SA and policies states
31+ * The Kernel talks to the keymanager
32+
2133 Userland access to the offload is typically through a system such as
2234 libreswan or KAME/raccoon, but the iproute2 'ip xfrm' command set can
2335 be handy when experimenting. An example command might look something
24−like this::
36+like this for crypto offload:
2537
2638 ip x s add proto esp dst 14.0.0.70 src 14.0.0.52 spi 0x07 mode transport \
2739 reqid 0x07 replay-window 32 \
@@ -29,6 +41,17 @@ like this:: · 1 unmodified line
2941 sel src 14.0.0.52/24 dst 14.0.0.70/24 proto tcp \
3042 offload dev eth4 dir in
3143
44+and for packet offload
45+
46+ ip x s add proto esp dst 14.0.0.70 src 14.0.0.52 spi 0x07 mode transport \
47+ reqid 0x07 replay-window 32 \
48+ aead 'rfc4106(gcm(aes))' 0x44434241343332312423222114131211f4f3f2f1 128 \
49+ sel src 14.0.0.52/24 dst 14.0.0.70/24 proto tcp \
50+ offload packet dev eth4 dir in
51+
52+ ip x p add src 14.0.0.70 dst 14.0.0.52 offload packet dev eth4 dir in
53+ tmpl src 14.0.0.70 dst 14.0.0.52 proto esp reqid 10000 mode transport
54+
3255 Yes, that's ugly, but that's what shell scripts and/or libreswan are for.
3356
3457
@@ -40,17 +63,24 @@ Callbacks to implement · 5 unmodified lines
4063
4164 /* from include/linux/netdevice.h */
4265 struct xfrmdev_ops {
66+ /* Crypto and Packet offload callbacks */
4367 int (*xdo_dev_state_add) (struct xfrm_state *x);
4468 void (*xdo_dev_state_delete) (struct xfrm_state *x);
4569 void (*xdo_dev_state_free) (struct xfrm_state *x);
4670 bool (*xdo_dev_offload_ok) (struct sk_buff *skb,
4771 struct xfrm_state *x);
4872 void (*xdo_dev_state_advance_esn) (struct xfrm_state *x);
73+
74+ /* Solely packet offload callbacks */
75+ void (*xdo_dev_state_update_curlft) (struct xfrm_state *x);
76+ int (*xdo_dev_policy_add) (struct xfrm_policy *x);
77+ void (*xdo_dev_policy_delete) (struct xfrm_policy *x);
78+ void (*xdo_dev_policy_free) (struct xfrm_policy *x);
4979 };
5080
51−The NIC driver offering ipsec offload will need to implement these
52−callbacks to make the offload available to the network stack's
53−XFRM subsystem. Additionally, the feature bits NETIF_F_HW_ESP and
81+The NIC driver offering ipsec offload will need to implement callbacks
82+relevant to supported offload to make the offload available to the network
83+stack's XFRM subsystem. Additionally, the feature bits NETIF_F_HW_ESP and
5484 NETIF_F_HW_ESP_TX_CSUM will signal the availability of the offload.
5585
5686
@@ -79,7 +109,8 @@ and an indication of whether it is for Rx or Tx. The driver should · 22 unmodified lines
79109
80110 =========== ===================================
81111 0 success
82− -EOPNETSUPP offload not supported, try SW IPsec
112+ -EOPNETSUPP offload not supported, try SW IPsec,
113+ not applicable for packet offload mode
83114 other fail the request
84115 =========== ===================================
85116
@@ -96,6 +127,7 @@ will serviceable. This can check the packet information to be sure the · 10 unmodified lines
96127 offload can be supported (e.g. IPv4 or IPv6, no IPv4 options, etc) and
97128 return true of false to signify its support.
98129
130+Crypto offload mode:
99131 When ready to send, the driver needs to inspect the Tx packet for the
100132 offload information, including the opaque context, and set up the packet
101133 send accordingly::
@@ -139,13 +171,25 @@ the stack in xfrm_input(). · 37 unmodified lines
139171 In ESN mode, xdo_dev_state_advance_esn() is called from xfrm_replay_advance_esn().
140172 Driver will check packet seq number and update HW ESN state machine if needed.
141173
174+Packet offload mode:
175+HW adds and deletes XFRM headers. So in RX path, XFRM stack is bypassed if HW
176+reported success. In TX path, the packet lefts kernel without extra header
177+and not encrypted, the HW is responsible to perform it.
178+
142179 When the SA is removed by the user, the driver's xdo_dev_state_delete()
143−is asked to disable the offload. Later, xdo_dev_state_free() is called
144−from a garbage collection routine after all reference counts to the state
180+and xdo_dev_policy_delete() are asked to disable the offload. Later,
181+xdo_dev_state_free() and xdo_dev_policy_free() are called from a garbage
182+collection routine after all reference counts to the state and policy
145183 have been removed and any remaining resources can be cleared for the
146184 offload state. How these are used by the driver will depend on specific
147185 hardware needs.
148186
149187 As a netdev is set to DOWN the XFRM stack's netdev listener will call
150−xdo_dev_state_delete() and xdo_dev_state_free() on any remaining offloaded
151−states.
188+xdo_dev_state_delete(), xdo_dev_policy_delete(), xdo_dev_state_free() and
189+xdo_dev_policy_free() on any remaining offloaded states.
190+
191+Outcome of HW handling packets, the XFRM core can't count hard, soft limits.
192+The HW/driver are responsible to perform it and provide accurate data when
193+xdo_dev_state_update_curlft() is called. In case of one of these limits
194+occuried, the driver needs to call to xfrm_state_check_expire() to make sure
195+that XFRM performs rekeying sequence.
MAINTAINERS+17−6
@@ -1932,6 +1932,7 @@ F: Documentation/devicetree/bindings/interrupt-controller/apple,* · 1931 unmodified lines
19321932 F: Documentation/devicetree/bindings/iommu/apple,dart.yaml
19331933 F: Documentation/devicetree/bindings/iommu/apple,sart.yaml
19341934 F: Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml
1935+F: Documentation/devicetree/bindings/net/bluetooth/brcm,bcm4377-bluetooth.yaml
19351936 F: Documentation/devicetree/bindings/nvme/apple,nvme-ans.yaml
19361937 F: Documentation/devicetree/bindings/nvmem/apple,efuses.yaml
19371938 F: Documentation/devicetree/bindings/pci/apple,pcie.yaml
@@ -1939,6 +1940,7 @@ F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml · 1 unmodified line
19391940 F: Documentation/devicetree/bindings/power/apple*
19401941 F: Documentation/devicetree/bindings/watchdog/apple,wdt.yaml
19411942 F: arch/arm64/boot/dts/apple/
1943+F: drivers/bluetooth/hci_bcm4377.c
19421944 F: drivers/clk/clk-apple-nco.c
19431945 F: drivers/cpufreq/apple-soc-cpufreq.c
19441946 F: drivers/dma/apple-admac.c
@@ -2470,6 +2472,7 @@ L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) · 525 unmodified lines
24702472 S: Supported
24712473 T: git git://github.com/microchip-ung/linux-upstream.git
24722474 F: arch/arm64/boot/dts/microchip/
2475+F: drivers/net/ethernet/microchip/vcap/
24732476 F: drivers/pinctrl/pinctrl-microchip-sgpio.c
24742477 N: sparx5
24752478
@@ -6362,6 +6365,7 @@ F: drivers/net/ethernet/freescale/dpaa2/Kconfig · 3886 unmodified lines
63626365 F: drivers/net/ethernet/freescale/dpaa2/Makefile
63636366 F: drivers/net/ethernet/freescale/dpaa2/dpaa2-eth*
63646367 F: drivers/net/ethernet/freescale/dpaa2/dpaa2-mac*
6368+F: drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk*
63656369 F: drivers/net/ethernet/freescale/dpaa2/dpkg.h
63666370 F: drivers/net/ethernet/freescale/dpaa2/dpmac*
63676371 F: drivers/net/ethernet/freescale/dpaa2/dpni*
@@ -7734,6 +7738,7 @@ ETAS ES58X CAN/USB DRIVER · 1366 unmodified lines
77347738 M: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
77357739 L: linux-can@vger.kernel.org
77367740 S: Maintained
7741+F: Documentation/networking/devlink/etas_es58x.rst
77377742 F: drivers/net/can/usb/etas_es58x/
77387743
77397744 ETHERNET BRIDGE
@@ -8236,7 +8241,10 @@ S: Maintained · 496 unmodified lines
82368241 F: drivers/i2c/busses/i2c-cpm.c
82378242
82388243 FREESCALE IMX / MXC FEC DRIVER
8239−M: Joakim Zhang <qiangqing.zhang@nxp.com>
8244+M: Wei Fang <wei.fang@nxp.com>
8245+R: Shenwei Wang <shenwei.wang@nxp.com>
8246+R: Clark Wang <xiaoning.wang@nxp.com>
8247+R: NXP Linux Team <linux-imx@nxp.com>
82408248 L: netdev@vger.kernel.org
82418249 S: Maintained
82428250 F: Documentation/devicetree/bindings/net/fsl,fec.yaml
@@ -9493,8 +9501,9 @@ F: Documentation/devicetree/bindings/iio/humidity/st,hts221.yaml · 1250 unmodified lines
94939501 F: drivers/iio/humidity/hts221*
94949502
94959503 HUAWEI ETHERNET DRIVER
9504+M: Cai Huoqing <cai.huoqing@linux.dev>
94969505 L: netdev@vger.kernel.org
9497−S: Orphan
9506+S: Maintained
94989507 F: Documentation/networking/device_drivers/ethernet/huawei/hinic.rst
94999508 F: drivers/net/ethernet/huawei/hinic/
95009509
@@ -9597,6 +9606,7 @@ F: include/asm-generic/hyperv-tlfs.h · 96 unmodified lines
95979606 F: include/asm-generic/mshyperv.h
95989607 F: include/clocksource/hyperv_timer.h
95999608 F: include/linux/hyperv.h
9609+F: include/net/mana
96009610 F: include/uapi/linux/hyperv.h
96019611 F: net/vmw_vsock/hyperv_transport.c
96029612 F: tools/hv/
@@ -12410,7 +12420,7 @@ M: Marcin Wojtas <mw@semihalf.com> · 2807 unmodified lines
1241012420 M: Russell King <linux@armlinux.org.uk>
1241112421 L: netdev@vger.kernel.org
1241212422 S: Maintained
12413−F: Documentation/devicetree/bindings/net/marvell-pp2.txt
12423+F: Documentation/devicetree/bindings/net/marvell,pp2.yaml
1241412424 F: drivers/net/ethernet/marvell/mvpp2/
1241512425
1241612426 MARVELL MWIFIEX WIRELESS DRIVER
@@ -12458,7 +12468,7 @@ F: Documentation/networking/device_drivers/ethernet/marvell/octeontx2.rst · 41 unmodified lines
1245812468 F: drivers/net/ethernet/marvell/octeontx2/af/
1245912469
1246012470 MARVELL PRESTERA ETHERNET SWITCH DRIVER
12461−M: Taras Chornyi <tchornyi@marvell.com>
12471+M: Taras Chornyi <taras.chornyi@plvision.eu>
1246212472 S: Supported
1246312473 W: https://github.com/Marvell-switching/switchdev-prestera
1246412474 F: drivers/net/ethernet/marvell/prestera/
@@ -13017,6 +13027,7 @@ M: Felix Fietkau <nbd@nbd.name> · 552 unmodified lines
1301713027 M: John Crispin <john@phrozen.org>
1301813028 M: Sean Wang <sean.wang@mediatek.com>
1301913029 M: Mark Lee <Mark-MC.Lee@mediatek.com>
13030+M: Lorenzo Bianconi <lorenzo@kernel.org>
1302013031 L: netdev@vger.kernel.org
1302113032 S: Maintained
1302213033 F: drivers/net/ethernet/mediatek/
@@ -14048,6 +14059,7 @@ F: include/uapi/linux/meye.h · 1025 unmodified lines
1404814059
1404914060 MOTORCOMM PHY DRIVER
1405014061 M: Peter Geis <pgwipeout@gmail.com>
14062+M: Frank <Frank.Sae@motor-comm.com>
1405114063 L: netdev@vger.kernel.org
1405214064 S: Maintained
1405314065 F: drivers/net/phy/motorcomm.c
@@ -19175,7 +19187,7 @@ M: Jassi Brar <jaswinder.singh@linaro.org> · 5121 unmodified lines
1917519187 M: Ilias Apalodimas <ilias.apalodimas@linaro.org>
1917619188 L: netdev@vger.kernel.org
1917719189 S: Maintained
19178−F: Documentation/devicetree/bindings/net/socionext-netsec.txt
19190+F: Documentation/devicetree/bindings/net/socionext,synquacer-netsec.yaml
1917919191 F: drivers/net/ethernet/socionext/netsec.c
1918019192
1918119193 SOCIONEXT (SNI) Synquacer SPI DRIVER
@@ -20828,7 +20840,6 @@ W: https://wireless.wiki.kernel.org/en/users/Drivers/wl12xx · 1646 unmodified lines
2082820840 W: https://wireless.wiki.kernel.org/en/users/Drivers/wl1251
2082920841 T: git git://git.kernel.org/pub/scm/linux/kernel/git/luca/wl12xx.git
2083020842 F: drivers/net/wireless/ti/
20831−F: include/linux/wl12xx.h
2083220843
2083320844 TIMEKEEPING, CLOCKSOURCE CORE, NTP, ALARMTIMER
2083420845 M: John Stultz <jstultz@google.com>
arch/arm/boot/dts/armada-375.dtsi+8−4
@@ -178,6 +178,8 @@ · 177 unmodified lines
178178
179179 /* Network controller */
180180 ethernet: ethernet@f0000 {
181+ #address-cells = <1>;
182+ #size-cells = <0>;
181183 compatible = "marvell,armada-375-pp2";
182184 reg = <0xf0000 0xa000>, /* Packet Processor regs */
183185 <0xc0000 0x3060>, /* LMS regs */
@@ -187,15 +189,17 @@ · 3 unmodified lines
187189 clock-names = "pp_clk", "gop_clk";
188190 status = "disabled";
189191
190− eth0: eth0 {
192+ eth0: ethernet-port@0 {
191193 interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
192− port-id = <0>;
194+ reg = <0>;
195+ port-id = <0>; /* For backward compatibility. */
193196 status = "disabled";
194197 };
195198
196− eth1: eth1 {
199+ eth1: ethernet-port@1 {
197200 interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>;
198− port-id = <1>;
201+ reg = <1>;
202+ port-id = <1>; /* For backward compatibility. */
199203 status = "disabled";
200204 };
201205 };
arch/arm/mach-omap2/pdata-quirks.c+0−1
@@ -10,7 +10,6 @@ · 9 unmodified lines
1010 #include <linux/init.h>
1111 #include <linux/kernel.h>
1212 #include <linux/of_platform.h>
13−#include <linux/wl12xx.h>
1413 #include <linux/mmc/card.h>
1514 #include <linux/mmc/host.h>
1615 #include <linux/power/smartreflex.h>
arch/arm64/boot/dts/apple/t8103-j274.dts+4−0
@@ -21,6 +21,10 @@ · 20 unmodified lines
2121 };
2222 };
2323
24+&bluetooth0 {
25+ brcm,board-type = "apple,atlantisb";
26+};
27+
2428 &wifi0 {
2529 brcm,board-type = "apple,atlantisb";
2630 };
arch/arm64/boot/dts/apple/t8103-j293.dts+4−0
@@ -17,6 +17,10 @@ · 16 unmodified lines
1717 model = "Apple MacBook Pro (13-inch, M1, 2020)";
1818 };
1919
20+&bluetooth0 {
21+ brcm,board-type = "apple,honshu";
22+};
23+
2024 &wifi0 {
2125 brcm,board-type = "apple,honshu";
2226 };
arch/arm64/boot/dts/apple/t8103-j313.dts+4−0
@@ -17,6 +17,10 @@ · 16 unmodified lines
1717 model = "Apple MacBook Air (M1, 2020)";
1818 };
1919
20+&bluetooth0 {
21+ brcm,board-type = "apple,shikoku";
22+};
23+
2024 &wifi0 {
2125 brcm,board-type = "apple,shikoku";
2226 };
arch/arm64/boot/dts/apple/t8103-j456.dts+4−0
@@ -21,6 +21,10 @@ · 20 unmodified lines
2121 };
2222 };
2323
24+&bluetooth0 {
25+ brcm,board-type = "apple,capri";
26+};
27+
2428 &wifi0 {
2529 brcm,board-type = "apple,capri";
2630 };
arch/arm64/boot/dts/apple/t8103-j457.dts+4−0
@@ -21,6 +21,10 @@ · 20 unmodified lines
2121 };
2222 };
2323
24+&bluetooth0 {
25+ brcm,board-type = "apple,santorini";
26+};
27+
2428 &wifi0 {
2529 brcm,board-type = "apple,santorini";
2630 };
arch/arm64/boot/dts/apple/t8103-jxxx.dtsi+8−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111
1212 / {
1313 aliases {
14+ bluetooth0 = &bluetooth0;
1415 serial0 = &serial0;
1516 serial2 = &serial2;
1617 wifi0 = &wifi0;
@@ -77,6 +78,13 @@ · 60 unmodified lines
7778 local-mac-address = [00 00 00 00 00 00];
7879 apple,antenna-sku = "XX";
7980 };
81+
82+ bluetooth0: bluetooth@0,1 {
83+ compatible = "pci14e4,5f69";
84+ reg = <0x10100 0x0 0x0 0x0 0x0>;
85+ /* To be filled by the loader */
86+ local-bd-address = [00 00 00 00 00 00];
87+ };
8088 };
8189
8290 &nco_clkref {
arch/arm64/boot/dts/freescale/fsl-ls1043-post.dtsi+24−0
@@ -24,9 +24,12 @@ · 23 unmodified lines
2424
2525 /* these aliases provide the FMan ports mapping */
2626 enet0: ethernet@e0000 {
27+ pcs-handle-names = "qsgmii";
2728 };
2829
2930 enet1: ethernet@e2000 {
31+ pcsphy-handle = <&pcsphy1>, <&qsgmiib_pcs1>;
32+ pcs-handle-names = "sgmii", "qsgmii";
3033 };
3134
3235 enet2: ethernet@e4000 {
@@ -36,11 +39,32 @@ · 3 unmodified lines
3639 };
3740
3841 enet4: ethernet@e8000 {
42+ pcsphy-handle = <&pcsphy4>, <&qsgmiib_pcs2>;
43+ pcs-handle-names = "sgmii", "qsgmii";
3944 };
4045
4146 enet5: ethernet@ea000 {
47+ pcsphy-handle = <&pcsphy5>, <&qsgmiib_pcs3>;
48+ pcs-handle-names = "sgmii", "qsgmii";
4249 };
4350
4451 enet6: ethernet@f0000 {
4552 };
53+
54+ mdio@e1000 {
55+ qsgmiib_pcs1: ethernet-pcs@1 {
56+ compatible = "fsl,lynx-pcs";
57+ reg = <0x1>;
58+ };
59+
60+ qsgmiib_pcs2: ethernet-pcs@2 {
61+ compatible = "fsl,lynx-pcs";
62+ reg = <0x2>;
63+ };
64+
65+ qsgmiib_pcs3: ethernet-pcs@3 {
66+ compatible = "fsl,lynx-pcs";
67+ reg = <0x3>;
68+ };
69+ };
4670 };
arch/arm64/boot/dts/freescale/fsl-ls1046-post.dtsi+25−0
@@ -23,6 +23,8 @@ · 22 unmodified lines
2323 &fman0 {
2424 /* these aliases provide the FMan ports mapping */
2525 enet0: ethernet@e0000 {
26+ pcsphy-handle = <&qsgmiib_pcs3>;
27+ pcs-handle-names = "qsgmii";
2628 };
2729
2830 enet1: ethernet@e2000 {
@@ -35,14 +37,37 @@ · 6 unmodified lines
3537 };
3638
3739 enet4: ethernet@e8000 {
40+ pcsphy-handle = <&pcsphy4>, <&qsgmiib_pcs1>;
41+ pcs-handle-names = "sgmii", "qsgmii";
3842 };
3943
4044 enet5: ethernet@ea000 {
45+ pcsphy-handle = <&pcsphy5>, <&pcsphy5>;
46+ pcs-handle-names = "sgmii", "qsgmii";
4147 };
4248
4349 enet6: ethernet@f0000 {
4450 };
4551
4652 enet7: ethernet@f2000 {
53+ pcsphy-handle = <&pcsphy7>, <&qsgmiib_pcs2>, <&pcsphy7>;
54+ pcs-handle-names = "sgmii", "qsgmii", "xfi";
55+ };
56+
57+ mdio@eb000 {
58+ qsgmiib_pcs1: ethernet-pcs@1 {
59+ compatible = "fsl,lynx-pcs";
60+ reg = <0x1>;
61+ };
62+
63+ qsgmiib_pcs2: ethernet-pcs@2 {
64+ compatible = "fsl,lynx-pcs";
65+ reg = <0x2>;
66+ };
67+
68+ qsgmiib_pcs3: ethernet-pcs@3 {
69+ compatible = "fsl,lynx-pcs";
70+ reg = <0x3>;
71+ };
4772 };
4873 };
arch/arm64/boot/dts/marvell/armada-cp11x.dtsi+11−6
@@ -58,6 +58,8 @@ · 57 unmodified lines
5858 ranges = <0x0 0x0 ADDRESSIFY(CP11X_BASE) 0x2000000>;
5959
6060 CP11X_LABEL(ethernet): ethernet@0 {
61+ #address-cells = <1>;
62+ #size-cells = <0>;
6163 compatible = "marvell,armada-7k-pp22";
6264 reg = <0x0 0x100000>, <0x129000 0xb000>, <0x220000 0x800>;
6365 clocks = <&CP11X_LABEL(clk) 1 3>, <&CP11X_LABEL(clk) 1 9>,
@@ -69,7 +71,7 @@ · 5 unmodified lines
6971 status = "disabled";
7072 dma-coherent;
7173
72− CP11X_LABEL(eth0): eth0 {
74+ CP11X_LABEL(eth0): ethernet-port@0 {
7375 interrupts = <39 IRQ_TYPE_LEVEL_HIGH>,
7476 <43 IRQ_TYPE_LEVEL_HIGH>,
7577 <47 IRQ_TYPE_LEVEL_HIGH>,
@@ -83,12 +85,13 @@ · 7 unmodified lines
8385 interrupt-names = "hif0", "hif1", "hif2",
8486 "hif3", "hif4", "hif5", "hif6", "hif7",
8587 "hif8", "link";
86− port-id = <0>;
88+ reg = <0>;
89+ port-id = <0>; /* For backward compatibility. */
8790 gop-port-id = <0>;
8891 status = "disabled";
8992 };
9093
91− CP11X_LABEL(eth1): eth1 {
94+ CP11X_LABEL(eth1): ethernet-port@1 {
9295 interrupts = <40 IRQ_TYPE_LEVEL_HIGH>,
9396 <44 IRQ_TYPE_LEVEL_HIGH>,
9497 <48 IRQ_TYPE_LEVEL_HIGH>,
@@ -102,12 +105,13 @@ · 7 unmodified lines
102105 interrupt-names = "hif0", "hif1", "hif2",
103106 "hif3", "hif4", "hif5", "hif6", "hif7",
104107 "hif8", "link";
105− port-id = <1>;
108+ reg = <1>;
109+ port-id = <1>; /* For backward compatibility. */
106110 gop-port-id = <2>;
107111 status = "disabled";
108112 };
109113
110− CP11X_LABEL(eth2): eth2 {
114+ CP11X_LABEL(eth2): ethernet-port@2 {
111115 interrupts = <41 IRQ_TYPE_LEVEL_HIGH>,
112116 <45 IRQ_TYPE_LEVEL_HIGH>,
113117 <49 IRQ_TYPE_LEVEL_HIGH>,
@@ -121,7 +125,8 @@ · 7 unmodified lines
121125 interrupt-names = "hif0", "hif1", "hif2",
122126 "hif3", "hif4", "hif5", "hif6", "hif7",
123127 "hif8", "link";
124− port-id = <2>;
128+ reg = <2>;
129+ port-id = <2>; /* For backward compatibility. */
125130 gop-port-id = <3>;
126131 status = "disabled";
127132 };
arch/arm64/boot/dts/mediatek/mt7986a.dtsi+65−0
@@ -77,6 +77,47 @@ · 76 unmodified lines
7777 no-map;
7878 reg = <0 0x4fc00000 0 0x00100000>;
7979 };
80+
81+ wo_emi0: wo-emi@4fd00000 {
82+ reg = <0 0x4fd00000 0 0x40000>;
83+ no-map;
84+ };
85+
86+ wo_emi1: wo-emi@4fd40000 {
87+ reg = <0 0x4fd40000 0 0x40000>;
88+ no-map;
89+ };
90+
91+ wo_ilm0: wo-ilm@151e0000 {
92+ reg = <0 0x151e0000 0 0x8000>;
93+ no-map;
94+ };
95+
96+ wo_ilm1: wo-ilm@151f0000 {
97+ reg = <0 0x151f0000 0 0x8000>;
98+ no-map;
99+ };
100+
101+ wo_data: wo-data@4fd80000 {
102+ reg = <0 0x4fd80000 0 0x240000>;
103+ no-map;
104+ };
105+
106+ wo_dlm0: wo-dlm@151e8000 {
107+ reg = <0 0x151e8000 0 0x2000>;
108+ no-map;
109+ };
110+
111+ wo_dlm1: wo-dlm@151f8000 {
112+ reg = <0 0x151f8000 0 0x2000>;
113+ no-map;
114+ };
115+
116+ wo_boot: wo-boot@15194000 {
117+ reg = <0 0x15194000 0 0x1000>;
118+ no-map;
119+ };
120+
80121 };
81122
82123 timer {
@@ -298,6 +339,11 @@ · 215 unmodified lines
298339 reg = <0 0x15010000 0 0x1000>;
299340 interrupt-parent = <&gic>;
300341 interrupts = <GIC_SPI 205 IRQ_TYPE_LEVEL_HIGH>;
342+ memory-region = <&wo_emi0>, <&wo_ilm0>, <&wo_dlm0>,
343+ <&wo_data>, <&wo_boot>;
344+ memory-region-names = "wo-emi", "wo-ilm", "wo-dlm",
345+ "wo-data", "wo-boot";
346+ mediatek,wo-ccif = <&wo_ccif0>;
301347 };
302348
303349 wed1: wed@15011000 {
@@ -306,6 +352,25 @@ · 2 unmodified lines
306352 reg = <0 0x15011000 0 0x1000>;
307353 interrupt-parent = <&gic>;
308354 interrupts = <GIC_SPI 206 IRQ_TYPE_LEVEL_HIGH>;
355+ memory-region = <&wo_emi1>, <&wo_ilm1>, <&wo_dlm1>,
356+ <&wo_data>, <&wo_boot>;
357+ memory-region-names = "wo-emi", "wo-ilm", "wo-dlm",
358+ "wo-data", "wo-boot";
359+ mediatek,wo-ccif = <&wo_ccif1>;
360+ };
361+
362+ wo_ccif0: syscon@151a5000 {
363+ compatible = "mediatek,mt7986-wo-ccif", "syscon";
364+ reg = <0 0x151a5000 0 0x1000>;
365+ interrupt-parent = <&gic>;
366+ interrupts = <GIC_SPI 211 IRQ_TYPE_LEVEL_HIGH>;
367+ };
368+
369+ wo_ccif1: syscon@151ad000 {
370+ compatible = "mediatek,mt7986-wo-ccif", "syscon";
371+ reg = <0 0x151ad000 0 0x1000>;
372+ interrupt-parent = <&gic>;
373+ interrupts = <GIC_SPI 212 IRQ_TYPE_LEVEL_HIGH>;
309374 };
310375
311376 eth: ethernet@15100000 {
arch/arm64/net/bpf_jit_comp.c+2−7
@@ -1649,13 +1649,8 @@ static void invoke_bpf_prog(struct jit_ctx *ctx, struct bpf_tramp_link *l, · 1648 unmodified lines
16491649 struct bpf_prog *p = l->link.prog;
16501650 int cookie_off = offsetof(struct bpf_tramp_run_ctx, bpf_cookie);
16511651
1652− if (p->aux->sleepable) {
1653− enter_prog = (u64)__bpf_prog_enter_sleepable;
1654− exit_prog = (u64)__bpf_prog_exit_sleepable;
1655− } else {
1656− enter_prog = (u64)__bpf_prog_enter;
1657− exit_prog = (u64)__bpf_prog_exit;
1658− }
1652+ enter_prog = (u64)bpf_trampoline_enter(p);
1653+ exit_prog = (u64)bpf_trampoline_exit(p);
16591654
16601655 if (l->cookie == 0) {
16611656 /* if cookie is zero, one instruction is enough to store it */
arch/mips/configs/mtx1_defconfig+0−1
@@ -284,7 +284,6 @@ CONFIG_IXGB=m · 283 unmodified lines
284284 CONFIG_SKGE=m
285285 CONFIG_SKY2=m
286286 CONFIG_MYRI10GE=m
287−CONFIG_FEALNX=m
288287 CONFIG_NATSEMI=m
289288 CONFIG_NS83820=m
290289 CONFIG_S2IO=m
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0-best-effort.dtsi+2−1
@@ -55,7 +55,8 @@ fman@400000 { · 54 unmodified lines
5555 reg = <0xe0000 0x1000>;
5656 fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
5757 ptp-timer = <&ptp_timer0>;
58− pcsphy-handle = <&pcsphy0>;
58+ pcsphy-handle = <&pcsphy0>, <&pcsphy0>;
59+ pcs-handle-names = "sgmii", "qsgmii";
5960 };
6061
6162 mdio@e1000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-0.dtsi+9−1
@@ -52,7 +52,15 @@ fman@400000 { · 51 unmodified lines
5252 compatible = "fsl,fman-memac";
5353 reg = <0xf0000 0x1000>;
5454 fsl,fman-ports = <&fman0_rx_0x10 &fman0_tx_0x30>;
55− pcsphy-handle = <&pcsphy6>;
55+ pcsphy-handle = <&pcsphy6>, <&qsgmiib_pcs2>, <&pcsphy6>;
56+ pcs-handle-names = "sgmii", "qsgmii", "xfi";
57+ };
58+
59+ mdio@e9000 {
60+ qsgmiib_pcs2: ethernet-pcs@2 {
61+ compatible = "fsl,lynx-pcs";
62+ reg = <2>;
63+ };
5664 };
5765
5866 mdio@f1000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1-best-effort.dtsi+9−1
@@ -55,7 +55,15 @@ fman@400000 { · 54 unmodified lines
5555 reg = <0xe2000 0x1000>;
5656 fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
5757 ptp-timer = <&ptp_timer0>;
58− pcsphy-handle = <&pcsphy1>;
58+ pcsphy-handle = <&pcsphy1>, <&qsgmiia_pcs1>;
59+ pcs-handle-names = "sgmii", "qsgmii";
60+ };
61+
62+ mdio@e1000 {
63+ qsgmiia_pcs1: ethernet-pcs@1 {
64+ compatible = "fsl,lynx-pcs";
65+ reg = <1>;
66+ };
5967 };
6068
6169 mdio@e3000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-1.dtsi+9−1
@@ -52,7 +52,15 @@ fman@400000 { · 51 unmodified lines
5252 compatible = "fsl,fman-memac";
5353 reg = <0xf2000 0x1000>;
5454 fsl,fman-ports = <&fman0_rx_0x11 &fman0_tx_0x31>;
55− pcsphy-handle = <&pcsphy7>;
55+ pcsphy-handle = <&pcsphy7>, <&qsgmiib_pcs3>, <&pcsphy7>;
56+ pcs-handle-names = "sgmii", "qsgmii", "xfi";
57+ };
58+
59+ mdio@e9000 {
60+ qsgmiib_pcs3: ethernet-pcs@3 {
61+ compatible = "fsl,lynx-pcs";
62+ reg = <3>;
63+ };
5664 };
5765
5866 mdio@f3000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-2.dtsi+45−0
@@ -0,0 +1,45 @@
1+// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
2+/*
3+ * QorIQ FMan v3 10g port #2 device tree stub [ controller @ offset 0x400000 ]
4+ *
5+ * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
6+ * Copyright 2012 - 2015 Freescale Semiconductor Inc.
7+ */
8+
9+fman@400000 {
10+ fman0_rx_0x08: port@88000 {
11+ cell-index = <0x8>;
12+ compatible = "fsl,fman-v3-port-rx";
13+ reg = <0x88000 0x1000>;
14+ fsl,fman-10g-port;
15+ };
16+
17+ fman0_tx_0x28: port@a8000 {
18+ cell-index = <0x28>;
19+ compatible = "fsl,fman-v3-port-tx";
20+ reg = <0xa8000 0x1000>;
21+ fsl,fman-10g-port;
22+ };
23+
24+ ethernet@e0000 {
25+ cell-index = <0>;
26+ compatible = "fsl,fman-memac";
27+ reg = <0xe0000 0x1000>;
28+ fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
29+ ptp-timer = <&ptp_timer0>;
30+ pcsphy-handle = <&pcsphy0>, <&pcsphy0>;
31+ pcs-handle-names = "sgmii", "xfi";
32+ };
33+
34+ mdio@e1000 {
35+ #address-cells = <1>;
36+ #size-cells = <0>;
37+ compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
38+ reg = <0xe1000 0x1000>;
39+ fsl,erratum-a011043; /* must ignore read errors */
40+
41+ pcsphy0: ethernet-phy@0 {
42+ reg = <0x0>;
43+ };
44+ };
45+};
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-10g-3.dtsi+45−0
@@ -0,0 +1,45 @@
1+// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
2+/*
3+ * QorIQ FMan v3 10g port #3 device tree stub [ controller @ offset 0x400000 ]
4+ *
5+ * Copyright 2022 Sean Anderson <sean.anderson@seco.com>
6+ * Copyright 2012 - 2015 Freescale Semiconductor Inc.
7+ */
8+
9+fman@400000 {
10+ fman0_rx_0x09: port@89000 {
11+ cell-index = <0x9>;
12+ compatible = "fsl,fman-v3-port-rx";
13+ reg = <0x89000 0x1000>;
14+ fsl,fman-10g-port;
15+ };
16+
17+ fman0_tx_0x29: port@a9000 {
18+ cell-index = <0x29>;
19+ compatible = "fsl,fman-v3-port-tx";
20+ reg = <0xa9000 0x1000>;
21+ fsl,fman-10g-port;
22+ };
23+
24+ ethernet@e2000 {
25+ cell-index = <1>;
26+ compatible = "fsl,fman-memac";
27+ reg = <0xe2000 0x1000>;
28+ fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
29+ ptp-timer = <&ptp_timer0>;
30+ pcsphy-handle = <&pcsphy1>, <&pcsphy1>;
31+ pcs-handle-names = "sgmii", "xfi";
32+ };
33+
34+ mdio@e3000 {
35+ #address-cells = <1>;
36+ #size-cells = <0>;
37+ compatible = "fsl,fman-memac-mdio", "fsl,fman-xmdio";
38+ reg = <0xe3000 0x1000>;
39+ fsl,erratum-a011043; /* must ignore read errors */
40+
41+ pcsphy1: ethernet-phy@0 {
42+ reg = <0x0>;
43+ };
44+ };
45+};
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-0.dtsi+2−1
@@ -51,7 +51,8 @@ fman@400000 { · 50 unmodified lines
5151 reg = <0xe0000 0x1000>;
5252 fsl,fman-ports = <&fman0_rx_0x08 &fman0_tx_0x28>;
5353 ptp-timer = <&ptp_timer0>;
54− pcsphy-handle = <&pcsphy0>;
54+ pcsphy-handle = <&pcsphy0>, <&pcsphy0>;
55+ pcs-handle-names = "sgmii", "qsgmii";
5556 };
5657
5758 mdio@e1000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-1.dtsi+9−1
@@ -51,7 +51,15 @@ fman@400000 { · 50 unmodified lines
5151 reg = <0xe2000 0x1000>;
5252 fsl,fman-ports = <&fman0_rx_0x09 &fman0_tx_0x29>;
5353 ptp-timer = <&ptp_timer0>;
54− pcsphy-handle = <&pcsphy1>;
54+ pcsphy-handle = <&pcsphy1>, <&qsgmiia_pcs1>;
55+ pcs-handle-names = "sgmii", "qsgmii";
56+ };
57+
58+ mdio@e1000 {
59+ qsgmiia_pcs1: ethernet-pcs@1 {
60+ compatible = "fsl,lynx-pcs";
61+ reg = <1>;
62+ };
5563 };
5664
5765 mdio@e3000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-2.dtsi+9−1
@@ -51,7 +51,15 @@ fman@400000 { · 50 unmodified lines
5151 reg = <0xe4000 0x1000>;
5252 fsl,fman-ports = <&fman0_rx_0x0a &fman0_tx_0x2a>;
5353 ptp-timer = <&ptp_timer0>;
54− pcsphy-handle = <&pcsphy2>;
54+ pcsphy-handle = <&pcsphy2>, <&qsgmiia_pcs2>;
55+ pcs-handle-names = "sgmii", "qsgmii";
56+ };
57+
58+ mdio@e1000 {
59+ qsgmiia_pcs2: ethernet-pcs@2 {
60+ compatible = "fsl,lynx-pcs";
61+ reg = <2>;
62+ };
5563 };
5664
5765 mdio@e5000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-3.dtsi+9−1
@@ -51,7 +51,15 @@ fman@400000 { · 50 unmodified lines
5151 reg = <0xe6000 0x1000>;
5252 fsl,fman-ports = <&fman0_rx_0x0b &fman0_tx_0x2b>;
5353 ptp-timer = <&ptp_timer0>;
54− pcsphy-handle = <&pcsphy3>;
54+ pcsphy-handle = <&pcsphy3>, <&qsgmiia_pcs3>;
55+ pcs-handle-names = "sgmii", "qsgmii";
56+ };
57+
58+ mdio@e1000 {
59+ qsgmiia_pcs3: ethernet-pcs@3 {
60+ compatible = "fsl,lynx-pcs";
61+ reg = <3>;
62+ };
5563 };
5664
5765 mdio@e7000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-4.dtsi+2−1
@@ -51,7 +51,8 @@ fman@400000 { · 50 unmodified lines
5151 reg = <0xe8000 0x1000>;
5252 fsl,fman-ports = <&fman0_rx_0x0c &fman0_tx_0x2c>;
5353 ptp-timer = <&ptp_timer0>;
54− pcsphy-handle = <&pcsphy4>;
54+ pcsphy-handle = <&pcsphy4>, <&pcsphy4>;
55+ pcs-handle-names = "sgmii", "qsgmii";
5556 };
5657
5758 mdio@e9000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-0-1g-5.dtsi+9−1
@@ -51,7 +51,15 @@ fman@400000 { · 50 unmodified lines
5151 reg = <0xea000 0x1000>;
5252 fsl,fman-ports = <&fman0_rx_0x0d &fman0_tx_0x2d>;
5353 ptp-timer = <&ptp_timer0>;
54− pcsphy-handle = <&pcsphy5>;
54+ pcsphy-handle = <&pcsphy5>, <&qsgmiib_pcs1>;
55+ pcs-handle-names = "sgmii", "qsgmii";
56+ };
57+
58+ mdio@e9000 {
59+ qsgmiib_pcs1: ethernet-pcs@1 {
60+ compatible = "fsl,lynx-pcs";
61+ reg = <1>;
62+ };
5563 };
5664
5765 mdio@eb000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-0.dtsi+9−1
@@ -52,7 +52,15 @@ fman@500000 { · 51 unmodified lines
5252 compatible = "fsl,fman-memac";
5353 reg = <0xf0000 0x1000>;
5454 fsl,fman-ports = <&fman1_rx_0x10 &fman1_tx_0x30>;
55− pcsphy-handle = <&pcsphy14>;
55+ pcsphy-handle = <&pcsphy14>, <&qsgmiid_pcs2>, <&pcsphy14>;
56+ pcs-handle-names = "sgmii", "qsgmii", "xfi";
57+ };
58+
59+ mdio@e9000 {
60+ qsgmiid_pcs2: ethernet-pcs@2 {
61+ compatible = "fsl,lynx-pcs";
62+ reg = <2>;
63+ };
5664 };
5765
5866 mdio@f1000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-1-10g-1.dtsi+9−1
@@ -52,7 +52,15 @@ fman@500000 { · 51 unmodified lines
5252 compatible = "fsl,fman-memac";
5353 reg = <0xf2000 0x1000>;
5454 fsl,fman-ports = <&fman1_rx_0x11 &fman1_tx_0x31>;
55− pcsphy-handle = <&pcsphy15>;
55+ pcsphy-handle = <&pcsphy15>, <&qsgmiid_pcs3>, <&pcsphy15>;
56+ pcs-handle-names = "sgmii", "qsgmii", "xfi";
57+ };
58+
59+ mdio@e9000 {
60+ qsgmiid_pcs3: ethernet-pcs@3 {
61+ compatible = "fsl,lynx-pcs";
62+ reg = <3>;
63+ };
5664 };
5765
5866 mdio@f3000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-0.dtsi+2−1
@@ -51,7 +51,8 @@ fman@500000 { · 50 unmodified lines
5151 reg = <0xe0000 0x1000>;
5252 fsl,fman-ports = <&fman1_rx_0x08 &fman1_tx_0x28>;
5353 ptp-timer = <&ptp_timer1>;
54− pcsphy-handle = <&pcsphy8>;
54+ pcsphy-handle = <&pcsphy8>, <&pcsphy8>;
55+ pcs-handle-names = "sgmii", "qsgmii";
5556 };
5657
5758 mdio@e1000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-1.dtsi+9−1
@@ -51,7 +51,15 @@ fman@500000 { · 50 unmodified lines
5151 reg = <0xe2000 0x1000>;
5252 fsl,fman-ports = <&fman1_rx_0x09 &fman1_tx_0x29>;
5353 ptp-timer = <&ptp_timer1>;
54− pcsphy-handle = <&pcsphy9>;
54+ pcsphy-handle = <&pcsphy9>, <&qsgmiic_pcs1>;
55+ pcs-handle-names = "sgmii", "qsgmii";
56+ };
57+
58+ mdio@e1000 {
59+ qsgmiic_pcs1: ethernet-pcs@1 {
60+ compatible = "fsl,lynx-pcs";
61+ reg = <1>;
62+ };
5563 };
5664
5765 mdio@e3000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-2.dtsi+9−1
@@ -51,7 +51,15 @@ fman@500000 { · 50 unmodified lines
5151 reg = <0xe4000 0x1000>;
5252 fsl,fman-ports = <&fman1_rx_0x0a &fman1_tx_0x2a>;
5353 ptp-timer = <&ptp_timer1>;
54− pcsphy-handle = <&pcsphy10>;
54+ pcsphy-handle = <&pcsphy10>, <&qsgmiic_pcs2>;
55+ pcs-handle-names = "sgmii", "qsgmii";
56+ };
57+
58+ mdio@e1000 {
59+ qsgmiic_pcs2: ethernet-pcs@2 {
60+ compatible = "fsl,lynx-pcs";
61+ reg = <2>;
62+ };
5563 };
5664
5765 mdio@e5000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-3.dtsi+9−1
@@ -51,7 +51,15 @@ fman@500000 { · 50 unmodified lines
5151 reg = <0xe6000 0x1000>;
5252 fsl,fman-ports = <&fman1_rx_0x0b &fman1_tx_0x2b>;
5353 ptp-timer = <&ptp_timer1>;
54− pcsphy-handle = <&pcsphy11>;
54+ pcsphy-handle = <&pcsphy11>, <&qsgmiic_pcs3>;
55+ pcs-handle-names = "sgmii", "qsgmii";
56+ };
57+
58+ mdio@e1000 {
59+ qsgmiic_pcs3: ethernet-pcs@3 {
60+ compatible = "fsl,lynx-pcs";
61+ reg = <3>;
62+ };
5563 };
5664
5765 mdio@e7000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-4.dtsi+2−1
@@ -51,7 +51,8 @@ fman@500000 { · 50 unmodified lines
5151 reg = <0xe8000 0x1000>;
5252 fsl,fman-ports = <&fman1_rx_0x0c &fman1_tx_0x2c>;
5353 ptp-timer = <&ptp_timer1>;
54− pcsphy-handle = <&pcsphy12>;
54+ pcsphy-handle = <&pcsphy12>, <&pcsphy12>;
55+ pcs-handle-names = "sgmii", "qsgmii";
5556 };
5657
5758 mdio@e9000 {
arch/powerpc/boot/dts/fsl/qoriq-fman3-1-1g-5.dtsi+9−1
@@ -51,7 +51,15 @@ fman@500000 { · 50 unmodified lines
5151 reg = <0xea000 0x1000>;
5252 fsl,fman-ports = <&fman1_rx_0x0d &fman1_tx_0x2d>;
5353 ptp-timer = <&ptp_timer1>;
54− pcsphy-handle = <&pcsphy13>;
54+ pcsphy-handle = <&pcsphy13>, <&qsgmiid_pcs1>;
55+ pcs-handle-names = "sgmii", "qsgmii";
56+ };
57+
58+ mdio@e9000 {
59+ qsgmiid_pcs1: ethernet-pcs@1 {
60+ compatible = "fsl,lynx-pcs";
61+ reg = <1>;
62+ };
5563 };
5664
5765 mdio@eb000 {
arch/powerpc/boot/dts/fsl/t2081si-post.dtsi+2−2
@@ -609,8 +609,8 @@ · 608 unmodified lines
609609 /include/ "qoriq-bman1.dtsi"
610610
611611 /include/ "qoriq-fman3-0.dtsi"
612−/include/ "qoriq-fman3-0-1g-0.dtsi"
613−/include/ "qoriq-fman3-0-1g-1.dtsi"
612+/include/ "qoriq-fman3-0-10g-2.dtsi"
613+/include/ "qoriq-fman3-0-10g-3.dtsi"
614614 /include/ "qoriq-fman3-0-1g-2.dtsi"
615615 /include/ "qoriq-fman3-0-1g-3.dtsi"
616616 /include/ "qoriq-fman3-0-1g-4.dtsi"
arch/powerpc/configs/ppc6xx_defconfig+0−1
@@ -461,7 +461,6 @@ CONFIG_MV643XX_ETH=m · 460 unmodified lines
461461 CONFIG_SKGE=m
462462 CONFIG_SKY2=m
463463 CONFIG_MYRI10GE=m
464−CONFIG_FEALNX=m
465464 CONFIG_NATSEMI=m
466465 CONFIG_NS83820=m
467466 CONFIG_PCMCIA_AXNET=m
arch/riscv/net/bpf_jit_comp64.c+28−1
@@ -136,6 +136,25 @@ static bool in_auipc_jalr_range(s64 val) · 135 unmodified lines
136136 val < ((1L << 31) - (1L << 11));
137137 }
138138
139+/* Emit fixed-length instructions for address */
140+static int emit_addr(u8 rd, u64 addr, bool extra_pass, struct rv_jit_context *ctx)
141+{
142+ u64 ip = (u64)(ctx->insns + ctx->ninsns);
143+ s64 off = addr - ip;
144+ s64 upper = (off + (1 << 11)) >> 12;
145+ s64 lower = off & 0xfff;
146+
147+ if (extra_pass && !in_auipc_jalr_range(off)) {
148+ pr_err("bpf-jit: target offset 0x%llx is out of range\n", off);
149+ return -ERANGE;
150+ }
151+
152+ emit(rv_auipc(rd, upper), ctx);
153+ emit(rv_addi(rd, rd, lower), ctx);
154+ return 0;
155+}
156+
157+/* Emit variable-length instructions for 32-bit and 64-bit imm */
139158 static void emit_imm(u8 rd, s64 val, struct rv_jit_context *ctx)
140159 {
141160 /* Note that the immediate from the add is sign-extended,
@@ -1050,7 +1069,15 @@ out_be: · 908 unmodified lines
10501069 u64 imm64;
10511070
10521071 imm64 = (u64)insn1.imm << 32 | (u32)imm;
1053− emit_imm(rd, imm64, ctx);
1072+ if (bpf_pseudo_func(insn)) {
1073+ /* fixed-length insns for extra jit pass */
1074+ ret = emit_addr(rd, imm64, extra_pass, ctx);
1075+ if (ret)
1076+ return ret;
1077+ } else {
1078+ emit_imm(rd, imm64, ctx);
1079+ }
1080+
10541081 return 1;
10551082 }
10561083
arch/sparc/net/bpf_jit_comp_32.c+5−5
@@ -555,11 +555,11 @@ void bpf_jit_compile(struct bpf_prog *fp) · 554 unmodified lines
555555 emit_skb_load16(vlan_tci, r_A);
556556 break;
557557 case BPF_ANC | SKF_AD_VLAN_TAG_PRESENT:
558− __emit_skb_load8(__pkt_vlan_present_offset, r_A);
559− if (PKT_VLAN_PRESENT_BIT)
560− emit_alu_K(SRL, PKT_VLAN_PRESENT_BIT);
561− if (PKT_VLAN_PRESENT_BIT < 7)
562− emit_andi(r_A, 1, r_A);
558+ emit_skb_load32(vlan_all, r_A);
559+ emit_cmpi(r_A, 0);
560+ emit_branch_off(BE, 12);
561+ emit_nop();
562+ emit_loadimm(1, r_A);
563563 break;
564564 case BPF_LD | BPF_W | BPF_LEN:
565565 emit_skb_load32(len, r_A);
arch/x86/net/bpf_jit_comp.c+97−31
@@ -891,6 +891,65 @@ static void emit_nops(u8 **pprog, int len) · 890 unmodified lines
891891 *pprog = prog;
892892 }
893893
894+/* emit the 3-byte VEX prefix
895+ *
896+ * r: same as rex.r, extra bit for ModRM reg field
897+ * x: same as rex.x, extra bit for SIB index field
898+ * b: same as rex.b, extra bit for ModRM r/m, or SIB base
899+ * m: opcode map select, encoding escape bytes e.g. 0x0f38
900+ * w: same as rex.w (32 bit or 64 bit) or opcode specific
901+ * src_reg2: additional source reg (encoded as BPF reg)
902+ * l: vector length (128 bit or 256 bit) or reserved
903+ * pp: opcode prefix (none, 0x66, 0xf2 or 0xf3)
904+ */
905+static void emit_3vex(u8 **pprog, bool r, bool x, bool b, u8 m,
906+ bool w, u8 src_reg2, bool l, u8 pp)
907+{
908+ u8 *prog = *pprog;
909+ const u8 b0 = 0xc4; /* first byte of 3-byte VEX prefix */
910+ u8 b1, b2;
911+ u8 vvvv = reg2hex[src_reg2];
912+
913+ /* reg2hex gives only the lower 3 bit of vvvv */
914+ if (is_ereg(src_reg2))
915+ vvvv |= 1 << 3;
916+
917+ /*
918+ * 2nd byte of 3-byte VEX prefix
919+ * ~ means bit inverted encoding
920+ *
921+ * 7 0
922+ * +---+---+---+---+---+---+---+---+
923+ * |~R |~X |~B | m |
924+ * +---+---+---+---+---+---+---+---+
925+ */
926+ b1 = (!r << 7) | (!x << 6) | (!b << 5) | (m & 0x1f);
927+ /*
928+ * 3rd byte of 3-byte VEX prefix
929+ *
930+ * 7 0
931+ * +---+---+---+---+---+---+---+---+
932+ * | W | ~vvvv | L | pp |
933+ * +---+---+---+---+---+---+---+---+
934+ */
935+ b2 = (w << 7) | ((~vvvv & 0xf) << 3) | (l << 2) | (pp & 3);
936+
937+ EMIT3(b0, b1, b2);
938+ *pprog = prog;
939+}
940+
941+/* emit BMI2 shift instruction */
942+static void emit_shiftx(u8 **pprog, u32 dst_reg, u8 src_reg, bool is64, u8 op)
943+{
944+ u8 *prog = *pprog;
945+ bool r = is_ereg(dst_reg);
946+ u8 m = 2; /* escape code 0f38 */
947+
948+ emit_3vex(&prog, r, false, r, m, is64, src_reg, false, op);
949+ EMIT2(0xf7, add_2reg(0xC0, dst_reg, dst_reg));
950+ *pprog = prog;
951+}
952+
894953 #define INSN_SZ_DIFF (((addrs[i] - addrs[i - 1]) - (prog - temp)))
895954
896955 static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, u8 *rw_image,
@@ -1137,17 +1196,38 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, u8 *rw_image · 240 unmodified lines
11371196 case BPF_ALU64 | BPF_LSH | BPF_X:
11381197 case BPF_ALU64 | BPF_RSH | BPF_X:
11391198 case BPF_ALU64 | BPF_ARSH | BPF_X:
1199+ /* BMI2 shifts aren't better when shift count is already in rcx */
1200+ if (boot_cpu_has(X86_FEATURE_BMI2) && src_reg != BPF_REG_4) {
1201+ /* shrx/sarx/shlx dst_reg, dst_reg, src_reg */
1202+ bool w = (BPF_CLASS(insn->code) == BPF_ALU64);
1203+ u8 op;
1204+
1205+ switch (BPF_OP(insn->code)) {
1206+ case BPF_LSH:
1207+ op = 1; /* prefix 0x66 */
1208+ break;
1209+ case BPF_RSH:
1210+ op = 3; /* prefix 0xf2 */
1211+ break;
1212+ case BPF_ARSH:
1213+ op = 2; /* prefix 0xf3 */
1214+ break;
1215+ }
11401216
1141− /* Check for bad case when dst_reg == rcx */
1142− if (dst_reg == BPF_REG_4) {
1143− /* mov r11, dst_reg */
1144− EMIT_mov(AUX_REG, dst_reg);
1145− dst_reg = AUX_REG;
1217+ emit_shiftx(&prog, dst_reg, src_reg, w, op);
1218+
1219+ break;
11461220 }
11471221
11481222 if (src_reg != BPF_REG_4) { /* common case */
1149− EMIT1(0x51); /* push rcx */
1150−
1223+ /* Check for bad case when dst_reg == rcx */
1224+ if (dst_reg == BPF_REG_4) {
1225+ /* mov r11, dst_reg */
1226+ EMIT_mov(AUX_REG, dst_reg);
1227+ dst_reg = AUX_REG;
1228+ } else {
1229+ EMIT1(0x51); /* push rcx */
1230+ }
11511231 /* mov rcx, src_reg */
11521232 EMIT_mov(BPF_REG_4, src_reg);
11531233 }
@@ -1159,12 +1239,14 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, u8 *rw_image · 5 unmodified lines
11591239 b3 = simple_alu_opcodes[BPF_OP(insn->code)];
11601240 EMIT2(0xD3, add_1reg(b3, dst_reg));
11611241
1162− if (src_reg != BPF_REG_4)
1163− EMIT1(0x59); /* pop rcx */
1242+ if (src_reg != BPF_REG_4) {
1243+ if (insn->dst_reg == BPF_REG_4)
1244+ /* mov dst_reg, r11 */
1245+ EMIT_mov(insn->dst_reg, AUX_REG);
1246+ else
1247+ EMIT1(0x59); /* pop rcx */
1248+ }
11641249
1165− if (insn->dst_reg == BPF_REG_4)
1166− /* mov dst_reg, r11 */
1167− EMIT_mov(insn->dst_reg, AUX_REG);
11681250 break;
11691251
11701252 case BPF_ALU | BPF_END | BPF_FROM_BE:
@@ -1226,8 +1308,7 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image, u8 *rw_image · 55 unmodified lines
12261308
12271309 /* speculation barrier */
12281310 case BPF_ST | BPF_NOSPEC:
1229− if (boot_cpu_has(X86_FEATURE_XMM2))
1230− EMIT_LFENCE();
1311+ EMIT_LFENCE();
12311312 break;
12321313
12331314 /* ST: *(u8*)(dst_reg + off) = imm */
@@ -1813,10 +1894,6 @@ static int invoke_bpf_prog(const struct btf_func_model *m, u8 **pprog, · 579 unmodified lines
18131894 struct bpf_tramp_link *l, int stack_size,
18141895 int run_ctx_off, bool save_ret)
18151896 {
1816− void (*exit)(struct bpf_prog *prog, u64 start,
1817− struct bpf_tramp_run_ctx *run_ctx) = __bpf_prog_exit;
1818− u64 (*enter)(struct bpf_prog *prog,
1819− struct bpf_tramp_run_ctx *run_ctx) = __bpf_prog_enter;
18201897 u8 *prog = *pprog;
18211898 u8 *jmp_insn;
18221899 int ctx_cookie_off = offsetof(struct bpf_tramp_run_ctx, bpf_cookie);
@@ -1835,23 +1912,12 @@ static int invoke_bpf_prog(const struct btf_func_model *m, u8 **pprog, · 12 unmodified lines
18351912 */
18361913 emit_stx(&prog, BPF_DW, BPF_REG_FP, BPF_REG_1, -run_ctx_off + ctx_cookie_off);
18371914
1838− if (p->aux->sleepable) {
1839− enter = __bpf_prog_enter_sleepable;
1840− exit = __bpf_prog_exit_sleepable;
1841− } else if (p->type == BPF_PROG_TYPE_STRUCT_OPS) {
1842− enter = __bpf_prog_enter_struct_ops;
1843− exit = __bpf_prog_exit_struct_ops;
1844− } else if (p->expected_attach_type == BPF_LSM_CGROUP) {
1845− enter = __bpf_prog_enter_lsm_cgroup;
1846− exit = __bpf_prog_exit_lsm_cgroup;
1847− }
1848−
18491915 /* arg1: mov rdi, progs[i] */
18501916 emit_mov_imm64(&prog, BPF_REG_1, (long) p >> 32, (u32) (long) p);
18511917 /* arg2: lea rsi, [rbp - ctx_cookie_off] */
18521918 EMIT4(0x48, 0x8D, 0x75, -run_ctx_off);
18531919
1854− if (emit_call(&prog, enter, prog))
1920+ if (emit_call(&prog, bpf_trampoline_enter(p), prog))
18551921 return -EINVAL;
18561922 /* remember prog start time returned by __bpf_prog_enter */
18571923 emit_mov_reg(&prog, true, BPF_REG_6, BPF_REG_0);
@@ -1896,7 +1962,7 @@ static int invoke_bpf_prog(const struct btf_func_model *m, u8 **pprog, · 38 unmodified lines
18961962 emit_mov_reg(&prog, true, BPF_REG_2, BPF_REG_6);
18971963 /* arg3: lea rdx, [rbp - run_ctx_off] */
18981964 EMIT4(0x48, 0x8D, 0x55, -run_ctx_off);
1899− if (emit_call(&prog, exit, prog))
1965+ if (emit_call(&prog, bpf_trampoline_exit(p), prog))
19001966 return -EINVAL;
19011967
19021968 *pprog = prog;
drivers/bcma/driver_gpio.c+6−2
@@ -82,6 +82,7 @@ static void bcma_gpio_irq_unmask(struct irq_data *d) · 81 unmodified lines
8282 int gpio = irqd_to_hwirq(d);
8383 u32 val = bcma_chipco_gpio_in(cc, BIT(gpio));
8484
85+ gpiochip_enable_irq(gc, gpio);
8586 bcma_chipco_gpio_polarity(cc, BIT(gpio), val);
8687 bcma_chipco_gpio_intmask(cc, BIT(gpio), BIT(gpio));
8788 }
@@ -93,12 +94,15 @@ static void bcma_gpio_irq_mask(struct irq_data *d) · 5 unmodified lines
9394 int gpio = irqd_to_hwirq(d);
9495
9596 bcma_chipco_gpio_intmask(cc, BIT(gpio), 0);
97+ gpiochip_disable_irq(gc, gpio);
9698 }
9799
98−static struct irq_chip bcma_gpio_irq_chip = {
100+static const struct irq_chip bcma_gpio_irq_chip = {
99101 .name = "BCMA-GPIO",
100102 .irq_mask = bcma_gpio_irq_mask,
101103 .irq_unmask = bcma_gpio_irq_unmask,
104+ .flags = IRQCHIP_IMMUTABLE,
105+ GPIOCHIP_IRQ_RESOURCE_HELPERS,
102106 };
103107
104108 static irqreturn_t bcma_gpio_irq_handler(int irq, void *dev_id)
@@ -139,7 +143,7 @@ static int bcma_gpio_irq_init(struct bcma_drv_cc *cc) · 34 unmodified lines
139143 bcma_chipco_gpio_intmask(cc, ~0, 0);
140144 bcma_cc_set32(cc, BCMA_CC_IRQMASK, BCMA_CC_IRQ_GPIO);
141145
142− girq->chip = &bcma_gpio_irq_chip;
146+ gpio_irq_chip_set_chip(girq, &bcma_gpio_irq_chip);
143147 /* This will let us handle the parent IRQ in the driver */
144148 girq->parent_handler = NULL;
145149 girq->num_parents = 0;
drivers/bcma/main.c+3−1
@@ -344,8 +344,10 @@ static int bcma_register_devices(struct bcma_bus *bus) · 343 unmodified lines
344344 err = bcma_gpio_init(&bus->drv_cc);
345345 if (err == -ENOTSUPP)
346346 bcma_debug(bus, "GPIO driver not activated\n");
347− else if (err)
347+ else if (err) {
348348 bcma_err(bus, "Error registering GPIO driver: %i\n", err);
349+ return err;
350+ }
349351
350352 if (bus->hosttype == BCMA_HOSTTYPE_SOC) {
351353 err = bcma_chipco_watchdog_register(&bus->drv_cc);
drivers/bcma/sprom.c+1−1
@@ -165,7 +165,7 @@ static int bcma_sprom_valid(struct bcma_bus *bus, const u16 *sprom, · 164 unmodified lines
165165 return err;
166166
167167 revision = sprom[words - 1] & SSB_SPROM_REVISION_REV;
168− if (revision != 8 && revision != 9 && revision != 10) {
168+ if (revision < 8 || revision > 11) {
169169 pr_err("Unsupported SPROM revision: %d\n", revision);
170170 return -ENOENT;
171171 }
drivers/bluetooth/Kconfig+23−0
@@ -45,6 +45,17 @@ config BT_HCIBTUSB_AUTOSUSPEND · 44 unmodified lines
4545 This can be overridden by passing btusb.enable_autosuspend=[y|n]
4646 on the kernel commandline.
4747
48+config BT_HCIBTUSB_POLL_SYNC
49+ bool "Enable USB poll_sync for Bluetooth USB devices by default"
50+ depends on BT_HCIBTUSB
51+ default y
52+ help
53+ poll_sync synchronizes the USB data and event endpoints by
54+ prioritizing the later.
55+
56+ Say Y here to enable USB poll_sync for Bluetooth USB devices by
57+ default.
58+
4859 config BT_HCIBTUSB_BCM
4960 bool "Broadcom protocol support"
5061 depends on BT_HCIBTUSB
@@ -274,6 +285,18 @@ config BT_HCIBCM203X · 223 unmodified lines
274285 Say Y here to compile support for HCI BCM203x devices into the
275286 kernel or say M to compile it as module (bcm203x).
276287
288+
289+config BT_HCIBCM4377
290+ tristate "HCI BCM4377/4378/4387 PCIe driver"
291+ depends on PCI
292+ select FW_LOADER
293+ help
294+ Support for Broadcom BCM4377/4378/4387 Bluetooth chipsets attached via
295+ PCIe. These are usually found in Apple machines.
296+
297+ Say Y here to compile support for HCI BCM4377 family devices into the
298+ kernel or say M to compile it as module (hci_bcm4377).
299+
277300 config BT_HCIBPA10X
278301 tristate "HCI BPA10x USB driver"
279302 depends on USB
drivers/bluetooth/Makefile+1−0
@@ -6,6 +6,7 @@ · 5 unmodified lines
66 obj-$(CONFIG_BT_HCIVHCI) += hci_vhci.o
77 obj-$(CONFIG_BT_HCIUART) += hci_uart.o
88 obj-$(CONFIG_BT_HCIBCM203X) += bcm203x.o
9+obj-$(CONFIG_BT_HCIBCM4377) += hci_bcm4377.o
910 obj-$(CONFIG_BT_HCIBPA10X) += bpa10x.o
1011 obj-$(CONFIG_BT_HCIBFUSB) += bfusb.o
1112 obj-$(CONFIG_BT_HCIDTL1) += dtl1_cs.o
drivers/bluetooth/btintel.c+11−10
@@ -26,7 +26,7 @@ · 25 unmodified lines
2626
2727 #define CMD_WRITE_BOOT_PARAMS 0xfc0e
2828 struct cmd_write_boot_params {
29− u32 boot_addr;
29+ __le32 boot_addr;
3030 u8 fw_build_num;
3131 u8 fw_build_ww;
3232 u8 fw_build_yy;
@@ -1783,19 +1783,19 @@ static int btintel_get_fw_name(struct intel_version *ver, · 1750 unmodified lines
17831783 case 0x0b: /* SfP */
17841784 case 0x0c: /* WsP */
17851785 snprintf(fw_name, len, "intel/ibt-%u-%u.%s",
1786− le16_to_cpu(ver->hw_variant),
1787− le16_to_cpu(params->dev_revid),
1788− suffix);
1786+ ver->hw_variant,
1787+ le16_to_cpu(params->dev_revid),
1788+ suffix);
17891789 break;
17901790 case 0x11: /* JfP */
17911791 case 0x12: /* ThP */
17921792 case 0x13: /* HrP */
17931793 case 0x14: /* CcP */
17941794 snprintf(fw_name, len, "intel/ibt-%u-%u-%u.%s",
1795− le16_to_cpu(ver->hw_variant),
1796− le16_to_cpu(ver->hw_revision),
1797− le16_to_cpu(ver->fw_revision),
1798− suffix);
1795+ ver->hw_variant,
1796+ ver->hw_revision,
1797+ ver->fw_revision,
1798+ suffix);
17991799 break;
18001800 default:
18011801 return -EINVAL;
@@ -2524,7 +2524,7 @@ static int btintel_setup_combined(struct hci_dev *hdev) · 722 unmodified lines
25242524 */
25252525 err = btintel_read_version(hdev, &ver);
25262526 if (err)
2527− return err;
2527+ break;
25282528
25292529 /* Apply the device specific HCI quirks
25302530 *
@@ -2566,7 +2566,8 @@ static int btintel_setup_combined(struct hci_dev *hdev) · 35 unmodified lines
25662566 default:
25672567 bt_dev_err(hdev, "Unsupported Intel hw variant (%u)",
25682568 INTEL_HW_VARIANT(ver_tlv.cnvi_bt));
2569− return -EINVAL;
2569+ err = -EINVAL;
2570+ break;
25702571 }
25712572
25722573 exit_error:
drivers/bluetooth/btrtl.c+7−0
@@ -781,6 +781,13 @@ void btrtl_set_quirks(struct hci_dev *hdev, struct btrtl_device_info *btrtl_dev) · 780 unmodified lines
781781 case CHIP_ID_8852C:
782782 set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks);
783783 set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks);
784+
785+ /* RTL8852C needs to transmit mSBC data continuously without
786+ * the zero length of USB packets for the ALT 6 supported chips
787+ */
788+ if (btrtl_dev->project_id == CHIP_ID_8852C)
789+ btrealtek_set_flag(hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP);
790+
784791 hci_set_aosp_capable(hdev);
785792 break;
786793 default:
drivers/bluetooth/btrtl.h+21−0
@@ -47,6 +47,27 @@ struct rtl_vendor_config { · 46 unmodified lines
4747 struct rtl_vendor_config_entry entry[];
4848 } __packed;
4949
50+enum {
51+ REALTEK_ALT6_CONTINUOUS_TX_CHIP,
52+
53+ __REALTEK_NUM_FLAGS,
54+};
55+
56+struct btrealtek_data {
57+ DECLARE_BITMAP(flags, __REALTEK_NUM_FLAGS);
58+};
59+
60+#define btrealtek_set_flag(hdev, nr) \
61+ do { \
62+ struct btrealtek_data *realtek = hci_get_priv((hdev)); \
63+ set_bit((nr), realtek->flags); \
64+ } while (0)
65+
66+#define btrealtek_get_flag(hdev) \
67+ (((struct btrealtek_data *)hci_get_priv(hdev))->flags)
68+
69+#define btrealtek_test_flag(hdev, nr) test_bit((nr), btrealtek_get_flag(hdev))
70+
5071 #if IS_ENABLED(CONFIG_BT_RTL)
5172
5273 struct btrtl_device_info *btrtl_initialize(struct hci_dev *hdev,
drivers/bluetooth/btusb.c+204−32
@@ -32,6 +32,7 @@ · 31 unmodified lines
3232 static bool disable_scofix;
3333 static bool force_scofix;
3434 static bool enable_autosuspend = IS_ENABLED(CONFIG_BT_HCIBTUSB_AUTOSUSPEND);
35+static bool enable_poll_sync = IS_ENABLED(CONFIG_BT_HCIBTUSB_POLL_SYNC);
3536 static bool reset = true;
3637
3738 static struct usb_driver btusb_driver;
@@ -316,6 +317,90 @@ static const struct usb_device_id blacklist_table[] = { · 278 unmodified lines
316317 { USB_DEVICE(0x0489, 0xe0d0), .driver_info = BTUSB_QCA_WCN6855 |
317318 BTUSB_WIDEBAND_SPEECH |
318319 BTUSB_VALID_LE_STATES },
320+ { USB_DEVICE(0x10ab, 0x9108), .driver_info = BTUSB_QCA_WCN6855 |
321+ BTUSB_WIDEBAND_SPEECH |
322+ BTUSB_VALID_LE_STATES },
323+ { USB_DEVICE(0x10ab, 0x9109), .driver_info = BTUSB_QCA_WCN6855 |
324+ BTUSB_WIDEBAND_SPEECH |
325+ BTUSB_VALID_LE_STATES },
326+ { USB_DEVICE(0x10ab, 0x9208), .driver_info = BTUSB_QCA_WCN6855 |
327+ BTUSB_WIDEBAND_SPEECH |
328+ BTUSB_VALID_LE_STATES },
329+ { USB_DEVICE(0x10ab, 0x9209), .driver_info = BTUSB_QCA_WCN6855 |
330+ BTUSB_WIDEBAND_SPEECH |
331+ BTUSB_VALID_LE_STATES },
332+ { USB_DEVICE(0x10ab, 0x9308), .driver_info = BTUSB_QCA_WCN6855 |
333+ BTUSB_WIDEBAND_SPEECH |
334+ BTUSB_VALID_LE_STATES },
335+ { USB_DEVICE(0x10ab, 0x9408), .driver_info = BTUSB_QCA_WCN6855 |
336+ BTUSB_WIDEBAND_SPEECH |
337+ BTUSB_VALID_LE_STATES },
338+ { USB_DEVICE(0x10ab, 0x9508), .driver_info = BTUSB_QCA_WCN6855 |
339+ BTUSB_WIDEBAND_SPEECH |
340+ BTUSB_VALID_LE_STATES },
341+ { USB_DEVICE(0x10ab, 0x9509), .driver_info = BTUSB_QCA_WCN6855 |
342+ BTUSB_WIDEBAND_SPEECH |
343+ BTUSB_VALID_LE_STATES },
344+ { USB_DEVICE(0x10ab, 0x9608), .driver_info = BTUSB_QCA_WCN6855 |
345+ BTUSB_WIDEBAND_SPEECH |
346+ BTUSB_VALID_LE_STATES },
347+ { USB_DEVICE(0x10ab, 0x9609), .driver_info = BTUSB_QCA_WCN6855 |
348+ BTUSB_WIDEBAND_SPEECH |
349+ BTUSB_VALID_LE_STATES },
350+ { USB_DEVICE(0x10ab, 0x9f09), .driver_info = BTUSB_QCA_WCN6855 |
351+ BTUSB_WIDEBAND_SPEECH |
352+ BTUSB_VALID_LE_STATES },
353+ { USB_DEVICE(0x04ca, 0x3022), .driver_info = BTUSB_QCA_WCN6855 |
354+ BTUSB_WIDEBAND_SPEECH |
355+ BTUSB_VALID_LE_STATES },
356+ { USB_DEVICE(0x0489, 0xe0c7), .driver_info = BTUSB_QCA_WCN6855 |
357+ BTUSB_WIDEBAND_SPEECH |
358+ BTUSB_VALID_LE_STATES },
359+ { USB_DEVICE(0x0489, 0xe0c9), .driver_info = BTUSB_QCA_WCN6855 |
360+ BTUSB_WIDEBAND_SPEECH |
361+ BTUSB_VALID_LE_STATES },
362+ { USB_DEVICE(0x0489, 0xe0ca), .driver_info = BTUSB_QCA_WCN6855 |
363+ BTUSB_WIDEBAND_SPEECH |
364+ BTUSB_VALID_LE_STATES },
365+ { USB_DEVICE(0x0489, 0xe0cb), .driver_info = BTUSB_QCA_WCN6855 |
366+ BTUSB_WIDEBAND_SPEECH |
367+ BTUSB_VALID_LE_STATES },
368+ { USB_DEVICE(0x0489, 0xe0ce), .driver_info = BTUSB_QCA_WCN6855 |
369+ BTUSB_WIDEBAND_SPEECH |
370+ BTUSB_VALID_LE_STATES },
371+ { USB_DEVICE(0x0489, 0xe0de), .driver_info = BTUSB_QCA_WCN6855 |
372+ BTUSB_WIDEBAND_SPEECH |
373+ BTUSB_VALID_LE_STATES },
374+ { USB_DEVICE(0x0489, 0xe0df), .driver_info = BTUSB_QCA_WCN6855 |
375+ BTUSB_WIDEBAND_SPEECH |
376+ BTUSB_VALID_LE_STATES },
377+ { USB_DEVICE(0x0489, 0xe0e1), .driver_info = BTUSB_QCA_WCN6855 |
378+ BTUSB_WIDEBAND_SPEECH |
379+ BTUSB_VALID_LE_STATES },
380+ { USB_DEVICE(0x0489, 0xe0ea), .driver_info = BTUSB_QCA_WCN6855 |
381+ BTUSB_WIDEBAND_SPEECH |
382+ BTUSB_VALID_LE_STATES },
383+ { USB_DEVICE(0x0489, 0xe0ec), .driver_info = BTUSB_QCA_WCN6855 |
384+ BTUSB_WIDEBAND_SPEECH |
385+ BTUSB_VALID_LE_STATES },
386+ { USB_DEVICE(0x04ca, 0x3023), .driver_info = BTUSB_QCA_WCN6855 |
387+ BTUSB_WIDEBAND_SPEECH |
388+ BTUSB_VALID_LE_STATES },
389+ { USB_DEVICE(0x04ca, 0x3024), .driver_info = BTUSB_QCA_WCN6855 |
390+ BTUSB_WIDEBAND_SPEECH |
391+ BTUSB_VALID_LE_STATES },
392+ { USB_DEVICE(0x04ca, 0x3a22), .driver_info = BTUSB_QCA_WCN6855 |
393+ BTUSB_WIDEBAND_SPEECH |
394+ BTUSB_VALID_LE_STATES },
395+ { USB_DEVICE(0x04ca, 0x3a24), .driver_info = BTUSB_QCA_WCN6855 |
396+ BTUSB_WIDEBAND_SPEECH |
397+ BTUSB_VALID_LE_STATES },
398+ { USB_DEVICE(0x04ca, 0x3a26), .driver_info = BTUSB_QCA_WCN6855 |
399+ BTUSB_WIDEBAND_SPEECH |
400+ BTUSB_VALID_LE_STATES },
401+ { USB_DEVICE(0x04ca, 0x3a27), .driver_info = BTUSB_QCA_WCN6855 |
402+ BTUSB_WIDEBAND_SPEECH |
403+ BTUSB_VALID_LE_STATES },
319404
320405 /* QCA WCN785x chipset */
321406 { USB_DEVICE(0x0cf3, 0xe700), .driver_info = BTUSB_QCA_WCN6855 |
@@ -413,6 +498,10 @@ static const struct usb_device_id blacklist_table[] = { · 91 unmodified lines
413498 { USB_DEVICE(0x0bda, 0xc822), .driver_info = BTUSB_REALTEK |
414499 BTUSB_WIDEBAND_SPEECH },
415500
501+ /* Realtek 8822CU Bluetooth devices */
502+ { USB_DEVICE(0x13d3, 0x3549), .driver_info = BTUSB_REALTEK |
503+ BTUSB_WIDEBAND_SPEECH },
504+
416505 /* Realtek 8852AE Bluetooth devices */
417506 { USB_DEVICE(0x0bda, 0x2852), .driver_info = BTUSB_REALTEK |
418507 BTUSB_WIDEBAND_SPEECH },
@@ -443,6 +532,10 @@ static const struct usb_device_id blacklist_table[] = { · 24 unmodified lines
443532 { USB_DEVICE(0x13d3, 0x3592), .driver_info = BTUSB_REALTEK |
444533 BTUSB_WIDEBAND_SPEECH },
445534
535+ /* Realtek 8852BE Bluetooth devices */
536+ { USB_DEVICE(0x0cb8, 0xc559), .driver_info = BTUSB_REALTEK |
537+ BTUSB_WIDEBAND_SPEECH },
538+
446539 /* Realtek Bluetooth devices */
447540 { USB_VENDOR_AND_INTERFACE_INFO(0x0bda, 0xe0, 0x01, 0x01),
448541 .driver_info = BTUSB_REALTEK },
@@ -511,6 +604,9 @@ static const struct usb_device_id blacklist_table[] = { · 62 unmodified lines
511604 { USB_DEVICE(0x0489, 0xe0e2), .driver_info = BTUSB_MEDIATEK |
512605 BTUSB_WIDEBAND_SPEECH |
513606 BTUSB_VALID_LE_STATES },
607+ { USB_DEVICE(0x0489, 0xe0f2), .driver_info = BTUSB_MEDIATEK |
608+ BTUSB_WIDEBAND_SPEECH |
609+ BTUSB_VALID_LE_STATES },
514610
515611 /* Additional Realtek 8723AE Bluetooth devices */
516612 { USB_DEVICE(0x0930, 0x021d), .driver_info = BTUSB_REALTEK },
@@ -543,6 +639,8 @@ static const struct usb_device_id blacklist_table[] = { · 26 unmodified lines
543639 BTUSB_WIDEBAND_SPEECH },
544640 { USB_DEVICE(0x7392, 0xc611), .driver_info = BTUSB_REALTEK |
545641 BTUSB_WIDEBAND_SPEECH },
642+ { USB_DEVICE(0x2b89, 0x8761), .driver_info = BTUSB_REALTEK |
643+ BTUSB_WIDEBAND_SPEECH },
546644
547645 /* Additional Realtek 8821AE Bluetooth devices */
548646 { USB_DEVICE(0x0b05, 0x17dc), .driver_info = BTUSB_REALTEK },
@@ -632,6 +730,7 @@ static const struct dmi_system_id btusb_needs_reset_resume_table[] = { · 83 unmodified lines
632730 #define BTUSB_TX_WAIT_VND_EVT 13
633731 #define BTUSB_WAKEUP_AUTOSUSPEND 14
634732 #define BTUSB_USE_ALT3_FOR_WBS 15
733+#define BTUSB_ALT6_CONTINUOUS_TX 16
635734
636735 struct btusb_data {
637736 struct hci_dev *hdev;
@@ -696,6 +795,28 @@ struct btusb_data { · 58 unmodified lines
696795 unsigned cmd_timeout_cnt;
697796 };
698797
798+static void btusb_reset(struct hci_dev *hdev)
799+{
800+ struct btusb_data *data;
801+ int err;
802+
803+ if (hdev->reset) {
804+ hdev->reset(hdev);
805+ return;
806+ }
807+
808+ data = hci_get_drvdata(hdev);
809+ /* This is not an unbalanced PM reference since the device will reset */
810+ err = usb_autopm_get_interface(data->intf);
811+ if (err) {
812+ bt_dev_err(hdev, "Failed usb_autopm_get_interface: %d", err);
813+ return;
814+ }
815+
816+ bt_dev_err(hdev, "Resetting usb device.");
817+ usb_queue_reset_device(data->intf);
818+}
819+
699820 static void btusb_intel_cmd_timeout(struct hci_dev *hdev)
700821 {
701822 struct btusb_data *data = hci_get_drvdata(hdev);
@@ -705,7 +826,7 @@ static void btusb_intel_cmd_timeout(struct hci_dev *hdev) · 3 unmodified lines
705826 return;
706827
707828 if (!reset_gpio) {
708− bt_dev_err(hdev, "No way to reset. Ignoring and continuing");
829+ btusb_reset(hdev);
709830 return;
710831 }
711832
@@ -736,7 +857,7 @@ static void btusb_rtl_cmd_timeout(struct hci_dev *hdev) · 24 unmodified lines
736857 return;
737858
738859 if (!reset_gpio) {
739− bt_dev_err(hdev, "No gpio to reset Realtek device, ignoring");
860+ btusb_reset(hdev);
740861 return;
741862 }
742863
@@ -761,7 +882,6 @@ static void btusb_qca_cmd_timeout(struct hci_dev *hdev) · 18 unmodified lines
761882 {
762883 struct btusb_data *data = hci_get_drvdata(hdev);
763884 struct gpio_desc *reset_gpio = data->reset_gpio;
764− int err;
765885
766886 if (++data->cmd_timeout_cnt < 5)
767887 return;
@@ -787,13 +907,7 @@ static void btusb_qca_cmd_timeout(struct hci_dev *hdev) · 19 unmodified lines
787907 return;
788908 }
789909
790− bt_dev_err(hdev, "Multiple cmd timeouts seen. Resetting usb device.");
791− /* This is not an unbalanced PM reference since the device will reset */
792− err = usb_autopm_get_interface(data->intf);
793− if (!err)
794− usb_queue_reset_device(data->intf);
795− else
796− bt_dev_err(hdev, "Failed usb_autopm_get_interface with %d", err);
910+ btusb_reset(hdev);
797911 }
798912
799913 static inline void btusb_free_frags(struct btusb_data *data)
@@ -802,13 +916,13 @@ static inline void btusb_free_frags(struct btusb_data *data) · 2 unmodified lines
802916
803917 spin_lock_irqsave(&data->rxlock, flags);
804918
805− kfree_skb(data->evt_skb);
919+ dev_kfree_skb_irq(data->evt_skb);
806920 data->evt_skb = NULL;
807921
808− kfree_skb(data->acl_skb);
922+ dev_kfree_skb_irq(data->acl_skb);
809923 data->acl_skb = NULL;
810924
811− kfree_skb(data->sco_skb);
925+ dev_kfree_skb_irq(data->sco_skb);
812926 data->sco_skb = NULL;
813927
814928 spin_unlock_irqrestore(&data->rxlock, flags);
@@ -962,6 +1076,34 @@ static int btusb_recv_bulk(struct btusb_data *data, void *buffer, int count) · 147 unmodified lines
9621076 return err;
9631077 }
9641078
1079+static bool btusb_validate_sco_handle(struct hci_dev *hdev,
1080+ struct hci_sco_hdr *hdr)
1081+{
1082+ __u16 handle;
1083+
1084+ if (hci_dev_test_flag(hdev, HCI_USER_CHANNEL))
1085+ // Can't validate, userspace controls everything.
1086+ return true;
1087+
1088+ /*
1089+ * USB isochronous transfers are not designed to be reliable and may
1090+ * lose fragments. When this happens, the next first fragment
1091+ * encountered might actually be a continuation fragment.
1092+ * Validate the handle to detect it and drop it, or else the upper
1093+ * layer will get garbage for a while.
1094+ */
1095+
1096+ handle = hci_handle(__le16_to_cpu(hdr->handle));
1097+
1098+ switch (hci_conn_lookup_type(hdev, handle)) {
1099+ case SCO_LINK:
1100+ case ESCO_LINK:
1101+ return true;
1102+ default:
1103+ return false;
1104+ }
1105+}
1106+
9651107 static int btusb_recv_isoc(struct btusb_data *data, void *buffer, int count)
9661108 {
9671109 struct sk_buff *skb;
@@ -994,9 +1136,12 @@ static int btusb_recv_isoc(struct btusb_data *data, void *buffer, int count) · 26 unmodified lines
9941136
9951137 if (skb->len == HCI_SCO_HDR_SIZE) {
9961138 /* Complete SCO header */
997− hci_skb_expect(skb) = hci_sco_hdr(skb)->dlen;
1139+ struct hci_sco_hdr *hdr = hci_sco_hdr(skb);
9981140
999− if (skb_tailroom(skb) < hci_skb_expect(skb)) {
1141+ hci_skb_expect(skb) = hdr->dlen;
1142+
1143+ if (skb_tailroom(skb) < hci_skb_expect(skb) ||
1144+ !btusb_validate_sco_handle(data->hdev, hdr)) {
10001145 kfree_skb(skb);
10011146 skb = NULL;
10021147
@@ -1276,11 +1421,17 @@ static void btusb_isoc_complete(struct urb *urb) · 273 unmodified lines
12761421 static inline void __fill_isoc_descriptor_msbc(struct urb *urb, int len,
12771422 int mtu, struct btusb_data *data)
12781423 {
1279− int i, offset = 0;
1424+ int i = 0, offset = 0;
12801425 unsigned int interval;
12811426
12821427 BT_DBG("len %d mtu %d", len, mtu);
12831428
1429+ /* For mSBC ALT 6 settings some chips need to transmit the data
1430+ * continuously without the zero length of USB packets.
1431+ */
1432+ if (test_bit(BTUSB_ALT6_CONTINUOUS_TX, &data->flags))
1433+ goto ignore_usb_alt6_packet_flow;
1434+
12841435 /* For mSBC ALT 6 setting the host will send the packet at continuous
12851436 * flow. As per core spec 5, vol 4, part B, table 2.1. For ALT setting
12861437 * 6 the HCI PACKET INTERVAL should be 7.5ms for every usb packets.
@@ -1300,6 +1451,7 @@ static inline void __fill_isoc_descriptor_msbc(struct urb *urb, int len, · 13 unmodified lines
13001451 urb->iso_frame_desc[i].length = offset;
13011452 }
13021453
1454+ignore_usb_alt6_packet_flow:
13031455 if (len && i < BTUSB_MAX_ISOC_FRAMES) {
13041456 urb->iso_frame_desc[i].offset = offset;
13051457 urb->iso_frame_desc[i].length = len;
@@ -1981,10 +2133,11 @@ static void btusb_work(struct work_struct *work) · 675 unmodified lines
19812133 if (btusb_switch_alt_setting(hdev, new_alts) < 0)
19822134 bt_dev_err(hdev, "set USB alt:(%d) failed!", new_alts);
19832135 } else {
1984− clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
19852136 usb_kill_anchored_urbs(&data->isoc_anchor);
19862137
1987− __set_isoc_interface(hdev, 0);
2138+ if (test_and_clear_bit(BTUSB_ISOC_RUNNING, &data->flags))
2139+ __set_isoc_interface(hdev, 0);
2140+
19882141 if (test_and_clear_bit(BTUSB_DID_ISO_RESUME, &data->flags))
19892142 usb_autopm_put_interface(data->isoc ? data->isoc : data->intf);
19902143 }
@@ -2048,18 +2201,19 @@ static int btusb_setup_csr(struct hci_dev *hdev) · 57 unmodified lines
20482201 return err;
20492202 }
20502203
2051− if (skb->len != sizeof(struct hci_rp_read_local_version)) {
2204+ rp = skb_pull_data(skb, sizeof(*rp));
2205+ if (!rp) {
20522206 bt_dev_err(hdev, "CSR: Local version length mismatch");
20532207 kfree_skb(skb);
20542208 return -EIO;
20552209 }
20562210
2057− rp = (struct hci_rp_read_local_version *)skb->data;
2211+ bt_dev_info(hdev, "CSR: Setting up dongle with HCI ver=%u rev=%04x",
2212+ rp->hci_ver, le16_to_cpu(rp->hci_rev));
20582213
2059− bt_dev_info(hdev, "CSR: Setting up dongle with HCI ver=%u rev=%04x; LMP ver=%u subver=%04x; manufacturer=%u",
2060− le16_to_cpu(rp->hci_ver), le16_to_cpu(rp->hci_rev),
2061− le16_to_cpu(rp->lmp_ver), le16_to_cpu(rp->lmp_subver),
2062− le16_to_cpu(rp->manufacturer));
2214+ bt_dev_info(hdev, "LMP ver=%u subver=%04x; manufacturer=%u",
2215+ rp->lmp_ver, le16_to_cpu(rp->lmp_subver),
2216+ le16_to_cpu(rp->manufacturer));
20632217
20642218 /* Detect a wide host of Chinese controllers that aren't CSR.
20652219 *
@@ -2089,29 +2243,29 @@ static int btusb_setup_csr(struct hci_dev *hdev) · 23 unmodified lines
20892243 * third-party BT 4.0 dongle reuses it.
20902244 */
20912245 else if (le16_to_cpu(rp->lmp_subver) <= 0x034e &&
2092− le16_to_cpu(rp->hci_ver) > BLUETOOTH_VER_1_1)
2246+ rp->hci_ver > BLUETOOTH_VER_1_1)
20932247 is_fake = true;
20942248
20952249 else if (le16_to_cpu(rp->lmp_subver) <= 0x0529 &&
2096− le16_to_cpu(rp->hci_ver) > BLUETOOTH_VER_1_2)
2250+ rp->hci_ver > BLUETOOTH_VER_1_2)
20972251 is_fake = true;
20982252
20992253 else if (le16_to_cpu(rp->lmp_subver) <= 0x0c5c &&
2100− le16_to_cpu(rp->hci_ver) > BLUETOOTH_VER_2_0)
2254+ rp->hci_ver > BLUETOOTH_VER_2_0)
21012255 is_fake = true;
21022256
21032257 else if (le16_to_cpu(rp->lmp_subver) <= 0x1899 &&
2104− le16_to_cpu(rp->hci_ver) > BLUETOOTH_VER_2_1)
2258+ rp->hci_ver > BLUETOOTH_VER_2_1)
21052259 is_fake = true;
21062260
21072261 else if (le16_to_cpu(rp->lmp_subver) <= 0x22bb &&
2108− le16_to_cpu(rp->hci_ver) > BLUETOOTH_VER_4_0)
2262+ rp->hci_ver > BLUETOOTH_VER_4_0)
21092263 is_fake = true;
21102264
21112265 /* Other clones which beat all the above checks */
21122266 else if (bcdDevice == 0x0134 &&
21132267 le16_to_cpu(rp->lmp_subver) == 0x0c5c &&
2114− le16_to_cpu(rp->hci_ver) == BLUETOOTH_VER_2_0)
2268+ rp->hci_ver == BLUETOOTH_VER_2_0)
21152269 is_fake = true;
21162270
21172271 if (is_fake) {
@@ -2321,6 +2475,19 @@ static int btusb_send_frame_intel(struct hci_dev *hdev, struct sk_buff *skb) · 203 unmodified lines
23212475 return -EILSEQ;
23222476 }
23232477
2478+static int btusb_setup_realtek(struct hci_dev *hdev)
2479+{
2480+ struct btusb_data *data = hci_get_drvdata(hdev);
2481+ int ret;
2482+
2483+ ret = btrtl_setup_realtek(hdev);
2484+
2485+ if (btrealtek_test_flag(data->hdev, REALTEK_ALT6_CONTINUOUS_TX_CHIP))
2486+ set_bit(BTUSB_ALT6_CONTINUOUS_TX, &data->flags);
2487+
2488+ return ret;
2489+}
2490+
23242491 /* UHW CR mapping */
23252492 #define MTK_BT_MISC 0x70002510
23262493 #define MTK_BT_SUBSYS_RST 0x70002610
@@ -3256,7 +3423,7 @@ static int btusb_setup_qca_load_rampatch(struct hci_dev *hdev, · 929 unmodified lines
32563423
32573424 if (ver_rom & ~0xffffU) {
32583425 rver_rom_high = le16_to_cpu(rver->rom_version_high);
3259− rver_rom = le32_to_cpu(rver_rom_high << 16 | rver_rom_low);
3426+ rver_rom = rver_rom_high << 16 | rver_rom_low;
32603427 } else {
32613428 rver_rom = rver_rom_low;
32623429 }
@@ -3761,6 +3928,9 @@ static int btusb_probe(struct usb_interface *intf, · 498 unmodified lines
37613928 /* Override the rx handlers */
37623929 data->recv_event = btusb_recv_event_intel;
37633930 data->recv_bulk = btusb_recv_bulk_intel;
3931+ } else if (id->driver_info & BTUSB_REALTEK) {
3932+ /* Allocate extra space for Realtek device */
3933+ priv_size += sizeof(struct btrealtek_data);
37643934 }
37653935
37663936 data->recv_acl = hci_recv_frame;
@@ -3919,7 +4089,7 @@ static int btusb_probe(struct usb_interface *intf, · 152 unmodified lines
39194089
39204090 if (IS_ENABLED(CONFIG_BT_HCIBTUSB_RTL) &&
39214091 (id->driver_info & BTUSB_REALTEK)) {
3922− hdev->setup = btrtl_setup_realtek;
4092+ hdev->setup = btusb_setup_realtek;
39234093 hdev->shutdown = btrtl_shutdown_realtek;
39244094 hdev->cmd_timeout = btusb_rtl_cmd_timeout;
39254095
@@ -4004,6 +4174,8 @@ static int btusb_probe(struct usb_interface *intf, · 78 unmodified lines
40044174 if (enable_autosuspend)
40054175 usb_enable_autosuspend(data->udev);
40064176
4177+ data->poll_sync = enable_poll_sync;
4178+
40074179 err = hci_register_dev(hdev);
40084180 if (err < 0)
40094181 goto out_free_dev;
drivers/bluetooth/hci_bcm.c+12−1
@@ -53,11 +53,13 @@ · 52 unmodified lines
5353 * struct bcm_device_data - device specific data
5454 * @no_early_set_baudrate: Disallow set baudrate before driver setup()
5555 * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it
56+ * @no_uart_clock_set: UART clock set command for >3Mbps mode is unavailable
5657 * @max_autobaud_speed: max baudrate supported by device in autobaud mode
5758 */
5859 struct bcm_device_data {
5960 bool no_early_set_baudrate;
6061 bool drive_rts_on_open;
62+ bool no_uart_clock_set;
6163 u32 max_autobaud_speed;
6264 };
6365
@@ -100,6 +102,7 @@ struct bcm_device_data { · 36 unmodified lines
100102 * @is_suspended: whether flow control is currently disabled
101103 * @no_early_set_baudrate: don't set_baudrate before setup()
102104 * @drive_rts_on_open: drive RTS signal on ->open() when platform requires it
105+ * @no_uart_clock_set: UART clock set command for >3Mbps mode is unavailable
103106 * @pcm_int_params: keep the initial PCM configuration
104107 * @use_autobaud_mode: start Bluetooth device in autobaud mode
105108 * @max_autobaud_speed: max baudrate supported by device in autobaud mode
@@ -140,6 +143,7 @@ struct bcm_device { · 34 unmodified lines
140143 #endif
141144 bool no_early_set_baudrate;
142145 bool drive_rts_on_open;
146+ bool no_uart_clock_set;
143147 bool use_autobaud_mode;
144148 u8 pcm_int_params[5];
145149 u32 max_autobaud_speed;
@@ -172,10 +176,11 @@ static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed) · 26 unmodified lines
172176 static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed)
173177 {
174178 struct hci_dev *hdev = hu->hdev;
179+ struct bcm_data *bcm = hu->priv;
175180 struct sk_buff *skb;
176181 struct bcm_update_uart_baud_rate param;
177182
178− if (speed > 3000000) {
183+ if (speed > 3000000 && !bcm->dev->no_uart_clock_set) {
179184 struct bcm_write_uart_clock_setting clock;
180185
181186 clock.type = BCM_UART_CLOCK_48MHZ;
@@ -1529,6 +1534,7 @@ static int bcm_serdev_probe(struct serdev_device *serdev) · 1347 unmodified lines
15291534 bcmdev->max_autobaud_speed = data->max_autobaud_speed;
15301535 bcmdev->no_early_set_baudrate = data->no_early_set_baudrate;
15311536 bcmdev->drive_rts_on_open = data->drive_rts_on_open;
1537+ bcmdev->no_uart_clock_set = data->no_uart_clock_set;
15321538 }
15331539
15341540 return hci_uart_register_device(&bcmdev->serdev_hu, &bcm_proto);
@@ -1550,6 +1556,10 @@ static struct bcm_device_data bcm43438_device_data = { · 15 unmodified lines
15501556 .drive_rts_on_open = true,
15511557 };
15521558
1559+static struct bcm_device_data cyw4373a0_device_data = {
1560+ .no_uart_clock_set = true,
1561+};
1562+
15531563 static struct bcm_device_data cyw55572_device_data = {
15541564 .max_autobaud_speed = 921600,
15551565 };
@@ -1566,6 +1576,7 @@ static const struct of_device_id bcm_bluetooth_of_match[] = { · 10 unmodified lines
15661576 { .compatible = "brcm,bcm4349-bt", .data = &bcm43438_device_data },
15671577 { .compatible = "brcm,bcm43540-bt", .data = &bcm4354_device_data },
15681578 { .compatible = "brcm,bcm4335a0" },
1579+ { .compatible = "cypress,cyw4373a0-bt", .data = &cyw4373a0_device_data },
15691580 { .compatible = "infineon,cyw55572-bt", .data = &cyw55572_device_data },
15701581 { },
15711582 };
drivers/bluetooth/hci_bcm4377.c+2514−0
@@ -0,0 +1,2514 @@
1+// SPDX-License-Identifier: GPL-2.0-only OR MIT
2+/*
3+ * Bluetooth HCI driver for Broadcom 4377/4378/4387 devices attached via PCIe
4+ *
5+ * Copyright (C) The Asahi Linux Contributors
6+ */
7+
8+#include <linux/async.h>
9+#include <linux/bitfield.h>
10+#include <linux/completion.h>
11+#include <linux/dma-mapping.h>
12+#include <linux/dmi.h>
13+#include <linux/firmware.h>
14+#include <linux/module.h>
15+#include <linux/msi.h>
16+#include <linux/of.h>
17+#include <linux/pci.h>
18+#include <linux/printk.h>
19+
20+#include <asm/unaligned.h>
21+
22+#include <net/bluetooth/bluetooth.h>
23+#include <net/bluetooth/hci_core.h>
24+
25+enum bcm4377_chip {
26+ BCM4377 = 0,
27+ BCM4378,
28+ BCM4387,
29+};
30+
31+#define BCM4377_DEVICE_ID 0x5fa0
32+#define BCM4378_DEVICE_ID 0x5f69
33+#define BCM4387_DEVICE_ID 0x5f71
34+
35+#define BCM4377_TIMEOUT 1000
36+
37+/*
38+ * These devices only support DMA transactions inside a 32bit window
39+ * (possibly to avoid 64 bit arithmetic). The window size cannot exceed
40+ * 0xffffffff but is always aligned down to the previous 0x200 byte boundary
41+ * which effectively limits the window to [start, start+0xfffffe00].
42+ * We just limit the DMA window to [0, 0xfffffe00] to make sure we don't
43+ * run into this limitation.
44+ */
45+#define BCM4377_DMA_MASK 0xfffffe00
46+
47+#define BCM4377_PCIECFG_BAR0_WINDOW1 0x80
48+#define BCM4377_PCIECFG_BAR0_WINDOW2 0x70
49+#define BCM4377_PCIECFG_BAR0_CORE2_WINDOW1 0x74
50+#define BCM4377_PCIECFG_BAR0_CORE2_WINDOW2 0x78
51+#define BCM4377_PCIECFG_BAR2_WINDOW 0x84
52+
53+#define BCM4377_PCIECFG_BAR0_CORE2_WINDOW1_DEFAULT 0x18011000
54+#define BCM4377_PCIECFG_BAR2_WINDOW_DEFAULT 0x19000000
55+
56+#define BCM4377_PCIECFG_SUBSYSTEM_CTRL 0x88
57+
58+#define BCM4377_BAR0_FW_DOORBELL 0x140
59+#define BCM4377_BAR0_RTI_CONTROL 0x144
60+
61+#define BCM4377_BAR0_SLEEP_CONTROL 0x150
62+#define BCM4377_BAR0_SLEEP_CONTROL_UNQUIESCE 0
63+#define BCM4377_BAR0_SLEEP_CONTROL_AWAKE 2
64+#define BCM4377_BAR0_SLEEP_CONTROL_QUIESCE 3
65+
66+#define BCM4377_BAR0_DOORBELL 0x174
67+#define BCM4377_BAR0_DOORBELL_VALUE GENMASK(31, 16)
68+#define BCM4377_BAR0_DOORBELL_IDX GENMASK(15, 8)
69+#define BCM4377_BAR0_DOORBELL_RING BIT(5)
70+
71+#define BCM4377_BAR0_HOST_WINDOW_LO 0x590
72+#define BCM4377_BAR0_HOST_WINDOW_HI 0x594
73+#define BCM4377_BAR0_HOST_WINDOW_SIZE 0x598
74+
75+#define BCM4377_BAR2_BOOTSTAGE 0x200454
76+
77+#define BCM4377_BAR2_FW_LO 0x200478
78+#define BCM4377_BAR2_FW_HI 0x20047c
79+#define BCM4377_BAR2_FW_SIZE 0x200480
80+
81+#define BCM4377_BAR2_CONTEXT_ADDR_LO 0x20048c
82+#define BCM4377_BAR2_CONTEXT_ADDR_HI 0x200450
83+
84+#define BCM4377_BAR2_RTI_STATUS 0x20045c
85+#define BCM4377_BAR2_RTI_WINDOW_LO 0x200494
86+#define BCM4377_BAR2_RTI_WINDOW_HI 0x200498
87+#define BCM4377_BAR2_RTI_WINDOW_SIZE 0x20049c
88+
89+#define BCM4377_OTP_SIZE 0xe0
90+#define BCM4377_OTP_SYS_VENDOR 0x15
91+#define BCM4377_OTP_CIS 0x80
92+#define BCM4377_OTP_VENDOR_HDR 0x00000008
93+#define BCM4377_OTP_MAX_PARAM_LEN 16
94+
95+#define BCM4377_N_TRANSFER_RINGS 9
96+#define BCM4377_N_COMPLETION_RINGS 6
97+
98+#define BCM4377_MAX_RING_SIZE 256
99+
100+#define BCM4377_MSGID_GENERATION GENMASK(15, 8)
101+#define BCM4377_MSGID_ID GENMASK(7, 0)
102+
103+#define BCM4377_RING_N_ENTRIES 128
104+
105+#define BCM4377_CONTROL_MSG_SIZE 0x34
106+#define BCM4377_XFER_RING_MAX_INPLACE_PAYLOAD_SIZE (4 * 0xff)
107+
108+#define MAX_ACL_PAYLOAD_SIZE (HCI_MAX_FRAME_SIZE + HCI_ACL_HDR_SIZE)
109+#define MAX_SCO_PAYLOAD_SIZE (HCI_MAX_SCO_SIZE + HCI_SCO_HDR_SIZE)
110+#define MAX_EVENT_PAYLOAD_SIZE (HCI_MAX_EVENT_SIZE + HCI_EVENT_HDR_SIZE)
111+
112+enum bcm4377_otp_params_type {
113+ BCM4377_OTP_BOARD_PARAMS,
114+ BCM4377_OTP_CHIP_PARAMS
115+};
116+
117+enum bcm4377_transfer_ring_id {
118+ BCM4377_XFER_RING_CONTROL = 0,
119+ BCM4377_XFER_RING_HCI_H2D = 1,
120+ BCM4377_XFER_RING_HCI_D2H = 2,
121+ BCM4377_XFER_RING_SCO_H2D = 3,
122+ BCM4377_XFER_RING_SCO_D2H = 4,
123+ BCM4377_XFER_RING_ACL_H2D = 5,
124+ BCM4377_XFER_RING_ACL_D2H = 6,
125+};
126+
127+enum bcm4377_completion_ring_id {
128+ BCM4377_ACK_RING_CONTROL = 0,
129+ BCM4377_ACK_RING_HCI_ACL = 1,
130+ BCM4377_EVENT_RING_HCI_ACL = 2,
131+ BCM4377_ACK_RING_SCO = 3,
132+ BCM4377_EVENT_RING_SCO = 4,
133+};
134+
135+enum bcm4377_doorbell {
136+ BCM4377_DOORBELL_CONTROL = 0,
137+ BCM4377_DOORBELL_HCI_H2D = 1,
138+ BCM4377_DOORBELL_HCI_D2H = 2,
139+ BCM4377_DOORBELL_ACL_H2D = 3,
140+ BCM4377_DOORBELL_ACL_D2H = 4,
141+ BCM4377_DOORBELL_SCO = 6,
142+};
143+
144+/*
145+ * Transfer ring entry
146+ *
147+ * flags: Flags to indicate if the payload is appended or mapped
148+ * len: Payload length
149+ * payload: Optional payload DMA address
150+ * id: Message id to recognize the answer in the completion ring entry
151+ */
152+struct bcm4377_xfer_ring_entry {
153+#define BCM4377_XFER_RING_FLAG_PAYLOAD_MAPPED BIT(0)
154+#define BCM4377_XFER_RING_FLAG_PAYLOAD_IN_FOOTER BIT(1)
155+ u8 flags;
156+ __le16 len;
157+ u8 _unk0;
158+ __le64 payload;
159+ __le16 id;
160+ u8 _unk1[2];
161+} __packed;
162+static_assert(sizeof(struct bcm4377_xfer_ring_entry) == 0x10);
163+
164+/*
165+ * Completion ring entry
166+ *
167+ * flags: Flags to indicate if the payload is appended or mapped. If the payload
168+ * is mapped it can be found in the buffer of the corresponding transfer
169+ * ring message.
170+ * ring_id: Transfer ring ID which required this message
171+ * msg_id: Message ID specified in transfer ring entry
172+ * len: Payload length
173+ */
174+struct bcm4377_completion_ring_entry {
175+ u8 flags;
176+ u8 _unk0;
177+ __le16 ring_id;
178+ __le16 msg_id;
179+ __le32 len;
180+ u8 _unk1[6];
181+} __packed;
182+static_assert(sizeof(struct bcm4377_completion_ring_entry) == 0x10);
183+
184+enum bcm4377_control_message_type {
185+ BCM4377_CONTROL_MSG_CREATE_XFER_RING = 1,
186+ BCM4377_CONTROL_MSG_CREATE_COMPLETION_RING = 2,
187+ BCM4377_CONTROL_MSG_DESTROY_XFER_RING = 3,
188+ BCM4377_CONTROL_MSG_DESTROY_COMPLETION_RING = 4,
189+};
190+
191+/*
192+ * Control message used to create a completion ring
193+ *
194+ * msg_type: Must be BCM4377_CONTROL_MSG_CREATE_COMPLETION_RING
195+ * header_size: Unknown, but probably reserved space in front of the entry
196+ * footer_size: Number of 32 bit words reserved for payloads after the entry
197+ * id/id_again: Completion ring index
198+ * ring_iova: DMA address of the ring buffer
199+ * n_elements: Number of elements inside the ring buffer
200+ * msi: MSI index, doesn't work for all rings though and should be zero
201+ * intmod_delay: Unknown delay
202+ * intmod_bytes: Unknown
203+ */
204+struct bcm4377_create_completion_ring_msg {
205+ u8 msg_type;
206+ u8 header_size;
207+ u8 footer_size;
208+ u8 _unk0;
209+ __le16 id;
210+ __le16 id_again;
211+ __le64 ring_iova;
212+ __le16 n_elements;
213+ __le32 unk;
214+ u8 _unk1[6];
215+ __le16 msi;
216+ __le16 intmod_delay;
217+ __le32 intmod_bytes;
218+ __le16 _unk2;
219+ __le32 _unk3;
220+ u8 _unk4[10];
221+} __packed;
222+static_assert(sizeof(struct bcm4377_create_completion_ring_msg) ==
223+ BCM4377_CONTROL_MSG_SIZE);
224+
225+/*
226+ * Control ring message used to destroy a completion ring
227+ *
228+ * msg_type: Must be BCM4377_CONTROL_MSG_DESTROY_COMPLETION_RING
229+ * ring_id: Completion ring to be destroyed
230+ */
231+struct bcm4377_destroy_completion_ring_msg {
232+ u8 msg_type;
233+ u8 _pad0;
234+ __le16 ring_id;
235+ u8 _pad1[48];
236+} __packed;
237+static_assert(sizeof(struct bcm4377_destroy_completion_ring_msg) ==
238+ BCM4377_CONTROL_MSG_SIZE);
239+
240+/*
241+ * Control message used to create a transfer ring
242+ *
243+ * msg_type: Must be BCM4377_CONTROL_MSG_CREATE_XFER_RING
244+ * header_size: Number of 32 bit words reserved for unknown content before the
245+ * entry
246+ * footer_size: Number of 32 bit words reserved for payloads after the entry
247+ * ring_id/ring_id_again: Transfer ring index
248+ * ring_iova: DMA address of the ring buffer
249+ * n_elements: Number of elements inside the ring buffer
250+ * completion_ring_id: Completion ring index for acknowledgements and events
251+ * doorbell: Doorbell index used to notify device of new entries
252+ * flags: Transfer ring flags
253+ * - virtual: set if there is no associated shared memory and only the
254+ * corresponding completion ring is used
255+ * - sync: only set for the SCO rings
256+ */
257+struct bcm4377_create_transfer_ring_msg {
258+ u8 msg_type;
259+ u8 header_size;
260+ u8 footer_size;
261+ u8 _unk0;
262+ __le16 ring_id;
263+ __le16 ring_id_again;
264+ __le64 ring_iova;
265+ u8 _unk1[8];
266+ __le16 n_elements;
267+ __le16 completion_ring_id;
268+ __le16 doorbell;
269+#define BCM4377_XFER_RING_FLAG_VIRTUAL BIT(7)
270+#define BCM4377_XFER_RING_FLAG_SYNC BIT(8)
271+ __le16 flags;
272+ u8 _unk2[20];
273+} __packed;
274+static_assert(sizeof(struct bcm4377_create_transfer_ring_msg) ==
275+ BCM4377_CONTROL_MSG_SIZE);
276+
277+/*
278+ * Control ring message used to destroy a transfer ring
279+ *
280+ * msg_type: Must be BCM4377_CONTROL_MSG_DESTROY_XFER_RING
281+ * ring_id: Transfer ring to be destroyed
282+ */
283+struct bcm4377_destroy_transfer_ring_msg {
284+ u8 msg_type;
285+ u8 _pad0;
286+ __le16 ring_id;
287+ u8 _pad1[48];
288+} __packed;
289+static_assert(sizeof(struct bcm4377_destroy_transfer_ring_msg) ==
290+ BCM4377_CONTROL_MSG_SIZE);
291+
292+/*
293+ * "Converged IPC" context struct used to make the device aware of all other
294+ * shared memory structures. A pointer to this structure is configured inside a
295+ * MMIO register.
296+ *
297+ * version: Protocol version, must be 2.
298+ * size: Size of this structure, must be 0x68.
299+ * enabled_caps: Enabled capabilities. Unknown bitfield but should be 2.
300+ * peripheral_info_addr: DMA address for a 0x20 buffer to which the device will
301+ * write unknown contents
302+ * {completion,xfer}_ring_{tails,heads}_addr: DMA pointers to ring heads/tails
303+ * n_completion_rings: Number of completion rings, the firmware only works if
304+ * this is set to BCM4377_N_COMPLETION_RINGS.
305+ * n_xfer_rings: Number of transfer rings, the firmware only works if
306+ * this is set to BCM4377_N_TRANSFER_RINGS.
307+ * control_completion_ring_addr: Control completion ring buffer DMA address
308+ * control_xfer_ring_addr: Control transfer ring buffer DMA address
309+ * control_xfer_ring_n_entries: Number of control transfer ring entries
310+ * control_completion_ring_n_entries: Number of control completion ring entries
311+ * control_xfer_ring_doorbell: Control transfer ring doorbell
312+ * control_completion_ring_doorbell: Control completion ring doorbell,
313+ * must be set to 0xffff
314+ * control_xfer_ring_msi: Control completion ring MSI index, must be 0
315+ * control_completion_ring_msi: Control completion ring MSI index, must be 0.
316+ * control_xfer_ring_header_size: Number of 32 bit words reserved in front of
317+ * every control transfer ring entry
318+ * control_xfer_ring_footer_size: Number of 32 bit words reserved after every
319+ * control transfer ring entry
320+ * control_completion_ring_header_size: Number of 32 bit words reserved in front
321+ * of every control completion ring entry
322+ * control_completion_ring_footer_size: Number of 32 bit words reserved after
323+ * every control completion ring entry
324+ * scratch_pad: Optional scratch pad DMA address
325+ * scratch_pad_size: Scratch pad size
326+ */
327+struct bcm4377_context {
328+ __le16 version;
329+ __le16 size;
330+ __le32 enabled_caps;
331+
332+ __le64 peripheral_info_addr;
333+
334+ /* ring heads and tails */
335+ __le64 completion_ring_heads_addr;
336+ __le64 xfer_ring_tails_addr;
337+ __le64 completion_ring_tails_addr;
338+ __le64 xfer_ring_heads_addr;
339+ __le16 n_completion_rings;
340+ __le16 n_xfer_rings;
341+
342+ /* control ring configuration */
343+ __le64 control_completion_ring_addr;
344+ __le64 control_xfer_ring_addr;
345+ __le16 control_xfer_ring_n_entries;
346+ __le16 control_completion_ring_n_entries;
347+ __le16 control_xfer_ring_doorbell;
348+ __le16 control_completion_ring_doorbell;
349+ __le16 control_xfer_ring_msi;
350+ __le16 control_completion_ring_msi;
351+ u8 control_xfer_ring_header_size;
352+ u8 control_xfer_ring_footer_size;
353+ u8 control_completion_ring_header_size;
354+ u8 control_completion_ring_footer_size;
355+
356+ __le16 _unk0;
357+ __le16 _unk1;
358+
359+ __le64 scratch_pad;
360+ __le32 scratch_pad_size;
361+
362+ __le32 _unk3;
363+} __packed;
364+static_assert(sizeof(struct bcm4377_context) == 0x68);
365+
366+#define BCM4378_CALIBRATION_CHUNK_SIZE 0xe6
367+struct bcm4378_hci_send_calibration_cmd {
368+ u8 unk;
369+ __le16 blocks_left;
370+ u8 data[BCM4378_CALIBRATION_CHUNK_SIZE];
371+} __packed;
372+
373+#define BCM4378_PTB_CHUNK_SIZE 0xcf
374+struct bcm4378_hci_send_ptb_cmd {
375+ __le16 blocks_left;
376+ u8 data[BCM4378_PTB_CHUNK_SIZE];
377+} __packed;
378+
379+/*
380+ * Shared memory structure used to store the ring head and tail pointers.
381+ */
382+struct bcm4377_ring_state {
383+ __le16 completion_ring_head[BCM4377_N_COMPLETION_RINGS];
384+ __le16 completion_ring_tail[BCM4377_N_COMPLETION_RINGS];
385+ __le16 xfer_ring_head[BCM4377_N_TRANSFER_RINGS];
386+ __le16 xfer_ring_tail[BCM4377_N_TRANSFER_RINGS];
387+};
388+
389+/*
390+ * A transfer ring can be used in two configurations:
391+ * 1) Send control or HCI messages to the device which are then acknowledged
392+ * in the corresponding completion ring
393+ * 2) Receiving HCI frames from the devices. In this case the transfer ring
394+ * itself contains empty messages that are acknowledged once data is
395+ * available from the device. If the payloads fit inside the footers
396+ * of the completion ring the transfer ring can be configured to be
397+ * virtual such that it has no ring buffer.
398+ *
399+ * ring_id: ring index hardcoded in the firmware
400+ * doorbell: doorbell index to notify device of new entries
401+ * payload_size: optional in-place payload size
402+ * mapped_payload_size: optional out-of-place payload size
403+ * completion_ring: index of corresponding completion ring
404+ * n_entries: number of entries inside this ring
405+ * generation: ring generation; incremented on hci_open to detect stale messages
406+ * sync: set to true for SCO rings
407+ * virtual: set to true if this ring has no entries and is just required to
408+ * setup a corresponding completion ring for device->host messages
409+ * d2h_buffers_only: set to true if this ring is only used to provide large
410+ * buffers used by device->host messages in the completion
411+ * ring
412+ * allow_wait: allow to wait for messages to be acknowledged
413+ * enabled: true once the ring has been created and can be used
414+ * ring: ring buffer for entries (struct bcm4377_xfer_ring_entry)
415+ * ring_dma: DMA address for ring entry buffer
416+ * payloads: payload buffer for mapped_payload_size payloads
417+ * payloads_dma:DMA address for payload buffer
418+ * events: pointer to array of completions if waiting is allowed
419+ * msgids: bitmap to keep track of used message ids
420+ * lock: Spinlock to protect access to ring structurs used in the irq handler
421+ */
422+struct bcm4377_transfer_ring {
423+ enum bcm4377_transfer_ring_id ring_id;
424+ enum bcm4377_doorbell doorbell;
425+ size_t payload_size;
426+ size_t mapped_payload_size;
427+ u8 completion_ring;
428+ u16 n_entries;
429+ u8 generation;
430+
431+ bool sync;
432+ bool virtual;
433+ bool d2h_buffers_only;
434+ bool allow_wait;
435+ bool enabled;
436+
437+ void *ring;
438+ dma_addr_t ring_dma;
439+
440+ void *payloads;
441+ dma_addr_t payloads_dma;
442+
443+ struct completion **events;
444+ DECLARE_BITMAP(msgids, BCM4377_MAX_RING_SIZE);
445+ spinlock_t lock;
446+};
447+
448+/*
449+ * A completion ring can be either used to either acknowledge messages sent in
450+ * the corresponding transfer ring or to receive messages associated with the
451+ * transfer ring. When used to receive messages the transfer ring either
452+ * has no ring buffer and is only advanced ("virtual transfer ring") or it
453+ * only contains empty DMA buffers to be used for the payloads.
454+ *
455+ * ring_id: completion ring id, hardcoded in firmware
456+ * payload_size: optional payload size after each entry
457+ * delay: unknown delay
458+ * n_entries: number of entries in this ring
459+ * enabled: true once the ring has been created and can be used
460+ * ring: ring buffer for entries (struct bcm4377_completion_ring_entry)
461+ * ring_dma: DMA address of ring buffer
462+ * transfer_rings: bitmap of corresponding transfer ring ids
463+ */
464+struct bcm4377_completion_ring {
465+ enum bcm4377_completion_ring_id ring_id;
466+ u16 payload_size;
467+ u16 delay;
468+ u16 n_entries;
469+ bool enabled;
470+
471+ void *ring;
472+ dma_addr_t ring_dma;
473+
474+ unsigned long transfer_rings;
475+};
476+
477+struct bcm4377_data;
478+
479+/*
480+ * Chip-specific configuration struct
481+ *
482+ * id: Chip id (e.g. 0x4377 for BCM4377)
483+ * otp_offset: Offset to the start of the OTP inside BAR0
484+ * bar0_window1: Backplane address mapped to the first window in BAR0
485+ * bar0_window2: Backplane address mapped to the second window in BAR0
486+ * bar0_core2_window2: Optional backplane address mapped to the second core's
487+ * second window in BAR0
488+ * has_bar0_core2_window2: Set to true if this chip requires the second core's
489+ * second window to be configured
490+ * clear_pciecfg_subsystem_ctrl_bit19: Set to true if bit 19 in the
491+ * vendor-specific subsystem control
492+ * register has to be cleared
493+ * disable_aspm: Set to true if ASPM must be disabled due to hardware errata
494+ * broken_ext_scan: Set to true if the chip erroneously claims to support
495+ * extended scanning
496+ * broken_mws_transport_config: Set to true if the chip erroneously claims to
497+ * support MWS Transport Configuration
498+ * send_calibration: Optional callback to send calibration data
499+ * send_ptb: Callback to send "PTB" regulatory/calibration data
500+ */
501+struct bcm4377_hw {
502+ unsigned int id;
503+
504+ u32 otp_offset;
505+
506+ u32 bar0_window1;
507+ u32 bar0_window2;
508+ u32 bar0_core2_window2;
509+
510+ unsigned long has_bar0_core2_window2 : 1;
511+ unsigned long clear_pciecfg_subsystem_ctrl_bit19 : 1;
512+ unsigned long disable_aspm : 1;
513+ unsigned long broken_ext_scan : 1;
514+ unsigned long broken_mws_transport_config : 1;
515+
516+ int (*send_calibration)(struct bcm4377_data *bcm4377);
517+ int (*send_ptb)(struct bcm4377_data *bcm4377,
518+ const struct firmware *fw);
519+};
520+
521+static const struct bcm4377_hw bcm4377_hw_variants[];
522+static const struct dmi_system_id bcm4377_dmi_board_table[];
523+
524+/*
525+ * Private struct associated with each device containing global state
526+ *
527+ * pdev: Pointer to associated struct pci_dev
528+ * hdev: Pointer to associated strucy hci_dev
529+ * bar0: iomem pointing to BAR0
530+ * bar1: iomem pointing to BAR2
531+ * bootstage: Current value of the bootstage
532+ * rti_status: Current "RTI" status value
533+ * hw: Pointer to chip-specific struct bcm4377_hw
534+ * taurus_cal_blob: "Taurus" calibration blob used for some chips
535+ * taurus_cal_size: "Taurus" calibration blob size
536+ * taurus_beamforming_cal_blob: "Taurus" beamforming calibration blob used for
537+ * some chips
538+ * taurus_beamforming_cal_size: "Taurus" beamforming calibration blob size
539+ * stepping: Chip stepping read from OTP; used for firmware selection
540+ * vendor: Antenna vendor read from OTP; used for firmware selection
541+ * board_type: Board type from FDT or DMI match; used for firmware selection
542+ * event: Event for changed bootstage or rti_status; used for booting firmware
543+ * ctx: "Converged IPC" context
544+ * ctx_dma: "Converged IPC" context DMA address
545+ * ring_state: Shared memory buffer containing ring head and tail indexes
546+ * ring_state_dma: DMA address for ring_state
547+ * {control,hci_acl,sco}_ack_ring: Completion rings used to acknowledge messages
548+ * {hci_acl,sco}_event_ring: Completion rings used for device->host messages
549+ * control_h2d_ring: Transfer ring used for control messages
550+ * {hci,sco,acl}_h2d_ring: Transfer ring used to transfer HCI frames
551+ * {hci,sco,acl}_d2h_ring: Transfer ring used to receive HCI frames in the
552+ * corresponding completion ring
553+ */
554+struct bcm4377_data {
555+ struct pci_dev *pdev;
556+ struct hci_dev *hdev;
557+
558+ void __iomem *bar0;
559+ void __iomem *bar2;
560+
561+ u32 bootstage;
562+ u32 rti_status;
563+
564+ const struct bcm4377_hw *hw;
565+
566+ const void *taurus_cal_blob;
567+ int taurus_cal_size;
568+ const void *taurus_beamforming_cal_blob;
569+ int taurus_beamforming_cal_size;
570+
571+ char stepping[BCM4377_OTP_MAX_PARAM_LEN];
572+ char vendor[BCM4377_OTP_MAX_PARAM_LEN];
573+ const char *board_type;
574+
575+ struct completion event;
576+
577+ struct bcm4377_context *ctx;
578+ dma_addr_t ctx_dma;
579+
580+ struct bcm4377_ring_state *ring_state;
581+ dma_addr_t ring_state_dma;
582+
583+ /*
584+ * The HCI and ACL rings have to be merged because this structure is
585+ * hardcoded in the firmware.
586+ */
587+ struct bcm4377_completion_ring control_ack_ring;
588+ struct bcm4377_completion_ring hci_acl_ack_ring;
589+ struct bcm4377_completion_ring hci_acl_event_ring;
590+ struct bcm4377_completion_ring sco_ack_ring;
591+ struct bcm4377_completion_ring sco_event_ring;
592+
593+ struct bcm4377_transfer_ring control_h2d_ring;
594+ struct bcm4377_transfer_ring hci_h2d_ring;
595+ struct bcm4377_transfer_ring hci_d2h_ring;
596+ struct bcm4377_transfer_ring sco_h2d_ring;
597+ struct bcm4377_transfer_ring sco_d2h_ring;
598+ struct bcm4377_transfer_ring acl_h2d_ring;
599+ struct bcm4377_transfer_ring acl_d2h_ring;
600+};
601+
602+static void bcm4377_ring_doorbell(struct bcm4377_data *bcm4377, u8 doorbell,
603+ u16 val)
604+{
605+ u32 db = 0;
606+
607+ db |= FIELD_PREP(BCM4377_BAR0_DOORBELL_VALUE, val);
608+ db |= FIELD_PREP(BCM4377_BAR0_DOORBELL_IDX, doorbell);
609+ db |= BCM4377_BAR0_DOORBELL_RING;
610+
611+ dev_dbg(&bcm4377->pdev->dev, "write %d to doorbell #%d (0x%x)\n", val,
612+ doorbell, db);
613+ iowrite32(db, bcm4377->bar0 + BCM4377_BAR0_DOORBELL);
614+}
615+
616+static int bcm4377_extract_msgid(struct bcm4377_data *bcm4377,
617+ struct bcm4377_transfer_ring *ring,
618+ u16 raw_msgid, u8 *msgid)
619+{
620+ u8 generation = FIELD_GET(BCM4377_MSGID_GENERATION, raw_msgid);
621+ *msgid = FIELD_GET(BCM4377_MSGID_ID, raw_msgid);
622+
623+ if (generation != ring->generation) {
624+ dev_warn(
625+ &bcm4377->pdev->dev,
626+ "invalid message generation %d should be %d in entry for ring %d\n",
627+ generation, ring->generation, ring->ring_id);
628+ return -EINVAL;
629+ }
630+
631+ if (*msgid >= ring->n_entries) {
632+ dev_warn(&bcm4377->pdev->dev,
633+ "invalid message id in entry for ring %d: %d > %d\n",
634+ ring->ring_id, *msgid, ring->n_entries);
635+ return -EINVAL;
636+ }
637+
638+ return 0;
639+}
640+
641+static void bcm4377_handle_event(struct bcm4377_data *bcm4377,
642+ struct bcm4377_transfer_ring *ring,
643+ u16 raw_msgid, u8 entry_flags, u8 type,
644+ void *payload, size_t len)
645+{
646+ struct sk_buff *skb;
647+ u16 head;
648+ u8 msgid;
649+ unsigned long flags;
650+
651+ spin_lock_irqsave(&ring->lock, flags);
652+ if (!ring->enabled) {
653+ dev_warn(&bcm4377->pdev->dev,
654+ "event for disabled transfer ring %d\n",
655+ ring->ring_id);
656+ goto out;
657+ }
658+
659+ if (ring->d2h_buffers_only &&
660+ entry_flags & BCM4377_XFER_RING_FLAG_PAYLOAD_MAPPED) {
661+ if (bcm4377_extract_msgid(bcm4377, ring, raw_msgid, &msgid))
662+ goto out;
663+
664+ if (len > ring->mapped_payload_size) {
665+ dev_warn(
666+ &bcm4377->pdev->dev,
667+ "invalid payload len in event for ring %d: %zu > %zu\n",
668+ ring->ring_id, len, ring->mapped_payload_size);
669+ goto out;
670+ }
671+
672+ payload = ring->payloads + msgid * ring->mapped_payload_size;
673+ }
674+
675+ skb = bt_skb_alloc(len, GFP_ATOMIC);
676+ if (!skb)
677+ goto out;
678+
679+ memcpy(skb_put(skb, len), payload, len);
680+ hci_skb_pkt_type(skb) = type;
681+ hci_recv_frame(bcm4377->hdev, skb);
682+
683+out:
684+ head = le16_to_cpu(bcm4377->ring_state->xfer_ring_head[ring->ring_id]);
685+ head = (head + 1) % ring->n_entries;
686+ bcm4377->ring_state->xfer_ring_head[ring->ring_id] = cpu_to_le16(head);
687+
688+ bcm4377_ring_doorbell(bcm4377, ring->doorbell, head);
689+
690+ spin_unlock_irqrestore(&ring->lock, flags);
691+}
692+
693+static void bcm4377_handle_ack(struct bcm4377_data *bcm4377,
694+ struct bcm4377_transfer_ring *ring,
695+ u16 raw_msgid)
696+{
697+ unsigned long flags;
698+ u8 msgid;
699+
700+ spin_lock_irqsave(&ring->lock, flags);
701+
702+ if (bcm4377_extract_msgid(bcm4377, ring, raw_msgid, &msgid))
703+ goto unlock;
704+
705+ if (!test_bit(msgid, ring->msgids)) {
706+ dev_warn(
707+ &bcm4377->pdev->dev,
708+ "invalid message id in ack for ring %d: %d is not used\n",
709+ ring->ring_id, msgid);
710+ goto unlock;
711+ }
712+
713+ if (ring->allow_wait && ring->events[msgid]) {
714+ complete(ring->events[msgid]);
715+ ring->events[msgid] = NULL;
716+ }
717+
718+ bitmap_release_region(ring->msgids, msgid, ring->n_entries);
719+
720+unlock:
721+ spin_unlock_irqrestore(&ring->lock, flags);
722+}
723+
724+static void bcm4377_handle_completion(struct bcm4377_data *bcm4377,
725+ struct bcm4377_completion_ring *ring,
726+ u16 pos)
727+{
728+ struct bcm4377_completion_ring_entry *entry;
729+ u16 msg_id, transfer_ring;
730+ size_t entry_size, data_len;
731+ void *data;
732+
733+ if (pos >= ring->n_entries) {
734+ dev_warn(&bcm4377->pdev->dev,
735+ "invalid offset %d for completion ring %d\n", pos,
736+ ring->ring_id);
737+ return;
738+ }
739+
740+ entry_size = sizeof(*entry) + ring->payload_size;
741+ entry = ring->ring + pos * entry_size;
742+ data = ring->ring + pos * entry_size + sizeof(*entry);
743+ data_len = le32_to_cpu(entry->len);
744+ msg_id = le16_to_cpu(entry->msg_id);
745+ transfer_ring = le16_to_cpu(entry->ring_id);
746+
747+ if ((ring->transfer_rings & BIT(transfer_ring)) == 0) {
748+ dev_warn(
749+ &bcm4377->pdev->dev,
750+ "invalid entry at offset %d for transfer ring %d in completion ring %d\n",
751+ pos, transfer_ring, ring->ring_id);
752+ return;
753+ }
754+
755+ dev_dbg(&bcm4377->pdev->dev,
756+ "entry in completion ring %d for transfer ring %d with msg_id %d\n",
757+ ring->ring_id, transfer_ring, msg_id);
758+
759+ switch (transfer_ring) {
760+ case BCM4377_XFER_RING_CONTROL:
761+ bcm4377_handle_ack(bcm4377, &bcm4377->control_h2d_ring, msg_id);
762+ break;
763+ case BCM4377_XFER_RING_HCI_H2D:
764+ bcm4377_handle_ack(bcm4377, &bcm4377->hci_h2d_ring, msg_id);
765+ break;
766+ case BCM4377_XFER_RING_SCO_H2D:
767+ bcm4377_handle_ack(bcm4377, &bcm4377->sco_h2d_ring, msg_id);
768+ break;
769+ case BCM4377_XFER_RING_ACL_H2D:
770+ bcm4377_handle_ack(bcm4377, &bcm4377->acl_h2d_ring, msg_id);
771+ break;
772+
773+ case BCM4377_XFER_RING_HCI_D2H:
774+ bcm4377_handle_event(bcm4377, &bcm4377->hci_d2h_ring, msg_id,
775+ entry->flags, HCI_EVENT_PKT, data,
776+ data_len);
777+ break;
778+ case BCM4377_XFER_RING_SCO_D2H:
779+ bcm4377_handle_event(bcm4377, &bcm4377->sco_d2h_ring, msg_id,
780+ entry->flags, HCI_SCODATA_PKT, data,
781+ data_len);
782+ break;
783+ case BCM4377_XFER_RING_ACL_D2H:
784+ bcm4377_handle_event(bcm4377, &bcm4377->acl_d2h_ring, msg_id,
785+ entry->flags, HCI_ACLDATA_PKT, data,
786+ data_len);
787+ break;
788+
789+ default:
790+ dev_warn(
791+ &bcm4377->pdev->dev,
792+ "entry in completion ring %d for unknown transfer ring %d with msg_id %d\n",
793+ ring->ring_id, transfer_ring, msg_id);
794+ }
795+}
796+
797+static void bcm4377_poll_completion_ring(struct bcm4377_data *bcm4377,
798+ struct bcm4377_completion_ring *ring)
799+{
800+ u16 tail;
801+ __le16 *heads = bcm4377->ring_state->completion_ring_head;
802+ __le16 *tails = bcm4377->ring_state->completion_ring_tail;
803+
804+ if (!ring->enabled)
805+ return;
806+
807+ tail = le16_to_cpu(tails[ring->ring_id]);
808+ dev_dbg(&bcm4377->pdev->dev,
809+ "completion ring #%d: head: %d, tail: %d\n", ring->ring_id,
810+ le16_to_cpu(heads[ring->ring_id]), tail);
811+
812+ while (tail != le16_to_cpu(READ_ONCE(heads[ring->ring_id]))) {
813+ /*
814+ * ensure the CPU doesn't speculate through the comparison.
815+ * otherwise it might already read the (empty) queue entry
816+ * before the updated head has been loaded and checked.
817+ */
818+ dma_rmb();
819+
820+ bcm4377_handle_completion(bcm4377, ring, tail);
821+
822+ tail = (tail + 1) % ring->n_entries;
823+ tails[ring->ring_id] = cpu_to_le16(tail);
824+ }
825+}
826+
827+static irqreturn_t bcm4377_irq(int irq, void *data)
828+{
829+ struct bcm4377_data *bcm4377 = data;
830+ u32 bootstage, rti_status;
831+
832+ bootstage = ioread32(bcm4377->bar2 + BCM4377_BAR2_BOOTSTAGE);
833+ rti_status = ioread32(bcm4377->bar2 + BCM4377_BAR2_RTI_STATUS);
834+
835+ if (bootstage != bcm4377->bootstage ||
836+ rti_status != bcm4377->rti_status) {
837+ dev_dbg(&bcm4377->pdev->dev,
838+ "bootstage = %d -> %d, rti state = %d -> %d\n",
839+ bcm4377->bootstage, bootstage, bcm4377->rti_status,
840+ rti_status);
841+ complete(&bcm4377->event);
842+ bcm4377->bootstage = bootstage;
843+ bcm4377->rti_status = rti_status;
844+ }
845+
846+ if (rti_status > 2)
847+ dev_err(&bcm4377->pdev->dev, "RTI status is %d\n", rti_status);
848+
849+ bcm4377_poll_completion_ring(bcm4377, &bcm4377->control_ack_ring);
850+ bcm4377_poll_completion_ring(bcm4377, &bcm4377->hci_acl_event_ring);
851+ bcm4377_poll_completion_ring(bcm4377, &bcm4377->hci_acl_ack_ring);
852+ bcm4377_poll_completion_ring(bcm4377, &bcm4377->sco_ack_ring);
853+ bcm4377_poll_completion_ring(bcm4377, &bcm4377->sco_event_ring);
854+
855+ return IRQ_HANDLED;
856+}
857+
858+static int bcm4377_enqueue(struct bcm4377_data *bcm4377,
859+ struct bcm4377_transfer_ring *ring, void *data,
860+ size_t len, bool wait)
861+{
862+ unsigned long flags;
863+ struct bcm4377_xfer_ring_entry *entry;
864+ void *payload;
865+ size_t offset;
866+ u16 head, tail, new_head;
867+ u16 raw_msgid;
868+ int ret, msgid;
869+ DECLARE_COMPLETION_ONSTACK(event);
870+
871+ if (len > ring->payload_size && len > ring->mapped_payload_size) {
872+ dev_warn(
873+ &bcm4377->pdev->dev,
874+ "payload len %zu is too large for ring %d (max is %zu or %zu)\n",
875+ len, ring->ring_id, ring->payload_size,
876+ ring->mapped_payload_size);
877+ return -EINVAL;
878+ }
879+ if (wait && !ring->allow_wait)
880+ return -EINVAL;
881+ if (ring->virtual)
882+ return -EINVAL;
883+
884+ spin_lock_irqsave(&ring->lock, flags);
885+
886+ head = le16_to_cpu(bcm4377->ring_state->xfer_ring_head[ring->ring_id]);
887+ tail = le16_to_cpu(bcm4377->ring_state->xfer_ring_tail[ring->ring_id]);
888+
889+ new_head = (head + 1) % ring->n_entries;
890+
891+ if (new_head == tail) {
892+ dev_warn(&bcm4377->pdev->dev,
893+ "can't send message because ring %d is full\n",
894+ ring->ring_id);
895+ ret = -EINVAL;
896+ goto out;
897+ }
898+
899+ msgid = bitmap_find_free_region(ring->msgids, ring->n_entries, 0);
900+ if (msgid < 0) {
901+ dev_warn(&bcm4377->pdev->dev,
902+ "can't find message id for ring %d\n", ring->ring_id);
903+ ret = -EINVAL;
904+ goto out;
905+ }
906+
907+ raw_msgid = FIELD_PREP(BCM4377_MSGID_GENERATION, ring->generation);
908+ raw_msgid |= FIELD_PREP(BCM4377_MSGID_ID, msgid);
909+
910+ offset = head * (sizeof(*entry) + ring->payload_size);
911+ entry = ring->ring + offset;
912+
913+ memset(entry, 0, sizeof(*entry));
914+ entry->id = cpu_to_le16(raw_msgid);
915+ entry->len = cpu_to_le16(len);
916+
917+ if (len <= ring->payload_size) {
918+ entry->flags = BCM4377_XFER_RING_FLAG_PAYLOAD_IN_FOOTER;
919+ payload = ring->ring + offset + sizeof(*entry);
920+ } else {
921+ entry->flags = BCM4377_XFER_RING_FLAG_PAYLOAD_MAPPED;
922+ entry->payload = cpu_to_le64(ring->payloads_dma +
923+ msgid * ring->mapped_payload_size);
924+ payload = ring->payloads + msgid * ring->mapped_payload_size;
925+ }
926+
927+ memcpy(payload, data, len);
928+
929+ if (wait)
930+ ring->events[msgid] = &event;
931+
932+ /*
933+ * The 4377 chips stop responding to any commands as soon as they
934+ * have been idle for a while. Poking the sleep control register here
935+ * makes them come alive again.
936+ */
937+ iowrite32(BCM4377_BAR0_SLEEP_CONTROL_AWAKE,
938+ bcm4377->bar0 + BCM4377_BAR0_SLEEP_CONTROL);
939+
940+ dev_dbg(&bcm4377->pdev->dev,
941+ "updating head for transfer queue #%d to %d\n", ring->ring_id,
942+ new_head);
943+ bcm4377->ring_state->xfer_ring_head[ring->ring_id] =
944+ cpu_to_le16(new_head);
945+
946+ if (!ring->sync)
947+ bcm4377_ring_doorbell(bcm4377, ring->doorbell, new_head);
948+ ret = 0;
949+
950+out:
951+ spin_unlock_irqrestore(&ring->lock, flags);
952+
953+ if (ret == 0 && wait) {
954+ ret = wait_for_completion_interruptible_timeout(
955+ &event, BCM4377_TIMEOUT);
956+ if (ret == 0)
957+ ret = -ETIMEDOUT;
958+ else if (ret > 0)
959+ ret = 0;
960+
961+ spin_lock_irqsave(&ring->lock, flags);
962+ ring->events[msgid] = NULL;
963+ spin_unlock_irqrestore(&ring->lock, flags);
964+ }
965+
966+ return ret;
967+}
968+
969+static int bcm4377_create_completion_ring(struct bcm4377_data *bcm4377,
970+ struct bcm4377_completion_ring *ring)
971+{
972+ struct bcm4377_create_completion_ring_msg msg;
973+ int ret;
974+
975+ if (ring->enabled) {
976+ dev_warn(&bcm4377->pdev->dev,
977+ "completion ring %d already enabled\n", ring->ring_id);
978+ return 0;
979+ }
980+
981+ memset(ring->ring, 0,
982+ ring->n_entries * (sizeof(struct bcm4377_completion_ring_entry) +
983+ ring->payload_size));
984+ memset(&msg, 0, sizeof(msg));
985+ msg.msg_type = BCM4377_CONTROL_MSG_CREATE_COMPLETION_RING;
986+ msg.id = cpu_to_le16(ring->ring_id);
987+ msg.id_again = cpu_to_le16(ring->ring_id);
988+ msg.ring_iova = cpu_to_le64(ring->ring_dma);
989+ msg.n_elements = cpu_to_le16(ring->n_entries);
990+ msg.intmod_bytes = cpu_to_le32(0xffffffff);
991+ msg.unk = cpu_to_le32(0xffffffff);
992+ msg.intmod_delay = cpu_to_le16(ring->delay);
993+ msg.footer_size = ring->payload_size / 4;
994+
995+ ret = bcm4377_enqueue(bcm4377, &bcm4377->control_h2d_ring, &msg,
996+ sizeof(msg), true);
997+ if (!ret)
998+ ring->enabled = true;
999+
1000+ return ret;
1001+}
1002+
1003+static int bcm4377_destroy_completion_ring(struct bcm4377_data *bcm4377,
1004+ struct bcm4377_completion_ring *ring)
1005+{
1006+ struct bcm4377_destroy_completion_ring_msg msg;
1007+ int ret;
1008+
1009+ memset(&msg, 0, sizeof(msg));
1010+ msg.msg_type = BCM4377_CONTROL_MSG_DESTROY_COMPLETION_RING;
1011+ msg.ring_id = cpu_to_le16(ring->ring_id);
1012+
1013+ ret = bcm4377_enqueue(bcm4377, &bcm4377->control_h2d_ring, &msg,
1014+ sizeof(msg), true);
1015+ if (ret)
1016+ dev_warn(&bcm4377->pdev->dev,
1017+ "failed to destroy completion ring %d\n",
1018+ ring->ring_id);
1019+
1020+ ring->enabled = false;
1021+ return ret;
1022+}
1023+
1024+static int bcm4377_create_transfer_ring(struct bcm4377_data *bcm4377,
1025+ struct bcm4377_transfer_ring *ring)
1026+{
1027+ struct bcm4377_create_transfer_ring_msg msg;
1028+ u16 flags = 0;
1029+ int ret, i;
1030+ unsigned long spinlock_flags;
1031+
1032+ if (ring->virtual)
1033+ flags |= BCM4377_XFER_RING_FLAG_VIRTUAL;
1034+ if (ring->sync)
1035+ flags |= BCM4377_XFER_RING_FLAG_SYNC;
1036+
1037+ spin_lock_irqsave(&ring->lock, spinlock_flags);
1038+ memset(&msg, 0, sizeof(msg));
1039+ msg.msg_type = BCM4377_CONTROL_MSG_CREATE_XFER_RING;
1040+ msg.ring_id = cpu_to_le16(ring->ring_id);
1041+ msg.ring_id_again = cpu_to_le16(ring->ring_id);
1042+ msg.ring_iova = cpu_to_le64(ring->ring_dma);
1043+ msg.n_elements = cpu_to_le16(ring->n_entries);
1044+ msg.completion_ring_id = cpu_to_le16(ring->completion_ring);
1045+ msg.doorbell = cpu_to_le16(ring->doorbell);
1046+ msg.flags = cpu_to_le16(flags);
1047+ msg.footer_size = ring->payload_size / 4;
1048+
1049+ bcm4377->ring_state->xfer_ring_head[ring->ring_id] = 0;
1050+ bcm4377->ring_state->xfer_ring_tail[ring->ring_id] = 0;
1051+ ring->generation++;
1052+ spin_unlock_irqrestore(&ring->lock, spinlock_flags);
1053+
1054+ ret = bcm4377_enqueue(bcm4377, &bcm4377->control_h2d_ring, &msg,
1055+ sizeof(msg), true);
1056+
1057+ spin_lock_irqsave(&ring->lock, spinlock_flags);
1058+
1059+ if (ring->d2h_buffers_only) {
1060+ for (i = 0; i < ring->n_entries; ++i) {
1061+ struct bcm4377_xfer_ring_entry *entry =
1062+ ring->ring + i * sizeof(*entry);
1063+ u16 raw_msgid = FIELD_PREP(BCM4377_MSGID_GENERATION,
1064+ ring->generation);
1065+ raw_msgid |= FIELD_PREP(BCM4377_MSGID_ID, i);
1066+
1067+ memset(entry, 0, sizeof(*entry));
1068+ entry->id = cpu_to_le16(raw_msgid);
1069+ entry->len = cpu_to_le16(ring->mapped_payload_size);
1070+ entry->flags = BCM4377_XFER_RING_FLAG_PAYLOAD_MAPPED;
1071+ entry->payload =
1072+ cpu_to_le64(ring->payloads_dma +
1073+ i * ring->mapped_payload_size);
1074+ }
1075+ }
1076+
1077+ /*
1078+ * send some messages if this is a device->host ring to allow the device
1079+ * to reply by acknowledging them in the completion ring
1080+ */
1081+ if (ring->virtual || ring->d2h_buffers_only) {
1082+ bcm4377->ring_state->xfer_ring_head[ring->ring_id] =
1083+ cpu_to_le16(0xf);
1084+ bcm4377_ring_doorbell(bcm4377, ring->doorbell, 0xf);
1085+ }
1086+
1087+ ring->enabled = true;
1088+ spin_unlock_irqrestore(&ring->lock, spinlock_flags);
1089+
1090+ return ret;
1091+}
1092+
1093+static int bcm4377_destroy_transfer_ring(struct bcm4377_data *bcm4377,
1094+ struct bcm4377_transfer_ring *ring)
1095+{
1096+ struct bcm4377_destroy_transfer_ring_msg msg;
1097+ int ret;
1098+
1099+ memset(&msg, 0, sizeof(msg));
1100+ msg.msg_type = BCM4377_CONTROL_MSG_DESTROY_XFER_RING;
1101+ msg.ring_id = cpu_to_le16(ring->ring_id);
1102+
1103+ ret = bcm4377_enqueue(bcm4377, &bcm4377->control_h2d_ring, &msg,
1104+ sizeof(msg), true);
1105+ if (ret)
1106+ dev_warn(&bcm4377->pdev->dev,
1107+ "failed to destroy transfer ring %d\n", ring->ring_id);
1108+
1109+ ring->enabled = false;
1110+ return ret;
1111+}
1112+
1113+static int __bcm4378_send_calibration_chunk(struct bcm4377_data *bcm4377,
1114+ const void *data, size_t data_len,
1115+ u16 blocks_left)
1116+{
1117+ struct bcm4378_hci_send_calibration_cmd cmd;
1118+ struct sk_buff *skb;
1119+
1120+ if (data_len > sizeof(cmd.data))
1121+ return -EINVAL;
1122+
1123+ memset(&cmd, 0, sizeof(cmd));
1124+ cmd.unk = 0x03;
1125+ cmd.blocks_left = cpu_to_le16(blocks_left);
1126+ memcpy(cmd.data, data, data_len);
1127+
1128+ skb = __hci_cmd_sync(bcm4377->hdev, 0xfd97, sizeof(cmd), &cmd,
1129+ HCI_INIT_TIMEOUT);
1130+ if (IS_ERR(skb))
1131+ return PTR_ERR(skb);
1132+
1133+ kfree_skb(skb);
1134+ return 0;
1135+}
1136+
1137+static int __bcm4378_send_calibration(struct bcm4377_data *bcm4377,
1138+ const void *data, size_t data_size)
1139+{
1140+ int ret;
1141+ size_t i, left, transfer_len;
1142+ size_t blocks =
1143+ DIV_ROUND_UP(data_size, (size_t)BCM4378_CALIBRATION_CHUNK_SIZE);
1144+
1145+ if (!data) {
1146+ dev_err(&bcm4377->pdev->dev,
1147+ "no calibration data available.\n");
1148+ return -ENOENT;
1149+ }
1150+
1151+ for (i = 0, left = data_size; i < blocks; ++i, left -= transfer_len) {
1152+ transfer_len =
1153+ min_t(size_t, left, BCM4378_CALIBRATION_CHUNK_SIZE);
1154+
1155+ ret = __bcm4378_send_calibration_chunk(
1156+ bcm4377, data + i * BCM4378_CALIBRATION_CHUNK_SIZE,
1157+ transfer_len, blocks - i - 1);
1158+ if (ret) {
1159+ dev_err(&bcm4377->pdev->dev,
1160+ "send calibration chunk failed with %d\n", ret);
1161+ return ret;
1162+ }
1163+ }
1164+
1165+ return 0;
1166+}
1167+
1168+static int bcm4378_send_calibration(struct bcm4377_data *bcm4377)
1169+{
1170+ if ((strcmp(bcm4377->stepping, "b1") == 0) ||
1171+ strcmp(bcm4377->stepping, "b3") == 0)
1172+ return __bcm4378_send_calibration(
1173+ bcm4377, bcm4377->taurus_beamforming_cal_blob,
1174+ bcm4377->taurus_beamforming_cal_size);
1175+ else
1176+ return __bcm4378_send_calibration(bcm4377,
1177+ bcm4377->taurus_cal_blob,
1178+ bcm4377->taurus_cal_size);
1179+}
1180+
1181+static int bcm4387_send_calibration(struct bcm4377_data *bcm4377)
1182+{
1183+ if (strcmp(bcm4377->stepping, "c2") == 0)
1184+ return __bcm4378_send_calibration(
1185+ bcm4377, bcm4377->taurus_beamforming_cal_blob,
1186+ bcm4377->taurus_beamforming_cal_size);
1187+ else
1188+ return __bcm4378_send_calibration(bcm4377,
1189+ bcm4377->taurus_cal_blob,
1190+ bcm4377->taurus_cal_size);
1191+}
1192+
1193+static const struct firmware *bcm4377_request_blob(struct bcm4377_data *bcm4377,
1194+ const char *suffix)
1195+{
1196+ const struct firmware *fw;
1197+ char name0[64], name1[64];
1198+ int ret;
1199+
1200+ snprintf(name0, sizeof(name0), "brcm/brcmbt%04x%s-%s-%s.%s",
1201+ bcm4377->hw->id, bcm4377->stepping, bcm4377->board_type,
1202+ bcm4377->vendor, suffix);
1203+ snprintf(name1, sizeof(name1), "brcm/brcmbt%04x%s-%s.%s",
1204+ bcm4377->hw->id, bcm4377->stepping, bcm4377->board_type,
1205+ suffix);
1206+ dev_dbg(&bcm4377->pdev->dev, "Trying to load firmware: '%s' or '%s'\n",
1207+ name0, name1);
1208+
1209+ ret = firmware_request_nowarn(&fw, name0, &bcm4377->pdev->dev);
1210+ if (!ret)
1211+ return fw;
1212+ ret = firmware_request_nowarn(&fw, name1, &bcm4377->pdev->dev);
1213+ if (!ret)
1214+ return fw;
1215+
1216+ dev_err(&bcm4377->pdev->dev,
1217+ "Unable to load firmware; tried '%s' and '%s'\n", name0, name1);
1218+ return NULL;
1219+}
1220+
1221+static int bcm4377_send_ptb(struct bcm4377_data *bcm4377,
1222+ const struct firmware *fw)
1223+{
1224+ struct sk_buff *skb;
1225+
1226+ skb = __hci_cmd_sync(bcm4377->hdev, 0xfd98, fw->size, fw->data,
1227+ HCI_INIT_TIMEOUT);
1228+ /*
1229+ * This command seems to always fail on more recent firmware versions
1230+ * (even in traces taken from the macOS driver). It's unclear why this
1231+ * happens but because the PTB file contains calibration and/or
1232+ * regulatory data and may be required on older firmware we still try to
1233+ * send it here just in case and just ignore if it fails.
1234+ */
1235+ if (!IS_ERR(skb))
1236+ kfree_skb(skb);
1237+ return 0;
1238+}
1239+
1240+static int bcm4378_send_ptb_chunk(struct bcm4377_data *bcm4377,
1241+ const void *data, size_t data_len,
1242+ u16 blocks_left)
1243+{
1244+ struct bcm4378_hci_send_ptb_cmd cmd;
1245+ struct sk_buff *skb;
1246+
1247+ if (data_len > BCM4378_PTB_CHUNK_SIZE)
1248+ return -EINVAL;
1249+
1250+ memset(&cmd, 0, sizeof(cmd));
1251+ cmd.blocks_left = cpu_to_le16(blocks_left);
1252+ memcpy(cmd.data, data, data_len);
1253+
1254+ skb = __hci_cmd_sync(bcm4377->hdev, 0xfe0d, sizeof(cmd), &cmd,
1255+ HCI_INIT_TIMEOUT);
1256+ if (IS_ERR(skb))
1257+ return PTR_ERR(skb);
1258+
1259+ kfree_skb(skb);
1260+ return 0;
1261+}
1262+
1263+static int bcm4378_send_ptb(struct bcm4377_data *bcm4377,
1264+ const struct firmware *fw)
1265+{
1266+ size_t chunks = DIV_ROUND_UP(fw->size, (size_t)BCM4378_PTB_CHUNK_SIZE);
1267+ size_t i, left, transfer_len;
1268+ int ret;
1269+
1270+ for (i = 0, left = fw->size; i < chunks; ++i, left -= transfer_len) {
1271+ transfer_len = min_t(size_t, left, BCM4378_PTB_CHUNK_SIZE);
1272+
1273+ dev_dbg(&bcm4377->pdev->dev, "sending ptb chunk %zu/%zu\n",
1274+ i + 1, chunks);
1275+ ret = bcm4378_send_ptb_chunk(
1276+ bcm4377, fw->data + i * BCM4378_PTB_CHUNK_SIZE,
1277+ transfer_len, chunks - i - 1);
1278+ if (ret) {
1279+ dev_err(&bcm4377->pdev->dev,
1280+ "sending ptb chunk %zu failed (%d)", i, ret);
1281+ return ret;
1282+ }
1283+ }
1284+
1285+ return 0;
1286+}
1287+
1288+static int bcm4377_hci_open(struct hci_dev *hdev)
1289+{
1290+ struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev);
1291+ int ret;
1292+
1293+ dev_dbg(&bcm4377->pdev->dev, "creating rings\n");
1294+
1295+ ret = bcm4377_create_completion_ring(bcm4377,
1296+ &bcm4377->hci_acl_ack_ring);
1297+ if (ret)
1298+ return ret;
1299+ ret = bcm4377_create_completion_ring(bcm4377,
1300+ &bcm4377->hci_acl_event_ring);
1301+ if (ret)
1302+ goto destroy_hci_acl_ack;
1303+ ret = bcm4377_create_completion_ring(bcm4377, &bcm4377->sco_ack_ring);
1304+ if (ret)
1305+ goto destroy_hci_acl_event;
1306+ ret = bcm4377_create_completion_ring(bcm4377, &bcm4377->sco_event_ring);
1307+ if (ret)
1308+ goto destroy_sco_ack;
1309+ dev_dbg(&bcm4377->pdev->dev,
1310+ "all completion rings successfully created!\n");
1311+
1312+ ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->hci_h2d_ring);
1313+ if (ret)
1314+ goto destroy_sco_event;
1315+ ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->hci_d2h_ring);
1316+ if (ret)
1317+ goto destroy_hci_h2d;
1318+ ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->sco_h2d_ring);
1319+ if (ret)
1320+ goto destroy_hci_d2h;
1321+ ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->sco_d2h_ring);
1322+ if (ret)
1323+ goto destroy_sco_h2d;
1324+ ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->acl_h2d_ring);
1325+ if (ret)
1326+ goto destroy_sco_d2h;
1327+ ret = bcm4377_create_transfer_ring(bcm4377, &bcm4377->acl_d2h_ring);
1328+ if (ret)
1329+ goto destroy_acl_h2d;
1330+ dev_dbg(&bcm4377->pdev->dev,
1331+ "all transfer rings successfully created!\n");
1332+
1333+ return 0;
1334+
1335+destroy_acl_h2d:
1336+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->acl_h2d_ring);
1337+destroy_sco_d2h:
1338+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->sco_d2h_ring);
1339+destroy_sco_h2d:
1340+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->sco_h2d_ring);
1341+destroy_hci_d2h:
1342+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->hci_h2d_ring);
1343+destroy_hci_h2d:
1344+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->hci_d2h_ring);
1345+destroy_sco_event:
1346+ bcm4377_destroy_completion_ring(bcm4377, &bcm4377->sco_event_ring);
1347+destroy_sco_ack:
1348+ bcm4377_destroy_completion_ring(bcm4377, &bcm4377->sco_ack_ring);
1349+destroy_hci_acl_event:
1350+ bcm4377_destroy_completion_ring(bcm4377, &bcm4377->hci_acl_event_ring);
1351+destroy_hci_acl_ack:
1352+ bcm4377_destroy_completion_ring(bcm4377, &bcm4377->hci_acl_ack_ring);
1353+
1354+ dev_err(&bcm4377->pdev->dev, "Creating rings failed with %d\n", ret);
1355+ return ret;
1356+}
1357+
1358+static int bcm4377_hci_close(struct hci_dev *hdev)
1359+{
1360+ struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev);
1361+
1362+ dev_dbg(&bcm4377->pdev->dev, "destroying rings in hci_close\n");
1363+
1364+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->acl_d2h_ring);
1365+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->acl_h2d_ring);
1366+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->sco_d2h_ring);
1367+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->sco_h2d_ring);
1368+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->hci_d2h_ring);
1369+ bcm4377_destroy_transfer_ring(bcm4377, &bcm4377->hci_h2d_ring);
1370+
1371+ bcm4377_destroy_completion_ring(bcm4377, &bcm4377->sco_event_ring);
1372+ bcm4377_destroy_completion_ring(bcm4377, &bcm4377->sco_ack_ring);
1373+ bcm4377_destroy_completion_ring(bcm4377, &bcm4377->hci_acl_event_ring);
1374+ bcm4377_destroy_completion_ring(bcm4377, &bcm4377->hci_acl_ack_ring);
1375+
1376+ return 0;
1377+}
1378+
1379+static bool bcm4377_is_valid_bdaddr(struct bcm4377_data *bcm4377,
1380+ bdaddr_t *addr)
1381+{
1382+ if (addr->b[0] != 0x93)
1383+ return true;
1384+ if (addr->b[1] != 0x76)
1385+ return true;
1386+ if (addr->b[2] != 0x00)
1387+ return true;
1388+ if (addr->b[4] != (bcm4377->hw->id & 0xff))
1389+ return true;
1390+ if (addr->b[5] != (bcm4377->hw->id >> 8))
1391+ return true;
1392+ return false;
1393+}
1394+
1395+static int bcm4377_check_bdaddr(struct bcm4377_data *bcm4377)
1396+{
1397+ struct hci_rp_read_bd_addr *bda;
1398+ struct sk_buff *skb;
1399+
1400+ skb = __hci_cmd_sync(bcm4377->hdev, HCI_OP_READ_BD_ADDR, 0, NULL,
1401+ HCI_INIT_TIMEOUT);
1402+ if (IS_ERR(skb)) {
1403+ int err = PTR_ERR(skb);
1404+
1405+ dev_err(&bcm4377->pdev->dev, "HCI_OP_READ_BD_ADDR failed (%d)",
1406+ err);
1407+ return err;
1408+ }
1409+
1410+ if (skb->len != sizeof(*bda)) {
1411+ dev_err(&bcm4377->pdev->dev,
1412+ "HCI_OP_READ_BD_ADDR reply length invalid");
1413+ kfree_skb(skb);
1414+ return -EIO;
1415+ }
1416+
1417+ bda = (struct hci_rp_read_bd_addr *)skb->data;
1418+ if (!bcm4377_is_valid_bdaddr(bcm4377, &bda->bdaddr))
1419+ set_bit(HCI_QUIRK_INVALID_BDADDR, &bcm4377->hdev->quirks);
1420+
1421+ kfree_skb(skb);
1422+ return 0;
1423+}
1424+
1425+static int bcm4377_hci_setup(struct hci_dev *hdev)
1426+{
1427+ struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev);
1428+ const struct firmware *fw;
1429+ int ret;
1430+
1431+ if (bcm4377->hw->send_calibration) {
1432+ ret = bcm4377->hw->send_calibration(bcm4377);
1433+ if (ret)
1434+ return ret;
1435+ }
1436+
1437+ fw = bcm4377_request_blob(bcm4377, "ptb");
1438+ if (!fw) {
1439+ dev_err(&bcm4377->pdev->dev, "failed to load PTB data");
1440+ return -ENOENT;
1441+ }
1442+
1443+ ret = bcm4377->hw->send_ptb(bcm4377, fw);
1444+ release_firmware(fw);
1445+ if (ret)
1446+ return ret;
1447+
1448+ return bcm4377_check_bdaddr(bcm4377);
1449+}
1450+
1451+static int bcm4377_hci_send_frame(struct hci_dev *hdev, struct sk_buff *skb)
1452+{
1453+ struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev);
1454+ struct bcm4377_transfer_ring *ring;
1455+ int ret;
1456+
1457+ switch (hci_skb_pkt_type(skb)) {
1458+ case HCI_COMMAND_PKT:
1459+ hdev->stat.cmd_tx++;
1460+ ring = &bcm4377->hci_h2d_ring;
1461+ break;
1462+
1463+ case HCI_ACLDATA_PKT:
1464+ hdev->stat.acl_tx++;
1465+ ring = &bcm4377->acl_h2d_ring;
1466+ break;
1467+
1468+ case HCI_SCODATA_PKT:
1469+ hdev->stat.sco_tx++;
1470+ ring = &bcm4377->sco_h2d_ring;
1471+ break;
1472+
1473+ default:
1474+ return -EILSEQ;
1475+ }
1476+
1477+ ret = bcm4377_enqueue(bcm4377, ring, skb->data, skb->len, false);
1478+ if (ret < 0) {
1479+ hdev->stat.err_tx++;
1480+ return ret;
1481+ }
1482+
1483+ hdev->stat.byte_tx += skb->len;
1484+ kfree_skb(skb);
1485+ return ret;
1486+}
1487+
1488+static int bcm4377_hci_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
1489+{
1490+ struct bcm4377_data *bcm4377 = hci_get_drvdata(hdev);
1491+ struct sk_buff *skb;
1492+ int err;
1493+
1494+ skb = __hci_cmd_sync(hdev, 0xfc01, 6, bdaddr, HCI_INIT_TIMEOUT);
1495+ if (IS_ERR(skb)) {
1496+ err = PTR_ERR(skb);
1497+ dev_err(&bcm4377->pdev->dev,
1498+ "Change address command failed (%d)", err);
1499+ return err;
1500+ }
1501+ kfree_skb(skb);
1502+
1503+ return 0;
1504+}
1505+
1506+static int bcm4377_alloc_transfer_ring(struct bcm4377_data *bcm4377,
1507+ struct bcm4377_transfer_ring *ring)
1508+{
1509+ size_t entry_size;
1510+
1511+ spin_lock_init(&ring->lock);
1512+ ring->payload_size = ALIGN(ring->payload_size, 4);
1513+ ring->mapped_payload_size = ALIGN(ring->mapped_payload_size, 4);
1514+
1515+ if (ring->payload_size > BCM4377_XFER_RING_MAX_INPLACE_PAYLOAD_SIZE)
1516+ return -EINVAL;
1517+ if (ring->n_entries > BCM4377_MAX_RING_SIZE)
1518+ return -EINVAL;
1519+ if (ring->virtual && ring->allow_wait)
1520+ return -EINVAL;
1521+
1522+ if (ring->d2h_buffers_only) {
1523+ if (ring->virtual)
1524+ return -EINVAL;
1525+ if (ring->payload_size)
1526+ return -EINVAL;
1527+ if (!ring->mapped_payload_size)
1528+ return -EINVAL;
1529+ }
1530+ if (ring->virtual)
1531+ return 0;
1532+
1533+ entry_size =
1534+ ring->payload_size + sizeof(struct bcm4377_xfer_ring_entry);
1535+ ring->ring = dmam_alloc_coherent(&bcm4377->pdev->dev,
1536+ ring->n_entries * entry_size,
1537+ &ring->ring_dma, GFP_KERNEL);
1538+ if (!ring->ring)
1539+ return -ENOMEM;
1540+
1541+ if (ring->allow_wait) {
1542+ ring->events = devm_kcalloc(&bcm4377->pdev->dev,
1543+ ring->n_entries,
1544+ sizeof(*ring->events), GFP_KERNEL);
1545+ if (!ring->events)
1546+ return -ENOMEM;
1547+ }
1548+
1549+ if (ring->mapped_payload_size) {
1550+ ring->payloads = dmam_alloc_coherent(
1551+ &bcm4377->pdev->dev,
1552+ ring->n_entries * ring->mapped_payload_size,
1553+ &ring->payloads_dma, GFP_KERNEL);
1554+ if (!ring->payloads)
1555+ return -ENOMEM;
1556+ }
1557+
1558+ return 0;
1559+}
1560+
1561+static int bcm4377_alloc_completion_ring(struct bcm4377_data *bcm4377,
1562+ struct bcm4377_completion_ring *ring)
1563+{
1564+ size_t entry_size;
1565+
1566+ ring->payload_size = ALIGN(ring->payload_size, 4);
1567+ if (ring->payload_size > BCM4377_XFER_RING_MAX_INPLACE_PAYLOAD_SIZE)
1568+ return -EINVAL;
1569+ if (ring->n_entries > BCM4377_MAX_RING_SIZE)
1570+ return -EINVAL;
1571+
1572+ entry_size = ring->payload_size +
1573+ sizeof(struct bcm4377_completion_ring_entry);
1574+
1575+ ring->ring = dmam_alloc_coherent(&bcm4377->pdev->dev,
1576+ ring->n_entries * entry_size,
1577+ &ring->ring_dma, GFP_KERNEL);
1578+ if (!ring->ring)
1579+ return -ENOMEM;
1580+ return 0;
1581+}
1582+
1583+static int bcm4377_init_context(struct bcm4377_data *bcm4377)
1584+{
1585+ struct device *dev = &bcm4377->pdev->dev;
1586+ dma_addr_t peripheral_info_dma;
1587+
1588+ bcm4377->ctx = dmam_alloc_coherent(dev, sizeof(*bcm4377->ctx),
1589+ &bcm4377->ctx_dma, GFP_KERNEL);
1590+ if (!bcm4377->ctx)
1591+ return -ENOMEM;
1592+ memset(bcm4377->ctx, 0, sizeof(*bcm4377->ctx));
1593+
1594+ bcm4377->ring_state =
1595+ dmam_alloc_coherent(dev, sizeof(*bcm4377->ring_state),
1596+ &bcm4377->ring_state_dma, GFP_KERNEL);
1597+ if (!bcm4377->ring_state)
1598+ return -ENOMEM;
1599+ memset(bcm4377->ring_state, 0, sizeof(*bcm4377->ring_state));
1600+
1601+ bcm4377->ctx->version = cpu_to_le16(1);
1602+ bcm4377->ctx->size = cpu_to_le16(sizeof(*bcm4377->ctx));
1603+ bcm4377->ctx->enabled_caps = cpu_to_le32(2);
1604+
1605+ /*
1606+ * The BT device will write 0x20 bytes of data to this buffer but
1607+ * the exact contents are unknown. It only needs to exist for BT
1608+ * to work such that we can just allocate and then ignore it.
1609+ */
1610+ if (!dmam_alloc_coherent(&bcm4377->pdev->dev, 0x20,
1611+ &peripheral_info_dma, GFP_KERNEL))
1612+ return -ENOMEM;
1613+ bcm4377->ctx->peripheral_info_addr = cpu_to_le64(peripheral_info_dma);
1614+
1615+ bcm4377->ctx->xfer_ring_heads_addr = cpu_to_le64(
1616+ bcm4377->ring_state_dma +
1617+ offsetof(struct bcm4377_ring_state, xfer_ring_head));
1618+ bcm4377->ctx->xfer_ring_tails_addr = cpu_to_le64(
1619+ bcm4377->ring_state_dma +
1620+ offsetof(struct bcm4377_ring_state, xfer_ring_tail));
1621+ bcm4377->ctx->completion_ring_heads_addr = cpu_to_le64(
1622+ bcm4377->ring_state_dma +
1623+ offsetof(struct bcm4377_ring_state, completion_ring_head));
1624+ bcm4377->ctx->completion_ring_tails_addr = cpu_to_le64(
1625+ bcm4377->ring_state_dma +
1626+ offsetof(struct bcm4377_ring_state, completion_ring_tail));
1627+
1628+ bcm4377->ctx->n_completion_rings =
1629+ cpu_to_le16(BCM4377_N_COMPLETION_RINGS);
1630+ bcm4377->ctx->n_xfer_rings = cpu_to_le16(BCM4377_N_TRANSFER_RINGS);
1631+
1632+ bcm4377->ctx->control_completion_ring_addr =
1633+ cpu_to_le64(bcm4377->control_ack_ring.ring_dma);
1634+ bcm4377->ctx->control_completion_ring_n_entries =
1635+ cpu_to_le16(bcm4377->control_ack_ring.n_entries);
1636+ bcm4377->ctx->control_completion_ring_doorbell = cpu_to_le16(0xffff);
1637+ bcm4377->ctx->control_completion_ring_msi = 0;
1638+ bcm4377->ctx->control_completion_ring_header_size = 0;
1639+ bcm4377->ctx->control_completion_ring_footer_size = 0;
1640+
1641+ bcm4377->ctx->control_xfer_ring_addr =
1642+ cpu_to_le64(bcm4377->control_h2d_ring.ring_dma);
1643+ bcm4377->ctx->control_xfer_ring_n_entries =
1644+ cpu_to_le16(bcm4377->control_h2d_ring.n_entries);
1645+ bcm4377->ctx->control_xfer_ring_doorbell =
1646+ cpu_to_le16(bcm4377->control_h2d_ring.doorbell);
1647+ bcm4377->ctx->control_xfer_ring_msi = 0;
1648+ bcm4377->ctx->control_xfer_ring_header_size = 0;
1649+ bcm4377->ctx->control_xfer_ring_footer_size =
1650+ bcm4377->control_h2d_ring.payload_size / 4;
1651+
1652+ dev_dbg(&bcm4377->pdev->dev, "context initialized at IOVA %pad",
1653+ &bcm4377->ctx_dma);
1654+
1655+ return 0;
1656+}
1657+
1658+static int bcm4377_prepare_rings(struct bcm4377_data *bcm4377)
1659+{
1660+ int ret;
1661+
1662+ /*
1663+ * Even though many of these settings appear to be configurable
1664+ * when sending the "create ring" messages most of these are
1665+ * actually hardcoded in some (and quite possibly all) firmware versions
1666+ * and changing them on the host has no effect.
1667+ * Specifically, this applies to at least the doorbells, the transfer
1668+ * and completion ring ids and their mapping (e.g. both HCI and ACL
1669+ * entries will always be queued in completion rings 1 and 2 no matter
1670+ * what we configure here).
1671+ */
1672+ bcm4377->control_ack_ring.ring_id = BCM4377_ACK_RING_CONTROL;
1673+ bcm4377->control_ack_ring.n_entries = 32;
1674+ bcm4377->control_ack_ring.transfer_rings =
1675+ BIT(BCM4377_XFER_RING_CONTROL);
1676+
1677+ bcm4377->hci_acl_ack_ring.ring_id = BCM4377_ACK_RING_HCI_ACL;
1678+ bcm4377->hci_acl_ack_ring.n_entries = 2 * BCM4377_RING_N_ENTRIES;
1679+ bcm4377->hci_acl_ack_ring.transfer_rings =
1680+ BIT(BCM4377_XFER_RING_HCI_H2D) | BIT(BCM4377_XFER_RING_ACL_H2D);
1681+ bcm4377->hci_acl_ack_ring.delay = 1000;
1682+
1683+ /*
1684+ * A payload size of MAX_EVENT_PAYLOAD_SIZE is enough here since large
1685+ * ACL packets will be transmitted inside buffers mapped via
1686+ * acl_d2h_ring anyway.
1687+ */
1688+ bcm4377->hci_acl_event_ring.ring_id = BCM4377_EVENT_RING_HCI_ACL;
1689+ bcm4377->hci_acl_event_ring.payload_size = MAX_EVENT_PAYLOAD_SIZE;
1690+ bcm4377->hci_acl_event_ring.n_entries = 2 * BCM4377_RING_N_ENTRIES;
1691+ bcm4377->hci_acl_event_ring.transfer_rings =
1692+ BIT(BCM4377_XFER_RING_HCI_D2H) | BIT(BCM4377_XFER_RING_ACL_D2H);
1693+ bcm4377->hci_acl_event_ring.delay = 1000;
1694+
1695+ bcm4377->sco_ack_ring.ring_id = BCM4377_ACK_RING_SCO;
1696+ bcm4377->sco_ack_ring.n_entries = BCM4377_RING_N_ENTRIES;
1697+ bcm4377->sco_ack_ring.transfer_rings = BIT(BCM4377_XFER_RING_SCO_H2D);
1698+
1699+ bcm4377->sco_event_ring.ring_id = BCM4377_EVENT_RING_SCO;
1700+ bcm4377->sco_event_ring.payload_size = MAX_SCO_PAYLOAD_SIZE;
1701+ bcm4377->sco_event_ring.n_entries = BCM4377_RING_N_ENTRIES;
1702+ bcm4377->sco_event_ring.transfer_rings = BIT(BCM4377_XFER_RING_SCO_D2H);
1703+
1704+ bcm4377->control_h2d_ring.ring_id = BCM4377_XFER_RING_CONTROL;
1705+ bcm4377->control_h2d_ring.doorbell = BCM4377_DOORBELL_CONTROL;
1706+ bcm4377->control_h2d_ring.payload_size = BCM4377_CONTROL_MSG_SIZE;
1707+ bcm4377->control_h2d_ring.completion_ring = BCM4377_ACK_RING_CONTROL;
1708+ bcm4377->control_h2d_ring.allow_wait = true;
1709+ bcm4377->control_h2d_ring.n_entries = BCM4377_RING_N_ENTRIES;
1710+
1711+ bcm4377->hci_h2d_ring.ring_id = BCM4377_XFER_RING_HCI_H2D;
1712+ bcm4377->hci_h2d_ring.doorbell = BCM4377_DOORBELL_HCI_H2D;
1713+ bcm4377->hci_h2d_ring.payload_size = MAX_EVENT_PAYLOAD_SIZE;
1714+ bcm4377->hci_h2d_ring.completion_ring = BCM4377_ACK_RING_HCI_ACL;
1715+ bcm4377->hci_h2d_ring.n_entries = BCM4377_RING_N_ENTRIES;
1716+
1717+ bcm4377->hci_d2h_ring.ring_id = BCM4377_XFER_RING_HCI_D2H;
1718+ bcm4377->hci_d2h_ring.doorbell = BCM4377_DOORBELL_HCI_D2H;
1719+ bcm4377->hci_d2h_ring.completion_ring = BCM4377_EVENT_RING_HCI_ACL;
1720+ bcm4377->hci_d2h_ring.virtual = true;
1721+ bcm4377->hci_d2h_ring.n_entries = BCM4377_RING_N_ENTRIES;
1722+
1723+ bcm4377->sco_h2d_ring.ring_id = BCM4377_XFER_RING_SCO_H2D;
1724+ bcm4377->sco_h2d_ring.doorbell = BCM4377_DOORBELL_SCO;
1725+ bcm4377->sco_h2d_ring.payload_size = MAX_SCO_PAYLOAD_SIZE;
1726+ bcm4377->sco_h2d_ring.completion_ring = BCM4377_ACK_RING_SCO;
1727+ bcm4377->sco_h2d_ring.sync = true;
1728+ bcm4377->sco_h2d_ring.n_entries = BCM4377_RING_N_ENTRIES;
1729+
1730+ bcm4377->sco_d2h_ring.ring_id = BCM4377_XFER_RING_SCO_D2H;
1731+ bcm4377->sco_d2h_ring.doorbell = BCM4377_DOORBELL_SCO;
1732+ bcm4377->sco_d2h_ring.completion_ring = BCM4377_EVENT_RING_SCO;
1733+ bcm4377->sco_d2h_ring.virtual = true;
1734+ bcm4377->sco_d2h_ring.sync = true;
1735+ bcm4377->sco_d2h_ring.n_entries = BCM4377_RING_N_ENTRIES;
1736+
1737+ /*
1738+ * This ring has to use mapped_payload_size because the largest ACL
1739+ * packet doesn't fit inside the largest possible footer
1740+ */
1741+ bcm4377->acl_h2d_ring.ring_id = BCM4377_XFER_RING_ACL_H2D;
1742+ bcm4377->acl_h2d_ring.doorbell = BCM4377_DOORBELL_ACL_H2D;
1743+ bcm4377->acl_h2d_ring.mapped_payload_size = MAX_ACL_PAYLOAD_SIZE;
1744+ bcm4377->acl_h2d_ring.completion_ring = BCM4377_ACK_RING_HCI_ACL;
1745+ bcm4377->acl_h2d_ring.n_entries = BCM4377_RING_N_ENTRIES;
1746+
1747+ /*
1748+ * This ring only contains empty buffers to be used by incoming
1749+ * ACL packets that do not fit inside the footer of hci_acl_event_ring
1750+ */
1751+ bcm4377->acl_d2h_ring.ring_id = BCM4377_XFER_RING_ACL_D2H;
1752+ bcm4377->acl_d2h_ring.doorbell = BCM4377_DOORBELL_ACL_D2H;
1753+ bcm4377->acl_d2h_ring.completion_ring = BCM4377_EVENT_RING_HCI_ACL;
1754+ bcm4377->acl_d2h_ring.d2h_buffers_only = true;
1755+ bcm4377->acl_d2h_ring.mapped_payload_size = MAX_ACL_PAYLOAD_SIZE;
1756+ bcm4377->acl_d2h_ring.n_entries = BCM4377_RING_N_ENTRIES;
1757+
1758+ /*
1759+ * no need for any cleanup since this is only called from _probe
1760+ * and only devres-managed allocations are used
1761+ */
1762+ ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->control_h2d_ring);
1763+ if (ret)
1764+ return ret;
1765+ ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->hci_h2d_ring);
1766+ if (ret)
1767+ return ret;
1768+ ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->hci_d2h_ring);
1769+ if (ret)
1770+ return ret;
1771+ ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->sco_h2d_ring);
1772+ if (ret)
1773+ return ret;
1774+ ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->sco_d2h_ring);
1775+ if (ret)
1776+ return ret;
1777+ ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->acl_h2d_ring);
1778+ if (ret)
1779+ return ret;
1780+ ret = bcm4377_alloc_transfer_ring(bcm4377, &bcm4377->acl_d2h_ring);
1781+ if (ret)
1782+ return ret;
1783+
1784+ ret = bcm4377_alloc_completion_ring(bcm4377,
1785+ &bcm4377->control_ack_ring);
1786+ if (ret)
1787+ return ret;
1788+ ret = bcm4377_alloc_completion_ring(bcm4377,
1789+ &bcm4377->hci_acl_ack_ring);
1790+ if (ret)
1791+ return ret;
1792+ ret = bcm4377_alloc_completion_ring(bcm4377,
1793+ &bcm4377->hci_acl_event_ring);
1794+ if (ret)
1795+ return ret;
1796+ ret = bcm4377_alloc_completion_ring(bcm4377, &bcm4377->sco_ack_ring);
1797+ if (ret)
1798+ return ret;
1799+ ret = bcm4377_alloc_completion_ring(bcm4377, &bcm4377->sco_event_ring);
1800+ if (ret)
1801+ return ret;
1802+
1803+ dev_dbg(&bcm4377->pdev->dev, "all rings allocated and prepared\n");
1804+
1805+ return 0;
1806+}
1807+
1808+static int bcm4377_boot(struct bcm4377_data *bcm4377)
1809+{
1810+ const struct firmware *fw;
1811+ void *bfr;
1812+ dma_addr_t fw_dma;
1813+ int ret = 0;
1814+ u32 bootstage, rti_status;
1815+
1816+ bootstage = ioread32(bcm4377->bar2 + BCM4377_BAR2_BOOTSTAGE);
1817+ rti_status = ioread32(bcm4377->bar2 + BCM4377_BAR2_RTI_STATUS);
1818+
1819+ if (bootstage != 0) {
1820+ dev_err(&bcm4377->pdev->dev, "bootstage is %d and not 0\n",
1821+ bootstage);
1822+ return -EINVAL;
1823+ }
1824+
1825+ if (rti_status != 0) {
1826+ dev_err(&bcm4377->pdev->dev, "RTI status is %d and not 0\n",
1827+ rti_status);
1828+ return -EINVAL;
1829+ }
1830+
1831+ fw = bcm4377_request_blob(bcm4377, "bin");
1832+ if (!fw) {
1833+ dev_err(&bcm4377->pdev->dev, "Failed to load firmware\n");
1834+ return -ENOENT;
1835+ }
1836+
1837+ bfr = dma_alloc_coherent(&bcm4377->pdev->dev, fw->size, &fw_dma,
1838+ GFP_KERNEL);
1839+ if (!bfr) {
1840+ ret = -ENOMEM;
1841+ goto out_release_fw;
1842+ }
1843+
1844+ memcpy(bfr, fw->data, fw->size);
1845+
1846+ iowrite32(0, bcm4377->bar0 + BCM4377_BAR0_HOST_WINDOW_LO);
1847+ iowrite32(0, bcm4377->bar0 + BCM4377_BAR0_HOST_WINDOW_HI);
1848+ iowrite32(BCM4377_DMA_MASK,
1849+ bcm4377->bar0 + BCM4377_BAR0_HOST_WINDOW_SIZE);
1850+
1851+ iowrite32(lower_32_bits(fw_dma), bcm4377->bar2 + BCM4377_BAR2_FW_LO);
1852+ iowrite32(upper_32_bits(fw_dma), bcm4377->bar2 + BCM4377_BAR2_FW_HI);
1853+ iowrite32(fw->size, bcm4377->bar2 + BCM4377_BAR2_FW_SIZE);
1854+ iowrite32(0, bcm4377->bar0 + BCM4377_BAR0_FW_DOORBELL);
1855+
1856+ dev_dbg(&bcm4377->pdev->dev, "waiting for firmware to boot\n");
1857+
1858+ ret = wait_for_completion_interruptible_timeout(&bcm4377->event,
1859+ BCM4377_TIMEOUT);
1860+ if (ret == 0) {
1861+ ret = -ETIMEDOUT;
1862+ goto out_dma_free;
1863+ } else if (ret < 0) {
1864+ goto out_dma_free;
1865+ }
1866+
1867+ if (bcm4377->bootstage != 2) {
1868+ dev_err(&bcm4377->pdev->dev, "boostage %d != 2\n",
1869+ bcm4377->bootstage);
1870+ ret = -ENXIO;
1871+ goto out_dma_free;
1872+ }
1873+
1874+ dev_dbg(&bcm4377->pdev->dev, "firmware has booted (stage = %x)\n",
1875+ bcm4377->bootstage);
1876+ ret = 0;
1877+
1878+out_dma_free:
1879+ dma_free_coherent(&bcm4377->pdev->dev, fw->size, bfr, fw_dma);
1880+out_release_fw:
1881+ release_firmware(fw);
1882+ return ret;
1883+}
1884+
1885+static int bcm4377_setup_rti(struct bcm4377_data *bcm4377)
1886+{
1887+ int ret;
1888+
1889+ dev_dbg(&bcm4377->pdev->dev, "starting RTI\n");
1890+ iowrite32(1, bcm4377->bar0 + BCM4377_BAR0_RTI_CONTROL);
1891+
1892+ ret = wait_for_completion_interruptible_timeout(&bcm4377->event,
1893+ BCM4377_TIMEOUT);
1894+ if (ret == 0) {
1895+ dev_err(&bcm4377->pdev->dev,
1896+ "timed out while waiting for RTI to transition to state 1");
1897+ return -ETIMEDOUT;
1898+ } else if (ret < 0) {
1899+ return ret;
1900+ }
1901+
1902+ if (bcm4377->rti_status != 1) {
1903+ dev_err(&bcm4377->pdev->dev, "RTI did not ack state 1 (%d)\n",
1904+ bcm4377->rti_status);
1905+ return -ENODEV;
1906+ }
1907+ dev_dbg(&bcm4377->pdev->dev, "RTI is in state 1\n");
1908+
1909+ /* allow access to the entire IOVA space again */
1910+ iowrite32(0, bcm4377->bar2 + BCM4377_BAR2_RTI_WINDOW_LO);
1911+ iowrite32(0, bcm4377->bar2 + BCM4377_BAR2_RTI_WINDOW_HI);
1912+ iowrite32(BCM4377_DMA_MASK,
1913+ bcm4377->bar2 + BCM4377_BAR2_RTI_WINDOW_SIZE);
1914+
1915+ /* setup "Converged IPC" context */
1916+ iowrite32(lower_32_bits(bcm4377->ctx_dma),
1917+ bcm4377->bar2 + BCM4377_BAR2_CONTEXT_ADDR_LO);
1918+ iowrite32(upper_32_bits(bcm4377->ctx_dma),
1919+ bcm4377->bar2 + BCM4377_BAR2_CONTEXT_ADDR_HI);
1920+ iowrite32(2, bcm4377->bar0 + BCM4377_BAR0_RTI_CONTROL);
1921+
1922+ ret = wait_for_completion_interruptible_timeout(&bcm4377->event,
1923+ BCM4377_TIMEOUT);
1924+ if (ret == 0) {
1925+ dev_err(&bcm4377->pdev->dev,
1926+ "timed out while waiting for RTI to transition to state 2");
1927+ return -ETIMEDOUT;
1928+ } else if (ret < 0) {
1929+ return ret;
1930+ }
1931+
1932+ if (bcm4377->rti_status != 2) {
1933+ dev_err(&bcm4377->pdev->dev, "RTI did not ack state 2 (%d)\n",
1934+ bcm4377->rti_status);
1935+ return -ENODEV;
1936+ }
1937+
1938+ dev_dbg(&bcm4377->pdev->dev,
1939+ "RTI is in state 2; control ring is ready\n");
1940+ bcm4377->control_ack_ring.enabled = true;
1941+
1942+ return 0;
1943+}
1944+
1945+static int bcm4377_parse_otp_board_params(struct bcm4377_data *bcm4377,
1946+ char tag, const char *val, size_t len)
1947+{
1948+ if (tag != 'V')
1949+ return 0;
1950+ if (len >= sizeof(bcm4377->vendor))
1951+ return -EINVAL;
1952+
1953+ strscpy(bcm4377->vendor, val, len + 1);
1954+ return 0;
1955+}
1956+
1957+static int bcm4377_parse_otp_chip_params(struct bcm4377_data *bcm4377, char tag,
1958+ const char *val, size_t len)
1959+{
1960+ size_t idx = 0;
1961+
1962+ if (tag != 's')
1963+ return 0;
1964+ if (len >= sizeof(bcm4377->stepping))
1965+ return -EINVAL;
1966+
1967+ while (len != 0) {
1968+ bcm4377->stepping[idx] = tolower(val[idx]);
1969+ if (val[idx] == '\0')
1970+ return 0;
1971+
1972+ idx++;
1973+ len--;
1974+ }
1975+
1976+ bcm4377->stepping[idx] = '\0';
1977+ return 0;
1978+}
1979+
1980+static int bcm4377_parse_otp_str(struct bcm4377_data *bcm4377, const u8 *str,
1981+ enum bcm4377_otp_params_type type)
1982+{
1983+ const char *p;
1984+ int ret;
1985+
1986+ p = skip_spaces(str);
1987+ while (*p) {
1988+ char tag = *p++;
1989+ const char *end;
1990+ size_t len;
1991+
1992+ if (*p++ != '=') /* implicit NUL check */
1993+ return -EINVAL;
1994+
1995+ /* *p might be NUL here, if so end == p and len == 0 */
1996+ end = strchrnul(p, ' ');
1997+ len = end - p;
1998+
1999+ /* leave 1 byte for NUL in destination string */
2000+ if (len > (BCM4377_OTP_MAX_PARAM_LEN - 1))
2001+ return -EINVAL;
2002+
2003+ switch (type) {
2004+ case BCM4377_OTP_BOARD_PARAMS:
2005+ ret = bcm4377_parse_otp_board_params(bcm4377, tag, p,
2006+ len);
2007+ break;
2008+ case BCM4377_OTP_CHIP_PARAMS:
2009+ ret = bcm4377_parse_otp_chip_params(bcm4377, tag, p,
2010+ len);
2011+ break;
2012+ default:
2013+ ret = -EINVAL;
2014+ break;
2015+ }
2016+
2017+ if (ret)
2018+ return ret;
2019+
2020+ /* Skip to next arg, if any */
2021+ p = skip_spaces(end);
2022+ }
2023+
2024+ return 0;
2025+}
2026+
2027+static int bcm4377_parse_otp_sys_vendor(struct bcm4377_data *bcm4377, u8 *otp,
2028+ size_t size)
2029+{
2030+ int idx = 4;
2031+ const char *chip_params;
2032+ const char *board_params;
2033+ int ret;
2034+
2035+ /* 4-byte header and two empty strings */
2036+ if (size < 6)
2037+ return -EINVAL;
2038+
2039+ if (get_unaligned_le32(otp) != BCM4377_OTP_VENDOR_HDR)
2040+ return -EINVAL;
2041+
2042+ chip_params = &otp[idx];
2043+
2044+ /* Skip first string, including terminator */
2045+ idx += strnlen(chip_params, size - idx) + 1;
2046+ if (idx >= size)
2047+ return -EINVAL;
2048+
2049+ board_params = &otp[idx];
2050+
2051+ /* Skip to terminator of second string */
2052+ idx += strnlen(board_params, size - idx);
2053+ if (idx >= size)
2054+ return -EINVAL;
2055+
2056+ /* At this point both strings are guaranteed NUL-terminated */
2057+ dev_dbg(&bcm4377->pdev->dev,
2058+ "OTP: chip_params='%s' board_params='%s'\n", chip_params,
2059+ board_params);
2060+
2061+ ret = bcm4377_parse_otp_str(bcm4377, chip_params,
2062+ BCM4377_OTP_CHIP_PARAMS);
2063+ if (ret)
2064+ return ret;
2065+
2066+ ret = bcm4377_parse_otp_str(bcm4377, board_params,
2067+ BCM4377_OTP_BOARD_PARAMS);
2068+ if (ret)
2069+ return ret;
2070+
2071+ if (!bcm4377->stepping[0] || !bcm4377->vendor[0])
2072+ return -EINVAL;
2073+
2074+ dev_dbg(&bcm4377->pdev->dev, "OTP: stepping=%s, vendor=%s\n",
2075+ bcm4377->stepping, bcm4377->vendor);
2076+ return 0;
2077+}
2078+
2079+static int bcm4377_parse_otp(struct bcm4377_data *bcm4377)
2080+{
2081+ u8 *otp;
2082+ int i;
2083+ int ret = -ENOENT;
2084+
2085+ otp = kzalloc(BCM4377_OTP_SIZE, GFP_KERNEL);
2086+ if (!otp)
2087+ return -ENOMEM;
2088+
2089+ for (i = 0; i < BCM4377_OTP_SIZE; ++i)
2090+ otp[i] = ioread8(bcm4377->bar0 + bcm4377->hw->otp_offset + i);
2091+
2092+ i = 0;
2093+ while (i < (BCM4377_OTP_SIZE - 1)) {
2094+ u8 type = otp[i];
2095+ u8 length = otp[i + 1];
2096+
2097+ if (type == 0)
2098+ break;
2099+
2100+ if ((i + 2 + length) > BCM4377_OTP_SIZE)
2101+ break;
2102+
2103+ switch (type) {
2104+ case BCM4377_OTP_SYS_VENDOR:
2105+ dev_dbg(&bcm4377->pdev->dev,
2106+ "OTP @ 0x%x (%d): SYS_VENDOR", i, length);
2107+ ret = bcm4377_parse_otp_sys_vendor(bcm4377, &otp[i + 2],
2108+ length);
2109+ break;
2110+ case BCM4377_OTP_CIS:
2111+ dev_dbg(&bcm4377->pdev->dev, "OTP @ 0x%x (%d): CIS", i,
2112+ length);
2113+ break;
2114+ default:
2115+ dev_dbg(&bcm4377->pdev->dev, "OTP @ 0x%x (%d): unknown",
2116+ i, length);
2117+ break;
2118+ }
2119+
2120+ i += 2 + length;
2121+ }
2122+
2123+ kfree(otp);
2124+ return ret;
2125+}
2126+
2127+static int bcm4377_init_cfg(struct bcm4377_data *bcm4377)
2128+{
2129+ int ret;
2130+ u32 ctrl;
2131+
2132+ ret = pci_write_config_dword(bcm4377->pdev,
2133+ BCM4377_PCIECFG_BAR0_WINDOW1,
2134+ bcm4377->hw->bar0_window1);
2135+ if (ret)
2136+ return ret;
2137+
2138+ ret = pci_write_config_dword(bcm4377->pdev,
2139+ BCM4377_PCIECFG_BAR0_WINDOW2,
2140+ bcm4377->hw->bar0_window2);
2141+ if (ret)
2142+ return ret;
2143+
2144+ ret = pci_write_config_dword(
2145+ bcm4377->pdev, BCM4377_PCIECFG_BAR0_CORE2_WINDOW1,
2146+ BCM4377_PCIECFG_BAR0_CORE2_WINDOW1_DEFAULT);
2147+ if (ret)
2148+ return ret;
2149+
2150+ if (bcm4377->hw->has_bar0_core2_window2) {
2151+ ret = pci_write_config_dword(bcm4377->pdev,
2152+ BCM4377_PCIECFG_BAR0_CORE2_WINDOW2,
2153+ bcm4377->hw->bar0_core2_window2);
2154+ if (ret)
2155+ return ret;
2156+ }
2157+
2158+ ret = pci_write_config_dword(bcm4377->pdev, BCM4377_PCIECFG_BAR2_WINDOW,
2159+ BCM4377_PCIECFG_BAR2_WINDOW_DEFAULT);
2160+ if (ret)
2161+ return ret;
2162+
2163+ ret = pci_read_config_dword(bcm4377->pdev,
2164+ BCM4377_PCIECFG_SUBSYSTEM_CTRL, &ctrl);
2165+ if (ret)
2166+ return ret;
2167+
2168+ if (bcm4377->hw->clear_pciecfg_subsystem_ctrl_bit19)
2169+ ctrl &= ~BIT(19);
2170+ ctrl |= BIT(16);
2171+
2172+ return pci_write_config_dword(bcm4377->pdev,
2173+ BCM4377_PCIECFG_SUBSYSTEM_CTRL, ctrl);
2174+}
2175+
2176+static int bcm4377_probe_dmi(struct bcm4377_data *bcm4377)
2177+{
2178+ const struct dmi_system_id *board_type_dmi_id;
2179+
2180+ board_type_dmi_id = dmi_first_match(bcm4377_dmi_board_table);
2181+ if (board_type_dmi_id && board_type_dmi_id->driver_data) {
2182+ bcm4377->board_type = board_type_dmi_id->driver_data;
2183+ dev_dbg(&bcm4377->pdev->dev,
2184+ "found board type via DMI match: %s\n",
2185+ bcm4377->board_type);
2186+ }
2187+
2188+ return 0;
2189+}
2190+
2191+static int bcm4377_probe_of(struct bcm4377_data *bcm4377)
2192+{
2193+ struct device_node *np = bcm4377->pdev->dev.of_node;
2194+ int ret;
2195+
2196+ if (!np)
2197+ return 0;
2198+
2199+ ret = of_property_read_string(np, "brcm,board-type",
2200+ &bcm4377->board_type);
2201+ if (ret) {
2202+ dev_err(&bcm4377->pdev->dev, "no brcm,board-type property\n");
2203+ return ret;
2204+ }
2205+
2206+ bcm4377->taurus_beamforming_cal_blob =
2207+ of_get_property(np, "brcm,taurus-bf-cal-blob",
2208+ &bcm4377->taurus_beamforming_cal_size);
2209+ if (!bcm4377->taurus_beamforming_cal_blob) {
2210+ dev_err(&bcm4377->pdev->dev,
2211+ "no brcm,taurus-bf-cal-blob property\n");
2212+ return -ENOENT;
2213+ }
2214+ bcm4377->taurus_cal_blob = of_get_property(np, "brcm,taurus-cal-blob",
2215+ &bcm4377->taurus_cal_size);
2216+ if (!bcm4377->taurus_cal_blob) {
2217+ dev_err(&bcm4377->pdev->dev,
2218+ "no brcm,taurus-cal-blob property\n");
2219+ return -ENOENT;
2220+ }
2221+
2222+ return 0;
2223+}
2224+
2225+static void bcm4377_disable_aspm(struct bcm4377_data *bcm4377)
2226+{
2227+ pci_disable_link_state(bcm4377->pdev,
2228+ PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1);
2229+
2230+ /*
2231+ * pci_disable_link_state can fail if either CONFIG_PCIEASPM is disabled
2232+ * or if the BIOS hasn't handed over control to us. We must *always*
2233+ * disable ASPM for this device due to hardware errata though.
2234+ */
2235+ pcie_capability_clear_word(bcm4377->pdev, PCI_EXP_LNKCTL,
2236+ PCI_EXP_LNKCTL_ASPMC);
2237+}
2238+
2239+static void bcm4377_pci_free_irq_vectors(void *data)
2240+{
2241+ pci_free_irq_vectors(data);
2242+}
2243+
2244+static void bcm4377_hci_free_dev(void *data)
2245+{
2246+ hci_free_dev(data);
2247+}
2248+
2249+static void bcm4377_hci_unregister_dev(void *data)
2250+{
2251+ hci_unregister_dev(data);
2252+}
2253+
2254+static int bcm4377_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2255+{
2256+ struct bcm4377_data *bcm4377;
2257+ struct hci_dev *hdev;
2258+ int ret, irq;
2259+
2260+ ret = dma_set_mask_and_coherent(&pdev->dev, BCM4377_DMA_MASK);
2261+ if (ret)
2262+ return ret;
2263+
2264+ bcm4377 = devm_kzalloc(&pdev->dev, sizeof(*bcm4377), GFP_KERNEL);
2265+ if (!bcm4377)
2266+ return -ENOMEM;
2267+
2268+ bcm4377->pdev = pdev;
2269+ bcm4377->hw = &bcm4377_hw_variants[id->driver_data];
2270+ init_completion(&bcm4377->event);
2271+
2272+ ret = bcm4377_prepare_rings(bcm4377);
2273+ if (ret)
2274+ return ret;
2275+
2276+ ret = bcm4377_init_context(bcm4377);
2277+ if (ret)
2278+ return ret;
2279+
2280+ ret = bcm4377_probe_dmi(bcm4377);
2281+ if (ret)
2282+ return ret;
2283+ ret = bcm4377_probe_of(bcm4377);
2284+ if (ret)
2285+ return ret;
2286+ if (!bcm4377->board_type) {
2287+ dev_err(&pdev->dev, "unable to determine board type\n");
2288+ return -ENODEV;
2289+ }
2290+
2291+ if (bcm4377->hw->disable_aspm)
2292+ bcm4377_disable_aspm(bcm4377);
2293+
2294+ ret = pci_reset_function_locked(pdev);
2295+ if (ret)
2296+ dev_warn(
2297+ &pdev->dev,
2298+ "function level reset failed with %d; trying to continue anyway\n",
2299+ ret);
2300+
2301+ /*
2302+ * If this number is too low and we try to access any BAR too
2303+ * early the device will crash. Experiments have shown that
2304+ * approximately 50 msec is the minimum amount we have to wait.
2305+ * Let's double that to be safe.
2306+ */
2307+ msleep(100);
2308+
2309+ ret = pcim_enable_device(pdev);
2310+ if (ret)
2311+ return ret;
2312+ pci_set_master(pdev);
2313+
2314+ ret = bcm4377_init_cfg(bcm4377);
2315+ if (ret)
2316+ return ret;
2317+
2318+ bcm4377->bar0 = pcim_iomap(pdev, 0, 0);
2319+ if (!bcm4377->bar0)
2320+ return -EBUSY;
2321+ bcm4377->bar2 = pcim_iomap(pdev, 2, 0);
2322+ if (!bcm4377->bar2)
2323+ return -EBUSY;
2324+
2325+ ret = bcm4377_parse_otp(bcm4377);
2326+ if (ret) {
2327+ dev_err(&pdev->dev, "Reading OTP failed with %d\n", ret);
2328+ return ret;
2329+ }
2330+
2331+ /*
2332+ * Legacy interrupts result in an IRQ storm because we don't know where
2333+ * the interrupt mask and status registers for these chips are.
2334+ * MSIs are acked automatically instead.
2335+ */
2336+ ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_MSI);
2337+ if (ret < 0)
2338+ return -ENODEV;
2339+ ret = devm_add_action_or_reset(&pdev->dev, bcm4377_pci_free_irq_vectors,
2340+ pdev);
2341+ if (ret)
2342+ return ret;
2343+
2344+ irq = pci_irq_vector(pdev, 0);
2345+ if (irq <= 0)
2346+ return -ENODEV;
2347+
2348+ ret = devm_request_irq(&pdev->dev, irq, bcm4377_irq, 0, "bcm4377",
2349+ bcm4377);
2350+ if (ret)
2351+ return ret;
2352+
2353+ hdev = hci_alloc_dev();
2354+ if (!hdev)
2355+ return -ENOMEM;
2356+ ret = devm_add_action_or_reset(&pdev->dev, bcm4377_hci_free_dev, hdev);
2357+ if (ret)
2358+ return ret;
2359+
2360+ bcm4377->hdev = hdev;
2361+
2362+ hdev->bus = HCI_PCI;
2363+ hdev->dev_type = HCI_PRIMARY;
2364+ hdev->open = bcm4377_hci_open;
2365+ hdev->close = bcm4377_hci_close;
2366+ hdev->send = bcm4377_hci_send_frame;
2367+ hdev->set_bdaddr = bcm4377_hci_set_bdaddr;
2368+ hdev->setup = bcm4377_hci_setup;
2369+
2370+ set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
2371+ if (bcm4377->hw->broken_mws_transport_config)
2372+ set_bit(HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG, &hdev->quirks);
2373+ if (bcm4377->hw->broken_ext_scan)
2374+ set_bit(HCI_QUIRK_BROKEN_EXT_SCAN, &hdev->quirks);
2375+
2376+ pci_set_drvdata(pdev, bcm4377);
2377+ hci_set_drvdata(hdev, bcm4377);
2378+ SET_HCIDEV_DEV(hdev, &pdev->dev);
2379+
2380+ ret = bcm4377_boot(bcm4377);
2381+ if (ret)
2382+ return ret;
2383+
2384+ ret = bcm4377_setup_rti(bcm4377);
2385+ if (ret)
2386+ return ret;
2387+
2388+ ret = hci_register_dev(hdev);
2389+ if (ret)
2390+ return ret;
2391+ return devm_add_action_or_reset(&pdev->dev, bcm4377_hci_unregister_dev,
2392+ hdev);
2393+}
2394+
2395+static int bcm4377_suspend(struct pci_dev *pdev, pm_message_t state)
2396+{
2397+ struct bcm4377_data *bcm4377 = pci_get_drvdata(pdev);
2398+ int ret;
2399+
2400+ ret = hci_suspend_dev(bcm4377->hdev);
2401+ if (ret)
2402+ return ret;
2403+
2404+ iowrite32(BCM4377_BAR0_SLEEP_CONTROL_QUIESCE,
2405+ bcm4377->bar0 + BCM4377_BAR0_SLEEP_CONTROL);
2406+
2407+ return 0;
2408+}
2409+
2410+static int bcm4377_resume(struct pci_dev *pdev)
2411+{
2412+ struct bcm4377_data *bcm4377 = pci_get_drvdata(pdev);
2413+
2414+ iowrite32(BCM4377_BAR0_SLEEP_CONTROL_UNQUIESCE,
2415+ bcm4377->bar0 + BCM4377_BAR0_SLEEP_CONTROL);
2416+
2417+ return hci_resume_dev(bcm4377->hdev);
2418+}
2419+
2420+static const struct dmi_system_id bcm4377_dmi_board_table[] = {
2421+ {
2422+ .matches = {
2423+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
2424+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookAir9,1"),
2425+ },
2426+ .driver_data = "apple,formosa",
2427+ },
2428+ {
2429+ .matches = {
2430+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
2431+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro15,4"),
2432+ },
2433+ .driver_data = "apple,formosa",
2434+ },
2435+ {
2436+ .matches = {
2437+ DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."),
2438+ DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro16,3"),
2439+ },
2440+ .driver_data = "apple,formosa",
2441+ },
2442+ {}
2443+};
2444+
2445+static const struct bcm4377_hw bcm4377_hw_variants[] = {
2446+ [BCM4377] = {
2447+ .id = 0x4377,
2448+ .otp_offset = 0x4120,
2449+ .bar0_window1 = 0x1800b000,
2450+ .bar0_window2 = 0x1810c000,
2451+ .disable_aspm = true,
2452+ .broken_ext_scan = true,
2453+ .send_ptb = bcm4377_send_ptb,
2454+ },
2455+
2456+ [BCM4378] = {
2457+ .id = 0x4378,
2458+ .otp_offset = 0x4120,
2459+ .bar0_window1 = 0x18002000,
2460+ .bar0_window2 = 0x1810a000,
2461+ .bar0_core2_window2 = 0x18107000,
2462+ .has_bar0_core2_window2 = true,
2463+ .broken_mws_transport_config = true,
2464+ .send_calibration = bcm4378_send_calibration,
2465+ .send_ptb = bcm4378_send_ptb,
2466+ },
2467+
2468+ [BCM4387] = {
2469+ .id = 0x4387,
2470+ .otp_offset = 0x413c,
2471+ .bar0_window1 = 0x18002000,
2472+ .bar0_window2 = 0x18109000,
2473+ .bar0_core2_window2 = 0x18106000,
2474+ .has_bar0_core2_window2 = true,
2475+ .clear_pciecfg_subsystem_ctrl_bit19 = true,
2476+ .broken_mws_transport_config = true,
2477+ .send_calibration = bcm4387_send_calibration,
2478+ .send_ptb = bcm4378_send_ptb,
2479+ },
2480+};
2481+
2482+#define BCM4377_DEVID_ENTRY(id) \
2483+ { \
2484+ PCI_VENDOR_ID_BROADCOM, BCM##id##_DEVICE_ID, PCI_ANY_ID, \
2485+ PCI_ANY_ID, PCI_CLASS_NETWORK_OTHER << 8, 0xffff00, \
2486+ BCM##id \
2487+ }
2488+
2489+static const struct pci_device_id bcm4377_devid_table[] = {
2490+ BCM4377_DEVID_ENTRY(4377),
2491+ BCM4377_DEVID_ENTRY(4378),
2492+ BCM4377_DEVID_ENTRY(4387),
2493+ {},
2494+};
2495+MODULE_DEVICE_TABLE(pci, bcm4377_devid_table);
2496+
2497+static struct pci_driver bcm4377_pci_driver = {
2498+ .name = "hci_bcm4377",
2499+ .id_table = bcm4377_devid_table,
2500+ .probe = bcm4377_probe,
2501+ .suspend = bcm4377_suspend,
2502+ .resume = bcm4377_resume,
2503+};
2504+module_pci_driver(bcm4377_pci_driver);
2505+
2506+MODULE_AUTHOR("Sven Peter <sven@svenpeter.dev>");
2507+MODULE_DESCRIPTION("Bluetooth support for Broadcom 4377/4378/4387 devices");
2508+MODULE_LICENSE("Dual MIT/GPL");
2509+MODULE_FIRMWARE("brcm/brcmbt4377*.bin");
2510+MODULE_FIRMWARE("brcm/brcmbt4377*.ptb");
2511+MODULE_FIRMWARE("brcm/brcmbt4378*.bin");
2512+MODULE_FIRMWARE("brcm/brcmbt4378*.ptb");
2513+MODULE_FIRMWARE("brcm/brcmbt4387*.bin");
2514+MODULE_FIRMWARE("brcm/brcmbt4387*.ptb");
drivers/bluetooth/hci_bcsp.c+1−1
@@ -378,7 +378,7 @@ static void bcsp_pkt_cull(struct bcsp_struct *bcsp) · 377 unmodified lines
378378 i++;
379379
380380 __skb_unlink(skb, &bcsp->unack);
381− kfree_skb(skb);
381+ dev_kfree_skb_irq(skb);
382382 }
383383
384384 if (skb_queue_empty(&bcsp->unack))
drivers/bluetooth/hci_h5.c+1−1
@@ -313,7 +313,7 @@ static void h5_pkt_cull(struct h5 *h5) · 312 unmodified lines
313313 break;
314314
315315 __skb_unlink(skb, &h5->unack);
316− kfree_skb(skb);
316+ dev_kfree_skb_irq(skb);
317317 }
318318
319319 if (skb_queue_empty(&h5->unack))
drivers/bluetooth/hci_ll.c+1−1
@@ -345,7 +345,7 @@ static int ll_enqueue(struct hci_uart *hu, struct sk_buff *skb) · 344 unmodified lines
345345 default:
346346 BT_ERR("illegal hcill state: %ld (losing packet)",
347347 ll->hcill_state);
348− kfree_skb(skb);
348+ dev_kfree_skb_irq(skb);
349349 break;
350350 }
351351
drivers/bluetooth/hci_qca.c+3−2
@@ -918,7 +918,7 @@ static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb) · 917 unmodified lines
918918 default:
919919 BT_ERR("Illegal tx state: %d (losing packet)",
920920 qca->tx_ibs_state);
921− kfree_skb(skb);
921+ dev_kfree_skb_irq(skb);
922922 break;
923923 }
924924
@@ -1771,7 +1771,8 @@ retry: · 846 unmodified lines
17711771 qca_debugfs_init(hdev);
17721772 hu->hdev->hw_error = qca_hw_error;
17731773 hu->hdev->cmd_timeout = qca_cmd_timeout;
1774− hu->hdev->wakeup = qca_wakeup;
1774+ if (device_can_wakeup(hu->serdev->ctrl->dev.parent))
1775+ hu->hdev->wakeup = qca_wakeup;
17751776 } else if (ret == -ENOENT) {
17761777 /* No patch/nvm-config found, run with original fw/config */
17771778 set_bit(QCA_ROM_FW, &qca->flags);
drivers/bluetooth/virtio_bt.c+30−5
@@ -50,8 +50,11 @@ static int virtbt_add_inbuf(struct virtio_bluetooth *vbt) · 49 unmodified lines
5050
5151 static int virtbt_open(struct hci_dev *hdev)
5252 {
53− struct virtio_bluetooth *vbt = hci_get_drvdata(hdev);
53+ return 0;
54+}
5455
56+static int virtbt_open_vdev(struct virtio_bluetooth *vbt)
57+{
5558 if (virtbt_add_inbuf(vbt) < 0)
5659 return -EIO;
5760
@@ -61,7 +64,11 @@ static int virtbt_open(struct hci_dev *hdev) · 3 unmodified lines
6164
6265 static int virtbt_close(struct hci_dev *hdev)
6366 {
64− struct virtio_bluetooth *vbt = hci_get_drvdata(hdev);
67+ return 0;
68+}
69+
70+static int virtbt_close_vdev(struct virtio_bluetooth *vbt)
71+{
6572 int i;
6673
6774 cancel_work_sync(&vbt->rx);
@@ -306,7 +313,12 @@ static int virtbt_probe(struct virtio_device *vdev) · 238 unmodified lines
306313 if (virtio_has_feature(vdev, VIRTIO_BT_F_VND_HCI)) {
307314 __u16 vendor;
308315
309− virtio_cread(vdev, struct virtio_bt_config, vendor, &vendor);
316+ if (virtio_has_feature(vdev, VIRTIO_BT_F_CONFIG_V2))
317+ virtio_cread(vdev, struct virtio_bt_config_v2,
318+ vendor, &vendor);
319+ else
320+ virtio_cread(vdev, struct virtio_bt_config,
321+ vendor, &vendor);
310322
311323 switch (vendor) {
312324 case VIRTIO_BT_CONFIG_VENDOR_ZEPHYR:
@@ -339,8 +351,12 @@ static int virtbt_probe(struct virtio_device *vdev) · 26 unmodified lines
339351 if (virtio_has_feature(vdev, VIRTIO_BT_F_MSFT_EXT)) {
340352 __u16 msft_opcode;
341353
342− virtio_cread(vdev, struct virtio_bt_config,
343− msft_opcode, &msft_opcode);
354+ if (virtio_has_feature(vdev, VIRTIO_BT_F_CONFIG_V2))
355+ virtio_cread(vdev, struct virtio_bt_config_v2,
356+ msft_opcode, &msft_opcode);
357+ else
358+ virtio_cread(vdev, struct virtio_bt_config,
359+ msft_opcode, &msft_opcode);
344360
345361 hci_set_msft_opcode(hdev, msft_opcode);
346362 }
@@ -354,8 +370,15 @@ static int virtbt_probe(struct virtio_device *vdev) · 7 unmodified lines
354370 goto failed;
355371 }
356372
373+ virtio_device_ready(vdev);
374+ err = virtbt_open_vdev(vbt);
375+ if (err)
376+ goto open_failed;
377+
357378 return 0;
358379
380+open_failed:
381+ hci_free_dev(hdev);
359382 failed:
360383 vdev->config->del_vqs(vdev);
361384 return err;
@@ -368,6 +391,7 @@ static void virtbt_remove(struct virtio_device *vdev) · 6 unmodified lines
368391
369392 hci_unregister_dev(hdev);
370393 virtio_reset_device(vdev);
394+ virtbt_close_vdev(vbt);
371395
372396 hci_free_dev(hdev);
373397 vbt->hdev = NULL;
@@ -387,6 +411,7 @@ static const unsigned int virtbt_features[] = { · 13 unmodified lines
387411 VIRTIO_BT_F_VND_HCI,
388412 VIRTIO_BT_F_MSFT_EXT,
389413 VIRTIO_BT_F_AOSP_EXT,
414+ VIRTIO_BT_F_CONFIG_V2,
390415 };
391416
392417 static struct virtio_driver virtbt_driver = {
drivers/crypto/marvell/octeontx2/otx2_cpt_devlink.c+0−4
@@ -76,10 +76,6 @@ static int otx2_cpt_devlink_info_get(struct devlink *dl, · 75 unmodified lines
7676 struct otx2_cptpf_dev *cptpf = cpt_dl->cptpf;
7777 int err;
7878
79− err = devlink_info_driver_name_put(req, "rvu_cptpf");
80− if (err)
81− return err;
82−
8379 err = otx2_cpt_dl_info_firmware_version_put(req, cptpf->eng_grps.grp,
8480 "fw.ae", OTX2_CPT_AE_TYPES);
8581 if (err)
drivers/hv/hv_util.c+2−2
@@ -706,7 +706,7 @@ static int hv_ptp_settime(struct ptp_clock_info *p, const struct timespec64 *ts) · 705 unmodified lines
706706 return -EOPNOTSUPP;
707707 }
708708
709−static int hv_ptp_adjfreq(struct ptp_clock_info *ptp, s32 delta)
709+static int hv_ptp_adjfine(struct ptp_clock_info *ptp, long delta)
710710 {
711711 return -EOPNOTSUPP;
712712 }
@@ -724,7 +724,7 @@ static struct ptp_clock_info ptp_hyperv_info = { · 11 unmodified lines
724724 .name = "hyperv",
725725 .enable = hv_ptp_enable,
726726 .adjtime = hv_ptp_adjtime,
727− .adjfreq = hv_ptp_adjfreq,
727+ .adjfine = hv_ptp_adjfine,
728728 .gettime64 = hv_ptp_gettime,
729729 .settime64 = hv_ptp_settime,
730730 .owner = THIS_MODULE,
drivers/infiniband/hw/mlx5/odp.c+1−2
@@ -230,8 +230,7 @@ static bool mlx5_ib_invalidate_range(struct mmu_interval_notifier *mni, · 229 unmodified lines
230230 struct ib_umem_odp *umem_odp =
231231 container_of(mni, struct ib_umem_odp, notifier);
232232 struct mlx5_ib_mr *mr;
233− const u64 umr_block_mask = (MLX5_UMR_MTT_ALIGNMENT /
234− sizeof(struct mlx5_mtt)) - 1;
233+ const u64 umr_block_mask = MLX5_UMR_MTT_NUM_ENTRIES_ALIGNMENT - 1;
235234 u64 idx = 0, blk_start_idx = 0;
236235 u64 invalidations = 0;
237236 unsigned long start;
drivers/infiniband/hw/mlx5/umr.c+7−7
@@ -418,7 +418,7 @@ int mlx5r_umr_rereg_pd_access(struct mlx5_ib_mr *mr, struct ib_pd *pd, · 417 unmodified lines
418418 }
419419
420420 #define MLX5_MAX_UMR_CHUNK \
421− ((1 << (MLX5_MAX_UMR_SHIFT + 4)) - MLX5_UMR_MTT_ALIGNMENT)
421+ ((1 << (MLX5_MAX_UMR_SHIFT + 4)) - MLX5_UMR_FLEX_ALIGNMENT)
422422 #define MLX5_SPARE_UMR_CHUNK 0x10000
423423
424424 /*
@@ -428,11 +428,11 @@ int mlx5r_umr_rereg_pd_access(struct mlx5_ib_mr *mr, struct ib_pd *pd, · 3 unmodified lines
428428 */
429429 static void *mlx5r_umr_alloc_xlt(size_t *nents, size_t ent_size, gfp_t gfp_mask)
430430 {
431− const size_t xlt_chunk_align = MLX5_UMR_MTT_ALIGNMENT / ent_size;
431+ const size_t xlt_chunk_align = MLX5_UMR_FLEX_ALIGNMENT / ent_size;
432432 size_t size;
433433 void *res = NULL;
434434
435− static_assert(PAGE_SIZE % MLX5_UMR_MTT_ALIGNMENT == 0);
435+ static_assert(PAGE_SIZE % MLX5_UMR_FLEX_ALIGNMENT == 0);
436436
437437 /*
438438 * MLX5_IB_UPD_XLT_ATOMIC doesn't signal an atomic context just that the
@@ -666,7 +666,7 @@ int mlx5r_umr_update_mr_pas(struct mlx5_ib_mr *mr, unsigned int flags) · 227 unmodified lines
666666 }
667667
668668 final_size = (void *)cur_mtt - (void *)mtt;
669− sg.length = ALIGN(final_size, MLX5_UMR_MTT_ALIGNMENT);
669+ sg.length = ALIGN(final_size, MLX5_UMR_FLEX_ALIGNMENT);
670670 memset(cur_mtt, 0, sg.length - final_size);
671671 mlx5r_umr_final_update_xlt(dev, &wqe, mr, &sg, flags);
672672
@@ -690,7 +690,7 @@ int mlx5r_umr_update_xlt(struct mlx5_ib_mr *mr, u64 idx, int npages, · 17 unmodified lines
690690 int desc_size = (flags & MLX5_IB_UPD_XLT_INDIRECT)
691691 ? sizeof(struct mlx5_klm)
692692 : sizeof(struct mlx5_mtt);
693− const int page_align = MLX5_UMR_MTT_ALIGNMENT / desc_size;
693+ const int page_align = MLX5_UMR_FLEX_ALIGNMENT / desc_size;
694694 struct mlx5_ib_dev *dev = mr_to_mdev(mr);
695695 struct device *ddev = &dev->mdev->pdev->dev;
696696 const int page_mask = page_align - 1;
@@ -711,7 +711,7 @@ int mlx5r_umr_update_xlt(struct mlx5_ib_mr *mr, u64 idx, int npages, · 14 unmodified lines
711711 if (WARN_ON(!mr->umem->is_odp))
712712 return -EINVAL;
713713
714− /* UMR copies MTTs in units of MLX5_UMR_MTT_ALIGNMENT bytes,
714+ /* UMR copies MTTs in units of MLX5_UMR_FLEX_ALIGNMENT bytes,
715715 * so we need to align the offset and length accordingly
716716 */
717717 if (idx & page_mask) {
@@ -748,7 +748,7 @@ int mlx5r_umr_update_xlt(struct mlx5_ib_mr *mr, u64 idx, int npages, · 30 unmodified lines
748748 mlx5_odp_populate_xlt(xlt, idx, npages, mr, flags);
749749 dma_sync_single_for_device(ddev, sg.addr, sg.length,
750750 DMA_TO_DEVICE);
751− sg.length = ALIGN(size_to_map, MLX5_UMR_MTT_ALIGNMENT);
751+ sg.length = ALIGN(size_to_map, MLX5_UMR_FLEX_ALIGNMENT);
752752
753753 if (pages_mapped + pages_iter >= pages_to_map)
754754 mlx5r_umr_final_update_xlt(dev, &wqe, mr, &sg, flags);
drivers/net/bonding/bond_3ad.c+9−0
@@ -75,6 +75,7 @@ enum ad_link_speed_type { · 74 unmodified lines
7575 AD_LINK_SPEED_100000MBPS,
7676 AD_LINK_SPEED_200000MBPS,
7777 AD_LINK_SPEED_400000MBPS,
78+ AD_LINK_SPEED_800000MBPS,
7879 };
7980
8081 /* compare MAC addresses */
@@ -251,6 +252,7 @@ static inline int __check_agg_selection_timer(struct port *port) · 170 unmodified lines
251252 * %AD_LINK_SPEED_100000MBPS
252253 * %AD_LINK_SPEED_200000MBPS
253254 * %AD_LINK_SPEED_400000MBPS
255+ * %AD_LINK_SPEED_800000MBPS
254256 */
255257 static u16 __get_link_speed(struct port *port)
256258 {
@@ -326,6 +328,10 @@ static u16 __get_link_speed(struct port *port) · 69 unmodified lines
326328 speed = AD_LINK_SPEED_400000MBPS;
327329 break;
328330
331+ case SPEED_800000:
332+ speed = AD_LINK_SPEED_800000MBPS;
333+ break;
334+
329335 default:
330336 /* unknown speed value from ethtool. shouldn't happen */
331337 if (slave->speed != SPEED_UNKNOWN)
@@ -753,6 +759,9 @@ static u32 __get_agg_bandwidth(struct aggregator *aggregator) · 421 unmodified lines
753759 case AD_LINK_SPEED_400000MBPS:
754760 bandwidth = nports * 400000;
755761 break;
762+ case AD_LINK_SPEED_800000MBPS:
763+ bandwidth = nports * 800000;
764+ break;
756765 default:
757766 bandwidth = 0; /* to silence the compiler */
758767 }
drivers/net/bonding/bond_main.c+25−19
@@ -307,7 +307,7 @@ netdev_tx_t bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, · 306 unmodified lines
307307 return dev_queue_xmit(skb);
308308 }
309309
310−bool bond_sk_check(struct bonding *bond)
310+static bool bond_sk_check(struct bonding *bond)
311311 {
312312 switch (BOND_MODE(bond)) {
313313 case BOND_MODE_8023AD:
@@ -1398,13 +1398,6 @@ static netdev_features_t bond_fix_features(struct net_device *dev, · 1084 unmodified lines
13981398 netdev_features_t mask;
13991399 struct slave *slave;
14001400
1401−#if IS_ENABLED(CONFIG_TLS_DEVICE)
1402− if (bond_sk_check(bond))
1403− features |= BOND_TLS_FEATURES;
1404− else
1405− features &= ~BOND_TLS_FEATURES;
1406−#endif
1407−
14081401 mask = features;
14091402
14101403 features &= ~NETIF_F_ONE_FOR_ALL;
@@ -1639,13 +1632,19 @@ static int bond_master_upper_dev_link(struct bonding *bond, struct slave *slave, · 228 unmodified lines
16391632 {
16401633 struct netdev_lag_upper_info lag_upper_info;
16411634 enum netdev_lag_tx_type type;
1635+ int err;
16421636
16431637 type = bond_lag_tx_type(bond);
16441638 lag_upper_info.tx_type = type;
16451639 lag_upper_info.hash_type = bond_lag_hash_type(bond, type);
16461640
1647− return netdev_master_upper_dev_link(slave->dev, bond->dev, slave,
1648− &lag_upper_info, extack);
1641+ err = netdev_master_upper_dev_link(slave->dev, bond->dev, slave,
1642+ &lag_upper_info, extack);
1643+ if (err)
1644+ return err;
1645+
1646+ slave->dev->flags |= IFF_SLAVE;
1647+ return 0;
16491648 }
16501649
16511650 static void bond_upper_dev_unlink(struct bonding *bond, struct slave *slave)
@@ -1957,8 +1956,8 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev, · 305 unmodified lines
19571956 }
19581957 }
19591958
1960− /* set slave flag before open to prevent IPv6 addrconf */
1961− slave_dev->flags |= IFF_SLAVE;
1959+ /* set no_addrconf flag before open to prevent IPv6 addrconf */
1960+ slave_dev->priv_flags |= IFF_NO_ADDRCONF;
19621961
19631962 /* open the slave since the application closed it */
19641963 res = dev_open(slave_dev, extack);
@@ -2261,7 +2260,7 @@ err_close: · 296 unmodified lines
22612260 dev_close(slave_dev);
22622261
22632262 err_restore_mac:
2264− slave_dev->flags &= ~IFF_SLAVE;
2263+ slave_dev->priv_flags &= ~IFF_NO_ADDRCONF;
22652264 if (!bond->params.fail_over_mac ||
22662265 BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) {
22672266 /* XXX TODO - fom follow mode needs to change master's
@@ -2453,6 +2452,8 @@ static int __bond_release_one(struct net_device *bond_dev, · 185 unmodified lines
24532452 /* close slave before restoring its mac address */
24542453 dev_close(slave_dev);
24552454
2455+ slave_dev->priv_flags &= ~IFF_NO_ADDRCONF;
2456+
24562457 if (bond->params.fail_over_mac != BOND_FOM_ACTIVE ||
24572458 BOND_MODE(bond) != BOND_MODE_ACTIVEBACKUP) {
24582459 /* restore original ("permanent") mac address */
@@ -2531,12 +2532,21 @@ static int bond_slave_info_query(struct net_device *bond_dev, struct ifslave *in · 72 unmodified lines
25312532 /* called with rcu_read_lock() */
25322533 static int bond_miimon_inspect(struct bonding *bond)
25332534 {
2535+ bool ignore_updelay = false;
25342536 int link_state, commit = 0;
25352537 struct list_head *iter;
25362538 struct slave *slave;
2537− bool ignore_updelay;
25382539
2539− ignore_updelay = !rcu_dereference(bond->curr_active_slave);
2540+ if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP) {
2541+ ignore_updelay = !rcu_dereference(bond->curr_active_slave);
2542+ } else {
2543+ struct bond_up_slave *usable_slaves;
2544+
2545+ usable_slaves = rcu_dereference(bond->usable_slaves);
2546+
2547+ if (usable_slaves && usable_slaves->count == 0)
2548+ ignore_updelay = true;
2549+ }
25402550
25412551 bond_for_each_slave_rcu(bond, slave, iter) {
25422552 bond_propose_link_state(slave, BOND_LINK_NOCHANGE);
@@ -5813,10 +5823,6 @@ void bond_setup(struct net_device *bond_dev) · 3270 unmodified lines
58135823 if (BOND_MODE(bond) == BOND_MODE_ACTIVEBACKUP)
58145824 bond_dev->features |= BOND_XFRM_FEATURES;
58155825 #endif /* CONFIG_XFRM_OFFLOAD */
5816−#if IS_ENABLED(CONFIG_TLS_DEVICE)
5817− if (bond_sk_check(bond))
5818− bond_dev->features |= BOND_TLS_FEATURES;
5819−#endif
58205826 }
58215827
58225828 /* Destroy a bonding device.
drivers/net/bonding/bond_options.c+0−18
@@ -842,19 +842,6 @@ static bool bond_set_xfrm_features(struct bonding *bond) · 841 unmodified lines
842842 return true;
843843 }
844844
845−static bool bond_set_tls_features(struct bonding *bond)
846−{
847− if (!IS_ENABLED(CONFIG_TLS_DEVICE))
848− return false;
849−
850− if (bond_sk_check(bond))
851− bond->dev->wanted_features |= BOND_TLS_FEATURES;
852− else
853− bond->dev->wanted_features &= ~BOND_TLS_FEATURES;
854−
855− return true;
856−}
857−
858845 static int bond_option_mode_set(struct bonding *bond,
859846 const struct bond_opt_value *newval)
860847 {
@@ -885,7 +872,6 @@ static int bond_option_mode_set(struct bonding *bond, · 24 unmodified lines
885872 bool update = false;
886873
887874 update |= bond_set_xfrm_features(bond);
888− update |= bond_set_tls_features(bond);
889875
890876 if (update)
891877 netdev_update_features(bond->dev);
@@ -1418,10 +1404,6 @@ static int bond_option_xmit_hash_policy_set(struct bonding *bond, · 526 unmodified lines
14181404 newval->string, newval->value);
14191405 bond->params.xmit_policy = newval->value;
14201406
1421− if (bond->dev->reg_state == NETREG_REGISTERED)
1422− if (bond_set_tls_features(bond))
1423− netdev_update_features(bond->dev);
1424−
14251407 return 0;
14261408 }
14271409
drivers/net/can/Kconfig+0−8
@@ -198,14 +198,6 @@ config CAN_XILINXCAN · 197 unmodified lines
198198 Xilinx CAN driver. This driver supports both soft AXI CAN IP and
199199 Zynq CANPS IP.
200200
201−config PCH_CAN
202− tristate "Intel EG20T PCH CAN controller"
203− depends on PCI && (X86_32 || COMPILE_TEST)
204− help
205− This driver is for PCH CAN of Topcliff (Intel EG20T PCH) which
206− is an IOH for x86 embedded processor (Intel Atom E6xx series).
207− This driver can access CAN bus.
208−
209201 source "drivers/net/can/c_can/Kconfig"
210202 source "drivers/net/can/cc770/Kconfig"
211203 source "drivers/net/can/ctucanfd/Kconfig"
drivers/net/can/Makefile+0−1
@@ -30,6 +30,5 @@ obj-$(CONFIG_CAN_SJA1000) += sja1000/ · 29 unmodified lines
3030 obj-$(CONFIG_CAN_SUN4I) += sun4i_can.o
3131 obj-$(CONFIG_CAN_TI_HECC) += ti_hecc.o
3232 obj-$(CONFIG_CAN_XILINXCAN) += xilinx_can.o
33−obj-$(CONFIG_PCH_CAN) += pch_can.o
3433
3534 subdir-ccflags-$(CONFIG_CAN_DEBUG_DEVICES) += -DDEBUG
drivers/net/can/c_can/Kconfig+2−1
@@ -20,5 +20,6 @@ config CAN_C_CAN_PCI · 19 unmodified lines
2020 depends on PCI
2121 help
2222 This driver adds support for the C_CAN/D_CAN chips connected
23− to the PCI bus.
23+ to the PCI bus. E.g. for the C_CAN controller IP inside the
24+ Intel Atom E6xx series IOH (aka EG20T 'PCH CAN').
2425 endif
drivers/net/can/c_can/c_can_platform.c+1−2
@@ -290,8 +290,7 @@ static int c_can_plat_probe(struct platform_device *pdev) · 289 unmodified lines
290290 goto exit;
291291 }
292292
293− mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
294− addr = devm_ioremap_resource(&pdev->dev, mem);
293+ addr = devm_platform_get_and_ioremap_resource(pdev, 0, &mem);
295294 if (IS_ERR(addr)) {
296295 ret = PTR_ERR(addr);
297296 goto exit;
drivers/net/can/ctucanfd/Kconfig+1−1
@@ -23,7 +23,7 @@ config CAN_CTUCANFD_PCI · 22 unmodified lines
2323
2424 config CAN_CTUCANFD_PLATFORM
2525 tristate "CTU CAN-FD IP core platform (FPGA, SoC) driver"
26− depends on HAS_IOMEM && (OF || COMPILE_TEST)
26+ depends on HAS_IOMEM && OF
2727 select CAN_CTUCANFD
2828 help
2929 The core has been tested together with OpenCores SJA1000
drivers/net/can/flexcan/flexcan-core.c+34−3
@@ -345,6 +345,15 @@ static struct flexcan_devtype_data fsl_imx8mp_devtype_data = { · 344 unmodified lines
345345 FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR,
346346 };
347347
348+static struct flexcan_devtype_data fsl_imx93_devtype_data = {
349+ .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
350+ FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_RX_MAILBOX |
351+ FLEXCAN_QUIRK_BROKEN_PERR_STATE | FLEXCAN_QUIRK_AUTO_STOP_MODE |
352+ FLEXCAN_QUIRK_SUPPORT_FD | FLEXCAN_QUIRK_SUPPORT_ECC |
353+ FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX |
354+ FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR,
355+};
356+
348357 static const struct flexcan_devtype_data fsl_vf610_devtype_data = {
349358 .quirks = FLEXCAN_QUIRK_DISABLE_RXFG | FLEXCAN_QUIRK_ENABLE_EACEN_RRS |
350359 FLEXCAN_QUIRK_DISABLE_MECR | FLEXCAN_QUIRK_USE_RX_MAILBOX |
@@ -532,9 +541,14 @@ static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv) · 181 unmodified lines
532541 ret = flexcan_stop_mode_enable_scfw(priv, true);
533542 if (ret < 0)
534543 return ret;
535− } else {
544+ } else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) {
536545 regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
537546 1 << priv->stm.req_bit, 1 << priv->stm.req_bit);
547+ } else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE) {
548+ /* For the auto stop mode, software do nothing, hardware will cover
549+ * all the operation automatically after system go into low power mode.
550+ */
551+ return 0;
538552 }
539553
540554 return flexcan_low_power_enter_ack(priv);
@@ -551,7 +565,7 @@ static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv) · 10 unmodified lines
551565 ret = flexcan_stop_mode_enable_scfw(priv, false);
552566 if (ret < 0)
553567 return ret;
554− } else {
568+ } else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR) {
555569 regmap_update_bits(priv->stm.gpr, priv->stm.req_gpr,
556570 1 << priv->stm.req_bit, 0);
557571 }
@@ -560,6 +574,12 @@ static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv) · 2 unmodified lines
560574 reg_mcr &= ~FLEXCAN_MCR_SLF_WAK;
561575 priv->write(reg_mcr, &regs->mcr);
562576
577+ /* For the auto stop mode, hardware will exist stop mode
578+ * automatically after system go out of low power mode.
579+ */
580+ if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE)
581+ return 0;
582+
563583 return flexcan_low_power_exit_ack(priv);
564584 }
565585
@@ -1974,6 +1994,8 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) · 1408 unmodified lines
19741994 ret = flexcan_setup_stop_mode_scfw(pdev);
19751995 else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR)
19761996 ret = flexcan_setup_stop_mode_gpr(pdev);
1997+ else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE)
1998+ ret = 0;
19771999 else
19782000 /* return 0 directly if doesn't support stop mode feature */
19792001 return 0;
@@ -1992,6 +2014,7 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev) · 12 unmodified lines
19922014 static const struct of_device_id flexcan_of_match[] = {
19932015 { .compatible = "fsl,imx8qm-flexcan", .data = &fsl_imx8qm_devtype_data, },
19942016 { .compatible = "fsl,imx8mp-flexcan", .data = &fsl_imx8mp_devtype_data, },
2017+ { .compatible = "fsl,imx93-flexcan", .data = &fsl_imx93_devtype_data, },
19952018 { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, },
19962019 { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, },
19972020 { .compatible = "fsl,imx53-flexcan", .data = &fsl_imx25_devtype_data, },
@@ -2299,8 +2322,16 @@ static int __maybe_unused flexcan_noirq_suspend(struct device *device) · 301 unmodified lines
22992322 if (netif_running(dev)) {
23002323 int err;
23012324
2302− if (device_may_wakeup(device))
2325+ if (device_may_wakeup(device)) {
23032326 flexcan_enable_wakeup_irq(priv, true);
2327+ /* For auto stop mode, need to keep the clock on before
2328+ * system go into low power mode. After system go into
2329+ * low power mode, hardware will config the flexcan into
2330+ * stop mode, and gate off the clock automatically.
2331+ */
2332+ if (priv->devtype_data.quirks & FLEXCAN_QUIRK_AUTO_STOP_MODE)
2333+ return 0;
2334+ }
23042335
23052336 err = pm_runtime_force_suspend(device);
23062337 if (err)
drivers/net/can/flexcan/flexcan.h+2−0
@@ -68,6 +68,8 @@ · 67 unmodified lines
6868 #define FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR BIT(15)
6969 /* Device supports RX via FIFO */
7070 #define FLEXCAN_QUIRK_SUPPORT_RX_FIFO BIT(16)
71+/* auto enter stop mode to support wakeup */
72+#define FLEXCAN_QUIRK_AUTO_STOP_MODE BIT(17)
7173
7274 struct flexcan_devtype_data {
7375 u32 quirks; /* quirks needed for different IP cores */
drivers/net/can/m_can/m_can.c+102−54
@@ -9,20 +9,20 @@ · 8 unmodified lines
99 */
1010
1111 #include <linux/bitfield.h>
12+#include <linux/can/dev.h>
1213 #include <linux/ethtool.h>
1314 #include <linux/interrupt.h>
1415 #include <linux/io.h>
16+#include <linux/iopoll.h>
1517 #include <linux/kernel.h>
1618 #include <linux/module.h>
1719 #include <linux/netdevice.h>
1820 #include <linux/of.h>
1921 #include <linux/of_device.h>
22+#include <linux/phy/phy.h>
23+#include <linux/pinctrl/consumer.h>
2024 #include <linux/platform_device.h>
2125 #include <linux/pm_runtime.h>
22−#include <linux/iopoll.h>
23−#include <linux/can/dev.h>
24−#include <linux/pinctrl/consumer.h>
25−#include <linux/phy/phy.h>
2626
2727 #include "m_can.h"
2828
@@ -156,6 +156,7 @@ enum m_can_reg { · 127 unmodified lines
156156 #define PSR_EW BIT(6)
157157 #define PSR_EP BIT(5)
158158 #define PSR_LEC_MASK GENMASK(2, 0)
159+#define PSR_DLEC_MASK GENMASK(10, 8)
159160
160161 /* Interrupt Register (IR) */
161162 #define IR_ALL_INT 0xffffffff
@@ -209,7 +210,7 @@ enum m_can_reg { · 47 unmodified lines
209210
210211 /* Interrupts for version >= 3.1.x */
211212 #define IR_ERR_LEC_31X (IR_PED | IR_PEA)
212−#define IR_ERR_BUS_31X (IR_ERR_LEC_31X | IR_WDI | IR_BEU | IR_BEC | \
213+#define IR_ERR_BUS_31X (IR_ERR_LEC_31X | IR_WDI | IR_BEU | IR_BEC | \
213214 IR_TOO | IR_MRAF | IR_TSW | IR_TEFL | IR_RF1L | \
214215 IR_RF0L)
215216 #define IR_ERR_ALL_31X (IR_ERR_STATE | IR_ERR_BUS_31X)
@@ -368,9 +369,14 @@ m_can_txe_fifo_read(struct m_can_classdev *cdev, u32 fgi, u32 offset, u32 *val) · 152 unmodified lines
368369 return cdev->ops->read_fifo(cdev, addr_offset, val, 1);
369370 }
370371
372+static inline bool _m_can_tx_fifo_full(u32 txfqs)
373+{
374+ return !!(txfqs & TXFQS_TFQF);
375+}
376+
371377 static inline bool m_can_tx_fifo_full(struct m_can_classdev *cdev)
372378 {
373− return !!(m_can_read(cdev, M_CAN_TXFQS) & TXFQS_TFQF);
379+ return _m_can_tx_fifo_full(m_can_read(cdev, M_CAN_TXFQS));
374380 }
375381
376382 static void m_can_config_endisable(struct m_can_classdev *cdev, bool enable)
@@ -471,19 +477,16 @@ static void m_can_receive_skb(struct m_can_classdev *cdev, · 94 unmodified lines
471477 }
472478 }
473479
474−static int m_can_read_fifo(struct net_device *dev, u32 rxfs)
480+static int m_can_read_fifo(struct net_device *dev, u32 fgi)
475481 {
476482 struct net_device_stats *stats = &dev->stats;
477483 struct m_can_classdev *cdev = netdev_priv(dev);
478484 struct canfd_frame *cf;
479485 struct sk_buff *skb;
480486 struct id_and_dlc fifo_header;
481− u32 fgi;
482487 u32 timestamp = 0;
483488 int err;
484489
485− /* calculate the fifo get index for where to read data */
486− fgi = FIELD_GET(RXFS_FGI_MASK, rxfs);
487490 err = m_can_fifo_read(cdev, fgi, M_CAN_FIFO_ID, &fifo_header, 2);
488491 if (err)
489492 goto out_fail;
@@ -527,9 +530,6 @@ static int m_can_read_fifo(struct net_device *dev, u32 rxfs) · 37 unmodified lines
527530 }
528531 stats->rx_packets++;
529532
530− /* acknowledge rx fifo 0 */
531− m_can_write(cdev, M_CAN_RXF0A, fgi);
532−
533533 timestamp = FIELD_GET(RX_BUF_RXTS_MASK, fifo_header.dlc) << 16;
534534
535535 m_can_receive_skb(cdev, skb, timestamp);
@@ -548,7 +548,11 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota) · 12 unmodified lines
548548 struct m_can_classdev *cdev = netdev_priv(dev);
549549 u32 pkts = 0;
550550 u32 rxfs;
551− int err;
551+ u32 rx_count;
552+ u32 fgi;
553+ int ack_fgi = -1;
554+ int i;
555+ int err = 0;
552556
553557 rxfs = m_can_read(cdev, M_CAN_RXF0S);
554558 if (!(rxfs & RXFS_FFL_MASK)) {
@@ -556,16 +560,26 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota) · 1 unmodified line
556560 return 0;
557561 }
558562
559− while ((rxfs & RXFS_FFL_MASK) && (quota > 0)) {
560− err = m_can_read_fifo(dev, rxfs);
563+ rx_count = FIELD_GET(RXFS_FFL_MASK, rxfs);
564+ fgi = FIELD_GET(RXFS_FGI_MASK, rxfs);
565+
566+ for (i = 0; i < rx_count && quota > 0; ++i) {
567+ err = m_can_read_fifo(dev, fgi);
561568 if (err)
562− return err;
569+ break;
563570
564571 quota--;
565572 pkts++;
566− rxfs = m_can_read(cdev, M_CAN_RXF0S);
573+ ack_fgi = fgi;
574+ fgi = (++fgi >= cdev->mcfg[MRAM_RXF0].num ? 0 : fgi);
567575 }
568576
577+ if (ack_fgi != -1)
578+ m_can_write(cdev, M_CAN_RXF0A, ack_fgi);
579+
580+ if (err)
581+ return err;
582+
569583 return pkts;
570584 }
571585
@@ -816,11 +830,9 @@ static void m_can_handle_other_err(struct net_device *dev, u32 irqstatus) · 244 unmodified lines
816830 netdev_err(dev, "Message RAM access failure occurred\n");
817831 }
818832
819−static inline bool is_lec_err(u32 psr)
833+static inline bool is_lec_err(u8 lec)
820834 {
821− psr &= LEC_UNUSED;
822−
823− return psr && (psr != LEC_UNUSED);
835+ return lec != LEC_NO_ERROR && lec != LEC_NO_CHANGE;
824836 }
825837
826838 static inline bool m_can_is_protocol_err(u32 irqstatus)
@@ -875,9 +887,20 @@ static int m_can_handle_bus_errors(struct net_device *dev, u32 irqstatus, · 48 unmodified lines
875887 work_done += m_can_handle_lost_msg(dev);
876888
877889 /* handle lec errors on the bus */
878− if ((cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) &&
879− is_lec_err(psr))
880− work_done += m_can_handle_lec_err(dev, psr & LEC_UNUSED);
890+ if (cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) {
891+ u8 lec = FIELD_GET(PSR_LEC_MASK, psr);
892+ u8 dlec = FIELD_GET(PSR_DLEC_MASK, psr);
893+
894+ if (is_lec_err(lec)) {
895+ netdev_dbg(dev, "Arbitration phase error detected\n");
896+ work_done += m_can_handle_lec_err(dev, lec);
897+ }
898+
899+ if (is_lec_err(dlec)) {
900+ netdev_dbg(dev, "Data phase error detected\n");
901+ work_done += m_can_handle_lec_err(dev, dlec);
902+ }
903+ }
881904
882905 /* handle protocol errors in arbitration phase */
883906 if ((cdev->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING) &&
@@ -890,14 +913,12 @@ static int m_can_handle_bus_errors(struct net_device *dev, u32 irqstatus, · 6 unmodified lines
890913 return work_done;
891914 }
892915
893−static int m_can_rx_handler(struct net_device *dev, int quota)
916+static int m_can_rx_handler(struct net_device *dev, int quota, u32 irqstatus)
894917 {
895918 struct m_can_classdev *cdev = netdev_priv(dev);
896919 int rx_work_or_err;
897920 int work_done = 0;
898− u32 irqstatus, psr;
899921
900− irqstatus = cdev->irqstatus | m_can_read(cdev, M_CAN_IR);
901922 if (!irqstatus)
902923 goto end;
903924
@@ -922,13 +943,13 @@ static int m_can_rx_handler(struct net_device *dev, int quota) · 18 unmodified lines
922943 }
923944 }
924945
925− psr = m_can_read(cdev, M_CAN_PSR);
926−
927946 if (irqstatus & IR_ERR_STATE)
928− work_done += m_can_handle_state_errors(dev, psr);
947+ work_done += m_can_handle_state_errors(dev,
948+ m_can_read(cdev, M_CAN_PSR));
929949
930950 if (irqstatus & IR_ERR_BUS_30X)
931− work_done += m_can_handle_bus_errors(dev, irqstatus, psr);
951+ work_done += m_can_handle_bus_errors(dev, irqstatus,
952+ m_can_read(cdev, M_CAN_PSR));
932953
933954 if (irqstatus & IR_RF0N) {
934955 rx_work_or_err = m_can_do_rx_poll(dev, (quota - work_done));
@@ -941,12 +962,12 @@ end: · 6 unmodified lines
941962 return work_done;
942963 }
943964
944−static int m_can_rx_peripheral(struct net_device *dev)
965+static int m_can_rx_peripheral(struct net_device *dev, u32 irqstatus)
945966 {
946967 struct m_can_classdev *cdev = netdev_priv(dev);
947968 int work_done;
948969
949− work_done = m_can_rx_handler(dev, NAPI_POLL_WEIGHT);
970+ work_done = m_can_rx_handler(dev, NAPI_POLL_WEIGHT, irqstatus);
950971
951972 /* Don't re-enable interrupts if the driver had a fatal error
952973 * (e.g., FIFO read failure).
@@ -962,8 +983,11 @@ static int m_can_poll(struct napi_struct *napi, int quota) · 9 unmodified lines
962983 struct net_device *dev = napi->dev;
963984 struct m_can_classdev *cdev = netdev_priv(dev);
964985 int work_done;
986+ u32 irqstatus;
987+
988+ irqstatus = cdev->irqstatus | m_can_read(cdev, M_CAN_IR);
965989
966− work_done = m_can_rx_handler(dev, quota);
990+ work_done = m_can_rx_handler(dev, quota, irqstatus);
967991
968992 /* Don't re-enable interrupts if the driver had a fatal error
969993 * (e.g., FIFO read failure).
@@ -1004,7 +1028,9 @@ static int m_can_echo_tx_event(struct net_device *dev) · 34 unmodified lines
10041028 u32 txe_count = 0;
10051029 u32 m_can_txefs;
10061030 u32 fgi = 0;
1031+ int ack_fgi = -1;
10071032 int i = 0;
1033+ int err = 0;
10081034 unsigned int msg_mark;
10091035
10101036 struct m_can_classdev *cdev = netdev_priv(dev);
@@ -1014,34 +1040,34 @@ static int m_can_echo_tx_event(struct net_device *dev) · 3 unmodified lines
10141040
10151041 /* Get Tx Event fifo element count */
10161042 txe_count = FIELD_GET(TXEFS_EFFL_MASK, m_can_txefs);
1043+ fgi = FIELD_GET(TXEFS_EFGI_MASK, m_can_txefs);
10171044
10181045 /* Get and process all sent elements */
10191046 for (i = 0; i < txe_count; i++) {
10201047 u32 txe, timestamp = 0;
1021− int err;
1022−
1023− /* retrieve get index */
1024− fgi = FIELD_GET(TXEFS_EFGI_MASK, m_can_read(cdev, M_CAN_TXEFS));
10251048
10261049 /* get message marker, timestamp */
10271050 err = m_can_txe_fifo_read(cdev, fgi, 4, &txe);
10281051 if (err) {
10291052 netdev_err(dev, "TXE FIFO read returned %d\n", err);
1030− return err;
1053+ break;
10311054 }
10321055
10331056 msg_mark = FIELD_GET(TX_EVENT_MM_MASK, txe);
10341057 timestamp = FIELD_GET(TX_EVENT_TXTS_MASK, txe) << 16;
10351058
1036− /* ack txe element */
1037− m_can_write(cdev, M_CAN_TXEFA, FIELD_PREP(TXEFA_EFAI_MASK,
1038− fgi));
1059+ ack_fgi = fgi;
1060+ fgi = (++fgi >= cdev->mcfg[MRAM_TXE].num ? 0 : fgi);
10391061
10401062 /* update stats */
10411063 m_can_tx_update_stats(cdev, msg_mark, timestamp);
10421064 }
10431065
1044− return 0;
1066+ if (ack_fgi != -1)
1067+ m_can_write(cdev, M_CAN_TXEFA, FIELD_PREP(TXEFA_EFAI_MASK,
1068+ ack_fgi));
1069+
1070+ return err;
10451071 }
10461072
10471073 static irqreturn_t m_can_isr(int irq, void *dev_id)
@@ -1073,7 +1099,7 @@ static irqreturn_t m_can_isr(int irq, void *dev_id) · 25 unmodified lines
10731099 m_can_disable_all_interrupts(cdev);
10741100 if (!cdev->is_peripheral)
10751101 napi_schedule(&cdev->napi);
1076− else if (m_can_rx_peripheral(dev) < 0)
1102+ else if (m_can_rx_peripheral(dev, ir) < 0)
10771103 goto out_fail;
10781104 }
10791105
@@ -1233,10 +1259,17 @@ static int m_can_set_bittiming(struct net_device *dev) · 153 unmodified lines
12331259 * - setup bittiming
12341260 * - configure timestamp generation
12351261 */
1236−static void m_can_chip_config(struct net_device *dev)
1262+static int m_can_chip_config(struct net_device *dev)
12371263 {
12381264 struct m_can_classdev *cdev = netdev_priv(dev);
12391265 u32 cccr, test;
1266+ int err;
1267+
1268+ err = m_can_init_ram(cdev);
1269+ if (err) {
1270+ dev_err(cdev->dev, "Message RAM configuration failed\n");
1271+ return err;
1272+ }
12401273
12411274 m_can_config_endisable(cdev, true);
12421275
@@ -1360,18 +1393,25 @@ static void m_can_chip_config(struct net_device *dev) · 117 unmodified lines
13601393
13611394 if (cdev->ops->init)
13621395 cdev->ops->init(cdev);
1396+
1397+ return 0;
13631398 }
13641399
1365−static void m_can_start(struct net_device *dev)
1400+static int m_can_start(struct net_device *dev)
13661401 {
13671402 struct m_can_classdev *cdev = netdev_priv(dev);
1403+ int ret;
13681404
13691405 /* basic m_can configuration */
1370− m_can_chip_config(dev);
1406+ ret = m_can_chip_config(dev);
1407+ if (ret)
1408+ return ret;
13711409
13721410 cdev->can.state = CAN_STATE_ERROR_ACTIVE;
13731411
13741412 m_can_enable_all_interrupts(cdev);
1413+
1414+ return 0;
13751415 }
13761416
13771417 static int m_can_set_mode(struct net_device *dev, enum can_mode mode)
@@ -1585,6 +1625,7 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev) · 207 unmodified lines
15851625 struct sk_buff *skb = cdev->tx_skb;
15861626 struct id_and_dlc fifo_header;
15871627 u32 cccr, fdflags;
1628+ u32 txfqs;
15881629 int err;
15891630 int putidx;
15901631
@@ -1641,8 +1682,10 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev) · 50 unmodified lines
16411682 } else {
16421683 /* Transmit routine for version >= v3.1.x */
16431684
1685+ txfqs = m_can_read(cdev, M_CAN_TXFQS);
1686+
16441687 /* Check if FIFO full */
1645− if (m_can_tx_fifo_full(cdev)) {
1688+ if (_m_can_tx_fifo_full(txfqs)) {
16461689 /* This shouldn't happen */
16471690 netif_stop_queue(dev);
16481691 netdev_warn(dev,
@@ -1658,8 +1701,7 @@ static netdev_tx_t m_can_tx_handler(struct m_can_classdev *cdev) · 9 unmodified lines
16581701 }
16591702
16601703 /* get put index for frame */
1661− putidx = FIELD_GET(TXFQS_TFQPI_MASK,
1662− m_can_read(cdev, M_CAN_TXFQS));
1704+ putidx = FIELD_GET(TXFQS_TFQPI_MASK, txfqs);
16631705
16641706 /* Construct DLC Field, with CAN-FD configuration.
16651707 * Use the put index of the fifo as the message marker,
@@ -1799,7 +1841,9 @@ static int m_can_open(struct net_device *dev) · 133 unmodified lines
17991841 }
18001842
18011843 /* start the m_can controller */
1802− m_can_start(dev);
1844+ err = m_can_start(dev);
1845+ if (err)
1846+ goto exit_irq_fail;
18031847
18041848 if (!cdev->is_peripheral)
18051849 napi_enable(&cdev->napi);
@@ -2058,9 +2102,13 @@ int m_can_class_resume(struct device *dev) · 252 unmodified lines
20582102 ret = m_can_clk_start(cdev);
20592103 if (ret)
20602104 return ret;
2105+ ret = m_can_start(ndev);
2106+ if (ret) {
2107+ m_can_clk_stop(cdev);
2108+
2109+ return ret;
2110+ }
20612111
2062− m_can_init_ram(cdev);
2063− m_can_start(ndev);
20642112 netif_device_attach(ndev);
20652113 netif_start_queue(ndev);
20662114 }
drivers/net/can/m_can/m_can.h+9−9
@@ -7,27 +7,27 @@ · 6 unmodified lines
77 #define _CAN_M_CAN_H_
88
99 #include <linux/can/core.h>
10+#include <linux/can/dev.h>
1011 #include <linux/can/rx-offload.h>
12+#include <linux/clk.h>
1113 #include <linux/completion.h>
14+#include <linux/delay.h>
1215 #include <linux/device.h>
1316 #include <linux/dma-mapping.h>
1417 #include <linux/freezer.h>
15−#include <linux/slab.h>
16−#include <linux/uaccess.h>
17−#include <linux/clk.h>
18−#include <linux/delay.h>
1918 #include <linux/interrupt.h>
2019 #include <linux/io.h>
20+#include <linux/iopoll.h>
2121 #include <linux/kernel.h>
2222 #include <linux/module.h>
2323 #include <linux/netdevice.h>
2424 #include <linux/of.h>
2525 #include <linux/of_device.h>
26−#include <linux/pm_runtime.h>
27−#include <linux/iopoll.h>
28−#include <linux/can/dev.h>
29−#include <linux/pinctrl/consumer.h>
3026 #include <linux/phy/phy.h>
27+#include <linux/pinctrl/consumer.h>
28+#include <linux/pm_runtime.h>
29+#include <linux/slab.h>
30+#include <linux/uaccess.h>
3131
3232 /* m_can lec values */
3333 enum m_can_lec_type {
@@ -38,7 +38,7 @@ enum m_can_lec_type { · 4 unmodified lines
3838 LEC_BIT1_ERROR,
3939 LEC_BIT0_ERROR,
4040 LEC_CRC_ERROR,
41− LEC_UNUSED,
41+ LEC_NO_CHANGE,
4242 };
4343
4444 enum m_can_mram_cfg {
drivers/net/can/m_can/m_can_platform.c+1−5
@@ -5,8 +5,8 @@ · 4 unmodified lines
55 //
66 // Copyright (C) 2018-19 Texas Instruments Incorporated - http://www.ti.com/
77
8−#include <linux/platform_device.h>
98 #include <linux/phy/phy.h>
9+#include <linux/platform_device.h>
1010
1111 #include "m_can.h"
1212
@@ -140,10 +140,6 @@ static int m_can_plat_probe(struct platform_device *pdev) · 127 unmodified lines
140140
141141 platform_set_drvdata(pdev, mcan_class);
142142
143− ret = m_can_init_ram(mcan_class);
144− if (ret)
145− goto probe_fail;
146−
147143 pm_runtime_enable(mcan_class->dev);
148144 ret = m_can_class_register(mcan_class);
149145 if (ret)
drivers/net/can/m_can/tcan4x5x-core.c+4−14
@@ -10,7 +10,7 @@ · 9 unmodified lines
1010 #define TCAN4X5X_DEV_ID1 0x04
1111 #define TCAN4X5X_REV 0x08
1212 #define TCAN4X5X_STATUS 0x0C
13−#define TCAN4X5X_ERROR_STATUS 0x10
13+#define TCAN4X5X_ERROR_STATUS_MASK 0x10
1414 #define TCAN4X5X_CONTROL 0x14
1515
1616 #define TCAN4X5X_CONFIG 0x800
@@ -204,17 +204,7 @@ static int tcan4x5x_clear_interrupts(struct m_can_classdev *cdev) · 187 unmodified lines
204204 if (ret)
205205 return ret;
206206
207− ret = tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_MCAN_INT_REG,
208− TCAN4X5X_ENABLE_MCAN_INT);
209− if (ret)
210− return ret;
211−
212− ret = tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_INT_FLAGS,
213− TCAN4X5X_CLEAR_ALL_INT);
214− if (ret)
215− return ret;
216−
217− return tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_ERROR_STATUS,
207+ return tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_INT_FLAGS,
218208 TCAN4X5X_CLEAR_ALL_INT);
219209 }
220210
@@ -234,8 +224,8 @@ static int tcan4x5x_init(struct m_can_classdev *cdev) · 13 unmodified lines
234224 if (ret)
235225 return ret;
236226
237− /* Zero out the MCAN buffers */
238− ret = m_can_init_ram(cdev);
227+ ret = tcan4x5x_write_tcan_reg(cdev, TCAN4X5X_ERROR_STATUS_MASK,
228+ TCAN4X5X_CLEAR_ALL_INT);
239229 if (ret)
240230 return ret;
241231
drivers/net/can/m_can/tcan4x5x-regmap.c+39−8
@@ -90,16 +90,47 @@ static int tcan4x5x_regmap_read(void *context, · 89 unmodified lines
9090 return 0;
9191 }
9292
93−static const struct regmap_range tcan4x5x_reg_table_yes_range[] = {
94− regmap_reg_range(0x0000, 0x002c), /* Device ID and SPI Registers */
95− regmap_reg_range(0x0800, 0x083c), /* Device configuration registers and Interrupt Flags*/
93+static const struct regmap_range tcan4x5x_reg_table_wr_range[] = {
94+ /* Device ID and SPI Registers */
95+ regmap_reg_range(0x000c, 0x0010),
96+ /* Device configuration registers and Interrupt Flags*/
97+ regmap_reg_range(0x0800, 0x080c),
98+ regmap_reg_range(0x0814, 0x0814),
99+ regmap_reg_range(0x0820, 0x0820),
100+ regmap_reg_range(0x0830, 0x0830),
101+ /* M_CAN */
102+ regmap_reg_range(0x100c, 0x102c),
103+ regmap_reg_range(0x1048, 0x1048),
104+ regmap_reg_range(0x1050, 0x105c),
105+ regmap_reg_range(0x1080, 0x1088),
106+ regmap_reg_range(0x1090, 0x1090),
107+ regmap_reg_range(0x1098, 0x10a0),
108+ regmap_reg_range(0x10a8, 0x10b0),
109+ regmap_reg_range(0x10b8, 0x10c0),
110+ regmap_reg_range(0x10c8, 0x10c8),
111+ regmap_reg_range(0x10d0, 0x10d4),
112+ regmap_reg_range(0x10e0, 0x10e4),
113+ regmap_reg_range(0x10f0, 0x10f0),
114+ regmap_reg_range(0x10f8, 0x10f8),
115+ /* MRAM */
116+ regmap_reg_range(0x8000, 0x87fc),
117+};
118+
119+static const struct regmap_range tcan4x5x_reg_table_rd_range[] = {
120+ regmap_reg_range(0x0000, 0x0010), /* Device ID and SPI Registers */
121+ regmap_reg_range(0x0800, 0x0830), /* Device configuration registers and Interrupt Flags*/
96122 regmap_reg_range(0x1000, 0x10fc), /* M_CAN */
97123 regmap_reg_range(0x8000, 0x87fc), /* MRAM */
98124 };
99125
100−static const struct regmap_access_table tcan4x5x_reg_table = {
101− .yes_ranges = tcan4x5x_reg_table_yes_range,
102− .n_yes_ranges = ARRAY_SIZE(tcan4x5x_reg_table_yes_range),
126+static const struct regmap_access_table tcan4x5x_reg_table_wr = {
127+ .yes_ranges = tcan4x5x_reg_table_wr_range,
128+ .n_yes_ranges = ARRAY_SIZE(tcan4x5x_reg_table_wr_range),
129+};
130+
131+static const struct regmap_access_table tcan4x5x_reg_table_rd = {
132+ .yes_ranges = tcan4x5x_reg_table_rd_range,
133+ .n_yes_ranges = ARRAY_SIZE(tcan4x5x_reg_table_rd_range),
103134 };
104135
105136 static const struct regmap_config tcan4x5x_regmap = {
@@ -107,8 +138,8 @@ static const struct regmap_config tcan4x5x_regmap = { · 1 unmodified line
107138 .reg_stride = 4,
108139 .pad_bits = 8,
109140 .val_bits = 32,
110− .wr_table = &tcan4x5x_reg_table,
111− .rd_table = &tcan4x5x_reg_table,
141+ .wr_table = &tcan4x5x_reg_table_wr,
142+ .rd_table = &tcan4x5x_reg_table_rd,
112143 .max_register = TCAN4X5X_MAX_REGISTER,
113144 .cache_type = REGCACHE_NONE,
114145 .read_flag_mask = (__force unsigned long)
drivers/net/can/pch_can.c+0−1249
@@ -1,1249 +0,0 @@
1−// SPDX-License-Identifier: GPL-2.0-only
2−/*
3− * Copyright (C) 1999 - 2010 Intel Corporation.
4− * Copyright (C) 2010 LAPIS SEMICONDUCTOR CO., LTD.
5− */
6−
7−#include <linux/interrupt.h>
8−#include <linux/delay.h>
9−#include <linux/ethtool.h>
10−#include <linux/io.h>
11−#include <linux/module.h>
12−#include <linux/sched.h>
13−#include <linux/pci.h>
14−#include <linux/kernel.h>
15−#include <linux/types.h>
16−#include <linux/errno.h>
17−#include <linux/netdevice.h>
18−#include <linux/skbuff.h>
19−#include <linux/can.h>
20−#include <linux/can/dev.h>
21−#include <linux/can/error.h>
22−
23−#define PCH_CTRL_INIT BIT(0) /* The INIT bit of CANCONT register. */
24−#define PCH_CTRL_IE BIT(1) /* The IE bit of CAN control register */
25−#define PCH_CTRL_IE_SIE_EIE (BIT(3) | BIT(2) | BIT(1))
26−#define PCH_CTRL_CCE BIT(6)
27−#define PCH_CTRL_OPT BIT(7) /* The OPT bit of CANCONT register. */
28−#define PCH_OPT_SILENT BIT(3) /* The Silent bit of CANOPT reg. */
29−#define PCH_OPT_LBACK BIT(4) /* The LoopBack bit of CANOPT reg. */
30−
31−#define PCH_CMASK_RX_TX_SET 0x00f3
32−#define PCH_CMASK_RX_TX_GET 0x0073
33−#define PCH_CMASK_ALL 0xff
34−#define PCH_CMASK_NEWDAT BIT(2)
35−#define PCH_CMASK_CLRINTPND BIT(3)
36−#define PCH_CMASK_CTRL BIT(4)
37−#define PCH_CMASK_ARB BIT(5)
38−#define PCH_CMASK_MASK BIT(6)
39−#define PCH_CMASK_RDWR BIT(7)
40−#define PCH_IF_MCONT_NEWDAT BIT(15)
41−#define PCH_IF_MCONT_MSGLOST BIT(14)
42−#define PCH_IF_MCONT_INTPND BIT(13)
43−#define PCH_IF_MCONT_UMASK BIT(12)
44−#define PCH_IF_MCONT_TXIE BIT(11)
45−#define PCH_IF_MCONT_RXIE BIT(10)
46−#define PCH_IF_MCONT_RMTEN BIT(9)
47−#define PCH_IF_MCONT_TXRQXT BIT(8)
48−#define PCH_IF_MCONT_EOB BIT(7)
49−#define PCH_IF_MCONT_DLC (BIT(0) | BIT(1) | BIT(2) | BIT(3))
50−#define PCH_MASK2_MDIR_MXTD (BIT(14) | BIT(15))
51−#define PCH_ID2_DIR BIT(13)
52−#define PCH_ID2_XTD BIT(14)
53−#define PCH_ID_MSGVAL BIT(15)
54−#define PCH_IF_CREQ_BUSY BIT(15)
55−
56−#define PCH_STATUS_INT 0x8000
57−#define PCH_RP 0x00008000
58−#define PCH_REC 0x00007f00
59−#define PCH_TEC 0x000000ff
60−
61−#define PCH_TX_OK BIT(3)
62−#define PCH_RX_OK BIT(4)
63−#define PCH_EPASSIV BIT(5)
64−#define PCH_EWARN BIT(6)
65−#define PCH_BUS_OFF BIT(7)
66−
67−/* bit position of certain controller bits. */
68−#define PCH_BIT_BRP_SHIFT 0
69−#define PCH_BIT_SJW_SHIFT 6
70−#define PCH_BIT_TSEG1_SHIFT 8
71−#define PCH_BIT_TSEG2_SHIFT 12
72−#define PCH_BIT_BRPE_BRPE_SHIFT 6
73−
74−#define PCH_MSK_BITT_BRP 0x3f
75−#define PCH_MSK_BRPE_BRPE 0x3c0
76−#define PCH_MSK_CTRL_IE_SIE_EIE 0x07
77−#define PCH_COUNTER_LIMIT 10
78−
79−#define PCH_CAN_CLK 50000000 /* 50MHz */
80−
81−/*
82− * Define the number of message object.
83− * PCH CAN communications are done via Message RAM.
84− * The Message RAM consists of 32 message objects.
85− */
86−#define PCH_RX_OBJ_NUM 26
87−#define PCH_TX_OBJ_NUM 6
88−#define PCH_RX_OBJ_START 1
89−#define PCH_RX_OBJ_END PCH_RX_OBJ_NUM
90−#define PCH_TX_OBJ_START (PCH_RX_OBJ_END + 1)
91−#define PCH_TX_OBJ_END (PCH_RX_OBJ_NUM + PCH_TX_OBJ_NUM)
92−
93−#define PCH_FIFO_THRESH 16
94−
95−/* TxRqst2 show status of MsgObjNo.17~32 */
96−#define PCH_TREQ2_TX_MASK (((1 << PCH_TX_OBJ_NUM) - 1) <<\
97− (PCH_RX_OBJ_END - 16))
98−
99−enum pch_ifreg {
100− PCH_RX_IFREG,
101− PCH_TX_IFREG,
102−};
103−
104−enum pch_can_err {
105− PCH_STUF_ERR = 1,
106− PCH_FORM_ERR,
107− PCH_ACK_ERR,
108− PCH_BIT1_ERR,
109− PCH_BIT0_ERR,
110− PCH_CRC_ERR,
111− PCH_LEC_ALL,
112−};
113−
114−enum pch_can_mode {
115− PCH_CAN_ENABLE,
116− PCH_CAN_DISABLE,
117− PCH_CAN_ALL,
118− PCH_CAN_NONE,
119− PCH_CAN_STOP,
120− PCH_CAN_RUN,
121−};
122−
123−struct pch_can_if_regs {
124− u32 creq;
125− u32 cmask;
126− u32 mask1;
127− u32 mask2;
128− u32 id1;
129− u32 id2;
130− u32 mcont;
131− u32 data[4];
132− u32 rsv[13];
133−};
134−
135−struct pch_can_regs {
136− u32 cont;
137− u32 stat;
138− u32 errc;
139− u32 bitt;
140− u32 intr;
141− u32 opt;
142− u32 brpe;
143− u32 reserve;
144− struct pch_can_if_regs ifregs[2]; /* [0]=if1 [1]=if2 */
145− u32 reserve1[8];
146− u32 treq1;
147− u32 treq2;
148− u32 reserve2[6];
149− u32 data1;
150− u32 data2;
151− u32 reserve3[6];
152− u32 canipend1;
153− u32 canipend2;
154− u32 reserve4[6];
155− u32 canmval1;
156− u32 canmval2;
157− u32 reserve5[37];
158− u32 srst;
159−};
160−
161−struct pch_can_priv {
162− struct can_priv can;
163− struct pci_dev *dev;
164− u32 tx_enable[PCH_TX_OBJ_END];
165− u32 rx_enable[PCH_TX_OBJ_END];
166− u32 rx_link[PCH_TX_OBJ_END];
167− u32 int_enables;
168− struct net_device *ndev;
169− struct pch_can_regs __iomem *regs;
170− struct napi_struct napi;
171− int tx_obj; /* Point next Tx Obj index */
172− int use_msi;
173−};
174−
175−static const struct can_bittiming_const pch_can_bittiming_const = {
176− .name = KBUILD_MODNAME,
177− .tseg1_min = 2,
178− .tseg1_max = 16,
179− .tseg2_min = 1,
180− .tseg2_max = 8,
181− .sjw_max = 4,
182− .brp_min = 1,
183− .brp_max = 1024, /* 6bit + extended 4bit */
184− .brp_inc = 1,
185−};
186−
187−static const struct pci_device_id pch_pci_tbl[] = {
188− {PCI_VENDOR_ID_INTEL, 0x8818, PCI_ANY_ID, PCI_ANY_ID,},
189− {0,}
190−};
191−MODULE_DEVICE_TABLE(pci, pch_pci_tbl);
192−
193−static inline void pch_can_bit_set(void __iomem *addr, u32 mask)
194−{
195− iowrite32(ioread32(addr) | mask, addr);
196−}
197−
198−static inline void pch_can_bit_clear(void __iomem *addr, u32 mask)
199−{
200− iowrite32(ioread32(addr) & ~mask, addr);
201−}
202−
203−static void pch_can_set_run_mode(struct pch_can_priv *priv,
204− enum pch_can_mode mode)
205−{
206− switch (mode) {
207− case PCH_CAN_RUN:
208− pch_can_bit_clear(&priv->regs->cont, PCH_CTRL_INIT);
209− break;
210−
211− case PCH_CAN_STOP:
212− pch_can_bit_set(&priv->regs->cont, PCH_CTRL_INIT);
213− break;
214−
215− default:
216− netdev_err(priv->ndev, "%s -> Invalid Mode.\n", __func__);
217− break;
218− }
219−}
220−
221−static void pch_can_set_optmode(struct pch_can_priv *priv)
222−{
223− u32 reg_val = ioread32(&priv->regs->opt);
224−
225− if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
226− reg_val |= PCH_OPT_SILENT;
227−
228− if (priv->can.ctrlmode & CAN_CTRLMODE_LOOPBACK)
229− reg_val |= PCH_OPT_LBACK;
230−
231− pch_can_bit_set(&priv->regs->cont, PCH_CTRL_OPT);
232− iowrite32(reg_val, &priv->regs->opt);
233−}
234−
235−static void pch_can_rw_msg_obj(void __iomem *creq_addr, u32 num)
236−{
237− int counter = PCH_COUNTER_LIMIT;
238− u32 ifx_creq;
239−
240− iowrite32(num, creq_addr);
241− while (counter) {
242− ifx_creq = ioread32(creq_addr) & PCH_IF_CREQ_BUSY;
243− if (!ifx_creq)
244− break;
245− counter--;
246− udelay(1);
247− }
248− if (!counter)
249− pr_err("%s:IF1 BUSY Flag is set forever.\n", __func__);
250−}
251−
252−static void pch_can_set_int_enables(struct pch_can_priv *priv,
253− enum pch_can_mode interrupt_no)
254−{
255− switch (interrupt_no) {
256− case PCH_CAN_DISABLE:
257− pch_can_bit_clear(&priv->regs->cont, PCH_CTRL_IE);
258− break;
259−
260− case PCH_CAN_ALL:
261− pch_can_bit_set(&priv->regs->cont, PCH_CTRL_IE_SIE_EIE);
262− break;
263−
264− case PCH_CAN_NONE:
265− pch_can_bit_clear(&priv->regs->cont, PCH_CTRL_IE_SIE_EIE);
266− break;
267−
268− default:
269− netdev_err(priv->ndev, "Invalid interrupt number.\n");
270− break;
271− }
272−}
273−
274−static void pch_can_set_rxtx(struct pch_can_priv *priv, u32 buff_num,
275− int set, enum pch_ifreg dir)
276−{
277− u32 ie;
278−
279− if (dir)
280− ie = PCH_IF_MCONT_TXIE;
281− else
282− ie = PCH_IF_MCONT_RXIE;
283−
284− /* Reading the Msg buffer from Message RAM to IF1/2 registers. */
285− iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[dir].cmask);
286− pch_can_rw_msg_obj(&priv->regs->ifregs[dir].creq, buff_num);
287−
288− /* Setting the IF1/2MASK1 register to access MsgVal and RxIE bits */
289− iowrite32(PCH_CMASK_RDWR | PCH_CMASK_ARB | PCH_CMASK_CTRL,
290− &priv->regs->ifregs[dir].cmask);
291−
292− if (set) {
293− /* Setting the MsgVal and RxIE/TxIE bits */
294− pch_can_bit_set(&priv->regs->ifregs[dir].mcont, ie);
295− pch_can_bit_set(&priv->regs->ifregs[dir].id2, PCH_ID_MSGVAL);
296− } else {
297− /* Clearing the MsgVal and RxIE/TxIE bits */
298− pch_can_bit_clear(&priv->regs->ifregs[dir].mcont, ie);
299− pch_can_bit_clear(&priv->regs->ifregs[dir].id2, PCH_ID_MSGVAL);
300− }
301−
302− pch_can_rw_msg_obj(&priv->regs->ifregs[dir].creq, buff_num);
303−}
304−
305−static void pch_can_set_rx_all(struct pch_can_priv *priv, int set)
306−{
307− int i;
308−
309− /* Traversing to obtain the object configured as receivers. */
310− for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++)
311− pch_can_set_rxtx(priv, i, set, PCH_RX_IFREG);
312−}
313−
314−static void pch_can_set_tx_all(struct pch_can_priv *priv, int set)
315−{
316− int i;
317−
318− /* Traversing to obtain the object configured as transmit object. */
319− for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++)
320− pch_can_set_rxtx(priv, i, set, PCH_TX_IFREG);
321−}
322−
323−static u32 pch_can_int_pending(struct pch_can_priv *priv)
324−{
325− return ioread32(&priv->regs->intr) & 0xffff;
326−}
327−
328−static void pch_can_clear_if_buffers(struct pch_can_priv *priv)
329−{
330− int i; /* Msg Obj ID (1~32) */
331−
332− for (i = PCH_RX_OBJ_START; i <= PCH_TX_OBJ_END; i++) {
333− iowrite32(PCH_CMASK_RX_TX_SET, &priv->regs->ifregs[0].cmask);
334− iowrite32(0xffff, &priv->regs->ifregs[0].mask1);
335− iowrite32(0xffff, &priv->regs->ifregs[0].mask2);
336− iowrite32(0x0, &priv->regs->ifregs[0].id1);
337− iowrite32(0x0, &priv->regs->ifregs[0].id2);
338− iowrite32(0x0, &priv->regs->ifregs[0].mcont);
339− iowrite32(0x0, &priv->regs->ifregs[0].data[0]);
340− iowrite32(0x0, &priv->regs->ifregs[0].data[1]);
341− iowrite32(0x0, &priv->regs->ifregs[0].data[2]);
342− iowrite32(0x0, &priv->regs->ifregs[0].data[3]);
343− iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
344− PCH_CMASK_ARB | PCH_CMASK_CTRL,
345− &priv->regs->ifregs[0].cmask);
346− pch_can_rw_msg_obj(&priv->regs->ifregs[0].creq, i);
347− }
348−}
349−
350−static void pch_can_config_rx_tx_buffers(struct pch_can_priv *priv)
351−{
352− int i;
353−
354− for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) {
355− iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
356− pch_can_rw_msg_obj(&priv->regs->ifregs[0].creq, i);
357−
358− iowrite32(0x0, &priv->regs->ifregs[0].id1);
359− iowrite32(0x0, &priv->regs->ifregs[0].id2);
360−
361− pch_can_bit_set(&priv->regs->ifregs[0].mcont,
362− PCH_IF_MCONT_UMASK);
363−
364− /* In case FIFO mode, Last EoB of Rx Obj must be 1 */
365− if (i == PCH_RX_OBJ_END)
366− pch_can_bit_set(&priv->regs->ifregs[0].mcont,
367− PCH_IF_MCONT_EOB);
368− else
369− pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
370− PCH_IF_MCONT_EOB);
371−
372− iowrite32(0, &priv->regs->ifregs[0].mask1);
373− pch_can_bit_clear(&priv->regs->ifregs[0].mask2,
374− 0x1fff | PCH_MASK2_MDIR_MXTD);
375−
376− /* Setting CMASK for writing */
377− iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK | PCH_CMASK_ARB |
378− PCH_CMASK_CTRL, &priv->regs->ifregs[0].cmask);
379−
380− pch_can_rw_msg_obj(&priv->regs->ifregs[0].creq, i);
381− }
382−
383− for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++) {
384− iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[1].cmask);
385− pch_can_rw_msg_obj(&priv->regs->ifregs[1].creq, i);
386−
387− /* Resetting DIR bit for reception */
388− iowrite32(0x0, &priv->regs->ifregs[1].id1);
389− iowrite32(PCH_ID2_DIR, &priv->regs->ifregs[1].id2);
390−
391− /* Setting EOB bit for transmitter */
392− iowrite32(PCH_IF_MCONT_EOB | PCH_IF_MCONT_UMASK,
393− &priv->regs->ifregs[1].mcont);
394−
395− iowrite32(0, &priv->regs->ifregs[1].mask1);
396− pch_can_bit_clear(&priv->regs->ifregs[1].mask2, 0x1fff);
397−
398− /* Setting CMASK for writing */
399− iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK | PCH_CMASK_ARB |
400− PCH_CMASK_CTRL, &priv->regs->ifregs[1].cmask);
401−
402− pch_can_rw_msg_obj(&priv->regs->ifregs[1].creq, i);
403− }
404−}
405−
406−static void pch_can_init(struct pch_can_priv *priv)
407−{
408− /* Stopping the Can device. */
409− pch_can_set_run_mode(priv, PCH_CAN_STOP);
410−
411− /* Clearing all the message object buffers. */
412− pch_can_clear_if_buffers(priv);
413−
414− /* Configuring the respective message object as either rx/tx object. */
415− pch_can_config_rx_tx_buffers(priv);
416−
417− /* Enabling the interrupts. */
418− pch_can_set_int_enables(priv, PCH_CAN_ALL);
419−}
420−
421−static void pch_can_release(struct pch_can_priv *priv)
422−{
423− /* Stooping the CAN device. */
424− pch_can_set_run_mode(priv, PCH_CAN_STOP);
425−
426− /* Disabling the interrupts. */
427− pch_can_set_int_enables(priv, PCH_CAN_NONE);
428−
429− /* Disabling all the receive object. */
430− pch_can_set_rx_all(priv, 0);
431−
432− /* Disabling all the transmit object. */
433− pch_can_set_tx_all(priv, 0);
434−}
435−
436−/* This function clears interrupt(s) from the CAN device. */
437−static void pch_can_int_clr(struct pch_can_priv *priv, u32 mask)
438−{
439− /* Clear interrupt for transmit object */
440− if ((mask >= PCH_RX_OBJ_START) && (mask <= PCH_RX_OBJ_END)) {
441− /* Setting CMASK for clearing the reception interrupts. */
442− iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL | PCH_CMASK_ARB,
443− &priv->regs->ifregs[0].cmask);
444−
445− /* Clearing the Dir bit. */
446− pch_can_bit_clear(&priv->regs->ifregs[0].id2, PCH_ID2_DIR);
447−
448− /* Clearing NewDat & IntPnd */
449− pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
450− PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_INTPND);
451−
452− pch_can_rw_msg_obj(&priv->regs->ifregs[0].creq, mask);
453− } else if ((mask >= PCH_TX_OBJ_START) && (mask <= PCH_TX_OBJ_END)) {
454− /*
455− * Setting CMASK for clearing interrupts for frame transmission.
456− */
457− iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL | PCH_CMASK_ARB,
458− &priv->regs->ifregs[1].cmask);
459−
460− /* Resetting the ID registers. */
461− pch_can_bit_set(&priv->regs->ifregs[1].id2,
462− PCH_ID2_DIR | (0x7ff << 2));
463− iowrite32(0x0, &priv->regs->ifregs[1].id1);
464−
465− /* Clearing NewDat, TxRqst & IntPnd */
466− pch_can_bit_clear(&priv->regs->ifregs[1].mcont,
467− PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_INTPND |
468− PCH_IF_MCONT_TXRQXT);
469− pch_can_rw_msg_obj(&priv->regs->ifregs[1].creq, mask);
470− }
471−}
472−
473−static void pch_can_reset(struct pch_can_priv *priv)
474−{
475− /* write to sw reset register */
476− iowrite32(1, &priv->regs->srst);
477− iowrite32(0, &priv->regs->srst);
478−}
479−
480−static void pch_can_error(struct net_device *ndev, u32 status)
481−{
482− struct sk_buff *skb;
483− struct pch_can_priv *priv = netdev_priv(ndev);
484− struct can_frame *cf;
485− u32 errc, lec;
486− struct net_device_stats *stats = &(priv->ndev->stats);
487− enum can_state state = priv->can.state;
488−
489− skb = alloc_can_err_skb(ndev, &cf);
490− if (!skb)
491− return;
492−
493− errc = ioread32(&priv->regs->errc);
494− if (status & PCH_BUS_OFF) {
495− pch_can_set_tx_all(priv, 0);
496− pch_can_set_rx_all(priv, 0);
497− state = CAN_STATE_BUS_OFF;
498− cf->can_id |= CAN_ERR_BUSOFF;
499− priv->can.can_stats.bus_off++;
500− can_bus_off(ndev);
501− } else {
502− cf->can_id |= CAN_ERR_CNT;
503− cf->data[6] = errc & PCH_TEC;
504− cf->data[7] = (errc & PCH_REC) >> 8;
505− }
506−
507− /* Warning interrupt. */
508− if (status & PCH_EWARN) {
509− state = CAN_STATE_ERROR_WARNING;
510− priv->can.can_stats.error_warning++;
511− cf->can_id |= CAN_ERR_CRTL;
512− if (((errc & PCH_REC) >> 8) > 96)
513− cf->data[1] |= CAN_ERR_CRTL_RX_WARNING;
514− if ((errc & PCH_TEC) > 96)
515− cf->data[1] |= CAN_ERR_CRTL_TX_WARNING;
516− netdev_dbg(ndev,
517− "%s -> Error Counter is more than 96.\n", __func__);
518− }
519− /* Error passive interrupt. */
520− if (status & PCH_EPASSIV) {
521− priv->can.can_stats.error_passive++;
522− state = CAN_STATE_ERROR_PASSIVE;
523− cf->can_id |= CAN_ERR_CRTL;
524− if (errc & PCH_RP)
525− cf->data[1] |= CAN_ERR_CRTL_RX_PASSIVE;
526− if ((errc & PCH_TEC) > 127)
527− cf->data[1] |= CAN_ERR_CRTL_TX_PASSIVE;
528− netdev_dbg(ndev,
529− "%s -> CAN controller is ERROR PASSIVE .\n", __func__);
530− }
531−
532− lec = status & PCH_LEC_ALL;
533− switch (lec) {
534− case PCH_STUF_ERR:
535− cf->data[2] |= CAN_ERR_PROT_STUFF;
536− priv->can.can_stats.bus_error++;
537− stats->rx_errors++;
538− break;
539− case PCH_FORM_ERR:
540− cf->data[2] |= CAN_ERR_PROT_FORM;
541− priv->can.can_stats.bus_error++;
542− stats->rx_errors++;
543− break;
544− case PCH_ACK_ERR:
545− cf->can_id |= CAN_ERR_ACK;
546− priv->can.can_stats.bus_error++;
547− stats->rx_errors++;
548− break;
549− case PCH_BIT1_ERR:
550− case PCH_BIT0_ERR:
551− cf->data[2] |= CAN_ERR_PROT_BIT;
552− priv->can.can_stats.bus_error++;
553− stats->rx_errors++;
554− break;
555− case PCH_CRC_ERR:
556− cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ;
557− priv->can.can_stats.bus_error++;
558− stats->rx_errors++;
559− break;
560− case PCH_LEC_ALL: /* Written by CPU. No error status */
561− break;
562− }
563−
564− priv->can.state = state;
565− netif_receive_skb(skb);
566−}
567−
568−static irqreturn_t pch_can_interrupt(int irq, void *dev_id)
569−{
570− struct net_device *ndev = (struct net_device *)dev_id;
571− struct pch_can_priv *priv = netdev_priv(ndev);
572−
573− if (!pch_can_int_pending(priv))
574− return IRQ_NONE;
575−
576− pch_can_set_int_enables(priv, PCH_CAN_NONE);
577− napi_schedule(&priv->napi);
578− return IRQ_HANDLED;
579−}
580−
581−static void pch_fifo_thresh(struct pch_can_priv *priv, int obj_id)
582−{
583− if (obj_id < PCH_FIFO_THRESH) {
584− iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL |
585− PCH_CMASK_ARB, &priv->regs->ifregs[0].cmask);
586−
587− /* Clearing the Dir bit. */
588− pch_can_bit_clear(&priv->regs->ifregs[0].id2, PCH_ID2_DIR);
589−
590− /* Clearing NewDat & IntPnd */
591− pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
592− PCH_IF_MCONT_INTPND);
593− pch_can_rw_msg_obj(&priv->regs->ifregs[0].creq, obj_id);
594− } else if (obj_id > PCH_FIFO_THRESH) {
595− pch_can_int_clr(priv, obj_id);
596− } else if (obj_id == PCH_FIFO_THRESH) {
597− int cnt;
598− for (cnt = 0; cnt < PCH_FIFO_THRESH; cnt++)
599− pch_can_int_clr(priv, cnt + 1);
600− }
601−}
602−
603−static void pch_can_rx_msg_lost(struct net_device *ndev, int obj_id)
604−{
605− struct pch_can_priv *priv = netdev_priv(ndev);
606− struct net_device_stats *stats = &(priv->ndev->stats);
607− struct sk_buff *skb;
608− struct can_frame *cf;
609−
610− netdev_dbg(priv->ndev, "Msg Obj is overwritten.\n");
611− pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
612− PCH_IF_MCONT_MSGLOST);
613− iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL,
614− &priv->regs->ifregs[0].cmask);
615− pch_can_rw_msg_obj(&priv->regs->ifregs[0].creq, obj_id);
616−
617− skb = alloc_can_err_skb(ndev, &cf);
618− if (!skb)
619− return;
620−
621− cf->can_id |= CAN_ERR_CRTL;
622− cf->data[1] = CAN_ERR_CRTL_RX_OVERFLOW;
623− stats->rx_over_errors++;
624− stats->rx_errors++;
625−
626− netif_receive_skb(skb);
627−}
628−
629−static int pch_can_rx_normal(struct net_device *ndev, u32 obj_num, int quota)
630−{
631− u32 reg;
632− canid_t id;
633− int rcv_pkts = 0;
634− struct sk_buff *skb;
635− struct can_frame *cf;
636− struct pch_can_priv *priv = netdev_priv(ndev);
637− struct net_device_stats *stats = &(priv->ndev->stats);
638− int i;
639− u32 id2;
640− u16 data_reg;
641−
642− do {
643− /* Reading the message object from the Message RAM */
644− iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
645− pch_can_rw_msg_obj(&priv->regs->ifregs[0].creq, obj_num);
646−
647− /* Reading the MCONT register. */
648− reg = ioread32(&priv->regs->ifregs[0].mcont);
649−
650− if (reg & PCH_IF_MCONT_EOB)
651− break;
652−
653− /* If MsgLost bit set. */
654− if (reg & PCH_IF_MCONT_MSGLOST) {
655− pch_can_rx_msg_lost(ndev, obj_num);
656− rcv_pkts++;
657− quota--;
658− obj_num++;
659− continue;
660− } else if (!(reg & PCH_IF_MCONT_NEWDAT)) {
661− obj_num++;
662− continue;
663− }
664−
665− skb = alloc_can_skb(priv->ndev, &cf);
666− if (!skb) {
667− netdev_err(ndev, "alloc_can_skb Failed\n");
668− return rcv_pkts;
669− }
670−
671− /* Get Received data */
672− id2 = ioread32(&priv->regs->ifregs[0].id2);
673− if (id2 & PCH_ID2_XTD) {
674− id = (ioread32(&priv->regs->ifregs[0].id1) & 0xffff);
675− id |= (((id2) & 0x1fff) << 16);
676− cf->can_id = id | CAN_EFF_FLAG;
677− } else {
678− id = (id2 >> 2) & CAN_SFF_MASK;
679− cf->can_id = id;
680− }
681−
682− cf->len = can_cc_dlc2len((ioread32(&priv->regs->
683− ifregs[0].mcont)) & 0xF);
684−
685− if (id2 & PCH_ID2_DIR) {
686− cf->can_id |= CAN_RTR_FLAG;
687− } else {
688− for (i = 0; i < cf->len; i += 2) {
689− data_reg = ioread16(&priv->regs->ifregs[0].data[i / 2]);
690− cf->data[i] = data_reg;
691− cf->data[i + 1] = data_reg >> 8;
692− }
693−
694− stats->rx_bytes += cf->len;
695− }
696− stats->rx_packets++;
697− rcv_pkts++;
698− quota--;
699− netif_receive_skb(skb);
700−
701− pch_fifo_thresh(priv, obj_num);
702− obj_num++;
703− } while (quota > 0);
704−
705− return rcv_pkts;
706−}
707−
708−static void pch_can_tx_complete(struct net_device *ndev, u32 int_stat)
709−{
710− struct pch_can_priv *priv = netdev_priv(ndev);
711− struct net_device_stats *stats = &(priv->ndev->stats);
712−
713− stats->tx_bytes += can_get_echo_skb(ndev, int_stat - PCH_RX_OBJ_END - 1,
714− NULL);
715− stats->tx_packets++;
716− iowrite32(PCH_CMASK_RX_TX_GET | PCH_CMASK_CLRINTPND,
717− &priv->regs->ifregs[1].cmask);
718− pch_can_rw_msg_obj(&priv->regs->ifregs[1].creq, int_stat);
719− if (int_stat == PCH_TX_OBJ_END)
720− netif_wake_queue(ndev);
721−}
722−
723−static int pch_can_poll(struct napi_struct *napi, int quota)
724−{
725− struct net_device *ndev = napi->dev;
726− struct pch_can_priv *priv = netdev_priv(ndev);
727− u32 int_stat;
728− u32 reg_stat;
729− int quota_save = quota;
730−
731− int_stat = pch_can_int_pending(priv);
732− if (!int_stat)
733− goto end;
734−
735− if (int_stat == PCH_STATUS_INT) {
736− reg_stat = ioread32(&priv->regs->stat);
737−
738− if ((reg_stat & (PCH_BUS_OFF | PCH_LEC_ALL)) &&
739− ((reg_stat & PCH_LEC_ALL) != PCH_LEC_ALL)) {
740− pch_can_error(ndev, reg_stat);
741− quota--;
742− }
743−
744− if (reg_stat & (PCH_TX_OK | PCH_RX_OK))
745− pch_can_bit_clear(&priv->regs->stat,
746− reg_stat & (PCH_TX_OK | PCH_RX_OK));
747−
748− int_stat = pch_can_int_pending(priv);
749− }
750−
751− if (quota == 0)
752− goto end;
753−
754− if ((int_stat >= PCH_RX_OBJ_START) && (int_stat <= PCH_RX_OBJ_END)) {
755− quota -= pch_can_rx_normal(ndev, int_stat, quota);
756− } else if ((int_stat >= PCH_TX_OBJ_START) &&
757− (int_stat <= PCH_TX_OBJ_END)) {
758− /* Handle transmission interrupt */
759− pch_can_tx_complete(ndev, int_stat);
760− }
761−
762−end:
763− napi_complete(napi);
764− pch_can_set_int_enables(priv, PCH_CAN_ALL);
765−
766− return quota_save - quota;
767−}
768−
769−static int pch_set_bittiming(struct net_device *ndev)
770−{
771− struct pch_can_priv *priv = netdev_priv(ndev);
772− const struct can_bittiming *bt = &priv->can.bittiming;
773− u32 canbit;
774− u32 bepe;
775−
776− /* Setting the CCE bit for accessing the Can Timing register. */
777− pch_can_bit_set(&priv->regs->cont, PCH_CTRL_CCE);
778−
779− canbit = (bt->brp - 1) & PCH_MSK_BITT_BRP;
780− canbit |= (bt->sjw - 1) << PCH_BIT_SJW_SHIFT;
781− canbit |= (bt->phase_seg1 + bt->prop_seg - 1) << PCH_BIT_TSEG1_SHIFT;
782− canbit |= (bt->phase_seg2 - 1) << PCH_BIT_TSEG2_SHIFT;
783− bepe = ((bt->brp - 1) & PCH_MSK_BRPE_BRPE) >> PCH_BIT_BRPE_BRPE_SHIFT;
784− iowrite32(canbit, &priv->regs->bitt);
785− iowrite32(bepe, &priv->regs->brpe);
786− pch_can_bit_clear(&priv->regs->cont, PCH_CTRL_CCE);
787−
788− return 0;
789−}
790−
791−static void pch_can_start(struct net_device *ndev)
792−{
793− struct pch_can_priv *priv = netdev_priv(ndev);
794−
795− if (priv->can.state != CAN_STATE_STOPPED)
796− pch_can_reset(priv);
797−
798− pch_set_bittiming(ndev);
799− pch_can_set_optmode(priv);
800−
801− pch_can_set_tx_all(priv, 1);
802− pch_can_set_rx_all(priv, 1);
803−
804− /* Setting the CAN to run mode. */
805− pch_can_set_run_mode(priv, PCH_CAN_RUN);
806−
807− priv->can.state = CAN_STATE_ERROR_ACTIVE;
808−
809− return;
810−}
811−
812−static int pch_can_do_set_mode(struct net_device *ndev, enum can_mode mode)
813−{
814− int ret = 0;
815−
816− switch (mode) {
817− case CAN_MODE_START:
818− pch_can_start(ndev);
819− netif_wake_queue(ndev);
820− break;
821− default:
822− ret = -EOPNOTSUPP;
823− break;
824− }
825−
826− return ret;
827−}
828−
829−static int pch_can_open(struct net_device *ndev)
830−{
831− struct pch_can_priv *priv = netdev_priv(ndev);
832− int retval;
833−
834− /* Registering the interrupt. */
835− retval = request_irq(priv->dev->irq, pch_can_interrupt, IRQF_SHARED,
836− ndev->name, ndev);
837− if (retval) {
838− netdev_err(ndev, "request_irq failed.\n");
839− goto req_irq_err;
840− }
841−
842− /* Open common can device */
843− retval = open_candev(ndev);
844− if (retval) {
845− netdev_err(ndev, "open_candev() failed %d\n", retval);
846− goto err_open_candev;
847− }
848−
849− pch_can_init(priv);
850− pch_can_start(ndev);
851− napi_enable(&priv->napi);
852− netif_start_queue(ndev);
853−
854− return 0;
855−
856−err_open_candev:
857− free_irq(priv->dev->irq, ndev);
858−req_irq_err:
859− pch_can_release(priv);
860−
861− return retval;
862−}
863−
864−static int pch_close(struct net_device *ndev)
865−{
866− struct pch_can_priv *priv = netdev_priv(ndev);
867−
868− netif_stop_queue(ndev);
869− napi_disable(&priv->napi);
870− pch_can_release(priv);
871− free_irq(priv->dev->irq, ndev);
872− close_candev(ndev);
873− priv->can.state = CAN_STATE_STOPPED;
874− return 0;
875−}
876−
877−static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
878−{
879− struct pch_can_priv *priv = netdev_priv(ndev);
880− struct can_frame *cf = (struct can_frame *)skb->data;
881− int tx_obj_no;
882− int i;
883− u32 id2;
884−
885− if (can_dev_dropped_skb(ndev, skb))
886− return NETDEV_TX_OK;
887−
888− tx_obj_no = priv->tx_obj;
889− if (priv->tx_obj == PCH_TX_OBJ_END) {
890− if (ioread32(&priv->regs->treq2) & PCH_TREQ2_TX_MASK)
891− netif_stop_queue(ndev);
892−
893− priv->tx_obj = PCH_TX_OBJ_START;
894− } else {
895− priv->tx_obj++;
896− }
897−
898− /* Setting the CMASK register. */
899− pch_can_bit_set(&priv->regs->ifregs[1].cmask, PCH_CMASK_ALL);
900−
901− /* If ID extended is set. */
902− if (cf->can_id & CAN_EFF_FLAG) {
903− iowrite32(cf->can_id & 0xffff, &priv->regs->ifregs[1].id1);
904− id2 = ((cf->can_id >> 16) & 0x1fff) | PCH_ID2_XTD;
905− } else {
906− iowrite32(0, &priv->regs->ifregs[1].id1);
907− id2 = (cf->can_id & CAN_SFF_MASK) << 2;
908− }
909−
910− id2 |= PCH_ID_MSGVAL;
911−
912− /* If remote frame has to be transmitted.. */
913− if (!(cf->can_id & CAN_RTR_FLAG))
914− id2 |= PCH_ID2_DIR;
915−
916− iowrite32(id2, &priv->regs->ifregs[1].id2);
917−
918− /* Copy data to register */
919− for (i = 0; i < cf->len; i += 2) {
920− iowrite16(cf->data[i] | (cf->data[i + 1] << 8),
921− &priv->regs->ifregs[1].data[i / 2]);
922− }
923−
924− can_put_echo_skb(skb, ndev, tx_obj_no - PCH_RX_OBJ_END - 1, 0);
925−
926− /* Set the size of the data. Update if2_mcont */
927− iowrite32(cf->len | PCH_IF_MCONT_NEWDAT | PCH_IF_MCONT_TXRQXT |
928− PCH_IF_MCONT_TXIE, &priv->regs->ifregs[1].mcont);
929−
930− pch_can_rw_msg_obj(&priv->regs->ifregs[1].creq, tx_obj_no);
931−
932− return NETDEV_TX_OK;
933−}
934−
935−static const struct net_device_ops pch_can_netdev_ops = {
936− .ndo_open = pch_can_open,
937− .ndo_stop = pch_close,
938− .ndo_start_xmit = pch_xmit,
939− .ndo_change_mtu = can_change_mtu,
940−};
941−
942−static const struct ethtool_ops pch_can_ethtool_ops = {
943− .get_ts_info = ethtool_op_get_ts_info,
944−};
945−
946−static void pch_can_remove(struct pci_dev *pdev)
947−{
948− struct net_device *ndev = pci_get_drvdata(pdev);
949− struct pch_can_priv *priv = netdev_priv(ndev);
950−
951− unregister_candev(priv->ndev);
952− if (priv->use_msi)
953− pci_disable_msi(priv->dev);
954− pci_release_regions(pdev);
955− pci_disable_device(pdev);
956− pch_can_reset(priv);
957− pci_iounmap(pdev, priv->regs);
958− free_candev(priv->ndev);
959−}
960−
961−static void __maybe_unused pch_can_set_int_custom(struct pch_can_priv *priv)
962−{
963− /* Clearing the IE, SIE and EIE bits of Can control register. */
964− pch_can_bit_clear(&priv->regs->cont, PCH_CTRL_IE_SIE_EIE);
965−
966− /* Appropriately setting them. */
967− pch_can_bit_set(&priv->regs->cont,
968− ((priv->int_enables & PCH_MSK_CTRL_IE_SIE_EIE) << 1));
969−}
970−
971−/* This function retrieves interrupt enabled for the CAN device. */
972−static u32 __maybe_unused pch_can_get_int_enables(struct pch_can_priv *priv)
973−{
974− /* Obtaining the status of IE, SIE and EIE interrupt bits. */
975− return (ioread32(&priv->regs->cont) & PCH_CTRL_IE_SIE_EIE) >> 1;
976−}
977−
978−static u32 __maybe_unused pch_can_get_rxtx_ir(struct pch_can_priv *priv,
979− u32 buff_num, enum pch_ifreg dir)
980−{
981− u32 ie, enable;
982−
983− if (dir)
984− ie = PCH_IF_MCONT_RXIE;
985− else
986− ie = PCH_IF_MCONT_TXIE;
987−
988− iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[dir].cmask);
989− pch_can_rw_msg_obj(&priv->regs->ifregs[dir].creq, buff_num);
990−
991− if (((ioread32(&priv->regs->ifregs[dir].id2)) & PCH_ID_MSGVAL) &&
992− ((ioread32(&priv->regs->ifregs[dir].mcont)) & ie))
993− enable = 1;
994− else
995− enable = 0;
996−
997− return enable;
998−}
999−
1000−static void __maybe_unused pch_can_set_rx_buffer_link(struct pch_can_priv *priv,
1001− u32 buffer_num, int set)
1002−{
1003− iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
1004− pch_can_rw_msg_obj(&priv->regs->ifregs[0].creq, buffer_num);
1005− iowrite32(PCH_CMASK_RDWR | PCH_CMASK_CTRL,
1006− &priv->regs->ifregs[0].cmask);
1007− if (set)
1008− pch_can_bit_clear(&priv->regs->ifregs[0].mcont,
1009− PCH_IF_MCONT_EOB);
1010− else
1011− pch_can_bit_set(&priv->regs->ifregs[0].mcont, PCH_IF_MCONT_EOB);
1012−
1013− pch_can_rw_msg_obj(&priv->regs->ifregs[0].creq, buffer_num);
1014−}
1015−
1016−static u32 __maybe_unused pch_can_get_rx_buffer_link(struct pch_can_priv *priv,
1017− u32 buffer_num)
1018−{
1019− u32 link;
1020−
1021− iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
1022− pch_can_rw_msg_obj(&priv->regs->ifregs[0].creq, buffer_num);
1023−
1024− if (ioread32(&priv->regs->ifregs[0].mcont) & PCH_IF_MCONT_EOB)
1025− link = 0;
1026− else
1027− link = 1;
1028− return link;
1029−}
1030−
1031−static int __maybe_unused pch_can_get_buffer_status(struct pch_can_priv *priv)
1032−{
1033− return (ioread32(&priv->regs->treq1) & 0xffff) |
1034− (ioread32(&priv->regs->treq2) << 16);
1035−}
1036−
1037−static int __maybe_unused pch_can_suspend(struct device *dev_d)
1038−{
1039− int i;
1040− u32 buf_stat; /* Variable for reading the transmit buffer status. */
1041− int counter = PCH_COUNTER_LIMIT;
1042−
1043− struct net_device *dev = dev_get_drvdata(dev_d);
1044− struct pch_can_priv *priv = netdev_priv(dev);
1045−
1046− /* Stop the CAN controller */
1047− pch_can_set_run_mode(priv, PCH_CAN_STOP);
1048−
1049− /* Indicate that we are aboutto/in suspend */
1050− priv->can.state = CAN_STATE_STOPPED;
1051−
1052− /* Waiting for all transmission to complete. */
1053− while (counter) {
1054− buf_stat = pch_can_get_buffer_status(priv);
1055− if (!buf_stat)
1056− break;
1057− counter--;
1058− udelay(1);
1059− }
1060− if (!counter)
1061− dev_err(dev_d, "%s -> Transmission time out.\n", __func__);
1062−
1063− /* Save interrupt configuration and then disable them */
1064− priv->int_enables = pch_can_get_int_enables(priv);
1065− pch_can_set_int_enables(priv, PCH_CAN_DISABLE);
1066−
1067− /* Save Tx buffer enable state */
1068− for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++)
1069− priv->tx_enable[i - 1] = pch_can_get_rxtx_ir(priv, i,
1070− PCH_TX_IFREG);
1071−
1072− /* Disable all Transmit buffers */
1073− pch_can_set_tx_all(priv, 0);
1074−
1075− /* Save Rx buffer enable state */
1076− for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) {
1077− priv->rx_enable[i - 1] = pch_can_get_rxtx_ir(priv, i,
1078− PCH_RX_IFREG);
1079− priv->rx_link[i - 1] = pch_can_get_rx_buffer_link(priv, i);
1080− }
1081−
1082− /* Disable all Receive buffers */
1083− pch_can_set_rx_all(priv, 0);
1084−
1085− return 0;
1086−}
1087−
1088−static int __maybe_unused pch_can_resume(struct device *dev_d)
1089−{
1090− int i;
1091− struct net_device *dev = dev_get_drvdata(dev_d);
1092− struct pch_can_priv *priv = netdev_priv(dev);
1093−
1094− priv->can.state = CAN_STATE_ERROR_ACTIVE;
1095−
1096− /* Disabling all interrupts. */
1097− pch_can_set_int_enables(priv, PCH_CAN_DISABLE);
1098−
1099− /* Setting the CAN device in Stop Mode. */
1100− pch_can_set_run_mode(priv, PCH_CAN_STOP);
1101−
1102− /* Configuring the transmit and receive buffers. */
1103− pch_can_config_rx_tx_buffers(priv);
1104−
1105− /* Restore the CAN state */
1106− pch_set_bittiming(dev);
1107−
1108− /* Listen/Active */
1109− pch_can_set_optmode(priv);
1110−
1111− /* Enabling the transmit buffer. */
1112− for (i = PCH_TX_OBJ_START; i <= PCH_TX_OBJ_END; i++)
1113− pch_can_set_rxtx(priv, i, priv->tx_enable[i - 1], PCH_TX_IFREG);
1114−
1115− /* Configuring the receive buffer and enabling them. */
1116− for (i = PCH_RX_OBJ_START; i <= PCH_RX_OBJ_END; i++) {
1117− /* Restore buffer link */
1118− pch_can_set_rx_buffer_link(priv, i, priv->rx_link[i - 1]);
1119−
1120− /* Restore buffer enables */
1121− pch_can_set_rxtx(priv, i, priv->rx_enable[i - 1], PCH_RX_IFREG);
1122− }
1123−
1124− /* Enable CAN Interrupts */
1125− pch_can_set_int_custom(priv);
1126−
1127− /* Restore Run Mode */
1128− pch_can_set_run_mode(priv, PCH_CAN_RUN);
1129−
1130− return 0;
1131−}
1132−
1133−static int pch_can_get_berr_counter(const struct net_device *dev,
1134− struct can_berr_counter *bec)
1135−{
1136− struct pch_can_priv *priv = netdev_priv(dev);
1137− u32 errc = ioread32(&priv->regs->errc);
1138−
1139− bec->txerr = errc & PCH_TEC;
1140− bec->rxerr = (errc & PCH_REC) >> 8;
1141−
1142− return 0;
1143−}
1144−
1145−static int pch_can_probe(struct pci_dev *pdev,
1146− const struct pci_device_id *id)
1147−{
1148− struct net_device *ndev;
1149− struct pch_can_priv *priv;
1150− int rc;
1151− void __iomem *addr;
1152−
1153− rc = pci_enable_device(pdev);
1154− if (rc) {
1155− dev_err(&pdev->dev, "Failed pci_enable_device %d\n", rc);
1156− goto probe_exit_endev;
1157− }
1158−
1159− rc = pci_request_regions(pdev, KBUILD_MODNAME);
1160− if (rc) {
1161− dev_err(&pdev->dev, "Failed pci_request_regions %d\n", rc);
1162− goto probe_exit_pcireq;
1163− }
1164−
1165− addr = pci_iomap(pdev, 1, 0);
1166− if (!addr) {
1167− rc = -EIO;
1168− dev_err(&pdev->dev, "Failed pci_iomap\n");
1169− goto probe_exit_ipmap;
1170− }
1171−
1172− ndev = alloc_candev(sizeof(struct pch_can_priv), PCH_TX_OBJ_END);
1173− if (!ndev) {
1174− rc = -ENOMEM;
1175− dev_err(&pdev->dev, "Failed alloc_candev\n");
1176− goto probe_exit_alloc_candev;
1177− }
1178−
1179− priv = netdev_priv(ndev);
1180− priv->ndev = ndev;
1181− priv->regs = addr;
1182− priv->dev = pdev;
1183− priv->can.bittiming_const = &pch_can_bittiming_const;
1184− priv->can.do_set_mode = pch_can_do_set_mode;
1185− priv->can.do_get_berr_counter = pch_can_get_berr_counter;
1186− priv->can.ctrlmode_supported = CAN_CTRLMODE_LISTENONLY |
1187− CAN_CTRLMODE_LOOPBACK;
1188− priv->tx_obj = PCH_TX_OBJ_START; /* Point head of Tx Obj */
1189−
1190− ndev->irq = pdev->irq;
1191− ndev->flags |= IFF_ECHO;
1192−
1193− pci_set_drvdata(pdev, ndev);
1194− SET_NETDEV_DEV(ndev, &pdev->dev);
1195− ndev->netdev_ops = &pch_can_netdev_ops;
1196− ndev->ethtool_ops = &pch_can_ethtool_ops;
1197− priv->can.clock.freq = PCH_CAN_CLK; /* Hz */
1198−
1199− netif_napi_add_weight(ndev, &priv->napi, pch_can_poll, PCH_RX_OBJ_END);
1200−
1201− rc = pci_enable_msi(priv->dev);
1202− if (rc) {
1203− netdev_err(ndev, "PCH CAN opened without MSI\n");
1204− priv->use_msi = 0;
1205− } else {
1206− netdev_err(ndev, "PCH CAN opened with MSI\n");
1207− pci_set_master(pdev);
1208− priv->use_msi = 1;
1209− }
1210−
1211− rc = register_candev(ndev);
1212− if (rc) {
1213− dev_err(&pdev->dev, "Failed register_candev %d\n", rc);
1214− goto probe_exit_reg_candev;
1215− }
1216−
1217− return 0;
1218−
1219−probe_exit_reg_candev:
1220− if (priv->use_msi)
1221− pci_disable_msi(priv->dev);
1222− free_candev(ndev);
1223−probe_exit_alloc_candev:
1224− pci_iounmap(pdev, addr);
1225−probe_exit_ipmap:
1226− pci_release_regions(pdev);
1227−probe_exit_pcireq:
1228− pci_disable_device(pdev);
1229−probe_exit_endev:
1230− return rc;
1231−}
1232−
1233−static SIMPLE_DEV_PM_OPS(pch_can_pm_ops,
1234− pch_can_suspend,
1235− pch_can_resume);
1236−
1237−static struct pci_driver pch_can_pci_driver = {
1238− .name = "pch_can",
1239− .id_table = pch_pci_tbl,
1240− .probe = pch_can_probe,
1241− .remove = pch_can_remove,
1242− .driver.pm = &pch_can_pm_ops,
1243−};
1244−
1245−module_pci_driver(pch_can_pci_driver);
1246−
1247−MODULE_DESCRIPTION("Intel EG20T PCH CAN(Controller Area Network) Driver");
1248−MODULE_LICENSE("GPL v2");
1249−MODULE_VERSION("0.94");
drivers/net/can/rcar/rcar_canfd.c+63−46
@@ -41,12 +41,6 @@ · 40 unmodified lines
4141
4242 #define RCANFD_DRV_NAME "rcar_canfd"
4343
44−enum rcanfd_chip_id {
45− RENESAS_RCAR_GEN3 = 0,
46− RENESAS_RZG2L,
47− RENESAS_R8A779A0,
48−};
49−
5044 /* Global register bits */
5145
5246 /* RSCFDnCFDGRMCFG */
@@ -522,6 +516,14 @@ enum rcar_canfd_fcanclk { · 469 unmodified lines
522516
523517 struct rcar_canfd_global;
524518
519+struct rcar_canfd_hw_info {
520+ u8 max_channels;
521+ u8 postdiv;
522+ /* hardware features */
523+ unsigned shared_global_irqs:1; /* Has shared global irqs */
524+ unsigned multi_channel_irqs:1; /* Has multiple channel irqs */
525+};
526+
525527 /* Channel priv data */
526528 struct rcar_canfd_channel {
527529 struct can_priv can; /* Must be the first member */
@@ -547,8 +549,7 @@ struct rcar_canfd_global { · 19 unmodified lines
547549 bool fdmode; /* CAN FD or Classical CAN only mode */
548550 struct reset_control *rstc1;
549551 struct reset_control *rstc2;
550− enum rcanfd_chip_id chip_id;
551− u32 max_channels;
552+ const struct rcar_canfd_hw_info *info;
552553 };
553554
554555 /* CAN FD mode nominal rate constants */
@@ -590,10 +591,28 @@ static const struct can_bittiming_const rcar_canfd_bittiming_const = { · 35 unmodified lines
590591 .brp_inc = 1,
591592 };
592593
594+static const struct rcar_canfd_hw_info rcar_gen3_hw_info = {
595+ .max_channels = 2,
596+ .postdiv = 2,
597+ .shared_global_irqs = 1,
598+};
599+
600+static const struct rcar_canfd_hw_info rzg2l_hw_info = {
601+ .max_channels = 2,
602+ .postdiv = 1,
603+ .multi_channel_irqs = 1,
604+};
605+
606+static const struct rcar_canfd_hw_info r8a779a0_hw_info = {
607+ .max_channels = 8,
608+ .postdiv = 2,
609+ .shared_global_irqs = 1,
610+};
611+
593612 /* Helper functions */
594613 static inline bool is_v3u(struct rcar_canfd_global *gpriv)
595614 {
596− return gpriv->chip_id == RENESAS_R8A779A0;
615+ return gpriv->info == &r8a779a0_hw_info;
597616 }
598617
599618 static inline u32 reg_v3u(struct rcar_canfd_global *gpriv,
@@ -721,7 +740,7 @@ static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv) · 121 unmodified lines
721740 rcar_canfd_set_mode(gpriv);
722741
723742 /* Transition all Channels to reset mode */
724− for_each_set_bit(ch, &gpriv->channels_mask, gpriv->max_channels) {
743+ for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels) {
725744 rcar_canfd_clear_bit(gpriv->base,
726745 RCANFD_CCTR(ch), RCANFD_CCTR_CSLPR);
727746
@@ -762,7 +781,7 @@ static void rcar_canfd_configure_controller(struct rcar_canfd_global *gpriv) · 34 unmodified lines
762781 rcar_canfd_set_bit(gpriv->base, RCANFD_GCFG, cfg);
763782
764783 /* Channel configuration settings */
765− for_each_set_bit(ch, &gpriv->channels_mask, gpriv->max_channels) {
784+ for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels) {
766785 rcar_canfd_set_bit(gpriv->base, RCANFD_CCTR(ch),
767786 RCANFD_CCTR_ERRD);
768787 rcar_canfd_update_bit(gpriv->base, RCANFD_CCTR(ch),
@@ -1142,7 +1161,7 @@ static irqreturn_t rcar_canfd_global_err_interrupt(int irq, void *dev_id) · 373 unmodified lines
11421161 struct rcar_canfd_global *gpriv = dev_id;
11431162 u32 ch;
11441163
1145− for_each_set_bit(ch, &gpriv->channels_mask, gpriv->max_channels)
1164+ for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels)
11461165 rcar_canfd_handle_global_err(gpriv, ch);
11471166
11481167 return IRQ_HANDLED;
@@ -1174,7 +1193,7 @@ static irqreturn_t rcar_canfd_global_receive_fifo_interrupt(int irq, void *dev_i · 25 unmodified lines
11741193 struct rcar_canfd_global *gpriv = dev_id;
11751194 u32 ch;
11761195
1177− for_each_set_bit(ch, &gpriv->channels_mask, gpriv->max_channels)
1196+ for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels)
11781197 rcar_canfd_handle_global_receive(gpriv, ch);
11791198
11801199 return IRQ_HANDLED;
@@ -1188,7 +1207,7 @@ static irqreturn_t rcar_canfd_global_interrupt(int irq, void *dev_id) · 7 unmodified lines
11881207 /* Global error interrupts still indicate a condition specific
11891208 * to a channel. RxFIFO interrupt is a global interrupt.
11901209 */
1191− for_each_set_bit(ch, &gpriv->channels_mask, gpriv->max_channels) {
1210+ for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels) {
11921211 rcar_canfd_handle_global_err(gpriv, ch);
11931212 rcar_canfd_handle_global_receive(gpriv, ch);
11941213 }
@@ -1284,7 +1303,7 @@ static irqreturn_t rcar_canfd_channel_interrupt(int irq, void *dev_id) · 89 unmodified lines
12841303 u32 ch;
12851304
12861305 /* Common FIFO is a per channel resource */
1287− for_each_set_bit(ch, &gpriv->channels_mask, gpriv->max_channels) {
1306+ for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels) {
12881307 rcar_canfd_handle_channel_err(gpriv, ch);
12891308 rcar_canfd_handle_channel_tx(gpriv, ch);
12901309 }
@@ -1696,6 +1715,7 @@ static const struct ethtool_ops rcar_canfd_ethtool_ops = { · 405 unmodified lines
16961715 static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch,
16971716 u32 fcan_freq)
16981717 {
1718+ const struct rcar_canfd_hw_info *info = gpriv->info;
16991719 struct platform_device *pdev = gpriv->pdev;
17001720 struct rcar_canfd_channel *priv;
17011721 struct net_device *ndev;
@@ -1718,7 +1738,7 @@ static int rcar_canfd_channel_probe(struct rcar_canfd_global *gpriv, u32 ch, · 16 unmodified lines
17181738 priv->can.clock.freq = fcan_freq;
17191739 dev_info(&pdev->dev, "can_clk rate is %u\n", priv->can.clock.freq);
17201740
1721− if (gpriv->chip_id == RENESAS_RZG2L) {
1741+ if (info->multi_channel_irqs) {
17221742 char *irq_name;
17231743 int err_irq;
17241744 int tx_irq;
@@ -1818,6 +1838,7 @@ static void rcar_canfd_channel_remove(struct rcar_canfd_global *gpriv, u32 ch) · 93 unmodified lines
18181838
18191839 static int rcar_canfd_probe(struct platform_device *pdev)
18201840 {
1841+ const struct rcar_canfd_hw_info *info;
18211842 void __iomem *addr;
18221843 u32 sts, ch, fcan_freq;
18231844 struct rcar_canfd_global *gpriv;
@@ -1826,18 +1847,15 @@ static int rcar_canfd_probe(struct platform_device *pdev) · 2 unmodified lines
18261847 int err, ch_irq, g_irq;
18271848 int g_err_irq, g_recc_irq;
18281849 bool fdmode = true; /* CAN FD only mode - default */
1829− enum rcanfd_chip_id chip_id;
1830− int max_channels;
18311850 char name[9] = "channelX";
18321851 int i;
18331852
1834− chip_id = (uintptr_t)of_device_get_match_data(&pdev->dev);
1835− max_channels = chip_id == RENESAS_R8A779A0 ? 8 : 2;
1853+ info = of_device_get_match_data(&pdev->dev);
18361854
18371855 if (of_property_read_bool(pdev->dev.of_node, "renesas,no-can-fd"))
18381856 fdmode = false; /* Classical CAN only mode */
18391857
1840− for (i = 0; i < max_channels; ++i) {
1858+ for (i = 0; i < info->max_channels; ++i) {
18411859 name[7] = '0' + i;
18421860 of_child = of_get_child_by_name(pdev->dev.of_node, name);
18431861 if (of_child && of_device_is_available(of_child))
@@ -1845,7 +1863,7 @@ static int rcar_canfd_probe(struct platform_device *pdev) · 1 unmodified line
18451863 of_node_put(of_child);
18461864 }
18471865
1848− if (chip_id != RENESAS_RZG2L) {
1866+ if (info->shared_global_irqs) {
18491867 ch_irq = platform_get_irq_byname_optional(pdev, "ch_int");
18501868 if (ch_irq < 0) {
18511869 /* For backward compatibility get irq by index */
@@ -1879,20 +1897,19 @@ static int rcar_canfd_probe(struct platform_device *pdev) · 27 unmodified lines
18791897 gpriv->pdev = pdev;
18801898 gpriv->channels_mask = channels_mask;
18811899 gpriv->fdmode = fdmode;
1882− gpriv->chip_id = chip_id;
1883− gpriv->max_channels = max_channels;
1884−
1885− if (gpriv->chip_id == RENESAS_RZG2L) {
1886− gpriv->rstc1 = devm_reset_control_get_exclusive(&pdev->dev, "rstp_n");
1887− if (IS_ERR(gpriv->rstc1))
1888− return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc1),
1889− "failed to get rstp_n\n");
1890−
1891− gpriv->rstc2 = devm_reset_control_get_exclusive(&pdev->dev, "rstc_n");
1892− if (IS_ERR(gpriv->rstc2))
1893− return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc2),
1894− "failed to get rstc_n\n");
1895− }
1900+ gpriv->info = info;
1901+
1902+ gpriv->rstc1 = devm_reset_control_get_optional_exclusive(&pdev->dev,
1903+ "rstp_n");
1904+ if (IS_ERR(gpriv->rstc1))
1905+ return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc1),
1906+ "failed to get rstp_n\n");
1907+
1908+ gpriv->rstc2 = devm_reset_control_get_optional_exclusive(&pdev->dev,
1909+ "rstc_n");
1910+ if (IS_ERR(gpriv->rstc2))
1911+ return dev_err_probe(&pdev->dev, PTR_ERR(gpriv->rstc2),
1912+ "failed to get rstc_n\n");
18961913
18971914 /* Peripheral clock */
18981915 gpriv->clkp = devm_clk_get(&pdev->dev, "fck");
@@ -1917,9 +1934,9 @@ static int rcar_canfd_probe(struct platform_device *pdev) · 18 unmodified lines
19171934 }
19181935 fcan_freq = clk_get_rate(gpriv->can_clk);
19191936
1920− if (gpriv->fcan == RCANFD_CANFDCLK && gpriv->chip_id != RENESAS_RZG2L)
1937+ if (gpriv->fcan == RCANFD_CANFDCLK)
19211938 /* CANFD clock is further divided by (1/2) within the IP */
1922− fcan_freq /= 2;
1939+ fcan_freq /= info->postdiv;
19231940
19241941 addr = devm_platform_ioremap_resource(pdev, 0);
19251942 if (IS_ERR(addr)) {
@@ -1929,7 +1946,7 @@ static int rcar_canfd_probe(struct platform_device *pdev) · 3 unmodified lines
19291946 gpriv->base = addr;
19301947
19311948 /* Request IRQ that's common for both channels */
1932− if (gpriv->chip_id != RENESAS_RZG2L) {
1949+ if (info->shared_global_irqs) {
19331950 err = devm_request_irq(&pdev->dev, ch_irq,
19341951 rcar_canfd_channel_interrupt, 0,
19351952 "canfd.ch_int", gpriv);
@@ -1995,7 +2012,7 @@ static int rcar_canfd_probe(struct platform_device *pdev) · 59 unmodified lines
19952012 rcar_canfd_configure_controller(gpriv);
19962013
19972014 /* Configure per channel attributes */
1998− for_each_set_bit(ch, &gpriv->channels_mask, max_channels) {
2015+ for_each_set_bit(ch, &gpriv->channels_mask, info->max_channels) {
19992016 /* Configure Channel's Rx fifo */
20002017 rcar_canfd_configure_rx(gpriv, ch);
20012018
@@ -2021,7 +2038,7 @@ static int rcar_canfd_probe(struct platform_device *pdev) · 19 unmodified lines
20212038 goto fail_mode;
20222039 }
20232040
2024− for_each_set_bit(ch, &gpriv->channels_mask, max_channels) {
2041+ for_each_set_bit(ch, &gpriv->channels_mask, info->max_channels) {
20252042 err = rcar_canfd_channel_probe(gpriv, ch, fcan_freq);
20262043 if (err)
20272044 goto fail_channel;
@@ -2033,7 +2050,7 @@ static int rcar_canfd_probe(struct platform_device *pdev) · 5 unmodified lines
20332050 return 0;
20342051
20352052 fail_channel:
2036− for_each_set_bit(ch, &gpriv->channels_mask, max_channels)
2053+ for_each_set_bit(ch, &gpriv->channels_mask, info->max_channels)
20372054 rcar_canfd_channel_remove(gpriv, ch);
20382055 fail_mode:
20392056 rcar_canfd_disable_global_interrupts(gpriv);
@@ -2054,7 +2071,7 @@ static int rcar_canfd_remove(struct platform_device *pdev) · 14 unmodified lines
20542071 rcar_canfd_reset_controller(gpriv);
20552072 rcar_canfd_disable_global_interrupts(gpriv);
20562073
2057− for_each_set_bit(ch, &gpriv->channels_mask, gpriv->max_channels) {
2074+ for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels) {
20582075 rcar_canfd_disable_channel_interrupts(gpriv->ch[ch]);
20592076 rcar_canfd_channel_remove(gpriv, ch);
20602077 }
@@ -2082,9 +2099,9 @@ static SIMPLE_DEV_PM_OPS(rcar_canfd_pm_ops, rcar_canfd_suspend, · 21 unmodified lines
20822099 rcar_canfd_resume);
20832100
20842101 static const __maybe_unused struct of_device_id rcar_canfd_of_table[] = {
2085− { .compatible = "renesas,rcar-gen3-canfd", .data = (void *)RENESAS_RCAR_GEN3 },
2086− { .compatible = "renesas,rzg2l-canfd", .data = (void *)RENESAS_RZG2L },
2087− { .compatible = "renesas,r8a779a0-canfd", .data = (void *)RENESAS_R8A779A0 },
2102+ { .compatible = "renesas,rcar-gen3-canfd", .data = &rcar_gen3_hw_info },
2103+ { .compatible = "renesas,rzg2l-canfd", .data = &rzg2l_hw_info },
2104+ { .compatible = "renesas,r8a779a0-canfd", .data = &r8a779a0_hw_info },
20882105 { }
20892106 };
20902107
drivers/net/can/usb/Kconfig+7−3
@@ -30,6 +30,7 @@ config CAN_ESD_USB · 29 unmodified lines
3030 config CAN_ETAS_ES58X
3131 tristate "ETAS ES58X CAN/USB interfaces"
3232 select CRC16
33+ select NET_DEVLINK
3334 help
3435 This driver supports the ES581.4, ES582.1 and ES584.1 interfaces
3536 from ETAS GmbH (https://www.etas.com/en/products/es58x.php).
@@ -38,10 +39,13 @@ config CAN_ETAS_ES58X · 2 unmodified lines
3839 will be called etas_es58x.
3940
4041 config CAN_GS_USB
41− tristate "Geschwister Schneider UG interfaces"
42+ tristate "Geschwister Schneider UG and candleLight compatible interfaces"
4243 help
43− This driver supports the Geschwister Schneider and bytewerk.org
44− candleLight USB CAN interfaces USB/CAN devices
44+ This driver supports the Geschwister Schneider and
45+ bytewerk.org candleLight compatible
46+ (https://github.com/candle-usb/candleLight_fw) USB/CAN
47+ interfaces.
48+
4549 If unsure choose N,
4650 choose Y for built in support,
4751 M to compile as module (module will be named: gs_usb).
drivers/net/can/usb/etas_es58x/Makefile+1−1
@@ -1,3 +1,3 @@
11 # SPDX-License-Identifier: GPL-2.0
22 obj-$(CONFIG_CAN_ETAS_ES58X) += etas_es58x.o
3−etas_es58x-y = es58x_core.o es581_4.o es58x_fd.o
3+etas_es58x-y = es58x_core.o es58x_devlink.o es581_4.o es58x_fd.o
drivers/net/can/usb/etas_es58x/es581_4.c+2−2
@@ -6,12 +6,12 @@ · 5 unmodified lines
66 *
77 * Copyright (c) 2019 Robert Bosch Engineering and Business Solutions. All rights reserved.
88 * Copyright (c) 2020 ETAS K.K.. All rights reserved.
9− * Copyright (c) 2020, 2021 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
9+ * Copyright (c) 2020-2022 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
1010 */
1111
12+#include <asm/unaligned.h>
1213 #include <linux/kernel.h>
1314 #include <linux/units.h>
14−#include <asm/unaligned.h>
1515
1616 #include "es58x_core.h"
1717 #include "es581_4.h"
drivers/net/can/usb/etas_es58x/es58x_core.c+42−62
@@ -7,15 +7,16 @@ · 6 unmodified lines
77 *
88 * Copyright (c) 2019 Robert Bosch Engineering and Business Solutions. All rights reserved.
99 * Copyright (c) 2020 ETAS K.K.. All rights reserved.
10− * Copyright (c) 2020, 2021 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
10+ * Copyright (c) 2020-2022 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
1111 */
1212
13+#include <asm/unaligned.h>
14+#include <linux/crc16.h>
1315 #include <linux/ethtool.h>
1416 #include <linux/kernel.h>
1517 #include <linux/module.h>
1618 #include <linux/usb.h>
17−#include <linux/crc16.h>
18−#include <asm/unaligned.h>
19+#include <net/devlink.h>
1920
2021 #include "es58x_core.h"
2122
@@ -2038,10 +2039,16 @@ static int es58x_set_mode(struct net_device *netdev, enum can_mode mode) · 2016 unmodified lines
20382039 * @es58x_dev: ES58X device.
20392040 * @priv: ES58X private parameters related to the network device.
20402041 * @channel_idx: Index of the network device.
2042+ *
2043+ * Return: zero on success, errno if devlink port could not be
2044+ * properly registered.
20412045 */
2042−static void es58x_init_priv(struct es58x_device *es58x_dev,
2043− struct es58x_priv *priv, int channel_idx)
2046+static int es58x_init_priv(struct es58x_device *es58x_dev,
2047+ struct es58x_priv *priv, int channel_idx)
20442048 {
2049+ struct devlink_port_attrs attrs = {
2050+ .flavour = DEVLINK_PORT_FLAVOUR_PHYSICAL,
2051+ };
20452052 const struct es58x_parameters *param = es58x_dev->param;
20462053 struct can_priv *can = &priv->can;
20472054
@@ -2060,6 +2067,10 @@ static void es58x_init_priv(struct es58x_device *es58x_dev, · 12 unmodified lines
20602067 can->state = CAN_STATE_STOPPED;
20612068 can->ctrlmode_supported = param->ctrlmode_supported;
20622069 can->do_set_mode = es58x_set_mode;
2070+
2071+ devlink_port_attrs_set(&priv->devlink_port, &attrs);
2072+ return devlink_port_register(priv_to_devlink(es58x_dev),
2073+ &priv->devlink_port, channel_idx);
20632074 }
20642075
20652076 /**
@@ -2083,7 +2094,10 @@ static int es58x_init_netdev(struct es58x_device *es58x_dev, int channel_idx) · 17 unmodified lines
20832094 }
20842095 SET_NETDEV_DEV(netdev, dev);
20852096 es58x_dev->netdev[channel_idx] = netdev;
2086− es58x_init_priv(es58x_dev, es58x_priv(netdev), channel_idx);
2097+ ret = es58x_init_priv(es58x_dev, es58x_priv(netdev), channel_idx);
2098+ if (ret)
2099+ goto free_candev;
2100+ SET_NETDEV_DEVLINK_PORT(netdev, &es58x_priv(netdev)->devlink_port);
20872101
20882102 netdev->netdev_ops = &es58x_netdev_ops;
20892103 netdev->ethtool_ops = &es58x_ethtool_ops;
@@ -2091,16 +2105,20 @@ static int es58x_init_netdev(struct es58x_device *es58x_dev, int channel_idx) · 1 unmodified line
20912105 netdev->dev_port = channel_idx;
20922106
20932107 ret = register_candev(netdev);
2094− if (ret) {
2095− es58x_dev->netdev[channel_idx] = NULL;
2096− free_candev(netdev);
2097− return ret;
2098− }
2108+ if (ret)
2109+ goto devlink_port_unregister;
20992110
21002111 netdev_queue_set_dql_min_limit(netdev_get_tx_queue(netdev, 0),
21012112 es58x_dev->param->dql_min_limit);
21022113
21032114 return ret;
2115+
2116+ devlink_port_unregister:
2117+ devlink_port_unregister(&es58x_priv(netdev)->devlink_port);
2118+ free_candev:
2119+ es58x_dev->netdev[channel_idx] = NULL;
2120+ free_candev(netdev);
2121+ return ret;
21042122 }
21052123
21062124 /**
@@ -2117,53 +2135,12 @@ static void es58x_free_netdevs(struct es58x_device *es58x_dev) · 10 unmodified lines
21172135 if (!netdev)
21182136 continue;
21192137 unregister_candev(netdev);
2138+ devlink_port_unregister(&es58x_priv(netdev)->devlink_port);
21202139 es58x_dev->netdev[i] = NULL;
21212140 free_candev(netdev);
21222141 }
21232142 }
21242143
2125−/**
2126− * es58x_get_product_info() - Get the product information and print them.
2127− * @es58x_dev: ES58X device.
2128− *
2129− * Do a synchronous call to get the product information.
2130− *
2131− * Return: zero on success, errno when any error occurs.
2132− */
2133−static int es58x_get_product_info(struct es58x_device *es58x_dev)
2134−{
2135− struct usb_device *udev = es58x_dev->udev;
2136− const int es58x_prod_info_idx = 6;
2137− /* Empirical tests show a prod_info length of maximum 83,
2138− * below should be more than enough.
2139− */
2140− const size_t prod_info_len = 127;
2141− char *prod_info;
2142− int ret;
2143−
2144− prod_info = kmalloc(prod_info_len, GFP_KERNEL);
2145− if (!prod_info)
2146− return -ENOMEM;
2147−
2148− ret = usb_string(udev, es58x_prod_info_idx, prod_info, prod_info_len);
2149− if (ret < 0) {
2150− dev_err(es58x_dev->dev,
2151− "%s: Could not read the product info: %pe\n",
2152− __func__, ERR_PTR(ret));
2153− goto out_free;
2154− }
2155− if (ret >= prod_info_len - 1) {
2156− dev_warn(es58x_dev->dev,
2157− "%s: Buffer is too small, result might be truncated\n",
2158− __func__);
2159− }
2160− dev_info(es58x_dev->dev, "Product info: %s\n", prod_info);
2161−
2162− out_free:
2163− kfree(prod_info);
2164− return ret < 0 ? ret : 0;
2165−}
2166−
21672144 /**
21682145 * es58x_init_es58x_dev() - Initialize the ES58X device.
21692146 * @intf: USB interface.
@@ -2177,6 +2154,7 @@ static struct es58x_device *es58x_init_es58x_dev(struct usb_interface *intf, · 7 unmodified lines
21772154 {
21782155 struct device *dev = &intf->dev;
21792156 struct es58x_device *es58x_dev;
2157+ struct devlink *devlink;
21802158 const struct es58x_parameters *param;
21812159 const struct es58x_operators *ops;
21822160 struct usb_device *udev = interface_to_usbdev(intf);
@@ -2199,11 +2177,12 @@ static struct es58x_device *es58x_init_es58x_dev(struct usb_interface *intf, · 16 unmodified lines
21992177 ops = &es581_4_ops;
22002178 }
22012179
2202− es58x_dev = devm_kzalloc(dev, es58x_sizeof_es58x_device(param),
2203− GFP_KERNEL);
2204− if (!es58x_dev)
2180+ devlink = devlink_alloc(&es58x_dl_ops, es58x_sizeof_es58x_device(param),
2181+ dev);
2182+ if (!devlink)
22052183 return ERR_PTR(-ENOMEM);
22062184
2185+ es58x_dev = devlink_priv(devlink);
22072186 es58x_dev->param = param;
22082187 es58x_dev->ops = ops;
22092188 es58x_dev->dev = dev;
@@ -2240,25 +2219,24 @@ static int es58x_probe(struct usb_interface *intf, · 30 unmodified lines
22402219 const struct usb_device_id *id)
22412220 {
22422221 struct es58x_device *es58x_dev;
2243− int ch_idx, ret;
2222+ int ch_idx;
22442223
22452224 es58x_dev = es58x_init_es58x_dev(intf, id->driver_info);
22462225 if (IS_ERR(es58x_dev))
22472226 return PTR_ERR(es58x_dev);
22482227
2249− ret = es58x_get_product_info(es58x_dev);
2250− if (ret)
2251− return ret;
2228+ es58x_parse_product_info(es58x_dev);
2229+ devlink_register(priv_to_devlink(es58x_dev));
22522230
22532231 for (ch_idx = 0; ch_idx < es58x_dev->num_can_ch; ch_idx++) {
2254− ret = es58x_init_netdev(es58x_dev, ch_idx);
2232+ int ret = es58x_init_netdev(es58x_dev, ch_idx);
22552233 if (ret) {
22562234 es58x_free_netdevs(es58x_dev);
22572235 return ret;
22582236 }
22592237 }
22602238
2261− return ret;
2239+ return 0;
22622240 }
22632241
22642242 /**
@@ -2275,8 +2253,10 @@ static void es58x_disconnect(struct usb_interface *intf) · 10 unmodified lines
22752253 dev_info(&intf->dev, "Disconnecting %s %s\n",
22762254 es58x_dev->udev->manufacturer, es58x_dev->udev->product);
22772255
2256+ devlink_unregister(priv_to_devlink(es58x_dev));
22782257 es58x_free_netdevs(es58x_dev);
22792258 es58x_free_urbs(es58x_dev);
2259+ devlink_free(priv_to_devlink(es58x_dev));
22802260 usb_set_intfdata(intf, NULL);
22812261 }
22822262
drivers/net/can/usb/etas_es58x/es58x_core.h+54−4
@@ -6,17 +6,18 @@ · 5 unmodified lines
66 *
77 * Copyright (c) 2019 Robert Bosch Engineering and Business Solutions. All rights reserved.
88 * Copyright (c) 2020 ETAS K.K.. All rights reserved.
9− * Copyright (c) 2020, 2021 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
9+ * Copyright (c) 2020-2022 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
1010 */
1111
1212 #ifndef __ES58X_COMMON_H__
1313 #define __ES58X_COMMON_H__
1414
15−#include <linux/types.h>
16−#include <linux/usb.h>
17−#include <linux/netdevice.h>
1815 #include <linux/can.h>
1916 #include <linux/can/dev.h>
17+#include <linux/netdevice.h>
18+#include <linux/types.h>
19+#include <linux/usb.h>
20+#include <net/devlink.h>
2021
2122 #include "es581_4.h"
2223 #include "es58x_fd.h"
@@ -230,6 +231,7 @@ union es58x_urb_cmd { · 207 unmodified lines
230231 * @can: struct can_priv must be the first member (Socket CAN relies
231232 * on the fact that function netdev_priv() returns a pointer to
232233 * a struct can_priv).
234+ * @devlink_port: devlink instance for the network interface.
233235 * @es58x_dev: pointer to the corresponding ES58X device.
234236 * @tx_urb: Used as a buffer to concatenate the TX messages and to do
235237 * a bulk send. Please refer to es58x_start_xmit() for more
@@ -255,6 +257,7 @@ union es58x_urb_cmd { · 19 unmodified lines
255257 */
256258 struct es58x_priv {
257259 struct can_priv can;
260+ struct devlink_port devlink_port;
258261 struct es58x_device *es58x_dev;
259262 struct urb *tx_urb;
260263
@@ -356,6 +359,39 @@ struct es58x_operators { · 95 unmodified lines
356359 int (*get_timestamp)(struct es58x_device *es58x_dev);
357360 };
358361
362+/**
363+ * struct es58x_sw_version - Version number of the firmware or the
364+ * bootloader.
365+ * @major: Version major number, represented on two digits.
366+ * @minor: Version minor number, represented on two digits.
367+ * @revision: Version revision number, represented on two digits.
368+ *
369+ * The firmware and the bootloader share the same format: "xx.xx.xx"
370+ * where 'x' is a digit. Both can be retrieved from the product
371+ * information string.
372+ */
373+struct es58x_sw_version {
374+ u8 major;
375+ u8 minor;
376+ u8 revision;
377+};
378+
379+/**
380+ * struct es58x_hw_revision - Hardware revision number.
381+ * @letter: Revision letter.
382+ * @major: Version major number, represented on three digits.
383+ * @minor: Version minor number, represented on three digits.
384+ *
385+ * The hardware revision uses its own format: "axxx/xxx" where 'a' is
386+ * a letter and 'x' a digit. It can be retrieved from the product
387+ * information string.
388+ */
389+struct es58x_hw_revision {
390+ char letter;
391+ u16 major;
392+ u16 minor;
393+};
394+
359395 /**
360396 * struct es58x_device - All information specific to an ES58X device.
361397 * @dev: Device information.
@@ -373,6 +409,9 @@ struct es58x_operators { · 11 unmodified lines
373409 * queue wake/stop logic should prevent this URB from getting
374410 * empty. Please refer to es58x_get_tx_urb() for more details.
375411 * @tx_urbs_idle_cnt: number of urbs in @tx_urbs_idle.
412+ * @firmware_version: The firmware version number.
413+ * @bootloader_version: The bootloader version number.
414+ * @hardware_revision: The hardware revision number.
376415 * @ktime_req_ns: kernel timestamp when es58x_set_realtime_diff_ns()
377416 * was called.
378417 * @realtime_diff_ns: difference in nanoseconds between the clocks of
@@ -408,6 +447,10 @@ struct es58x_device { · 29 unmodified lines
408447 struct usb_anchor tx_urbs_idle;
409448 atomic_t tx_urbs_idle_cnt;
410449
450+ struct es58x_sw_version firmware_version;
451+ struct es58x_sw_version bootloader_version;
452+ struct es58x_hw_revision hardware_revision;
453+
411454 u64 ktime_req_ns;
412455 s64 realtime_diff_ns;
413456
@@ -674,6 +717,7 @@ static inline enum es58x_flag es58x_get_flags(const struct sk_buff *skb) · 260 unmodified lines
674717 return es58x_flags;
675718 }
676719
720+/* es58x_core.c. */
677721 int es58x_can_get_echo_skb(struct net_device *netdev, u32 packet_idx,
678722 u64 *tstamps, unsigned int pkts);
679723 int es58x_tx_ack_msg(struct net_device *netdev, u16 tx_free_entries,
@@ -691,9 +735,15 @@ int es58x_rx_cmd_ret_u32(struct net_device *netdev, · 11 unmodified lines
691735 int es58x_send_msg(struct es58x_device *es58x_dev, u8 cmd_type, u8 cmd_id,
692736 const void *msg, u16 cmd_len, int channel_idx);
693737
738+/* es58x_devlink.c. */
739+void es58x_parse_product_info(struct es58x_device *es58x_dev);
740+extern const struct devlink_ops es58x_dl_ops;
741+
742+/* es581_4.c. */
694743 extern const struct es58x_parameters es581_4_param;
695744 extern const struct es58x_operators es581_4_ops;
696745
746+/* es58x_fd.c. */
697747 extern const struct es58x_parameters es58x_fd_param;
698748 extern const struct es58x_operators es58x_fd_ops;
699749
drivers/net/can/usb/etas_es58x/es58x_devlink.c+235−0
@@ -0,0 +1,235 @@
1+// SPDX-License-Identifier: GPL-2.0
2+
3+/* Driver for ETAS GmbH ES58X USB CAN(-FD) Bus Interfaces.
4+ *
5+ * File es58x_devlink.c: report the product information using devlink.
6+ *
7+ * Copyright (c) 2022 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
8+ */
9+
10+#include <linux/ctype.h>
11+#include <linux/device.h>
12+#include <linux/usb.h>
13+#include <net/devlink.h>
14+
15+#include "es58x_core.h"
16+
17+/* USB descriptor index containing the product information string. */
18+#define ES58X_PROD_INFO_IDX 6
19+
20+/**
21+ * es58x_parse_sw_version() - Extract boot loader or firmware version.
22+ * @es58x_dev: ES58X device.
23+ * @prod_info: USB custom string returned by the device.
24+ * @prefix: Select which information should be parsed. Set it to "FW"
25+ * to parse the firmware version or to "BL" to parse the
26+ * bootloader version.
27+ *
28+ * The @prod_info string contains the firmware and the bootloader
29+ * version number all prefixed by a magic string and concatenated with
30+ * other numbers. Depending on the device, the firmware (bootloader)
31+ * format is either "FW_Vxx.xx.xx" ("BL_Vxx.xx.xx") or "FW:xx.xx.xx"
32+ * ("BL:xx.xx.xx") where 'x' represents a digit. @prod_info must
33+ * contains the common part of those prefixes: "FW" or "BL".
34+ *
35+ * Parse @prod_info and store the version number in
36+ * &es58x_dev.firmware_version or &es58x_dev.bootloader_version
37+ * according to @prefix value.
38+ *
39+ * Return: zero on success, -EINVAL if @prefix contains an invalid
40+ * value and -EBADMSG if @prod_info could not be parsed.
41+ */
42+static int es58x_parse_sw_version(struct es58x_device *es58x_dev,
43+ const char *prod_info, const char *prefix)
44+{
45+ struct es58x_sw_version *version;
46+ int major, minor, revision;
47+
48+ if (!strcmp(prefix, "FW"))
49+ version = &es58x_dev->firmware_version;
50+ else if (!strcmp(prefix, "BL"))
51+ version = &es58x_dev->bootloader_version;
52+ else
53+ return -EINVAL;
54+
55+ /* Go to prefix */
56+ prod_info = strstr(prod_info, prefix);
57+ if (!prod_info)
58+ return -EBADMSG;
59+ /* Go to beginning of the version number */
60+ while (!isdigit(*prod_info)) {
61+ prod_info++;
62+ if (!*prod_info)
63+ return -EBADMSG;
64+ }
65+
66+ if (sscanf(prod_info, "%2u.%2u.%2u", &major, &minor, &revision) != 3)
67+ return -EBADMSG;
68+
69+ version->major = major;
70+ version->minor = minor;
71+ version->revision = revision;
72+
73+ return 0;
74+}
75+
76+/**
77+ * es58x_parse_hw_rev() - Extract hardware revision number.
78+ * @es58x_dev: ES58X device.
79+ * @prod_info: USB custom string returned by the device.
80+ *
81+ * @prod_info contains the hardware revision prefixed by a magic
82+ * string and conquenated together with other numbers. Depending on
83+ * the device, the hardware revision format is either
84+ * "HW_VER:axxx/xxx" or "HR:axxx/xxx" where 'a' represents a letter
85+ * and 'x' a digit.
86+ *
87+ * Parse @prod_info and store the hardware revision number in
88+ * &es58x_dev.hardware_revision.
89+ *
90+ * Return: zero on success, -EBADMSG if @prod_info could not be
91+ * parsed.
92+ */
93+static int es58x_parse_hw_rev(struct es58x_device *es58x_dev,
94+ const char *prod_info)
95+{
96+ char letter;
97+ int major, minor;
98+
99+ /* The only occurrence of 'H' is in the hardware revision prefix. */
100+ prod_info = strchr(prod_info, 'H');
101+ if (!prod_info)
102+ return -EBADMSG;
103+ /* Go to beginning of the hardware revision */
104+ prod_info = strchr(prod_info, ':');
105+ if (!prod_info)
106+ return -EBADMSG;
107+ prod_info++;
108+
109+ if (sscanf(prod_info, "%c%3u/%3u", &letter, &major, &minor) != 3)
110+ return -EBADMSG;
111+
112+ es58x_dev->hardware_revision.letter = letter;
113+ es58x_dev->hardware_revision.major = major;
114+ es58x_dev->hardware_revision.minor = minor;
115+
116+ return 0;
117+}
118+
119+/**
120+ * es58x_parse_product_info() - Parse the ES58x product information
121+ * string.
122+ * @es58x_dev: ES58X device.
123+ *
124+ * Retrieve the product information string and parse it to extract the
125+ * firmware version, the bootloader version and the hardware
126+ * revision.
127+ *
128+ * If the function fails, simply emit a log message and continue
129+ * because product information is not critical for the driver to
130+ * operate.
131+ */
132+void es58x_parse_product_info(struct es58x_device *es58x_dev)
133+{
134+ char *prod_info;
135+
136+ prod_info = usb_cache_string(es58x_dev->udev, ES58X_PROD_INFO_IDX);
137+ if (!prod_info) {
138+ dev_warn(es58x_dev->dev,
139+ "could not retrieve the product info string\n");
140+ return;
141+ }
142+
143+ if (es58x_parse_sw_version(es58x_dev, prod_info, "FW") ||
144+ es58x_parse_sw_version(es58x_dev, prod_info, "BL") ||
145+ es58x_parse_hw_rev(es58x_dev, prod_info))
146+ dev_info(es58x_dev->dev,
147+ "could not parse product info: '%s'\n", prod_info);
148+
149+ kfree(prod_info);
150+}
151+
152+/**
153+ * es58x_sw_version_is_set() - Check if the version is a valid number.
154+ * @sw_ver: Version number of either the firmware or the bootloader.
155+ *
156+ * If &es58x_sw_version.major, &es58x_sw_version.minor and
157+ * &es58x_sw_version.revision are all zero, the product string could
158+ * not be parsed and the version number is invalid.
159+ */
160+static inline bool es58x_sw_version_is_set(struct es58x_sw_version *sw_ver)
161+{
162+ return sw_ver->major || sw_ver->minor || sw_ver->revision;
163+}
164+
165+/**
166+ * es58x_hw_revision_is_set() - Check if the revision is a valid number.
167+ * @hw_rev: Revision number of the hardware.
168+ *
169+ * If &es58x_hw_revision.letter is the null character, the product
170+ * string could not be parsed and the hardware revision number is
171+ * invalid.
172+ */
173+static inline bool es58x_hw_revision_is_set(struct es58x_hw_revision *hw_rev)
174+{
175+ return hw_rev->letter != '\0';
176+}
177+
178+/**
179+ * es58x_devlink_info_get() - Report the product information.
180+ * @devlink: Devlink.
181+ * @req: skb wrapper where to put requested information.
182+ * @extack: Unused.
183+ *
184+ * Report the firmware version, the bootloader version, the hardware
185+ * revision and the serial number through netlink.
186+ *
187+ * Return: zero on success, errno when any error occurs.
188+ */
189+static int es58x_devlink_info_get(struct devlink *devlink,
190+ struct devlink_info_req *req,
191+ struct netlink_ext_ack *extack)
192+{
193+ struct es58x_device *es58x_dev = devlink_priv(devlink);
194+ struct es58x_sw_version *fw_ver = &es58x_dev->firmware_version;
195+ struct es58x_sw_version *bl_ver = &es58x_dev->bootloader_version;
196+ struct es58x_hw_revision *hw_rev = &es58x_dev->hardware_revision;
197+ char buf[max(sizeof("xx.xx.xx"), sizeof("axxx/xxx"))];
198+ int ret = 0;
199+
200+ if (es58x_sw_version_is_set(fw_ver)) {
201+ snprintf(buf, sizeof(buf), "%02u.%02u.%02u",
202+ fw_ver->major, fw_ver->minor, fw_ver->revision);
203+ ret = devlink_info_version_running_put(req,
204+ DEVLINK_INFO_VERSION_GENERIC_FW,
205+ buf);
206+ if (ret)
207+ return ret;
208+ }
209+
210+ if (es58x_sw_version_is_set(bl_ver)) {
211+ snprintf(buf, sizeof(buf), "%02u.%02u.%02u",
212+ bl_ver->major, bl_ver->minor, bl_ver->revision);
213+ ret = devlink_info_version_running_put(req,
214+ DEVLINK_INFO_VERSION_GENERIC_FW_BOOTLOADER,
215+ buf);
216+ if (ret)
217+ return ret;
218+ }
219+
220+ if (es58x_hw_revision_is_set(hw_rev)) {
221+ snprintf(buf, sizeof(buf), "%c%03u/%03u",
222+ hw_rev->letter, hw_rev->major, hw_rev->minor);
223+ ret = devlink_info_version_fixed_put(req,
224+ DEVLINK_INFO_VERSION_GENERIC_BOARD_REV,
225+ buf);
226+ if (ret)
227+ return ret;
228+ }
229+
230+ return devlink_info_serial_number_put(req, es58x_dev->udev->serial);
231+}
232+
233+const struct devlink_ops es58x_dl_ops = {
234+ .info_get = es58x_devlink_info_get,
235+};
drivers/net/can/usb/etas_es58x/es58x_fd.c+2−2
@@ -8,12 +8,12 @@ · 7 unmodified lines
88 *
99 * Copyright (c) 2019 Robert Bosch Engineering and Business Solutions. All rights reserved.
1010 * Copyright (c) 2020 ETAS K.K.. All rights reserved.
11− * Copyright (c) 2020, 2021 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
11+ * Copyright (c) 2020-2022 Vincent Mailhol <mailhol.vincent@wanadoo.fr>
1212 */
1313
14+#include <asm/unaligned.h>
1415 #include <linux/kernel.h>
1516 #include <linux/units.h>
16−#include <asm/unaligned.h>
1717
1818 #include "es58x_core.h"
1919 #include "es58x_fd.h"
drivers/net/can/usb/gs_usb.c+69−30
@@ -66,6 +66,7 @@ enum gs_usb_breq { · 65 unmodified lines
6666 GS_USB_BREQ_BT_CONST_EXT,
6767 GS_USB_BREQ_SET_TERMINATION,
6868 GS_USB_BREQ_GET_TERMINATION,
69+ GS_USB_BREQ_GET_STATE,
6970 };
7071
7172 enum gs_can_mode {
@@ -134,6 +135,8 @@ struct gs_device_config { · 62 unmodified lines
134135 /* GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX BIT(9) */
135136 /* GS_CAN_FEATURE_BT_CONST_EXT BIT(10) */
136137 /* GS_CAN_FEATURE_TERMINATION BIT(11) */
138+#define GS_CAN_MODE_BERR_REPORTING BIT(12)
139+/* GS_CAN_FEATURE_GET_STATE BIT(13) */
137140
138141 struct gs_device_mode {
139142 __le32 mode;
@@ -174,7 +177,9 @@ struct gs_device_termination_state { · 34 unmodified lines
174177 #define GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX BIT(9)
175178 #define GS_CAN_FEATURE_BT_CONST_EXT BIT(10)
176179 #define GS_CAN_FEATURE_TERMINATION BIT(11)
177−#define GS_CAN_FEATURE_MASK GENMASK(11, 0)
180+#define GS_CAN_FEATURE_BERR_REPORTING BIT(12)
181+#define GS_CAN_FEATURE_GET_STATE BIT(13)
182+#define GS_CAN_FEATURE_MASK GENMASK(13, 0)
178183
179184 /* internal quirks - keep in GS_CAN_FEATURE space for now */
180185
@@ -294,7 +299,6 @@ struct gs_can { · 113 unmodified lines
294299
295300 struct net_device *netdev;
296301 struct usb_device *udev;
297− struct usb_interface *iface;
298302
299303 struct can_bittiming_const bt_const, data_bt_const;
300304 unsigned int channel; /* channel number */
@@ -378,8 +382,7 @@ static int gs_cmd_reset(struct gs_can *dev) · 77 unmodified lines
378382 .mode = GS_CAN_MODE_RESET,
379383 };
380384
381− return usb_control_msg_send(interface_to_usbdev(dev->iface), 0,
382− GS_USB_BREQ_MODE,
385+ return usb_control_msg_send(dev->udev, 0, GS_USB_BREQ_MODE,
383386 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
384387 dev->channel, 0, &dm, sizeof(dm), 1000,
385388 GFP_KERNEL);
@@ -391,8 +394,7 @@ static inline int gs_usb_get_timestamp(const struct gs_can *dev, · 5 unmodified lines
391394 __le32 timestamp;
392395 int rc;
393396
394− rc = usb_control_msg_recv(interface_to_usbdev(dev->iface), 0,
395− GS_USB_BREQ_TIMESTAMP,
397+ rc = usb_control_msg_recv(dev->udev, 0, GS_USB_BREQ_TIMESTAMP,
396398 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
397399 dev->channel, 0,
398400 &timestamp, sizeof(timestamp),
@@ -669,8 +671,7 @@ static int gs_usb_set_bittiming(struct net_device *netdev) · 270 unmodified lines
669671 };
670672
671673 /* request bit timings */
672− return usb_control_msg_send(interface_to_usbdev(dev->iface), 0,
673− GS_USB_BREQ_BITTIMING,
674+ return usb_control_msg_send(dev->udev, 0, GS_USB_BREQ_BITTIMING,
674675 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
675676 dev->channel, 0, &dbt, sizeof(dbt), 1000,
676677 GFP_KERNEL);
@@ -693,8 +694,7 @@ static int gs_usb_set_data_bittiming(struct net_device *netdev) · 16 unmodified lines
693694 request = GS_USB_BREQ_QUIRK_CANTACT_PRO_DATA_BITTIMING;
694695
695696 /* request data bit timings */
696− return usb_control_msg_send(interface_to_usbdev(dev->iface), 0,
697− request,
697+ return usb_control_msg_send(dev->udev, 0, request,
698698 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
699699 dev->channel, 0, &dbt, sizeof(dbt), 1000,
700700 GFP_KERNEL);
@@ -843,8 +843,6 @@ static int gs_can_open(struct net_device *netdev) · 142 unmodified lines
843843
844844 ctrlmode = dev->can.ctrlmode;
845845 if (ctrlmode & CAN_CTRLMODE_FD) {
846− flags |= GS_CAN_MODE_FD;
847−
848846 if (dev->feature & GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX)
849847 dev->hf_size_tx = struct_size(hf, canfd_quirk, 1);
850848 else
@@ -911,31 +909,34 @@ static int gs_can_open(struct net_device *netdev) · 60 unmodified lines
911909 /* flags */
912910 if (ctrlmode & CAN_CTRLMODE_LOOPBACK)
913911 flags |= GS_CAN_MODE_LOOP_BACK;
914− else if (ctrlmode & CAN_CTRLMODE_LISTENONLY)
912+
913+ if (ctrlmode & CAN_CTRLMODE_LISTENONLY)
915914 flags |= GS_CAN_MODE_LISTEN_ONLY;
916915
917− /* Controller is not allowed to retry TX
918− * this mode is unavailable on atmels uc3c hardware
919− */
916+ if (ctrlmode & CAN_CTRLMODE_3_SAMPLES)
917+ flags |= GS_CAN_MODE_TRIPLE_SAMPLE;
918+
920919 if (ctrlmode & CAN_CTRLMODE_ONE_SHOT)
921920 flags |= GS_CAN_MODE_ONE_SHOT;
922921
923− if (ctrlmode & CAN_CTRLMODE_3_SAMPLES)
924− flags |= GS_CAN_MODE_TRIPLE_SAMPLE;
922+ if (ctrlmode & CAN_CTRLMODE_BERR_REPORTING)
923+ flags |= GS_CAN_MODE_BERR_REPORTING;
924+
925+ if (ctrlmode & CAN_CTRLMODE_FD)
926+ flags |= GS_CAN_MODE_FD;
925927
926928 /* if hardware supports timestamps, enable it */
927− if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
929+ if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP) {
928930 flags |= GS_CAN_MODE_HW_TIMESTAMP;
929931
930− /* start polling timestamp */
931− if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
932+ /* start polling timestamp */
932933 gs_usb_timestamp_init(dev);
934+ }
933935
934936 /* finally start device */
935937 dev->can.state = CAN_STATE_ERROR_ACTIVE;
936938 dm.flags = cpu_to_le32(flags);
937− rc = usb_control_msg_send(interface_to_usbdev(dev->iface), 0,
938− GS_USB_BREQ_MODE,
939+ rc = usb_control_msg_send(dev->udev, 0, GS_USB_BREQ_MODE,
939940 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
940941 dev->channel, 0, &dm, sizeof(dm), 1000,
941942 GFP_KERNEL);
@@ -954,6 +955,41 @@ static int gs_can_open(struct net_device *netdev) · 12 unmodified lines
954955 return 0;
955956 }
956957
958+static int gs_usb_get_state(const struct net_device *netdev,
959+ struct can_berr_counter *bec,
960+ enum can_state *state)
961+{
962+ struct gs_can *dev = netdev_priv(netdev);
963+ struct gs_device_state ds;
964+ int rc;
965+
966+ rc = usb_control_msg_recv(dev->udev, 0, GS_USB_BREQ_GET_STATE,
967+ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
968+ dev->channel, 0,
969+ &ds, sizeof(ds),
970+ USB_CTRL_GET_TIMEOUT,
971+ GFP_KERNEL);
972+ if (rc)
973+ return rc;
974+
975+ if (le32_to_cpu(ds.state) >= CAN_STATE_MAX)
976+ return -EOPNOTSUPP;
977+
978+ *state = le32_to_cpu(ds.state);
979+ bec->txerr = le32_to_cpu(ds.txerr);
980+ bec->rxerr = le32_to_cpu(ds.rxerr);
981+
982+ return 0;
983+}
984+
985+static int gs_usb_can_get_berr_counter(const struct net_device *netdev,
986+ struct can_berr_counter *bec)
987+{
988+ enum can_state state;
989+
990+ return gs_usb_get_state(netdev, bec, &state);
991+}
992+
957993 static int gs_can_close(struct net_device *netdev)
958994 {
959995 int rc;
@@ -1021,8 +1057,7 @@ static int gs_usb_set_identify(struct net_device *netdev, bool do_identify) · 61 unmodified lines
10211057 else
10221058 imode.mode = cpu_to_le32(GS_CAN_IDENTIFY_OFF);
10231059
1024− return usb_control_msg_send(interface_to_usbdev(dev->iface), 0,
1025− GS_USB_BREQ_IDENTIFY,
1060+ return usb_control_msg_send(dev->udev, 0, GS_USB_BREQ_IDENTIFY,
10261061 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
10271062 dev->channel, 0, &imode, sizeof(imode), 100,
10281063 GFP_KERNEL);
@@ -1075,8 +1110,7 @@ static int gs_usb_get_termination(struct net_device *netdev, u16 *term) · 46 unmodified lines
10751110 struct gs_device_termination_state term_state;
10761111 int rc;
10771112
1078− rc = usb_control_msg_recv(interface_to_usbdev(dev->iface), 0,
1079− GS_USB_BREQ_GET_TERMINATION,
1113+ rc = usb_control_msg_recv(dev->udev, 0, GS_USB_BREQ_GET_TERMINATION,
10801114 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
10811115 dev->channel, 0,
10821116 &term_state, sizeof(term_state), 1000,
@@ -1102,8 +1136,7 @@ static int gs_usb_set_termination(struct net_device *netdev, u16 term) · 19 unmodified lines
11021136 else
11031137 term_state.state = cpu_to_le32(GS_CAN_TERMINATION_STATE_OFF);
11041138
1105− return usb_control_msg_send(interface_to_usbdev(dev->iface), 0,
1106− GS_USB_BREQ_SET_TERMINATION,
1139+ return usb_control_msg_send(dev->udev, 0, GS_USB_BREQ_SET_TERMINATION,
11071140 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_INTERFACE,
11081141 dev->channel, 0,
11091142 &term_state, sizeof(term_state), 1000,
@@ -1153,6 +1186,7 @@ static struct gs_can *gs_make_candev(unsigned int channel, · 43 unmodified lines
11531186 netdev->ethtool_ops = &gs_usb_ethtool_ops;
11541187
11551188 netdev->flags |= IFF_ECHO; /* we support full roundtrip echo */
1189+ netdev->dev_id = channel;
11561190
11571191 /* dev setup */
11581192 strcpy(dev->bt_const.name, KBUILD_MODNAME);
@@ -1166,7 +1200,6 @@ static struct gs_can *gs_make_candev(unsigned int channel, · 7 unmodified lines
11661200 dev->bt_const.brp_inc = le32_to_cpu(bt_const.brp_inc);
11671201
11681202 dev->udev = interface_to_usbdev(intf);
1169− dev->iface = intf;
11701203 dev->netdev = netdev;
11711204 dev->channel = channel;
11721205
@@ -1224,6 +1257,12 @@ static struct gs_can *gs_make_candev(unsigned int channel, · 51 unmodified lines
12241257 }
12251258 }
12261259
1260+ if (feature & GS_CAN_FEATURE_BERR_REPORTING)
1261+ dev->can.ctrlmode_supported |= CAN_CTRLMODE_BERR_REPORTING;
1262+
1263+ if (feature & GS_CAN_FEATURE_GET_STATE)
1264+ dev->can.do_get_berr_counter = gs_usb_can_get_berr_counter;
1265+
12271266 /* The CANtact Pro from LinkLayer Labs is based on the
12281267 * LPC54616 µC, which is affected by the NXP LPC USB transfer
12291268 * erratum. However, the current firmware (version 2) doesn't
drivers/net/can/usb/kvaser_usb/Makefile+0−5
@@ -1,8 +1,3 @@
11 # SPDX-License-Identifier: GPL-2.0-only
22 obj-$(CONFIG_CAN_KVASER_USB) += kvaser_usb.o
33 kvaser_usb-y = kvaser_usb_core.o kvaser_usb_leaf.o kvaser_usb_hydra.o
4−
5−# FIXME: temporarily silence -Warray-bounds on non W=1+ builds
6−ifndef KBUILD_EXTRA_WARN
7−CFLAGS_kvaser_usb_hydra.o += -Wno-array-bounds
8−endif
drivers/net/can/usb/kvaser_usb/kvaser_usb.h+27−3
@@ -76,6 +76,14 @@ struct kvaser_usb_tx_urb_context { · 75 unmodified lines
7676 u32 echo_index;
7777 };
7878
79+struct kvaser_usb_busparams {
80+ __le32 bitrate;
81+ u8 tseg1;
82+ u8 tseg2;
83+ u8 sjw;
84+ u8 nsamples;
85+} __packed;
86+
7987 struct kvaser_usb {
8088 struct usb_device *udev;
8189 struct usb_interface *intf;
@@ -104,13 +112,19 @@ struct kvaser_usb_net_priv { · 22 unmodified lines
104112 struct can_priv can;
105113 struct can_berr_counter bec;
106114
115+ /* subdriver-specific data */
116+ void *sub_priv;
117+
107118 struct kvaser_usb *dev;
108119 struct net_device *netdev;
109120 int channel;
110121
111− struct completion start_comp, stop_comp, flush_comp;
122+ struct completion start_comp, stop_comp, flush_comp,
123+ get_busparams_comp;
112124 struct usb_anchor tx_submitted;
113125
126+ struct kvaser_usb_busparams busparams_nominal, busparams_data;
127+
114128 spinlock_t tx_contexts_lock; /* lock for active_tx_contexts */
115129 int active_tx_contexts;
116130 struct kvaser_usb_tx_urb_context tx_contexts[];
@@ -120,11 +134,15 @@ struct kvaser_usb_net_priv { · 3 unmodified lines
120134 * struct kvaser_usb_dev_ops - Device specific functions
121135 * @dev_set_mode: used for can.do_set_mode
122136 * @dev_set_bittiming: used for can.do_set_bittiming
137+ * @dev_get_busparams: readback arbitration busparams
123138 * @dev_set_data_bittiming: used for can.do_set_data_bittiming
139+ * @dev_get_data_busparams: readback data busparams
124140 * @dev_get_berr_counter: used for can.do_get_berr_counter
125141 *
126142 * @dev_setup_endpoints: setup USB in and out endpoints
127143 * @dev_init_card: initialize card
144+ * @dev_init_channel: initialize channel
145+ * @dev_remove_channel: uninitialize channel
128146 * @dev_get_software_info: get software info
129147 * @dev_get_software_details: get software details
130148 * @dev_get_card_info: get card info
@@ -140,12 +158,18 @@ struct kvaser_usb_net_priv { · 9 unmodified lines
140158 */
141159 struct kvaser_usb_dev_ops {
142160 int (*dev_set_mode)(struct net_device *netdev, enum can_mode mode);
143− int (*dev_set_bittiming)(struct net_device *netdev);
144− int (*dev_set_data_bittiming)(struct net_device *netdev);
161+ int (*dev_set_bittiming)(const struct net_device *netdev,
162+ const struct kvaser_usb_busparams *busparams);
163+ int (*dev_get_busparams)(struct kvaser_usb_net_priv *priv);
164+ int (*dev_set_data_bittiming)(const struct net_device *netdev,
165+ const struct kvaser_usb_busparams *busparams);
166+ int (*dev_get_data_busparams)(struct kvaser_usb_net_priv *priv);
145167 int (*dev_get_berr_counter)(const struct net_device *netdev,
146168 struct can_berr_counter *bec);
147169 int (*dev_setup_endpoints)(struct kvaser_usb *dev);
148170 int (*dev_init_card)(struct kvaser_usb *dev);
171+ int (*dev_init_channel)(struct kvaser_usb_net_priv *priv);
172+ void (*dev_remove_channel)(struct kvaser_usb_net_priv *priv);
149173 int (*dev_get_software_info)(struct kvaser_usb *dev);
150174 int (*dev_get_software_details)(struct kvaser_usb *dev);
151175 int (*dev_get_card_info)(struct kvaser_usb *dev);
drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c+104−9
@@ -440,10 +440,6 @@ static int kvaser_usb_open(struct net_device *netdev) · 439 unmodified lines
440440 if (err)
441441 return err;
442442
443− err = kvaser_usb_setup_rx_urbs(dev);
444− if (err)
445− goto error;
446−
447443 err = ops->dev_set_opt_mode(priv);
448444 if (err)
449445 goto error;
@@ -534,6 +530,91 @@ static int kvaser_usb_close(struct net_device *netdev) · 84 unmodified lines
534530 return 0;
535531 }
536532
533+static int kvaser_usb_set_bittiming(struct net_device *netdev)
534+{
535+ struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
536+ struct kvaser_usb *dev = priv->dev;
537+ const struct kvaser_usb_dev_ops *ops = dev->driver_info->ops;
538+ struct can_bittiming *bt = &priv->can.bittiming;
539+ struct kvaser_usb_busparams busparams;
540+ int tseg1 = bt->prop_seg + bt->phase_seg1;
541+ int tseg2 = bt->phase_seg2;
542+ int sjw = bt->sjw;
543+ int err;
544+
545+ busparams.bitrate = cpu_to_le32(bt->bitrate);
546+ busparams.sjw = (u8)sjw;
547+ busparams.tseg1 = (u8)tseg1;
548+ busparams.tseg2 = (u8)tseg2;
549+ if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)
550+ busparams.nsamples = 3;
551+ else
552+ busparams.nsamples = 1;
553+
554+ err = ops->dev_set_bittiming(netdev, &busparams);
555+ if (err)
556+ return err;
557+
558+ err = kvaser_usb_setup_rx_urbs(priv->dev);
559+ if (err)
560+ return err;
561+
562+ err = ops->dev_get_busparams(priv);
563+ if (err) {
564+ /* Treat EOPNOTSUPP as success */
565+ if (err == -EOPNOTSUPP)
566+ err = 0;
567+ return err;
568+ }
569+
570+ if (memcmp(&busparams, &priv->busparams_nominal,
571+ sizeof(priv->busparams_nominal)) != 0)
572+ err = -EINVAL;
573+
574+ return err;
575+}
576+
577+static int kvaser_usb_set_data_bittiming(struct net_device *netdev)
578+{
579+ struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
580+ struct kvaser_usb *dev = priv->dev;
581+ const struct kvaser_usb_dev_ops *ops = dev->driver_info->ops;
582+ struct can_bittiming *dbt = &priv->can.data_bittiming;
583+ struct kvaser_usb_busparams busparams;
584+ int tseg1 = dbt->prop_seg + dbt->phase_seg1;
585+ int tseg2 = dbt->phase_seg2;
586+ int sjw = dbt->sjw;
587+ int err;
588+
589+ if (!ops->dev_set_data_bittiming ||
590+ !ops->dev_get_data_busparams)
591+ return -EOPNOTSUPP;
592+
593+ busparams.bitrate = cpu_to_le32(dbt->bitrate);
594+ busparams.sjw = (u8)sjw;
595+ busparams.tseg1 = (u8)tseg1;
596+ busparams.tseg2 = (u8)tseg2;
597+ busparams.nsamples = 1;
598+
599+ err = ops->dev_set_data_bittiming(netdev, &busparams);
600+ if (err)
601+ return err;
602+
603+ err = kvaser_usb_setup_rx_urbs(priv->dev);
604+ if (err)
605+ return err;
606+
607+ err = ops->dev_get_data_busparams(priv);
608+ if (err)
609+ return err;
610+
611+ if (memcmp(&busparams, &priv->busparams_data,
612+ sizeof(priv->busparams_data)) != 0)
613+ err = -EINVAL;
614+
615+ return err;
616+}
617+
537618 static void kvaser_usb_write_bulk_callback(struct urb *urb)
538619 {
539620 struct kvaser_usb_tx_urb_context *context = urb->context;
@@ -684,6 +765,7 @@ static const struct ethtool_ops kvaser_usb_ethtool_ops_hwts = { · 144 unmodified lines
684765
685766 static void kvaser_usb_remove_interfaces(struct kvaser_usb *dev)
686767 {
768+ const struct kvaser_usb_dev_ops *ops = dev->driver_info->ops;
687769 int i;
688770
689771 for (i = 0; i < dev->nchannels; i++) {
@@ -699,6 +781,9 @@ static void kvaser_usb_remove_interfaces(struct kvaser_usb *dev) · 9 unmodified lines
699781 if (!dev->nets[i])
700782 continue;
701783
784+ if (ops->dev_remove_channel)
785+ ops->dev_remove_channel(dev->nets[i]);
786+
702787 free_candev(dev->nets[i]->netdev);
703788 }
704789 }
@@ -730,6 +815,7 @@ static int kvaser_usb_init_one(struct kvaser_usb *dev, int channel) · 25 unmodified lines
730815 init_completion(&priv->start_comp);
731816 init_completion(&priv->stop_comp);
732817 init_completion(&priv->flush_comp);
818+ init_completion(&priv->get_busparams_comp);
733819 priv->can.ctrlmode_supported = 0;
734820
735821 priv->dev = dev;
@@ -742,7 +828,7 @@ static int kvaser_usb_init_one(struct kvaser_usb *dev, int channel) · 6 unmodified lines
742828 priv->can.state = CAN_STATE_STOPPED;
743829 priv->can.clock.freq = dev->cfg->clock.freq;
744830 priv->can.bittiming_const = dev->cfg->bittiming_const;
745− priv->can.do_set_bittiming = ops->dev_set_bittiming;
831+ priv->can.do_set_bittiming = kvaser_usb_set_bittiming;
746832 priv->can.do_set_mode = ops->dev_set_mode;
747833 if ((driver_info->quirks & KVASER_USB_QUIRK_HAS_TXRX_ERRORS) ||
748834 (priv->dev->card_data.capabilities & KVASER_USB_CAP_BERR_CAP))
@@ -754,7 +840,7 @@ static int kvaser_usb_init_one(struct kvaser_usb *dev, int channel) · 5 unmodified lines
754840
755841 if (priv->can.ctrlmode_supported & CAN_CTRLMODE_FD) {
756842 priv->can.data_bittiming_const = dev->cfg->data_bittiming_const;
757− priv->can.do_set_data_bittiming = ops->dev_set_data_bittiming;
843+ priv->can.do_set_data_bittiming = kvaser_usb_set_data_bittiming;
758844 }
759845
760846 netdev->flags |= IFF_ECHO;
@@ -772,17 +858,26 @@ static int kvaser_usb_init_one(struct kvaser_usb *dev, int channel) · 11 unmodified lines
772858
773859 dev->nets[channel] = priv;
774860
861+ if (ops->dev_init_channel) {
862+ err = ops->dev_init_channel(priv);
863+ if (err)
864+ goto err;
865+ }
866+
775867 err = register_candev(netdev);
776868 if (err) {
777869 dev_err(&dev->intf->dev, "Failed to register CAN device\n");
778− free_candev(netdev);
779− dev->nets[channel] = NULL;
780− return err;
870+ goto err;
781871 }
782872
783873 netdev_dbg(netdev, "device registered\n");
784874
785875 return 0;
876+
877+err:
878+ free_candev(netdev);
879+ dev->nets[channel] = NULL;
880+ return err;
786881 }
787882
788883 static int kvaser_usb_probe(struct usb_interface *intf,
drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c+130−30
@@ -45,6 +45,8 @@ static const struct kvaser_usb_dev_cfg kvaser_usb_hydra_dev_cfg_rt; · 44 unmodified lines
4545
4646 /* Minihydra command IDs */
4747 #define CMD_SET_BUSPARAMS_REQ 16
48+#define CMD_GET_BUSPARAMS_REQ 17
49+#define CMD_GET_BUSPARAMS_RESP 18
4850 #define CMD_GET_CHIP_STATE_REQ 19
4951 #define CMD_CHIP_STATE_EVENT 20
5052 #define CMD_SET_DRIVERMODE_REQ 21
@@ -196,21 +198,26 @@ struct kvaser_cmd_chip_state_event { · 145 unmodified lines
196198 #define KVASER_USB_HYDRA_BUS_MODE_CANFD_ISO 0x01
197199 #define KVASER_USB_HYDRA_BUS_MODE_NONISO 0x02
198200 struct kvaser_cmd_set_busparams {
199− __le32 bitrate;
200− u8 tseg1;
201− u8 tseg2;
202− u8 sjw;
203− u8 nsamples;
201+ struct kvaser_usb_busparams busparams_nominal;
204202 u8 reserved0[4];
205− __le32 bitrate_d;
206− u8 tseg1_d;
207− u8 tseg2_d;
208− u8 sjw_d;
209− u8 nsamples_d;
203+ struct kvaser_usb_busparams busparams_data;
210204 u8 canfd_mode;
211205 u8 reserved1[7];
212206 } __packed;
213207
208+/* Busparam type */
209+#define KVASER_USB_HYDRA_BUSPARAM_TYPE_CAN 0x00
210+#define KVASER_USB_HYDRA_BUSPARAM_TYPE_CANFD 0x01
211+struct kvaser_cmd_get_busparams_req {
212+ u8 type;
213+ u8 reserved[27];
214+} __packed;
215+
216+struct kvaser_cmd_get_busparams_res {
217+ struct kvaser_usb_busparams busparams;
218+ u8 reserved[20];
219+} __packed;
220+
214221 /* Ctrl modes */
215222 #define KVASER_USB_HYDRA_CTRLMODE_NORMAL 0x01
216223 #define KVASER_USB_HYDRA_CTRLMODE_LISTEN 0x02
@@ -281,6 +288,8 @@ struct kvaser_cmd { · 64 unmodified lines
281288 struct kvaser_cmd_error_event error_event;
282289
283290 struct kvaser_cmd_set_busparams set_busparams_req;
291+ struct kvaser_cmd_get_busparams_req get_busparams_req;
292+ struct kvaser_cmd_get_busparams_res get_busparams_res;
284293
285294 struct kvaser_cmd_chip_state_event chip_state_event;
286295
@@ -363,6 +372,10 @@ struct kvaser_cmd_ext { · 76 unmodified lines
363372 } __packed;
364373 } __packed;
365374
375+struct kvaser_usb_net_hydra_priv {
376+ int pending_get_busparams_type;
377+};
378+
366379 static const struct can_bittiming_const kvaser_usb_hydra_kcan_bittiming_c = {
367380 .name = "kvaser_usb_kcan",
368381 .tseg1_min = 1,
@@ -840,6 +853,39 @@ static void kvaser_usb_hydra_flush_queue_reply(const struct kvaser_usb *dev, · 471 unmodified lines
840853 complete(&priv->flush_comp);
841854 }
842855
856+static void kvaser_usb_hydra_get_busparams_reply(const struct kvaser_usb *dev,
857+ const struct kvaser_cmd *cmd)
858+{
859+ struct kvaser_usb_net_priv *priv;
860+ struct kvaser_usb_net_hydra_priv *hydra;
861+
862+ priv = kvaser_usb_hydra_net_priv_from_cmd(dev, cmd);
863+ if (!priv)
864+ return;
865+
866+ hydra = priv->sub_priv;
867+ if (!hydra)
868+ return;
869+
870+ switch (hydra->pending_get_busparams_type) {
871+ case KVASER_USB_HYDRA_BUSPARAM_TYPE_CAN:
872+ memcpy(&priv->busparams_nominal, &cmd->get_busparams_res.busparams,
873+ sizeof(priv->busparams_nominal));
874+ break;
875+ case KVASER_USB_HYDRA_BUSPARAM_TYPE_CANFD:
876+ memcpy(&priv->busparams_data, &cmd->get_busparams_res.busparams,
877+ sizeof(priv->busparams_nominal));
878+ break;
879+ default:
880+ dev_warn(&dev->intf->dev, "Unknown get_busparams_type %d\n",
881+ hydra->pending_get_busparams_type);
882+ break;
883+ }
884+ hydra->pending_get_busparams_type = -1;
885+
886+ complete(&priv->get_busparams_comp);
887+}
888+
843889 static void
844890 kvaser_usb_hydra_bus_status_to_can_state(const struct kvaser_usb_net_priv *priv,
845891 u8 bus_status,
@@ -1326,6 +1372,10 @@ static void kvaser_usb_hydra_handle_cmd_std(const struct kvaser_usb *dev, · 480 unmodified lines
13261372 kvaser_usb_hydra_state_event(dev, cmd);
13271373 break;
13281374
1375+ case CMD_GET_BUSPARAMS_RESP:
1376+ kvaser_usb_hydra_get_busparams_reply(dev, cmd);
1377+ break;
1378+
13291379 case CMD_ERROR_EVENT:
13301380 kvaser_usb_hydra_error_event(dev, cmd);
13311381 break;
@@ -1522,15 +1572,58 @@ static int kvaser_usb_hydra_set_mode(struct net_device *netdev, · 190 unmodified lines
15221572 return err;
15231573 }
15241574
1525−static int kvaser_usb_hydra_set_bittiming(struct net_device *netdev)
1575+static int kvaser_usb_hydra_get_busparams(struct kvaser_usb_net_priv *priv,
1576+ int busparams_type)
1577+{
1578+ struct kvaser_usb *dev = priv->dev;
1579+ struct kvaser_usb_net_hydra_priv *hydra = priv->sub_priv;
1580+ struct kvaser_cmd *cmd;
1581+ int err;
1582+
1583+ if (!hydra)
1584+ return -EINVAL;
1585+
1586+ cmd = kcalloc(1, sizeof(struct kvaser_cmd), GFP_KERNEL);
1587+ if (!cmd)
1588+ return -ENOMEM;
1589+
1590+ cmd->header.cmd_no = CMD_GET_BUSPARAMS_REQ;
1591+ kvaser_usb_hydra_set_cmd_dest_he
1592+ (cmd, dev->card_data.hydra.channel_to_he[priv->channel]);
1593+ kvaser_usb_hydra_set_cmd_transid
1594+ (cmd, kvaser_usb_hydra_get_next_transid(dev));
1595+ cmd->get_busparams_req.type = busparams_type;
1596+ hydra->pending_get_busparams_type = busparams_type;
1597+
1598+ reinit_completion(&priv->get_busparams_comp);
1599+
1600+ err = kvaser_usb_send_cmd(dev, cmd, kvaser_usb_hydra_cmd_size(cmd));
1601+ if (err)
1602+ return err;
1603+
1604+ if (!wait_for_completion_timeout(&priv->get_busparams_comp,
1605+ msecs_to_jiffies(KVASER_USB_TIMEOUT)))
1606+ return -ETIMEDOUT;
1607+
1608+ return err;
1609+}
1610+
1611+static int kvaser_usb_hydra_get_nominal_busparams(struct kvaser_usb_net_priv *priv)
1612+{
1613+ return kvaser_usb_hydra_get_busparams(priv, KVASER_USB_HYDRA_BUSPARAM_TYPE_CAN);
1614+}
1615+
1616+static int kvaser_usb_hydra_get_data_busparams(struct kvaser_usb_net_priv *priv)
1617+{
1618+ return kvaser_usb_hydra_get_busparams(priv, KVASER_USB_HYDRA_BUSPARAM_TYPE_CANFD);
1619+}
1620+
1621+static int kvaser_usb_hydra_set_bittiming(const struct net_device *netdev,
1622+ const struct kvaser_usb_busparams *busparams)
15261623 {
15271624 struct kvaser_cmd *cmd;
15281625 struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
1529− struct can_bittiming *bt = &priv->can.bittiming;
15301626 struct kvaser_usb *dev = priv->dev;
1531− int tseg1 = bt->prop_seg + bt->phase_seg1;
1532− int tseg2 = bt->phase_seg2;
1533− int sjw = bt->sjw;
15341627 int err;
15351628
15361629 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
@@ -1538,11 +1631,8 @@ static int kvaser_usb_hydra_set_bittiming(struct net_device *netdev) · 1 unmodified line
15381631 return -ENOMEM;
15391632
15401633 cmd->header.cmd_no = CMD_SET_BUSPARAMS_REQ;
1541− cmd->set_busparams_req.bitrate = cpu_to_le32(bt->bitrate);
1542− cmd->set_busparams_req.sjw = (u8)sjw;
1543− cmd->set_busparams_req.tseg1 = (u8)tseg1;
1544− cmd->set_busparams_req.tseg2 = (u8)tseg2;
1545− cmd->set_busparams_req.nsamples = 1;
1634+ memcpy(&cmd->set_busparams_req.busparams_nominal, busparams,
1635+ sizeof(cmd->set_busparams_req.busparams_nominal));
15461636
15471637 kvaser_usb_hydra_set_cmd_dest_he
15481638 (cmd, dev->card_data.hydra.channel_to_he[priv->channel]);
@@ -1556,15 +1646,12 @@ static int kvaser_usb_hydra_set_bittiming(struct net_device *netdev) · 7 unmodified lines
15561646 return err;
15571647 }
15581648
1559−static int kvaser_usb_hydra_set_data_bittiming(struct net_device *netdev)
1649+static int kvaser_usb_hydra_set_data_bittiming(const struct net_device *netdev,
1650+ const struct kvaser_usb_busparams *busparams)
15601651 {
15611652 struct kvaser_cmd *cmd;
15621653 struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
1563− struct can_bittiming *dbt = &priv->can.data_bittiming;
15641654 struct kvaser_usb *dev = priv->dev;
1565− int tseg1 = dbt->prop_seg + dbt->phase_seg1;
1566− int tseg2 = dbt->phase_seg2;
1567− int sjw = dbt->sjw;
15681655 int err;
15691656
15701657 cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
@@ -1572,11 +1659,8 @@ static int kvaser_usb_hydra_set_data_bittiming(struct net_device *netdev) · 1 unmodified line
15721659 return -ENOMEM;
15731660
15741661 cmd->header.cmd_no = CMD_SET_BUSPARAMS_FD_REQ;
1575− cmd->set_busparams_req.bitrate_d = cpu_to_le32(dbt->bitrate);
1576− cmd->set_busparams_req.sjw_d = (u8)sjw;
1577− cmd->set_busparams_req.tseg1_d = (u8)tseg1;
1578− cmd->set_busparams_req.tseg2_d = (u8)tseg2;
1579− cmd->set_busparams_req.nsamples_d = 1;
1662+ memcpy(&cmd->set_busparams_req.busparams_data, busparams,
1663+ sizeof(cmd->set_busparams_req.busparams_data));
15801664
15811665 if (priv->can.ctrlmode & CAN_CTRLMODE_FD) {
15821666 if (priv->can.ctrlmode & CAN_CTRLMODE_FD_NON_ISO)
@@ -1683,6 +1767,19 @@ static int kvaser_usb_hydra_init_card(struct kvaser_usb *dev) · 100 unmodified lines
16831767 return 0;
16841768 }
16851769
1770+static int kvaser_usb_hydra_init_channel(struct kvaser_usb_net_priv *priv)
1771+{
1772+ struct kvaser_usb_net_hydra_priv *hydra;
1773+
1774+ hydra = devm_kzalloc(&priv->dev->intf->dev, sizeof(*hydra), GFP_KERNEL);
1775+ if (!hydra)
1776+ return -ENOMEM;
1777+
1778+ priv->sub_priv = hydra;
1779+
1780+ return 0;
1781+}
1782+
16861783 static int kvaser_usb_hydra_get_software_info(struct kvaser_usb *dev)
16871784 {
16881785 struct kvaser_cmd cmd;
@@ -2027,10 +2124,13 @@ kvaser_usb_hydra_frame_to_cmd(const struct kvaser_usb_net_priv *priv, · 338 unmodified lines
20272124 const struct kvaser_usb_dev_ops kvaser_usb_hydra_dev_ops = {
20282125 .dev_set_mode = kvaser_usb_hydra_set_mode,
20292126 .dev_set_bittiming = kvaser_usb_hydra_set_bittiming,
2127+ .dev_get_busparams = kvaser_usb_hydra_get_nominal_busparams,
20302128 .dev_set_data_bittiming = kvaser_usb_hydra_set_data_bittiming,
2129+ .dev_get_data_busparams = kvaser_usb_hydra_get_data_busparams,
20312130 .dev_get_berr_counter = kvaser_usb_hydra_get_berr_counter,
20322131 .dev_setup_endpoints = kvaser_usb_hydra_setup_endpoints,
20332132 .dev_init_card = kvaser_usb_hydra_init_card,
2133+ .dev_init_channel = kvaser_usb_hydra_init_channel,
20342134 .dev_get_software_info = kvaser_usb_hydra_get_software_info,
20352135 .dev_get_software_details = kvaser_usb_hydra_get_software_details,
20362136 .dev_get_card_info = kvaser_usb_hydra_get_card_info,
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c+415−49
@@ -21,6 +21,7 @@ · 20 unmodified lines
2121 #include <linux/types.h>
2222 #include <linux/units.h>
2323 #include <linux/usb.h>
24+#include <linux/workqueue.h>
2425
2526 #include <linux/can.h>
2627 #include <linux/can/dev.h>
@@ -56,6 +57,9 @@ · 29 unmodified lines
5657 #define CMD_RX_EXT_MESSAGE 14
5758 #define CMD_TX_EXT_MESSAGE 15
5859 #define CMD_SET_BUS_PARAMS 16
60+#define CMD_GET_BUS_PARAMS 17
61+#define CMD_GET_BUS_PARAMS_REPLY 18
62+#define CMD_GET_CHIP_STATE 19
5963 #define CMD_CHIP_STATE_EVENT 20
6064 #define CMD_SET_CTRL_MODE 21
6165 #define CMD_RESET_CHIP 24
@@ -70,10 +74,13 @@ · 8 unmodified lines
7074 #define CMD_GET_CARD_INFO_REPLY 35
7175 #define CMD_GET_SOFTWARE_INFO 38
7276 #define CMD_GET_SOFTWARE_INFO_REPLY 39
77+#define CMD_ERROR_EVENT 45
7378 #define CMD_FLUSH_QUEUE 48
7479 #define CMD_TX_ACKNOWLEDGE 50
7580 #define CMD_CAN_ERROR_EVENT 51
7681 #define CMD_FLUSH_QUEUE_REPLY 68
82+#define CMD_GET_CAPABILITIES_REQ 95
83+#define CMD_GET_CAPABILITIES_RESP 96
7784
7885 #define CMD_LEAF_LOG_MESSAGE 106
7986
@@ -83,6 +90,8 @@ · 3 unmodified lines
8390 #define KVASER_USB_LEAF_SWOPTION_FREQ_32_MHZ_CLK BIT(5)
8491 #define KVASER_USB_LEAF_SWOPTION_FREQ_24_MHZ_CLK BIT(6)
8592
93+#define KVASER_USB_LEAF_SWOPTION_EXT_CAP BIT(12)
94+
8695 /* error factors */
8796 #define M16C_EF_ACKE BIT(0)
8897 #define M16C_EF_CRCE BIT(1)
@@ -157,11 +166,7 @@ struct usbcan_cmd_softinfo { · 68 unmodified lines
157166 struct kvaser_cmd_busparams {
158167 u8 tid;
159168 u8 channel;
160− __le32 bitrate;
161− u8 tseg1;
162− u8 tseg2;
163− u8 sjw;
164− u8 no_samp;
169+ struct kvaser_usb_busparams busparams;
165170 } __packed;
166171
167172 struct kvaser_cmd_tx_can {
@@ -230,7 +235,7 @@ struct kvaser_cmd_tx_acknowledge_header { · 62 unmodified lines
230235 u8 tid;
231236 } __packed;
232237
233−struct leaf_cmd_error_event {
238+struct leaf_cmd_can_error_event {
234239 u8 tid;
235240 u8 flags;
236241 __le16 time[3];
@@ -242,7 +247,7 @@ struct leaf_cmd_error_event { · 5 unmodified lines
242247 u8 error_factor;
243248 } __packed;
244249
245−struct usbcan_cmd_error_event {
250+struct usbcan_cmd_can_error_event {
246251 u8 tid;
247252 u8 padding;
248253 u8 tx_errors_count_ch0;
@@ -254,6 +259,28 @@ struct usbcan_cmd_error_event { · 5 unmodified lines
254259 __le16 time;
255260 } __packed;
256261
262+/* CMD_ERROR_EVENT error codes */
263+#define KVASER_USB_LEAF_ERROR_EVENT_TX_QUEUE_FULL 0x8
264+#define KVASER_USB_LEAF_ERROR_EVENT_PARAM 0x9
265+
266+struct leaf_cmd_error_event {
267+ u8 tid;
268+ u8 error_code;
269+ __le16 timestamp[3];
270+ __le16 padding;
271+ __le16 info1;
272+ __le16 info2;
273+} __packed;
274+
275+struct usbcan_cmd_error_event {
276+ u8 tid;
277+ u8 error_code;
278+ __le16 info1;
279+ __le16 info2;
280+ __le16 timestamp;
281+ __le16 padding;
282+} __packed;
283+
257284 struct kvaser_cmd_ctrl_mode {
258285 u8 tid;
259286 u8 channel;
@@ -278,6 +305,28 @@ struct leaf_cmd_log_message { · 18 unmodified lines
278305 u8 data[8];
279306 } __packed;
280307
308+/* Sub commands for cap_req and cap_res */
309+#define KVASER_USB_LEAF_CAP_CMD_LISTEN_MODE 0x02
310+#define KVASER_USB_LEAF_CAP_CMD_ERR_REPORT 0x05
311+struct kvaser_cmd_cap_req {
312+ __le16 padding0;
313+ __le16 cap_cmd;
314+ __le16 padding1;
315+ __le16 channel;
316+} __packed;
317+
318+/* Status codes for cap_res */
319+#define KVASER_USB_LEAF_CAP_STAT_OK 0x00
320+#define KVASER_USB_LEAF_CAP_STAT_NOT_IMPL 0x01
321+#define KVASER_USB_LEAF_CAP_STAT_UNAVAIL 0x02
322+struct kvaser_cmd_cap_res {
323+ __le16 padding;
324+ __le16 cap_cmd;
325+ __le16 status;
326+ __le32 mask;
327+ __le32 value;
328+} __packed;
329+
281330 struct kvaser_cmd {
282331 u8 len;
283332 u8 id;
@@ -293,14 +342,18 @@ struct kvaser_cmd { · 9 unmodified lines
293342 struct leaf_cmd_softinfo softinfo;
294343 struct leaf_cmd_rx_can rx_can;
295344 struct leaf_cmd_chip_state_event chip_state_event;
296− struct leaf_cmd_error_event error_event;
345+ struct leaf_cmd_can_error_event can_error_event;
297346 struct leaf_cmd_log_message log_message;
347+ struct leaf_cmd_error_event error_event;
348+ struct kvaser_cmd_cap_req cap_req;
349+ struct kvaser_cmd_cap_res cap_res;
298350 } __packed leaf;
299351
300352 union {
301353 struct usbcan_cmd_softinfo softinfo;
302354 struct usbcan_cmd_rx_can rx_can;
303355 struct usbcan_cmd_chip_state_event chip_state_event;
356+ struct usbcan_cmd_can_error_event can_error_event;
304357 struct usbcan_cmd_error_event error_event;
305358 } __packed usbcan;
306359
@@ -323,7 +376,10 @@ static const u8 kvaser_usb_leaf_cmd_sizes_leaf[] = { · 16 unmodified lines
323376 [CMD_RX_EXT_MESSAGE] = kvaser_fsize(u.leaf.rx_can),
324377 [CMD_LEAF_LOG_MESSAGE] = kvaser_fsize(u.leaf.log_message),
325378 [CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.leaf.chip_state_event),
326− [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.leaf.error_event),
379+ [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.leaf.can_error_event),
380+ [CMD_GET_CAPABILITIES_RESP] = kvaser_fsize(u.leaf.cap_res),
381+ [CMD_GET_BUS_PARAMS_REPLY] = kvaser_fsize(u.busparams),
382+ [CMD_ERROR_EVENT] = kvaser_fsize(u.leaf.error_event),
327383 /* ignored events: */
328384 [CMD_FLUSH_QUEUE_REPLY] = CMD_SIZE_ANY,
329385 };
@@ -337,7 +393,8 @@ static const u8 kvaser_usb_leaf_cmd_sizes_usbcan[] = { · 7 unmodified lines
337393 [CMD_RX_STD_MESSAGE] = kvaser_fsize(u.usbcan.rx_can),
338394 [CMD_RX_EXT_MESSAGE] = kvaser_fsize(u.usbcan.rx_can),
339395 [CMD_CHIP_STATE_EVENT] = kvaser_fsize(u.usbcan.chip_state_event),
340− [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.usbcan.error_event),
396+ [CMD_CAN_ERROR_EVENT] = kvaser_fsize(u.usbcan.can_error_event),
397+ [CMD_ERROR_EVENT] = kvaser_fsize(u.usbcan.error_event),
341398 /* ignored events: */
342399 [CMD_USBCAN_CLOCK_OVERFLOW_EVENT] = CMD_SIZE_ANY,
343400 };
@@ -365,6 +422,15 @@ struct kvaser_usb_err_summary { · 21 unmodified lines
365422 };
366423 };
367424
425+struct kvaser_usb_net_leaf_priv {
426+ struct kvaser_usb_net_priv *net;
427+
428+ struct delayed_work chip_state_req_work;
429+
430+ /* started but not reported as bus-on yet */
431+ bool joining_bus;
432+};
433+
368434 static const struct can_bittiming_const kvaser_usb_leaf_m16c_bittiming_const = {
369435 .name = "kvaser_usb_ucii",
370436 .tseg1_min = 4,
@@ -606,6 +672,9 @@ static void kvaser_usb_leaf_get_software_info_leaf(struct kvaser_usb *dev, · 235 unmodified lines
606672 dev->fw_version = le32_to_cpu(softinfo->fw_version);
607673 dev->max_tx_urbs = le16_to_cpu(softinfo->max_outstanding_tx);
608674
675+ if (sw_options & KVASER_USB_LEAF_SWOPTION_EXT_CAP)
676+ dev->card_data.capabilities |= KVASER_USB_CAP_EXT_CAP;
677+
609678 if (dev->driver_info->quirks & KVASER_USB_QUIRK_IGNORE_CLK_FREQ) {
610679 /* Firmware expects bittiming parameters calculated for 16MHz
611680 * clock, regardless of the actual clock
@@ -693,6 +762,116 @@ static int kvaser_usb_leaf_get_card_info(struct kvaser_usb *dev) · 81 unmodified lines
693762 return 0;
694763 }
695764
765+static int kvaser_usb_leaf_get_single_capability(struct kvaser_usb *dev,
766+ u16 cap_cmd_req, u16 *status)
767+{
768+ struct kvaser_usb_dev_card_data *card_data = &dev->card_data;
769+ struct kvaser_cmd *cmd;
770+ u32 value = 0;
771+ u32 mask = 0;
772+ u16 cap_cmd_res;
773+ int err;
774+ int i;
775+
776+ cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
777+ if (!cmd)
778+ return -ENOMEM;
779+
780+ cmd->id = CMD_GET_CAPABILITIES_REQ;
781+ cmd->u.leaf.cap_req.cap_cmd = cpu_to_le16(cap_cmd_req);
782+ cmd->len = CMD_HEADER_LEN + sizeof(struct kvaser_cmd_cap_req);
783+
784+ err = kvaser_usb_send_cmd(dev, cmd, cmd->len);
785+ if (err)
786+ goto end;
787+
788+ err = kvaser_usb_leaf_wait_cmd(dev, CMD_GET_CAPABILITIES_RESP, cmd);
789+ if (err)
790+ goto end;
791+
792+ *status = le16_to_cpu(cmd->u.leaf.cap_res.status);
793+
794+ if (*status != KVASER_USB_LEAF_CAP_STAT_OK)
795+ goto end;
796+
797+ cap_cmd_res = le16_to_cpu(cmd->u.leaf.cap_res.cap_cmd);
798+ switch (cap_cmd_res) {
799+ case KVASER_USB_LEAF_CAP_CMD_LISTEN_MODE:
800+ case KVASER_USB_LEAF_CAP_CMD_ERR_REPORT:
801+ value = le32_to_cpu(cmd->u.leaf.cap_res.value);
802+ mask = le32_to_cpu(cmd->u.leaf.cap_res.mask);
803+ break;
804+ default:
805+ dev_warn(&dev->intf->dev, "Unknown capability command %u\n",
806+ cap_cmd_res);
807+ break;
808+ }
809+
810+ for (i = 0; i < dev->nchannels; i++) {
811+ if (BIT(i) & (value & mask)) {
812+ switch (cap_cmd_res) {
813+ case KVASER_USB_LEAF_CAP_CMD_LISTEN_MODE:
814+ card_data->ctrlmode_supported |=
815+ CAN_CTRLMODE_LISTENONLY;
816+ break;
817+ case KVASER_USB_LEAF_CAP_CMD_ERR_REPORT:
818+ card_data->capabilities |=
819+ KVASER_USB_CAP_BERR_CAP;
820+ break;
821+ }
822+ }
823+ }
824+
825+end:
826+ kfree(cmd);
827+
828+ return err;
829+}
830+
831+static int kvaser_usb_leaf_get_capabilities_leaf(struct kvaser_usb *dev)
832+{
833+ int err;
834+ u16 status;
835+
836+ if (!(dev->card_data.capabilities & KVASER_USB_CAP_EXT_CAP)) {
837+ dev_info(&dev->intf->dev,
838+ "No extended capability support. Upgrade device firmware.\n");
839+ return 0;
840+ }
841+
842+ err = kvaser_usb_leaf_get_single_capability(dev,
843+ KVASER_USB_LEAF_CAP_CMD_LISTEN_MODE,
844+ &status);
845+ if (err)
846+ return err;
847+ if (status)
848+ dev_info(&dev->intf->dev,
849+ "KVASER_USB_LEAF_CAP_CMD_LISTEN_MODE failed %u\n",
850+ status);
851+
852+ err = kvaser_usb_leaf_get_single_capability(dev,
853+ KVASER_USB_LEAF_CAP_CMD_ERR_REPORT,
854+ &status);
855+ if (err)
856+ return err;
857+ if (status)
858+ dev_info(&dev->intf->dev,
859+ "KVASER_USB_LEAF_CAP_CMD_ERR_REPORT failed %u\n",
860+ status);
861+
862+ return 0;
863+}
864+
865+static int kvaser_usb_leaf_get_capabilities(struct kvaser_usb *dev)
866+{
867+ int err = 0;
868+
869+ if (dev->driver_info->family == KVASER_LEAF)
870+ err = kvaser_usb_leaf_get_capabilities_leaf(dev);
871+
872+ return err;
873+}
874+
696875 static void kvaser_usb_leaf_tx_acknowledge(const struct kvaser_usb *dev,
697876 const struct kvaser_cmd *cmd)
698877 {
@@ -721,7 +900,7 @@ static void kvaser_usb_leaf_tx_acknowledge(const struct kvaser_usb *dev, · 22 unmodified lines
721900 context = &priv->tx_contexts[tid % dev->max_tx_urbs];
722901
723902 /* Sometimes the state change doesn't come after a bus-off event */
724− if (priv->can.restart_ms && priv->can.state >= CAN_STATE_BUS_OFF) {
903+ if (priv->can.restart_ms && priv->can.state == CAN_STATE_BUS_OFF) {
725904 struct sk_buff *skb;
726905 struct can_frame *cf;
727906
@@ -774,11 +953,22 @@ static int kvaser_usb_leaf_simple_cmd_async(struct kvaser_usb_net_priv *priv, · 46 unmodified lines
774953 return err;
775954 }
776955
956+static void kvaser_usb_leaf_chip_state_req_work(struct work_struct *work)
957+{
958+ struct kvaser_usb_net_leaf_priv *leaf =
959+ container_of(work, struct kvaser_usb_net_leaf_priv,
960+ chip_state_req_work.work);
961+ struct kvaser_usb_net_priv *priv = leaf->net;
962+
963+ kvaser_usb_leaf_simple_cmd_async(priv, CMD_GET_CHIP_STATE);
964+}
965+
777966 static void
778967 kvaser_usb_leaf_rx_error_update_can_state(struct kvaser_usb_net_priv *priv,
779968 const struct kvaser_usb_err_summary *es,
780969 struct can_frame *cf)
781970 {
971+ struct kvaser_usb_net_leaf_priv *leaf = priv->sub_priv;
782972 struct kvaser_usb *dev = priv->dev;
783973 struct net_device_stats *stats = &priv->netdev->stats;
784974 enum can_state cur_state, new_state, tx_state, rx_state;
@@ -792,20 +982,32 @@ kvaser_usb_leaf_rx_error_update_can_state(struct kvaser_usb_net_priv *priv, · 7 unmodified lines
792982 new_state = CAN_STATE_BUS_OFF;
793983 } else if (es->status & M16C_STATE_BUS_PASSIVE) {
794984 new_state = CAN_STATE_ERROR_PASSIVE;
795− } else if (es->status & M16C_STATE_BUS_ERROR) {
985+ } else if ((es->status & M16C_STATE_BUS_ERROR) &&
986+ cur_state >= CAN_STATE_BUS_OFF) {
796987 /* Guard against spurious error events after a busoff */
797− if (cur_state < CAN_STATE_BUS_OFF) {
798− if (es->txerr >= 128 || es->rxerr >= 128)
799− new_state = CAN_STATE_ERROR_PASSIVE;
800− else if (es->txerr >= 96 || es->rxerr >= 96)
801− new_state = CAN_STATE_ERROR_WARNING;
802− else if (cur_state > CAN_STATE_ERROR_ACTIVE)
803− new_state = CAN_STATE_ERROR_ACTIVE;
804− }
988+ } else if (es->txerr >= 128 || es->rxerr >= 128) {
989+ new_state = CAN_STATE_ERROR_PASSIVE;
990+ } else if (es->txerr >= 96 || es->rxerr >= 96) {
991+ new_state = CAN_STATE_ERROR_WARNING;
992+ } else {
993+ new_state = CAN_STATE_ERROR_ACTIVE;
805994 }
806995
807− if (!es->status)
808− new_state = CAN_STATE_ERROR_ACTIVE;
996+ /* 0bfd:0124 FW 4.18.778 was observed to send the initial
997+ * CMD_CHIP_STATE_EVENT after CMD_START_CHIP with M16C_STATE_BUS_OFF
998+ * bit set if the channel was bus-off when it was last stopped (even
999+ * across chip resets). This bit will clear shortly afterwards, without
1000+ * triggering a second unsolicited chip state event.
1001+ * Ignore this initial bus-off.
1002+ */
1003+ if (leaf->joining_bus) {
1004+ if (new_state == CAN_STATE_BUS_OFF) {
1005+ netdev_dbg(priv->netdev, "ignoring bus-off during startup");
1006+ new_state = cur_state;
1007+ } else {
1008+ leaf->joining_bus = false;
1009+ }
1010+ }
8091011
8101012 if (new_state != cur_state) {
8111013 tx_state = (es->txerr >= es->rxerr) ? new_state : 0;
@@ -815,7 +1017,7 @@ kvaser_usb_leaf_rx_error_update_can_state(struct kvaser_usb_net_priv *priv, · 3 unmodified lines
8151017 }
8161018
8171019 if (priv->can.restart_ms &&
818− cur_state >= CAN_STATE_BUS_OFF &&
1020+ cur_state == CAN_STATE_BUS_OFF &&
8191021 new_state < CAN_STATE_BUS_OFF)
8201022 priv->can.can_stats.restarts++;
8211023
@@ -849,6 +1051,7 @@ static void kvaser_usb_leaf_rx_error(const struct kvaser_usb *dev, · 27 unmodified lines
8491051 struct sk_buff *skb;
8501052 struct net_device_stats *stats;
8511053 struct kvaser_usb_net_priv *priv;
1054+ struct kvaser_usb_net_leaf_priv *leaf;
8521055 enum can_state old_state, new_state;
8531056
8541057 if (es->channel >= dev->nchannels) {
@@ -858,8 +1061,13 @@ static void kvaser_usb_leaf_rx_error(const struct kvaser_usb *dev, · 3 unmodified lines
8581061 }
8591062
8601063 priv = dev->nets[es->channel];
1064+ leaf = priv->sub_priv;
8611065 stats = &priv->netdev->stats;
8621066
1067+ /* Ignore e.g. state change to bus-off reported just after stopping */
1068+ if (!netif_running(priv->netdev))
1069+ return;
1070+
8631071 /* Update all of the CAN interface's state and error counters before
8641072 * trying any memory allocation that can actually fail with -ENOMEM.
8651073 *
@@ -874,6 +1082,17 @@ static void kvaser_usb_leaf_rx_error(const struct kvaser_usb *dev, · 8 unmodified lines
8741082 kvaser_usb_leaf_rx_error_update_can_state(priv, es, &tmp_cf);
8751083 new_state = priv->can.state;
8761084
1085+ /* If there are errors, request status updates periodically as we do
1086+ * not get automatic notifications of improved state.
1087+ * Also request updates if we saw a stale BUS_OFF during startup
1088+ * (joining_bus).
1089+ */
1090+ if (new_state < CAN_STATE_BUS_OFF &&
1091+ (es->rxerr || es->txerr || new_state == CAN_STATE_ERROR_PASSIVE ||
1092+ leaf->joining_bus))
1093+ schedule_delayed_work(&leaf->chip_state_req_work,
1094+ msecs_to_jiffies(500));
1095+
8771096 skb = alloc_can_err_skb(priv->netdev, &cf);
8781097 if (!skb) {
8791098 stats->rx_dropped++;
@@ -891,7 +1110,7 @@ static void kvaser_usb_leaf_rx_error(const struct kvaser_usb *dev, · 11 unmodified lines
8911110 }
8921111
8931112 if (priv->can.restart_ms &&
894− old_state >= CAN_STATE_BUS_OFF &&
1113+ old_state == CAN_STATE_BUS_OFF &&
8951114 new_state < CAN_STATE_BUS_OFF) {
8961115 cf->can_id |= CAN_ERR_RESTARTED;
8971116 netif_carrier_on(priv->netdev);
@@ -990,11 +1209,11 @@ static void kvaser_usb_leaf_usbcan_rx_error(const struct kvaser_usb *dev, · 92 unmodified lines
9901209
9911210 case CMD_CAN_ERROR_EVENT:
9921211 es.channel = 0;
993− es.status = cmd->u.usbcan.error_event.status_ch0;
994− es.txerr = cmd->u.usbcan.error_event.tx_errors_count_ch0;
995− es.rxerr = cmd->u.usbcan.error_event.rx_errors_count_ch0;
1212+ es.status = cmd->u.usbcan.can_error_event.status_ch0;
1213+ es.txerr = cmd->u.usbcan.can_error_event.tx_errors_count_ch0;
1214+ es.rxerr = cmd->u.usbcan.can_error_event.rx_errors_count_ch0;
9961215 es.usbcan.other_ch_status =
997− cmd->u.usbcan.error_event.status_ch1;
1216+ cmd->u.usbcan.can_error_event.status_ch1;
9981217 kvaser_usb_leaf_usbcan_conditionally_rx_error(dev, &es);
9991218
10001219 /* The USBCAN firmware supports up to 2 channels.
@@ -1002,13 +1221,13 @@ static void kvaser_usb_leaf_usbcan_rx_error(const struct kvaser_usb *dev, · 1 unmodified line
10021221 */
10031222 if (dev->nchannels == MAX_USBCAN_NET_DEVICES) {
10041223 es.channel = 1;
1005− es.status = cmd->u.usbcan.error_event.status_ch1;
1224+ es.status = cmd->u.usbcan.can_error_event.status_ch1;
10061225 es.txerr =
1007− cmd->u.usbcan.error_event.tx_errors_count_ch1;
1226+ cmd->u.usbcan.can_error_event.tx_errors_count_ch1;
10081227 es.rxerr =
1009− cmd->u.usbcan.error_event.rx_errors_count_ch1;
1228+ cmd->u.usbcan.can_error_event.rx_errors_count_ch1;
10101229 es.usbcan.other_ch_status =
1011− cmd->u.usbcan.error_event.status_ch0;
1230+ cmd->u.usbcan.can_error_event.status_ch0;
10121231 kvaser_usb_leaf_usbcan_conditionally_rx_error(dev, &es);
10131232 }
10141233 break;
@@ -1025,11 +1244,11 @@ static void kvaser_usb_leaf_leaf_rx_error(const struct kvaser_usb *dev, · 10 unmodified lines
10251244
10261245 switch (cmd->id) {
10271246 case CMD_CAN_ERROR_EVENT:
1028− es.channel = cmd->u.leaf.error_event.channel;
1029− es.status = cmd->u.leaf.error_event.status;
1030− es.txerr = cmd->u.leaf.error_event.tx_errors_count;
1031− es.rxerr = cmd->u.leaf.error_event.rx_errors_count;
1032− es.leaf.error_factor = cmd->u.leaf.error_event.error_factor;
1247+ es.channel = cmd->u.leaf.can_error_event.channel;
1248+ es.status = cmd->u.leaf.can_error_event.status;
1249+ es.txerr = cmd->u.leaf.can_error_event.tx_errors_count;
1250+ es.rxerr = cmd->u.leaf.can_error_event.rx_errors_count;
1251+ es.leaf.error_factor = cmd->u.leaf.can_error_event.error_factor;
10331252 break;
10341253 case CMD_LEAF_LOG_MESSAGE:
10351254 es.channel = cmd->u.leaf.log_message.channel;
@@ -1162,6 +1381,74 @@ static void kvaser_usb_leaf_rx_can_msg(const struct kvaser_usb *dev, · 126 unmodified lines
11621381 netif_rx(skb);
11631382 }
11641383
1384+static void kvaser_usb_leaf_error_event_parameter(const struct kvaser_usb *dev,
1385+ const struct kvaser_cmd *cmd)
1386+{
1387+ u16 info1 = 0;
1388+
1389+ switch (dev->driver_info->family) {
1390+ case KVASER_LEAF:
1391+ info1 = le16_to_cpu(cmd->u.leaf.error_event.info1);
1392+ break;
1393+ case KVASER_USBCAN:
1394+ info1 = le16_to_cpu(cmd->u.usbcan.error_event.info1);
1395+ break;
1396+ }
1397+
1398+ /* info1 will contain the offending cmd_no */
1399+ switch (info1) {
1400+ case CMD_SET_CTRL_MODE:
1401+ dev_warn(&dev->intf->dev,
1402+ "CMD_SET_CTRL_MODE error in parameter\n");
1403+ break;
1404+
1405+ case CMD_SET_BUS_PARAMS:
1406+ dev_warn(&dev->intf->dev,
1407+ "CMD_SET_BUS_PARAMS error in parameter\n");
1408+ break;
1409+
1410+ default:
1411+ dev_warn(&dev->intf->dev,
1412+ "Unhandled parameter error event cmd_no (%u)\n",
1413+ info1);
1414+ break;
1415+ }
1416+}
1417+
1418+static void kvaser_usb_leaf_error_event(const struct kvaser_usb *dev,
1419+ const struct kvaser_cmd *cmd)
1420+{
1421+ u8 error_code = 0;
1422+
1423+ switch (dev->driver_info->family) {
1424+ case KVASER_LEAF:
1425+ error_code = cmd->u.leaf.error_event.error_code;
1426+ break;
1427+ case KVASER_USBCAN:
1428+ error_code = cmd->u.usbcan.error_event.error_code;
1429+ break;
1430+ }
1431+
1432+ switch (error_code) {
1433+ case KVASER_USB_LEAF_ERROR_EVENT_TX_QUEUE_FULL:
1434+ /* Received additional CAN message, when firmware TX queue is
1435+ * already full. Something is wrong with the driver.
1436+ * This should never happen!
1437+ */
1438+ dev_err(&dev->intf->dev,
1439+ "Received error event TX_QUEUE_FULL\n");
1440+ break;
1441+ case KVASER_USB_LEAF_ERROR_EVENT_PARAM:
1442+ kvaser_usb_leaf_error_event_parameter(dev, cmd);
1443+ break;
1444+
1445+ default:
1446+ dev_warn(&dev->intf->dev,
1447+ "Unhandled error event (%d)\n", error_code);
1448+ break;
1449+ }
1450+}
1451+
11651452 static void kvaser_usb_leaf_start_chip_reply(const struct kvaser_usb *dev,
11661453 const struct kvaser_cmd *cmd)
11671454 {
@@ -1202,6 +1489,25 @@ static void kvaser_usb_leaf_stop_chip_reply(const struct kvaser_usb *dev, · 34 unmodified lines
12021489 complete(&priv->stop_comp);
12031490 }
12041491
1492+static void kvaser_usb_leaf_get_busparams_reply(const struct kvaser_usb *dev,
1493+ const struct kvaser_cmd *cmd)
1494+{
1495+ struct kvaser_usb_net_priv *priv;
1496+ u8 channel = cmd->u.busparams.channel;
1497+
1498+ if (channel >= dev->nchannels) {
1499+ dev_err(&dev->intf->dev,
1500+ "Invalid channel number (%d)\n", channel);
1501+ return;
1502+ }
1503+
1504+ priv = dev->nets[channel];
1505+ memcpy(&priv->busparams_nominal, &cmd->u.busparams.busparams,
1506+ sizeof(priv->busparams_nominal));
1507+
1508+ complete(&priv->get_busparams_comp);
1509+}
1510+
12051511 static void kvaser_usb_leaf_handle_command(const struct kvaser_usb *dev,
12061512 const struct kvaser_cmd *cmd)
12071513 {
@@ -1240,6 +1546,14 @@ static void kvaser_usb_leaf_handle_command(const struct kvaser_usb *dev, · 32 unmodified lines
12401546 kvaser_usb_leaf_tx_acknowledge(dev, cmd);
12411547 break;
12421548
1549+ case CMD_ERROR_EVENT:
1550+ kvaser_usb_leaf_error_event(dev, cmd);
1551+ break;
1552+
1553+ case CMD_GET_BUS_PARAMS_REPLY:
1554+ kvaser_usb_leaf_get_busparams_reply(dev, cmd);
1555+ break;
1556+
12431557 /* Ignored commands */
12441558 case CMD_USBCAN_CLOCK_OVERFLOW_EVENT:
12451559 if (dev->driver_info->family != KVASER_USBCAN)
@@ -1318,8 +1632,11 @@ static int kvaser_usb_leaf_set_opt_mode(const struct kvaser_usb_net_priv *priv) · 72 unmodified lines
13181632
13191633 static int kvaser_usb_leaf_start_chip(struct kvaser_usb_net_priv *priv)
13201634 {
1635+ struct kvaser_usb_net_leaf_priv *leaf = priv->sub_priv;
13211636 int err;
13221637
1638+ leaf->joining_bus = true;
1639+
13231640 reinit_completion(&priv->start_comp);
13241641
13251642 err = kvaser_usb_leaf_send_simple_cmd(priv->dev, CMD_START_CHIP,
@@ -1336,10 +1653,13 @@ static int kvaser_usb_leaf_start_chip(struct kvaser_usb_net_priv *priv) · 10 unmodified lines
13361653
13371654 static int kvaser_usb_leaf_stop_chip(struct kvaser_usb_net_priv *priv)
13381655 {
1656+ struct kvaser_usb_net_leaf_priv *leaf = priv->sub_priv;
13391657 int err;
13401658
13411659 reinit_completion(&priv->stop_comp);
13421660
1661+ cancel_delayed_work(&leaf->chip_state_req_work);
1662+
13431663 err = kvaser_usb_leaf_send_simple_cmd(priv->dev, CMD_STOP_CHIP,
13441664 priv->channel);
13451665 if (err)
@@ -1386,10 +1706,35 @@ static int kvaser_usb_leaf_init_card(struct kvaser_usb *dev) · 40 unmodified lines
13861706 return 0;
13871707 }
13881708
1389−static int kvaser_usb_leaf_set_bittiming(struct net_device *netdev)
1709+static int kvaser_usb_leaf_init_channel(struct kvaser_usb_net_priv *priv)
1710+{
1711+ struct kvaser_usb_net_leaf_priv *leaf;
1712+
1713+ leaf = devm_kzalloc(&priv->dev->intf->dev, sizeof(*leaf), GFP_KERNEL);
1714+ if (!leaf)
1715+ return -ENOMEM;
1716+
1717+ leaf->net = priv;
1718+ INIT_DELAYED_WORK(&leaf->chip_state_req_work,
1719+ kvaser_usb_leaf_chip_state_req_work);
1720+
1721+ priv->sub_priv = leaf;
1722+
1723+ return 0;
1724+}
1725+
1726+static void kvaser_usb_leaf_remove_channel(struct kvaser_usb_net_priv *priv)
1727+{
1728+ struct kvaser_usb_net_leaf_priv *leaf = priv->sub_priv;
1729+
1730+ if (leaf)
1731+ cancel_delayed_work_sync(&leaf->chip_state_req_work);
1732+}
1733+
1734+static int kvaser_usb_leaf_set_bittiming(const struct net_device *netdev,
1735+ const struct kvaser_usb_busparams *busparams)
13901736 {
13911737 struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
1392− struct can_bittiming *bt = &priv->can.bittiming;
13931738 struct kvaser_usb *dev = priv->dev;
13941739 struct kvaser_cmd *cmd;
13951740 int rc;
@@ -1402,15 +1747,8 @@ static int kvaser_usb_leaf_set_bittiming(struct net_device *netdev) · 6 unmodified lines
14021747 cmd->len = CMD_HEADER_LEN + sizeof(struct kvaser_cmd_busparams);
14031748 cmd->u.busparams.channel = priv->channel;
14041749 cmd->u.busparams.tid = 0xff;
1405− cmd->u.busparams.bitrate = cpu_to_le32(bt->bitrate);
1406− cmd->u.busparams.sjw = bt->sjw;
1407− cmd->u.busparams.tseg1 = bt->prop_seg + bt->phase_seg1;
1408− cmd->u.busparams.tseg2 = bt->phase_seg2;
1409−
1410− if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)
1411− cmd->u.busparams.no_samp = 3;
1412− else
1413− cmd->u.busparams.no_samp = 1;
1750+ memcpy(&cmd->u.busparams.busparams, busparams,
1751+ sizeof(cmd->u.busparams.busparams));
14141752
14151753 rc = kvaser_usb_send_cmd(dev, cmd, cmd->len);
14161754
@@ -1418,16 +1756,40 @@ static int kvaser_usb_leaf_set_bittiming(struct net_device *netdev) · 1 unmodified line
14181756 return rc;
14191757 }
14201758
1759+static int kvaser_usb_leaf_get_busparams(struct kvaser_usb_net_priv *priv)
1760+{
1761+ int err;
1762+
1763+ if (priv->dev->driver_info->family == KVASER_USBCAN)
1764+ return -EOPNOTSUPP;
1765+
1766+ reinit_completion(&priv->get_busparams_comp);
1767+
1768+ err = kvaser_usb_leaf_send_simple_cmd(priv->dev, CMD_GET_BUS_PARAMS,
1769+ priv->channel);
1770+ if (err)
1771+ return err;
1772+
1773+ if (!wait_for_completion_timeout(&priv->get_busparams_comp,
1774+ msecs_to_jiffies(KVASER_USB_TIMEOUT)))
1775+ return -ETIMEDOUT;
1776+
1777+ return 0;
1778+}
1779+
14211780 static int kvaser_usb_leaf_set_mode(struct net_device *netdev,
14221781 enum can_mode mode)
14231782 {
14241783 struct kvaser_usb_net_priv *priv = netdev_priv(netdev);
1784+ struct kvaser_usb_net_leaf_priv *leaf = priv->sub_priv;
14251785 int err;
14261786
14271787 switch (mode) {
14281788 case CAN_MODE_START:
14291789 kvaser_usb_unlink_tx_urbs(priv);
14301790
1791+ leaf->joining_bus = true;
1792+
14311793 err = kvaser_usb_leaf_simple_cmd_async(priv, CMD_START_CHIP);
14321794 if (err)
14331795 return err;
@@ -1479,14 +1841,18 @@ static int kvaser_usb_leaf_setup_endpoints(struct kvaser_usb *dev) · 45 unmodified lines
14791841 const struct kvaser_usb_dev_ops kvaser_usb_leaf_dev_ops = {
14801842 .dev_set_mode = kvaser_usb_leaf_set_mode,
14811843 .dev_set_bittiming = kvaser_usb_leaf_set_bittiming,
1844+ .dev_get_busparams = kvaser_usb_leaf_get_busparams,
14821845 .dev_set_data_bittiming = NULL,
1846+ .dev_get_data_busparams = NULL,
14831847 .dev_get_berr_counter = kvaser_usb_leaf_get_berr_counter,
14841848 .dev_setup_endpoints = kvaser_usb_leaf_setup_endpoints,
14851849 .dev_init_card = kvaser_usb_leaf_init_card,
1850+ .dev_init_channel = kvaser_usb_leaf_init_channel,
1851+ .dev_remove_channel = kvaser_usb_leaf_remove_channel,
14861852 .dev_get_software_info = kvaser_usb_leaf_get_software_info,
14871853 .dev_get_software_details = NULL,
14881854 .dev_get_card_info = kvaser_usb_leaf_get_card_info,
1489− .dev_get_capabilities = NULL,
1855+ .dev_get_capabilities = kvaser_usb_leaf_get_capabilities,
14901856 .dev_set_opt_mode = kvaser_usb_leaf_set_opt_mode,
14911857 .dev_start_chip = kvaser_usb_leaf_start_chip,
14921858 .dev_stop_chip = kvaser_usb_leaf_stop_chip,
drivers/net/can/usb/ucan.c+5−7
@@ -245,7 +245,8 @@ struct ucan_message_in { · 244 unmodified lines
245245 /* CAN transmission complete
246246 * (type == UCAN_IN_TX_COMPLETE)
247247 */
248− struct ucan_tx_complete_entry_t can_tx_complete_msg[0];
248+ DECLARE_FLEX_ARRAY(struct ucan_tx_complete_entry_t,
249+ can_tx_complete_msg);
249250 } __aligned(0x4) msg;
250251 } __packed __aligned(0x4);
251252
@@ -276,7 +277,6 @@ struct ucan_priv { · 24 unmodified lines
276277
277278 /* linux USB device structures */
278279 struct usb_device *udev;
279− struct usb_interface *intf;
280280 struct net_device *netdev;
281281
282282 /* lock for can->echo_skb (used around
@@ -1500,7 +1500,6 @@ static int ucan_probe(struct usb_interface *intf, · 1217 unmodified lines
15001500
15011501 /* initialize data */
15021502 up->udev = udev;
1503− up->intf = intf;
15041503 up->netdev = netdev;
15051504 up->intf_index = iface_desc->desc.bInterfaceNumber;
15061505 up->in_ep_addr = in_ep_addr;
@@ -1533,9 +1532,8 @@ static int ucan_probe(struct usb_interface *intf, · 26 unmodified lines
15331532 sizeof(union ucan_ctl_payload));
15341533 if (ret > 0) {
15351534 /* copy string while ensuring zero termination */
1536− strncpy(firmware_str, up->ctl_msg_buffer->raw,
1537− sizeof(union ucan_ctl_payload));
1538− firmware_str[sizeof(union ucan_ctl_payload)] = '\0';
1535+ strscpy(firmware_str, up->ctl_msg_buffer->raw,
1536+ sizeof(union ucan_ctl_payload) + 1);
15391537 } else {
15401538 strcpy(firmware_str, "unknown");
15411539 }
@@ -1581,7 +1579,7 @@ static void ucan_disconnect(struct usb_interface *intf) · 39 unmodified lines
15811579 usb_set_intfdata(intf, NULL);
15821580
15831581 if (up) {
1584− unregister_netdev(up->netdev);
1582+ unregister_candev(up->netdev);
15851583 free_candev(up->netdev);
15861584 }
15871585 }
drivers/net/can/vxcan.c+1−1
@@ -236,7 +236,7 @@ static int vxcan_newlink(struct net *net, struct net_device *dev, · 235 unmodified lines
236236
237237 netif_carrier_off(peer);
238238
239− err = rtnl_configure_link(peer, ifmp);
239+ err = rtnl_configure_link(peer, ifmp, 0, NULL);
240240 if (err < 0)
241241 goto unregister_network_device;
242242
drivers/net/dsa/Kconfig+2−0
@@ -18,6 +18,7 @@ config NET_DSA_BCM_SF2 · 17 unmodified lines
1818
1919 config NET_DSA_LOOP
2020 tristate "DSA mock-up Ethernet switch chip support"
21+ select NET_DSA_TAG_NONE
2122 select FIXED_PHY
2223 help
2324 This enables support for a fake mock-up switch chip which
@@ -99,6 +100,7 @@ config NET_DSA_SMSC_LAN9303_MDIO · 75 unmodified lines
99100
100101 config NET_DSA_VITESSE_VSC73XX
101102 tristate
103+ select NET_DSA_TAG_NONE
102104 select FIXED_PHY
103105 select VITESSE_PHY
104106 select GPIOLIB
drivers/net/dsa/b53/Kconfig+1−0
@@ -2,6 +2,7 @@ · 1 unmodified line
22 menuconfig B53
33 tristate "Broadcom BCM53xx managed switch support"
44 depends on NET_DSA
5+ select NET_DSA_TAG_NONE
56 select NET_DSA_TAG_BRCM
67 select NET_DSA_TAG_BRCM_LEGACY
78 select NET_DSA_TAG_BRCM_PREPEND
drivers/net/dsa/hirschmann/hellcreek.c+0−5
@@ -1176,11 +1176,6 @@ static int hellcreek_devlink_info_get(struct dsa_switch *ds, · 1175 unmodified lines
11761176 struct netlink_ext_ack *extack)
11771177 {
11781178 struct hellcreek *hellcreek = ds->priv;
1179− int ret;
1180−
1181− ret = devlink_info_driver_name_put(req, "hellcreek");
1182− if (ret)
1183− return ret;
11841179
11851180 return devlink_info_version_fixed_put(req,
11861181 DEVLINK_INFO_VERSION_GENERIC_ASIC_ID,
drivers/net/dsa/lan9303-core.c+3−1
@@ -1005,9 +1005,11 @@ static void lan9303_get_ethtool_stats(struct dsa_switch *ds, int port, · 1004 unmodified lines
10051005 ret = lan9303_read_switch_port(
10061006 chip, port, lan9303_mib[u].offset, &reg);
10071007
1008− if (ret)
1008+ if (ret) {
10091009 dev_warn(chip->dev, "Reading status port %d reg %u failed\n",
10101010 port, lan9303_mib[u].offset);
1011+ reg = 0;
1012+ }
10111013 data[u] = reg;
10121014 }
10131015 }
drivers/net/dsa/lan9303_i2c.c+2−3
@@ -29,8 +29,7 @@ static const struct regmap_config lan9303_i2c_regmap_config = { · 28 unmodified lines
2929 .cache_type = REGCACHE_NONE,
3030 };
3131
32−static int lan9303_i2c_probe(struct i2c_client *client,
33− const struct i2c_device_id *id)
32+static int lan9303_i2c_probe(struct i2c_client *client)
3433 {
3534 struct lan9303_i2c *sw_dev;
3635 int ret;
@@ -106,7 +105,7 @@ static struct i2c_driver lan9303_i2c_driver = { · 69 unmodified lines
106105 .name = "LAN9303_I2C",
107106 .of_match_table = of_match_ptr(lan9303_i2c_of_match),
108107 },
109− .probe = lan9303_i2c_probe,
108+ .probe_new = lan9303_i2c_probe,
110109 .remove = lan9303_i2c_remove,
111110 .shutdown = lan9303_i2c_shutdown,
112111 .id_table = lan9303_i2c_id,
drivers/net/dsa/microchip/Kconfig+1−0
@@ -3,6 +3,7 @@ menuconfig NET_DSA_MICROCHIP_KSZ_COMMON · 2 unmodified lines
33 tristate "Microchip KSZ8795/KSZ9477/LAN937x series switch support"
44 depends on NET_DSA
55 select NET_DSA_TAG_KSZ
6+ select NET_DSA_TAG_NONE
67 help
78 This driver adds support for Microchip KSZ9477 series switch and
89 KSZ8795/KSZ88x3 switch chips.
drivers/net/dsa/microchip/ksz8.h+1−0
@@ -57,5 +57,6 @@ int ksz8_reset_switch(struct ksz_device *dev); · 56 unmodified lines
5757 int ksz8_switch_detect(struct ksz_device *dev);
5858 int ksz8_switch_init(struct ksz_device *dev);
5959 void ksz8_switch_exit(struct ksz_device *dev);
60+int ksz8_change_mtu(struct ksz_device *dev, int port, int mtu);
6061
6162 #endif
drivers/net/dsa/microchip/ksz8795.c+63−12
@@ -76,6 +76,57 @@ int ksz8_reset_switch(struct ksz_device *dev) · 75 unmodified lines
7676 return 0;
7777 }
7878
79+static int ksz8863_change_mtu(struct ksz_device *dev, int frame_size)
80+{
81+ u8 ctrl2 = 0;
82+
83+ if (frame_size <= KSZ8_LEGAL_PACKET_SIZE)
84+ ctrl2 |= KSZ8863_LEGAL_PACKET_ENABLE;
85+ else if (frame_size > KSZ8863_NORMAL_PACKET_SIZE)
86+ ctrl2 |= KSZ8863_HUGE_PACKET_ENABLE;
87+
88+ return ksz_rmw8(dev, REG_SW_CTRL_2, KSZ8863_LEGAL_PACKET_ENABLE |
89+ KSZ8863_HUGE_PACKET_ENABLE, ctrl2);
90+}
91+
92+static int ksz8795_change_mtu(struct ksz_device *dev, int frame_size)
93+{
94+ u8 ctrl1 = 0, ctrl2 = 0;
95+ int ret;
96+
97+ if (frame_size > KSZ8_LEGAL_PACKET_SIZE)
98+ ctrl2 |= SW_LEGAL_PACKET_DISABLE;
99+ else if (frame_size > KSZ8863_NORMAL_PACKET_SIZE)
100+ ctrl1 |= SW_HUGE_PACKET;
101+
102+ ret = ksz_rmw8(dev, REG_SW_CTRL_1, SW_HUGE_PACKET, ctrl1);
103+ if (ret)
104+ return ret;
105+
106+ return ksz_rmw8(dev, REG_SW_CTRL_2, SW_LEGAL_PACKET_DISABLE, ctrl2);
107+}
108+
109+int ksz8_change_mtu(struct ksz_device *dev, int port, int mtu)
110+{
111+ u16 frame_size;
112+
113+ if (!dsa_is_cpu_port(dev->ds, port))
114+ return 0;
115+
116+ frame_size = mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;
117+
118+ switch (dev->chip_id) {
119+ case KSZ8795_CHIP_ID:
120+ case KSZ8794_CHIP_ID:
121+ case KSZ8765_CHIP_ID:
122+ return ksz8795_change_mtu(dev, frame_size);
123+ case KSZ8830_CHIP_ID:
124+ return ksz8863_change_mtu(dev, frame_size);
125+ }
126+
127+ return -EOPNOTSUPP;
128+}
129+
79130 static void ksz8795_set_prio_queue(struct ksz_device *dev, int port, int queue)
80131 {
81132 u8 hi, lo;
@@ -1233,8 +1284,6 @@ void ksz8_config_cpu_port(struct dsa_switch *ds) · 1151 unmodified lines
12331284 masks = dev->info->masks;
12341285 regs = dev->info->regs;
12351286
1236− /* Switch marks the maximum frame with extra byte as oversize. */
1237− ksz_cfg(dev, REG_SW_CTRL_2, SW_LEGAL_PACKET_DISABLE, true);
12381287 ksz_cfg(dev, regs[S_TAIL_TAG_CTRL], masks[SW_TAIL_TAG_ENABLE], true);
12391288
12401289 p = &dev->ports[dev->cpu_port];
@@ -1308,6 +1357,18 @@ int ksz8_setup(struct dsa_switch *ds) · 67 unmodified lines
13081357 struct ksz_device *dev = ds->priv;
13091358 int i;
13101359
1360+ ds->mtu_enforcement_ingress = true;
1361+
1362+ /* We rely on software untagging on the CPU port, so that we
1363+ * can support both tagged and untagged VLANs
1364+ */
1365+ ds->untag_bridge_pvid = true;
1366+
1367+ /* VLAN filtering is partly controlled by the global VLAN
1368+ * Enable flag
1369+ */
1370+ ds->vlan_filtering_is_global = true;
1371+
13111372 ksz_cfg(dev, S_REPLACE_VID_CTRL, SW_FLOW_CTRL, true);
13121373
13131374 /* Enable automatic fast aging when link changed detected. */
@@ -1367,16 +1428,6 @@ int ksz8_switch_init(struct ksz_device *dev) · 53 unmodified lines
13671428 dev->phy_port_cnt = dev->info->port_cnt - 1;
13681429 dev->port_mask = (BIT(dev->phy_port_cnt) - 1) | dev->info->cpu_ports;
13691430
1370− /* We rely on software untagging on the CPU port, so that we
1371− * can support both tagged and untagged VLANs
1372− */
1373− dev->ds->untag_bridge_pvid = true;
1374−
1375− /* VLAN filtering is partly controlled by the global VLAN
1376− * Enable flag
1377− */
1378− dev->ds->vlan_filtering_is_global = true;
1379−
13801431 return 0;
13811432 }
13821433
drivers/net/dsa/microchip/ksz8795_reg.h+3−0
@@ -48,6 +48,9 @@ · 47 unmodified lines
4848 #define NO_EXC_COLLISION_DROP BIT(3)
4949 #define SW_LEGAL_PACKET_DISABLE BIT(1)
5050
51+#define KSZ8863_HUGE_PACKET_ENABLE BIT(2)
52+#define KSZ8863_LEGAL_PACKET_ENABLE BIT(1)
53+
5154 #define REG_SW_CTRL_3 0x05
5255 #define WEIGHTED_FAIR_QUEUE_ENABLE BIT(3)
5356
drivers/net/dsa/microchip/ksz8863_smi.c+4−5
@@ -152,11 +152,10 @@ static int ksz8863_smi_probe(struct mdio_device *mdiodev) · 151 unmodified lines
152152 &regmap_smi[i], dev,
153153 &rc);
154154 if (IS_ERR(dev->regmap[i])) {
155− ret = PTR_ERR(dev->regmap[i]);
156− dev_err(&mdiodev->dev,
157− "Failed to initialize regmap%i: %d\n",
158− ksz8863_regmap_config[i].val_bits, ret);
159− return ret;
155+ return dev_err_probe(&mdiodev->dev,
156+ PTR_ERR(dev->regmap[i]),
157+ "Failed to initialize regmap%i\n",
158+ ksz8863_regmap_config[i].val_bits);
160159 }
161160 }
162161
drivers/net/dsa/microchip/ksz9477.c+9−15
@@ -45,24 +45,15 @@ static void ksz9477_port_cfg32(struct ksz_device *dev, int port, int offset, · 44 unmodified lines
4545
4646 int ksz9477_change_mtu(struct ksz_device *dev, int port, int mtu)
4747 {
48− u16 frame_size, max_frame = 0;
49− int i;
50−
51− frame_size = mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;
48+ u16 frame_size;
5249
53− /* Cache the per-port MTU setting */
54− dev->ports[port].max_frame = frame_size;
50+ if (!dsa_is_cpu_port(dev->ds, port))
51+ return 0;
5552
56− for (i = 0; i < dev->info->port_cnt; i++)
57− max_frame = max(max_frame, dev->ports[i].max_frame);
53+ frame_size = mtu + VLAN_ETH_HLEN + ETH_FCS_LEN;
5854
5955 return regmap_update_bits(dev->regmap[1], REG_SW_MTU__2,
60− REG_SW_MTU_MASK, max_frame);
61−}
62−
63−int ksz9477_max_mtu(struct ksz_device *dev, int port)
64−{
65− return KSZ9477_MAX_FRAME_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN;
56+ REG_SW_MTU_MASK, frame_size);
6657 }
6758
6859 static int ksz9477_wait_vlan_ctrl_ready(struct ksz_device *dev)
@@ -195,7 +186,8 @@ int ksz9477_reset_switch(struct ksz_device *dev) · 126 unmodified lines
195186
196187 /* KSZ9893 compatible chips do not support refclk configuration */
197188 if (dev->chip_id == KSZ9893_CHIP_ID ||
198− dev->chip_id == KSZ8563_CHIP_ID)
189+ dev->chip_id == KSZ8563_CHIP_ID ||
190+ dev->chip_id == KSZ9563_CHIP_ID)
199191 return 0;
200192
201193 data8 = SW_ENABLE_REFCLKO;
@@ -1142,6 +1134,8 @@ int ksz9477_setup(struct dsa_switch *ds) · 940 unmodified lines
11421134 struct ksz_device *dev = ds->priv;
11431135 int ret = 0;
11441136
1137+ ds->mtu_enforcement_ingress = true;
1138+
11451139 /* Required for port partitioning. */
11461140 ksz9477_cfg32(dev, REG_SW_QM_CTRL__4, UNICAST_VLAN_BOUNDARY,
11471141 true);
drivers/net/dsa/microchip/ksz9477.h+0−1
@@ -50,7 +50,6 @@ int ksz9477_mdb_add(struct ksz_device *dev, int port, · 49 unmodified lines
5050 int ksz9477_mdb_del(struct ksz_device *dev, int port,
5151 const struct switchdev_obj_port_mdb *mdb, struct dsa_db db);
5252 int ksz9477_change_mtu(struct ksz_device *dev, int port, int mtu);
53−int ksz9477_max_mtu(struct ksz_device *dev, int port);
5453 void ksz9477_config_cpu_port(struct dsa_switch *ds);
5554 int ksz9477_enable_stp_addr(struct ksz_device *dev);
5655 int ksz9477_reset_switch(struct ksz_device *dev);
drivers/net/dsa/microchip/ksz9477_i2c.c+8−9
@@ -14,8 +14,7 @@ · 13 unmodified lines
1414
1515 KSZ_REGMAP_TABLE(ksz9477, not_used, 16, 0, 0);
1616
17−static int ksz9477_i2c_probe(struct i2c_client *i2c,
18− const struct i2c_device_id *i2c_id)
17+static int ksz9477_i2c_probe(struct i2c_client *i2c)
1918 {
2019 struct regmap_config rc;
2120 struct ksz_device *dev;
@@ -30,17 +29,17 @@ static int ksz9477_i2c_probe(struct i2c_client *i2c, · 8 unmodified lines
3029 rc.lock_arg = &dev->regmap_mutex;
3130 dev->regmap[i] = devm_regmap_init_i2c(i2c, &rc);
3231 if (IS_ERR(dev->regmap[i])) {
33− ret = PTR_ERR(dev->regmap[i]);
34− dev_err(&i2c->dev,
35− "Failed to initialize regmap%i: %d\n",
36− ksz9477_regmap_config[i].val_bits, ret);
37− return ret;
32+ return dev_err_probe(&i2c->dev, PTR_ERR(dev->regmap[i]),
33+ "Failed to initialize regmap%i\n",
34+ ksz9477_regmap_config[i].val_bits);
3835 }
3936 }
4037
4138 if (i2c->dev.platform_data)
4239 dev->pdata = i2c->dev.platform_data;
4340
41+ dev->irq = i2c->irq;
42+
4443 ret = ksz_switch_register(dev);
4544
4645 /* Main DSA driver may not be started yet. */
@@ -101,7 +100,7 @@ static const struct of_device_id ksz9477_dt_ids[] = { · 54 unmodified lines
101100 },
102101 {
103102 .compatible = "microchip,ksz9563",
104− .data = &ksz_switch_chips[KSZ9893]
103+ .data = &ksz_switch_chips[KSZ9563]
105104 },
106105 {
107106 .compatible = "microchip,ksz8563",
@@ -120,7 +119,7 @@ static struct i2c_driver ksz9477_i2c_driver = { · 12 unmodified lines
120119 .name = "ksz9477-switch",
121120 .of_match_table = of_match_ptr(ksz9477_dt_ids),
122121 },
123− .probe = ksz9477_i2c_probe,
122+ .probe_new = ksz9477_i2c_probe,
124123 .remove = ksz9477_i2c_remove,
125124 .shutdown = ksz9477_i2c_shutdown,
126125 .id_table = ksz9477_i2c_id,
drivers/net/dsa/microchip/ksz9477_reg.h+0−2
@@ -1615,6 +1615,4 @@ · 1614 unmodified lines
16151615 #define PTP_TRIG_UNIT_M (BIT(MAX_TRIG_UNIT) - 1)
16161616 #define PTP_TS_UNIT_M (BIT(MAX_TIMESTAMP_UNIT) - 1)
16171617
1618−#define KSZ9477_MAX_FRAME_SIZE 9000
1619−
16201618 #endif /* KSZ9477_REGS_H */
drivers/net/dsa/microchip/ksz_common.c+143−7
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/phy.h>
1515 #include <linux/etherdevice.h>
1616 #include <linux/if_bridge.h>
17+#include <linux/if_vlan.h>
1718 #include <linux/irq.h>
1819 #include <linux/irqdomain.h>
1920 #include <linux/of_mdio.h>
@@ -69,6 +70,43 @@ struct ksz_stats_raw { · 49 unmodified lines
6970 u64 tx_discards;
7071 };
7172
73+struct ksz88xx_stats_raw {
74+ u64 rx;
75+ u64 rx_hi;
76+ u64 rx_undersize;
77+ u64 rx_fragments;
78+ u64 rx_oversize;
79+ u64 rx_jabbers;
80+ u64 rx_symbol_err;
81+ u64 rx_crc_err;
82+ u64 rx_align_err;
83+ u64 rx_mac_ctrl;
84+ u64 rx_pause;
85+ u64 rx_bcast;
86+ u64 rx_mcast;
87+ u64 rx_ucast;
88+ u64 rx_64_or_less;
89+ u64 rx_65_127;
90+ u64 rx_128_255;
91+ u64 rx_256_511;
92+ u64 rx_512_1023;
93+ u64 rx_1024_1522;
94+ u64 tx;
95+ u64 tx_hi;
96+ u64 tx_late_col;
97+ u64 tx_pause;
98+ u64 tx_bcast;
99+ u64 tx_mcast;
100+ u64 tx_ucast;
101+ u64 tx_deferred;
102+ u64 tx_total_col;
103+ u64 tx_exc_col;
104+ u64 tx_single_col;
105+ u64 tx_mult_col;
106+ u64 rx_discards;
107+ u64 tx_discards;
108+};
109+
72110 static const struct ksz_mib_names ksz88xx_mib_names[] = {
73111 { 0x00, "rx" },
74112 { 0x01, "rx_hi" },
@@ -155,6 +193,7 @@ static const struct ksz_dev_ops ksz8_dev_ops = { · 80 unmodified lines
155193 .w_phy = ksz8_w_phy,
156194 .r_mib_cnt = ksz8_r_mib_cnt,
157195 .r_mib_pkt = ksz8_r_mib_pkt,
196+ .r_mib_stat64 = ksz88xx_r_mib_stats64,
158197 .freeze_mib = ksz8_freeze_mib,
159198 .port_init_cnt = ksz8_port_init_cnt,
160199 .fdb_dump = ksz8_fdb_dump,
@@ -171,6 +210,7 @@ static const struct ksz_dev_ops ksz8_dev_ops = { · 10 unmodified lines
171210 .reset = ksz8_reset_switch,
172211 .init = ksz8_switch_init,
173212 .exit = ksz8_switch_exit,
213+ .change_mtu = ksz8_change_mtu,
174214 };
175215
176216 static void ksz9477_phylink_mac_link_up(struct ksz_device *dev, int port,
@@ -206,7 +246,6 @@ static const struct ksz_dev_ops ksz9477_dev_ops = { · 29 unmodified lines
206246 .mdb_add = ksz9477_mdb_add,
207247 .mdb_del = ksz9477_mdb_del,
208248 .change_mtu = ksz9477_change_mtu,
209− .max_mtu = ksz9477_max_mtu,
210249 .phylink_mac_link_up = ksz9477_phylink_mac_link_up,
211250 .config_cpu_port = ksz9477_config_cpu_port,
212251 .enable_stp_addr = ksz9477_enable_stp_addr,
@@ -243,7 +282,6 @@ static const struct ksz_dev_ops lan937x_dev_ops = { · 30 unmodified lines
243282 .mdb_add = ksz9477_mdb_add,
244283 .mdb_del = ksz9477_mdb_del,
245284 .change_mtu = lan937x_change_mtu,
246− .max_mtu = ksz9477_max_mtu,
247285 .phylink_mac_link_up = ksz9477_phylink_mac_link_up,
248286 .config_cpu_port = lan937x_config_cpu_port,
249287 .enable_stp_addr = ksz9477_enable_stp_addr,
@@ -1039,6 +1077,7 @@ const struct ksz_chip_data ksz_switch_chips[] = { · 789 unmodified lines
10391077 .num_statics = 16,
10401078 .cpu_ports = 0x07, /* can be configured as cpu port */
10411079 .port_cnt = 3, /* total port count */
1080+ .port_nirqs = 3,
10421081 .ops = &ksz9477_dev_ops,
10431082 .mib_names = ksz9477_mib_names,
10441083 .mib_cnt = ARRAY_SIZE(ksz9477_mib_names),
@@ -1282,6 +1321,31 @@ const struct ksz_chip_data ksz_switch_chips[] = { · 237 unmodified lines
12821321 .gbit_capable = {true, true, true},
12831322 },
12841323
1324+ [KSZ9563] = {
1325+ .chip_id = KSZ9563_CHIP_ID,
1326+ .dev_name = "KSZ9563",
1327+ .num_vlans = 4096,
1328+ .num_alus = 4096,
1329+ .num_statics = 16,
1330+ .cpu_ports = 0x07, /* can be configured as cpu port */
1331+ .port_cnt = 3, /* total port count */
1332+ .port_nirqs = 3,
1333+ .ops = &ksz9477_dev_ops,
1334+ .mib_names = ksz9477_mib_names,
1335+ .mib_cnt = ARRAY_SIZE(ksz9477_mib_names),
1336+ .reg_mib_cnt = MIB_COUNTER_NUM,
1337+ .regs = ksz9477_regs,
1338+ .masks = ksz9477_masks,
1339+ .shifts = ksz9477_shifts,
1340+ .xmii_ctrl0 = ksz9477_xmii_ctrl0,
1341+ .xmii_ctrl1 = ksz8795_xmii_ctrl1, /* Same as ksz8795 */
1342+ .supports_mii = {false, false, true},
1343+ .supports_rmii = {false, false, true},
1344+ .supports_rgmii = {false, false, true},
1345+ .internal_phy = {true, true, false},
1346+ .gbit_capable = {true, true, true},
1347+ },
1348+
12851349 [KSZ9567] = {
12861350 .chip_id = KSZ9567_CHIP_ID,
12871351 .dev_name = "KSZ9567",
@@ -1557,6 +1621,55 @@ void ksz_r_mib_stats64(struct ksz_device *dev, int port) · 269 unmodified lines
15571621 spin_unlock(&mib->stats64_lock);
15581622 }
15591623
1624+void ksz88xx_r_mib_stats64(struct ksz_device *dev, int port)
1625+{
1626+ struct ethtool_pause_stats *pstats;
1627+ struct rtnl_link_stats64 *stats;
1628+ struct ksz88xx_stats_raw *raw;
1629+ struct ksz_port_mib *mib;
1630+
1631+ mib = &dev->ports[port].mib;
1632+ stats = &mib->stats64;
1633+ pstats = &mib->pause_stats;
1634+ raw = (struct ksz88xx_stats_raw *)mib->counters;
1635+
1636+ spin_lock(&mib->stats64_lock);
1637+
1638+ stats->rx_packets = raw->rx_bcast + raw->rx_mcast + raw->rx_ucast +
1639+ raw->rx_pause;
1640+ stats->tx_packets = raw->tx_bcast + raw->tx_mcast + raw->tx_ucast +
1641+ raw->tx_pause;
1642+
1643+ /* HW counters are counting bytes + FCS which is not acceptable
1644+ * for rtnl_link_stats64 interface
1645+ */
1646+ stats->rx_bytes = raw->rx + raw->rx_hi - stats->rx_packets * ETH_FCS_LEN;
1647+ stats->tx_bytes = raw->tx + raw->tx_hi - stats->tx_packets * ETH_FCS_LEN;
1648+
1649+ stats->rx_length_errors = raw->rx_undersize + raw->rx_fragments +
1650+ raw->rx_oversize;
1651+
1652+ stats->rx_crc_errors = raw->rx_crc_err;
1653+ stats->rx_frame_errors = raw->rx_align_err;
1654+ stats->rx_dropped = raw->rx_discards;
1655+ stats->rx_errors = stats->rx_length_errors + stats->rx_crc_errors +
1656+ stats->rx_frame_errors + stats->rx_dropped;
1657+
1658+ stats->tx_window_errors = raw->tx_late_col;
1659+ stats->tx_fifo_errors = raw->tx_discards;
1660+ stats->tx_aborted_errors = raw->tx_exc_col;
1661+ stats->tx_errors = stats->tx_window_errors + stats->tx_fifo_errors +
1662+ stats->tx_aborted_errors;
1663+
1664+ stats->multicast = raw->rx_mcast;
1665+ stats->collisions = raw->tx_total_col;
1666+
1667+ pstats->tx_pause_frames = raw->tx_pause;
1668+ pstats->rx_pause_frames = raw->rx_pause;
1669+
1670+ spin_unlock(&mib->stats64_lock);
1671+}
1672+
15601673 static void ksz_get_stats64(struct dsa_switch *ds, int port,
15611674 struct rtnl_link_stats64 *s)
15621675 {
@@ -2389,7 +2502,8 @@ static enum dsa_tag_protocol ksz_get_tag_protocol(struct dsa_switch *ds, · 826 unmodified lines
23892502
23902503 if (dev->chip_id == KSZ8830_CHIP_ID ||
23912504 dev->chip_id == KSZ8563_CHIP_ID ||
2392− dev->chip_id == KSZ9893_CHIP_ID)
2505+ dev->chip_id == KSZ9893_CHIP_ID ||
2506+ dev->chip_id == KSZ9563_CHIP_ID)
23932507 proto = DSA_TAG_PROTO_KSZ9893;
23942508
23952509 if (dev->chip_id == KSZ9477_CHIP_ID ||
@@ -2473,10 +2587,29 @@ static int ksz_max_mtu(struct dsa_switch *ds, int port) · 77 unmodified lines
24732587 {
24742588 struct ksz_device *dev = ds->priv;
24752589
2476− if (!dev->dev_ops->max_mtu)
2477− return -EOPNOTSUPP;
2590+ switch (dev->chip_id) {
2591+ case KSZ8795_CHIP_ID:
2592+ case KSZ8794_CHIP_ID:
2593+ case KSZ8765_CHIP_ID:
2594+ return KSZ8795_HUGE_PACKET_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN;
2595+ case KSZ8830_CHIP_ID:
2596+ return KSZ8863_HUGE_PACKET_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN;
2597+ case KSZ8563_CHIP_ID:
2598+ case KSZ9477_CHIP_ID:
2599+ case KSZ9563_CHIP_ID:
2600+ case KSZ9567_CHIP_ID:
2601+ case KSZ9893_CHIP_ID:
2602+ case KSZ9896_CHIP_ID:
2603+ case KSZ9897_CHIP_ID:
2604+ case LAN9370_CHIP_ID:
2605+ case LAN9371_CHIP_ID:
2606+ case LAN9372_CHIP_ID:
2607+ case LAN9373_CHIP_ID:
2608+ case LAN9374_CHIP_ID:
2609+ return KSZ9477_MAX_FRAME_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN;
2610+ }
24782611
2479− return dev->dev_ops->max_mtu(dev, port);
2612+ return -EOPNOTSUPP;
24802613 }
24812614
24822615 static void ksz_set_xmii(struct ksz_device *dev, int port,
@@ -2509,7 +2642,8 @@ static void ksz_set_xmii(struct ksz_device *dev, int port, · 26 unmodified lines
25092642 data8 |= bitval[P_RGMII_SEL];
25102643 /* On KSZ9893, disable RGMII in-band status support */
25112644 if (dev->chip_id == KSZ9893_CHIP_ID ||
2512− dev->chip_id == KSZ8563_CHIP_ID)
2645+ dev->chip_id == KSZ8563_CHIP_ID ||
2646+ dev->chip_id == KSZ9563_CHIP_ID)
25132647 data8 &= ~P_MII_MAC_MODE;
25142648 break;
25152649 default:
@@ -2782,6 +2916,8 @@ static int ksz_switch_detect(struct ksz_device *dev) · 266 unmodified lines
27822916
27832917 if (id4 == SKU_ID_KSZ8563)
27842918 dev->chip_id = KSZ8563_CHIP_ID;
2919+ else if (id4 == SKU_ID_KSZ9563)
2920+ dev->chip_id = KSZ9563_CHIP_ID;
27852921 else
27862922 dev->chip_id = KSZ9893_CHIP_ID;
27872923
drivers/net/dsa/microchip/ksz_common.h+15−2
@@ -95,7 +95,6 @@ struct ksz_port { · 94 unmodified lines
9595
9696 struct ksz_port_mib mib;
9797 phy_interface_t interface;
98− u16 max_frame;
9998 u32 rgmii_tx_val;
10099 u32 rgmii_rx_val;
101100 struct ksz_device *ksz_dev;
@@ -154,6 +153,7 @@ enum ksz_model { · 52 unmodified lines
154153 KSZ9896,
155154 KSZ9897,
156155 KSZ9893,
156+ KSZ9563,
157157 KSZ9567,
158158 LAN9370,
159159 LAN9371,
@@ -172,6 +172,7 @@ enum ksz_chip_id { · 12 unmodified lines
172172 KSZ9896_CHIP_ID = 0x00989600,
173173 KSZ9897_CHIP_ID = 0x00989700,
174174 KSZ9893_CHIP_ID = 0x00989300,
175+ KSZ9563_CHIP_ID = 0x00956300,
175176 KSZ9567_CHIP_ID = 0x00956700,
176177 LAN9370_CHIP_ID = 0x00937000,
177178 LAN9371_CHIP_ID = 0x00937100,
@@ -320,7 +321,6 @@ struct ksz_dev_ops { · 142 unmodified lines
320321 void (*get_caps)(struct ksz_device *dev, int port,
321322 struct phylink_config *config);
322323 int (*change_mtu)(struct ksz_device *dev, int port, int mtu);
323− int (*max_mtu)(struct ksz_device *dev, int port);
324324 void (*freeze_mib)(struct ksz_device *dev, int port, bool freeze);
325325 void (*port_init_cnt)(struct ksz_device *dev, int port);
326326 void (*phylink_mac_config)(struct ksz_device *dev, int port,
@@ -345,6 +345,7 @@ void ksz_switch_remove(struct ksz_device *dev); · 18 unmodified lines
345345
346346 void ksz_init_mib_timer(struct ksz_device *dev);
347347 void ksz_r_mib_stats64(struct ksz_device *dev, int port);
348+void ksz88xx_r_mib_stats64(struct ksz_device *dev, int port);
348349 void ksz_port_stp_state_set(struct dsa_switch *ds, int port, u8 state);
349350 bool ksz_get_gbit(struct ksz_device *dev, int port);
350351 phy_interface_t ksz_get_xmii(struct ksz_device *dev, int port, bool gbit);
@@ -454,6 +455,11 @@ static inline int ksz_write64(struct ksz_device *dev, u32 reg, u64 value) · 103 unmodified lines
454455 return regmap_bulk_write(dev->regmap[2], reg, val, 2);
455456 }
456457
458+static inline int ksz_rmw8(struct ksz_device *dev, int offset, u8 mask, u8 val)
459+{
460+ return regmap_update_bits(dev->regmap[0], offset, mask, val);
461+}
462+
457463 static inline int ksz_pread8(struct ksz_device *dev, int port, int offset,
458464 u8 *data)
459465 {
@@ -551,6 +557,7 @@ static inline int is_lan937x(struct ksz_device *dev) · 91 unmodified lines
551557 /* KSZ9893, KSZ9563, KSZ8563 specific register */
552558 #define REG_CHIP_ID4 0x0f
553559 #define SKU_ID_KSZ8563 0x3c
560+#define SKU_ID_KSZ9563 0x1c
554561
555562 /* Driver set switch broadcast storm protection at 10% rate. */
556563 #define BROADCAST_STORM_PROT_RATE 10
@@ -585,6 +592,12 @@ static inline int is_lan937x(struct ksz_device *dev) · 28 unmodified lines
585592
586593 #define PORT_SRC_PHY_INT 1
587594
595+#define KSZ8795_HUGE_PACKET_SIZE 2000
596+#define KSZ8863_HUGE_PACKET_SIZE 1916
597+#define KSZ8863_NORMAL_PACKET_SIZE 1536
598+#define KSZ8_LEGAL_PACKET_SIZE 1518
599+#define KSZ9477_MAX_FRAME_SIZE 9000
600+
588601 /* Regmap tables generation */
589602 #define KSZ_SPI_OP_RD 3
590603 #define KSZ_SPI_OP_WR 2
drivers/net/dsa/microchip/ksz_spi.c+4−6
@@ -71,11 +71,9 @@ static int ksz_spi_probe(struct spi_device *spi) · 70 unmodified lines
7171 dev->regmap[i] = devm_regmap_init_spi(spi, &rc);
7272
7373 if (IS_ERR(dev->regmap[i])) {
74− ret = PTR_ERR(dev->regmap[i]);
75− dev_err(&spi->dev,
76− "Failed to initialize regmap%i: %d\n",
77− regmap_config[i].val_bits, ret);
78− return ret;
74+ return dev_err_probe(&spi->dev, PTR_ERR(dev->regmap[i]),
75+ "Failed to initialize regmap%i\n",
76+ regmap_config[i].val_bits);
7977 }
8078 }
8179
@@ -163,7 +161,7 @@ static const struct of_device_id ksz_dt_ids[] = { · 81 unmodified lines
163161 },
164162 {
165163 .compatible = "microchip,ksz9563",
166− .data = &ksz_switch_chips[KSZ9893]
164+ .data = &ksz_switch_chips[KSZ9563]
167165 },
168166 {
169167 .compatible = "microchip,ksz8563",
drivers/net/dsa/microchip/lan937x_main.c+5−1
@@ -242,7 +242,11 @@ int lan937x_change_mtu(struct ksz_device *dev, int port, int new_mtu) · 241 unmodified lines
242242 }
243243
244244 /* Write the frame size in PORT_MAX_FR_SIZE register */
245− ksz_pwrite16(dev, port, PORT_MAX_FR_SIZE, new_mtu);
245+ ret = ksz_pwrite16(dev, port, PORT_MAX_FR_SIZE, new_mtu);
246+ if (ret) {
247+ dev_err(ds->dev, "failed to update mtu for port %d\n", port);
248+ return ret;
249+ }
246250
247251 return 0;
248252 }
drivers/net/dsa/mv88e6xxx/Makefile+4−0
@@ -15,3 +15,7 @@ mv88e6xxx-objs += port_hidden.o · 14 unmodified lines
1515 mv88e6xxx-$(CONFIG_NET_DSA_MV88E6XXX_PTP) += ptp.o
1616 mv88e6xxx-objs += serdes.o
1717 mv88e6xxx-objs += smi.o
18+mv88e6xxx-objs += trace.o
19+
20+# for tracing framework to find trace.h
21+CFLAGS_trace.o := -I$(src)
drivers/net/dsa/mv88e6xxx/chip.c+4−0
@@ -4077,6 +4077,7 @@ static const struct mv88e6xxx_ops mv88e6085_ops = { · 4076 unmodified lines
40774077 .port_sync_link = mv88e6xxx_port_sync_link,
40784078 .port_set_speed_duplex = mv88e6185_port_set_speed_duplex,
40794079 .port_tag_remap = mv88e6095_port_tag_remap,
4080+ .port_set_policy = mv88e6352_port_set_policy,
40804081 .port_set_frame_mode = mv88e6351_port_set_frame_mode,
40814082 .port_set_ucast_flood = mv88e6352_port_set_ucast_flood,
40824083 .port_set_mcast_flood = mv88e6352_port_set_mcast_flood,
@@ -4349,6 +4350,7 @@ static const struct mv88e6xxx_ops mv88e6161_ops = { · 266 unmodified lines
43494350 .port_sync_link = mv88e6xxx_port_sync_link,
43504351 .port_set_speed_duplex = mv88e6185_port_set_speed_duplex,
43514352 .port_tag_remap = mv88e6095_port_tag_remap,
4353+ .port_set_policy = mv88e6352_port_set_policy,
43524354 .port_set_frame_mode = mv88e6351_port_set_frame_mode,
43534355 .port_set_ucast_flood = mv88e6352_port_set_ucast_flood,
43544356 .port_set_mcast_flood = mv88e6352_port_set_mcast_flood,
@@ -5032,6 +5034,7 @@ static const struct mv88e6xxx_ops mv88e6320_ops = { · 677 unmodified lines
50325034 .phy_write = mv88e6xxx_g2_smi_phy_write,
50335035 .port_set_link = mv88e6xxx_port_set_link,
50345036 .port_sync_link = mv88e6xxx_port_sync_link,
5037+ .port_set_rgmii_delay = mv88e6320_port_set_rgmii_delay,
50355038 .port_set_speed_duplex = mv88e6185_port_set_speed_duplex,
50365039 .port_tag_remap = mv88e6095_port_tag_remap,
50375040 .port_set_frame_mode = mv88e6351_port_set_frame_mode,
@@ -5076,6 +5079,7 @@ static const struct mv88e6xxx_ops mv88e6321_ops = { · 38 unmodified lines
50765079 .phy_write = mv88e6xxx_g2_smi_phy_write,
50775080 .port_set_link = mv88e6xxx_port_set_link,
50785081 .port_sync_link = mv88e6xxx_port_sync_link,
5082+ .port_set_rgmii_delay = mv88e6320_port_set_rgmii_delay,
50795083 .port_set_speed_duplex = mv88e6185_port_set_speed_duplex,
50805084 .port_tag_remap = mv88e6095_port_tag_remap,
50815085 .port_set_frame_mode = mv88e6351_port_set_frame_mode,
drivers/net/dsa/mv88e6xxx/devlink.c+0−5
@@ -821,11 +821,6 @@ int mv88e6xxx_devlink_info_get(struct dsa_switch *ds, · 820 unmodified lines
821821 struct netlink_ext_ack *extack)
822822 {
823823 struct mv88e6xxx_chip *chip = ds->priv;
824− int err;
825−
826− err = devlink_info_driver_name_put(req, "mv88e6xxx");
827− if (err)
828− return err;
829824
830825 return devlink_info_version_fixed_put(req,
831826 DEVLINK_INFO_VERSION_GENERIC_ASIC_ID,
drivers/net/dsa/mv88e6xxx/global1_atu.c+65−20
@@ -12,6 +12,7 @@ · 11 unmodified lines
1212
1313 #include "chip.h"
1414 #include "global1.h"
15+#include "trace.h"
1516
1617 /* Offset 0x01: ATU FID Register */
1718
@@ -114,6 +115,19 @@ static int mv88e6xxx_g1_atu_op_wait(struct mv88e6xxx_chip *chip) · 96 unmodified lines
114115 return mv88e6xxx_g1_wait_bit(chip, MV88E6XXX_G1_ATU_OP, bit, 0);
115116 }
116117
118+static int mv88e6xxx_g1_read_atu_violation(struct mv88e6xxx_chip *chip)
119+{
120+ int err;
121+
122+ err = mv88e6xxx_g1_write(chip, MV88E6XXX_G1_ATU_OP,
123+ MV88E6XXX_G1_ATU_OP_BUSY |
124+ MV88E6XXX_G1_ATU_OP_GET_CLR_VIOLATION);
125+ if (err)
126+ return err;
127+
128+ return mv88e6xxx_g1_atu_op_wait(chip);
129+}
130+
117131 static int mv88e6xxx_g1_atu_op(struct mv88e6xxx_chip *chip, u16 fid, u16 op)
118132 {
119133 u16 val;
@@ -159,6 +173,41 @@ int mv88e6xxx_g1_atu_get_next(struct mv88e6xxx_chip *chip, u16 fid) · 39 unmodified lines
159173 return mv88e6xxx_g1_atu_op(chip, fid, MV88E6XXX_G1_ATU_OP_GET_NEXT_DB);
160174 }
161175
176+static int mv88e6xxx_g1_atu_fid_read(struct mv88e6xxx_chip *chip, u16 *fid)
177+{
178+ u16 val = 0, upper = 0, op = 0;
179+ int err = -EOPNOTSUPP;
180+
181+ if (mv88e6xxx_num_databases(chip) > 256) {
182+ err = mv88e6xxx_g1_read(chip, MV88E6352_G1_ATU_FID, &val);
183+ val &= 0xfff;
184+ if (err)
185+ return err;
186+ } else {
187+ err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_ATU_OP, &op);
188+ if (err)
189+ return err;
190+ if (mv88e6xxx_num_databases(chip) > 64) {
191+ /* ATU DBNum[7:4] are located in ATU Control 15:12 */
192+ err = mv88e6xxx_g1_read(chip, MV88E6XXX_G1_ATU_CTL,
193+ &upper);
194+ if (err)
195+ return err;
196+
197+ upper = (upper >> 8) & 0x00f0;
198+ } else if (mv88e6xxx_num_databases(chip) > 16) {
199+ /* ATU DBNum[5:4] are located in ATU Operation 9:8 */
200+ upper = (op >> 4) & 0x30;
201+ }
202+
203+ /* ATU DBNum[3:0] are located in ATU Operation 3:0 */
204+ val = (op & 0xf) | upper;
205+ }
206+ *fid = val;
207+
208+ return err;
209+}
210+
162211 /* Offset 0x0C: ATU Data Register */
163212
164213 static int mv88e6xxx_g1_atu_data_read(struct mv88e6xxx_chip *chip,
@@ -353,14 +402,12 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) · 188 unmodified lines
353402 {
354403 struct mv88e6xxx_chip *chip = dev_id;
355404 struct mv88e6xxx_atu_entry entry;
356− int spid;
357− int err;
358− u16 val;
405+ int err, spid;
406+ u16 val, fid;
359407
360408 mv88e6xxx_reg_lock(chip);
361409
362− err = mv88e6xxx_g1_atu_op(chip, 0,
363− MV88E6XXX_G1_ATU_OP_GET_CLR_VIOLATION);
410+ err = mv88e6xxx_g1_read_atu_violation(chip);
364411 if (err)
365412 goto out;
366413
@@ -368,6 +415,10 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) · 1 unmodified line
368415 if (err)
369416 goto out;
370417
418+ err = mv88e6xxx_g1_atu_fid_read(chip, &fid);
419+ if (err)
420+ goto out;
421+
371422 err = mv88e6xxx_g1_atu_data_read(chip, &entry);
372423 if (err)
373424 goto out;
@@ -378,30 +429,24 @@ static irqreturn_t mv88e6xxx_g1_atu_prob_irq_thread_fn(int irq, void *dev_id) · 4 unmodified lines
378429
379430 spid = entry.state;
380431
381− if (val & MV88E6XXX_G1_ATU_OP_AGE_OUT_VIOLATION) {
382− dev_err_ratelimited(chip->dev,
383− "ATU age out violation for %pM\n",
384− entry.mac);
385− }
386−
387432 if (val & MV88E6XXX_G1_ATU_OP_MEMBER_VIOLATION) {
388− dev_err_ratelimited(chip->dev,
389− "ATU member violation for %pM portvec %x spid %d\n",
390− entry.mac, entry.portvec, spid);
433+ trace_mv88e6xxx_atu_member_violation(chip->dev, spid,
434+ entry.portvec, entry.mac,
435+ fid);
391436 chip->ports[spid].atu_member_violation++;
392437 }
393438
394439 if (val & MV88E6XXX_G1_ATU_OP_MISS_VIOLATION) {
395− dev_err_ratelimited(chip->dev,
396− "ATU miss violation for %pM portvec %x spid %d\n",
397− entry.mac, entry.portvec, spid);
440+ trace_mv88e6xxx_atu_miss_violation(chip->dev, spid,
441+ entry.portvec, entry.mac,
442+ fid);
398443 chip->ports[spid].atu_miss_violation++;
399444 }
400445
401446 if (val & MV88E6XXX_G1_ATU_OP_FULL_VIOLATION) {
402− dev_err_ratelimited(chip->dev,
403− "ATU full violation for %pM portvec %x spid %d\n",
404− entry.mac, entry.portvec, spid);
447+ trace_mv88e6xxx_atu_full_violation(chip->dev, spid,
448+ entry.portvec, entry.mac,
449+ fid);
405450 chip->ports[spid].atu_full_violation++;
406451 }
407452 mv88e6xxx_reg_unlock(chip);
drivers/net/dsa/mv88e6xxx/global1_vtu.c+3−4
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313
1414 #include "chip.h"
1515 #include "global1.h"
16+#include "trace.h"
1617
1718 /* Offset 0x02: VTU FID Register */
1819
@@ -628,14 +629,12 @@ static irqreturn_t mv88e6xxx_g1_vtu_prob_irq_thread_fn(int irq, void *dev_id) · 609 unmodified lines
628629 spid = val & MV88E6XXX_G1_VTU_OP_SPID_MASK;
629630
630631 if (val & MV88E6XXX_G1_VTU_OP_MEMBER_VIOLATION) {
631− dev_err_ratelimited(chip->dev, "VTU member violation for vid %d, source port %d\n",
632− vid, spid);
632+ trace_mv88e6xxx_vtu_member_violation(chip->dev, spid, vid);
633633 chip->ports[spid].vtu_member_violation++;
634634 }
635635
636636 if (val & MV88E6XXX_G1_VTU_OP_MISS_VIOLATION) {
637− dev_dbg_ratelimited(chip->dev, "VTU miss violation for vid %d, source port %d\n",
638− vid, spid);
637+ trace_mv88e6xxx_vtu_miss_violation(chip->dev, spid, vid);
639638 chip->ports[spid].vtu_miss_violation++;
640639 }
641640
drivers/net/dsa/mv88e6xxx/port.c+9−0
@@ -133,6 +133,15 @@ int mv88e6390_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port, · 132 unmodified lines
133133 return mv88e6xxx_port_set_rgmii_delay(chip, port, mode);
134134 }
135135
136+int mv88e6320_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
137+ phy_interface_t mode)
138+{
139+ if (port != 2 && port != 5 && port != 6)
140+ return -EOPNOTSUPP;
141+
142+ return mv88e6xxx_port_set_rgmii_delay(chip, port, mode);
143+}
144+
136145 int mv88e6xxx_port_set_link(struct mv88e6xxx_chip *chip, int port, int link)
137146 {
138147 u16 reg;
drivers/net/dsa/mv88e6xxx/port.h+2−0
@@ -332,6 +332,8 @@ int mv88e6xxx_port_wait_bit(struct mv88e6xxx_chip *chip, int port, int reg, · 331 unmodified lines
332332
333333 int mv88e6185_port_set_pause(struct mv88e6xxx_chip *chip, int port,
334334 int pause);
335+int mv88e6320_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
336+ phy_interface_t mode);
335337 int mv88e6352_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
336338 phy_interface_t mode);
337339 int mv88e6390_port_set_rgmii_delay(struct mv88e6xxx_chip *chip, int port,
drivers/net/dsa/mv88e6xxx/trace.c+6−0
@@ -0,0 +1,6 @@
1+// SPDX-License-Identifier: GPL-2.0-or-later
2+/* Copyright 2022 NXP
3+ */
4+
5+#define CREATE_TRACE_POINTS
6+#include "trace.h"
drivers/net/dsa/mv88e6xxx/trace.h+96−0
@@ -0,0 +1,96 @@
1+/* SPDX-License-Identifier: GPL-2.0-or-later */
2+/* Copyright 2022 NXP
3+ */
4+
5+#undef TRACE_SYSTEM
6+#define TRACE_SYSTEM mv88e6xxx
7+
8+#if !defined(_MV88E6XXX_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
9+#define _MV88E6XXX_TRACE_H
10+
11+#include <linux/device.h>
12+#include <linux/if_ether.h>
13+#include <linux/tracepoint.h>
14+
15+DECLARE_EVENT_CLASS(mv88e6xxx_atu_violation,
16+
17+ TP_PROTO(const struct device *dev, int spid, u16 portvec,
18+ const unsigned char *addr, u16 fid),
19+
20+ TP_ARGS(dev, spid, portvec, addr, fid),
21+
22+ TP_STRUCT__entry(
23+ __string(name, dev_name(dev))
24+ __field(int, spid)
25+ __field(u16, portvec)
26+ __array(unsigned char, addr, ETH_ALEN)
27+ __field(u16, fid)
28+ ),
29+
30+ TP_fast_assign(
31+ __assign_str(name, dev_name(dev));
32+ __entry->spid = spid;
33+ __entry->portvec = portvec;
34+ memcpy(__entry->addr, addr, ETH_ALEN);
35+ __entry->fid = fid;
36+ ),
37+
38+ TP_printk("dev %s spid %d portvec 0x%x addr %pM fid %u",
39+ __get_str(name), __entry->spid, __entry->portvec,
40+ __entry->addr, __entry->fid)
41+);
42+
43+DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_member_violation,
44+ TP_PROTO(const struct device *dev, int spid, u16 portvec,
45+ const unsigned char *addr, u16 fid),
46+ TP_ARGS(dev, spid, portvec, addr, fid));
47+
48+DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_miss_violation,
49+ TP_PROTO(const struct device *dev, int spid, u16 portvec,
50+ const unsigned char *addr, u16 fid),
51+ TP_ARGS(dev, spid, portvec, addr, fid));
52+
53+DEFINE_EVENT(mv88e6xxx_atu_violation, mv88e6xxx_atu_full_violation,
54+ TP_PROTO(const struct device *dev, int spid, u16 portvec,
55+ const unsigned char *addr, u16 fid),
56+ TP_ARGS(dev, spid, portvec, addr, fid));
57+
58+DECLARE_EVENT_CLASS(mv88e6xxx_vtu_violation,
59+
60+ TP_PROTO(const struct device *dev, int spid, u16 vid),
61+
62+ TP_ARGS(dev, spid, vid),
63+
64+ TP_STRUCT__entry(
65+ __string(name, dev_name(dev))
66+ __field(int, spid)
67+ __field(u16, vid)
68+ ),
69+
70+ TP_fast_assign(
71+ __assign_str(name, dev_name(dev));
72+ __entry->spid = spid;
73+ __entry->vid = vid;
74+ ),
75+
76+ TP_printk("dev %s spid %d vid %u",
77+ __get_str(name), __entry->spid, __entry->vid)
78+);
79+
80+DEFINE_EVENT(mv88e6xxx_vtu_violation, mv88e6xxx_vtu_member_violation,
81+ TP_PROTO(const struct device *dev, int spid, u16 vid),
82+ TP_ARGS(dev, spid, vid));
83+
84+DEFINE_EVENT(mv88e6xxx_vtu_violation, mv88e6xxx_vtu_miss_violation,
85+ TP_PROTO(const struct device *dev, int spid, u16 vid),
86+ TP_ARGS(dev, spid, vid));
87+
88+#endif /* _MV88E6XXX_TRACE_H */
89+
90+/* We don't want to use include/trace/events */
91+#undef TRACE_INCLUDE_PATH
92+#define TRACE_INCLUDE_PATH .
93+#undef TRACE_INCLUDE_FILE
94+#define TRACE_INCLUDE_FILE trace
95+/* This part must be outside protection */
96+#include <trace/define_trace.h>
drivers/net/dsa/ocelot/felix.c+4−13
@@ -1048,21 +1048,14 @@ static void felix_phylink_get_caps(struct dsa_switch *ds, int port, · 1047 unmodified lines
10481048 */
10491049 config->legacy_pre_march2020 = false;
10501050
1051+ config->mac_capabilities = MAC_ASYM_PAUSE | MAC_SYM_PAUSE |
1052+ MAC_10 | MAC_100 | MAC_1000FD |
1053+ MAC_2500FD;
1054+
10511055 __set_bit(ocelot->ports[port]->phy_mode,
10521056 config->supported_interfaces);
10531057 }
10541058
1055−static void felix_phylink_validate(struct dsa_switch *ds, int port,
1056− unsigned long *supported,
1057− struct phylink_link_state *state)
1058−{
1059− struct ocelot *ocelot = ds->priv;
1060− struct felix *felix = ocelot_to_felix(ocelot);
1061−
1062− if (felix->info->phylink_validate)
1063− felix->info->phylink_validate(ocelot, port, supported, state);
1064−}
1065−
10661059 static struct phylink_pcs *felix_phylink_mac_select_pcs(struct dsa_switch *ds,
10671060 int port,
10681061 phy_interface_t iface)
@@ -1370,7 +1363,6 @@ static int felix_init_structs(struct felix *felix, int num_phys_ports) · 301 unmodified lines
13701363 return -ENOMEM;
13711364
13721365 ocelot->map = felix->info->map;
1373− ocelot->stats_layout = felix->info->stats_layout;
13741366 ocelot->num_mact_rows = felix->info->num_mact_rows;
13751367 ocelot->vcap = felix->info->vcap;
13761368 ocelot->vcap_pol.base = felix->info->vcap_pol_base;
@@ -2050,7 +2042,6 @@ const struct dsa_switch_ops felix_switch_ops = { · 673 unmodified lines
20502042 .get_sset_count = felix_get_sset_count,
20512043 .get_ts_info = felix_get_ts_info,
20522044 .phylink_get_caps = felix_phylink_get_caps,
2053− .phylink_validate = felix_phylink_validate,
20542045 .phylink_mac_select_pcs = felix_phylink_mac_select_pcs,
20552046 .phylink_mac_link_down = felix_phylink_mac_link_down,
20562047 .phylink_mac_link_up = felix_phylink_mac_link_up,
drivers/net/dsa/ocelot/felix.h+0−4
@@ -28,7 +28,6 @@ struct felix_info { · 27 unmodified lines
2828 const struct ocelot_ops *ops;
2929 const u32 *port_modes;
3030 int num_mact_rows;
31− const struct ocelot_stat_layout *stats_layout;
3231 int num_ports;
3332 int num_tx_queues;
3433 struct vcap_props *vcap;
@@ -52,9 +51,6 @@ struct felix_info { · 17 unmodified lines
5251
5352 int (*mdio_bus_alloc)(struct ocelot *ocelot);
5453 void (*mdio_bus_free)(struct ocelot *ocelot);
55− void (*phylink_validate)(struct ocelot *ocelot, int port,
56− unsigned long *supported,
57− struct phylink_link_state *state);
5854 int (*port_setup_tc)(struct dsa_switch *ds, int port,
5955 enum tc_setup_type type, void *type_data);
6056 void (*tas_guard_bands_update)(struct ocelot *ocelot, int port);
drivers/net/dsa/ocelot/felix_vsc9959.c+0−35
@@ -565,10 +565,6 @@ static const struct reg_field vsc9959_regfields[REGFIELD_MAX] = { · 564 unmodified lines
565565 [SYS_PAUSE_CFG_PAUSE_ENA] = REG_FIELD_ID(SYS_PAUSE_CFG, 0, 1, 7, 4),
566566 };
567567
568−static const struct ocelot_stat_layout vsc9959_stats_layout[OCELOT_NUM_STATS] = {
569− OCELOT_COMMON_STATS,
570−};
571−
572568 static const struct vcap_field vsc9959_vcap_es0_keys[] = {
573569 [VCAP_ES0_EGR_PORT] = { 0, 3},
574570 [VCAP_ES0_IGR_PORT] = { 3, 3},
@@ -885,35 +881,6 @@ static int vsc9959_reset(struct ocelot *ocelot) · 310 unmodified lines
885881 return 0;
886882 }
887883
888−static void vsc9959_phylink_validate(struct ocelot *ocelot, int port,
889− unsigned long *supported,
890− struct phylink_link_state *state)
891−{
892− __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
893−
894− phylink_set_port_modes(mask);
895− phylink_set(mask, Autoneg);
896− phylink_set(mask, Pause);
897− phylink_set(mask, Asym_Pause);
898− phylink_set(mask, 10baseT_Half);
899− phylink_set(mask, 10baseT_Full);
900− phylink_set(mask, 100baseT_Half);
901− phylink_set(mask, 100baseT_Full);
902− phylink_set(mask, 1000baseT_Half);
903− phylink_set(mask, 1000baseT_Full);
904− phylink_set(mask, 1000baseX_Full);
905−
906− if (state->interface == PHY_INTERFACE_MODE_INTERNAL ||
907− state->interface == PHY_INTERFACE_MODE_2500BASEX ||
908− state->interface == PHY_INTERFACE_MODE_USXGMII) {
909− phylink_set(mask, 2500baseT_Full);
910− phylink_set(mask, 2500baseX_Full);
911− }
912−
913− linkmode_and(supported, supported, mask);
914− linkmode_and(state->advertising, state->advertising, mask);
915−}
916−
917884 /* Watermark encode
918885 * Bit 8: Unit; 0:1, 1:16
919886 * Bit 7-0: Value to be multiplied with unit
@@ -2575,7 +2542,6 @@ static const struct felix_info felix_info_vsc9959 = { · 1655 unmodified lines
25752542 .regfields = vsc9959_regfields,
25762543 .map = vsc9959_regmap,
25772544 .ops = &vsc9959_ops,
2578− .stats_layout = vsc9959_stats_layout,
25792545 .vcap = vsc9959_vcap_props,
25802546 .vcap_pol_base = VSC9959_VCAP_POLICER_BASE,
25812547 .vcap_pol_max = VSC9959_VCAP_POLICER_MAX,
@@ -2588,7 +2554,6 @@ static const struct felix_info felix_info_vsc9959 = { · 6 unmodified lines
25882554 .ptp_caps = &vsc9959_ptp_caps,
25892555 .mdio_bus_alloc = vsc9959_mdio_bus_alloc,
25902556 .mdio_bus_free = vsc9959_mdio_bus_free,
2591− .phylink_validate = vsc9959_phylink_validate,
25922557 .port_modes = vsc9959_port_modes,
25932558 .port_setup_tc = vsc9959_port_setup_tc,
25942559 .port_sched_speed_set = vsc9959_sched_speed_set,
drivers/net/dsa/ocelot/seville_vsc9953.c+0−32
@@ -543,10 +543,6 @@ static const struct reg_field vsc9953_regfields[REGFIELD_MAX] = { · 542 unmodified lines
543543 [SYS_PAUSE_CFG_PAUSE_ENA] = REG_FIELD_ID(SYS_PAUSE_CFG, 0, 1, 11, 4),
544544 };
545545
546−static const struct ocelot_stat_layout vsc9953_stats_layout[OCELOT_NUM_STATS] = {
547− OCELOT_COMMON_STATS,
548−};
549−
550546 static const struct vcap_field vsc9953_vcap_es0_keys[] = {
551547 [VCAP_ES0_EGR_PORT] = { 0, 4},
552548 [VCAP_ES0_IGR_PORT] = { 4, 4},
@@ -840,32 +836,6 @@ static int vsc9953_reset(struct ocelot *ocelot) · 287 unmodified lines
840836 return 0;
841837 }
842838
843−static void vsc9953_phylink_validate(struct ocelot *ocelot, int port,
844− unsigned long *supported,
845− struct phylink_link_state *state)
846−{
847− __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, };
848−
849− phylink_set_port_modes(mask);
850− phylink_set(mask, Autoneg);
851− phylink_set(mask, Pause);
852− phylink_set(mask, Asym_Pause);
853− phylink_set(mask, 10baseT_Full);
854− phylink_set(mask, 10baseT_Half);
855− phylink_set(mask, 100baseT_Full);
856− phylink_set(mask, 100baseT_Half);
857− phylink_set(mask, 1000baseT_Full);
858− phylink_set(mask, 1000baseX_Full);
859−
860− if (state->interface == PHY_INTERFACE_MODE_INTERNAL) {
861− phylink_set(mask, 2500baseT_Full);
862− phylink_set(mask, 2500baseX_Full);
863− }
864−
865− linkmode_and(supported, supported, mask);
866− linkmode_and(state->advertising, state->advertising, mask);
867−}
868−
869839 /* Watermark encode
870840 * Bit 9: Unit; 0:1, 1:16
871841 * Bit 8-0: Value to be multiplied with unit
@@ -996,7 +966,6 @@ static const struct felix_info seville_info_vsc9953 = { · 124 unmodified lines
996966 .regfields = vsc9953_regfields,
997967 .map = vsc9953_regmap,
998968 .ops = &vsc9953_ops,
999− .stats_layout = vsc9953_stats_layout,
1000969 .vcap = vsc9953_vcap_props,
1001970 .vcap_pol_base = VSC9953_VCAP_POLICER_BASE,
1002971 .vcap_pol_max = VSC9953_VCAP_POLICER_MAX,
@@ -1007,7 +976,6 @@ static const struct felix_info seville_info_vsc9953 = { · 4 unmodified lines
1007976 .num_tx_queues = OCELOT_NUM_TC,
1008977 .mdio_bus_alloc = vsc9953_mdio_bus_alloc,
1009978 .mdio_bus_free = vsc9953_mdio_bus_free,
1010− .phylink_validate = vsc9953_phylink_validate,
1011979 .port_modes = vsc9953_port_modes,
1012980 };
1013981
drivers/net/dsa/sja1105/sja1105_devlink.c+3−9
@@ -122,16 +122,10 @@ int sja1105_devlink_info_get(struct dsa_switch *ds, · 121 unmodified lines
122122 struct netlink_ext_ack *extack)
123123 {
124124 struct sja1105_private *priv = ds->priv;
125− int rc;
126−
127− rc = devlink_info_driver_name_put(req, "sja1105");
128− if (rc)
129− return rc;
130125
131− rc = devlink_info_version_fixed_put(req,
132− DEVLINK_INFO_VERSION_GENERIC_ASIC_ID,
133− priv->info->name);
134− return rc;
126+ return devlink_info_version_fixed_put(req,
127+ DEVLINK_INFO_VERSION_GENERIC_ASIC_ID,
128+ priv->info->name);
135129 }
136130
137131 int sja1105_devlink_setup(struct dsa_switch *ds)
drivers/net/dsa/xrs700x/xrs700x_i2c.c+2−3
@@ -76,8 +76,7 @@ static const struct regmap_config xrs700x_i2c_regmap_config = { · 75 unmodified lines
7676 .val_format_endian = REGMAP_ENDIAN_BIG
7777 };
7878
79−static int xrs700x_i2c_probe(struct i2c_client *i2c,
80− const struct i2c_device_id *i2c_id)
79+static int xrs700x_i2c_probe(struct i2c_client *i2c)
8180 {
8281 struct xrs700x *priv;
8382 int ret;
@@ -148,7 +147,7 @@ static struct i2c_driver xrs700x_i2c_driver = { · 64 unmodified lines
148147 .name = "xrs700x-i2c",
149148 .of_match_table = of_match_ptr(xrs700x_i2c_dt_ids),
150149 },
151− .probe = xrs700x_i2c_probe,
150+ .probe_new = xrs700x_i2c_probe,
152151 .remove = xrs700x_i2c_remove,
153152 .shutdown = xrs700x_i2c_shutdown,
154153 .id_table = xrs700x_i2c_id,
drivers/net/dummy.c+0−7
@@ -99,14 +99,7 @@ static const struct net_device_ops dummy_netdev_ops = { · 98 unmodified lines
9999 .ndo_change_carrier = dummy_change_carrier,
100100 };
101101
102−static void dummy_get_drvinfo(struct net_device *dev,
103− struct ethtool_drvinfo *info)
104−{
105− strscpy(info->driver, DRV_NAME, sizeof(info->driver));
106−}
107−
108102 static const struct ethtool_ops dummy_ethtool_ops = {
109− .get_drvinfo = dummy_get_drvinfo,
110103 .get_ts_info = ethtool_op_get_ts_info,
111104 };
112105
drivers/net/ethernet/Kconfig+0−10
@@ -132,16 +132,6 @@ source "drivers/net/ethernet/mscc/Kconfig" · 131 unmodified lines
132132 source "drivers/net/ethernet/microsoft/Kconfig"
133133 source "drivers/net/ethernet/moxa/Kconfig"
134134 source "drivers/net/ethernet/myricom/Kconfig"
135−
136−config FEALNX
137− tristate "Myson MTD-8xx PCI Ethernet support"
138− depends on PCI
139− select CRC32
140− select MII
141− help
142− Say Y here to support the Myson MTD-800 family of PCI-based Ethernet
143− cards. <http://www.myson.com.tw/>
144−
145135 source "drivers/net/ethernet/ni/Kconfig"
146136 source "drivers/net/ethernet/natsemi/Kconfig"
147137 source "drivers/net/ethernet/neterion/Kconfig"
drivers/net/ethernet/Makefile+0−1
@@ -64,7 +64,6 @@ obj-$(CONFIG_NET_VENDOR_MICROCHIP) += microchip/ · 63 unmodified lines
6464 obj-$(CONFIG_NET_VENDOR_MICROSEMI) += mscc/
6565 obj-$(CONFIG_NET_VENDOR_MOXART) += moxa/
6666 obj-$(CONFIG_NET_VENDOR_MYRI) += myricom/
67−obj-$(CONFIG_FEALNX) += fealnx.o
6867 obj-$(CONFIG_NET_VENDOR_NATSEMI) += natsemi/
6968 obj-$(CONFIG_NET_VENDOR_NETERION) += neterion/
7069 obj-$(CONFIG_NET_VENDOR_NETRONOME) += netronome/
drivers/net/ethernet/adi/adin1110.c+37−21
@@ -196,7 +196,7 @@ static int adin1110_read_reg(struct adin1110_priv *priv, u16 reg, u32 *val) · 195 unmodified lines
196196 {
197197 u32 header_len = ADIN1110_RD_HEADER_LEN;
198198 u32 read_len = ADIN1110_REG_LEN;
199− struct spi_transfer t[2] = {0};
199+ struct spi_transfer t = {0};
200200 int ret;
201201
202202 priv->data[0] = ADIN1110_CD | FIELD_GET(GENMASK(12, 8), reg);
@@ -209,17 +209,15 @@ static int adin1110_read_reg(struct adin1110_priv *priv, u16 reg, u32 *val) · 6 unmodified lines
209209 header_len++;
210210 }
211211
212− t[0].tx_buf = &priv->data[0];
213− t[0].len = header_len;
214−
215212 if (priv->append_crc)
216213 read_len++;
217214
218215 memset(&priv->data[header_len], 0, read_len);
219− t[1].rx_buf = &priv->data[header_len];
220− t[1].len = read_len;
216+ t.tx_buf = &priv->data[0];
217+ t.rx_buf = &priv->data[0];
218+ t.len = read_len + header_len;
221219
222− ret = spi_sync_transfer(priv->spidev, t, 2);
220+ ret = spi_sync_transfer(priv->spidev, &t, 1);
223221 if (ret)
224222 return ret;
225223
@@ -296,7 +294,7 @@ static int adin1110_read_fifo(struct adin1110_port_priv *port_priv) · 70 unmodified lines
296294 {
297295 struct adin1110_priv *priv = port_priv->priv;
298296 u32 header_len = ADIN1110_RD_HEADER_LEN;
299− struct spi_transfer t[2] = {0};
297+ struct spi_transfer t;
300298 u32 frame_size_no_fcs;
301299 struct sk_buff *rxb;
302300 u32 frame_size;
@@ -327,12 +325,7 @@ static int adin1110_read_fifo(struct adin1110_port_priv *port_priv) · 24 unmodified lines
327325 return ret;
328326
329327 frame_size_no_fcs = frame_size - ADIN1110_FRAME_HEADER_LEN - ADIN1110_FEC_LEN;
330−
331− rxb = netdev_alloc_skb(port_priv->netdev, round_len);
332− if (!rxb)
333− return -ENOMEM;
334−
335− memset(priv->data, 0, round_len + ADIN1110_RD_HEADER_LEN);
328+ memset(priv->data, 0, ADIN1110_RD_HEADER_LEN);
336329
337330 priv->data[0] = ADIN1110_CD | FIELD_GET(GENMASK(12, 8), reg);
338331 priv->data[1] = FIELD_GET(GENMASK(7, 0), reg);
@@ -342,21 +335,23 @@ static int adin1110_read_fifo(struct adin1110_port_priv *port_priv) · 3 unmodified lines
342335 header_len++;
343336 }
344337
345− skb_put(rxb, frame_size_no_fcs + ADIN1110_FRAME_HEADER_LEN);
338+ rxb = netdev_alloc_skb(port_priv->netdev, round_len + header_len);
339+ if (!rxb)
340+ return -ENOMEM;
346341
347− t[0].tx_buf = &priv->data[0];
348− t[0].len = header_len;
342+ skb_put(rxb, frame_size_no_fcs + header_len + ADIN1110_FRAME_HEADER_LEN);
349343
350− t[1].rx_buf = &rxb->data[0];
351− t[1].len = round_len;
344+ t.tx_buf = &priv->data[0];
345+ t.rx_buf = &rxb->data[0];
346+ t.len = header_len + round_len;
352347
353− ret = spi_sync_transfer(priv->spidev, t, 2);
348+ ret = spi_sync_transfer(priv->spidev, &t, 1);
354349 if (ret) {
355350 kfree_skb(rxb);
356351 return ret;
357352 }
358353
359− skb_pull(rxb, ADIN1110_FRAME_HEADER_LEN);
354+ skb_pull(rxb, header_len + ADIN1110_FRAME_HEADER_LEN);
360355 rxb->protocol = eth_type_trans(rxb, port_priv->netdev);
361356
362357 if ((port_priv->flags & IFF_ALLMULTI && rxb->pkt_type == PACKET_MULTICAST) ||
@@ -1087,9 +1082,30 @@ static void adin1110_adjust_link(struct net_device *dev) · 724 unmodified lines
10871082 */
10881083 static int adin1110_check_spi(struct adin1110_priv *priv)
10891084 {
1085+ struct gpio_desc *reset_gpio;
10901086 int ret;
10911087 u32 val;
10921088
1089+ reset_gpio = devm_gpiod_get_optional(&priv->spidev->dev, "reset",
1090+ GPIOD_OUT_LOW);
1091+ if (reset_gpio) {
1092+ /* MISO pin is used for internal configuration, can't have
1093+ * anyone else disturbing the SDO line.
1094+ */
1095+ spi_bus_lock(priv->spidev->controller);
1096+
1097+ gpiod_set_value(reset_gpio, 1);
1098+ fsleep(10000);
1099+ gpiod_set_value(reset_gpio, 0);
1100+
1101+ /* Need to wait 90 ms before interacting with
1102+ * the MAC after a HW reset.
1103+ */
1104+ fsleep(90000);
1105+
1106+ spi_bus_unlock(priv->spidev->controller);
1107+ }
1108+
10931109 ret = adin1110_read_reg(priv, ADIN1110_PHY_ID, &val);
10941110 if (ret < 0)
10951111 return ret;
drivers/net/ethernet/alacritech/slic.h+6−6
@@ -288,13 +288,13 @@ do { \ · 287 unmodified lines
288288 u64_stats_update_end(&(st)->syncp); \
289289 } while (0)
290290
291−#define SLIC_GET_STATS_COUNTER(newst, st, counter) \
292−{ \
293− unsigned int start; \
291+#define SLIC_GET_STATS_COUNTER(newst, st, counter) \
292+{ \
293+ unsigned int start; \
294294 do { \
295− start = u64_stats_fetch_begin_irq(&(st)->syncp); \
296− newst = (st)->counter; \
297− } while (u64_stats_fetch_retry_irq(&(st)->syncp, start)); \
295+ start = u64_stats_fetch_begin(&(st)->syncp); \
296+ newst = (st)->counter; \
297+ } while (u64_stats_fetch_retry(&(st)->syncp, start)); \
298298 }
299299
300300 struct slic_upr {
drivers/net/ethernet/altera/altera_tse_main.c+0−1
@@ -1096,7 +1096,6 @@ static struct phylink_pcs *alt_tse_select_pcs(struct phylink_config *config, · 1095 unmodified lines
10961096 }
10971097
10981098 static const struct phylink_mac_ops alt_tse_phylink_ops = {
1099− .validate = phylink_generic_validate,
11001099 .mac_an_restart = alt_tse_mac_an_restart,
11011100 .mac_config = alt_tse_mac_config,
11021101 .mac_link_down = alt_tse_mac_link_down,
drivers/net/ethernet/amazon/ena/ena_ethtool.c+2−2
@@ -118,9 +118,9 @@ static void ena_safe_update_stat(u64 *src, u64 *dst, · 117 unmodified lines
118118 unsigned int start;
119119
120120 do {
121− start = u64_stats_fetch_begin_irq(syncp);
121+ start = u64_stats_fetch_begin(syncp);
122122 *(dst) = *src;
123− } while (u64_stats_fetch_retry_irq(syncp, start));
123+ } while (u64_stats_fetch_retry(syncp, start));
124124 }
125125
126126 static void ena_queue_stats(struct ena_adapter *adapter, u64 **data)
drivers/net/ethernet/amazon/ena/ena_netdev.c+6−6
@@ -3268,10 +3268,10 @@ static void ena_get_stats64(struct net_device *netdev, · 3267 unmodified lines
32683268 tx_ring = &adapter->tx_ring[i];
32693269
32703270 do {
3271− start = u64_stats_fetch_begin_irq(&tx_ring->syncp);
3271+ start = u64_stats_fetch_begin(&tx_ring->syncp);
32723272 packets = tx_ring->tx_stats.cnt;
32733273 bytes = tx_ring->tx_stats.bytes;
3274− } while (u64_stats_fetch_retry_irq(&tx_ring->syncp, start));
3274+ } while (u64_stats_fetch_retry(&tx_ring->syncp, start));
32753275
32763276 stats->tx_packets += packets;
32773277 stats->tx_bytes += bytes;
@@ -3279,20 +3279,20 @@ static void ena_get_stats64(struct net_device *netdev, · 1 unmodified line
32793279 rx_ring = &adapter->rx_ring[i];
32803280
32813281 do {
3282− start = u64_stats_fetch_begin_irq(&rx_ring->syncp);
3282+ start = u64_stats_fetch_begin(&rx_ring->syncp);
32833283 packets = rx_ring->rx_stats.cnt;
32843284 bytes = rx_ring->rx_stats.bytes;
3285− } while (u64_stats_fetch_retry_irq(&rx_ring->syncp, start));
3285+ } while (u64_stats_fetch_retry(&rx_ring->syncp, start));
32863286
32873287 stats->rx_packets += packets;
32883288 stats->rx_bytes += bytes;
32893289 }
32903290
32913291 do {
3292− start = u64_stats_fetch_begin_irq(&adapter->syncp);
3292+ start = u64_stats_fetch_begin(&adapter->syncp);
32933293 rx_drops = adapter->dev_stats.rx_drops;
32943294 tx_drops = adapter->dev_stats.tx_drops;
3295− } while (u64_stats_fetch_retry_irq(&adapter->syncp, start));
3295+ } while (u64_stats_fetch_retry(&adapter->syncp, start));
32963296
32973297 stats->rx_dropped = rx_drops;
32983298 stats->tx_dropped = tx_drops;
drivers/net/ethernet/amd/atarilance.c+1−1
@@ -824,7 +824,7 @@ lance_start_xmit(struct sk_buff *skb, struct net_device *dev) · 823 unmodified lines
824824 lp->memcpy_f( PKTBUF_ADDR(head), (void *)skb->data, skb->len );
825825 head->flag = TMD1_OWN_CHIP | TMD1_ENP | TMD1_STP;
826826 dev->stats.tx_bytes += skb->len;
827− dev_kfree_skb( skb );
827+ dev_consume_skb_irq(skb);
828828 lp->cur_tx++;
829829 while( lp->cur_tx >= TX_RING_SIZE && lp->dirty_tx >= TX_RING_SIZE ) {
830830 lp->cur_tx -= TX_RING_SIZE;
drivers/net/ethernet/amd/lance.c+1−1
@@ -1001,7 +1001,7 @@ static netdev_tx_t lance_start_xmit(struct sk_buff *skb, · 1000 unmodified lines
10011001 skb_copy_from_linear_data(skb, &lp->tx_bounce_buffs[entry], skb->len);
10021002 lp->tx_ring[entry].base =
10031003 ((u32)isa_virt_to_bus((lp->tx_bounce_buffs + entry)) & 0xffffff) | 0x83000000;
1004− dev_kfree_skb(skb);
1004+ dev_consume_skb_irq(skb);
10051005 } else {
10061006 lp->tx_skbuff[entry] = skb;
10071007 lp->tx_ring[entry].base = ((u32)isa_virt_to_bus(skb->data) & 0xffffff) | 0x83000000;
drivers/net/ethernet/amd/xgbe/xgbe-phy-v2.c+8−15
@@ -189,6 +189,7 @@ enum xgbe_sfp_cable { · 188 unmodified lines
189189 XGBE_SFP_CABLE_UNKNOWN = 0,
190190 XGBE_SFP_CABLE_ACTIVE,
191191 XGBE_SFP_CABLE_PASSIVE,
192+ XGBE_SFP_CABLE_FIBER,
192193 };
193194
194195 enum xgbe_sfp_base {
@@ -236,10 +237,7 @@ enum xgbe_sfp_speed { · 41 unmodified lines
236237
237238 #define XGBE_SFP_BASE_BR 12
238239 #define XGBE_SFP_BASE_BR_1GBE_MIN 0x0a
239−#define XGBE_SFP_BASE_BR_1GBE_MAX 0x0d
240240 #define XGBE_SFP_BASE_BR_10GBE_MIN 0x64
241−#define XGBE_SFP_BASE_BR_10GBE_MAX 0x68
242−#define XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX 0x78
243241
244242 #define XGBE_SFP_BASE_CU_CABLE_LEN 18
245243
@@ -826,29 +824,22 @@ static void xgbe_phy_sfp_phy_settings(struct xgbe_prv_data *pdata) · 580 unmodified lines
826824 static bool xgbe_phy_sfp_bit_rate(struct xgbe_sfp_eeprom *sfp_eeprom,
827825 enum xgbe_sfp_speed sfp_speed)
828826 {
829− u8 *sfp_base, min, max;
827+ u8 *sfp_base, min;
830828
831829 sfp_base = sfp_eeprom->base;
832830
833831 switch (sfp_speed) {
834832 case XGBE_SFP_SPEED_1000:
835833 min = XGBE_SFP_BASE_BR_1GBE_MIN;
836− max = XGBE_SFP_BASE_BR_1GBE_MAX;
837834 break;
838835 case XGBE_SFP_SPEED_10000:
839836 min = XGBE_SFP_BASE_BR_10GBE_MIN;
840− if (memcmp(&sfp_eeprom->base[XGBE_SFP_BASE_VENDOR_NAME],
841− XGBE_MOLEX_VENDOR, XGBE_SFP_BASE_VENDOR_NAME_LEN) == 0)
842− max = XGBE_MOLEX_SFP_BASE_BR_10GBE_MAX;
843− else
844− max = XGBE_SFP_BASE_BR_10GBE_MAX;
845837 break;
846838 default:
847839 return false;
848840 }
849841
850− return ((sfp_base[XGBE_SFP_BASE_BR] >= min) &&
851− (sfp_base[XGBE_SFP_BASE_BR] <= max));
842+ return sfp_base[XGBE_SFP_BASE_BR] >= min;
852843 }
853844
854845 static void xgbe_phy_free_phy_device(struct xgbe_prv_data *pdata)
@@ -1149,16 +1140,18 @@ static void xgbe_phy_sfp_parse_eeprom(struct xgbe_prv_data *pdata) · 294 unmodified lines
11491140 phy_data->sfp_tx_fault = xgbe_phy_check_sfp_tx_fault(phy_data);
11501141 phy_data->sfp_rx_los = xgbe_phy_check_sfp_rx_los(phy_data);
11511142
1152− /* Assume ACTIVE cable unless told it is PASSIVE */
1143+ /* Assume FIBER cable unless told otherwise */
11531144 if (sfp_base[XGBE_SFP_BASE_CABLE] & XGBE_SFP_BASE_CABLE_PASSIVE) {
11541145 phy_data->sfp_cable = XGBE_SFP_CABLE_PASSIVE;
11551146 phy_data->sfp_cable_len = sfp_base[XGBE_SFP_BASE_CU_CABLE_LEN];
1156− } else {
1147+ } else if (sfp_base[XGBE_SFP_BASE_CABLE] & XGBE_SFP_BASE_CABLE_ACTIVE) {
11571148 phy_data->sfp_cable = XGBE_SFP_CABLE_ACTIVE;
1149+ } else {
1150+ phy_data->sfp_cable = XGBE_SFP_CABLE_FIBER;
11581151 }
11591152
11601153 /* Determine the type of SFP */
1161− if (phy_data->sfp_cable == XGBE_SFP_CABLE_PASSIVE &&
1154+ if (phy_data->sfp_cable != XGBE_SFP_CABLE_FIBER &&
11621155 xgbe_phy_sfp_bit_rate(sfp_eeprom, XGBE_SFP_SPEED_10000))
11631156 phy_data->sfp_base = XGBE_SFP_BASE_10000_CR;
11641157 else if (sfp_base[XGBE_SFP_BASE_10GBE_CC] & XGBE_SFP_BASE_10GBE_CC_SR)
drivers/net/ethernet/amd/xgbe/xgbe-ptp.c+4−16
@@ -134,27 +134,15 @@ static u64 xgbe_cc_read(const struct cyclecounter *cc) · 133 unmodified lines
134134 return nsec;
135135 }
136136
137−static int xgbe_adjfreq(struct ptp_clock_info *info, s32 delta)
137+static int xgbe_adjfine(struct ptp_clock_info *info, long scaled_ppm)
138138 {
139139 struct xgbe_prv_data *pdata = container_of(info,
140140 struct xgbe_prv_data,
141141 ptp_clock_info);
142142 unsigned long flags;
143− u64 adjust;
144− u32 addend, diff;
145− unsigned int neg_adjust = 0;
143+ u64 addend;
146144
147− if (delta < 0) {
148− neg_adjust = 1;
149− delta = -delta;
150− }
151−
152− adjust = pdata->tstamp_addend;
153− adjust *= delta;
154− diff = div_u64(adjust, 1000000000UL);
155−
156− addend = (neg_adjust) ? pdata->tstamp_addend - diff :
157− pdata->tstamp_addend + diff;
145+ addend = adjust_by_scaled_ppm(pdata->tstamp_addend, scaled_ppm);
158146
159147 spin_lock_irqsave(&pdata->tstamp_lock, flags);
160148
@@ -235,7 +223,7 @@ void xgbe_ptp_register(struct xgbe_prv_data *pdata) · 74 unmodified lines
235223 netdev_name(pdata->netdev));
236224 info->owner = THIS_MODULE;
237225 info->max_adj = pdata->ptpclk_rate;
238− info->adjfreq = xgbe_adjfreq;
226+ info->adjfine = xgbe_adjfine;
239227 info->adjtime = xgbe_adjtime;
240228 info->gettime64 = xgbe_gettime;
241229 info->settime64 = xgbe_settime;
drivers/net/ethernet/apple/bmac.c+1−1
@@ -1510,7 +1510,7 @@ static void bmac_tx_timeout(struct timer_list *t) · 1509 unmodified lines
15101510 i = bp->tx_empty;
15111511 ++dev->stats.tx_errors;
15121512 if (i != bp->tx_fill) {
1513− dev_kfree_skb(bp->tx_bufs[i]);
1513+ dev_kfree_skb_irq(bp->tx_bufs[i]);
15141514 bp->tx_bufs[i] = NULL;
15151515 if (++i >= N_TX_RING) i = 0;
15161516 bp->tx_empty = i;
drivers/net/ethernet/apple/mace.c+1−1
@@ -846,7 +846,7 @@ static void mace_tx_timeout(struct timer_list *t) · 845 unmodified lines
846846 if (mp->tx_bad_runt) {
847847 mp->tx_bad_runt = 0;
848848 } else if (i != mp->tx_fill) {
849− dev_kfree_skb(mp->tx_bufs[i]);
849+ dev_kfree_skb_irq(mp->tx_bufs[i]);
850850 if (++i >= N_TX_RING)
851851 i = 0;
852852 mp->tx_empty = i;
drivers/net/ethernet/aquantia/atlantic/aq_ring.c+4−4
@@ -934,7 +934,7 @@ unsigned int aq_ring_fill_stats_data(struct aq_ring_s *self, u64 *data) · 933 unmodified lines
934934 /* This data should mimic aq_ethtool_queue_rx_stat_names structure */
935935 do {
936936 count = 0;
937− start = u64_stats_fetch_begin_irq(&self->stats.rx.syncp);
937+ start = u64_stats_fetch_begin(&self->stats.rx.syncp);
938938 data[count] = self->stats.rx.packets;
939939 data[++count] = self->stats.rx.jumbo_packets;
940940 data[++count] = self->stats.rx.lro_packets;
@@ -951,15 +951,15 @@ unsigned int aq_ring_fill_stats_data(struct aq_ring_s *self, u64 *data) · 10 unmodified lines
951951 data[++count] = self->stats.rx.xdp_tx;
952952 data[++count] = self->stats.rx.xdp_invalid;
953953 data[++count] = self->stats.rx.xdp_redirect;
954− } while (u64_stats_fetch_retry_irq(&self->stats.rx.syncp, start));
954+ } while (u64_stats_fetch_retry(&self->stats.rx.syncp, start));
955955 } else {
956956 /* This data should mimic aq_ethtool_queue_tx_stat_names structure */
957957 do {
958958 count = 0;
959− start = u64_stats_fetch_begin_irq(&self->stats.tx.syncp);
959+ start = u64_stats_fetch_begin(&self->stats.tx.syncp);
960960 data[count] = self->stats.tx.packets;
961961 data[++count] = self->stats.tx.queue_restarts;
962− } while (u64_stats_fetch_retry_irq(&self->stats.tx.syncp, start));
962+ } while (u64_stats_fetch_retry(&self->stats.tx.syncp, start));
963963 }
964964
965965 return ++count;
drivers/net/ethernet/asix/ax88796c_main.c+2−2
@@ -662,12 +662,12 @@ static void ax88796c_get_stats64(struct net_device *ndev, · 661 unmodified lines
662662 s = per_cpu_ptr(ax_local->stats, cpu);
663663
664664 do {
665− start = u64_stats_fetch_begin_irq(&s->syncp);
665+ start = u64_stats_fetch_begin(&s->syncp);
666666 rx_packets = u64_stats_read(&s->rx_packets);
667667 rx_bytes = u64_stats_read(&s->rx_bytes);
668668 tx_packets = u64_stats_read(&s->tx_packets);
669669 tx_bytes = u64_stats_read(&s->tx_bytes);
670− } while (u64_stats_fetch_retry_irq(&s->syncp, start));
670+ } while (u64_stats_fetch_retry(&s->syncp, start));
671671
672672 stats->rx_packets += rx_packets;
673673 stats->rx_bytes += rx_bytes;
drivers/net/ethernet/atheros/ag71xx.c+0−1
@@ -1086,7 +1086,6 @@ static void ag71xx_mac_link_up(struct phylink_config *config, · 1085 unmodified lines
10861086 }
10871087
10881088 static const struct phylink_mac_ops ag71xx_phylink_mac_ops = {
1089− .validate = phylink_generic_validate,
10901089 .mac_config = ag71xx_mac_config,
10911090 .mac_link_down = ag71xx_mac_link_down,
10921091 .mac_link_up = ag71xx_mac_link_up,
drivers/net/ethernet/broadcom/b44.c+4−4
@@ -1680,7 +1680,7 @@ static void b44_get_stats64(struct net_device *dev, · 1679 unmodified lines
16801680 unsigned int start;
16811681
16821682 do {
1683− start = u64_stats_fetch_begin_irq(&hwstat->syncp);
1683+ start = u64_stats_fetch_begin(&hwstat->syncp);
16841684
16851685 /* Convert HW stats into rtnl_link_stats64 stats. */
16861686 nstat->rx_packets = hwstat->rx_pkts;
@@ -1714,7 +1714,7 @@ static void b44_get_stats64(struct net_device *dev, · 27 unmodified lines
17141714 /* Carrier lost counter seems to be broken for some devices */
17151715 nstat->tx_carrier_errors = hwstat->tx_carrier_lost;
17161716 #endif
1717− } while (u64_stats_fetch_retry_irq(&hwstat->syncp, start));
1717+ } while (u64_stats_fetch_retry(&hwstat->syncp, start));
17181718
17191719 }
17201720
@@ -2082,12 +2082,12 @@ static void b44_get_ethtool_stats(struct net_device *dev, · 361 unmodified lines
20822082 do {
20832083 data_src = &hwstat->tx_good_octets;
20842084 data_dst = data;
2085− start = u64_stats_fetch_begin_irq(&hwstat->syncp);
2085+ start = u64_stats_fetch_begin(&hwstat->syncp);
20862086
20872087 for (i = 0; i < ARRAY_SIZE(b44_gstrings); i++)
20882088 *data_dst++ = *data_src++;
20892089
2090− } while (u64_stats_fetch_retry_irq(&hwstat->syncp, start));
2090+ } while (u64_stats_fetch_retry(&hwstat->syncp, start));
20912091 }
20922092
20932093 static void b44_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
drivers/net/ethernet/broadcom/bcm4908_enet.c+40−17
@@ -36,13 +36,24 @@ · 35 unmodified lines
3636 #define ENET_MAX_ETH_OVERHEAD (ETH_HLEN + BRCM_MAX_TAG_LEN + VLAN_HLEN + \
3737 ETH_FCS_LEN + 4) /* 32 */
3838
39+#define ENET_RX_SKB_BUF_SIZE (NET_SKB_PAD + NET_IP_ALIGN + \
40+ ETH_HLEN + BRCM_MAX_TAG_LEN + VLAN_HLEN + \
41+ ENET_MTU_MAX + ETH_FCS_LEN + 4)
42+#define ENET_RX_SKB_BUF_ALLOC_SIZE (SKB_DATA_ALIGN(ENET_RX_SKB_BUF_SIZE) + \
43+ SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
44+#define ENET_RX_BUF_DMA_OFFSET (NET_SKB_PAD + NET_IP_ALIGN)
45+#define ENET_RX_BUF_DMA_SIZE (ENET_RX_SKB_BUF_SIZE - ENET_RX_BUF_DMA_OFFSET)
46+
3947 struct bcm4908_enet_dma_ring_bd {
4048 __le32 ctl;
4149 __le32 addr;
4250 } __packed;
4351
4452 struct bcm4908_enet_dma_ring_slot {
45− struct sk_buff *skb;
53+ union {
54+ void *buf; /* RX */
55+ struct sk_buff *skb; /* TX */
56+ };
4657 unsigned int len;
4758 dma_addr_t dma_addr;
4859 };
@@ -260,22 +271,21 @@ static int bcm4908_enet_dma_alloc_rx_buf(struct bcm4908_enet *enet, unsigned int · 211 unmodified lines
260271 u32 tmp;
261272 int err;
262273
263− slot->len = ENET_MTU_MAX + ENET_MAX_ETH_OVERHEAD;
264−
265− slot->skb = netdev_alloc_skb(enet->netdev, slot->len);
266− if (!slot->skb)
274+ slot->buf = napi_alloc_frag(ENET_RX_SKB_BUF_ALLOC_SIZE);
275+ if (!slot->buf)
267276 return -ENOMEM;
268277
269− slot->dma_addr = dma_map_single(dev, slot->skb->data, slot->len, DMA_FROM_DEVICE);
278+ slot->dma_addr = dma_map_single(dev, slot->buf + ENET_RX_BUF_DMA_OFFSET,
279+ ENET_RX_BUF_DMA_SIZE, DMA_FROM_DEVICE);
270280 err = dma_mapping_error(dev, slot->dma_addr);
271281 if (err) {
272282 dev_err(dev, "Failed to map DMA buffer: %d\n", err);
273− kfree_skb(slot->skb);
274− slot->skb = NULL;
283+ skb_free_frag(slot->buf);
284+ slot->buf = NULL;
275285 return err;
276286 }
277287
278− tmp = slot->len << DMA_CTL_LEN_DESC_BUFLENGTH_SHIFT;
288+ tmp = ENET_RX_BUF_DMA_SIZE << DMA_CTL_LEN_DESC_BUFLENGTH_SHIFT;
279289 tmp |= DMA_CTL_STATUS_OWN;
280290 if (idx == enet->rx_ring.length - 1)
281291 tmp |= DMA_CTL_STATUS_WRAP;
@@ -315,11 +325,11 @@ static void bcm4908_enet_dma_uninit(struct bcm4908_enet *enet) · 33 unmodified lines
315325
316326 for (i = rx_ring->length - 1; i >= 0; i--) {
317327 slot = &rx_ring->slots[i];
318− if (!slot->skb)
328+ if (!slot->buf)
319329 continue;
320330 dma_unmap_single(dev, slot->dma_addr, slot->len, DMA_FROM_DEVICE);
321− kfree_skb(slot->skb);
322− slot->skb = NULL;
331+ skb_free_frag(slot->buf);
332+ slot->buf = NULL;
323333 }
324334 }
325335
@@ -495,6 +505,7 @@ static int bcm4908_enet_stop(struct net_device *netdev) · 169 unmodified lines
495505 netif_carrier_off(netdev);
496506 napi_disable(&rx_ring->napi);
497507 napi_disable(&tx_ring->napi);
508+ netdev_reset_queue(netdev);
498509
499510 bcm4908_enet_dma_rx_ring_disable(enet, &enet->rx_ring);
500511 bcm4908_enet_dma_tx_ring_disable(enet, &enet->tx_ring);
@@ -554,6 +565,8 @@ static netdev_tx_t bcm4908_enet_start_xmit(struct sk_buff *skb, struct net_devic · 53 unmodified lines
554565 if (ring->write_idx + 1 == ring->length - 1)
555566 tmp |= DMA_CTL_STATUS_WRAP;
556567
568+ netdev_sent_queue(enet->netdev, skb->len);
569+
557570 buf_desc->addr = cpu_to_le32((uint32_t)slot->dma_addr);
558571 buf_desc->ctl = cpu_to_le32(tmp);
559572
@@ -575,6 +588,7 @@ static int bcm4908_enet_poll_rx(struct napi_struct *napi, int weight) · 15 unmodified lines
575588 while (handled < weight) {
576589 struct bcm4908_enet_dma_ring_bd *buf_desc;
577590 struct bcm4908_enet_dma_ring_slot slot;
591+ struct sk_buff *skb;
578592 u32 ctl;
579593 int len;
580594 int err;
@@ -598,16 +612,24 @@ static int bcm4908_enet_poll_rx(struct napi_struct *napi, int weight) · 17 unmodified lines
598612
599613 if (len < ETH_ZLEN ||
600614 (ctl & (DMA_CTL_STATUS_SOP | DMA_CTL_STATUS_EOP)) != (DMA_CTL_STATUS_SOP | DMA_CTL_STATUS_EOP)) {
601− kfree_skb(slot.skb);
615+ skb_free_frag(slot.buf);
602616 enet->netdev->stats.rx_dropped++;
603617 break;
604618 }
605619
606− dma_unmap_single(dev, slot.dma_addr, slot.len, DMA_FROM_DEVICE);
620+ dma_unmap_single(dev, slot.dma_addr, ENET_RX_BUF_DMA_SIZE, DMA_FROM_DEVICE);
621+
622+ skb = build_skb(slot.buf, ENET_RX_SKB_BUF_ALLOC_SIZE);
623+ if (unlikely(!skb)) {
624+ skb_free_frag(slot.buf);
625+ enet->netdev->stats.rx_dropped++;
626+ break;
627+ }
628+ skb_reserve(skb, ENET_RX_BUF_DMA_OFFSET);
629+ skb_put(skb, len - ETH_FCS_LEN);
630+ skb->protocol = eth_type_trans(skb, enet->netdev);
607631
608− skb_put(slot.skb, len - ETH_FCS_LEN);
609− slot.skb->protocol = eth_type_trans(slot.skb, enet->netdev);
610− netif_receive_skb(slot.skb);
632+ netif_receive_skb(skb);
611633
612634 enet->netdev->stats.rx_packets++;
613635 enet->netdev->stats.rx_bytes += len;
@@ -652,6 +674,7 @@ static int bcm4908_enet_poll_tx(struct napi_struct *napi, int weight) · 38 unmodified lines
652674 tx_ring->read_idx = 0;
653675 }
654676
677+ netdev_completed_queue(enet->netdev, handled, bytes);
655678 enet->netdev->stats.tx_packets += handled;
656679 enet->netdev->stats.tx_bytes += bytes;
657680
drivers/net/ethernet/broadcom/bcmsysport.c+17−6
@@ -295,6 +295,8 @@ static const struct bcm_sysport_stats bcm_sysport_gstrings_stats[] = { · 294 unmodified lines
295295 /* RBUF misc statistics */
296296 STAT_RBUF("rbuf_ovflow_cnt", mib.rbuf_ovflow_cnt, RBUF_OVFL_DISC_CNTR),
297297 STAT_RBUF("rbuf_err_cnt", mib.rbuf_err_cnt, RBUF_ERR_PKT_CNTR),
298+ /* RDMA misc statistics */
299+ STAT_RDMA("rdma_ovflow_cnt", mib.rdma_ovflow_cnt, RDMA_OVFL_DISC_CNTR),
298300 STAT_MIB_SOFT("alloc_rx_buff_failed", mib.alloc_rx_buff_failed),
299301 STAT_MIB_SOFT("rx_dma_failed", mib.rx_dma_failed),
300302 STAT_MIB_SOFT("tx_dma_failed", mib.tx_dma_failed),
@@ -333,6 +335,7 @@ static inline bool bcm_sysport_lite_stat_valid(enum bcm_sysport_stat_type type) · 32 unmodified lines
333335 case BCM_SYSPORT_STAT_NETDEV64:
334336 case BCM_SYSPORT_STAT_RXCHK:
335337 case BCM_SYSPORT_STAT_RBUF:
338+ case BCM_SYSPORT_STAT_RDMA:
336339 case BCM_SYSPORT_STAT_SOFT:
337340 return true;
338341 default:
@@ -436,6 +439,14 @@ static void bcm_sysport_update_mib_counters(struct bcm_sysport_priv *priv) · 97 unmodified lines
436439 if (val == ~0)
437440 rbuf_writel(priv, 0, s->reg_offset);
438441 break;
442+ case BCM_SYSPORT_STAT_RDMA:
443+ if (!priv->is_lite)
444+ continue;
445+
446+ val = rdma_readl(priv, s->reg_offset);
447+ if (val == ~0)
448+ rdma_writel(priv, 0, s->reg_offset);
449+ break;
439450 }
440451
441452 j += s->stat_sizeof;
@@ -457,10 +468,10 @@ static void bcm_sysport_update_tx_stats(struct bcm_sysport_priv *priv, · 15 unmodified lines
457468 for (q = 0; q < priv->netdev->num_tx_queues; q++) {
458469 ring = &priv->tx_rings[q];
459470 do {
460− start = u64_stats_fetch_begin_irq(&priv->syncp);
471+ start = u64_stats_fetch_begin(&priv->syncp);
461472 bytes = ring->bytes;
462473 packets = ring->packets;
463− } while (u64_stats_fetch_retry_irq(&priv->syncp, start));
474+ } while (u64_stats_fetch_retry(&priv->syncp, start));
464475
465476 *tx_bytes += bytes;
466477 *tx_packets += packets;
@@ -504,9 +515,9 @@ static void bcm_sysport_get_stats(struct net_device *dev, · 37 unmodified lines
504515 if (s->stat_sizeof == sizeof(u64) &&
505516 s->type == BCM_SYSPORT_STAT_NETDEV64) {
506517 do {
507− start = u64_stats_fetch_begin_irq(syncp);
518+ start = u64_stats_fetch_begin(syncp);
508519 data[i] = *(u64 *)p;
509− } while (u64_stats_fetch_retry_irq(syncp, start));
520+ } while (u64_stats_fetch_retry(syncp, start));
510521 } else
511522 data[i] = *(u32 *)p;
512523 j++;
@@ -1878,10 +1889,10 @@ static void bcm_sysport_get_stats64(struct net_device *dev, · 1365 unmodified lines
18781889 &stats->tx_packets);
18791890
18801891 do {
1881− start = u64_stats_fetch_begin_irq(&priv->syncp);
1892+ start = u64_stats_fetch_begin(&priv->syncp);
18821893 stats->rx_packets = stats64->rx_packets;
18831894 stats->rx_bytes = stats64->rx_bytes;
1884− } while (u64_stats_fetch_retry_irq(&priv->syncp, start));
1895+ } while (u64_stats_fetch_retry(&priv->syncp, start));
18851896 }
18861897
18871898 static void bcm_sysport_netif_start(struct net_device *dev)
drivers/net/ethernet/broadcom/bcmsysport.h+11−0
@@ -290,6 +290,7 @@ struct bcm_rsb { · 289 unmodified lines
290290
291291 #define RDMA_WRITE_PTR_HI 0x1010
292292 #define RDMA_WRITE_PTR_LO 0x1014
293+#define RDMA_OVFL_DISC_CNTR 0x1018
293294 #define RDMA_PROD_INDEX 0x1018
294295 #define RDMA_PROD_INDEX_MASK 0xffff
295296
@@ -565,6 +566,7 @@ struct bcm_sysport_mib { · 269 unmodified lines
565566 u32 rxchk_other_pkt_disc;
566567 u32 rbuf_ovflow_cnt;
567568 u32 rbuf_err_cnt;
569+ u32 rdma_ovflow_cnt;
568570 u32 alloc_rx_buff_failed;
569571 u32 rx_dma_failed;
570572 u32 tx_dma_failed;
@@ -581,6 +583,7 @@ enum bcm_sysport_stat_type { · 10 unmodified lines
581583 BCM_SYSPORT_STAT_RUNT,
582584 BCM_SYSPORT_STAT_RXCHK,
583585 BCM_SYSPORT_STAT_RBUF,
586+ BCM_SYSPORT_STAT_RDMA,
584587 BCM_SYSPORT_STAT_SOFT,
585588 };
586589
@@ -627,6 +630,14 @@ enum bcm_sysport_stat_type { · 40 unmodified lines
627630 .reg_offset = ofs, \
628631 }
629632
633+#define STAT_RDMA(str, m, ofs) { \
634+ .stat_string = str, \
635+ .stat_sizeof = sizeof(((struct bcm_sysport_priv *)0)->m), \
636+ .stat_offset = offsetof(struct bcm_sysport_priv, m), \
637+ .type = BCM_SYSPORT_STAT_RDMA, \
638+ .reg_offset = ofs, \
639+}
640+
630641 /* TX bytes and packets */
631642 #define NUM_SYSPORT_TXQ_STAT 2
632643
drivers/net/ethernet/broadcom/bnx2.c+4−3
@@ -3045,7 +3045,7 @@ error: · 3044 unmodified lines
30453045
30463046 dma_unmap_single(&bp->pdev->dev, dma_addr, bp->rx_buf_use_size,
30473047 DMA_FROM_DEVICE);
3048− skb = build_skb(data, 0);
3048+ skb = slab_build_skb(data);
30493049 if (!skb) {
30503050 kfree(data);
30513051 goto error;
@@ -5415,8 +5415,9 @@ bnx2_set_rx_ring_size(struct bnx2 *bp, u32 size) · 2363 unmodified lines
54155415
54165416 bp->rx_buf_use_size = rx_size;
54175417 /* hw alignment + build_skb() overhead*/
5418− bp->rx_buf_size = SKB_DATA_ALIGN(bp->rx_buf_use_size + BNX2_RX_ALIGN) +
5419− NET_SKB_PAD + SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
5418+ bp->rx_buf_size = kmalloc_size_roundup(
5419+ SKB_DATA_ALIGN(bp->rx_buf_use_size + BNX2_RX_ALIGN) +
5420+ NET_SKB_PAD + SKB_DATA_ALIGN(sizeof(struct skb_shared_info)));
54205421 bp->rx_jumbo_thresh = rx_size - BNX2_RX_OFFSET;
54215422 bp->rx_ring_size = size;
54225423 bp->rx_max_ring = bnx2_find_max_ring(size, BNX2_MAX_RX_RINGS);
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c+5−4
@@ -13671,19 +13671,20 @@ static int bnx2x_send_update_drift_ramrod(struct bnx2x *bp, int drift_dir, · 13670 unmodified lines
1367113671 return bnx2x_func_state_change(bp, &func_params);
1367213672 }
1367313673
13674−static int bnx2x_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb)
13674+static int bnx2x_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
1367513675 {
1367613676 struct bnx2x *bp = container_of(ptp, struct bnx2x, ptp_clock_info);
1367713677 int rc;
1367813678 int drift_dir = 1;
1367913679 int val, period, period1, period2, dif, dif1, dif2;
1368013680 int best_dif = BNX2X_MAX_PHC_DRIFT, best_period = 0, best_val = 0;
13681+ s32 ppb = scaled_ppm_to_ppb(scaled_ppm);
1368113682
13682− DP(BNX2X_MSG_PTP, "PTP adjfreq called, ppb = %d\n", ppb);
13683+ DP(BNX2X_MSG_PTP, "PTP adjfine called, ppb = %d\n", ppb);
1368313684
1368413685 if (!netif_running(bp->dev)) {
1368513686 DP(BNX2X_MSG_PTP,
13686− "PTP adjfreq called while the interface is down\n");
13687+ "PTP adjfine called while the interface is down\n");
1368713688 return -ENETDOWN;
1368813689 }
1368913690
@@ -13818,7 +13819,7 @@ void bnx2x_register_phc(struct bnx2x *bp) · 128 unmodified lines
1381813819 bp->ptp_clock_info.n_ext_ts = 0;
1381913820 bp->ptp_clock_info.n_per_out = 0;
1382013821 bp->ptp_clock_info.pps = 0;
13821− bp->ptp_clock_info.adjfreq = bnx2x_ptp_adjfreq;
13822+ bp->ptp_clock_info.adjfine = bnx2x_ptp_adjfine;
1382213823 bp->ptp_clock_info.adjtime = bnx2x_ptp_adjtime;
1382313824 bp->ptp_clock_info.gettime64 = bnx2x_ptp_gettime;
1382413825 bp->ptp_clock_info.settime64 = bnx2x_ptp_settime;
drivers/net/ethernet/broadcom/bnxt/bnxt.c+79−33
@@ -389,6 +389,9 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) · 388 unmodified lines
389389 return NETDEV_TX_BUSY;
390390 }
391391
392+ if (unlikely(ipv6_hopopt_jumbo_remove(skb)))
393+ goto tx_free;
394+
392395 length = skb->len;
393396 len = skb_headlen(skb);
394397 last_frag = skb_shinfo(skb)->nr_frags;
@@ -5250,7 +5253,7 @@ int bnxt_get_nr_rss_ctxs(struct bnxt *bp, int rx_rings) · 4855 unmodified lines
52505253 return 1;
52515254 }
52525255
5253−static void __bnxt_fill_hw_rss_tbl(struct bnxt *bp, struct bnxt_vnic_info *vnic)
5256+static void bnxt_fill_hw_rss_tbl(struct bnxt *bp, struct bnxt_vnic_info *vnic)
52545257 {
52555258 bool no_rss = !(vnic->flags & BNXT_VNIC_RSS_FLAG);
52565259 u16 i, j;
@@ -5263,8 +5266,8 @@ static void __bnxt_fill_hw_rss_tbl(struct bnxt *bp, struct bnxt_vnic_info *vnic) · 6 unmodified lines
52635266 }
52645267 }
52655268
5266−static void __bnxt_fill_hw_rss_tbl_p5(struct bnxt *bp,
5267− struct bnxt_vnic_info *vnic)
5269+static void bnxt_fill_hw_rss_tbl_p5(struct bnxt *bp,
5270+ struct bnxt_vnic_info *vnic)
52685271 {
52695272 __le16 *ring_tbl = vnic->rss_table;
52705273 struct bnxt_rx_ring_info *rxr;
@@ -5285,12 +5288,27 @@ static void __bnxt_fill_hw_rss_tbl_p5(struct bnxt *bp, · 14 unmodified lines
52855288 }
52865289 }
52875290
5288−static void bnxt_fill_hw_rss_tbl(struct bnxt *bp, struct bnxt_vnic_info *vnic)
5291+static void
5292+__bnxt_hwrm_vnic_set_rss(struct bnxt *bp, struct hwrm_vnic_rss_cfg_input *req,
5293+ struct bnxt_vnic_info *vnic)
52895294 {
52905295 if (bp->flags & BNXT_FLAG_CHIP_P5)
5291− __bnxt_fill_hw_rss_tbl_p5(bp, vnic);
5296+ bnxt_fill_hw_rss_tbl_p5(bp, vnic);
52925297 else
5293− __bnxt_fill_hw_rss_tbl(bp, vnic);
5298+ bnxt_fill_hw_rss_tbl(bp, vnic);
5299+
5300+ if (bp->rss_hash_delta) {
5301+ req->hash_type = cpu_to_le32(bp->rss_hash_delta);
5302+ if (bp->rss_hash_cfg & bp->rss_hash_delta)
5303+ req->flags |= VNIC_RSS_CFG_REQ_FLAGS_HASH_TYPE_INCLUDE;
5304+ else
5305+ req->flags |= VNIC_RSS_CFG_REQ_FLAGS_HASH_TYPE_EXCLUDE;
5306+ } else {
5307+ req->hash_type = cpu_to_le32(bp->rss_hash_cfg);
5308+ }
5309+ req->hash_mode_flags = VNIC_RSS_CFG_REQ_HASH_MODE_FLAGS_DEFAULT;
5310+ req->ring_grp_tbl_addr = cpu_to_le64(vnic->rss_table_dma_addr);
5311+ req->hash_key_tbl_addr = cpu_to_le64(vnic->rss_hash_key_dma_addr);
52945312 }
52955313
52965314 static int bnxt_hwrm_vnic_set_rss(struct bnxt *bp, u16 vnic_id, bool set_rss)
@@ -5307,14 +5325,8 @@ static int bnxt_hwrm_vnic_set_rss(struct bnxt *bp, u16 vnic_id, bool set_rss) · 10 unmodified lines
53075325 if (rc)
53085326 return rc;
53095327
5310− if (set_rss) {
5311− bnxt_fill_hw_rss_tbl(bp, vnic);
5312− req->hash_type = cpu_to_le32(bp->rss_hash_cfg);
5313− req->hash_mode_flags = VNIC_RSS_CFG_REQ_HASH_MODE_FLAGS_DEFAULT;
5314− req->ring_grp_tbl_addr = cpu_to_le64(vnic->rss_table_dma_addr);
5315− req->hash_key_tbl_addr =
5316− cpu_to_le64(vnic->rss_hash_key_dma_addr);
5317− }
5328+ if (set_rss)
5329+ __bnxt_hwrm_vnic_set_rss(bp, req, vnic);
53185330 req->rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[0]);
53195331 return hwrm_req_send(bp, req);
53205332 }
@@ -5335,10 +5347,7 @@ static int bnxt_hwrm_vnic_set_rss_p5(struct bnxt *bp, u16 vnic_id, bool set_rss) · 14 unmodified lines
53355347 if (!set_rss)
53365348 return hwrm_req_send(bp, req);
53375349
5338− bnxt_fill_hw_rss_tbl(bp, vnic);
5339− req->hash_type = cpu_to_le32(bp->rss_hash_cfg);
5340− req->hash_mode_flags = VNIC_RSS_CFG_REQ_HASH_MODE_FLAGS_DEFAULT;
5341− req->hash_key_tbl_addr = cpu_to_le64(vnic->rss_hash_key_dma_addr);
5350+ __bnxt_hwrm_vnic_set_rss(bp, req, vnic);
53425351 ring_tbl_map = vnic->rss_table_dma_addr;
53435352 nr_ctxs = bnxt_get_nr_rss_ctxs(bp, bp->rx_nr_rings);
53445353
@@ -5357,6 +5366,25 @@ exit: · 12 unmodified lines
53575366 return rc;
53585367 }
53595368
5369+static void bnxt_hwrm_update_rss_hash_cfg(struct bnxt *bp)
5370+{
5371+ struct bnxt_vnic_info *vnic = &bp->vnic_info[0];
5372+ struct hwrm_vnic_rss_qcfg_output *resp;
5373+ struct hwrm_vnic_rss_qcfg_input *req;
5374+
5375+ if (hwrm_req_init(bp, req, HWRM_VNIC_RSS_QCFG))
5376+ return;
5377+
5378+ /* all contexts configured to same hash_type, zero always exists */
5379+ req->rss_ctx_idx = cpu_to_le16(vnic->fw_rss_cos_lb_ctx[0]);
5380+ resp = hwrm_req_hold(bp, req);
5381+ if (!hwrm_req_send(bp, req)) {
5382+ bp->rss_hash_cfg = le32_to_cpu(resp->hash_type) ?: bp->rss_hash_cfg;
5383+ bp->rss_hash_delta = 0;
5384+ }
5385+ hwrm_req_drop(bp, req);
5386+}
5387+
53605388 static int bnxt_hwrm_vnic_set_hds(struct bnxt *bp, u16 vnic_id)
53615389 {
53625390 struct bnxt_vnic_info *vnic = &bp->vnic_info[vnic_id];
@@ -5614,6 +5642,8 @@ static int bnxt_hwrm_vnic_qcaps(struct bnxt *bp) · 251 unmodified lines
56145642 (BNXT_CHIP_P5_THOR(bp) &&
56155643 !(bp->fw_cap & BNXT_FW_CAP_EXT_HW_STATS_SUPPORTED)))
56165644 bp->fw_cap |= BNXT_FW_CAP_VLAN_RX_STRIP;
5645+ if (flags & VNIC_QCAPS_RESP_FLAGS_RSS_HASH_TYPE_DELTA_CAP)
5646+ bp->fw_cap |= BNXT_FW_CAP_RSS_HASH_TYPE_DELTA;
56175647 bp->max_tpa_v2 = le16_to_cpu(resp->max_aggs_supported);
56185648 if (bp->max_tpa_v2) {
56195649 if (BNXT_CHIP_P5_THOR(bp))
@@ -6958,8 +6988,11 @@ static int bnxt_hwrm_func_qcfg(struct bnxt *bp) · 1338 unmodified lines
69586988 if (flags & FUNC_QCFG_RESP_FLAGS_FW_DCBX_AGENT_ENABLED)
69596989 bp->fw_cap |= BNXT_FW_CAP_DCBX_AGENT;
69606990 }
6961− if (BNXT_PF(bp) && (flags & FUNC_QCFG_RESP_FLAGS_MULTI_HOST))
6991+ if (BNXT_PF(bp) && (flags & FUNC_QCFG_RESP_FLAGS_MULTI_HOST)) {
69626992 bp->flags |= BNXT_FLAG_MULTI_HOST;
6993+ if (bp->fw_cap & BNXT_FW_CAP_PTP_RTC)
6994+ bp->fw_cap &= ~BNXT_FW_CAP_PTP_RTC;
6995+ }
69636996 if (flags & FUNC_QCFG_RESP_FLAGS_RING_MONITOR_ENABLED)
69646997 bp->fw_cap |= BNXT_FW_CAP_RING_MONITOR;
69656998
@@ -8808,6 +8841,8 @@ static int bnxt_init_chip(struct bnxt *bp, bool irq_re_init) · 1842 unmodified lines
88088841 rc = bnxt_setup_vnic(bp, 0);
88098842 if (rc)
88108843 goto err_out;
8844+ if (bp->fw_cap & BNXT_FW_CAP_RSS_HASH_TYPE_DELTA)
8845+ bnxt_hwrm_update_rss_hash_cfg(bp);
88118846
88128847 if (bp->flags & BNXT_FLAG_RFS) {
88138848 rc = bnxt_alloc_rfs_vnics(bp);
@@ -11283,6 +11318,7 @@ static bool bnxt_exthdr_check(struct bnxt *bp, struct sk_buff *skb, int nw_off, · 2469 unmodified lines
1128311318 u8 **nextp)
1128411319 {
1128511320 struct ipv6hdr *ip6h = (struct ipv6hdr *)(skb->data + nw_off);
11321+ struct hop_jumbo_hdr *jhdr;
1128611322 int hdr_count = 0;
1128711323 u8 *nexthdr;
1128811324 int start;
@@ -11310,9 +11346,27 @@ static bool bnxt_exthdr_check(struct bnxt *bp, struct sk_buff *skb, int nw_off, · 21 unmodified lines
1131011346
1131111347 if (hdrlen > 64)
1131211348 return false;
11349+
11350+ /* The ext header may be a hop-by-hop header inserted for
11351+ * big TCP purposes. This will be removed before sending
11352+ * from NIC, so do not count it.
11353+ */
11354+ if (*nexthdr == NEXTHDR_HOP) {
11355+ if (likely(skb->len <= GRO_LEGACY_MAX_SIZE))
11356+ goto increment_hdr;
11357+
11358+ jhdr = (struct hop_jumbo_hdr *)hp;
11359+ if (jhdr->tlv_type != IPV6_TLV_JUMBO || jhdr->hdrlen != 0 ||
11360+ jhdr->nexthdr != IPPROTO_TCP)
11361+ goto increment_hdr;
11362+
11363+ goto next_hdr;
11364+ }
11365+increment_hdr:
11366+ hdr_count++;
11367+next_hdr:
1131311368 nexthdr = &hp->nexthdr;
1131411369 start += hdrlen;
11315− hdr_count++;
1131611370 }
1131711371 if (nextp) {
1131811372 /* Caller will check inner protocol */
@@ -12252,6 +12306,8 @@ static void bnxt_set_dflt_rss_hash_type(struct bnxt *bp) · 933 unmodified lines
1225212306 VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV4 |
1225312307 VNIC_RSS_CFG_REQ_HASH_TYPE_IPV6 |
1225412308 VNIC_RSS_CFG_REQ_HASH_TYPE_TCP_IPV6;
12309+ if (bp->fw_cap & BNXT_FW_CAP_RSS_HASH_TYPE_DELTA)
12310+ bp->rss_hash_delta = bp->rss_hash_cfg;
1225512311 if (BNXT_CHIP_P4_PLUS(bp) && bp->hwrm_spec_code >= 0x10501) {
1225612312 bp->flags |= BNXT_FLAG_UDP_RSS_CAP;
1225712313 bp->rss_hash_cfg |= VNIC_RSS_CFG_REQ_HASH_TYPE_UDP_IPV4 |
@@ -13082,13 +13138,6 @@ int bnxt_get_port_parent_id(struct net_device *dev, · 824 unmodified lines
1308213138 return 0;
1308313139 }
1308413140
13085−static struct devlink_port *bnxt_get_devlink_port(struct net_device *dev)
13086−{
13087− struct bnxt *bp = netdev_priv(dev);
13088−
13089− return &bp->dl_port;
13090−}
13091−
1309213141 static const struct net_device_ops bnxt_netdev_ops = {
1309313142 .ndo_open = bnxt_open,
1309413143 .ndo_start_xmit = bnxt_start_xmit,
@@ -13120,7 +13169,6 @@ static const struct net_device_ops bnxt_netdev_ops = { · 25 unmodified lines
1312013169 .ndo_xdp_xmit = bnxt_xdp_xmit,
1312113170 .ndo_bridge_getlink = bnxt_bridge_getlink,
1312213171 .ndo_bridge_setlink = bnxt_bridge_setlink,
13123− .ndo_get_devlink_port = bnxt_get_devlink_port,
1312413172 };
1312513173
1312613174 static void bnxt_remove_one(struct pci_dev *pdev)
@@ -13131,9 +13179,6 @@ static void bnxt_remove_one(struct pci_dev *pdev) · 4 unmodified lines
1313113179 if (BNXT_PF(bp))
1313213180 bnxt_sriov_disable(bp);
1313313181
13134− if (BNXT_PF(bp))
13135− devlink_port_type_clear(&bp->dl_port);
13136−
1313713182 bnxt_ptp_clear(bp);
1313813183 pci_disable_pcie_error_reporting(pdev);
1313913184 unregister_netdev(dev);
@@ -13546,6 +13591,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 406 unmodified lines
1354613591 return -ENOMEM;
1354713592
1354813593 bp = netdev_priv(dev);
13594+ SET_NETDEV_DEVLINK_PORT(dev, &bp->dl_port);
1354913595 bp->board_idx = ent->driver_data;
1355013596 bp->msg_enable = BNXT_DEF_MSG_ENABLE;
1355113597 bnxt_set_max_func_irqs(bp, max_irqs);
@@ -13633,6 +13679,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 81 unmodified lines
1363313679 dev->features &= ~NETIF_F_LRO;
1363413680 dev->priv_flags |= IFF_UNICAST_FLT;
1363513681
13682+ netif_set_tso_max_size(dev, GSO_MAX_SIZE);
13683+
1363613684 #ifdef CONFIG_BNXT_SRIOV
1363713685 init_waitqueue_head(&bp->sriov_cfg_wait);
1363813686 #endif
@@ -13721,8 +13769,6 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 82 unmodified lines
1372113769 if (rc)
1372213770 goto init_err_cleanup;
1372313771
13724− if (BNXT_PF(bp))
13725− devlink_port_type_eth_set(&bp->dl_port, bp->dev);
1372613772 bnxt_dl_fw_reporters_create(bp);
1372713773
1372813774 bnxt_print_device_info(bp);
drivers/net/ethernet/broadcom/bnxt/bnxt.h+3−0
@@ -1901,6 +1901,7 @@ struct bnxt { · 1900 unmodified lines
19011901 u16 *rss_indir_tbl;
19021902 u16 rss_indir_tbl_entries;
19031903 u32 rss_hash_cfg;
1904+ u32 rss_hash_delta;
19041905
19051906 u16 max_mtu;
19061907 u8 max_tc;
@@ -1966,6 +1967,7 @@ struct bnxt { · 59 unmodified lines
19661967 #define BNXT_FW_CAP_CFA_RFS_RING_TBL_IDX_V2 0x00010000
19671968 #define BNXT_FW_CAP_PCIE_STATS_SUPPORTED 0x00020000
19681969 #define BNXT_FW_CAP_EXT_STATS_SUPPORTED 0x00040000
1970+ #define BNXT_FW_CAP_RSS_HASH_TYPE_DELTA 0x00080000
19691971 #define BNXT_FW_CAP_ERR_RECOVER_RELOAD 0x00100000
19701972 #define BNXT_FW_CAP_HOT_RESET 0x00200000
19711973 #define BNXT_FW_CAP_PTP_RTC 0x00400000
@@ -2117,6 +2119,7 @@ struct bnxt { · 145 unmodified lines
21172119 #define BNXT_PHY_FL_NO_FCS PORT_PHY_QCAPS_RESP_FLAGS_NO_FCS
21182120 #define BNXT_PHY_FL_NO_PAUSE (PORT_PHY_QCAPS_RESP_FLAGS2_PAUSE_UNSUPPORTED << 8)
21192121 #define BNXT_PHY_FL_NO_PFC (PORT_PHY_QCAPS_RESP_FLAGS2_PFC_UNSUPPORTED << 8)
2122+#define BNXT_PHY_FL_BANK_SEL (PORT_PHY_QCAPS_RESP_FLAGS2_BANK_ADDR_SUPPORTED << 8)
21202123
21212124 u8 num_tests;
21222125 struct bnxt_test_info *test_info;
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c+0−4
@@ -892,10 +892,6 @@ static int bnxt_dl_info_get(struct devlink *dl, struct devlink_info_req *req, · 891 unmodified lines
892892 u32 ver = 0;
893893 int rc;
894894
895− rc = devlink_info_driver_name_put(req, DRV_MODULE_NAME);
896− if (rc)
897− return rc;
898−
899895 if (BNXT_PF(bp) && (bp->flags & BNXT_FLAG_DSN_VALID)) {
900896 sprintf(buf, "%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X",
901897 bp->dsn[7], bp->dsn[6], bp->dsn[5], bp->dsn[4],
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c+127−7
@@ -1234,6 +1234,8 @@ static int bnxt_srxfh(struct bnxt *bp, struct ethtool_rxnfc *cmd) · 1233 unmodified lines
12341234 if (bp->rss_hash_cfg == rss_hash_cfg)
12351235 return 0;
12361236
1237+ if (bp->fw_cap & BNXT_FW_CAP_RSS_HASH_TYPE_DELTA)
1238+ bp->rss_hash_delta = bp->rss_hash_cfg ^ rss_hash_cfg;
12371239 bp->rss_hash_cfg = rss_hash_cfg;
12381240 if (netif_running(bp->dev)) {
12391241 bnxt_close_nic(bp, false, false);
@@ -2005,6 +2007,14 @@ static void bnxt_get_fec_stats(struct net_device *dev, · 765 unmodified lines
20052007 rx = bp->rx_port_stats_ext.sw_stats;
20062008 fec_stats->corrected_bits.total =
20072009 *(rx + BNXT_RX_STATS_EXT_OFFSET(rx_corrected_bits));
2010+
2011+ if (bp->fw_rx_stats_ext_size <= BNXT_RX_STATS_EXT_NUM_LEGACY)
2012+ return;
2013+
2014+ fec_stats->corrected_blocks.total =
2015+ *(rx + BNXT_RX_STATS_EXT_OFFSET(rx_fec_corrected_blocks));
2016+ fec_stats->uncorrectable_blocks.total =
2017+ *(rx + BNXT_RX_STATS_EXT_OFFSET(rx_fec_uncorrectable_blocks));
20082018 }
20092019
20102020 static u32 bnxt_ethtool_forced_fec_to_fw(struct bnxt_link_info *link_info,
@@ -2514,6 +2524,7 @@ static int bnxt_flash_firmware_from_file(struct net_device *dev, · 503 unmodified lines
25142524 #define MSG_INTERNAL_ERR "PKG install error : Internal error"
25152525 #define MSG_NO_PKG_UPDATE_AREA_ERR "PKG update area not created in nvram"
25162526 #define MSG_NO_SPACE_ERR "PKG insufficient update area in nvram"
2527+#define MSG_RESIZE_UPDATE_ERR "Resize UPDATE entry error"
25172528 #define MSG_ANTI_ROLLBACK_ERR "HWRM_NVM_INSTALL_UPDATE failure due to Anti-rollback detected"
25182529 #define MSG_GENERIC_FAILURE_ERR "HWRM_NVM_INSTALL_UPDATE failure"
25192530
@@ -2564,6 +2575,32 @@ static int nvm_update_err_to_stderr(struct net_device *dev, u8 result, · 44 unmodified lines
25642575 #define BNXT_NVM_MORE_FLAG (cpu_to_le16(NVM_MODIFY_REQ_FLAGS_BATCH_MODE))
25652576 #define BNXT_NVM_LAST_FLAG (cpu_to_le16(NVM_MODIFY_REQ_FLAGS_BATCH_LAST))
25662577
2578+static int bnxt_resize_update_entry(struct net_device *dev, size_t fw_size,
2579+ struct netlink_ext_ack *extack)
2580+{
2581+ u32 item_len;
2582+ int rc;
2583+
2584+ rc = bnxt_find_nvram_item(dev, BNX_DIR_TYPE_UPDATE,
2585+ BNX_DIR_ORDINAL_FIRST, BNX_DIR_EXT_NONE, NULL,
2586+ &item_len, NULL);
2587+ if (rc) {
2588+ BNXT_NVM_ERR_MSG(dev, extack, MSG_NO_PKG_UPDATE_AREA_ERR);
2589+ return rc;
2590+ }
2591+
2592+ if (fw_size > item_len) {
2593+ rc = bnxt_flash_nvram(dev, BNX_DIR_TYPE_UPDATE,
2594+ BNX_DIR_ORDINAL_FIRST, 0, 1,
2595+ round_up(fw_size, 4096), NULL, 0);
2596+ if (rc) {
2597+ BNXT_NVM_ERR_MSG(dev, extack, MSG_RESIZE_UPDATE_ERR);
2598+ return rc;
2599+ }
2600+ }
2601+ return 0;
2602+}
2603+
25672604 int bnxt_flash_package_from_fw_obj(struct net_device *dev, const struct firmware *fw,
25682605 u32 install_type, struct netlink_ext_ack *extack)
25692606 {
@@ -2580,6 +2617,11 @@ int bnxt_flash_package_from_fw_obj(struct net_device *dev, const struct firmware · 10 unmodified lines
25802617 u16 index;
25812618 int rc;
25822619
2620+ /* resize before flashing larger image than available space */
2621+ rc = bnxt_resize_update_entry(dev, fw->size, extack);
2622+ if (rc)
2623+ return rc;
2624+
25832625 bnxt_hwrm_fw_set_time(bp);
25842626
25852627 rc = hwrm_req_init(bp, modify, HWRM_NVM_MODIFY);
@@ -3146,8 +3188,9 @@ static int bnxt_get_eee(struct net_device *dev, struct ethtool_eee *edata) · 560 unmodified lines
31463188 }
31473189
31483190 static int bnxt_read_sfp_module_eeprom_info(struct bnxt *bp, u16 i2c_addr,
3149− u16 page_number, u16 start_addr,
3150− u16 data_length, u8 *buf)
3191+ u16 page_number, u8 bank,
3192+ u16 start_addr, u16 data_length,
3193+ u8 *buf)
31513194 {
31523195 struct hwrm_port_phy_i2c_read_output *output;
31533196 struct hwrm_port_phy_i2c_read_input *req;
@@ -3168,8 +3211,13 @@ static int bnxt_read_sfp_module_eeprom_info(struct bnxt *bp, u16 i2c_addr, · 14 unmodified lines
31683211 data_length -= xfer_size;
31693212 req->page_offset = cpu_to_le16(start_addr + byte_offset);
31703213 req->data_length = xfer_size;
3171− req->enables = cpu_to_le32(start_addr + byte_offset ?
3172− PORT_PHY_I2C_READ_REQ_ENABLES_PAGE_OFFSET : 0);
3214+ req->enables =
3215+ cpu_to_le32((start_addr + byte_offset ?
3216+ PORT_PHY_I2C_READ_REQ_ENABLES_PAGE_OFFSET :
3217+ 0) |
3218+ (bank ?
3219+ PORT_PHY_I2C_READ_REQ_ENABLES_BANK_NUMBER :
3220+ 0));
31733221 rc = hwrm_req_send(bp, req);
31743222 if (!rc)
31753223 memcpy(buf + byte_offset, output->data, xfer_size);
@@ -3199,7 +3247,7 @@ static int bnxt_get_module_info(struct net_device *dev, · 23 unmodified lines
31993247 if (bp->hwrm_spec_code < 0x10202)
32003248 return -EOPNOTSUPP;
32013249
3202− rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A0, 0, 0,
3250+ rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A0, 0, 0, 0,
32033251 SFF_DIAG_SUPPORT_OFFSET + 1,
32043252 data);
32053253 if (!rc) {
@@ -3244,7 +3292,7 @@ static int bnxt_get_module_eeprom(struct net_device *dev, · 38 unmodified lines
32443292 if (start < ETH_MODULE_SFF_8436_LEN) {
32453293 if (start + eeprom->len > ETH_MODULE_SFF_8436_LEN)
32463294 length = ETH_MODULE_SFF_8436_LEN - start;
3247− rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A0, 0,
3295+ rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A0, 0, 0,
32483296 start, length, data);
32493297 if (rc)
32503298 return rc;
@@ -3256,12 +3304,68 @@ static int bnxt_get_module_eeprom(struct net_device *dev, · 5 unmodified lines
32563304 /* Read A2 portion of the EEPROM */
32573305 if (length) {
32583306 start -= ETH_MODULE_SFF_8436_LEN;
3259− rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 0,
3307+ rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A2, 0, 0,
32603308 start, length, data);
32613309 }
32623310 return rc;
32633311 }
32643312
3313+static int bnxt_get_module_status(struct bnxt *bp, struct netlink_ext_ack *extack)
3314+{
3315+ if (bp->link_info.module_status <=
3316+ PORT_PHY_QCFG_RESP_MODULE_STATUS_WARNINGMSG)
3317+ return 0;
3318+
3319+ switch (bp->link_info.module_status) {
3320+ case PORT_PHY_QCFG_RESP_MODULE_STATUS_PWRDOWN:
3321+ NL_SET_ERR_MSG_MOD(extack, "Transceiver module is powering down");
3322+ break;
3323+ case PORT_PHY_QCFG_RESP_MODULE_STATUS_NOTINSERTED:
3324+ NL_SET_ERR_MSG_MOD(extack, "Transceiver module not inserted");
3325+ break;
3326+ case PORT_PHY_QCFG_RESP_MODULE_STATUS_CURRENTFAULT:
3327+ NL_SET_ERR_MSG_MOD(extack, "Transceiver module disabled due to current fault");
3328+ break;
3329+ default:
3330+ NL_SET_ERR_MSG_MOD(extack, "Unknown error");
3331+ break;
3332+ }
3333+ return -EINVAL;
3334+}
3335+
3336+static int bnxt_get_module_eeprom_by_page(struct net_device *dev,
3337+ const struct ethtool_module_eeprom *page_data,
3338+ struct netlink_ext_ack *extack)
3339+{
3340+ struct bnxt *bp = netdev_priv(dev);
3341+ int rc;
3342+
3343+ rc = bnxt_get_module_status(bp, extack);
3344+ if (rc)
3345+ return rc;
3346+
3347+ if (bp->hwrm_spec_code < 0x10202) {
3348+ NL_SET_ERR_MSG_MOD(extack, "Firmware version too old");
3349+ return -EINVAL;
3350+ }
3351+
3352+ if (page_data->bank && !(bp->phy_flags & BNXT_PHY_FL_BANK_SEL)) {
3353+ NL_SET_ERR_MSG_MOD(extack, "Firmware not capable for bank selection");
3354+ return -EINVAL;
3355+ }
3356+
3357+ rc = bnxt_read_sfp_module_eeprom_info(bp, page_data->i2c_address << 1,
3358+ page_data->page, page_data->bank,
3359+ page_data->offset,
3360+ page_data->length,
3361+ page_data->data);
3362+ if (rc) {
3363+ NL_SET_ERR_MSG_MOD(extack, "Module`s eeprom read failed");
3364+ return rc;
3365+ }
3366+ return page_data->length;
3367+}
3368+
32653369 static int bnxt_nway_reset(struct net_device *dev)
32663370 {
32673371 int rc = 0;
@@ -4018,6 +4122,20 @@ static void bnxt_get_rmon_stats(struct net_device *dev, · 750 unmodified lines
40184122 *ranges = bnxt_rmon_ranges;
40194123 }
40204124
4125+static void bnxt_get_link_ext_stats(struct net_device *dev,
4126+ struct ethtool_link_ext_stats *stats)
4127+{
4128+ struct bnxt *bp = netdev_priv(dev);
4129+ u64 *rx;
4130+
4131+ if (BNXT_VF(bp) || !(bp->flags & BNXT_FLAG_PORT_STATS_EXT))
4132+ return;
4133+
4134+ rx = bp->rx_port_stats_ext.sw_stats;
4135+ stats->link_down_events =
4136+ *(rx + BNXT_RX_STATS_EXT_OFFSET(link_down_events));
4137+}
4138+
40214139 void bnxt_ethtool_free(struct bnxt *bp)
40224140 {
40234141 kfree(bp->test_info);
@@ -4067,10 +4185,12 @@ const struct ethtool_ops bnxt_ethtool_ops = { · 43 unmodified lines
40674185 .get_eeprom = bnxt_get_eeprom,
40684186 .set_eeprom = bnxt_set_eeprom,
40694187 .get_link = bnxt_get_link,
4188+ .get_link_ext_stats = bnxt_get_link_ext_stats,
40704189 .get_eee = bnxt_get_eee,
40714190 .set_eee = bnxt_set_eee,
40724191 .get_module_info = bnxt_get_module_info,
40734192 .get_module_eeprom = bnxt_get_module_eeprom,
4193+ .get_module_eeprom_by_page = bnxt_get_module_eeprom_by_page,
40744194 .nway_reset = bnxt_nway_reset,
40754195 .set_phys_id = bnxt_set_phys_id,
40764196 .self_test = bnxt_self_test,
drivers/net/ethernet/broadcom/bnxt/bnxt_hsi.h+216−65
@@ -254,6 +254,8 @@ struct cmd_nums { · 253 unmodified lines
254254 #define HWRM_PORT_DSC_DUMP 0xd9UL
255255 #define HWRM_PORT_EP_TX_QCFG 0xdaUL
256256 #define HWRM_PORT_EP_TX_CFG 0xdbUL
257+ #define HWRM_PORT_CFG 0xdcUL
258+ #define HWRM_PORT_QCFG 0xddUL
257259 #define HWRM_TEMP_MONITOR_QUERY 0xe0UL
258260 #define HWRM_REG_POWER_QUERY 0xe1UL
259261 #define HWRM_CORE_FREQUENCY_QUERY 0xe2UL
@@ -379,6 +381,8 @@ struct cmd_nums { · 119 unmodified lines
379381 #define HWRM_FUNC_BACKING_STORE_QCAPS_V2 0x1a8UL
380382 #define HWRM_FUNC_DBR_PACING_NQLIST_QUERY 0x1a9UL
381383 #define HWRM_FUNC_DBR_RECOVERY_COMPLETED 0x1aaUL
384+ #define HWRM_FUNC_SYNCE_CFG 0x1abUL
385+ #define HWRM_FUNC_SYNCE_QCFG 0x1acUL
382386 #define HWRM_SELFTEST_QLIST 0x200UL
383387 #define HWRM_SELFTEST_EXEC 0x201UL
384388 #define HWRM_SELFTEST_IRQ 0x202UL
@@ -417,6 +421,8 @@ struct cmd_nums { · 32 unmodified lines
417421 #define HWRM_TF_SESSION_RESC_FREE 0x2ceUL
418422 #define HWRM_TF_SESSION_RESC_FLUSH 0x2cfUL
419423 #define HWRM_TF_SESSION_RESC_INFO 0x2d0UL
424+ #define HWRM_TF_SESSION_HOTUP_STATE_SET 0x2d1UL
425+ #define HWRM_TF_SESSION_HOTUP_STATE_GET 0x2d2UL
420426 #define HWRM_TF_TBL_TYPE_GET 0x2daUL
421427 #define HWRM_TF_TBL_TYPE_SET 0x2dbUL
422428 #define HWRM_TF_TBL_TYPE_BULK_GET 0x2dcUL
@@ -440,6 +446,25 @@ struct cmd_nums { · 17 unmodified lines
440446 #define HWRM_TF_GLOBAL_CFG_GET 0x2fdUL
441447 #define HWRM_TF_IF_TBL_SET 0x2feUL
442448 #define HWRM_TF_IF_TBL_GET 0x2ffUL
449+ #define HWRM_TFC_TBL_SCOPE_QCAPS 0x380UL
450+ #define HWRM_TFC_TBL_SCOPE_ID_ALLOC 0x381UL
451+ #define HWRM_TFC_TBL_SCOPE_CONFIG 0x382UL
452+ #define HWRM_TFC_TBL_SCOPE_DECONFIG 0x383UL
453+ #define HWRM_TFC_TBL_SCOPE_FID_ADD 0x384UL
454+ #define HWRM_TFC_TBL_SCOPE_FID_REM 0x385UL
455+ #define HWRM_TFC_TBL_SCOPE_POOL_ALLOC 0x386UL
456+ #define HWRM_TFC_TBL_SCOPE_POOL_FREE 0x387UL
457+ #define HWRM_TFC_SESSION_ID_ALLOC 0x388UL
458+ #define HWRM_TFC_SESSION_FID_ADD 0x389UL
459+ #define HWRM_TFC_SESSION_FID_REM 0x38aUL
460+ #define HWRM_TFC_IDENT_ALLOC 0x38bUL
461+ #define HWRM_TFC_IDENT_FREE 0x38cUL
462+ #define HWRM_TFC_IDX_TBL_ALLOC 0x38dUL
463+ #define HWRM_TFC_IDX_TBL_ALLOC_SET 0x38eUL
464+ #define HWRM_TFC_IDX_TBL_SET 0x38fUL
465+ #define HWRM_TFC_IDX_TBL_GET 0x390UL
466+ #define HWRM_TFC_IDX_TBL_FREE 0x391UL
467+ #define HWRM_TFC_GLOBAL_ID_ALLOC 0x392UL
443468 #define HWRM_SV 0x400UL
444469 #define HWRM_DBG_READ_DIRECT 0xff10UL
445470 #define HWRM_DBG_READ_INDIRECT 0xff11UL
@@ -546,8 +571,8 @@ struct hwrm_err_output { · 100 unmodified lines
546571 #define HWRM_VERSION_MAJOR 1
547572 #define HWRM_VERSION_MINOR 10
548573 #define HWRM_VERSION_UPDATE 2
549−#define HWRM_VERSION_RSVD 95
550−#define HWRM_VERSION_STR "1.10.2.95"
574+#define HWRM_VERSION_RSVD 118
575+#define HWRM_VERSION_STR "1.10.2.118"
551576
552577 /* hwrm_ver_get_input (size:192b/24B) */
553578 struct hwrm_ver_get_input {
@@ -1657,6 +1682,10 @@ struct hwrm_func_qcaps_output { · 1103 unmodified lines
16571682 #define FUNC_QCAPS_RESP_FLAGS_EXT2_DBR_PACING_EXT_SUPPORTED 0x8UL
16581683 #define FUNC_QCAPS_RESP_FLAGS_EXT2_SW_DBR_DROP_RECOVERY_SUPPORTED 0x10UL
16591684 #define FUNC_QCAPS_RESP_FLAGS_EXT2_GENERIC_STATS_SUPPORTED 0x20UL
1685+ #define FUNC_QCAPS_RESP_FLAGS_EXT2_UDP_GSO_SUPPORTED 0x40UL
1686+ #define FUNC_QCAPS_RESP_FLAGS_EXT2_SYNCE_SUPPORTED 0x80UL
1687+ #define FUNC_QCAPS_RESP_FLAGS_EXT2_DBR_PACING_V0_SUPPORTED 0x100UL
1688+ #define FUNC_QCAPS_RESP_FLAGS_EXT2_TX_PKT_TS_CMPL_SUPPORTED 0x200UL
16601689 __le16 tunnel_disable_flag;
16611690 #define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_VXLAN 0x1UL
16621691 #define FUNC_QCAPS_RESP_TUNNEL_DISABLE_FLAG_DISABLE_NGE 0x2UL
@@ -1804,7 +1833,20 @@ struct hwrm_func_qcfg_output { · 141 unmodified lines
18041833 #define FUNC_QCFG_RESP_MPC_CHNLS_TE_CFA_ENABLED 0x4UL
18051834 #define FUNC_QCFG_RESP_MPC_CHNLS_RE_CFA_ENABLED 0x8UL
18061835 #define FUNC_QCFG_RESP_MPC_CHNLS_PRIMATE_ENABLED 0x10UL
1807− u8 unused_2[3];
1836+ u8 db_page_size;
1837+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_4KB 0x0UL
1838+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_8KB 0x1UL
1839+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_16KB 0x2UL
1840+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_32KB 0x3UL
1841+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_64KB 0x4UL
1842+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_128KB 0x5UL
1843+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_256KB 0x6UL
1844+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_512KB 0x7UL
1845+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_1MB 0x8UL
1846+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_2MB 0x9UL
1847+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_4MB 0xaUL
1848+ #define FUNC_QCFG_RESP_DB_PAGE_SIZE_LAST FUNC_QCFG_RESP_DB_PAGE_SIZE_4MB
1849+ u8 unused_2[2];
18081850 __le32 partition_min_bw;
18091851 #define FUNC_QCFG_RESP_PARTITION_MIN_BW_BW_VALUE_MASK 0xfffffffUL
18101852 #define FUNC_QCFG_RESP_PARTITION_MIN_BW_BW_VALUE_SFT 0
@@ -1876,6 +1918,7 @@ struct hwrm_func_cfg_input { · 65 unmodified lines
18761918 #define FUNC_CFG_REQ_FLAGS_PPP_PUSH_MODE_DISABLE 0x10000000UL
18771919 #define FUNC_CFG_REQ_FLAGS_BD_METADATA_ENABLE 0x20000000UL
18781920 #define FUNC_CFG_REQ_FLAGS_BD_METADATA_DISABLE 0x40000000UL
1921+ #define FUNC_CFG_REQ_FLAGS_KEY_CTX_ASSETS_TEST 0x80000000UL
18791922 __le32 enables;
18801923 #define FUNC_CFG_REQ_ENABLES_ADMIN_MTU 0x1UL
18811924 #define FUNC_CFG_REQ_ENABLES_MRU 0x2UL
@@ -2021,12 +2064,26 @@ struct hwrm_func_cfg_input { · 139 unmodified lines
20212064 __le16 num_tx_key_ctxs;
20222065 __le16 num_rx_key_ctxs;
20232066 __le32 enables2;
2024− #define FUNC_CFG_REQ_ENABLES2_KDNET 0x1UL
2067+ #define FUNC_CFG_REQ_ENABLES2_KDNET 0x1UL
2068+ #define FUNC_CFG_REQ_ENABLES2_DB_PAGE_SIZE 0x2UL
20252069 u8 port_kdnet_mode;
20262070 #define FUNC_CFG_REQ_PORT_KDNET_MODE_DISABLED 0x0UL
20272071 #define FUNC_CFG_REQ_PORT_KDNET_MODE_ENABLED 0x1UL
20282072 #define FUNC_CFG_REQ_PORT_KDNET_MODE_LAST FUNC_CFG_REQ_PORT_KDNET_MODE_ENABLED
2029− u8 unused_0[7];
2073+ u8 db_page_size;
2074+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_4KB 0x0UL
2075+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_8KB 0x1UL
2076+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_16KB 0x2UL
2077+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_32KB 0x3UL
2078+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_64KB 0x4UL
2079+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_128KB 0x5UL
2080+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_256KB 0x6UL
2081+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_512KB 0x7UL
2082+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_1MB 0x8UL
2083+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_2MB 0x9UL
2084+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_4MB 0xaUL
2085+ #define FUNC_CFG_REQ_DB_PAGE_SIZE_LAST FUNC_CFG_REQ_DB_PAGE_SIZE_4MB
2086+ u8 unused_0[6];
20302087 };
20312088
20322089 /* hwrm_func_cfg_output (size:128b/16B) */
@@ -2060,10 +2117,9 @@ struct hwrm_func_qstats_input { · 27 unmodified lines
20602117 __le64 resp_addr;
20612118 __le16 fid;
20622119 u8 flags;
2063− #define FUNC_QSTATS_REQ_FLAGS_UNUSED 0x0UL
2064− #define FUNC_QSTATS_REQ_FLAGS_ROCE_ONLY 0x1UL
2065− #define FUNC_QSTATS_REQ_FLAGS_COUNTER_MASK 0x2UL
2066− #define FUNC_QSTATS_REQ_FLAGS_LAST FUNC_QSTATS_REQ_FLAGS_COUNTER_MASK
2120+ #define FUNC_QSTATS_REQ_FLAGS_ROCE_ONLY 0x1UL
2121+ #define FUNC_QSTATS_REQ_FLAGS_COUNTER_MASK 0x2UL
2122+ #define FUNC_QSTATS_REQ_FLAGS_L2_ONLY 0x4UL
20672123 u8 unused_0[5];
20682124 };
20692125
@@ -2093,7 +2149,8 @@ struct hwrm_func_qstats_output { · 23 unmodified lines
20932149 __le64 rx_agg_bytes;
20942150 __le64 rx_agg_events;
20952151 __le64 rx_agg_aborts;
2096− u8 unused_0[7];
2152+ u8 clear_seq;
2153+ u8 unused_0[6];
20972154 u8 valid;
20982155 };
20992156
@@ -2106,10 +2163,8 @@ struct hwrm_func_qstats_ext_input { · 6 unmodified lines
21062163 __le64 resp_addr;
21072164 __le16 fid;
21082165 u8 flags;
2109− #define FUNC_QSTATS_EXT_REQ_FLAGS_UNUSED 0x0UL
2110− #define FUNC_QSTATS_EXT_REQ_FLAGS_ROCE_ONLY 0x1UL
2111− #define FUNC_QSTATS_EXT_REQ_FLAGS_COUNTER_MASK 0x2UL
2112− #define FUNC_QSTATS_EXT_REQ_FLAGS_LAST FUNC_QSTATS_EXT_REQ_FLAGS_COUNTER_MASK
2166+ #define FUNC_QSTATS_EXT_REQ_FLAGS_ROCE_ONLY 0x1UL
2167+ #define FUNC_QSTATS_EXT_REQ_FLAGS_COUNTER_MASK 0x2UL
21132168 u8 unused_0[1];
21142169 __le32 enables;
21152170 #define FUNC_QSTATS_EXT_REQ_ENABLES_SCHQ_ID 0x1UL
@@ -2210,6 +2265,7 @@ struct hwrm_func_drv_rgtr_input { · 94 unmodified lines
22102265 #define FUNC_DRV_RGTR_REQ_FLAGS_FAST_RESET_SUPPORT 0x80UL
22112266 #define FUNC_DRV_RGTR_REQ_FLAGS_RSS_STRICT_HASH_TYPE_SUPPORT 0x100UL
22122267 #define FUNC_DRV_RGTR_REQ_FLAGS_NPAR_1_2_SUPPORT 0x200UL
2268+ #define FUNC_DRV_RGTR_REQ_FLAGS_ASYM_QUEUE_CFG_SUPPORT 0x400UL
22132269 __le32 enables;
22142270 #define FUNC_DRV_RGTR_REQ_ENABLES_OS_TYPE 0x1UL
22152271 #define FUNC_DRV_RGTR_REQ_ENABLES_VER 0x2UL
@@ -3155,19 +3211,23 @@ struct hwrm_func_ptp_pin_qcfg_output { · 939 unmodified lines
31553211 #define FUNC_PTP_PIN_QCFG_RESP_PIN1_USAGE_SYNC_OUT 0x4UL
31563212 #define FUNC_PTP_PIN_QCFG_RESP_PIN1_USAGE_LAST FUNC_PTP_PIN_QCFG_RESP_PIN1_USAGE_SYNC_OUT
31573213 u8 pin2_usage;
3158− #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_NONE 0x0UL
3159− #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_PPS_IN 0x1UL
3160− #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_PPS_OUT 0x2UL
3161− #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_SYNC_IN 0x3UL
3162− #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_SYNC_OUT 0x4UL
3163− #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_LAST FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_SYNC_OUT
3214+ #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_NONE 0x0UL
3215+ #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_PPS_IN 0x1UL
3216+ #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_PPS_OUT 0x2UL
3217+ #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_SYNC_IN 0x3UL
3218+ #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_SYNC_OUT 0x4UL
3219+ #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_SYNCE_PRIMARY_CLOCK_OUT 0x5UL
3220+ #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT 0x6UL
3221+ #define FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_LAST FUNC_PTP_PIN_QCFG_RESP_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT
31643222 u8 pin3_usage;
3165− #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_NONE 0x0UL
3166− #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_PPS_IN 0x1UL
3167− #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_PPS_OUT 0x2UL
3168− #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_SYNC_IN 0x3UL
3169− #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_SYNC_OUT 0x4UL
3170− #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_LAST FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_SYNC_OUT
3223+ #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_NONE 0x0UL
3224+ #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_PPS_IN 0x1UL
3225+ #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_PPS_OUT 0x2UL
3226+ #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_SYNC_IN 0x3UL
3227+ #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_SYNC_OUT 0x4UL
3228+ #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_SYNCE_PRIMARY_CLOCK_OUT 0x5UL
3229+ #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT 0x6UL
3230+ #define FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_LAST FUNC_PTP_PIN_QCFG_RESP_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT
31713231 u8 unused_0;
31723232 u8 valid;
31733233 };
@@ -3215,23 +3275,27 @@ struct hwrm_func_ptp_pin_cfg_input { · 41 unmodified lines
32153275 #define FUNC_PTP_PIN_CFG_REQ_PIN2_STATE_ENABLED 0x1UL
32163276 #define FUNC_PTP_PIN_CFG_REQ_PIN2_STATE_LAST FUNC_PTP_PIN_CFG_REQ_PIN2_STATE_ENABLED
32173277 u8 pin2_usage;
3218− #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_NONE 0x0UL
3219− #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_PPS_IN 0x1UL
3220− #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_PPS_OUT 0x2UL
3221− #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_SYNC_IN 0x3UL
3222− #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_SYNC_OUT 0x4UL
3223− #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_LAST FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_SYNC_OUT
3278+ #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_NONE 0x0UL
3279+ #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_PPS_IN 0x1UL
3280+ #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_PPS_OUT 0x2UL
3281+ #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_SYNC_IN 0x3UL
3282+ #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_SYNC_OUT 0x4UL
3283+ #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_SYNCE_PRIMARY_CLOCK_OUT 0x5UL
3284+ #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT 0x6UL
3285+ #define FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_LAST FUNC_PTP_PIN_CFG_REQ_PIN2_USAGE_SYNCE_SECONDARY_CLOCK_OUT
32243286 u8 pin3_state;
32253287 #define FUNC_PTP_PIN_CFG_REQ_PIN3_STATE_DISABLED 0x0UL
32263288 #define FUNC_PTP_PIN_CFG_REQ_PIN3_STATE_ENABLED 0x1UL
32273289 #define FUNC_PTP_PIN_CFG_REQ_PIN3_STATE_LAST FUNC_PTP_PIN_CFG_REQ_PIN3_STATE_ENABLED
32283290 u8 pin3_usage;
3229− #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_NONE 0x0UL
3230− #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_PPS_IN 0x1UL
3231− #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_PPS_OUT 0x2UL
3232− #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_SYNC_IN 0x3UL
3233− #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_SYNC_OUT 0x4UL
3234− #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_LAST FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_SYNC_OUT
3291+ #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_NONE 0x0UL
3292+ #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_PPS_IN 0x1UL
3293+ #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_PPS_OUT 0x2UL
3294+ #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_SYNC_IN 0x3UL
3295+ #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_SYNC_OUT 0x4UL
3296+ #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_SYNCE_PRIMARY_CLOCK_OUT 0x5UL
3297+ #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT 0x6UL
3298+ #define FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_LAST FUNC_PTP_PIN_CFG_REQ_PIN3_USAGE_SYNCE_SECONDARY_CLOCK_OUT
32353299 u8 unused_0[4];
32363300 };
32373301
@@ -3319,9 +3383,9 @@ struct hwrm_func_ptp_ts_query_output { · 81 unmodified lines
33193383 __le16 seq_id;
33203384 __le16 resp_len;
33213385 __le64 pps_event_ts;
3322− __le64 ptm_res_local_ts;
3323− __le64 ptm_pmstr_ts;
3324− __le32 ptm_mstr_prop_dly;
3386+ __le64 ptm_local_ts;
3387+ __le64 ptm_system_ts;
3388+ __le32 ptm_link_delay;
33253389 u8 unused_0[3];
33263390 u8 valid;
33273391 };
@@ -3417,7 +3481,9 @@ struct hwrm_func_backing_store_cfg_v2_input { · 89 unmodified lines
34173481 #define FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_LAST FUNC_BACKING_STORE_CFG_V2_REQ_TYPE_INVALID
34183482 __le16 instance;
34193483 __le32 flags;
3420− #define FUNC_BACKING_STORE_CFG_V2_REQ_FLAGS_PREBOOT_MODE 0x1UL
3484+ #define FUNC_BACKING_STORE_CFG_V2_REQ_FLAGS_PREBOOT_MODE 0x1UL
3485+ #define FUNC_BACKING_STORE_CFG_V2_REQ_FLAGS_BS_CFG_ALL_DONE 0x2UL
3486+ #define FUNC_BACKING_STORE_CFG_V2_REQ_FLAGS_BS_EXTEND 0x4UL
34213487 __le64 page_dir;
34223488 __le32 num_entries;
34233489 __le16 entry_size;
@@ -3853,7 +3919,7 @@ struct hwrm_port_phy_qcfg_input { · 429 unmodified lines
38533919 u8 unused_0[6];
38543920 };
38553921
3856−/* hwrm_port_phy_qcfg_output (size:768b/96B) */
3922+/* hwrm_port_phy_qcfg_output (size:832b/104B) */
38573923 struct hwrm_port_phy_qcfg_output {
38583924 __le16 error_code;
38593925 __le16 req_type;
@@ -4150,6 +4216,9 @@ struct hwrm_port_phy_qcfg_output { · 290 unmodified lines
41504216 #define PORT_PHY_QCFG_RESP_LINK_PARTNER_PAM4_ADV_SPEEDS_50GB 0x1UL
41514217 #define PORT_PHY_QCFG_RESP_LINK_PARTNER_PAM4_ADV_SPEEDS_100GB 0x2UL
41524218 #define PORT_PHY_QCFG_RESP_LINK_PARTNER_PAM4_ADV_SPEEDS_200GB 0x4UL
4219+ u8 link_down_reason;
4220+ #define PORT_PHY_QCFG_RESP_LINK_DOWN_REASON_RF 0x1UL
4221+ u8 unused_0[7];
41534222 u8 valid;
41544223 };
41554224
@@ -4422,9 +4491,7 @@ struct hwrm_port_qstats_input { · 266 unmodified lines
44224491 __le64 resp_addr;
44234492 __le16 port_id;
44244493 u8 flags;
4425− #define PORT_QSTATS_REQ_FLAGS_UNUSED 0x0UL
4426− #define PORT_QSTATS_REQ_FLAGS_COUNTER_MASK 0x1UL
4427− #define PORT_QSTATS_REQ_FLAGS_LAST PORT_QSTATS_REQ_FLAGS_COUNTER_MASK
4494+ #define PORT_QSTATS_REQ_FLAGS_COUNTER_MASK 0x1UL
44284495 u8 unused_0[5];
44294496 __le64 tx_stat_host_addr;
44304497 __le64 rx_stat_host_addr;
@@ -4552,9 +4619,7 @@ struct hwrm_port_qstats_ext_input { · 121 unmodified lines
45524619 __le16 tx_stat_size;
45534620 __le16 rx_stat_size;
45544621 u8 flags;
4555− #define PORT_QSTATS_EXT_REQ_FLAGS_UNUSED 0x0UL
4556− #define PORT_QSTATS_EXT_REQ_FLAGS_COUNTER_MASK 0x1UL
4557− #define PORT_QSTATS_EXT_REQ_FLAGS_LAST PORT_QSTATS_EXT_REQ_FLAGS_COUNTER_MASK
4622+ #define PORT_QSTATS_EXT_REQ_FLAGS_COUNTER_MASK 0x1UL
45584623 u8 unused_0;
45594624 __le64 tx_stat_host_addr;
45604625 __le64 rx_stat_host_addr;
@@ -4613,9 +4678,7 @@ struct hwrm_port_ecn_qstats_input { · 52 unmodified lines
46134678 __le16 port_id;
46144679 __le16 ecn_stat_buf_size;
46154680 u8 flags;
4616− #define PORT_ECN_QSTATS_REQ_FLAGS_UNUSED 0x0UL
4617− #define PORT_ECN_QSTATS_REQ_FLAGS_COUNTER_MASK 0x1UL
4618− #define PORT_ECN_QSTATS_REQ_FLAGS_LAST PORT_ECN_QSTATS_REQ_FLAGS_COUNTER_MASK
4681+ #define PORT_ECN_QSTATS_REQ_FLAGS_COUNTER_MASK 0x1UL
46194682 u8 unused_0[3];
46204683 __le64 ecn_stat_host_addr;
46214684 };
@@ -4814,8 +4877,9 @@ struct hwrm_port_phy_qcaps_output { · 192 unmodified lines
48144877 #define PORT_PHY_QCAPS_RESP_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_100G 0x2UL
48154878 #define PORT_PHY_QCAPS_RESP_SUPPORTED_PAM4_SPEEDS_FORCE_MODE_200G 0x4UL
48164879 __le16 flags2;
4817− #define PORT_PHY_QCAPS_RESP_FLAGS2_PAUSE_UNSUPPORTED 0x1UL
4818− #define PORT_PHY_QCAPS_RESP_FLAGS2_PFC_UNSUPPORTED 0x2UL
4880+ #define PORT_PHY_QCAPS_RESP_FLAGS2_PAUSE_UNSUPPORTED 0x1UL
4881+ #define PORT_PHY_QCAPS_RESP_FLAGS2_PFC_UNSUPPORTED 0x2UL
4882+ #define PORT_PHY_QCAPS_RESP_FLAGS2_BANK_ADDR_SUPPORTED 0x4UL
48194883 u8 internal_port_cnt;
48204884 u8 valid;
48214885 };
@@ -4830,9 +4894,10 @@ struct hwrm_port_phy_i2c_read_input { · 8 unmodified lines
48304894 __le32 flags;
48314895 __le32 enables;
48324896 #define PORT_PHY_I2C_READ_REQ_ENABLES_PAGE_OFFSET 0x1UL
4897+ #define PORT_PHY_I2C_READ_REQ_ENABLES_BANK_NUMBER 0x2UL
48334898 __le16 port_id;
48344899 u8 i2c_slave_addr;
4835− u8 unused_0;
4900+ u8 bank_number;
48364901 __le16 page_number;
48374902 __le16 page_offset;
48384903 u8 data_length;
@@ -6537,6 +6602,7 @@ struct hwrm_vnic_qcaps_output { · 1698 unmodified lines
65376602 #define VNIC_QCAPS_RESP_FLAGS_RSS_IPSEC_ESP_SPI_IPV4_CAP 0x400000UL
65386603 #define VNIC_QCAPS_RESP_FLAGS_RSS_IPSEC_AH_SPI_IPV6_CAP 0x800000UL
65396604 #define VNIC_QCAPS_RESP_FLAGS_RSS_IPSEC_ESP_SPI_IPV6_CAP 0x1000000UL
6605+ #define VNIC_QCAPS_RESP_FLAGS_OUTERMOST_RSS_TRUSTED_VF_CAP 0x2000000UL
65406606 __le16 max_aggs_supported;
65416607 u8 unused_1[5];
65426608 u8 valid;
@@ -6702,6 +6768,53 @@ struct hwrm_vnic_rss_cfg_cmd_err { · 159 unmodified lines
67026768 u8 unused_0[7];
67036769 };
67046770
6771+/* hwrm_vnic_rss_qcfg_input (size:192b/24B) */
6772+struct hwrm_vnic_rss_qcfg_input {
6773+ __le16 req_type;
6774+ __le16 cmpl_ring;
6775+ __le16 seq_id;
6776+ __le16 target_id;
6777+ __le64 resp_addr;
6778+ __le16 rss_ctx_idx;
6779+ __le16 vnic_id;
6780+ u8 unused_0[4];
6781+};
6782+
6783+/* hwrm_vnic_rss_qcfg_output (size:512b/64B) */
6784+struct hwrm_vnic_rss_qcfg_output {
6785+ __le16 error_code;
6786+ __le16 req_type;
6787+ __le16 seq_id;
6788+ __le16 resp_len;
6789+ __le32 hash_type;
6790+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_IPV4 0x1UL
6791+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_TCP_IPV4 0x2UL
6792+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_UDP_IPV4 0x4UL
6793+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_IPV6 0x8UL
6794+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_TCP_IPV6 0x10UL
6795+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_UDP_IPV6 0x20UL
6796+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_IPV6_FLOW_LABEL 0x40UL
6797+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_AH_SPI_IPV4 0x80UL
6798+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_ESP_SPI_IPV4 0x100UL
6799+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_AH_SPI_IPV6 0x200UL
6800+ #define VNIC_RSS_QCFG_RESP_HASH_TYPE_ESP_SPI_IPV6 0x400UL
6801+ u8 unused_0[4];
6802+ __le32 hash_key[10];
6803+ u8 hash_mode_flags;
6804+ #define VNIC_RSS_QCFG_RESP_HASH_MODE_FLAGS_DEFAULT 0x1UL
6805+ #define VNIC_RSS_QCFG_RESP_HASH_MODE_FLAGS_INNERMOST_4 0x2UL
6806+ #define VNIC_RSS_QCFG_RESP_HASH_MODE_FLAGS_INNERMOST_2 0x4UL
6807+ #define VNIC_RSS_QCFG_RESP_HASH_MODE_FLAGS_OUTERMOST_4 0x8UL
6808+ #define VNIC_RSS_QCFG_RESP_HASH_MODE_FLAGS_OUTERMOST_2 0x10UL
6809+ u8 ring_select_mode;
6810+ #define VNIC_RSS_QCFG_RESP_RING_SELECT_MODE_TOEPLITZ 0x0UL
6811+ #define VNIC_RSS_QCFG_RESP_RING_SELECT_MODE_XOR 0x1UL
6812+ #define VNIC_RSS_QCFG_RESP_RING_SELECT_MODE_TOEPLITZ_CHECKSUM 0x2UL
6813+ #define VNIC_RSS_QCFG_RESP_RING_SELECT_MODE_LAST VNIC_RSS_QCFG_RESP_RING_SELECT_MODE_TOEPLITZ_CHECKSUM
6814+ u8 unused_1[5];
6815+ u8 valid;
6816+};
6817+
67056818 /* hwrm_vnic_plcmodes_cfg_input (size:320b/40B) */
67066819 struct hwrm_vnic_plcmodes_cfg_input {
67076820 __le16 req_type;
@@ -6827,6 +6940,7 @@ struct hwrm_ring_alloc_input { · 119 unmodified lines
68276940 #define RING_ALLOC_REQ_FLAGS_RX_SOP_PAD 0x1UL
68286941 #define RING_ALLOC_REQ_FLAGS_DISABLE_CQ_OVERFLOW_DETECTION 0x2UL
68296942 #define RING_ALLOC_REQ_FLAGS_NQ_DBR_PACING 0x4UL
6943+ #define RING_ALLOC_REQ_FLAGS_TX_PKT_TS_CMPL_ENABLE 0x8UL
68306944 __le64 page_tbl_addr;
68316945 __le32 fbo;
68326946 u8 page_size;
@@ -7626,7 +7740,10 @@ struct hwrm_cfa_ntuple_filter_alloc_input { · 793 unmodified lines
76267740 #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_UNKNOWN 0x0UL
76277741 #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_TCP 0x6UL
76287742 #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_UDP 0x11UL
7629− #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_LAST CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_UDP
7743+ #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_ICMP 0x1UL
7744+ #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_ICMPV6 0x3aUL
7745+ #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_RSVD 0xffUL
7746+ #define CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_LAST CFA_NTUPLE_FILTER_ALLOC_REQ_IP_PROTOCOL_RSVD
76307747 __le16 dst_id;
76317748 __le16 mirror_vnic_id;
76327749 u8 tunnel_type;
@@ -8337,6 +8454,7 @@ struct hwrm_cfa_adv_flow_mgnt_qcaps_output { · 704 unmodified lines
83378454 #define CFA_ADV_FLOW_MGNT_QCAPS_RESP_FLAGS_LAG_SUPPORTED 0x20000UL
83388455 #define CFA_ADV_FLOW_MGNT_QCAPS_RESP_FLAGS_NTUPLE_FLOW_NO_L2CTX_SUPPORTED 0x40000UL
83398456 #define CFA_ADV_FLOW_MGNT_QCAPS_RESP_FLAGS_NIC_FLOW_STATS_SUPPORTED 0x80000UL
8457+ #define CFA_ADV_FLOW_MGNT_QCAPS_RESP_FLAGS_NTUPLE_FLOW_RX_EXT_IP_PROTO_SUPPORTED 0x100000UL
83408458 u8 unused_0[3];
83418459 u8 valid;
83428460 };
@@ -8355,7 +8473,9 @@ struct hwrm_tunnel_dst_port_query_input { · 12 unmodified lines
83558473 #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL
83568474 #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL
83578475 #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL
8358− #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_VXLAN_GPE_V6
8476+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL
8477+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ECPRI 0xeUL
8478+ #define TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_QUERY_REQ_TUNNEL_TYPE_ECPRI
83598479 u8 unused_0[7];
83608480 };
83618481
@@ -8367,7 +8487,16 @@ struct hwrm_tunnel_dst_port_query_output { · 5 unmodified lines
83678487 __le16 resp_len;
83688488 __le16 tunnel_dst_port_id;
83698489 __be16 tunnel_dst_port_val;
8370− u8 unused_0[3];
8490+ u8 upar_in_use;
8491+ #define TUNNEL_DST_PORT_QUERY_RESP_UPAR_IN_USE_UPAR0 0x1UL
8492+ #define TUNNEL_DST_PORT_QUERY_RESP_UPAR_IN_USE_UPAR1 0x2UL
8493+ #define TUNNEL_DST_PORT_QUERY_RESP_UPAR_IN_USE_UPAR2 0x4UL
8494+ #define TUNNEL_DST_PORT_QUERY_RESP_UPAR_IN_USE_UPAR3 0x8UL
8495+ #define TUNNEL_DST_PORT_QUERY_RESP_UPAR_IN_USE_UPAR4 0x10UL
8496+ #define TUNNEL_DST_PORT_QUERY_RESP_UPAR_IN_USE_UPAR5 0x20UL
8497+ #define TUNNEL_DST_PORT_QUERY_RESP_UPAR_IN_USE_UPAR6 0x40UL
8498+ #define TUNNEL_DST_PORT_QUERY_RESP_UPAR_IN_USE_UPAR7 0x80UL
8499+ u8 unused_0[2];
83718500 u8 valid;
83728501 };
83738502
@@ -8385,7 +8514,9 @@ struct hwrm_tunnel_dst_port_alloc_input { · 11 unmodified lines
83858514 #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL
83868515 #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL
83878516 #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL
8388− #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_VXLAN_GPE_V6
8517+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL
8518+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ECPRI 0xeUL
8519+ #define TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_ALLOC_REQ_TUNNEL_TYPE_ECPRI
83898520 u8 unused_0;
83908521 __be16 tunnel_dst_port_val;
83918522 u8 unused_1[4];
@@ -8398,7 +8529,21 @@ struct hwrm_tunnel_dst_port_alloc_output { · 6 unmodified lines
83988529 __le16 seq_id;
83998530 __le16 resp_len;
84008531 __le16 tunnel_dst_port_id;
8401− u8 unused_0[5];
8532+ u8 error_info;
8533+ #define TUNNEL_DST_PORT_ALLOC_RESP_ERROR_INFO_SUCCESS 0x0UL
8534+ #define TUNNEL_DST_PORT_ALLOC_RESP_ERROR_INFO_ERR_ALLOCATED 0x1UL
8535+ #define TUNNEL_DST_PORT_ALLOC_RESP_ERROR_INFO_ERR_NO_RESOURCE 0x2UL
8536+ #define TUNNEL_DST_PORT_ALLOC_RESP_ERROR_INFO_LAST TUNNEL_DST_PORT_ALLOC_RESP_ERROR_INFO_ERR_NO_RESOURCE
8537+ u8 upar_in_use;
8538+ #define TUNNEL_DST_PORT_ALLOC_RESP_UPAR_IN_USE_UPAR0 0x1UL
8539+ #define TUNNEL_DST_PORT_ALLOC_RESP_UPAR_IN_USE_UPAR1 0x2UL
8540+ #define TUNNEL_DST_PORT_ALLOC_RESP_UPAR_IN_USE_UPAR2 0x4UL
8541+ #define TUNNEL_DST_PORT_ALLOC_RESP_UPAR_IN_USE_UPAR3 0x8UL
8542+ #define TUNNEL_DST_PORT_ALLOC_RESP_UPAR_IN_USE_UPAR4 0x10UL
8543+ #define TUNNEL_DST_PORT_ALLOC_RESP_UPAR_IN_USE_UPAR5 0x20UL
8544+ #define TUNNEL_DST_PORT_ALLOC_RESP_UPAR_IN_USE_UPAR6 0x40UL
8545+ #define TUNNEL_DST_PORT_ALLOC_RESP_UPAR_IN_USE_UPAR7 0x80UL
8546+ u8 unused_0[3];
84028547 u8 valid;
84038548 };
84048549
@@ -8416,7 +8561,9 @@ struct hwrm_tunnel_dst_port_free_input { · 11 unmodified lines
84168561 #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_IPGRE_V1 0xaUL
84178562 #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_L2_ETYPE 0xbUL
84188563 #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE_V6 0xcUL
8419− #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_VXLAN_GPE_V6
8564+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_CUSTOM_GRE 0xdUL
8565+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ECPRI 0xeUL
8566+ #define TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_LAST TUNNEL_DST_PORT_FREE_REQ_TUNNEL_TYPE_ECPRI
84208567 u8 unused_0;
84218568 __le16 tunnel_dst_port_id;
84228569 u8 unused_1[4];
@@ -8428,7 +8575,12 @@ struct hwrm_tunnel_dst_port_free_output { · 5 unmodified lines
84288575 __le16 req_type;
84298576 __le16 seq_id;
84308577 __le16 resp_len;
8431− u8 unused_1[7];
8578+ u8 error_info;
8579+ #define TUNNEL_DST_PORT_FREE_RESP_ERROR_INFO_SUCCESS 0x0UL
8580+ #define TUNNEL_DST_PORT_FREE_RESP_ERROR_INFO_ERR_NOT_OWNER 0x1UL
8581+ #define TUNNEL_DST_PORT_FREE_RESP_ERROR_INFO_ERR_NOT_ALLOCATED 0x2UL
8582+ #define TUNNEL_DST_PORT_FREE_RESP_ERROR_INFO_LAST TUNNEL_DST_PORT_FREE_RESP_ERROR_INFO_ERR_NOT_ALLOCATED
8583+ u8 unused_1[6];
84328584 u8 valid;
84338585 };
84348586
@@ -8686,9 +8838,7 @@ struct hwrm_stat_generic_qstats_input { · 251 unmodified lines
86868838 __le64 resp_addr;
86878839 __le16 generic_stat_size;
86888840 u8 flags;
8689− #define STAT_GENERIC_QSTATS_REQ_FLAGS_COUNTER 0x0UL
8690− #define STAT_GENERIC_QSTATS_REQ_FLAGS_COUNTER_MASK 0x1UL
8691− #define STAT_GENERIC_QSTATS_REQ_FLAGS_LAST STAT_GENERIC_QSTATS_REQ_FLAGS_COUNTER_MASK
8841+ #define STAT_GENERIC_QSTATS_REQ_FLAGS_COUNTER_MASK 0x1UL
86928842 u8 unused_0[5];
86938843 __le64 generic_stat_host_addr;
86948844 };
@@ -10202,6 +10352,7 @@ struct fw_status_reg { · 1507 unmodified lines
1020210352 #define FW_STATUS_REG_SHUTDOWN 0x100000UL
1020310353 #define FW_STATUS_REG_CRASHED_NO_MASTER 0x200000UL
1020410354 #define FW_STATUS_REG_RECOVERING 0x400000UL
10355+ #define FW_STATUS_REG_MANU_DEBUG_STATUS 0x800000UL
1020510356 };
1020610357
1020710358 /* hcomm_status (size:64b/8B) */
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c+25−14
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <linux/net_tstamp.h>
1515 #include <linux/timekeeping.h>
1616 #include <linux/ptp_classify.h>
17+#include <linux/clocksource.h>
1718 #include "bnxt_hsi.h"
1819 #include "bnxt.h"
1920 #include "bnxt_hwrm.h"
@@ -204,24 +205,33 @@ static int bnxt_ptp_adjtime(struct ptp_clock_info *ptp_info, s64 delta) · 184 unmodified lines
204205 return 0;
205206 }
206207
207−static int bnxt_ptp_adjfreq(struct ptp_clock_info *ptp_info, s32 ppb)
208+static int bnxt_ptp_adjfine(struct ptp_clock_info *ptp_info, long scaled_ppm)
208209 {
209210 struct bnxt_ptp_cfg *ptp = container_of(ptp_info, struct bnxt_ptp_cfg,
210211 ptp_info);
211212 struct hwrm_port_mac_cfg_input *req;
212213 struct bnxt *bp = ptp->bp;
213− int rc;
214+ int rc = 0;
214215
215− rc = hwrm_req_init(bp, req, HWRM_PORT_MAC_CFG);
216− if (rc)
217− return rc;
216+ if (!(ptp->bp->fw_cap & BNXT_FW_CAP_PTP_RTC)) {
217+ spin_lock_bh(&ptp->ptp_lock);
218+ timecounter_read(&ptp->tc);
219+ ptp->cc.mult = adjust_by_scaled_ppm(ptp->cmult, scaled_ppm);
220+ spin_unlock_bh(&ptp->ptp_lock);
221+ } else {
222+ s32 ppb = scaled_ppm_to_ppb(scaled_ppm);
218223
219− req->ptp_freq_adj_ppb = cpu_to_le32(ppb);
220− req->enables = cpu_to_le32(PORT_MAC_CFG_REQ_ENABLES_PTP_FREQ_ADJ_PPB);
221− rc = hwrm_req_send(ptp->bp, req);
222− if (rc)
223− netdev_err(ptp->bp->dev,
224− "ptp adjfreq failed. rc = %d\n", rc);
224+ rc = hwrm_req_init(bp, req, HWRM_PORT_MAC_CFG);
225+ if (rc)
226+ return rc;
227+
228+ req->ptp_freq_adj_ppb = cpu_to_le32(ppb);
229+ req->enables = cpu_to_le32(PORT_MAC_CFG_REQ_ENABLES_PTP_FREQ_ADJ_PPB);
230+ rc = hwrm_req_send(ptp->bp, req);
231+ if (rc)
232+ netdev_err(ptp->bp->dev,
233+ "ptp adjfine failed. rc = %d\n", rc);
234+ }
225235 return rc;
226236 }
227237
@@ -749,7 +759,7 @@ static const struct ptp_clock_info bnxt_ptp_caps = { · 521 unmodified lines
749759 .n_per_out = 0,
750760 .n_pins = 0,
751761 .pps = 0,
752− .adjfreq = bnxt_ptp_adjfreq,
762+ .adjfine = bnxt_ptp_adjfine,
753763 .adjtime = bnxt_ptp_adjtime,
754764 .do_aux_work = bnxt_ptp_ts_aux_work,
755765 .gettimex64 = bnxt_ptp_gettimex,
@@ -846,8 +856,9 @@ static void bnxt_ptp_timecounter_init(struct bnxt *bp, bool init_tc) · 90 unmodified lines
846856 memset(&ptp->cc, 0, sizeof(ptp->cc));
847857 ptp->cc.read = bnxt_cc_read;
848858 ptp->cc.mask = CYCLECOUNTER_MASK(48);
849− ptp->cc.shift = 0;
850− ptp->cc.mult = 1;
859+ ptp->cc.shift = BNXT_CYCLES_SHIFT;
860+ ptp->cc.mult = clocksource_khz2mult(BNXT_DEVCLK_FREQ, ptp->cc.shift);
861+ ptp->cmult = ptp->cc.mult;
851862 ptp->next_overflow_check = jiffies + BNXT_PHC_OVERFLOW_PERIOD;
852863 }
853864 if (init_tc)
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.h+5−2
@@ -17,6 +17,8 @@ · 16 unmodified lines
1717 #define BNXT_PTP_GRC_WIN_BASE 0x6000
1818
1919 #define BNXT_MAX_PHC_DRIFT 31000000
20+#define BNXT_CYCLES_SHIFT 23
21+#define BNXT_DEVCLK_FREQ 1000000
2022 #define BNXT_LO_TIMER_MASK 0x0000ffffffffUL
2123 #define BNXT_HI_TIMER_MASK 0xffff00000000UL
2224
@@ -88,8 +90,9 @@ struct bnxt_ptp_cfg { · 65 unmodified lines
8890 u64 old_time;
8991 unsigned long next_period;
9092 unsigned long next_overflow_check;
91− /* 48-bit PHC overflows in 78 hours. Check overflow every 19 hours. */
92− #define BNXT_PHC_OVERFLOW_PERIOD (19 * 3600 * HZ)
93+ u32 cmult;
94+ /* a 23b shift cyclecounter will overflow in ~36 mins. Check overflow every 18 mins. */
95+ #define BNXT_PHC_OVERFLOW_PERIOD (18 * 60 * HZ)
9396
9497 u16 tx_seqid;
9598 u16 tx_hdr_off;
drivers/net/ethernet/broadcom/genet/bcmgenet.c+27−22
@@ -117,24 +117,6 @@ static inline void dmadesc_set(struct bcmgenet_priv *priv, · 116 unmodified lines
117117 dmadesc_set_length_status(priv, d, val);
118118 }
119119
120−static inline dma_addr_t dmadesc_get_addr(struct bcmgenet_priv *priv,
121− void __iomem *d)
122−{
123− dma_addr_t addr;
124−
125− addr = bcmgenet_readl(d + DMA_DESC_ADDRESS_LO);
126−
127− /* Register writes to GISB bus can take couple hundred nanoseconds
128− * and are done for each packet, save these expensive writes unless
129− * the platform is explicitly configured for 64-bits/LPAE.
130− */
131−#ifdef CONFIG_PHYS_ADDR_T_64BIT
132− if (priv->hw_params->flags & GENET_HAS_40BITS)
133− addr |= (u64)bcmgenet_readl(d + DMA_DESC_ADDRESS_HI) << 32;
134−#endif
135− return addr;
136−}
137−
138120 #define GENET_VER_FMT "%1d.%1d EPHY: 0x%04x"
139121
140122 #define GENET_MSG_DEFAULT (NETIF_MSG_DRV | NETIF_MSG_PROBE | \
@@ -1387,7 +1369,8 @@ static int bcmgenet_validate_flow(struct net_device *dev, · 1246 unmodified lines
13871369 struct ethtool_usrip4_spec *l4_mask;
13881370 struct ethhdr *eth_mask;
13891371
1390− if (cmd->fs.location >= MAX_NUM_OF_FS_RULES) {
1372+ if (cmd->fs.location >= MAX_NUM_OF_FS_RULES &&
1373+ cmd->fs.location != RX_CLS_LOC_ANY) {
13911374 netdev_err(dev, "rxnfc: Invalid location (%d)\n",
13921375 cmd->fs.location);
13931376 return -EINVAL;
@@ -1452,7 +1435,7 @@ static int bcmgenet_insert_flow(struct net_device *dev, · 58 unmodified lines
14521435 {
14531436 struct bcmgenet_priv *priv = netdev_priv(dev);
14541437 struct bcmgenet_rxnfc_rule *loc_rule;
1455− int err;
1438+ int err, i;
14561439
14571440 if (priv->hw_params->hfb_filter_size < 128) {
14581441 netdev_err(dev, "rxnfc: Not supported by this device\n");
@@ -1470,7 +1453,29 @@ static int bcmgenet_insert_flow(struct net_device *dev, · 11 unmodified lines
14701453 if (err)
14711454 return err;
14721455
1473− loc_rule = &priv->rxnfc_rules[cmd->fs.location];
1456+ if (cmd->fs.location == RX_CLS_LOC_ANY) {
1457+ list_for_each_entry(loc_rule, &priv->rxnfc_list, list) {
1458+ cmd->fs.location = loc_rule->fs.location;
1459+ err = memcmp(&loc_rule->fs, &cmd->fs,
1460+ sizeof(struct ethtool_rx_flow_spec));
1461+ if (!err)
1462+ /* rule exists so return current location */
1463+ return 0;
1464+ }
1465+ for (i = 0; i < MAX_NUM_OF_FS_RULES; i++) {
1466+ loc_rule = &priv->rxnfc_rules[i];
1467+ if (loc_rule->state == BCMGENET_RXNFC_STATE_UNUSED) {
1468+ cmd->fs.location = i;
1469+ break;
1470+ }
1471+ }
1472+ if (i == MAX_NUM_OF_FS_RULES) {
1473+ cmd->fs.location = RX_CLS_LOC_ANY;
1474+ return -ENOSPC;
1475+ }
1476+ } else {
1477+ loc_rule = &priv->rxnfc_rules[cmd->fs.location];
1478+ }
14741479 if (loc_rule->state == BCMGENET_RXNFC_STATE_ENABLED)
14751480 bcmgenet_hfb_disable_filter(priv, cmd->fs.location);
14761481 if (loc_rule->state != BCMGENET_RXNFC_STATE_UNUSED) {
@@ -1583,7 +1588,7 @@ static int bcmgenet_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, · 106 unmodified lines
15831588 break;
15841589 case ETHTOOL_GRXCLSRLCNT:
15851590 cmd->rule_cnt = bcmgenet_get_num_flows(priv);
1586− cmd->data = MAX_NUM_OF_FS_RULES;
1591+ cmd->data = MAX_NUM_OF_FS_RULES | RX_CLS_LOC_SPECIAL;
15871592 break;
15881593 case ETHTOOL_GRXCLSRULE:
15891594 err = bcmgenet_get_flow(dev, cmd, cmd->fs.location);
drivers/net/ethernet/broadcom/genet/bcmmii.c+14−5
@@ -72,7 +72,6 @@ static void bcmgenet_mac_config(struct net_device *dev) · 71 unmodified lines
7272 * Receive clock is provided by the PHY.
7373 */
7474 reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
75− reg &= ~OOB_DISABLE;
7675 reg |= RGMII_LINK;
7776 bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
7877
@@ -95,10 +94,18 @@ static void bcmgenet_mac_config(struct net_device *dev) · 16 unmodified lines
9594 */
9695 void bcmgenet_mii_setup(struct net_device *dev)
9796 {
97+ struct bcmgenet_priv *priv = netdev_priv(dev);
9898 struct phy_device *phydev = dev->phydev;
99+ u32 reg;
99100
100− if (phydev->link)
101+ if (phydev->link) {
101102 bcmgenet_mac_config(dev);
103+ } else {
104+ reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
105+ reg &= ~RGMII_LINK;
106+ bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
107+ }
108+
102109 phy_print_status(phydev);
103110 }
104111
@@ -266,18 +273,20 @@ int bcmgenet_mii_config(struct net_device *dev, bool init) · 161 unmodified lines
266273 (priv->phy_interface != PHY_INTERFACE_MODE_MOCA);
267274
268275 /* This is an external PHY (xMII), so we need to enable the RGMII
269− * block for the interface to work
276+ * block for the interface to work, unconditionally clear the
277+ * Out-of-band disable since we do not need it.
270278 */
279+ reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
280+ reg &= ~OOB_DISABLE;
271281 if (priv->ext_phy) {
272− reg = bcmgenet_ext_readl(priv, EXT_RGMII_OOB_CTRL);
273282 reg &= ~ID_MODE_DIS;
274283 reg |= id_mode_dis;
275284 if (GENET_IS_V1(priv) || GENET_IS_V2(priv) || GENET_IS_V3(priv))
276285 reg |= RGMII_MODE_EN_V123;
277286 else
278287 reg |= RGMII_MODE_EN;
279− bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
280288 }
289+ bcmgenet_ext_writel(priv, reg, EXT_RGMII_OOB_CTRL);
281290
282291 if (init)
283292 dev_info(kdev, "configuring instance for %s\n", phy_name);
drivers/net/ethernet/broadcom/tg3.c+7−15
@@ -6179,34 +6179,26 @@ static int tg3_get_ts_info(struct net_device *dev, struct ethtool_ts_info *info) · 6178 unmodified lines
61796179 return 0;
61806180 }
61816181
6182−static int tg3_ptp_adjfreq(struct ptp_clock_info *ptp, s32 ppb)
6182+static int tg3_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
61836183 {
61846184 struct tg3 *tp = container_of(ptp, struct tg3, ptp_info);
6185− bool neg_adj = false;
6186− u32 correction = 0;
6187−
6188− if (ppb < 0) {
6189− neg_adj = true;
6190− ppb = -ppb;
6191− }
6185+ u64 correction;
6186+ bool neg_adj;
61926187
61936188 /* Frequency adjustment is performed using hardware with a 24 bit
61946189 * accumulator and a programmable correction value. On each clk, the
61956190 * correction value gets added to the accumulator and when it
61966191 * overflows, the time counter is incremented/decremented.
6197− *
6198− * So conversion from ppb to correction value is
6199− * ppb * (1 << 24) / 1000000000
62006192 */
6201− correction = div_u64((u64)ppb * (1 << 24), 1000000000ULL) &
6202− TG3_EAV_REF_CLK_CORRECT_MASK;
6193+ neg_adj = diff_by_scaled_ppm(1 << 24, scaled_ppm, &correction);
62036194
62046195 tg3_full_lock(tp, 0);
62056196
62066197 if (correction)
62076198 tw32(TG3_EAV_REF_CLK_CORRECT_CTL,
62086199 TG3_EAV_REF_CLK_CORRECT_EN |
6209− (neg_adj ? TG3_EAV_REF_CLK_CORRECT_NEG : 0) | correction);
6200+ (neg_adj ? TG3_EAV_REF_CLK_CORRECT_NEG : 0) |
6201+ ((u32)correction & TG3_EAV_REF_CLK_CORRECT_MASK));
62106202 else
62116203 tw32(TG3_EAV_REF_CLK_CORRECT_CTL, 0);
62126204
@@ -6330,7 +6322,7 @@ static const struct ptp_clock_info tg3_ptp_caps = { · 117 unmodified lines
63306322 .n_per_out = 1,
63316323 .n_pins = 0,
63326324 .pps = 0,
6333− .adjfreq = tg3_ptp_adjfreq,
6325+ .adjfine = tg3_ptp_adjfine,
63346326 .adjtime = tg3_ptp_adjtime,
63356327 .gettimex64 = tg3_ptp_gettimex,
63366328 .settime64 = tg3_ptp_settime,
drivers/net/ethernet/brocade/bna/bfa_cs.h+38−22
@@ -18,15 +18,43 @@ · 17 unmodified lines
1818
1919 /* BFA state machine interfaces */
2020
21−typedef void (*bfa_sm_t)(void *sm, int event);
22−
2321 /* For converting from state machine function to state encoding. */
24−struct bfa_sm_table {
25− bfa_sm_t sm; /*!< state machine function */
26− int state; /*!< state machine encoding */
27− char *name; /*!< state name for display */
28−};
29−#define BFA_SM(_sm) ((bfa_sm_t)(_sm))
22+#define BFA_SM_TABLE(n, s, e, t) \
23+struct s; \
24+enum e; \
25+typedef void (*t)(struct s *, enum e); \
26+ \
27+struct n ## _sm_table_s { \
28+ t sm; /* state machine function */ \
29+ int state; /* state machine encoding */ \
30+ char *name; /* state name for display */ \
31+}; \
32+ \
33+static inline int \
34+n ## _sm_to_state(struct n ## _sm_table_s *smt, t sm) \
35+{ \
36+ int i = 0; \
37+ \
38+ while (smt[i].sm && smt[i].sm != sm) \
39+ i++; \
40+ return smt[i].state; \
41+}
42+
43+BFA_SM_TABLE(iocpf, bfa_iocpf, iocpf_event, bfa_fsm_iocpf_t)
44+BFA_SM_TABLE(ioc, bfa_ioc, ioc_event, bfa_fsm_ioc_t)
45+BFA_SM_TABLE(cmdq, bfa_msgq_cmdq, cmdq_event, bfa_fsm_msgq_cmdq_t)
46+BFA_SM_TABLE(rspq, bfa_msgq_rspq, rspq_event, bfa_fsm_msgq_rspq_t)
47+
48+BFA_SM_TABLE(ioceth, bna_ioceth, bna_ioceth_event, bna_fsm_ioceth_t)
49+BFA_SM_TABLE(enet, bna_enet, bna_enet_event, bna_fsm_enet_t)
50+BFA_SM_TABLE(ethport, bna_ethport, bna_ethport_event, bna_fsm_ethport_t)
51+BFA_SM_TABLE(tx, bna_tx, bna_tx_event, bna_fsm_tx_t)
52+BFA_SM_TABLE(rxf, bna_rxf, bna_rxf_event, bna_fsm_rxf_t)
53+BFA_SM_TABLE(rx, bna_rx, bna_rx_event, bna_fsm_rx_t)
54+
55+#undef BFA_SM_TABLE
56+
57+#define BFA_SM(_sm) (_sm)
3058
3159 /* State machine with entry actions. */
3260 typedef void (*bfa_fsm_t)(void *fsm, int event);
@@ -41,24 +69,12 @@ typedef void (*bfa_fsm_t)(void *fsm, int event); · 8 unmodified lines
4169 static void oc ## _sm_ ## st ## _entry(otype * fsm)
4270
4371 #define bfa_fsm_set_state(_fsm, _state) do { \
44− (_fsm)->fsm = (bfa_fsm_t)(_state); \
72+ (_fsm)->fsm = (_state); \
4573 _state ## _entry(_fsm); \
4674 } while (0)
4775
4876 #define bfa_fsm_send_event(_fsm, _event) ((_fsm)->fsm((_fsm), (_event)))
49−#define bfa_fsm_cmp_state(_fsm, _state) \
50− ((_fsm)->fsm == (bfa_fsm_t)(_state))
51−
52−static inline int
53−bfa_sm_to_state(const struct bfa_sm_table *smt, bfa_sm_t sm)
54−{
55− int i = 0;
56−
57− while (smt[i].sm && smt[i].sm != sm)
58− i++;
59− return smt[i].state;
60−}
61−
77+#define bfa_fsm_cmp_state(_fsm, _state) ((_fsm)->fsm == (_state))
6278 /* Generic wait counter. */
6379
6480 typedef void (*bfa_wc_resume_t) (void *cbarg);
drivers/net/ethernet/brocade/bna/bfa_ioc.c+5−5
@@ -114,7 +114,7 @@ bfa_fsm_state_decl(bfa_ioc, disabling, struct bfa_ioc, enum ioc_event); · 113 unmodified lines
114114 bfa_fsm_state_decl(bfa_ioc, disabled, struct bfa_ioc, enum ioc_event);
115115 bfa_fsm_state_decl(bfa_ioc, hwfail, struct bfa_ioc, enum ioc_event);
116116
117−static struct bfa_sm_table ioc_sm_table[] = {
117+static struct ioc_sm_table_s ioc_sm_table[] = {
118118 {BFA_SM(bfa_ioc_sm_uninit), BFA_IOC_UNINIT},
119119 {BFA_SM(bfa_ioc_sm_reset), BFA_IOC_RESET},
120120 {BFA_SM(bfa_ioc_sm_enabling), BFA_IOC_ENABLING},
@@ -183,7 +183,7 @@ bfa_fsm_state_decl(bfa_iocpf, disabling_sync, struct bfa_iocpf, · 62 unmodified lines
183183 enum iocpf_event);
184184 bfa_fsm_state_decl(bfa_iocpf, disabled, struct bfa_iocpf, enum iocpf_event);
185185
186−static struct bfa_sm_table iocpf_sm_table[] = {
186+static struct iocpf_sm_table_s iocpf_sm_table[] = {
187187 {BFA_SM(bfa_iocpf_sm_reset), BFA_IOCPF_RESET},
188188 {BFA_SM(bfa_iocpf_sm_fwcheck), BFA_IOCPF_FWMISMATCH},
189189 {BFA_SM(bfa_iocpf_sm_mismatch), BFA_IOCPF_FWMISMATCH},
@@ -2860,12 +2860,12 @@ static enum bfa_ioc_state · 2670 unmodified lines
28602860 bfa_ioc_get_state(struct bfa_ioc *ioc)
28612861 {
28622862 enum bfa_iocpf_state iocpf_st;
2863− enum bfa_ioc_state ioc_st = bfa_sm_to_state(ioc_sm_table, ioc->fsm);
2863+ enum bfa_ioc_state ioc_st = ioc_sm_to_state(ioc_sm_table, ioc->fsm);
28642864
28652865 if (ioc_st == BFA_IOC_ENABLING ||
28662866 ioc_st == BFA_IOC_FAIL || ioc_st == BFA_IOC_INITFAIL) {
28672867
2868− iocpf_st = bfa_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
2868+ iocpf_st = iocpf_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
28692869
28702870 switch (iocpf_st) {
28712871 case BFA_IOCPF_SEMWAIT:
@@ -2983,7 +2983,7 @@ bfa_nw_iocpf_timeout(struct bfa_ioc *ioc) · 111 unmodified lines
29832983 {
29842984 enum bfa_iocpf_state iocpf_st;
29852985
2986− iocpf_st = bfa_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
2986+ iocpf_st = iocpf_sm_to_state(iocpf_sm_table, ioc->iocpf.fsm);
29872987
29882988 if (iocpf_st == BFA_IOCPF_HWINIT)
29892989 bfa_ioc_poll_fwinit(ioc);
drivers/net/ethernet/brocade/bna/bfa_ioc.h+6−2
@@ -147,16 +147,20 @@ struct bfa_ioc_notify { · 146 unmodified lines
147147 (__notify)->cbarg = (__cbarg); \
148148 } while (0)
149149
150+enum iocpf_event;
151+
150152 struct bfa_iocpf {
151− bfa_fsm_t fsm;
153+ void (*fsm)(struct bfa_iocpf *s, enum iocpf_event e);
152154 struct bfa_ioc *ioc;
153155 bool fw_mismatch_notified;
154156 bool auto_recover;
155157 u32 poll_time;
156158 };
157159
160+enum ioc_event;
161+
158162 struct bfa_ioc {
159− bfa_fsm_t fsm;
163+ void (*fsm)(struct bfa_ioc *s, enum ioc_event e);
160164 struct bfa *bfa;
161165 struct bfa_pcidev pcidev;
162166 struct timer_list ioc_timer;
drivers/net/ethernet/brocade/bna/bfa_msgq.c+0−2
@@ -202,7 +202,6 @@ static void · 201 unmodified lines
202202 __cmd_copy(struct bfa_msgq_cmdq *cmdq, struct bfa_msgq_cmd_entry *cmd)
203203 {
204204 size_t len = cmd->msg_size;
205− int num_entries = 0;
206205 size_t to_copy;
207206 u8 *src, *dst;
208207
@@ -219,7 +218,6 @@ __cmd_copy(struct bfa_msgq_cmdq *cmdq, struct bfa_msgq_cmd_entry *cmd) · 10 unmodified lines
219218 BFA_MSGQ_INDX_ADD(cmdq->producer_index, 1, cmdq->depth);
220219 dst = (u8 *)cmdq->addr.kva;
221220 dst += (cmdq->producer_index * BFI_MSGQ_CMD_ENTRY_SIZE);
222− num_entries++;
223221 }
224222
225223 }
drivers/net/ethernet/brocade/bna/bfa_msgq.h+6−2
@@ -55,8 +55,10 @@ enum bfa_msgq_cmdq_flags { · 54 unmodified lines
5555 BFA_MSGQ_CMDQ_F_DB_UPDATE = 1,
5656 };
5757
58+enum cmdq_event;
59+
5860 struct bfa_msgq_cmdq {
59− bfa_fsm_t fsm;
61+ void (*fsm)(struct bfa_msgq_cmdq *s, enum cmdq_event e);
6062 enum bfa_msgq_cmdq_flags flags;
6163
6264 u16 producer_index;
@@ -81,8 +83,10 @@ enum bfa_msgq_rspq_flags { · 18 unmodified lines
8183
8284 typedef void (*bfa_msgq_mcfunc_t)(void *cbarg, struct bfi_msgq_mhdr *mhdr);
8385
86+enum rspq_event;
87+
8488 struct bfa_msgq_rspq {
85− bfa_fsm_t fsm;
89+ void (*fsm)(struct bfa_msgq_rspq *s, enum rspq_event e);
8690 enum bfa_msgq_rspq_flags flags;
8791
8892 u16 producer_index;
drivers/net/ethernet/brocade/bna/bna_enet.c+3−3
@@ -1257,7 +1257,7 @@ bna_enet_mtu_get(struct bna_enet *enet) · 1256 unmodified lines
12571257 void
12581258 bna_enet_enable(struct bna_enet *enet)
12591259 {
1260− if (enet->fsm != (bfa_sm_t)bna_enet_sm_stopped)
1260+ if (enet->fsm != bna_enet_sm_stopped)
12611261 return;
12621262
12631263 enet->flags |= BNA_ENET_F_ENABLED;
@@ -1751,12 +1751,12 @@ bna_ioceth_uninit(struct bna_ioceth *ioceth) · 487 unmodified lines
17511751 void
17521752 bna_ioceth_enable(struct bna_ioceth *ioceth)
17531753 {
1754− if (ioceth->fsm == (bfa_fsm_t)bna_ioceth_sm_ready) {
1754+ if (ioceth->fsm == bna_ioceth_sm_ready) {
17551755 bnad_cb_ioceth_ready(ioceth->bna->bnad);
17561756 return;
17571757 }
17581758
1759− if (ioceth->fsm == (bfa_fsm_t)bna_ioceth_sm_stopped)
1759+ if (ioceth->fsm == bna_ioceth_sm_stopped)
17601760 bfa_fsm_send_event(ioceth, IOCETH_E_ENABLE);
17611761 }
17621762
drivers/net/ethernet/brocade/bna/bna_tx_rx.c+3−3
@@ -1956,7 +1956,7 @@ static void · 1955 unmodified lines
19561956 bna_rx_stop(struct bna_rx *rx)
19571957 {
19581958 rx->rx_flags &= ~BNA_RX_F_ENET_STARTED;
1959− if (rx->fsm == (bfa_fsm_t) bna_rx_sm_stopped)
1959+ if (rx->fsm == bna_rx_sm_stopped)
19601960 bna_rx_mod_cb_rx_stopped(&rx->bna->rx_mod, rx);
19611961 else {
19621962 rx->stop_cbfn = bna_rx_mod_cb_rx_stopped;
@@ -2535,7 +2535,7 @@ bna_rx_destroy(struct bna_rx *rx) · 572 unmodified lines
25352535 void
25362536 bna_rx_enable(struct bna_rx *rx)
25372537 {
2538− if (rx->fsm != (bfa_sm_t)bna_rx_sm_stopped)
2538+ if (rx->fsm != bna_rx_sm_stopped)
25392539 return;
25402540
25412541 rx->rx_flags |= BNA_RX_F_ENABLED;
@@ -3523,7 +3523,7 @@ bna_tx_destroy(struct bna_tx *tx) · 981 unmodified lines
35233523 void
35243524 bna_tx_enable(struct bna_tx *tx)
35253525 {
3526− if (tx->fsm != (bfa_sm_t)bna_tx_sm_stopped)
3526+ if (tx->fsm != bna_tx_sm_stopped)
35273527 return;
35283528
35293529 tx->flags |= BNA_TX_F_ENABLED;
drivers/net/ethernet/brocade/bna/bna_types.h+21−6
@@ -312,8 +312,10 @@ struct bna_attr { · 311 unmodified lines
312312
313313 /* IOCEth */
314314
315+enum bna_ioceth_event;
316+
315317 struct bna_ioceth {
316− bfa_fsm_t fsm;
318+ void (*fsm)(struct bna_ioceth *s, enum bna_ioceth_event e);
317319 struct bfa_ioc ioc;
318320
319321 struct bna_attr attr;
@@ -334,8 +336,10 @@ struct bna_pause_config { · 14 unmodified lines
334336 enum bna_status rx_pause;
335337 };
336338
339+enum bna_enet_event;
340+
337341 struct bna_enet {
338− bfa_fsm_t fsm;
342+ void (*fsm)(struct bna_enet *s, enum bna_enet_event e);
339343 enum bna_enet_flags flags;
340344
341345 enum bna_enet_type type;
@@ -360,8 +364,10 @@ struct bna_enet { · 18 unmodified lines
360364
361365 /* Ethport */
362366
367+enum bna_ethport_event;
368+
363369 struct bna_ethport {
364− bfa_fsm_t fsm;
370+ void (*fsm)(struct bna_ethport *s, enum bna_ethport_event e);
365371 enum bna_ethport_flags flags;
366372
367373 enum bna_link_status link_status;
@@ -454,13 +460,16 @@ struct bna_txq { · 86 unmodified lines
454460 };
455461
456462 /* Tx object */
463+
464+enum bna_tx_event;
465+
457466 struct bna_tx {
458467 /* This should be the first one */
459468 struct list_head qe;
460469 int rid;
461470 int hw_id;
462471
463− bfa_fsm_t fsm;
472+ void (*fsm)(struct bna_tx *s, enum bna_tx_event e);
464473 enum bna_tx_flags flags;
465474
466475 enum bna_tx_type type;
@@ -698,8 +707,11 @@ struct bna_rxp { · 231 unmodified lines
698707 };
699708
700709 /* RxF structure (hardware Rx Function) */
710+
711+enum bna_rxf_event;
712+
701713 struct bna_rxf {
702− bfa_fsm_t fsm;
714+ void (*fsm)(struct bna_rxf *s, enum bna_rxf_event e);
703715
704716 struct bfa_msgq_cmd_entry msgq_cmd;
705717 union {
@@ -769,13 +781,16 @@ struct bna_rxf { · 63 unmodified lines
769781 };
770782
771783 /* Rx object */
784+
785+enum bna_rx_event;
786+
772787 struct bna_rx {
773788 /* This should be the first one */
774789 struct list_head qe;
775790 int rid;
776791 int hw_id;
777792
778− bfa_fsm_t fsm;
793+ void (*fsm)(struct bna_rx *s, enum bna_rx_event e);
779794
780795 enum bna_rx_type type;
781796
drivers/net/ethernet/cadence/macb_main.c+15−2
@@ -742,7 +742,6 @@ static struct phylink_pcs *macb_mac_select_pcs(struct phylink_config *config, · 741 unmodified lines
742742 }
743743

42 more lines aren’t shown here.

drivers/net/ethernet/cavium/liquidio/lio_main.c+7−4

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

drivers/net/ethernet/cavium/liquidio/octeon_console.c+3−4

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

drivers/net/ethernet/chelsio/cxgb4/cxgb4_ptp.c+8−5

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

drivers/net/ethernet/chelsio/inline_crypto/ch_ipsec/chcr_ipsec.c+4−0

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

drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c+12−14

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

drivers/net/ethernet/cisco/enic/enic.h+6−17

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

drivers/net/ethernet/cisco/enic/enic_main.c+5−6

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

drivers/net/ethernet/cortina/gemini.c+12−12

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

drivers/net/ethernet/dlink/dl2k.c+0−2

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

drivers/net/ethernet/dlink/sundance.c+0−2

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

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

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

drivers/net/ethernet/emulex/benet/be_ethtool.c+6−6

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

drivers/net/ethernet/emulex/benet/be_main.c+8−8

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

drivers/net/ethernet/engleder/tsnep.h+8−0

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

drivers/net/ethernet/engleder/tsnep_ethtool.c+159−6

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

drivers/net/ethernet/engleder/tsnep_hw.h+7−0

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

drivers/net/ethernet/engleder/tsnep_main.c+171−74

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

drivers/net/ethernet/faraday/ftmac100.c+45−20

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

drivers/net/ethernet/fealnx.c+0−1953

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

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

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

drivers/net/ethernet/freescale/dpaa/Kconfig+2−2

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

drivers/net/ethernet/freescale/dpaa/dpaa_eth.c+26−63

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

drivers/net/ethernet/freescale/dpaa/dpaa_ethtool.c+15−75

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

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

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c+53−4

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-devlink.c+2−20

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-trace.h+91−51

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c+415−194

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.h+99−13

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-ethtool.c+91−37

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c+17−5

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.h+8−2

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-ptp.c+0−1

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch-ethtool.c+28−17

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c+40−20

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.h+3−6

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

drivers/net/ethernet/freescale/dpaa2/dpaa2-xsk.c+454−0

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

drivers/net/ethernet/freescale/dpaa2/dpni-cmd.h+13−6

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

drivers/net/ethernet/freescale/dpaa2/dpni.c+5−1

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

drivers/net/ethernet/freescale/dpaa2/dpni.h+9−0

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

drivers/net/ethernet/freescale/enetc/enetc_pf.c+0−1

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

drivers/net/ethernet/freescale/fec.h+19−1

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

drivers/net/ethernet/freescale/fec_main.c+324−73

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

drivers/net/ethernet/freescale/fec_ptp.c+170−7

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

drivers/net/ethernet/freescale/fman/Kconfig+2−1

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

drivers/net/ethernet/freescale/fman/fman_dtsec.c+211−246

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

drivers/net/ethernet/freescale/fman/fman_mac.h+0−10

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

drivers/net/ethernet/freescale/fman/fman_memac.c+376−368

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

drivers/net/ethernet/freescale/fman/fman_tgec.c+58−72

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

drivers/net/ethernet/freescale/fman/mac.c+6−162

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

drivers/net/ethernet/freescale/fman/mac.h+10−13

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

drivers/net/ethernet/fungible/funeth/funeth_devlink.c+0−7

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

drivers/net/ethernet/fungible/funeth/funeth_main.c+1−12

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

drivers/net/ethernet/fungible/funeth/funeth_txrx.h+2−2

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

drivers/net/ethernet/google/gve/gve.h+21−6

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

drivers/net/ethernet/google/gve/gve_adminq.c+20−1

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

drivers/net/ethernet/google/gve/gve_adminq.h+51−0

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

drivers/net/ethernet/google/gve/gve_desc_dqo.h+5−0

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

drivers/net/ethernet/google/gve/gve_ethtool.c+10−8

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

drivers/net/ethernet/google/gve/gve_main.c+58−6

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

drivers/net/ethernet/google/gve/gve_rx.c+309−235

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

drivers/net/ethernet/google/gve/gve_rx_dqo.c+1−1

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

drivers/net/ethernet/google/gve/gve_tx_dqo.c+13−7

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

drivers/net/ethernet/google/gve/gve_utils.c+7−23

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

drivers/net/ethernet/google/gve/gve_utils.h+1−1

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

drivers/net/ethernet/hisilicon/hns/hnae.c+0−3

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

drivers/net/ethernet/hisilicon/hns/hns_ethtool.c+4−7

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

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c+2−2

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

drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c+2−4

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

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_devlink.c+0−5

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

drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c+5−17

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

drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_devlink.c+0−5

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

drivers/net/ethernet/huawei/hinic/hinic_dev.h+4−0

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

drivers/net/ethernet/huawei/hinic/hinic_hw_dev.h+118−52

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

drivers/net/ethernet/huawei/hinic/hinic_main.c+12−1

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

drivers/net/ethernet/huawei/hinic/hinic_port.c+34−16

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

drivers/net/ethernet/huawei/hinic/hinic_port.h+12−0

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

drivers/net/ethernet/huawei/hinic/hinic_rx.c+2−2

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

drivers/net/ethernet/huawei/hinic/hinic_sriov.c+18−0

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

drivers/net/ethernet/huawei/hinic/hinic_tx.c+2−2

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

drivers/net/ethernet/ibm/ibmveth.c+1−17

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

drivers/net/ethernet/ibm/ibmveth.h+0−1

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

drivers/net/ethernet/ibm/ibmvnic.c+238−1

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

drivers/net/ethernet/ibm/ibmvnic.h+5−0

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

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

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

drivers/net/ethernet/intel/e1000e/Makefile+3−0

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

drivers/net/ethernet/intel/e1000e/e1000.h+3−1

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

drivers/net/ethernet/intel/e1000e/e1000e_trace.h+42−0

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

drivers/net/ethernet/intel/e1000e/ethtool.c+2−0

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

drivers/net/ethernet/intel/e1000e/hw.h+9−0

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

drivers/net/ethernet/intel/e1000e/ich8lan.c+27−0

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

drivers/net/ethernet/intel/e1000e/netdev.c+28−23

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

drivers/net/ethernet/intel/e1000e/ptp.c+4−13

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

drivers/net/ethernet/intel/fm10k/fm10k_netdev.c+4−4

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

drivers/net/ethernet/intel/i40e/i40e.h+1−0

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

drivers/net/ethernet/intel/i40e/i40e_adminq_cmd.h+5−3

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

drivers/net/ethernet/intel/i40e/i40e_common.c+26−0

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

drivers/net/ethernet/intel/i40e/i40e_ethtool.c+7−5

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

drivers/net/ethernet/intel/i40e/i40e_main.c+62−23

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

drivers/net/ethernet/intel/i40e/i40e_prototype.h+3−0

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

drivers/net/ethernet/intel/i40e/i40e_ptp.c+3−14

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

drivers/net/ethernet/intel/i40e/i40e_trace.h+49−0

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

drivers/net/ethernet/intel/i40e/i40e_txrx.c+21−6

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

drivers/net/ethernet/intel/iavf/iavf_ethtool.c+4−4

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

drivers/net/ethernet/intel/iavf/iavf_main.c+2−2

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

drivers/net/ethernet/intel/ice/ice.h+24−0

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

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h+2−2

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

drivers/net/ethernet/intel/ice/ice_base.c+1−1

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

drivers/net/ethernet/intel/ice/ice_common.c+44−4

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

drivers/net/ethernet/intel/ice/ice_common.h+1−0

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

drivers/net/ethernet/intel/ice/ice_dcb.c+1−1

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

drivers/net/ethernet/intel/ice/ice_dcb_lib.c+10−0

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

drivers/net/ethernet/intel/ice/ice_devlink.c+570−64

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

drivers/net/ethernet/intel/ice/ice_devlink.h+3−0

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

drivers/net/ethernet/intel/ice/ice_ethtool.c+175−6

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

drivers/net/ethernet/intel/ice/ice_hw_autogen.h+3−0

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

drivers/net/ethernet/intel/ice/ice_lan_tx_rx.h+0−12

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

drivers/net/ethernet/intel/ice/ice_lib.c+237−35

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

drivers/net/ethernet/intel/ice/ice_main.c+90−45

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

drivers/net/ethernet/intel/ice/ice_ptp.c+272−292

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

drivers/net/ethernet/intel/ice/ice_ptp.h+25−14

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

drivers/net/ethernet/intel/ice/ice_ptp_hw.c+166−182

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

drivers/net/ethernet/intel/ice/ice_ptp_hw.h+6−2

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

drivers/net/ethernet/intel/ice/ice_repr.c+25−15

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

drivers/net/ethernet/intel/ice/ice_sched.c+93−11

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

drivers/net/ethernet/intel/ice/ice_sched.h+30−1

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

drivers/net/ethernet/intel/ice/ice_tc_lib.c+251−100

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

drivers/net/ethernet/intel/ice/ice_tc_lib.h+32−8

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

drivers/net/ethernet/intel/ice/ice_txrx.c+26−14

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

drivers/net/ethernet/intel/ice/ice_txrx.h+12−6

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

drivers/net/ethernet/intel/ice/ice_txrx_lib.c+1−1

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

drivers/net/ethernet/intel/ice/ice_type.h+9−0

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

drivers/net/ethernet/intel/ice/ice_vf_lib.c+24−0

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

drivers/net/ethernet/intel/ice/ice_vf_lib_private.h+1−0

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

drivers/net/ethernet/intel/ice/ice_vf_mbx.c+24−68

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

drivers/net/ethernet/intel/ice/ice_virtchnl.c+195−0

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

drivers/net/ethernet/intel/ice/ice_virtchnl.h+4−0

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

drivers/net/ethernet/intel/ice/ice_virtchnl_allowlist.c+6−0

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

drivers/net/ethernet/intel/ice/ice_xsk.c+18−7

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

drivers/net/ethernet/intel/igb/igb_ethtool.c+6−6

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

drivers/net/ethernet/intel/igb/igb_main.c+11−7

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

drivers/net/ethernet/intel/igb/igb_ptp.c+2−16

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

drivers/net/ethernet/intel/igc/igc_defines.h+9−0

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

drivers/net/ethernet/intel/igc/igc_ethtool.c+6−6

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

drivers/net/ethernet/intel/igc/igc_main.c+11−4

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

drivers/net/ethernet/intel/igc/igc_regs.h+1−0

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

drivers/net/ethernet/intel/igc/igc_tsn.c+30−0

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

drivers/net/ethernet/intel/igc/igc_tsn.h+1−0

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

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

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

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c+46−15

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

drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c+5−0

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

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+4−4

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

drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c+5−21

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

drivers/net/ethernet/intel/ixgbevf/ethtool.c+6−6

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

drivers/net/ethernet/intel/ixgbevf/ipsec.c+5−0

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

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c+16−9

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

drivers/net/ethernet/marvell/mv643xx_eth.c+42−7

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

drivers/net/ethernet/marvell/mvneta.c+5−8

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

drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c+11−5

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

drivers/net/ethernet/marvell/octeon_ep/octep_main.c+17−3

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

drivers/net/ethernet/marvell/octeon_ep/octep_main.h+2−0

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

drivers/net/ethernet/marvell/octeontx2/af/cgx.c+50−28

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

drivers/net/ethernet/marvell/octeontx2/af/cgx.h+3−6

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

drivers/net/ethernet/marvell/octeontx2/af/lmac_common.h+13−2

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

drivers/net/ethernet/marvell/octeontx2/af/mbox.h+18−0

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

drivers/net/ethernet/marvell/octeontx2/af/mcs.c+5−1

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

drivers/net/ethernet/marvell/octeontx2/af/npc.h+3−0

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

drivers/net/ethernet/marvell/octeontx2/af/rpm.c+239−23

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

drivers/net/ethernet/marvell/octeontx2/af/rpm.h+35−1

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

drivers/net/ethernet/marvell/octeontx2/af/rvu.h+10−3

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_cgx.c+34−15

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_debugfs.c+15−1

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c+0−7

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_nix.c+7−3

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc.c+22−0

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_fs.c+126−25

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

drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c+11−10

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h+3−0

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_devlink.c+0−15

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c+34−0

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c+46−6

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c+1−1

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

drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c+25−0

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

drivers/net/ethernet/marvell/prestera/prestera_devlink.c+0−22

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

drivers/net/ethernet/marvell/prestera/prestera_devlink.h+0−5

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

drivers/net/ethernet/marvell/prestera/prestera_main.c+5−16

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

drivers/net/ethernet/marvell/prestera/prestera_pci.c+105−14

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

drivers/net/ethernet/marvell/sky2.c+4−4

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

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

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

drivers/net/ethernet/mediatek/mtk_eth_soc.c+390−114

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

drivers/net/ethernet/mediatek/mtk_eth_soc.h+47−12

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

drivers/net/ethernet/mediatek/mtk_ppe.c+21−1

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

drivers/net/ethernet/mediatek/mtk_ppe.h+4−0

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

drivers/net/ethernet/mediatek/mtk_ppe_offload.c+9−3

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

drivers/net/ethernet/mediatek/mtk_sgmii.c+100−74

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

drivers/net/ethernet/mediatek/mtk_wed.c+763−100

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

drivers/net/ethernet/mediatek/mtk_wed.h+21−0

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

drivers/net/ethernet/mediatek/mtk_wed_debugfs.c+87−0

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

drivers/net/ethernet/mediatek/mtk_wed_mcu.c+390−0

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

drivers/net/ethernet/mediatek/mtk_wed_regs.h+138−2

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

drivers/net/ethernet/mediatek/mtk_wed_wo.c+512−0

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

drivers/net/ethernet/mediatek/mtk_wed_wo.h+282−0

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

drivers/net/ethernet/mellanox/mlx4/en_clock.c+11−18

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

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

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

drivers/net/ethernet/mellanox/mlx4/en_tx.c+10−8

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

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

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

drivers/net/ethernet/mellanox/mlx4/mlx4_en.h+13−5

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

drivers/net/ethernet/mellanox/mlx5/core/Makefile+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/cmd.c+0−1

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

drivers/net/ethernet/mellanox/mlx5/core/devlink.c+6−13

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

drivers/net/ethernet/mellanox/mlx5/core/devlink.h+2−0

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

drivers/net/ethernet/mellanox/mlx5/core/diag/fs_tracepoint.c+16−0

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

drivers/net/ethernet/mellanox/mlx5/core/en.h+7−4

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

drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c+0−17

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

drivers/net/ethernet/mellanox/mlx5/core/en/devlink.h+0−2

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

drivers/net/ethernet/mellanox/mlx5/core/en/fs.h+2−1

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

drivers/net/ethernet/mellanox/mlx5/core/en/params.c+6−10

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

drivers/net/ethernet/mellanox/mlx5/core/en/params.h+14−0

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

drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c+0−1

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/accept.c+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.c+1−1

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/act.h+12−0

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/drop.c+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/goto.c+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred.c+7−0

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/mirred_nic.c+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/police.c+74−12

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/act/trap.c+2−8

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.c+24−16

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/meter.h+3−2

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c+326−76

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.h+36−3

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c+56−33

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

drivers/net/ethernet/mellanox/mlx5/core/en/tc_priv.h+0−4

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c+277−94

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.h+103−34

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_fs.c+764−305

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c+297−6

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c+13−9

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_stats.c+52−0

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c+26−39

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

drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec.c+6−6

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

drivers/net/ethernet/mellanox/mlx5/core/en_arfs.c+0−2

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

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/en_main.c+19−10

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

drivers/net/ethernet/mellanox/mlx5/core/en_rep.c+85−63

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

drivers/net/ethernet/mellanox/mlx5/core/en_rx.c+145−26

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

drivers/net/ethernet/mellanox/mlx5/core/en_stats.c+18−0

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

drivers/net/ethernet/mellanox/mlx5/core/en_stats.h+19−0

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

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c+328−117

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

drivers/net/ethernet/mellanox/mlx5/core/en_tc.h+7−2

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

drivers/net/ethernet/mellanox/mlx5/core/eq.c+5−0

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

drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c+4−4

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

drivers/net/ethernet/mellanox/mlx5/core/esw/debugfs.c+19−3

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

drivers/net/ethernet/mellanox/mlx5/core/esw/devlink_port.c+2−2

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch.c+43−0

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch.h+15−1

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c+253−17

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

drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c+28−4

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

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c+15−5

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

drivers/net/ethernet/mellanox/mlx5/core/fs_core.h+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib.c+6−1

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

drivers/net/ethernet/mellanox/mlx5/core/ipoib/ipoib_vlan.c+5−1

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

drivers/net/ethernet/mellanox/mlx5/core/lag/mp.c+48−31

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

drivers/net/ethernet/mellanox/mlx5/core/lib/aso.c+5−5

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

drivers/net/ethernet/mellanox/mlx5/core/lib/aso.h+3−1

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

drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c+6−16

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

drivers/net/ethernet/mellanox/mlx5/core/main.c+19−3

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

drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h+4−1

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

drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c+2−1

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_action.c+254−46

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_buddy.c+0−2

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c+84−0

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_dbg.c+28−1

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_definer.c+151−0

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_domain.c+76−20

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c+102−72

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c+77−42

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c+140−1

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.c+19−3

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste.h+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.c+69−0

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v1.h+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_ste_v2.c+1−0

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_table.c+1−1

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

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_types.h+58−1

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

drivers/net/ethernet/mellanox/mlx5/core/steering/fs_dr.c+41−12

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

drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5_ifc_dr_ste_v1.h+35−0

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

drivers/net/ethernet/mellanox/mlx5/core/steering/mlx5dr.h+14−8

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

drivers/net/ethernet/mellanox/mlx5/core/uar.c+0−1

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

drivers/net/ethernet/mellanox/mlx5/core/vport.c+28−2

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

drivers/net/ethernet/mellanox/mlx5/core/wq.h+17−0

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

drivers/net/ethernet/mellanox/mlxsw/core.c+4−21

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

drivers/net/ethernet/mellanox/mlxsw/core.h+3−4

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

drivers/net/ethernet/mellanox/mlxsw/i2c.c+3−3

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

drivers/net/ethernet/mellanox/mlxsw/minimal.c+2−15

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

drivers/net/ethernet/mellanox/mlxsw/reg.h+36−0

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

drivers/net/ethernet/mellanox/mlxsw/spectrum.c+26−16

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

drivers/net/ethernet/mellanox/mlxsw/spectrum.h+4−1

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_ethtool.c+21−0

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.c+47−113

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_ipip.h+1−0

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_ptp.c+3−15

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+85−17

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_router.h+4−0

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c+53−11

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

drivers/net/ethernet/mellanox/mlxsw/spectrum_trap.c+25−0

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

drivers/net/ethernet/mellanox/mlxsw/trap.h+2−0

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

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

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

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

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

drivers/net/ethernet/microchip/lan743x_ethtool.c+153−6

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

drivers/net/ethernet/microchip/lan743x_ethtool.h+70−1

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

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

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

drivers/net/ethernet/microchip/lan743x_main.h+3−0

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

drivers/net/ethernet/microchip/lan743x_ptp.c+6−48

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

drivers/net/ethernet/microchip/lan966x/Kconfig+2−0

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

drivers/net/ethernet/microchip/lan966x/Makefile+6−1

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

drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c+329−104

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

drivers/net/ethernet/microchip/lan966x/lan966x_goto.c+54−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_ifh.h+1−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_main.c+37−5

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

drivers/net/ethernet/microchip/lan966x/lan966x_main.h+91−4

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

drivers/net/ethernet/microchip/lan966x/lan966x_phylink.c+0−2

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

drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c+227−7

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

drivers/net/ethernet/microchip/lan966x/lan966x_regs.h+196−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_tc.c+2−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_tc_flower.c+254−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_tc_matchall.c+6−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_vcap_ag_api.c+1608−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_vcap_ag_api.h+11−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c+549−0

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

drivers/net/ethernet/microchip/lan966x/lan966x_xdp.c+140−0

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

drivers/net/ethernet/microchip/sparx5/Kconfig+12−0

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

drivers/net/ethernet/microchip/sparx5/Makefile+9−2

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

drivers/net/ethernet/microchip/sparx5/sparx5_dcb.c+310−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_main.c+12−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_main.h+20−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_main_regs.h+581−2

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

drivers/net/ethernet/microchip/sparx5/sparx5_phylink.c+0−1

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

drivers/net/ethernet/microchip/sparx5/sparx5_port.c+99−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_port.h+42−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_qos.c+4−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_tc.c+51−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_tc.h+19−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c+1016−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_tc_matchall.c+97−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_vcap_ag_api.c+1351−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_vcap_ag_api.h+18−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_vcap_debugfs.c+200−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_vcap_debugfs.h+33−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.c+723−0

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

drivers/net/ethernet/microchip/sparx5/sparx5_vcap_impl.h+81−0

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

drivers/net/ethernet/microchip/vcap/Kconfig+53−0

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

drivers/net/ethernet/microchip/vcap/Makefile+10−0

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

drivers/net/ethernet/microchip/vcap/vcap_ag_api.h+735−0

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

drivers/net/ethernet/microchip/vcap/vcap_api.c+2883−0

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

drivers/net/ethernet/microchip/vcap/vcap_api.h+280−0

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

drivers/net/ethernet/microchip/vcap/vcap_api_client.h+265−0

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

drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c+431−0

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

drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.h+41−0

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

drivers/net/ethernet/microchip/vcap/vcap_api_debugfs_kunit.c+555−0

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

drivers/net/ethernet/microchip/vcap/vcap_api_kunit.c+2245−0

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

drivers/net/ethernet/microchip/vcap/vcap_api_private.h+113−0

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

drivers/net/ethernet/microchip/vcap/vcap_model_kunit.c+5570−0

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

drivers/net/ethernet/microchip/vcap/vcap_model_kunit.h+10−0

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

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

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

drivers/net/ethernet/microsoft/mana/gdma_main.c+56−14

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

drivers/net/ethernet/microsoft/mana/hw_channel.c+3−3

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

drivers/net/ethernet/microsoft/mana/mana_bpf.c+1−1

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

drivers/net/ethernet/microsoft/mana/mana_en.c+160−25

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

drivers/net/ethernet/microsoft/mana/mana_ethtool.c+5−5

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

drivers/net/ethernet/microsoft/mana/shm_channel.c+1−1

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

drivers/net/ethernet/mscc/ocelot.c+2−4

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

drivers/net/ethernet/mscc/ocelot_net.c+1−11

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

drivers/net/ethernet/mscc/ocelot_stats.c+235−9

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

drivers/net/ethernet/mscc/ocelot_vsc7514.c+0−14

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

drivers/net/ethernet/myricom/myri10ge/myri10ge.c+1−2

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

drivers/net/ethernet/neterion/s2io.c+1−1

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

drivers/net/ethernet/netronome/Kconfig+11−0

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

drivers/net/ethernet/netronome/nfp/Makefile+2−0

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

drivers/net/ethernet/netronome/nfp/ccm_mbox.c+1−1

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

drivers/net/ethernet/netronome/nfp/crypto/crypto.h+23−0

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

drivers/net/ethernet/netronome/nfp/crypto/ipsec.c+592−0

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

drivers/net/ethernet/netronome/nfp/flower/lag_conf.c+41−11

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

drivers/net/ethernet/netronome/nfp/flower/main.c+9−0

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

drivers/net/ethernet/netronome/nfp/flower/main.h+20−1

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

drivers/net/ethernet/netronome/nfp/flower/tunnel_conf.c+44−9

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

drivers/net/ethernet/netronome/nfp/nfd3/dp.c+48−10

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

drivers/net/ethernet/netronome/nfp/nfd3/ipsec.c+18−0

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

drivers/net/ethernet/netronome/nfp/nfd3/nfd3.h+8−0

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

drivers/net/ethernet/netronome/nfp/nfp_app.h+0−2

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

drivers/net/ethernet/netronome/nfp/nfp_devlink.c+2−25

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

drivers/net/ethernet/netronome/nfp/nfp_main.h+1−1

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

drivers/net/ethernet/netronome/nfp/nfp_net.h+16−0

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

drivers/net/ethernet/netronome/nfp/nfp_net_common.c+76−13

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

drivers/net/ethernet/netronome/nfp/nfp_net_ctrl.h+32−5

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

drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c+77−4

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

drivers/net/ethernet/netronome/nfp/nfp_net_main.c+2−10

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

drivers/net/ethernet/netronome/nfp/nfp_net_repr.c+2−3

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

drivers/net/ethernet/netronome/nfp/nfp_port.h+0−2

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

drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.c+17−0

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

drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h+56−0

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

drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp_eth.c+26−0

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

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

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

drivers/net/ethernet/pensando/ionic/ionic_dev.c+14−0

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

drivers/net/ethernet/pensando/ionic/ionic_dev.h+3−0

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

drivers/net/ethernet/pensando/ionic/ionic_devlink.c+1−5

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

drivers/net/ethernet/pensando/ionic/ionic_if.h+44−1

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

drivers/net/ethernet/pensando/ionic/ionic_lif.c+96−17

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

drivers/net/ethernet/pensando/ionic/ionic_main.c+1−1

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

drivers/net/ethernet/pensando/ionic/ionic_txrx.c+18−13

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

drivers/net/ethernet/qlogic/qed/qed_debug.c+2−1

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

drivers/net/ethernet/qlogic/qed/qed_devlink.c+0−4

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

drivers/net/ethernet/qlogic/qed/qed_ll2.c+1−1

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

drivers/net/ethernet/qlogic/qede/qede_ptp.c+8−5

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

drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c+1−1

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

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

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

drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c+2−2

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

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

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

drivers/net/ethernet/realtek/r8169_main.c+6−3

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

drivers/net/ethernet/renesas/Kconfig+12−0

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

drivers/net/ethernet/renesas/Makefile+4−0

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

drivers/net/ethernet/renesas/ravb_ptp.c+5−12

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

drivers/net/ethernet/renesas/rcar_gen4_ptp.c+181−0

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

drivers/net/ethernet/renesas/rcar_gen4_ptp.h+72−0

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

drivers/net/ethernet/renesas/rswitch.c+1841−0

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

drivers/net/ethernet/renesas/rswitch.h+973−0

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

drivers/net/ethernet/rocker/rocker_ofdpa.c+8−7

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

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

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

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

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

drivers/net/ethernet/sfc/ef100_rx.c+19−4

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

drivers/net/ethernet/sfc/ef100_tx.c+2−1

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

drivers/net/ethernet/sfc/efx_channels.c+8−1

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

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

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

drivers/net/ethernet/sfc/ethtool_common.c+0−37

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

drivers/net/ethernet/sfc/ethtool_common.h+0−2

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

drivers/net/ethernet/sfc/mae.c+301−5

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

drivers/net/ethernet/sfc/mae.h+7−0

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

drivers/net/ethernet/sfc/mae_counter_format.h+73−0

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

drivers/net/ethernet/sfc/mcdi.h+17−0

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

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

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

drivers/net/ethernet/sfc/ptp.c+4−3

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

drivers/net/ethernet/sfc/rx_common.c+3−0

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

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

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

drivers/net/ethernet/sfc/siena/ptp.c+4−3

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

drivers/net/ethernet/sfc/tc.c+267−35

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

drivers/net/ethernet/sfc/tc.h+31−17

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

drivers/net/ethernet/sfc/tc_counters.c+503−0

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

drivers/net/ethernet/sfc/tc_counters.h+59−0

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

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

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

drivers/net/ethernet/smsc/Kconfig+0−14

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

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

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

drivers/net/ethernet/smsc/smc911x.c+0−2198

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

drivers/net/ethernet/smsc/smc911x.h+0−901

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

drivers/net/ethernet/socionext/sni_ave.c+4−10

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

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

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

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

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

drivers/net/ethernet/stmicro/stmmac/dwmac-tegra.c+388−0

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

drivers/net/ethernet/stmicro/stmmac/dwmac4.h+1−3

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

drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c+6−15

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

drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c+2−1

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

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c+7−4

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

drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c+7−16

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

drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.h+1−1

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

drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c+6−2

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

drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c+3−0

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

drivers/net/ethernet/sun/cassini.c+15−33

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

drivers/net/ethernet/sun/sunvnet_common.c+2−2

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

drivers/net/ethernet/ti/am65-cpsw-nuss.c+199−67

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

drivers/net/ethernet/ti/am65-cpsw-nuss.h+6−0

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

drivers/net/ethernet/ti/am65-cpts.c+79−2

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

drivers/net/ethernet/ti/am65-cpts.h+10−0

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

drivers/net/ethernet/ti/cpsw_ale.c+10−0

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

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

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

drivers/net/ethernet/ti/cpts.c+4−16

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

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

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

drivers/net/ethernet/via/via-rhine.c+4−4

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

drivers/net/ethernet/wangxun/Kconfig+7−0

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

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

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

drivers/net/ethernet/wangxun/libwx/Makefile+7−0

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

drivers/net/ethernet/wangxun/libwx/wx_hw.c+936−0

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

drivers/net/ethernet/wangxun/libwx/wx_hw.h+28−0

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

drivers/net/ethernet/wangxun/libwx/wx_type.h+352−0

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

drivers/net/ethernet/wangxun/ngbe/Makefile+1−1

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

drivers/net/ethernet/wangxun/ngbe/ngbe.h+55−0

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

drivers/net/ethernet/wangxun/ngbe/ngbe_hw.c+87−0

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

drivers/net/ethernet/wangxun/ngbe/ngbe_hw.h+12−0

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

drivers/net/ethernet/wangxun/ngbe/ngbe_main.c+368−0

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

drivers/net/ethernet/wangxun/ngbe/ngbe_type.h+94−5

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

drivers/net/ethernet/wangxun/txgbe/Makefile+2−1

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

drivers/net/ethernet/wangxun/txgbe/txgbe.h+21−2

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

drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c+312−0

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

drivers/net/ethernet/wangxun/txgbe/txgbe_hw.h+11−0

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

drivers/net/ethernet/wangxun/txgbe/txgbe_main.c+464−1

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

drivers/net/ethernet/wangxun/txgbe/txgbe_type.h+32−15

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

drivers/net/ethernet/xilinx/xilinx_axienet.h+0−2

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

drivers/net/ethernet/xilinx/xilinx_axienet_main.c+40−5

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

drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c+48−31

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

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

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

drivers/net/ethernet/xscale/ptp_ixp46x.c+4−15

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

drivers/net/fddi/defxx.c+18−4

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

drivers/net/geneve.c+1−1

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

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

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

drivers/net/hamradio/scc.c+3−3

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

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

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

drivers/net/ieee802154/atusb.c+28−5

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

drivers/net/ieee802154/mac802154_hwsim.c+172−7

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

drivers/net/ieee802154/mcr20a.c+3−6

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

drivers/net/ifb.c+6−6

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

drivers/net/ipa/Makefile+1−1

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

drivers/net/ipa/data/ipa_data-v3.1.c+10−9

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

drivers/net/ipa/data/ipa_data-v3.5.1.c+14−13

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

drivers/net/ipa/data/ipa_data-v4.11.c+9−8

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

drivers/net/ipa/data/ipa_data-v4.2.c+9−8

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

drivers/net/ipa/data/ipa_data-v4.5.c+9−8

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

drivers/net/ipa/data/ipa_data-v4.7.c+405−0

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

drivers/net/ipa/data/ipa_data-v4.9.c+9−8

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

drivers/net/ipa/gsi_trans.c+5−2

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

drivers/net/ipa/ipa.h+21−11

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

drivers/net/ipa/ipa_cmd.c+25−49

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

drivers/net/ipa/ipa_cmd.h+13−3

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

drivers/net/ipa/ipa_data.h+3−0

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

drivers/net/ipa/ipa_endpoint.c+160−117

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

drivers/net/ipa/ipa_endpoint.h+1−1

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

drivers/net/ipa/ipa_interrupt.c+22−12

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

drivers/net/ipa/ipa_main.c+90−22

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

drivers/net/ipa/ipa_mem.c+10−9

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

drivers/net/ipa/ipa_qmi.c+5−4

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

drivers/net/ipa/ipa_qmi_msg.c+10−10

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

drivers/net/ipa/ipa_qmi_msg.h+10−10

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

drivers/net/ipa/ipa_reg.c+2−0

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

drivers/net/ipa/ipa_reg.h+1−0

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

drivers/net/ipa/ipa_sysfs.c+3−3

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

drivers/net/ipa/ipa_table.c+196−154

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

drivers/net/ipa/ipa_table.h+10−20

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

drivers/net/ipa/ipa_version.h+4−0

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

drivers/net/ipa/reg/ipa_reg-v3.1.c+8−5

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

drivers/net/ipa/reg/ipa_reg-v3.5.1.c+8−5

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

drivers/net/ipa/reg/ipa_reg-v4.11.c+8−5

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

drivers/net/ipa/reg/ipa_reg-v4.2.c+8−5

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

drivers/net/ipa/reg/ipa_reg-v4.5.c+8−5

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

drivers/net/ipa/reg/ipa_reg-v4.7.c+507−0

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

drivers/net/ipa/reg/ipa_reg-v4.9.c+8−5

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

drivers/net/ipvlan/ipvlan_main.c+2−2

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

drivers/net/loopback.c+2−2

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

drivers/net/macsec.c+6−6

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

drivers/net/macvlan.c+2−2

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

drivers/net/mhi_net.c+4−4

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

drivers/net/netdevsim/dev.c+1−6

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

drivers/net/netdevsim/ipsec.c+5−0

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

drivers/net/netdevsim/netdev.c+3−11

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

drivers/net/ntb_netdev.c+2−2

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

drivers/net/pcs/pcs-altera-tse.c+3−18

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

drivers/net/pcs/pcs-xpcs.c+2−8

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

drivers/net/phy/Kconfig+1−4

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

drivers/net/phy/aquantia_main.c+40−0

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

drivers/net/phy/dp83822.c+2−0

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

drivers/net/phy/dp83867.c+7−0

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

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

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

drivers/net/phy/motorcomm.c+1675−2

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

drivers/net/phy/mscc/mscc_macsec.c+30−27

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

drivers/net/phy/mscc/mscc_macsec.h+0−2

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

drivers/net/phy/mxl-gpy.c+94−12

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

drivers/net/phy/phy-core.c+10−1

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

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

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

drivers/net/phy/phy_device.c+12−0

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

drivers/net/phy/phylink.c+31−12

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

drivers/net/phy/sfp.c+85−77

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

drivers/net/ppp/ppp_generic.c+2−0

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

drivers/net/tap.c+8−2

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

drivers/net/team/team.c+4−2

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

drivers/net/team/team_mode_loadbalance.c+2−2

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

drivers/net/thunderbolt.c+12−14

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

drivers/net/tun.c+37−38

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

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

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

drivers/net/usb/cdc_ether.c+6−0

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

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

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

drivers/net/usb/qmi_wwan.c+3−2

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

drivers/net/veth.c+7−7

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

drivers/net/virtio_net.c+23−12

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

drivers/net/vrf.c+2−2

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

drivers/net/vxlan/vxlan_core.c+2−2

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

drivers/net/vxlan/vxlan_vnifilter.c+2−2

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

drivers/net/wan/farsync.c+2−0

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

drivers/net/wireless/admtek/adm8211.c+1−0

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

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

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

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

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

drivers/net/wireless/ath/ath10k/core.c+16−0

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

drivers/net/wireless/ath/ath10k/debug.c+3−2

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

drivers/net/wireless/ath/ath10k/htc.c+9−0

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

drivers/net/wireless/ath/ath10k/htt.h+4−2

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

drivers/net/wireless/ath/ath10k/htt_rx.c+10−15

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

drivers/net/wireless/ath/ath10k/hw.h+2−0

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

drivers/net/wireless/ath/ath10k/pci.c+12−8

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

drivers/net/wireless/ath/ath10k/qmi.c+36−1

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

drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.c+63−63

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

drivers/net/wireless/ath/ath10k/qmi_wlfw_v01.h+51−51

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

drivers/net/wireless/ath/ath10k/wmi-tlv.c+7−0

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

drivers/net/wireless/ath/ath11k/core.c+11−4

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

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

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

drivers/net/wireless/ath/ath11k/hw.h+1−0

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

drivers/net/wireless/ath/ath11k/mac.c+162−70

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

drivers/net/wireless/ath/ath11k/mac.h+1−1

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

drivers/net/wireless/ath/ath11k/pcic.c+10−3

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

drivers/net/wireless/ath/ath11k/qmi.c+48−39

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

drivers/net/wireless/ath/ath11k/wmi.c+1−1

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

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

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

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

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

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

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

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

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

drivers/net/wireless/ath/ath9k/hif_usb.c+29−17

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

drivers/net/wireless/ath/ath9k/htc_drv_main.c+1−0

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

drivers/net/wireless/ath/ath9k/mci.c+6−2

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

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

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

drivers/net/wireless/ath/ath9k/xmit.c+0−2

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

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

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

drivers/net/wireless/ath/carl9170/fwcmd.h+2−2

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

drivers/net/wireless/ath/carl9170/main.c+1−0

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

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

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

drivers/net/wireless/ath/wcn36xx/main.c+1−0

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

drivers/net/wireless/ath/wil6210/debugfs.c+6−30

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

drivers/net/wireless/atmel/at76c50x-usb.c+1−0

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

drivers/net/wireless/atmel/atmel.c+79−83

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

drivers/net/wireless/broadcom/b43/main.c+4−7

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

drivers/net/wireless/broadcom/b43legacy/main.c+1−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/Makefile+11−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/Makefile+12−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/core.c+27−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/module.c+27−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bca/vops.h+11−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c+28−24

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h+35−1

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c+558−29

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c+10−5

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c+13−2

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.h+9−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/Makefile+12−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c+27−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/module.c+27−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/vops.h+11−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c+2−1

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.h+3−1

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c+5−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwil_types.h+2−2

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.c+199−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/fwvid.h+47−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c+6−2

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c+177−34

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/pno.c+3−3

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c+13−4

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

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

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/Makefile+12−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/core.c+27−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/module.c+27−0

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

drivers/net/wireless/broadcom/brcm80211/brcmfmac/wcc/vops.h+11−0

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

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

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

drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c+1−0

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

drivers/net/wireless/cisco/airo.c+108−96

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

drivers/net/wireless/intel/ipw2x00/ipw2100.c+0−11

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

drivers/net/wireless/intel/ipw2x00/ipw2200.c+1−15

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

drivers/net/wireless/intel/iwlegacy/3945-mac.c+1−6

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

drivers/net/wireless/intel/iwlegacy/4965-mac.c+1−0

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

drivers/net/wireless/intel/iwlwifi/cfg/22000.c+32−4

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

drivers/net/wireless/intel/iwlwifi/dvm/mac80211.c+1−0

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

drivers/net/wireless/intel/iwlwifi/fw/api/datapath.h+89−6

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

drivers/net/wireless/intel/iwlwifi/fw/api/mac.h+3−3

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

drivers/net/wireless/intel/iwlwifi/fw/api/phy-ctxt.h+16−17

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

drivers/net/wireless/intel/iwlwifi/fw/api/rs.h+4−6

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

drivers/net/wireless/intel/iwlwifi/fw/dump.c+4−3

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

drivers/net/wireless/intel/iwlwifi/fw/rs.c+2−0

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

drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c+5−2

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

drivers/net/wireless/intel/iwlwifi/iwl-drv.c+3−0

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

drivers/net/wireless/intel/iwlwifi/iwl-eeprom-parse.h+2−1

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

drivers/net/wireless/intel/iwlwifi/iwl-modparams.h+1−0

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

drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c+210−27

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

drivers/net/wireless/intel/iwlwifi/iwl-prph.h+5−0

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

drivers/net/wireless/intel/iwlwifi/iwl-trans.h+5−0

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

drivers/net/wireless/intel/iwlwifi/mei/iwl-mei.h+30−6

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

drivers/net/wireless/intel/iwlwifi/mei/main.c+217−87

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

drivers/net/wireless/intel/iwlwifi/mei/net.c+7−3

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

drivers/net/wireless/intel/iwlwifi/mei/sap.h+59−6

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

drivers/net/wireless/intel/iwlwifi/mei/trace-data.h+1−1

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

drivers/net/wireless/intel/iwlwifi/mei/trace.h+1−1

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

drivers/net/wireless/intel/iwlwifi/mvm/Makefile+1−0

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

drivers/net/wireless/intel/iwlwifi/mvm/d3.c+7−2

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

drivers/net/wireless/intel/iwlwifi/mvm/debugfs.c+2−2

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

drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c+5−7

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

drivers/net/wireless/intel/iwlwifi/mvm/fw.c+35−3

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

drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c+52−8

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

drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c+182−30

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

drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c+226−0

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

drivers/net/wireless/intel/iwlwifi/mvm/mvm.h+18−3

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

drivers/net/wireless/intel/iwlwifi/mvm/ops.c+19−6

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

drivers/net/wireless/intel/iwlwifi/mvm/phy-ctxt.c+27−27

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

drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c+123−2

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

drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c+25−21

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

drivers/net/wireless/intel/iwlwifi/mvm/sta.c+19−10

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

drivers/net/wireless/intel/iwlwifi/mvm/time-event.c+3−4

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

drivers/net/wireless/intel/iwlwifi/mvm/tx.c+23−4

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

drivers/net/wireless/intel/iwlwifi/pcie/drv.c+23−10

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

drivers/net/wireless/intel/iwlwifi/pcie/trans.c+47−38

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

drivers/net/wireless/intersil/hostap/hostap_ioctl.c+133−111

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

drivers/net/wireless/intersil/orinoco/wext.c+73−58

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

drivers/net/wireless/intersil/p54/eeprom.h+2−2

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

drivers/net/wireless/intersil/p54/main.c+1−0

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

drivers/net/wireless/mac80211_hwsim.c+1−0

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

drivers/net/wireless/marvell/libertas_tf/main.c+1−0

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

drivers/net/wireless/marvell/mwifiex/debugfs.c+1−1

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

drivers/net/wireless/marvell/mwifiex/main.h+1−0

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

drivers/net/wireless/marvell/mwl8k.c+1−0

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

drivers/net/wireless/mediatek/mt76/Kconfig+1−0

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

drivers/net/wireless/mediatek/mt76/Makefile+1−0

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

drivers/net/wireless/mediatek/mt76/debugfs.c+0−19

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

drivers/net/wireless/mediatek/mt76/dma.c+195−51

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

drivers/net/wireless/mediatek/mt76/dma.h+8−0

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

drivers/net/wireless/mediatek/mt76/mac80211.c+19−8

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

drivers/net/wireless/mediatek/mt76/mt76.h+30−20

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

drivers/net/wireless/mediatek/mt76/mt7603/debugfs.c+1−1

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

drivers/net/wireless/mediatek/mt76/mt7603/dma.c+1−1

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

drivers/net/wireless/mediatek/mt76/mt7603/mac.c+3−3

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

drivers/net/wireless/mediatek/mt76/mt7603/mt7603.h+1−1

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

drivers/net/wireless/mediatek/mt76/mt7615/debugfs.c+2−4

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

drivers/net/wireless/mediatek/mt76/mt7615/mac.c+23−11

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

drivers/net/wireless/mediatek/mt76/mt7615/main.c+5−2

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

drivers/net/wireless/mediatek/mt76/mt7615/mcu.c+1−1

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

drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h+4−2

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

drivers/net/wireless/mediatek/mt76/mt7615/regs.h+2−0

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

drivers/net/wireless/mediatek/mt76/mt76_connac.h+16−0

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

drivers/net/wireless/mediatek/mt76/mt76_connac_mac.c+13−4

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

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c+145−69

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

drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.h+89−10

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

drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c+8−20

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

drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.h+1−1

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

drivers/net/wireless/mediatek/mt76/mt76x0/init.c+1−1

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

drivers/net/wireless/mediatek/mt76/mt76x0/phy.c+5−8

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

drivers/net/wireless/mediatek/mt76/mt76x02.h+15−1

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

drivers/net/wireless/mediatek/mt76/mt76x02_debugfs.c+18−1

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

drivers/net/wireless/mediatek/mt76/mt76x02_eeprom.h+0−2

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

drivers/net/wireless/mediatek/mt76/mt76x02_mac.c+3−3

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

drivers/net/wireless/mediatek/mt76/mt76x02_phy.c+11−11

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

drivers/net/wireless/mediatek/mt76/mt76x02_phy.h+3−3

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

drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c+7−7

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

drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.c+2−14

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

drivers/net/wireless/mediatek/mt76/mt76x2/eeprom.h+1−1

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

drivers/net/wireless/mediatek/mt76/mt76x2/init.c+1−1

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

drivers/net/wireless/mediatek/mt76/mt76x2/phy.c+3−3

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

drivers/net/wireless/mediatek/mt76/mt7915/Kconfig+1−0

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

drivers/net/wireless/mediatek/mt76/mt7915/Makefile+2−1

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

drivers/net/wireless/mediatek/mt76/mt7915/coredump.c+410−0

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

drivers/net/wireless/mediatek/mt76/mt7915/coredump.h+136−0

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

drivers/net/wireless/mediatek/mt76/mt7915/debugfs.c+262−45

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

drivers/net/wireless/mediatek/mt76/mt7915/dma.c+167−40

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

drivers/net/wireless/mediatek/mt76/mt7915/eeprom.c+29−37

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

drivers/net/wireless/mediatek/mt76/mt7915/eeprom.h+0−5

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

drivers/net/wireless/mediatek/mt76/mt7915/init.c+94−41

This diff is large: its 318 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7915/mac.c+467−168

This diff is large: its 1074 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7915/main.c+102−40

This diff is large: its 329 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7915/mcu.c+398−97

This diff is large: its 830 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7915/mcu.h+57−3

This diff is large: its 108 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7915/mmio.c+369−45

This diff is large: its 471 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7915/mt7915.h+59−6

This diff is large: its 180 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7915/pci.c+11−95

This diff is large: its 135 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7915/regs.h+86−2

This diff is large: its 181 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7915/soc.c+15−6

This diff is large: its 43 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7915/testmode.c+35−36

This diff is large: its 237 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7921/debugfs.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7921/init.c+89−2

This diff is large: its 137 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7921/mac.c+29−27

This diff is large: its 110 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7921/main.c+228−5

This diff is large: its 295 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7921/mcu.c+143−18

This diff is large: its 210 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7921/mt7921.h+72−2

This diff is large: its 142 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7921/pci.c+51−8

This diff is large: its 112 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7921/sdio.c+27−4

This diff is large: its 61 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7921/usb.c+20−2

This diff is large: its 57 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/Kconfig+12−0

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/Makefile+6−0

This diff is large: its 7 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/debugfs.c+851−0

This diff is large: its 852 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/dma.c+360−0

This diff is large: its 361 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/eeprom.c+229−0

This diff is large: its 230 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/eeprom.h+75−0

This diff is large: its 76 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/init.c+823−0

This diff is large: its 824 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/mac.c+2498−0

This diff is large: its 2499 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/mac.h+398−0

This diff is large: its 399 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/main.c+1334−0

This diff is large: its 1335 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/mcu.c+3607−0

This diff is large: its 3608 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/mcu.h+669−0

This diff is large: its 670 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/mmio.c+386−0

This diff is large: its 387 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/mt7996.h+523−0

This diff is large: its 524 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/pci.c+222−0

This diff is large: its 223 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/mt7996/regs.h+542−0

This diff is large: its 543 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/sdio.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/tx.c+30−0

This diff is large: its 41 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/usb.c+8−5

This diff is large: its 35 lines aren’t shown here.

drivers/net/wireless/mediatek/mt76/util.h+0−6

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/mediatek/mt7601u/main.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/microchip/wilc1000/sdio.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/purelifi/plfxlc/mac.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/purelifi/plfxlc/usb.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ralink/rt2x00/rt2400pci.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ralink/rt2x00/rt2500pci.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ralink/rt2x00/rt2500usb.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ralink/rt2x00/rt2800pci.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ralink/rt2x00/rt2800soc.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ralink/rt2x00/rt2800usb.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ralink/rt2x00/rt61pci.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ralink/rt2x00/rt73usb.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/realtek/rtl8xxxu/Kconfig+4−3

This diff is large: its 26 lines aren’t shown here.

drivers/net/wireless/realtek/rtl8xxxu/Makefile+1−1

This diff is large: its 6 lines aren’t shown here.

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h+89−8

This diff is large: its 231 lines aren’t shown here.

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188f.c+1766−0

This diff is large: its 1767 lines aren’t shown here.

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192c.c+67−6

This diff is large: its 143 lines aren’t shown here.

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c+131−30

This diff is large: its 342 lines aren’t shown here.

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723a.c+109−5

This diff is large: its 157 lines aren’t shown here.

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8723b.c+86−7

This diff is large: its 169 lines aren’t shown here.

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c+385−298

This diff is large: its 1081 lines aren’t shown here.

drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_regs.h+29−1

This diff is large: its 121 lines aren’t shown here.

drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtc8723b1ant.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/net/wireless/realtek/rtlwifi/core.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c+0−8

This diff is large: its 22 lines aren’t shown here.

drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c+0−3

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/Kconfig+47−0

This diff is large: its 82 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/Makefile+15−0

This diff is large: its 39 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/coex.c+1−2

This diff is large: its 17 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/debug.c+15−0

This diff is large: its 75 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/fw.c+17−14

This diff is large: its 87 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/fw.h+11−0

This diff is large: its 39 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/hci.h+3−6

This diff is large: its 28 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/mac.c+20−1

This diff is large: its 42 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/mac80211.c+1−1

This diff is large: its 10 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/main.c+7−5

This diff is large: its 51 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/main.h+5−7

This diff is large: its 47 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/phy.c+3−3

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/ps.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/reg.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/rtw8723d.c+28−0

This diff is large: its 56 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/rtw8723d.h+12−1

This diff is large: its 27 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/rtw8723du.c+36−0

This diff is large: its 37 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/rtw8821c.c+18−0

This diff is large: its 53 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/rtw8821c.h+21−0

This diff is large: its 35 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/rtw8821cu.c+50−0

This diff is large: its 51 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/rtw8822b.c+19−0

This diff is large: its 47 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/rtw8822bu.c+90−0

This diff is large: its 91 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/rtw8822c.c+24−0

This diff is large: its 59 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/rtw8822cu.c+44−0

This diff is large: its 45 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/tx.h+31−0

This diff is large: its 43 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/usb.c+911−0

This diff is large: its 912 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/usb.h+107−0

This diff is large: its 108 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/util.c+103−0

This diff is large: its 107 lines aren’t shown here.

drivers/net/wireless/realtek/rtw88/util.h+9−3

This diff is large: its 26 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/Kconfig+14−0

This diff is large: its 28 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/Makefile+11−0

This diff is large: its 25 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/chan.c+36−4

This diff is large: its 88 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/coex.c+7−2

This diff is large: its 21 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/core.c+95−7

This diff is large: its 277 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/core.h+227−11

This diff is large: its 511 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/debug.c+961−91

This diff is large: its 1227 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/debug.h+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/fw.c+758−32

This diff is large: its 970 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/fw.h+728−3

This diff is large: its 824 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/mac.c+645−125

This diff is large: its 1007 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/mac.h+120−0

This diff is large: its 218 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/mac80211.c+69−1

This diff is large: its 130 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/pci.c+37−4

This diff is large: its 87 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/pci.h+12−0

This diff is large: its 19 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/phy.c+342−16

This diff is large: its 520 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/phy.h+73−14

This diff is large: its 139 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/ps.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/ps.h+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/reg.h+461−5

This diff is large: its 993 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852a.c+24−155

This diff is large: its 244 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852a.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852b.c+2444−1

This diff is large: its 2475 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852b.h+137−0

This diff is large: its 138 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.c+4174−0

This diff is large: its 4175 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852b_rfk.h+25−0

This diff is large: its 26 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852b_rfk_table.c+794−0

This diff is large: its 795 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852b_rfk_table.h+62−0

This diff is large: its 63 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852b_table.c+22877−0

This diff is large: its 22878 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852b_table.h+30−0

This diff is large: its 31 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852be.c+64−0

This diff is large: its 83 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852c.c+29−203

This diff is large: its 345 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852c.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852c_rfk.c+12−13

This diff is large: its 71 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/rtw8852c_table.c+879−109

This diff is large: its 1424 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/txrx.h+3−1

This diff is large: its 11 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/util.h+11−0

This diff is large: its 16 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/wow.c+859−0

This diff is large: its 860 lines aren’t shown here.

drivers/net/wireless/realtek/rtw89/wow.h+21−0

This diff is large: its 22 lines aren’t shown here.

drivers/net/wireless/rsi/rsi_91x_core.c+3−1

This diff is large: its 11 lines aren’t shown here.

drivers/net/wireless/rsi/rsi_91x_hal.c+5−1

This diff is large: its 26 lines aren’t shown here.

drivers/net/wireless/rsi/rsi_91x_mac80211.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/silabs/wfx/main.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/st/cw1200/main.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ti/Kconfig+0−8

This diff is large: its 13 lines aren’t shown here.

drivers/net/wireless/ti/wilink_platform_data.c+0−35

This diff is large: its 36 lines aren’t shown here.

drivers/net/wireless/ti/wl1251/main.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ti/wl1251/sdio.c+1−7

This diff is large: its 29 lines aren’t shown here.

drivers/net/wireless/ti/wl1251/spi.c+36−40

This diff is large: its 194 lines aren’t shown here.

drivers/net/wireless/ti/wl1251/wl1251.h+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ti/wlcore/main.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/ti/wlcore/spi.c+0−1

This diff is large: its 8 lines aren’t shown here.

drivers/net/wireless/zydas/zd1201.c+89−85

This diff is large: its 419 lines aren’t shown here.

drivers/net/wireless/zydas/zd1211rw/zd_mac.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wwan/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/net/wwan/iosm/iosm_ipc_chnl_cfg.c+1−1

This diff is large: its 9 lines aren’t shown here.

drivers/net/wwan/mhi_wwan_mbim.c+4−4

This diff is large: its 24 lines aren’t shown here.

drivers/net/wwan/t7xx/Makefile+3−0

This diff is large: its 7 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_hif_cldma.c+2−0

This diff is large: its 9 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_hif_dpmaif.h+5−9

This diff is large: its 41 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c+66−152

This diff is large: its 348 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.h+1−0

This diff is large: its 7 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_netdev.c+85−6

This diff is large: its 203 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_netdev.h+5−0

This diff is large: its 19 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_pci.h+3−0

This diff is large: its 10 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_port.h+8−1

This diff is large: its 23 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_port_proxy.c+12−0

This diff is large: its 19 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_port_proxy.h+4−0

This diff is large: its 11 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_port_trace.c+116−0

This diff is large: its 117 lines aren’t shown here.

drivers/net/wwan/t7xx/t7xx_port_wwan.c+8−8

This diff is large: its 40 lines aren’t shown here.

drivers/net/wwan/wwan_core.c+5−1

This diff is large: its 20 lines aren’t shown here.

drivers/net/xen-netfront.c+4−4

This diff is large: its 21 lines aren’t shown here.

drivers/nfc/microread/i2c.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/nfc/nfcmrvl/i2c.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/nfc/nxp-nci/i2c.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/nfc/pn533/i2c.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/nfc/pn544/i2c.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/nfc/s3fwrn5/i2c.c+7−17

This diff is large: its 69 lines aren’t shown here.

drivers/nfc/st-nci/i2c.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/nfc/st21nfca/i2c.c+2−3

This diff is large: its 19 lines aren’t shown here.

drivers/nfc/virtual_ncidev.c+71−76

This diff is large: its 245 lines aren’t shown here.

drivers/ptp/ptp_clock.c+1−4

This diff is large: its 12 lines aren’t shown here.

drivers/ptp/ptp_dte.c+3−2

This diff is large: its 20 lines aren’t shown here.

drivers/ptp/ptp_idt82p33.c+617−92

This diff is large: its 998 lines aren’t shown here.

drivers/ptp/ptp_idt82p33.h+19−2

This diff is large: its 50 lines aren’t shown here.

drivers/ptp/ptp_kvm_common.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/ptp/ptp_ocp.c+515−52

This diff is large: its 779 lines aren’t shown here.

drivers/ptp/ptp_pch.c+4−15

This diff is large: its 37 lines aren’t shown here.

drivers/ptp/ptp_vmw.c+2−2

This diff is large: its 18 lines aren’t shown here.

drivers/s390/net/ctcm_main.c+2−9

This diff is large: its 27 lines aren’t shown here.

drivers/s390/net/lcs.c+3−5

This diff is large: its 22 lines aren’t shown here.

drivers/s390/net/netiucv.c+1−8

This diff is large: its 17 lines aren’t shown here.

drivers/staging/vt6655/device_main.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/staging/vt6656/main_usb.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/usb/core/message.c+1−0

This diff is large: its 8 lines aren’t shown here.

drivers/usb/core/usb.h+0−1

This diff is large: its 8 lines aren’t shown here.

include/linux/avf/virtchnl.h+12−2

This diff is large: its 49 lines aren’t shown here.

include/linux/bcma/bcma_driver_chipcommon.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/linux/bpf.h+236−121

This diff is large: its 637 lines aren’t shown here.

include/linux/bpf_local_storage.h+7−10

This diff is large: its 40 lines aren’t shown here.

include/linux/bpf_lsm.h+6−0

This diff is large: its 20 lines aren’t shown here.

include/linux/bpf_types.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/bpf_verifier.h+53−13

This diff is large: its 143 lines aren’t shown here.

include/linux/btf.h+123−27

This diff is large: its 230 lines aren’t shown here.

include/linux/btf_ids.h+3−1

This diff is large: its 17 lines aren’t shown here.

include/linux/cgroup-defs.h+4−0

This diff is large: its 11 lines aren’t shown here.

include/linux/compiler_types.h+2−1

This diff is large: its 10 lines aren’t shown here.

include/linux/cpuhotplug.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/dsa/8021q.h+1−30

This diff is large: its 46 lines aren’t shown here.

include/linux/ethtool.h+21−4

This diff is large: its 53 lines aren’t shown here.

include/linux/filter.h+10−10

This diff is large: its 59 lines aren’t shown here.

include/linux/ieee80211.h+70−14

This diff is large: its 143 lines aren’t shown here.

include/linux/ieee802154.h+24−0

This diff is large: its 31 lines aren’t shown here.

include/linux/if_bridge.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/if_vlan.h+3−6

This diff is large: its 37 lines aren’t shown here.

include/linux/jump_label.h+17−4

This diff is large: its 39 lines aren’t shown here.

include/linux/mdio.h+13−0

This diff is large: its 20 lines aren’t shown here.

include/linux/mlx5/device.h+9−4

This diff is large: its 27 lines aren’t shown here.

include/linux/mlx5/driver.h+0−2

This diff is large: its 9 lines aren’t shown here.

include/linux/mlx5/fs.h+12−0

This diff is large: its 33 lines aren’t shown here.

include/linux/mlx5/mlx5_ifc.h+121−6

This diff is large: its 192 lines aren’t shown here.

include/linux/mlx5/vport.h+2−0

This diff is large: its 7 lines aren’t shown here.

include/linux/module.h+9−0

This diff is large: its 18 lines aren’t shown here.

include/linux/mv643xx_eth.h+2−0

This diff is large: its 16 lines aren’t shown here.

include/linux/net.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/netdevice.h+64−39

This diff is large: its 225 lines aren’t shown here.

include/linux/netfilter/ipset/ip_set.h+10−0

This diff is large: its 17 lines aren’t shown here.

include/linux/netlink.h+27−2

This diff is large: its 65 lines aren’t shown here.

include/linux/of_net.h+6−0

This diff is large: its 20 lines aren’t shown here.

include/linux/phy.h+7−0

This diff is large: its 35 lines aren’t shown here.

include/linux/phylink.h+32−0

This diff is large: its 53 lines aren’t shown here.

include/linux/proc_fs.h+2−0

This diff is large: its 11 lines aren’t shown here.

include/linux/ptp_clock_kernel.h+53−7

This diff is large: its 95 lines aren’t shown here.

include/linux/rcupdate.h+12−0

This diff is large: its 19 lines aren’t shown here.

include/linux/rhashtable.h+36−25

This diff is large: its 188 lines aren’t shown here.

include/linux/rtnetlink.h+5−4

This diff is large: its 27 lines aren’t shown here.

include/linux/sctp.h+5−0

This diff is large: its 10 lines aren’t shown here.

include/linux/sfp.h+99−90

This diff is large: its 253 lines aren’t shown here.

include/linux/skbuff.h+11−15

This diff is large: its 80 lines aren’t shown here.

include/linux/skmsg.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/smc911x.h+0−14

This diff is large: its 15 lines aren’t shown here.

include/linux/soc/mediatek/mtk_wed.h+116−5

This diff is large: its 229 lines aren’t shown here.

include/linux/socket.h+4−1

This diff is large: its 12 lines aren’t shown here.

include/linux/stmmac.h+1−0

This diff is large: its 7 lines aren’t shown here.

include/linux/tcp.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/udp.h+7−1

This diff is large: its 30 lines aren’t shown here.

include/linux/usb.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/linux/virtio_net.h+9−0

This diff is large: its 37 lines aren’t shown here.

include/linux/wl12xx.h+0−44

This diff is large: its 45 lines aren’t shown here.

include/linux/wwan.h+2−0

This diff is large: its 16 lines aren’t shown here.

include/net/act_api.h+6−5

This diff is large: its 32 lines aren’t shown here.

include/net/af_rxrpc.h+1−1

This diff is large: its 12 lines aren’t shown here.

include/net/bluetooth/hci.h+21−0

This diff is large: its 35 lines aren’t shown here.

include/net/bluetooth/hci_core.h+7−1

This diff is large: its 29 lines aren’t shown here.

include/net/bond_alb.h+2−2

This diff is large: its 11 lines aren’t shown here.

include/net/bonding.h+0−4

This diff is large: its 18 lines aren’t shown here.

include/net/cfg80211-wext.h+10−10

This diff is large: its 45 lines aren’t shown here.

include/net/cfg80211.h+13−2

This diff is large: its 78 lines aren’t shown here.

include/net/cfg802154.h+34−4

This diff is large: its 85 lines aren’t shown here.

include/net/dcbnl.h+4−0

This diff is large: its 11 lines aren’t shown here.

include/net/devlink.h+110−8

This diff is large: its 251 lines aren’t shown here.

include/net/dropreason.h+14−0

This diff is large: its 35 lines aren’t shown here.

include/net/dsa.h+1−75

This diff is large: its 109 lines aren’t shown here.

include/net/dst.h+2−3

This diff is large: its 12 lines aren’t shown here.

include/net/dst_metadata.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/flow_offload.h+8−0

This diff is large: its 36 lines aren’t shown here.

include/net/fq_impl.h+10−6

This diff is large: its 37 lines aren’t shown here.

include/net/genetlink.h+70−9

This diff is large: its 148 lines aren’t shown here.

include/net/geneve.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/ieee802154_netdev.h+8−0

This diff is large: its 15 lines aren’t shown here.

include/net/inet_frag.h+5−1

This diff is large: its 33 lines aren’t shown here.

include/net/ip_vs.h+160−11

This diff is large: its 267 lines aren’t shown here.

include/net/ipv6.h+33−0

This diff is large: its 40 lines aren’t shown here.

include/net/ipv6_frag.h+2−1

This diff is large: its 17 lines aren’t shown here.

include/net/mac80211.h+59−19

This diff is large: its 205 lines aren’t shown here.

include/net/mac802154.h+0−31

This diff is large: its 52 lines aren’t shown here.

include/net/mana/gdma.hrenamed from drivers/net/ethernet/microsoft/mana/gdma.h+154−5

This diff is large: its 265 lines aren’t shown here.

include/net/mana/hw_channel.hrenamed from drivers/net/ethernet/microsoft/mana/hw_channel.h+0−0

File renamed without changes.

include/net/mana/mana.hrenamed from drivers/net/ethernet/microsoft/mana/mana.h+18−4

This diff is large: its 55 lines aren’t shown here.

include/net/mana/mana_auxiliary.h+10−0

This diff is large: its 11 lines aren’t shown here.

include/net/mana/shm_channel.hrenamed from drivers/net/ethernet/microsoft/mana/shm_channel.h+0−0

File renamed without changes.

include/net/mptcp.h+10−2

This diff is large: its 33 lines aren’t shown here.

include/net/mrp.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/net_namespace.h+22−8

This diff is large: its 58 lines aren’t shown here.

include/net/netfilter/nf_conntrack_core.h+1−2

This diff is large: its 10 lines aren’t shown here.

include/net/netfilter/nf_conntrack_helper.h+5−0

This diff is large: its 12 lines aren’t shown here.

include/net/netfilter/nf_nat.h+4−0

This diff is large: its 11 lines aren’t shown here.

include/net/netfilter/nf_tables.h+11−4

This diff is large: its 53 lines aren’t shown here.

include/net/netfilter/nf_tables_core.h+26−10

This diff is large: its 55 lines aren’t shown here.

include/net/netfilter/nf_tables_ipv4.h+4−0

This diff is large: its 18 lines aren’t shown here.

include/net/netfilter/nf_tables_ipv6.h+3−3

This diff is large: its 27 lines aren’t shown here.

include/net/netfilter/nft_fib.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/net/netfilter/nft_meta.h+8−2

This diff is large: its 24 lines aren’t shown here.

include/net/netfilter/nft_reject.h+2−1

This diff is large: its 10 lines aren’t shown here.

include/net/netlink.h+32−0

This diff is large: its 46 lines aren’t shown here.

include/net/netns/ipv4.h+8−0

This diff is large: its 29 lines aren’t shown here.

include/net/netns/sctp.h+4−0

This diff is large: its 11 lines aren’t shown here.

include/net/netns/xdp.h+1−1

This diff is large: its 10 lines aren’t shown here.

include/net/nl802154.h+43−0

This diff is large: its 64 lines aren’t shown here.

include/net/rtnetlink.h+3−2

This diff is large: its 12 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/sctp.h+4−7

This diff is large: its 35 lines aren’t shown here.

include/net/sctp/stream_sched.h+0−2

This diff is large: its 9 lines aren’t shown here.

include/net/sctp/structs.h+6−3

This diff is large: its 24 lines aren’t shown here.

include/net/sctp/ulpqueue.h+1−2

This diff is large: its 10 lines aren’t shown here.

include/net/sock.h+4−4

This diff is large: its 31 lines aren’t shown here.

include/net/sock_reuseport.h+2−0

This diff is large: its 15 lines aren’t shown here.

include/net/switchdev.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/tc_act/tc_ct.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/net/tc_act/tc_skbedit.h+29−0

This diff is large: its 42 lines aren’t shown here.

include/net/tc_wrapper.h+251−0

This diff is large: its 252 lines aren’t shown here.

include/net/tcp.h+37−5

This diff is large: its 77 lines aren’t shown here.

include/net/transp_v6.h+0−2

This diff is large: its 9 lines aren’t shown here.

include/net/tso.h+7−1

This diff is large: its 22 lines aren’t shown here.

include/net/udp.h+9−0

This diff is large: its 16 lines aren’t shown here.

include/net/udp_tunnel.h+2−2

This diff is large: its 11 lines aren’t shown here.

include/net/xfrm.h+123−26

This diff is large: its 249 lines aren’t shown here.

include/soc/mscc/ocelot.h+0−216

This diff is large: its 230 lines aren’t shown here.

include/trace/events/rxrpc.h+633−188

This diff is large: its 1228 lines aren’t shown here.

include/trace/events/skb.h+1−1

This diff is large: its 9 lines aren’t shown here.

include/uapi/linux/bpf.h+296−228

This diff is large: its 620 lines aren’t shown here.

include/uapi/linux/dcbnl.h+8−0

This diff is large: its 43 lines aren’t shown here.

include/uapi/linux/devlink.h+18−0

This diff is large: its 37 lines aren’t shown here.

include/uapi/linux/ethtool.h+12−6

This diff is large: its 46 lines aren’t shown here.

include/uapi/linux/ethtool_netlink.h+15−0

This diff is large: its 43 lines aren’t shown here.

include/uapi/linux/if_bridge.h+21−0

This diff is large: its 32 lines aren’t shown here.

include/uapi/linux/if_link.h+3−0

This diff is large: its 17 lines aren’t shown here.

include/uapi/linux/if_packet.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/if_tun.h+2−0

This diff is large: its 9 lines aren’t shown here.

include/uapi/linux/mptcp.h+9−0

This diff is large: its 23 lines aren’t shown here.

include/uapi/linux/neighbour.h+7−1

This diff is large: its 22 lines aren’t shown here.

include/uapi/linux/net_tstamp.h+2−1

This diff is large: its 11 lines aren’t shown here.

include/uapi/linux/netfilter/ipset/ip_set.h+2−0

This diff is large: its 16 lines aren’t shown here.

include/uapi/linux/netfilter/nf_conntrack_sctp.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/netfilter/nf_tables.h+29−0

This diff is large: its 57 lines aren’t shown here.

include/uapi/linux/netfilter/nfnetlink_cttimeout.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/nl80211.h+3−0

This diff is large: its 17 lines aren’t shown here.

include/uapi/linux/openvswitch.h+14−0

This diff is large: its 26 lines aren’t shown here.

include/uapi/linux/snmp.h+1−0

This diff is large: its 8 lines aren’t shown here.

include/uapi/linux/tc_act/tc_ct.h+3−0

This diff is large: its 10 lines aren’t shown here.

include/uapi/linux/tcp.h+6−0

This diff is large: its 20 lines aren’t shown here.

include/uapi/linux/virtio_bt.h+8−0

This diff is large: its 20 lines aren’t shown here.

include/uapi/linux/virtio_net.h+4−0

This diff is large: its 18 lines aren’t shown here.

include/uapi/linux/xfrm.h+6−0

This diff is large: its 13 lines aren’t shown here.

kernel/bpf/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/bpf/arraymap.c+10−19

This diff is large: its 91 lines aren’t shown here.

kernel/bpf/bpf_cgrp_storage.c+246−0

This diff is large: its 247 lines aren’t shown here.

kernel/bpf/bpf_inode_storage.c+4−38

This diff is large: its 83 lines aren’t shown here.

kernel/bpf/bpf_local_storage.c+134−72

This diff is large: its 272 lines aren’t shown here.

kernel/bpf/bpf_lsm.c+20−2

This diff is large: its 56 lines aren’t shown here.

kernel/bpf/bpf_task_storage.c+99−62

This diff is large: its 267 lines aren’t shown here.

kernel/bpf/btf.c+744−564

This diff is large: its 1747 lines aren’t shown here.

kernel/bpf/cgroup_iter.c+15−1

This diff is large: its 39 lines aren’t shown here.

kernel/bpf/core.c+23−1

This diff is large: its 53 lines aren’t shown here.

kernel/bpf/cpumap.c+16−17

This diff is large: its 78 lines aren’t shown here.

kernel/bpf/devmap.c+2−2

This diff is large: its 17 lines aren’t shown here.

kernel/bpf/hashtab.c+13−24

This diff is large: its 111 lines aren’t shown here.

kernel/bpf/helpers.c+420−19

This diff is large: its 592 lines aren’t shown here.

kernel/bpf/local_storage.c+1−1

This diff is large: its 9 lines aren’t shown here.

kernel/bpf/map_in_map.c+44−17

This diff is large: its 111 lines aren’t shown here.

kernel/bpf/memalloc.c+37−9

This diff is large: its 76 lines aren’t shown here.

kernel/bpf/ringbuf.c+3−3

This diff is large: its 27 lines aren’t shown here.

kernel/bpf/syscall.c+242−227

This diff is large: its 758 lines aren’t shown here.

kernel/bpf/trampoline.c+67−13

This diff is large: its 143 lines aren’t shown here.

kernel/bpf/verifier.c+2200−553

This diff is large: its 3972 lines aren’t shown here.

kernel/cgroup/cgroup.c+1−0

This diff is large: its 8 lines aren’t shown here.

kernel/jump_label.c+44−12

This diff is large: its 87 lines aren’t shown here.

kernel/module/kallsyms.c+0−2

This diff is large: its 13 lines aren’t shown here.

kernel/rcu/tasks.h+2−0

This diff is large: its 9 lines aren’t shown here.

kernel/trace/bpf_trace.c+107−6

This diff is large: its 218 lines aren’t shown here.

kernel/trace/ftrace.c+11−5

This diff is large: its 36 lines aren’t shown here.

lib/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

lib/net_utils.c+2−1

This diff is large: its 13 lines aren’t shown here.

lib/nlattr.c+1−1

This diff is large: its 9 lines aren’t shown here.

lib/packing.c+2−14

This diff is large: its 37 lines aren’t shown here.

lib/rhashtable.c+10−6

This diff is large: its 73 lines aren’t shown here.

lib/test_bpf.c+0−1

This diff is large: its 8 lines aren’t shown here.

lib/test_rhashtable.c+2−4

This diff is large: its 20 lines aren’t shown here.

net/802/mrp.c+13−5

This diff is large: its 47 lines aren’t shown here.

net/8021q/vlan_dev.c+2−2

This diff is large: its 16 lines aren’t shown here.

net/ax25/af_ax25.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/batman-adv/netlink.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/bluetooth/Kconfig+11−0

This diff is large: its 18 lines aren’t shown here.

net/bluetooth/hci_conn.c+4−13

This diff is large: its 56 lines aren’t shown here.

net/bluetooth/hci_core.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/bluetooth/hci_debugfs.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bluetooth/hci_event.c+17−7

This diff is large: its 54 lines aren’t shown here.

net/bluetooth/hci_sync.c+20−1

This diff is large: its 49 lines aren’t shown here.

net/bluetooth/iso.c+42−25

This diff is large: its 199 lines aren’t shown here.

net/bluetooth/l2cap_core.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bluetooth/lib.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/bluetooth/mgmt.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bluetooth/rfcomm/core.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/bpf/bpf_dummy_struct_ops.c+7−7

This diff is large: its 37 lines aren’t shown here.

net/bpf/test_run.c+12−7

This diff is large: its 54 lines aren’t shown here.

net/bridge/br.c+3−2

This diff is large: its 17 lines aren’t shown here.

net/bridge/br_fdb.c+44−2

This diff is large: its 142 lines aren’t shown here.

net/bridge/br_input.c+19−2

This diff is large: its 29 lines aren’t shown here.

net/bridge/br_mdb.c+603−221

This diff is large: its 963 lines aren’t shown here.

net/bridge/br_multicast.c+18−12

This diff is large: its 103 lines aren’t shown here.

net/bridge/br_netlink.c+20−1

This diff is large: its 49 lines aren’t shown here.

net/bridge/br_private.h+27−3

This diff is large: its 72 lines aren’t shown here.

net/bridge/br_switchdev.c+5−1

This diff is large: its 27 lines aren’t shown here.

net/bridge/br_vlan.c+2−2

This diff is large: its 15 lines aren’t shown here.

net/bridge/netfilter/nf_conntrack_bridge.c+1−31

This diff is large: its 44 lines aren’t shown here.

net/can/af_can.c+1−2

This diff is large: its 17 lines aren’t shown here.

net/can/j1939/transport.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/can/raw.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/core/bpf_sk_storage.c+6−36

This diff is large: its 98 lines aren’t shown here.

net/core/dev.c+96−89

This diff is large: its 442 lines aren’t shown here.

net/core/dev.h+7−0

This diff is large: its 14 lines aren’t shown here.

net/core/dev_ioctl.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/core/devlink.c+637−152

This diff is large: its 1384 lines aren’t shown here.

net/core/drop_monitor.c+6−6

This diff is large: its 42 lines aren’t shown here.

net/core/dst.c+6−2

This diff is large: its 30 lines aren’t shown here.

net/core/failover.c+3−3

This diff is large: its 26 lines aren’t shown here.

net/core/filter.c+94−47

This diff is large: its 310 lines aren’t shown here.

net/core/flow_dissector.c+3−1

This diff is large: its 16 lines aren’t shown here.

net/core/flow_offload.c+7−0

This diff is large: its 14 lines aren’t shown here.

net/core/gen_stats.c+8−8

This diff is large: its 52 lines aren’t shown here.

net/core/gro.c+36−38

This diff is large: its 92 lines aren’t shown here.

net/core/link_watch.c+17−3

This diff is large: its 27 lines aren’t shown here.

net/core/net-sysfs.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/core/net_namespace.c+5−0

This diff is large: its 19 lines aren’t shown here.

net/core/of_net.c+3−2

This diff is large: its 26 lines aren’t shown here.

net/core/rtnetlink.c+70−20

This diff is large: its 263 lines aren’t shown here.

net/core/skbuff.c+115−50

This diff is large: its 366 lines aren’t shown here.

net/core/skmsg.c+6−3

This diff is large: its 20 lines aren’t shown here.

net/core/sock.c+25−4

This diff is large: its 84 lines aren’t shown here.

net/core/sock_diag.c+9−6

This diff is large: its 24 lines aren’t shown here.

net/core/sock_map.c+2−0

This diff is large: its 14 lines aren’t shown here.

net/core/sock_reuseport.c+89−5

This diff is large: its 157 lines aren’t shown here.

net/core/tso.c+0−8

This diff is large: its 15 lines aren’t shown here.

net/core/utils.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/dcb/dcbnl.c+148−5

This diff is large: its 227 lines aren’t shown here.

net/dccp/dccp.h+1−0

This diff is large: its 8 lines aren’t shown here.

net/dccp/ipv6.c+8−7

This diff is large: its 41 lines aren’t shown here.

net/dccp/proto.c+7−1

This diff is large: its 20 lines aren’t shown here.

net/dsa/Kconfig+6−0

This diff is large: its 13 lines aren’t shown here.

net/dsa/Makefile+3−1

This diff is large: its 24 lines aren’t shown here.

net/dsa/devlink.c+391−0

This diff is large: its 392 lines aren’t shown here.

net/dsa/devlink.h+16−0

This diff is large: its 17 lines aren’t shown here.

net/dsa/dsa.c+1462−283

This diff is large: its 1873 lines aren’t shown here.

net/dsa/dsa.h+40−0

This diff is large: its 41 lines aren’t shown here.

net/dsa/dsa2.c+0−1829

This diff is large: its 1830 lines aren’t shown here.

net/dsa/dsa_priv.h+0−588

This diff is large: its 589 lines aren’t shown here.

net/dsa/master.c+22−3

This diff is large: its 44 lines aren’t shown here.

net/dsa/master.h+19−0

This diff is large: its 20 lines aren’t shown here.

net/dsa/netlink.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/dsa/netlink.h+8−0

This diff is large: its 9 lines aren’t shown here.

net/dsa/port.c+13−11

This diff is large: its 38 lines aren’t shown here.

net/dsa/port.h+114−0

This diff is large: its 115 lines aren’t shown here.

net/dsa/slave.c+62−13

This diff is large: its 129 lines aren’t shown here.

net/dsa/slave.h+69−0

This diff is large: its 70 lines aren’t shown here.

net/dsa/switch.c+52−1

This diff is large: its 67 lines aren’t shown here.

net/dsa/switch.h+120−0

This diff is large: its 121 lines aren’t shown here.

net/dsa/tag.c+243−0

This diff is large: its 244 lines aren’t shown here.

net/dsa/tag.h+310−0

This diff is large: its 311 lines aren’t shown here.

net/dsa/tag_8021q.c+28−2

This diff is large: its 58 lines aren’t shown here.

net/dsa/tag_8021q.h+27−0

This diff is large: its 28 lines aren’t shown here.

net/dsa/tag_ar9331.c+5−3

This diff is large: its 27 lines aren’t shown here.

net/dsa/tag_brcm.c+11−7

This diff is large: its 67 lines aren’t shown here.

net/dsa/tag_dsa.c+8−5

This diff is large: its 48 lines aren’t shown here.

net/dsa/tag_gswip.c+5−3

This diff is large: its 28 lines aren’t shown here.

net/dsa/tag_hellcreek.c+5−3

This diff is large: its 28 lines aren’t shown here.

net/dsa/tag_ksz.c+15−9

This diff is large: its 87 lines aren’t shown here.

net/dsa/tag_lan9303.c+5−3

This diff is large: its 35 lines aren’t shown here.

net/dsa/tag_mtk.c+7−3

This diff is large: its 37 lines aren’t shown here.

net/dsa/tag_none.c+30−0

This diff is large: its 31 lines aren’t shown here.

net/dsa/tag_ocelot.c+9−5

This diff is large: its 44 lines aren’t shown here.

net/dsa/tag_ocelot_8021q.c+7−3

This diff is large: its 30 lines aren’t shown here.

net/dsa/tag_qca.c+5−3

This diff is large: its 28 lines aren’t shown here.

net/dsa/tag_rtl4_a.c+5−3

This diff is large: its 26 lines aren’t shown here.

net/dsa/tag_rtl8_4.c+6−3

This diff is large: its 36 lines aren’t shown here.

net/dsa/tag_rzn1_a5psw.c+5−3

This diff is large: its 34 lines aren’t shown here.

net/dsa/tag_sja1105.c+10−5

This diff is large: its 45 lines aren’t shown here.

net/dsa/tag_trailer.c+5−3

This diff is large: its 28 lines aren’t shown here.

net/dsa/tag_xrs700x.c+5−3

This diff is large: its 28 lines aren’t shown here.

net/ethernet/eth.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ethtool/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

net/ethtool/channels.c+14−5

This diff is large: its 40 lines aren’t shown here.

net/ethtool/common.c+81−0

This diff is large: its 116 lines aren’t shown here.

net/ethtool/common.h+1−0

This diff is large: its 8 lines aren’t shown here.

net/ethtool/ioctl.c+25−19

This diff is large: its 86 lines aren’t shown here.

net/ethtool/linkstate.c+23−1

This diff is large: its 59 lines aren’t shown here.

net/ethtool/netlink.c+7−0

This diff is large: its 21 lines aren’t shown here.

net/ethtool/netlink.h+2−0

This diff is large: its 16 lines aren’t shown here.

net/ethtool/rss.c+153−0

This diff is large: its 154 lines aren’t shown here.

net/hsr/hsr_debugfs.c+16−24

This diff is large: its 61 lines aren’t shown here.

net/hsr/hsr_device.c+13−18

This diff is large: its 112 lines aren’t shown here.

net/hsr/hsr_forward.c+6−8

This diff is large: its 68 lines aren’t shown here.

net/hsr/hsr_framereg.c+110−155

This diff is large: its 475 lines aren’t shown here.

net/hsr/hsr_framereg.h+6−11

This diff is large: its 39 lines aren’t shown here.

net/hsr/hsr_main.h+8−7

This diff is large: its 39 lines aren’t shown here.

net/hsr/hsr_netlink.c+1−3

This diff is large: its 18 lines aren’t shown here.

net/ieee802154/core.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/ieee802154/nl802154.c+107−2

This diff is large: its 148 lines aren’t shown here.

net/ieee802154/nl802154.h+2−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/af_inet.c+4−4

This diff is large: its 24 lines aren’t shown here.

net/ipv4/bpf_tcp_ca.c+9−8

This diff is large: its 36 lines aren’t shown here.

net/ipv4/inet_connection_sock.c+4−3

This diff is large: its 32 lines aren’t shown here.

net/ipv4/inet_fragment.c+10−4

This diff is large: its 51 lines aren’t shown here.

net/ipv4/ip_fragment.c+13−6

This diff is large: its 64 lines aren’t shown here.

net/ipv4/ip_gre.c+6−6

This diff is large: its 54 lines aren’t shown here.

net/ipv4/ip_sockglue.c+2−1

This diff is large: its 17 lines aren’t shown here.

net/ipv4/ip_tunnel.c+16−16

This diff is large: its 116 lines aren’t shown here.

net/ipv4/ip_vti.c+10−10

This diff is large: its 82 lines aren’t shown here.

net/ipv4/ipip.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/ipmr.c+6−6

This diff is large: its 33 lines aren’t shown here.

net/ipv4/metrics.c+0−3

This diff is large: its 10 lines aren’t shown here.

net/ipv4/netfilter/nft_dup_ipv4.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/ipv4/netfilter/nft_fib_ipv4.c+2−3

This diff is large: its 15 lines aren’t shown here.

net/ipv4/ping.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv4/proc.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/syncookies.c+3−4

This diff is large: its 16 lines aren’t shown here.

net/ipv4/sysctl_net_ipv4.c+83−0

This diff is large: its 117 lines aren’t shown here.

net/ipv4/tcp.c+6−4

This diff is large: its 46 lines aren’t shown here.

net/ipv4/tcp_bpf.c+12−7

This diff is large: its 65 lines aren’t shown here.

net/ipv4/tcp_dctcp.c+22−1

This diff is large: its 60 lines aren’t shown here.

net/ipv4/tcp_input.c+43−24

This diff is large: its 140 lines aren’t shown here.

net/ipv4/tcp_ipv4.c+82−23

This diff is large: its 171 lines aren’t shown here.

net/ipv4/tcp_minisocks.c+39−22

This diff is large: its 85 lines aren’t shown here.

net/ipv4/tcp_output.c+19−22

This diff is large: its 87 lines aren’t shown here.

net/ipv4/tcp_plb.c+109−0

This diff is large: its 110 lines aren’t shown here.

net/ipv4/udp.c+176−41

This diff is large: its 436 lines aren’t shown here.

net/ipv4/udp_diag.c+3−3

This diff is large: its 25 lines aren’t shown here.

net/ipv4/udp_offload.c+5−3

This diff is large: its 24 lines aren’t shown here.

net/ipv4/udp_tunnel_core.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/ipv4/udp_tunnel_nic.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/ipv6/addrconf.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/ipv6/af_inet6.c+4−9

This diff is large: its 43 lines aren’t shown here.

net/ipv6/datagram.c+12−6

This diff is large: its 52 lines aren’t shown here.

net/ipv6/esp6_offload.c+1−2

This diff is large: its 14 lines aren’t shown here.

net/ipv6/ip6_fib.c+3−4

This diff is large: its 17 lines aren’t shown here.

net/ipv6/ip6_gre.c+4−27

This diff is large: its 67 lines aren’t shown here.

net/ipv6/ip6_offload.c+4−23

This diff is large: its 41 lines aren’t shown here.

net/ipv6/ip6_tunnel.c+12−14

This diff is large: its 89 lines aren’t shown here.

net/ipv6/ip6_vti.c+7−9

This diff is large: its 65 lines aren’t shown here.

net/ipv6/ip6mr.c+5−5

This diff is large: its 31 lines aren’t shown here.

net/ipv6/ipv6_sockglue.c+2−4

This diff is large: its 13 lines aren’t shown here.

net/ipv6/netfilter/nf_conntrack_reasm.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/ipv6/netfilter/nft_dup_ipv6.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/ipv6/ping.c+0−6

This diff is large: its 20 lines aren’t shown here.

net/ipv6/raw.c+0−2

This diff is large: its 9 lines aren’t shown here.

net/ipv6/reassembly.c+9−4

This diff is large: its 37 lines aren’t shown here.

net/ipv6/seg6_local.c+2−2

This diff is large: its 16 lines aren’t shown here.

net/ipv6/sit.c+11−11

This diff is large: its 91 lines aren’t shown here.

net/ipv6/tcp_ipv6.c+11−18

This diff is large: its 60 lines aren’t shown here.

net/ipv6/udp.c+24−17

This diff is large: its 137 lines aren’t shown here.

net/ipv6/udp_offload.c+5−3

This diff is large: its 24 lines aren’t shown here.

net/key/af_key.c+3−3

This diff is large: its 25 lines aren’t shown here.

net/l2tp/l2tp_ip6.c+0−2

This diff is large: its 9 lines aren’t shown here.

net/mac80211/agg-rx.c+3−22

This diff is large: its 56 lines aren’t shown here.

net/mac80211/agg-tx.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/mac80211/cfg.c+22−23

This diff is large: its 119 lines aren’t shown here.

net/mac80211/debugfs.c+1−3

This diff is large: its 11 lines aren’t shown here.

net/mac80211/debugfs_netdev.c+1−2

This diff is large: its 10 lines aren’t shown here.

net/mac80211/debugfs_sta.c+122−26

This diff is large: its 210 lines aren’t shown here.

net/mac80211/debugfs_sta.h+12−0

This diff is large: its 22 lines aren’t shown here.

net/mac80211/driver-ops.c+26−1

This diff is large: its 52 lines aren’t shown here.

net/mac80211/driver-ops.h+16−0

This diff is large: its 23 lines aren’t shown here.

net/mac80211/ieee80211_i.h+20−2

This diff is large: its 66 lines aren’t shown here.

net/mac80211/iface.c+6−68

This diff is large: its 167 lines aren’t shown here.

net/mac80211/link.c+17−0

This diff is large: its 35 lines aren’t shown here.

net/mac80211/main.c+15−8

This diff is large: its 58 lines aren’t shown here.

net/mac80211/mlme.c+100−33

This diff is large: its 338 lines aren’t shown here.

net/mac80211/rc80211_minstrel_ht.c+0−3

This diff is large: its 10 lines aren’t shown here.

net/mac80211/rc80211_minstrel_ht.h+0−1

This diff is large: its 8 lines aren’t shown here.

net/mac80211/rx.c+10−31

This diff is large: its 69 lines aren’t shown here.

net/mac80211/sta_info.c+74−44

This diff is large: its 246 lines aren’t shown here.

net/mac80211/sta_info.h+7−0

This diff is large: its 28 lines aren’t shown here.

net/mac80211/tdls.c+0−1

This diff is large: its 8 lines aren’t shown here.

net/mac80211/tx.c+200−127

This diff is large: its 535 lines aren’t shown here.

net/mac80211/util.c+196−50

This diff is large: its 310 lines aren’t shown here.

net/mac80211/wme.c+8−55

This diff is large: its 88 lines aren’t shown here.

net/mac80211/wme.h+1−3

This diff is large: its 12 lines aren’t shown here.

net/mac802154/cfg.c+3−3

This diff is large: its 24 lines aren’t shown here.

net/mac802154/driver-ops.h+161−92

This diff is large: its 388 lines aren’t shown here.

net/mac802154/ieee802154_i.h+54−2

This diff is large: its 90 lines aren’t shown here.

net/mac802154/iface.c+24−35

This diff is large: its 133 lines aren’t shown here.

net/mac802154/main.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/mac802154/rx.c+35−18

This diff is large: its 118 lines aren’t shown here.

net/mac802154/trace.h+25−0

This diff is large: its 32 lines aren’t shown here.

net/mac802154/tx.c+118−14

This diff is large: its 192 lines aren’t shown here.

net/mac802154/util.c+64−7

This diff is large: its 122 lines aren’t shown here.

net/mpls/af_mpls.c+2−2

This diff is large: its 12 lines aren’t shown here.

net/mptcp/Makefile+1−1

This diff is large: its 9 lines aren’t shown here.

net/mptcp/fastopen.c+73−0

This diff is large: its 74 lines aren’t shown here.

net/mptcp/options.c+17−8

This diff is large: its 82 lines aren’t shown here.

net/mptcp/pm_netlink.c+88−38

This diff is large: its 227 lines aren’t shown here.

net/mptcp/pm_userspace.c+6−2

This diff is large: its 44 lines aren’t shown here.

net/mptcp/protocol.c+25−62

This diff is large: its 265 lines aren’t shown here.

net/mptcp/protocol.h+26−4

This diff is large: its 75 lines aren’t shown here.

net/mptcp/sockopt.c+21−24

This diff is large: its 112 lines aren’t shown here.

net/mptcp/subflow.c+135−33

This diff is large: its 345 lines aren’t shown here.

net/mptcp/token.c+2−2

This diff is large: its 11 lines aren’t shown here.

net/ncsi/ncsi-cmd.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/Kconfig+3−6

This diff is large: its 23 lines aren’t shown here.

net/netfilter/Makefile+3−2

This diff is large: its 26 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_gen.h+62−9

This diff is large: its 129 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_ip.c+8−11

This diff is large: its 75 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_ipport.c+23−1

This diff is large: its 85 lines aren’t shown here.

net/netfilter/ipset/ip_set_hash_netnet.c+21−5

This diff is large: its 82 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_core.c+22−18

This diff is large: its 91 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_ctl.c+364−88

This diff is large: its 773 lines aren’t shown here.

net/netfilter/ipvs/ip_vs_est.c+815−68

This diff is large: its 940 lines aren’t shown here.

net/netfilter/nf_conntrack_bpf.c+7−10

This diff is large: its 27 lines aren’t shown here.

net/netfilter/nf_conntrack_core.c+13−17

This diff is large: its 42 lines aren’t shown here.

net/netfilter/nf_conntrack_helper.c+100−0

This diff is large: its 115 lines aren’t shown here.

net/netfilter/nf_conntrack_proto.c+55−69

This diff is large: its 184 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_icmpv6.c+53−0

This diff is large: its 67 lines aren’t shown here.

net/netfilter/nf_conntrack_proto_sctp.c+61−43

This diff is large: its 177 lines aren’t shown here.

net/netfilter/nf_conntrack_standalone.c+8−0

This diff is large: its 29 lines aren’t shown here.

net/netfilter/nf_flow_table_ip.c+8−0

This diff is large: its 22 lines aren’t shown here.

net/netfilter/nf_nat_ovs.c+135−0

This diff is large: its 136 lines aren’t shown here.

net/netfilter/nf_tables_api.c+72−18

This diff is large: its 239 lines aren’t shown here.

net/netfilter/nf_tables_core.c+2−0

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nft_bitwise.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/netfilter/nft_byteorder.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_cmp.c+6−3

This diff is large: its 30 lines aren’t shown here.

net/netfilter/nft_compat.c+6−3

This diff is large: its 27 lines aren’t shown here.

net/netfilter/nft_connlimit.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_counter.c+3−2

This diff is large: its 15 lines aren’t shown here.

net/netfilter/nft_ct.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/netfilter/nft_dup_netdev.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_dynset.c+4−3

This diff is large: its 28 lines aren’t shown here.

net/netfilter/nft_exthdr.c+6−4

This diff is large: its 38 lines aren’t shown here.

net/netfilter/nft_fib.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nft_flow_offload.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_fwd_netdev.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/netfilter/nft_hash.c+2−2

This diff is large: its 18 lines aren’t shown here.

net/netfilter/nft_immediate.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_inner.c+385−0

This diff is large: its 386 lines aren’t shown here.

net/netfilter/nft_last.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_limit.c+3−2

This diff is large: its 19 lines aren’t shown here.

net/netfilter/nft_log.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_lookup.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_masq.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_meta.c+65−2

This diff is large: its 91 lines aren’t shown here.

net/netfilter/nft_nat.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_numgen.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/netfilter/nft_objref.c+5−23

This diff is large: its 66 lines aren’t shown here.

net/netfilter/nft_osf.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_payload.c+138−3

This diff is large: its 197 lines aren’t shown here.

net/netfilter/nft_queue.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/netfilter/nft_quota.c+3−2

This diff is large: its 15 lines aren’t shown here.

net/netfilter/nft_range.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_redir.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_reject.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_rt.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nft_socket.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nft_synproxy.c+2−1

This diff is large: its 10 lines aren’t shown here.

net/netfilter/nft_tproxy.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nft_tunnel.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/nft_xfrm.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/netfilter/xt_sctp.c+0−1

This diff is large: its 8 lines aren’t shown here.

net/netlink/af_netlink.c+33−9

This diff is large: its 67 lines aren’t shown here.

net/netlink/genetlink.c+374−121

This diff is large: its 797 lines aren’t shown here.

net/nfc/nci/core.c+7−1

This diff is large: its 50 lines aren’t shown here.

net/nfc/nci/hci.c+3−1

This diff is large: its 18 lines aren’t shown here.

net/nfc/rawsock.c+3−0

This diff is large: its 24 lines aren’t shown here.

net/openvswitch/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

net/openvswitch/conntrack.c+19−232

This diff is large: its 295 lines aren’t shown here.

net/openvswitch/datapath.c+43−2

This diff is large: its 102 lines aren’t shown here.

net/openvswitch/flow_netlink.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/openvswitch/flow_table.c+4−5

This diff is large: its 25 lines aren’t shown here.

net/openvswitch/vport-geneve.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/openvswitch/vport-gre.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/openvswitch/vport-netdev.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/openvswitch/vport-vxlan.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/openvswitch/vport.c+50−0

This diff is large: its 57 lines aren’t shown here.

net/openvswitch/vport.h+16−0

This diff is large: its 44 lines aren’t shown here.

net/packet/af_packet.c+6−5

This diff is large: its 42 lines aren’t shown here.

net/rds/message.c+0−2

This diff is large: its 16 lines aren’t shown here.

net/rds/send.c+1−2

This diff is large: its 17 lines aren’t shown here.

net/rds/tcp.c+3−0

This diff is large: its 10 lines aren’t shown here.

net/rxrpc/Kconfig+7−0

This diff is large: its 12 lines aren’t shown here.

net/rxrpc/Makefile+5−0

This diff is large: its 21 lines aren’t shown here.

net/rxrpc/af_rxrpc.c+14−18

This diff is large: its 119 lines aren’t shown here.

net/rxrpc/ar-internal.h+243−172

This diff is large: its 815 lines aren’t shown here.

net/rxrpc/call_accept.c+92−103

This diff is large: its 344 lines aren’t shown here.

net/rxrpc/call_event.c+302−267

This diff is large: its 717 lines aren’t shown here.

net/rxrpc/call_object.c+179−182

This diff is large: its 695 lines aren’t shown here.

net/rxrpc/conn_client.c+75−71

This diff is large: its 405 lines aren’t shown here.

net/rxrpc/conn_event.c+85−43

This diff is large: its 265 lines aren’t shown here.

net/rxrpc/conn_object.c+149−164

This diff is large: its 487 lines aren’t shown here.

net/rxrpc/conn_service.c+14−15

This diff is large: its 93 lines aren’t shown here.

net/rxrpc/input.c+371−852

This diff is large: its 1577 lines aren’t shown here.

net/rxrpc/insecure.c+5−11

This diff is large: its 42 lines aren’t shown here.

net/rxrpc/io_thread.c+496−0

This diff is large: its 497 lines aren’t shown here.

net/rxrpc/key.c+10−6

This diff is large: its 44 lines aren’t shown here.

net/rxrpc/local_event.c+3−43

This diff is large: its 64 lines aren’t shown here.

net/rxrpc/local_object.c+70−104

This diff is large: its 323 lines aren’t shown here.

net/rxrpc/misc.c+1−22

This diff is large: its 41 lines aren’t shown here.

net/rxrpc/net_ns.c+3−1

This diff is large: its 18 lines aren’t shown here.

net/rxrpc/output.c+274−251

This diff is large: its 748 lines aren’t shown here.

net/rxrpc/peer_event.c+67−358

This diff is large: its 574 lines aren’t shown here.

net/rxrpc/peer_object.c+24−35

This diff is large: its 193 lines aren’t shown here.

net/rxrpc/proc.c+134−35

This diff is large: its 269 lines aren’t shown here.

net/rxrpc/protocol.h+1−8

This diff is large: its 23 lines aren’t shown here.

net/rxrpc/recvmsg.c+96−212

This diff is large: its 524 lines aren’t shown here.

net/rxrpc/rxkad.c+122−192

This diff is large: its 725 lines aren’t shown here.

net/rxrpc/rxperf.c+619−0

This diff is large: its 620 lines aren’t shown here.

net/rxrpc/security.c+32−2

This diff is large: its 55 lines aren’t shown here.

net/rxrpc/sendmsg.c+71−162

This diff is large: its 419 lines aren’t shown here.

net/rxrpc/server_key.c+25−0

This diff is large: its 29 lines aren’t shown here.

net/rxrpc/skbuff.c+16−28

This diff is large: its 103 lines aren’t shown here.

net/rxrpc/sysctl.c+1−10

This diff is large: its 25 lines aren’t shown here.

net/rxrpc/txbuf.c+142−0

This diff is large: its 143 lines aren’t shown here.

net/sched/Kconfig+1−0

This diff is large: its 8 lines aren’t shown here.

net/sched/act_api.c+2−1

This diff is large: its 17 lines aren’t shown here.

net/sched/act_bpf.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_connmark.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_csum.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_ct.c+109−148

This diff is large: its 425 lines aren’t shown here.

net/sched/act_ctinfo.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_gact.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_gate.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_ife.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_ipt.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_mirred.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_mpls.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_nat.c+4−3

This diff is large: its 21 lines aren’t shown here.

net/sched/act_pedit.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_police.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_sample.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_simple.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/act_skbedit.c+16−4

This diff is large: its 56 lines aren’t shown here.

net/sched/act_skbmod.c+4−2

This diff is large: its 19 lines aren’t shown here.

net/sched/act_tunnel_key.c+4−2

This diff is large: its 19 lines aren’t shown here.

net/sched/act_vlan.c+4−2

This diff is large: its 19 lines aren’t shown here.

net/sched/cls_api.c+9−1

This diff is large: its 38 lines aren’t shown here.

net/sched/cls_basic.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/cls_bpf.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/cls_cgroup.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/cls_flow.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/cls_flower.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/cls_fw.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/cls_matchall.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/cls_route.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/cls_rsvp.c+2−0

This diff is large: its 13 lines aren’t shown here.

net/sched/cls_rsvp.h+3−3

This diff is large: its 20 lines aren’t shown here.

net/sched/cls_rsvp6.c+2−0

This diff is large: its 13 lines aren’t shown here.

net/sched/cls_tcindex.c+4−3

This diff is large: its 21 lines aren’t shown here.

net/sched/cls_u32.c+4−2

This diff is large: its 20 lines aren’t shown here.

net/sched/sch_api.c+5−0

This diff is large: its 26 lines aren’t shown here.

net/sctp/associola.c+1−3

This diff is large: its 18 lines aren’t shown here.

net/sctp/diag.c+2−1

This diff is large: its 17 lines aren’t shown here.

net/sctp/endpointola.c+9−4

This diff is large: its 37 lines aren’t shown here.

net/sctp/input.c+59−49

This diff is large: its 309 lines aren’t shown here.

net/sctp/ipv6.c+18−4

This diff is large: its 52 lines aren’t shown here.

net/sctp/protocol.c+16−3

This diff is large: its 48 lines aren’t shown here.

net/sctp/sm_statefuns.c+1−1

This diff is large: its 9 lines aren’t shown here.

net/sctp/socket.c+27−11

This diff is large: its 100 lines aren’t shown here.

net/sctp/stream_interleave.c+3−9

This diff is large: its 26 lines aren’t shown here.

net/sctp/stream_sched.c+20−18

This diff is large: its 73 lines aren’t shown here.

net/sctp/stream_sched_prio.c+0−27

This diff is large: its 41 lines aren’t shown here.

net/sctp/stream_sched_rr.c+0−6

This diff is large: its 20 lines aren’t shown here.

net/sctp/sysctl.c+55−29

This diff is large: its 127 lines aren’t shown here.

net/sctp/ulpqueue.c+2−8

This diff is large: its 31 lines aren’t shown here.

net/socket.c+1−7

This diff is large: its 15 lines aren’t shown here.

net/tls/tls_sw.c+4−2

This diff is large: its 27 lines aren’t shown here.

net/unix/af_unix.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/vmw_vsock/vmci_transport.c+5−1

This diff is large: its 13 lines aren’t shown here.

net/wireless/core.h+4−1

This diff is large: its 19 lines aren’t shown here.

net/wireless/mlme.c+4−0

This diff is large: its 11 lines aren’t shown here.

net/wireless/nl80211.c+21−5

This diff is large: its 89 lines aren’t shown here.

net/wireless/nl80211.h+2−1

This diff is large: its 10 lines aren’t shown here.

net/wireless/reg.c+3−1

This diff is large: its 12 lines aren’t shown here.

net/wireless/scan.c+15−32

This diff is large: its 143 lines aren’t shown here.

net/wireless/sme.c+22−4

This diff is large: its 69 lines aren’t shown here.

net/wireless/util.c+3−1

This diff is large: its 11 lines aren’t shown here.

net/wireless/wext-compat.c+82−98

This diff is large: its 392 lines aren’t shown here.

net/wireless/wext-compat.h+4−4

This diff is large: its 31 lines aren’t shown here.

net/wireless/wext-sme.c+3−2

This diff is large: its 20 lines aren’t shown here.

net/xdp/xskmap.c+2−2

This diff is large: its 12 lines aren’t shown here.

net/xfrm/Makefile+8−0

This diff is large: its 15 lines aren’t shown here.

net/xfrm/xfrm_device.c+101−8

This diff is large: its 183 lines aren’t shown here.

net/xfrm/xfrm_input.c+1−0

This diff is large: its 8 lines aren’t shown here.

net/xfrm/xfrm_interface_bpf.c+115−0

This diff is large: its 116 lines aren’t shown here.

net/xfrm/xfrm_interface_core.crenamed from net/xfrm/xfrm_interface.c+14−0

This diff is large: its 34 lines aren’t shown here.

net/xfrm/xfrm_output.c+12−3

This diff is large: its 43 lines aren’t shown here.

net/xfrm/xfrm_policy.c+106−16

This diff is large: its 280 lines aren’t shown here.

net/xfrm/xfrm_state.c+189−23

This diff is large: its 384 lines aren’t shown here.

net/xfrm/xfrm_user.c+81−23

This diff is large: its 280 lines aren’t shown here.

samples/bpf/README.rst+3−3

This diff is large: its 20 lines aren’t shown here.

samples/bpf/hbm_edt_kern.c+1−1

This diff is large: its 9 lines aren’t shown here.

samples/bpf/sockex3_kern.c+53−42

This diff is large: its 149 lines aren’t shown here.

samples/bpf/sockex3_user.c+10−13

This diff is large: its 48 lines aren’t shown here.

samples/bpf/test_cgrp2_tc.sh+1−1

This diff is large: its 9 lines aren’t shown here.

samples/bpf/tracex2_kern.c+2−2

This diff is large: its 17 lines aren’t shown here.

samples/bpf/tracex2_user.c+2−1

This diff is large: its 10 lines aren’t shown here.

samples/bpf/xdp1_user.c+1−1

This diff is large: its 9 lines aren’t shown here.

samples/bpf/xdp2_kern.c+4−0

This diff is large: its 11 lines aren’t shown here.

samples/bpf/xdp_router_ipv4_user.c+1−1

This diff is large: its 9 lines aren’t shown here.

samples/pktgen/functions.sh+1−1

This diff is large: its 9 lines aren’t shown here.

scripts/bpf_doc.py+35−14

This diff is large: its 134 lines aren’t shown here.

tools/bpf/bpftool/Documentation/bpftool-map.rst+1−1

This diff is large: its 9 lines aren’t shown here.

tools/bpf/bpftool/Documentation/bpftool-prog.rst+13−2

This diff is large: its 36 lines aren’t shown here.

tools/bpf/bpftool/Documentation/common_options.rst+4−13

This diff is large: its 28 lines aren’t shown here.

tools/bpf/bpftool/Documentation/substitutions.rst+1−1

This diff is large: its 5 lines aren’t shown here.

tools/bpf/bpftool/Makefile+49−25

This diff is large: its 97 lines aren’t shown here.

tools/bpf/bpftool/bash-completion/bpftool+2−1

This diff is large: its 17 lines aren’t shown here.

tools/bpf/bpftool/btf.c+17−27

This diff is large: its 110 lines aren’t shown here.

tools/bpf/bpftool/btf_dumper.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/bpf/bpftool/common.c+14−9

This diff is large: its 83 lines aren’t shown here.

tools/bpf/bpftool/gen.c+11−18

This diff is large: its 84 lines aren’t shown here.

tools/bpf/bpftool/iter.c+8−4

This diff is large: its 39 lines aren’t shown here.

tools/bpf/bpftool/jit_disasm.c+215−46

This diff is large: its 341 lines aren’t shown here.

tools/bpf/bpftool/link.c+4−6

This diff is large: its 24 lines aren’t shown here.

tools/bpf/bpftool/main.c+62−54

This diff is large: its 229 lines aren’t shown here.

tools/bpf/bpftool/main.h+19−30

This diff is large: its 98 lines aren’t shown here.

tools/bpf/bpftool/map.c+12−21

This diff is large: its 92 lines aren’t shown here.

tools/bpf/bpftool/net.c+2−0

This diff is large: its 10 lines aren’t shown here.

tools/bpf/bpftool/perf.c+2−0

This diff is large: its 10 lines aren’t shown here.

tools/bpf/bpftool/pids.c+8−8

This diff is large: its 51 lines aren’t shown here.

tools/bpf/bpftool/prog.c+96−28

This diff is large: its 250 lines aren’t shown here.

tools/bpf/bpftool/struct_ops.c+9−13

This diff is large: its 72 lines aren’t shown here.

tools/bpf/bpftool/xlated_dumper.c+2−0

This diff is large: its 10 lines aren’t shown here.

tools/include/uapi/linux/bpf.h+296−228

This diff is large: its 620 lines aren’t shown here.

tools/include/uapi/linux/if_link.h+1−0

This diff is large: its 8 lines aren’t shown here.

tools/lib/bpf/Makefile+17−0

This diff is large: its 21 lines aren’t shown here.

tools/lib/bpf/bpf.c+44−4

This diff is large: its 103 lines aren’t shown here.

tools/lib/bpf/bpf.h+23−0

This diff is large: its 43 lines aren’t shown here.

tools/lib/bpf/btf.c+192−80

This diff is large: its 503 lines aren’t shown here.

tools/lib/bpf/btf_dump.c+36−10

This diff is large: its 95 lines aren’t shown here.

tools/lib/bpf/hashmap.c+9−9

This diff is large: its 53 lines aren’t shown here.

tools/lib/bpf/hashmap.h+57−34

This diff is large: its 120 lines aren’t shown here.

tools/lib/bpf/libbpf.c+166−100

This diff is large: its 554 lines aren’t shown here.

tools/lib/bpf/libbpf.map+5−1

This diff is large: its 16 lines aren’t shown here.

tools/lib/bpf/libbpf_probes.c+1−0

This diff is large: its 8 lines aren’t shown here.

tools/lib/bpf/ringbuf.c+2−2

This diff is large: its 18 lines aren’t shown here.

tools/lib/bpf/strset.c+9−9

This diff is large: its 54 lines aren’t shown here.

tools/lib/bpf/usdt.c+30−33

This diff is large: its 184 lines aren’t shown here.

tools/perf/tests/expr.c+10−18

This diff is large: its 69 lines aren’t shown here.

tools/perf/tests/pmu-events.c+3−3

This diff is large: its 22 lines aren’t shown here.

tools/perf/util/bpf-loader.c+5−6

This diff is large: its 35 lines aren’t shown here.

tools/perf/util/evsel.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/util/expr.c+15−21

This diff is large: its 120 lines aren’t shown here.

tools/perf/util/hashmap.c+9−9

This diff is large: its 53 lines aren’t shown here.

tools/perf/util/hashmap.h+57−34

This diff is large: its 120 lines aren’t shown here.

tools/perf/util/metricgroup.c+5−5

This diff is large: its 44 lines aren’t shown here.

tools/perf/util/stat-shadow.c+1−1

This diff is large: its 9 lines aren’t shown here.

tools/perf/util/stat.c+4−5

This diff is large: its 32 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/bpf/DENYLIST+2−1

This diff is large: its 9 lines aren’t shown here.

tools/testing/selftests/bpf/DENYLIST.aarch64+84−0

This diff is large: its 85 lines aren’t shown here.

tools/testing/selftests/bpf/DENYLIST.s390x+29−18

This diff is large: its 97 lines aren’t shown here.

tools/testing/selftests/bpf/Makefile+23−14

This diff is large: its 96 lines aren’t shown here.

tools/testing/selftests/bpf/README.rst+47−6

This diff is large: its 74 lines aren’t shown here.

tools/testing/selftests/bpf/bpf_experimental.h+68−0

This diff is large: its 69 lines aren’t shown here.

tools/testing/selftests/bpf/bpf_legacy.h+13−6

This diff is large: its 29 lines aren’t shown here.

tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c+24−0

This diff is large: its 38 lines aren’t shown here.

tools/testing/selftests/bpf/bpf_util.h+19−0

This diff is large: its 26 lines aren’t shown here.

tools/testing/selftests/bpf/cgroup_helpers.c+21−1

This diff is large: its 43 lines aren’t shown here.

tools/testing/selftests/bpf/cgroup_helpers.h+1−0

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/bpf/config+6−1

This diff is large: its 33 lines aren’t shown here.

tools/testing/selftests/bpf/config.aarch64+181−0

This diff is large: its 182 lines aren’t shown here.

tools/testing/selftests/bpf/config.s390x+0−3

This diff is large: its 10 lines aren’t shown here.

tools/testing/selftests/bpf/config.x86_64+0−1

This diff is large: its 8 lines aren’t shown here.

tools/testing/selftests/bpf/network_helpers.c+5−42

This diff is large: its 67 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/align.c+24−14

This diff is large: its 98 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/bpf_iter.c+22−19

This diff is large: its 102 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/bpf_nf.c+3−3

This diff is large: its 26 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/btf.c+273−5

This diff is large: its 306 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/btf_dedup_split.c+30−15

This diff is large: its 80 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/btf_dump.c+2−2

This diff is large: its 14 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c+10−15

This diff is large: its 68 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/cgroup_iter.c+76−0

This diff is large: its 90 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/cgrp_kfunc.c+175−0

This diff is large: its 176 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/cgrp_local_storage.c+265−0

This diff is large: its 266 lines aren’t shown here.

tools/testing/selftests/bpf/prog_tests/dynptr.c+3−77

This diff is large: its 110 lines aren’t shown here.

This diff is larger than a page shows: the files after these aren’t listed. Clone the repository to see all of it.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t