diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2008-04-24 22:34:49 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-27 13:20:00 -0400 |
commit | d1d7b19d433188e94fc87cc7ca66363cd77a0bba (patch) | |
tree | ca3474a25f2ca420e0004e47fd1a1b9d0cf5e057 /drivers/scsi | |
parent | d10c2e4627b0dda286bcd1c77720eb5fe4a04f93 (diff) |
[SCSI] aic7xxx: add static
This patch adds static (and sometimes const) keywords where appropriate.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Acked-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx.h | 17 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_core.c | 88 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_inline.h | 44 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.c | 5 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_osm.h | 1 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic79xx_pci.c | 2 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx.h | 49 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_core.c | 180 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_inline.h | 55 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.c | 6 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_osm.h | 3 | ||||
-rw-r--r-- | drivers/scsi/aic7xxx/aic7xxx_proc.c | 2 |
12 files changed, 195 insertions, 257 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx.h b/drivers/scsi/aic7xxx/aic79xx.h index 2f00467b6b8c..9c1484453d5f 100644 --- a/drivers/scsi/aic7xxx/aic79xx.h +++ b/drivers/scsi/aic7xxx/aic79xx.h | |||
@@ -1314,7 +1314,7 @@ typedef int (ahd_device_setup_t)(struct ahd_softc *); | |||
1314 | struct ahd_pci_identity { | 1314 | struct ahd_pci_identity { |
1315 | uint64_t full_id; | 1315 | uint64_t full_id; |
1316 | uint64_t id_mask; | 1316 | uint64_t id_mask; |
1317 | char *name; | 1317 | const char *name; |
1318 | ahd_device_setup_t *setup; | 1318 | ahd_device_setup_t *setup; |
1319 | }; | 1319 | }; |
1320 | 1320 | ||
@@ -1322,7 +1322,7 @@ struct ahd_pci_identity { | |||
1322 | struct aic7770_identity { | 1322 | struct aic7770_identity { |
1323 | uint32_t full_id; | 1323 | uint32_t full_id; |
1324 | uint32_t id_mask; | 1324 | uint32_t id_mask; |
1325 | char *name; | 1325 | const char *name; |
1326 | ahd_device_setup_t *setup; | 1326 | ahd_device_setup_t *setup; |
1327 | }; | 1327 | }; |
1328 | extern struct aic7770_identity aic7770_ident_table []; | 1328 | extern struct aic7770_identity aic7770_ident_table []; |
@@ -1333,7 +1333,6 @@ extern const int ahd_num_aic7770_devs; | |||
1333 | 1333 | ||
1334 | /*************************** Function Declarations ****************************/ | 1334 | /*************************** Function Declarations ****************************/ |
1335 | /******************************************************************************/ | 1335 | /******************************************************************************/ |
1336 | void ahd_reset_cmds_pending(struct ahd_softc *ahd); | ||
1337 | 1336 | ||
1338 | /***************************** PCI Front End *********************************/ | 1337 | /***************************** PCI Front End *********************************/ |
1339 | struct ahd_pci_identity *ahd_find_pci_device(ahd_dev_softc_t); | 1338 | struct ahd_pci_identity *ahd_find_pci_device(ahd_dev_softc_t); |
@@ -1376,16 +1375,6 @@ int ahd_write_flexport(struct ahd_softc *ahd, | |||
1376 | int ahd_read_flexport(struct ahd_softc *ahd, u_int addr, | 1375 | int ahd_read_flexport(struct ahd_softc *ahd, u_int addr, |
1377 | uint8_t *value); | 1376 | uint8_t *value); |
1378 | 1377 | ||
1379 | /*************************** Interrupt Services *******************************/ | ||
1380 | void ahd_run_qoutfifo(struct ahd_softc *ahd); | ||
1381 | #ifdef AHD_TARGET_MODE | ||
1382 | void ahd_run_tqinfifo(struct ahd_softc *ahd, int paused); | ||
1383 | #endif | ||
1384 | void ahd_handle_hwerrint(struct ahd_softc *ahd); | ||
1385 | void ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat); | ||
1386 | void ahd_handle_scsiint(struct ahd_softc *ahd, | ||
1387 | u_int intstat); | ||
1388 | |||
1389 | /***************************** Error Recovery *********************************/ | 1378 | /***************************** Error Recovery *********************************/ |
1390 | typedef enum { | 1379 | typedef enum { |
1391 | SEARCH_COMPLETE, | 1380 | SEARCH_COMPLETE, |
@@ -1479,7 +1468,7 @@ extern uint32_t ahd_debug; | |||
1479 | void ahd_print_devinfo(struct ahd_softc *ahd, | 1468 | void ahd_print_devinfo(struct ahd_softc *ahd, |
1480 | struct ahd_devinfo *devinfo); | 1469 | struct ahd_devinfo *devinfo); |
1481 | void ahd_dump_card_state(struct ahd_softc *ahd); | 1470 | void ahd_dump_card_state(struct ahd_softc *ahd); |
1482 | int ahd_print_register(ahd_reg_parse_entry_t *table, | 1471 | int ahd_print_register(const ahd_reg_parse_entry_t *table, |
1483 | u_int num_entries, | 1472 | u_int num_entries, |
1484 | const char *name, | 1473 | const char *name, |
1485 | u_int address, | 1474 | u_int address, |
diff --git a/drivers/scsi/aic7xxx/aic79xx_core.c b/drivers/scsi/aic7xxx/aic79xx_core.c index 336f4bea251b..1e452cfa2390 100644 --- a/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/drivers/scsi/aic7xxx/aic79xx_core.c | |||
@@ -266,6 +266,18 @@ static int ahd_match_scb(struct ahd_softc *ahd, struct scb *scb, | |||
266 | int target, char channel, int lun, | 266 | int target, char channel, int lun, |
267 | u_int tag, role_t role); | 267 | u_int tag, role_t role); |
268 | 268 | ||
269 | static void ahd_reset_cmds_pending(struct ahd_softc *ahd); | ||
270 | |||
271 | /*************************** Interrupt Services *******************************/ | ||
272 | static void ahd_run_qoutfifo(struct ahd_softc *ahd); | ||
273 | #ifdef AHD_TARGET_MODE | ||
274 | static void ahd_run_tqinfifo(struct ahd_softc *ahd, int paused); | ||
275 | #endif | ||
276 | static void ahd_handle_hwerrint(struct ahd_softc *ahd); | ||
277 | static void ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat); | ||
278 | static void ahd_handle_scsiint(struct ahd_softc *ahd, | ||
279 | u_int intstat); | ||
280 | |||
269 | /************************ Sequencer Execution Control *************************/ | 281 | /************************ Sequencer Execution Control *************************/ |
270 | void | 282 | void |
271 | ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst) | 283 | ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst) |
@@ -285,7 +297,7 @@ ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, ahd_mode dst) | |||
285 | ahd->dst_mode = dst; | 297 | ahd->dst_mode = dst; |
286 | } | 298 | } |
287 | 299 | ||
288 | void | 300 | static void |
289 | ahd_update_modes(struct ahd_softc *ahd) | 301 | ahd_update_modes(struct ahd_softc *ahd) |
290 | { | 302 | { |
291 | ahd_mode_state mode_ptr; | 303 | ahd_mode_state mode_ptr; |
@@ -301,7 +313,7 @@ ahd_update_modes(struct ahd_softc *ahd) | |||
301 | ahd_known_modes(ahd, src, dst); | 313 | ahd_known_modes(ahd, src, dst); |
302 | } | 314 | } |
303 | 315 | ||
304 | void | 316 | static void |
305 | ahd_assert_modes(struct ahd_softc *ahd, ahd_mode srcmode, | 317 | ahd_assert_modes(struct ahd_softc *ahd, ahd_mode srcmode, |
306 | ahd_mode dstmode, const char *file, int line) | 318 | ahd_mode dstmode, const char *file, int line) |
307 | { | 319 | { |
@@ -422,7 +434,7 @@ ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb, | |||
422 | } | 434 | } |
423 | } | 435 | } |
424 | 436 | ||
425 | void | 437 | static void |
426 | ahd_setup_scb_common(struct ahd_softc *ahd, struct scb *scb) | 438 | ahd_setup_scb_common(struct ahd_softc *ahd, struct scb *scb) |
427 | { | 439 | { |
428 | /* XXX Handle target mode SCBs. */ | 440 | /* XXX Handle target mode SCBs. */ |
@@ -443,7 +455,7 @@ ahd_setup_scb_common(struct ahd_softc *ahd, struct scb *scb) | |||
443 | ahd_htole32(scb->sense_busaddr); | 455 | ahd_htole32(scb->sense_busaddr); |
444 | } | 456 | } |
445 | 457 | ||
446 | void | 458 | static void |
447 | ahd_setup_data_scb(struct ahd_softc *ahd, struct scb *scb) | 459 | ahd_setup_data_scb(struct ahd_softc *ahd, struct scb *scb) |
448 | { | 460 | { |
449 | /* | 461 | /* |
@@ -480,7 +492,7 @@ ahd_setup_data_scb(struct ahd_softc *ahd, struct scb *scb) | |||
480 | scb->hscb->sgptr = ahd_htole32(scb->sg_list_busaddr|SG_FULL_RESID); | 492 | scb->hscb->sgptr = ahd_htole32(scb->sg_list_busaddr|SG_FULL_RESID); |
481 | } | 493 | } |
482 | 494 | ||
483 | void | 495 | static void |
484 | ahd_setup_noxfer_scb(struct ahd_softc *ahd, struct scb *scb) | 496 | ahd_setup_noxfer_scb(struct ahd_softc *ahd, struct scb *scb) |
485 | { | 497 | { |
486 | scb->hscb->sgptr = ahd_htole32(SG_LIST_NULL); | 498 | scb->hscb->sgptr = ahd_htole32(SG_LIST_NULL); |
@@ -489,7 +501,7 @@ ahd_setup_noxfer_scb(struct ahd_softc *ahd, struct scb *scb) | |||
489 | } | 501 | } |
490 | 502 | ||
491 | /************************** Memory mapping routines ***************************/ | 503 | /************************** Memory mapping routines ***************************/ |
492 | void * | 504 | static void * |
493 | ahd_sg_bus_to_virt(struct ahd_softc *ahd, struct scb *scb, uint32_t sg_busaddr) | 505 | ahd_sg_bus_to_virt(struct ahd_softc *ahd, struct scb *scb, uint32_t sg_busaddr) |
494 | { | 506 | { |
495 | dma_addr_t sg_offset; | 507 | dma_addr_t sg_offset; |
@@ -499,7 +511,7 @@ ahd_sg_bus_to_virt(struct ahd_softc *ahd, struct scb *scb, uint32_t sg_busaddr) | |||
499 | return ((uint8_t *)scb->sg_list + sg_offset); | 511 | return ((uint8_t *)scb->sg_list + sg_offset); |
500 | } | 512 | } |
501 | 513 | ||
502 | uint32_t | 514 | static uint32_t |
503 | ahd_sg_virt_to_bus(struct ahd_softc *ahd, struct scb *scb, void *sg) | 515 | ahd_sg_virt_to_bus(struct ahd_softc *ahd, struct scb *scb, void *sg) |
504 | { | 516 | { |
505 | dma_addr_t sg_offset; | 517 | dma_addr_t sg_offset; |
@@ -511,7 +523,7 @@ ahd_sg_virt_to_bus(struct ahd_softc *ahd, struct scb *scb, void *sg) | |||
511 | return (scb->sg_list_busaddr + sg_offset); | 523 | return (scb->sg_list_busaddr + sg_offset); |
512 | } | 524 | } |
513 | 525 | ||
514 | void | 526 | static void |
515 | ahd_sync_scb(struct ahd_softc *ahd, struct scb *scb, int op) | 527 | ahd_sync_scb(struct ahd_softc *ahd, struct scb *scb, int op) |
516 | { | 528 | { |
517 | ahd_dmamap_sync(ahd, ahd->scb_data.hscb_dmat, | 529 | ahd_dmamap_sync(ahd, ahd->scb_data.hscb_dmat, |
@@ -532,7 +544,7 @@ ahd_sync_sglist(struct ahd_softc *ahd, struct scb *scb, int op) | |||
532 | /*len*/ahd_sg_size(ahd) * scb->sg_count, op); | 544 | /*len*/ahd_sg_size(ahd) * scb->sg_count, op); |
533 | } | 545 | } |
534 | 546 | ||
535 | void | 547 | static void |
536 | ahd_sync_sense(struct ahd_softc *ahd, struct scb *scb, int op) | 548 | ahd_sync_sense(struct ahd_softc *ahd, struct scb *scb, int op) |
537 | { | 549 | { |
538 | ahd_dmamap_sync(ahd, ahd->scb_data.sense_dmat, | 550 | ahd_dmamap_sync(ahd, ahd->scb_data.sense_dmat, |
@@ -541,12 +553,14 @@ ahd_sync_sense(struct ahd_softc *ahd, struct scb *scb, int op) | |||
541 | /*len*/AHD_SENSE_BUFSIZE, op); | 553 | /*len*/AHD_SENSE_BUFSIZE, op); |
542 | } | 554 | } |
543 | 555 | ||
544 | uint32_t | 556 | #ifdef AHD_TARGET_MODE |
557 | static uint32_t | ||
545 | ahd_targetcmd_offset(struct ahd_softc *ahd, u_int index) | 558 | ahd_targetcmd_offset(struct ahd_softc *ahd, u_int index) |
546 | { | 559 | { |
547 | return (((uint8_t *)&ahd->targetcmds[index]) | 560 | return (((uint8_t *)&ahd->targetcmds[index]) |
548 | - (uint8_t *)ahd->qoutfifo); | 561 | - (uint8_t *)ahd->qoutfifo); |
549 | } | 562 | } |
563 | #endif | ||
550 | 564 | ||
551 | /*********************** Miscelaneous Support Functions ***********************/ | 565 | /*********************** Miscelaneous Support Functions ***********************/ |
552 | /* | 566 | /* |
@@ -653,31 +667,35 @@ ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr) | |||
653 | ahd_outb(ahd, SCBPTR+1, (scbptr >> 8) & 0xFF); | 667 | ahd_outb(ahd, SCBPTR+1, (scbptr >> 8) & 0xFF); |
654 | } | 668 | } |
655 | 669 | ||
656 | u_int | 670 | #if 0 /* unused */ |
671 | static u_int | ||
657 | ahd_get_hnscb_qoff(struct ahd_softc *ahd) | 672 | ahd_get_hnscb_qoff(struct ahd_softc *ahd) |
658 | { | 673 | { |
659 | return (ahd_inw_atomic(ahd, HNSCB_QOFF)); | 674 | return (ahd_inw_atomic(ahd, HNSCB_QOFF)); |
660 | } | 675 | } |
676 | #endif | ||
661 | 677 | ||
662 | void | 678 | static void |
663 | ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value) | 679 | ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value) |
664 | { | 680 | { |
665 | ahd_outw_atomic(ahd, HNSCB_QOFF, value); | 681 | ahd_outw_atomic(ahd, HNSCB_QOFF, value); |
666 | } | 682 | } |
667 | 683 | ||
668 | u_int | 684 | #if 0 /* unused */ |
685 | static u_int | ||
669 | ahd_get_hescb_qoff(struct ahd_softc *ahd) | 686 | ahd_get_hescb_qoff(struct ahd_softc *ahd) |
670 | { | 687 | { |
671 | return (ahd_inb(ahd, HESCB_QOFF)); | 688 | return (ahd_inb(ahd, HESCB_QOFF)); |
672 | } | 689 | } |
690 | #endif | ||
673 | 691 | ||
674 | void | 692 | static void |
675 | ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value) | 693 | ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value) |
676 | { | 694 | { |
677 | ahd_outb(ahd, HESCB_QOFF, value); | 695 | ahd_outb(ahd, HESCB_QOFF, value); |
678 | } | 696 | } |
679 | 697 | ||
680 | u_int | 698 | static u_int |
681 | ahd_get_snscb_qoff(struct ahd_softc *ahd) | 699 | ahd_get_snscb_qoff(struct ahd_softc *ahd) |
682 | { | 700 | { |
683 | u_int oldvalue; | 701 | u_int oldvalue; |
@@ -688,35 +706,39 @@ ahd_get_snscb_qoff(struct ahd_softc *ahd) | |||
688 | return (oldvalue); | 706 | return (oldvalue); |
689 | } | 707 | } |
690 | 708 | ||
691 | void | 709 | static void |
692 | ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value) | 710 | ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value) |
693 | { | 711 | { |
694 | AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); | 712 | AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); |
695 | ahd_outw(ahd, SNSCB_QOFF, value); | 713 | ahd_outw(ahd, SNSCB_QOFF, value); |
696 | } | 714 | } |
697 | 715 | ||
698 | u_int | 716 | #if 0 /* unused */ |
717 | static u_int | ||
699 | ahd_get_sescb_qoff(struct ahd_softc *ahd) | 718 | ahd_get_sescb_qoff(struct ahd_softc *ahd) |
700 | { | 719 | { |
701 | AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); | 720 | AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); |
702 | return (ahd_inb(ahd, SESCB_QOFF)); | 721 | return (ahd_inb(ahd, SESCB_QOFF)); |
703 | } | 722 | } |
723 | #endif | ||
704 | 724 | ||
705 | void | 725 | static void |
706 | ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value) | 726 | ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value) |
707 | { | 727 | { |
708 | AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); | 728 | AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); |
709 | ahd_outb(ahd, SESCB_QOFF, value); | 729 | ahd_outb(ahd, SESCB_QOFF, value); |
710 | } | 730 | } |
711 | 731 | ||
712 | u_int | 732 | #if 0 /* unused */ |
733 | static u_int | ||
713 | ahd_get_sdscb_qoff(struct ahd_softc *ahd) | 734 | ahd_get_sdscb_qoff(struct ahd_softc *ahd) |
714 | { | 735 | { |
715 | AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); | 736 | AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); |
716 | return (ahd_inb(ahd, SDSCB_QOFF) | (ahd_inb(ahd, SDSCB_QOFF + 1) << 8)); | 737 | return (ahd_inb(ahd, SDSCB_QOFF) | (ahd_inb(ahd, SDSCB_QOFF + 1) << 8)); |
717 | } | 738 | } |
739 | #endif | ||
718 | 740 | ||
719 | void | 741 | static void |
720 | ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value) | 742 | ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value) |
721 | { | 743 | { |
722 | AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); | 744 | AHD_ASSERT_MODES(ahd, AHD_MODE_CCHAN_MSK, AHD_MODE_CCHAN_MSK); |
@@ -756,14 +778,14 @@ ahd_inw_scbram(struct ahd_softc *ahd, u_int offset) | |||
756 | | (ahd_inb_scbram(ahd, offset+1) << 8)); | 778 | | (ahd_inb_scbram(ahd, offset+1) << 8)); |
757 | } | 779 | } |
758 | 780 | ||
759 | uint32_t | 781 | static uint32_t |
760 | ahd_inl_scbram(struct ahd_softc *ahd, u_int offset) | 782 | ahd_inl_scbram(struct ahd_softc *ahd, u_int offset) |
761 | { | 783 | { |
762 | return (ahd_inw_scbram(ahd, offset) | 784 | return (ahd_inw_scbram(ahd, offset) |
763 | | (ahd_inw_scbram(ahd, offset+2) << 16)); | 785 | | (ahd_inw_scbram(ahd, offset+2) << 16)); |
764 | } | 786 | } |
765 | 787 | ||
766 | uint64_t | 788 | static uint64_t |
767 | ahd_inq_scbram(struct ahd_softc *ahd, u_int offset) | 789 | ahd_inq_scbram(struct ahd_softc *ahd, u_int offset) |
768 | { | 790 | { |
769 | return (ahd_inl_scbram(ahd, offset) | 791 | return (ahd_inl_scbram(ahd, offset) |
@@ -784,7 +806,7 @@ ahd_lookup_scb(struct ahd_softc *ahd, u_int tag) | |||
784 | return (scb); | 806 | return (scb); |
785 | } | 807 | } |
786 | 808 | ||
787 | void | 809 | static void |
788 | ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb) | 810 | ahd_swap_with_next_hscb(struct ahd_softc *ahd, struct scb *scb) |
789 | { | 811 | { |
790 | struct hardware_scb *q_hscb; | 812 | struct hardware_scb *q_hscb; |
@@ -869,7 +891,7 @@ ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb) | |||
869 | } | 891 | } |
870 | 892 | ||
871 | /************************** Interrupt Processing ******************************/ | 893 | /************************** Interrupt Processing ******************************/ |
872 | void | 894 | static void |
873 | ahd_sync_qoutfifo(struct ahd_softc *ahd, int op) | 895 | ahd_sync_qoutfifo(struct ahd_softc *ahd, int op) |
874 | { | 896 | { |
875 | ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap, | 897 | ahd_dmamap_sync(ahd, ahd->shared_data_dmat, ahd->shared_data_map.dmamap, |
@@ -877,7 +899,7 @@ ahd_sync_qoutfifo(struct ahd_softc *ahd, int op) | |||
877 | /*len*/AHD_SCB_MAX * sizeof(struct ahd_completion), op); | 899 | /*len*/AHD_SCB_MAX * sizeof(struct ahd_completion), op); |
878 | } | 900 | } |
879 | 901 | ||
880 | void | 902 | static void |
881 | ahd_sync_tqinfifo(struct ahd_softc *ahd, int op) | 903 | ahd_sync_tqinfifo(struct ahd_softc *ahd, int op) |
882 | { | 904 | { |
883 | #ifdef AHD_TARGET_MODE | 905 | #ifdef AHD_TARGET_MODE |
@@ -897,7 +919,7 @@ ahd_sync_tqinfifo(struct ahd_softc *ahd, int op) | |||
897 | */ | 919 | */ |
898 | #define AHD_RUN_QOUTFIFO 0x1 | 920 | #define AHD_RUN_QOUTFIFO 0x1 |
899 | #define AHD_RUN_TQINFIFO 0x2 | 921 | #define AHD_RUN_TQINFIFO 0x2 |
900 | u_int | 922 | static u_int |
901 | ahd_check_cmdcmpltqueues(struct ahd_softc *ahd) | 923 | ahd_check_cmdcmpltqueues(struct ahd_softc *ahd) |
902 | { | 924 | { |
903 | u_int retval; | 925 | u_int retval; |
@@ -1640,7 +1662,7 @@ clrchn: | |||
1640 | * a copy of the first byte (little endian) of the sgptr | 1662 | * a copy of the first byte (little endian) of the sgptr |
1641 | * hscb field. | 1663 | * hscb field. |
1642 | */ | 1664 | */ |
1643 | void | 1665 | static void |
1644 | ahd_run_qoutfifo(struct ahd_softc *ahd) | 1666 | ahd_run_qoutfifo(struct ahd_softc *ahd) |
1645 | { | 1667 | { |
1646 | struct ahd_completion *completion; | 1668 | struct ahd_completion *completion; |
@@ -1679,7 +1701,7 @@ ahd_run_qoutfifo(struct ahd_softc *ahd) | |||
1679 | } | 1701 | } |
1680 | 1702 | ||
1681 | /************************* Interrupt Handling *********************************/ | 1703 | /************************* Interrupt Handling *********************************/ |
1682 | void | 1704 | static void |
1683 | ahd_handle_hwerrint(struct ahd_softc *ahd) | 1705 | ahd_handle_hwerrint(struct ahd_softc *ahd) |
1684 | { | 1706 | { |
1685 | /* | 1707 | /* |
@@ -1753,7 +1775,7 @@ ahd_dump_sglist(struct scb *scb) | |||
1753 | } | 1775 | } |
1754 | #endif /* AHD_DEBUG */ | 1776 | #endif /* AHD_DEBUG */ |
1755 | 1777 | ||
1756 | void | 1778 | static void |
1757 | ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | 1779 | ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) |
1758 | { | 1780 | { |
1759 | u_int seqintcode; | 1781 | u_int seqintcode; |
@@ -2365,7 +2387,7 @@ ahd_handle_seqint(struct ahd_softc *ahd, u_int intstat) | |||
2365 | ahd_unpause(ahd); | 2387 | ahd_unpause(ahd); |
2366 | } | 2388 | } |
2367 | 2389 | ||
2368 | void | 2390 | static void |
2369 | ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) | 2391 | ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) |
2370 | { | 2392 | { |
2371 | struct scb *scb; | 2393 | struct scb *scb; |
@@ -8131,7 +8153,7 @@ ahd_qinfifo_count(struct ahd_softc *ahd) | |||
8131 | + ARRAY_SIZE(ahd->qinfifo) - wrap_qinpos); | 8153 | + ARRAY_SIZE(ahd->qinfifo) - wrap_qinpos); |
8132 | } | 8154 | } |
8133 | 8155 | ||
8134 | void | 8156 | static void |
8135 | ahd_reset_cmds_pending(struct ahd_softc *ahd) | 8157 | ahd_reset_cmds_pending(struct ahd_softc *ahd) |
8136 | { | 8158 | { |
8137 | struct scb *scb; | 8159 | struct scb *scb; |
@@ -9656,7 +9678,7 @@ sized: | |||
9656 | } | 9678 | } |
9657 | 9679 | ||
9658 | int | 9680 | int |
9659 | ahd_print_register(ahd_reg_parse_entry_t *table, u_int num_entries, | 9681 | ahd_print_register(const ahd_reg_parse_entry_t *table, u_int num_entries, |
9660 | const char *name, u_int address, u_int value, | 9682 | const char *name, u_int address, u_int value, |
9661 | u_int *cur_column, u_int wrap_point) | 9683 | u_int *cur_column, u_int wrap_point) |
9662 | { | 9684 | { |
@@ -10647,7 +10669,7 @@ ahd_update_scsiid(struct ahd_softc *ahd, u_int targid_mask) | |||
10647 | #endif | 10669 | #endif |
10648 | } | 10670 | } |
10649 | 10671 | ||
10650 | void | 10672 | static void |
10651 | ahd_run_tqinfifo(struct ahd_softc *ahd, int paused) | 10673 | ahd_run_tqinfifo(struct ahd_softc *ahd, int paused) |
10652 | { | 10674 | { |
10653 | struct target_cmd *cmd; | 10675 | struct target_cmd *cmd; |
diff --git a/drivers/scsi/aic7xxx/aic79xx_inline.h b/drivers/scsi/aic7xxx/aic79xx_inline.h index 875137262156..5f12cf9d99d0 100644 --- a/drivers/scsi/aic7xxx/aic79xx_inline.h +++ b/drivers/scsi/aic7xxx/aic79xx_inline.h | |||
@@ -66,10 +66,6 @@ static __inline void ahd_extract_mode_state(struct ahd_softc *ahd, | |||
66 | 66 | ||
67 | void ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, | 67 | void ahd_set_modes(struct ahd_softc *ahd, ahd_mode src, |
68 | ahd_mode dst); | 68 | ahd_mode dst); |
69 | void ahd_update_modes(struct ahd_softc *ahd); | ||
70 | void ahd_assert_modes(struct ahd_softc *ahd, ahd_mode srcmode, | ||
71 | ahd_mode dstmode, const char *file, | ||
72 | int line); | ||
73 | ahd_mode_state ahd_save_modes(struct ahd_softc *ahd); | 69 | ahd_mode_state ahd_save_modes(struct ahd_softc *ahd); |
74 | void ahd_restore_modes(struct ahd_softc *ahd, | 70 | void ahd_restore_modes(struct ahd_softc *ahd, |
75 | ahd_mode_state state); | 71 | ahd_mode_state state); |
@@ -104,33 +100,12 @@ ahd_extract_mode_state(struct ahd_softc *ahd, ahd_mode_state state, | |||
104 | void *ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb, | 100 | void *ahd_sg_setup(struct ahd_softc *ahd, struct scb *scb, |
105 | void *sgptr, dma_addr_t addr, | 101 | void *sgptr, dma_addr_t addr, |
106 | bus_size_t len, int last); | 102 | bus_size_t len, int last); |
107 | void ahd_setup_scb_common(struct ahd_softc *ahd, | ||
108 | struct scb *scb); | ||
109 | void ahd_setup_data_scb(struct ahd_softc *ahd, | ||
110 | struct scb *scb); | ||
111 | void ahd_setup_noxfer_scb(struct ahd_softc *ahd, | ||
112 | struct scb *scb); | ||
113 | 103 | ||
114 | /************************** Memory mapping routines ***************************/ | 104 | /************************** Memory mapping routines ***************************/ |
115 | static __inline size_t ahd_sg_size(struct ahd_softc *ahd); | 105 | static __inline size_t ahd_sg_size(struct ahd_softc *ahd); |
116 | 106 | ||
117 | void * | ||
118 | ahd_sg_bus_to_virt(struct ahd_softc *ahd, | ||
119 | struct scb *scb, | ||
120 | uint32_t sg_busaddr); | ||
121 | uint32_t | ||
122 | ahd_sg_virt_to_bus(struct ahd_softc *ahd, | ||
123 | struct scb *scb, | ||
124 | void *sg); | ||
125 | void ahd_sync_scb(struct ahd_softc *ahd, | ||
126 | struct scb *scb, int op); | ||
127 | void ahd_sync_sglist(struct ahd_softc *ahd, | 107 | void ahd_sync_sglist(struct ahd_softc *ahd, |
128 | struct scb *scb, int op); | 108 | struct scb *scb, int op); |
129 | void ahd_sync_sense(struct ahd_softc *ahd, | ||
130 | struct scb *scb, int op); | ||
131 | uint32_t | ||
132 | ahd_targetcmd_offset(struct ahd_softc *ahd, | ||
133 | u_int index); | ||
134 | 109 | ||
135 | static __inline size_t | 110 | static __inline size_t |
136 | ahd_sg_size(struct ahd_softc *ahd) | 111 | ahd_sg_size(struct ahd_softc *ahd) |
@@ -160,26 +135,10 @@ void ahd_outq(struct ahd_softc *ahd, u_int port, | |||
160 | uint64_t value); | 135 | uint64_t value); |
161 | u_int ahd_get_scbptr(struct ahd_softc *ahd); | 136 | u_int ahd_get_scbptr(struct ahd_softc *ahd); |
162 | void ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr); | 137 | void ahd_set_scbptr(struct ahd_softc *ahd, u_int scbptr); |
163 | u_int ahd_get_hnscb_qoff(struct ahd_softc *ahd); | ||
164 | void ahd_set_hnscb_qoff(struct ahd_softc *ahd, u_int value); | ||
165 | u_int ahd_get_hescb_qoff(struct ahd_softc *ahd); | ||
166 | void ahd_set_hescb_qoff(struct ahd_softc *ahd, u_int value); | ||
167 | u_int ahd_get_snscb_qoff(struct ahd_softc *ahd); | ||
168 | void ahd_set_snscb_qoff(struct ahd_softc *ahd, u_int value); | ||
169 | u_int ahd_get_sescb_qoff(struct ahd_softc *ahd); | ||
170 | void ahd_set_sescb_qoff(struct ahd_softc *ahd, u_int value); | ||
171 | u_int ahd_get_sdscb_qoff(struct ahd_softc *ahd); | ||
172 | void ahd_set_sdscb_qoff(struct ahd_softc *ahd, u_int value); | ||
173 | u_int ahd_inb_scbram(struct ahd_softc *ahd, u_int offset); | 138 | u_int ahd_inb_scbram(struct ahd_softc *ahd, u_int offset); |
174 | u_int ahd_inw_scbram(struct ahd_softc *ahd, u_int offset); | 139 | u_int ahd_inw_scbram(struct ahd_softc *ahd, u_int offset); |
175 | uint32_t | ||
176 | ahd_inl_scbram(struct ahd_softc *ahd, u_int offset); | ||
177 | uint64_t | ||
178 | ahd_inq_scbram(struct ahd_softc *ahd, u_int offset); | ||
179 | struct scb * | 140 | struct scb * |
180 | ahd_lookup_scb(struct ahd_softc *ahd, u_int tag); | 141 | ahd_lookup_scb(struct ahd_softc *ahd, u_int tag); |
181 | void ahd_swap_with_next_hscb(struct ahd_softc *ahd, | ||
182 | struct scb *scb); | ||
183 | void ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb); | 142 | void ahd_queue_scb(struct ahd_softc *ahd, struct scb *scb); |
184 | 143 | ||
185 | static __inline uint8_t * | 144 | static __inline uint8_t * |
@@ -212,9 +171,6 @@ ahd_get_sense_bufaddr(struct ahd_softc *ahd, struct scb *scb) | |||
212 | } | 171 | } |
213 | 172 | ||
214 | /************************** Interrupt Processing ******************************/ | 173 | /************************** Interrupt Processing ******************************/ |
215 | void ahd_sync_qoutfifo(struct ahd_softc *ahd, int op); | ||
216 | void ahd_sync_tqinfifo(struct ahd_softc *ahd, int op); | ||
217 | u_int ahd_check_cmdcmpltqueues(struct ahd_softc *ahd); | ||
218 | int ahd_intr(struct ahd_softc *ahd); | 174 | int ahd_intr(struct ahd_softc *ahd); |
219 | 175 | ||
220 | #endif /* _AIC79XX_INLINE_H_ */ | 176 | #endif /* _AIC79XX_INLINE_H_ */ |
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c index 6c5287722465..ea0bbda47324 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.c +++ b/drivers/scsi/aic7xxx/aic79xx_osm.c | |||
@@ -388,7 +388,6 @@ ahd_delay(long usec) | |||
388 | 388 | ||
389 | /***************************** Low Level I/O **********************************/ | 389 | /***************************** Low Level I/O **********************************/ |
390 | uint8_t ahd_inb(struct ahd_softc * ahd, long port); | 390 | uint8_t ahd_inb(struct ahd_softc * ahd, long port); |
391 | uint16_t ahd_inw_atomic(struct ahd_softc * ahd, long port); | ||
392 | void ahd_outb(struct ahd_softc * ahd, long port, uint8_t val); | 391 | void ahd_outb(struct ahd_softc * ahd, long port, uint8_t val); |
393 | void ahd_outw_atomic(struct ahd_softc * ahd, | 392 | void ahd_outw_atomic(struct ahd_softc * ahd, |
394 | long port, uint16_t val); | 393 | long port, uint16_t val); |
@@ -411,7 +410,8 @@ ahd_inb(struct ahd_softc * ahd, long port) | |||
411 | return (x); | 410 | return (x); |
412 | } | 411 | } |
413 | 412 | ||
414 | uint16_t | 413 | #if 0 /* unused */ |
414 | static uint16_t | ||
415 | ahd_inw_atomic(struct ahd_softc * ahd, long port) | 415 | ahd_inw_atomic(struct ahd_softc * ahd, long port) |
416 | { | 416 | { |
417 | uint8_t x; | 417 | uint8_t x; |
@@ -424,6 +424,7 @@ ahd_inw_atomic(struct ahd_softc * ahd, long port) | |||
424 | mb(); | 424 | mb(); |
425 | return (x); | 425 | return (x); |
426 | } | 426 | } |
427 | #endif | ||
427 | 428 | ||
428 | void | 429 | void |
429 | ahd_outb(struct ahd_softc * ahd, long port, uint8_t val) | 430 | ahd_outb(struct ahd_softc * ahd, long port, uint8_t val) |
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.h b/drivers/scsi/aic7xxx/aic79xx_osm.h index 08dd18229b45..8d6612c19922 100644 --- a/drivers/scsi/aic7xxx/aic79xx_osm.h +++ b/drivers/scsi/aic7xxx/aic79xx_osm.h | |||
@@ -374,7 +374,6 @@ void ahd_delay(long); | |||
374 | 374 | ||
375 | /***************************** Low Level I/O **********************************/ | 375 | /***************************** Low Level I/O **********************************/ |
376 | uint8_t ahd_inb(struct ahd_softc * ahd, long port); | 376 | uint8_t ahd_inb(struct ahd_softc * ahd, long port); |
377 | uint16_t ahd_inw_atomic(struct ahd_softc * ahd, long port); | ||
378 | void ahd_outb(struct ahd_softc * ahd, long port, uint8_t val); | 377 | void ahd_outb(struct ahd_softc * ahd, long port, uint8_t val); |
379 | void ahd_outw_atomic(struct ahd_softc * ahd, | 378 | void ahd_outw_atomic(struct ahd_softc * ahd, |
380 | long port, uint16_t val); | 379 | long port, uint16_t val); |
diff --git a/drivers/scsi/aic7xxx/aic79xx_pci.c b/drivers/scsi/aic7xxx/aic79xx_pci.c index c9f79fdf9131..0bb352573f57 100644 --- a/drivers/scsi/aic7xxx/aic79xx_pci.c +++ b/drivers/scsi/aic7xxx/aic79xx_pci.c | |||
@@ -97,7 +97,7 @@ static ahd_device_setup_t ahd_aic7901A_setup; | |||
97 | static ahd_device_setup_t ahd_aic7902_setup; | 97 | static ahd_device_setup_t ahd_aic7902_setup; |
98 | static ahd_device_setup_t ahd_aic790X_setup; | 98 | static ahd_device_setup_t ahd_aic790X_setup; |
99 | 99 | ||
100 | static struct ahd_pci_identity ahd_pci_ident_table [] = | 100 | static struct ahd_pci_identity ahd_pci_ident_table[] = |
101 | { | 101 | { |
102 | /* aic7901 based controllers */ | 102 | /* aic7901 based controllers */ |
103 | { | 103 | { |
diff --git a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h index c0344e617651..862e0fbffa42 100644 --- a/drivers/scsi/aic7xxx/aic7xxx.h +++ b/drivers/scsi/aic7xxx/aic7xxx.h | |||
@@ -736,7 +736,7 @@ struct ahc_syncrate { | |||
736 | #define ST_SXFR 0x010 /* Rate Single Transition Only */ | 736 | #define ST_SXFR 0x010 /* Rate Single Transition Only */ |
737 | #define DT_SXFR 0x040 /* Rate Double Transition Only */ | 737 | #define DT_SXFR 0x040 /* Rate Double Transition Only */ |
738 | uint8_t period; /* Period to send to SCSI target */ | 738 | uint8_t period; /* Period to send to SCSI target */ |
739 | char *rate; | 739 | const char *rate; |
740 | }; | 740 | }; |
741 | 741 | ||
742 | /* Safe and valid period for async negotiations. */ | 742 | /* Safe and valid period for async negotiations. */ |
@@ -1133,10 +1133,6 @@ extern const int ahc_num_aic7770_devs; | |||
1133 | 1133 | ||
1134 | /*************************** Function Declarations ****************************/ | 1134 | /*************************** Function Declarations ****************************/ |
1135 | /******************************************************************************/ | 1135 | /******************************************************************************/ |
1136 | u_int ahc_index_busy_tcl(struct ahc_softc *ahc, u_int tcl); | ||
1137 | void ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl); | ||
1138 | void ahc_busy_tcl(struct ahc_softc *ahc, | ||
1139 | u_int tcl, u_int busyid); | ||
1140 | 1136 | ||
1141 | /***************************** PCI Front End *********************************/ | 1137 | /***************************** PCI Front End *********************************/ |
1142 | struct ahc_pci_identity *ahc_find_pci_device(ahc_dev_softc_t); | 1138 | struct ahc_pci_identity *ahc_find_pci_device(ahc_dev_softc_t); |
@@ -1155,9 +1151,6 @@ int aic7770_config(struct ahc_softc *ahc, | |||
1155 | 1151 | ||
1156 | /************************** SCB and SCB queue management **********************/ | 1152 | /************************** SCB and SCB queue management **********************/ |
1157 | int ahc_probe_scbs(struct ahc_softc *); | 1153 | int ahc_probe_scbs(struct ahc_softc *); |
1158 | void ahc_run_untagged_queues(struct ahc_softc *ahc); | ||
1159 | void ahc_run_untagged_queue(struct ahc_softc *ahc, | ||
1160 | struct scb_tailq *queue); | ||
1161 | void ahc_qinfifo_requeue_tail(struct ahc_softc *ahc, | 1154 | void ahc_qinfifo_requeue_tail(struct ahc_softc *ahc, |
1162 | struct scb *scb); | 1155 | struct scb *scb); |
1163 | int ahc_match_scb(struct ahc_softc *ahc, struct scb *scb, | 1156 | int ahc_match_scb(struct ahc_softc *ahc, struct scb *scb, |
@@ -1178,22 +1171,8 @@ int ahc_resume(struct ahc_softc *ahc); | |||
1178 | #endif | 1171 | #endif |
1179 | void ahc_set_unit(struct ahc_softc *, int); | 1172 | void ahc_set_unit(struct ahc_softc *, int); |
1180 | void ahc_set_name(struct ahc_softc *, char *); | 1173 | void ahc_set_name(struct ahc_softc *, char *); |
1181 | void ahc_alloc_scbs(struct ahc_softc *ahc); | ||
1182 | void ahc_free(struct ahc_softc *ahc); | 1174 | void ahc_free(struct ahc_softc *ahc); |
1183 | int ahc_reset(struct ahc_softc *ahc, int reinit); | 1175 | int ahc_reset(struct ahc_softc *ahc, int reinit); |
1184 | void ahc_shutdown(void *arg); | ||
1185 | |||
1186 | /*************************** Interrupt Services *******************************/ | ||
1187 | void ahc_clear_intstat(struct ahc_softc *ahc); | ||
1188 | void ahc_run_qoutfifo(struct ahc_softc *ahc); | ||
1189 | #ifdef AHC_TARGET_MODE | ||
1190 | void ahc_run_tqinfifo(struct ahc_softc *ahc, int paused); | ||
1191 | #endif | ||
1192 | void ahc_handle_brkadrint(struct ahc_softc *ahc); | ||
1193 | void ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat); | ||
1194 | void ahc_handle_scsiint(struct ahc_softc *ahc, | ||
1195 | u_int intstat); | ||
1196 | void ahc_clear_critical_section(struct ahc_softc *ahc); | ||
1197 | 1176 | ||
1198 | /***************************** Error Recovery *********************************/ | 1177 | /***************************** Error Recovery *********************************/ |
1199 | typedef enum { | 1178 | typedef enum { |
@@ -1214,36 +1193,19 @@ int ahc_search_disc_list(struct ahc_softc *ahc, int target, | |||
1214 | char channel, int lun, u_int tag, | 1193 | char channel, int lun, u_int tag, |
1215 | int stop_on_first, int remove, | 1194 | int stop_on_first, int remove, |
1216 | int save_state); | 1195 | int save_state); |
1217 | void ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb); | ||
1218 | int ahc_reset_channel(struct ahc_softc *ahc, char channel, | 1196 | int ahc_reset_channel(struct ahc_softc *ahc, char channel, |
1219 | int initiate_reset); | 1197 | int initiate_reset); |
1220 | int ahc_abort_scbs(struct ahc_softc *ahc, int target, | 1198 | |
1221 | char channel, int lun, u_int tag, | ||
1222 | role_t role, uint32_t status); | ||
1223 | void ahc_restart(struct ahc_softc *ahc); | ||
1224 | void ahc_calc_residual(struct ahc_softc *ahc, | ||
1225 | struct scb *scb); | ||
1226 | /*************************** Utility Functions ********************************/ | 1199 | /*************************** Utility Functions ********************************/ |
1227 | struct ahc_phase_table_entry* | ||
1228 | ahc_lookup_phase_entry(int phase); | ||
1229 | void ahc_compile_devinfo(struct ahc_devinfo *devinfo, | 1200 | void ahc_compile_devinfo(struct ahc_devinfo *devinfo, |
1230 | u_int our_id, u_int target, | 1201 | u_int our_id, u_int target, |
1231 | u_int lun, char channel, | 1202 | u_int lun, char channel, |
1232 | role_t role); | 1203 | role_t role); |
1233 | /************************** Transfer Negotiation ******************************/ | 1204 | /************************** Transfer Negotiation ******************************/ |
1234 | struct ahc_syncrate* ahc_find_syncrate(struct ahc_softc *ahc, u_int *period, | 1205 | const struct ahc_syncrate* ahc_find_syncrate(struct ahc_softc *ahc, u_int *period, |
1235 | u_int *ppr_options, u_int maxsync); | 1206 | u_int *ppr_options, u_int maxsync); |
1236 | u_int ahc_find_period(struct ahc_softc *ahc, | 1207 | u_int ahc_find_period(struct ahc_softc *ahc, |
1237 | u_int scsirate, u_int maxsync); | 1208 | u_int scsirate, u_int maxsync); |
1238 | void ahc_validate_offset(struct ahc_softc *ahc, | ||
1239 | struct ahc_initiator_tinfo *tinfo, | ||
1240 | struct ahc_syncrate *syncrate, | ||
1241 | u_int *offset, int wide, | ||
1242 | role_t role); | ||
1243 | void ahc_validate_width(struct ahc_softc *ahc, | ||
1244 | struct ahc_initiator_tinfo *tinfo, | ||
1245 | u_int *bus_width, | ||
1246 | role_t role); | ||
1247 | /* | 1209 | /* |
1248 | * Negotiation types. These are used to qualify if we should renegotiate | 1210 | * Negotiation types. These are used to qualify if we should renegotiate |
1249 | * even if our goal and current transport parameters are identical. | 1211 | * even if our goal and current transport parameters are identical. |
@@ -1263,7 +1225,7 @@ void ahc_set_width(struct ahc_softc *ahc, | |||
1263 | u_int width, u_int type, int paused); | 1225 | u_int width, u_int type, int paused); |
1264 | void ahc_set_syncrate(struct ahc_softc *ahc, | 1226 | void ahc_set_syncrate(struct ahc_softc *ahc, |
1265 | struct ahc_devinfo *devinfo, | 1227 | struct ahc_devinfo *devinfo, |
1266 | struct ahc_syncrate *syncrate, | 1228 | const struct ahc_syncrate *syncrate, |
1267 | u_int period, u_int offset, | 1229 | u_int period, u_int offset, |
1268 | u_int ppr_options, | 1230 | u_int ppr_options, |
1269 | u_int type, int paused); | 1231 | u_int type, int paused); |
@@ -1305,11 +1267,10 @@ extern uint32_t ahc_debug; | |||
1305 | #define AHC_SHOW_MASKED_ERRORS 0x1000 | 1267 | #define AHC_SHOW_MASKED_ERRORS 0x1000 |
1306 | #define AHC_DEBUG_SEQUENCER 0x2000 | 1268 | #define AHC_DEBUG_SEQUENCER 0x2000 |
1307 | #endif | 1269 | #endif |
1308 | void ahc_print_scb(struct scb *scb); | ||
1309 | void ahc_print_devinfo(struct ahc_softc *ahc, | 1270 | void ahc_print_devinfo(struct ahc_softc *ahc, |
1310 | struct ahc_devinfo *dev); | 1271 | struct ahc_devinfo *dev); |
1311 | void ahc_dump_card_state(struct ahc_softc *ahc); | 1272 | void ahc_dump_card_state(struct ahc_softc *ahc); |
1312 | int ahc_print_register(ahc_reg_parse_entry_t *table, | 1273 | int ahc_print_register(const ahc_reg_parse_entry_t *table, |
1313 | u_int num_entries, | 1274 | u_int num_entries, |
1314 | const char *name, | 1275 | const char *name, |
1315 | u_int address, | 1276 | u_int address, |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c index d1d006b8b3a9..62417ed17cf3 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/drivers/scsi/aic7xxx/aic7xxx_core.c | |||
@@ -51,8 +51,7 @@ | |||
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | /***************************** Lookup Tables **********************************/ | 53 | /***************************** Lookup Tables **********************************/ |
54 | char *ahc_chip_names[] = | 54 | static const char *const ahc_chip_names[] = { |
55 | { | ||
56 | "NONE", | 55 | "NONE", |
57 | "aic7770", | 56 | "aic7770", |
58 | "aic7850", | 57 | "aic7850", |
@@ -75,10 +74,10 @@ static const u_int num_chip_names = ARRAY_SIZE(ahc_chip_names); | |||
75 | */ | 74 | */ |
76 | struct ahc_hard_error_entry { | 75 | struct ahc_hard_error_entry { |
77 | uint8_t errno; | 76 | uint8_t errno; |
78 | char *errmesg; | 77 | const char *errmesg; |
79 | }; | 78 | }; |
80 | 79 | ||
81 | static struct ahc_hard_error_entry ahc_hard_errors[] = { | 80 | static const struct ahc_hard_error_entry ahc_hard_errors[] = { |
82 | { ILLHADDR, "Illegal Host Access" }, | 81 | { ILLHADDR, "Illegal Host Access" }, |
83 | { ILLSADDR, "Illegal Sequencer Address referrenced" }, | 82 | { ILLSADDR, "Illegal Sequencer Address referrenced" }, |
84 | { ILLOPCODE, "Illegal Opcode in sequencer program" }, | 83 | { ILLOPCODE, "Illegal Opcode in sequencer program" }, |
@@ -90,7 +89,7 @@ static struct ahc_hard_error_entry ahc_hard_errors[] = { | |||
90 | }; | 89 | }; |
91 | static const u_int num_errors = ARRAY_SIZE(ahc_hard_errors); | 90 | static const u_int num_errors = ARRAY_SIZE(ahc_hard_errors); |
92 | 91 | ||
93 | static struct ahc_phase_table_entry ahc_phase_table[] = | 92 | static const struct ahc_phase_table_entry ahc_phase_table[] = |
94 | { | 93 | { |
95 | { P_DATAOUT, MSG_NOOP, "in Data-out phase" }, | 94 | { P_DATAOUT, MSG_NOOP, "in Data-out phase" }, |
96 | { P_DATAIN, MSG_INITIATOR_DET_ERR, "in Data-in phase" }, | 95 | { P_DATAIN, MSG_INITIATOR_DET_ERR, "in Data-in phase" }, |
@@ -115,7 +114,7 @@ static const u_int num_phases = ARRAY_SIZE(ahc_phase_table) - 1; | |||
115 | * Provides a mapping of tranfer periods in ns to the proper value to | 114 | * Provides a mapping of tranfer periods in ns to the proper value to |
116 | * stick in the scsixfer reg. | 115 | * stick in the scsixfer reg. |
117 | */ | 116 | */ |
118 | static struct ahc_syncrate ahc_syncrates[] = | 117 | static const struct ahc_syncrate ahc_syncrates[] = |
119 | { | 118 | { |
120 | /* ultra2 fast/ultra period rate */ | 119 | /* ultra2 fast/ultra period rate */ |
121 | { 0x42, 0x000, 9, "80.0" }, | 120 | { 0x42, 0x000, 9, "80.0" }, |
@@ -148,7 +147,7 @@ static struct ahc_tmode_tstate* | |||
148 | static void ahc_free_tstate(struct ahc_softc *ahc, | 147 | static void ahc_free_tstate(struct ahc_softc *ahc, |
149 | u_int scsi_id, char channel, int force); | 148 | u_int scsi_id, char channel, int force); |
150 | #endif | 149 | #endif |
151 | static struct ahc_syncrate* | 150 | static const struct ahc_syncrate* |
152 | ahc_devlimited_syncrate(struct ahc_softc *ahc, | 151 | ahc_devlimited_syncrate(struct ahc_softc *ahc, |
153 | struct ahc_initiator_tinfo *, | 152 | struct ahc_initiator_tinfo *, |
154 | u_int *period, | 153 | u_int *period, |
@@ -204,9 +203,9 @@ static void ahc_setup_target_msgin(struct ahc_softc *ahc, | |||
204 | #endif | 203 | #endif |
205 | 204 | ||
206 | static bus_dmamap_callback_t ahc_dmamap_cb; | 205 | static bus_dmamap_callback_t ahc_dmamap_cb; |
207 | static void ahc_build_free_scb_list(struct ahc_softc *ahc); | 206 | static void ahc_build_free_scb_list(struct ahc_softc *ahc); |
208 | static int ahc_init_scbdata(struct ahc_softc *ahc); | 207 | static int ahc_init_scbdata(struct ahc_softc *ahc); |
209 | static void ahc_fini_scbdata(struct ahc_softc *ahc); | 208 | static void ahc_fini_scbdata(struct ahc_softc *ahc); |
210 | static void ahc_qinfifo_requeue(struct ahc_softc *ahc, | 209 | static void ahc_qinfifo_requeue(struct ahc_softc *ahc, |
211 | struct scb *prev_scb, | 210 | struct scb *prev_scb, |
212 | struct scb *scb); | 211 | struct scb *scb); |
@@ -238,6 +237,71 @@ static int ahc_handle_target_cmd(struct ahc_softc *ahc, | |||
238 | struct target_cmd *cmd); | 237 | struct target_cmd *cmd); |
239 | #endif | 238 | #endif |
240 | 239 | ||
240 | static u_int ahc_index_busy_tcl(struct ahc_softc *ahc, u_int tcl); | ||
241 | static void ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl); | ||
242 | static void ahc_busy_tcl(struct ahc_softc *ahc, | ||
243 | u_int tcl, u_int busyid); | ||
244 | |||
245 | /************************** SCB and SCB queue management **********************/ | ||
246 | static void ahc_run_untagged_queues(struct ahc_softc *ahc); | ||
247 | static void ahc_run_untagged_queue(struct ahc_softc *ahc, | ||
248 | struct scb_tailq *queue); | ||
249 | |||
250 | /****************************** Initialization ********************************/ | ||
251 | static void ahc_alloc_scbs(struct ahc_softc *ahc); | ||
252 | static void ahc_shutdown(void *arg); | ||
253 | |||
254 | /*************************** Interrupt Services *******************************/ | ||
255 | static void ahc_clear_intstat(struct ahc_softc *ahc); | ||
256 | static void ahc_run_qoutfifo(struct ahc_softc *ahc); | ||
257 | #ifdef AHC_TARGET_MODE | ||
258 | static void ahc_run_tqinfifo(struct ahc_softc *ahc, int paused); | ||
259 | #endif | ||
260 | static void ahc_handle_brkadrint(struct ahc_softc *ahc); | ||
261 | static void ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat); | ||
262 | static void ahc_handle_scsiint(struct ahc_softc *ahc, | ||
263 | u_int intstat); | ||
264 | static void ahc_clear_critical_section(struct ahc_softc *ahc); | ||
265 | |||
266 | /***************************** Error Recovery *********************************/ | ||
267 | static void ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb); | ||
268 | static int ahc_abort_scbs(struct ahc_softc *ahc, int target, | ||
269 | char channel, int lun, u_int tag, | ||
270 | role_t role, uint32_t status); | ||
271 | static void ahc_calc_residual(struct ahc_softc *ahc, | ||
272 | struct scb *scb); | ||
273 | |||
274 | /*********************** Untagged Transaction Routines ************************/ | ||
275 | static inline void ahc_freeze_untagged_queues(struct ahc_softc *ahc); | ||
276 | static inline void ahc_release_untagged_queues(struct ahc_softc *ahc); | ||
277 | |||
278 | /* | ||
279 | * Block our completion routine from starting the next untagged | ||
280 | * transaction for this target or target lun. | ||
281 | */ | ||
282 | static inline void | ||
283 | ahc_freeze_untagged_queues(struct ahc_softc *ahc) | ||
284 | { | ||
285 | if ((ahc->flags & AHC_SCB_BTT) == 0) | ||
286 | ahc->untagged_queue_lock++; | ||
287 | } | ||
288 | |||
289 | /* | ||
290 | * Allow the next untagged transaction for this target or target lun | ||
291 | * to be executed. We use a counting semaphore to allow the lock | ||
292 | * to be acquired recursively. Once the count drops to zero, the | ||
293 | * transaction queues will be run. | ||
294 | */ | ||
295 | static inline void | ||
296 | ahc_release_untagged_queues(struct ahc_softc *ahc) | ||
297 | { | ||
298 | if ((ahc->flags & AHC_SCB_BTT) == 0) { | ||
299 | ahc->untagged_queue_lock--; | ||
300 | if (ahc->untagged_queue_lock == 0) | ||
301 | ahc_run_untagged_queues(ahc); | ||
302 | } | ||
303 | } | ||
304 | |||
241 | /************************* Sequencer Execution Control ************************/ | 305 | /************************* Sequencer Execution Control ************************/ |
242 | /* | 306 | /* |
243 | * Work around any chip bugs related to halting sequencer execution. | 307 | * Work around any chip bugs related to halting sequencer execution. |
@@ -247,7 +311,7 @@ static int ahc_handle_target_cmd(struct ahc_softc *ahc, | |||
247 | * manual pause while accessing scb ram, accesses to certain registers | 311 | * manual pause while accessing scb ram, accesses to certain registers |
248 | * will hang the system (infinite pci retries). | 312 | * will hang the system (infinite pci retries). |
249 | */ | 313 | */ |
250 | void | 314 | static void |
251 | ahc_pause_bug_fix(struct ahc_softc *ahc) | 315 | ahc_pause_bug_fix(struct ahc_softc *ahc) |
252 | { | 316 | { |
253 | if ((ahc->features & AHC_ULTRA2) != 0) | 317 | if ((ahc->features & AHC_ULTRA2) != 0) |
@@ -304,7 +368,7 @@ ahc_unpause(struct ahc_softc *ahc) | |||
304 | } | 368 | } |
305 | 369 | ||
306 | /************************** Memory mapping routines ***************************/ | 370 | /************************** Memory mapping routines ***************************/ |
307 | struct ahc_dma_seg * | 371 | static struct ahc_dma_seg * |
308 | ahc_sg_bus_to_virt(struct scb *scb, uint32_t sg_busaddr) | 372 | ahc_sg_bus_to_virt(struct scb *scb, uint32_t sg_busaddr) |
309 | { | 373 | { |
310 | int sg_index; | 374 | int sg_index; |
@@ -316,7 +380,7 @@ ahc_sg_bus_to_virt(struct scb *scb, uint32_t sg_busaddr) | |||
316 | return (&scb->sg_list[sg_index]); | 380 | return (&scb->sg_list[sg_index]); |
317 | } | 381 | } |
318 | 382 | ||
319 | uint32_t | 383 | static uint32_t |
320 | ahc_sg_virt_to_bus(struct scb *scb, struct ahc_dma_seg *sg) | 384 | ahc_sg_virt_to_bus(struct scb *scb, struct ahc_dma_seg *sg) |
321 | { | 385 | { |
322 | int sg_index; | 386 | int sg_index; |
@@ -327,14 +391,14 @@ ahc_sg_virt_to_bus(struct scb *scb, struct ahc_dma_seg *sg) | |||
327 | return (scb->sg_list_phys + (sg_index * sizeof(*scb->sg_list))); | 391 | return (scb->sg_list_phys + (sg_index * sizeof(*scb->sg_list))); |
328 | } | 392 | } |
329 | 393 | ||
330 | uint32_t | 394 | static uint32_t |
331 | ahc_hscb_busaddr(struct ahc_softc *ahc, u_int index) | 395 | ahc_hscb_busaddr(struct ahc_softc *ahc, u_int index) |
332 | { | 396 | { |
333 | return (ahc->scb_data->hscb_busaddr | 397 | return (ahc->scb_data->hscb_busaddr |
334 | + (sizeof(struct hardware_scb) * index)); | 398 | + (sizeof(struct hardware_scb) * index)); |
335 | } | 399 | } |
336 | 400 | ||
337 | void | 401 | static void |
338 | ahc_sync_scb(struct ahc_softc *ahc, struct scb *scb, int op) | 402 | ahc_sync_scb(struct ahc_softc *ahc, struct scb *scb, int op) |
339 | { | 403 | { |
340 | ahc_dmamap_sync(ahc, ahc->scb_data->hscb_dmat, | 404 | ahc_dmamap_sync(ahc, ahc->scb_data->hscb_dmat, |
@@ -355,18 +419,20 @@ ahc_sync_sglist(struct ahc_softc *ahc, struct scb *scb, int op) | |||
355 | /*len*/sizeof(struct ahc_dma_seg) * scb->sg_count, op); | 419 | /*len*/sizeof(struct ahc_dma_seg) * scb->sg_count, op); |
356 | } | 420 | } |
357 | 421 | ||
358 | uint32_t | 422 | #ifdef AHC_TARGET_MODE |
423 | static uint32_t | ||
359 | ahc_targetcmd_offset(struct ahc_softc *ahc, u_int index) | 424 | ahc_targetcmd_offset(struct ahc_softc *ahc, u_int index) |
360 | { | 425 | { |
361 | return (((uint8_t *)&ahc->targetcmds[index]) - ahc->qoutfifo); | 426 | return (((uint8_t *)&ahc->targetcmds[index]) - ahc->qoutfifo); |
362 | } | 427 | } |
428 | #endif | ||
363 | 429 | ||
364 | /*********************** Miscelaneous Support Functions ***********************/ | 430 | /*********************** Miscelaneous Support Functions ***********************/ |
365 | /* | 431 | /* |
366 | * Determine whether the sequencer reported a residual | 432 | * Determine whether the sequencer reported a residual |
367 | * for this SCB/transaction. | 433 | * for this SCB/transaction. |
368 | */ | 434 | */ |
369 | void | 435 | static void |
370 | ahc_update_residual(struct ahc_softc *ahc, struct scb *scb) | 436 | ahc_update_residual(struct ahc_softc *ahc, struct scb *scb) |
371 | { | 437 | { |
372 | uint32_t sgptr; | 438 | uint32_t sgptr; |
@@ -504,7 +570,7 @@ ahc_lookup_scb(struct ahc_softc *ahc, u_int tag) | |||
504 | return (scb); | 570 | return (scb); |
505 | } | 571 | } |
506 | 572 | ||
507 | void | 573 | static void |
508 | ahc_swap_with_next_hscb(struct ahc_softc *ahc, struct scb *scb) | 574 | ahc_swap_with_next_hscb(struct ahc_softc *ahc, struct scb *scb) |
509 | { | 575 | { |
510 | struct hardware_scb *q_hscb; | 576 | struct hardware_scb *q_hscb; |
@@ -593,7 +659,7 @@ ahc_get_sense_buf(struct ahc_softc *ahc, struct scb *scb) | |||
593 | return (&ahc->scb_data->sense[offset]); | 659 | return (&ahc->scb_data->sense[offset]); |
594 | } | 660 | } |
595 | 661 | ||
596 | uint32_t | 662 | static uint32_t |
597 | ahc_get_sense_bufaddr(struct ahc_softc *ahc, struct scb *scb) | 663 | ahc_get_sense_bufaddr(struct ahc_softc *ahc, struct scb *scb) |
598 | { | 664 | { |
599 | int offset; | 665 | int offset; |
@@ -604,14 +670,14 @@ ahc_get_sense_bufaddr(struct ahc_softc *ahc, struct scb *scb) | |||
604 | } | 670 | } |
605 | 671 | ||
606 | /************************** Interrupt Processing ******************************/ | 672 | /************************** Interrupt Processing ******************************/ |
607 | void | 673 | static void |
608 | ahc_sync_qoutfifo(struct ahc_softc *ahc, int op) | 674 | ahc_sync_qoutfifo(struct ahc_softc *ahc, int op) |
609 | { | 675 | { |
610 | ahc_dmamap_sync(ahc, ahc->shared_data_dmat, ahc->shared_data_dmamap, | 676 | ahc_dmamap_sync(ahc, ahc->shared_data_dmat, ahc->shared_data_dmamap, |
611 | /*offset*/0, /*len*/256, op); | 677 | /*offset*/0, /*len*/256, op); |
612 | } | 678 | } |
613 | 679 | ||
614 | void | 680 | static void |
615 | ahc_sync_tqinfifo(struct ahc_softc *ahc, int op) | 681 | ahc_sync_tqinfifo(struct ahc_softc *ahc, int op) |
616 | { | 682 | { |
617 | #ifdef AHC_TARGET_MODE | 683 | #ifdef AHC_TARGET_MODE |
@@ -631,7 +697,7 @@ ahc_sync_tqinfifo(struct ahc_softc *ahc, int op) | |||
631 | */ | 697 | */ |
632 | #define AHC_RUN_QOUTFIFO 0x1 | 698 | #define AHC_RUN_QOUTFIFO 0x1 |
633 | #define AHC_RUN_TQINFIFO 0x2 | 699 | #define AHC_RUN_TQINFIFO 0x2 |
634 | u_int | 700 | static u_int |
635 | ahc_check_cmdcmpltqueues(struct ahc_softc *ahc) | 701 | ahc_check_cmdcmpltqueues(struct ahc_softc *ahc) |
636 | { | 702 | { |
637 | u_int retval; | 703 | u_int retval; |
@@ -745,7 +811,7 @@ ahc_intr(struct ahc_softc *ahc) | |||
745 | /* | 811 | /* |
746 | * Restart the sequencer program from address zero | 812 | * Restart the sequencer program from address zero |
747 | */ | 813 | */ |
748 | void | 814 | static void |
749 | ahc_restart(struct ahc_softc *ahc) | 815 | ahc_restart(struct ahc_softc *ahc) |
750 | { | 816 | { |
751 | 817 | ||
@@ -806,7 +872,7 @@ ahc_restart(struct ahc_softc *ahc) | |||
806 | } | 872 | } |
807 | 873 | ||
808 | /************************* Input/Output Queues ********************************/ | 874 | /************************* Input/Output Queues ********************************/ |
809 | void | 875 | static void |
810 | ahc_run_qoutfifo(struct ahc_softc *ahc) | 876 | ahc_run_qoutfifo(struct ahc_softc *ahc) |
811 | { | 877 | { |
812 | struct scb *scb; | 878 | struct scb *scb; |
@@ -853,7 +919,7 @@ ahc_run_qoutfifo(struct ahc_softc *ahc) | |||
853 | } | 919 | } |
854 | } | 920 | } |
855 | 921 | ||
856 | void | 922 | static void |
857 | ahc_run_untagged_queues(struct ahc_softc *ahc) | 923 | ahc_run_untagged_queues(struct ahc_softc *ahc) |
858 | { | 924 | { |
859 | int i; | 925 | int i; |
@@ -862,7 +928,7 @@ ahc_run_untagged_queues(struct ahc_softc *ahc) | |||
862 | ahc_run_untagged_queue(ahc, &ahc->untagged_queues[i]); | 928 | ahc_run_untagged_queue(ahc, &ahc->untagged_queues[i]); |
863 | } | 929 | } |
864 | 930 | ||
865 | void | 931 | static void |
866 | ahc_run_untagged_queue(struct ahc_softc *ahc, struct scb_tailq *queue) | 932 | ahc_run_untagged_queue(struct ahc_softc *ahc, struct scb_tailq *queue) |
867 | { | 933 | { |
868 | struct scb *scb; | 934 | struct scb *scb; |
@@ -878,7 +944,7 @@ ahc_run_untagged_queue(struct ahc_softc *ahc, struct scb_tailq *queue) | |||
878 | } | 944 | } |
879 | 945 | ||
880 | /************************* Interrupt Handling *********************************/ | 946 | /************************* Interrupt Handling *********************************/ |
881 | void | 947 | static void |
882 | ahc_handle_brkadrint(struct ahc_softc *ahc) | 948 | ahc_handle_brkadrint(struct ahc_softc *ahc) |
883 | { | 949 | { |
884 | /* | 950 | /* |
@@ -907,7 +973,7 @@ ahc_handle_brkadrint(struct ahc_softc *ahc) | |||
907 | ahc_shutdown(ahc); | 973 | ahc_shutdown(ahc); |
908 | } | 974 | } |
909 | 975 | ||
910 | void | 976 | static void |
911 | ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) | 977 | ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat) |
912 | { | 978 | { |
913 | struct scb *scb; | 979 | struct scb *scb; |
@@ -1458,7 +1524,7 @@ unpause: | |||
1458 | ahc_unpause(ahc); | 1524 | ahc_unpause(ahc); |
1459 | } | 1525 | } |
1460 | 1526 | ||
1461 | void | 1527 | static void |
1462 | ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) | 1528 | ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) |
1463 | { | 1529 | { |
1464 | u_int scb_index; | 1530 | u_int scb_index; |
@@ -1911,7 +1977,7 @@ ahc_force_renegotiation(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
1911 | } | 1977 | } |
1912 | 1978 | ||
1913 | #define AHC_MAX_STEPS 2000 | 1979 | #define AHC_MAX_STEPS 2000 |
1914 | void | 1980 | static void |
1915 | ahc_clear_critical_section(struct ahc_softc *ahc) | 1981 | ahc_clear_critical_section(struct ahc_softc *ahc) |
1916 | { | 1982 | { |
1917 | int stepping; | 1983 | int stepping; |
@@ -2004,7 +2070,7 @@ ahc_clear_critical_section(struct ahc_softc *ahc) | |||
2004 | /* | 2070 | /* |
2005 | * Clear any pending interrupt status. | 2071 | * Clear any pending interrupt status. |
2006 | */ | 2072 | */ |
2007 | void | 2073 | static void |
2008 | ahc_clear_intstat(struct ahc_softc *ahc) | 2074 | ahc_clear_intstat(struct ahc_softc *ahc) |
2009 | { | 2075 | { |
2010 | /* Clear any interrupt conditions this may have caused */ | 2076 | /* Clear any interrupt conditions this may have caused */ |
@@ -2023,7 +2089,8 @@ ahc_clear_intstat(struct ahc_softc *ahc) | |||
2023 | uint32_t ahc_debug = AHC_DEBUG_OPTS; | 2089 | uint32_t ahc_debug = AHC_DEBUG_OPTS; |
2024 | #endif | 2090 | #endif |
2025 | 2091 | ||
2026 | void | 2092 | #if 0 /* unused */ |
2093 | static void | ||
2027 | ahc_print_scb(struct scb *scb) | 2094 | ahc_print_scb(struct scb *scb) |
2028 | { | 2095 | { |
2029 | int i; | 2096 | int i; |
@@ -2055,6 +2122,7 @@ ahc_print_scb(struct scb *scb) | |||
2055 | } | 2122 | } |
2056 | } | 2123 | } |
2057 | } | 2124 | } |
2125 | #endif | ||
2058 | 2126 | ||
2059 | /************************* Transfer Negotiation *******************************/ | 2127 | /************************* Transfer Negotiation *******************************/ |
2060 | /* | 2128 | /* |
@@ -2138,7 +2206,7 @@ ahc_free_tstate(struct ahc_softc *ahc, u_int scsi_id, char channel, int force) | |||
2138 | * by the capabilities of the bus connectivity of and sync settings for | 2206 | * by the capabilities of the bus connectivity of and sync settings for |
2139 | * the target. | 2207 | * the target. |
2140 | */ | 2208 | */ |
2141 | struct ahc_syncrate * | 2209 | const struct ahc_syncrate * |
2142 | ahc_devlimited_syncrate(struct ahc_softc *ahc, | 2210 | ahc_devlimited_syncrate(struct ahc_softc *ahc, |
2143 | struct ahc_initiator_tinfo *tinfo, | 2211 | struct ahc_initiator_tinfo *tinfo, |
2144 | u_int *period, u_int *ppr_options, role_t role) | 2212 | u_int *period, u_int *ppr_options, role_t role) |
@@ -2193,11 +2261,11 @@ ahc_devlimited_syncrate(struct ahc_softc *ahc, | |||
2193 | * Return the period and offset that should be sent to the target | 2261 | * Return the period and offset that should be sent to the target |
2194 | * if this was the beginning of an SDTR. | 2262 | * if this was the beginning of an SDTR. |
2195 | */ | 2263 | */ |
2196 | struct ahc_syncrate * | 2264 | const struct ahc_syncrate * |
2197 | ahc_find_syncrate(struct ahc_softc *ahc, u_int *period, | 2265 | ahc_find_syncrate(struct ahc_softc *ahc, u_int *period, |
2198 | u_int *ppr_options, u_int maxsync) | 2266 | u_int *ppr_options, u_int maxsync) |
2199 | { | 2267 | { |
2200 | struct ahc_syncrate *syncrate; | 2268 | const struct ahc_syncrate *syncrate; |
2201 | 2269 | ||
2202 | if ((ahc->features & AHC_DT) == 0) | 2270 | if ((ahc->features & AHC_DT) == 0) |
2203 | *ppr_options &= ~MSG_EXT_PPR_DT_REQ; | 2271 | *ppr_options &= ~MSG_EXT_PPR_DT_REQ; |
@@ -2272,7 +2340,7 @@ ahc_find_syncrate(struct ahc_softc *ahc, u_int *period, | |||
2272 | u_int | 2340 | u_int |
2273 | ahc_find_period(struct ahc_softc *ahc, u_int scsirate, u_int maxsync) | 2341 | ahc_find_period(struct ahc_softc *ahc, u_int scsirate, u_int maxsync) |
2274 | { | 2342 | { |
2275 | struct ahc_syncrate *syncrate; | 2343 | const struct ahc_syncrate *syncrate; |
2276 | 2344 | ||
2277 | if ((ahc->features & AHC_ULTRA2) != 0) | 2345 | if ((ahc->features & AHC_ULTRA2) != 0) |
2278 | scsirate &= SXFR_ULTRA2; | 2346 | scsirate &= SXFR_ULTRA2; |
@@ -2310,10 +2378,10 @@ ahc_find_period(struct ahc_softc *ahc, u_int scsirate, u_int maxsync) | |||
2310 | * Truncate the given synchronous offset to a value the | 2378 | * Truncate the given synchronous offset to a value the |
2311 | * current adapter type and syncrate are capable of. | 2379 | * current adapter type and syncrate are capable of. |
2312 | */ | 2380 | */ |
2313 | void | 2381 | static void |
2314 | ahc_validate_offset(struct ahc_softc *ahc, | 2382 | ahc_validate_offset(struct ahc_softc *ahc, |
2315 | struct ahc_initiator_tinfo *tinfo, | 2383 | struct ahc_initiator_tinfo *tinfo, |
2316 | struct ahc_syncrate *syncrate, | 2384 | const struct ahc_syncrate *syncrate, |
2317 | u_int *offset, int wide, role_t role) | 2385 | u_int *offset, int wide, role_t role) |
2318 | { | 2386 | { |
2319 | u_int maxoffset; | 2387 | u_int maxoffset; |
@@ -2342,7 +2410,7 @@ ahc_validate_offset(struct ahc_softc *ahc, | |||
2342 | * Truncate the given transfer width parameter to a value the | 2410 | * Truncate the given transfer width parameter to a value the |
2343 | * current adapter type is capable of. | 2411 | * current adapter type is capable of. |
2344 | */ | 2412 | */ |
2345 | void | 2413 | static void |
2346 | ahc_validate_width(struct ahc_softc *ahc, struct ahc_initiator_tinfo *tinfo, | 2414 | ahc_validate_width(struct ahc_softc *ahc, struct ahc_initiator_tinfo *tinfo, |
2347 | u_int *bus_width, role_t role) | 2415 | u_int *bus_width, role_t role) |
2348 | { | 2416 | { |
@@ -2417,7 +2485,7 @@ ahc_update_neg_request(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | |||
2417 | */ | 2485 | */ |
2418 | void | 2486 | void |
2419 | ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, | 2487 | ahc_set_syncrate(struct ahc_softc *ahc, struct ahc_devinfo *devinfo, |
2420 | struct ahc_syncrate *syncrate, u_int period, | 2488 | const struct ahc_syncrate *syncrate, u_int period, |
2421 | u_int offset, u_int ppr_options, u_int type, int paused) | 2489 | u_int offset, u_int ppr_options, u_int type, int paused) |
2422 | { | 2490 | { |
2423 | struct ahc_initiator_tinfo *tinfo; | 2491 | struct ahc_initiator_tinfo *tinfo; |
@@ -2724,11 +2792,11 @@ ahc_fetch_devinfo(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
2724 | role); | 2792 | role); |
2725 | } | 2793 | } |
2726 | 2794 | ||
2727 | struct ahc_phase_table_entry* | 2795 | static const struct ahc_phase_table_entry* |
2728 | ahc_lookup_phase_entry(int phase) | 2796 | ahc_lookup_phase_entry(int phase) |
2729 | { | 2797 | { |
2730 | struct ahc_phase_table_entry *entry; | 2798 | const struct ahc_phase_table_entry *entry; |
2731 | struct ahc_phase_table_entry *last_entry; | 2799 | const struct ahc_phase_table_entry *last_entry; |
2732 | 2800 | ||
2733 | /* | 2801 | /* |
2734 | * num_phases doesn't include the default entry which | 2802 | * num_phases doesn't include the default entry which |
@@ -2894,7 +2962,7 @@ ahc_build_transfer_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
2894 | */ | 2962 | */ |
2895 | struct ahc_initiator_tinfo *tinfo; | 2963 | struct ahc_initiator_tinfo *tinfo; |
2896 | struct ahc_tmode_tstate *tstate; | 2964 | struct ahc_tmode_tstate *tstate; |
2897 | struct ahc_syncrate *rate; | 2965 | const struct ahc_syncrate *rate; |
2898 | int dowide; | 2966 | int dowide; |
2899 | int dosync; | 2967 | int dosync; |
2900 | int doppr; | 2968 | int doppr; |
@@ -3560,7 +3628,7 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
3560 | switch (ahc->msgin_buf[2]) { | 3628 | switch (ahc->msgin_buf[2]) { |
3561 | case MSG_EXT_SDTR: | 3629 | case MSG_EXT_SDTR: |
3562 | { | 3630 | { |
3563 | struct ahc_syncrate *syncrate; | 3631 | const struct ahc_syncrate *syncrate; |
3564 | u_int period; | 3632 | u_int period; |
3565 | u_int ppr_options; | 3633 | u_int ppr_options; |
3566 | u_int offset; | 3634 | u_int offset; |
@@ -3735,7 +3803,7 @@ ahc_parse_msg(struct ahc_softc *ahc, struct ahc_devinfo *devinfo) | |||
3735 | } | 3803 | } |
3736 | case MSG_EXT_PPR: | 3804 | case MSG_EXT_PPR: |
3737 | { | 3805 | { |
3738 | struct ahc_syncrate *syncrate; | 3806 | const struct ahc_syncrate *syncrate; |
3739 | u_int period; | 3807 | u_int period; |
3740 | u_int offset; | 3808 | u_int offset; |
3741 | u_int bus_width; | 3809 | u_int bus_width; |
@@ -4488,7 +4556,7 @@ ahc_free(struct ahc_softc *ahc) | |||
4488 | return; | 4556 | return; |
4489 | } | 4557 | } |
4490 | 4558 | ||
4491 | void | 4559 | static void |
4492 | ahc_shutdown(void *arg) | 4560 | ahc_shutdown(void *arg) |
4493 | { | 4561 | { |
4494 | struct ahc_softc *ahc; | 4562 | struct ahc_softc *ahc; |
@@ -4892,7 +4960,7 @@ ahc_fini_scbdata(struct ahc_softc *ahc) | |||
4892 | free(scb_data->scbarray, M_DEVBUF); | 4960 | free(scb_data->scbarray, M_DEVBUF); |
4893 | } | 4961 | } |
4894 | 4962 | ||
4895 | void | 4963 | static void |
4896 | ahc_alloc_scbs(struct ahc_softc *ahc) | 4964 | ahc_alloc_scbs(struct ahc_softc *ahc) |
4897 | { | 4965 | { |
4898 | struct scb_data *scb_data; | 4966 | struct scb_data *scb_data; |
@@ -5625,7 +5693,7 @@ ahc_resume(struct ahc_softc *ahc) | |||
5625 | * Return the untagged transaction id for a given target/channel lun. | 5693 | * Return the untagged transaction id for a given target/channel lun. |
5626 | * Optionally, clear the entry. | 5694 | * Optionally, clear the entry. |
5627 | */ | 5695 | */ |
5628 | u_int | 5696 | static u_int |
5629 | ahc_index_busy_tcl(struct ahc_softc *ahc, u_int tcl) | 5697 | ahc_index_busy_tcl(struct ahc_softc *ahc, u_int tcl) |
5630 | { | 5698 | { |
5631 | u_int scbid; | 5699 | u_int scbid; |
@@ -5646,7 +5714,7 @@ ahc_index_busy_tcl(struct ahc_softc *ahc, u_int tcl) | |||
5646 | return (scbid); | 5714 | return (scbid); |
5647 | } | 5715 | } |
5648 | 5716 | ||
5649 | void | 5717 | static void |
5650 | ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl) | 5718 | ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl) |
5651 | { | 5719 | { |
5652 | u_int target_offset; | 5720 | u_int target_offset; |
@@ -5664,7 +5732,7 @@ ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl) | |||
5664 | } | 5732 | } |
5665 | } | 5733 | } |
5666 | 5734 | ||
5667 | void | 5735 | static void |
5668 | ahc_busy_tcl(struct ahc_softc *ahc, u_int tcl, u_int scbid) | 5736 | ahc_busy_tcl(struct ahc_softc *ahc, u_int tcl, u_int scbid) |
5669 | { | 5737 | { |
5670 | u_int target_offset; | 5738 | u_int target_offset; |
@@ -5719,7 +5787,7 @@ ahc_match_scb(struct ahc_softc *ahc, struct scb *scb, int target, | |||
5719 | return match; | 5787 | return match; |
5720 | } | 5788 | } |
5721 | 5789 | ||
5722 | void | 5790 | static void |
5723 | ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb) | 5791 | ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb) |
5724 | { | 5792 | { |
5725 | int target; | 5793 | int target; |
@@ -6260,7 +6328,7 @@ ahc_rem_wscb(struct ahc_softc *ahc, u_int scbpos, u_int prev) | |||
6260 | * been modified from CAM_REQ_INPROG. This routine assumes that the sequencer | 6328 | * been modified from CAM_REQ_INPROG. This routine assumes that the sequencer |
6261 | * is paused before it is called. | 6329 | * is paused before it is called. |
6262 | */ | 6330 | */ |
6263 | int | 6331 | static int |
6264 | ahc_abort_scbs(struct ahc_softc *ahc, int target, char channel, | 6332 | ahc_abort_scbs(struct ahc_softc *ahc, int target, char channel, |
6265 | int lun, u_int tag, role_t role, uint32_t status) | 6333 | int lun, u_int tag, role_t role, uint32_t status) |
6266 | { | 6334 | { |
@@ -6582,7 +6650,7 @@ ahc_reset_channel(struct ahc_softc *ahc, char channel, int initiate_reset) | |||
6582 | /* | 6650 | /* |
6583 | * Calculate the residual for a just completed SCB. | 6651 | * Calculate the residual for a just completed SCB. |
6584 | */ | 6652 | */ |
6585 | void | 6653 | static void |
6586 | ahc_calc_residual(struct ahc_softc *ahc, struct scb *scb) | 6654 | ahc_calc_residual(struct ahc_softc *ahc, struct scb *scb) |
6587 | { | 6655 | { |
6588 | struct hardware_scb *hscb; | 6656 | struct hardware_scb *hscb; |
@@ -7049,7 +7117,7 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts) | |||
7049 | } | 7117 | } |
7050 | 7118 | ||
7051 | int | 7119 | int |
7052 | ahc_print_register(ahc_reg_parse_entry_t *table, u_int num_entries, | 7120 | ahc_print_register(const ahc_reg_parse_entry_t *table, u_int num_entries, |
7053 | const char *name, u_int address, u_int value, | 7121 | const char *name, u_int address, u_int value, |
7054 | u_int *cur_column, u_int wrap_point) | 7122 | u_int *cur_column, u_int wrap_point) |
7055 | { | 7123 | { |
@@ -7733,7 +7801,7 @@ ahc_update_scsiid(struct ahc_softc *ahc, u_int targid_mask) | |||
7733 | ahc_outb(ahc, SCSIID, scsiid); | 7801 | ahc_outb(ahc, SCSIID, scsiid); |
7734 | } | 7802 | } |
7735 | 7803 | ||
7736 | void | 7804 | static void |
7737 | ahc_run_tqinfifo(struct ahc_softc *ahc, int paused) | 7805 | ahc_run_tqinfifo(struct ahc_softc *ahc, int paused) |
7738 | { | 7806 | { |
7739 | struct target_cmd *cmd; | 7807 | struct target_cmd *cmd; |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_inline.h b/drivers/scsi/aic7xxx/aic7xxx_inline.h index d18cd743618d..09bf2f4d78d5 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_inline.h +++ b/drivers/scsi/aic7xxx/aic7xxx_inline.h | |||
@@ -46,58 +46,13 @@ | |||
46 | #define _AIC7XXX_INLINE_H_ | 46 | #define _AIC7XXX_INLINE_H_ |
47 | 47 | ||
48 | /************************* Sequencer Execution Control ************************/ | 48 | /************************* Sequencer Execution Control ************************/ |
49 | void ahc_pause_bug_fix(struct ahc_softc *ahc); | ||
50 | int ahc_is_paused(struct ahc_softc *ahc); | 49 | int ahc_is_paused(struct ahc_softc *ahc); |
51 | void ahc_pause(struct ahc_softc *ahc); | 50 | void ahc_pause(struct ahc_softc *ahc); |
52 | void ahc_unpause(struct ahc_softc *ahc); | 51 | void ahc_unpause(struct ahc_softc *ahc); |
53 | 52 | ||
54 | /*********************** Untagged Transaction Routines ************************/ | ||
55 | static __inline void ahc_freeze_untagged_queues(struct ahc_softc *ahc); | ||
56 | static __inline void ahc_release_untagged_queues(struct ahc_softc *ahc); | ||
57 | |||
58 | /* | ||
59 | * Block our completion routine from starting the next untagged | ||
60 | * transaction for this target or target lun. | ||
61 | */ | ||
62 | static __inline void | ||
63 | ahc_freeze_untagged_queues(struct ahc_softc *ahc) | ||
64 | { | ||
65 | if ((ahc->flags & AHC_SCB_BTT) == 0) | ||
66 | ahc->untagged_queue_lock++; | ||
67 | } | ||
68 | |||
69 | /* | ||
70 | * Allow the next untagged transaction for this target or target lun | ||
71 | * to be executed. We use a counting semaphore to allow the lock | ||
72 | * to be acquired recursively. Once the count drops to zero, the | ||
73 | * transaction queues will be run. | ||
74 | */ | ||
75 | static __inline void | ||
76 | ahc_release_untagged_queues(struct ahc_softc *ahc) | ||
77 | { | ||
78 | if ((ahc->flags & AHC_SCB_BTT) == 0) { | ||
79 | ahc->untagged_queue_lock--; | ||
80 | if (ahc->untagged_queue_lock == 0) | ||
81 | ahc_run_untagged_queues(ahc); | ||
82 | } | ||
83 | } | ||
84 | |||
85 | /************************** Memory mapping routines ***************************/ | 53 | /************************** Memory mapping routines ***************************/ |
86 | struct ahc_dma_seg * | ||
87 | ahc_sg_bus_to_virt(struct scb *scb, | ||
88 | uint32_t sg_busaddr); | ||
89 | uint32_t | ||
90 | ahc_sg_virt_to_bus(struct scb *scb, | ||
91 | struct ahc_dma_seg *sg); | ||
92 | uint32_t | ||
93 | ahc_hscb_busaddr(struct ahc_softc *ahc, u_int index); | ||
94 | void ahc_sync_scb(struct ahc_softc *ahc, | ||
95 | struct scb *scb, int op); | ||
96 | void ahc_sync_sglist(struct ahc_softc *ahc, | 54 | void ahc_sync_sglist(struct ahc_softc *ahc, |
97 | struct scb *scb, int op); | 55 | struct scb *scb, int op); |
98 | uint32_t | ||
99 | ahc_targetcmd_offset(struct ahc_softc *ahc, | ||
100 | u_int index); | ||
101 | 56 | ||
102 | /******************************** Debugging ***********************************/ | 57 | /******************************** Debugging ***********************************/ |
103 | static __inline char *ahc_name(struct ahc_softc *ahc); | 58 | static __inline char *ahc_name(struct ahc_softc *ahc); |
@@ -110,8 +65,6 @@ ahc_name(struct ahc_softc *ahc) | |||
110 | 65 | ||
111 | /*********************** Miscellaneous Support Functions ***********************/ | 66 | /*********************** Miscellaneous Support Functions ***********************/ |
112 | 67 | ||
113 | void ahc_update_residual(struct ahc_softc *ahc, | ||
114 | struct scb *scb); | ||
115 | struct ahc_initiator_tinfo * | 68 | struct ahc_initiator_tinfo * |
116 | ahc_fetch_transinfo(struct ahc_softc *ahc, | 69 | ahc_fetch_transinfo(struct ahc_softc *ahc, |
117 | char channel, u_int our_id, | 70 | char channel, u_int our_id, |
@@ -134,20 +87,12 @@ struct scb* | |||
134 | void ahc_free_scb(struct ahc_softc *ahc, struct scb *scb); | 87 | void ahc_free_scb(struct ahc_softc *ahc, struct scb *scb); |
135 | struct scb * | 88 | struct scb * |
136 | ahc_lookup_scb(struct ahc_softc *ahc, u_int tag); | 89 | ahc_lookup_scb(struct ahc_softc *ahc, u_int tag); |
137 | void ahc_swap_with_next_hscb(struct ahc_softc *ahc, | ||
138 | struct scb *scb); | ||
139 | void ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb); | 90 | void ahc_queue_scb(struct ahc_softc *ahc, struct scb *scb); |
140 | struct scsi_sense_data * | 91 | struct scsi_sense_data * |
141 | ahc_get_sense_buf(struct ahc_softc *ahc, | 92 | ahc_get_sense_buf(struct ahc_softc *ahc, |
142 | struct scb *scb); | 93 | struct scb *scb); |
143 | uint32_t | ||
144 | ahc_get_sense_bufaddr(struct ahc_softc *ahc, | ||
145 | struct scb *scb); | ||
146 | 94 | ||
147 | /************************** Interrupt Processing ******************************/ | 95 | /************************** Interrupt Processing ******************************/ |
148 | void ahc_sync_qoutfifo(struct ahc_softc *ahc, int op); | ||
149 | void ahc_sync_tqinfifo(struct ahc_softc *ahc, int op); | ||
150 | u_int ahc_check_cmdcmpltqueues(struct ahc_softc *ahc); | ||
151 | int ahc_intr(struct ahc_softc *ahc); | 96 | int ahc_intr(struct ahc_softc *ahc); |
152 | 97 | ||
153 | #endif /* _AIC7XXX_INLINE_H_ */ | 98 | #endif /* _AIC7XXX_INLINE_H_ */ |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index c5a354b39d88..01118c3f56b5 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c | |||
@@ -2386,7 +2386,7 @@ static void ahc_linux_set_period(struct scsi_target *starget, int period) | |||
2386 | unsigned int ppr_options = tinfo->goal.ppr_options; | 2386 | unsigned int ppr_options = tinfo->goal.ppr_options; |
2387 | unsigned long flags; | 2387 | unsigned long flags; |
2388 | unsigned long offset = tinfo->goal.offset; | 2388 | unsigned long offset = tinfo->goal.offset; |
2389 | struct ahc_syncrate *syncrate; | 2389 | const struct ahc_syncrate *syncrate; |
2390 | 2390 | ||
2391 | if (offset == 0) | 2391 | if (offset == 0) |
2392 | offset = MAX_OFFSET; | 2392 | offset = MAX_OFFSET; |
@@ -2430,7 +2430,7 @@ static void ahc_linux_set_offset(struct scsi_target *starget, int offset) | |||
2430 | unsigned int ppr_options = 0; | 2430 | unsigned int ppr_options = 0; |
2431 | unsigned int period = 0; | 2431 | unsigned int period = 0; |
2432 | unsigned long flags; | 2432 | unsigned long flags; |
2433 | struct ahc_syncrate *syncrate = NULL; | 2433 | const struct ahc_syncrate *syncrate = NULL; |
2434 | 2434 | ||
2435 | ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, | 2435 | ahc_compile_devinfo(&devinfo, shost->this_id, starget->id, 0, |
2436 | starget->channel + 'A', ROLE_INITIATOR); | 2436 | starget->channel + 'A', ROLE_INITIATOR); |
@@ -2460,7 +2460,7 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt) | |||
2460 | unsigned int period = tinfo->goal.period; | 2460 | unsigned int period = tinfo->goal.period; |
2461 | unsigned int width = tinfo->goal.width; | 2461 | unsigned int width = tinfo->goal.width; |
2462 | unsigned long flags; | 2462 | unsigned long flags; |
2463 | struct ahc_syncrate *syncrate; | 2463 | const struct ahc_syncrate *syncrate; |
2464 | 2464 | ||
2465 | if (dt && spi_max_width(starget)) { | 2465 | if (dt && spi_max_width(starget)) { |
2466 | ppr_options |= MSG_EXT_PPR_DT_REQ; | 2466 | ppr_options |= MSG_EXT_PPR_DT_REQ; |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.h b/drivers/scsi/aic7xxx/aic7xxx_osm.h index c2a9ad76d35d..3f7238db35e5 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.h +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.h | |||
@@ -398,9 +398,6 @@ struct info_str { | |||
398 | int pos; | 398 | int pos; |
399 | }; | 399 | }; |
400 | 400 | ||
401 | void ahc_format_transinfo(struct info_str *info, | ||
402 | struct ahc_transinfo *tinfo); | ||
403 | |||
404 | /******************************** Locking *************************************/ | 401 | /******************************** Locking *************************************/ |
405 | /* Lock protecting internal data structures */ | 402 | /* Lock protecting internal data structures */ |
406 | 403 | ||
diff --git a/drivers/scsi/aic7xxx/aic7xxx_proc.c b/drivers/scsi/aic7xxx/aic7xxx_proc.c index 99e5443e7535..3afa34c7c591 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_proc.c +++ b/drivers/scsi/aic7xxx/aic7xxx_proc.c | |||
@@ -137,7 +137,7 @@ copy_info(struct info_str *info, char *fmt, ...) | |||
137 | return (len); | 137 | return (len); |
138 | } | 138 | } |
139 | 139 | ||
140 | void | 140 | static void |
141 | ahc_format_transinfo(struct info_str *info, struct ahc_transinfo *tinfo) | 141 | ahc_format_transinfo(struct info_str *info, struct ahc_transinfo *tinfo) |
142 | { | 142 | { |
143 | u_int speed; | 143 | u_int speed; |