diff options
author | reinoud <reinoud@pkgsrc.org> | 2008-12-11 15:05:01 +0000 |
---|---|---|
committer | reinoud <reinoud@pkgsrc.org> | 2008-12-11 15:05:01 +0000 |
commit | c08bab93b62a8f6f119c71e1ff17778f28be5e82 (patch) | |
tree | e1f43a087b61c0f73bfa17f3e08db6edfc6d576e /sysutils/hal/files | |
parent | 4e74bcbd6b58b5360e784f240a25d145c7114afc (diff) | |
download | pkgsrc-c08bab93b62a8f6f119c71e1ff17778f28be5e82.tar.gz |
Add rudementary cdrom HAL info. Probing and volume management needs to be
implemented still.
Diffstat (limited to 'sysutils/hal/files')
-rw-r--r-- | sysutils/hal/files/hald-netbsd/Makefile.am | 7 | ||||
-rw-r--r-- | sysutils/hal/files/hald-netbsd/addons/addon-storage.c | 8 | ||||
-rw-r--r-- | sysutils/hal/files/hald-netbsd/devinfo.c | 4 | ||||
-rw-r--r-- | sysutils/hal/files/hald-netbsd/osspec_netbsd.h | 2 |
4 files changed, 14 insertions, 7 deletions
diff --git a/sysutils/hal/files/hald-netbsd/Makefile.am b/sysutils/hal/files/hald-netbsd/Makefile.am index 6f278ee4e8c..c5ba9a9163c 100644 --- a/sysutils/hal/files/hald-netbsd/Makefile.am +++ b/sysutils/hal/files/hald-netbsd/Makefile.am @@ -18,7 +18,10 @@ libhald_netbsd_la_SOURCES = \ osspec.c drvctl.c envsys.c vfsstat.c \ devinfo.c devinfo_misc.c devinfo_audio.c devinfo_video.c \ devinfo_mass.c \ - hotplug.c hal-file-monitor.c -# devinfo_pci.c devinfo_storage.c devinfo_usb.c + hotplug.c hal-file-monitor.c \ + devinfo_optical.c +# devinfo_scsipi.c +# devinfo_usb.c \ +# devinfo_pci.c libhald_netbsd_la_LDFLAGS = -lprop @VOLUME_ID_LIBS@ diff --git a/sysutils/hal/files/hald-netbsd/addons/addon-storage.c b/sysutils/hal/files/hald-netbsd/addons/addon-storage.c index 493430c086c..4a24551a033 100644 --- a/sysutils/hal/files/hald-netbsd/addons/addon-storage.c +++ b/sysutils/hal/files/hald-netbsd/addons/addon-storage.c @@ -18,6 +18,7 @@ #include <strings.h> #include <stdlib.h> #include <stdio.h> +#include <syslog.h> #include <sys/ioctl.h> #include <sys/types.h> #include <sys/stat.h> @@ -60,7 +61,7 @@ scsi_test_unit_ready (int fd) req.databuf = NULL; req.datalen = 0; req.timeout = 10000; - req.flags = 0; + req.flags = SCCMD_READ; req.senselen = SENSEBUFLEN; if (ioctl(fd, SCIOCCOMMAND, &req) == -1) @@ -224,7 +225,7 @@ main (int argc, char *argv[]) goto out; if ((device_file = getenv ("HAL_PROP_BLOCK_DEVICE")) == NULL) goto out; - if ((raw_device_file = getenv ("HAL_PROP_BLOCK_SOLARIS_RAW_DEVICE")) == NULL) + if ((raw_device_file = getenv ("HAL_PROP_BLOCK_NETBSD_RAW_DEVICE")) == NULL) goto out; if ((bus = getenv ("HAL_PROP_STORAGE_BUS")) == NULL) goto out; @@ -263,12 +264,11 @@ main (int argc, char *argv[]) * keeps media constantly spun up. All this needs more thought. */ for (;;) { + sleep (SLEEP_PERIOD); if (is_mounted (device_file)) { close_device (&fd); - sleep (SLEEP_PERIOD); } else if ((fd < 0) && ((fd = open (raw_device_file, O_RDONLY | O_NONBLOCK)) < 0)) { HAL_DEBUG (("open failed for %s: %s", raw_device_file, strerror (errno))); - sleep (SLEEP_PERIOD); } else { /* Check if a disc is in the drive */ state = scsi_test_unit_ready (fd); diff --git a/sysutils/hal/files/hald-netbsd/devinfo.c b/sysutils/hal/files/hald-netbsd/devinfo.c index a92f4929fa2..7e473836756 100644 --- a/sysutils/hal/files/hald-netbsd/devinfo.c +++ b/sysutils/hal/files/hald-netbsd/devinfo.c @@ -36,6 +36,8 @@ #include "devinfo_usb.h" #include "devinfo_misc.h" #include "devinfo_cpu.h" +#include "devinfo_optical.h" +/* #include "devinfo_scsipi.h" */ #include "drvctl.h" void devinfo_add_subtree(HalDevice *parent, const char *devnode, gboolean is_root); @@ -142,7 +144,9 @@ devinfo_set_default_properties (HalDevice *d, HalDevice *parent, const char *dev static DevinfoDevHandler *devinfo_handlers[] = { &devinfo_computer_handler, &devinfo_cpu_handler, + &devinfo_optical_handler, #if notyet + &devinfo_scsipi_handler, &devinfo_ide_handler, &devinfo_scsi_handler, &devinfo_floppy_handler, diff --git a/sysutils/hal/files/hald-netbsd/osspec_netbsd.h b/sysutils/hal/files/hald-netbsd/osspec_netbsd.h index 5a1bed810f3..13ba3277118 100644 --- a/sysutils/hal/files/hald-netbsd/osspec_netbsd.h +++ b/sysutils/hal/files/hald-netbsd/osspec_netbsd.h @@ -18,4 +18,4 @@ void hotplug_queue_now_empty (void); HalDevice *hal_util_find_closest_ancestor (const gchar *devfs_path, gchar **ancestor_devfs_path, gchar **hotplug_devfs_path); char *dsk_to_rdsk(char *); -#endif /* OSSPEC_SOLARIS_H */ +#endif /* OSSPEC_NETBSD_H */ |