blob: 99bb152ae685175a12d927fb84a6421a3f402265 (
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
$NetBSD: patch-ch,v 1.3 2006/09/03 17:13:30 ben Exp $
--- interface/cdda_interface.h.orig 2001-03-23 17:15:46.000000000 -0800
+++ interface/cdda_interface.h
@@ -18,9 +18,19 @@
#endif
#define CD_FRAMESAMPLES (CD_FRAMESIZE_RAW / 4)
+#if defined(__APPLE__) && defined(__MACH__)
+#include <IOKit/IOKitLib.h>
+#include <IOKit/storage/IOCDTypes.h>
+#endif
+
#include <sys/types.h>
#include <signal.h>
+#if defined(__FreeBSD__) || defined(__DragonFly__)
+#include <stdio.h>
+#include <camlib.h>
+#endif
+
#define MAXTRK 100
typedef struct TOC { /* structure of table of contents */
@@ -33,6 +43,7 @@ typedef struct TOC { /* structure of tab
#define GENERIC_SCSI 0
#define COOKED_IOCTL 1
#define TEST_INTERFACE 2
+#define OSX_IOKIT 3
#define CDDA_MESSAGE_FORGETIT 0
#define CDDA_MESSAGE_PRINTIT 1
@@ -47,13 +58,27 @@ typedef struct cdrom_drive{
int opened; /* This struct may just represent a candidate for opening */
char *cdda_device_name;
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
char *ioctl_device_name;
int cdda_fd;
- int ioctl_fd;
- char *drive_model;
int drive_type;
+#else
+ struct cam_device *dev;
+ union ccb *ccb;
+#endif
+
+#if defined(__APPLE__) && defined(__MACH__)
+ io_object_t io;
+ int fd;
+ char *dev;
+ CDTOC *raw_toc;
+ int descriptor_count;
+#endif
+
+ int ioctl_fd;
+ char *drive_model;
int interface;
int bigendianp;
int nsectors;
@@ -83,9 +108,13 @@ typedef struct cdrom_drive{
int is_mmc;
/* SCSI command buffer and offset pointers */
+#if !defined(__FreeBSD__) && !defined(__DragonFly__)
unsigned char *sg;
unsigned char *sg_buffer;
unsigned char inqbytes[4];
+#else
+ unsigned char *sg_buffer;
+#endif
/* Scsi parameters and state */
unsigned char density;
|