haldaemon and device discovery

Greg Allen GAllen at arrayinc.com
Thu Sep 13 10:41:02 PDT 2007


 
OK, I think I've gotten this right. The patch file for
my changes to get these devices recognized is attached.

Basically the change is to add code to handle a missing parent to the
functions net_add() and scsi_host_add(), just like the existing code 
in input_add().

If the passed variable phys_parent is NULL then no parent was found.  
In this case use the hard coded parent of 
"/org/freedesktop/Hal/devices/computer".

In net_add() if the parent not passed, then "net.physical_device" is not
known, so do not set it.

Since "net.physical_device" may not be set, the routine
net_compute_udi()
can attempt to use this unset value with will cause the hal deamon to
crash.
Therefore the code was changed to get the last part of
"linux.sysfs_path" in
this case.  It looks like "net.interface" will always contain what id is
being set to, but that has not been proved. (Changing to use
"net.interface"  would be simpler code.)

Thanks,

-- Greg Allen

-----Original Message-----
From: hal-bounces at lists.freedesktop.org
[mailto:hal-bounces at lists.freedesktop.org] On Behalf Of Doug Goldstein
Sent: Friday, September 07, 2007 2:36 PM
To: HAL Development List
Subject: Re: haldaemon and device discovery

Greg Allen wrote:
>
> I have figured out my problem and have made some general changes to
the
> daemon code so these devices are recognized.
>
>  
>
> What is the mechanism for getting these changes into the source tree?
>
> Is there someone I should send them to for review and comment?
>
>  
>
> Thanks,
>
>  
>
> -- Greg Allen
>
>  
>
>  
>
>  
>
>
------------------------------------------------------------------------
>
> *From:* hal-bounces at lists.freedesktop.org
> [mailto:hal-bounces at lists.freedesktop.org] *On Behalf Of *Greg Allen
> *Sent:* Wednesday, August 08, 2007 8:37 PM
> *To:* hal at lists.freedesktop.org
> *Subject:* haldaemon and device discovery
>
>  
>
> I have a CD device with my own drivers on the system. It is recognized
> by udevinfo as you can see below:
>
>  
>
> udevinfo -a -p /sys/bus/scsi/devices/0\:0\:126\:0/
>
>  
>
> Udevinfo starts with the device specified by the devpath and then
>
> walks up the chain of parent devices. It prints for every device
>
> found, all possible attributes in the udev rules key format.
>
> A rule to match, can be composed by the attributes of the device
>
> and the attributes from one single parent device.
>
>  
>
>   looking at device '/devices/vscsi0/host0/target0:0:126/0:0:126:0':
>
>     KERNEL=="0:0:126:0"
>
>     SUBSYSTEM=="scsi"
>
>     SYSFS{ioerr_cnt}=="0x2"
>
>     SYSFS{iodone_cnt}=="0xe"
>
>     SYSFS{iorequest_cnt}=="0xe"
>
>     SYSFS{iocounterbits}=="32"
>
>     SYSFS{timeout}=="0"
>
>     SYSFS{state}=="running"
>
>     SYSFS{rev}=="1.00"
>
>     SYSFS{model}=="DVDR   PX-716AL "
>
>     SYSFS{vendor}=="PLEXTOR "
>
>     SYSFS{scsi_level}=="3"
>
>     SYSFS{type}=="5"
>
>     SYSFS{queue_type}=="none"
>
>     SYSFS{queue_depth}=="1"
>
>     SYSFS{device_blocked}=="0"
>
>  
>
>   looking at parent device '/devices/vscsi0/host0/target0:0:126':
>
>     ID=="target0:0:126"
>
>     BUS==""
>
>     DRIVER==""
>
>  
>
>   looking at parent device '/devices/vscsi0/host0':
>
>     ID=="host0"
>
>     BUS==""
>
>     DRIVER==""
>
>  
>
>   looking at parent device '/devices/vscsi0':
>
>     ID=="vscsi0"
>
>     BUS=="virtual_bus"
>
>     DRIVER=="cd_vscsi"
>
>  
>
> However, the device does not appear in the output of hal-devices. Is
there
> something I need to do to make this happen?
>
>  
>
> I've tried restarting haldaemon, and also restart the udev daemon as
> well, but
> it still doesn't show up.
>
>  
>
> My understanding is that HAL discovers devices based on udev. Then why
> isn't my device being seen?
>
>  
>
> Thanks for any help.
>
>  
>
> -- Greg Allen
>
Copying and pasting a similar e-mail I sent this morning....

The best thing to do would be to provide a diff against the current 
master branch files, rather then a whole acpi.c file.

http://gitweb.freedesktop.org/?p=hal.git;a=blob;f=HACKING

Provides a terse explaination of how to use git to pull the latest
master.

You would submit your patches to the mailing list.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: device.c.patch
Type: application/octet-stream
Size: 3573 bytes
Desc: device.c.patch
Url : http://lists.freedesktop.org/archives/hal/attachments/20070913/db706576/attachment.obj 


More information about the hal mailing list