Re: rt2x00/rt2500 support



On Wed, 2006-07-12 at 10:57 +1200, Eion Robb wrote:
> Thats fantastic: I wasn't expecting a patch, just a push in the right  
> direction.  You've given a huge push.
> 
> > Ok; does it show up in HAL?  Run 'hal-device-manager' and look around
> > for your card.  There needs to also be a "WLAN Interface" object that's
> > a child of the actual PCI/USB card.  The "WLAN Interface" object needs
> > to have the "net.80211" capability in its info.capabilities list.  It
> > also needs to have a "net.interface" property.
> >
> > The driver is likely not showing up because it has no SET_NETDEV_DEV()
> > call when it sets up its netdevice, which means that the right device
> > links aren't set up in sysfs.  Each separate hardware-specific file
> > (rt2500pci.c, rt2400pci.c, rt2500usb.c) needs to have the
> > SET_NETDEV_DEV() command added.  Try the attached patch, and if that
> > works, please send it upstream to the rt2x00 maintainers.
> >

(copying some d80211-experienced people now too)

Ok, thanks for the check.  Updated patch attached since rt61pci.c and
rt73usb.c also need this.

Can you run "tree /sys", tar up and compress that output, and send it to
me?  I'd like to see how the d80211 devices present themselves in sysfs.

For _each_ actual network interface (as shown with iwconfig or ifconfig
-a), you'll need an entry in /sys/class/net/<device name> that contains
a "device" link, like so:

|   |-- net
|   |   |-- eth0
|   |   |   |-- addr_len
|   |   |   |-- address
|   |   |   |-- broadcast
|   |   |   |-- carrier
|   |   |   |-- device -> ../../../devices/pci0000:00/0000:00:1e.0/0000:02:01.0

If your interface doesn't provide the device link (which is what
SET_NETDEV_DEV does for you), then HAL and NetworkManager will have no
idea which physical device that interface maps to, which means no
information on what type of device it is, no information on what driver
it uses, and no information about what its parent is.

There's a lot of alloc_netdevice() calls in rt2x00's d80211; and there
are no SET_NETDEV_DEV calls at all.  Obviously the d80211 layer
shouldn't need to know what bus type (pci, usb, etc) the net device is,
but _something_ needs to set up the sysfs links for each d80211 station
interface as well, if they show up in sysfs in /sys/class/net/xxx.

So, Jouni/Michael/Jiri; for d80211, how should SET_NETDEV_DEV get called
to assign each 'struct net_device' that d80211 creates with the
appropriate 'struct device' item so that the right sysfs links show up?
Ideally, whenever d80211 does an alloc_netdevice() call, it should soon
thereafter call SET_NETDEV_DEV.  Maybe we need to update HAL for its
view of the world, but at a minimum, we need to be able to map each
network interface device shown in sysfs to the appropriate hardware
device which it uses underneath.

(Michael, Jiri: I notice that bcm43xx+d80211 has no SET_NETDEV_DEV call
either, which should likely go in bcm43xx_init_one()... is that no
longer needed with d80211 or something?  We went through a lot of
trouble to get that added to all the drivers, including PCMCIA ones, and
now perhaps we have to add it all back in d80211 drivers?)

Cheers,
Dan

> I modified your patch slightly and got it to compile and now its half  
> added the device to hal.
> It's adding the wmaster0 device (for being an access point) to hal, but  
> not wlan0.
> 
> 0: udi = '/org/freedesktop/Hal/devices/net_00_0d_f0_17_33_ba'
>    info.udi = '/org/freedesktop/Hal/devices/net_00_0d_f0_17_33_ba'  (string)
>    linux.subsystem = 'net'  (string)
>    linux.hotplug_type = 2  (0x2)  (int)
>    net.interface_up = false  (bool)
>    net.arp_proto_hw_id = 801  (0x321)  (int)
>    net.linux.ifindex = 7  (0x7)  (int)
>    net.address = '00:0d:f0:17:33:ba'  (string)
>    net.interface = 'wmaster0'  (string)
>    net.physical_device = '/org/freedesktop/Hal/devices/pci_1814_201'   
> (string)
>    info.capabilities = { 'net' } (string list)
>    info.category = 'net'  (string)
>    info.parent = '/org/freedesktop/Hal/devices/pci_1814_201'  (string)
>    linux.sysfs_path = '/sys/class/net/wmaster0'  (string)
> 
> I'm digging around through the source to try to work out if theres any  
> other points that the wlan0 device is added, but any help would be great.
> 
> For the record, the change to your patch needed to be from
> SET_NETDEV_DEV(net_dev, pci_dev->dev);
> to
> SET_NETDEV_DEV(net_dev, &pci_dev->dev);
--- ./rt2500pci.c.setnetdevdev	2006-07-11 18:05:03.000000000 -0400
+++ ./rt2500pci.c	2006-07-12 09:42:15.000000000 -0400
@@ -3104,6 +3104,7 @@
 	struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
 
 	rt2x00dev->dev = pci_dev;
+	SET_NETDEV_DEV(net_dev, &pci_dev->dev);
 
 	rt2x00dev->csr_addr = ioremap(
 		pci_resource_start(rt2x00dev_pci(rt2x00dev), 0),
--- ./rt2400pci.c.setnetdevdev	2006-07-11 18:04:56.000000000 -0400
+++ ./rt2400pci.c	2006-07-12 09:42:01.000000000 -0400
@@ -2821,6 +2821,7 @@
 	struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
 
 	rt2x00dev->dev = pci_dev;
+	SET_NETDEV_DEV(net_dev, &pci_dev->dev);
 
 	rt2x00dev->csr_addr = ioremap(
 		pci_resource_start(rt2x00dev_pci(rt2x00dev), 0),
--- ./rt73usb.c.setnetdevdev	2006-07-12 09:43:17.000000000 -0400
+++ ./rt73usb.c	2006-07-12 09:43:52.000000000 -0400
@@ -3095,6 +3095,7 @@
 	struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
 
 	rt2x00dev->dev = usb_intf;
+	SET_NETDEV_DEV(net_dev, &usb_intf->dev);
 
 	rt2x00dev->workqueue = create_singlethread_workqueue(DRV_NAME);
 	if (!rt2x00dev->workqueue)
--- ./rt61pci.c.setnetdevdev	2006-07-12 09:43:09.000000000 -0400
+++ ./rt61pci.c	2006-07-12 09:43:36.000000000 -0400
@@ -3633,6 +3633,7 @@
 	struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
 
 	rt2x00dev->dev = pci_dev;
+	SET_NETDEV_DEV(net_dev, &pci_dev->dev);
 
 	rt2x00dev->csr_addr = ioremap(
 		pci_resource_start(rt2x00dev_pci(rt2x00dev), 0),
--- ./rt2500usb.c.setnetdevdev	2006-07-11 18:05:10.000000000 -0400
+++ ./rt2500usb.c	2006-07-12 09:42:19.000000000 -0400
@@ -2727,6 +2727,7 @@
 	struct rt2x00_dev *rt2x00dev = ieee80211_dev_hw_data(net_dev);
 
 	rt2x00dev->dev = usb_intf;
+	SET_NETDEV_DEV(net_dev, &usb_intf->dev);
 
 	rt2x00dev->workqueue = create_singlethread_workqueue(DRV_NAME);
 	if (!rt2x00dev->workqueue)


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