Commit 7f117c41 authored by Michael E. Brown's avatar Michael E. Brown Committed by Jeff Garzik

[libata] fake geometry for partition tables / setups that need such

parent f143781b
...@@ -97,6 +97,7 @@ static Scsi_Host_Template piix_sht = { ...@@ -97,6 +97,7 @@ static Scsi_Host_Template piix_sht = {
.proc_name = DRV_NAME, .proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY, .dma_boundary = ATA_DMA_BOUNDARY,
.slave_configure = ata_scsi_slave_config, .slave_configure = ata_scsi_slave_config,
.bios_param = ata_std_bios_param,
}; };
static struct ata_port_operations piix_pata_ops = { static struct ata_port_operations piix_pata_ops = {
......
...@@ -3279,6 +3279,29 @@ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits) ...@@ -3279,6 +3279,29 @@ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits)
return (tmp == bits->val) ? 1 : 0; return (tmp == bits->val) ? 1 : 0;
} }
/**
* ata_std_bios_param - generic bios head/sector/cylinder calculator
* used by sd. Most BIOSes nowadays expect a XXX/255/16 (CHS)
* mapping. Some situations may arise where the disk is not
* bootable if this is not used.
*
* LOCKING:
*
* RETURNS:
*
*/
int ata_std_bios_param(Disk * disk, /* SCSI disk */
kdev_t dev, /* Device major, minor */
int *ip /* Heads, sectors, cylinders in that order */ )
{
ip[0] = 255;
ip[1] = 63;
ip[2] = disk->capacity / (ip[0] * ip[1]);
return 0;
}
/** /**
* ata_init - * ata_init -
* *
...@@ -3304,6 +3327,7 @@ module_init(ata_init); ...@@ -3304,6 +3327,7 @@ module_init(ata_init);
*/ */
EXPORT_SYMBOL_GPL(pci_test_config_bits); EXPORT_SYMBOL_GPL(pci_test_config_bits);
EXPORT_SYMBOL_GPL(ata_std_bios_param);
EXPORT_SYMBOL_GPL(ata_std_ports); EXPORT_SYMBOL_GPL(ata_std_ports);
EXPORT_SYMBOL_GPL(ata_device_add); EXPORT_SYMBOL_GPL(ata_device_add);
EXPORT_SYMBOL_GPL(ata_qc_complete); EXPORT_SYMBOL_GPL(ata_qc_complete);
......
...@@ -186,6 +186,7 @@ static Scsi_Host_Template pdc_sata_sht = { ...@@ -186,6 +186,7 @@ static Scsi_Host_Template pdc_sata_sht = {
.proc_name = DRV_NAME, .proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY, .dma_boundary = ATA_DMA_BOUNDARY,
.slave_configure = ata_scsi_slave_config, .slave_configure = ata_scsi_slave_config,
.bios_param = ata_std_bios_param,
}; };
static struct ata_port_operations pdc_sata_ops = { static struct ata_port_operations pdc_sata_ops = {
......
...@@ -87,6 +87,7 @@ static Scsi_Host_Template sil_sht = { ...@@ -87,6 +87,7 @@ static Scsi_Host_Template sil_sht = {
.proc_name = DRV_NAME, .proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY, .dma_boundary = ATA_DMA_BOUNDARY,
.slave_configure = ata_scsi_slave_config, .slave_configure = ata_scsi_slave_config,
.bios_param = ata_std_bios_param,
}; };
static struct ata_port_operations sil_ops = { static struct ata_port_operations sil_ops = {
......
...@@ -219,6 +219,7 @@ static Scsi_Host_Template k2_sata_sht = { ...@@ -219,6 +219,7 @@ static Scsi_Host_Template k2_sata_sht = {
#ifdef CONFIG_ALL_PPC #ifdef CONFIG_ALL_PPC
.proc_info = k2_sata_proc_info .proc_info = k2_sata_proc_info
#endif #endif
.bios_param = ata_std_bios_param,
}; };
......
...@@ -78,6 +78,7 @@ static Scsi_Host_Template svia_sht = { ...@@ -78,6 +78,7 @@ static Scsi_Host_Template svia_sht = {
.proc_name = DRV_NAME, .proc_name = DRV_NAME,
.dma_boundary = ATA_DMA_BOUNDARY, .dma_boundary = ATA_DMA_BOUNDARY,
.slave_configure = ata_scsi_slave_config, .slave_configure = ata_scsi_slave_config,
.bios_param = ata_std_bios_param,
}; };
static struct ata_port_operations svia_sata_ops = { static struct ata_port_operations svia_sata_ops = {
......
...@@ -427,6 +427,7 @@ extern void ata_bmdma_start_pio (struct ata_queued_cmd *qc); ...@@ -427,6 +427,7 @@ extern void ata_bmdma_start_pio (struct ata_queued_cmd *qc);
extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat, unsigned int done_late); extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat, unsigned int done_late);
extern void ata_eng_timeout(struct ata_port *ap); extern void ata_eng_timeout(struct ata_port *ap);
extern int ata_std_bios_param(Disk * disk, kdev_t dev, int *ip);
static inline unsigned long msecs_to_jiffies(unsigned long msecs) static inline unsigned long msecs_to_jiffies(unsigned long msecs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment