26 #include <linux/module.h>
28 #include <linux/kernel.h>
29 #include <linux/string.h>
35 #include <linux/pci.h>
37 #include <linux/ctype.h>
43 #include <scsi/scsi.h>
55 static int trans_mode = 0;
57 MODULE_PARM_DESC(trans_mode,
"transfer mode (0: BIOS(default) 1: Async 2: Ultra20M");
59 #define ULTRA20M_MODE 2
61 static bool auto_param = 0;
65 static bool disc_priv = 1;
67 MODULE_PARM_DESC(disc_priv,
"disconnection privilege mode (0: ON 1: OFF(default))");
70 MODULE_DESCRIPTION(
"Workbit NinjaSCSI-32Bi/UDE CardBus/PCI SCSI host bus adapter module");
73 static const char *nsp32_release_version =
"1.2";
191 static int __init init_nsp32 (
void);
192 static void __exit exit_nsp32 (
void);
195 static int nsp32_proc_info (
struct Scsi_Host *,
char *,
char **,
off_t,
int,
int);
197 static int nsp32_detect (
struct pci_dev *pdev);
199 static const char *nsp32_info (
struct Scsi_Host *);
200 static int nsp32_release (
struct Scsi_Host *);
203 static int nsp32_eh_abort (
struct scsi_cmnd *);
204 static int nsp32_eh_bus_reset (
struct scsi_cmnd *);
205 static int nsp32_eh_host_reset(
struct scsi_cmnd *);
208 static void nsp32_build_identify(
struct scsi_cmnd *);
209 static void nsp32_build_nop (
struct scsi_cmnd *);
210 static void nsp32_build_reject (
struct scsi_cmnd *);
211 static void nsp32_build_sdtr (
struct scsi_cmnd *,
unsigned char,
unsigned char);
214 static int nsp32_busfree_occur(
struct scsi_cmnd *,
unsigned short);
215 static void nsp32_msgout_occur (
struct scsi_cmnd *);
216 static void nsp32_msgin_occur (
struct scsi_cmnd *,
unsigned long,
unsigned short);
218 static int nsp32_setup_sg_table (
struct scsi_cmnd *);
219 static int nsp32_selection_autopara(
struct scsi_cmnd *);
220 static int nsp32_selection_autoscsi(
struct scsi_cmnd *);
221 static void nsp32_scsi_done (
struct scsi_cmnd *);
222 static int nsp32_arbitration (
struct scsi_cmnd *,
unsigned int);
223 static int nsp32_reselection (
struct scsi_cmnd *,
unsigned char);
224 static void nsp32_adjust_busfree (
struct scsi_cmnd *,
unsigned int);
225 static void nsp32_restart_autoscsi (
struct scsi_cmnd *,
unsigned short);
228 static void nsp32_analyze_sdtr (
struct scsi_cmnd *);
260 static void nsp32_message (
const char *,
int,
char *,
char *, ...);
262 static void nsp32_dmessage(
const char *,
int,
int,
char *, ...);
269 .proc_name =
"nsp32",
270 .name =
"Workbit NinjaSCSI-32Bi/UDE",
271 .proc_info = nsp32_proc_info,
273 .queuecommand = nsp32_queuecommand,
280 .eh_abort_handler = nsp32_eh_abort,
281 .eh_bus_reset_handler = nsp32_eh_bus_reset,
282 .eh_host_reset_handler = nsp32_eh_host_reset,
292 # define NSP32_DEBUG_MASK 0x000000
293 # define nsp32_msg(type, args...) nsp32_message ("", 0, (type), args)
294 # define nsp32_dbg(mask, args...)
296 # define NSP32_DEBUG_MASK 0xffffff
297 # define nsp32_msg(type, args...) \
298 nsp32_message (__func__, __LINE__, (type), args)
299 # define nsp32_dbg(mask, args...) \
300 nsp32_dmessage(__func__, __LINE__, (mask), args)
303 #define NSP32_DEBUG_QUEUECOMMAND BIT(0)
304 #define NSP32_DEBUG_REGISTER BIT(1)
305 #define NSP32_DEBUG_AUTOSCSI BIT(2)
306 #define NSP32_DEBUG_INTR BIT(3)
307 #define NSP32_DEBUG_SGLIST BIT(4)
308 #define NSP32_DEBUG_BUSFREE BIT(5)
309 #define NSP32_DEBUG_CDB_CONTENTS BIT(6)
310 #define NSP32_DEBUG_RESELECTION BIT(7)
311 #define NSP32_DEBUG_MSGINOCCUR BIT(8)
312 #define NSP32_DEBUG_EEPROM BIT(9)
313 #define NSP32_DEBUG_MSGOUTOCCUR BIT(10)
314 #define NSP32_DEBUG_BUSRESET BIT(11)
315 #define NSP32_DEBUG_RESTART BIT(12)
316 #define NSP32_DEBUG_SYNC BIT(13)
317 #define NSP32_DEBUG_WAIT BIT(14)
318 #define NSP32_DEBUG_TARGETFLAG BIT(15)
319 #define NSP32_DEBUG_PROC BIT(16)
320 #define NSP32_DEBUG_INIT BIT(17)
321 #define NSP32_SPECIAL_PRINT_REGISTER BIT(20)
323 #define NSP32_DEBUG_BUF_LEN 100
325 static void nsp32_message(
const char *
func,
int line,
char *
type,
char *
fmt, ...)
335 printk(
"%snsp32: %s\n", type, buf);
337 printk(
"%snsp32: %s (%d): %s\n", type, func, line, buf);
342 static void nsp32_dmessage(
const char *
func,
int line,
int mask,
char *
fmt, ...)
352 printk(
"nsp32-debug: 0x%x %s (%d): %s\n", mask, func, line, buf);
360 # define show_command(arg)
361 # define show_busphase(arg)
362 # define show_autophase(arg)
368 static void nsp32_build_identify(
struct scsi_cmnd *SCpnt)
375 if (disc_priv == 0) {
387 static void nsp32_build_sdtr(
struct scsi_cmnd *SCpnt,
406 static void nsp32_build_nop(
struct scsi_cmnd *SCpnt)
413 "Some messages are already contained!");
424 static void nsp32_build_reject(
struct scsi_cmnd *SCpnt)
437 static void nsp32_start_timer(
struct scsi_cmnd *SCpnt,
int time)
439 unsigned int base = SCpnt->host->io_port;
455 static int nsp32_selection_autopara(
struct scsi_cmnd *SCpnt)
458 unsigned int base = SCpnt->
device->host->io_port;
515 memset(param, 0,
sizeof(nsp32_autoparam));
518 for (i = 0; i < SCpnt->
cmd_len; i++) {
519 param->cdb[4 *
i] = SCpnt->
cmnd[
i];
577 ret = nsp32_arbitration(SCpnt, base);
586 static int nsp32_selection_autoscsi(
struct scsi_cmnd *SCpnt)
589 unsigned int base = SCpnt->
device->host->io_port;
595 unsigned int msgout = 0;
596 unsigned short execph;
630 for (i = 0; i < SCpnt->
cmd_len; i++) {
701 "syncreg=0x%x, ackwidth=0x%x, sgtpaddr=0x%x, id=0x%x",
718 if (scsi_bufflen(SCpnt) > 0) {
741 status = nsp32_arbitration(SCpnt, base);
761 static int nsp32_arbitration(
struct scsi_cmnd *SCpnt,
unsigned int base)
774 "arbit: 0x%x, delay time: %d", arbit, time);
810 static int nsp32_reselection(
struct scsi_cmnd *SCpnt,
unsigned char newlun)
814 unsigned int base = SCpnt->
device->host->io_port;
815 unsigned char tmpid, newid;
864 static int nsp32_setup_sg_table(
struct scsi_cmnd *SCpnt)
892 "can't transfer over 64KB at a time, size=0x%lx",
le32_to_cpu(
sgt[i].len));
896 "num 0x%x : addr 0x%lx len 0x%lx",
918 "enter. target: 0x%x LUN: 0x%x cmnd: 0x%x cmndlen: 0x%x "
919 "use_sg: 0x%x reqbuf: 0x%lx reqlen: 0x%x",
921 scsi_sg_count(SCpnt), scsi_sglist(SCpnt), scsi_bufflen(SCpnt));
952 SCpnt->
SCp.Message = 0;
953 scsi_set_resid(SCpnt, scsi_bufflen(SCpnt));
955 SCpnt->
SCp.ptr = (
char *)scsi_sglist(SCpnt);
956 SCpnt->
SCp.this_residual = scsi_bufflen(SCpnt);
958 SCpnt->
SCp.buffers_residual = 0;
964 cur_lunt->SCpnt = SCpnt;
965 cur_lunt->save_datp = 0;
966 cur_lunt->msgin03 =
FALSE;
971 ret = nsp32_setup_sg_table(SCpnt);
975 nsp32_scsi_done(SCpnt);
980 nsp32_build_identify(SCpnt);
994 nsp32_set_max_sync(data,
target, &period, &offset);
995 nsp32_build_sdtr(SCpnt, period, offset);
998 nsp32_set_async(data,
target);
1003 "SDTR: entry: %d start_period: 0x%x offset: 0x%x\n",
1004 target->limit_entry, period, offset);
1011 nsp32_set_async(data,
target);
1016 "SDTR_INITIATOR: fall back to async");
1023 nsp32_set_async(data,
target);
1028 "Unknown SDTR from target is reached, fall back to async.");
1032 "target: %d sync_flag: 0x%x syncreg: 0x%x ackwidth: 0x%x",
1037 if (auto_param == 0) {
1038 ret = nsp32_selection_autopara(SCpnt);
1040 ret = nsp32_selection_autoscsi(SCpnt);
1045 nsp32_scsi_done(SCpnt);
1056 unsigned int base = data->BaseAddress;
1058 unsigned long lc_reg;
1059 unsigned char power;
1062 if ((lc_reg & 0xff00) == 0) {
1063 lc_reg |= (0x20 << 8);
1069 nsp32_write4(base,
BM_CNT, 0);
1096 nsp32_index_write1(base,
CLOCK_DIV, data->clock);
1115 nsp32_index_write2(base,
MISC_WR,
1125 if (!(power &
SENSE)) {
1166 unsigned short auto_stat, irq_stat, trans_stat;
1167 unsigned char busmon, busphase;
1168 unsigned long flags;
1180 "enter IRQ: %d, IRQstatus: 0x%x", irq, irq_stat);
1182 if ((irq_stat & IRQSTATUS_ANY_IRQ) == 0) {
1193 if ((irq_stat == 0xffff) && (trans_stat == 0xffff)) {
1198 nsp32_scsi_done(SCpnt);
1213 nsp32_do_bus_reset(data);
1214 if (SCpnt !=
NULL) {
1216 nsp32_scsi_done(SCpnt);
1221 if (SCpnt ==
NULL) {
1241 "selection timeout occurred");
1244 nsp32_scsi_done(SCpnt);
1269 (scsi_get_resid(SCpnt) > 0) &&
1278 "Data in/out phase processed");
1282 nsp32_read4(base,
BM_CNT));
1290 scsi_set_resid(SCpnt, 0);
1296 if (auto_stat & MSG_IN_OCCUER) {
1297 nsp32_msgin_occur(SCpnt, irq_stat, auto_stat);
1304 nsp32_msgout_occur(SCpnt);
1311 ret = nsp32_busfree_occur(SCpnt, auto_stat);
1331 "AUTO SCSI ILLEGAL PHASE OCCUR!!!!");
1338 nsp32_sack_assert(data);
1339 nsp32_wait_req(data,
NEGATE);
1340 nsp32_sack_negate(data);
1398 nsp32_msgin_occur(SCpnt, irq_stat, 0);
1403 irq_stat, trans_stat);
1428 "irq_stat=0x%x trans_stat=0x%x", irq_stat, trans_stat);
1437 spin_unlock_irqrestore(host->
host_lock, flags);
1445 #define SPRINTF(args...) \
1447 if(length > (pos - buffer)) { \
1448 pos += snprintf(pos, length - (pos - buffer) + 1, ## args); \
1449 nsp32_dbg(NSP32_DEBUG_PROC, "buffer=0x%p pos=0x%p length=%d %d\n", buffer, pos, length, length - (pos - buffer));\
1458 unsigned long flags;
1462 unsigned char mode_reg;
1467 if (inout ==
TRUE) {
1475 SPRINTF(
"NinjaSCSI-32 status\n\n");
1476 SPRINTF(
"Driver version: %s, $Revision: 1.33 $\n", nsp32_release_version);
1477 SPRINTF(
"SCSI host No.: %d\n", hostno);
1482 SPRINTF(
"Chip revision: 0x%x\n", (nsp32_read2(base,
INDEX_REG) >> 8) & 0xff);
1484 mode_reg = nsp32_index_read1(base,
CHIP_MODE);
1488 SPRINTF(
"Power Management: %s\n", (mode_reg &
OPTF) ?
"yes" :
"no");
1490 SPRINTF(
"OEM: %ld, %s\n", (mode_reg & (
OEM0|
OEM1)), nsp32_model[model]);
1494 spin_unlock_irqrestore(&(data->
Lock), flags);
1503 SPRINTF(
"----- NinjaSCSI-32 host adapter\n");
1522 SPRINTF(
" transfer %d.%dMB/s, offset %d",
1532 thislength = pos - (buffer +
offset);
1534 if(thislength < 0) {
1540 thislength =
min(thislength, length);
1541 *start = buffer +
offset;
1553 static void nsp32_scsi_done(
struct scsi_cmnd *SCpnt)
1556 unsigned int base = SCpnt->
device->host->io_port;
1564 nsp32_write4(base,
BM_CNT, 0);
1591 static int nsp32_busfree_occur(
struct scsi_cmnd *SCpnt,
unsigned short execph)
1594 unsigned int base = SCpnt->
device->host->io_port;
1599 nsp32_write4(base,
BM_CNT, 0);
1622 unsigned int sacklen, s_sacklen;
1627 sacklen = nsp32_read4(base,
SACK_CNT );
1634 if (s_sacklen > 0) {
1646 if (sacklen != s_sacklen) {
1652 nsp32_adjust_busfree(SCpnt, s_sacklen);
1707 if (execph & MSGIN_00_VALID) {
1712 SCpnt->
SCp.Message = 0;
1714 "normal end stat=0x%x resid=0x%x\n",
1715 SCpnt->
SCp.Status, scsi_get_resid(SCpnt));
1717 (SCpnt->
SCp.Message << 8) |
1718 (SCpnt->
SCp.Status << 0);
1719 nsp32_scsi_done(SCpnt);
1725 SCpnt->
SCp.Message = 4;
1736 nsp32_scsi_done(SCpnt);
1749 static void nsp32_adjust_busfree(
struct scsi_cmnd *SCpnt,
unsigned int s_sacklen)
1756 unsigned int restlen, sentlen;
1769 for (new_entry = old_entry; new_entry < sg_num; new_entry++) {
1771 if (sentlen > s_sacklen) {
1777 if (new_entry == sg_num) {
1781 if (sentlen == s_sacklen) {
1788 restlen = sentlen - s_sacklen;
1793 addr += (len - restlen);
1803 if (scsi_get_resid(SCpnt) < sentlen) {
1807 scsi_set_resid(SCpnt, scsi_get_resid(SCpnt) - sentlen);
1822 static void nsp32_msgout_occur(
struct scsi_cmnd *SCpnt)
1825 unsigned int base = SCpnt->
device->host->io_port;
1831 "enter: msgout_len: 0x%x", data->
msgout_len);
1838 nsp32_build_nop(SCpnt);
1859 nsp32_wait_req(data,
ASSERT);
1881 nsp32_wait_sack(data,
NEGATE);
1898 static void nsp32_restart_autoscsi(
struct scsi_cmnd *SCpnt,
unsigned short command)
1902 unsigned short transfer = 0;
1937 if (scsi_bufflen(SCpnt) > 0) {
1964 static void nsp32_msgin_occur(
struct scsi_cmnd *SCpnt,
1965 unsigned long irq_status,
1966 unsigned short execph)
1969 unsigned int base = SCpnt->
device->host->io_port;
1972 unsigned char newlun;
1973 unsigned short command = 0;
1974 int msgclear =
TRUE;
1987 "enter: msglen: 0x%x msgin: 0x%x msgtype: 0x%x",
1997 nsp32_sack_assert(data);
2009 ret = nsp32_reselection(SCpnt, newlun);
2033 "unexpected message of AutoSCSI MsgIn: 0x%x",
msg);
2041 if ((execph & DATA_IN_PHASE) || (execph & DATA_OUT_PHASE)) {
2042 unsigned int s_sacklen;
2045 if ((execph & MSGIN_02_VALID) && (s_sacklen > 0)) {
2046 nsp32_adjust_busfree(SCpnt, s_sacklen);
2063 nsp32_write4(base,
SGT_ADR, new_sgtp);
2073 "unexpected message of AutoSCSI MsgIn: SAVE_POINTERS");
2098 "unsupported message: 0x%x",
msgtype);
2171 nsp32_analyze_sdtr(SCpnt);
2196 if (msgclear ==
TRUE) {
2231 nsp32_restart_autoscsi(SCpnt, command);
2236 nsp32_wait_req(data,
NEGATE);
2241 nsp32_sack_negate(data);
2249 "invalid or unsupported MessageIn, rejected. "
2250 "current msg: 0x%x (len: 0x%x), processing msg: 0x%x",
2252 nsp32_build_reject(SCpnt);
2261 static void nsp32_analyze_sdtr(
struct scsi_cmnd *SCpnt)
2266 unsigned char get_period = data->
msginbuf[3];
2267 unsigned char get_offset = data->
msginbuf[4];
2273 synct = data->
synct;
2322 if (get_period < data->synct[0].period_num) {
2330 entry = nsp32_search_period_entry(data,
target, get_period);
2343 nsp32_set_sync_entry(data,
target,
entry, get_offset);
2357 if (get_period < data->synct[0].period_num) {
2361 entry = nsp32_search_period_entry(data,
target, get_period);
2364 nsp32_set_async(data,
target);
2367 nsp32_set_sync_entry(data,
target,
entry, get_offset);
2368 nsp32_build_sdtr(SCpnt, get_period, get_offset);
2372 target->period = get_period;
2381 nsp32_build_reject(SCpnt);
2384 nsp32_set_async(data,
target);
2398 unsigned char period)
2407 for (i = target->
limit_entry; i < data->syncnum; i++) {
2409 period <= data->synct[i].end_period) {
2448 unsigned char *period,
2449 unsigned char *offset)
2451 unsigned char period_num,
ackwidth;
2471 unsigned char offset)
2501 unsigned char bus, req_bit;
2513 "wait_time: %d", wait_time);
2530 unsigned char bus, ack_bit;
2542 "wait_time: %d", wait_time);
2560 unsigned char busctrl;
2573 unsigned char busctrl;
2589 static int nsp32_detect(
struct pci_dev *pdev)
2642 switch (data->
clock) {
2645 data->
synct = nsp32_sync_table_40M;
2650 data->
synct = nsp32_sync_table_20M;
2655 data->
synct = nsp32_sync_table_pci;
2660 "Invalid clock div is selected, set CLOCK_4.");
2663 data->
synct = nsp32_sync_table_40M;
2695 goto free_autoparam;
2708 .sglun_paddr = data->
sg_paddr + (offset *
sizeof(nsp32_sglun)),
2723 nsp32_set_async(data, target);
2729 ret = nsp32_getprom_param(data);
2740 "NinjaSCSI-32Bi/UDE: irq %d, io 0x%lx+0x%x",
2761 nsp32_do_bus_reset(data);
2766 "SCSI PCI controller. Interrupt: %d", host->
irq);
2776 "I/O region 0x%lx+0x%lx is already used",
2781 ret = scsi_add_host(host, &pdev->
dev);
2787 pci_set_drvdata(pdev, host);
2811 static int nsp32_release(
struct Scsi_Host *host)
2840 static const char *nsp32_info(
struct Scsi_Host *shpnt)
2851 static int nsp32_eh_abort(
struct scsi_cmnd *SCpnt)
2854 unsigned int base = SCpnt->
device->host->io_port;
2870 nsp32_write2(base,
BM_CNT, 0);
2873 nsp32_scsi_done(SCpnt);
2879 static int nsp32_eh_bus_reset(
struct scsi_cmnd *SCpnt)
2882 unsigned int base = SCpnt->
device->host->io_port;
2884 spin_lock_irq(SCpnt->
device->host->host_lock);
2890 nsp32_do_bus_reset(data);
2893 spin_unlock_irq(SCpnt->
device->host->host_lock);
2900 unsigned short intrdat;
2911 nsp32_write4(base,
BM_CNT, 0);
2922 nsp32_set_async(data, target);
2931 for(i = 0; i < 5; i++) {
2939 static int nsp32_eh_host_reset(
struct scsi_cmnd *SCpnt)
2942 unsigned int base = SCpnt->
device->host->io_port;
2948 spin_lock_irq(SCpnt->
device->host->host_lock);
2952 nsp32_do_bus_reset(data);
2955 spin_unlock_irq(SCpnt->
device->host->host_lock);
2976 ret = nsp32_prom_read(data, 0x7e);
2981 ret = nsp32_prom_read(data, 0x7f);
2992 ret = nsp32_getprom_c16(data);
2995 ret = nsp32_getprom_at24(data);
2998 ret = nsp32_getprom_at24(data);
3005 for (i = 0; i <= 0x1f; i++) {
3006 val = nsp32_prom_read(data, i);
3008 "rom address 0x%x : 0x%x", i, val);
3054 data->
resettime = nsp32_prom_read(data, 0x12);
3069 ret = nsp32_prom_read(data, 0x07);
3079 "Unsupported Auto Sync mode. Fall back to manual mode.");
3092 if (auto_sync ==
TRUE) {
3095 ret = nsp32_prom_read(data, i);
3096 entry = nsp32_search_period_entry(data, target, ret);
3140 data->
resettime = nsp32_prom_read(data, 0x11);
3147 ret = nsp32_prom_read(data, i);
3165 entry = nsp32_search_period_entry(data, target, val);
3180 static int nsp32_prom_read(
nsp32_hw_data *data,
int romaddr)
3185 nsp32_prom_start(data);
3188 nsp32_prom_write_bit(data, 1);
3189 nsp32_prom_write_bit(data, 0);
3190 nsp32_prom_write_bit(data, 1);
3191 nsp32_prom_write_bit(data, 0);
3192 nsp32_prom_write_bit(data, 0);
3193 nsp32_prom_write_bit(data, 0);
3194 nsp32_prom_write_bit(data, 0);
3197 nsp32_prom_write_bit(data, 0);
3200 nsp32_prom_write_bit(data, 0);
3203 for (i = 7; i >= 0; i--) {
3204 nsp32_prom_write_bit(data, ((romaddr >> i) & 1));
3208 nsp32_prom_write_bit(data, 0);
3211 nsp32_prom_start(data);
3214 nsp32_prom_write_bit(data, 1);
3215 nsp32_prom_write_bit(data, 0);
3216 nsp32_prom_write_bit(data, 1);
3217 nsp32_prom_write_bit(data, 0);
3218 nsp32_prom_write_bit(data, 0);
3219 nsp32_prom_write_bit(data, 0);
3220 nsp32_prom_write_bit(data, 0);
3223 nsp32_prom_write_bit(data, 1);
3226 nsp32_prom_write_bit(data, 0);
3230 for (i = 7; i >= 0; i--) {
3231 val += (nsp32_prom_read_bit(data) <<
i);
3235 nsp32_prom_write_bit(data, 1);
3238 nsp32_prom_stop(data);
3288 nsp32_prom_set(data,
SCL, 1);
3289 nsp32_prom_set(data,
SDA, 1);
3290 nsp32_prom_set(data,
ENA, 1);
3291 nsp32_prom_set(data,
SDA, 0);
3293 nsp32_prom_set(data,
SCL, 0);
3299 nsp32_prom_set(data,
SCL, 1);
3300 nsp32_prom_set(data,
SDA, 0);
3301 nsp32_prom_set(data,
ENA, 1);
3302 nsp32_prom_set(data,
SDA, 1);
3303 nsp32_prom_set(data,
SCL, 0);
3306 static void nsp32_prom_write_bit(
nsp32_hw_data *data,
int val)
3309 nsp32_prom_set(data,
SDA, val);
3310 nsp32_prom_set(data,
SCL, 1 );
3311 nsp32_prom_set(data,
SCL, 0 );
3319 nsp32_prom_set(data,
ENA, 0);
3320 nsp32_prom_set(data,
SCL, 1);
3322 val = nsp32_prom_get(data,
SDA);
3324 nsp32_prom_set(data,
SCL, 0);
3325 nsp32_prom_set(data,
ENA, 1);
3339 struct Scsi_Host *host = pci_get_drvdata(pdev);
3341 nsp32_msg(
KERN_INFO,
"pci-suspend: pdev=0x%p, state=%ld, slot=%s, host=0x%p", pdev, state, pci_name(pdev), host);
3351 static int nsp32_resume(
struct pci_dev *pdev)
3353 struct Scsi_Host *host = pci_get_drvdata(pdev);
3357 nsp32_msg(
KERN_INFO,
"pci-resume: pdev=0x%p, slot=%s, host=0x%p", pdev, pci_name(pdev), host);
3360 pci_enable_wake (pdev,
PCI_D0, 0);
3367 if (
reg == 0xffff) {
3372 nsp32hw_init (data);
3373 nsp32_do_bus_reset(data);
3408 ret = nsp32_detect(pdev);
3423 struct Scsi_Host *host = pci_get_drvdata(pdev);
3429 nsp32_release(host);
3436 .id_table = nsp32_pci_table,
3437 .probe = nsp32_probe,
3440 .suspend = nsp32_suspend,
3441 .resume = nsp32_resume,
3448 static int __init init_nsp32(
void) {
3450 return pci_register_driver(&nsp32_driver);
3453 static void __exit exit_nsp32(
void) {