Skip to contentSkip to conversation

mac80211_hwsim: implement ampdu action

PATCH New Johannes Berg 1 participant 1 message Dec 1, 2009 Networking drivers (wireless)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211_hwsim: implement ampdu action

Not that we actually ever aggregate anything, but
it could potentially be useful anyhow to simulate
aggregation sessions.

---
This must go in front of "mac80211: introduce flush operation" for that one to apply cleanly. Sorry.

 drivers/net/wireless/mac80211_hwsim.c |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
drivers/net/wireless/mac80211_hwsim.c +26 -0
@@ -828,6 +828,31 @@ static int mac80211_hwsim_testmode_cmd(s
 }
 #endif
 
+static int mac80211_hwsim_ampdu_action(struct ieee80211_hw *hw,
+				       struct ieee80211_vif *vif,
+				       enum ieee80211_ampdu_mlme_action action,
+				       struct ieee80211_sta *sta, u16 tid, u16 *ssn)
+{
+	switch (action) {
+	case IEEE80211_AMPDU_TX_START:
+		ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
+		break;
+	case IEEE80211_AMPDU_TX_STOP:
+		ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
+		break;
+	case IEEE80211_AMPDU_TX_OPERATIONAL:
+		break;
+	case IEEE80211_AMPDU_RX_START:
+	case IEEE80211_AMPDU_RX_STOP:
+		break;
+	default:
+		return -EOPNOTSUPP;
+	}
+
+	return 0;
+}
+
+
 static const struct ieee80211_ops mac80211_hwsim_ops =
 {
 	.tx = mac80211_hwsim_tx,
@@ -842,6 +867,7 @@ static const struct ieee80211_ops mac802
 	.set_tim = mac80211_hwsim_set_tim,
 	.conf_tx = mac80211_hwsim_conf_tx,
 	CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd)
+	.ampdu_action = mac80211_hwsim_ampdu_action,
 };