Commit 55a2c077 authored by Xinming Hu's avatar Xinming Hu Committed by Kalle Valo

mwifiex: enhance tdls link setup condition

TDLS link status - channel switching, off channel or base channel itself
indicates that TDLS link is setup.
Signed-off-by: default avatarXinming Hu <huxm@marvell.com>
Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 20834343
...@@ -1333,6 +1333,21 @@ static inline u8 mwifiex_is_any_intf_active(struct mwifiex_private *priv) ...@@ -1333,6 +1333,21 @@ static inline u8 mwifiex_is_any_intf_active(struct mwifiex_private *priv)
return 0; return 0;
} }
static inline u8 mwifiex_is_tdls_link_setup(u8 status)
{
switch (status) {
case TDLS_SETUP_COMPLETE:
case TDLS_CHAN_SWITCHING:
case TDLS_IN_BASE_CHAN:
case TDLS_IN_OFF_CHAN:
return true;
default:
break;
}
return false;
}
int mwifiex_init_shutdown_fw(struct mwifiex_private *priv, int mwifiex_init_shutdown_fw(struct mwifiex_private *priv,
u32 func_init_shutdown); u32 func_init_shutdown);
int mwifiex_add_card(void *, struct semaphore *, struct mwifiex_if_ops *, u8); int mwifiex_add_card(void *, struct semaphore *, struct mwifiex_if_ops *, u8);
......
...@@ -273,7 +273,7 @@ mwifiex_process_sta_tx_pause_event(struct mwifiex_private *priv, ...@@ -273,7 +273,7 @@ mwifiex_process_sta_tx_pause_event(struct mwifiex_private *priv,
tp_tlv->pkt_cnt); tp_tlv->pkt_cnt);
status = mwifiex_get_tdls_link_status status = mwifiex_get_tdls_link_status
(priv, tp_tlv->peermac); (priv, tp_tlv->peermac);
if (status == TDLS_SETUP_COMPLETE) { if (mwifiex_is_tdls_link_setup(status)) {
spin_lock_irqsave(&priv->sta_list_spinlock, spin_lock_irqsave(&priv->sta_list_spinlock,
flags); flags);
sta_ptr = mwifiex_get_sta_entry sta_ptr = mwifiex_get_sta_entry
......
...@@ -49,7 +49,7 @@ static void mwifiex_restore_tdls_packets(struct mwifiex_private *priv, ...@@ -49,7 +49,7 @@ static void mwifiex_restore_tdls_packets(struct mwifiex_private *priv,
tid = skb->priority; tid = skb->priority;
tid_down = mwifiex_wmm_downgrade_tid(priv, tid); tid_down = mwifiex_wmm_downgrade_tid(priv, tid);
if (status == TDLS_SETUP_COMPLETE) { if (mwifiex_is_tdls_link_setup(status)) {
ra_list = mwifiex_wmm_get_queue_raptr(priv, tid, mac); ra_list = mwifiex_wmm_get_queue_raptr(priv, tid, mac);
ra_list->tdls_link = true; ra_list->tdls_link = true;
tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT; tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT;
...@@ -1147,7 +1147,7 @@ int mwifiex_get_tdls_list(struct mwifiex_private *priv, ...@@ -1147,7 +1147,7 @@ int mwifiex_get_tdls_list(struct mwifiex_private *priv,
spin_lock_irqsave(&priv->sta_list_spinlock, flags); spin_lock_irqsave(&priv->sta_list_spinlock, flags);
list_for_each_entry(sta_ptr, &priv->sta_list, list) { list_for_each_entry(sta_ptr, &priv->sta_list, list) {
if (sta_ptr->tdls_status == TDLS_SETUP_COMPLETE) { if (mwifiex_is_tdls_link_setup(sta_ptr->tdls_status)) {
ether_addr_copy(peer->peer_addr, sta_ptr->mac_addr); ether_addr_copy(peer->peer_addr, sta_ptr->mac_addr);
peer++; peer++;
count++; count++;
...@@ -1301,7 +1301,7 @@ void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv, ...@@ -1301,7 +1301,7 @@ void mwifiex_auto_tdls_update_peer_status(struct mwifiex_private *priv,
if ((link_status == TDLS_NOT_SETUP) && if ((link_status == TDLS_NOT_SETUP) &&
(peer->tdls_status == TDLS_SETUP_INPROGRESS)) (peer->tdls_status == TDLS_SETUP_INPROGRESS))
peer->failure_count++; peer->failure_count++;
else if (link_status == TDLS_SETUP_COMPLETE) else if (mwifiex_is_tdls_link_setup(link_status))
peer->failure_count = 0; peer->failure_count = 0;
peer->tdls_status = link_status; peer->tdls_status = link_status;
...@@ -1373,7 +1373,7 @@ void mwifiex_check_auto_tdls(unsigned long context) ...@@ -1373,7 +1373,7 @@ void mwifiex_check_auto_tdls(unsigned long context)
if (((tdls_peer->rssi >= MWIFIEX_TDLS_RSSI_LOW) || if (((tdls_peer->rssi >= MWIFIEX_TDLS_RSSI_LOW) ||
!tdls_peer->rssi) && !tdls_peer->rssi) &&
tdls_peer->tdls_status == TDLS_SETUP_COMPLETE) { mwifiex_is_tdls_link_setup(tdls_peer->tdls_status)) {
tdls_peer->tdls_status = TDLS_LINK_TEARDOWN; tdls_peer->tdls_status = TDLS_LINK_TEARDOWN;
mwifiex_dbg(priv->adapter, MSG, mwifiex_dbg(priv->adapter, MSG,
"teardown TDLS link,peer=%pM rssi=%d\n", "teardown TDLS link,peer=%pM rssi=%d\n",
......
...@@ -162,8 +162,8 @@ void mwifiex_ralist_add(struct mwifiex_private *priv, const u8 *ra) ...@@ -162,8 +162,8 @@ void mwifiex_ralist_add(struct mwifiex_private *priv, const u8 *ra)
ra_list->amsdu_in_ampdu = false; ra_list->amsdu_in_ampdu = false;
ra_list->tx_paused = false; ra_list->tx_paused = false;
if (!mwifiex_queuing_ra_based(priv)) { if (!mwifiex_queuing_ra_based(priv)) {
if (mwifiex_get_tdls_link_status(priv, ra) == if (mwifiex_is_tdls_link_setup
TDLS_SETUP_COMPLETE) { (mwifiex_get_tdls_link_status(priv, ra))) {
ra_list->tdls_link = true; ra_list->tdls_link = true;
ra_list->is_11n_enabled = ra_list->is_11n_enabled =
mwifiex_tdls_peer_11n_enabled(priv, ra); mwifiex_tdls_peer_11n_enabled(priv, ra);
...@@ -806,6 +806,9 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv, ...@@ -806,6 +806,9 @@ mwifiex_wmm_add_buf_txqueue(struct mwifiex_private *priv,
!mwifiex_is_skb_mgmt_frame(skb)) { !mwifiex_is_skb_mgmt_frame(skb)) {
switch (tdls_status) { switch (tdls_status) {
case TDLS_SETUP_COMPLETE: case TDLS_SETUP_COMPLETE:
case TDLS_CHAN_SWITCHING:
case TDLS_IN_BASE_CHAN:
case TDLS_IN_OFF_CHAN:
ra_list = mwifiex_wmm_get_queue_raptr(priv, tid_down, ra_list = mwifiex_wmm_get_queue_raptr(priv, tid_down,
ra); ra);
tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT; tx_info->flags |= MWIFIEX_BUF_FLAG_TDLS_PKT;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment