[patch] Allow devices with no sysdevices

Joe Shaw joeshaw at novell.com
Tue May 25 12:16:13 PDT 2004


On Tue, 2004-05-25 at 20:31 +0200, David Zeuthen wrote:
> > Me too, but from talking it over with Robert it seems like this simply
> > won't happen until 2.7 at the earliest.
>
> Really? I googled a bit for it some weeks ago and found this patch
> 
>  http://www.uwsg.iu.edu/hypermail/linux/kernel/0303.3/1548.html
> 
> that looked pretty simple. Haven't applied though, because I rarely use
> the one box I have with PCMCIA sockets and I don't know enough kernel
> stuff. 

I think the key there is "... for any pcmcia device registered with the
sysfs core", which most aren't.  I think the problem (at least with the
wireless drivers I looked at) is that there isn't a "struct device *"
anywhere to be found.

> Waiting for 2.7 for this would really really suck. One thing we should
> then is to try to do what cardmgr and cardctl does and build our tree
> this way if at all possible (I've would have no clue on how to map class
> devices to such bus devices though).

I looked into this.  There's no way to associate the information we get
from cardctl with a class device as far as I can tell.

> But in the, unlikely, event that I have two 16-bit PCMCIA networking
> cards they will both merge net.* stuff on the same fakeroot device and
> one will overwrite the other, right?

No, the fakeroot exists only as a parent to those devices.  None of the
net.* stuff gets merged onto it.  That's the reason for the hackish
passing around of a "merge_or_add" variable.  It'll get overridden from
the class handler's TRUE to FALSE if there is no sysdevice.  That's also
why we need to add a compute_udi function.

To better illustrate this, here's the relevant lshal output:

udi = '/org/freedesktop/Hal/devices/net-eth1'
  info.udi = '/org/freedesktop/Hal/devices/net-eth1'  (string)
  info.category = 'net.ethernet'  (string)
  info.capabilities = 'net net.ethernet'  (string)
  net.wireless.mode_str = 'managed'  (string)
  net.wireless.mode = 2  (0x2)  (int)
  net.wireless.essid = 'Helix'  (string)
  net.wireless.frequency = 2.447e+09  (double)
  net.wireless.protocol = 'IEEE 802.11-DS'  (string)
  net.wireless = true  (bool)
  net.wireless.noise = 165  (0xa5)  (int)
  net.wireless.level = 209  (0xd1)  (int)
  net.wireless.link = 44  (0x2c)  (int)
  net.wireless.status = 0  (0x0)  (int)
  net.media = 'Ethernet'  (string)
  net.arp_proto_hw_id = 1  (0x1)  (int)
  net.ethernet.mac_addr_lower24 = 1996935  (0x1e7887)  (int)
  net.ethernet.mac_addr_upper24 = 24605  (0x601d)  (int)
  net.ethernet.mac_addr = '00:60:1d:1e:78:87'  (string)
  net.interface = 'eth1'  (string)
  net.linux.sysfs_path = '/sys/class/net/eth1'  (string)
  info.parent = '/org/freedesktop/Hal/devices/fakeroot'  (string)
  linux.sysfs_path = '/sys/class/net/eth1'  (string)
  info.bus = 'unknown'  (string)

udi = '/org/freedesktop/Hal/devices/fakeroot'
  info.virtual = true  (bool)
  info.product = 'City of Lost Devices'  (string)
  linux.sysfs_path_device = '(none)'  (string)
  info.bus = 'unknown'  (string)

Joe


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



More information about the Hal mailing list