10 #include <linux/types.h>
11 #include <linux/module.h>
12 #include <linux/kernel.h>
13 #include <linux/pci.h>
17 #define DRV_NAME "slc90e66"
24 int is_slave = drive->
dn & 1;
25 int master_port = hwif->
channel ? 0x42 : 0x40;
26 int slave_port = 0x44;
42 pci_read_config_word(dev, master_port, &master_data);
51 master_data |= 0x4000;
52 master_data &= ~0x0070;
55 master_data |= control << 4;
57 pci_read_config_byte(dev, slave_port, &slave_data);
58 slave_data &= hwif->
channel ? 0x0f : 0xf0;
59 slave_data |= ((timings[
pio][0] << 2) | timings[pio][1]) <<
62 master_data &= ~0x3307;
67 master_data |= (timings[
pio][0] << 12) | (timings[pio][1] << 8);
69 pci_write_config_word(dev, master_port, master_data);
71 pci_write_config_byte(dev, slave_port, slave_data);
72 spin_unlock_irqrestore(&slc90e66_lock, flags);
79 int sitre = 0, a_speed = 7 << (drive->
dn * 4);
80 int u_speed = 0, u_flag = 1 << drive->
dn;
81 u16 reg4042, reg44, reg48, reg4a;
84 pci_read_config_word(dev, maslave, ®4042);
85 sitre = (reg4042 & 0x4000) ? 1 : 0;
86 pci_read_config_word(dev, 0x44, ®44);
87 pci_read_config_word(dev, 0x48, ®48);
88 pci_read_config_word(dev, 0x4a, ®4a);
93 if (!(reg48 & u_flag))
94 pci_write_config_word(dev, 0x48, reg48|u_flag);
95 if ((reg4a & a_speed) != u_speed) {
96 pci_write_config_word(dev, 0x4a, reg4a & ~a_speed);
97 pci_read_config_word(dev, 0x4a, ®4a);
98 pci_write_config_word(dev, 0x4a, reg4a|u_speed);
101 const u8 mwdma_to_pio[] = { 0, 3, 4 };
104 pci_write_config_word(dev, 0x48, reg48 & ~u_flag);
106 pci_write_config_word(dev, 0x4a, reg4a & ~a_speed);
114 slc90e66_set_pio_mode(hwif, drive);
123 pci_read_config_byte(dev, 0x47, ®47);
130 .set_pio_mode = slc90e66_set_pio_mode,
131 .set_dma_mode = slc90e66_set_dma_mode,
132 .cable_detect = slc90e66_cable_detect,
137 .enablebits = { {0x41, 0x80, 0x80}, {0x43, 0x80, 0x80} },
138 .port_ops = &slc90e66_port_ops,
156 static struct pci_driver slc90e66_pci_driver = {
157 .name =
"SLC90e66_IDE",
158 .id_table = slc90e66_pci_tbl,
159 .probe = slc90e66_init_one,
165 static int __init slc90e66_ide_init(
void)
170 static void __exit slc90e66_ide_exit(
void)