qcacld-3.0: Properly configuring OpClass into TDLS Peer

OpClass in TDLS peer is configured using gTDLSPrefOffChanNum
and gTDLSPrefOffChanBandwidth INIs. Values of OffChanBandwidth
INI can't distinguish 40+ and 40- BW which is required to fetch
the correct Opclass for a given channel from regdb. Adding
function which will convert OffChanBandwidth value into required
value before fetching opclass. This is required for TDLS 5.9 Cert
Test Case.

Change-Id: Iba27034335309472d16a6aeef819995504674fc5
CRs-Fixed: 2457369
This commit is contained in:
nakul kachhwaha
2019-07-26 11:41:23 +05:30
committed by nshrivas
parent 0248c92a83
commit 987f6b13dc

View File

@@ -144,6 +144,35 @@ uint8_t tdls_find_opclass(struct wlan_objmgr_psoc *psoc, uint8_t channel,
bw_offset); bw_offset);
} }
static uint8_t
tdls_get_opclass_from_bandwidth(struct tdls_soc_priv_obj *soc_obj,
struct tdls_peer *peer)
{
uint8_t opclass;
uint8_t bw_offset = soc_obj->tdls_configs.tdls_pre_off_chan_bw;
uint8_t channel = peer->pref_off_chan_num;
if (bw_offset & (1 << BW_80_OFFSET_BIT)) {
opclass = tdls_find_opclass(soc_obj->soc,
channel, BW80);
} else if (bw_offset & (1 << BW_40_OFFSET_BIT)) {
opclass = tdls_find_opclass(soc_obj->soc,
channel, BW40_LOW_PRIMARY);
if (!opclass) {
opclass = tdls_find_opclass(soc_obj->soc,
channel, BW40_HIGH_PRIMARY);
}
} else if (bw_offset & (1 << BW_20_OFFSET_BIT)) {
opclass = tdls_find_opclass(soc_obj->soc,
channel, BW20);
} else {
opclass = tdls_find_opclass(soc_obj->soc,
channel, BWALL);
}
return opclass;
}
/** /**
* tdls_add_peer() - add TDLS peer in TDLS vdev object * tdls_add_peer() - add TDLS peer in TDLS vdev object
* @vdev_obj: TDLS vdev object * @vdev_obj: TDLS vdev object
@@ -182,9 +211,8 @@ static struct tdls_peer *tdls_add_peer(struct tdls_vdev_priv_obj *vdev_obj,
peer->pref_off_chan_num = peer->pref_off_chan_num =
soc_obj->tdls_configs.tdls_pre_off_chan_num; soc_obj->tdls_configs.tdls_pre_off_chan_num;
peer->op_class_for_pref_off_chan = peer->op_class_for_pref_off_chan =
tdls_find_opclass(soc_obj->soc, tdls_get_opclass_from_bandwidth(soc_obj, peer);
peer->pref_off_chan_num,
soc_obj->tdls_configs.tdls_pre_off_chan_bw);
peer->sta_id = INVALID_TDLS_PEER_ID; peer->sta_id = INVALID_TDLS_PEER_ID;
qdf_list_insert_back(head, &peer->node); qdf_list_insert_back(head, &peer->node);
@@ -750,9 +778,7 @@ QDF_STATUS tdls_reset_peer(struct tdls_vdev_priv_obj *vdev_obj,
config = &soc_obj->tdls_configs; config = &soc_obj->tdls_configs;
curr_peer->pref_off_chan_num = config->tdls_pre_off_chan_num; curr_peer->pref_off_chan_num = config->tdls_pre_off_chan_num;
curr_peer->op_class_for_pref_off_chan = curr_peer->op_class_for_pref_off_chan =
tdls_find_opclass(soc_obj->soc, tdls_get_opclass_from_bandwidth(soc_obj, curr_peer);
curr_peer->pref_off_chan_num,
config->tdls_pre_off_chan_bw);
} }
tdls_set_peer_link_status(curr_peer, TDLS_LINK_IDLE, tdls_set_peer_link_status(curr_peer, TDLS_LINK_IDLE,