summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Zhang <paulz@codeaurora.org>2016-12-09 20:57:58 +0800
committerqcabuildsw <qcabuildsw@localhost>2016-12-29 13:23:37 -0800
commit496eaaf4be4719bd9b1d8bab2bb0b793aa90a1b5 (patch)
tree5959143741e3d89d7d64fad4c7e35dcb434e550b
parent41126456e876623ddff40ff860388b5696904b1c (diff)
qcacld-3.0: Ensure phymode and chanwidth consistent
Propagation from qcacld-2.0 to qcacld-3.0. After connecting to a candidate AP, the STA checks the beacon's IE whether it needs to update channel width in function __schBeaconProcessForSession. Currently, it uses WMI_PEER_CHWIDTH to update the firmware parameter directly and ignores Phymode. Firmware can only handle downgrade of channel width and not upgrade. If Phymode is initially set to VHT20 and later if channel width is to be changed to VHT80. This has to be sent to firmware explicity via PHYMODE WMI command otherwise firmware will ASSERT. Fix is to send phymode along with channel width. Change-Id: Id7405ab1c80bca8d7647b562af28f84b7501fd79 CRs-Fixed: 1052131
-rw-r--r--core/mac/src/pe/lim/lim_process_action_frame.c3
-rw-r--r--core/mac/src/pe/lim/lim_process_sme_req_messages.c1
-rw-r--r--core/mac/src/pe/lim/lim_utils.c5
-rw-r--r--core/mac/src/pe/lim/lim_utils.h4
-rw-r--r--core/mac/src/pe/sch/sch_beacon_process.c8
-rw-r--r--core/sme/src/common/sme_api.c3
-rw-r--r--core/wma/inc/wma_if.h1
-rw-r--r--core/wma/src/wma_mgmt.c27
8 files changed, 40 insertions, 12 deletions
diff --git a/core/mac/src/pe/lim/lim_process_action_frame.c b/core/mac/src/pe/lim/lim_process_action_frame.c
index 3164e0e7ae5b..fba5a219c54e 100644
--- a/core/mac/src/pe/lim/lim_process_action_frame.c
+++ b/core/mac/src/pe/lim/lim_process_action_frame.c
@@ -569,8 +569,9 @@ static void __lim_process_operating_mode_action_frame(tpAniSirGlobal mac_ctx,
eHT_CHANNEL_WIDTH_20MHZ;
ch_bw = eHT_CHANNEL_WIDTH_20MHZ;
}
+
lim_check_vht_op_mode_change(mac_ctx, session, ch_bw,
- sta_ptr->staIndex, mac_hdr->sa);
+ session->dot11mode, sta_ptr->staIndex, mac_hdr->sa);
}
if (sta_ptr->vhtSupportedRxNss !=
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index 03bad8c62b39..84404945d550 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -4435,6 +4435,7 @@ static void __lim_process_sme_set_ht2040_mode(tpAniSirGlobal pMac,
qdf_mem_copy(pHtOpMode->peer_mac, &pStaDs->staAddr,
sizeof(tSirMacAddr));
pHtOpMode->smesessionId = sessionId;
+ pHtOpMode->dot11_mode = psessionEntry->dot11mode;
msg.type = WMA_UPDATE_OP_MODE;
msg.reserved = 0;
diff --git a/core/mac/src/pe/lim/lim_utils.c b/core/mac/src/pe/lim/lim_utils.c
index 394887010a96..34a4eff050fa 100644
--- a/core/mac/src/pe/lim/lim_utils.c
+++ b/core/mac/src/pe/lim/lim_utils.c
@@ -6078,12 +6078,13 @@ void lim_pmf_sa_query_timer_handler(void *pMacGlobal, uint32_t param)
#endif
bool lim_check_vht_op_mode_change(tpAniSirGlobal pMac, tpPESession psessionEntry,
- uint8_t chanWidth, uint8_t staId,
- uint8_t *peerMac)
+ uint8_t chanWidth, uint8_t dot11_mode,
+ uint8_t staId, uint8_t *peerMac)
{
tUpdateVHTOpMode tempParam;
tempParam.opMode = chanWidth;
+ tempParam.dot11_mode = dot11_mode;
tempParam.staId = staId;
tempParam.smesessionId = psessionEntry->smeSessionId;
qdf_mem_copy(tempParam.peer_mac, peerMac, sizeof(tSirMacAddr));
diff --git a/core/mac/src/pe/lim/lim_utils.h b/core/mac/src/pe/lim/lim_utils.h
index 9f65755cd3cd..ef6df8658bac 100644
--- a/core/mac/src/pe/lim/lim_utils.h
+++ b/core/mac/src/pe/lim/lim_utils.h
@@ -455,8 +455,8 @@ uint32_t lim_get_max_rate_flags(tpAniSirGlobal mac_ctx, tpDphHashNode sta_ds);
bool lim_check_vht_op_mode_change(tpAniSirGlobal pMac,
tpPESession psessionEntry,
- uint8_t chanWidth, uint8_t staId,
- uint8_t *peerMac);
+ uint8_t chanWidth, uint8_t dot11_mode,
+ uint8_t staId, uint8_t *peerMac);
bool lim_set_nss_change(tpAniSirGlobal pMac, tpPESession psessionEntry,
uint8_t rxNss, uint8_t staId, uint8_t *peerMac);
bool lim_check_membership_user_position(tpAniSirGlobal pMac,
diff --git a/core/mac/src/pe/sch/sch_beacon_process.c b/core/mac/src/pe/sch/sch_beacon_process.c
index 111db50d978c..23bd6d50897d 100644
--- a/core/mac/src/pe/sch/sch_beacon_process.c
+++ b/core/mac/src/pe/sch/sch_beacon_process.c
@@ -609,7 +609,8 @@ sch_bcn_process_sta_ibss(tpAniSirGlobal mac_ctx,
chWidth = eHT_CHANNEL_WIDTH_20MHZ;
}
lim_check_vht_op_mode_change(mac_ctx, session,
- chWidth, pStaDs->staIndex, pMh->sa);
+ chWidth, session->dot11mode,
+ pStaDs->staIndex, pMh->sa);
update_nss(mac_ctx, pStaDs, bcn, session, pMh);
}
return;
@@ -671,8 +672,9 @@ sch_bcn_process_sta_ibss(tpAniSirGlobal mac_ctx,
chWidth = eHT_CHANNEL_WIDTH_20MHZ;
}
}
- lim_check_vht_op_mode_change(mac_ctx, session, chWidth,
- pStaDs->staIndex, pMh->sa);
+ lim_check_vht_op_mode_change(mac_ctx, session,
+ chWidth, session->dot11mode,
+ pStaDs->staIndex, pMh->sa);
}
return;
}
diff --git a/core/sme/src/common/sme_api.c b/core/sme/src/common/sme_api.c
index ae67f667b5de..c4d8bf465751 100644
--- a/core/sme/src/common/sme_api.c
+++ b/core/sme/src/common/sme_api.c
@@ -12032,7 +12032,8 @@ QDF_STATUS sme_notify_ht2040_mode(tHalHandle hHal, uint16_t staId,
return QDF_STATUS_E_FAILURE;
}
- pHtOpMode->staId = staId,
+ pHtOpMode->dot11_mode = sme_get_wni_dot11_mode(hHal);
+ pHtOpMode->staId = staId;
qdf_mem_copy(pHtOpMode->peer_mac, macAddrSTA.bytes,
sizeof(tSirMacAddr));
pHtOpMode->smesessionId = sessionId;
diff --git a/core/wma/inc/wma_if.h b/core/wma/inc/wma_if.h
index ac553511ed98..632d429885f9 100644
--- a/core/wma/inc/wma_if.h
+++ b/core/wma/inc/wma_if.h
@@ -800,6 +800,7 @@ typedef struct {
*/
typedef struct {
uint16_t opMode;
+ uint16_t dot11_mode;
uint16_t staId;
uint16_t smesessionId;
tSirMacAddr peer_mac;
diff --git a/core/wma/src/wma_mgmt.c b/core/wma/src/wma_mgmt.c
index 0782bd738549..05c141ca5ba4 100644
--- a/core/wma/src/wma_mgmt.c
+++ b/core/wma/src/wma_mgmt.c
@@ -2595,11 +2595,32 @@ 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;
+ uint16_t chan_mode;
+
+
+ iface = &wma_handle->interfaces[update_vht_opmode->smesessionId];
+ if (iface == NULL)
+ return;
+
+ chan_mode = wma_chan_phy_mode(cds_freq_to_chan(iface->mhz),
+ update_vht_opmode->opMode,
+ update_vht_opmode->dot11_mode);
+ if (MODE_UNKNOWN == chan_mode)
+ return;
+
+ WMA_LOGD("%s: opMode = %d, chanMode = %d, dot11mode = %d ",
+ __func__,
+ update_vht_opmode->opMode, chan_mode,
+ update_vht_opmode->dot11_mode);
+
+ wma_set_peer_param(wma_handle, update_vht_opmode->peer_mac,
+ WMI_PEER_PHYMODE, chan_mode,
+ update_vht_opmode->smesessionId);
wma_set_peer_param(wma_handle, update_vht_opmode->peer_mac,
- WMI_PEER_CHWIDTH, update_vht_opmode->opMode,
- update_vht_opmode->smesessionId);
+ WMI_PEER_CHWIDTH, update_vht_opmode->opMode,
+ update_vht_opmode->smesessionId);
}
/**