Search Linux Wireless

[PATCHv2 3/3] mac80211_hwsim: Implement ieee80211_ops:tx_last_beacon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Without this you won't see probe responses in an IBSS/hwsim network,
which is convenient for testing.

Signed-off-by: Javier Cardona <javier@xxxxxxxxxxx>
---
 drivers/net/wireless/mac80211_hwsim.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index deed95f..e4b6ca6 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -47,6 +47,8 @@ static bool fake_hw_scan;
 module_param(fake_hw_scan, bool, 0444);
 MODULE_PARM_DESC(fake_hw_scan, "Install fake (no-op) hw-scan handler");
 
+static struct ieee80211_hw *txed_last_beacon;
+
 /**
  * enum hwsim_regtest - the type of regulatory tests we offer
  *
@@ -821,6 +823,7 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
 	hdr = (struct ieee80211_hdr_3addr *) skb->data;
 	tsfpos = (__le64 *) (hdr + 1);
 	put_unaligned(__mac80211_hwsim_get_tsf(data), tsfpos);
+	txed_last_beacon = hw;
 
 	mac80211_hwsim_monitor_rx(hw, skb);
 
@@ -1220,6 +1223,11 @@ static void mac80211_hwsim_sw_scan_complete(struct ieee80211_hw *hw)
 	mutex_unlock(&hwsim->mutex);
 }
 
+static int mac80211_hwsim_tx_last_beacon(struct ieee80211_hw *hw)
+{
+	return (hw == txed_last_beacon);
+}
+
 static struct ieee80211_ops mac80211_hwsim_ops =
 {
 	.tx = mac80211_hwsim_tx,
@@ -1244,6 +1252,7 @@ static struct ieee80211_ops mac80211_hwsim_ops =
 	.flush = mac80211_hwsim_flush,
 	.get_tsf = mac80211_hwsim_get_tsf,
 	.set_tsf = mac80211_hwsim_set_tsf,
+	.tx_last_beacon = mac80211_hwsim_tx_last_beacon,
 };
 
 
-- 
1.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux