Blame view
drivers/ide/ide-cd.h
3.47 KB
1da177e4c Linux-2.6.12-rc2 |
1 |
/* |
1da177e4c Linux-2.6.12-rc2 |
2 3 4 5 6 7 8 9 |
* Copyright (C) 1996-98 Erik Andersen * Copyright (C) 1998-2000 Jens Axboe */ #ifndef _IDE_CD_H #define _IDE_CD_H #include <linux/cdrom.h> #include <asm/byteorder.h> |
0f38aaa49 ide-cd: move debu... |
10 11 12 |
#define IDECD_DEBUG_LOG 0 #if IDECD_DEBUG_LOG |
088b1b886 ide: improve debu... |
13 |
#define ide_debug_log(lvl, fmt, args...) __ide_debug_log(lvl, fmt, ## args) |
0f38aaa49 ide-cd: move debu... |
14 15 16 |
#else #define ide_debug_log(lvl, fmt, args...) do {} while (0) #endif |
1da177e4c Linux-2.6.12-rc2 |
17 18 19 20 21 22 23 24 25 26 |
#define ATAPI_WAIT_WRITE_BUSY (10 * HZ) /************************************************************************/ #define SECTOR_BITS 9 #ifndef SECTOR_SIZE #define SECTOR_SIZE (1 << SECTOR_BITS) #endif #define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_BITS) #define SECTOR_BUFFER_SIZE (CD_FRAMESIZE * 32) |
1da177e4c Linux-2.6.12-rc2 |
27 |
|
455d80a95 ide-cd: remove st... |
28 29 30 |
/* Capabilities Page size including 8 bytes of Mode Page Header */ #define ATAPI_CAPABILITIES_PAGE_SIZE (8 + 20) #define ATAPI_CAPABILITIES_PAGE_PAD_SIZE 4 |
1da177e4c Linux-2.6.12-rc2 |
31 32 |
/* Structure of a MSF cdrom address. */ struct atapi_msf { |
9892ec549 ide: remove 'byte... |
33 34 35 36 |
u8 reserved; u8 minute; u8 second; u8 frame; |
1da177e4c Linux-2.6.12-rc2 |
37 38 39 40 41 42 |
}; /* Space to hold the disk TOC. */ #define MAX_TRACKS 99 struct atapi_toc_header { unsigned short toc_length; |
9892ec549 ide: remove 'byte... |
43 44 |
u8 first_track; u8 last_track; |
1da177e4c Linux-2.6.12-rc2 |
45 46 47 |
}; struct atapi_toc_entry { |
9892ec549 ide: remove 'byte... |
48 |
u8 reserved1; |
1da177e4c Linux-2.6.12-rc2 |
49 |
#if defined(__BIG_ENDIAN_BITFIELD) |
9892ec549 ide: remove 'byte... |
50 51 |
u8 adr : 4; u8 control : 4; |
1da177e4c Linux-2.6.12-rc2 |
52 |
#elif defined(__LITTLE_ENDIAN_BITFIELD) |
9892ec549 ide: remove 'byte... |
53 54 |
u8 control : 4; u8 adr : 4; |
1da177e4c Linux-2.6.12-rc2 |
55 56 57 |
#else #error "Please fix <asm/byteorder.h>" #endif |
9892ec549 ide: remove 'byte... |
58 59 |
u8 track; u8 reserved2; |
1da177e4c Linux-2.6.12-rc2 |
60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
union { unsigned lba; struct atapi_msf msf; } addr; }; struct atapi_toc { int last_session_lba; int xa_flag; unsigned long capacity; struct atapi_toc_header hdr; struct atapi_toc_entry ent[MAX_TRACKS+1]; /* One extra for the leadout. */ }; |
1da177e4c Linux-2.6.12-rc2 |
74 75 |
/* Extra per-device info for cdrom drives. */ struct cdrom_info { |
7f3c868ba ide: remove ide_d... |
76 77 78 |
ide_drive_t *drive; struct ide_driver *driver; struct gendisk *disk; |
8fed43684 ide: fix refcount... |
79 |
struct device dev; |
1da177e4c Linux-2.6.12-rc2 |
80 81 82 83 84 |
/* Buffer for table of contents. NULL if we haven't allocated a TOC buffer for this device yet. */ struct atapi_toc *toc; |
2bc4cf2d8 ide-cd: remove st... |
85 86 |
u8 max_speed; /* Max speed of the drive. */ u8 current_speed; /* Current speed of the drive. */ |
1da177e4c Linux-2.6.12-rc2 |
87 88 89 90 91 92 |
/* Per-device info needed by cdrom.c generic driver. */ struct cdrom_device_info devinfo; unsigned long write_timeout; }; |
972560fb9 ide-cd: move VERB... |
93 94 |
/* ide-cd_verbose.c */ void ide_cd_log_error(const char *, struct request *, struct request_sense *); |
1da177e4c Linux-2.6.12-rc2 |
95 |
|
17802998d ide-cd: move code... |
96 |
/* ide-cd.c functions used by ide-cd_ioctl.c */ |
5f828546e ide-cd: convert i... |
97 98 |
int ide_cd_queue_pc(ide_drive_t *, const unsigned char *, int, void *, unsigned *, struct request_sense *, int, unsigned int); |
17802998d ide-cd: move code... |
99 100 101 |
int ide_cd_read_toc(ide_drive_t *, struct request_sense *); int ide_cdrom_get_capabilities(ide_drive_t *, u8 *); void ide_cdrom_update_speed(ide_drive_t *, u8 *); |
f9afd18b5 ide-cd: move the ... |
102 |
int cdrom_check_status(ide_drive_t *, struct request_sense *); |
17802998d ide-cd: move code... |
103 104 |
/* ide-cd_ioctl.c */ |
f9afd18b5 ide-cd: move the ... |
105 106 107 |
int ide_cdrom_open_real(struct cdrom_device_info *, int); void ide_cdrom_release_real(struct cdrom_device_info *); int ide_cdrom_drive_status(struct cdrom_device_info *, int); |
5b03a1b14 ide: Convert to b... |
108 109 |
unsigned int ide_cdrom_check_events_real(struct cdrom_device_info *, unsigned int clearing, int slot_nr); |
f9afd18b5 ide-cd: move the ... |
110 |
int ide_cdrom_tray_move(struct cdrom_device_info *, int); |
17802998d ide-cd: move code... |
111 112 113 114 115 116 117 |
int ide_cdrom_lock_door(struct cdrom_device_info *, int); int ide_cdrom_select_speed(struct cdrom_device_info *, int); int ide_cdrom_get_last_session(struct cdrom_device_info *, struct cdrom_multisession *); int ide_cdrom_get_mcn(struct cdrom_device_info *, struct cdrom_mcn *); int ide_cdrom_reset(struct cdrom_device_info *cdi); int ide_cdrom_audio_ioctl(struct cdrom_device_info *, unsigned int, void *); |
f9afd18b5 ide-cd: move the ... |
118 |
int ide_cdrom_packet(struct cdrom_device_info *, struct packet_command *); |
17802998d ide-cd: move code... |
119 |
|
1da177e4c Linux-2.6.12-rc2 |
120 |
#endif /* _IDE_CD_H */ |