]> git.hungrycats.org Git - linux/commitdiff
[libata] fake geometry for partition tables / setups that need such
authorMichael E. Brown <michael_e_brown@dell.com>
Tue, 16 Dec 2003 14:17:00 +0000 (09:17 -0500)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 16 Dec 2003 14:17:00 +0000 (09:17 -0500)
drivers/scsi/ata_piix.c
drivers/scsi/libata-core.c
drivers/scsi/sata_promise.c
drivers/scsi/sata_sil.c
drivers/scsi/sata_svw.c
drivers/scsi/sata_via.c
include/linux/libata.h

index 22e52f39e8aa356def98c9b645e55f97275ae4a3..ac371f363033637464fe334a3e876a77aa95e089 100644 (file)
@@ -97,6 +97,7 @@ static Scsi_Host_Template piix_sht = {
        .proc_name              = DRV_NAME,
        .dma_boundary           = ATA_DMA_BOUNDARY,
        .slave_configure        = ata_scsi_slave_config,
+       .bios_param             = ata_std_bios_param,
 };
 
 static struct ata_port_operations piix_pata_ops = {
index 64c6d0b8e569be9c5bebd56f692d8f62f46dc141..aaae472d983ce3d57b567428e2758d27c1dd708c 100644 (file)
@@ -3279,6 +3279,29 @@ int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits)
        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 -
  *
@@ -3304,6 +3327,7 @@ module_init(ata_init);
  */
 
 EXPORT_SYMBOL_GPL(pci_test_config_bits);
+EXPORT_SYMBOL_GPL(ata_std_bios_param);
 EXPORT_SYMBOL_GPL(ata_std_ports);
 EXPORT_SYMBOL_GPL(ata_device_add);
 EXPORT_SYMBOL_GPL(ata_qc_complete);
index 7160e3266ab13df1572d624b152446aca4f371ae..239d67950218e291b8e812b2c8314577643a35e3 100644 (file)
@@ -186,6 +186,7 @@ static Scsi_Host_Template pdc_sata_sht = {
        .proc_name              = DRV_NAME,
        .dma_boundary           = ATA_DMA_BOUNDARY,
        .slave_configure        = ata_scsi_slave_config,
+       .bios_param             = ata_std_bios_param,
 };
 
 static struct ata_port_operations pdc_sata_ops = {
index ce80f6290e1f5ecd2ba3ee00b07dc71361cbeeac..c513fea14da6b7133dde9315e7cd6444b78018ba 100644 (file)
@@ -87,6 +87,7 @@ static Scsi_Host_Template sil_sht = {
        .proc_name              = DRV_NAME,
        .dma_boundary           = ATA_DMA_BOUNDARY,
        .slave_configure        = ata_scsi_slave_config,
+       .bios_param             = ata_std_bios_param,
 };
 
 static struct ata_port_operations sil_ops = {
index 075bacfe0b783f25243b2b351661d3da29cbef22..7ff5dd72db75e4d2659d573812f25cbc6526e1ca 100644 (file)
@@ -219,6 +219,7 @@ static Scsi_Host_Template k2_sata_sht = {
 #ifdef CONFIG_ALL_PPC
        .proc_info              = k2_sata_proc_info
 #endif
+       .bios_param             = ata_std_bios_param,
 };
 
 
index 97a341ec96f0ed35e7399774703aeefebe448026..7eb858caa87ec170f791b4f6c065cb70e1cff731 100644 (file)
@@ -78,6 +78,7 @@ static Scsi_Host_Template svia_sht = {
        .proc_name              = DRV_NAME,
        .dma_boundary           = ATA_DMA_BOUNDARY,
        .slave_configure        = ata_scsi_slave_config,
+       .bios_param             = ata_std_bios_param,
 };
 
 static struct ata_port_operations svia_sata_ops = {
index feabeae1cfc09ae1421f28700834b39c9ecdebcd..df9013bf2c6455c7d293468b1adea992f8ec28ff 100644 (file)
@@ -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 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 int ata_std_bios_param(Disk * disk, kdev_t dev, int *ip);
 
 
 static inline unsigned long msecs_to_jiffies(unsigned long msecs)