1 /***************************************************************************
3 * devinfo_ieee1394.c : IEEE 1394/FireWire devices
5 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
6 * Use is subject to license terms.
8 * Licensed under the Academic Free License version 2.1
10 **************************************************************************/
12 #pragma ident "%Z%%M% %I% %E% SMI"
20 #include <libdevinfo.h>
21 #include <sys/types.h>
22 #include <sys/mkdev.h>
25 #include "../osspec.h"
26 #include "../logger.h"
28 #include "../hald_dbus.h"
29 #include "../device_info.h"
34 #include "devinfo_ieee1394.h"
36 HalDevice
*devinfo_ieee1394_add(HalDevice
*parent
, di_node_t node
, char *devfs_path
, char *device_type
);
37 static HalDevice
*devinfo_scsa1394_add(HalDevice
*d
, di_node_t node
, gchar
*devfs_path
);
39 DevinfoDevHandler devinfo_ieee1394_handler
= {
49 devinfo_ieee1394_add(HalDevice
*parent
, di_node_t node
, char *devfs_path
, char *device_type
)
56 * we distinguish 1394 devices by compatible name
57 * starting with 'firewire'
59 if ((di_compatible_names (node
, &compat
) < 1) ||
60 (strncmp (compat
, "firewire", sizeof ("firewire") - 1) != 0)) {
64 if ((driver_name
= di_driver_name (node
)) == NULL
) {
68 if (strcmp (driver_name
, "scsa1394") == 0) {
69 d
= devinfo_scsa1394_add (parent
, node
, devfs_path
);
76 devinfo_scsa1394_add(HalDevice
*parent
, di_node_t node
, gchar
*devfs_path
)
80 d
= hal_device_new ();
82 devinfo_set_default_properties (d
, parent
, node
, devfs_path
);
83 hal_device_property_set_string (d
, "info.subsystem", "ieee1394");
84 hal_device_property_set_string (d
, "info.product", "FireWire SBP-2 device");
86 devinfo_add_enqueue (d
, devfs_path
, &devinfo_ieee1394_handler
);