summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhinav Kumar <abhikuma@codeaurora.org>2019-05-09 13:55:02 +0530
committernshrivas <nshrivas@codeaurora.org>2019-05-16 05:47:03 -0700
commit38ab2a8fd6c0e69b8bebedb2b29d39fe7e23d2e4 (patch)
tree7130fd71f19ec7542f5ba6d5fa80807912892f17
parent7b13c7578ea92ce65ad07a95222701f4a3070025 (diff)
qcacld-3.0: Update phymode during channel width updation
When roaming is completed if the phymode of the target AP is different from current phymode, then firmware will have updated phymode and host driver will have older phy mode. The host driver will update the opmode when new opmode is found over beacon or vht opmode action frame. During opmode updation over wma_process_update_opmode(), phymode is also sent to firmware. As the phymode on the host driver is not updated to new value after roaming and there will be mismatched phymode sent to firmware. Firmware will not be able to handle this and asserts. With current design, the channel width and frequency are updated to wma interface on roam synch complete. Fix is to update the phymode also after roam synch complete is received to wma iface based on the new channel width updated. Change-Id: I54aec080f53d3b49a309f9cb66553ec7c1805c50 CRs-Fixed: 2380456
-rw-r--r--core/wma/src/wma_scan_roam.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/core/wma/src/wma_scan_roam.c b/core/wma/src/wma_scan_roam.c
index 3bb9e2e049d7..2d03ba804e8f 100644
--- a/core/wma/src/wma_scan_roam.c
+++ b/core/wma/src/wma_scan_roam.c
@@ -3001,6 +3001,30 @@ static void wma_roam_remove_self_reassoc(tp_wma_handle wma, uint32_t vdev_id)
}
/**
+ * wma_get_phy_mode: get current PHY Mode
+ * @chan: channel number
+ * @chan_width: maximum channel width possible
+ * @phy_mode: PHY Mode
+ *
+ * Return: None
+ */
+static
+void wma_get_phy_mode(uint8_t chan, uint32_t chan_width, uint32_t *phy_mode)
+{
+ uint32_t dot11_mode;
+ struct sAniSirGlobal *mac = cds_get_context(QDF_MODULE_ID_PE);
+
+ if (!mac) {
+ WMA_LOGE("MAC context is NULL");
+ *phy_mode = MODE_UNKNOWN;
+ return;
+ }
+
+ wlan_cfg_get_int(mac, WNI_CFG_DOT11_MODE, &dot11_mode);
+ *phy_mode = wma_chan_phy_mode(chan, chan_width, dot11_mode);
+}
+
+/**
* wma_roam_synch_event_handler() - roam synch event handler
* @handle: wma handle
* @event: event data
@@ -3019,6 +3043,7 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event,
tp_wma_handle wma = (tp_wma_handle) handle;
roam_offload_synch_ind *roam_synch_ind_ptr = NULL;
tpSirBssDescription bss_desc_ptr = NULL;
+ uint8_t channel;
uint16_t ie_len = 0;
int status = -EINVAL;
tSirRoamOffloadScanReq *roam_req;
@@ -3216,6 +3241,20 @@ int wma_roam_synch_event_handler(void *handle, uint8_t *event,
wma->interfaces[synch_event->vdev_id].chan_width =
roam_synch_ind_ptr->join_rsp->vht_channel_width;
+ /*
+ * update phy_mode in wma to avoid mismatch in phymode between
+ * host and firmware. The phymode stored in
+ * interface[vdev_id].chanmode is sent to firmware as part of
+ * opmode update during either - vht opmode action frame received
+ * or during opmode change detected while processing beacon.
+ * Any mismatch of this value with firmware phymode results in
+ * firmware assert.
+ */
+ channel = cds_freq_to_chan(wma->interfaces[synch_event->vdev_id].mhz);
+ wma_get_phy_mode(channel,
+ wma->interfaces[synch_event->vdev_id].chan_width,
+ &wma->interfaces[synch_event->vdev_id].chanmode);
+
wma->csr_roam_synch_cb((tpAniSirGlobal)wma->mac_context,
roam_synch_ind_ptr, bss_desc_ptr, SIR_ROAM_SYNCH_COMPLETE);
wma->interfaces[synch_event->vdev_id].roam_synch_delay =