2011-7-29 15:12:24
设备探测一下
"org.freedesktop.Hal.Device",
"Reprobe")
dbus-send --system --print-reply --type=signal /org/freedesktop/Hal/Manager org.freedesktop.Hal.Device.Reprobe
dbus-send --system --print-reply --dest=org.freedesktop.Hal /org/freedesktop/Hal/Device org.freedesktop.Hal.Device.Reprobe
系统相关的探测
gboolean
osspec_device_reprobe (HalDevice *d)
{
return hotplug_reprobe_tree (d);
}
gboolean
hotplug_reprobe_tree (HalDevice *d)
{
hotplug_reprobe_generate_remove_events (d);
hotplug_reprobe_generate_add_events (d);
hotplug_event_process_queue ();
return FALSE;
}
热插拔探测树
childs = hal_device_store_match_multiple_key_value_string (hald_get_gdl (), "info.parent", hal_device_get_udi (d));
for (i = childs; i != NULL; i = g_slist_next (i)) {
HalDevice *child;
child = HAL_DEVICE (i->data);
hotplug_reprobe_generate_remove_events (child);
}
g_slist_free (childs);
首先移除孩子
dev_generate_remove_hotplug_event 产生热插拔事件
将产生的事件放入 hotplug_event_queue 中
read(8, "l\1\0\1\26\0\0\0q\0\0\0\305\0\0\0\1\1o\0=\0\0\0/org/free"..., 2048) = 238
read(8, 0x4e878, 2048) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=9, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=14, events=POLLIN}, {fd=8, events=POLLIN}], 5, 0) = 0 (Timeout)
writev(8, [{"l\3\1\1r\0\0\0\214\1\0\0O\0\0\0\6\1s\0\4\0\0\0:1.9\0\0\0\0\4"..., 96}, {"m\0\0\0No property info.capabilities"..., 114}], 2) = 210
poll([{fd=9, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=14, events=POLLIN}, {fd=8, events=POLLIN}, {fd=5, events=POLLIN}, {fd=11, events=POLLIN|POLLPRI}, {fd=13, events=0}, {fd=12, events=POLLIN}], 9, -1) = 1 ([{fd=8, revents=POLLIN}])
read(8, "l\1\0\1\26\0\0\0r\0\0\0\305\0\0\0\1\1o\0=\0\0\0/org/free"..., 2048) = 238
read(8, 0x4e878, 2048) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=9, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=14, events=POLLIN}, {fd=8, events=POLLIN}], 5, 0) = 0 (Timeout)
writev(8, [{"l\2\1\1\10\0\0\0\215\1\0\0\37\0\0\0\6\1s\0\4\0\0\0:1.9\0\0\0\0\5"..., 48}, {"\3\0\0\0hub\0"..., 8}], 2) = 56
poll([{fd=9, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=14, events=POLLIN}, {fd=8, events=POLLIN}, {fd=5, events=POLLIN}, {fd=11, events=POLLIN|POLLPRI}, {fd=13, events=0}, {fd=12, events=POLLIN}], 9, -1) = 1 ([{fd=8, revents=POLLIN}])
read(8, "l\1\0\1\26\0\0\0s\0\0\0\305\0\0\0\1\1o\0=\0\0\0/org/free"..., 2048) = 238
read(8, 0x4e878, 2048) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=9, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=14, events=POLLIN}, {fd=8, events=POLLIN}], 5, 0) = 0 (Timeout)
writev(8, [{"l\3\1\1r\0\0\0\216\1\0\0O\0\0\0\6\1s\0\4\0\0\0:1.9\0\0\0\0\4"..., 96}, {"m\0\0\0No property info.capabilities"..., 114}], 2) = 210
poll([{fd=9, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=14, events=POLLIN}, {fd=8, events=POLLIN}, {fd=5, events=POLLIN}, {fd=11, events=POLLIN|POLLPRI}, {fd=13, events=0}, {fd=12, events=POLLIN}], 9, -1) = 1 ([{fd=12, revents=POLLIN}])
recvmsg(12, {msg_name(0)=NULL, msg_iov(1)=[{"add@/class/usb_endpoint/usbdev1.6"..., 4096}], msg_controllen=24, {cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=1868, uid=0, gid=0}}, msg_flags=0}, 0) = 282
readlink("/sys/class/usb_endpoint/usbdev1.6_ep00/subsystem", "../../../class/usb_endpoint"..., 511) = 27
readlink("/sys/class/usb_endpoint/usbdev1.6_ep00/device", "../../../devices/platform/pxa3xx-ohci/usb1/1-2"..., 511) = 46
stat64("/sys/devices/platform/pxa3xx-ohci/usb1/1-2/driver", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
readlink("/sys/devices/platform/pxa3xx-ohci/usb1/1-2/driver", "../../../../../bus/usb/drivers/usb"..., 255) = 34
poll([{fd=9, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=14, events=POLLIN}, {fd=8, events=POLLIN}, {fd=5, events=POLLIN}, {fd=11, events=POLLIN|POLLPRI}, {fd=13, events=0}, {fd=12, events=POLLIN}], 9, -1) = 1 ([{fd=12, revents=POLLIN}]recvmsg(12, {msg_name(0)=NULL, msg_iov(1)=[{"add@/class/usb_endpoint/usbdev1.6"..., 4096}], msg_controllen=24, {cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=1870, uid=0, gid=0}}, msg_flags=0}, 0) = 290
readlink("/sys/class/usb_endpoint/usbdev1.6_ep81/subsystem", "../../../class/usb_endpoint"..., 511) = 27
readlink("/sys/class/usb_endpoint/usbdev1.6_ep81/device", "../../../devices/platform/pxa3xx-ohci/usb1/1-2/1-2:1.0"..., 511) = 54
stat64("/sys/devices/platform/pxa3xx-ohci/usb1/1-2/1-2:1.0/driver", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
readlink("/sys/devices/platform/pxa3xx-ohci/usb1/1-2/1-2:1.0/driver", "../../../../../../bus/usb/drivers/hub"..., 255) = 37
poll([{fd=9, events=POLLIN}, {fd=7, events=POLLIN}, {fd=10, events=POLLIN}, {fd=14, events=POLLIN}, {fd=8, events=POLLIN}, {fd=5, events=POLLIN}, {fd=11, events=POLLIN|POLLPRI}, {fd=13, events=0}, {fd=12, events=POLLIN}], 9, -1) = 1 ([{fd=12, revents=POLLIN}])
recvmsg(12, {msg_name(0)=NULL, msg_iov(1)=[{"add@/class/usb_device/usbdev1.6\0U"..., 4096}], msg_controllen=24, {cmsg_len=24, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS{pid=1871, uid=0, gid=0}}, msg_flags=0}, 0) = 267
readlink("/sys/class/usb_device/usbdev1.6/subsystem", "../../../class/usb_device"..., 511) = 25
readlink("/sys/class/usb_device/usbdev1.6/device", "../../../devices/platform/pxa3xx-ohci/usb1/1-2"..., 511) = 46
stat64("/sys/devices/platform/pxa3xx-ohci/usb1/1-2/driver", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0
readlink("/sys/devices/platform/pxa3xx-ohci/usb1/1-2/driver", "../../../../../bus/usb/drivers/usb"..., 255) = 34
writev(8, [{"l\4\1\1E\0\0\0\217\1\0\0o\0\0\0\1\1o\0\34\0\0\0/org/free"..., 128}, {"@\0\0\0/org/freedesktop/Hal/devices/"..., 69}], 2signal sender=:1.0 -> dest=(null destination) path=/org/freedesktop/Hal/Manager; interface=org.freedesktop.Hal.Manager; member=DeviceAdded
string "/org/freedesktop/Hal/devices/usb_device_58f_6254_noserial_usbraw"
02:04:29.673: usb_device_58f_6254_noserial_usbraw added
) = 197