qcacld-3.0: Move chanmode_to_chanwidth API to qcacmn

Move chanmode_to_chanwidth API to qcacmn since it will be used by ndp
schedule update event.

Change-Id: I13d00c0b818eb0da434c8a5372b2ab7b6693f22a
CRs-Fixed: 2216803
This commit is contained in:
Naveen Rawat 2017-11-12 21:38:05 -08:00 • committed by nshrivas
commit f8792bd18a
3 changed files with 7 additions and 63 deletions

View file

@ -2460,14 +2460,6 @@ void wma_vdev_clear_pause_bit(uint8_t vdev_id, wmi_tx_pause_type bit_pos)
iface->pause_bitmap &= ~(1 << bit_pos);
}
/**
* chanmode_to_chanwidth() - get channel width through channel mode
* @chanmode: channel phy mode
*
* Return: channel width
*/
wmi_channel_width chanmode_to_chanwidth(WLAN_PHY_MODE chanmode);
/**
* wma_process_roaming_config() - process roam request
* @wma_handle: wma handle

View file

@ -1037,56 +1037,6 @@ static void wma_find_mcc_ap(tp_wma_handle wma, uint8_t vdev_id, bool add)
}
#endif /* FEATURE_AP_MCC_CH_AVOIDANCE */
static const wmi_channel_width mode_to_width[MODE_MAX] = {
[MODE_11A] = WMI_CHAN_WIDTH_20,
[MODE_11G] = WMI_CHAN_WIDTH_20,
[MODE_11B] = WMI_CHAN_WIDTH_20,
[MODE_11GONLY] = WMI_CHAN_WIDTH_20,
[MODE_11NA_HT20] = WMI_CHAN_WIDTH_20,
[MODE_11NG_HT20] = WMI_CHAN_WIDTH_20,
[MODE_11AC_VHT20] = WMI_CHAN_WIDTH_20,
[MODE_11AC_VHT20_2G] = WMI_CHAN_WIDTH_20,
[MODE_11NA_HT40] = WMI_CHAN_WIDTH_40,
[MODE_11NG_HT40] = WMI_CHAN_WIDTH_40,
[MODE_11AC_VHT40] = WMI_CHAN_WIDTH_40,
[MODE_11AC_VHT40_2G] = WMI_CHAN_WIDTH_40,
[MODE_11AC_VHT80] = WMI_CHAN_WIDTH_80,
[MODE_11AC_VHT80_2G] = WMI_CHAN_WIDTH_80,
#if CONFIG_160MHZ_SUPPORT
[MODE_11AC_VHT80_80] = WMI_CHAN_WIDTH_80P80,
[MODE_11AC_VHT160] = WMI_CHAN_WIDTH_160,
#endif
#if SUPPORT_11AX
[MODE_11AX_HE20] = WMI_CHAN_WIDTH_20,
[MODE_11AX_HE40] = WMI_CHAN_WIDTH_40,
[MODE_11AX_HE80] = WMI_CHAN_WIDTH_80,
[MODE_11AX_HE80_80] = WMI_CHAN_WIDTH_80P80,
[MODE_11AX_HE160] = WMI_CHAN_WIDTH_160,
[MODE_11AX_HE20_2G] = WMI_CHAN_WIDTH_20,
[MODE_11AX_HE40_2G] = WMI_CHAN_WIDTH_40,
[MODE_11AX_HE80_2G] = WMI_CHAN_WIDTH_80,
#endif
};
/**
* chanmode_to_chanwidth() - get channel width through channel mode
* @chanmode: channel phy mode
*
* Return: channel width
*/
wmi_channel_width chanmode_to_chanwidth(WLAN_PHY_MODE chanmode)
{
wmi_channel_width chan_width;
if (chanmode >= MODE_11A && chanmode < MODE_MAX)
chan_width = mode_to_width[chanmode];
else
chan_width = WMI_CHAN_WIDTH_20;
return chan_width;
}
/**
* wma_vdev_start_resp_handler() - vdev start response handler
* @handle: wma handle
@ -1106,7 +1056,7 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
struct vdev_up_params param = {0};
QDF_STATUS status;
int err;
wmi_channel_width chanwidth;
wmi_host_channel_width chanwidth;
target_resource_config *wlan_res_cfg;
struct wlan_objmgr_psoc *psoc = wma->psoc;
#ifdef FEATURE_AP_MCC_CH_AVOIDANCE
@ -1277,7 +1227,9 @@ int wma_vdev_start_resp_handler(void *handle, uint8_t *cmd_param_info,
__func__, resp_event->vdev_id,
iface->chanmode, err);
chanwidth = chanmode_to_chanwidth(iface->chanmode);
chanwidth =
wmi_get_ch_width_from_phy_mode(wma->wmi_handle,
iface->chanmode);
err = wma_set_peer_param(wma, iface->bssid,
WMI_PEER_CHWIDTH, chanwidth,
resp_event->vdev_id);

View file

@ -2980,11 +2980,11 @@ void wma_process_update_opmode(tp_wma_handle wma_handle,
tUpdateVHTOpMode *update_vht_opmode)
{
struct wma_txrx_node *iface;
wmi_channel_width ch_width;
wmi_host_channel_width ch_width;
iface = &wma_handle->interfaces[update_vht_opmode->smesessionId];
ch_width = chanmode_to_chanwidth(iface->chanmode);
ch_width = wmi_get_ch_width_from_phy_mode(wma_handle->wmi_handle,
iface->chanmode);
if (ch_width < update_vht_opmode->opMode) {
WMA_LOGE("%s: Invalid peer bw update %d, self bw %d",
__func__, update_vht_opmode->opMode,