2008-05-14 05:18:26

by Masakazu Mokuno

[permalink] [raw]
Subject: [PATCH] wireless: Create 'device' symlink in sysfs

Some network interfaces of the wireless drivers lack the 'device'
symlink in sysfs.
This patch lets the drivers create the links.

Signed-off-by: Masakazu Mokuno <[email protected]>
---
drivers/net/wireless/airo.c | 1 +
drivers/net/wireless/ipw2200.c | 1 +
drivers/net/wireless/libertas/main.c | 1 +
3 files changed, 3 insertions(+)

--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2668,6 +2668,7 @@ static struct net_device *init_wifidev(s
dev->irq = ethdev->irq;
dev->base_addr = ethdev->base_addr;
dev->wireless_data = ethdev->wireless_data;
+ SET_NETDEV_DEV(dev, ethdev->dev.parent);
memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len);
err = register_netdev(dev);
if (err<0) {
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -11584,6 +11584,7 @@ static int ipw_prom_alloc(struct ipw_pri
priv->prom_net_dev->hard_start_xmit = ipw_prom_hard_start_xmit;

priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR;
+ SET_NETDEV_DEV(priv->prom_net_dev, &priv->pci_dev->dev);

rc = register_netdev(priv->prom_net_dev);
if (rc) {
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -1566,6 +1566,7 @@ static int lbs_add_rtap(struct lbs_priva
rtap_dev->hard_start_xmit = lbs_rtap_hard_start_xmit;
rtap_dev->set_multicast_list = lbs_set_multicast_list;
rtap_dev->priv = priv;
+ SET_NETDEV_DEV(rtap_dev, priv->dev->dev.parent);

ret = register_netdev(rtap_dev);
if (ret) {

--
Masakazu Mokuno



2008-05-14 15:30:53

by Dan Williams

[permalink] [raw]
Subject: Re: [PATCH] wireless: Create 'device' symlink in sysfs

On Wed, 2008-05-14 at 14:16 +0900, Masakazu Mokuno wrote:
> Some network interfaces of the wireless drivers lack the 'device'
> symlink in sysfs.
> This patch lets the drivers create the links.
>
> Signed-off-by: Masakazu Mokuno <[email protected]>

Libertas parts:

Acked-by: Dan Williams <[email protected]>

but in general, this is a Good Thing, since it would allow HAL to match
the device up with it's parent.

> ---
> drivers/net/wireless/airo.c | 1 +
> drivers/net/wireless/ipw2200.c | 1 +
> drivers/net/wireless/libertas/main.c | 1 +
> 3 files changed, 3 insertions(+)
>
> --- a/drivers/net/wireless/airo.c
> +++ b/drivers/net/wireless/airo.c
> @@ -2668,6 +2668,7 @@ static struct net_device *init_wifidev(s
> dev->irq = ethdev->irq;
> dev->base_addr = ethdev->base_addr;
> dev->wireless_data = ethdev->wireless_data;
> + SET_NETDEV_DEV(dev, ethdev->dev.parent);
> memcpy(dev->dev_addr, ethdev->dev_addr, dev->addr_len);
> err = register_netdev(dev);
> if (err<0) {
> --- a/drivers/net/wireless/ipw2200.c
> +++ b/drivers/net/wireless/ipw2200.c
> @@ -11584,6 +11584,7 @@ static int ipw_prom_alloc(struct ipw_pri
> priv->prom_net_dev->hard_start_xmit = ipw_prom_hard_start_xmit;
>
> priv->prom_priv->ieee->iw_mode = IW_MODE_MONITOR;
> + SET_NETDEV_DEV(priv->prom_net_dev, &priv->pci_dev->dev);
>
> rc = register_netdev(priv->prom_net_dev);
> if (rc) {
> --- a/drivers/net/wireless/libertas/main.c
> +++ b/drivers/net/wireless/libertas/main.c
> @@ -1566,6 +1566,7 @@ static int lbs_add_rtap(struct lbs_priva
> rtap_dev->hard_start_xmit = lbs_rtap_hard_start_xmit;
> rtap_dev->set_multicast_list = lbs_set_multicast_list;
> rtap_dev->priv = priv;
> + SET_NETDEV_DEV(rtap_dev, priv->dev->dev.parent);
>
> ret = register_netdev(rtap_dev);
> if (ret) {
>