Skip to contentSkip to conversation

mac80211: Support multiple VIFS per AP in debugfs.

mac80211 [email protected] 4 participants 15 messages Sep 21, 2010 – Sep 23, 2010 mac80211

lore
Share & tools
lore
#0 lore raw

From: Ben Greear <[email protected]>

MAC address of AP isn't unique..need to add the device name as well.

---
:100644 100644 76839d4... e802fce... M net/mac80211/debugfs_sta.c

 net/mac80211/debugfs_sta.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
net/mac80211/debugfs_sta.c +3 -2
index 76839d4..e802fce 100644
@@ -301,14 +301,15 @@ STA_OPS(ht_capa);
 void ieee80211_sta_debugfs_add(struct sta_info *sta)
 {
 	struct dentry *stations_dir = sta->local->debugfs.stations;
-	u8 mac[3*ETH_ALEN];
+	u8 mac[3*ETH_ALEN + IFNAMSIZ + 2];
 
 	sta->debugfs.add_has_run = true;
 
 	if (!stations_dir)
 		return;
 
-	snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+	snprintf(mac, sizeof(mac), "%pM-%s",
+		 sta->sta.addr, sta->sdata->name);
 
 	/*
 	 * This might fail due to a race condition:
Signature · 1 line
1.7.2.2
#1 lore raw
Quoted 23 lines · On 09/21/2010 05:15 AM, [email protected] wrote:

From: Ben Greear<[email protected]>

MAC address of AP isn't unique..need to add the device name as well.

---
:100644 100644 76839d4... e802fce... M net/mac80211/debugfs_sta.c

  net/mac80211/debugfs_sta.c |    5 +++--
  1 files changed, 3 insertions(+), 2 deletions(-)
net/mac80211/debugfs_sta.c +1 -1
index 76839d4..e802fce 100644
@@ -301,14 +301,15 @@ STA_OPS(ht_capa);
  void ieee80211_sta_debugfs_add(struct sta_info *sta)
  {
  	struct dentry *stations_dir = sta->local->debugfs.stations;
-	u8 mac[3*ETH_ALEN];
+	u8 mac[3*ETH_ALEN + IFNAMSIZ + 2];
 
  	sta->debugfs.add_has_run = true;

net/mac80211/debugfs_sta.c STA_OPS(ht_capa); · line 315

Quoted 10 lines
net/mac80211/debugfs_sta.c +2 -1
 
  	if (!stations_dir)
  		return;
 
-	snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+	snprintf(mac, sizeof(mac), "%pM-%s",
+		 sta->sta.addr, sta->sdata->name);
 
  	/*
  	 * This might fail due to a race condition:

I got to thinking: Is there any reason to put the sta.addr in there?

Maybe just use sta->sdata->name? Seems it might be easier for scripts to deal with?

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
maintainer
#2 lore raw
Quoted 11 lines · Ben Greear

net/mac80211/debugfs_sta.c STA_OPS(ht_capa); · line 315

Quoted 6 lines
net/mac80211/debugfs_sta.c +2 -1
-	snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+	snprintf(mac, sizeof(mac), "%pM-%s",
+		 sta->sta.addr, sta->sdata->name);
 
  	/*
  	 * This might fail due to a race condition:

I got to thinking: Is there any reason to put the sta.addr in there?

Maybe just use sta->sdata->name? Seems it might be easier for scripts to deal with?

APs have many STAs

johannes

#3 lore raw
Quoted 11 lines · Johannes Berg
Quoted 9 lines · Ben Greear

net/mac80211/debugfs_sta.c STA_OPS(ht_capa); · line 315

Quoted 6 lines
net/mac80211/debugfs_sta.c +2 -1
-	snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+	snprintf(mac, sizeof(mac), "%pM-%s",
+		 sta->sta.addr, sta->sdata->name);
 
   	/*
   	 * This might fail due to a race condition:

I got to thinking: Is there any reason to put the sta.addr in there?

Quoted 4 lines
Quoted 2 lines

Maybe just use sta->sdata->name? Seems it might be easier for scripts to deal with?

APs have many STAs

So, when in STA mode, sta_info are related to local VIFs, but in AP mode, they represent the remote wireless devices, with sdata pointing to the local AP interface?

Thanks,
Ben

Quoted 2 lines

johannes

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
maintainer
#4 lore raw
Quoted 12 lines · Ben Greear
Quoted 11 lines · Johannes Berg
Quoted 9 lines · Ben Greear

net/mac80211/debugfs_sta.c STA_OPS(ht_capa); · line 315

Quoted 6 lines
net/mac80211/debugfs_sta.c +2 -1
-	snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+	snprintf(mac, sizeof(mac), "%pM-%s",
+		 sta->sta.addr, sta->sdata->name);
 
   	/*
   	 * This might fail due to a race condition:

I got to thinking: Is there any reason to put the sta.addr in there?

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Maybe just use sta->sdata->name? Seems it might be easier for scripts to deal with?

APs have many STAs

So, when in STA mode, sta_info are related to local VIFs, but in AP mode, they represent the remote wireless devices, with sdata pointing to the local AP interface?

No, there's a sta_info for each peer, which in STA mode is only the AP.

johannes

maintainer
#5 lore raw
Quoted 12 lines · Johannes Berg
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines

net/mac80211/debugfs_sta.c STA_OPS(ht_capa); · line 315

Quoted 6 lines
net/mac80211/debugfs_sta.c +2 -1
-	snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+	snprintf(mac, sizeof(mac), "%pM-%s",
+		 sta->sta.addr, sta->sdata->name);
 
   	/*
   	 * This might fail due to a race condition:

I got to thinking: Is there any reason to put the sta.addr in there?

Maybe just use sta->sdata->name? Seems it might be easier for scripts to deal with?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

APs have many STAs

So, when in STA mode, sta_info are related to local VIFs, but in AP mode, they represent the remote wireless devices, with sdata pointing to the local AP interface?

No, there's a sta_info for each peer, which in STA mode is only the AP.

maybe the stations should be moved from phy0/stations/ to phy0/wlan0/stations/ instead?

johannes

#6 lore raw
Quoted 16 lines · Johannes Berg
Quoted 14 lines · Johannes Berg
Quoted 14 lines
Quoted 13 lines
Quoted 11 lines

net/mac80211/debugfs_sta.c STA_OPS(ht_capa); · line 315

Quoted 6 lines
net/mac80211/debugfs_sta.c +2 -1
-	snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+	snprintf(mac, sizeof(mac), "%pM-%s",
+		 sta->sta.addr, sta->sdata->name);
 
    	/*
    	 * This might fail due to a race condition:

I got to thinking: Is there any reason to put the sta.addr in there?

Maybe just use sta->sdata->name? Seems it might be easier for scripts to deal with?

APs have many STAs

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

So, when in STA mode, sta_info are related to local VIFs, but in AP mode, they represent the remote wireless devices, with sdata pointing to the local AP interface?

No, there's a sta_info for each peer, which in STA mode is only the AP.

maybe the stations should be moved from phy0/stations/ to phy0/wlan0/stations/ instead?

That would be fine with me.

Thanks,
Ben

Quoted 2 lines

johannes

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
#7 lore raw
In reply to Johannes Berg
Quoted 16 lines · Johannes Berg
Quoted 14 lines · Johannes Berg
Quoted 14 lines
Quoted 13 lines
Quoted 11 lines

net/mac80211/debugfs_sta.c STA_OPS(ht_capa); · line 315

Quoted 6 lines
net/mac80211/debugfs_sta.c +2 -1
-	snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+	snprintf(mac, sizeof(mac), "%pM-%s",
+		 sta->sta.addr, sta->sdata->name);
 
    	/*
    	 * This might fail due to a race condition:

I got to thinking: Is there any reason to put the sta.addr in there?

Maybe just use sta->sdata->name? Seems it might be easier for scripts to deal with?

APs have many STAs

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

So, when in STA mode, sta_info are related to local VIFs, but in AP mode, they represent the remote wireless devices, with sdata pointing to the local AP interface?

No, there's a sta_info for each peer, which in STA mode is only the AP.

maybe the stations should be moved from phy0/stations/ to phy0/wlan0/stations/ instead?

It doesn't matter either way to me, but I'd like to get one or another patch upstream.

If you want me to change it to put stations under netdev:wlan0/ instead, please just let me know.

Thanks,
Ben

Quoted 2 lines

johannes

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
maintainer
#8 lore raw
Quoted 8 lines · Ben Greear
Quoted 2 lines

maybe the stations should be moved from phy0/stations/ to phy0/wlan0/stations/ instead?

It doesn't matter either way to me, but I'd like to get one or another patch upstream.

If you want me to change it to put stations under netdev:wlan0/ instead, please just let me know.

I'd prefer that, if you want to do this.

johannes

#9 lore raw
Quoted 8 lines · Johannes Berg
Quoted 6 lines · Ben Greear
Quoted 2 lines

maybe the stations should be moved from phy0/stations/ to phy0/wlan0/stations/ instead?

It doesn't matter either way to me, but I'd like to get one or another patch upstream.

Quoted 6 lines
Quoted 2 lines

If you want me to change it to put stations under netdev:wlan0/ instead, please just let me know.

I'd prefer that, if you want to do this.

johannes

Something like this?

net/mac80211/debugfs.c +0 -1
index e81ef4e..ebd5b69 100644
@@ -368,7 +368,6 @@ void debugfs_hw_add(struct ieee80211_local *local)
        if (!phyd)
                return;
 
-       local->debugfs.stations = debugfs_create_dir("stations", phyd);
        local->debugfs.keys = debugfs_create_dir("keys", phyd);
 
        DEBUGFS_ADD(frequency);
net/mac80211/debugfs_sta.c +2 -2
index 76839d4..dea24e6 100644
@@ -300,7 +300,7 @@ STA_OPS(ht_capa);
 
 void ieee80211_sta_debugfs_add(struct sta_info *sta)
 {
-       struct dentry *stations_dir = sta->local->debugfs.stations;
+       struct dentry *stations_dir = sta->sdata->debugfs.dir;
        u8 mac[3*ETH_ALEN];
 
        sta->debugfs.add_has_run = true;
@@ -308,7 +308,7 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
        if (!stations_dir)
                return;
 
-       snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+       snprintf(mac, sizeof(mac), "sta-%pM", sta->sta.addr);
 
        /*
         * This might fail due to a race condition:
net/mac80211/ieee80211_i.h +0 -1
index 9346a6b..d03191c 100644
@@ -899,7 +899,6 @@ struct ieee80211_local {
 #ifdef CONFIG_MAC80211_DEBUGFS
        struct local_debugfsdentries {
                struct dentry *rcdir;
-               struct dentry *stations;
                struct dentry *keys;
        } debugfs;
 #endif
Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
maintainer
#10 lore raw

net/mac80211/debugfs_sta.c void ieee80211_sta_debugfs_add(struct sta_info *sta) · line 311

Quoted 6 lines · Ben Greear
net/mac80211/debugfs_sta.c +1 -1
@@ -308,7 +308,7 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
         if (!stations_dir)
                 return;
 
-       snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+       snprintf(mac, sizeof(mac), "sta-%pM", sta->sta.addr);

Wouldn't a stations/ subdirectory in netdev:wlan0 be nicer? I don't really care too much -- what do others think?

johannes

#11 lore raw
Quoted 11 lines · Johannes Berg

net/mac80211/debugfs_sta.c void ieee80211_sta_debugfs_add(struct sta_info *sta) · line 311

Quoted 6 lines · Ben Greear
net/mac80211/debugfs_sta.c +1 -1
@@ -308,7 +308,7 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
         if (!stations_dir)
                 return;
 
-       snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+       snprintf(mac, sizeof(mac), "sta-%pM", sta->sta.addr);

Wouldn't a stations/ subdirectory in netdev:wlan0 be nicer? I don't really care too much -- what do others think?

Sounds better that way to me too...

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#12 lore raw
Quoted 7 lines · John W. Linville
Quoted 6 lines · Johannes Berg
Quoted 4 lines · Ben Greear
(quoted diff) +0 -0
@@ -308,7 +308,7 @@ void ieee80211_sta_debugfs_add(struct sta_info *sta)
          if (!stations_dir)
                  return;
 
Quoted 8 lines
Quoted 5 lines

Review void ieee80211_sta_debugfs_add(struct sta_info *sta) · line 311

Quoted 2 lines
(quoted diff) +1 -1
-       snprintf(mac, sizeof(mac), "%pM", sta->sta.addr);
+       snprintf(mac, sizeof(mac), "sta-%pM", sta->sta.addr);

Wouldn't a stations/ subdirectory in netdev:wlan0 be nicer? I don't really care too much -- what do others think?

Sounds better that way to me too...

This look better?

net/mac80211/debugfs.c +0 -1
index e81ef4e..ebd5b69 100644
@@ -368,7 +368,6 @@ void debugfs_hw_add(struct ieee80211_local *local)
        if (!phyd)
                return;
 
-       local->debugfs.stations = debugfs_create_dir("stations", phyd);
        local->debugfs.keys = debugfs_create_dir("keys", phyd);
 
        DEBUGFS_ADD(frequency);
net/mac80211/debugfs_netdev.c +3 -0
index 20b2998..3e12430 100644
@@ -409,6 +409,9 @@ void ieee80211_debugfs_add_netdev(struct ieee80211_sub_if_data *sdata)
        sprintf(buf, "netdev:%s", sdata->name);
        sdata->debugfs.dir = debugfs_create_dir(buf,
                sdata->local->hw.wiphy->debugfsdir);
+       if (sdata->debugfs.dir)
+               sdata->debugfs.subdir_stations = debugfs_create_dir("stations",
+                       sdata->debugfs.dir);
        add_files(sdata);
 }
 
net/mac80211/debugfs_sta.c +1 -1
index 76839d4..6b7ff9f 100644
@@ -300,7 +300,7 @@ STA_OPS(ht_capa);
 
 void ieee80211_sta_debugfs_add(struct sta_info *sta)
 {
-       struct dentry *stations_dir = sta->local->debugfs.stations;
+       struct dentry *stations_dir = sta->sdata->debugfs.subdir_stations;
        u8 mac[3*ETH_ALEN];
 
        sta->debugfs.add_has_run = true;
net/mac80211/ieee80211_i.h +1 -1
index 9346a6b..3c7c230 100644
@@ -564,6 +564,7 @@ struct ieee80211_sub_if_data {
 #ifdef CONFIG_MAC80211_DEBUGFS
        struct {
                struct dentry *dir;
+               struct dentry *subdir_stations;
                struct dentry *default_key;
                struct dentry *default_mgmt_key;
        } debugfs;
@@ -899,7 +900,6 @@ struct ieee80211_local {
 #ifdef CONFIG_MAC80211_DEBUGFS
        struct local_debugfsdentries {
                struct dentry *rcdir;
-               struct dentry *stations;
                struct dentry *keys;
        } debugfs;
 #endif
Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
maintainer
#13 lore raw
Quoted 7 lines · Ben Greear

This look better?

net/mac80211/debugfs.c +0 -0
index e81ef4e..ebd5b69 100644

net/mac80211/debugfs.c void debugfs_hw_add(struct ieee80211_local *local) · line 373

Quoted 7 lines
net/mac80211/debugfs.c +0 -1
@@ -368,7 +368,6 @@ void debugfs_hw_add(struct ieee80211_local *local)
         if (!phyd)
                 return;
 
-       local->debugfs.stations = debugfs_create_dir("stations", phyd);
         local->debugfs.keys = debugfs_create_dir("keys", phyd);
 
         DEBUGFS_ADD(frequency);

Yeah, but completely whitespace damaged, you're going to have to work on your submissions :)

Also, why do you do "[mac80211] mac80211" rather than "[PATCH] mac80211"?

johannes

#14 lore raw
Quoted 15 lines · Johannes Berg
Quoted 13 lines · Ben Greear

This look better?

net/mac80211/debugfs.c +0 -1
index e81ef4e..ebd5b69 100644
@@ -368,7 +368,6 @@ void debugfs_hw_add(struct ieee80211_local *local)
          if (!phyd)
                  return;
 
-       local->debugfs.stations = debugfs_create_dir("stations", phyd);
          local->debugfs.keys = debugfs_create_dir("keys", phyd);
 
Quoted 7 lines

net/mac80211/debugfs.c void debugfs_hw_add(struct ieee80211_local *local) · line 373

Quoted 1 line
net/mac80211/debugfs.c +0 -0
          DEBUGFS_ADD(frequency);

Yeah, but completely whitespace damaged, you're going to have to work on your submissions :)

Also, why do you do "[mac80211] mac80211" rather than "[PATCH] mac80211"?

That was just pasted into email..I'll fix up your other suggestions and re-submit using git. I'll see if I can get the email subject more correct as well.

Thanks,
Ben

Quoted 2 lines

johannes

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com