1. 16 Jan, 2024 10 commits
  2. 14 Jan, 2024 15 commits
  3. 11 Jan, 2024 2 commits
  4. 20 Dec, 2023 1 commit
  5. 18 Dec, 2023 12 commits
    • Baochen Qiang's avatar
      wifi: ath12k: support default regdb while searching board-2.bin for WCN7850 · 52f8c45f
      Baochen Qiang authored
      Sometimes board-2.bin does not have the regdb data which matches the
      parameters such as vendor, device, subsystem-vendor, subsystem-device
      etc. Add default regdb data with only 'bus=%s' into board-2.bin for
      WCN7850, then ath12k uses 'bus=pci' to search regdb data in board-2.bin
      for WCN7850.
      
      [   46.114895] ath12k_pci 0000:03:00.0: boot using board name 'bus=pci,vendor=17cb,device=1107,subsystem-vendor=17cb,subsystem-device=3378,qmi-chip-id=2,qmi-board-id=260'
      [   46.118167] ath12k_pci 0000:03:00.0: boot firmware request ath12k/WCN7850/hw2.0/board-2.bin size 380280
      [   46.118173] ath12k_pci 0000:03:00.0: board name
      [   46.118176] ath12k_pci 0000:03:00.0: 00000000: 62 75 73 3d 70 63 69                             bus=pci
      [   46.118179] ath12k_pci 0000:03:00.0: failed to fetch regdb data for bus=pci,vendor=17cb,device=1107,subsystem-vendor=17cb,subsystem-device=3378,qmi-chip-id=2,qmi-board-id=260 from ath12k/WCN7850/hw2.0/board-2.bin
      [   46.118239] ath12k_pci 0000:03:00.0: boot using board name 'bus=pci'
      [   46.119842] ath12k_pci 0000:03:00.0: boot firmware request ath12k/WCN7850/hw2.0/board-2.bin size 380280
      [   46.119847] ath12k_pci 0000:03:00.0: board name
      [   46.119849] ath12k_pci 0000:03:00.0: 00000000: 62 75 73 3d 70 63 69                             bus=pci
      [   46.119852] ath12k_pci 0000:03:00.0: boot found match regdb data for name 'bus=pci'
      [   46.119855] ath12k_pci 0000:03:00.0: boot found regdb data for 'bus=pci'
      [   46.119857] ath12k_pci 0000:03:00.0: fetched regdb
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231216060140.30611-6-quic_bqiang@quicinc.com
      52f8c45f
    • Wen Gong's avatar
      wifi: ath12k: add support to search regdb data in board-2.bin for WCN7850 · 51120745
      Wen Gong authored
      Currently ath12k only downloads the same regdb.bin file for all WCN7850
      chips, actually ath12k needs to distinguish all different WCN7850 chips.
      
      This is to re-use the string type which includes bus, chip id, board id,
      vendor, device, subsystem-vendor, subsystem-device and variant for
      WCN7850 to distinguish different regdb in board-2.bin.
      
      ath12k will first load board-2.bin and search in it for the regdb data
      with the above parameters. If matched with one regdb data, download it
      to firmware. And if not, download regdb.bin instead.
      
      Add enum value ATH12K_BD_IE_REGDB and enum type ath12k_bd_ie_regdb_type
      to distinguish regdb data and board data since they are in the same file
      board-2.bin.
      
      Test log:
      [ 3833.091948] ath12k_pci 0000:05:00.0: boot using board name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [ 3833.092072] ath12k_pci 0000:05:00.0: boot firmware request ath12k/WCN7850/hw2.0/board-2.bin size 205316
      [ 3833.092079] ath12k_pci 0000:05:00.0: board name
      [ 3833.092083] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092088] ath12k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 31                                   -id=1
      [ 3833.092091] ath12k_pci 0000:05:00.0: board name
      [ 3833.092095] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092099] ath12k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 32                                   -id=2
      [ 3833.092102] ath12k_pci 0000:05:00.0: board name
      [ 3833.092105] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092109] ath12k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 33                                   -id=3
      [ 3833.092112] ath12k_pci 0000:05:00.0: board name
      [ 3833.092116] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [ 3833.092119] ath12k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [ 3833.092123] ath12k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [ 3833.092126] ath12k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [ 3833.092130] ath12k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [ 3833.092133] ath12k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [ 3833.092137] ath12k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 36 2c 76 61 72 69 61  ard-id=266,varia
      [ 3833.092140] ath12k_pci 0000:05:00.0: 00000070: 6e 74 3d 48 50 5f 47 38 5f 4c 61 6e 63 69 61 31  nt=HP_G8_Lancia1
      [ 3833.092144] ath12k_pci 0000:05:00.0: 00000080: 35                                               5
      [ 3833.092147] ath12k_pci 0000:05:00.0: board name
      [ 3833.092150] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [ 3833.092154] ath12k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [ 3833.092157] ath12k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [ 3833.092161] ath12k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [ 3833.092165] ath12k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [ 3833.092168] ath12k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [ 3833.092172] ath12k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 36                    ard-id=266
      [ 3833.092206] ath12k_pci 0000:05:00.0: board name
      [ 3833.092209] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [ 3833.092213] ath12k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [ 3833.092216] ath12k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [ 3833.092220] ath12k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [ 3833.092223] ath12k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [ 3833.092227] ath12k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [ 3833.092230] ath12k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 32                    ard-id=262
      [ 3833.092234] ath12k_pci 0000:05:00.0: boot found match regdb data for name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [ 3833.092238] ath12k_pci 0000:05:00.0: board name
      [ 3833.092241] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092245] ath12k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 31 31                                -id=11
      [ 3833.092248] ath12k_pci 0000:05:00.0: board name
      [ 3833.092251] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092255] ath12k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 32 32                                -id=22
      [ 3833.092258] ath12k_pci 0000:05:00.0: board name
      [ 3833.092261] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 71 6d 69 2d 63 68 69 70  bus=pci,qmi-chip
      [ 3833.092265] ath12k_pci 0000:05:00.0: 00000010: 2d 69 64 3d 33 33                                -id=33
      [ 3833.092268] ath12k_pci 0000:05:00.0: boot found regdb data for 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [ 3833.092272] ath12k_pci 0000:05:00.0: fetched regdb
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231216060140.30611-5-quic_bqiang@quicinc.com
      51120745
    • Wen Gong's avatar
      wifi: ath12k: remove unused ATH12K_BD_IE_BOARD_EXT · 97474e5f
      Wen Gong authored
      Currently ATH12K_BD_IE_BOARD_EXT is not used, so remove it.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231216060140.30611-4-quic_bqiang@quicinc.com
      97474e5f
    • Wen Gong's avatar
      wifi: ath12k: add fallback board name without variant while searching board-2.bin · 7173972a
      Wen Gong authored
      Currently a variant value read from DT or SMBIOS is considered while
      searching board-2.bin, this may fail because not all board-2.bin files
      contains that symbol.
      
      Add fallback board name which removes variant value and searches again
      in board-2.bin when fails to increase boot up success rate.
      
      dmesg log after this patch:
      [169547.248472] ath12k_pci 0000:05:00.0: boot using board name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262,variant=test'
      [169547.248565] ath12k_pci 0000:05:00.0: boot firmware request ath12k/WCN7850/hw2.0/board-2.bin size 180324
      [169547.248568] ath12k_pci 0000:05:00.0: board name
      [169547.248570] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [169547.248571] ath12k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [169547.248572] ath12k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [169547.248574] ath12k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [169547.248575] ath12k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [169547.248576] ath12k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [169547.248577] ath12k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 32                    ard-id=262
      [169547.248578] ath12k_pci 0000:05:00.0: board name
      [169547.248579] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [169547.248581] ath12k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [169547.248582] ath12k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [169547.248583] ath12k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [169547.248584] ath12k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [169547.248585] ath12k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [169547.248587] ath12k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 36                    ard-id=266
      [169547.248588] ath12k_pci 0000:05:00.0: board name
      [169547.248589] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [169547.248590] ath12k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [169547.248591] ath12k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [169547.248592] ath12k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [169547.248594] ath12k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [169547.248595] ath12k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 31 38 2c 71 6d 69 2d 62  chip-id=18,qmi-b
      [169547.248596] ath12k_pci 0000:05:00.0: 00000060: 6f 61 72 64 2d 69 64 3d 32 36 36                 oard-id=266
      [169547.248597] ath12k_pci 0000:05:00.0: failed to fetch board data for bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262,variant=test from ath12k/WCN7850/hw2.0/board-2.bin
      [169547.248476] ath12k_pci 0000:05:00.0: boot using board name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [169547.248634] ath12k_pci 0000:05:00.0: boot firmware request ath12k/WCN7850/hw2.0/board-2.bin size 180324
      [169547.248636] ath12k_pci 0000:05:00.0: board name
      [169547.248637] ath12k_pci 0000:05:00.0: 00000000: 62 75 73 3d 70 63 69 2c 76 65 6e 64 6f 72 3d 31  bus=pci,vendor=1
      [169547.248638] ath12k_pci 0000:05:00.0: 00000010: 37 63 62 2c 64 65 76 69 63 65 3d 31 31 30 33 2c  7cb,device=1103,
      [169547.248639] ath12k_pci 0000:05:00.0: 00000020: 73 75 62 73 79 73 74 65 6d 2d 76 65 6e 64 6f 72  subsystem-vendor
      [169547.248641] ath12k_pci 0000:05:00.0: 00000030: 3d 31 37 63 62 2c 73 75 62 73 79 73 74 65 6d 2d  =17cb,subsystem-
      [169547.248642] ath12k_pci 0000:05:00.0: 00000040: 64 65 76 69 63 65 3d 33 33 37 34 2c 71 6d 69 2d  device=3374,qmi-
      [169547.248643] ath12k_pci 0000:05:00.0: 00000050: 63 68 69 70 2d 69 64 3d 32 2c 71 6d 69 2d 62 6f  chip-id=2,qmi-bo
      [169547.248645] ath12k_pci 0000:05:00.0: 00000060: 61 72 64 2d 69 64 3d 32 36 32                    ard-id=262
      [169547.248646] ath12k_pci 0000:05:00.0: boot found match for name 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [169547.248647] ath12k_pci 0000:05:00.0: boot found board data for 'bus=pci,vendor=17cb,device=1103,subsystem-vendor=17cb,subsystem-device=3374,qmi-chip-id=2,qmi-board-id=262'
      [169547.248649] ath12k_pci 0000:05:00.0: using board api 2
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231216060140.30611-3-quic_bqiang@quicinc.com
      7173972a
    • Wen Gong's avatar
      wifi: ath12k: add string type to search board data in board-2.bin for WCN7850 · f4c2a9d6
      Wen Gong authored
      Currently ath12k only supports string type with bus, chip id and board id
      such as "bus=ahb,qmi-chip-id=1,qmi-board-id=4" for AHB bus chip and
      "bus=pci,qmi-chip-id=0,qmi-board-id=255" for PCI bus chip in board-2.bin.
      For WCN7850, it is not enough to distinguish all different chips.
      
      Add a new string type which includes bus, chip id, board id, vendor,
      device, subsystem-vendor and subsystem-device for WCN7850.
      
      ath12k will first load board-2.bin and searches in it for the board data
      with the above parameters. If matched with one board data, ath12k downloads
      it to firmware. And if not, downloads board.bin instead.
      
      Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4
      Signed-off-by: default avatarWen Gong <quic_wgong@quicinc.com>
      Signed-off-by: default avatarBaochen Qiang <quic_bqiang@quicinc.com>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231216060140.30611-2-quic_bqiang@quicinc.com
      f4c2a9d6
    • Jeff Johnson's avatar
      wifi: ath10k: remove duplicate memset() in 10.4 TDLS peer update · 6b9923f1
      Jeff Johnson authored
      In [1] it was identified that in ath10k_wmi_10_4_gen_tdls_peer_update()
      the memset(skb->data, 0, sizeof(*cmd)) is unnecessary since function
      ath10k_wmi_alloc_skb() already zeroes skb->data, so remove it.
      
      No functional changes, compile tested only.
      
      [1] https://lore.kernel.org/linux-wireless/626ae2e7-66f8-423b-b17f-e75c1a6d29b3@embeddedor.com/Signed-off-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231213-wmi_host_mem_chunks_flexarray-v1-6-92922d92fa2c@quicinc.com
      6b9923f1
    • Jeff Johnson's avatar
      wifi: ath10k: use flexible array in struct wmi_tdls_peer_capabilities · cb188e86
      Jeff Johnson authored
      Currently struct wmi_tdls_peer_capabilities defines:
      	struct wmi_channel peer_chan_list[1];
      
      Per the guidance in [1] this should be a flexible array, and at one
      point Gustavo was trying to fix this [2], but had questions about the
      correct behavior when the associated peer_chan_len is 0.
      
      I have been unable to determine if firmware requires that at least one
      record be present even if peer_chan_len is 0. But since that is the
      current behavior, follow the example from [3] and replace the
      one-element array with a union that contains both a flexible array and
      a single instance of the array element. This results in a struct that
      has the same footprint as the original, so no other driver changes are
      required.
      
      No functional changes, compile tested only.
      
      [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays
      [2] https://lore.kernel.org/linux-wireless/626ae2e7-66f8-423b-b17f-e75c1a6d29b3@embeddedor.com/
      [3] https://lore.kernel.org/linux-wireless/202308301529.AC90A9EF98@keescook/Signed-off-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231213-wmi_host_mem_chunks_flexarray-v1-5-92922d92fa2c@quicinc.com
      cb188e86
    • Jeff Johnson's avatar
      wifi: ath10k: remove unused template structs · b0c0794b
      Jeff Johnson authored
      Currently both the wmi_bcn_tmpl_cmd and wmi_prb_tmpl_cmd structs
      define:
      	  u8 data[1];
      
      Per the guidance in [1] both instances of this should be flexible
      arrays. However during conversion it was discovered that neither of
      these structs are actually used, so just remove them.
      
      No functional changes, compile tested only.
      
      [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arraysSigned-off-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231213-wmi_host_mem_chunks_flexarray-v1-4-92922d92fa2c@quicinc.com
      b0c0794b
    • Jeff Johnson's avatar
      wifi: ath10k: remove struct wmi_pdev_chanlist_update_event · 26eb704a
      Jeff Johnson authored
      Currently struct wmi_pdev_chanlist_update_event defines:
      	  struct wmi_channel channel_list[1];
      
      Per the guidance in [1] this should be a flexible array. However
      during conversion it was discovered that this struct is not used, so
      just remove the entire struct.
      
      No functional changes, compile tested only.
      
      [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arraysSigned-off-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231213-wmi_host_mem_chunks_flexarray-v1-3-92922d92fa2c@quicinc.com
      26eb704a
    • Jeff Johnson's avatar
      wifi: ath10k: use flexible arrays for WMI start scan TLVs · 72ca7c40
      Jeff Johnson authored
      Currently ath10k defines the following struct:
      	struct wmi_start_scan_tlvs {
      		u8 tlvs[0];
      	} __packed;
      
      Per the guidance in [1] this should be a flexible array. However, a
      direct replace to u8 tlvs[] results in the compilation error:
             flexible array member in a struct with no named members
      
      This is because C99 6.7.2.1 (16) requires that a structure containing
      a flexible array member must have more than one named member.
      
      So rather than defining a separate struct wmi_start_scan_tlvs which
      contains the flexible tlvs[] array, just define the tlvs[] array where
      struct wmi_start_scan_tlvs is being used.
      
      No functional changes, compile tested only.
      
      [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arraysSigned-off-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231213-wmi_host_mem_chunks_flexarray-v1-2-92922d92fa2c@quicinc.com
      72ca7c40
    • Jeff Johnson's avatar
      wifi: ath10k: use flexible array in struct wmi_host_mem_chunks · d2eb318f
      Jeff Johnson authored
      Currently struct wmi_host_mem_chunks defines:
      	struct host_memory_chunk items[1];
      
      Per the guidance in [1] this should be a flexible array. However there
      is a documented requirement:
      	some fw revisions require at least 1 chunk regardless of count
      
      To satisfy this requirement, follow the guidance from [2] and wrap the
      array in a union which contains both the flexible array and a single
      instance of the underlying struct. Since the footprint of the struct
      is unchanged, no additional driver changes are required.
      
      No functional changes, compile tested only.
      
      [1] https://docs.kernel.org/process/deprecated.html#zero-length-and-one-element-arrays
      [2] https://lore.kernel.org/linux-wireless/202308301529.AC90A9EF98@keescook/Signed-off-by: default avatarJeff Johnson <quic_jjohnson@quicinc.com>
      Reviewed-by: default avatarKees Cook <keescook@chromium.org>
      Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231213-wmi_host_mem_chunks_flexarray-v1-1-92922d92fa2c@quicinc.com
      d2eb318f
    • Dmitry Antipov's avatar
      wifi: ath9k: fix LNA selection in ath_ant_try_scan() · d6b27eb9
      Dmitry Antipov authored
      In 'ath_ant_try_scan()', (most likely) the 2nd LNA's signal
      strength should be used in comparison against RSSI when
      selecting first LNA as the main one. Compile tested only.
      
      Found by Linux Verification Center (linuxtesting.org) with SVACE.
      Signed-off-by: default avatarDmitry Antipov <dmantipov@yandex.ru>
      Acked-by: default avatarToke Høiland-Jørgensen <toke@toke.dk>
      Signed-off-by: default avatarKalle Valo <quic_kvalo@quicinc.com>
      Link: https://msgid.link/20231211172502.25202-1-dmantipov@yandex.ru
      d6b27eb9