HAL 0.5.x & networking

Sean Meiners sean.meiners at linspireinc.com
Wed Jun 8 08:23:18 PDT 2005


On Jun 8, 2005, at 7:57 AM, Dan Williams wrote:

>> Speaking of bad drivers, I noticed that non-PCI PCMCIA and USB
>> network devices won't currently show up in HAL.  I tracked it down to
>> the fact that net_add specifically looks for /sys/class/net/<if>/
>> device and if it fails to find it, gives up.  Unfortunately, drivers
>> like airo don't provide device symlinks.  I created a patch to remove
>> this restriction and the devices show up, but with no parents (as
>> would be expected).  I'd be happy to send it along as well as
>> entertain other ideas of how to resolve the issue.
>>
>
> The idea here is to get drivers _fixed_.  Its a one-line fix, and  
> recent kernels
> should have all in-kernel PCMCIA drivers fixed to use  
> SET_NETDEV_DEV.  I've
> submitted patches for drivers like the atmel one to do this.  In  
> 2.6.11.8, the
> airo driver has SET_NETDEV_DEV on line 2763 in the _init_airo_card 
> () function,
> so it should be OK.  If its not in your kernel, patch it.
>
> HAL usually will not tolerate drivers that don't use sysfs  
> correctly, and the
> response is usually "fix the driver" rather than removing these  
> checks from HAL.
> This does mean that kernels < 2.6.10 may not have little fixes like  
> this.  So
> be it.

I would agree that fixing the drivers is ideal, but unfortunately,  
it's not a luxury we have.  There are too many drivers for us to fix  
ourselves, and we can't afford to wait until someone else fixes them  
all for us :(  If we (read: Linspire) are going to use HAL to help  
manage the network devices we need all devices to work (even the  
crappy ones).  So I guess I'll just keep my patch in place on our  
package until all the drivers work properly.

Also, I forgot to mention, even after I removed the device check the  
airo device still wasn't showing up at first.  It turns out that  
there is a bit of a race condition.  For some reason there is a delay  
between when HAL receives the event telling it that the card has been  
inserted and when /sys/class/net/<if> gets populated.  So even though  
the address file does get created for the interface, it's not  
available when net_add goes looking for it causing it to not find the  
device.  I added a limited retry around hal_util_set_string_from_file  
(d, "net.address", sysfs_path, "address") with sleep(1)'s between  
each iteration and it works fine, although I'd prefer a less brute- 
force solution.


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list