7 #include <linux/module.h>
8 #include <linux/types.h>
9 #include <linux/string.h>
10 #include <linux/kernel.h>
15 #include <linux/errno.h>
18 #include <linux/slab.h>
19 #include <linux/pci.h>
22 #include <linux/bitops.h>
25 #include <asm/byteorder.h>
27 #include <asm/uaccess.h>
50 #ifndef __LITTLE_ENDIAN
54 for (i = 0; i < 256; i++)
57 # error "Please fix <asm/byteorder.h>"
71 u8 *
p, *
end = &s[bytecount & ~1];
75 for (p = s ; p !=
end ; p += 2)
81 while (s != end && *s ==
' ')
84 while (s != end && *s) {
85 if (*s++ !=
' ' || (s != end && *s && *s !=
' '))
106 unsigned long timeout,
u8 *rstat)
121 while ((stat = tp_ops->
read_status(hwif)) & ATA_BUSY) {
129 if ((stat & ATA_BUSY) == 0)
146 for (i = 0; i < 10; i++) {
150 if (
OK_STAT(stat, good, bad)) {
165 u8 bad,
unsigned long timeout)
179 char *
s = (err == -
EBUSY) ?
"status timeout" :
"status error";
212 {
"QUANTUM FIREBALLlct10 05" ,
"A03.0900" },
213 {
"QUANTUM FIREBALLlct20 30" ,
"APL.0900" },
214 {
"TSSTcorp CDDVDW SH-S202J" ,
"SB00" },
215 {
"TSSTcorp CDDVDW SH-S202J" ,
"SB01" },
216 {
"TSSTcorp CDDVDW SH-S202N" ,
"SB00" },
217 {
"TSSTcorp CDDVDW SH-S202N" ,
"SB01" },
218 {
"TSSTcorp CDDVDW SH-S202H" ,
"SB00" },
219 {
"TSSTcorp CDDVDW SH-S202H" ,
"SB01" },
220 {
"SAMSUNG SP0822N" ,
"WA100-10" },
241 if (ata_id_is_sata(
id) && !ivb)
259 if (
strstr(model,
"TSSTcorp CDDVDW SH-S202")) {
277 "limiting max speed to UDMA33\n",
286 static const char *nien_quirk_list[] = {
287 "QUANTUM FIREBALLlct08 08",
288 "QUANTUM FIREBALLP KA6.4",
289 "QUANTUM FIREBALLP KA9.1",
290 "QUANTUM FIREBALLP KX13.6",
291 "QUANTUM FIREBALLP KX20.5",
292 "QUANTUM FIREBALLP KX27.3",
293 "QUANTUM FIREBALLP LM20.4",
294 "QUANTUM FIREBALLP LM20.5",
295 "FUJITSU MHZ2160BH G2",
303 for (list = nien_quirk_list; *list !=
NULL; list++)
351 #ifdef CONFIG_BLK_DEV_IDEDMA
353 hwif->
dma_ops->dma_host_set(drive, 0);
373 memset(&tf, 0,
sizeof(tf));
399 if (ata_id_is_cfa(
id))
401 }
else if (ata_id_is_cfa(
id))
405 #ifdef CONFIG_BLK_DEV_IDEDMA
407 hwif->
dma_ops->dma_host_set(drive, 1);
424 }
else if (ata_id_is_cfa(
id) && speed >=
XFER_PIO_5) {
445 unsigned int timeout)
457 unsigned int timeout)
464 spin_unlock_irqrestore(&hwif->
lock, flags);
492 hwif->
tp_ops->exec_command(hwif, cmd->
tf.command);
500 spin_unlock_irqrestore(&hwif->
lock, flags);
517 stat = hwif->
tp_ops->read_status(hwif);