Skip to content

Commit

Permalink
Modified ampdu/amsdu related code.
Browse files Browse the repository at this point in the history
Let mwlwifi driver can work with lastest mac80211's APIs.

Signed-off-by: David Lin <dlin@marvell.com>
  • Loading branch information
yuhhaurlin committed Jun 1, 2016
1 parent af93c39 commit 8759b55
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 52 deletions.
12 changes: 8 additions & 4 deletions mac80211.c
Expand Up @@ -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;

Expand Down Expand Up @@ -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:
Expand All @@ -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);
Expand All @@ -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);
Expand Down
37 changes: 0 additions & 37 deletions rx.c
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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:
Expand Down
11 changes: 0 additions & 11 deletions tx.c
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 8759b55

Please sign in to comment.