Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 49111
b: refs/heads/master
c: cf62a0a
h: refs/heads/master
i:
  49109: 6db178a
  49107: 77d41c1
  49103: 530dedd
v: v3
  • Loading branch information
Sumant Patro authored and James Bottomley committed Feb 16, 2007
1 parent cabd758 commit 5d396b3
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af37acfb63d8e924550e67b884dbd1c478e26c96
refs/heads/master: cf62a0a543fbab15286509d2e04e3dcf5549e966
45 changes: 45 additions & 0 deletions trunk/drivers/scsi/megaraid/megaraid_sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <asm/uaccess.h>
#include <linux/fs.h>
#include <linux/compat.h>
#include <linux/blkdev.h>
#include <linux/mutex.h>

#include <scsi/scsi.h>
Expand Down Expand Up @@ -1014,6 +1015,49 @@ static int megasas_reset_bus_host(struct scsi_cmnd *scmd)
return ret;
}

/**
* megasas_bios_param - Returns disk geometry for a disk
* @sdev: device handle
* @bdev: block device
* @capacity: drive capacity
* @geom: geometry parameters
*/
static int
megasas_bios_param(struct scsi_device *sdev, struct block_device *bdev,
sector_t capacity, int geom[])
{
int heads;
int sectors;
sector_t cylinders;
unsigned long tmp;
/* Default heads (64) & sectors (32) */
heads = 64;
sectors = 32;

tmp = heads * sectors;
cylinders = capacity;

sector_div(cylinders, tmp);

/*
* Handle extended translation size for logical drives > 1Gb
*/

if (capacity >= 0x200000) {
heads = 255;
sectors = 63;
tmp = heads*sectors;
cylinders = capacity;
sector_div(cylinders, tmp);
}

geom[0] = heads;
geom[1] = sectors;
geom[2] = cylinders;

return 0;
}

/**
* megasas_service_aen - Processes an event notification
* @instance: Adapter soft state
Expand Down Expand Up @@ -1054,6 +1098,7 @@ static struct scsi_host_template megasas_template = {
.eh_device_reset_handler = megasas_reset_device,
.eh_bus_reset_handler = megasas_reset_bus_host,
.eh_host_reset_handler = megasas_reset_bus_host,
.bios_param = megasas_bios_param,
.use_clustering = ENABLE_CLUSTERING,
};

Expand Down

0 comments on commit 5d396b3

Please sign in to comment.