diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 21:58:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-15 21:58:04 -0400 |
commit | 89a93f2f4834f8c126e8d9dd6b368d0b9e21ec3d (patch) | |
tree | e731456fec0cab1225ad3e806dc8d3efefa0a78b /drivers/scsi/sd.h | |
parent | 260eddf4391f162a69d1d163729249635fa7a78f (diff) | |
parent | fe9233fb6914a0eb20166c967e3020f7f0fba2c9 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (102 commits)
[SCSI] scsi_dh: fix kconfig related build errors
[SCSI] sym53c8xx: Fix bogus sym_que_entry re-implementation of container_of
[SCSI] scsi_cmnd.h: remove double inclusion of linux/blkdev.h
[SCSI] make struct scsi_{host,target}_type static
[SCSI] fix locking in host use of blk_plug_device()
[SCSI] zfcp: Cleanup external header file
[SCSI] zfcp: Cleanup code in zfcp_erp.c
[SCSI] zfcp: zfcp_fsf cleanup.
[SCSI] zfcp: consolidate sysfs things into one file.
[SCSI] zfcp: Cleanup of code in zfcp_aux.c
[SCSI] zfcp: Cleanup of code in zfcp_scsi.c
[SCSI] zfcp: Move status accessors from zfcp to SCSI include file.
[SCSI] zfcp: Small QDIO cleanups
[SCSI] zfcp: Adapter reopen for large number of unsolicited status
[SCSI] zfcp: Fix error checking for ELS ADISC requests
[SCSI] zfcp: wait until adapter is finished with ERP during auto-port
[SCSI] ibmvfc: IBM Power Virtual Fibre Channel Adapter Client Driver
[SCSI] sg: Add target reset support
[SCSI] lib: Add support for the T10 (SCSI) Data Integrity Field CRC
[SCSI] sd: Move scsi_disk() accessor function to sd.h
...
Diffstat (limited to 'drivers/scsi/sd.h')
-rw-r--r-- | drivers/scsi/sd.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h new file mode 100644 index 000000000000..03a3d45cfa42 --- /dev/null +++ b/drivers/scsi/sd.h | |||
@@ -0,0 +1,62 @@ | |||
1 | #ifndef _SCSI_DISK_H | ||
2 | #define _SCSI_DISK_H | ||
3 | |||
4 | /* | ||
5 | * More than enough for everybody ;) The huge number of majors | ||
6 | * is a leftover from 16bit dev_t days, we don't really need that | ||
7 | * much numberspace. | ||
8 | */ | ||
9 | #define SD_MAJORS 16 | ||
10 | |||
11 | /* | ||
12 | * This is limited by the naming scheme enforced in sd_probe, | ||
13 | * add another character to it if you really need more disks. | ||
14 | */ | ||
15 | #define SD_MAX_DISKS (((26 * 26) + 26 + 1) * 26) | ||
16 | |||
17 | /* | ||
18 | * Time out in seconds for disks and Magneto-opticals (which are slower). | ||
19 | */ | ||
20 | #define SD_TIMEOUT (30 * HZ) | ||
21 | #define SD_MOD_TIMEOUT (75 * HZ) | ||
22 | |||
23 | /* | ||
24 | * Number of allowed retries | ||
25 | */ | ||
26 | #define SD_MAX_RETRIES 5 | ||
27 | #define SD_PASSTHROUGH_RETRIES 1 | ||
28 | |||
29 | /* | ||
30 | * Size of the initial data buffer for mode and read capacity data | ||
31 | */ | ||
32 | #define SD_BUF_SIZE 512 | ||
33 | |||
34 | struct scsi_disk { | ||
35 | struct scsi_driver *driver; /* always &sd_template */ | ||
36 | struct scsi_device *device; | ||
37 | struct device dev; | ||
38 | struct gendisk *disk; | ||
39 | unsigned int openers; /* protected by BKL for now, yuck */ | ||
40 | sector_t capacity; /* size in 512-byte sectors */ | ||
41 | u32 index; | ||
42 | u8 media_present; | ||
43 | u8 write_prot; | ||
44 | unsigned previous_state : 1; | ||
45 | unsigned WCE : 1; /* state of disk WCE bit */ | ||
46 | unsigned RCD : 1; /* state of disk RCD bit, unused */ | ||
47 | unsigned DPOFUA : 1; /* state of disk DPOFUA bit */ | ||
48 | }; | ||
49 | #define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev) | ||
50 | |||
51 | static inline struct scsi_disk *scsi_disk(struct gendisk *disk) | ||
52 | { | ||
53 | return container_of(disk->private_data, struct scsi_disk, driver); | ||
54 | } | ||
55 | |||
56 | #define sd_printk(prefix, sdsk, fmt, a...) \ | ||
57 | (sdsk)->disk ? \ | ||
58 | sdev_printk(prefix, (sdsk)->device, "[%s] " fmt, \ | ||
59 | (sdsk)->disk->disk_name, ##a) : \ | ||
60 | sdev_printk(prefix, (sdsk)->device, fmt, ##a) | ||
61 | |||
62 | #endif /* _SCSI_DISK_H */ | ||