|
@@ -2724,6 +2724,65 @@ out:
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
+int wl1271_op_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
|
|
|
+ enum ieee80211_ampdu_mlme_action action,
|
|
|
+ struct ieee80211_sta *sta, u16 tid, u16 *ssn)
|
|
|
+{
|
|
|
+ struct wl1271 *wl = hw->priv;
|
|
|
+ int ret;
|
|
|
+
|
|
|
+ mutex_lock(&wl->mutex);
|
|
|
+
|
|
|
+ if (unlikely(wl->state == WL1271_STATE_OFF)) {
|
|
|
+ ret = -EAGAIN;
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
+ ret = wl1271_ps_elp_wakeup(wl, false);
|
|
|
+ if (ret < 0)
|
|
|
+ goto out;
|
|
|
+
|
|
|
+ switch (action) {
|
|
|
+ case IEEE80211_AMPDU_RX_START:
|
|
|
+ if (wl->ba_support) {
|
|
|
+ ret = wl1271_acx_set_ba_receiver_session(wl, tid, *ssn,
|
|
|
+ true);
|
|
|
+ if (!ret)
|
|
|
+ wl->ba_rx_bitmap |= BIT(tid);
|
|
|
+ } else {
|
|
|
+ ret = -ENOTSUPP;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case IEEE80211_AMPDU_RX_STOP:
|
|
|
+ ret = wl1271_acx_set_ba_receiver_session(wl, tid, 0, false);
|
|
|
+ if (!ret)
|
|
|
+ wl->ba_rx_bitmap &= ~BIT(tid);
|
|
|
+ break;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * The BA initiator session management in FW independently.
|
|
|
+ * Falling break here on purpose for all TX APDU commands.
|
|
|
+ */
|
|
|
+ case IEEE80211_AMPDU_TX_START:
|
|
|
+ case IEEE80211_AMPDU_TX_STOP:
|
|
|
+ case IEEE80211_AMPDU_TX_OPERATIONAL:
|
|
|
+ ret = -EINVAL;
|
|
|
+ break;
|
|
|
+
|
|
|
+ default:
|
|
|
+ wl1271_error("Incorrect ampdu action id=%x\n", action);
|
|
|
+ ret = -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ wl1271_ps_elp_sleep(wl);
|
|
|
+
|
|
|
+out:
|
|
|
+ mutex_unlock(&wl->mutex);
|
|
|
+
|
|
|
+ return ret;
|
|
|
+}
|
|
|
+
|
|
|
/* can't be const, mac80211 writes to this */
|
|
|
static struct ieee80211_rate wl1271_rates[] = {
|
|
|
{ .bitrate = 10,
|
|
@@ -2973,6 +3032,7 @@ static const struct ieee80211_ops wl1271_ops = {
|
|
|
.get_survey = wl1271_op_get_survey,
|
|
|
.sta_add = wl1271_op_sta_add,
|
|
|
.sta_remove = wl1271_op_sta_remove,
|
|
|
+ .ampdu_action = wl1271_op_ampdu_action,
|
|
|
CFG80211_TESTMODE_CMD(wl1271_tm_cmd)
|
|
|
};
|
|
|
|