34 #include <linux/module.h>
36 #include <linux/kernel.h>
37 #include <linux/slab.h>
38 #include <linux/string.h>
41 #include <scsi/scsi.h>
49 #include "../qlogicfas408.h"
61 static char qlogic_name[] =
"qlogic_cs";
66 .proc_name = qlogic_name,
82 struct pcmcia_device *
p_dev;
87 static void qlogic_release(
struct pcmcia_device *
link);
88 static void qlogic_detach(
struct pcmcia_device *p_dev);
89 static int qlogic_config(
struct pcmcia_device *
link);
92 struct pcmcia_device *
link,
int qbase,
int qlirq)
106 host->
name = qlogic_name;
127 "Qlogicfas Driver version 0.46, chip %02X at %03X, IRQ %d, TPdma:%d",
130 if (scsi_add_host(shost,
NULL))
146 static int qlogic_probe(
struct pcmcia_device *link)
150 dev_dbg(&link->dev,
"qlogic_attach()\n");
158 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
159 link->config_regs = PRESENT_OPTION;
161 return qlogic_config(link);
166 static void qlogic_detach(
struct pcmcia_device *link)
168 dev_dbg(&link->dev,
"qlogic_detach\n");
170 qlogic_release(link);
177 static int qlogic_config_check(
struct pcmcia_device *p_dev,
void *priv_data)
179 p_dev->io_lines = 10;
180 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
181 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
183 if (p_dev->resource[0]->start == 0)
189 static int qlogic_config(
struct pcmcia_device * link)
195 dev_dbg(&link->dev,
"qlogic_config\n");
197 ret = pcmcia_loop_config(link, qlogic_config_check,
NULL);
210 outb(0xb4, link->resource[0]->start + 0xd);
211 outb(0x24, link->resource[0]->start + 0x9);
212 outb(0x04, link->resource[0]->start + 0xd);
216 if (resource_size(link->resource[0]) == 32)
217 host = qlogic_detect(&qlogicfas_driver_template, link,
218 link->resource[0]->start + 16, link->irq);
220 host = qlogic_detect(&qlogicfas_driver_template, link,
221 link->resource[0]->start, link->irq);
239 static void qlogic_release(
struct pcmcia_device *link)
243 dev_dbg(&link->dev,
"qlogic_release\n");
255 static int qlogic_resume(
struct pcmcia_device *link)
263 outb(0x80, link->resource[0]->start + 0xd);
264 outb(0x24, link->resource[0]->start + 0x9);
265 outb(0x04, link->resource[0]->start + 0xd);
274 PCMCIA_DEVICE_PROD_ID12(
"EIger Labs",
"PCMCIA-to-SCSI Adapter", 0x88395fa7, 0x33b7a5e6),
275 PCMCIA_DEVICE_PROD_ID12(
"EPSON",
"SCSI-2 PC Card SC200", 0xd361772f, 0x299d1751),
276 PCMCIA_DEVICE_PROD_ID12(
"MACNICA",
"MIRACLE SCSI-II mPS110", 0x20841b68, 0xab3c3b6d),
277 PCMCIA_DEVICE_PROD_ID12(
"MIDORI ELECTRONICS ",
"CN-SC43", 0x6534382a, 0xd67eee79),
278 PCMCIA_DEVICE_PROD_ID12(
"NEC",
"PC-9801N-J03R", 0x18df0ba0, 0x24662e8a),
279 PCMCIA_DEVICE_PROD_ID12(
"KME ",
"KXLC003", 0x82375a27, 0xf68e5bf7),
280 PCMCIA_DEVICE_PROD_ID12(
"KME ",
"KXLC004", 0x82375a27, 0x68eace54),
281 PCMCIA_DEVICE_PROD_ID12(
"KME",
"KXLC101", 0x3faee676, 0x194250ec),
282 PCMCIA_DEVICE_PROD_ID12(
"QLOGIC CORPORATION",
"pc05", 0xd77b2930, 0xa85b2735),
283 PCMCIA_DEVICE_PROD_ID12(
"QLOGIC CORPORATION",
"pc05 rev 1.10", 0xd77b2930, 0x70f8b5f8),
284 PCMCIA_DEVICE_PROD_ID123(
"KME",
"KXLC002",
"00", 0x3faee676, 0x81896b61, 0xf99f065f),
285 PCMCIA_DEVICE_PROD_ID12(
"RATOC System Inc.",
"SCSI2 CARD 37", 0x85c10e17, 0x1a2640c1),
286 PCMCIA_DEVICE_PROD_ID12(
"TOSHIBA",
"SCSC200A PC CARD SCSI", 0xb4585a1a, 0xa6f06ebe),
287 PCMCIA_DEVICE_PROD_ID12(
"TOSHIBA",
"SCSC200B PC CARD SCSI-10", 0xb4585a1a, 0x0a88dea0),
295 static struct pcmcia_driver qlogic_cs_driver = {
298 .probe = qlogic_probe,
299 .remove = qlogic_detach,
300 .id_table = qlogic_ids,
301 .resume = qlogic_resume,
304 static int __init init_qlogic_cs(
void)
309 static void __exit exit_qlogic_cs(
void)