blob: e8e8edbaac9526720c0d03cf62baf3d631c10fbe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
$NetBSD: patch-cb,v 1.7 2009/08/29 04:54:52 hasso Exp $
--- interface/low_interface.h.orig 2008-09-11 13:43:52 +0300
+++ interface/low_interface.h 2009-08-26 10:00:01 +0300
@@ -26,6 +26,7 @@
#include <sys/time.h>
#include <sys/types.h>
+#ifdef __linux__
#include <linux/major.h>
#include <linux/version.h>
@@ -54,6 +55,22 @@
#include <linux/cdrom.h>
#include <linux/major.h>
+#elif defined(__FreeBSD__) || defined(__DragonFly__)
+
+#include <sys/cdio.h>
+#include <sys/cdrio.h>
+
+#define CAM_NO_SCSI_INQUIRY
+#include <cam/scsi/scsi_message.h>
+#include <cam/scsi/scsi_sg.h>
+#include <camlib.h>
+
+#elif defined(__NetBSD__)
+
+#include <sys/scsiio.h>
+#include <sys/cdio.h>
+#endif
+
#include "cdda_interface.h"
#ifndef SG_EMULATED_HOST
@@ -107,10 +124,18 @@ struct cdda_private_data {
#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__) || defined(__DragonFly__)
+#define SG_OFF (0)
+#elif defined(__NetBSD__)
+#define SG_OFF sizeof(scsireq_t)
+#endif
extern int cooked_init_drive (cdrom_drive *d);
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
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);
|