Re: [PATCH] net: nl80211 - pass name_assign_type to rdev_add_virtual_intf()

2015-03-30 Thread Johannes Berg
On Wed, 2015-03-18 at 11:13 +0100, Tom Gundersen wrote:
> This will expose in /sys whether the ifname of a device is set by userspace
> or generated by the kernel. The latter kind (wlanX, etc) is not deterministic,
> so userspace needs to rename these devices to names that are guaranteed to
> stay the same between reboots. The former, however should never be renamed,
> so userspace needs to be able to reliably tell the difference.
> 
> Similar functionality was introduced for the rtnetlink core in commit 5517750.

Applied - I rewrapped the commit log to fit 72 cols and expanded the
commit ID to 12 hex chars and added the subject.

johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net: nl80211 - pass name_assign_type to rdev_add_virtual_intf()

2015-03-30 Thread Johannes Berg
On Wed, 2015-03-18 at 11:13 +0100, Tom Gundersen wrote:
 This will expose in /sys whether the ifname of a device is set by userspace
 or generated by the kernel. The latter kind (wlanX, etc) is not deterministic,
 so userspace needs to rename these devices to names that are guaranteed to
 stay the same between reboots. The former, however should never be renamed,
 so userspace needs to be able to reliably tell the difference.
 
 Similar functionality was introduced for the rtnetlink core in commit 5517750.

Applied - I rewrapped the commit log to fit 72 cols and expanded the
commit ID to 12 hex chars and added the subject.

johannes

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] net: nl80211 - pass name_assign_type to rdev_add_virtual_intf()

2015-03-18 Thread Tom Gundersen
This will expose in /sys whether the ifname of a device is set by userspace
or generated by the kernel. The latter kind (wlanX, etc) is not deterministic,
so userspace needs to rename these devices to names that are guaranteed to
stay the same between reboots. The former, however should never be renamed,
so userspace needs to be able to reliably tell the difference.

Similar functionality was introduced for the rtnetlink core in commit 5517750.

Signed-off-by: Tom Gundersen 
Cc: Kalle Valo 
Cc: Brett Rudley 
Cc: Arend van Spriel 
Cc: Franky (Zhenhui) Lin 
Cc: Hante Meuleman 
Cc: Johannes Berg 
---

Hi Johannes,

This patch was originally part of a bigger series from last year, but I decided
to split it out and resend it alone. You had a comment back then about using
enums instead of unsigned char in the method signatures. Both sound fine to me,
but I opted for keeping unsigned char for the sake of uniformity with the 
similar
code in the core.

If this looks ok to you, could you take it through the wireless tree, or do you
want me to resend it to Dave directly?

Cheers,

Tom

 drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 --
 drivers/net/wireless/ath/ath6kl/cfg80211.h | 1 +
 drivers/net/wireless/ath/ath6kl/core.c | 4 ++--
 drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 3 ++-
 drivers/net/wireless/brcm80211/brcmfmac/p2p.c  | 3 +++
 drivers/net/wireless/brcm80211/brcmfmac/p2p.h  | 1 +
 drivers/net/wireless/mwifiex/cfg80211.c| 5 +++--
 drivers/net/wireless/mwifiex/main.c| 6 +++---
 drivers/net/wireless/mwifiex/main.h| 1 +
 drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c  | 6 +-
 include/net/cfg80211.h | 1 +
 net/mac80211/cfg.c | 3 ++-
 net/mac80211/ieee80211_i.h | 1 +
 net/mac80211/iface.c   | 3 ++-
 net/mac80211/main.c| 2 +-
 net/wireless/nl80211.c | 3 ++-
 net/wireless/rdev-ops.h| 5 +++--
 17 files changed, 37 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c 
b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 85da63a..0cb5433 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1495,6 +1495,7 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy 
*wiphy,
 
 static struct wireless_dev *ath6kl_cfg80211_add_iface(struct wiphy *wiphy,
  const char *name,
+ unsigned char 
name_assign_type,
  enum nl80211_iftype type,
  u32 *flags,
  struct vif_params *params)
@@ -1513,7 +1514,7 @@ static struct wireless_dev 
*ath6kl_cfg80211_add_iface(struct wiphy *wiphy,
return ERR_PTR(-EINVAL);
}
 
-   wdev = ath6kl_interface_add(ar, name, type, if_idx, nw_type);
+   wdev = ath6kl_interface_add(ar, name, name_assign_type, type, if_idx, 
nw_type);
if (!wdev)
return ERR_PTR(-ENOMEM);
 
@@ -3633,13 +3634,14 @@ void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif)
 }
 
 struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
+ unsigned char name_assign_type,
  enum nl80211_iftype type,
  u8 fw_vif_idx, u8 nw_type)
 {
struct net_device *ndev;
struct ath6kl_vif *vif;
 
-   ndev = alloc_netdev(sizeof(*vif), name, NET_NAME_UNKNOWN, ether_setup);
+   ndev = alloc_netdev(sizeof(*vif), name, name_assign_type, ether_setup);
if (!ndev)
return NULL;
 
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h 
b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index b59becd..5aa57a7 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -25,6 +25,7 @@ enum ath6kl_cfg_suspend_mode {
 };
 
 struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
+ unsigned char name_assign_type,
  enum nl80211_iftype type,
  u8 fw_vif_idx, u8 nw_type);
 void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
