blob: ced5ceb474de7b5311b59543692bdc076be77b3f [file] [log] [blame]
Bartlomiej Zolnierkiewicz01278542008-10-10 22:39:38 +02001#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 */
9typedef 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
Bartlomiej Zolnierkiewicz01278542008-10-10 22:39:38 +020016 /* 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
Bartlomiej Zolnierkiewicz01278542008-10-10 22:39:38 +020021 /* Last error information */
22 u8 sense_key, asc, ascq;
23 /* delay this long before sending packet command */
24 u8 ticks;
25 int progress_indication;
26
27 /* Device information */
28 /* Current format */
29 int blocks, block_size, bs_factor;
30 /* Last format capacity descriptor */
31 u8 cap_desc[8];
32 /* Copy of the flexible disk page */
33 u8 flexible_disk_page[32];
34} idefloppy_floppy_t;
35
36/*
37 * Pages of the SELECT SENSE / MODE SENSE packet commands.
38 * See SFF-8070i spec.
39 */
40#define IDEFLOPPY_CAPABILITIES_PAGE 0x1b
41#define IDEFLOPPY_FLEXIBLE_DISK_PAGE 0x05
42
43/* IOCTLs used in low-level formatting. */
44#define IDEFLOPPY_IOCTL_FORMAT_SUPPORTED 0x4600
45#define IDEFLOPPY_IOCTL_FORMAT_GET_CAPACITY 0x4601
46#define IDEFLOPPY_IOCTL_FORMAT_START 0x4602
47#define IDEFLOPPY_IOCTL_FORMAT_GET_PROGRESS 0x4603
48
49/* ide-floppy.c */
50void ide_floppy_create_mode_sense_cmd(struct ide_atapi_pc *, u8);
51void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *);
Bartlomiej Zolnierkiewicz01278542008-10-10 22:39:38 +020052
53/* ide-floppy_ioctl.c */
54int ide_floppy_format_ioctl(ide_drive_t *, struct file *, unsigned int,
55 void __user *);
56
57#endif /*__IDE_FLOPPY_H */