aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ata/libata-core.c2
-rw-r--r--drivers/ata/libata-sff.c4
-rw-r--r--drivers/ata/pata_ali.c4
-rw-r--r--drivers/ata/pata_hpt366.c4
-rw-r--r--drivers/ata/pata_hpt37x.c10
-rw-r--r--drivers/ata/pata_serverworks.c14
-rw-r--r--include/linux/libata.h4
7 files changed, 20 insertions, 22 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index d01bb5d50fcc..eaab6d925ef2 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3545,7 +3545,7 @@ static void ata_dev_xfermask(struct ata_device *dev)
3545 } 3545 }
3546 3546
3547 if (ap->ops->mode_filter) 3547 if (ap->ops->mode_filter)
3548 xfer_mask = ap->ops->mode_filter(ap, dev, xfer_mask); 3548 xfer_mask = ap->ops->mode_filter(dev, xfer_mask);
3549 3549
3550 /* Apply cable rule here. Don't apply it early because when 3550 /* Apply cable rule here. Don't apply it early because when
3551 * we handle hot plug the cable type can itself change. 3551 * we handle hot plug the cable type can itself change.
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index 2ffcca063d80..066689c5e509 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -893,12 +893,12 @@ int ata_pci_clear_simplex(struct pci_dev *pdev)
893 return 0; 893 return 0;
894} 894}
895 895
896unsigned long ata_pci_default_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long xfer_mask) 896unsigned long ata_pci_default_filter(struct ata_device *adev, unsigned long xfer_mask)
897{ 897{
898 /* Filter out DMA modes if the device has been configured by 898 /* Filter out DMA modes if the device has been configured by
899 the BIOS as PIO only */ 899 the BIOS as PIO only */
900 900
901 if (ap->ioaddr.bmdma_addr == 0) 901 if (adev->ap->ioaddr.bmdma_addr == 0)
902 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA); 902 xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
903 return xfer_mask; 903 return xfer_mask;
904} 904}
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index 76243400c01d..047f636e258d 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -151,7 +151,7 @@ static void ali_early_error_handler(struct ata_port *ap)
151 * fix that later on. Also ensure we do not do UDMA on WDC drives 151 * fix that later on. Also ensure we do not do UDMA on WDC drives
152 */ 152 */
153 153
154static unsigned long ali_20_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) 154static unsigned long ali_20_filter(struct ata_device *adev, unsigned long mask)
155{ 155{
156 char model_num[ATA_ID_PROD_LEN + 1]; 156 char model_num[ATA_ID_PROD_LEN + 1];
157 /* No DMA on anything but a disk for now */ 157 /* No DMA on anything but a disk for now */
@@ -160,7 +160,7 @@ static unsigned long ali_20_filter(const struct ata_port *ap, struct ata_device
160 ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num)); 160 ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num));
161 if (strstr(model_num, "WDC")) 161 if (strstr(model_num, "WDC"))
162 return mask &= ~ATA_MASK_UDMA; 162 return mask &= ~ATA_MASK_UDMA;
163 return ata_pci_default_filter(ap, adev, mask); 163 return ata_pci_default_filter(adev, mask);
164} 164}
165 165
166/** 166/**
diff --git a/drivers/ata/pata_hpt366.c b/drivers/ata/pata_hpt366.c
index e9ad4eba0670..c3e5ea35e0f8 100644
--- a/drivers/ata/pata_hpt366.c
+++ b/drivers/ata/pata_hpt366.c
@@ -175,7 +175,7 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, cons
175 * Block UDMA on devices that cause trouble with this controller. 175 * Block UDMA on devices that cause trouble with this controller.
176 */ 176 */
177 177
178static unsigned long hpt366_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) 178static unsigned long hpt366_filter(struct ata_device *adev, unsigned long mask)
179{ 179{
180 if (adev->class == ATA_DEV_ATA) { 180 if (adev->class == ATA_DEV_ATA) {
181 if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33)) 181 if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
@@ -185,7 +185,7 @@ static unsigned long hpt366_filter(const struct ata_port *ap, struct ata_device
185 if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4)) 185 if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4))
186 mask &= ~(0x0F << ATA_SHIFT_UDMA); 186 mask &= ~(0x0F << ATA_SHIFT_UDMA);
187 } 187 }
188 return ata_pci_default_filter(ap, adev, mask); 188 return ata_pci_default_filter(adev, mask);
189} 189}
190 190
191/** 191/**
diff --git a/drivers/ata/pata_hpt37x.c b/drivers/ata/pata_hpt37x.c
index 12f387f37771..fe1b482d5291 100644
--- a/drivers/ata/pata_hpt37x.c
+++ b/drivers/ata/pata_hpt37x.c
@@ -272,13 +272,12 @@ static const char *bad_ata100_5[] = {
272 272
273/** 273/**
274 * hpt370_filter - mode selection filter 274 * hpt370_filter - mode selection filter
275 * @ap: ATA interface
276 * @adev: ATA device 275 * @adev: ATA device
277 * 276 *
278 * Block UDMA on devices that cause trouble with this controller. 277 * Block UDMA on devices that cause trouble with this controller.
279 */ 278 */
280 279
281static unsigned long hpt370_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) 280static unsigned long hpt370_filter(struct ata_device *adev, unsigned long mask)
282{ 281{
283 if (adev->class == ATA_DEV_ATA) { 282 if (adev->class == ATA_DEV_ATA) {
284 if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33)) 283 if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
@@ -286,24 +285,23 @@ static unsigned long hpt370_filter(const struct ata_port *ap, struct ata_device
286 if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5)) 285 if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
287 mask &= ~(0x1F << ATA_SHIFT_UDMA); 286 mask &= ~(0x1F << ATA_SHIFT_UDMA);
288 } 287 }
289 return ata_pci_default_filter(ap, adev, mask); 288 return ata_pci_default_filter(adev, mask);
290} 289}
291 290
292/** 291/**
293 * hpt370a_filter - mode selection filter 292 * hpt370a_filter - mode selection filter
294 * @ap: ATA interface
295 * @adev: ATA device 293 * @adev: ATA device
296 * 294 *
297 * Block UDMA on devices that cause trouble with this controller. 295 * Block UDMA on devices that cause trouble with this controller.
298 */ 296 */
299 297
300static unsigned long hpt370a_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) 298static unsigned long hpt370a_filter(struct ata_device *adev, unsigned long mask)
301{ 299{
302 if (adev->class != ATA_DEV_ATA) { 300 if (adev->class != ATA_DEV_ATA) {
303 if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5)) 301 if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
304 mask &= ~ (0x1F << ATA_SHIFT_UDMA); 302 mask &= ~ (0x1F << ATA_SHIFT_UDMA);
305 } 303 }
306 return ata_pci_default_filter(ap, adev, mask); 304 return ata_pci_default_filter(adev, mask);
307} 305}
308 306
309/** 307/**
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c
index 283e9afade01..3956ef26936d 100644
--- a/drivers/ata/pata_serverworks.c
+++ b/drivers/ata/pata_serverworks.c
@@ -185,31 +185,31 @@ static u8 serverworks_is_csb(struct pci_dev *pdev)
185 185
186/** 186/**
187 * serverworks_osb4_filter - mode selection filter 187 * serverworks_osb4_filter - mode selection filter
188 * @ap: ATA interface
189 * @adev: ATA device 188 * @adev: ATA device
189 * @mask: Mask of proposed modes
190 * 190 *
191 * Filter the offered modes for the device to apply controller 191 * Filter the offered modes for the device to apply controller
192 * specific rules. OSB4 requires no UDMA for disks due to a FIFO 192 * specific rules. OSB4 requires no UDMA for disks due to a FIFO
193 * bug we hit. 193 * bug we hit.
194 */ 194 */
195 195
196static unsigned long serverworks_osb4_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) 196static unsigned long serverworks_osb4_filter(struct ata_device *adev, unsigned long mask)
197{ 197{
198 if (adev->class == ATA_DEV_ATA) 198 if (adev->class == ATA_DEV_ATA)
199 mask &= ~ATA_MASK_UDMA; 199 mask &= ~ATA_MASK_UDMA;
200 return ata_pci_default_filter(ap, adev, mask); 200 return ata_pci_default_filter(adev, mask);
201} 201}
202 202
203 203
204/** 204/**
205 * serverworks_csb_filter - mode selection filter 205 * serverworks_csb_filter - mode selection filter
206 * @ap: ATA interface
207 * @adev: ATA device 206 * @adev: ATA device
207 * @mask: Mask of proposed modes
208 * 208 *
209 * Check the blacklist and disable UDMA5 if matched 209 * Check the blacklist and disable UDMA5 if matched
210 */ 210 */
211 211
212static unsigned long serverworks_csb_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask) 212static unsigned long serverworks_csb_filter(struct ata_device *adev, unsigned long mask)
213{ 213{
214 const char *p; 214 const char *p;
215 char model_num[ATA_ID_PROD_LEN + 1]; 215 char model_num[ATA_ID_PROD_LEN + 1];
@@ -217,7 +217,7 @@ static unsigned long serverworks_csb_filter(const struct ata_port *ap, struct at
217 217
218 /* Disk, UDMA */ 218 /* Disk, UDMA */
219 if (adev->class != ATA_DEV_ATA) 219 if (adev->class != ATA_DEV_ATA)
220 return ata_pci_default_filter(ap, adev, mask); 220 return ata_pci_default_filter(adev, mask);
221 221
222 /* Actually do need to check */ 222 /* Actually do need to check */
223 ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num)); 223 ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num));
@@ -226,7 +226,7 @@ static unsigned long serverworks_csb_filter(const struct ata_port *ap, struct at
226 if (!strcmp(p, model_num)) 226 if (!strcmp(p, model_num))
227 mask &= ~(0x1F << ATA_SHIFT_UDMA); 227 mask &= ~(0x1F << ATA_SHIFT_UDMA);
228 } 228 }
229 return ata_pci_default_filter(ap, adev, mask); 229 return ata_pci_default_filter(adev, mask);
230} 230}
231 231
232 232
diff --git a/include/linux/libata.h b/include/linux/libata.h
index c145d9df04d0..5a40a8d95114 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -601,7 +601,7 @@ struct ata_port_operations {
601 601
602 void (*set_piomode) (struct ata_port *, struct ata_device *); 602 void (*set_piomode) (struct ata_port *, struct ata_device *);
603 void (*set_dmamode) (struct ata_port *, struct ata_device *); 603 void (*set_dmamode) (struct ata_port *, struct ata_device *);
604 unsigned long (*mode_filter) (const struct ata_port *, struct ata_device *, unsigned long); 604 unsigned long (*mode_filter) (struct ata_device *, unsigned long);
605 605
606 void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); 606 void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf);
607 void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); 607 void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf);
@@ -882,7 +882,7 @@ struct pci_bits {
882extern struct ata_probe_ent * 882extern struct ata_probe_ent *
883ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); 883ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
884extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); 884extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
885extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long); 885extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long);
886#endif /* CONFIG_PCI */ 886#endif /* CONFIG_PCI */
887 887
888/* 888/*