$NetBSD: patch-cb,v 1.3 2003/10/20 12:07:23 grant Exp $

--- interface/low_interface.h.orig	2001-03-26 16:12:11.000000000 +1000
+++ interface/low_interface.h
@@ -25,6 +25,7 @@
 #include <sys/time.h>
 #include <sys/types.h>
 
+#ifdef __linux__
 #include <linux/major.h>
 #include <linux/version.h>
 
@@ -48,12 +49,32 @@
 #include <linux/cdrom.h>
 #include <linux/major.h>
 
+#elif defined(__FreeBSD__)
+
+#include <sys/cdio.h>
+#include <sys/cdrio.h>
+
+#include <cam/scsi/scsi_message.h>
+#include <camlib.h>
+
+#elif defined(__NetBSD__)
+
+#include <sys/scsiio.h>
+#include <sys/cdio.h>
+#endif
+
 #include "cdda_interface.h"
 
 #define MAX_RETRIES 8
 #define MAX_BIG_BUFF_SIZE 65536
 #define MIN_BIG_BUFF_SIZE 4096
+#ifdef __linux__
 #define SG_OFF sizeof(struct sg_header)
+#elif defined(__FreeBSD__)
+#define SG_OFF (0)
+#elif defined(__NetBSD__)
+#define SG_OFF sizeof(scsireq_t)
+#endif
 
 #ifndef SG_EMULATED_HOST
 /* old kernel version; the check for the ioctl is still runtime, this
@@ -64,7 +85,9 @@
 #endif
 
 extern int  cooked_init_drive (cdrom_drive *d);
+#ifndef __FreeBSD__
 extern unsigned char *scsi_inquiry (cdrom_drive *d);
+#endif
 extern int  scsi_init_drive (cdrom_drive *d);
 #ifdef CDDA_TEST
 extern int  test_init_drive (cdrom_drive *d);
