diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:19:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-01-25 20:19:08 -0500 |
commit | 9b73e76f3cf63379dcf45fcd4f112f5812418d0a (patch) | |
tree | 4e6bef87cd0cd6d848fc39a5ae25b981dbbe035b /drivers/scsi/scsicam.c | |
parent | 50d9a126240f9961cfdd063336bbeb91f77a7dce (diff) | |
parent | 23c3e290fb9ce38cabc2822b47583fc8702411bf (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: (200 commits)
[SCSI] usbstorage: use last_sector_bug flag universally
[SCSI] libsas: abstract STP task status into a function
[SCSI] ultrastor: clean up inline asm warnings
[SCSI] aic7xxx: fix firmware build
[SCSI] aacraid: fib context lock for management ioctls
[SCSI] ch: remove forward declarations
[SCSI] ch: fix device minor number management bug
[SCSI] ch: handle class_device_create failure properly
[SCSI] NCR5380: fix section mismatch
[SCSI] sg: fix /proc/scsi/sg/devices when no SCSI devices
[SCSI] IB/iSER: add logical unit reset support
[SCSI] don't use __GFP_DMA for sense buffers if not required
[SCSI] use dynamically allocated sense buffer
[SCSI] scsi.h: add macro for enclosure bit of inquiry data
[SCSI] sd: add fix for devices with last sector access problems
[SCSI] fix pcmcia compile problem
[SCSI] aacraid: add Voodoo Lite class of cards.
[SCSI] aacraid: add new driver features flags
[SCSI] qla2xxx: Update version number to 8.02.00-k7.
[SCSI] qla2xxx: Issue correct MBC_INITIALIZE_FIRMWARE command.
...
Diffstat (limited to 'drivers/scsi/scsicam.c')
-rw-r--r-- | drivers/scsi/scsicam.c | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/drivers/scsi/scsicam.c b/drivers/scsi/scsicam.c index cd68a66c7bb3..3f21bc65e8c6 100644 --- a/drivers/scsi/scsicam.c +++ b/drivers/scsi/scsicam.c | |||
@@ -24,6 +24,14 @@ | |||
24 | static int setsize(unsigned long capacity, unsigned int *cyls, unsigned int *hds, | 24 | static int setsize(unsigned long capacity, unsigned int *cyls, unsigned int *hds, |
25 | unsigned int *secs); | 25 | unsigned int *secs); |
26 | 26 | ||
27 | /** | ||
28 | * scsi_bios_ptable - Read PC partition table out of first sector of device. | ||
29 | * @dev: from this device | ||
30 | * | ||
31 | * Description: Reads the first sector from the device and returns %0x42 bytes | ||
32 | * starting at offset %0x1be. | ||
33 | * Returns: partition table in kmalloc(GFP_KERNEL) memory, or NULL on error. | ||
34 | */ | ||
27 | unsigned char *scsi_bios_ptable(struct block_device *dev) | 35 | unsigned char *scsi_bios_ptable(struct block_device *dev) |
28 | { | 36 | { |
29 | unsigned char *res = kmalloc(66, GFP_KERNEL); | 37 | unsigned char *res = kmalloc(66, GFP_KERNEL); |
@@ -43,15 +51,17 @@ unsigned char *scsi_bios_ptable(struct block_device *dev) | |||
43 | } | 51 | } |
44 | EXPORT_SYMBOL(scsi_bios_ptable); | 52 | EXPORT_SYMBOL(scsi_bios_ptable); |
45 | 53 | ||
46 | /* | 54 | /** |
47 | * Function : int scsicam_bios_param (struct block_device *bdev, ector_t capacity, int *ip) | 55 | * scsicam_bios_param - Determine geometry of a disk in cylinders/heads/sectors. |
56 | * @bdev: which device | ||
57 | * @capacity: size of the disk in sectors | ||
58 | * @ip: return value: ip[0]=heads, ip[1]=sectors, ip[2]=cylinders | ||
48 | * | 59 | * |
49 | * Purpose : to determine the BIOS mapping used for a drive in a | 60 | * Description : determine the BIOS mapping/geometry used for a drive in a |
50 | * SCSI-CAM system, storing the results in ip as required | 61 | * SCSI-CAM system, storing the results in ip as required |
51 | * by the HDIO_GETGEO ioctl(). | 62 | * by the HDIO_GETGEO ioctl(). |
52 | * | 63 | * |
53 | * Returns : -1 on failure, 0 on success. | 64 | * Returns : -1 on failure, 0 on success. |
54 | * | ||
55 | */ | 65 | */ |
56 | 66 | ||
57 | int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) | 67 | int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) |
@@ -98,15 +108,18 @@ int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) | |||
98 | } | 108 | } |
99 | EXPORT_SYMBOL(scsicam_bios_param); | 109 | EXPORT_SYMBOL(scsicam_bios_param); |
100 | 110 | ||
101 | /* | 111 | /** |
102 | * Function : static int scsi_partsize(unsigned char *buf, unsigned long | 112 | * scsi_partsize - Parse cylinders/heads/sectors from PC partition table |
103 | * capacity,unsigned int *cyls, unsigned int *hds, unsigned int *secs); | 113 | * @buf: partition table, see scsi_bios_ptable() |
114 | * @capacity: size of the disk in sectors | ||
115 | * @cyls: put cylinders here | ||
116 | * @hds: put heads here | ||
117 | * @secs: put sectors here | ||
104 | * | 118 | * |
105 | * Purpose : to determine the BIOS mapping used to create the partition | 119 | * Description: determine the BIOS mapping/geometry used to create the partition |
106 | * table, storing the results in *cyls, *hds, and *secs | 120 | * table, storing the results in *cyls, *hds, and *secs |
107 | * | 121 | * |
108 | * Returns : -1 on failure, 0 on success. | 122 | * Returns: -1 on failure, 0 on success. |
109 | * | ||
110 | */ | 123 | */ |
111 | 124 | ||
112 | int scsi_partsize(unsigned char *buf, unsigned long capacity, | 125 | int scsi_partsize(unsigned char *buf, unsigned long capacity, |
@@ -194,7 +207,7 @@ EXPORT_SYMBOL(scsi_partsize); | |||
194 | * | 207 | * |
195 | * WORKING X3T9.2 | 208 | * WORKING X3T9.2 |
196 | * DRAFT 792D | 209 | * DRAFT 792D |
197 | * | 210 | * see http://www.t10.org/ftp/t10/drafts/cam/cam-r12b.pdf |
198 | * | 211 | * |
199 | * Revision 6 | 212 | * Revision 6 |
200 | * 10-MAR-94 | 213 | * 10-MAR-94 |