]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blob - drivers/ide/ide-floppy.h
ide: add pointer to the current packet command to ide_drive_t
[linux-2.6-omap-h63xx.git] / drivers / ide / ide-floppy.h
1 #ifndef __IDE_FLOPPY_H
2 #define __IDE_FLOPPY_H
3
4 /*
5  * Most of our global data which we need to save even as we leave the driver
6  * due to an interrupt or a timer event is stored in a variable of type
7  * idefloppy_floppy_t, defined below.
8  */
9 typedef struct ide_floppy_obj {
10         ide_drive_t     *drive;
11         ide_driver_t    *driver;
12         struct gendisk  *disk;
13         struct kref     kref;
14         unsigned int    openers;        /* protected by BKL for now */
15
16         /* Last failed packet command */
17         struct ide_atapi_pc *failed_pc;
18         /* used for blk_{fs,pc}_request() requests */
19         struct ide_atapi_pc queued_pc;
20
21         struct ide_atapi_pc request_sense_pc;
22         struct request request_sense_rq;
23
24         /* Last error information */
25         u8 sense_key, asc, ascq;
26         /* delay this long before sending packet command */
27         u8 ticks;
28         int progress_indication;
29
30         /* Device information */
31         /* Current format */
32         int blocks, block_size, bs_factor;
33         /* Last format capacity descriptor */
34         u8 cap_desc[8];
35         /* Copy of the flexible disk page */
36         u8 flexible_disk_page[32];
37 } idefloppy_floppy_t;
38
39 /*
40  * Pages of the SELECT SENSE / MODE SENSE packet commands.
41  * See SFF-8070i spec.
42  */
43 #define IDEFLOPPY_CAPABILITIES_PAGE     0x1b
44 #define IDEFLOPPY_FLEXIBLE_DISK_PAGE    0x05
45
46 /* IOCTLs used in low-level formatting. */
47 #define IDEFLOPPY_IOCTL_FORMAT_SUPPORTED        0x4600
48 #define IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY     0x4601
49 #define IDEFLOPPY_IOCTL_FORMAT_START            0x4602
50 #define IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS     0x4603
51
52 /* ide-floppy.c */
53 void ide_floppy_create_mode_sense_cmd(struct ide_atapi_pc *, u8);
54 void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *);
55 void ide_floppy_create_request_sense_cmd(struct ide_atapi_pc *);
56
57 /* ide-floppy_ioctl.c */
58 int ide_floppy_format_ioctl(ide_drive_t *, struct file *, unsigned int,
59                             void __user *);
60
61 #endif /*__IDE_FLOPPY_H */