qcacmn: Fix TDLS tear down issue on initiator

The tdls peer sta id is allocated as part of wma_create_peer.
In HDD, as part of change interface,
wlan_hdd_tdls_disable_offchan_and_teardown_links API is called.
Here driver checks for valid TDLS peers based on staid.
Here HDD assumes staid zero as invalid and non zero values as
valid ID. This is not correct as staid zero also is a valid
staid. Due to this teardown status is not informed to upper layers.

Use 0xFF as invalid sta id for tdls peer to fix this issue.

Change-Id: I3827df9a63081952b2d443c175ef5a59eab85e43
CRs-Fixed: 2258171
这个提交包含在:
Bala Venkatesh
2018-06-05 16:24:14 +05:30
提交者 nshrivas
父节点 873dc40d46
当前提交 96bdde1b07
修改 5 个文件,包含 11 行新增9 行删除

查看文件

@@ -1398,7 +1398,7 @@ static QDF_STATUS tdls_add_peer_rsp(struct tdls_add_sta_rsp *rsp)
conn_rec = soc_obj->tdls_conn_info; conn_rec = soc_obj->tdls_conn_info;
for (sta_idx = 0; sta_idx < soc_obj->max_num_tdls_sta; for (sta_idx = 0; sta_idx < soc_obj->max_num_tdls_sta;
sta_idx++) { sta_idx++) {
if (0 == conn_rec[sta_idx].sta_id) { if (INVALID_TDLS_PEER_ID == conn_rec[sta_idx].sta_id) {
conn_rec[sta_idx].session_id = rsp->session_id; conn_rec[sta_idx].session_id = rsp->session_id;
conn_rec[sta_idx].sta_id = rsp->sta_id; conn_rec[sta_idx].sta_id = rsp->sta_id;
qdf_copy_macaddr(&conn_rec[sta_idx].peer_mac, qdf_copy_macaddr(&conn_rec[sta_idx].peer_mac,
@@ -1510,7 +1510,7 @@ QDF_STATUS tdls_process_del_peer_rsp(struct tdls_del_sta_rsp *rsp)
} }
} }
tdls_reset_peer(vdev_obj, macaddr); tdls_reset_peer(vdev_obj, macaddr);
conn_rec[sta_idx].sta_id = 0; conn_rec[sta_idx].sta_id = INVALID_TDLS_PEER_ID;
conn_rec[sta_idx].session_id = 0xff; conn_rec[sta_idx].session_id = 0xff;
qdf_mem_zero(&conn_rec[sta_idx].peer_mac, qdf_mem_zero(&conn_rec[sta_idx].peer_mac,
QDF_MAC_ADDR_SIZE); QDF_MAC_ADDR_SIZE);
@@ -2190,7 +2190,7 @@ static int tdls_teardown_links(struct tdls_soc_priv_obj *soc_obj, uint32_t mode)
conn_rec = soc_obj->tdls_conn_info; conn_rec = soc_obj->tdls_conn_info;
for (staidx = 0; staidx < soc_obj->max_num_tdls_sta; staidx++) { for (staidx = 0; staidx < soc_obj->max_num_tdls_sta; staidx++) {
if (conn_rec[staidx].sta_id == 0) if (conn_rec[staidx].sta_id == INVALID_TDLS_PEER_ID)
continue; continue;
curr_peer = tdls_find_all_peer(soc_obj, curr_peer = tdls_find_all_peer(soc_obj,

查看文件

@@ -587,7 +587,7 @@ tdls_ct_process_idle_handler(
&tdls_soc_obj)) &tdls_soc_obj))
return; return;
if (!tdls_info->sta_id) { if (INVALID_TDLS_PEER_ID == tdls_info->sta_id) {
tdls_err("peer (staidx %u) doesn't exists", tdls_info->sta_id); tdls_err("peer (staidx %u) doesn't exists", tdls_info->sta_id);
return; return;
} }
@@ -1252,7 +1252,8 @@ void tdls_disable_offchan_and_teardown_links(
for (staidx = 0; staidx < tdls_soc->max_num_tdls_sta; for (staidx = 0; staidx < tdls_soc->max_num_tdls_sta;
staidx++) { staidx++) {
if (!tdls_soc->tdls_conn_info[staidx].sta_id) if (tdls_soc->tdls_conn_info[staidx].sta_id
== INVALID_TDLS_PEER_ID)
continue; continue;
curr_peer = tdls_find_all_peer(tdls_soc, curr_peer = tdls_find_all_peer(tdls_soc,
@@ -1280,7 +1281,7 @@ void tdls_disable_offchan_and_teardown_links(
wlan_vdev_get_id(vdev), wlan_vdev_get_id(vdev),
curr_peer->sta_id); curr_peer->sta_id);
tdls_decrement_peer_count(tdls_soc); tdls_decrement_peer_count(tdls_soc);
tdls_soc->tdls_conn_info[staidx].sta_id = 0; tdls_soc->tdls_conn_info[staidx].sta_id = INVALID_TDLS_PEER_ID;
tdls_soc->tdls_conn_info[staidx].session_id = 255; tdls_soc->tdls_conn_info[staidx].session_id = 255;
qdf_mem_zero(&tdls_soc->tdls_conn_info[staidx].peer_mac, qdf_mem_zero(&tdls_soc->tdls_conn_info[staidx].peer_mac,

查看文件

@@ -756,7 +756,7 @@ QDF_STATUS tdls_reset_peer(struct tdls_vdev_priv_obj *vdev_obj,
tdls_set_peer_link_status(curr_peer, TDLS_LINK_IDLE, tdls_set_peer_link_status(curr_peer, TDLS_LINK_IDLE,
TDLS_LINK_UNSPECIFIED); TDLS_LINK_UNSPECIFIED);
curr_peer->sta_id = 0; curr_peer->sta_id = INVALID_TDLS_PEER_ID;
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }

查看文件

@@ -74,8 +74,9 @@
#define TDLS_TEARDOWN_PEER_UNREACHABLE 25 #define TDLS_TEARDOWN_PEER_UNREACHABLE 25
#define TDLS_TEARDOWN_PEER_UNSPEC_REASON 26 #define TDLS_TEARDOWN_PEER_UNSPEC_REASON 26
#define INVALID_TDLS_PEER_ID 0xFF
#define TDLS_STA_INDEX_CHECK(sta_id) \ #define TDLS_STA_INDEX_CHECK(sta_id) \
(((sta_id) >= 1) && ((sta_id) < 0xFF)) (((sta_id) >= 0) && ((sta_id) < 0xFF))
/** /**
* enum tdls_conc_cap - tdls concurrency support * enum tdls_conc_cap - tdls concurrency support
* @TDLS_SUPPORTED_ONLY_ON_STA: only support sta tdls * @TDLS_SUPPORTED_ONLY_ON_STA: only support sta tdls

查看文件

@@ -137,7 +137,7 @@ static QDF_STATUS tdls_global_init(struct tdls_soc_priv_obj *soc_obj)
soc_obj->max_num_tdls_sta = WLAN_TDLS_STA_MAX_NUM; soc_obj->max_num_tdls_sta = WLAN_TDLS_STA_MAX_NUM;
for (sta_idx = 0; sta_idx < soc_obj->max_num_tdls_sta; sta_idx++) { for (sta_idx = 0; sta_idx < soc_obj->max_num_tdls_sta; sta_idx++) {
soc_obj->tdls_conn_info[sta_idx].sta_id = 0; soc_obj->tdls_conn_info[sta_idx].sta_id = INVALID_TDLS_PEER_ID;
soc_obj->tdls_conn_info[sta_idx].session_id = 255; soc_obj->tdls_conn_info[sta_idx].session_id = 255;
qdf_mem_zero(&soc_obj->tdls_conn_info[sta_idx].peer_mac, qdf_mem_zero(&soc_obj->tdls_conn_info[sta_idx].peer_mac,
QDF_MAC_ADDR_SIZE); QDF_MAC_ADDR_SIZE);