diff options
Diffstat (limited to 'drivers/scsi/fdomain.c')
-rw-r--r-- | drivers/scsi/fdomain.c | 70 |
1 files changed, 44 insertions, 26 deletions
diff --git a/drivers/scsi/fdomain.c b/drivers/scsi/fdomain.c index 5d4ea6f77953..36169d597e98 100644 --- a/drivers/scsi/fdomain.c +++ b/drivers/scsi/fdomain.c | |||
@@ -410,6 +410,8 @@ static irqreturn_t do_fdomain_16x0_intr( int irq, void *dev_id ); | |||
410 | static char * fdomain = NULL; | 410 | static char * fdomain = NULL; |
411 | module_param(fdomain, charp, 0); | 411 | module_param(fdomain, charp, 0); |
412 | 412 | ||
413 | #ifndef PCMCIA | ||
414 | |||
413 | static unsigned long addresses[] = { | 415 | static unsigned long addresses[] = { |
414 | 0xc8000, | 416 | 0xc8000, |
415 | 0xca000, | 417 | 0xca000, |
@@ -426,6 +428,8 @@ static unsigned short ports[] = { 0x140, 0x150, 0x160, 0x170 }; | |||
426 | 428 | ||
427 | static unsigned short ints[] = { 3, 5, 10, 11, 12, 14, 15, 0 }; | 429 | static unsigned short ints[] = { 3, 5, 10, 11, 12, 14, 15, 0 }; |
428 | 430 | ||
431 | #endif /* !PCMCIA */ | ||
432 | |||
429 | /* | 433 | /* |
430 | 434 | ||
431 | READ THIS BEFORE YOU ADD A SIGNATURE! | 435 | READ THIS BEFORE YOU ADD A SIGNATURE! |
@@ -458,6 +462,8 @@ static unsigned short ints[] = { 3, 5, 10, 11, 12, 14, 15, 0 }; | |||
458 | 462 | ||
459 | */ | 463 | */ |
460 | 464 | ||
465 | #ifndef PCMCIA | ||
466 | |||
461 | static struct signature { | 467 | static struct signature { |
462 | const char *signature; | 468 | const char *signature; |
463 | int sig_offset; | 469 | int sig_offset; |
@@ -503,6 +509,8 @@ static struct signature { | |||
503 | 509 | ||
504 | #define SIGNATURE_COUNT ARRAY_SIZE(signatures) | 510 | #define SIGNATURE_COUNT ARRAY_SIZE(signatures) |
505 | 511 | ||
512 | #endif /* !PCMCIA */ | ||
513 | |||
506 | static void print_banner( struct Scsi_Host *shpnt ) | 514 | static void print_banner( struct Scsi_Host *shpnt ) |
507 | { | 515 | { |
508 | if (!shpnt) return; /* This won't ever happen */ | 516 | if (!shpnt) return; /* This won't ever happen */ |
@@ -633,6 +641,8 @@ static int fdomain_test_loopback( void ) | |||
633 | return 0; | 641 | return 0; |
634 | } | 642 | } |
635 | 643 | ||
644 | #ifndef PCMCIA | ||
645 | |||
636 | /* fdomain_get_irq assumes that we have a valid MCA ID for a | 646 | /* fdomain_get_irq assumes that we have a valid MCA ID for a |
637 | TMC-1660/TMC-1680 Future Domain board. Now, check to be sure the | 647 | TMC-1660/TMC-1680 Future Domain board. Now, check to be sure the |
638 | bios_base matches these ports. If someone was unlucky enough to have | 648 | bios_base matches these ports. If someone was unlucky enough to have |
@@ -667,7 +677,6 @@ static int fdomain_get_irq( int base ) | |||
667 | 677 | ||
668 | static int fdomain_isa_detect( int *irq, int *iobase ) | 678 | static int fdomain_isa_detect( int *irq, int *iobase ) |
669 | { | 679 | { |
670 | #ifndef PCMCIA | ||
671 | int i, j; | 680 | int i, j; |
672 | int base = 0xdeadbeef; | 681 | int base = 0xdeadbeef; |
673 | int flag = 0; | 682 | int flag = 0; |
@@ -786,11 +795,22 @@ found: | |||
786 | *iobase = base; | 795 | *iobase = base; |
787 | 796 | ||
788 | return 1; /* success */ | 797 | return 1; /* success */ |
789 | #else | ||
790 | return 0; | ||
791 | #endif | ||
792 | } | 798 | } |
793 | 799 | ||
800 | #else /* PCMCIA */ | ||
801 | |||
802 | static int fdomain_isa_detect( int *irq, int *iobase ) | ||
803 | { | ||
804 | if (irq) | ||
805 | *irq = 0; | ||
806 | if (iobase) | ||
807 | *iobase = 0; | ||
808 | return 0; | ||
809 | } | ||
810 | |||
811 | #endif /* !PCMCIA */ | ||
812 | |||
813 | |||
794 | /* PCI detection function: int fdomain_pci_bios_detect(int* irq, int* | 814 | /* PCI detection function: int fdomain_pci_bios_detect(int* irq, int* |
795 | iobase) This function gets the Interrupt Level and I/O base address from | 815 | iobase) This function gets the Interrupt Level and I/O base address from |
796 | the PCI configuration registers. */ | 816 | the PCI configuration registers. */ |
@@ -1345,16 +1365,15 @@ static irqreturn_t do_fdomain_16x0_intr(int irq, void *dev_id) | |||
1345 | 1365 | ||
1346 | #if ERRORS_ONLY | 1366 | #if ERRORS_ONLY |
1347 | if (current_SC->cmnd[0] == REQUEST_SENSE && !current_SC->SCp.Status) { | 1367 | if (current_SC->cmnd[0] == REQUEST_SENSE && !current_SC->SCp.Status) { |
1348 | if ((unsigned char)(*((char *)current_SC->request_buffer+2)) & 0x0f) { | 1368 | char *buf = scsi_sglist(current_SC); |
1369 | if ((unsigned char)(*(buf + 2)) & 0x0f) { | ||
1349 | unsigned char key; | 1370 | unsigned char key; |
1350 | unsigned char code; | 1371 | unsigned char code; |
1351 | unsigned char qualifier; | 1372 | unsigned char qualifier; |
1352 | 1373 | ||
1353 | key = (unsigned char)(*((char *)current_SC->request_buffer + 2)) | 1374 | key = (unsigned char)(*(buf + 2)) & 0x0f; |
1354 | & 0x0f; | 1375 | code = (unsigned char)(*(buf + 12)); |
1355 | code = (unsigned char)(*((char *)current_SC->request_buffer + 12)); | 1376 | qualifier = (unsigned char)(*(buf + 13)); |
1356 | qualifier = (unsigned char)(*((char *)current_SC->request_buffer | ||
1357 | + 13)); | ||
1358 | 1377 | ||
1359 | if (key != UNIT_ATTENTION | 1378 | if (key != UNIT_ATTENTION |
1360 | && !(key == NOT_READY | 1379 | && !(key == NOT_READY |
@@ -1405,8 +1424,8 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt, | |||
1405 | printk( "queue: target = %d cmnd = 0x%02x pieces = %d size = %u\n", | 1424 | printk( "queue: target = %d cmnd = 0x%02x pieces = %d size = %u\n", |
1406 | SCpnt->target, | 1425 | SCpnt->target, |
1407 | *(unsigned char *)SCpnt->cmnd, | 1426 | *(unsigned char *)SCpnt->cmnd, |
1408 | SCpnt->use_sg, | 1427 | scsi_sg_count(SCpnt), |
1409 | SCpnt->request_bufflen ); | 1428 | scsi_bufflen(SCpnt)); |
1410 | #endif | 1429 | #endif |
1411 | 1430 | ||
1412 | fdomain_make_bus_idle(); | 1431 | fdomain_make_bus_idle(); |
@@ -1416,20 +1435,19 @@ static int fdomain_16x0_queue(struct scsi_cmnd *SCpnt, | |||
1416 | 1435 | ||
1417 | /* Initialize static data */ | 1436 | /* Initialize static data */ |
1418 | 1437 | ||
1419 | if (current_SC->use_sg) { | 1438 | if (scsi_sg_count(current_SC)) { |
1420 | current_SC->SCp.buffer = | 1439 | current_SC->SCp.buffer = scsi_sglist(current_SC); |
1421 | (struct scatterlist *)current_SC->request_buffer; | 1440 | current_SC->SCp.ptr = page_address(current_SC->SCp.buffer->page) |
1422 | current_SC->SCp.ptr = page_address(current_SC->SCp.buffer->page) + current_SC->SCp.buffer->offset; | 1441 | + current_SC->SCp.buffer->offset; |
1423 | current_SC->SCp.this_residual = current_SC->SCp.buffer->length; | 1442 | current_SC->SCp.this_residual = current_SC->SCp.buffer->length; |
1424 | current_SC->SCp.buffers_residual = current_SC->use_sg - 1; | 1443 | current_SC->SCp.buffers_residual = scsi_sg_count(current_SC) - 1; |
1425 | } else { | 1444 | } else { |
1426 | current_SC->SCp.ptr = (char *)current_SC->request_buffer; | 1445 | current_SC->SCp.ptr = 0; |
1427 | current_SC->SCp.this_residual = current_SC->request_bufflen; | 1446 | current_SC->SCp.this_residual = 0; |
1428 | current_SC->SCp.buffer = NULL; | 1447 | current_SC->SCp.buffer = NULL; |
1429 | current_SC->SCp.buffers_residual = 0; | 1448 | current_SC->SCp.buffers_residual = 0; |
1430 | } | 1449 | } |
1431 | 1450 | ||
1432 | |||
1433 | current_SC->SCp.Status = 0; | 1451 | current_SC->SCp.Status = 0; |
1434 | current_SC->SCp.Message = 0; | 1452 | current_SC->SCp.Message = 0; |
1435 | current_SC->SCp.have_data_in = 0; | 1453 | current_SC->SCp.have_data_in = 0; |
@@ -1472,8 +1490,8 @@ static void print_info(struct scsi_cmnd *SCpnt) | |||
1472 | SCpnt->SCp.phase, | 1490 | SCpnt->SCp.phase, |
1473 | SCpnt->device->id, | 1491 | SCpnt->device->id, |
1474 | *(unsigned char *)SCpnt->cmnd, | 1492 | *(unsigned char *)SCpnt->cmnd, |
1475 | SCpnt->use_sg, | 1493 | scsi_sg_count(SCpnt), |
1476 | SCpnt->request_bufflen ); | 1494 | scsi_bufflen(SCpnt)); |
1477 | printk( "sent_command = %d, have_data_in = %d, timeout = %d\n", | 1495 | printk( "sent_command = %d, have_data_in = %d, timeout = %d\n", |
1478 | SCpnt->SCp.sent_command, | 1496 | SCpnt->SCp.sent_command, |
1479 | SCpnt->SCp.have_data_in, | 1497 | SCpnt->SCp.have_data_in, |