aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_serverworks.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2011-10-11 14:09:31 -0400
committerJeff Garzik <jgarzik@redhat.com>2011-10-14 13:15:54 -0400
commit5860a5545a308850fab11bd8dadd217973d3cc97 (patch)
tree2ffd14f8bbc9c81d08051ef805ce26b5c32132ee /drivers/ata/pata_serverworks.c
parent57242762e4d8e7c1fda6d79bf8a6f081f22db57d (diff)
pata_serverworks: use standard cable detection methods
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/pata_serverworks.c')
-rw-r--r--drivers/ata/pata_serverworks.c45
1 files changed, 12 insertions, 33 deletions
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index 86dd714e3e1d..e49365f36dab 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -65,7 +65,8 @@ static const char *csb_bad_ata100[] = {
65 * bits of the subsystem ID. 65 * bits of the subsystem ID.
66 */ 66 */
67 67
68static int dell_cable(struct ata_port *ap) { 68static int dell_cable(struct ata_port *ap)
69{
69 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 70 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
70 71
71 if (pdev->subsystem_device & (1 << (ap->port_no + 14))) 72 if (pdev->subsystem_device & (1 << (ap->port_no + 14)))
@@ -82,7 +83,8 @@ static int dell_cable(struct ata_port *ap) {
82 * need to extend the Dell one in future 83 * need to extend the Dell one in future
83 */ 84 */
84 85
85static int sun_cable(struct ata_port *ap) { 86static int sun_cable(struct ata_port *ap)
87{
86 struct pci_dev *pdev = to_pci_dev(ap->host->dev); 88 struct pci_dev *pdev = to_pci_dev(ap->host->dev);
87 89
88 if (pdev->subsystem_device & (1 << (ap->port_no + 14))) 90 if (pdev->subsystem_device & (1 << (ap->port_no + 14)))
@@ -90,29 +92,6 @@ static int sun_cable(struct ata_port *ap) {
90 return ATA_CBL_PATA40; 92 return ATA_CBL_PATA40;
91} 93}
92 94
93/**
94 * osb4_cable - OSB4 cable detect
95 * @ap: ATA port to check
96 *
97 * The OSB4 isn't UDMA66 capable so this is easy
98 */
99
100static int osb4_cable(struct ata_port *ap) {
101 return ATA_CBL_PATA40;
102}
103
104/**
105 * csb_cable - CSB5/6 cable detect
106 * @ap: ATA port to check
107 *
108 * Serverworks default arrangement is to use the drive side detection
109 * only.
110 */
111
112static int csb_cable(struct ata_port *ap) {
113 return ATA_CBL_PATA_UNK;
114}
115
116struct sv_cable_table { 95struct sv_cable_table {
117 int device; 96 int device;
118 int subvendor; 97 int subvendor;
@@ -125,14 +104,14 @@ struct sv_cable_table {
125 */ 104 */
126 105
127static struct sv_cable_table cable_detect[] = { 106static struct sv_cable_table cable_detect[] = {
128 { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_DELL, dell_cable }, 107 { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_DELL, dell_cable },
129 { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_VENDOR_ID_DELL, dell_cable }, 108 { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_VENDOR_ID_DELL, dell_cable },
130 { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_SUN, sun_cable }, 109 { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_VENDOR_ID_SUN, sun_cable },
131 { PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, PCI_ANY_ID, osb4_cable }, 110 { PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, PCI_ANY_ID, ata_cable_40wire },
132 { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, csb_cable }, 111 { PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, PCI_ANY_ID, ata_cable_unknown },
133 { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, csb_cable }, 112 { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, PCI_ANY_ID, ata_cable_unknown },
134 { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, csb_cable }, 113 { PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, PCI_ANY_ID, ata_cable_unknown },
135 { PCI_DEVICE_ID_SERVERWORKS_HT1000IDE, PCI_ANY_ID, csb_cable }, 114 { PCI_DEVICE_ID_SERVERWORKS_HT1000IDE, PCI_ANY_ID, ata_cable_unknown },
136 { } 115 { }
137}; 116};
138 117