mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
qcacmn: Fill valid channels on oem caps user request
Currently when user request comes to populate oem capabilities, driver is populating all the channels which includes disabled channels also and the logic to populate the channels is incorrect. This is resulting in invalid channel configuration for user space command. To avoid above issue, use correct api which returns only valid channels and valid number of channels and populate the channels correctly in the output buffer. Change-Id: Ib239d5d869ca9d010c85f444b83751d2e121625d CRs-fixed: 2470193
This commit is contained in:
parent
56320c1e4d
commit
034a01be32
1 changed files with 12 additions and 27 deletions
|
|
@ -632,46 +632,31 @@ int wifi_pos_oem_rsp_handler(struct wlan_objmgr_psoc *psoc,
|
|||
static void wifi_pos_pdev_iterator(struct wlan_objmgr_psoc *psoc,
|
||||
void *obj, void *arg)
|
||||
{
|
||||
uint32_t i;
|
||||
QDF_STATUS status;
|
||||
uint8_t i, num_channels;
|
||||
struct wlan_objmgr_pdev *pdev = obj;
|
||||
struct regulatory_channel *psoc_ch_lst = arg;
|
||||
struct regulatory_channel pdev_ch_lst[NUM_CHANNELS];
|
||||
struct wifi_pos_driver_caps *caps = arg;
|
||||
struct channel_power ch_list[NUM_CHANNELS];
|
||||
|
||||
status = wlan_reg_get_channel_list_with_power(pdev, ch_list,
|
||||
&num_channels);
|
||||
|
||||
status = wlan_reg_get_current_chan_list(pdev, pdev_ch_lst);
|
||||
if (QDF_IS_STATUS_ERROR(status)) {
|
||||
wifi_pos_err("wlan_reg_get_current_chan_list_by_range failed");
|
||||
wifi_pos_err("Failed to get valid channel list");
|
||||
return;
|
||||
}
|
||||
|
||||
for (i = 0; i < NUM_CHANNELS; i++) {
|
||||
if (pdev_ch_lst[i].state != CHANNEL_STATE_DISABLE &&
|
||||
pdev_ch_lst[i].state != CHANNEL_STATE_INVALID)
|
||||
psoc_ch_lst[i] = pdev_ch_lst[i];
|
||||
}
|
||||
for (i = 0; i < num_channels; i++)
|
||||
caps->channel_list[i] = ch_list[i].chan_num;
|
||||
caps->num_channels = num_channels;
|
||||
}
|
||||
|
||||
static void wifi_pos_get_ch_info(struct wlan_objmgr_psoc *psoc,
|
||||
struct wifi_pos_driver_caps *caps)
|
||||
{
|
||||
uint32_t i, num_ch = 0;
|
||||
struct regulatory_channel ch_lst[NUM_CHANNELS] = {{0}};
|
||||
|
||||
wlan_objmgr_iterate_obj_list(psoc, WLAN_PDEV_OP,
|
||||
wifi_pos_pdev_iterator,
|
||||
ch_lst, true, WLAN_WIFI_POS_CORE_ID);
|
||||
|
||||
for (i = 0; i < NUM_CHANNELS && num_ch < OEM_CAP_MAX_NUM_CHANNELS;
|
||||
i++) {
|
||||
if (ch_lst[i].state != CHANNEL_STATE_DISABLE &&
|
||||
ch_lst[i].state != CHANNEL_STATE_INVALID) {
|
||||
num_ch++;
|
||||
caps->channel_list[i] = ch_lst[i].chan_num;
|
||||
}
|
||||
}
|
||||
|
||||
caps->num_channels = num_ch;
|
||||
wifi_pos_err("num channels: %d", num_ch);
|
||||
caps, true, WLAN_WIFI_POS_CORE_ID);
|
||||
wifi_pos_err("num channels: %d", caps->num_channels);
|
||||
}
|
||||
|
||||
QDF_STATUS wifi_pos_populate_caps(struct wlan_objmgr_psoc *psoc,
|
||||
|
|
|
|||
Loading…
Reference in a new issue