1: 2560c8c1a45f ! 1: c533dd40853e wifi: ath12k: fix potential OOB access due to unverified hardware link id @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c ##  2: ad24d2b39441 ! 2: ddae457234e8 wifi: ath12k: skip hw link id match for devices without hw link id support @@ Commit message hw_link_id against the one being assigned to decide whether the existing entry belongs to this link before adding or removing it.  - hw_link_id is only used by QCN9274, IPQ5332 and IPQ5424; WCN7850 and - QCC2072 do not use it and rely on the logical link id instead. Also such - devices are single pdev and never hit the split PHY/roaming case, so the - disambiguation is unnecessary; keeping it would also break the logical + hw_link_id is only used by QCN9274, IPQ5332 and IPQ5424, QCN6432; WCN7850 + and QCC2072 do not use it and rely on the logical link id instead. Also + such devices are single pdev and never hit the split PHY/roaming case, so + the disambiguation is unnecessary; keeping it would also break the logical link id support added in subsequent patches.  Add a support_hw_link_id hardware parameter and, for devices that do not @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/dp_peer.c ## @@ drivers/net/wireless/ath/ath12k/dp_peer.c: void ath12k_dp_link_peer_unassign(str  ## drivers/net/wireless/ath/ath12k/hw.h ##  @@ drivers/net/wireless/ath/ath12k/hw.h: struct ath12k_hw_params { -  - bool host_alloc_ml_id; - bool advertise_iface_mac_pool; + * Example: QCN6432 (PCIe device attached to Q6, registered as AHB). + */ + bool hybrid_bus_type;  +  + bool support_hw_link_id; }; @@ drivers/net/wireless/ath/ath12k/hw.h: struct ath12k_hw_params {  ## drivers/net/wireless/ath/ath12k/wifi7/hw.c ##  @@ drivers/net/wireless/ath/ath12k/wifi7/hw.c: static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = { -  .host_alloc_ml_id = true, .advertise_iface_mac_pool = false, + .hybrid_bus_type = false,  +  + .support_hw_link_id = true, }, { .name = "wcn7850 hw2.0",  @@ drivers/net/wireless/ath/ath12k/wifi7/hw.c: static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = { -  .host_alloc_ml_id = false, .advertise_iface_mac_pool = true, + .hybrid_bus_type = false,  +  + .support_hw_link_id = false, }, { .name = "qcn9274 hw2.0",  @@ drivers/net/wireless/ath/ath12k/wifi7/hw.c: static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = { -  .host_alloc_ml_id = true, .advertise_iface_mac_pool = false, + .hybrid_bus_type = false,  +  + .support_hw_link_id = true, }, { .name = "ipq5332 hw1.0",  @@ drivers/net/wireless/ath/ath12k/wifi7/hw.c: static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = { -  .host_alloc_ml_id = true, .advertise_iface_mac_pool = false, + .hybrid_bus_type = false,  +  + .support_hw_link_id = true, }, { .name = "qcc2072 hw1.0",  @@ drivers/net/wireless/ath/ath12k/wifi7/hw.c: static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = { -  .host_alloc_ml_id = false, .advertise_iface_mac_pool = true, + .hybrid_bus_type = false,  +  + .support_hw_link_id = false, }, { .name = "ipq5424 hw1.0",  @@ drivers/net/wireless/ath/ath12k/wifi7/hw.c: static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = { -  .host_alloc_ml_id = true, .advertise_iface_mac_pool = false, + .hybrid_bus_type = false, ++ ++ .support_hw_link_id = true, + }, + { + .name = "qcn6432 hw1.0", +@@ drivers/net/wireless/ath/ath12k/wifi7/hw.c: static const struct ath12k_hw_params ath12k_wifi7_hw_params[] = { + .host_alloc_ml_id = true, + .advertise_iface_mac_pool = false, + .hybrid_bus_type = true,  +  + .support_hw_link_id = true, },  3: 86b1939741f6 ! 3: 9246ad77f2a5 wifi: ath12k: rename ath12k_dp_peer::hw_links to link_id_map @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/dp_peer.c ##  4: e38d21db9912 ! 4: ea51e1d578cb wifi: ath12k: rename ath12k_dp_link_peer::hw_link_id to drv_link_id @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/dp_peer.c ##  5: 1db7b6d90b81 ! 5: bdbffa89524e wifi: ath12k: rename ath12k_skb_rxcb::hw_link_id to drv_link_id @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/core.h ##  6: 5defcb22ec41 ! 6: f2781881ebe2 wifi: ath12k: derive device id without drv_link_id for single device group @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/dp.c ## @@ drivers/net/wireless/ath/ath12k/dp.h: ath12k_dp_rxdma_buf_ring_size(const struct   +u8 ath12k_dp_drv_link_id_to_device_id(struct ath12k_hw_group *ag, u8 drv_link_id); void ath12k_dp_vdev_tx_attach(struct ath12k *ar, struct ath12k_link_vif *arvif); - void ath12k_dp_partner_cc_init(struct ath12k_base *ab); + int ath12k_dp_partner_cc_init(struct ath12k_base *ab); int ath12k_dp_pdev_alloc(struct ath12k_base *ab);  ## drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c ##  7: 5c581e3fab04 ! 7: b42b7fd36192 wifi: ath12k: add support for HTT_T2H_MSG_TYPE_PEER_EXTENDED event @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/core.c ##  8: 5a87d65aba15 ! 8: cfb1943c4ff2 wifi: ath12k: allocate logical link id on host when firmware does not report it @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/dp_cmn.h ## @@ drivers/net/wireless/ath/ath12k/dp_peer.c  @@ drivers/net/wireless/ath/ath12k/dp_peer.c: int ath12k_dp_peer_create(struct ath12k_dp_hw *dp_hw, u8 *addr, dp_peer->sec_type = HAL_ENCRYPT_TYPE_OPEN; dp_peer->sec_type_grp = HAL_ENCRYPT_TYPE_OPEN; - dp_peer->ucast_ra_only = params->ucast_ra_only; -+ dp_peer->free_slot_map = U16_MAX;  ++ dp_peer->free_slot_map = U16_MAX; ++ spin_lock_bh(&dp_hw->peer_lock);  + list_add(&dp_peer->list, &dp_hw->dp_peers_list);  @@ drivers/net/wireless/ath/ath12k/dp_peer.c: void ath12k_dp_peer_delete(struct ath12k_dp_hw *dp_hw, u8 *addr, kfree(dp_peer); }  9: 6e5ba0b82f54 ! 9: 4ff35f124d2d wifi: ath12k: derive REO RX drv_link_id per device via HAL ops @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/dp_rx.h ## @@ drivers/net/wireless/ath/ath12k/hal.h: struct hal_ops {  ## drivers/net/wireless/ath/ath12k/hw.h ##  @@ drivers/net/wireless/ath/ath12k/hw.h: enum ath12k_bus { - #define ATH12K_EXT_IRQ_GRP_NUM_MAX 11 + #define ATH12K_EXT_IRQ_GRP_NUM_MAX 12  struct hal_rx_desc;  +struct hal_reo_dest_ring; 10: afae53072d18 ! 10: 5fb87df81b87 wifi: ath12k: derive WBM RX drv_link_id per device via HAL ops @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/dp_rx.h ## 11: b8689d847e1b ! 11: bd021842b9b0 wifi: ath12k: use link_id_map to resolve RX link id for all devices @@ Commit message Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c7-00108-QCAHMTSWPL_V1.0_V2.0_SILICONZ_UPSTREAM-3 Tested-on: QCC2072 hw1.0 PCI WLAN.COL.1.0.c2-00068-QCACOLSWPL_V1_TO_SILICONZ-1  + Tested-by: Burke Cates # ASUS Zenbook A16 (UX3607OA) Signed-off-by: Baochen Qiang   ## drivers/net/wireless/ath/ath12k/dp_peer.c ##