Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Finding devices of a certain type with HAL
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 672
Location: Belgium

PostPosted: Mon Mar 23, 2009 1:42 pm    Post subject: Finding devices of a certain type with HAL Reply with quote

A script I wrote needs to list all serial devices available on my system. I tried to give it a go with HAL (first time use).

One of my machines has two PCI cards that provide extra serial interfaces, one card sold by Moxa, one by Digi.

1) The Moxa one has in-kernel drivers. The devices are referred to as /dev/ttyMI<index>.

Code:
# hal-find-by-capability --capability serial
/org/freedesktop/Hal/devices/pci_8086_29b7_serial_platform_1
/org/freedesktop/Hal/devices/pnp_PNP0501_serial_platform_0
/org/freedesktop/Hal/devices/pci_1393_1680_serial_unknown_7
/org/freedesktop/Hal/devices/pci_1393_1680_serial_unknown_6
/org/freedesktop/Hal/devices/pci_1393_1680_serial_unknown_5
/org/freedesktop/Hal/devices/pci_1393_1680_serial_unknown_4
/org/freedesktop/Hal/devices/pci_1393_1680_serial_unknown_3
/org/freedesktop/Hal/devices/pci_1393_1680_serial_unknown_2
/org/freedesktop/Hal/devices/pci_1393_1680_serial_unknown_1
/org/freedesktop/Hal/devices/pci_1393_1680_serial_unknown_0


and, for example,

Code:
hal-get-property --udi /org/freedesktop/Hal/devices/pci_1393_1680_serial_unknown_2 --key serial.device
/dev/ttyMI2


Neat!

2) The Digi one I compiled some beta drivers for that I found lying around on the Digi server. The devices are referred to as /dev/tty_dgdm_G<index>.

Code:
 # hal-find-by-capability --capability serial
/org/freedesktop/Hal/devices/pci_8086_29b7_serial_platform_1
/org/freedesktop/Hal/devices/pnp_PNP0501_serial_platform_0


Alas, the devices are not listed, I only see the parent device.

Code:
55: udi = '/org/freedesktop/Hal/devices/pci_114f_40'
  linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1e.0/0000:03:02.0'  (string)
  pci.vendor = 'Digi International'  (string)
  info.subsystem = 'pci'  (string)
  info.parent = '/org/freedesktop/Hal/devices/pci_8086_244e'  (string)
  info.vendor = 'Digi International'  (string)
  info.product = 'AccelePort Xp'  (string)
  pci.linux.sysfs_path = '/sys/devices/pci0000:00/0000:00:1e.0/0000:03:02.0'  (string)
  pci.product = 'AccelePort Xp'  (string)
  info.udi = '/org/freedesktop/Hal/devices/pci_114f_40'  (string)
  info.linux.driver = 'dgdm'  (string)
  pci.subsys_vendor = 'Digi International'  (string)
  pci.product_id = 64  (0x40)  (int)
  linux.hotplug_type = 2  (0x2)  (int)
  pci.vendor_id = 4431  (0x114f)  (int)
  linux.subsystem = 'pci'  (string)
  pci.subsys_product_id = 68  (0x44)  (int)
  pci.subsys_vendor_id = 4431  (0x114f)  (int)
  pci.device_class = 7  (0x7)  (int)
  pci.device_subclass = 128  (0x80)  (int)
  pci.device_protocol = 0  (0x0)  (int)


What is missing in my setup/configuration/... for this to behave like the Moxa card/devices?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum