Added the implementation for CDROM_GetIdeInterface on NetBSD.

This commit is contained in:
Yorick Hardy 2003-05-19 21:46:09 +00:00 committed by Alexandre Julliard
parent d21e32a04f
commit c26b7dbad9
4 changed files with 27 additions and 1 deletions

2
configure vendored
View File

@ -13236,6 +13236,7 @@ done
for ac_header in \
@ -13289,6 +13290,7 @@ for ac_header in \
sys/poll.h \
sys/ptrace.h \
sys/reg.h \
sys/scsiio.h \
sys/shm.h \
sys/signal.h \
sys/socket.h \

View File

@ -1007,6 +1007,7 @@ AC_CHECK_HEADERS(\
sys/poll.h \
sys/ptrace.h \
sys/reg.h \
sys/scsiio.h \
sys/shm.h \
sys/signal.h \
sys/socket.h \

View File

@ -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 @@ static int CDROM_GetIdeInterface(int fd, int* iface, int* device)
*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

View File

@ -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