diff options
author | David Lin <dlin@marvell.com> | 2016-06-01 16:19:09 +0800 |
---|---|---|
committer | David Lin <dlin@marvell.com> | 2016-06-01 16:19:09 +0800 |
commit | 8759b558071b111a7404182cf95e9f8b0ba8cca6 (patch) | |
tree | adc8b4fa6751c170d910ad6eb96acf67bd813b23 | |
parent | af93c39bdce22b3bd1a12e6fb2a1097f9a448ecf (diff) |
Modified ampdu/amsdu related code.
Let mwlwifi driver can work with lastest mac80211's APIs.
Signed-off-by: David Lin <dlin@marvell.com>
-rw-r--r-- | mac80211.c | 12 | ||||
-rw-r--r-- | rx.c | 37 | ||||
-rw-r--r-- | tx.c | 11 |
3 files changed, 8 insertions, 52 deletions
@@ -575,13 +575,15 @@ static int mwl_mac80211_get_survey(struct ieee80211_hw *hw, static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - enum ieee80211_ampdu_mlme_action action, - struct ieee80211_sta *sta, - u16 tid, u16 *ssn, u8 buf_size, bool amsdu) + struct ieee80211_ampdu_params *params) { int rc = 0; struct mwl_priv *priv = hw->priv; struct mwl_ampdu_stream *stream; + enum ieee80211_ampdu_mlme_action action = params->action; + struct ieee80211_sta *sta = params->sta; + u16 tid = params->tid; + u8 buf_size = params->buf_size; u8 *addr = sta->addr, idx; struct mwl_sta *sta_info; @@ -621,7 +623,7 @@ static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, break; } stream->state = AMPDU_STREAM_IN_PROGRESS; - *ssn = 0; + params->ssn = 0; ieee80211_start_tx_ba_cb_irqsafe(vif, addr, tid); break; case IEEE80211_AMPDU_TX_STOP_CONT: @@ -634,6 +636,7 @@ static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, spin_unlock_bh(&priv->stream_lock); mwl_fwcmd_destroy_ba(hw, idx); spin_lock_bh(&priv->stream_lock); + sta_info->is_amsdu_allowed = false; } mwl_fwcmd_remove_stream(hw, stream); @@ -656,6 +659,7 @@ static int mwl_mac80211_ampdu_action(struct ieee80211_hw *hw, if (!rc) { stream->state = AMPDU_STREAM_ACTIVE; sta_info->check_ba_failed[tid] = 0; + sta_info->is_amsdu_allowed = params->amsdu; } else { idx = stream->idx; spin_unlock_bh(&priv->stream_lock); @@ -280,24 +280,6 @@ static inline void mwl_rx_prepare_status(struct mwl_rx_desc *pdesc, } } -static inline void mwl_rx_enable_sta_amsdu(struct mwl_priv *priv, - u8 *sta_addr) -{ - struct mwl_sta *sta_info; - struct ieee80211_sta *sta; - - spin_lock_bh(&priv->sta_lock); - list_for_each_entry(sta_info, &priv->sta_list, list) { - sta = container_of((char *)sta_info, struct ieee80211_sta, - drv_priv[0]); - if (ether_addr_equal(sta->addr, sta_addr)) { - sta_info->is_amsdu_allowed = true; - break; - } - } - spin_unlock_bh(&priv->sta_lock); -} - static inline struct mwl_vif *mwl_rx_find_vif_bss(struct mwl_priv *priv, u8 *bssid) { @@ -510,25 +492,6 @@ void mwl_rx_recv(unsigned long data) skb_put(prx_skb, pkt_len); mwl_rx_remove_dma_header(prx_skb, curr_hndl->pdesc->qos_ctrl); - wh = (struct ieee80211_hdr *)prx_skb->data; - - if (ieee80211_is_mgmt(wh->frame_control)) { - struct ieee80211_mgmt *mgmt; - __le16 capab; - - mgmt = (struct ieee80211_mgmt *)prx_skb->data; - - if (unlikely(ieee80211_is_action(wh->frame_control) && - mgmt->u.action.category == - WLAN_CATEGORY_BACK && - mgmt->u.action.u.addba_resp.action_code == - WLAN_ACTION_ADDBA_RESP)) { - capab = mgmt->u.action.u.addba_resp.capab; - if (le16_to_cpu(capab) & 1) - mwl_rx_enable_sta_amsdu(priv, mgmt->sa); - } - } - memcpy(IEEE80211_SKB_RXCB(prx_skb), &status, sizeof(status)); ieee80211_rx(hw, prx_skb); out: @@ -823,17 +823,6 @@ void mwl_tx_xmit(struct ieee80211_hw *hw, capab = le16_to_cpu(mgmt->u.action.u.addba_req.capab); tid = (capab & IEEE80211_ADDBA_PARAM_TID_MASK) >> 2; index = mwl_tx_tid_queue_mapping(tid); - capab |= 1; - mgmt->u.action.u.addba_req.capab = cpu_to_le16(capab); - } - - if (unlikely(ieee80211_is_action(wh->frame_control) && - mgmt->u.action.category == WLAN_CATEGORY_BACK && - mgmt->u.action.u.addba_resp.action_code == - WLAN_ACTION_ADDBA_RESP)) { - capab = le16_to_cpu(mgmt->u.action.u.addba_resp.capab); - capab |= 1; - mgmt->u.action.u.addba_resp.capab = cpu_to_le16(capab); } } |