|
@@ -459,9 +459,9 @@ static QDF_STATUS tdls_activate_add_peer(struct tdls_add_peer_request *req)
|
|
|
|
|
|
/* in add station, we accept existing valid sta_id if there is */
|
|
|
if ((peer->link_status > TDLS_LINK_CONNECTING) ||
|
|
|
- (TDLS_STA_INDEX_CHECK((peer->sta_id)))) {
|
|
|
- tdls_notice("link_status %d sta_id %d add peer ignored",
|
|
|
- peer->link_status, peer->sta_id);
|
|
|
+ (peer->valid_entry)) {
|
|
|
+ tdls_notice("link_status %d add peer ignored",
|
|
|
+ peer->link_status);
|
|
|
status = QDF_STATUS_SUCCESS;
|
|
|
goto addrsp;
|
|
|
}
|
|
@@ -911,19 +911,17 @@ tdls_activate_update_peer(struct tdls_update_peer_request *req)
|
|
|
|
|
|
/* in change station, we accept only when sta_id is valid */
|
|
|
if (curr_peer->link_status == TDLS_LINK_TEARING ||
|
|
|
- !(TDLS_STA_INDEX_CHECK(curr_peer->sta_id))) {
|
|
|
- tdls_err(QDF_MAC_ADDR_STR " link %d. sta %d. update peer rejected",
|
|
|
- QDF_MAC_ADDR_ARRAY(mac), curr_peer->link_status,
|
|
|
- curr_peer->sta_id);
|
|
|
+ !curr_peer->valid_entry) {
|
|
|
+ tdls_err(QDF_MAC_ADDR_STR " link %d. update peer rejected",
|
|
|
+ QDF_MAC_ADDR_ARRAY(mac), curr_peer->link_status);
|
|
|
status = QDF_STATUS_E_PERM;
|
|
|
goto updatersp;
|
|
|
}
|
|
|
|
|
|
if (curr_peer->link_status == TDLS_LINK_CONNECTED &&
|
|
|
- TDLS_STA_INDEX_CHECK(curr_peer->sta_id)) {
|
|
|
- tdls_err(QDF_MAC_ADDR_STR " link %d. sta %d. update peer is igonored as tdls state is already connected ",
|
|
|
- QDF_MAC_ADDR_ARRAY(mac), curr_peer->link_status,
|
|
|
- curr_peer->sta_id);
|
|
|
+ curr_peer->valid_entry) {
|
|
|
+ tdls_err(QDF_MAC_ADDR_STR " link %d. update peer is igonored as tdls state is already connected ",
|
|
|
+ QDF_MAC_ADDR_ARRAY(mac), curr_peer->link_status);
|
|
|
status = QDF_STATUS_SUCCESS;
|
|
|
goto updatersp;
|
|
|
}
|
|
@@ -1178,7 +1176,7 @@ QDF_STATUS tdls_process_del_peer(struct tdls_oper_request *req)
|
|
|
|
|
|
mac = req->peer_addr;
|
|
|
peer = tdls_find_peer(vdev_obj, mac);
|
|
|
- if (!peer || !(TDLS_STA_INDEX_CHECK((peer->sta_id)))) {
|
|
|
+ if (!peer) {
|
|
|
tdls_err(QDF_MAC_ADDR_STR
|
|
|
" not found, ignore NL80211_TDLS_ENABLE_LINK",
|
|
|
QDF_MAC_ADDR_ARRAY(mac));
|
|
@@ -1420,23 +1418,22 @@ static QDF_STATUS tdls_add_peer_rsp(struct tdls_add_sta_rsp *rsp)
|
|
|
conn_rec = soc_obj->tdls_conn_info;
|
|
|
for (sta_idx = 0; sta_idx < soc_obj->max_num_tdls_sta;
|
|
|
sta_idx++) {
|
|
|
- if (INVALID_TDLS_PEER_ID == conn_rec[sta_idx].sta_id) {
|
|
|
+ if (!conn_rec[sta_idx].valid_entry) {
|
|
|
conn_rec[sta_idx].session_id = rsp->session_id;
|
|
|
- conn_rec[sta_idx].sta_id = rsp->sta_id;
|
|
|
+ conn_rec[sta_idx].valid_entry = true;
|
|
|
conn_rec[sta_idx].index = sta_idx;
|
|
|
qdf_copy_macaddr(&conn_rec[sta_idx].peer_mac,
|
|
|
&rsp->peermac);
|
|
|
- tdls_warn("TDLS: STA IDX at %d is %d of mac "
|
|
|
- QDF_MAC_ADDR_STR, sta_idx,
|
|
|
- rsp->sta_id, QDF_MAC_ADDR_ARRAY
|
|
|
+ tdls_warn("TDLS: Add sta mac "
|
|
|
+ QDF_MAC_ADDR_STR,
|
|
|
+ QDF_MAC_ADDR_ARRAY
|
|
|
(rsp->peermac.bytes));
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (sta_idx < soc_obj->max_num_tdls_sta) {
|
|
|
- status = tdls_set_sta_id(vdev_obj, rsp->peermac.bytes,
|
|
|
- rsp->sta_id);
|
|
|
+ status = tdls_set_valid(vdev_obj, rsp->peermac.bytes);
|
|
|
if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
tdls_err("set staid failed");
|
|
|
status = QDF_STATUS_E_FAILURE;
|
|
@@ -1507,11 +1504,12 @@ QDF_STATUS tdls_process_del_peer_rsp(struct tdls_del_sta_rsp *rsp)
|
|
|
conn_rec = soc_obj->tdls_conn_info;
|
|
|
for (sta_idx = 0; sta_idx < soc_obj->max_num_tdls_sta; sta_idx++) {
|
|
|
if (conn_rec[sta_idx].session_id != rsp->session_id ||
|
|
|
- conn_rec[sta_idx].sta_id != rsp->sta_id)
|
|
|
+ qdf_mem_cmp(conn_rec[sta_idx].peer_mac.bytes,
|
|
|
+ rsp->peermac.bytes, QDF_MAC_ADDR_SIZE))
|
|
|
continue;
|
|
|
|
|
|
macaddr = rsp->peermac.bytes;
|
|
|
- tdls_warn("TDLS: del STA IDX = %x", rsp->sta_id);
|
|
|
+ tdls_warn("TDLS: del STA");
|
|
|
curr_peer = tdls_find_peer(vdev_obj, macaddr);
|
|
|
if (curr_peer) {
|
|
|
tdls_debug(QDF_MAC_ADDR_STR " status is %d",
|
|
@@ -1533,7 +1531,7 @@ QDF_STATUS tdls_process_del_peer_rsp(struct tdls_del_sta_rsp *rsp)
|
|
|
}
|
|
|
}
|
|
|
tdls_reset_peer(vdev_obj, macaddr);
|
|
|
- conn_rec[sta_idx].sta_id = INVALID_TDLS_PEER_ID;
|
|
|
+ conn_rec[sta_idx].valid_entry = false;
|
|
|
conn_rec[sta_idx].session_id = 0xff;
|
|
|
conn_rec[sta_idx].index = INVALID_TDLS_PEER_INDEX;
|
|
|
qdf_mem_zero(&conn_rec[sta_idx].peer_mac,
|
|
@@ -1635,9 +1633,9 @@ QDF_STATUS tdls_process_enable_link(struct tdls_oper_request *req)
|
|
|
|
|
|
tdls_debug("enable link for peer " QDF_MAC_ADDR_STR " link state %d",
|
|
|
QDF_MAC_ADDR_ARRAY(mac), peer->link_status);
|
|
|
- if (!TDLS_STA_INDEX_CHECK(peer->sta_id)) {
|
|
|
- tdls_err("invalid sta idx %u for " QDF_MAC_ADDR_STR,
|
|
|
- peer->sta_id, QDF_MAC_ADDR_ARRAY(mac));
|
|
|
+ if (!peer->valid_entry) {
|
|
|
+ tdls_err("invalid entry " QDF_MAC_ADDR_STR,
|
|
|
+ QDF_MAC_ADDR_ARRAY(mac));
|
|
|
status = QDF_STATUS_E_INVAL;
|
|
|
goto error;
|
|
|
}
|
|
@@ -1649,8 +1647,7 @@ QDF_STATUS tdls_process_enable_link(struct tdls_oper_request *req)
|
|
|
|
|
|
id = wlan_vdev_get_id(vdev);
|
|
|
status = soc_obj->tdls_reg_peer(soc_obj->tdls_peer_context,
|
|
|
- id, mac, peer->sta_id,
|
|
|
- peer->qos);
|
|
|
+ id, mac, peer->qos);
|
|
|
if (QDF_IS_STATUS_ERROR(status)) {
|
|
|
tdls_err("TDLS register peer fail, status %d", status);
|
|
|
goto error;
|
|
@@ -2154,7 +2151,7 @@ static int tdls_teardown_links(struct tdls_soc_priv_obj *soc_obj, uint32_t mode)
|
|
|
|
|
|
conn_rec = soc_obj->tdls_conn_info;
|
|
|
for (staidx = 0; staidx < soc_obj->max_num_tdls_sta; staidx++) {
|
|
|
- if (conn_rec[staidx].sta_id == INVALID_TDLS_PEER_ID)
|
|
|
+ if (!conn_rec[staidx].valid_entry)
|
|
|
continue;
|
|
|
|
|
|
curr_peer = tdls_find_all_peer(soc_obj,
|
|
@@ -2166,8 +2163,9 @@ static int tdls_teardown_links(struct tdls_soc_priv_obj *soc_obj, uint32_t mode)
|
|
|
if (curr_peer->spatial_streams == HW_MODE_SS_1x1)
|
|
|
continue;
|
|
|
|
|
|
- tdls_debug("Indicate TDLS teardown (staId %d)",
|
|
|
- curr_peer->sta_id);
|
|
|
+ tdls_debug("Indicate TDLS teardown peer bssid "
|
|
|
+ QDF_MAC_ADDR_STR, QDF_MAC_ADDR_ARRAY(
|
|
|
+ curr_peer->peer_mac.bytes));
|
|
|
tdls_indicate_teardown(curr_peer->vdev_priv, curr_peer,
|
|
|
TDLS_TEARDOWN_PEER_UNSPEC_REASON);
|
|
|
|