linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* question on "mac80211_hwsim: support any address in userspace"
@ 2015-12-16  3:29 Ben Greear
  2015-12-16  9:17 ` Johannes Berg
  2015-12-16 13:21 ` me@bobcopeland.com >> Bob Copeland
  0 siblings, 2 replies; 24+ messages in thread
From: Ben Greear @ 2015-12-16  3:29 UTC (permalink / raw)
  To: linux-wireless@vger.kernel.org,
	me@bobcopeland.com >> Bob Copeland

This patch below was added to the kernel around 2/24/2015

I am curious mostly about the first change:  I thought the transmitter-addr
relates to the radio device, not the vdev (sta, ap, etc).

But, wouldn't using data from the header break that assumption?


Is there any actual advantage to having more than one address per
hwsim radio?  It seems it complicates things for no particular
reason as far as I can tell?

Thanks,
Ben


mac80211_hwsim: support any address in userspace

     Due to the checks in get_hwsim_data_ref_from_addr, wmediumd
     was only able to use the second mac address (those starting with
     0x42).  This is confusing and needlessly limiting, so allow any
     configured address.

     Signed-off-by: Bob Copeland <me@bobcopeland.com>
     Signed-off-by: Johannes Berg <johannes.berg@intel.com>

-------------------- drivers/net/wireless/mac80211_hwsim.c --------------------
index 4a4c658..e259ee1 100644
@@ -906,8 +906,7 @@ static void mac80211_hwsim_tx_frame_nl(struct ieee80211_hw *hw,
  		goto nla_put_failure;
  	}

-	if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER,
-		    ETH_ALEN, data->addresses[1].addr))
+	if (nla_put(skb, HWSIM_ATTR_ADDR_TRANSMITTER, ETH_ALEN, hdr->addr2))
  		goto nla_put_failure;

  	/* We get the skb->data */
@@ -2608,7 +2607,7 @@ static struct mac80211_hwsim_data *get_hwsim_data_ref_from_addr(const u8 *addr)

  	spin_lock_bh(&hwsim_radio_lock);
  	list_for_each_entry(data, &hwsim_radios, list) {
-		if (memcmp(data->addresses[1].addr, addr, ETH_ALEN) == 0) {
+		if (mac80211_hwsim_addr_match(data, addr)) {
  			_found = true;
  			break;
  		}


-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2015-12-17 13:26 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-16  3:29 question on "mac80211_hwsim: support any address in userspace" Ben Greear
2015-12-16  9:17 ` Johannes Berg
2015-12-16 13:13   ` Ben Greear
2015-12-16 13:25     ` Johannes Berg
2015-12-16 13:35       ` Ben Greear
2015-12-16 13:42         ` Johannes Berg
2015-12-16 14:11           ` Ben Greear
2015-12-16 14:14             ` Johannes Berg
2015-12-16 14:15             ` Johannes Berg
2015-12-16 14:59               ` Bob Copeland
2015-12-16 15:52                 ` Ben Greear
2015-12-16 17:30           ` Adam R. Welle
2015-12-16 17:46             ` Bob Copeland
2015-12-16 18:57               ` Adam R. Welle
2015-12-16 22:14             ` Ben Greear
2015-12-16 22:56               ` Adam R. Welle
2015-12-16 23:20                 ` Ben Greear
2015-12-16 23:56                   ` Adam R. Welle
2015-12-17 13:26               ` Bob Copeland
2015-12-16 13:21 ` me@bobcopeland.com >> Bob Copeland
2015-12-16 13:27   ` Ben Greear
2015-12-16 13:57     ` me@bobcopeland.com >> Bob Copeland
2015-12-16 14:16       ` Ben Greear
2015-12-16 14:33         ` me@bobcopeland.com >> Bob Copeland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).