From 8e63ff7840d66c2246dc5909a1d6537e9ca66e17 Mon Sep 17 00:00:00 2001 From: Daniel Kim Date: Tue, 7 Jan 2020 17:54:29 -0800 Subject: [PATCH] qcacmn: Use correct phy id in the reg services To support dynamic mode switch (phase 2), correct phy_id should be used. Instead of pdev_id, target phy_id should be used to retrieve correct channel range sent in target capabilities (mac_phy_caps). Change-Id: If0e2503cc99636b775721ecb3628290d19e5575c --- umac/regulatory/core/src/reg_services_common.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/umac/regulatory/core/src/reg_services_common.c b/umac/regulatory/core/src/reg_services_common.c index 1b61ab3fb577..a3040806e462 100644 --- a/umac/regulatory/core/src/reg_services_common.c +++ b/umac/regulatory/core/src/reg_services_common.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2020 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -34,6 +34,7 @@ #include "reg_db_parser.h" #include "reg_build_chan_list.h" #include +#include const struct chan_map *channel_map; #ifdef CONFIG_CHAN_NUM_API @@ -2654,11 +2655,13 @@ QDF_STATUS reg_modify_pdev_chan_range(struct wlan_objmgr_pdev *pdev) struct wlan_lmac_if_reg_tx_ops *reg_tx_ops; struct wlan_psoc_host_hal_reg_capabilities_ext *reg_cap_ptr; uint32_t cnt; - uint32_t pdev_id; + uint32_t phy_id; enum direction dir; QDF_STATUS status = QDF_STATUS_SUCCESS; + struct target_pdev_info *tgt_pdev; - pdev_id = wlan_objmgr_pdev_get_pdev_id(pdev); + tgt_pdev = wlan_pdev_get_tgt_if_handle(pdev); + phy_id = (uint32_t)target_pdev_get_phy_idx(tgt_pdev); pdev_priv_obj = reg_get_pdev_obj(pdev); if (!IS_VALID_PDEV_REG_OBJ(pdev_priv_obj)) { reg_err("pdev reg component is NULL"); @@ -2686,7 +2689,7 @@ QDF_STATUS reg_modify_pdev_chan_range(struct wlan_objmgr_pdev *pdev) return QDF_STATUS_E_FAULT; } - if (reg_cap_ptr->phy_id == pdev_id) + if (reg_cap_ptr->phy_id == phy_id) break; reg_cap_ptr++; }