qcacld-3.0: Validate opmode update req before sending to FW

Check the current vdev supported bandwidth values agianst peer
opemode update value and if the peer opmode value is greater than
current supported value then do not send the opmode update request
to FW.

Change-Id: I8f360d769b5aafb90061a6a9d18f1f8062e3534e
CRs-Fixed: 2174050
This commit is contained in:
Kiran Kumar Lokere 2018-02-05 09:04:07 -08:00 • committed by snandini
commit f7662e5fed
3 changed files with 21 additions and 2 deletions

View file

@ -2482,6 +2482,14 @@ 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

@ -1000,7 +1000,7 @@ static const wmi_channel_width mode_to_width[MODE_MAX] = {
*
* Return: channel width
*/
static wmi_channel_width chanmode_to_chanwidth(WLAN_PHY_MODE chanmode)
wmi_channel_width chanmode_to_chanwidth(WLAN_PHY_MODE chanmode)
{
wmi_channel_width chan_width;

View file

@ -2967,8 +2967,19 @@ int wma_mgmt_tx_bundle_completion_handler(void *handle, uint8_t *buf,
void wma_process_update_opmode(tp_wma_handle wma_handle,
tUpdateVHTOpMode *update_vht_opmode)
{
WMA_LOGD("%s: opMode = %d", __func__, update_vht_opmode->opMode);
struct wma_txrx_node *iface;
wmi_channel_width ch_width;
iface = &wma_handle->interfaces[update_vht_opmode->smesessionId];
ch_width = chanmode_to_chanwidth(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,
ch_width);
return;
}
WMA_LOGD("%s: opMode = %d", __func__, update_vht_opmode->opMode);
wma_set_peer_param(wma_handle, update_vht_opmode->peer_mac,
WMI_PEER_CHWIDTH, update_vht_opmode->opMode,
update_vht_opmode->smesessionId);