Skip to contentSkip to conversation

PATCH: Add enablebits to via driver

PATCH Applied Alan Cox 2 participants 2 messages Nov 8, 2005 – Nov 9, 2005 SCSI

lore
Share & tools
lore

Alan Cox

author
#0 lore raw
drivers/scsi/pata_via.c +14 -1
diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.14-mm1/drivers/scsi/pata_via.c linux-2.6.14-mm1/drivers/scsi/pata_via.c
@@ -61,7 +61,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME "pata_via"
-#define DRV_VERSION "0.1"
+#define DRV_VERSION "0.1.1"
 
 /*
  *	The following comes directly from Vojtech Pavlik's ide/pci/via82cxxx
@@ -148,6 +148,19 @@
  
 static void via_phy_reset(struct ata_port *ap)
 {
+	struct pci_dev *pdev = to_pci_dev(ap->host_set->dev);
+	
+	/* Note: When we add VIA 6410 remember it doesn't have enable bits */
+	static struct pci_bits via_enable_bits[] = {
+		{ 0x40, 0x02, 0x02 },
+		{ 0x40, 0x01, 0x01 }
+	};
+
+	if (!pci_test_config_bits(pdev, &via_enable_bits[ap->hard_port_no])) {
+		ata_port_disable(ap);
+		printk(KERN_INFO "ata%u: port disabled. ignoring.\n", ap->id);
+		return;
+	}
 	ap->cbl = via_cable_detect(ap);
 	ata_bus_reset(ap);
 	ata_port_probe(ap);