diff --git a/drivers/net/wireless/ath/ath6kl/core.c 
b/drivers/net/wireless/ath/ath6kl/core.c
index 0df74b2..4ec02ce 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -211,8 +211,8 @@ int ath6kl_core_init(struct ath6kl *ar, enum 
ath6kl_htc_type htc_type)
rtnl_lock();
 
/* Add an initial station 

[PATCH] net: nl80211 - pass name_assign_type to rdev_add_virtual_intf()

2015-03-18 Thread Tom Gundersen
This will expose in /sys whether the ifname of a device is set by userspace
or generated by the kernel. The latter kind (wlanX, etc) is not deterministic,
so userspace needs to rename these devices to names that are guaranteed to
stay the same between reboots. The former, however should never be renamed,
so userspace needs to be able to reliably tell the difference.

Similar functionality was introduced for the rtnetlink core in commit 5517750.

Signed-off-by: Tom Gundersen t...@jklm.no
Cc: Kalle Valo kv...@qca.qualcomm.com
Cc: Brett Rudley brud...@broadcom.com
Cc: Arend van Spriel ar...@broadcom.com
Cc: Franky (Zhenhui) Lin fran...@broadcom.com
Cc: Hante Meuleman meule...@broadcom.com
Cc: Johannes Berg johan...@sipsolutions.net
---

Hi Johannes,

This patch was originally part of a bigger series from last year, but I decided
to split it out and resend it alone. You had a comment back then about using
enums instead of unsigned char in the method signatures. Both sound fine to me,
but I opted for keeping unsigned char for the sake of uniformity with the 
similar
code in the core.

If this looks ok to you, could you take it through the wireless tree, or do you
want me to resend it to Dave directly?

Cheers,

Tom

 drivers/net/wireless/ath/ath6kl/cfg80211.c | 6 --
 drivers/net/wireless/ath/ath6kl/cfg80211.h | 1 +
 drivers/net/wireless/ath/ath6kl/core.c | 4 ++--
 drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 3 ++-
 drivers/net/wireless/brcm80211/brcmfmac/p2p.c  | 3 +++
 drivers/net/wireless/brcm80211/brcmfmac/p2p.h  | 1 +
 drivers/net/wireless/mwifiex/cfg80211.c| 5 +++--
 drivers/net/wireless/mwifiex/main.c| 6 +++---
 drivers/net/wireless/mwifiex/main.h| 1 +
 drivers/staging/rtl8723au/os_dep/ioctl_cfg80211.c  | 6 +-
 include/net/cfg80211.h | 1 +
 net/mac80211/cfg.c | 3 ++-
 net/mac80211/ieee80211_i.h | 1 +
 net/mac80211/iface.c   | 3 ++-
 net/mac80211/main.c| 2 +-
 net/wireless/nl80211.c | 3 ++-
 net/wireless/rdev-ops.h| 5 +++--
 17 files changed, 37 insertions(+), 17 deletions(-)

diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c 
b/drivers/net/wireless/ath/ath6kl/cfg80211.c
index 85da63a..0cb5433 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.c
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c
@@ -1495,6 +1495,7 @@ static int ath6kl_cfg80211_set_power_mgmt(struct wiphy 
*wiphy,
 
 static struct wireless_dev *ath6kl_cfg80211_add_iface(struct wiphy *wiphy,
  const char *name,
+ unsigned char 
name_assign_type,
  enum nl80211_iftype type,
  u32 *flags,
  struct vif_params *params)
@@ -1513,7 +1514,7 @@ static struct wireless_dev 
*ath6kl_cfg80211_add_iface(struct wiphy *wiphy,
return ERR_PTR(-EINVAL);
}
 
-   wdev = ath6kl_interface_add(ar, name, type, if_idx, nw_type);
+   wdev = ath6kl_interface_add(ar, name, name_assign_type, type, if_idx, 
nw_type);
if (!wdev)
return ERR_PTR(-ENOMEM);
 
@@ -3633,13 +3634,14 @@ void ath6kl_cfg80211_vif_cleanup(struct ath6kl_vif *vif)
 }
 
 struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
+ unsigned char name_assign_type,
  enum nl80211_iftype type,
  u8 fw_vif_idx, u8 nw_type)
 {
struct net_device *ndev;
struct ath6kl_vif *vif;
 
-   ndev = alloc_netdev(sizeof(*vif), name, NET_NAME_UNKNOWN, ether_setup);
+   ndev = alloc_netdev(sizeof(*vif), name, name_assign_type, ether_setup);
if (!ndev)
return NULL;
 
diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.h 
b/drivers/net/wireless/ath/ath6kl/cfg80211.h
index b59becd..5aa57a7 100644
--- a/drivers/net/wireless/ath/ath6kl/cfg80211.h
+++ b/drivers/net/wireless/ath/ath6kl/cfg80211.h
@@ -25,6 +25,7 @@ enum ath6kl_cfg_suspend_mode {
 };
 
 struct wireless_dev *ath6kl_interface_add(struct ath6kl *ar, const char *name,
+ unsigned char name_assign_type,
  enum nl80211_iftype type,
  u8 fw_vif_idx, u8 nw_type);
 void ath6kl_cfg80211_ch_switch_notify(struct ath6kl_vif *vif, int freq,
diff --git a/drivers/net/wireless/ath/ath6kl/core.c 
b/drivers/net/wireless/ath/ath6kl/core.c
index 0df74b2..4ec02ce 100644
--- a/drivers/net/wireless/ath/ath6kl/core.c
+++ b/drivers/net/wireless/ath/ath6kl/core.c
@@ -211,8 +211,8