Questions on physdev vs. classdev

David Zeuthen david at fubar.dk
Wed Jan 25 08:55:03 PST 2006


Hi,

Sorry for the late reply...

On Tue, 2006-01-24 at 15:17 -0500, Joe Marcus Clarke wrote:
> Looks like I needed to subscribe to get this message out.

Yea..

> In addition to my questions below, would it be possible for me to get
> CVS commit access so I can add my FreeBSD work so others can contribute?
>    Thanks.

Certainly, that's doable, there's a guide here

 http://www.freedesktop.org/wiki/AccountRequests

Ping me or some fd.o admin on #freedesktop on freenode if there is no
respone...

> [Old message follows]
> 
> I've finally started writing the FreeBSD port of HAL, and I have two
> questions regarding device types and embedded hotplug events.

Cool, happy to see this.

> It seems like Linux distinguishes between physical devices (e.g. a PCI
> card), and logical devices (a PCI card that happens to be a sound card).
>  Therefore, one physdev event will be triggered as well as one classdev
> event.  Is that correct?

On Linux this is true, but it don't have to be this way. As Artem points
out you can simply merge both both sets of properties on the same hal
device object. 

Specifically for sound cards the Linux port exposes devices of
capability of 'alsa' and 'oss' (and hence respectively properties
'alsa.*' and 'oss.*). I'm not sure whether FreeBSD and/or Solaris
exports the same userland interface so you may want to create your own
namespace here... Hence you can merge both 'pci.*' and 'freebsd_sound.*'
on the same device object...

> In FreeBSD, we have one device tree in devinfo.  I want to send my
> soundcard event as a physdev event with a subsystem of pci.  Once the
> soundcard is added as a physical PCI card, I'd like to then add a
> classdev entry that is sound-specific.  Is this possible?  Is there are
> better way of doing this?
> 
> Additionally, FreeBSD doesn't register hotplug events for SCSI devices
> (e.g. disks, tapes, CD-ROMS, etc.).  What I'm doing now is upon
> detection of such a device, I add the blockdev, then fire off hotplug
> events for the various slices and partitions.  In essence, I have events
> within events.  Is this legal?

Right.. With respect to drives and volumes all HAL specifically cares
about are simply three objects

 1. The physical device that the drive stems from
 2. An object representing the drive (block.* and storage.* properties)
 3. An object for every volume on the drive (block.* and volume.* props)

Note how we specifically avoid hard to talk about partitions and slices
though we do have a few properties to be used as hints. Hence, you the
SCSI device objects on Linux can be safely ignored - they are only there
because they are glue..

> Okay, I guess I have a third question.  I've created some
> FreeBSD-specific properties such as freebsd.dev_name and
> info.freebsd.driver.  Do I need to register these anywhere, or is this
> something I can do after the fact?

You can put these into the spec when you feel like they're not going to
change..

Btw, Kay, myself and others usually hang out in #hal on Freenode if you
have questions.

Thanks a lot for looking at this!

Cheers,
David




More information about the hal mailing list