dlls/ntdll/cdrom.c CDROM_GetIdeInterface on NetBSD

Yorick Hardy yh at metroweb.co.za
Sun May 18 03:58:27 CDT 2003


Add the implementation for CDROM_GetIdeInterface on NetBSD.

-- 
Yorick Hardy

--- configure.ac	Sat May 17 09:49:07 2003
+++ configure.ac	Sun May 18 10:26:39 2003
@@ -1007,6 +1007,7 @@
 	sys/poll.h \
 	sys/ptrace.h \
 	sys/reg.h \
+	sys/scsiio.h \
 	sys/shm.h \
 	sys/signal.h \
 	sys/socket.h \
--- include/config.h.in	Sat May 17 10:07:39 2003
+++ include/config.h.in	Sun May 18 10:26:39 2003
@@ -560,6 +560,9 @@
 /* Define to 1 if you have the <sys/reg.h> header file. */
 #undef HAVE_SYS_REG_H
 
+/* Define to 1 if you have the <sys/scsiio.h> header file. */
+#undef HAVE_SYS_SCSIIO_H
+
 /* Define to 1 if you have the <sys/shm.h> header file. */
 #undef HAVE_SYS_SHM_H
 
--- dlls/ntdll/cdrom.c	Thu Apr  3 20:56:01 2003
+++ dlls/ntdll/cdrom.c	Sun May 18 10:44:10 2003
@@ -60,6 +60,9 @@
 #ifdef HAVE_SYS_CDIO_H
 # include <sys/cdio.h>
 #endif
+#ifdef HAVE_SYS_SCSIIO_H
+# include <sys/scsiio.h>
+#endif
 
 #define NONAMELESSUNION
 #define NONAMELESSSTRUCT
@@ -379,7 +382,24 @@
         *device = (minor(st.st_rdev) == 63 ? 1 : 0);
         return 1;
     }
-#elif defined(__FreeBSD__) || defined(__NetBSD__)
+#elif defined(__NetBSD__)
+    {
+       struct scsi_addr addr;
+       if (ioctl(fd, SCIOCIDENTIFY, &addr) != -1) {
+            switch (addr.type) {
+                /* for SCSI copy linux case, i.e. start at *iface = 11 */
+                case TYPE_SCSI:  *iface = 11 + addr.addr.scsi.scbus;
+                                 *device = addr.addr.scsi.target;
+                                 break;
+                case TYPE_ATAPI: *iface = addr.addr.atapi.atbus;
+                                 *device = addr.addr.atapi.drive;
+                                 break;
+            }
+            return 1;
+       }
+       return 0;
+    }
+#elif defined(__FreeBSD__)
     FIXME("not implemented for BSD\n");
     return 0;
 #else



More information about the wine-patches mailing list