qcacld-3.0: Channel width from peer phymode
Add MLME API to get channel width for STA / P2P-CLI mode from peer phymode Change-Id: Iffef01b5fe0ad603ae3b75a659144c3fdcc23a02 CRs-Fixed: 3529931
This commit is contained in:

zatwierdzone przez
Rahul Choudhary

rodzic
cacceb7f35
commit
5e32b65f93
@@ -4456,9 +4456,19 @@ wlan_get_op_chan_freq_info_vdev_id(struct wlan_objmgr_pdev *pdev,
|
||||
if (!chan)
|
||||
goto rel_ref;
|
||||
|
||||
/* If operating mode is STA / P2P-CLI then get the channel width
|
||||
* from phymode. This is due the reason where actual operating
|
||||
* channel width is configured as part of WMI_PEER_ASSOC_CMDID
|
||||
* which could be downgraded while the peer associated.
|
||||
* If there is a failure or operating mode is not STA / P2P-CLI
|
||||
* then get channel width from wlan_channel.
|
||||
*/
|
||||
status = wlan_mlme_get_sta_ch_width(vdev, ch_width);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
*ch_width = chan->ch_width;
|
||||
|
||||
*op_freq = chan->ch_freq;
|
||||
*freq_seg_0 = chan->ch_cfreq1;
|
||||
*ch_width = chan->ch_width;
|
||||
status = QDF_STATUS_SUCCESS;
|
||||
|
||||
rel_ref:
|
||||
|
@@ -1073,7 +1073,7 @@ QDF_STATUS mlme_update_tgt_he_caps_in_cfg(struct wlan_objmgr_psoc *psoc,
|
||||
* @channel_width: channel width in VHT operation IE.
|
||||
* @chan_id: channel id
|
||||
* @ccfs0: channel center frequency segment 0
|
||||
* @ccfs0: channel center frequency segment 1
|
||||
* @ccfs1: channel center frequency segment 1
|
||||
*
|
||||
* Return: phy_ch_width
|
||||
*/
|
||||
@@ -1089,7 +1089,7 @@ wlan_mlme_convert_vht_op_bw_to_phy_ch_width(uint8_t channel_width,
|
||||
* @channel_width: channel width in HE operation IE.
|
||||
* @chan_id: channel id
|
||||
* @ccfs0: channel center frequency segment 0
|
||||
* @ccfs0: channel center frequency segment 1
|
||||
* @ccfs1: channel center frequency segment 1
|
||||
*
|
||||
* Return: phy_ch_width
|
||||
*/
|
||||
@@ -4355,4 +4355,17 @@ wlan_mlme_get_sap_ps_with_twt(struct wlan_objmgr_psoc *psoc);
|
||||
*
|
||||
*/
|
||||
enum phy_ch_width wlan_mlme_get_max_bw(void);
|
||||
|
||||
/**
|
||||
* wlan_mlme_get_sta_ch_width() - Get current operating
|
||||
* channel width for STA / P2P-CLI mode
|
||||
*
|
||||
* @vdev: STA / P2P-CLI vdev
|
||||
* @ch_width: Returned channel width
|
||||
*
|
||||
* Return: QDF_STATUS_SUCCESS for success otherwise QDF_STATUS_E_INVAL
|
||||
*
|
||||
*/
|
||||
QDF_STATUS wlan_mlme_get_sta_ch_width(struct wlan_objmgr_vdev *vdev,
|
||||
enum phy_ch_width *ch_width);
|
||||
#endif /* _WLAN_MLME_API_H_ */
|
||||
|
@@ -1246,6 +1246,29 @@ enum phy_ch_width wlan_mlme_get_max_bw(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
QDF_STATUS wlan_mlme_get_sta_ch_width(struct wlan_objmgr_vdev *vdev,
|
||||
enum phy_ch_width *ch_width)
|
||||
{
|
||||
QDF_STATUS status = QDF_STATUS_E_INVAL;
|
||||
struct wlan_objmgr_peer *peer;
|
||||
enum wlan_phymode phymode;
|
||||
enum QDF_OPMODE op_mode;
|
||||
|
||||
peer = wlan_vdev_get_bsspeer(vdev);
|
||||
op_mode = wlan_vdev_mlme_get_opmode(vdev);
|
||||
|
||||
if (ch_width && peer &&
|
||||
(op_mode == QDF_STA_MODE ||
|
||||
op_mode == QDF_P2P_CLIENT_MODE)) {
|
||||
wlan_peer_obj_lock(peer);
|
||||
phymode = wlan_peer_get_phymode(peer);
|
||||
wlan_peer_obj_unlock(peer);
|
||||
*ch_width = wlan_mlme_get_ch_width_from_phymode(phymode);
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
#ifdef WLAN_FEATURE_11BE_MLO
|
||||
uint8_t wlan_mlme_get_sta_mlo_simultaneous_links(struct wlan_objmgr_psoc *psoc)
|
||||
{
|
||||
|
@@ -741,6 +741,7 @@ void cm_connect_info(struct wlan_objmgr_vdev *vdev, bool connect_success,
|
||||
struct wlan_objmgr_pdev *pdev;
|
||||
struct wlan_objmgr_psoc *psoc;
|
||||
struct wlan_mlme_psoc_ext_obj *mlme_obj;
|
||||
enum phy_ch_width ch_width = CH_WIDTH_20MHZ;
|
||||
WLAN_HOST_DIAG_EVENT_DEF(conn_stats,
|
||||
struct host_event_wlan_connection_stats);
|
||||
|
||||
@@ -771,8 +772,8 @@ void cm_connect_info(struct wlan_objmgr_vdev *vdev, bool connect_success,
|
||||
|
||||
des_chan = wlan_vdev_mlme_get_des_chan(vdev);
|
||||
|
||||
conn_stats.chnl_bw =
|
||||
cm_get_diag_ch_width(des_chan->ch_width);
|
||||
wlan_mlme_get_sta_ch_width(vdev, &ch_width);
|
||||
conn_stats.chnl_bw = cm_get_diag_ch_width(ch_width);
|
||||
conn_stats.dot11mode =
|
||||
cm_diag_dot11_mode_from_phy_mode(des_chan->ch_phymode);
|
||||
|
||||
|
@@ -134,6 +134,8 @@ cm_update_associated_ch_info(struct wlan_objmgr_vdev *vdev, bool is_update)
|
||||
struct mlme_legacy_priv *mlme_priv;
|
||||
struct wlan_channel *des_chan;
|
||||
struct connect_chan_info *chan_info_orig;
|
||||
enum phy_ch_width ch_width;
|
||||
QDF_STATUS status;
|
||||
|
||||
mlme_priv = wlan_vdev_mlme_get_ext_hdl(vdev);
|
||||
if (!mlme_priv)
|
||||
@@ -148,7 +150,19 @@ cm_update_associated_ch_info(struct wlan_objmgr_vdev *vdev, bool is_update)
|
||||
des_chan = wlan_vdev_mlme_get_des_chan(vdev);
|
||||
if (!des_chan)
|
||||
return;
|
||||
chan_info_orig->ch_width_orig = des_chan->ch_width;
|
||||
|
||||
/* If operating mode is STA / P2P-CLI then get the channel width
|
||||
* from phymode. This is due the reason where actual operating
|
||||
* channel width is configured as part of WMI_PEER_ASSOC_CMDID
|
||||
* which could be downgraded while the peer associated.
|
||||
* If there is a failure or operating mode is not STA / P2P-CLI
|
||||
* then get channel width from wlan_channel.
|
||||
*/
|
||||
status = wlan_mlme_get_sta_ch_width(vdev, &ch_width);
|
||||
if (QDF_IS_STATUS_ERROR(status))
|
||||
chan_info_orig->ch_width_orig = des_chan->ch_width;
|
||||
else
|
||||
chan_info_orig->ch_width_orig = ch_width;
|
||||
|
||||
if (WLAN_REG_IS_24GHZ_CH_FREQ(des_chan->ch_freq) &&
|
||||
des_chan->ch_width == CH_WIDTH_40MHZ) {
|
||||
|
Reference in New Issue
Block a user