Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
scsicam.c File Reference
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/fs.h>
#include <linux/genhd.h>
#include <linux/kernel.h>
#include <linux/blkdev.h>
#include <asm/unaligned.h>
#include <scsi/scsicam.h>

Go to the source code of this file.

Functions

unsigned charscsi_bios_ptable (struct block_device *dev)
 
 EXPORT_SYMBOL (scsi_bios_ptable)
 
int scsicam_bios_param (struct block_device *bdev, sector_t capacity, int *ip)
 
 EXPORT_SYMBOL (scsicam_bios_param)
 
int scsi_partsize (unsigned char *buf, unsigned long capacity, unsigned int *cyls, unsigned int *hds, unsigned int *secs)
 
 EXPORT_SYMBOL (scsi_partsize)
 

Function Documentation

EXPORT_SYMBOL ( scsi_bios_ptable  )
EXPORT_SYMBOL ( scsicam_bios_param  )
EXPORT_SYMBOL ( scsi_partsize  )
unsigned char* scsi_bios_ptable ( struct block_device dev)

scsi_bios_ptable - Read PC partition table out of first sector of device. : from this device

Description: Reads the first sector from the device and returns %0x42 bytes starting at offset %0x1be. Returns: partition table in kmalloc(GFP_KERNEL) memory, or NULL on error.

Definition at line 35 of file scsicam.c.

int scsi_partsize ( unsigned char buf,
unsigned long  capacity,
unsigned int cyls,
unsigned int hds,
unsigned int secs 
)

scsi_partsize - Parse cylinders/heads/sectors from PC partition table : partition table, see scsi_bios_ptable() : size of the disk in sectors : put cylinders here : put heads here : put sectors here

Description: determine the BIOS mapping/geometry used to create the partition table, storing the results in *cyls, *hds, and *secs

Returns: -1 on failure, 0 on success.

Definition at line 125 of file scsicam.c.

int scsicam_bios_param ( struct block_device bdev,
sector_t  capacity,
int ip 
)

scsicam_bios_param - Determine geometry of a disk in cylinders/heads/sectors. : which device : size of the disk in sectors : return value: ip[0]=heads, ip[1]=sectors, ip[2]=cylinders

Description : determine the BIOS mapping/geometry used for a drive in a SCSI-CAM system, storing the results in ip as required by the HDIO_GETGEO ioctl().

Returns : -1 on failure, 0 on success.

Definition at line 67 of file scsicam.c.